MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
Classes | Macros | Functions | Variables
cooling_rates.c File Reference
#include "cooling_rates.h"
#include "cooling_qso_lightup.h"
#include "cosmology.h"
#include <omp.h>
#include <math.h>
#include <mpi.h>
#include <stdio.h>
#include <string.h>
#include <gsl/gsl_interp.h>
#include "physconst.h"
#include "utils/endrun.h"
#include "utils/paramset.h"
#include "utils/mymalloc.h"
Include dependency graph for cooling_rates.c:

Go to the source code of this file.

Classes

struct  itp_type
 
struct  he_ions
 

Macros

#define NGRAY   6
 
#define NRECOMBTAB   1000
 
#define RECOMBTMAX   log(1e9)
 
#define RECOMBTMIN   0
 
#define MAXITER   1000
 
#define ITERCONV   1e-6
 

Functions

static void init_itp_type (double *xarr, struct itp_type *Gamma, int Nelem)
 
static double load_tree_value (char **saveptr)
 
static void load_treecool (const char *TreeCoolFile)
 
static double get_photo_rate (double redshift, struct itp_type *Gamma_tab)
 
static double self_shield_dens (double redshift, const struct UVBG *uvbg)
 
struct UVBG get_global_UVBG (double redshift)
 
static double self_shield_corr (double nh, double logt, double ssdens)
 
static double _Verner96Fit (double temp, double aa, double bb, double temp0, double temp1)
 
double recomb_alphaHp (double temp)
 
static double _Verner96alphaHep (double temp)
 
static double recomb_alphaHep (double temp)
 
static double recomb_alphad (double temp)
 
static double recomb_alphaHepd (double temp)
 
static double recomb_alphaHepp (double temp)
 
static double _Voronov96Fit (double temp, double dE, double PP, double AA, double XX, double KK)
 
static double recomb_GammaeH0 (double temp)
 
static double recomb_GammaeHe0 (double temp)
 
static double recomb_GammaeHep (double temp)
 
static double get_interpolated_recomb (double logt, double *rec_tab, double rec_func(double))
 
static double nH0_internal (double logt, double ne, const struct UVBG *uvbg, double photofac)
 
static double nHp_internal (double nH0)
 
static struct he_ions nHe_internal (double nh, double logt, double ne, const struct UVBG *uvbg, double photofac)
 
static double get_temp_internal (double nebynh, double ienergy, double helium)
 
static double ne_internal (double nh, double ienergy, double ne, double helium, double *logt, const struct UVBG *uvbg)
 
static double scipy_optimize_fixed_point (double ne_init, double nh, double ienergy, double helium, double *logt, const struct UVBG *uvbg)
 
double get_equilib_ne (double density, double ienergy, double helium, double *logt, const struct UVBG *uvbg, double ne_init)
 
double get_ne_by_nh (double density, double ienergy, double helium, const struct UVBG *uvbg, double ne_init)
 
static double _t5 (double temp)
 
static double cool_CollisionalExciteH0 (double temp)
 
static double cool_CollisionalExciteHeP (double temp)
 
static double cool_CollisionalExciteHe0 (double temp)
 
static double cool_CollisionalIonizeH0 (double temp)
 
static double cool_CollisionalIonizeHe0 (double temp)
 
static double cool_CollisionalIonizeHeP (double temp)
 
static double cool_CollisionalH0 (double temp)
 
static double cool_CollisionalHe0 (double temp)
 
static double cool_CollisionalHeP (double temp)
 
static double cool_RecombHp (double temp)
 
static double cool_RecombDielect (double temp)
 
static double cool_RecombHeP (double temp)
 
static double cool_RecombHePP (double temp)
 
static double cool_FreeFree (double temp, int zz)
 
static double cool_FreeFree1 (double temp)
 
static double cool_InverseCompton (double temp, double redshift)
 
static double cool_he_reion_factor (double nHcgs, double helium, double redshift)
 
void set_coolpar (struct cooling_params cp)
 
void set_cooling_params (ParameterSet *ps)
 
void init_cooling_rates (const char *TreeCoolFile, const char *MetalCoolFile, Cosmology *CP)
 
double get_compton_cooling (double density, double ienergy, double helium, double redshift, double nebynh)
 
double get_individual_cooling (enum CoolProcess process, double density, double ienergy, double helium, const struct UVBG *uvbg, double *ne_equilib)
 
double get_heatingcooling_rate (double density, double ienergy, double helium, double redshift, double metallicity, const struct UVBG *uvbg, double *ne_equilib)
 
double get_temp (double density, double ienergy, double helium, const struct UVBG *uvbg, double *ne_init)
 
double get_neutral_fraction_phys_cgs (double density, double ienergy, double helium, const struct UVBG *uvbg, double *ne_init)
 
double get_helium_ion_phys_cgs (int ion, double density, double ienergy, double helium, const struct UVBG *uvbg, double ne_init)
 

Variables

static struct cooling_params CoolingParams
 
static gsl_interp * GrayOpac
 
static const double GrayOpac_ydata [NGRAY] = { 2.59e-18, 2.37e-18, 2.27e-18, 2.15e-18, 2.02e-18, 1.94e-18}
 
static const double GrayOpac_zz [NGRAY] = {0, 1, 2, 3, 4, 5}
 
static int NTreeCool
 
static double * Gamma_log1z
 
static struct itp_type Gamma_HI Gamma_HeI Gamma_HeII
 
static struct itp_type Eps_HI Eps_HeI Eps_HeII
 
static double * temp_tab
 
static double * rec_alphaHp
 
static double * rec_alphaHep
 
static double * rec_alphaHepp
 
static double * rec_GammaH0
 
static double * rec_GammaHe0
 
static double * rec_GammaHep
 
static double * cool_collisH0
 
static double * cool_collisHe0
 
static double * cool_collisHeP
 
static double * cool_recombHp
 
static double * cool_recombHeP
 
static double * cool_recombHePP
 
static double * cool_freefree1
 

Macro Definition Documentation

◆ ITERCONV

#define ITERCONV   1e-6

Definition at line 636 of file cooling_rates.c.

◆ MAXITER

#define MAXITER   1000

Definition at line 633 of file cooling_rates.c.

◆ NGRAY

#define NGRAY   6

Definition at line 73 of file cooling_rates.c.

◆ NRECOMBTAB

#define NRECOMBTAB   1000

Definition at line 95 of file cooling_rates.c.

◆ RECOMBTMAX

#define RECOMBTMAX   log(1e9)

Definition at line 96 of file cooling_rates.c.

◆ RECOMBTMIN

#define RECOMBTMIN   0

Definition at line 97 of file cooling_rates.c.

Function Documentation

◆ _t5()

static double _t5 ( double  temp)
static

Definition at line 746 of file cooling_rates.c.

747 {
748  double t0;
750  t0 = 1e5;
751  /* The original Cen 92 correction is implemented in order to achieve the
752  * correct asymptotic behaviour at high temperatures. However, the rates he is correcting
753  * should be good up to 10^7 K, so he is being too aggressive.*/
754  else
755  t0 = 5e7;
756  return 1+sqrt(temp/t0);
757 }
static struct cooling_params CoolingParams
Definition: cooling_rates.c:68
@ KWH92
Definition: cooling_rates.h:17
enum CoolingType cooling
Definition: cooling_rates.h:28

References cooling_params::cooling, CoolingParams, and KWH92.

Referenced by cool_CollisionalExciteH0(), cool_CollisionalExciteHe0(), and cool_CollisionalExciteHeP().

Here is the caller graph for this function:

◆ _Verner96alphaHep()

static double _Verner96alphaHep ( double  temp)
static

Definition at line 367 of file cooling_rates.c.

368 {
369  /*Accurate to ~2% for T < 10^6 and 5% for T< 10^10.
370  * VF96 give two rates. The first is more accurate for T < 10^6, the second is valid up to T = 10^10.
371  * We use the most accurate allowed. See lines 2 and 3 of Table 1 of VF96.*/
372  double lowTfit = _Verner96Fit(temp, 3.294e-11, 0.6910, 1.554e+01, 3.676e+07);
373  double highTfit = _Verner96Fit(temp, 9.356e-10, 0.7892, 4.266e-02, 4.677e+06);
374  /*Note that at 10^6K the two fits differ by ~10%. This may lead one to disbelieve the quoted accuracies!
375  * We thus switch over at a slightly lower temperature. The two fits cross at T ~ 3e5K.*/
376  double swtmp = 7e5;
377  double deltat = 1e5;
378  double upper = swtmp + deltat;
379  double lower = swtmp - deltat;
380  //In order to avoid a sharp feature at 10^6 K, we linearly interpolate between the two fits around 10^6 K.
381  double interpfit = (lowTfit * (upper - temp) + highTfit * (temp - lower))/(2*deltat);
382  return (temp < lower)*lowTfit + (temp > upper)*highTfit + (upper > temp)*(temp > lower)*interpfit;
383 }
static double _Verner96Fit(double temp, double aa, double bb, double temp0, double temp1)

References _Verner96Fit().

Referenced by recomb_alphaHep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _Verner96Fit()

static double _Verner96Fit ( double  temp,
double  aa,
double  bb,
double  temp0,
double  temp1 
)
static

Definition at line 338 of file cooling_rates.c.

339 {
340  double sqrttt0 = sqrt(temp/temp0);
341  double sqrttt1 = sqrt(temp/temp1);
342  return aa / ( sqrttt0 * pow(1 + sqrttt0, 1-bb)*pow(1+sqrttt1, 1+bb) );
343 }

Referenced by _Verner96alphaHep(), recomb_alphaHep(), recomb_alphaHepp(), and recomb_alphaHp().

Here is the caller graph for this function:

◆ _Voronov96Fit()

static double _Voronov96Fit ( double  temp,
double  dE,
double  PP,
double  AA,
double  XX,
double  KK 
)
static

Definition at line 451 of file cooling_rates.c.

452 {
453  double UU = dE / (BOLEVK * temp);
454  return AA * (1 + PP * sqrt(UU))/(XX+UU) * pow(UU, KK) * exp(-UU);
455 }
#define BOLEVK
Definition: physconst.h:13

References BOLEVK.

Referenced by recomb_GammaeH0(), recomb_GammaeHe0(), and recomb_GammaeHep().

Here is the caller graph for this function:

◆ cool_CollisionalExciteH0()

static double cool_CollisionalExciteH0 ( double  temp)
static

Definition at line 761 of file cooling_rates.c.

762 {
763  return 7.5e-19 * exp(-118348.0/temp) / _t5(temp);
764 }
static double _t5(double temp)

References _t5().

Referenced by cool_CollisionalH0().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_CollisionalExciteHe0()

static double cool_CollisionalExciteHe0 ( double  temp)
static

Definition at line 775 of file cooling_rates.c.

776 {
777  return 9.1e-27 * pow(temp, -0.1687) * exp(-473638/temp) / _t5(temp);
778 }

References _t5().

Referenced by cool_CollisionalHe0().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_CollisionalExciteHeP()

static double cool_CollisionalExciteHeP ( double  temp)
static

Definition at line 768 of file cooling_rates.c.

769 {
770  return 5.54e-17 * pow(temp, -0.397)*exp(-473638./temp)/_t5(temp);
771 }

References _t5().

Referenced by cool_CollisionalHeP().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_CollisionalH0()

static double cool_CollisionalH0 ( double  temp)
static

Definition at line 804 of file cooling_rates.c.

805 {
807  /*Formula from Eq. 23, Table 4 of Scholz & Walters, claimed good to 0.45 %.
808  Note though that they have two datasets which differ by a factor of two.
809  Differs from Cen 92 by a factor of two.*/
810  //Technically only good for T > 2000.
811  double y = log(temp);
812  //Constant is 0.75/k_B in Rydberg
813  double Ryd = 2.1798741e-11;
814  double tot = -0.75/BOLTZMANN *Ryd/temp;
815  double coeffslowT[6] = {213.7913, 113.9492, 25.06062, 2.762755, 0.1515352, 3.290382e-3};
816  double coeffshighT[6] = {271.25446, 98.019455, 14.00728, 0.9780842, 3.356289e-2, 4.553323e-4};
817  int j;
818  for(j=0; j < 6; j++)
819  tot += ((temp < 1e5)*coeffslowT[j]+(temp >=1e5)*coeffshighT[j])*pow(-y, j);
820  return 1e-20 * exp(tot);
821  }
822  else /*Everyone else splits collisional from excitation, because collisional is mostly exact*/
824 }
static double cool_CollisionalExciteH0(double temp)
static double cool_CollisionalIonizeH0(double temp)
@ Enzo2Nyx
Definition: cooling_rates.h:18
#define BOLTZMANN
Definition: physconst.h:11

References BOLTZMANN, cool_CollisionalExciteH0(), cool_CollisionalIonizeH0(), cooling_params::cooling, CoolingParams, and Enzo2Nyx.

Referenced by get_heatingcooling_rate(), get_individual_cooling(), and init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_CollisionalHe0()

static double cool_CollisionalHe0 ( double  temp)
static

Definition at line 828 of file cooling_rates.c.

829 {
831 }
static double cool_CollisionalExciteHe0(double temp)
static double cool_CollisionalIonizeHe0(double temp)

References cool_CollisionalExciteHe0(), and cool_CollisionalIonizeHe0().

Referenced by get_heatingcooling_rate(), get_individual_cooling(), and init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_CollisionalHeP()

static double cool_CollisionalHeP ( double  temp)
static

Definition at line 835 of file cooling_rates.c.

836 {
838 }
static double cool_CollisionalExciteHeP(double temp)
static double cool_CollisionalIonizeHeP(double temp)

References cool_CollisionalExciteHeP(), and cool_CollisionalIonizeHeP().

Referenced by get_heatingcooling_rate(), get_individual_cooling(), and init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_CollisionalIonizeH0()

static double cool_CollisionalIonizeH0 ( double  temp)
static

Definition at line 782 of file cooling_rates.c.

783 {
784  /*H ionization potential*/
785  return 13.5984 * eVinergs * recomb_GammaeH0(temp);
786 }
static double recomb_GammaeH0(double temp)
#define eVinergs
Definition: physconst.h:15

References eVinergs, and recomb_GammaeH0().

Referenced by cool_CollisionalH0().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_CollisionalIonizeHe0()

static double cool_CollisionalIonizeHe0 ( double  temp)
static

Definition at line 790 of file cooling_rates.c.

791 {
792  return 24.5874 * eVinergs * recomb_GammaeHe0(temp);
793 }
static double recomb_GammaeHe0(double temp)

References eVinergs, and recomb_GammaeHe0().

Referenced by cool_CollisionalHe0().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_CollisionalIonizeHeP()

static double cool_CollisionalIonizeHeP ( double  temp)
static

Definition at line 797 of file cooling_rates.c.

798 {
799  return 54.417760 * eVinergs * recomb_GammaeHep(temp);
800 }
static double recomb_GammaeHep(double temp)

References eVinergs, and recomb_GammaeHep().

Referenced by cool_CollisionalHeP().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_FreeFree()

static double cool_FreeFree ( double  temp,
int  zz 
)
static

Definition at line 881 of file cooling_rates.c.

882 {
883  double gff;
884  /*Formula for the Gaunt factor from Shapiro & Kang 1987. ZZ is 1 for H+ and He+ and 2 for He++.
885  This is almost identical to the KWH rate but not continuous.*/
887  double lt = 2 * log10(temp/zz);
888  if(lt <= log10(3.2e5))
889  gff = (0.79464 + 0.1243*lt);
890  else
891  gff = (2.13164 - 0.1240*lt);
892  }
893  else {
894  /*Formula for the Gaunt factor. KWH takes this from Spitzer 1978.*/
895  gff = 1.1+0.34*exp(-pow(5.5 - log10(temp),2) /3.);
896  }
897  return 1.426e-27*sqrt(temp)* pow(zz,2) * gff;
898 }

References cooling_params::cooling, CoolingParams, and Enzo2Nyx.

Referenced by cool_FreeFree1(), get_heatingcooling_rate(), get_individual_cooling(), and init_cooling_rates().

Here is the caller graph for this function:

◆ cool_FreeFree1()

static double cool_FreeFree1 ( double  temp)
static

Definition at line 901 of file cooling_rates.c.

902 {
903  return cool_FreeFree(temp, 1);
904 }
static double cool_FreeFree(double temp, int zz)

References cool_FreeFree().

Referenced by get_heatingcooling_rate(), and get_individual_cooling().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_he_reion_factor()

static double cool_he_reion_factor ( double  nHcgs,
double  helium,
double  redshift 
)
static

Definition at line 924 of file cooling_rates.c.

925 {
927  return 1.;
928  const double rho = PROTONMASS * nHcgs / (1 - helium);
929  double overden = rho/(CoolingParams.rho_crit_baryon * pow(1+redshift,3.0));
930  if (overden >= CoolingParams.HeliumHeatThresh)
933 }
#define PROTONMASS
Definition: physconst.h:21
double HeliumHeatThresh
Definition: cooling_rates.h:54
double HeliumHeatAmp
Definition: cooling_rates.h:55
double rho_crit_baryon
Definition: cooling_rates.h:57
double HeliumHeatExp
Definition: cooling_rates.h:56

References CoolingParams, cooling_params::HeliumHeatAmp, cooling_params::HeliumHeatExp, cooling_params::HeliumHeatOn, cooling_params::HeliumHeatThresh, PROTONMASS, and cooling_params::rho_crit_baryon.

Referenced by get_heatingcooling_rate().

Here is the caller graph for this function:

◆ cool_InverseCompton()

static double cool_InverseCompton ( double  temp,
double  redshift 
)
static

Definition at line 910 of file cooling_rates.c.

911 {
912  double tcmb_red = CoolingParams.CMBTemperature * (1+redshift);
913  return 4 * THOMPSON * RAD_CONST / (ELECTRONMASS * LIGHTCGS ) * pow(tcmb_red, 4) * BOLTZMANN * (temp - tcmb_red);
914 }
#define RAD_CONST
Definition: physconst.h:9
#define ELECTRONMASS
Definition: physconst.h:22
#define THOMPSON
Definition: physconst.h:23
#define LIGHTCGS
Definition: physconst.h:18
double CMBTemperature
Definition: cooling_rates.h:41

References BOLTZMANN, cooling_params::CMBTemperature, CoolingParams, ELECTRONMASS, LIGHTCGS, RAD_CONST, and THOMPSON.

Referenced by get_compton_cooling(), and get_heatingcooling_rate().

Here is the caller graph for this function:

◆ cool_RecombDielect()

static double cool_RecombDielect ( double  temp)
static

Definition at line 853 of file cooling_rates.c.

854 {
855  /*What is this magic number?*/
856  return 6.526e-11* recomb_alphad(temp);
857 }
static double recomb_alphad(double temp)

References recomb_alphad().

Referenced by cool_RecombHeP().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_RecombHeP()

static double cool_RecombHeP ( double  temp)
static

Definition at line 861 of file cooling_rates.c.

862 {
863  return 0.75 * BOLTZMANN * temp * recomb_alphaHep(temp) + cool_RecombDielect(temp);
864 }
static double cool_RecombDielect(double temp)
static double recomb_alphaHep(double temp)

References BOLTZMANN, cool_RecombDielect(), and recomb_alphaHep().

Referenced by get_heatingcooling_rate(), get_individual_cooling(), and init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_RecombHePP()

static double cool_RecombHePP ( double  temp)
static

Definition at line 868 of file cooling_rates.c.

869 {
871  /*Recombination cooling rate from Black 1981: these increase rapidly for T > 5e5K. */
872  return 1.140e-26 * sqrt(temp) * (6.607 - 0.5 * log(temp) + 7.459e-3 * pow(temp, 1./3));
873  }
874  return 0.75 * BOLTZMANN * temp * recomb_alphaHepp(temp);
875 }
static double recomb_alphaHepp(double temp)

References BOLTZMANN, cooling_params::cooling, CoolingParams, Enzo2Nyx, and recomb_alphaHepp().

Referenced by get_heatingcooling_rate(), get_individual_cooling(), and init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cool_RecombHp()

static double cool_RecombHp ( double  temp)
static

Definition at line 842 of file cooling_rates.c.

843 {
845  /*Recombination cooling rate from Black 1981: these increase rapidly for T > 5e5K. */
846  return 2.851e-27 * sqrt(temp) * (5.914 - 0.5 * log(temp) + 0.01184 * pow(temp, 1./3));
847  }
848  return 0.75 * BOLTZMANN * temp * recomb_alphaHp(temp);
849 }
double recomb_alphaHp(double temp)

References BOLTZMANN, cooling_params::cooling, CoolingParams, Enzo2Nyx, and recomb_alphaHp().

Referenced by get_heatingcooling_rate(), get_individual_cooling(), and init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_compton_cooling()

double get_compton_cooling ( double  density,
double  ienergy,
double  helium,
double  redshift,
double  nebynh 
)

Definition at line 1034 of file cooling_rates.c.

1035 {
1036  double nh = density * (1 - helium);
1037  double temp = get_temp_internal(nebynh, ienergy, helium);
1038  /*Compton cooling in erg/s cm^3*/
1039  double LambdaCmptn = -1*nebynh * cool_InverseCompton(temp, redshift) / nh;
1040  return LambdaCmptn * pow(1 - helium, 2) * density / PROTONMASS;
1041 }
static double cool_InverseCompton(double temp, double redshift)
static double get_temp_internal(double nebynh, double ienergy, double helium)
void density(const ActiveParticles *act, int update_hsml, int DoEgyDensity, int BlackHoleOn, double MinEgySpec, const DriftKickTimes times, Cosmology *CP, struct sph_pred_data *SPH_predicted, MyFloat *GradRho, const ForceTree *const tree)
Definition: density.c:203

References cool_InverseCompton(), density(), get_temp_internal(), and PROTONMASS.

Here is the call graph for this function:

◆ get_equilib_ne()

double get_equilib_ne ( double  density,
double  ienergy,
double  helium,
double *  logt,
const struct UVBG uvbg,
double  ne_init 
)

Definition at line 683 of file cooling_rates.c.

684 {
685  /*Get hydrogen number density*/
686  double nh = density * (1-helium);
687  /* Avoid getting stuck in an alternate solution
688  * where there is never any heating in the presence of roundoff.*/
689  if(ne_init <= 0)
690  ne_init = 1.0;
691  return scipy_optimize_fixed_point(ne_init, nh, ienergy, helium, logt, uvbg);
692 }
static double scipy_optimize_fixed_point(double ne_init, double nh, double ienergy, double helium, double *logt, const struct UVBG *uvbg)

References density(), and scipy_optimize_fixed_point().

Referenced by get_heatingcooling_rate(), get_helium_ion_phys_cgs(), get_individual_cooling(), get_ne_by_nh(), get_neutral_fraction_phys_cgs(), get_temp(), and test_rate_network().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_global_UVBG()

struct UVBG get_global_UVBG ( double  redshift)

Definition at line 244 of file cooling_rates.c.

264 {
265  struct UVBG GlobalUVBG = {0};
266 
268  return GlobalUVBG;
269 
270  /* Set the homogeneous reionization redshift as the point when the UVB switches on.*/
271  GlobalUVBG.zreion = pow(10,Gamma_log1z[NTreeCool - 1])-1;
272 
275 
276  /* if a threshold is set, disable UV bg above that redshift */
278  return GlobalUVBG;
279 
280 
281  GlobalUVBG.gJH0 = get_photo_rate(redshift, &Gamma_HI);
282  GlobalUVBG.gJHe0 = get_photo_rate(redshift, &Gamma_HeI);
283  GlobalUVBG.gJHep = get_photo_rate(redshift, &Gamma_HeII);
284 
285  GlobalUVBG.epsH0 = get_photo_rate(redshift, &Eps_HI);
286  GlobalUVBG.epsHe0 = get_photo_rate(redshift, &Eps_HeI);
287  /* During helium reionization we have a model for the inhomogeneous non-equilibrium heating.
288  * To avoid double counting, remove the heating in the existing UVB*/
289  if(during_helium_reionization(redshift))
290  GlobalUVBG.epsHep = 0;
291  else
292  GlobalUVBG.epsHep = get_photo_rate(redshift, &Eps_HeII);
293  GlobalUVBG.self_shield_dens = self_shield_dens(redshift, &GlobalUVBG);
294  return GlobalUVBG;
295 }
int during_helium_reionization(double redshift)
static double self_shield_dens(double redshift, const struct UVBG *uvbg)
static double * Gamma_log1z
Definition: cooling_rates.c:88
static struct itp_type Eps_HI Eps_HeI Eps_HeII
Definition: cooling_rates.c:92
static double get_photo_rate(double redshift, struct itp_type *Gamma_tab)
static int NTreeCool
Definition: cooling_rates.c:86
static struct itp_type Gamma_HI Gamma_HeI Gamma_HeII
Definition: cooling_rates.c:90
Definition: cooling.h:8
double epsHep
Definition: cooling.h:13
double epsH0
Definition: cooling.h:12
double gJHep
Definition: cooling.h:10
double gJHe0
Definition: cooling.h:11
double gJH0
Definition: cooling.h:9
double self_shield_dens
Definition: cooling.h:15
double epsHe0
Definition: cooling.h:14
double zreion
Definition: cooling.h:16
double UVRedshiftThreshold
Definition: cooling_rates.h:47

References CoolingParams, cooling_params::fBar, UVBG::gJH0, GrayOpac, GrayOpac_ydata, GrayOpac_zz, and NGRAY.

Referenced by cooling_and_starformation(), get_helium_neutral_fraction_sfreff(), get_neutral_fraction_sfreff(), sfreff_on_eeqos(), test_DoCooling(), test_heatingcooling_rate(), test_rate_network(), and test_uvbg_loader().

Here is the caller graph for this function:

◆ get_heatingcooling_rate()

double get_heatingcooling_rate ( double  density,
double  ienergy,
double  helium,
double  redshift,
double  metallicity,
const struct UVBG uvbg,
double *  ne_equilib 
)

Definition at line 1104 of file cooling_rates.c.

1105 {
1106  double logt;
1107  double ne = get_equilib_ne(density, ienergy, helium, &logt, uvbg, *ne_equilib);
1108  double nh = density * (1 - helium);
1109  double nebynh = ne/nh;
1110  /*Faster than running the exp.*/
1111  double temp = get_temp_internal(nebynh, ienergy, helium);
1112  double photofac = self_shield_corr(nh, logt, uvbg->self_shield_dens);
1113 
1114  /*The helium number fraction*/
1115  double yy = helium / 4 / (1 - helium);
1116 
1117  double nH0 = nH0_internal(logt, ne, uvbg, photofac);
1118  double nHp = nHp_internal(nH0);
1119  struct he_ions He = nHe_internal(nh, logt, ne, uvbg, photofac);
1120  /*Put the abundances in units of nH to avoid underflows*/
1121  He.nHep*= yy/nh;
1122  He.nHe0*= yy/nh;
1123  He.nHepp*= yy/nh;
1124  /*Collisional ionization and excitation rate*/
1125  double LambdaCollis = nebynh * (get_interpolated_recomb(logt, cool_collisH0, cool_CollisionalH0) * nH0 +
1128  double LambdaRecomb = nebynh * (get_interpolated_recomb(logt, cool_recombHp, cool_RecombHp) * nHp +
1131  /*Free-free cooling rate*/
1132  double LambdaFF = 0;
1133 
1135 
1136  if(CoolingParams.cooling == Enzo2Nyx) {
1137  LambdaFF = nebynh * (cff * (nHp + He.nHep) + cool_FreeFree(temp, 2) * He.nHepp);
1138  } else {
1139  /*The factor of (zz=2)^2 has been pulled out, so if we use the Spitzer gaunt factor we don't need
1140  * to call the FreeFree function again.*/
1141  LambdaFF = nebynh * (cff * (nHp + He.nHep) + 4 * cff * He.nHepp);
1142  }
1143  /*Compton cooling in erg/s cm^3*/
1144  double LambdaCmptn = nebynh * cool_InverseCompton(temp, redshift) / nh;
1145  /*Total cooling rate per proton in erg/s cm^3*/
1146  double Lambda = LambdaCollis + LambdaRecomb + LambdaFF + LambdaCmptn;
1147 
1148  /*Total heating rate per proton in erg/s cm^3*/
1149  double Heat = (nH0 * uvbg->epsH0 + He.nHe0 * uvbg->epsHe0 + He.nHep * uvbg->epsHep)/nh;
1150 
1151  Heat *= cool_he_reion_factor(density, helium, redshift);
1152  /*Set external equilibrium electron density*/
1153  *ne_equilib = nebynh;
1154 
1155  /*Apply metal cooling. Does nothing if metal cooling is disabled*/
1156  double MetalCooling = metallicity * TableMetalCoolingRate(redshift, temp, nh);
1157 
1158  double LambdaNet = Heat - Lambda - MetalCooling;
1159 
1160  //message(1, "Heat = %g Lambda = %g MetalCool = %g LC = %g LR = %g LFF = %g LCmptn = %g, ne = %g, nH0 = %g, nHp = %g, nHe0 = %g, nHep = %g, nHepp = %g, nh=%g, temp=%g, ienergy=%g\n", Heat, Lambda, MetalCooling, LambdaCollis, LambdaRecomb, LambdaFF, LambdaCmptn, nebynh, nH0, nHp, nHe0, nHep, nHepp, nh, temp, ienergy);
1161 
1162  /* LambdaNet in erg cm^3 /s, Density in protons/cm^3, PROTONMASS in protons/g.
1163  * Convert to erg/s/g*/
1164  return LambdaNet * pow(1 - helium, 2) * density / PROTONMASS;
1165 }
static struct he_ions nHe_internal(double nh, double logt, double ne, const struct UVBG *uvbg, double photofac)
static double nHp_internal(double nH0)
static double * cool_recombHePP
static double * cool_freefree1
static double * cool_collisHe0
static double * cool_recombHp
double get_equilib_ne(double density, double ienergy, double helium, double *logt, const struct UVBG *uvbg, double ne_init)
static double cool_CollisionalHe0(double temp)
static double nH0_internal(double logt, double ne, const struct UVBG *uvbg, double photofac)
static double cool_FreeFree1(double temp)
static double cool_RecombHePP(double temp)
static double * cool_collisHeP
static double cool_CollisionalH0(double temp)
static double cool_RecombHeP(double temp)
static double * cool_collisH0
static double self_shield_corr(double nh, double logt, double ssdens)
static double cool_he_reion_factor(double nHcgs, double helium, double redshift)
static double cool_CollisionalHeP(double temp)
static double cool_RecombHp(double temp)
static double get_interpolated_recomb(double logt, double *rec_tab, double rec_func(double))
static double * cool_recombHeP
double TableMetalCoolingRate(double redshift, double temp, double nHcgs)
double nHe0
double nHep
double nHepp

References cool_collisH0, cool_collisHe0, cool_collisHeP, cool_CollisionalH0(), cool_CollisionalHe0(), cool_CollisionalHeP(), cool_FreeFree(), cool_freefree1, cool_FreeFree1(), cool_he_reion_factor(), cool_InverseCompton(), cool_recombHeP, cool_RecombHeP(), cool_recombHePP, cool_RecombHePP(), cool_recombHp, cool_RecombHp(), cooling_params::cooling, CoolingParams, density(), Enzo2Nyx, UVBG::epsH0, UVBG::epsHe0, UVBG::epsHep, get_equilib_ne(), get_interpolated_recomb(), get_temp_internal(), nH0_internal(), he_ions::nHe0, nHe_internal(), he_ions::nHep, he_ions::nHepp, nHp_internal(), PROTONMASS, self_shield_corr(), UVBG::self_shield_dens, and TableMetalCoolingRate().

Referenced by get_lambdanet(), GetCoolingTime(), and test_heatingcooling_rate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_helium_ion_phys_cgs()

double get_helium_ion_phys_cgs ( int  ion,
double  density,
double  ienergy,
double  helium,
const struct UVBG uvbg,
double  ne_init 
)

Definition at line 1202 of file cooling_rates.c.

1203 {
1204  double logt;
1205  double ne = get_equilib_ne(density, ienergy, helium, &logt, uvbg, ne_init);
1206  double yy = helium / 4 / (1 - helium);
1207  double nh = density * (1-helium);
1208  double photofac = self_shield_corr(nh, logt, uvbg->self_shield_dens);
1209  struct he_ions He = nHe_internal(nh, logt, ne, uvbg, photofac);
1210  if(ion == 0)
1211  return yy * He.nHe0 / nh;
1212  else if (ion == 1)
1213  return yy * He.nHep / nh;
1214  else
1215  return yy * He.nHepp / nh;
1216 }

References density(), get_equilib_ne(), he_ions::nHe0, nHe_internal(), he_ions::nHep, he_ions::nHepp, self_shield_corr(), and UVBG::self_shield_dens.

Referenced by GetHeliumIonFraction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_individual_cooling()

double get_individual_cooling ( enum CoolProcess  process,
double  density,
double  ienergy,
double  helium,
const struct UVBG uvbg,
double *  ne_equilib 
)

Definition at line 1046 of file cooling_rates.c.

1047 {
1048  double logt;
1049  double ne = get_equilib_ne(density, ienergy, helium, &logt, uvbg, *ne_equilib);
1050  double nh = density * (1 - helium);
1051  double nebynh = ne/nh;
1052  /*Faster than running the exp.*/
1053  double temp = get_temp_internal(nebynh, ienergy, helium);
1054  double photofac = self_shield_corr(nh, logt, uvbg->self_shield_dens);
1055  double nH0 = nH0_internal(logt, ne, uvbg, photofac);
1056  double nHp = nHp_internal(nH0);
1057  /*The helium number fraction*/
1058  double yy = helium / 4 / (1 - helium);
1059  struct he_ions He = nHe_internal(nh, logt, ne, uvbg, photofac);
1060  /*Put the abundances in units of nH to avoid underflows*/
1061  He.nHep*= yy/nh;
1062  He.nHe0*= yy/nh;
1063  He.nHepp*= yy/nh;
1064 
1065  /*Compton cooling in erg/s cm^3*/
1066  double Lambda = 0;
1067 
1068  if(process == FREEFREE) {
1070  if(CoolingParams.cooling == Enzo2Nyx) {
1071  Lambda = -1*nebynh * (cff * (nHp + He.nHep) + cool_FreeFree(temp, 2) * He.nHepp);
1072  } else {
1073  /*The factor of (zz=2)^2 has been pulled out, so if we use the Spitzer gaunt factor we don't need
1074  * to call the FreeFree function again.*/
1075  Lambda = -1*nebynh * (cff * (nHp + He.nHep) + 4 * cff * He.nHepp);
1076  }
1077  } else if(process == HEAT) {
1078  /*Total heating rate per proton in erg/s cm^3*/
1079  Lambda = (nH0 * uvbg->epsH0 + He.nHe0 * uvbg->epsHe0 + He.nHep * uvbg->epsHep)/nh;
1080  }
1081  else if(process == RECOMB) {
1082  Lambda = -1*nebynh * (get_interpolated_recomb(logt, cool_recombHp, cool_RecombHp) * nHp +
1085  }
1086  else if(process == COLLIS) {
1087  Lambda = -1*nebynh * (get_interpolated_recomb(logt, cool_collisH0, cool_CollisionalH0) * nH0 +
1090  }
1091 
1092  return Lambda * pow(1 - helium, 2) * density / PROTONMASS;
1093 }
@ RECOMB
Definition: cooling_rates.h:95
@ HEAT
Definition: cooling_rates.h:98
@ COLLIS
Definition: cooling_rates.h:96
@ FREEFREE
Definition: cooling_rates.h:97

References COLLIS, cool_collisH0, cool_collisHe0, cool_collisHeP, cool_CollisionalH0(), cool_CollisionalHe0(), cool_CollisionalHeP(), cool_FreeFree(), cool_freefree1, cool_FreeFree1(), cool_recombHeP, cool_RecombHeP(), cool_recombHePP, cool_RecombHePP(), cool_recombHp, cool_RecombHp(), cooling_params::cooling, CoolingParams, density(), Enzo2Nyx, UVBG::epsH0, UVBG::epsHe0, UVBG::epsHep, FREEFREE, get_equilib_ne(), get_interpolated_recomb(), get_temp_internal(), HEAT, nH0_internal(), he_ions::nHe0, nHe_internal(), he_ions::nHep, he_ions::nHepp, nHp_internal(), PROTONMASS, RECOMB, self_shield_corr(), and UVBG::self_shield_dens.

Here is the call graph for this function:

◆ get_interpolated_recomb()

static double get_interpolated_recomb ( double  logt,
double *  rec_tab,
double   rec_funcdouble 
)
static

Definition at line 510 of file cooling_rates.c.

511 {
512  /*Find the index to use in our temperature table.*/
513  double dind = (logt - RECOMBTMIN) / (RECOMBTMAX - RECOMBTMIN) * NRECOMBTAB;
514  int index = (int) dind;
515  /*Just call the function directly if we are out of interpolation range*/
516  if(index < 0 || index >= NRECOMBTAB-1)
517  return rec_func(exp(logt));
518  //if (temp_tab[index] > logt || temp_tab[index+1] < logt || index < 0 || index >= NRECOMBTAB)
519  // endrun(2, "Incorrect indexing of recombination array\n");
520  return rec_tab[index + 1] * (dind - index) + rec_tab[index] * (1 - (dind - index));
521 }
#define NRECOMBTAB
Definition: cooling_rates.c:95
#define RECOMBTMIN
Definition: cooling_rates.c:97
#define RECOMBTMAX
Definition: cooling_rates.c:96

References NRECOMBTAB, RECOMBTMAX, and RECOMBTMIN.

Referenced by get_heatingcooling_rate(), get_individual_cooling(), and nH0_internal().

Here is the caller graph for this function:

◆ get_ne_by_nh()

double get_ne_by_nh ( double  density,
double  ienergy,
double  helium,
const struct UVBG uvbg,
double  ne_init 
)

Definition at line 696 of file cooling_rates.c.

697 {
698  double logt;
699  return get_equilib_ne(density, ienergy, helium, &logt, uvbg, ne_init)/(density*(1-helium));
700 }

References density(), and get_equilib_ne().

Here is the call graph for this function:

◆ get_neutral_fraction_phys_cgs()

double get_neutral_fraction_phys_cgs ( double  density,
double  ienergy,
double  helium,
const struct UVBG uvbg,
double *  ne_init 
)

Definition at line 1186 of file cooling_rates.c.

1187 {
1188  double logt;
1189  double ne = get_equilib_ne(density, ienergy, helium, &logt, uvbg, *ne_init);
1190  double nh = density * (1-helium);
1191  double photofac = self_shield_corr(nh, logt, uvbg->self_shield_dens);
1192  *ne_init = ne/nh;
1193  return nH0_internal(logt, ne, uvbg, photofac);
1194 }

References density(), get_equilib_ne(), nH0_internal(), self_shield_corr(), and UVBG::self_shield_dens.

Referenced by GetNeutralFraction(), and test_rate_network().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_photo_rate()

static double get_photo_rate ( double  redshift,
struct itp_type Gamma_tab 
)
static

Definition at line 215 of file cooling_rates.c.

216 {
218  return 0;
219  double log1z = log10(1+redshift);
220  double photo_rate;
221  if (NTreeCool < 1 || log1z >= Gamma_log1z[NTreeCool - 1])
222  return 0;
223  else if (log1z < Gamma_log1z[0])
224  photo_rate = Gamma_tab->ydata[0];
225  else {
226  photo_rate = gsl_interp_eval(Gamma_tab->intp, Gamma_log1z, Gamma_tab->ydata, log1z, NULL);
227  }
228  return pow(10, photo_rate) * CoolingParams.PhotoIonizeFactor;
229 }
double PhotoIonizeFactor
Definition: cooling_rates.h:38
gsl_interp * intp
Definition: cooling_rates.c:82
double * ydata
Definition: cooling_rates.c:81

References CoolingParams, Gamma_log1z, itp_type::intp, NTreeCool, cooling_params::PhotoIonizationOn, cooling_params::PhotoIonizeFactor, and itp_type::ydata.

◆ get_temp()

double get_temp ( double  density,
double  ienergy,
double  helium,
const struct UVBG uvbg,
double *  ne_init 
)

Definition at line 1172 of file cooling_rates.c.

1173 {
1174  double logt;
1175  double ne = get_equilib_ne(density, ienergy, helium, &logt, uvbg, *ne_init);
1176  double nh = density * (1 - helium);
1177  *ne_init = ne/nh;
1178  return get_temp_internal(ne/nh, ienergy, helium);
1179 }

References density(), get_equilib_ne(), and get_temp_internal().

Referenced by test_rate_network().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_temp_internal()

static double get_temp_internal ( double  nebynh,
double  ienergy,
double  helium 
)
static

Definition at line 601 of file cooling_rates.c.

602 {
603  /*convert U (erg/g) to T (K) : U = N k T / (γ - 1)
604  T = U (γ-1) μ m_P / k_B
605  where k_B is the Boltzmann constant
606  γ is 5/3, the perfect gas constant
607  m_P is the proton mass
608  μ is 1 / (mean no. molecules per unit atomic weight) calculated in loop.
609  Internal energy units are 10^-10 erg/g*/
610  double hy_mass = 1 - helium;
611  double muienergy = 4 / (hy_mass * (3 + 4*nebynh) + 1)*ienergy;
612  /*So for T in K, Boltzmann in erg/K, internal energy has units of erg/g*/
613  double temp = GAMMA_MINUS1 * PROTONMASS / BOLTZMANN * muienergy;
614  if(temp < CoolingParams.MinGasTemp)
615  return CoolingParams.MinGasTemp;
616  return temp;
617 }
#define GAMMA_MINUS1
Definition: physconst.h:35

References BOLTZMANN, CoolingParams, GAMMA_MINUS1, cooling_params::MinGasTemp, and PROTONMASS.

Referenced by get_compton_cooling(), get_heatingcooling_rate(), get_individual_cooling(), get_temp(), ne_internal(), and scipy_optimize_fixed_point().

Here is the caller graph for this function:

◆ init_cooling_rates()

void init_cooling_rates ( const char *  TreeCoolFile,
const char *  MetalCoolFile,
Cosmology CP 
)

Definition at line 970 of file cooling_rates.c.

971 {
973  CoolingParams.rho_crit_baryon = CP->OmegaBaryon * 3.0 * pow(CP->HubbleParam*HUBBLE,2.0) /(8.0*M_PI*GRAVITY);
974 
975  /* Initialize the interpolation for the self-shielding module as a function of redshift.
976  * A crash has been observed in GSL with a cspline interpolator. */
977  GrayOpac = gsl_interp_alloc(gsl_interp_linear,NGRAY);
978  gsl_interp_init(GrayOpac,GrayOpac_zz,GrayOpac_ydata, NGRAY);
979 
980  if(!TreeCoolFile || strnlen(TreeCoolFile,100) == 0) {
982  message(0, "No TreeCool file is provided. Cooling is broken. OK for DM only runs. \n");
983  }
984  else {
985  message(0, "Using uniform UVB from file %s\n", TreeCoolFile);
986  /* Load the TREECOOL into Gamma_HI->ydata, and initialise the interpolators*/
987  load_treecool(TreeCoolFile);
988  }
989 
990  /*Initialize the recombination tables*/
991  temp_tab = (double *) mymalloc("Recombination_tables", NRECOMBTAB * sizeof(double) * 14);
992 
1006 
1007  int i;
1008  for(i = 0 ; i < NRECOMBTAB; i++)
1009  {
1011  double tt = exp(temp_tab[i]);
1016  /* Note this includes dielectronic recombination*/
1025  cool_freefree1[i] = cool_FreeFree(tt, 1);
1026  }
1027 
1028  /*Initialize the metal cooling table*/
1029  InitMetalCooling(MetalCoolFile);
1030 }
static void load_treecool(const char *TreeCoolFile)
static double * rec_GammaHe0
static gsl_interp * GrayOpac
Definition: cooling_rates.c:70
static const double GrayOpac_ydata[NGRAY]
Definition: cooling_rates.c:75
static double * rec_GammaHep
static double * rec_alphaHp
Definition: cooling_rates.c:99
static const double GrayOpac_zz[NGRAY]
Definition: cooling_rates.c:76
static double recomb_alphaHepd(double temp)
#define NGRAY
Definition: cooling_rates.c:73
static double * rec_alphaHep
Definition: cooling_rates.c:99
static double * rec_GammaH0
static double * temp_tab
Definition: cooling_rates.c:98
static double * rec_alphaHepp
Definition: cooling_rates.c:99
void InitMetalCooling(const char *MetalCoolFile)
void message(int where, const char *fmt,...)
Definition: endrun.c:175
#define mymalloc(name, size)
Definition: mymalloc.h:15
#define HUBBLE
Definition: physconst.h:25
#define GRAVITY
Definition: physconst.h:5
static Cosmology * CP
Definition: power.c:27
double HubbleParam
Definition: cosmology.h:20
double OmegaCDM
Definition: cosmology.h:11
double OmegaBaryon
Definition: cosmology.h:19
static const double tt[NEXACT]

References cool_collisH0, cool_collisHe0, cool_collisHeP, cool_CollisionalH0(), cool_CollisionalHe0(), cool_CollisionalHeP(), cool_FreeFree(), cool_freefree1, cool_recombHeP, cool_RecombHeP(), cool_recombHePP, cool_RecombHePP(), cool_recombHp, cool_RecombHp(), CoolingParams, CP, cooling_params::fBar, GRAVITY, GrayOpac, GrayOpac_ydata, GrayOpac_zz, HUBBLE, Cosmology::HubbleParam, InitMetalCooling(), load_treecool(), message(), mymalloc, NGRAY, NRECOMBTAB, Cosmology::OmegaBaryon, Cosmology::OmegaCDM, cooling_params::PhotoIonizationOn, rec_alphaHep, rec_alphaHepp, rec_alphaHp, rec_GammaH0, rec_GammaHe0, rec_GammaHep, recomb_alphaHepd(), recomb_alphaHepp(), recomb_alphaHp(), recomb_GammaeH0(), recomb_GammaeHe0(), recomb_GammaeHep(), RECOMBTMAX, RECOMBTMIN, cooling_params::rho_crit_baryon, temp_tab, and tt.

Referenced by init_cooling(), test_heatingcooling_rate(), test_rate_network(), test_recomb_rates(), and test_uvbg_loader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_itp_type()

static void init_itp_type ( double *  xarr,
struct itp_type Gamma,
int  Nelem 
)
static

Definition at line 107 of file cooling_rates.c.

108 {
109  Gamma->intp = gsl_interp_alloc(gsl_interp_linear,Nelem);
110  gsl_interp_init(Gamma->intp, xarr, Gamma->ydata, Nelem);
111 }

References itp_type::intp, and itp_type::ydata.

Referenced by load_treecool().

Here is the caller graph for this function:

◆ load_tree_value()

static double load_tree_value ( char **  saveptr)
static

Definition at line 115 of file cooling_rates.c.

116 {
117  double data = atof(strtok_r(NULL, " \t", saveptr));
118  if(data > 0)
119  return log10(data);
120  return -9000;
121 }

Referenced by load_treecool().

Here is the caller graph for this function:

◆ load_treecool()

static void load_treecool ( const char *  TreeCoolFile)
static

Definition at line 130 of file cooling_rates.c.

131 {
133  return;
134  FILE * fd = fopen(TreeCoolFile, "r");
135  if(!fd)
136  endrun(456, "Could not open photon background (TREECOOL) file at: '%s'\n", TreeCoolFile);
137 
138  /*Find size of file*/
139  NTreeCool = 0;
140  do
141  {
142  char buffer[1024];
143  char * retval = fgets(buffer, 1024, fd);
144  /*Happens on end of file*/
145  if(!retval)
146  break;
147  retval = strtok(buffer, " \t");
148  /*Discard comments*/
149  if(!retval || retval[0] == '#')
150  continue;
151  NTreeCool++;
152  }
153  while(1);
154  rewind(fd);
155 
156  MPI_Bcast(&(NTreeCool), 1, MPI_INT, 0, MPI_COMM_WORLD);
157 
158  if(NTreeCool<= 2)
159  endrun(1, "Photon background contains: %d entries, not enough.\n", NTreeCool);
160 
161  /*Allocate memory for the photon background table.*/
162  Gamma_log1z = (double *) mymalloc("TreeCoolTable", 7 * NTreeCool * sizeof(double));
163  Gamma_HI.ydata = Gamma_log1z + NTreeCool;
164  Gamma_HeI.ydata = Gamma_log1z + 2 * NTreeCool;
166  Eps_HI.ydata = Gamma_log1z + 4 * NTreeCool;
167  Eps_HeI.ydata = Gamma_log1z + 5 * NTreeCool;
169 
170  int ThisTask;
171  MPI_Comm_rank(MPI_COMM_WORLD, &ThisTask);
172  if(ThisTask == 0)
173  {
174  int i = 0;
175  while(i < NTreeCool)
176  {
177  char buffer[1024];
178  char * saveptr;
179  char * line = fgets(buffer, 1024, fd);
180  /*Happens on end of file*/
181  if(!line)
182  break;
183  char * retval = strtok_r(line, " \t", &saveptr);
184  if(!retval || retval[0] == '#')
185  continue;
186  Gamma_log1z[i] = atof(retval);
187  /*Get the rest*/
188  Gamma_HI.ydata[i] = load_tree_value(&saveptr);
189  Gamma_HeI.ydata[i] = load_tree_value(&saveptr);
190  Gamma_HeII.ydata[i] = load_tree_value(&saveptr);
191  Eps_HI.ydata[i] = load_tree_value(&saveptr)+ CoolingParams.HydrogenHeatAmp;
192  Eps_HeI.ydata[i] = load_tree_value(&saveptr);
193  Eps_HeII.ydata[i] = load_tree_value(&saveptr);
194  i++;
195  }
196 
197  fclose(fd);
198  }
199 
200  /*Broadcast data to other processors*/
201  MPI_Bcast(Gamma_log1z, 7 * NTreeCool, MPI_DOUBLE, 0, MPI_COMM_WORLD);
202  /*Initialize the UVB redshift interpolation: reticulate the splines*/
203  init_itp_type(Gamma_log1z, &Gamma_HI, NTreeCool);
204  init_itp_type(Gamma_log1z, &Gamma_HeI, NTreeCool);
207  init_itp_type(Gamma_log1z, &Eps_HeI, NTreeCool);
209 
210  message(0, "Read %d lines z = %g - %g from file %s\n", NTreeCool, pow(10, Gamma_log1z[0])-1, pow(10, Gamma_log1z[NTreeCool-1])-1, TreeCoolFile);
211 }
static double load_tree_value(char **saveptr)
static void init_itp_type(double *xarr, struct itp_type *Gamma, int Nelem)
void endrun(int where, const char *fmt,...)
Definition: endrun.c:147
double HydrogenHeatAmp
Definition: cooling_rates.h:50
int ThisTask
Definition: test_exchange.c:23

References CoolingParams, endrun(), Eps_HeII, Gamma_HeII, Gamma_log1z, cooling_params::HydrogenHeatAmp, init_itp_type(), load_tree_value(), message(), mymalloc, NTreeCool, cooling_params::PhotoIonizationOn, ThisTask, and itp_type::ydata.

Referenced by init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ne_internal()

static double ne_internal ( double  nh,
double  ienergy,
double  ne,
double  helium,
double *  logt,
const struct UVBG uvbg 
)
static

Definition at line 621 of file cooling_rates.c.

622 {
623  double yy = helium / 4 / (1 - helium);
624  *logt = log(get_temp_internal(ne/nh, ienergy, helium));
625  double photofac = self_shield_corr(nh, *logt, uvbg->self_shield_dens);
626  double nH0 = nH0_internal(*logt, ne, uvbg, photofac);
627  double nHp = nHp_internal(nH0);
628  struct he_ions He = nHe_internal(nh, *logt, ne, uvbg, photofac);
629  return nh * nHp + yy * He.nHep + 2 * yy * He.nHepp;
630 }

References get_temp_internal(), nH0_internal(), nHe_internal(), he_ions::nHep, he_ions::nHepp, nHp_internal(), self_shield_corr(), and UVBG::self_shield_dens.

Referenced by scipy_optimize_fixed_point().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nH0_internal()

static double nH0_internal ( double  logt,
double  ne,
const struct UVBG uvbg,
double  photofac 
)
static

Definition at line 526 of file cooling_rates.c.

527 {
528  double alphaHp = get_interpolated_recomb(logt, rec_alphaHp, &recomb_alphaHp);
529  double GammaeH0 = get_interpolated_recomb(logt, rec_GammaH0, &recomb_GammaeH0);
530  /*Be careful when there is no ionization.*/
531  double photorate = 0;
532  if(uvbg->gJH0 > 0. && ne > 1e-50)
533  photorate = uvbg->gJH0/ne * photofac;
534  return alphaHp/ (alphaHp + GammaeH0 + photorate);
535 }

References get_interpolated_recomb(), UVBG::gJH0, rec_alphaHp, rec_GammaH0, recomb_alphaHp(), and recomb_GammaeH0().

Referenced by get_heatingcooling_rate(), get_individual_cooling(), get_neutral_fraction_phys_cgs(), and ne_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nHe_internal()

static struct he_ions nHe_internal ( double  nh,
double  logt,
double  ne,
const struct UVBG uvbg,
double  photofac 
)
static

Definition at line 539 of file cooling_rates.c.

557 {
558  double alphaHep = get_interpolated_recomb(logt, rec_alphaHep, &recomb_alphaHepd);
559  double alphaHepp = get_interpolated_recomb(logt, rec_alphaHepp, &recomb_alphaHepp);
560  double GammaHe0 = get_interpolated_recomb(logt, rec_GammaHe0, &recomb_GammaeHe0);
561  double GammaHep = get_interpolated_recomb(logt, rec_GammaHep, &recomb_GammaeHep);
562  struct he_ions He;
563  /*Be careful when there is no ionization.*/
564  if(uvbg->gJHe0 > 0. && ne > 1e-50) {
565  GammaHe0 += uvbg->gJHe0/ne * photofac;
566  GammaHep += uvbg->gJHep/ne * photofac;
567  }
568  /*Deal with the case where there is no ionization separately to avoid NaN.*/
569  if(GammaHe0 > 1e-50) {
570  He.nHep = nh / (1 + alphaHep / GammaHe0 + GammaHep/alphaHepp);
571  He.nHe0 = He.nHep * alphaHep / GammaHe0;
572  He.nHepp = He.nHep * GammaHep / alphaHepp;
573  }
574  else {
575  He.nHep = 0;
576  He.nHe0 = 1;
577  He.nHepp = 0;
578  }
579  return He;
580 }

Referenced by get_heatingcooling_rate(), get_helium_ion_phys_cgs(), get_individual_cooling(), and ne_internal().

Here is the caller graph for this function:

◆ nHp_internal()

static double nHp_internal ( double  nH0)
static

Definition at line 539 of file cooling_rates.c.

540 {
541  double nHp = 1. - nH0;
542  if (nHp < 0)
543  return 0;
544  return nHp;
545 }

Referenced by get_heatingcooling_rate(), get_individual_cooling(), and ne_internal().

Here is the caller graph for this function:

◆ recomb_alphad()

static double recomb_alphad ( double  temp)
static

Definition at line 406 of file cooling_rates.c.

407 {
408  switch(CoolingParams.recomb)
409  {
410  case Cen92:
411  return 1.9e-3 / pow(temp,1.5) * exp(-4.7e5/temp)*(1+0.3*exp(-9.4e4/temp));
412  case Verner96:
413  case Badnell06:
414  /* Private communication from Avery Meiksin:
415  The rate in Black (1981) is wrong by a factor of 0.65. He took the rate fit from Aldrovandi & Pequignot (1973),
416  who based it on Burgess (1965), but was unaware of the correction factor in Burgess & Tworkowski (1976, ApJ 205:L105-L107, fig 1).
417  The correct dielectronic cooling rate should have the coefficient 0.813e-13 instead of 1.24e-13 as in Black's table 3.
418  */
419  return 1.23e-3 / pow(temp,1.5) * exp(-4.72e5/temp)*(1+0.3*exp(-9.4e4/temp));
420  default:
421  endrun(3, "Recombination rate not supported\n");
422  }
423 }
@ Cen92
Definition: cooling_rates.h:11
@ Verner96
Definition: cooling_rates.h:12
@ Badnell06
Definition: cooling_rates.h:13
enum RecombType recomb
Definition: cooling_rates.h:26

References Badnell06, Cen92, CoolingParams, endrun(), cooling_params::recomb, and Verner96.

Referenced by cool_RecombDielect(), and recomb_alphaHepd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recomb_alphaHep()

static double recomb_alphaHep ( double  temp)
static

Definition at line 387 of file cooling_rates.c.

388 {
389  switch(CoolingParams.recomb)
390  {
391  case Cen92:
392  return 1.5e-10 / pow(temp,0.6353);
393  case Verner96:
394  return _Verner96alphaHep(temp);
395  case Badnell06:
396  return _Verner96Fit(temp, 1.818E-10, 0.7492, 10.17, 2.786e6);
397  default:
398  endrun(3, "Recombination rate not supported\n");
399  }
400 }
static double _Verner96alphaHep(double temp)

References _Verner96alphaHep(), _Verner96Fit(), Badnell06, Cen92, CoolingParams, endrun(), cooling_params::recomb, and Verner96.

Referenced by cool_RecombHeP(), and recomb_alphaHepd().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recomb_alphaHepd()

static double recomb_alphaHepd ( double  temp)
static

Definition at line 427 of file cooling_rates.c.

428 {
429  return recomb_alphad(temp) + recomb_alphaHep(temp);
430 }

References recomb_alphad(), and recomb_alphaHep().

Referenced by init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recomb_alphaHepp()

static double recomb_alphaHepp ( double  temp)
static

Definition at line 434 of file cooling_rates.c.

435 {
436  switch(CoolingParams.recomb)
437  {
438  case Cen92:
439  return 4 * recomb_alphaHp(temp);
440  case Verner96:
441  return _Verner96Fit(temp, 1.891e-10, 0.7524, 9.370, 2.774e6);
442  case Badnell06:
443  return _Verner96Fit(temp, 5.235E-11, 0.6988 + 0.0829*exp(-1.682e5/temp), 7.301, 4.475e6);
444  default:
445  endrun(3, "Recombination rate not supported\n");
446  }
447 }

References _Verner96Fit(), Badnell06, Cen92, CoolingParams, endrun(), cooling_params::recomb, recomb_alphaHp(), and Verner96.

Referenced by cool_RecombHePP(), and init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recomb_alphaHp()

double recomb_alphaHp ( double  temp)

Definition at line 347 of file cooling_rates.c.

348 {
349  switch(CoolingParams.recomb)
350  {
351  case Cen92:
352  return 8.4e-11 / sqrt(temp) / pow(temp/1000, 0.2) / (1+ pow(temp/1e6, 0.7));
353  case Verner96:
354  /*The V&F 96 fitting formula is accurate to < 1% in the worst case.
355  See line 1 of V&F96 table 1.*/
356  return _Verner96Fit(temp, 7.982e-11, 0.748, 3.148, 7.036e+05);
357  case Badnell06:
358  /*Slightly different fit coefficients*/
359  return _Verner96Fit(temp, 8.318e-11, 0.7472, 2.965, 7.001e5);
360  default:
361  endrun(3, "Recombination rate not supported\n");
362  }
363 }

References _Verner96Fit(), Badnell06, Cen92, CoolingParams, endrun(), cooling_params::recomb, and Verner96.

Referenced by cool_RecombHp(), init_cooling_rates(), nH0_internal(), recomb_alphaHepp(), and test_recomb_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recomb_GammaeH0()

static double recomb_GammaeH0 ( double  temp)
static

Definition at line 459 of file cooling_rates.c.

460 {
461  switch(CoolingParams.recomb)
462  {
463  case Cen92:
464  return 5.85e-11 * sqrt(temp) * exp(-157809.1/temp) / (1 + sqrt(temp/1e5));
465  case Verner96:
466  case Badnell06:
467  //Voronov 97 Table 1
468  return _Voronov96Fit(temp, 13.6, 0, 0.291e-07, 0.232, 0.39);
469  default:
470  endrun(3, "Collisional rate not supported\n");
471  }
472 }
static double _Voronov96Fit(double temp, double dE, double PP, double AA, double XX, double KK)

References _Voronov96Fit(), Badnell06, Cen92, CoolingParams, endrun(), cooling_params::recomb, and Verner96.

Referenced by cool_CollisionalIonizeH0(), init_cooling_rates(), and nH0_internal().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recomb_GammaeHe0()

static double recomb_GammaeHe0 ( double  temp)
static

Definition at line 476 of file cooling_rates.c.

477 {
478  switch(CoolingParams.recomb)
479  {
480  case Cen92:
481  return 2.38e-11 * sqrt(temp) * exp(-285335.4/temp) / (1+ sqrt(temp/1e5));
482  case Verner96:
483  case Badnell06:
484  //Voronov 97 Table 1
485  return _Voronov96Fit(temp, 24.6, 0, 0.175e-07, 0.180, 0.35);
486  default:
487  endrun(3, "Collisional rate not supported\n");
488  }
489 }

References _Voronov96Fit(), Badnell06, Cen92, CoolingParams, endrun(), cooling_params::recomb, and Verner96.

Referenced by cool_CollisionalIonizeHe0(), and init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ recomb_GammaeHep()

static double recomb_GammaeHep ( double  temp)
static

Definition at line 493 of file cooling_rates.c.

494 {
495  switch(CoolingParams.recomb)
496  {
497  case Cen92:
498  return 5.68e-12 * sqrt(temp) * exp(-631515.0/temp) / (1+ sqrt(temp/1e5));
499  case Verner96:
500  case Badnell06:
501  //Voronov 97 Table 1
502  return _Voronov96Fit(temp, 54.4, 1, 0.205e-08, 0.265, 0.25);
503  default:
504  endrun(3, "Collisional rate not supported\n");
505  }
506 }

References _Voronov96Fit(), Badnell06, Cen92, CoolingParams, endrun(), cooling_params::recomb, and Verner96.

Referenced by cool_CollisionalIonizeHeP(), and init_cooling_rates().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scipy_optimize_fixed_point()

static double scipy_optimize_fixed_point ( double  ne_init,
double  nh,
double  ienergy,
double  helium,
double *  logt,
const struct UVBG uvbg 
)
static

Definition at line 645 of file cooling_rates.c.

646 {
647  int i;
648  double ne0 = ne_init;
649  for(i = 0; i < MAXITER; i++)
650  {
651  double logt1;
652  double ne1 = ne_internal(nh, ienergy, ne0*nh, helium, &logt1, uvbg) / nh;
653 
654  if(fabs(ne1 - ne0) < ITERCONV) {
655  *logt = logt1;
656  ne0 = ne1;
657  break;
658  }
659 
660  double ne2 = ne_internal(nh, ienergy, ne1*nh, helium, &logt1, uvbg) / nh;
661  double d = ne0 + ne2 - 2.0 * ne1;
662  double pp = ne2;
663  /*This is del^2*/
664  if (d > 1e-15 || d < -1e-15)
665  pp = ne0 - (ne1 - ne0)*(ne1 - ne0) / d;
666  ne0 = pp;
667  /*Enforce positivity*/
668  if(ne0 < 0)
669  ne0 = 0;
670  }
671  if (!isfinite(ne0) || i == MAXITER)
672  endrun(1, "Ionization rate network failed to converge for nh = %g temp = %g helium=%g ienergy=%g: last ne = %g (init=%g)\n", nh, get_temp_internal(ne0, ienergy, helium), helium, ienergy, ne0, ne_init);
673  return ne0 * nh;
674 }
#define ITERCONV
#define MAXITER
static double ne_internal(double nh, double ienergy, double ne, double helium, double *logt, const struct UVBG *uvbg)

References endrun(), get_temp_internal(), ITERCONV, MAXITER, and ne_internal().

Referenced by get_equilib_ne().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ self_shield_corr()

static double self_shield_corr ( double  nh,
double  logt,
double  ssdens 
)
static

Definition at line 304 of file cooling_rates.c.

305 {
306  /* Turn off self-shielding for low-density gas.
307  * If such gas becomes very cold, this is not strictly what they find,
308  * but I think it is more physical*/
309  if(!CoolingParams.SelfShieldingOn || nh < ssdens * 0.01)
310  return 1;
311  /* T/1e4**0.17*/
312  double T4 = exp(0.17 * (logt - log(1e4)));
313  double nSSh = 1.003*ssdens*T4;
314  return 0.98*pow(1+pow(nh/nSSh,1.64),-2.28)+0.02*pow(1+nh/nSSh, -0.84);
315 }

References CoolingParams, and cooling_params::SelfShieldingOn.

Referenced by get_heatingcooling_rate(), get_helium_ion_phys_cgs(), get_individual_cooling(), get_neutral_fraction_phys_cgs(), and ne_internal().

Here is the caller graph for this function:

◆ self_shield_dens()

static double self_shield_dens ( double  redshift,
const struct UVBG uvbg 
)
static

Definition at line 244 of file cooling_rates.c.

245 {
246  /*Before the UVBG switches on, no need for self-shielding*/
247  if(uvbg->gJH0 == 0)
248  return 1e10;
249  double G12 = uvbg->gJH0/1e-12;
250  double greyopac;
251  if (redshift <= GrayOpac_zz[0])
252  greyopac = GrayOpac_ydata[0];
253  else if (redshift >= GrayOpac_zz[NGRAY-1])
254  greyopac = GrayOpac_ydata[NGRAY-1];
255  else {
256  greyopac = gsl_interp_eval(GrayOpac, GrayOpac_zz, GrayOpac_ydata,redshift, NULL);
257  }
258  return 6.73e-3 * pow(greyopac / 2.49e-18, -2./3)*pow(G12, 2./3)*pow(CoolingParams.fBar/0.17,-1./3);
259 }

◆ set_cooling_params()

void set_cooling_params ( ParameterSet ps)

Definition at line 942 of file cooling_rates.c.

943 {
944  int ThisTask;
945  MPI_Comm_rank(MPI_COMM_WORLD, &ThisTask);
946  if(ThisTask == 0) {
947  /*Cooling rate network parameters*/
948  CoolingParams.CMBTemperature = param_get_double(ps, "CMBTemperature");
949  CoolingParams.cooling = (enum CoolingType) param_get_enum(ps, "CoolingRates"); // Sherwood;
950  CoolingParams.recomb = (enum RecombType) param_get_enum(ps, "RecombRates"); // Verner96;
951  CoolingParams.SelfShieldingOn = param_get_int(ps, "SelfShieldingOn");
952  CoolingParams.PhotoIonizeFactor = param_get_double(ps, "PhotoIonizeFactor");
953  CoolingParams.PhotoIonizationOn = param_get_int(ps, "PhotoIonizationOn");
954  CoolingParams.MinGasTemp = param_get_double(ps, "MinGasTemp");
955  CoolingParams.UVRedshiftThreshold = param_get_double(ps, "UVRedshiftThreshold");
956  CoolingParams.HydrogenHeatAmp = log10(param_get_double(ps, "HydrogenHeatAmp"));
957 
958  /*Helium model parameters*/
959  CoolingParams.HeliumHeatOn = param_get_int(ps, "HeliumHeatOn");
960  CoolingParams.HeliumHeatThresh = param_get_double(ps, "HeliumHeatThresh");
961  CoolingParams.HeliumHeatAmp = param_get_double(ps, "HeliumHeatAmp");
962  CoolingParams.HeliumHeatExp = param_get_double(ps, "HeliumHeatExp");
963  }
964  MPI_Bcast(&CoolingParams, sizeof(struct cooling_params), MPI_BYTE, 0, MPI_COMM_WORLD);
965 }
CoolingType
Definition: cooling_rates.h:16
RecombType
Definition: cooling_rates.h:10
double param_get_double(ParameterSet *ps, const char *name)
Definition: paramset.c:336
int param_get_int(ParameterSet *ps, const char *name)
Definition: paramset.c:368
int param_get_enum(ParameterSet *ps, const char *name)
Definition: paramset.c:378

References cooling_params::CMBTemperature, cooling_params::cooling, CoolingParams, cooling_params::HeliumHeatAmp, cooling_params::HeliumHeatExp, cooling_params::HeliumHeatOn, cooling_params::HeliumHeatThresh, cooling_params::HydrogenHeatAmp, cooling_params::MinGasTemp, param_get_double(), param_get_enum(), param_get_int(), cooling_params::PhotoIonizationOn, cooling_params::PhotoIonizeFactor, cooling_params::recomb, cooling_params::SelfShieldingOn, ThisTask, and cooling_params::UVRedshiftThreshold.

Referenced by read_parameter_file().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_coolpar()

void set_coolpar ( struct cooling_params  cp)

Definition at line 936 of file cooling_rates.c.

937 {
938  CoolingParams = cp;
939 }

References CoolingParams.

Referenced by test_DoCooling(), test_heatingcooling_rate(), test_rate_network(), test_recomb_rates(), and test_uvbg_loader().

Here is the caller graph for this function:

Variable Documentation

◆ cool_collisH0

double* cool_collisH0
static

◆ cool_collisHe0

double * cool_collisHe0
static

◆ cool_collisHeP

double * cool_collisHeP
static

◆ cool_freefree1

double* cool_freefree1
static

◆ cool_recombHeP

double * cool_recombHeP
static

◆ cool_recombHePP

double * cool_recombHePP
static

◆ cool_recombHp

double* cool_recombHp
static

◆ CoolingParams

struct cooling_params CoolingParams
static

◆ Eps_HeII

struct itp_type Eps_HI Eps_HeI Eps_HeII
static

Definition at line 88 of file cooling_rates.c.

Referenced by load_treecool().

◆ Gamma_HeII

struct itp_type Gamma_HI Gamma_HeI Gamma_HeII
static

Definition at line 88 of file cooling_rates.c.

Referenced by load_treecool().

◆ Gamma_log1z

double* Gamma_log1z
static

Definition at line 88 of file cooling_rates.c.

Referenced by get_photo_rate(), and load_treecool().

◆ GrayOpac

gsl_interp* GrayOpac
static

Definition at line 70 of file cooling_rates.c.

Referenced by get_global_UVBG(), and init_cooling_rates().

◆ GrayOpac_ydata

const double GrayOpac_ydata[NGRAY] = { 2.59e-18, 2.37e-18, 2.27e-18, 2.15e-18, 2.02e-18, 1.94e-18}
static

Definition at line 75 of file cooling_rates.c.

Referenced by get_global_UVBG(), and init_cooling_rates().

◆ GrayOpac_zz

const double GrayOpac_zz[NGRAY] = {0, 1, 2, 3, 4, 5}
static

Definition at line 76 of file cooling_rates.c.

Referenced by get_global_UVBG(), and init_cooling_rates().

◆ NTreeCool

int NTreeCool
static

Definition at line 86 of file cooling_rates.c.

Referenced by get_photo_rate(), and load_treecool().

◆ rec_alphaHep

double * rec_alphaHep
static

Definition at line 99 of file cooling_rates.c.

Referenced by init_cooling_rates().

◆ rec_alphaHepp

double * rec_alphaHepp
static

Definition at line 99 of file cooling_rates.c.

Referenced by init_cooling_rates().

◆ rec_alphaHp

double* rec_alphaHp
static

Definition at line 99 of file cooling_rates.c.

Referenced by init_cooling_rates(), and nH0_internal().

◆ rec_GammaH0

double* rec_GammaH0
static

Definition at line 100 of file cooling_rates.c.

Referenced by init_cooling_rates(), and nH0_internal().

◆ rec_GammaHe0

double * rec_GammaHe0
static

Definition at line 100 of file cooling_rates.c.

Referenced by init_cooling_rates().

◆ rec_GammaHep

double * rec_GammaHep
static

Definition at line 100 of file cooling_rates.c.

Referenced by init_cooling_rates().

◆ temp_tab

double* temp_tab
static

Definition at line 98 of file cooling_rates.c.

Referenced by init_cooling_rates().