#include "cddefines.h"
#include "physconst.h"
#include "rfield.h"
#include "phycon.h"
#include "dense.h"
#include "hmi.h"
#include "thermal.h"
#include "trace.h"
#include "thirdparty.h"
#include "iterations.h"
#include "grainvar.h"
#include "grains.h"
Include dependency graph for grains_qheat.cpp:
Go to the source code of this file.
Defines | |
#define | NO_ATOMS(ND) (gv.bin[ND]->AvVol*gv.bin[ND]->dustp[0]/ATOMIC_MASS_UNIT/gv.bin[ND]->atomWeight) |
Enumerations | |
enum | QH_Code { QH_OK, QH_ANALYTIC, QH_ANALYTIC_RELAX, QH_DELTA, QH_NEGRATE_FAIL, QH_LOOP_FAIL, QH_ARRAY_FAIL, QH_THIGH_FAIL, QH_RETRY, QH_CONV_FAIL, QH_BOUND_FAIL, QH_DELTA_FAIL, QH_NO_REBIN, QH_LOW_FAIL, QH_HIGH_FAIL, QH_STEP_FAIL, QH_FATAL, QH_WIDE_FAIL, QH_NBIN_FAIL, QH_REBIN_FAIL } |
Functions | |
STATIC void | qheat_init (long, double[], double *) |
STATIC void | GetProbDistr_LowLimit (long, double, double, double, double[], double[], double[], double[], double[], long *, double *, long *, QH_Code *) |
STATIC double | TryDoubleStep (double[], double[], double[], double[], double[], double[], double[], double, double *, long, long, bool *) |
STATIC double | log_integral (double, double, double, double) |
STATIC void | ScanProbDistr (double[], double[], long, double, long, double, long *, long *, long *, long *, QH_Code *) |
STATIC long | RebinQHeatResults (long, long, long, double[], double[], double[], double[], double[], double[], double[], QH_Code *) |
STATIC void | GetProbDistr_HighLimit (long, double, double, double, double[], double[], double[], double *, long *, double *, QH_Code *) |
STATIC double | uderiv (double, long) |
STATIC double | ufunct (double, long, bool *) |
STATIC double | inv_ufunct (double, long, bool *) |
STATIC double | DebyeDeriv (double, long) |
void | GrainMakeDiffuse (void) |
void | qheat (double qtemp[], double qprob[], long int *qnbin, long int nd) |
STATIC void | GetProbDistr_LowLimit (long int nd, double rel_tol, double Umax, double fwhm, double Phi[], double PhiDrv[], double qtemp[], double qprob[], double dPdlnT[], long int *qnbin, double *new_tmin, long *nWideFail, QH_Code *ErrorCode) |
STATIC double | uderiv (double temp, long int nd) |
STATIC double | ufunct (double temp, long int nd, bool *lgBoundErr) |
STATIC double | inv_ufunct (double enthalpy, long int nd, bool *lgBoundErr) |
void | InitEnthalpy (void) |
Variables | |
static const long | NQMIN = 10L |
static const double | PROB_CUTOFF_LO = 1.e-15 |
static const double | PROB_CUTOFF_HI = 1.e-20 |
static const double | SAFETY = 1.e+8 |
static const long | NSTARTUP = 5L |
static const double | MAX_EVENTS = 150. |
static const long | LOOP_MAX = 20L |
static const double | DEF_FAC = 3. |
static const double | PROB_TOL = 0.02 |
static const long | NQTEST = 500L |
static const double | FWHM_RATIO = 0.1 |
static const double | FWHM_RATIO2 = 0.007 |
static const long | MAX_LOOP = 2*NQGRID |
static const double | QHEAT_TOL = 5.e-3 |
static const long | WIDE_FAIL_MAX = 3 |
static const double | STRICT = 1. |
static const double | RELAX = 15. |
static const double | QT_RATIO = 1.03 |
static const double | DEN_SIL = 3.30 |
static const double | MW_SIL = 24.6051 |
static const double | tlim [5] = {0.,50.,150.,500.,DBL_MAX} |
static const double | ppower [4] = {2.00,1.30,0.68,0.00} |
static const double | cval [4] |
#define NO_ATOMS | ( | ND | ) | (gv.bin[ND]->AvVol*gv.bin[ND]->dustp[0]/ATOMIC_MASS_UNIT/gv.bin[ND]->atomWeight) |
enum QH_Code |
Definition at line 24 of file grains_qheat.cpp.
STATIC double DebyeDeriv | ( | double | , | |
long | ||||
) |
Definition at line 2571 of file grains_qheat.cpp.
References ASSERT, DEBUG_ENTRY, gauss_init(), gauss_legendre(), MALLOC, MAX2, POW2, POW3, powi(), and TotalInsanity().
Referenced by uderiv().
Here is the call graph for this function:
STATIC void GetProbDistr_HighLimit | ( | long | , | |
double | , | |||
double | , | |||
double | , | |||
double | [], | |||
double | [], | |||
double | [], | |||
double * | , | |||
long * | , | |||
double * | , | |||
QH_Code * | ||||
) |
Definition at line 2161 of file grains_qheat.cpp.
References t_gv::bin, GrainBin::chDstLab, GrainBin::cnv_GR_pCM3, GrainBin::cnv_GR_pH, GrainBin::cnv_H_pGR, DEBUG_ENTRY, GrainBin::dstems, GrainBin::dstslp, GrainBin::dstslp2, t_gv::dsttmp, GrainBin::DustEnth, EN1RYD, GrainBin::GrainHeat, gv, inv_ufunct(), ioQQQ, t_trace::lgDustBug, t_trace::lgTrace, LN_TWO, log_integral(), MAX2, MIN2, NDEMS, NQGRID, NQMIN, nzone, PI, POW2, PROB_CUTOFF_HI, PROB_TOL, QH_ANALYTIC, QH_ANALYTIC_RELAX, QH_BOUND_FAIL, QH_CONV_FAIL, QH_THIGH_FAIL, QH_WIDE_FAIL, QT_RATIO, SAFETY, splint_safe(), STRICT, trace, uderiv(), and ufunct().
Referenced by qheat().
Here is the call graph for this function:
STATIC void GetProbDistr_LowLimit | ( | long int | nd, | |
double | rel_tol, | |||
double | Umax, | |||
double | fwhm, | |||
double | Phi[], | |||
double | PhiDrv[], | |||
double | qtemp[], | |||
double | qprob[], | |||
double | dPdlnT[], | |||
long int * | qnbin, | |||
double * | new_tmin, | |||
long * | nWideFail, | |||
QH_Code * | ErrorCode | |||
) |
Definition at line 1224 of file grains_qheat.cpp.
References ASSERT, t_gv::bin, GrainBin::chDstLab, GrainBin::cnv_GR_pCM3, GrainBin::cnv_H_pGR, DEBUG_ENTRY, DEF_FAC, GrainBin::dstems, GrainBin::dstslp2, t_gv::dsttmp, EN1RYD, GRAIN_TMIN, GrainBin::GrainHeat, gv, ioQQQ, t_trace::lgDustBug, t_trace::lgTrace, LN_TWO, MAX2, MAX3, MAX_LOOP, MIN2, t_gv::nBin, NDEMS, NQGRID, NQMIN, NQTEST, NSTARTUP, nzone, POW3, PROB_CUTOFF_HI, PROB_CUTOFF_LO, PROB_TOL, QH_ARRAY_FAIL, QH_BOUND_FAIL, QH_CONV_FAIL, QH_DELTA_FAIL, QH_HIGH_FAIL, QH_LOOP_FAIL, QH_LOW_FAIL, QH_NBIN_FAIL, QH_NO_REBIN, QH_STEP_FAIL, QH_THIGH_FAIL, QH_WIDE_FAIL, QHEAT_TOL, GrainBin::qtmin, RebinQHeatResults(), SAFETY, ScanProbDistr(), spldrv_safe(), splint_safe(), GrainBin::tedust, trace, TryDoubleStep(), uderiv(), ufunct(), and WIDE_FAIL_MAX.
Here is the call graph for this function:
STATIC void GetProbDistr_LowLimit | ( | long | , | |
double | , | |||
double | , | |||
double | , | |||
double | [], | |||
double | [], | |||
double | [], | |||
double | [], | |||
double | [], | |||
long * | , | |||
double * | , | |||
long * | , | |||
QH_Code * | ||||
) |
Referenced by qheat().
void GrainMakeDiffuse | ( | void | ) |
main routine for generating the grain diffuse emission
Definition at line 165 of file grains_qheat.cpp.
References t_rfield::anu, t_rfield::anu2, ASSERT, t_gv::bin, cdEXIT, DEBUG_ENTRY, dense, GrainBin::dstab1, GrainBin::dstAbund, t_gv::dstAbundThresholdFar, t_gv::dstAbundThresholdNear, FR1RYD, t_gv::GrainEmission, t_gv::GraphiteEmission, gv, t_hmi::H2_total, hmi, ioQQQ, ipHYDROGEN, GrainBin::lgQHeat, GrainBin::lgUseQHeat, MALLOC, GrainBin::matType, t_gv::nBin, t_rfield::nflux, NQGRID, PI4, POW2, qheat(), rfield, t_gv::SilicateEmission, SPEEDLIGHT, STRG_CAR, STRG_SIL, TE1RYD, t_gv::which_strg, t_rfield::widflx, and t_dense::xIonDense.
Here is the call graph for this function:
void InitEnthalpy | ( | void | ) |
initialize interpolation arrays for grain enthalpy
Definition at line 2505 of file grains_qheat.cpp.
References t_gv::bin, DEBUG_ENTRY, t_gv::dsttmp, GrainBin::DustEnth, GrainBin::EnthSlp, GrainBin::EnthSlp2, GRAIN_TMIN, gv, log_integral(), t_gv::nBin, NDEMS, spline(), tlim, and uderiv().
Here is the call graph for this function:
STATIC double inv_ufunct | ( | double | enthalpy, | |
long int | nd, | |||
bool * | lgBoundErr | |||
) |
Definition at line 2479 of file grains_qheat.cpp.
References ASSERT, t_gv::bin, cdEXIT, DEBUG_ENTRY, t_gv::dsttmp, GrainBin::DustEnth, GrainBin::EnthSlp2, gv, ioQQQ, t_gv::nBin, NDEMS, and splint_safe().
Here is the call graph for this function:
STATIC double inv_ufunct | ( | double | , | |
long | , | |||
bool * | ||||
) |
Referenced by GetProbDistr_HighLimit(), qheat(), and TryDoubleStep().
STATIC double log_integral | ( | double | , | |
double | , | |||
double | , | |||
double | ||||
) |
Definition at line 1798 of file grains_qheat.cpp.
References ASSERT, and DEBUG_ENTRY.
Referenced by GetProbDistr_HighLimit(), InitEnthalpy(), and RebinQHeatResults().
void qheat | ( | double | qtemp[], | |
double | qprob[], | |||
long int * | qnbin, | |||
long int | nd | |||
) |
Definition at line 459 of file grains_qheat.cpp.
References t_rfield::anu, ASSERT, t_gv::bin, GrainBin::chDstLab, GrainBin::chrg, GrainBin::cnv_H_pCM3, GrainBin::cnv_H_pGR, CONSERV_TOL, DEBUG_ENTRY, DEF_FAC, GrainBin::dstems, GrainBin::dstslp2, t_gv::dsttmp, GrainBin::DustEnth, EN1RYD, ChargeBin::FracPop, FWHM_RATIO, FWHM_RATIO2, GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), GRAIN_TMIN, GrainBin::GrainCoolTherm, GrainBin::GrainHeat, GrainBin::GrainHeatColl, gv, GrainBin::HeatingRate1, ChargeBin::HeatingRate2, inv_ufunct(), ioQQQ, t_trace::lgDustBug, GrainBin::lgQHeat, GrainBin::lgQHTooWide, t_trace::lgTrace, LN_TWO, LOOP_MAX, MALLOC, MAX2, MAX_EVENTS, MIN2, t_gv::nBin, GrainBin::nChrg, NDEMS, NQGRID, t_rfield::nupper, POW2, PROB_CUTOFF_LO, QH_ANALYTIC, QH_CONV_FAIL, QH_DELTA, QH_DELTA_FAIL, QH_FATAL, QH_HIGH_FAIL, QH_LOW_FAIL, QH_NEGRATE_FAIL, QH_NO_REBIN, QH_OK, QH_RETRY, QH_WIDE_FAIL, qheat_init(), GrainBin::qnflux, GrainBin::qtmin, rfield, spldrv_safe(), STRICT, GrainBin::tedust, TorF(), trace, uderiv(), ufunct(), WIDE_FAIL_MAX, and t_rfield::widflx.
Here is the call graph for this function:
STATIC void qheat_init | ( | long | , | |
double | [], | |||
double * | ||||
) |
Definition at line 884 of file grains_qheat.cpp.
References t_rfield::anu, t_gv::anumax, t_gv::anumin, ASSERT, t_gv::bin, BOLTZMANN, GrainBin::chrg, GrainBin::cnv_H_pCM3, CONSERV_TOL, DEBUG_ENTRY, dprintf(), GrainBin::dstab1, ChargeBin::DustZ, ChargeBin::ehat, Ehi, EN1RYD, ChargeBin::fac1, ChargeBin::FracPop, GrainBin::GrainHeat, gv, ChargeBin::HeatingRate2, hunt_bisect(), ioQQQ, ChargeBin::ipThresInf, ChargeBin::ipThresInfVal, GrainBin::lgQHeat, t_gv::lgWD01, MALLOC, MAX2, MIN2, t_gv::nBin, GrainBin::nChrg, t_rfield::nflux, phycon, ChargeBin::PotSurf, ChargeBin::PotSurfInc, GrainBin::qnflux, GrainBin::qnflux2, rfield, sign(), t_rfield::SummedCon, t_phycon::te, ChargeBin::ThresInfInc, ChargeBin::ThresSurf, ChargeBin::ThresSurfVal, t_rfield::widflx, ChargeBin::yhat, and ChargeBin::yhat_primary.
Referenced by qheat().
Here is the call graph for this function:
STATIC long RebinQHeatResults | ( | long | , | |
long | , | |||
long | , | |||
double | [], | |||
double | [], | |||
double | [], | |||
double | [], | |||
double | [], | |||
double | [], | |||
double | [], | |||
QH_Code * | ||||
) |
Definition at line 1933 of file grains_qheat.cpp.
References ASSERT, t_gv::bin, GrainBin::cnv_GR_pCM3, GrainBin::cnv_GR_pH, CONSERV_TOL, DEBUG_ENTRY, GrainBin::dstems, GrainBin::dstslp, t_gv::dsttmp, EN1RYD, GrainBin::GrainHeat, gv, ioQQQ, t_trace::lgDustBug, t_trace::lgTrace, log_integral(), MALLOC, MAX2, MIN2, t_gv::nBin, NDEMS, NQGRID, NQMIN, PROB_CUTOFF_LO, QH_CONV_FAIL, QH_REBIN_FAIL, QT_RATIO, SAFETY, splint_safe(), trace, uderiv(), and ufunct().
Referenced by GetProbDistr_LowLimit().
Here is the call graph for this function:
STATIC void ScanProbDistr | ( | double | [], | |
double | [], | |||
long | , | |||
double | , | |||
long | , | |||
double | , | |||
long * | , | |||
long * | , | |||
long * | , | |||
long * | , | |||
QH_Code * | ||||
) |
Definition at line 1827 of file grains_qheat.cpp.
References ASSERT, DEBUG_ENTRY, GRAIN_TMIN, ioQQQ, t_trace::lgDustBug, t_trace::lgTrace, MAX2, NQMIN, QH_HIGH_FAIL, QH_LOW_FAIL, QH_NBIN_FAIL, QH_NO_REBIN, QH_WIDE_FAIL, trace, and WIDE_FAIL_MAX.
Referenced by GetProbDistr_LowLimit().
STATIC double TryDoubleStep | ( | double | [], | |
double | [], | |||
double | [], | |||
double | [], | |||
double | [], | |||
double | [], | |||
double | [], | |||
double | , | |||
double * | , | |||
long | , | |||
long | , | |||
bool * | ||||
) |
Definition at line 1625 of file grains_qheat.cpp.
References t_rfield::anu, ASSERT, t_gv::bin, GrainBin::cnv_H_pGR, DEBUG_ENTRY, GrainBin::dstems, GrainBin::dstslp2, t_gv::dsttmp, EN1RYD, gv, inv_ufunct(), MAX2, NDEMS, PROB_CUTOFF_LO, GrainBin::qnflux, rfield, and splint_safe().
Referenced by GetProbDistr_LowLimit().
Here is the call graph for this function:
STATIC double uderiv | ( | double | temp, | |
long int | nd | |||
) |
Definition at line 2335 of file grains_qheat.cpp.
References ASSERT, t_gv::bin, BOLTZMANN, cdEXIT, cval, DEBUG_ENTRY, DebyeDeriv(), EN1RYD, ENTH_CAR, ENTH_CAR2, ENTH_PAH, ENTH_PAH2, ENTH_SIL, ENTH_SIL2, gv, ioQQQ, GrainBin::matType, MAX2, MIN2, t_gv::nBin, NO_ATOMS, POW2, ppower, tlim, and t_gv::which_enth.
Here is the call graph for this function:
STATIC double uderiv | ( | double | , | |
long | ||||
) |
Referenced by GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), InitEnthalpy(), qheat(), and RebinQHeatResults().
STATIC double ufunct | ( | double | temp, | |
long int | nd, | |||
bool * | lgBoundErr | |||
) |
Definition at line 2453 of file grains_qheat.cpp.
References ASSERT, t_gv::bin, cdEXIT, DEBUG_ENTRY, t_gv::dsttmp, GrainBin::DustEnth, GrainBin::EnthSlp, gv, ioQQQ, t_gv::nBin, NDEMS, and splint_safe().
Here is the call graph for this function:
STATIC double ufunct | ( | double | , | |
long | , | |||
bool * | ||||
) |
Referenced by GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), qheat(), and RebinQHeatResults().
const double cval[4] [static] |
Initial value:
{ 1.40e3/DEN_SIL*ATOMIC_MASS_UNIT*MW_SIL/EN1RYD, 2.20e4/DEN_SIL*ATOMIC_MASS_UNIT*MW_SIL/EN1RYD, 4.80e5/DEN_SIL*ATOMIC_MASS_UNIT*MW_SIL/EN1RYD, 3.41e7/DEN_SIL*ATOMIC_MASS_UNIT*MW_SIL/EN1RYD}
Definition at line 123 of file grains_qheat.cpp.
Referenced by uderiv().
const double DEF_FAC = 3. [static] |
const double DEN_SIL = 3.30 [static] |
Definition at line 115 of file grains_qheat.cpp.
const double FWHM_RATIO = 0.1 [static] |
const double FWHM_RATIO2 = 0.007 [static] |
const long LOOP_MAX = 20L [static] |
Definition at line 63 of file grains_qheat.cpp.
Referenced by cnewton(), lgCoolNetConverge(), and qheat().
const double MAX_EVENTS = 150. [static] |
const double MW_SIL = 24.6051 [static] |
Definition at line 118 of file grains_qheat.cpp.
const long NQMIN = 10L [static] |
Definition at line 47 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), RebinQHeatResults(), and ScanProbDistr().
const long NQTEST = 500L [static] |
const long NSTARTUP = 5L [static] |
const double ppower[4] = {2.00,1.30,0.68,0.00} [static] |
const double PROB_CUTOFF_HI = 1.e-20 [static] |
Definition at line 51 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), and GetProbDistr_LowLimit().
const double PROB_CUTOFF_LO = 1.e-15 [static] |
Definition at line 50 of file grains_qheat.cpp.
Referenced by GetProbDistr_LowLimit(), qheat(), RebinQHeatResults(), and TryDoubleStep().
const double PROB_TOL = 0.02 [static] |
Definition at line 69 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), and GetProbDistr_LowLimit().
const double QHEAT_TOL = 5.e-3 [static] |
const double QT_RATIO = 1.03 [static] |
Definition at line 100 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), and RebinQHeatResults().
const double RELAX = 15. [static] |
Definition at line 93 of file grains_qheat.cpp.
const double SAFETY = 1.e+8 [static] |
Definition at line 52 of file grains_qheat.cpp.
Referenced by gauss_legendre(), GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), RebinQHeatResults(), spldrv_safe(), and splint_safe().
const double STRICT = 1. [static] |
Definition at line 92 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), and qheat().
const double tlim[5] = {0.,50.,150.,500.,DBL_MAX} [static] |
const long WIDE_FAIL_MAX = 3 [static] |
Definition at line 89 of file grains_qheat.cpp.
Referenced by GetProbDistr_LowLimit(), qheat(), and ScanProbDistr().