cloudy trunk
Loading...
Searching...
No Matches
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
13double dense_fabden(double radius,
14 double depth);
15
20double dense_tabden(double r0,
21 double depth);
22
23/*dense_parametric_wind called by dlaw command, returns density for any density law */
24double dense_parametric_wind(double rad);
25
26const int LIMTABDLAW = 500;
27
29struct t_dense
30{
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
77private:
81
82public:
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
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
228
230 double edensqte;
231
235 double cdsqte;
236
242
245
249
255
256};
257extern t_dense dense;
258
259// test whether nuclei conservation holds
260bool 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.
265void lgStatesConserved ( long nelem, long ionStage, qList states, long numStates, realnum err_tol, long loop_ion );
266
267void SumDensities( void );
268
269void ScaleAllDensities( const realnum factor );
270void ScaleIonDensities( const long nelem, const realnum factor );
271bool AbundChange( );
272
275
276#endif /* DENSE_H_ */
const int LIMELM
Definition cddefines.h:258
float realnum
Definition cddefines.h:103
t_dense dense
Definition dense.cpp:24
double dense_tabden(double r0, double depth)
double dense_fabden(double radius, double depth)
bool lgElemsConserved(void)
Definition dense.cpp:99
void ScaleAllDensities(const realnum factor)
Definition dense.cpp:37
void SumDensities(void)
Definition dense.cpp:200
realnum scalingDensity(void)
Definition dense.cpp:378
void ScaleIonDensities(const long nelem, const realnum factor)
Definition dense.cpp:70
bool AbundChange()
Definition dense.cpp:269
void lgStatesConserved(long nelem, long ionStage, qList states, long numStates, realnum err_tol, long loop_ion)
Definition dense.cpp:160
const int LIMTABDLAW
Definition dense.h:26
realnum scalingZoneDensity(long i)
Definition dense.cpp:385
double dense_parametric_wind(double rad)
t_radius radius
Definition radius.cpp:5
realnum xNucleiTotal
Definition dense.h:104
realnum DensityPower
Definition dense.h:239
double eden_from_metals
Definition dense.h:224
realnum HCorrFac
Definition dense.h:111
realnum pden
Definition dense.h:98
void zero()
Definition dense.cpp:31
double PressureVaryTimeTimescale
Definition dense.h:168
double EdenMin
Definition dense.h:193
bool lgDLWDepth
Definition dense.h:187
double density_low_limit
Definition dense.h:197
double eden
Definition dense.h:190
bool lgElmtOn[LIMELM]
Definition dense.h:146
realnum SetIoniz[LIMELM][LIMELM+1]
Definition dense.h:154
bool lgDenFlucOn
Definition dense.h:244
double SqrtEden
Definition dense.h:212
char chDenseLaw[5]
Definition dense.h:158
bool lgSetIoniz[LIMELM]
Definition dense.h:149
double cdsqte
Definition dense.h:235
long int IonLow[LIMELM+1]
Definition dense.h:119
long int IonHigh[LIMELM+1]
Definition dense.h:120
long int nvals
Definition dense.h:184
realnum EdenSet
Definition dense.h:203
realnum flong
Definition dense.h:251
double PressureVaryTimeIndex
Definition dense.h:170
void updateXMolecules()
Definition dense.cpp:26
double EdenHCorr
Definition dense.h:216
realnum xMolecules(long nelem)
Definition dense.h:83
realnum flcPhase
Definition dense.h:254
double DensityLaw[10]
Definition dense.h:173
long int nzEdenBad
Definition dense.h:200
realnum EdenHCorr_f
Definition dense.h:218
bool lgDenseInitConstant
Definition dense.h:162
bool lgAsChoose[LIMELM][LIMELM]
Definition dense.h:176
double xIonDense[LIMELM][LIMELM+1]
Definition dense.h:125
realnum rscale
Definition dense.h:240
bool lgEdenBad
Definition dense.h:227
double edensqte
Definition dense.h:230
realnum xMassTotal
Definition dense.h:107
double maxWN[LIMELM][LIMELM+1]
Definition dense.h:134
t_dense()
Definition dense.h:31
realnum m_xMolecules[LIMELM]
Definition dense.h:80
bool lgIonStoutOn[LIMELM][LIMELM+1]
Definition dense.h:131
realnum xMassDensity0
Definition dense.h:95
realnum frad[LIMTABDLAW]
Definition dense.h:180
realnum fhden[LIMTABDLAW]
Definition dense.h:181
realnum gas_phase[LIMELM]
Definition dense.h:71
double EdenTrue
Definition dense.h:221
realnum AtomicWeight[LIMELM]
Definition dense.h:75
realnum csecnd
Definition dense.h:253
realnum xMassDensity
Definition dense.h:91
realnum EdenExtra
Definition dense.h:206
void SetGasPhaseDensity(const long nelem, const realnum density)
Definition dense.cpp:86
bool lgCSChoose[LIMELM][LIMELM]
Definition dense.h:177
bool lgIonChiantiOn[LIMELM][LIMELM+1]
Definition dense.h:128
double EdenMax
Definition dense.h:193
bool lgDenFlucRadius
Definition dense.h:248
realnum wmole
Definition dense.h:101
bool lgPressureVaryTime
Definition dense.h:165
realnum den0
Definition dense.h:241
realnum EdenFraction
Definition dense.h:209
realnum AbundanceLimit
Definition dense.h:139
realnum cfirst
Definition dense.h:252