cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rt_line_one_tau_reset.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2013 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*RT_line_one_tau_reset computes average of old and new optical depths for new scale at end of iter,
4  * called by update, also FeIILevelPops */
5 #include "cddefines.h"
6 #include "opacity.h"
7 #include "geometry.h"
8 #include "transition.h"
9 #include "prt.h"
10 #include "rt.h"
11 
13 {
14  char chSave[11];
15 
16  DEBUG_ENTRY( "RT_line_one_tau_reset()" );
17 
18  if( t.ipCont() <= 0 )
19  {
20  return;
21  }
22 
23  /* option to print masing lines, set with print maser */
24  if( prt.lgPrtMaser &&
25  ( t.Emis().TauTot() < -0.01 || t.Emis().TauIn() < -0.01 ) )
26  {
27  strcpy( chSave, chLineLbl(t) );
28  fprintf( ioQQQ, " Masing line:%10.10s t(in, out)=%10.2e%10.2e\n",
29  chSave, t.Emis().TauIn(), t.Emis().TauTot() );
30  }
31 
32  realnum TauNext;
33 
34  /* lgStatic is false by default, set true with command sphere SPHERE STATIC */
36  {
37  /* static sphere, both sides interact */
38  TauNext = 2.f*t.Emis().TauIn();
39  }
40  else
41  {
42  /* end of iteration, the next estimate of total optical depth
43  * is now the inward optical depth - set T(ipLnTauTot) to T(1)
44  * DoubleTau normally 1, set to 2 by DoubleTau command in order
45  * to simulate two-sided photoionization */
46  TauNext = rt.DoubleTau*t.Emis().TauIn();
47  }
48 
49  /* iteration is 1 when this routine is called at end of first iteration
50  * estimate is bad when starting first iteration, so don't track that one */
51  if( iteration > 1 )
52  TauNext = t.Emis().TauTrack().next_val( t.Emis().TauTot(), TauNext );
53 
55  t.Emis().TauIn() = TauNext/2.f;
56  else
57  t.Emis().TauIn() = min(opac.taumin,TauNext/2.f);
58 
59  t.Emis().TauTot() = TauNext;
60 
61  /* this is escape prob */
62  t.Emis().Pesc() = 0.5f*(1.f + 1.f/MAX2(1.f,t.Emis().TauTot()));
63 
64  /* this is fraction inward */
65  t.Emis().FracInwd() = MIN2(1.f,1.5f-t.Emis().Pesc());
66 
67  /* destruction probability */
68  t.Emis().Pdest() = 0.;
69  t.Emis().Pelec_esc() = 0.;
70 
71  /* optical depth to the continuum source */
72  t.Emis().TauCon() = opac.taumin;
73 
74  /* >>chng 01 sep 01, zero out some pops and energies */
75  (*t.Lo()).Pop() = 0.;
76  /* >>chng 97 jul 21, added following zero
77  * population of upper level */
78  (*t.Hi()).Pop() = 0.;
79  /* population of lower level with correction for stim emission */
80  t.Emis().PopOpc() = 0.;
81  /* following two heat exchange excitation, deexcitation */
82  t.Coll().cool() = 0.;
83  t.Coll().heat() = 0.;
84  /* intensity of line */
85  t.Emis().xIntensity() = 0.;
86  /* number of photons emitted in line */
87  t.Emis().phots() = 0.;
88  return;
89 }
#define MIN2
Definition: cddefines.h:765
realnum & Pelec_esc() const
Definition: emission.h:533
t_opac opac
Definition: opacity.cpp:5
bool lgPrtMaser
Definition: prt.h:127
char * chLineLbl(const TransitionProxy &t)
Definition: transition.cpp:237
#define MAX2
Definition: cddefines.h:786
realnum & TauTot() const
Definition: emission.h:433
FILE * ioQQQ
Definition: cddefines.cpp:7
double & phots() const
Definition: emission.h:503
bool lgSphere
Definition: geometry.h:24
long int iteration
Definition: cddefines.cpp:16
t_geometry geometry
Definition: geometry.cpp:5
iter_track_basic< realnum > & TauTrack() const
Definition: emission.h:443
double & heat() const
Definition: collision.h:194
double & xIntensity() const
Definition: emission.h:483
EmissionList::reference Emis() const
Definition: transition.h:408
long & ipCont() const
Definition: transition.h:450
float realnum
Definition: cddefines.h:107
realnum & Pesc() const
Definition: emission.h:523
bool lgStatic
Definition: geometry.h:54
qList::iterator Hi() const
Definition: transition.h:396
long min(int a, long b)
Definition: cddefines.h:727
t_prt prt
Definition: prt.cpp:10
realnum & Pdest() const
Definition: emission.h:543
qList::iterator Lo() const
Definition: transition.h:392
realnum & TauCon() const
Definition: emission.h:453
CollisionProxy Coll() const
Definition: transition.h:424
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:688
double & cool() const
Definition: collision.h:190
double & PopOpc() const
Definition: emission.h:603
realnum DoubleTau
Definition: rt.h:247
realnum & FracInwd() const
Definition: emission.h:463
void RT_line_one_tau_reset(const TransitionProxy &t)
realnum & TauIn() const
Definition: emission.h:423
realnum taumin
Definition: opacity.h:154
t_rt rt
Definition: rt.cpp:5