cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rt_line_driving.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*RT_line_driving derive radiative acceleration due to line absorption of incident continuum,
4  * return value is line radiative acceleration */
5 #include "cddefines.h"
6 #include "physconst.h"
7 #include "iso.h"
8 #include "dense.h"
9 #include "taulines.h"
10 #include "h2.h"
11 #include "atomfeii.h"
12 #include "rt.h"
13 
14 /*RT_line_driving derive radiative acceleration due to line absorption of incident continuum,
15  * return value is line radiative acceleration */
16 double RT_line_driving(void)
17 {
18  long int i,
19  ipHi,
20  nelem,
21  ipLo,
22  ipISO;
23 
24  double AllHeavy,
25  AllRest,
26  OneLine,
27  fe2drive,
28  forlin_v,
29  h2drive,
30  accel_iso[NISO];
31 
32  /* following used for debugging */
33  /* double
34  RestMax,
35  HeavMax,
36  hydromax;
37  long int
38  ipRestMax,
39  ihmax; */
40 
41  DEBUG_ENTRY( "RT_line_driving()" );
42 
43  /* this function finds the total rate the gas absorbs energy
44  * this result is divided by the calling routine to find the
45  * momentum absorbed by the gas, and eventually the radiative acceleration
46  *
47  * the energy absorbed by the line is
48  * Abundance * energy * A *(g_up/g_lo) * occnum * escape prob
49  * where occnum is the photon occupation number, and the g's are
50  * the ratios of statistical weights */
51 
52  /* total energy absorbed in this zone, per cubic cm
53  * do hydrogen first */
54 
55  for( ipISO=ipH_LIKE; ipISO<NISO; ++ipISO )
56  {
57  accel_iso[ipISO] = 0;
58  for( nelem=ipISO; nelem < LIMELM; nelem++ )
59  {
60  if( (dense.IonHigh[nelem] >= nelem + 1-ipISO) )
61  {
62  for( ipHi=1; ipHi < iso.numLevels_local[ipISO][nelem]; ipHi++ )
63  {
64  /* do not put in highest level since its not real */
65  for( ipLo=0; ipLo < ipHi - 1; ipLo++ )
66  {
67  /* do not include bogus lines */
68  if( Transitions[ipISO][nelem][ipHi][ipLo].ipCont > 0 )
69  {
70  OneLine = Transitions[ipISO][nelem][ipHi][ipLo].Emis->pump*
71  Transitions[ipISO][nelem][ipHi][ipLo].EnergyErg*
72  Transitions[ipISO][nelem][ipHi][ipLo].Emis->PopOpc*
73  dense.xIonDense[nelem][nelem+1-ipISO];
74 
75  accel_iso[ipISO] += OneLine;
76  }
77  }
78 
79  /* do not include bogus lines */
80  if( SatelliteLines[ipISO][nelem][ipHi].ipCont > 0 )
81  {
82  OneLine = SatelliteLines[ipISO][nelem][ipHi].Emis->pump*
83  SatelliteLines[ipISO][nelem][ipHi].EnergyErg*
84  SatelliteLines[ipISO][nelem][ipHi].Emis->PopOpc*
85  dense.xIonDense[nelem][nelem+1-ipISO];
86 
87  accel_iso[ipISO] += OneLine;
88  }
89 
90  }
91  }
92  }
93  accel_iso[ipISO] *= EN1RYD;
94  }
95 
96  /* all heavy element lines in calculation of cooling
97  * these are the level 1 lines */
98  AllHeavy = 0.;
99  for( i=1; i <= nLevel1; i++ )
100  {
101  OneLine =
102  TauLines[i].Emis->pump*
103  TauLines[i].EnergyErg*
104  TauLines[i].Emis->PopOpc;
105  AllHeavy += OneLine;
106  }
107 
108  /* all heavy element lines treated with g-bar
109  * these are the level 2 lines, f should be ok */
110  AllRest = 0.;
111  for( i=0; i < nWindLine; i++ )
112  {
113  OneLine =
114  TauLine2[i].Emis->pump*
115  TauLine2[i].EnergyErg*
116  TauLine2[i].Emis->PopOpc;
117  AllRest += OneLine;
118  }
119  for( i=0; i < nUTA; i++ )
120  {
121  if( UTALines[i].Emis->Aul > 0. )
122  {
123  OneLine =
124  UTALines[i].Emis->pump*
125  UTALines[i].EnergyErg*
126  UTALines[i].Emis->PopOpc;
127  AllRest += OneLine;
128  }
129  }
130  for( i=0; i < nHFLines; i++ )
131  {
132  OneLine =
133  HFLines[i].Emis->pump*
134  HFLines[i].EnergyErg*
135  HFLines[i].Emis->PopOpc;
136  AllRest += OneLine;
137  }
138  for( i=0; i < linesAdded2; i++)
139  {
140  OneLine =
141  atmolEmis[i].pump*
143  atmolEmis[i].PopOpc;
144  AllRest += OneLine;
145  }
146  for( i=0; i < nCORotate; i++ )
147  {
148  OneLine =
149  C12O16Rotate[i].Emis->pump*
152  AllRest += OneLine;
153  OneLine =
154  C13O16Rotate[i].Emis->pump*
157  AllRest += OneLine;
158  }
159 
160  /* the H2 molecule */
161  h2drive = H2_Accel();
162 
163  /* The large model FeII atom */
164  fe2drive = 0.;
165  FeIIAccel(&fe2drive);
166 
167  forlin_v = AllHeavy + accel_iso[ipH_LIKE] + accel_iso[ipHE_LIKE] +
168  fe2drive + h2drive + AllRest;
169 
170  /*fprintf(ioQQQ," wind te %e %e %e %e %e\n",
171  AllHeavy , HydroAccel , fe2drive , he1l , AllRest );*/
172  return( forlin_v );
173 }

Generated for cloudy by doxygen 1.8.4