72 const long int nelem=(*atom)->el->Z-1;
76 for (
long int ion=0;ion<nelem+2;ion++)
78 if ((*atom)->ipMl[ion] != -1)
243 static double log_G0_face = -1;
281 f1 = 0.15 * log_density + 0.75;
282 f2 = -0.5 * log_density + 10.;
314 k_f4 = -0.25 * log_G0_face + 1.25;
325 f4 =
pow2(k_f4) * pow( 10. , 2.2211 * log_density - 29.8506);
330 f4 =
pow2(k_f4) * pow( 10., 2.2211 * log_density - 29.8506);
333 f3 =
MAX2(0.1, -4.75 * log_density + 24.25);
334 f5 =
MAX2(1.,0.95 * log_density - 1.45) * 0.2 * log_G0_face;
428 enum {DEBUG_LOC=
false};
430 if( DEBUG_LOC && (
nzone>50) )
432 double createsum ,create_from_Hn2 , create_3body_Ho, create_h2p,
433 create_h3p, create_h3pe, create_grains, create_hminus;
434 double destroysum, destroy_hm ,destroy_solomon ,destroy_2h ,destroy_hp,
435 destroy_h,destroy_hp2,destroy_h3p;
445 createsum = create_from_Hn2 + create_3body_Ho + create_h2p +
446 create_h3p + create_h3pe + create_grains + create_hminus;
448 fprintf(
ioQQQ,
"H2 create zone\t%.2f \tsum\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
451 create_hminus / createsum,
452 create_from_Hn2 / createsum,
453 create_3body_Ho / createsum,
454 create_h2p / createsum,
455 create_h3p / createsum,
456 create_h3pe / createsum,
457 create_grains / createsum );
470 destroysum = destroy_hm + destroy_solomon + destroy_2h +
471 destroy_hp+ destroy_h+ destroy_hp2+ destroy_h3p;
473 fprintf(
ioQQQ,
"H2 destroy\t%.3f \t%.2e\tsum\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
476 destroy_hm / destroysum ,
477 destroy_solomon / destroysum ,
478 destroy_2h / destroysum ,
479 destroy_hp / destroysum ,
480 destroy_h / destroysum ,
481 destroy_hp2 / destroysum ,
482 destroy_h3p / destroysum );
490 enum {DEBUG_LOC=
false};
492 if( DEBUG_LOC && (
nzone>140) )
494 double create_from_Ho,create_3body_Ho,create_batach,destroy_photo,
495 destroy_coll_heavies,destroy_coll_electrons,destroy_Hattach,destroy_fhneut,
503 destroy_coll_heavies = 0.;
513 destroy_coll_electrons =
mole.
findrate(
"H-,e-=>H-,e-,e-");
517 destsum = destroy_photo + destroy_coll_heavies + destroy_coll_electrons +
518 destroy_Hattach + destroy_fhneut;
519 fprintf(
ioQQQ,
"H- destroy zone\t%.2f\tTe\t%.4e\tsum\t%.2e\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f\n",
523 destroy_photo/destsum ,
524 destroy_coll_heavies/destsum,
525 destroy_coll_electrons/destsum,
526 destroy_Hattach/destsum,
527 destroy_fhneut/destsum );
529 createsum = create_from_Ho+create_3body_Ho+create_batach;
530 fprintf(
ioQQQ,
"H- create\t%.2f\tTe\t%.4e\tsum\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
535 create_from_Ho/createsum,
536 create_3body_Ho/createsum,
537 create_batach/createsum);
543 enum {DEBUG_LOC=
false};
553 fprintf(
ioQQQ,
" \n" );
560 fprintf(
ioQQQ,
" raw; " );
565 fprintf(
ioQQQ,
" \n" );
579 fprintf(
ioQQQ,
" Create H2, rate=%10.2e grain;%5.3f hmin;%5.3f bhedis;%5.3f h2+;%5.3f hmi.radasc:%5.3f hmi.h3ph2p:%5.3f hmi.h3petc:%5.3f\n",
591 fprintf(
ioQQQ,
" Create H2, rate=0\n" );
602 fprintf(
ioQQQ,
" Create H2+, rate=%10.2e hmi.rh2h2p;%5.3f b2pcin;%5.3f hmi.h3ph2p;%5.3f hmi.h3petc+;%5.3f\n",
604 mole.
findrate(
"H,H+,e-=>H2+,e-")/rate,
mole.
findrate(
"H,H3+=>H2,H2+")/rate,
mole.
findrate(
"H2,H3+=>H2,H2+,H")/rate );
608 fprintf(
ioQQQ,
" Create H2+, rate=0\n" );
615 double destroy_coll_heavies = 0.;
626 fprintf(
ioQQQ,
" MOLE, Dep Coef, H-:%10.2e H2:%10.2e H2+:%10.2e\n",
628 fprintf(
ioQQQ,
" H- creat: Rad atch%10.3e Induc%10.3e bHneut%10.2e 3bod%10.2e b=>H2%10.2e N(H-);%10.2e b(H-);%10.2e\n",
633 fprintf(
ioQQQ,
" H- destr: Photo;%10.3e mut neut%10.2e e- coll ion%10.2e =>H2%10.2e x-ray%10.2e p+H-%10.2e\n",
638 fprintf(
ioQQQ,
" H- heating:%10.3e Ind cooling%10.2e Spon cooling%10.2e\n",
652 " Destroy H2+: rate=%10.2e e-;%5.3f phot;%5.3f hard gam;%5.3f H2col;%5.3f h2phhp;%5.3f pion;%5.3f bh2h2p:%5.3f\n",
654 mole.
findrate(
"H2+,CRPHOT=>H,H+")/rate,
mole.
findrate(
"H2,H2+=>H,H3+")/rate,
mole.
findrate(
"H2+,H2=>H,H+,H2")/rate,
658 " Create H2+: rate=%.2e HII HI;%.3f Col H2;%.3f HII H2;%.3f HI HI;%.3f\n",
667 fprintf(
ioQQQ,
" Create H2+: rate= is zero\n" );
675 enum {DEBUG_LOC=
false};
679 fprintf(
ioQQQ,
"mole bugg\t%.3f\t%.2e\t%.2e\t%.2e\t%.2e\t%.2e\n",
692 enum {DEBUG_LOC=
false};
694 if( DEBUG_LOC &&
nzone>140 )
696 fprintf(
ioQQQ,
" debuggggrn grn\t%.2f\t%.3e\t%.3e\tfrac\t%.3e\tH-\t%.3e\t%.3e\tfrac\t%.3e\t%.3e\t%.3e\t%.3e\n",
700 mole.
findrate(
"H,H,grn=>H2*,grn")/
SDIV(
mole.
findrate(
"H,H,grn=>H2*,grn")+
mole.
findrate(
"H,H,grn=>H2,grn")),
714 enum {DEBUG_LOC=
false};
716 if( DEBUG_LOC &&
nzone>140)
720 "hmi.assoc_detach_backwards_grnd\t%.2f\t%.5e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\t%.3e\n",
746 " H2 destroy rate=%.2e DIS;%.3f bat;%.3f h2dis;%.3f photoionize_rate;%.3f h2h2p;%.3f E-h;%.3f hmi.h2hph3p;%.3f sec;%.3f\n",
760 fprintf(
ioQQQ,
" Destroy H2: rate=0\n" );
767 enum {DEBUG_LOC=
false};
771 if( DEBUG_LOC && (
nzone > 570) )
790 for (molecule::nAtomsMap::iterator atom =
mole_global.
list[i]->nAtom.begin();
793 long nelem = atom->first->el->Z-1;
NORETURN void TotalInsanity(void)
sys_float SDIV(sys_float x)
#define DEBUG_ENTRY(funcname)
double source_rate_tot(const char chSpecies[]) const
double findrate(const char buf[]) const
valarray< class molezone > species
double sink_rate_tot(const char chSpecies[]) const
double GammaK(long int ipLoEnr, long int ipHiEnr, long int ipOpac, double yield1, t_phoHeat *photoHeat)
diatomics h2("h2", 4100., &hmi.H2_total, Yan_H2_CS)
t_iso_sp iso_sp[NISO][LIMELM]
t_mole_global mole_global
molezone * findspecieslocal(const char buf[])
void mole_update_species_cache(void)
ChemAtomList unresolved_atom_list
STATIC void mole_h_rate_diagnostics(void)
STATIC void mole_ion_trim(void)
void mole_update_sources(void)
STATIC void mole_update_limiting_reactants()
STATIC void mole_effects(void)
static const double MOLETOLER
void mole_eval_sources(long int num_total)
double frac_H2star_hminus()
void mole_update_rks(void)
UNUSED const double EN1EV
t_secondaries secondaries
long int IonLow[LIMELM+1]
long int IonHigh[LIMELM+1]
double xIonDense[LIMELM][LIMELM+1]
realnum gas_phase[LIMELM]
realnum deriv_HeatH2Dexc_BHT90
double HMinus_induc_rec_cooling
double H2_Solomon_dissoc_rate_used_H2g
char chH2_small_model_type
double H2star_forms_grains
double HMinus_induc_rec_rate
double H2_Solomon_dissoc_rate_used_H2s
realnum UV_Cont_rel2_Draine_DB96_face
realnum deriv_HeatH2Dexc_TH85
realnum deriv_HeatH2Dexc_BD96
double H2star_forms_hminus
realnum deriv_HeatH2Dexc_ELWERT
double heating[LIMELM][LIMELM]