00001
00002
00003
00004 #ifndef GRAINVAR_H_
00005 #define GRAINVAR_H_
00006
00007
00008
00011 #define IGNORE_QUANTUM_HEATING 1
00012
00014 const int NDEMS = 200;
00015
00017 const double GRAIN_TMIN = 1.e-3;
00018 const double GRAIN_TMID = 5.e3;
00019 const double GRAIN_TMAX = 1.2e9;
00020
00022 const int NCHS = 30;
00024 const int NCHRG_DEFAULT= 2;
00025
00029 const int NQGRID = 10000;
00030
00032 const double CONSERV_TOL = 1.e-3;
00033
00035 typedef enum {
00036 DF_STANDARD,
00037 DF_USER_FUNCTION,
00038 DF_SUBLIMATION
00039 } df_type;
00040
00042 typedef enum {
00043 ENTH_CAR,
00044 ENTH_CAR2,
00045 ENTH_SIL,
00046 ENTH_SIL2,
00047 ENTH_PAH,
00048 ENTH_PAH2
00049 } enth_type;
00050
00052 typedef enum {
00053 ZMIN_CAR,
00054 ZMIN_SIL
00055 } zmin_type;
00056
00058 typedef enum {
00059 POT_CAR,
00060 POT_SIL
00061 } pot_type;
00062
00064 typedef enum {
00065 IAL_CAR,
00066 IAL_SIL
00067 } ial_type;
00068
00070 typedef enum {
00071 PE_CAR,
00072 PE_SIL
00073 } pe_type;
00074
00076 typedef enum {
00077 STRG_CAR,
00078 STRG_SIL
00079 } strg_type;
00080
00082 typedef enum {
00083 H2_ICE,
00084 H2_SIL,
00085 H2_CAR,
00090 H2_TOP
00091 } H2_type;
00092
00096 typedef enum {
00097 MAT_USR=0,
00098 MAT_CAR,
00099 MAT_SIL,
00100 MAT_PAH,
00101 MAT_CAR2,
00102 MAT_SIL2,
00103 MAT_PAH2,
00107 MAT_TOP
00108 } mat_type;
00109
00110 struct GrainPar {
00111 double dep;
00112 df_type nDustFunc;
00113 bool lgForbidQHeating,
00114 lgGreyGrain,
00115 lgRequestQHeating;
00116 };
00117
00118 class ShellData
00119 {
00120 void p_clear0();
00121 void p_clear1();
00122
00123 public:
00124 ShellData()
00125 {
00126 p_clear1();
00127 }
00128 ~ShellData()
00129 {
00130 p_clear0();
00131 }
00132 void clear()
00133 {
00134 p_clear0();
00135 p_clear1();
00136 }
00137
00138 long nelem;
00139 long ns;
00140 double ionPot;
00141 long ipLo;
00142 flex_arr<realnum> p;
00143 flex_arr<realnum> y01;
00144 long nData;
00145 vector<double> AvNr;
00146 vector<double> Ener;
00147 vector< flex_arr<realnum> > y01A;
00148 };
00149
00154 class AEInfo
00155 {
00156 void p_clear0();
00157 void p_clear1();
00158
00159 public:
00160 AEInfo()
00161 {
00162 p_clear1();
00163 }
00164 ~AEInfo()
00165 {
00166 p_clear0();
00167 }
00168 void clear()
00169 {
00170 p_clear0();
00171 p_clear1();
00172 }
00173
00174 unsigned int nSubShell;
00175 vector<unsigned int> nData;
00176 vector<double> IonThres;
00177 vector< vector<double> > AvNumber;
00179 vector< vector<double> > Energy;
00180 };
00181
00196 class ChargeBin
00197 {
00198 void p_clear0();
00199 void p_clear1();
00200
00201 public:
00202 ChargeBin()
00203 {
00204 p_clear1();
00205 }
00206 ~ChargeBin()
00207 {
00208 p_clear0();
00209 }
00210 void clear()
00211 {
00212 p_clear0();
00213 p_clear1();
00214 }
00215
00217 long DustZ,
00218 ipThresInf,
00219 ipThresInfVal,
00220 nfill;
00221 double FracPop,
00222 Emin,
00223 EminInc,
00224 PotSurf,
00225 PotSurfInc,
00226 ThresInf,
00227 ThresInfInc,
00228 ThresInfVal,
00229 ThresSurf,
00230 ThresSurfInc,
00231 ThresSurfVal,
00232 ThermRate;
00233 flex_arr<realnum> yhat;
00234 flex_arr<realnum> yhat_primary;
00235 flex_arr<realnum> ehat;
00236 flex_arr<double> cs_pdt;
00238 long RecomZ0[LIMELM][LIMELM+1];
00240 double eta[LIMELM+2],
00241 xi[LIMELM+2];
00243 double RSum1;
00244 double RSum2;
00245 double ESum1a;
00246 double ESum1b;
00247 double ESum2;
00250 realnum tedust;
00251 double hcon1;
00252 double hots1;
00253 double bolflux1;
00254 double pe1;
00255 flex_arr<double> fac1;
00256 flex_arr<double> fac2;
00258 realnum RecomEn[LIMELM][LIMELM+1];
00259 realnum ChemEn[LIMELM][LIMELM+1];
00262 double BolFlux,
00263 GrainHeat,
00264 GrainHeatColl,
00265 GasHeatPhotoEl,
00266 GasHeatTherm,
00267 GrainCoolTherm,
00268 ChemEnIon,
00269 ChemEnH2;
00272 double HeatingRate2;
00273 };
00274
00289 class GrainBin
00290 {
00291 void p_clear0();
00292 void p_clear1();
00293
00294 public:
00295 GrainBin()
00296 {
00297 p_clear1();
00298 }
00299 ~GrainBin()
00300 {
00301 p_clear0();
00302 }
00303 void clear()
00304 {
00305 p_clear0();
00306 p_clear1();
00307 }
00308
00310 df_type nDustFunc;
00311 bool lgPAHsInIonizedRegion;
00314 char chDstLab[13];
00315 double eec;
00316 double eyc;
00317 realnum dustp[5],
00319 AvRadius,
00320 AvArea,
00321 AvVol,
00322 IntRadius,
00323 IntArea,
00324 IntVol,
00325 elmAbund[LIMELM],
00326 atomWeight,
00327 Tsublimat,
00328 DustWorkFcn,
00329 BandGap,
00330 ThermEff,
00331 avDGRatio;
00332 mat_type matType;
00342 realnum dstfactor,
00343 dstAbund,
00344 GrnDpth;
00346 double cnv_H_pGR,
00347 cnv_H_pCM3,
00348 cnv_CM3_pGR,
00349 cnv_CM3_pH,
00350 cnv_GR_pH,
00351 cnv_GR_pCM3;
00354 double RSFCheck;
00358 vector<double> dstab1;
00359 vector<double> pure_sc1;
00360 vector<double> asym;
00363 double dstems[NDEMS],
00364 dstslp[NDEMS],
00365 dstslp2[NDEMS];
00367 bool lgTdustConverged;
00368 realnum tedust,
00369 TeGrainMax,
00370 avdust;
00378 bool lgChrgConverged;
00379 long LowestZg;
00380 long nfill;
00381 vector<ShellData*> sd;
00382 vector<realnum> y0b06;
00383 double AveDustZ,
00384 Capacity,
00385 dstpot,
00386 dstpotsav,
00387 LowestPot,
00388 RateUp,
00389 RateDn,
00390 StickElecNeg,
00391 StickElecPos;
00392 realnum avdpot,
00393 le_thres;
00394 vector<realnum> inv_att_len;
00395 double AccomCoef[LIMELM];
00398 double BolFlux,
00399 GrainCoolTherm,
00400 GasHeatPhotoEl,
00401 GrainHeat,
00402 GrainHeatColl,
00403 GrainGasCool,
00404 ChemEn,
00405 ChemEnH2,
00406 thermionic;
00409 bool lgQHeat,
00410 lgUseQHeat,
00411 lgEverQHeat,
00412 lgQHTooWide;
00413 long QHeatFailures,
00414 qnflux,
00415 qnflux2;
00416 double
00417 qtmin,
00418 qtmin_zone1,
00419 HeatingRate1;
00420 double DustEnth[NDEMS],
00421 EnthSlp[NDEMS],
00422 EnthSlp2[NDEMS];
00425 double rate_h2_form_grains_HM79;
00426 double rate_h2_form_grains_CT02;
00427 double rate_h2_form_grains_used;
00431 realnum DustDftVel,
00432 avdft;
00434 long nChrgOrg;
00435 long nChrg;
00436 ChargeBin *chrg[NCHS];
00437 };
00438
00447 EXTERN class GrainVar
00448 {
00449 void p_clear0();
00450 void p_clear1();
00451
00452 public:
00453 GrainVar()
00454 {
00455 p_clear1();
00456 }
00457 ~GrainVar()
00458 {
00459 p_clear0();
00460 }
00461 void clear()
00462 {
00463 p_clear0();
00464 p_clear1();
00465 }
00466
00468 bool lgDustOn() const
00469 {
00470 return ( bin.size() > 0 );
00471 }
00472 bool lgWD01,
00473 lgReevaluate,
00475 lgGrainPhysicsOn,
00477 lgAnyDustVary,
00478 lgAnyNegCharge,
00479 lgBakesPAH_heat;
00480 bool lgNegGrnDrg;
00483 bool lgDHetOn,
00484 lgQHeatOn;
00488 bool lgDColOn;
00492 bool lgGrainElectrons;
00493
00494 vector<string> ReadRecord;
00496 string chPAH_abundance;
00504 realnum GrainMetal,
00505 elmSumAbund[LIMELM];
00509 enth_type which_enth[MAT_TOP];
00510 zmin_type which_zmin[MAT_TOP];
00511 pot_type which_pot[MAT_TOP];
00512 ial_type which_ial[MAT_TOP];
00513 pe_type which_pe[MAT_TOP];
00514 strg_type which_strg[MAT_TOP];
00515 H2_type which_H2distr[MAT_TOP];
00517 vector<realnum> anumin;
00518 vector<realnum> anumax;
00521 long nfill,
00522 nzone;
00523 vector<double> dstab;
00524 vector<double> dstsc;
00527 double TotalEden;
00529 realnum GrnElecDonateMax,
00530 GrnElecHoldMax;
00531 double GrnRecomTe;
00532 long HighestIon,
00533 nChrgRequested;
00535 AEInfo *AugerData[LIMELM];
00540 realnum GrainChTrRate[LIMELM][LIMELM+1][LIMELM+1];
00541
00543 double GasCoolColl,
00544 GasHeatPhotoEl,
00545 GasHeatTherm,
00546 GasHeatNet,
00547 GrainHeatSum,
00548 GrainHeatLya,
00549 GrainHeatDif,
00550 GrainHeatInc,
00551 GrainHeatCollSum,
00552 GrainHeatChem;
00554 double dHeatdT;
00556 realnum GrainHeatScaleFactor;
00558 realnum TotalDustHeat,
00559 dphmax,
00560 dclmax;
00563 double dsttmp[NDEMS];
00566 realnum dstAbundThresholdNear;
00567 realnum dstAbundThresholdFar;
00568 bool lgQHeatAll,
00569 lgQHPunLast;
00570 FILE *QHSaveFile;
00573 double rate_h2_form_grains_used_total;
00577 vector<realnum> GrainEmission;
00578 vector<realnum> GraphiteEmission;
00579 vector<realnum> SilicateEmission;
00582 vector<GrainBin*> bin;
00584 } gv;
00585
00586
00587 #endif