cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dense.h
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 
4 #ifndef DENSE_H_
5 #define DENSE_H_
6 
7 /* dense.h density related variables */
8 
13 double dense_fabden(double radius,
14  double depth);
15 
20 double dense_tabden(double r0,
21  double depth);
22 
23 /*dense_parametric_wind called by dlaw command, returns density for any density law */
24 double dense_parametric_wind(double rad);
25 
26 const int LIMTABDLAW = 500;
27 
29 struct t_dense
30 {
31  t_dense() {
32  /* list of atomic weights, mass in AMU, used for thermal line widths */
33  /* >>refer all atomic weight Coplen, T.B. 2001, J. Phys. Chem REf Data, 30, 701 */
34  AtomicWeight[0] = 1.00794f;
35  AtomicWeight[1] = 4.0026022f;
36  AtomicWeight[2] = 6.9412f;
37  AtomicWeight[3] = 9.0121823f;
38  AtomicWeight[4] = 10.8117f;
39  AtomicWeight[5] = 12.01078f;
40  AtomicWeight[6] = 14.00672f;
41  AtomicWeight[7] = 15.99943f;
42  AtomicWeight[8] = 18.9984032f;
43  AtomicWeight[9] = 20.17976f;
44  AtomicWeight[10] = 22.989770f;
45  AtomicWeight[11] = 24.30506f;
46  AtomicWeight[12] = 26.9815382f;
47  AtomicWeight[13] = 28.08553f;
48  AtomicWeight[14] = 30.9737612f;
49  AtomicWeight[15] = 32.0655f;
50  AtomicWeight[16] = 35.4532f;
51  AtomicWeight[17] = 39.9481f;
52  AtomicWeight[18] = 39.09831f;
53  AtomicWeight[19] = 40.0784f;
54  AtomicWeight[20] = 44.9559108f;
55  AtomicWeight[21] = 47.8671f;
56  AtomicWeight[22] = 50.94151f;
57  AtomicWeight[23] = 51.99616f;
58  AtomicWeight[24] = 54.9380499f;
59  AtomicWeight[25] = 55.8472f;
60  AtomicWeight[26] = 58.9332009f;
61  AtomicWeight[27] = 58.69342f;
62  AtomicWeight[28] = 63.5463f;
63  AtomicWeight[29] = 65.392f;
64 
65  zero();
66  }
67 
72  void SetGasPhaseDensity( const long nelem, const realnum density );
73 
76 
77 private:
81 
82 public:
83  realnum xMolecules(long nelem)
84  {
85  return m_xMolecules[nelem];
86  }
87  void updateXMolecules();
88  void zero();
89 
92 
96 
99 
102 
105 
108 
112 
119  long int IonLow[LIMELM+1];
120  long int IonHigh[LIMELM+1];
121 
125  double xIonDense[LIMELM][LIMELM+1];
126 
129 
132 
134  double maxWN[LIMELM][LIMELM+1];
135 
140 
147 
150 
155 
158  char chDenseLaw[5];
159 
160  /* this says keep initial density constant,
161  * so pressure from iter to iter not really const */
163 
164  // let initial pressure vary with time
166 
167  // required number is timescale for time variation
169  // optional number is index for time variation
171 
173  double DensityLaw[10];
174 
178 
182 
184  long int nvals;
185 
188 
190  double eden;
191 
193  double EdenMax , EdenMin;
194 
198 
200  long int nzEdenBad;
201 
204 
207 
210 
212  double SqrtEden;
213 
216  double EdenHCorr;
217 
219 
221  double EdenTrue;
222 
225 
227  bool lgEdenBad;
228 
230  double edensqte;
231 
235  double cdsqte;
236 
242 
245 
249 
255 
256 };
257 extern t_dense dense;
258 
259 // test whether nuclei conservation holds
260 bool lgElemsConserved(void);
261 
262 #include "iso.h"
263 
264 // test whether the sum of a set of states agrees with the ion population to the requested tolerance.
265 void lgStatesConserved ( long nelem, long ionStage, qList states, long numStates, realnum err_tol, long loop_ion );
266 
267 void SumDensities( void );
268 
269 void ScaleAllDensities( const realnum factor );
270 void ScaleIonDensities( const long nelem, const realnum factor );
271 bool AbundChange( );
272 
273 realnum scalingDensity(void);
275 
276 #endif /* DENSE_H_ */
realnum frad[LIMTABDLAW]
Definition: dense.h:180
void ScaleIonDensities(const long nelem, const realnum factor)
Definition: dense.cpp:70
double cdsqte
Definition: dense.h:235
realnum m_xMolecules[LIMELM]
Definition: dense.h:80
void SetGasPhaseDensity(const long nelem, const realnum density)
Definition: dense.cpp:86
bool lgCSChoose[LIMELM][LIMELM]
Definition: dense.h:177
void zero()
Definition: dense.cpp:31
double PressureVaryTimeIndex
Definition: dense.h:170
bool lgEdenBad
Definition: dense.h:227
realnum flong
Definition: dense.h:251
Definition: dense.h:29
double eden_from_metals
Definition: dense.h:224
const int LIMTABDLAW
Definition: dense.h:26
realnum HCorrFac
Definition: dense.h:111
realnum wmole
Definition: dense.h:101
long int nvals
Definition: dense.h:184
t_dense dense
Definition: dense.cpp:24
realnum EdenSet
Definition: dense.h:203
bool lgDLWDepth
Definition: dense.h:187
double maxWN[LIMELM][LIMELM+1]
Definition: dense.h:134
bool lgAsChoose[LIMELM][LIMELM]
Definition: dense.h:176
void lgStatesConserved(long nelem, long ionStage, qList states, long numStates, realnum err_tol, long loop_ion)
Definition: dense.cpp:160
double density_low_limit
Definition: dense.h:197
double xIonDense[LIMELM][LIMELM+1]
Definition: dense.h:125
double SqrtEden
Definition: dense.h:212
realnum SetIoniz[LIMELM][LIMELM+1]
Definition: dense.h:154
bool lgIonChiantiOn[LIMELM][LIMELM+1]
Definition: dense.h:128
void ScaleAllDensities(realnum factor)
Definition: dense.cpp:37
double EdenMax
Definition: dense.h:193
double EdenHCorr
Definition: dense.h:216
realnum csecnd
Definition: dense.h:253
realnum EdenHCorr_f
Definition: dense.h:218
realnum AbundanceLimit
Definition: dense.h:139
long int IonHigh[LIMELM+1]
Definition: dense.h:120
double DensityLaw[10]
Definition: dense.h:173
float realnum
Definition: cddefines.h:107
realnum xNucleiTotal
Definition: dense.h:104
realnum AtomicWeight[LIMELM]
Definition: dense.h:75
bool lgElmtOn[LIMELM]
Definition: dense.h:146
realnum den0
Definition: dense.h:241
bool AbundChange()
Definition: dense.cpp:269
realnum scalingZoneDensity(long i)
Definition: dense.cpp:385
t_radius radius
Definition: radius.cpp:5
double PressureVaryTimeTimescale
Definition: dense.h:168
realnum EdenFraction
Definition: dense.h:209
realnum gas_phase[LIMELM]
Definition: dense.h:71
realnum cfirst
Definition: dense.h:252
long int IonLow[LIMELM+1]
Definition: dense.h:119
bool lgIonStoutOn[LIMELM][LIMELM+1]
Definition: dense.h:131
bool lgDenFlucOn
Definition: dense.h:244
realnum rscale
Definition: dense.h:240
const int LIMELM
Definition: cddefines.h:262
realnum xMolecules(long nelem)
Definition: dense.h:83
char chDenseLaw[5]
Definition: dense.h:158
realnum fhden[LIMTABDLAW]
Definition: dense.h:181
realnum scalingDensity(void)
Definition: dense.cpp:378
realnum DensityPower
Definition: dense.h:239
realnum flcPhase
Definition: dense.h:254
double EdenMin
Definition: dense.h:193
double eden
Definition: dense.h:190
double EdenTrue
Definition: dense.h:221
realnum xMassDensity0
Definition: dense.h:95
double dense_fabden(double radius, double depth)
Definition: dense_fabden.cpp:9
double dense_tabden(double r0, double depth)
Definition: dense_tabden.cpp:7
double dense_parametric_wind(double rad)
realnum xMassTotal
Definition: dense.h:107
t_dense()
Definition: dense.h:31
void SumDensities(void)
Definition: dense.cpp:200
long int nzEdenBad
Definition: dense.h:200
bool lgElemsConserved(void)
Definition: dense.cpp:99
void updateXMolecules()
Definition: dense.cpp:26
realnum EdenExtra
Definition: dense.h:206
realnum xMassDensity
Definition: dense.h:91
bool lgPressureVaryTime
Definition: dense.h:165
bool lgDenFlucRadius
Definition: dense.h:248
bool lgDenseInitConstant
Definition: dense.h:162
bool lgSetIoniz[LIMELM]
Definition: dense.h:149
realnum pden
Definition: dense.h:98
double edensqte
Definition: dense.h:230