Go to the source code of this file.
|
void | Radiat (double *v, double *rhs) |
|
void Radiat |
( |
double * |
v, |
|
|
double * |
rhs |
|
) |
| |
Provide r.h.s. for tabulated cooling.
Definition at line 3 of file radiat.c.
11 double mu,
T, Tmid,
scrh, dT, prs;
12 static double *L_tab, *T_tab, E_cost;
21 print1 (
" > Reading table from disk...\n");
22 fcool = fopen(
"cooltable.dat",
"r");
24 print1 (
"! Radiat: cooltable.dat could not be found.\n");
31 while (fscanf(fcool,
"%lf %lf\n", T_tab + ntab,
52 printf (
" ! Nan found in radiat \n");
53 printf (
" ! rho = %12.6e, prs = %12.6e\n",v[
RHO], prs);
69 if (T > T_tab[khi] || T < T_tab[klo]){
70 print (
" ! T out of range %12.6e\n",T);
74 while (klo != (khi - 1)){
88 dT = T_tab[khi] - T_tab[klo];
89 scrh = L_tab[klo]*(T_tab[khi] -
T)/dT + L_tab[khi]*(T - T_tab[klo])/dT;
90 rhs[RHOE] = -scrh*v[
RHO]*v[
RHO];
93 rhs[RHOE] *= E_cost*scrh*
scrh;
#define UNIT_DENSITY
Unit density in gr/cm^3.
void print1(const char *fmt,...)
#define CONST_amu
Atomic mass unit.
double g_smallPressure
Small value for pressure fix.
#define UNIT_VELOCITY
Unit velocity in cm/sec.
#define UNIT_LENGTH
Unit Length in cm.
void print(const char *fmt,...)
double g_minCoolingTemp
The minimum temperature (in K) below which cooling is suppressed.
#define ARRAY_1D(nx, type)
double MeanMolecularWeight(double *V)
#define QUIT_PLUTO(e_code)