root/branches/newmole/source/atoms.h

Revision 2440, 7.0 kB (checked in by rjrw, 2 months ago)

Merged from trunk r2405:2439.

  • Property svn:eol-style set to native
Line 
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
4#ifndef _ATOMS_H_
5#define _ATOMS_H_
6
7 /**
8  AtomSeqBeryllium compute level populations and emissivity for Be-sequence ions
9  \param cs12
10  \param cs13
11  \param cs23
12  \param t
13  \param a30
14 */ 
15void AtomSeqBeryllium(double cs12,
16  double cs13,
17  double cs23,
18  transition * t,
19  double a30);
20
21 /**
22 AtomSeqBoron compute cooling from 5-level boron sequence model atom
23  \param  t21
24  \param  t31
25  \param  t41
26  \param  t32
27  \param  t42
28  \param  t52
29  \param  cs51
30  \param  cs43
31  \param  cs53
32  \param  cd54
33  \param  pump_rate pump rate due to UV permitted lines
34  \param chLabel string used to identify calling program in case of error
35
36 */ 
37void AtomSeqBoron(
38  transition * t21,
39  transition * t31,
40  transition * t41,
41  transition * t32,
42  transition * t42,
43  transition * t52,
44  double cs51,
45  double cs43,
46  double cs53,
47  double cd54,
48  double pump_rate ,
49  const char *chLabel
50);
51
52/**atom_level2 do level population and cooling for two level atom
53 \param t
54*/
55void atom_level2(transition * t );
56
57 /**
58  atom_level3 compute three level atom, 10, 21, and 20 are line
59  \param t10
60  \param t21
61  \param t20
62 */ 
63void atom_level3(transition * t10,
64  transition * t21,
65  transition * t20);
66
67 /**
68  atom_pop2 do level population for simple two level atom, no radiative transfer
69  \param  omega
70  \param  g1
71  \param  g2
72  \param  a21
73  \param  bltz
74  \param  abund
75 */ 
76double atom_pop2(double omega,
77  double g1,
78  double g2,
79  double a21,
80  double bltz,
81  double abund);
82
83/**
84atom_pop3 return value is population for 3-level atom, cm^-3
85\param  g1 statictical weights of level 1
86\param  g2 statictical weights of level 2
87\param  g3 statictical weights of level 3
88\param  o12 collision strengths between three levels
89\param  o13 collision strengths between three levels
90\param  o23 collision strengths between three levels
91\param  a21 transition probabilities between three levels
92\param  a31 transition probabilities between three levels
93\param  a32 transition probabilities between three levels
94\param  Tex12 excitation energy in Kelvin
95\param  Tex23 excitation energy in Kelvin
96\param  *pop2 returned population of level 2, cm^-3
97\param  abund incoming total abundance of ion
98\param  gam2 possible photodestruction of level 2, normally 0
99\param  r12 excitation rates (s-1) due to "other" processes
100\param  r13 excitation rates (s-1) due to "other" processes
101 */ 
102double atom_pop3(
103        double g1, double g2, double g3,
104        double o12, double o13, double o23,
105        double a21, double a31, double a32,
106        double Tex12, double Tex23,
107        realnum *pop2,
108        double abund,
109        double gam2,
110        double r12,
111        double r13 );
112
113 /**
114  atom_pop5 do populations and cooling for five level atom
115  \param  g[]
116  \param  ex[]
117  \param  cs12
118  \param  cs13
119  \param  cs14
120  \param  cs15
121  \param  cs23
122  \param  cs24
123  \param  cs25
124  \param  cs34
125  \param  cs35
126  \param  cs45
127  \param  a21
128  \param  a31
129  \param  a41
130  \param  a51
131  \param  a32
132  \param  a42
133  \param  a52
134  \param  a43
135  \param  a53
136  \param  a54
137  \param  p[]
138  \param  abund
139 */ 
140void atom_pop5(double g[],
141  double ex[],
142  double cs12,
143  double cs13,
144  double cs14,
145  double cs15,
146  double cs23,
147  double cs24,
148  double cs25,
149  double cs34,
150  double cs35,
151  double cs45,
152  double a21,
153  double a31,
154  double a41,
155  double a51,
156  double a32,
157  double a42,
158  double a52,
159  double a43,
160  double a53,
161  double a54,
162  double p[],
163  realnum abund);
164
165/**
166atom_levelN - compute populations of arbitrary n-level atom
167\param nlev nlev is the number of levels to compute
168\param abund ABUND is total abundance of species, used for nth equation
169\param g[] G(ndim) is stat weight of levels
170\param ex[] EX(ndim) is excitation potential of levels, either wn or deg K 0 for first one, NOT d(ENER), but energy rel to ground
171\param chExUnits this is 'K' for above ex[] as Kelvin deg, is 'w' for wavenumbers
172\param pops[] populations of each level as deduced here
173\param depart[] departure coefficient derived here
174\param AulEscp net transition rate, A * esc prob, s-1
175\param col_str col str rom up to low
176\param AulDest AulDest(ilo,ihi) is destruction rate, from up to low, A * dest prob, [s-1], asserts confirm that ihi,lo is zero
177\param AulPump AulPump(lo, hi) is pumping rate, A * occ num, (hi,lo) must be zero, [s-1] 
178\param CollRate collision rates, evaluated here and returned for cooling by calling function, unless following flag is true. 
179        If true then calling function has already filled in these rates.  CollRate[i][j] is rate from i to j
180\param create this is an additional creation rate, normally zero, units cm-3 s-1
181\param destroy[] this is an additional destruction rate to continuum, normally zero, units s-1
182\param lgCollRateDone flag saying whether CollRate already done, or we need to do it here
183\param cooltl total cooling, set here but nothing done with it
184\param coolder derivative of cooling, set here but nothing done with it
185\param chLabel string used to identify calling program in case of error
186\param lgNegPop lgNegPop flag indicating what we have done positive if negative populations occurred zero if normal calculation done negative if too cold (for some atoms other routine will be called in this case)
187\param lgZeroPop true if populations are zero, either due to zero abundance of very low temperature
188\param lgDeBug option to print matrices for debugging
189\post atoms.PopLevels[n], atoms.DepLTELevels[n] are set lines added to ots array
190*/ 
191void atom_levelN(
192        long int nlev,
193        realnum abund,
194        const double g[],
195        const double ex[],
196        char chExUnits,
197        double pops[],
198        double depart[],
199        double ***AulEscp,
200        double ***col_str,
201        double ***AulDest,
202        double ***AulPump,
203        double ***CollRate,
204        const double create[] ,
205        const double destroy[] ,
206        bool lgCollRateDone,
207        double *cooltl,
208        double *coolder,
209        const char *chLabel,
210        int *nNegPop,
211        bool *lgZeroPop ,
212        bool lgDeBug);
213
214/**atom_oi drive the solution of OI level populations, Ly-beta pumping
215\param coloi
216*/
217void atom_oi_calc(double *coloi);
218
219/** number of levels in OI atom */
220const int N_OI_LEVELS = 6;
221const long LIMLEVELN = 20L;
222
223EXTERN struct t_atoms {
224
225        /** photo excitation of excited state of NI */
226        realnum p2nit,
227                d5200r;
228
229        /** collisional rates */
230        double c12,
231                c13;
232
233        /** array indices for level energies for OI bowen problem,
234         * used to generate Boltzmann factors */
235        long int ipoiex[5];
236
237        /** number of negative OI level populations in current calculation */
238        long int nNegOI;
239
240        /** populations from OI fluorescense problem */
241        realnum popoi[N_OI_LEVELS];
242
243        realnum pmpo51,
244                pmpo15;
245
246        /** excited state of Mg+ */
247        realnum xMg2Max,
248                /** its population */
249                popmg2;
250
251        /**
252         * this stores most recently evaluated level populations
253         * resulting from the leven family of routines
254         * PopLevels is population (cm^-3) of the levels
255         * DepLevels is lte departure coef
256         */
257        double PopLevels[LIMLEVELN+1],
258          DepLTELevels[LIMLEVELN+1];
259
260        }       atoms;
261
262#endif /* _ATOMS_H_ */
Note: See TracBrowser for help on using the browser.