#include "cddefines.h"
#include "physconst.h"
#include "mole.h"
#include "mole_co_priv.h"
#include "hmi.h"
#include "rfield.h"
#include "dense.h"
#include "ionbal.h"
#include "grainvar.h"
#include "timesc.h"
Go to the source code of this file.
Enumerations | |
enum | spectype { MOLECULE, OTHER } |
enum | molstate { ACTIVE, PASSIVE } |
Functions | |
STATIC void | newelement (const char label[], int ipion, int priority) |
STATIC struct molecule * | newspecies (const char label[7], enum spectype type, enum molstate state, realnum *location, double frac0) |
STATIC struct chem_element_s * | findelement (const char buf[]) |
STATIC int | isactive (data_u *dat) |
STATIC int | ispassive (data_u *dat) |
STATIC int | isCOnet (data_u *dat) |
void | CO_Init (void) |
struct molecule * | findspecies (const char buf[]) |
struct COmole_rate_s * | CO_findrate_s (const char buf[]) |
double | CO_findrk (const char buf[]) |
double | CO_findrate (const char buf[]) |
void | CO_update_species_cache (void) |
double | CO_sink_rate (const char chSpecies[7]) |
void | CO_update_rks (void) |
double | CO_dissoc_rate (const char chSpecies[7]) |
double | CO_source_rate (const char chSpecies[7]) |
void | CO_punch_mol (FILE *punit, const char chSpecies[], char header[], double depth) |
void | CO_zero (void) |
Variables | |
struct chem_element_s ** | chem_element |
struct chem_element_s * | element_list [LIMELM] |
int32 * | ipiv |
realnum * | tot_ion |
struct mole_priv_s | mole_priv |
struct molecule | null_mole |
enum molstate |
Definition at line 21 of file mole_co_etc.cpp.
enum spectype |
Definition at line 20 of file mole_co_etc.cpp.
double CO_dissoc_rate | ( | const char | chSpecies[7] | ) |
Definition at line 689 of file mole_co_etc.cpp.
References coreactions, DEBUG_ENTRY, findspecies(), molecule::hevmol, t_coreactions::list, t_coreactions::n, COmole_rate_s::nproducts, COmole_rate_s::nrates, COmole_rate_s::photon, COmole_rate_s::products, COmole_rate_s::rate_species, and COmole_rate_s::rk.
double CO_findrate | ( | const char | buf[] | ) |
Definition at line 569 of file mole_co_etc.cpp.
References CO_findrate_s(), DEBUG_ENTRY, molecule::hevmol, COmole_rate_s::nrates, COmole_rate_s::rate_species, and COmole_rate_s::rk.
Referenced by CO_solve(), CoolOxyg(), and lines_lv1_li_ne().
struct COmole_rate_s* CO_findrate_s | ( | const char | buf[] | ) | [read] |
Definition at line 540 of file mole_co_etc.cpp.
References DEBUG_ENTRY, lookup(), mole_priv, data_u::p, and mole_priv_s::reactab.
Referenced by CO_drive(), CO_findrate(), and CO_findrk().
double CO_findrk | ( | const char | buf[] | ) |
Definition at line 553 of file mole_co_etc.cpp.
References ASSERT, CO_findrate_s(), DEBUG_ENTRY, isnan, and COmole_rate_s::rk.
Referenced by hmole_step(), IonIron(), IonMagne(), and SaveDo().
void CO_Init | ( | void | ) |
called from cdInit to initialized co routines
Definition at line 44 of file mole_co_etc.cpp.
References molecule::active, ACTIVE, t_mole::amat, ASSERT, t_mole::b, t_mole::c, co, t_co::co_nzone, COmole, DEBUG_ENTRY, dense, t_dense::eden_f, ELECTRON_MASS, mole_priv_s::elemtab, gv, molecule::hevcol, molecule::hevmol, hmi, t_hmi::Hmolec, molecule::index, ipCARBON, ipCHLORINE, ipHELIUM, ipHYDROGEN, ipIRON, ipiv, ipMAGNESIUM, ipMH2g, ipMH2p, ipMH2s, ipMH3p, ipMHm, chem_element_s::ipMl, chem_element_s::ipMlP, ipNITROGEN, ipOXYGEN, ipSILICON, ipSULPHUR, isactive(), isCOnet(), ispassive(), t_co::iteration_co, GrainVar::lgDustOn(), t_mole::lgElem_in_chemistry, t_mole::lgGrain_mole_deplete, LIMELM, makeplist(), MALLOC, mole, molecule::mole_mass, mole_priv, MOLECULE, molecule::n_nuclei, molecule::nElec, molecule::nelem_hevmol, newelement(), newhash(), newspecies(), null_mole, t_mole::num_comole_calc, t_mole::num_comole_tot, t_mole::num_elements, OTHER, PASSIVE, mole_priv_s::reactab, mole_priv_s::spectab, tot_ion, and t_dense::xIonDense.
Referenced by InitSimPostparse().
void CO_punch_mol | ( | FILE * | punit, | |
const char | chSpecies[], | |||
char | header[], | |||
double | depth | |||
) |
Definition at line 767 of file mole_co_etc.cpp.
References cdEXIT, coreactions, DEBUG_ENTRY, findspecies(), molecule::hevmol, ioQQQ, COmole_rate_s::label, t_coreactions::list, t_coreactions::n, COmole_rate_s::nproducts, COmole_rate_s::nrates, null_mole, COmole_rate_s::products, COmole_rate_s::rate_species, and COmole_rate_s::rk.
Referenced by SaveDo().
double CO_sink_rate | ( | const char | chSpecies[7] | ) |
Definition at line 614 of file mole_co_etc.cpp.
References coreactions, DEBUG_ENTRY, findspecies(), molecule::hevmol, t_coreactions::list, t_coreactions::n, COmole_rate_s::nrates, COmole_rate_s::rate_species, and COmole_rate_s::rk.
double CO_source_rate | ( | const char | chSpecies[7] | ) |
Definition at line 729 of file mole_co_etc.cpp.
References coreactions, DEBUG_ENTRY, findspecies(), molecule::hevmol, t_coreactions::list, t_coreactions::n, COmole_rate_s::nproducts, COmole_rate_s::nrates, COmole_rate_s::products, COmole_rate_s::rate_species, and COmole_rate_s::rk.
void CO_update_rks | ( | void | ) |
CO_update_rks update rate coefficients, only temp part
Definition at line 671 of file mole_co_etc.cpp.
References COmole_rate_s::a, coreactions, DEBUG_ENTRY, COmole_rate_s::fun, t_coreactions::list, t_coreactions::n, and COmole_rate_s::rk.
Referenced by CO_drive(), and ConvBase().
void CO_update_species_cache | ( | void | ) |
Definition at line 589 of file mole_co_etc.cpp.
References ASSERT, COmole, DEBUG_ENTRY, dense, t_dense::eden, t_dense::eden_f, molecule::hevmol, isnan, molecule::location, MAX_DENSITY, mole, and t_mole::num_comole_tot.
Referenced by CO_drive(), and ConvBase().
void CO_zero | ( | void | ) |
CO_zero allocate + initialize workspace
Definition at line 842 of file mole_co_etc.cpp.
References t_timesc::AgeCOMoleDest, cdEXIT, COmole, DEBUG_ENTRY, molecule::hevcol, molecule::hevmol, ioQQQ, lgFirstCall, MALLOC, mole, t_mole::num_comole_calc, t_mole::num_comole_tot, timesc, and molecule::xMoleFracMax.
Referenced by CO_drive(), and InitSimPostparse().
STATIC struct chem_element_s * findelement | ( | const char | buf[] | ) | [read] |
Definition at line 526 of file mole_co_etc.cpp.
References DEBUG_ENTRY, mole_priv_s::elemtab, lookup(), mole_priv, and data_u::p.
Referenced by newspecies().
struct molecule* findspecies | ( | const char | buf[] | ) | [read] |
Definition at line 507 of file mole_co_etc.cpp.
References DEBUG_ENTRY, lookup(), mole_priv, null_mole, data_u::p, and mole_priv_s::spectab.
Referenced by AgeCheck(), cdColm(), CO_dissoc_rate(), CO_drive(), CO_punch_mol(), CO_sink_rate(), CO_solve(), CO_source_rate(), database_readin(), dBase_solve(), DynaPunchTimeDep(), GrainCollHeating(), hmole_step(), iso_level(), iter_end_check(), lgMolecAver(), newreact(), OpacityAddTotal(), prt_smooth_predictions(), PrtZone(), radius_increment(), radius_next(), and SaveDo().
STATIC int isactive | ( | data_u * | dat | ) |
Definition at line 489 of file mole_co_etc.cpp.
References molecule::active, DEBUG_ENTRY, and data_u::p.
Referenced by CO_Init().
STATIC int isCOnet | ( | data_u * | dat | ) |
STATIC int ispassive | ( | data_u * | dat | ) |
STATIC void newelement | ( | const char | label[], | |
int | ipion, | |||
int | priority | |||
) |
Definition at line 301 of file mole_co_etc.cpp.
References addentry(), ASSERT, chem_element_s::chName, DEBUG_ENTRY, mole_priv_s::elemtab, chem_element_s::ipCl, chem_element_s::ipMl, chem_element_s::ipMlP, chem_element_s::ipZ, MALLOC, mole_priv, and data_u::p.
Referenced by CO_Init().
STATIC struct molecule * newspecies | ( | const char | label[7], | |
enum spectype | type, | |||
enum molstate | state, | |||
realnum * | location, | |||
double | frac0 | |||
) | [read] |
Definition at line 320 of file mole_co_etc.cpp.
References molecule::active, ACTIVE, addentry(), ASSERT, ATOMIC_MASS_UNIT, t_dense::AtomicWeight, cdEXIT, CHARS_ELEMENT, molecule::co_save, DEBUG_ENTRY, dense, molecule::Excit, findelement(), chem_element_s::ipCl, ipHYDROGEN, chem_element_s::ipZ, molecule::label, t_mole::lgElem_in_chemistry, molecule::lgGas_Phase, LIMELM, molecule::location, MALLOC, mole, molecule::mole_mass, mole_priv, MOLECULE, molecule::n_nuclei, molecule::nElec, molecule::nElem, molecule::nelem_hevmol, t_mole::num_comole_calc, t_mole::num_comole_tot, t_mole::num_elements, data_u::p, molecule::pdr_mole_co, mole_priv_s::spectab, strchr_s(), and strstr_s().
Referenced by CO_Init().
struct chem_element_s** chem_element |
Definition at line 32 of file mole_co_etc.cpp.
Referenced by CO_solve(), and lgMolecAver().
struct chem_element_s* element_list[LIMELM] |
Definition at line 35 of file mole_co_etc.cpp.
int32* ipiv |
Definition at line 36 of file mole_co_etc.cpp.
Referenced by atom_levelN(), atom_pop5(), AtomSeqBeryllium(), CO_Init(), CO_solve(), FeIILevelPops(), fill_array(), find_solution(), hmole_step(), iso_level(), oi_level_pops(), and SanityCheckBegin().
struct mole_priv_s mole_priv |
Definition at line 39 of file mole_co_etc.cpp.
Referenced by CO_create_react(), CO_findrate_s(), CO_Init(), findelement(), findspecies(), newelement(), newreact(), and newspecies().
>>chng 03 feb 09, rm ipH3P_hev, since not used, and decrement NUM_HEAVY_MOLEC to 17 >>chng 03 aug 04, rm ipCTWO and ipC2P from hevmol since not included in balance, and always finds zero column density, so NUM_HEAVY_MOLEC from 17 to 15 >>chng 03 aug 05, rm ch2 and ch3, so n from 15 to 13 >>chng 03 nov 14 add Si chemistry & CH3+, so that now every reaction that is in the TH85 chemical network is also included in Cloudy. Additionally, there are also reactions taken from other papers (mostly Hollenbach and McKee...see co.c). In all 20 molecular species are calculated, along with the atomic and first ionization stages of C, O, and Si >>chng 04 May 13, Nick Abel. Add CH3, CH4, CH4+, and CH5+ to network in order to get the same chemical abundances vs. depth as other PDR codes in the Leiden meeting. With changes we now can predict molecular abundances for 24 C, O, and Si bearing molecules. >>chng 04 jul 13, Nick Abel. Add nitrogen and sulphur bearing molecules to the chemical network. First added to generate a chemical model for eta carinae, but is applicable to all molecular clouds >>chng 05 mar 11, Nick Abel. Add C2 and C2+ to chemistry, reactions involving these species affects the abundance of C >>chng 05 mar 23, Nick Abel. Add Chlorine to chemistry
this includes the atomic and first ionized species of each element that can combine to form molecules. This is the number of molecules, ions, and atoms that the co network uses This is used in comole to improve the calculation, as deep in molecular regions reactions with molecules can be important to the ionization balance
Definition at line 40 of file mole_co_etc.cpp.
Referenced by cdColm(), CO_Init(), CO_punch_mol(), database_readin(), dBase_solve(), findspecies(), and newreact().
Definition at line 37 of file mole_co_etc.cpp.
Referenced by CO_Init(), and CO_solve().