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 NDUST = 500;
00023
00025 const unsigned int NSHL = 50U;
00027 const int NCHS = 30;
00029 const int NCHRG_DEFAULT= 2;
00030
00034 const int NQGRID = 10000;
00035
00037 const double CONSERV_TOL = 1.e-3;
00038
00040 typedef enum {
00041 ENTH_CAR,
00042 ENTH_CAR2,
00043 ENTH_SIL,
00044 ENTH_SIL2,
00045 ENTH_PAH,
00046 ENTH_PAH2
00047 } enth_type;
00048
00050 typedef enum {
00051 ZMIN_CAR,
00052 ZMIN_SIL,
00053 ZMIN_BAKES
00054 } zmin_type;
00055
00057 typedef enum {
00058 POT_CAR,
00059 POT_SIL
00060 } pot_type;
00061
00063 typedef enum {
00064 IAL_CAR,
00065 IAL_SIL
00066 } ial_type;
00067
00069 typedef enum {
00070 PE_CAR,
00071 PE_SIL
00072 } pe_type;
00073
00075 typedef enum {
00076 STRG_CAR,
00077 STRG_SIL
00078 } strg_type;
00079
00081 typedef enum {
00082 H2_ICE,
00083 H2_SIL,
00084 H2_CAR,
00089 H2_TOP
00090 } H2_type;
00091
00095 typedef enum {
00096 MAT_USR=0,
00097 MAT_CAR,
00098 MAT_SIL,
00099 MAT_PAH,
00100 MAT_CAR2,
00101 MAT_SIL2,
00102 MAT_PAH2,
00106 MAT_TOP
00107 } mat_type;
00108
00109 typedef struct
00110 {
00111 long nelem;
00112 long ns;
00113 double ionPot;
00114 long ipLo;
00115 flex_arr<realnum> p;
00116 flex_arr<realnum> y01;
00117 long nData;
00118 double *AvNr;
00119 double *Ener;
00120 valarray< flex_arr<realnum> > y01A;
00121 } ShellData;
00122
00127 typedef struct
00128 {
00129 unsigned long nSubShell;
00130 unsigned long *nData;
00131 double *IonThres;
00132 double **AvNumber;
00133 double **Energy;
00134 } AEInfo;
00135
00137 const int MAX_READ_RECORDS = 50;
00139 const int READ_RECORD_LENGTH = 200;
00140
00141
00142
00143
00158 typedef struct
00159 {
00161 long DustZ,
00162 ipThresInf,
00163 ipThresInfVal,
00164 nfill;
00165 double FracPop,
00166 Emin,
00167 EminInc,
00168 PotSurf,
00169 PotSurfInc,
00170 ThresInf,
00171 ThresInfInc,
00172 ThresInfVal,
00173 ThresSurf,
00174 ThresSurfInc,
00175 ThresSurfVal,
00176 ThermRate;
00177 flex_arr<realnum> yhat;
00178 flex_arr<realnum> yhat_primary;
00179 flex_arr<realnum> ehat;
00180 flex_arr<double> cs_pdt;
00182 long RecomZ0[LIMELM][LIMELM+1];
00184 double eta[LIMELM+2],
00185 xi[LIMELM+2];
00187 double RSum1;
00188 double RSum2;
00189 double ESum1a;
00190 double ESum1b;
00191 double ESum2;
00194 realnum tedust;
00195 double hcon1;
00196 double hots1;
00197 double bolflux1;
00198 double pe1;
00199 flex_arr<double> fac1;
00200 flex_arr<double> fac2;
00202 realnum RecomEn[LIMELM][LIMELM+1];
00203 realnum ChemEn[LIMELM][LIMELM+1];
00206 double BolFlux,
00207 GrainHeat,
00208 GrainHeatColl,
00209 GasHeatPhotoEl,
00210 GasHeatTherm,
00211 GrainCoolTherm,
00212 ChemEnIon,
00213 ChemEnH2;
00216 double HeatingRate2;
00218 } ChargeBin;
00219
00234 typedef struct
00235 {
00237 bool lgDustFunc;
00238 bool lgPAHsInIonizedRegion;
00241 char chDstLab[13];
00242 double eec;
00243 double eyc;
00244 realnum dustp[5],
00246 AvRadius,
00247 AvArea,
00248 AvVol,
00249 IntRadius,
00250 IntArea,
00251 IntVol,
00252 elmAbund[LIMELM],
00253 atomWeight,
00254 Tsublimat,
00255 DustWorkFcn,
00256 BandGap,
00257 ThermEff,
00258 avDGRatio;
00259 mat_type matType;
00269 realnum dstfactor,
00270 dstAbund,
00271 GrnVryDpth;
00273 double cnv_H_pGR,
00274 cnv_H_pCM3,
00275 cnv_CM3_pGR,
00276 cnv_CM3_pH,
00277 cnv_GR_pH,
00278 cnv_GR_pCM3;
00281 realnum EnergyCheck;
00282 long int NFPCheck;
00286 double *dstab1,
00287 *pure_sc1,
00288 *asym;
00291 double dstems[NDEMS],
00292 dstslp[NDEMS],
00293 dstslp2[NDEMS];
00295 bool lgTdustConverged;
00296 realnum tedust,
00297 TeGrainMax,
00298 avdust;
00306 bool lgChrgConverged;
00307 long LowestZg;
00308 unsigned long nShells;
00309 long nfill;
00310 ShellData *sd[NSHL];
00311 realnum *y0b06;
00312 double AveDustZ,
00313 Capacity,
00314 dstpot,
00315 dstpotsav,
00316 LowestPot,
00317 RateUp,
00318 RateDn,
00319 StickElecNeg,
00320 StickElecPos;
00321 realnum avdpot,
00322 le_thres,
00323 *inv_att_len;
00324 double AccomCoef[LIMELM];
00327 double BolFlux,
00328 GrainCoolTherm,
00329 GasHeatPhotoEl,
00330 GrainHeat,
00331 GrainHeatColl,
00332 GrainGasCool,
00333 ChemEn,
00334 ChemEnH2,
00335 thermionic;
00338 bool lgQHeat,
00339 lgUseQHeat,
00340 lgEverQHeat,
00341 lgQHTooWide;
00342 long QHeatFailures,
00343 qnflux,
00344 qnflux2;
00345 double
00346 qtmin,
00347 qtmin_zone1,
00348 HeatingRate1;
00349 double DustEnth[NDEMS],
00350 EnthSlp[NDEMS],
00351 EnthSlp2[NDEMS];
00354 double rate_h2_form_grains_HM79;
00355 double rate_h2_form_grains_CT02;
00356 double rate_h2_form_grains_used;
00360 realnum DustDftVel,
00361 avdft;
00363 long nChrgOrg;
00364 long nChrg;
00365 ChargeBin *chrg[NCHS];
00367 } GrainBin;
00368
00379 EXTERN struct t_gv
00380 {
00382 bool lgDustOn,
00383 lgBakes,
00384 lgWD01,
00385 lgReevaluate,
00387 lgGrainPhysicsOn,
00389 lgAnyDustVary,
00390 lgAnyNegCharge,
00391 lgBakesPAH_heat;
00392 bool lgNegGrnDrg;
00395 bool lgDHetOn,
00396 lgQHeatOn;
00400 bool lgDColOn;
00404 bool lgGrainElectrons;
00405
00406 char ReadRecord[MAX_READ_RECORDS][READ_RECORD_LENGTH];
00408 long ReadPtr;
00413 char chPAH_abundance_fcn[5];
00414
00421 realnum GrainMetal,
00422 elmSumAbund[LIMELM];
00426 enth_type which_enth[MAT_TOP];
00427 zmin_type which_zmin[MAT_TOP];
00428 pot_type which_pot[MAT_TOP];
00429 ial_type which_ial[MAT_TOP];
00430 pe_type which_pe[MAT_TOP];
00431 strg_type which_strg[MAT_TOP];
00432 H2_type which_H2distr[MAT_TOP];
00434 realnum *anumin,
00435 *anumax;
00438 long nfill,
00439 nzone;
00440 double *dstab,
00441 *dstsc;
00446 double TotalEden;
00448 realnum GrnElecDonateMax,
00449 GrnElecHoldMax;
00450 realnum GrnRecomTe;
00451 long HighestIon,
00452 nChrgRequested;
00454 AEInfo *AugerData[LIMELM];
00459 realnum GrainChTrRate[LIMELM][LIMELM+1][LIMELM+1];
00460
00462 double GasCoolColl,
00463 GasHeatPhotoEl,
00464 GasHeatTherm,
00465 GasHeatNet,
00466 GrainHeatSum,
00467 GrainHeatLya,
00468 GrainHeatDif,
00469 GrainHeatInc,
00470 GrainHeatCollSum,
00471 GrainHeatChem;
00473 double dHeatdT;
00475 realnum GrainHeatScaleFactor;
00477 realnum TotalDustHeat,
00478 dphmax,
00479 dclmax;
00482 double dsttmp[NDEMS];
00485 realnum dstAbundThresholdNear;
00486 realnum dstAbundThresholdFar;
00487 bool lgQHeatAll,
00488 lgQHPunLast;
00489 FILE *QHPunchFile;
00492 double rate_h2_form_grains_used_total;
00496 realnum *GrainEmission,
00497 *GraphiteEmission,
00498 *SilicateEmission;
00501 long int nBin;
00502 GrainBin *bin[NDUST];
00504 } gv;
00505
00506
00507 #endif