cloudy trunk
|
#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"
Go to the source code of this file.
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 | |
double | no_atoms (size_t nd) |
STATIC void | qheat_init (size_t, vector< double > &, double *) |
STATIC void | GetProbDistr_LowLimit (size_t, double, double, double, const vector< double > &, const vector< double > &, vector< double > &, vector< double > &, vector< double > &, long *, double *, long *, QH_Code *) |
STATIC double | TryDoubleStep (vector< double > &, vector< double > &, vector< double > &, vector< double > &, vector< double > &, const vector< double > &, const vector< double > &, double, double *, long, size_t, bool *) |
STATIC double | log_integral (double, double, double, double) |
STATIC void | ScanProbDistr (const vector< double > &, const vector< double > &, long, double, long, double, long *, long *, long *, long *, QH_Code *) |
STATIC long | RebinQHeatResults (size_t, long, long, vector< double > &, vector< double > &, vector< double > &, vector< double > &, vector< double > &, vector< double > &, vector< double > &, QH_Code *) |
STATIC void | GetProbDistr_HighLimit (long, double, double, double, vector< double > &, vector< double > &, vector< double > &, double *, long *, double *, QH_Code *) |
STATIC double | uderiv (double, size_t) |
STATIC double | ufunct (double, size_t, bool *) |
STATIC double | inv_ufunct (double, size_t, bool *) |
STATIC double | DebyeDeriv (double, long) |
void | GrainMakeDiffuse (void) |
void | qheat (vector< double > &qtemp, vector< double > &qprob, long int *qnbin, size_t nd) |
STATIC void | GetProbDistr_LowLimit (size_t nd, double rel_tol, double Umax, double fwhm, const vector< double > &Phi, const vector< double > &PhiDrv, vector< double > &qtemp, vector< double > &qprob, vector< double > &dPdlnT, long int *qnbin, double *new_tmin, long *nWideFail, QH_Code *ErrorCode) |
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] |
enum QH_Code |
Definition at line 27 of file grains_qheat.cpp.
STATIC double DebyeDeriv | ( | double | x, |
long | n ) |
Definition at line 2545 of file grains_qheat.cpp.
References ASSERT, DEBUG_ENTRY, gauss_init(), gauss_legendre(), MAX2, POW2, POW3, powi(), STATIC, and TotalInsanity().
Referenced by uderiv().
STATIC void GetProbDistr_HighLimit | ( | long | nd, |
double | TolFac, | ||
double | Umax, | ||
double | fwhm, | ||
vector< double > & | qtemp, | ||
vector< double > & | qprob, | ||
vector< double > & | dPdlnT, | ||
double * | tol, | ||
long * | qnbin, | ||
double * | new_tmin, | ||
QH_Code * | ErrorCode ) |
Definition at line 2138 of file grains_qheat.cpp.
References DEBUG_ENTRY, EN1RYD, gv, inv_ufunct(), ioQQQ, LN_TWO, log_integral(), MAX2, MIN2, NDEMS, NQGRID, NQMIN, nzone, PI, POW2, PROB_CUTOFF_HI, PROB_CUTOFF_LO, PROB_TOL, QH_ANALYTIC, QH_ANALYTIC_RELAX, QH_BOUND_FAIL, QH_CONV_FAIL, QH_THIGH_FAIL, QH_WIDE_FAIL, QT_RATIO, SAFETY, splint_safe(), STATIC, STRICT, trace, uderiv(), and ufunct().
Referenced by qheat().
STATIC void GetProbDistr_LowLimit | ( | size_t | nd, |
double | rel_tol, | ||
double | Umax, | ||
double | fwhm, | ||
const vector< double > & | Phi, | ||
const vector< double > & | PhiDrv, | ||
vector< double > & | qtemp, | ||
vector< double > & | qprob, | ||
vector< double > & | dPdlnT, | ||
long int * | qnbin, | ||
double * | new_tmin, | ||
long * | nWideFail, | ||
QH_Code * | ErrorCode ) |
Definition at line 1204 of file grains_qheat.cpp.
References ASSERT, DEBUG_ENTRY, DEF_FAC, EN1RYD, GRAIN_TMIN, gv, ioQQQ, LN_TWO, MAX2, MAX3, MAX_LOOP, MIN2, 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, RebinQHeatResults(), SAFETY, ScanProbDistr(), spldrv_safe(), splint_safe(), STATIC, trace, TryDoubleStep(), uderiv(), ufunct(), and WIDE_FAIL_MAX.
void GrainMakeDiffuse | ( | void | ) |
main routine for generating the grain diffuse emission
Definition at line 170 of file grains_qheat.cpp.
References ASSERT, CONSERV_TOL, DEBUG_ENTRY, dense, EN1RYD, FR1RYD, gv, hmi, ipHYDROGEN, lgAbort, MAX2, NQGRID, PI4, POW2, qheat(), rfield, SPEEDLIGHT, STRG_CAR, STRG_SIL, TE1RYD, thermal, and TotalInsanity().
Referenced by RT_diffuse().
void InitEnthalpy | ( | void | ) |
initialize interpolation arrays for grain enthalpy
Definition at line 2482 of file grains_qheat.cpp.
References DEBUG_ENTRY, GRAIN_TMIN, gv, log_integral(), NDEMS, spline(), tlim, and uderiv().
Referenced by GrainsInit().
Definition at line 2456 of file grains_qheat.cpp.
References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, gv, ioQQQ, NDEMS, splint_safe(), and STATIC.
Referenced by GetProbDistr_HighLimit(), qheat(), and TryDoubleStep().
STATIC double log_integral | ( | double | xx1, |
double | yy1, | ||
double | xx2, | ||
double | yy2 ) |
Definition at line 1778 of file grains_qheat.cpp.
References ASSERT, DEBUG_ENTRY, and STATIC.
Referenced by GetProbDistr_HighLimit(), InitEnthalpy(), RebinQHeatResults(), and TryDoubleStep().
|
inline |
Definition at line 17 of file grains_qheat.cpp.
References ATOMIC_MASS_UNIT, and gv.
Referenced by mie_read_form(), and uderiv().
void qheat | ( | vector< double > & | qtemp, |
vector< double > & | qprob, | ||
long int * | qnbin, | ||
size_t | nd ) |
Definition at line 450 of file grains_qheat.cpp.
References ASSERT, CONSERV_TOL, DEBUG_ENTRY, DEF_FAC, EN1RYD, FWHM_RATIO, FWHM_RATIO2, GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), GRAIN_TMIN, gv, inv_ufunct(), ioQQQ, iterations, LN_TWO, LOOP_MAX, MAX2, MAX_EVENTS, MIN2, NDEMS, NQGRID, nzone, 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(), RELAX, rfield, spldrv_safe(), STRICT, TorF(), trace, uderiv(), ufunct(), and WIDE_FAIL_MAX.
Referenced by GrainMakeDiffuse().
Definition at line 866 of file grains_qheat.cpp.
References ASSERT, BOLTZMANN, CONSERV_TOL, DEBUG_ENTRY, dprintf(), ChargeBin::DustZ, ChargeBin::ehat, EN1RYD, ChargeBin::fac1, ChargeBin::FracPop, gv, ChargeBin::HeatingRate2, hunt_bisect(), ioQQQ, ChargeBin::ipThresInf, ChargeBin::ipThresInfVal, MAX2, MIN2, phycon, ChargeBin::PotSurf, ChargeBin::PotSurfInc, rfield, sign(), STATIC, ChargeBin::ThresInfInc, ChargeBin::ThresSurf, ChargeBin::ThresSurfVal, ChargeBin::yhat, and ChargeBin::yhat_primary.
Referenced by qheat().
STATIC long RebinQHeatResults | ( | size_t | nd, |
long | nstart, | ||
long | nend, | ||
vector< double > & | p, | ||
vector< double > & | qtemp, | ||
vector< double > & | qprob, | ||
vector< double > & | dPdlnT, | ||
vector< double > & | u1, | ||
vector< double > & | delu, | ||
vector< double > & | Lambda, | ||
QH_Code * | ErrorCode ) |
Definition at line 1913 of file grains_qheat.cpp.
References ASSERT, CONSERV_TOL, DEBUG_ENTRY, EN1RYD, gv, ioQQQ, log_integral(), MAX2, MIN2, NDEMS, NQGRID, NQMIN, PROB_CUTOFF_LO, QH_CONV_FAIL, QH_REBIN_FAIL, QT_RATIO, SAFETY, splint_safe(), STATIC, trace, uderiv(), and ufunct().
Referenced by GetProbDistr_LowLimit().
STATIC void ScanProbDistr | ( | const vector< double > & | u1, |
const vector< double > & | dPdlnT, | ||
long | nbin, | ||
double | maxVal, | ||
long | nmax, | ||
double | qtmin1, | ||
long * | nstart, | ||
long * | nstart2, | ||
long * | nend, | ||
long * | nWideFail, | ||
QH_Code * | ErrorCode ) |
Definition at line 1807 of file grains_qheat.cpp.
References ASSERT, DEBUG_ENTRY, GRAIN_TMIN, ioQQQ, MAX2, NQMIN, QH_HIGH_FAIL, QH_LOW_FAIL, QH_NBIN_FAIL, QH_NO_REBIN, QH_WIDE_FAIL, STATIC, trace, and WIDE_FAIL_MAX.
Referenced by GetProbDistr_LowLimit().
STATIC double TryDoubleStep | ( | vector< double > & | u1, |
vector< double > & | delu, | ||
vector< double > & | p, | ||
vector< double > & | qtemp, | ||
vector< double > & | Lambda, | ||
const vector< double > & | Phi, | ||
const vector< double > & | PhiDrv, | ||
double | step, | ||
double * | cooling, | ||
long | index, | ||
size_t | nd, | ||
bool * | lgBoundFail ) |
Definition at line 1605 of file grains_qheat.cpp.
References ASSERT, DEBUG_ENTRY, EN1RYD, gv, inv_ufunct(), log_integral(), MAX2, NDEMS, NQGRID, PROB_CUTOFF_LO, QHEAT_TOL, rfield, splint_safe(), and STATIC.
Referenced by GetProbDistr_LowLimit().
Definition at line 2312 of file grains_qheat.cpp.
References ASSERT, BOLTZMANN, cdEXIT, cval, DEBUG_ENTRY, DebyeDeriv(), EN1RYD, ENTH_CAR, ENTH_CAR2, ENTH_PAH, ENTH_PAH2, ENTH_SIL, ENTH_SIL2, EXIT_FAILURE, gv, ioQQQ, MAX2, MIN2, no_atoms(), POW2, ppower, STATIC, and tlim.
Referenced by GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), InitEnthalpy(), qheat(), and RebinQHeatResults().
Definition at line 2430 of file grains_qheat.cpp.
References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, gv, ioQQQ, NDEMS, splint_safe(), and STATIC.
Referenced by GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), qheat(), and RebinQHeatResults().
|
static |
|
static |
Definition at line 69 of file grains_qheat.cpp.
Referenced by GetProbDistr_LowLimit(), and qheat().
|
static |
Definition at line 118 of file grains_qheat.cpp.
|
static |
Definition at line 80 of file grains_qheat.cpp.
Referenced by qheat().
|
static |
Definition at line 83 of file grains_qheat.cpp.
Referenced by qheat().
|
static |
Definition at line 66 of file grains_qheat.cpp.
Referenced by cnewton(), lgCoolNetConverge(), and qheat().
|
static |
Definition at line 62 of file grains_qheat.cpp.
Referenced by qheat().
|
static |
Definition at line 86 of file grains_qheat.cpp.
Referenced by GetProbDistr_LowLimit().
|
static |
Definition at line 121 of file grains_qheat.cpp.
|
static |
Definition at line 50 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), RebinQHeatResults(), and ScanProbDistr().
|
static |
Definition at line 76 of file grains_qheat.cpp.
Referenced by GetProbDistr_LowLimit().
|
static |
Definition at line 58 of file grains_qheat.cpp.
Referenced by GetProbDistr_LowLimit().
|
static |
Definition at line 125 of file grains_qheat.cpp.
Referenced by uderiv().
|
static |
Definition at line 54 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), and GetProbDistr_LowLimit().
|
static |
Definition at line 53 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), qheat(), RebinQHeatResults(), and TryDoubleStep().
|
static |
Definition at line 72 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), and GetProbDistr_LowLimit().
|
static |
Definition at line 89 of file grains_qheat.cpp.
Referenced by GetProbDistr_LowLimit(), and TryDoubleStep().
|
static |
Definition at line 103 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), and RebinQHeatResults().
|
static |
Definition at line 96 of file grains_qheat.cpp.
Referenced by qheat().
|
static |
Definition at line 55 of file grains_qheat.cpp.
Referenced by gauss_legendre(), GetProbDistr_HighLimit(), GetProbDistr_LowLimit(), radius_next(), RebinQHeatResults(), spldrv_safe(), and splint_safe().
|
static |
Definition at line 95 of file grains_qheat.cpp.
Referenced by GetProbDistr_HighLimit(), and qheat().
|
static |
Definition at line 124 of file grains_qheat.cpp.
Referenced by InitEnthalpy(), and uderiv().
|
static |
Definition at line 92 of file grains_qheat.cpp.
Referenced by GetProbDistr_LowLimit(), qheat(), and ScanProbDistr().