cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Enumerations | Functions | Variables
grains_qheat.cpp File Reference
#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.

Macros

#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, 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]

Macro Definition Documentation

#define NO_ATOMS (   ND)    (gv.bin[ND]->AvVol*gv.bin[ND]->dustp[0]/ATOMIC_MASS_UNIT/gv.bin[ND]->atomWeight)

Definition at line 17 of file grains_qheat.cpp.

Referenced by uderiv().

Enumeration Type Documentation

enum QH_Code
Enumerator:
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 

Definition at line 24 of file grains_qheat.cpp.

Function Documentation

STATIC double DebyeDeriv ( double  x,
long  n 
)

Definition at line 2556 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  nd,
double  TolFac,
double  Umax,
double  fwhm,
double  qtemp[],
double  qprob[],
double  dPdlnT[],
double *  tol,
long *  qnbin,
double *  new_tmin,
QH_Code ErrorCode 
)
STATIC void GetProbDistr_LowLimit ( long  ,
double  ,
double  ,
double  ,
double  [],
double  [],
double  [],
double  [],
double  [],
long *  ,
double *  ,
long *  ,
QH_Code  
)

Referenced by qheat().

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 
)
void GrainMakeDiffuse ( void  )
void InitEnthalpy ( void  )

initialize interpolation arrays for grain enthalpy

Definition at line 2490 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().

Referenced by GrainsInit().

Here is the call graph for this function:

STATIC double inv_ufunct ( double  ,
long  ,
bool *   
)
STATIC double inv_ufunct ( double  enthalpy,
long int  nd,
bool *  lgBoundErr 
)

Definition at line 2464 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 log_integral ( double  xx1,
double  yy1,
double  xx2,
double  yy2 
)

Definition at line 1788 of file grains_qheat.cpp.

References ASSERT, and DEBUG_ENTRY.

Referenced by GetProbDistr_HighLimit(), InitEnthalpy(), RebinQHeatResults(), and TryDoubleStep().

void qheat ( double  qtemp[],
double  qprob[],
long int *  qnbin,
long int  nd 
)
STATIC void qheat_init ( long  nd,
double  phiTilde[],
double *  check 
)
STATIC long RebinQHeatResults ( long  nd,
long  nstart,
long  nend,
double  p[],
double  qtemp[],
double  qprob[],
double  dPdlnT[],
double  u1[],
double  delu[],
double  Lambda[],
QH_Code ErrorCode 
)
STATIC void ScanProbDistr ( double  u1[],
double  dPdlnT[],
long  nbin,
double  maxVal,
long  nmax,
long *  nstart,
long *  nstart2,
long *  nend,
long *  nWideFail,
QH_Code ErrorCode 
)
STATIC double TryDoubleStep ( double  u1[],
double  delu[],
double  p[],
double  qtemp[],
double  Lambda[],
double  Phi[],
double  PhiDrv[],
double  step,
double *  cooling,
long  index,
long  nd,
bool *  lgBoundFail 
)
STATIC double uderiv ( double  ,
long   
)
STATIC double uderiv ( double  temp,
long int  nd 
)
STATIC double ufunct ( double  ,
long  ,
bool *   
)
STATIC double ufunct ( double  temp,
long int  nd,
bool *  lgBoundErr 
)

Definition at line 2438 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:

Variable Documentation

const double cval[4]
static
const double DEF_FAC = 3.
static

Definition at line 66 of file grains_qheat.cpp.

Referenced by GetProbDistr_LowLimit(), and qheat().

const double DEN_SIL = 3.30
static

Definition at line 115 of file grains_qheat.cpp.

const double FWHM_RATIO = 0.1
static

Definition at line 77 of file grains_qheat.cpp.

Referenced by qheat().

const double FWHM_RATIO2 = 0.007
static

Definition at line 80 of file grains_qheat.cpp.

Referenced by qheat().

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

Definition at line 59 of file grains_qheat.cpp.

Referenced by qheat().

const long MAX_LOOP = 2*NQGRID
static

Definition at line 83 of file grains_qheat.cpp.

Referenced by GetProbDistr_LowLimit().

const double MW_SIL = 24.6051
static

Definition at line 118 of file grains_qheat.cpp.

const long NQMIN = 10L
static
const long NQTEST = 500L
static

Definition at line 73 of file grains_qheat.cpp.

Referenced by GetProbDistr_LowLimit().

const long NSTARTUP = 5L
static

Definition at line 55 of file grains_qheat.cpp.

Referenced by GetProbDistr_LowLimit().

const double ppower[4] = {2.00,1.30,0.68,0.00}
static

Definition at line 122 of file grains_qheat.cpp.

Referenced by uderiv().

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
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

Definition at line 86 of file grains_qheat.cpp.

Referenced by GetProbDistr_LowLimit(), and TryDoubleStep().

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.

Referenced by qheat().

const double SAFETY = 1.e+8
static
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

Definition at line 121 of file grains_qheat.cpp.

Referenced by InitEnthalpy(), and uderiv().

const long WIDE_FAIL_MAX = 3
static

Definition at line 89 of file grains_qheat.cpp.

Referenced by GetProbDistr_LowLimit(), qheat(), and ScanProbDistr().


Generated for cloudy by doxygen 1.8.1.2