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-2022 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 
9 #include "global.h"
10 #include "module.h"
11 #include "depth_table.h"
12 
13 class molezone;
14 
19 double dense_fabden(double radius,
20  double depth);
21 
22 /*dense_parametric_wind called by dlaw command, returns density for any density law */
23 double dense_parametric_wind(double rad);
24 
26 class t_dense : public module
27 {
28 public:
29  t_dense() {
30  /* list of atomic weights, mass in AMU, used for thermal line widths */
31  /* >>refer all atomic weight Coplen, T.B. 2001, J. Phys. Chem REf Data, 30, 701 */
32  AtomicWeight[0] = 1.00794f;
33  AtomicWeight[1] = 4.0026022f;
34  AtomicWeight[2] = 6.9412f;
35  AtomicWeight[3] = 9.0121823f;
36  AtomicWeight[4] = 10.8117f;
37  AtomicWeight[5] = 12.01078f;
38  AtomicWeight[6] = 14.00672f;
39  AtomicWeight[7] = 15.99943f;
40  AtomicWeight[8] = 18.9984032f;
41  AtomicWeight[9] = 20.17976f;
42  AtomicWeight[10] = 22.989770f;
43  AtomicWeight[11] = 24.30506f;
44  AtomicWeight[12] = 26.9815382f;
45  AtomicWeight[13] = 28.08553f;
46  AtomicWeight[14] = 30.9737612f;
47  AtomicWeight[15] = 32.0655f;
48  AtomicWeight[16] = 35.4532f;
49  AtomicWeight[17] = 39.9481f;
50  AtomicWeight[18] = 39.09831f;
51  AtomicWeight[19] = 40.0784f;
52  AtomicWeight[20] = 44.9559108f;
53  AtomicWeight[21] = 47.8671f;
54  AtomicWeight[22] = 50.94151f;
55  AtomicWeight[23] = 51.99616f;
56  AtomicWeight[24] = 54.9380499f;
57  AtomicWeight[25] = 55.8472f;
58  AtomicWeight[26] = 58.9332009f;
59  AtomicWeight[27] = 58.69342f;
60  AtomicWeight[28] = 63.5463f;
61  AtomicWeight[29] = 65.392f;
62 
63  for (long nelem=0; nelem<LIMELM; ++nelem)
64  {
65  for (long ion=0; ion<LIMELM+1; ++ion)
66  {
67  ionMole[nelem][ion] = NULL;
68  }
69  }
70  zero();
71  }
72 
77  void SetGasPhaseDensity( const long nelem, const realnum density );
78 
81 
82 private:
86 
87 public:
88  realnum xMolecules(long nelem)
89  {
90  return m_xMolecules[nelem];
91  }
92  void updateXMolecules();
93  void zero();
94  void comment(t_warnings&) {}
95  const char* chName() const
96  {
97  return "dense";
98  }
99 
102 
106 
109 
112 
115 
118 
122 
129  long int IonLow[LIMELM+1];
130  long int IonHigh[LIMELM+1];
131 
135  double xIonDense[LIMELM][LIMELM+1];
136 
138 
141 
144 
146  double maxWN[LIMELM][LIMELM+1];
147 
152 
165 
168 
173 
176  char chDenseLaw[5];
177 
178  /* this says keep initial density constant,
179  * so pressure from iter to iter not really const */
181 
182  // let initial pressure vary with time
184 
185  // required number is timescale for time variation
187  // optional number is index for time variation
189 
191  double DensityLaw[10];
192 
196 
199 
201  double eden;
202 
204  double EdenMax , EdenMin;
205 
209 
211  long int nzEdenBad;
212 
215 
218 
221 
223  double SqrtEden;
224 
227  double EdenHCorr;
228 
230 
232  double EdenTrue;
233 
236 
238  bool lgEdenBad;
239 
241  double edensqte;
242 
246  double cdsqte;
247 
253 
256 
260 
266 
267 };
268 extern t_dense dense;
269 
270 // test whether nuclei conservation holds
271 bool lgElemsConserved();
272 
273 class qList;
274 
275 // test whether the sum of a set of states agrees with the ion population to the requested tolerance.
276 void lgStatesConserved ( long nelem, long ionStage, qList states, long numStates, realnum err_tol, long loop_ion );
277 
278 void SumDensities();
279 
280 void ScaleAllDensities( const realnum factor );
281 void ScaleIonDensities( const long nelem, const realnum factor );
282 bool AbundChange();
283 
286 
287 #endif /* DENSE_H_ */
bool lgAsChoose[LIMELM][LIMELM]
Definition: dense.h:194
void ScaleIonDensities(const long nelem, const realnum factor)
Definition: dense.cpp:90
realnum den0
Definition: dense.h:252
realnum EdenFraction
Definition: dense.h:220
long int nzEdenBad
Definition: dense.h:211
void SetGasPhaseDensity(const long nelem, const realnum density)
Definition: dense.cpp:106
realnum xMolecules(long nelem)
Definition: dense.h:88
realnum DensityPower
Definition: dense.h:250
double EdenMax
Definition: dense.h:204
realnum flcPhase
Definition: dense.h:265
realnum csecnd
Definition: dense.h:264
double EdenHCorr
Definition: dense.h:227
realnum SetIoniz[LIMELM][LIMELM+1]
Definition: dense.h:172
realnum xNucleiTotal
Definition: dense.h:114
long int IonHigh[LIMELM+1]
Definition: dense.h:130
double cdsqte
Definition: dense.h:246
realnum HCorrFac
Definition: dense.h:121
bool lgDenFlucRadius
Definition: dense.h:259
void comment(t_warnings &)
Definition: dense.h:94
void updateXMolecules()
Definition: dense.cpp:24
bool lgElmtSetOff[LIMELM]
Definition: dense.h:164
molezone * ionMole[LIMELM][LIMELM+1]
Definition: dense.h:137
bool lgSetIoniz[LIMELM]
Definition: dense.h:167
Definition: mole.h:378
double EdenMin
Definition: dense.h:204
Definition: dense.h:26
void lgStatesConserved(long nelem, long ionStage, qList states, long numStates, realnum err_tol, long loop_ion)
Definition: dense.cpp:195
t_dense dense
Definition: global.cpp:15
realnum xMassDensity0
Definition: dense.h:105
bool lgIonStoutOn[LIMELM][LIMELM+1]
Definition: dense.h:143
double edensqte
Definition: dense.h:241
double xIonDense[LIMELM][LIMELM+1]
Definition: dense.h:135
t_dense()
Definition: dense.h:29
bool lgIonChiantiOn[LIMELM][LIMELM+1]
Definition: dense.h:140
void ScaleAllDensities(realnum factor)
Definition: dense.cpp:56
long int IonLow[LIMELM+1]
Definition: dense.h:129
realnum pden
Definition: dense.h:108
bool lgCSChoose[LIMELM][LIMELM]
Definition: dense.h:195
bool lgPressureVaryTime
Definition: dense.h:183
double PressureVaryTimeIndex
Definition: dense.h:188
const char * chName() const
Definition: dense.h:95
double EdenTrue
Definition: dense.h:232
float realnum
Definition: cddefines.h:124
realnum m_xMolecules[LIMELM]
Definition: dense.h:85
realnum flong
Definition: dense.h:262
DepthTable DLW
Definition: dense.h:198
bool AbundChange()
Definition: dense.cpp:300
realnum scalingZoneDensity(long i)
Definition: dense.cpp:416
t_radius radius
Definition: radius.cpp:5
bool lgElmtOn[LIMELM]
Definition: dense.h:160
realnum gas_phase[LIMELM]
Definition: dense.h:76
realnum AbundanceLimit
Definition: dense.h:151
realnum rscale
Definition: dense.h:251
realnum wmole
Definition: dense.h:111
realnum AtomicWeight[LIMELM]
Definition: dense.h:80
char chDenseLaw[5]
Definition: dense.h:176
double PressureVaryTimeTimescale
Definition: dense.h:186
double density(const genericState &gs)
const int LIMELM
Definition: cddefines.h:308
realnum scalingDensity(void)
Definition: dense.cpp:409
realnum xMassDensity
Definition: dense.h:101
realnum EdenHCorr_f
Definition: dense.h:229
bool lgDenseInitConstant
Definition: dense.h:180
double eden
Definition: dense.h:201
realnum xMassTotal
Definition: dense.h:117
bool lgEdenBad
Definition: dense.h:238
double dense_fabden(double radius, double depth)
bool lgDenFlucOn
Definition: dense.h:255
double maxWN[LIMELM][LIMELM+1]
Definition: dense.h:146
void zero()
Definition: dense.cpp:29
double dense_parametric_wind(double rad)
double SqrtEden
Definition: dense.h:223
double DensityLaw[10]
Definition: dense.h:191
void SumDensities(void)
Definition: dense.cpp:235
realnum EdenSet
Definition: dense.h:214
bool lgElemsConserved(void)
Definition: dense.cpp:119
double eden_from_metals
Definition: dense.h:235
realnum cfirst
Definition: dense.h:263
Definition: module.h:26
realnum EdenExtra
Definition: dense.h:217
double density_low_limit
Definition: dense.h:208