cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
grainvar.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 GRAINVAR_H_
5 #define GRAINVAR_H_
6 
7 /* grainvar.h */
8 
9 #include "container_classes.h"
10 
13 const bool ENABLE_QUANTUM_HEATING=false;
14 
16 const int NDEMS = 200;
17 
19 const double GRAIN_TMIN = 1.e-3;
20 const double GRAIN_TMID = 5.e3;
21 const double GRAIN_TMAX = 1.2e9;
22 
24 const int NCHS = 50;
27 const int NCHU = NCHS/5;
29 const int NCHRG_DEFAULT= 2;
30 
34 const int NQGRID = 10000;
35 
37 const double CONSERV_TOL = 1.e-3;
38 
40 typedef enum {
44 } df_type;
45 
47 typedef enum {
55 } enth_type;
56 
58 typedef enum {
61 } zmin_type;
62 
64 typedef enum {
67 } pot_type;
68 
70 typedef enum {
73 } ial_type;
74 
76 typedef enum {
79 } pe_type;
80 
82 typedef enum {
85 } strg_type;
86 
88 typedef enum {
97 } H2_type;
98 
102 typedef enum {
115 } mat_type;
116 
117 struct GrainPar {
118  double dep;
121  lgGreyGrain,
123 };
124 
126 {
127  void p_clear0();
128  void p_clear1();
129 
130 public:
132  {
133  p_clear1();
134  }
136  {
137  p_clear0();
138  }
139  void clear()
140  {
141  p_clear0();
142  p_clear1();
143  }
144 
145  long nelem;
146  long ns;
147  double ionPot;
148  long ipLo;
151  long nData;
152  vector<double> AvNr;
153  vector<double> Ener;
154  vector< flex_arr<realnum> > y01A;
155 };
156 
161 class AEInfo
162 {
163  void p_clear0();
164  void p_clear1();
165 
166 public:
168  {
169  p_clear1();
170  }
172  {
173  p_clear0();
174  }
175  void clear()
176  {
177  p_clear0();
178  p_clear1();
179  }
180 
181  unsigned int nSubShell;
182  vector<unsigned int> nData;
183  vector<double> IonThres;
184  vector< vector<double> > AvNumber;
186  vector< vector<double> > Energy;
187 };
188 
204 {
205  void p_clear0();
206  void p_clear1();
207 
208 public:
210  {
211  p_clear1();
212  }
214  {
215  p_clear0();
216  }
217  void clear()
218  {
219  p_clear0();
220  p_clear1();
221  }
222 
224  long DustZ,
225  ipThresInf,
226  ipThresInfVal,
227  nfill;
228  double FracPop,
229  Emin,
230  EminInc,
231  PotSurf,
232  PotSurfInc,
233  ThresInf,
234  ThresInfInc,
235  ThresInfVal,
236  ThresSurf,
237  ThresSurfInc,
238  ThresSurfVal,
239  ThermRate;
247  double eta[LIMELM+2],
248  xi[LIMELM+2];
250  double RSum1;
251  double RSum2;
252  double ESum1a;
253  double ESum1b;
254  double ESum2;
258  double hcon1;
259  double hots1;
260  double bolflux1;
261  double pe1;
269  double BolFlux,
270  GrainHeat,
271  GrainHeatColl,
273  GasHeatTherm,
275  ChemEnIon,
276  ChemEnH2;
279  double HeatingRate2;
280 };
281 
296 class GrainBin
297 {
298  void p_clear0();
299  void p_clear1();
300 
301 public:
303  {
304  p_clear1();
305  }
307  {
308  p_clear0();
309  }
310  void clear()
311  {
312  p_clear0();
313  p_clear1();
314  }
315 
319  bool lgIterStart;
322  char chDstLab[13];
323  double eec;
324  double eyc;
325  realnum dustp[5],
327  AvRadius,
328  AvArea,
329  AvVol,
330  IntRadius,
331  IntArea,
332  IntVol,
333  elmAbund[LIMELM],
334  atomWeight,
335  Tsublimat,
336  DustWorkFcn,
337  BandGap,
338  ThermEff,
339  avDGRatio;
351  dstAbund,
352  GrnDpth;
354  double cnv_H_pGR,
355  cnv_H_pCM3,
356  cnv_CM3_pGR,
357  cnv_CM3_pH,
358  cnv_GR_pH,
359  cnv_GR_pCM3;
362  double RSFCheck;
366  vector<double> dstab1;
367  vector<double> pure_sc1;
368  vector<double> asym;
369  vector<double> dstab1_x_anu;
372  double dstems[NDEMS],
373  dstslp[NDEMS],
374  dstslp2[NDEMS];
378  TeGrainMax,
379  avdust;
387  long LowestZg;
388  long nfill;
389  vector<ShellData*> sd;
390  vector<realnum> y0b06;
391  double AveDustZ;
392  long ZloSave;
393  double Capacity;
394  double dstpot,
395  RateUp,
396  RateDn,
397  StickElecNeg,
398  StickElecPos;
400  le_thres;
401  vector<realnum> inv_att_len;
402  double AccomCoef[LIMELM];
405  double BolFlux,
408  GrainHeat,
409  GrainHeatColl,
410  GrainGasCool,
411  ChemEn,
412  ChemEnH2,
413  thermionic;
416  bool lgQHeat,
417  lgUseQHeat,
418  lgEverQHeat,
419  lgQHTooWide;
421  qnflux,
422  qnflux2;
423  double qtmin;
424  double qtmin_zone1;
425  double HeatingRate1;
426  double DustEnth[NDEMS],
427  EnthSlp[NDEMS],
428  EnthSlp2[NDEMS];
439  avdft;
441  long nChrgOrg;
442  long nChrg;
444 };
445 
454 class GrainVar
455 {
456  void p_clear0();
457  void p_clear1();
458 
459 public:
461  {
462  p_clear1();
463  }
465  {
466  p_clear0();
467  }
468  void clear()
469  {
470  p_clear0();
471  p_clear1();
472  }
473 
475  bool lgDustOn() const
476  {
477  return ( bin.size() > 0 );
478  }
479  bool lgWD01,
480  lgReevaluate,
484  lgAnyDustVary,
486  bool lgNegGrnDrg;
489  bool lgDHetOn,
490  lgQHeatOn;
494  bool lgDColOn;
499 
500  vector<string> ReadRecord;
524  long nzone;
525  vector<double> dstab;
526  vector<double> dstsc;
529  double TotalEden;
533  double GrnRecomTe;
542 
544  double GasCoolColl,
546  GasHeatTherm,
547  GasHeatNet,
548  GrainHeatSum,
549  GrainHeatLya,
550  GrainHeatDif,
551  GrainHeatInc,
553  GrainHeatChem;
555  double dHeatdT;
560  dphmax,
561  dclmax;
564  double dsttmp[NDEMS];
569  bool lgQHeatAll;
570  bool lgQHPunLast;
571  FILE *QHSaveFile;
578  vector<realnum> GrainEmission;
579  vector<realnum> GraphiteEmission;
580  vector<realnum> SilicateEmission;
583  vector<GrainBin*> bin;
585 };
586 extern GrainVar gv;
587 
588 
589 #endif /* GRAINVAR_H_ */
long qnflux2
Definition: grainvar.h:420
vector< realnum > y0b06
Definition: grainvar.h:390
ChargeBin()
Definition: grainvar.h:209
bool lgBakesPAH_heat
Definition: grainvar.h:479
realnum tedust
Definition: grainvar.h:257
~GrainVar()
Definition: grainvar.h:464
double PotSurf
Definition: grainvar.h:228
vector< double > dstab
Definition: grainvar.h:525
double ionPot
Definition: grainvar.h:147
double bolflux1
Definition: grainvar.h:260
long QHeatFailures
Definition: grainvar.h:420
double GrainHeatLya
Definition: grainvar.h:544
double EnthSlp2[NDEMS]
Definition: grainvar.h:426
flex_arr< realnum > ehat
Definition: grainvar.h:242
long ZloSave
Definition: grainvar.h:392
double cnv_GR_pH
Definition: grainvar.h:354
realnum atomWeight
Definition: grainvar.h:326
double rate_h2_form_grains_used
Definition: grainvar.h:434
FILE * QHSaveFile
Definition: grainvar.h:571
bool lgUseQHeat
Definition: grainvar.h:416
flex_arr< double > cs_pdt
Definition: grainvar.h:243
double GrainHeatSum
Definition: grainvar.h:544
bool lgGrainElectrons
Definition: grainvar.h:498
double dstems[NDEMS]
Definition: grainvar.h:372
realnum dclmax
Definition: grainvar.h:559
realnum le_thres
Definition: grainvar.h:399
double cnv_H_pGR
Definition: grainvar.h:354
double StickElecNeg
Definition: grainvar.h:394
vector< ShellData * > sd
Definition: grainvar.h:389
double cnv_CM3_pGR
Definition: grainvar.h:354
long qnflux
Definition: grainvar.h:420
double GrainHeat
Definition: grainvar.h:269
long nData
Definition: grainvar.h:151
const double GRAIN_TMAX
Definition: grainvar.h:21
double GrainHeatColl
Definition: grainvar.h:269
double ESum1b
Definition: grainvar.h:253
double dstslp2[NDEMS]
Definition: grainvar.h:372
double GasCoolColl
Definition: grainvar.h:544
long LowestZg
Definition: grainvar.h:387
strg_type
Definition: grainvar.h:82
double ThresSurfInc
Definition: grainvar.h:228
long nelem
Definition: grainvar.h:145
bool lgQHeat
Definition: grainvar.h:416
AEInfo * AugerData[LIMELM]
Definition: grainvar.h:536
bool lgAnyDustVary
Definition: grainvar.h:479
realnum tedust
Definition: grainvar.h:377
vector< realnum > inv_att_len
Definition: grainvar.h:401
realnum BandGap
Definition: grainvar.h:326
double thermionic
Definition: grainvar.h:405
double EminInc
Definition: grainvar.h:228
double dsttmp[NDEMS]
Definition: grainvar.h:564
AEInfo()
Definition: grainvar.h:167
double GrainCoolTherm
Definition: grainvar.h:405
realnum elmAbund[LIMELM]
Definition: grainvar.h:326
zmin_type
Definition: grainvar.h:58
double HeatingRate2
Definition: grainvar.h:279
double xi[LIMELM+2]
Definition: grainvar.h:247
vector< double > dstab1
Definition: grainvar.h:366
df_type
Definition: grainvar.h:40
df_type nDustFunc
Definition: grainvar.h:317
flex_arr< realnum > yhat_primary
Definition: grainvar.h:241
bool lgQHeatAll
Definition: grainvar.h:569
double dep
Definition: grainvar.h:118
bool lgReevaluate
Definition: grainvar.h:479
double GrainHeatColl
Definition: grainvar.h:405
long ipLo
Definition: grainvar.h:148
double Emin
Definition: grainvar.h:228
pe_type which_pe[MAT_TOP]
Definition: grainvar.h:519
void p_clear0()
Definition: grains.cpp:197
realnum avdust
Definition: grainvar.h:377
bool lgQHeatOn
Definition: grainvar.h:489
realnum Tsublimat
Definition: grainvar.h:326
realnum elmSumAbund[LIMELM]
Definition: grainvar.h:510
double dHeatdT
Definition: grainvar.h:555
void clear()
Definition: grainvar.h:217
double GrainHeatCollSum
Definition: grainvar.h:544
bool lgQHPunLast
Definition: grainvar.h:570
realnum avDGRatio
Definition: grainvar.h:326
pe_type
Definition: grainvar.h:76
void p_clear0()
Definition: grains.cpp:339
vector< vector< double > > AvNumber
Definition: grainvar.h:184
void p_clear1()
Definition: grains.cpp:219
~ShellData()
Definition: grainvar.h:135
vector< double > asym
Definition: grainvar.h:368
double cnv_GR_pCM3
Definition: grainvar.h:354
df_type nDustFunc
Definition: grainvar.h:119
double RSFCheck
Definition: grainvar.h:362
double RSum1
Definition: grainvar.h:250
void p_clear0()
Definition: grains.cpp:210
double FracPop
Definition: grainvar.h:228
vector< realnum > GraphiteEmission
Definition: grainvar.h:579
mat_type
Definition: grainvar.h:102
realnum GrnElecDonateMax
Definition: grainvar.h:531
realnum TeGrainMax
Definition: grainvar.h:377
flex_arr< realnum > yhat
Definition: grainvar.h:240
H2_type which_H2distr[MAT_TOP]
Definition: grainvar.h:521
double hots1
Definition: grainvar.h:259
long DustZ
Definition: grainvar.h:224
vector< double > dstsc
Definition: grainvar.h:526
bool lgNegGrnDrg
Definition: grainvar.h:486
flex_arr< realnum > p
Definition: grainvar.h:149
double RateUp
Definition: grainvar.h:394
bool lgIterStart
Definition: grainvar.h:319
vector< vector< double > > Energy
Definition: grainvar.h:186
char chDstLab[13]
Definition: grainvar.h:322
double GrainCoolTherm
Definition: grainvar.h:269
vector< double > dstab1_x_anu
Definition: grainvar.h:369
double TotalEden
Definition: grainvar.h:529
realnum dustp[5]
Definition: grainvar.h:326
double qtmin_zone1
Definition: grainvar.h:424
bool lgGreyGrain
Definition: grainvar.h:120
realnum dstAbundThresholdNear
Definition: grainvar.h:567
const bool ENABLE_QUANTUM_HEATING
Definition: grainvar.h:13
vector< realnum > GrainEmission
Definition: grainvar.h:578
double ThresInfVal
Definition: grainvar.h:228
double DustEnth[NDEMS]
Definition: grainvar.h:426
strg_type which_strg[MAT_TOP]
Definition: grainvar.h:520
long nChrg
Definition: grainvar.h:442
long ipThresInf
Definition: grainvar.h:224
double GasHeatTherm
Definition: grainvar.h:544
realnum AvArea
Definition: grainvar.h:326
pot_type which_pot[MAT_TOP]
Definition: grainvar.h:517
long ns
Definition: grainvar.h:146
GrainVar()
Definition: grainvar.h:460
void p_clear1()
Definition: grains.cpp:359
double dstpot
Definition: grainvar.h:394
realnum dstAbundThresholdFar
Definition: grainvar.h:568
realnum dstfactor
Definition: grainvar.h:350
double ThresInfInc
Definition: grainvar.h:228
~AEInfo()
Definition: grainvar.h:171
double StickElecPos
Definition: grainvar.h:394
double HeatingRate1
Definition: grainvar.h:425
const int NCHU
Definition: grainvar.h:27
enth_type which_enth[MAT_TOP]
Definition: grainvar.h:515
bool lgTdustConverged
Definition: grainvar.h:376
bool lgRequestQHeating
Definition: grainvar.h:120
float realnum
Definition: cddefines.h:124
void p_clear1()
Definition: grains.cpp:238
ShellData()
Definition: grainvar.h:131
double GrainHeatDif
Definition: grainvar.h:544
pot_type
Definition: grainvar.h:64
double rate_h2_form_grains_CT02
Definition: grainvar.h:432
void clear()
Definition: grainvar.h:310
enth_type
Definition: grainvar.h:47
double rate_h2_form_grains_ELRD
Definition: grainvar.h:433
bool lgGrainPhysicsOn
Definition: grainvar.h:479
double hcon1
Definition: grainvar.h:258
void p_clear0()
Definition: grains.cpp:228
double PotSurfInc
Definition: grainvar.h:228
double ChemEnIon
Definition: grainvar.h:269
bool lgForbidQHeating
Definition: grainvar.h:120
double ThermRate
Definition: grainvar.h:228
void p_clear0()
Definition: grains.cpp:246
double rate_h2_form_grains_HM79
Definition: grainvar.h:431
long nChrgOrg
Definition: grainvar.h:441
double ESum2
Definition: grainvar.h:254
ial_type
Definition: grainvar.h:70
H2_type
Definition: grainvar.h:88
double GasHeatPhotoEl
Definition: grainvar.h:405
double GasHeatPhotoEl
Definition: grainvar.h:544
void clear()
Definition: grainvar.h:139
const int NCHRG_DEFAULT
Definition: grainvar.h:29
const double GRAIN_TMID
Definition: grainvar.h:20
realnum IntVol
Definition: grainvar.h:326
realnum avdpot
Definition: grainvar.h:399
double BolFlux
Definition: grainvar.h:405
void clear()
Definition: grainvar.h:468
bool lgWD01
Definition: grainvar.h:479
const double GRAIN_TMIN
Definition: grainvar.h:19
double ThresInf
Definition: grainvar.h:228
flex_arr< double > fac2
Definition: grainvar.h:263
ial_type which_ial[MAT_TOP]
Definition: grainvar.h:518
vector< flex_arr< realnum > > y01A
Definition: grainvar.h:154
long nfill
Definition: grainvar.h:224
void clear()
Definition: grainvar.h:175
~GrainBin()
Definition: grainvar.h:306
double GasHeatTherm
Definition: grainvar.h:269
zmin_type which_zmin[MAT_TOP]
Definition: grainvar.h:516
bool lgDHetOn
Definition: grainvar.h:489
realnum ChemEn[LIMELM][LIMELM+1]
Definition: grainvar.h:266
double GasHeatPhotoEl
Definition: grainvar.h:269
long ipThresInfVal
Definition: grainvar.h:224
realnum DustWorkFcn
Definition: grainvar.h:326
const int LIMELM
Definition: cddefines.h:308
long nChrgRequested
Definition: grainvar.h:534
double cnv_CM3_pH
Definition: grainvar.h:354
vector< double > pure_sc1
Definition: grainvar.h:367
double ESum1a
Definition: grainvar.h:252
bool lgQHTooWide
Definition: grainvar.h:416
const int NDEMS
Definition: grainvar.h:16
realnum GrnDpth
Definition: grainvar.h:350
realnum RecomEn[LIMELM][LIMELM+1]
Definition: grainvar.h:265
vector< double > AvNr
Definition: grainvar.h:152
realnum GrainHeatScaleFactor
Definition: grainvar.h:557
double eta[LIMELM+2]
Definition: grainvar.h:247
vector< double > Ener
Definition: grainvar.h:153
vector< GrainBin * > bin
Definition: grainvar.h:583
realnum ThermEff
Definition: grainvar.h:326
realnum GrainMetal
Definition: grainvar.h:510
double ChemEnH2
Definition: grainvar.h:405
long RecomZ0[LIMELM][LIMELM+1]
Definition: grainvar.h:245
long nfill
Definition: grainvar.h:388
vector< double > IonThres
Definition: grainvar.h:183
flex_arr< double > fac1
Definition: grainvar.h:262
double GrnRecomTe
Definition: grainvar.h:533
double GrainHeat
Definition: grainvar.h:405
realnum IntRadius
Definition: grainvar.h:326
double eec
Definition: grainvar.h:323
double BolFlux
Definition: grainvar.h:269
const int NQGRID
Definition: grainvar.h:34
const double CONSERV_TOL
Definition: grainvar.h:37
double EnthSlp[NDEMS]
Definition: grainvar.h:426
realnum GrnElecHoldMax
Definition: grainvar.h:532
string chPAH_abundance
Definition: grainvar.h:502
double qtmin
Definition: grainvar.h:423
double pe1
Definition: grainvar.h:261
long nzone
Definition: grainvar.h:524
double Capacity
Definition: grainvar.h:393
double ChemEnH2
Definition: grainvar.h:269
vector< unsigned int > nData
Definition: grainvar.h:182
vector< realnum > SilicateEmission
Definition: grainvar.h:580
bool lgEverQHeat
Definition: grainvar.h:416
vector< string > ReadRecord
Definition: grainvar.h:500
double RateDn
Definition: grainvar.h:394
GrainVar gv
Definition: grainvar.cpp:5
realnum TotalDustHeat
Definition: grainvar.h:559
double cnv_H_pCM3
Definition: grainvar.h:354
realnum dphmax
Definition: grainvar.h:559
realnum dstAbund
Definition: grainvar.h:350
realnum AvVol
Definition: grainvar.h:326
bool lgDustOn() const
Definition: grainvar.h:475
double RSum2
Definition: grainvar.h:251
realnum GrainChTrRate[LIMELM][LIMELM+1][LIMELM+1]
Definition: grainvar.h:541
realnum avdft
Definition: grainvar.h:438
double ThresSurf
Definition: grainvar.h:228
bool lgPAHsInIonizedRegion
Definition: grainvar.h:318
~ChargeBin()
Definition: grainvar.h:213
ChargeBin * chrg[NCHS]
Definition: grainvar.h:443
double eyc
Definition: grainvar.h:324
realnum AvRadius
Definition: grainvar.h:326
double GrainHeatChem
Definition: grainvar.h:544
double AccomCoef[LIMELM]
Definition: grainvar.h:402
void p_clear1()
Definition: grains.cpp:205
double GrainGasCool
Definition: grainvar.h:405
void p_clear1()
Definition: grains.cpp:266
double AveDustZ
Definition: grainvar.h:391
double dstslp[NDEMS]
Definition: grainvar.h:372
flex_arr< realnum > y01
Definition: grainvar.h:150
double GrainHeatInc
Definition: grainvar.h:544
realnum DustDftVel
Definition: grainvar.h:438
realnum IntArea
Definition: grainvar.h:326
double rate_h2_form_grains_used_total
Definition: grainvar.h:574
double ChemEn
Definition: grainvar.h:405
unsigned int nSubShell
Definition: grainvar.h:181
const int NCHS
Definition: grainvar.h:24
bool lgDColOn
Definition: grainvar.h:494
double GasHeatNet
Definition: grainvar.h:544
GrainBin()
Definition: grainvar.h:302
mat_type matType
Definition: grainvar.h:340
double ThresSurfVal
Definition: grainvar.h:228