/home66/gary/public_html/cloudy/c08_branch/source/grains.cpp File Reference

#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 dependency graph for grains.cpp:

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 (long, long, long)
STATIC void GetNextLine (const char *, FILE *, char[])
STATIC void InitEmissivities (void)
STATIC double PlanckIntegral (double, long, long)
STATIC void NewChargeData (long)
STATIC double GrnStdDpth (long)
STATIC void GrainChargeTemp (void)
STATIC void GrainCharge (long, double *)
STATIC double GrainElecRecomb1 (long, long, double *, double *)
STATIC double GrainElecEmis1 (long, long, double *, double *, double *, double *)
STATIC void GrainScreen (long, long, long, double *, double *)
STATIC double ThetaNu (double)
STATIC void UpdatePot (long, long, long, double[], double[])
STATIC void GetFracPop (long, long, double[], double[], long *)
STATIC void UpdatePot1 (long, long, long, long)
STATIC void UpdatePot2 (long, long)
void Yfunc (long, long, double, double, double, double, double, double *, double *, double *, double *)
STATIC double y0b (long, long, long)
STATIC double y0b01 (long, long, long)
STATIC double y0psa (long, long, long, double)
STATIC double y1psa (long, long, double)
double y2pa (double, double, long, double *)
double y2s (double, double, long, double *)
STATIC long HighestIonStage (void)
STATIC void UpdateRecomZ0 (long, long, bool)
STATIC void GetPotValues (long, long, double *, double *, double *, double *, double *, double *, bool)
STATIC void GrainIonColl (long, long, long, long, const double[], const double[], long *, realnum *, realnum *)
STATIC void GrainChrgTransferRates (long)
STATIC void GrainUpdateRadius1 (void)
STATIC void GrainUpdateRadius2 (bool)
STATIC void GrainTemperature (long, realnum *, double *, double *, double *)
STATIC void PE_init (long, long, long, double *, double *, double *, double *, double *, double *, double *)
STATIC void GrainCollHeating (long, realnum *, realnum *)
STATIC double GrnVryDpth (long)
void GrainZero (void)
void GrainStartIter (void)
void GrainRestartIter (void)
void SetNChrgStates (long nChrg)
long NewGrainBin (void)
void ReturnGrainBins (void)
void GrainsInit (void)
STATIC double PlanckIntegral (double tdust, long int nd, long int ip)
STATIC double GrnStdDpth (long int nd)
void GrainDrive (void)
STATIC void GrainCharge (long int nd, double *ThermRatio)
STATIC void GrainIonColl (long int 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)
STATIC void GrainTemperature (long int nd, realnum *dccool, double *hcon, double *hots, double *hla)
STATIC void GrainCollHeating (long int nd, realnum *dcheat, realnum *dccool)
void GrainDrift (void)
STATIC double GrnVryDpth (long int nd)

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 bool lgGvInitialized = false
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 Documentation

#define FREE_CHECK ( PTR   )     { ASSERT( PTR != NULL ); free( PTR ); PTR = NULL; }

Definition at line 54 of file grains.cpp.

Referenced by FreeGrid(), InitGridCoStar(), InterpolateModelCoStar(), lgCompileAtmosphere(), lgCompileAtmosphereCoStar(), RauchInitializeSub(), StarburstInitialize(), and ValidateGrid().

#define FREE_SAFE ( PTR   )     { if( PTR != NULL ) free( PTR ); PTR = NULL; }

Definition at line 55 of file grains.cpp.

Referenced by FreeGrid(), lgCompileAtmosphere(), lgCompileAtmosphereCoStar(), ReturnGrainBins(), and StarburstInitialize().


Function Documentation

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 33 of file grains.cpp.

References LN_TWO, and pow2().

Referenced by y2s().

Here is the call graph for this function:

double chrg2pot ( double  x,
long  nd 
) [inline]

convert grain charge in electrons into potential in Ryd

Definition at line 131 of file grains.cpp.

References one_elec().

Referenced by GetPotValues(), GrainCharge(), GrainDrive(), and UpdatePot1().

Here is the call graph for this function:

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 138 of file grains.cpp.

References t_gv::bin, GrainBin::eec, EVRYD, gv, GrainBin::le_thres, and pow3().

Referenced by y0psa(), y1psa(), and Yfunc().

Here is the call graph for this function:

STATIC void GetFracPop ( long  ,
long  ,
double  [],
double  [],
long *   
)

Definition at line 2986 of file grains.cpp.

References ASSERT, t_gv::bin, DEBUG_ENTRY, fnzone, gv, GrainBin::LowestZg, t_gv::nBin, GrainBin::nChrg, and NCHU.

Referenced by GrainCharge().

STATIC void GetNextLine ( const char *  ,
FILE *  ,
char  [] 
)

Definition at line 1345 of file grains.cpp.

References cdEXIT, DEBUG_ENTRY, FILENAME_PATH_LENGTH_2, ioQQQ, and read_whole_line().

Referenced by ReadAugerData().

Here is the call graph for this function:

STATIC void GetPotValues ( long  ,
long  ,
double *  ,
double *  ,
double *  ,
double *  ,
double *  ,
double *  ,
bool   
)

Definition at line 3852 of file grains.cpp.

References AC0, AC1G, AC2G, GrainBin::AvRadius, GrainBin::BandGap, t_gv::bin, cdEXIT, chrg2pot(), DEBUG_ENTRY, GrainBin::DustWorkFcn, gv, GrainBin::matType, MAX2, one_elec(), POT_CAR, POT_SIL, ThetaNu(), and t_gv::which_pot.

Referenced by GrainIonColl(), UpdatePot1(), and UpdateRecomZ0().

Here is the call graph for this function:

STATIC void GrainCharge ( long int  nd,
double *  ThermRatio 
)

Definition at line 2279 of file grains.cpp.

References ASSERT, GrainBin::AveDustZ, t_gv::bin, BRACKET_MAX, cdEXIT, GrainBin::chDstLab, GrainBin::chrg, chrg2pot(), conv, DEBUG_ENTRY, GrainBin::dstpot, ChargeBin::DustZ, EVRYD, fnzone, ChargeBin::FracPop, GetFracPop(), GrainElecEmis1(), GrainElecRecomb1(), gv, GrainBin::lgChrgConverged, t_trace::lgDustBug, t_conv::lgSearch, t_trace::lgTrace, GrainBin::LowestZg, MAX2, t_gv::nBin, GrainBin::nChrg, NCHU, nint(), powi(), ShowMe(), ChargeBin::ThresInf, ChargeBin::ThresInfVal, TorF(), trace, and UpdatePot().

Here is the call graph for this function:

STATIC void GrainCharge ( long  ,
double *   
)

STATIC void GrainChargeTemp ( void   ) 

Definition at line 1780 of file grains.cpp.

References t_gv::bin, conv, DEBUG_ENTRY, dense, t_dense::gas_phase, t_gv::GasCoolColl, t_gv::GasHeatPhotoEl, t_gv::GasHeatTherm, t_gv::GrainChTrRate, t_gv::GrainHeatChem, t_gv::GrainHeatCollSum, t_gv::GrainHeatDif, t_gv::GrainHeatInc, t_gv::GrainHeatLya, t_gv::GrainHeatSum, GrainUpdateRadius1(), gv, t_gv::HighestIon, HighestIonStage(), ioQQQ, ipHYDROGEN, t_trace::lgDustBug, GrainBin::lgPAHsInIonizedRegion, t_conv::lgSearch, t_trace::lgTrace, MAT_PAH, MAT_PAH2, GrainBin::matType, t_gv::nBin, TorF(), t_gv::TotalEden, trace, and t_dense::xIonDense.

Referenced by GrainDrive().

Here is the call graph for this function:

STATIC void GrainChrgTransferRates ( long   ) 

Definition at line 4026 of file grains.cpp.

References t_DoppVel::AveVel, t_gv::bin, GrainBin::chrg, GrainBin::cnv_H_pCM3, DEBUG_ENTRY, dense, DoppVel, ChargeBin::FracPop, t_gv::GrainChTrRate, GrainScreen(), gv, GrainBin::IntArea, t_dense::lgElmtOn, MAX2, GrainBin::nChrg, ChargeBin::RecomZ0, and STICK_ION.

Here is the call graph for this function:

STATIC void GrainCollHeating ( long int  nd,
realnum dcheat,
realnum dccool 
)

Definition at line 4569 of file grains.cpp.

References GrainBin::AccomCoef, t_DoppVel::AveVel, t_gv::bin, GrainBin::ChemEn, GrainBin::chrg, DEBUG_ENTRY, dense, DoppVel, GrainScreen(), gv, H2_TOP, t_dense::lgElmtOn, MAX2, GrainBin::nChrg, STICK_ION, and t_dense::xIonDense.

Here is the call graph for this function:

STATIC void GrainCollHeating ( long  ,
realnum ,
realnum  
)

void GrainDrift ( void   ) 

GrainDrift computes grains drift velocity

Definition at line 4950 of file grains.cpp.

References t_rfield::anu, ASSERT, GrainBin::asym, t_gv::bin, BOLTZMANN, t_rfield::ConInterOut, DEBUG_ENTRY, dense, GrainBin::dstab1, GrainBin::dstpot, GrainBin::DustDftVel, t_dense::eden, EN1RYD, t_rfield::flux, gv, GrainBin::IntArea, ipHELIUM, ipHYDROGEN, t_trace::lgDustBug, t_gv::lgNegGrnDrg, t_trace::lgTrace, MALLOC, t_gv::nBin, t_rfield::nflux, t_rfield::outlin, t_rfield::outlin_noplot, phycon, POW2, POW3, GrainBin::pure_sc1, 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 1621 of file grains.cpp.

References GrainBin::avdft, GrainBin::avDGRatio, GrainBin::avdpot, GrainBin::avdust, GrainBin::AveDustZ, t_gv::bin, GrainBin::BolFlux, GrainBin::ChemEn, GrainBin::ChemEnH2, GrainBin::chrg, chrg2pot(), conv, t_thermal::ctot, t_gv::dclmax, DEBUG_ENTRY, dense, t_gv::dphmax, GrainBin::dstpot, GrainBin::DustDftVel, ChargeBin::DustZ, t_dense::eden, t_conv::EdenErrorAllowed, EVRYD, fp_equal(), ChargeBin::FracPop, t_dense::gas_phase, t_gv::GasCoolColl, t_gv::GasHeatPhotoEl, GrainBin::GasHeatPhotoEl, GrainChargeTemp(), t_gv::GrainChTrRate, GrainBin::GrainCoolTherm, GrainBin::GrainHeat, t_gv::GrainHeatChem, GrainBin::GrainHeatColl, t_gv::GrainHeatCollSum, t_gv::GrainHeatDif, t_gv::GrainHeatInc, t_gv::GrainHeatLya, t_gv::GrainHeatScaleFactor, t_gv::GrainHeatSum, GrainUpdateRadius1(), GrainUpdateRadius2(), t_gv::GrnElecDonateMax, t_gv::GrnElecHoldMax, gv, t_thermal::heating, hmi, ioQQQ, ipHYDROGEN, t_gv::lgAnyDustVary, t_gv::lgAnyNegCharge, t_gv::lgBakesPAH_heat, t_gv::lgDustOn, GrainBin::lgEverQHeat, t_gv::lgGrainPhysicsOn, GrainBin::lgPAHsInIonizedRegion, t_gv::lgReevaluate, t_conv::lgSearch, GrainBin::lgUseQHeat, t_gv::nBin, nCalledGrainDrive, GrainBin::nChrg, ChargeBin::nfill, t_trace::nTrConvg, nzone, phycon, GrainBin::QHeatFailures, SDIV(), t_phycon::te, ChargeBin::tedust, GrainBin::tedust, GrainBin::TeGrainMax, thermal, GrainBin::thermionic, t_gv::TotalDustHeat, t_gv::TotalEden, trace, and t_hmi::UV_Cont_rel2_Habing_TH85_depth.

Here is the call graph for this function:

STATIC double GrainElecEmis1 ( long  ,
long  ,
double *  ,
double *  ,
double *  ,
double *   
)

Definition at line 2643 of file grains.cpp.

References ASSERT, t_gv::bin, GrainBin::chrg, ChargeBin::cs_pdt, DEBUG_ENTRY, GrainBin::dstab1, ChargeBin::DustZ, ChargeBin::ESum1a, ChargeBin::ESum1b, ChargeBin::ESum2, t_rfield::flux, gv, GrainBin::IntArea, ChargeBin::ipThresInf, ChargeBin::ipThresInfVal, t_gv::nBin, GrainBin::nChrg, t_rfield::nflux, rfield, t_rfield::SummedCon, ChargeBin::ThermRate, and ChargeBin::yhat.

Referenced by GrainCharge(), and UpdatePot().

STATIC double GrainElecRecomb1 ( long  ,
long  ,
double *  ,
double *   
)

Definition at line 2560 of file grains.cpp.

References ASSERT, t_DoppVel::AveVel, t_gv::bin, BOLTZMANN, GrainBin::chrg, DEBUG_ENTRY, dense, DoppVel, ChargeBin::DustZ, t_dense::eden, ELECTRON_MASS, GrainScreen(), gv, t_dense::lgElmtOn, GrainBin::LowestZg, MAX2, t_gv::nBin, GrainBin::nChrg, phycon, PI, ChargeBin::RecomZ0, ChargeBin::RSum1, ChargeBin::RSum2, STICK_ION, GrainBin::StickElecNeg, GrainBin::StickElecPos, t_phycon::te, and t_dense::xIonDense.

Referenced by GrainCharge(), and UpdatePot().

Here is the call graph for this function:

STATIC void GrainIonColl ( long int  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 3946 of file grains.cpp.

References t_rfield::anu, t_gv::bin, GrainBin::chrg, DEBUG_ENTRY, ChargeBin::DustZ, GetPotValues(), gv, Heavy, t_Heavy::ipHeavy, GrainBin::LowestZg, NO_TUNNEL, and rfield.

Here is the call graph for this function:

STATIC void GrainIonColl ( long  ,
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 391 of file grains.cpp.

References t_gv::bin, DEBUG_ENTRY, GrainBin::dstpot, GrainBin::dstpotsav, gv, t_gv::lgDustOn, t_gv::lgGrainPhysicsOn, t_gv::nBin, GrainBin::nChrg, and GrainBin::nChrgOrg.

STATIC void GrainScreen ( long  ,
long  ,
long  ,
double *  ,
double *   
)

Definition at line 2766 of file grains.cpp.

References ASSERT, t_gv::bin, BOLTZMANN, GrainBin::Capacity, GrainBin::chrg, DEBUG_ENTRY, ChargeBin::DustZ, ELEM_CHARGE, ChargeBin::eta, gv, MIN2, phycon, PI, POW2, t_phycon::te, ThetaNu(), and ChargeBin::xi.

Referenced by GrainChrgTransferRates(), GrainCollHeating(), and GrainElecRecomb1().

Here is the call graph for this function:

void GrainsInit ( void   ) 

startup routine for grains, called before first calculations, but after parsecommands

Todo:
xray - StickElec depends on Te ???? use elec_esc_length(1.5*kTe,nd) ????

Definition at line 585 of file grains.cpp.

References t_gv::anumax, t_gv::anumin, ASSERT, t_gv::bin, DEBUG_ENTRY, t_gv::dstab, t_gv::dstsc, t_gv::elmSumAbund, t_gv::GasCoolColl, t_gv::GrainEmission, t_gv::GrainHeatCollSum, t_gv::GrainHeatDif, t_gv::GrainHeatInc, t_gv::GrainHeatLya, t_gv::GrainHeatSum, t_gv::GraphiteEmission, gv, t_thermal::heating, ioQQQ, t_trace::lgDustBug, t_gv::lgDustOn, t_trace::lgTrace, MALLOC, t_gv::nBin, NDUST, t_rfield::nupper, rfield, t_gv::SilicateEmission, thermal, and trace.

Referenced by OpacityCreateAll().

void GrainStartIter ( void   ) 

this routine is called by IterStart()

Definition at line 358 of file grains.cpp.

References GrainBin::avdft, GrainBin::avDGRatio, GrainBin::avdpot, GrainBin::avdust, t_gv::bin, DEBUG_ENTRY, GrainBin::dstpot, GrainBin::dstpotsav, gv, t_gv::lgDustOn, GrainBin::lgEverQHeat, t_gv::lgGrainPhysicsOn, GrainBin::lgPAHsInIonizedRegion, GrainBin::lgQHTooWide, t_gv::nBin, GrainBin::nChrg, GrainBin::nChrgOrg, GrainBin::QHeatFailures, GrainBin::qtmin, GrainBin::qtmin_zone1, and GrainBin::TeGrainMax.

STATIC void GrainTemperature ( long int  nd,
realnum dccool,
double *  hcon,
double *  hots,
double *  hla 
)

Definition at line 4182 of file grains.cpp.

References t_rfield::anu, ASSERT, t_gv::bin, GrainBin::BolFlux, GrainBin::chDstLab, GrainBin::chrg, DEBUG_ENTRY, GrainBin::dstab1, t_rfield::flux, GrainBin::GasHeatPhotoEl, GrainBin::GrainCoolTherm, gv, ChargeBin::hcon1, ipH1s, ipH2p, ipH_LIKE, ipHYDROGEN, t_trace::lgDustBug, t_trace::lgTrace, MIN2, t_gv::nBin, GrainBin::nChrg, t_rfield::nflux, rfield, t_rfield::SummedCon, t_rfield::SummedDif, GrainBin::thermionic, trace, and Transitions.

STATIC void GrainTemperature ( long  ,
realnum ,
double *  ,
double *  ,
double *   
)

STATIC void GrainUpdateRadius1 ( void   ) 

Definition at line 4075 of file grains.cpp.

References ASSERT, t_gv::bin, GrainBin::cnv_CM3_pGR, GrainBin::cnv_CM3_pH, GrainBin::cnv_GR_pCM3, GrainBin::cnv_H_pCM3, GrainBin::cnv_H_pGR, DEBUG_ENTRY, dense, GrainBin::dstAbund, GrainBin::dstfactor, GrainBin::elmAbund, t_gv::elmSumAbund, t_dense::gas_phase, t_gv::GrainMetal, GrnVryDpth(), GrainBin::GrnVryDpth, gv, ipHYDROGEN, and t_gv::nBin.

Referenced by GrainChargeTemp(), and GrainDrive().

Here is the call graph for this function:

STATIC void GrainUpdateRadius2 ( bool   ) 

Definition at line 4116 of file grains.cpp.

References ASSERT, GrainBin::asym, t_gv::bin, GrainBin::chrg, DEBUG_ENTRY, t_gv::dstab, GrainBin::dstab1, GrainBin::dstAbund, t_gv::dstsc, gv, ChargeBin::ipThresInf, t_gv::lgAnyDustVary, t_gv::lgAnyNegCharge, t_gv::nBin, GrainBin::nChrg, t_gv::nfill, t_rfield::nflux, t_rfield::nupper, t_gv::nzone, nzone, GrainBin::pure_sc1, and rfield.

Referenced by GrainDrive().

void GrainZero ( void   ) 

initialize some variables, called by zero()

Definition at line 239 of file grains.cpp.

References t_gv::chPAH_abundance_fcn, DEBUG_ENTRY, t_gv::dHeatdT, t_gv::dstAbundThresholdFar, t_gv::dstAbundThresholdNear, ENTH_CAR, ENTH_CAR2, ENTH_PAH, ENTH_PAH2, ENTH_SIL, ENTH_SIL2, t_gv::GrainChTrRate, t_gv::GrainHeatScaleFactor, t_gv::GrainMetal, gv, H2_CAR, H2_SIL, IAL_CAR, IAL_SIL, t_gv::lgAnyDustVary, t_gv::lgBakes, t_gv::lgBakesPAH_heat, t_gv::lgDColOn, t_gv::lgDHetOn, t_gv::lgGrainElectrons, t_gv::lgGrainPhysicsOn, t_gv::lgNegGrnDrg, t_gv::lgQHeatAll, t_gv::lgQHeatOn, t_gv::lgReevaluate, t_gv::lgWD01, LIMELM, MAT_CAR, MAT_CAR2, MAT_PAH, MAT_PAH2, MAT_SIL, MAT_SIL2, nCalledGrainDrive, NCHRG_DEFAULT, t_gv::nChrgRequested, PE_CAR, PE_SIL, POT_CAR, POT_SIL, t_gv::ReadPtr, ReturnGrainBins(), STRG_CAR, STRG_SIL, t_gv::TotalEden, t_gv::which_enth, t_gv::which_H2distr, t_gv::which_ial, t_gv::which_pe, t_gv::which_pot, t_gv::which_strg, t_gv::which_zmin, ZMIN_CAR, and ZMIN_SIL.

Here is the call graph for this function:

STATIC double GrnStdDpth ( long int  nd  ) 

Definition at line 1578 of file grains.cpp.

References ASSERT, t_gv::bin, t_gv::chPAH_abundance_fcn, DEBUG_ENTRY, dense, t_dense::gas_phase, gv, ipHYDROGEN, MAT_PAH, MAT_PAH2, GrainBin::matType, max(), TotalInsanity(), and t_dense::xIonDense.

Here is the call graph for this function:

STATIC double GrnStdDpth ( long   ) 

Referenced by GrnVryDpth().

STATIC double GrnVryDpth ( long int  nd  ) 

Definition at line 5071 of file grains.cpp.

References ASSERT, t_gv::bin, DEBUG_ENTRY, dense, t_dense::gas_phase, GrnStdDpth(), gv, ipHYDROGEN, GrainBin::lgDustFunc, and t_dense::xIonDense.

Here is the call graph for this function:

STATIC double GrnVryDpth ( long   ) 

Referenced by GrainUpdateRadius1().

STATIC long HighestIonStage ( void   ) 

Definition at line 3769 of file grains.cpp.

References DEBUG_ENTRY, dense, t_dense::lgElmtOn, MAX2, and t_dense::xIonDense.

Referenced by GrainChargeTemp().

STATIC void InitBinAugerData ( long  nd,
long  ipBegin,
long  ipEnd 
)

initialize the Auger data for grain bin nd between index ipBegin <= i < ipEnd

Todo:
xray - Compton recoil still needs to be added here

Definition at line 1198 of file grains.cpp.

References t_rfield::anu, t_gv::AugerData, GrainBin::AvVol, t_gv::bin, GrainBin::cnv_H_pGR, DEBUG_ENTRY, GrainBin::elmAbund, EVRYD, gv, Heavy, Singleton< T >::Inst(), ipHYDROGEN, ShellData::ipLo, max(), ShellData::nelem, ShellData::ns, GrainBin::nShells, t_Heavy::nsShells, AEInfo::nSubShell, ShellData::p, rfield, GrainBin::sd, and flex_arr< T, lgBC >::zero().

Referenced by UpdatePot().

Here is the call graph for this function:

STATIC void InitEmissivities ( void   ) 

Definition at line 1372 of file grains.cpp.

References ASSERT, t_gv::bin, cdEXIT, DEBUG_ENTRY, GrainBin::dstems, GrainBin::dstslp, GrainBin::dstslp2, t_gv::dsttmp, fudge(), GRAIN_TMAX, GRAIN_TMID, GRAIN_TMIN, gv, ioQQQ, t_trace::lgDustBug, t_trace::lgTrace, t_gv::nBin, NDEMS, nint(), NTOP, PlanckIntegral(), powi(), spline(), splint(), and trace.

Here is the call graph for this function:

STATIC void NewChargeData ( long   ) 

Definition at line 1532 of file grains.cpp.

References t_gv::bin, ChargeBin::bolflux1, GrainBin::chrg, DEBUG_ENTRY, ChargeBin::ESum1a, ChargeBin::ESum1b, ChargeBin::ESum2, ChargeBin::eta, ChargeBin::GrainHeat, t_gv::GrnRecomTe, gv, ChargeBin::HeatingRate2, ChargeBin::hots1, ChargeBin::pe1, phycon, ChargeBin::RSum1, ChargeBin::RSum2, t_phycon::te, ChargeBin::ThermRate, and ChargeBin::xi.

long NewGrainBin ( void   ) 

allocate new grain bin

Definition at line 422 of file grains.cpp.

References ASSERT, GrainBin::asym, t_gv::bin, cdEXIT, GrainBin::chrg, GrainBin::cnv_CM3_pGR, GrainBin::cnv_CM3_pH, GrainBin::cnv_GR_pCM3, GrainBin::cnv_GR_pH, GrainBin::cnv_H_pCM3, GrainBin::cnv_H_pGR, DEBUG_ENTRY, GrainBin::dstab1, GrainBin::dstAbund, GrainBin::dstfactor, GrainBin::DustDftVel, GrainBin::EnergyCheck, GrainBin::GrainGasCool, GrainBin::GrainHeat, GrainBin::GrnVryDpth, gv, GrainBin::inv_att_len, ioQQQ, GrainBin::le_thres, GrainBin::lgDustFunc, t_gv::lgDustOn, lgGvInitialized, GrainBin::lgQHeat, MALLOC, t_gv::nBin, GrainBin::nChrg, t_gv::nChrgRequested, NCHS, NDUST, GrainBin::nfill, NSHL, GrainBin::pure_sc1, GrainBin::qnflux, GrainBin::rate_h2_form_grains_used, GrainBin::sd, GrainBin::tedust, GrainBin::TeGrainMax, and GrainBin::y0b06.

double one_elec ( long  nd  )  [inline]

evaluate e^2/a, the potential of one electron

Definition at line 118 of file grains.cpp.

References t_gv::bin, GrainBin::Capacity, ELEM_CHARGE, EVRYD, and gv.

Referenced by chrg2pot(), GetPotValues(), and pot2chrg().

STATIC void PE_init ( long  ,
long  ,
long  ,
double *  ,
double *  ,
double *  ,
double *  ,
double *  ,
double *  ,
double *   
)

Definition at line 4478 of file grains.cpp.

References t_rfield::anu, ASSERT, t_gv::bin, GrainBin::chrg, ChargeBin::cs_pdt, DEBUG_ENTRY, GrainBin::dstab1, ChargeBin::DustZ, ChargeBin::ehat, gv, ChargeBin::ipThresInf, ChargeBin::ipThresInfVal, t_gv::nBin, GrainBin::nChrg, t_rfield::nflux, ChargeBin::PotSurf, rfield, ChargeBin::ThresSurf, ChargeBin::ThresSurfVal, and ChargeBin::yhat.

STATIC double PlanckIntegral ( double  tdust,
long int  nd,
long int  ip 
)

Definition at line 1453 of file grains.cpp.

References t_rfield::anu, t_rfield::anu3, t_gv::bin, DEBUG_ENTRY, GrainBin::dstab1, FR1RYD, gv, HPLANCK, MIN2, t_rfield::nupper, PI4, POW2, rfield, SPEEDLIGHT, TE1RYD, and t_rfield::widflx.

STATIC double PlanckIntegral ( double  ,
long  ,
long   
)

Referenced by InitEmissivities().

double pot2chrg ( double  x,
long  nd 
) [inline]

convert grain potential in Ryd to charge in electrons

Definition at line 124 of file grains.cpp.

References one_elec().

Here is the call graph for this function:

STATIC void ReadAugerData (  ) 

Definition at line 1114 of file grains.cpp.

References ASSERT, t_gv::AugerData, AEInfo::AvNumber, cdEXIT, DEBUG_ENTRY, AEInfo::Energy, EVRYD, FILENAME_PATH_LENGTH_2, GetNextLine(), gv, AEInfo::IonThres, ioQQQ, MAGIC_AUGER_DATA, MALLOC, AEInfo::nData, AEInfo::nSubShell, and open_data().

Here is the call graph for this function:

void ReturnGrainBins ( void   ) 

deallocate grain bins

Definition at line 488 of file grains.cpp.

References ASSERT, GrainBin::asym, ShellData::AvNr, t_gv::bin, GrainBin::chrg, DEBUG_ENTRY, GrainBin::dstab1, ShellData::Ener, FREE_SAFE, gv, GrainBin::inv_att_len, lgGvInitialized, t_gv::nBin, NCHS, NSHL, GrainBin::pure_sc1, GrainBin::sd, and GrainBin::y0b06.

Referenced by GrainZero(), grid_do(), and main().

void SetNChrgStates ( long   ) 

this routine is called by ParseSet()

Definition at line 412 of file grains.cpp.

References ASSERT, DEBUG_ENTRY, gv, t_gv::nChrgRequested, and NCHU.

Referenced by ParseSet().

STATIC double ThetaNu ( double   ) 

Definition at line 2844 of file grains.cpp.

References DEBUG_ENTRY, and POW2.

Referenced by GetPotValues(), and GrainScreen().

STATIC void UpdatePot ( long  ,
long  ,
long  ,
double  [],
double  [] 
)

Definition at line 2881 of file grains.cpp.

References ASSERT, t_gv::bin, GrainBin::chrg, DEBUG_ENTRY, ChargeBin::DustZ, GrainElecEmis1(), GrainElecRecomb1(), gv, InitBinAugerData(), t_trace::lgDustBug, t_trace::lgTrace, GrainBin::LowestZg, t_gv::nBin, GrainBin::nChrg, ChargeBin::nfill, GrainBin::nfill, t_rfield::nflux, rfield, trace, UpdatePot1(), and UpdatePot2().

Referenced by GrainCharge().

Here is the call graph for this function:

STATIC void UpdatePot1 ( long  ,
long  ,
long  ,
long   
)

Definition at line 3138 of file grains.cpp.

References t_rfield::anu, ASSERT, ShellData::AvNr, t_gv::bin, GrainBin::chrg, chrg2pot(), DEBUG_ENTRY, GrainBin::DustWorkFcn, ChargeBin::DustZ, ChargeBin::ehat, Ehi, Elo, ChargeBin::Emin, ChargeBin::EminInc, ShellData::Ener, ChargeBin::eta, EVRYD, GetPotValues(), gv, hunt_bisect(), INCL_TUNNEL, ShellData::ionPot, ShellData::ipLo, ChargeBin::ipThresInfVal, max(), min(), ShellData::nData, ChargeBin::nfill, t_rfield::nflux, NO_TUNNEL, GrainBin::nShells, t_rfield::nupper, ShellData::p, ChargeBin::PotSurf, ChargeBin::PotSurfInc, rfield, GrainBin::sd, ChargeBin::ThresInf, ChargeBin::ThresInfInc, ChargeBin::ThresInfVal, ChargeBin::ThresSurf, ChargeBin::ThresSurfInc, ChargeBin::ThresSurfVal, ChargeBin::xi, ShellData::y01, ShellData::y01A, y0b(), Yfunc(), ChargeBin::yhat, and ChargeBin::yhat_primary.

Referenced by UpdatePot().

Here is the call graph for this function:

STATIC void UpdatePot2 ( long  ,
long   
)

Definition at line 3417 of file grains.cpp.

References t_gv::bin, GrainBin::chrg, DEBUG_ENTRY, gv, POW2, TE1RYD, GrainBin::tedust, THERMCONST, GrainBin::ThermEff, ChargeBin::ThermRate, and ChargeBin::ThresInf.

Referenced by UpdatePot().

STATIC void UpdateRecomZ0 ( long  ,
long  ,
bool   
)

Definition at line 3796 of file grains.cpp.

References t_gv::bin, ChargeBin::ChemEn, GrainBin::chrg, DEBUG_ENTRY, dense, ChargeBin::DustZ, GetPotValues(), GrainIonColl(), gv, t_gv::HighestIon, INCL_TUNNEL, t_dense::lgElmtOn, NO_TUNNEL, ChargeBin::RecomEn, ChargeBin::RecomZ0, ChargeBin::ThresSurf, ChargeBin::ThresSurfInc, and t_dense::xIonDense.

Here is the call graph for this function:

STATIC double y0b ( long  ,
long  ,
long   
)

Definition at line 3491 of file grains.cpp.

References t_rfield::anu, ASSERT, t_gv::bin, DEBUG_ENTRY, EVRYD, gv, t_gv::lgWD01, rfield, y0b01(), and GrainBin::y0b06.

Referenced by UpdatePot1().

Here is the call graph for this function:

STATIC double y0b01 ( long  ,
long  ,
long   
)

Definition at line 3526 of file grains.cpp.

References t_rfield::anu, ASSERT, t_gv::bin, cdEXIT, GrainBin::chrg, DEBUG_ENTRY, GrainBin::DustWorkFcn, gv, GrainBin::matType, MAX2, PE_CAR, PE_SIL, POW2, POW3, rfield, ChargeBin::ThresSurfVal, and t_gv::which_pe.

Referenced by y0b().

STATIC double y0psa ( long  ,
long  ,
long  ,
double   
)

Definition at line 3559 of file grains.cpp.

References ASSERT, t_gv::bin, DEBUG_ENTRY, elec_esc_length(), gv, GrainBin::inv_att_len, ShellData::ipLo, ShellData::p, and GrainBin::sd.

Here is the call graph for this function:

STATIC double y1psa ( long  ,
long  ,
double   
)

Definition at line 3590 of file grains.cpp.

References ASSERT, GrainBin::AvRadius, t_gv::bin, DEBUG_ENTRY, elec_esc_length(), gv, GrainBin::inv_att_len, pow2(), and pow3().

Here is the call graph for this function:

double y2pa ( double  ,
double  ,
long  ,
double *   
) [inline]

Definition at line 3618 of file grains.cpp.

References ASSERT, DEBUG_ENTRY, and pow3().

Referenced by Yfunc().

Here is the call graph for this function:

double y2s ( double  ,
double  ,
long  ,
double *   
) [inline]

Definition at line 3662 of file grains.cpp.

References ASINH(), ASSERT, DEBUG_ENTRY, ETILDE, gv, and t_gv::lgWD01.

Referenced by Yfunc().

Here is the call graph for this function:

void Yfunc ( long  ,
long  ,
double  ,
double  ,
double  ,
double  ,
double  ,
double *  ,
double *  ,
double *  ,
double *   
) [inline]

Definition at line 3436 of file grains.cpp.

References ASSERT, t_gv::bin, cdEXIT, GrainBin::chrg, DEBUG_ENTRY, ChargeBin::DustZ, elec_esc_length(), EVRYD, GrainBin::eyc, gv, GrainBin::matType, max(), min(), PE_CAR, PE_SIL, t_gv::which_pe, y2pa(), and y2s().

Referenced by UpdatePot1().

Here is the call graph for this function:


Variable Documentation

const double AC0 = 3.e-9 [static]

Definition at line 103 of file grains.cpp.

Referenced by GetPotValues().

const double AC1G = 4.e-8 [static]

Definition at line 104 of file grains.cpp.

Referenced by GetPotValues().

const double AC2G = 7.e-8 [static]

Definition at line 105 of file grains.cpp.

Referenced by GetPotValues().

const bool ALL_STAGES = true [static]

Definition at line 62 of file grains.cpp.

const long BRACKET_MAX = 50L [static]

Definition at line 79 of file grains.cpp.

Referenced by GrainCharge().

double CHRG_TOLER = DBL_MAX [static]

Definition at line 96 of file grains.cpp.

const long CT_LOOP_MAX = 25L [static]

Definition at line 88 of file grains.cpp.

const double ETILDE = 2.*SQRT2/EVRYD [static]

Definition at line 108 of file grains.cpp.

Referenced by y2s().

double HEAT_TOLER = DBL_MAX [static]

Definition at line 94 of file grains.cpp.

double HEAT_TOLER_BIN = DBL_MAX [static]

Definition at line 95 of file grains.cpp.

const bool INCL_TUNNEL = true [static]

Definition at line 59 of file grains.cpp.

Referenced by UpdatePot1(), and UpdateRecomZ0().

bool lgGvInitialized = false [static]

Definition at line 68 of file grains.cpp.

Referenced by NewGrainBin(), and ReturnGrainBins().

const long MAGIC_AUGER_DATA = 20060126L [static]

Definition at line 57 of file grains.cpp.

Referenced by ReadAugerData().

long int nCalledGrainDrive [static]

Definition at line 66 of file grains.cpp.

Referenced by GrainDrive(), and GrainZero().

const int NCHU = NCHS/3 [static]

Definition at line 83 of file grains.cpp.

Referenced by GetFracPop(), GrainCharge(), and SetNChrgStates().

const bool NO_TUNNEL = false [static]

Definition at line 60 of file grains.cpp.

Referenced by GrainIonColl(), UpdatePot1(), and UpdateRecomZ0().

const long NTOP = NDEMS/5 [static]

Definition at line 74 of file grains.cpp.

Referenced by InitEmissivities().

const double STICK_ELEC = 0.5 [static]

Definition at line 114 of file grains.cpp.

const double STICK_ION = 1.0 [static]

Definition at line 115 of file grains.cpp.

Referenced by GrainChrgTransferRates(), GrainCollHeating(), and GrainElecRecomb1().

const long T_LOOP_MAX = 50L [static]

Definition at line 91 of file grains.cpp.

const double THERMCONST = PI4*ELECTRON_MASS*POW2(BOLTZMANN)/POW3(HPLANCK) [static]

Definition at line 111 of file grains.cpp.

Referenced by UpdatePot2().

const double TOLER = CONSERV_TOL/10. [static]

Definition at line 78 of file grains.cpp.

Referenced by mie_auxiliary(), and search_limit().


Generated on Mon Feb 16 12:06:16 2009 for cloudy by  doxygen 1.4.7