Cooling for optically thin plasma up to about 200,000 K Plasma composition: H, HeI-II, CI-V, NI-V, OI-V, NeI-V, SI-V Assumed abundances in elem_ab Uses S : Array = Variables vector x line points rhs : output for the system of ODE ibeg, iend : begin and end points of the current line
52 int nv,
j,
k, cooling_nT, cooling_nNe, jj;
53 int ti1, ti2, ne1, ne2, nrt;
54 double mu, sT,
scrh, tmpT, tmpNe, tt1, tt2, nn1, nn2, tf1, tf2, nf1, nf2;
55 double N, n_el, rlosst, em, cf1, cf2;
59 static double E_cost, Unit_Time;
95 tab =
ARRAY_3D(NIONS, ne1, ne2,
double);
105 v[nv] =
MIN(v[nv], 1.0);
106 v[nv] =
MAX(v[nv], 0.0);
119 print (
"! Radiat: negative mu\n");
139 n_el = N*(1.0 - v[
X_HI])*elem_ab[
el_H];
141 for (nv = 1; nv <
NIONS; nv++) {
146 if (n_el/N < 1.e-4) n_el = N*1.e-4;
163 for (nv = 1; nv <= NIONS - 2; nv++) {
173 for (nv = 0; nv <
NIONS; nv++) RS[nv] *= Unit_Time;
267 tf1 = (tt2 - tmpT)/(tt2 - tt1);
268 tf2 = (tmpT - tt1)/(tt2 - tt1);
269 nf1 = (nn2 - tmpNe)/(nn2 - nn1);
270 nf2 = (tmpNe - nn1)/(nn2 - nn1);
276 for (nv = 0; nv <
NIONS; nv++) {
277 cf1 = tf1*tab[nv][ne1][ti1] + tf2*tab[nv][ne1][ti2];
278 cf2 = tf1*tab[nv][ne2][ti1] + tf2*tab[nv][ne2][ti2];
284 scrh = 0.5/(nn2 - nn1);
285 for (nv = 0; nv <
NIONS; nv++) {
287 - tab[nv][ne1][ti1] - tab[nv][ne1][ti2])*scrh;
296 scrh = exp(-(T - 9.e+4)/4.e+4);
304 for (nv = 0; nv <
NIONS; nv++) {
308 if (em < 0.0)
print(
"> 2 negative em => possitive losses???? em = %12.6e\n",em);
344 scrh = 2.6e-11/sT*elem_ab[
el_H]*T/11590.0*0.67*
CONST_eV;
345 em += scrh*(1.0 - v[
X_HI]);
363 scrh = 1.42e-27*sT*elem_ab[
el_H];
376 em += 1.6e-12*8.63e-6*0.3*0.0495*exp(-575.0/T)/sT * 580.0*sT/(n_el + 580.0*sT) *0.00004;
377 em += 1.6e-12*8.63e-6*0.39*0.775*exp(-8980.0/T)/sT * 1130.0*sT/(n_el + 1130.0*sT) *0.00004;
379 em += 1.6e-12*8.63e-6*8.0*4.43*exp(-5.13e4/T)/sT*1.e10*sT/(n_el + 1.e10*sT)*0.00002*0.7;
380 em += 1.6e-12*8.63e-6*2.85*0.0354*exp(-410.0/T)/sT*16.8*sT/(n_el + 16.8*sT)*0.000033*0.7;
403 rhs[RHOE] = -E_cost*rlosst;
406 if (rhs[RHOE] > 0.0) {
407 print (
"! Error: positive radiative losses! %12.6e %12.6e %12.6e \n", em, n_el, N);
#define UNIT_DENSITY
Unit density in gr/cm^3.
#define CONST_eV
Electron Volt in erg.
double g_smallPressure
Small value for pressure fix.
#define ARRAY_3D(nx, ny, nz, type)
#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.
double MeanMolecularWeight(double *V)
void Find_Rates(double T, double Ne, double N, double *v)
int Create_Losses_Tables(double ***, int *, int *)
#define QUIT_PLUTO(e_code)