#include "cddefines.h"
#include "physconst.h"
#include "atmdat.h"
#include "rfield.h"
#include "hmi.h"
#include "trace.h"
#include "conv.h"
#include "ionbal.h"
#include "thermal.h"
#include "phycon.h"
#include "doppvel.h"
#include "taulines.h"
#include "mole.h"
#include "heavy.h"
#include "thirdparty.h"
#include "dense.h"
#include "ipoint.h"
#include "elementnames.h"
#include "grainvar.h"
#include "grains.h"
#include "iso.h"
Go to the source code of this file.
Defines | |
#define | FREE_CHECK(PTR) { ASSERT( PTR != NULL ); free( PTR ); PTR = NULL; } |
#define | FREE_SAFE(PTR) { if( PTR != NULL ) free( PTR ); PTR = NULL; } |
Functions | |
double | ASINH (double x) |
double | one_elec (long nd) |
double | pot2chrg (double x, long nd) |
double | chrg2pot (double x, long nd) |
double | elec_esc_length (double e, long nd) |
STATIC void | ReadAugerData () |
STATIC void | InitBinAugerData (size_t, long, long) |
STATIC void | GetNextLine (const char *, FILE *, char[]) |
STATIC void | InitEmissivities (void) |
STATIC double | PlanckIntegral (double, size_t, long) |
STATIC void | NewChargeData (long) |
STATIC double | GrnStdDpth (long) |
STATIC void | GrainChargeTemp (void) |
STATIC void | GrainCharge (size_t, double *) |
STATIC double | GrainElecRecomb1 (size_t, long, double *, double *) |
STATIC double | GrainElecEmis1 (size_t, long, double *, double *, double *, double *) |
STATIC void | GrainScreen (long, size_t, long, double *, double *) |
STATIC double | ThetaNu (double) |
STATIC void | UpdatePot (size_t, long, long, double[], double[]) |
STATIC void | GetFracPop (size_t, long, double[], double[], long *) |
STATIC void | UpdatePot1 (size_t, long, long, long) |
STATIC void | UpdatePot2 (size_t, long) |
void | Yfunc (long, long, double, double, double, double, double, double *, double *, double *, double *) |
STATIC double | y0b (size_t, long, long) |
STATIC double | y0b01 (size_t, long, long) |
STATIC double | y0psa (size_t, long, long, double) |
STATIC double | y1psa (size_t, long, double) |
double | y2pa (double, double, long, double *) |
double | y2s (double, double, long, double *) |
STATIC long | HighestIonStage (void) |
STATIC void | UpdateRecomZ0 (size_t, long, bool) |
STATIC void | GetPotValues (size_t, long, double *, double *, double *, double *, double *, double *, bool) |
STATIC void | GrainIonColl (size_t, long, long, long, const double[], const double[], long *, realnum *, realnum *) |
STATIC void | GrainChrgTransferRates (long) |
STATIC void | GrainUpdateRadius1 (void) |
STATIC void | GrainUpdateRadius2 () |
STATIC void | GrainTemperature (size_t, realnum *, double *, double *, double *) |
STATIC void | PE_init (size_t, long, long, double *, double *, double *, double *, double *, double *, double *) |
STATIC void | GrainCollHeating (size_t, realnum *, realnum *) |
STATIC double | GrnVryDpth (size_t) |
void | GrainZero (void) |
void | GrainStartIter (void) |
void | GrainRestartIter (void) |
void | SetNChrgStates (long nChrg) |
void | GrainsInit (void) |
STATIC double | PlanckIntegral (double tdust, size_t nd, long int ip) |
STATIC double | GrnStdDpth (long int nd) |
void | GrainDrive (void) |
STATIC void | GrainIonColl (size_t nd, long int nz, long int nelem, long int ion, const double phi_s_up[], const double phi_s_dn[], long *Z0, realnum *ChEn, realnum *ChemEn) |
void | GrainDrift (void) |
Variables | |
static const long | MAGIC_AUGER_DATA = 20060126L |
static const bool | INCL_TUNNEL = true |
static const bool | NO_TUNNEL = false |
static const bool | ALL_STAGES = true |
static long int | nCalledGrainDrive |
static const long | NTOP = NDEMS/5 |
static const double | TOLER = CONSERV_TOL/10. |
static const long | BRACKET_MAX = 50L |
static const int | NCHU = NCHS/3 |
static const long | CT_LOOP_MAX = 25L |
static const long | T_LOOP_MAX = 50L |
static double | HEAT_TOLER = DBL_MAX |
static double | HEAT_TOLER_BIN = DBL_MAX |
static double | CHRG_TOLER = DBL_MAX |
static const double | AC0 = 3.e-9 |
static const double | AC1G = 4.e-8 |
static const double | AC2G = 7.e-8 |
static const double | ETILDE = 2.*SQRT2/EVRYD |
static const double | THERMCONST = PI4*ELECTRON_MASS*POW2(BOLTZMANN)/POW3(HPLANCK) |
static const double | STICK_ELEC = 0.5 |
static const double | STICK_ION = 1.0 |
#define FREE_CHECK | ( | PTR | ) | { ASSERT( PTR != NULL ); free( PTR ); PTR = NULL; } |
Definition at line 55 of file grains.cpp.
Referenced by FreeGrid(), InitGridCoStar(), InitIndexArrays(), InterpolateGridCoStar(), InterpolateModel(), InterpolateModelCoStar(), InterpolateRectGrid(), lgCompileAtmosphere(), lgCompileAtmosphereCoStar(), RauchInitializeSub(), RebinAtmosphere(), and StarburstInitialize().
#define FREE_SAFE | ( | PTR | ) | { if( PTR != NULL ) free( PTR ); PTR = NULL; } |
Definition at line 56 of file grains.cpp.
Referenced by FreeGrid(), lgCompileAtmosphere(), lgCompileAtmosphereCoStar(), RebinAtmosphere(), and StarburstInitialize().
double ASINH | ( | double | x | ) | [inline] |
asinh is often present in math libraries, but is not guaranteed by the ANSI C89 standard hence we supply our own version, named ASINH to avoid clashes, which should disappear once C++0x is adopted; its accuracy is better than 100 epsilon (worst around |x| = 9e-3)
Definition at line 34 of file grains.cpp.
References LN_TWO, and pow2().
Referenced by y2s().
double chrg2pot | ( | double | x, | |
long | nd | |||
) | [inline] |
convert grain charge in electrons into potential in Ryd
Definition at line 130 of file grains.cpp.
References one_elec().
Referenced by GetPotValues(), GrainCharge(), GrainDrive(), GrainsInit(), and UpdatePot1().
double elec_esc_length | ( | double | e, | |
long | nd | |||
) | [inline] |
mean pathlength travelled by electrons inside the grain, in cm (Eq. 11 of WDB06)
Definition at line 137 of file grains.cpp.
References GrainVar::bin, EVRYD, gv, and pow3().
Referenced by GrainsInit(), y0psa(), y1psa(), and Yfunc().
STATIC void GetFracPop | ( | size_t | nd, | |
long | Zlo, | |||
double | rate_up[], | |||
double | rate_dn[], | |||
long * | newZlo | |||
) |
Definition at line 2940 of file grains.cpp.
References ASSERT, GrainVar::bin, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fnzone, gv, ioQQQ, MAX2, NCHU, safe_div(), ShowMe(), x1, and x2.
Referenced by GrainCharge().
STATIC void GetNextLine | ( | const char * | chFile, | |
FILE * | io, | |||
char | chLine[] | |||
) |
Definition at line 1290 of file grains.cpp.
References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, FILENAME_PATH_LENGTH_2, ioQQQ, read_whole_line(), and strstr_s().
Referenced by ReadAugerData().
STATIC void GetPotValues | ( | size_t | nd, | |
long | Zg, | |||
double * | ThresInf, | |||
double * | ThresInfVal, | |||
double * | ThresSurf, | |||
double * | ThresSurfVal, | |||
double * | PotSurf, | |||
double * | Emin, | |||
bool | lgUseTunnelCorr | |||
) |
Definition at line 3806 of file grains.cpp.
References AC0, AC1G, AC2G, GrainVar::bin, cdEXIT, chrg2pot(), DEBUG_ENTRY, EXIT_FAILURE, gv, ioQQQ, MAX2, one_elec(), POT_CAR, POT_SIL, pow(), ThetaNu(), and GrainVar::which_pot.
Referenced by GrainIonColl(), GrainsInit(), UpdatePot1(), and UpdateRecomZ0().
STATIC void GrainCharge | ( | size_t | nd, | |
double * | ThermRatio | |||
) |
Definition at line 2232 of file grains.cpp.
References ASSERT, GrainVar::bin, BRACKET_MAX, cdEXIT, chrg2pot(), conv, DEBUG_ENTRY, EVRYD, EXIT_FAILURE, fnzone, GetFracPop(), GrainElecEmis1(), GrainElecRecomb1(), gv, ioQQQ, t_trace::lgDustBug, t_conv::lgSearch, t_trace::lgTrace, MAX2, NCHS, NCHU, nint(), powi(), ShowMe(), TorF(), trace, and UpdatePot().
Referenced by GrainChargeTemp().
STATIC void GrainChargeTemp | ( | void | ) |
Definition at line 1750 of file grains.cpp.
References ASSERT, GrainVar::bin, t_elementnames::chElementSym, CHRG_TOLER, conv, ConvFail(), t_thermal::ctot, DEBUG_ENTRY, dense, GrainVar::dHeatdT, GrainVar::dsttmp, t_dense::eden, elementnames, fnzone, fp_equal(), fudge(), t_dense::gas_phase, GrainVar::GasCoolColl, GrainVar::GasHeatNet, GrainVar::GasHeatPhotoEl, GrainVar::GasHeatTherm, GRAIN_TMAX, GRAIN_TMIN, GrainCharge(), GrainChrgTransferRates(), GrainVar::GrainChTrRate, GrainVar::GrainHeatChem, GrainVar::GrainHeatCollSum, GrainVar::GrainHeatDif, GrainVar::GrainHeatInc, GrainVar::GrainHeatLya, GrainVar::GrainHeatSum, GrainTemperature(), GrainUpdateRadius1(), GrainUpdateRadius2(), GrainVar::GrnRecomTe, gv, HEAT_TOLER, HEAT_TOLER_BIN, GrainVar::HighestIon, HighestIonStage(), ionbal, t_dense::IonHigh, t_dense::IonLow, ioQQQ, ipHYDROGEN, lgAbort, t_trace::lgDustBug, t_dense::lgElmtOn, t_ionbal::lgGrainIonRecom, t_conv::lgSearch, t_trace::lgTrace, LIMELM, MAT_PAH, MAT_PAH2, NDEMS, NewChargeData(), nzone, GrainVar::nzone, phycon, POW2, t_conv::setConvIonizFail(), splint_safe(), T_LOOP_MAX, t_phycon::te, TE1RYD, thermal, TOLER, TorF(), GrainVar::TotalEden, TotalInsanity(), trace, and t_dense::xIonDense.
Referenced by GrainDrive().
STATIC void GrainChrgTransferRates | ( | long | nd | ) |
Definition at line 3980 of file grains.cpp.
References atmdat, t_dense::AtomicWeight, GrainVar::bin, DEBUG_ENTRY, dense, ChargeBin::FracPop, GetAveVelocity(), GrainVar::GrainChTrRate, GrainScreen(), gv, t_atmdat::lgCTOn, t_dense::lgElmtOn, LIMELM, MAX2, ChargeBin::RecomZ0, and STICK_ION.
Referenced by GrainChargeTemp().
Definition at line 4507 of file grains.cpp.
References ATOMIC_MASS_UNIT, t_dense::AtomicWeight, GrainVar::bin, BOLTZMANN, ChargeBin::ChemEn, DEBUG_ENTRY, molezone::den, dense, ChargeBin::DustZ, t_dense::eden, ELECTRON_MASS, EN1EV, EN1RYD, findspecieslocal(), ChargeBin::FracPop, GetAveVelocity(), GrainElecEmis1(), GrainElecRecomb1(), GrainScreen(), gv, H2_TOP, t_hmi::H2_total, ChargeBin::HeatingRate2, hmi, ioQQQ, ipCARBON, ipH2, ipHYDROGEN, ipOXYGEN, GrainVar::lgDColOn, t_trace::lgDustBug, t_dense::lgElmtOn, t_trace::lgTrace, LIMELM, MAX2, phycon, PI, ChargeBin::PotSurf, ChargeBin::PotSurfInc, POW2, ChargeBin::RecomEn, ChargeBin::RecomZ0, STICK_ION, t_phycon::te, ChargeBin::ThresSurfInc, trace, GrainVar::which_H2distr, and t_dense::xIonDense.
Referenced by GrainTemperature().
void GrainDrift | ( | void | ) |
GrainDrift computes grains drift velocity
Definition at line 4888 of file grains.cpp.
References t_rfield::anu, ASSERT, GrainVar::bin, BOLTZMANN, t_rfield::ConInterOut, DEBUG_ENTRY, dense, t_dense::eden, EN1RYD, t_rfield::flux, gv, ioQQQ, ipHELIUM, ipHYDROGEN, t_trace::lgDustBug, GrainVar::lgNegGrnDrg, t_trace::lgTrace, t_rfield::nflux, t_rfield::outlin, t_rfield::outlin_noplot, phycon, POW2, POW3, rfield, SPEEDLIGHT, t_phycon::sqrte, t_dense::SqrtEden, t_phycon::te, TE1RYD, trace, and t_dense::xIonDense.
Referenced by ConvPresTempEdenIoniz().
void GrainDrive | ( | void | ) |
GrainDrive main routine to converge grains thermal solution
Definition at line 1595 of file grains.cpp.
References GrainVar::bin, chrg2pot(), conv, t_thermal::ctot, GrainVar::dclmax, DEBUG_ENTRY, dense, GrainVar::dphmax, t_dense::eden, t_conv::EdenErrorAllowed, EVRYD, fp_equal(), t_dense::gas_phase, GrainVar::GasCoolColl, GrainVar::GasHeatPhotoEl, GrainChargeTemp(), GrainVar::GrainChTrRate, GrainVar::GrainHeatChem, GrainVar::GrainHeatCollSum, GrainVar::GrainHeatDif, GrainVar::GrainHeatInc, GrainVar::GrainHeatLya, GrainVar::GrainHeatScaleFactor, GrainVar::GrainHeatSum, GrainUpdateRadius1(), GrainUpdateRadius2(), GrainVar::GrnElecDonateMax, GrainVar::GrnElecHoldMax, gv, t_thermal::heating, hmi, ioQQQ, ipHYDROGEN, GrainVar::lgAnyDustVary, GrainVar::lgBakesPAH_heat, GrainVar::lgDustOn(), GrainVar::lgGrainPhysicsOn, GrainVar::lgReevaluate, t_conv::lgSearch, LIMELM, nCalledGrainDrive, t_trace::nTrConvg, nzone, phycon, pow(), SDIV(), t_phycon::te, thermal, GrainVar::TotalDustHeat, GrainVar::TotalEden, trace, and t_hmi::UV_Cont_rel2_Habing_TH85_depth.
Referenced by ConvBase(), and mole_h2_grain_form().
STATIC double GrainElecEmis1 | ( | size_t | nd, | |
long | nz, | |||
double * | sum1a, | |||
double * | sum1b, | |||
double * | sum2, | |||
double * | sum3 | |||
) |
Definition at line 2597 of file grains.cpp.
References ASSERT, t_dense::AtomicWeight, GrainVar::bin, DEBUG_ENTRY, dense, t_rfield::flux, GetAveVelocity(), GrainScreen(), gv, t_dense::lgElmtOn, LIMELM, MAX2, t_rfield::nflux, rfield, STICK_ION, t_rfield::SummedCon, and t_dense::xIonDense.
Referenced by GrainCharge(), GrainCollHeating(), and UpdatePot().
STATIC double GrainElecRecomb1 | ( | size_t | nd, | |
long | nz, | |||
double * | sum1, | |||
double * | sum2 | |||
) |
Definition at line 2514 of file grains.cpp.
References ASSERT, t_dense::AtomicWeight, GrainVar::bin, BOLTZMANN, DEBUG_ENTRY, dense, t_dense::eden, ELECTRON_MASS, GetAveVelocity(), GrainScreen(), gv, t_dense::lgElmtOn, LIMELM, MAX2, phycon, PI, STICK_ION, t_phycon::te, and t_dense::xIonDense.
Referenced by GrainCharge(), GrainCollHeating(), and UpdatePot().
STATIC void GrainIonColl | ( | size_t | nd, | |
long int | nz, | |||
long int | nelem, | |||
long int | ion, | |||
const double | phi_s_up[], | |||
const double | phi_s_dn[], | |||
long * | Z0, | |||
realnum * | ChEn, | |||
realnum * | ChemEn | |||
) |
Definition at line 3900 of file grains.cpp.
References t_rfield::anu, GrainVar::bin, DEBUG_ENTRY, GetPotValues(), gv, Heavy, t_Heavy::ipHeavy, NO_TUNNEL, rfield, and save.
STATIC void GrainIonColl | ( | size_t | , | |
long | , | |||
long | , | |||
long | , | |||
const | double[], | |||
const | double[], | |||
long * | , | |||
realnum * | , | |||
realnum * | ||||
) |
Referenced by UpdateRecomZ0().
void GrainRestartIter | ( | void | ) |
this routine is called by IterRestart()
Definition at line 555 of file grains.cpp.
References GrainVar::bin, DEBUG_ENTRY, gv, GrainVar::lgDustOn(), and GrainVar::lgGrainPhysicsOn.
Referenced by IterRestart().
STATIC void GrainScreen | ( | long | ion, | |
size_t | nd, | |||
long | nz, | |||
double * | eta, | |||
double * | xi | |||
) |
Definition at line 2720 of file grains.cpp.
References ASSERT, GrainVar::bin, BOLTZMANN, DEBUG_ENTRY, ELEM_CHARGE, gv, LIMELM, MIN2, phycon, PI, pow(), POW2, t_phycon::te, and ThetaNu().
Referenced by GrainChrgTransferRates(), GrainCollHeating(), GrainElecEmis1(), and GrainElecRecomb1().
void GrainsInit | ( | void | ) |
startup routine for grains, called before first calculations, but after parsecommands
Definition at line 587 of file grains.cpp.
References t_rfield::anu, GrainVar::anumax, GrainVar::anumin, ASSERT, ATOMIC_MASS_UNIT, atoms, GrainVar::AugerData, AEInfo::AvNumber, GrainVar::bin, cdEXIT, t_elementnames::chElementName, chrg2pot(), CHRG_TOLER, t_thermal::ConstGrainTemp, conv, DEBUG_ENTRY, dense, DF_STANDARD, GrainVar::dstab, GrainVar::dstsc, t_conv::EdenErrorAllowed, elec_esc_length(), elementnames, GrainVar::elmSumAbund, AEInfo::Energy, EVRYD, EXIT_FAILURE, t_dense::gas_phase, GrainVar::GasCoolColl, GetPotValues(), GrainVar::GrainEmission, GrainVar::GrainHeatCollSum, GrainVar::GrainHeatDif, GrainVar::GrainHeatInc, GrainVar::GrainHeatLya, GrainVar::GrainHeatSum, GrainVar::GrainMetal, GrainVar::GraphiteEmission, GrainVar::GrnRecomTe, GrnStdDpth(), gv, HEAT_TOLER, HEAT_TOLER_BIN, t_conv::HeatCoolRelErrorAllowed, t_thermal::heating, hunt_bisect(), INCL_TUNNEL, InitBinAugerData(), InitEmissivities(), InitEnthalpy(), AEInfo::IonThres, ioQQQ, ipHYDROGEN, ipLITHIUM, GrainVar::lgAnyDustVary, t_trace::lgDustBug, GrainVar::lgDustOn(), GrainVar::lgQHeatAll, GrainVar::lgQHeatOn, t_trace::lgTrace, GrainVar::lgWD01, LIMELM, MAT_PAH, MAT_PAH2, MAX2, NCHS, NCHU, AEInfo::nData, t_rfield::nflux, nint(), AEInfo::nSubShell, t_rfield::nupper, GrainVar::nzone, pot2chrg(), pow(), POW2, ReadAugerData(), rfield, GrainVar::SilicateEmission, STICK_ELEC, thermal, TorF(), trace, GrainVar::which_zmin, ZMIN_CAR, and ZMIN_SIL.
Referenced by OpacityCreateAll().
void GrainStartIter | ( | void | ) |
this routine is called by IterStart()
Definition at line 517 of file grains.cpp.
References GrainVar::bin, GrainVar::dclmax, DEBUG_ENTRY, GrainVar::dphmax, GrainVar::GrnElecDonateMax, GrainVar::GrnElecHoldMax, gv, GrainVar::lgDustOn(), GrainVar::lgGrainPhysicsOn, GrainVar::lgNegGrnDrg, and GrainVar::TotalDustHeat.
Referenced by IterStart().
STATIC void GrainTemperature | ( | size_t | nd, | |
realnum * | dccool, | |||
double * | hcon, | |||
double * | hots, | |||
double * | hla | |||
) |
Definition at line 4120 of file grains.cpp.
References t_rfield::anu, ASSERT, GrainVar::bin, ChargeBin::bolflux1, BOLTZMANN, t_thermal::ConstGrainTemp, ChargeBin::cs_pdt, DEBUG_ENTRY, dense, GrainVar::dsttmp, ChargeBin::DustZ, t_dense::eden, EN1RYD, ChargeBin::fac1, ChargeBin::fac2, t_rfield::flux, ChargeBin::FracPop, t_dense::gas_phase, GrainCollHeating(), GrainVar::GrainHeatScaleFactor, gv, ChargeBin::hcon1, hmi, ChargeBin::hots1, ioQQQ, TransitionProxy::ipCont(), ipH1s, ipH2p, ipH_LIKE, ipHYDROGEN, ChargeBin::ipThresInf, iso_sp, GrainVar::lgBakesPAH_heat, GrainVar::lgDHetOn, t_trace::lgDustBug, t_trace::lgTrace, MAX2, MIN2, NDEMS, t_rfield::nflux, t_rfield::otslin, ChargeBin::pe1, phycon, ChargeBin::PotSurf, pow(), rfield, splint_safe(), t_phycon::sqrte, t_rfield::SummedCon, t_rfield::SummedDif, t_phycon::te, thermal, ChargeBin::ThermRate, ChargeBin::ThresSurf, trace, t_iso_sp::trans(), and t_hmi::UV_Cont_rel2_Habing_TH85_depth.
Referenced by GrainChargeTemp().
STATIC void GrainUpdateRadius1 | ( | void | ) |
Definition at line 4029 of file grains.cpp.
References ASSERT, GrainVar::bin, DEBUG_ENTRY, dense, GrainVar::elmSumAbund, t_dense::gas_phase, GrainVar::GrainMetal, GrnStdDpth(), gv, ipHYDROGEN, and LIMELM.
Referenced by GrainChargeTemp(), and GrainDrive().
STATIC void GrainUpdateRadius2 | ( | ) |
Definition at line 4068 of file grains.cpp.
References ASSERT, GrainVar::bin, ChargeBin::cs_pdt, DEBUG_ENTRY, GrainVar::dstab, GrainVar::dstsc, ChargeBin::DustZ, ChargeBin::FracPop, gv, ChargeBin::ipThresInf, t_rfield::nflux, t_rfield::nupper, and rfield.
Referenced by GrainChargeTemp(), and GrainDrive().
void GrainZero | ( | void | ) |
this routine is called by zero(), so it should contain initializations that need to be done every time before the input lines get parsed
Definition at line 504 of file grains.cpp.
References GrainVar::clear(), DEBUG_ENTRY, and gv.
Referenced by zero().
STATIC double GrnStdDpth | ( | long int | nd | ) |
Definition at line 1522 of file grains.cpp.
References GrainVar::bin, GrainVar::chPAH_abundance, DEBUG_ENTRY, dense, DF_STANDARD, DF_SUBLIMATION, DF_USER_FUNCTION, t_dense::gas_phase, GrnVryDpth(), gv, t_hmi::H2_total, hmi, ioQQQ, ipHYDROGEN, MAT_PAH, MAT_PAH2, max(), min(), pow3(), sexp(), TotalInsanity(), and t_dense::xIonDense.
STATIC double GrnStdDpth | ( | long | ) |
Referenced by GrainsInit(), and GrainUpdateRadius1().
STATIC double GrnVryDpth | ( | size_t | nd | ) |
Definition at line 5006 of file grains.cpp.
References ASSERT, GrainVar::bin, DEBUG_ENTRY, dense, t_dense::gas_phase, gv, ipHYDROGEN, max(), min(), and t_dense::xIonDense.
Referenced by GrnStdDpth().
STATIC long HighestIonStage | ( | void | ) |
Definition at line 3723 of file grains.cpp.
References DEBUG_ENTRY, dense, t_dense::lgElmtOn, LIMELM, MAX2, and t_dense::xIonDense.
Referenced by GrainChargeTemp().
STATIC void InitBinAugerData | ( | size_t | nd, | |
long | ipBegin, | |||
long | ipEnd | |||
) |
initialize the Auger data for grain bin nd between index ipBegin <= i < ipEnd
Definition at line 1143 of file grains.cpp.
References t_rfield::anu, GrainVar::AugerData, ShellData::AvNr, GrainVar::bin, flex_arr< T, lgBC >::clear(), DEBUG_ENTRY, ShellData::Ener, EVRYD, gv, Heavy, Singleton< t_ADfA >::Inst(), ShellData::ionPot, ipHYDROGEN, ShellData::ipLo, GrainVar::lgWD01, LIMELM, max(), MAX2, ShellData::nData, t_Heavy::nsShells, AEInfo::nSubShell, t_ADfA::phfit(), flex_arr< T, lgBC >::realloc(), rfield, ShellData::y01, ShellData::y01A, y0psa(), y1psa(), and flex_arr< T, lgBC >::zero().
Referenced by GrainsInit(), and UpdatePot().
STATIC void InitEmissivities | ( | void | ) |
Definition at line 1317 of file grains.cpp.
References ASSERT, GrainVar::bin, cdEXIT, DEBUG_ENTRY, GrainVar::dsttmp, EXIT_SUCCESS, fudge(), GRAIN_TMAX, GRAIN_TMID, GRAIN_TMIN, gv, ioQQQ, t_trace::lgDustBug, t_trace::lgTrace, NDEMS, nint(), NTOP, PlanckIntegral(), pow(), powi(), spline(), splint(), and trace.
Referenced by GrainsInit().
STATIC void NewChargeData | ( | long | nd | ) |
Definition at line 1476 of file grains.cpp.
References GrainVar::bin, DEBUG_ENTRY, fp_equal(), GrainVar::GrnRecomTe, gv, LIMELM, NCHS, GrainVar::nzone, nzone, phycon, and t_phycon::te.
Referenced by GrainChargeTemp().
double one_elec | ( | long | nd | ) | [inline] |
evaluate e^2/a, the potential of one electron
Definition at line 117 of file grains.cpp.
References GrainVar::bin, ELEM_CHARGE, EVRYD, and gv.
Referenced by chrg2pot(), GetPotValues(), and pot2chrg().
STATIC void PE_init | ( | size_t | nd, | |
long | nz, | |||
long | i, | |||
double * | cs1, | |||
double * | cs2, | |||
double * | cs_tot, | |||
double * | cool1, | |||
double * | cool2, | |||
double * | ehat1, | |||
double * | ehat2 | |||
) |
Definition at line 4416 of file grains.cpp.
References t_rfield::anu, ASSERT, GrainVar::bin, ChargeBin::cs_pdt, DEBUG_ENTRY, ChargeBin::DustZ, ChargeBin::ehat, gv, ChargeBin::ipThresInf, ChargeBin::ipThresInfVal, t_rfield::nflux, ChargeBin::PotSurf, rfield, ChargeBin::ThresSurf, ChargeBin::ThresSurfVal, and ChargeBin::yhat.
Referenced by UpdatePot1().
STATIC double PlanckIntegral | ( | double | tdust, | |
size_t | nd, | |||
long int | ip | |||
) |
Definition at line 1397 of file grains.cpp.
References t_rfield::anu, t_rfield::anu3, ASSERT, GrainVar::bin, DEBUG_ENTRY, FR1RYD, gv, HPLANCK, ioQQQ, t_trace::lgDustBug, t_trace::lgTrace, MIN2, t_rfield::nupper, PI4, POW2, powi(), rfield, SPEEDLIGHT, TE1RYD, trace, and t_rfield::widflx.
STATIC double PlanckIntegral | ( | double | , | |
size_t | , | |||
long | ||||
) |
Referenced by InitEmissivities().
double pot2chrg | ( | double | x, | |
long | nd | |||
) | [inline] |
convert grain potential in Ryd to charge in electrons
Definition at line 123 of file grains.cpp.
References one_elec().
Referenced by GrainsInit().
STATIC void ReadAugerData | ( | ) |
Definition at line 1058 of file grains.cpp.
References ASSERT, GrainVar::AugerData, AEInfo::AvNumber, cdEXIT, DEBUG_ENTRY, AEInfo::Energy, EVRYD, EXIT_FAILURE, FILENAME_PATH_LENGTH_2, GetNextLine(), gv, AEInfo::IonThres, ioQQQ, LIMELM, MAGIC_AUGER_DATA, AEInfo::nData, AEInfo::nSubShell, and open_data().
Referenced by GrainsInit().
void SetNChrgStates | ( | long | ) |
this routine is called by ParseSet()
Definition at line 574 of file grains.cpp.
References ASSERT, DEBUG_ENTRY, gv, GrainVar::nChrgRequested, and NCHU.
Referenced by ParseSet().
STATIC double ThetaNu | ( | double | nu | ) |
Definition at line 2798 of file grains.cpp.
References DEBUG_ENTRY, and POW2.
Referenced by GetPotValues(), and GrainScreen().
STATIC void UpdatePot | ( | size_t | nd, | |
long | Zlo, | |||
long | stride, | |||
double | rate_up[], | |||
double | rate_dn[] | |||
) |
Definition at line 2835 of file grains.cpp.
References t_rfield::anu, ASSERT, GrainVar::bin, BOLTZMANN, CONSERV_TOL, DEBUG_ENTRY, EN1RYD, GrainElecEmis1(), GrainElecRecomb1(), gv, InitBinAugerData(), ioQQQ, ipoint(), t_trace::lgDustBug, t_trace::lgTrace, MAX2, MIN2, NCHS, t_rfield::nflux, t_rfield::nupper, phycon, rfield, t_phycon::te, trace, UpdatePot1(), and UpdatePot2().
Referenced by GrainCharge().
STATIC void UpdatePot1 | ( | size_t | nd, | |
long | nz, | |||
long | Zg, | |||
long | ipStart | |||
) |
Definition at line 3092 of file grains.cpp.
References ALL_STAGES, t_rfield::anu, ASSERT, ShellData::AvNr, GrainVar::bin, chrg2pot(), DEBUG_ENTRY, ShellData::Ener, EVRYD, GetPotValues(), gv, hunt_bisect(), INCL_TUNNEL, ShellData::ionPot, LIMELM, max(), MAX2, min(), ShellData::nData, t_rfield::nflux, NO_TUNNEL, t_rfield::nupper, ShellData::p, PE_init(), POW2, rfield, UpdateRecomZ0(), ShellData::y01, ShellData::y01A, y0b(), and Yfunc().
Referenced by UpdatePot().
STATIC void UpdatePot2 | ( | size_t | nd, | |
long | nz | |||
) |
Definition at line 3371 of file grains.cpp.
References GrainVar::bin, DEBUG_ENTRY, gv, POW2, TE1RYD, and THERMCONST.
Referenced by UpdatePot().
STATIC void UpdateRecomZ0 | ( | size_t | nd, | |
long | nz, | |||
bool | lgAllIonStages | |||
) |
Definition at line 3750 of file grains.cpp.
References GrainVar::bin, DEBUG_ENTRY, dense, GetPotValues(), GrainIonColl(), gv, GrainVar::HighestIon, INCL_TUNNEL, t_dense::lgElmtOn, LIMELM, NO_TUNNEL, and t_dense::xIonDense.
Referenced by UpdatePot1().
STATIC double y0b | ( | size_t | nd, | |
long | nz, | |||
long | i | |||
) |
Definition at line 3445 of file grains.cpp.
References t_rfield::anu, ASSERT, GrainVar::bin, DEBUG_ENTRY, EVRYD, gv, GrainVar::lgWD01, rfield, and y0b01().
Referenced by UpdatePot1().
STATIC double y0b01 | ( | size_t | nd, | |
long | nz, | |||
long | i | |||
) |
Definition at line 3480 of file grains.cpp.
References t_rfield::anu, ASSERT, GrainVar::bin, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, gv, ioQQQ, MAX2, PE_CAR, PE_SIL, POW2, POW3, rfield, and GrainVar::which_pe.
Referenced by y0b().
STATIC double y0psa | ( | size_t | nd, | |
long | ns, | |||
long | i, | |||
double | Eel | |||
) |
Definition at line 3513 of file grains.cpp.
References ASSERT, GrainVar::bin, DEBUG_ENTRY, elec_esc_length(), and gv.
Referenced by InitBinAugerData().
STATIC double y1psa | ( | size_t | nd, | |
long | i, | |||
double | Eel | |||
) |
Definition at line 3544 of file grains.cpp.
References ASSERT, GrainVar::bin, DEBUG_ENTRY, elec_esc_length(), gv, pow2(), and pow3().
Referenced by InitBinAugerData().
double y2pa | ( | double | Elo, | |
double | Ehi, | |||
long | Zg, | |||
double * | Ehp | |||
) | [inline] |
Definition at line 3572 of file grains.cpp.
References ASSERT, DEBUG_ENTRY, and pow3().
Referenced by Yfunc().
double y2s | ( | double | Elo, | |
double | Ehi, | |||
long | Zg, | |||
double * | Ehs | |||
) | [inline] |
Definition at line 3616 of file grains.cpp.
References ASINH(), ASSERT, DEBUG_ENTRY, ETILDE, gv, GrainVar::lgWD01, and x2.
Referenced by Yfunc().
void Yfunc | ( | long | nd, | |
long | nz, | |||
double | y01, | |||
double | maxval, | |||
double | Elo, | |||
double | Ehi, | |||
double | Eel, | |||
double * | Yp, | |||
double * | Ys, | |||
double * | Ehp, | |||
double * | Ehs | |||
) | [inline] |
Definition at line 3390 of file grains.cpp.
References ASSERT, GrainVar::bin, cdEXIT, DEBUG_ENTRY, elec_esc_length(), EVRYD, EXIT_FAILURE, gv, ioQQQ, max(), min(), PE_CAR, PE_SIL, GrainVar::which_pe, y2pa(), and y2s().
Referenced by UpdatePot1().
const double AC0 = 3.e-9 [static] |
Definition at line 102 of file grains.cpp.
Referenced by GetPotValues().
const double AC1G = 4.e-8 [static] |
Definition at line 103 of file grains.cpp.
Referenced by GetPotValues().
const double AC2G = 7.e-8 [static] |
Definition at line 104 of file grains.cpp.
Referenced by GetPotValues().
const bool ALL_STAGES = true [static] |
Definition at line 63 of file grains.cpp.
Referenced by UpdatePot1().
const long BRACKET_MAX = 50L [static] |
Definition at line 78 of file grains.cpp.
Referenced by GrainCharge().
double CHRG_TOLER = DBL_MAX [static] |
Definition at line 95 of file grains.cpp.
Referenced by GrainChargeTemp(), and GrainsInit().
const long CT_LOOP_MAX = 25L [static] |
Definition at line 87 of file grains.cpp.
Definition at line 107 of file grains.cpp.
Referenced by y2s().
double HEAT_TOLER = DBL_MAX [static] |
Definition at line 93 of file grains.cpp.
Referenced by GrainChargeTemp(), and GrainsInit().
double HEAT_TOLER_BIN = DBL_MAX [static] |
Definition at line 94 of file grains.cpp.
Referenced by GrainChargeTemp(), and GrainsInit().
const bool INCL_TUNNEL = true [static] |
Definition at line 60 of file grains.cpp.
Referenced by GrainsInit(), UpdatePot1(), and UpdateRecomZ0().
const long MAGIC_AUGER_DATA = 20060126L [static] |
Definition at line 58 of file grains.cpp.
Referenced by ReadAugerData().
long int nCalledGrainDrive [static] |
Definition at line 67 of file grains.cpp.
Referenced by GrainDrive(), and GrainVar::p_clear1().
Definition at line 82 of file grains.cpp.
Referenced by GetFracPop(), GrainCharge(), GrainsInit(), and SetNChrgStates().
const bool NO_TUNNEL = false [static] |
Definition at line 61 of file grains.cpp.
Referenced by GrainIonColl(), UpdatePot1(), and UpdateRecomZ0().
Definition at line 73 of file grains.cpp.
Referenced by InitEmissivities().
const double STICK_ELEC = 0.5 [static] |
Definition at line 113 of file grains.cpp.
Referenced by GrainsInit().
const double STICK_ION = 1.0 [static] |
Definition at line 114 of file grains.cpp.
Referenced by GrainChrgTransferRates(), GrainCollHeating(), GrainElecEmis1(), and GrainElecRecomb1().
const long T_LOOP_MAX = 50L [static] |
Definition at line 90 of file grains.cpp.
Referenced by GrainChargeTemp().
const double THERMCONST = PI4*ELECTRON_MASS*POW2(BOLTZMANN)/POW3(HPLANCK) [static] |
Definition at line 110 of file grains.cpp.
Referenced by UpdatePot2().
const double TOLER = CONSERV_TOL/10. [static] |
Definition at line 77 of file grains.cpp.
Referenced by GrainChargeTemp(), mie_auxiliary(), and search_limit().