Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
mole.h File Reference
#include "module.h"
#include "container_classes.h"
Include dependency graph for mole.h:

Go to the source code of this file.

Classes

class  chem_element
class  chem_nuclide
class  element_pointer_value_less
class  molecule
class  t_mole_global
class  molezone
class  t_mole_local

Typedefs

typedef map< int, shared_ptr< chem_nuclide > >::iterator isotopes_i
typedef vector< shared_ptr< chem_nuclide > > ChemNuclideList
typedef vector< shared_ptr< chem_element > > ChemElementList
typedef molecule::nNucsMap::iterator nNucs_i
typedef molecule::nNucsMap::reverse_iterator nNucs_ri
typedef molecule::nNucsMap::const_reverse_iterator nNucs_cri

Enumerations

enum  mole_state { MOLE_NULL , MOLE_PASSIVE , MOLE_ACTIVE }

Functions

bool operator< (const chem_nuclide &a, const chem_nuclide &b)
bool operator> (const chem_nuclide &a, const chem_nuclide &b)
bool operator<= (const chem_nuclide &a, const chem_nuclide &b)
bool operator>= (const chem_nuclide &a, const chem_nuclide &b)
bool operator== (const chem_nuclide &a, const chem_nuclide &b)
bool operator!= (const chem_nuclide &a, const chem_nuclide &b)
void mole_drive (void)
void mole_create_react (void)
mole_reactionmole_findrate_s (const char buf[])
bool exists (const molecule *m)
moleculefindspecies (const char buf[])
moleculefindspecies_validate (const char buf[])
molezonefindspecieslocal (const char buf[])
molezonefindspecieslocal_validate (const char buf[])
shared_ptr< chem_nuclidefindnuclide (const char buf[])
bool exists (const molezone *m)
void total_molecule_elems (realnum total[LIMELM])
void total_molecule_deut (realnum &total)
realnum total_molecules (void)
realnum total_molecules_gasphase (void)
realnum species_gasphase_density (const string &chSpecies)
void mole_make_list (void)
void mole_make_groups (void)
void mole_cmp_num_in_out_reactions (void)
bool lgDifferByExcitation (const molecule &mol1, const molecule &mol2)
void mole_update_species_cache (void)
void mole_update_sources (void)
void mole_rk_bigchange (void)
void create_isotopologues (ChemNuclideList &atoms, vector< int > &numAtoms, string atom_old, string atom_new, string embellishments, vector< string > &newLabels)
void create_isotopologues_one_position (unsigned position, ChemNuclideList &atoms, vector< int > &numAtoms, string atom_old, string atom_new, string embellishments, string &newLabel)
bool parse_species_label (const char label[], ChemNuclideList &atomsLeftToRight, vector< int > &numAtoms, string &embellishments)
bool parse_species_label (const char mylab[], ChemNuclideList &atomsLeftToRight, vector< int > &numAtoms, string &embellishments, bool &lgExcit, int &charge, bool &lgGas_Phase)
double hmrate4 (double a, double b, double c, double te)
 Computes the UMIST rate coefficient for a reaction as a function of temperature.
void ParseChemistry (Parser &p)
bool isSpecies (const string &chSpecies)
bool isMolecule (const string &chSpecies)
void test_isMolecule ()
void getMolecules (vector< string > &allMolecules)

Variables

static const double SMALLABUND = 1e-24
ChemNuclideList nuclide_list
ChemElementList element_list
chem_nuclidenull_nuclide
moleculenull_mole
t_mole_global mole_global
molezonenull_molezone
t_mole_local mole

Typedef Documentation

◆ ChemElementList

typedef vector< shared_ptr<chem_element> > ChemElementList

◆ ChemNuclideList

typedef vector< shared_ptr<chem_nuclide> > ChemNuclideList

◆ isotopes_i

typedef map<int,shared_ptr<chem_nuclide>>::iterator isotopes_i

◆ nNucs_cri

typedef molecule::nNucsMap::const_reverse_iterator nNucs_cri

◆ nNucs_i

typedef molecule::nNucsMap::iterator nNucs_i

◆ nNucs_ri

typedef molecule::nNucsMap::reverse_iterator nNucs_ri

Enumeration Type Documentation

◆ mole_state

enum mole_state
Enumerator
MOLE_NULL 
MOLE_PASSIVE 
MOLE_ACTIVE 

Function Documentation

◆ create_isotopologues()

void create_isotopologues ( ChemNuclideList & atoms,
vector< int > & numAtoms,
string atom_old,
string atom_new,
string embellishments,
vector< string > & newLabels )

References atoms, create_isotopologues_one_position(), DEBUG_ENTRY, and fixit.

Referenced by mole_generate_isotopologue_reactions(), and newspecies().

Here is the call graph for this function:

◆ create_isotopologues_one_position()

void create_isotopologues_one_position ( unsigned position,
ChemNuclideList & atoms,
vector< int > & numAtoms,
string atom_old,
string atom_new,
string embellishments,
string & newLabel )

◆ exists() [1/2]

bool exists ( const molecule * m)
inline

◆ exists() [2/2]

bool exists ( const molezone * m)
inline

References null_molezone.

◆ findnuclide()

shared_ptr< chem_nuclide > findnuclide ( const char buf[])
extern

◆ findspecies()

◆ findspecies_validate()

molecule * findspecies_validate ( const char buf[])
extern

version for user-supplied species which may not be valid

References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), ioQQQ, and mole_priv::spectab.

Referenced by findspecieslocal_validate().

Here is the call graph for this function:

◆ findspecieslocal()

◆ findspecieslocal_validate()

molezone * findspecieslocal_validate ( const char buf[])
extern

version for user-supplied species which may not be valid

References DEBUG_ENTRY, findspecies_validate(), molecule::index, and mole.

Referenced by iter_end_check(), radius_first(), and radius_next().

Here is the call graph for this function:

◆ getMolecules()

void getMolecules ( vector< string > & allMolecules)

getMolecules - Get a list of all active molecules.

Parameters
allMolecules[in,out] List of molecule strings.

References DEBUG_ENTRY, isMolecule(), and mole_global.

Referenced by t_mean::setup_molecules(), and test_cdTemp_molecules().

Here is the call graph for this function:

◆ hmrate4()

double hmrate4 ( double a,
double b,
double c,
double te )
inline

Computes the UMIST rate coefficient for a reaction as a function of temperature.

This function evaluates the rate coefficient using the UMIST formula: k(T) = a * (T/300)^b * exp(-c/T) with safeguards to prevent extrapolation outside the intended temperature range.

  • For b > 0, temperature is capped at 5000 K to avoid unphysical rates at high T.
  • For b < 0 or c < 0, temperature is floored at 10 K to avoid unphysical rates at low T.
  • If both b and c are zero, returns a constant rate.
Parameters
aPre-exponential factor (rate coefficient at reference temperature).
bTemperature exponent.
cActivation energy (in temperature units).
teGas temperature (in Kelvin).
Returns
The computed rate coefficient.

References max(), min(), and sexp().

Referenced by ChargTranEval(), and ion_photo().

Here is the call graph for this function:

◆ isMolecule()

bool isMolecule ( const string & chSpecies)

isMolecule - Tell if the input string corresponds to a valid & active molecule.

Parameters
chSpecies[in] Species string
Returns
bool value: true, if a valid molecule; false, otherwise

References chSpecies, DEBUG_ENTRY, findspecies(), molecule::isMolecule(), molecule::label, and null_mole.

Referenced by cdTemp(), getMolecules(), and test_isMolecule().

Here is the call graph for this function:

◆ isSpecies()

bool isSpecies ( const string & chSpecies)

isSpecies - Tell if the input string corresponds to a valid & active species.

Parameters
chSpecies[in] Species string
Returns
bool value: true, if a valid species; false, otherwise

References chSpecies, DEBUG_ENTRY, findspecies(), molecule::isMolecule(), molecule::isMonatomic(), molecule::label, and null_mole.

Referenced by cdTemp().

Here is the call graph for this function:

◆ lgDifferByExcitation()

bool lgDifferByExcitation ( const molecule & mol1,
const molecule & mol2 )

References molecule::label.

Referenced by register_reaction_vectors().

◆ mole_cmp_num_in_out_reactions()

void mole_cmp_num_in_out_reactions ( void )

References CHARS_SPECIES, DEBUG_ENTRY, fprintf(), ioQQQ, mole_global, and mole_priv::reactab.

Here is the call graph for this function:

◆ mole_create_react()

◆ mole_drive()

void mole_drive ( void )
extern

mole_drive main driver for chemical equilibrium routines

References DEBUG_ENTRY, mole_effects(), mole_ion_trim(), mole_solve(), mole_update_limiting_reactants(), mole_update_rks(), mole_update_species_cache(), and MOLETOLER.

Referenced by ConvBase().

Here is the call graph for this function:

◆ mole_findrate_s()

mole_reaction * mole_findrate_s ( const char buf[])

◆ mole_make_groups()

void mole_make_groups ( void )
extern

◆ mole_make_list()

◆ mole_rk_bigchange()

void mole_rk_bigchange ( void )

References ASSERT, DEBUG_ENTRY, fprintf(), mole_reaction::index, ioQQQ, mole_reaction::label, mole, nzone, and mole_priv::reactab.

Referenced by ZoneEnd().

Here is the call graph for this function:

◆ mole_update_sources()

void mole_update_sources ( void )

References DEBUG_ENTRY, mole_eval_sources(), mole_global, and mole_update_species_cache().

Referenced by ConvBase().

Here is the call graph for this function:

◆ mole_update_species_cache()

void mole_update_species_cache ( void )
extern

References ASSERT, DEBUG_ENTRY, fprintf(), gv, ioQQQ, mole, mole_global, and NULL.

Referenced by diatomics::H2_LevelPops(), mole_drive(), and mole_update_sources().

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( const chem_nuclide & a,
const chem_nuclide & b )
inline

◆ operator<()

bool operator< ( const chem_nuclide & a,
const chem_nuclide & b )
inline

References chem_nuclide::compare().

Here is the call graph for this function:

◆ operator<=()

bool operator<= ( const chem_nuclide & a,
const chem_nuclide & b )
inline

References chem_nuclide::compare().

Here is the call graph for this function:

◆ operator==()

bool operator== ( const chem_nuclide & a,
const chem_nuclide & b )
inline

References chem_nuclide::compare().

Here is the call graph for this function:

◆ operator>()

bool operator> ( const chem_nuclide & a,
const chem_nuclide & b )
inline

References chem_nuclide::compare().

Here is the call graph for this function:

◆ operator>=()

bool operator>= ( const chem_nuclide & a,
const chem_nuclide & b )
inline

References chem_nuclide::compare().

Here is the call graph for this function:

◆ parse_species_label() [1/2]

bool parse_species_label ( const char label[],
ChemNuclideList & atomsLeftToRight,
vector< int > & numAtoms,
string & embellishments )

References parse_species_label().

Referenced by mole_generate_isotopologue_reactions(), newspecies(), and parse_species_label().

Here is the call graph for this function:

◆ parse_species_label() [2/2]

bool parse_species_label ( const char mylab[],
ChemNuclideList & atomsLeftToRight,
vector< int > & numAtoms,
string & embellishments,
bool & lgExcit,
int & charge,
bool & lgGas_Phase )

References ASSERT, CHARS_ISOTOPE_SYM, dense, findnuclide(), fprintf(), ioQQQ, NULL, and trace.

Here is the call graph for this function:

◆ ParseChemistry()

void ParseChemistry ( Parser & p)

◆ species_gasphase_density()

realnum species_gasphase_density ( const string & chSpecies)

species_gasphase_density - Report gas phase density of requested species

Parameters
chSpecies[in] species to process
Returns
density of species in the current zone

References chSpecies, DEBUG_ENTRY, findspecies(), molecule::index, mole, and null_mole.

Referenced by t_mean::MeanInc().

Here is the call graph for this function:

◆ test_isMolecule()

void test_isMolecule ( )

test_isMolecule() - Test function isMolecule()

References cdEXIT, DEBUG_ENTRY, EXIT_SUCCESS, fprintf(), ioQQQ, isMolecule(), and mole_global.

Here is the call graph for this function:

◆ total_molecule_deut()

void total_molecule_deut ( realnum & total)
extern

◆ total_molecule_elems()

void total_molecule_elems ( realnum total[LIMELM])
extern

◆ total_molecules()

realnum total_molecules ( void )
extern

References DEBUG_ENTRY, mole, mole_global, and NULL.

◆ total_molecules_gasphase()

realnum total_molecules_gasphase ( void )
extern

References DEBUG_ENTRY, mole, mole_global, and NULL.

Referenced by SumDensities().

Variable Documentation

◆ element_list

◆ mole

◆ mole_global

t_mole_global mole_global
extern

Referenced by AbundChange(), atmdat_readin(), t_gaunt::brems_sum_ions(), ChargTranEval(), ChemImportance(), diatomics::Cont_Diss_Heat_Rate(), ConvBase(), ConvInitSolution(), ConvIterCheck(), CoolEvaluate(), DynaCreateArrays(), DynaIonize(), DynaNewStep(), DynaSaveLast(), DynaStartZone(), eden_sum(), ElectronFractions(), funjac(), getMolecules(), molezone::global(), grouped_elems(), diatomics::H2_X_sink_and_source(), diatomics::init(), init_struc(), InitSimPostparse(), ion_photo(), ion_trim(), ion_trim2(), isSpeciesActive(), iter_end_check(), IterRestart(), IterStart(), lgNucleiConserved(), t_mole_global::make_species(), matchGeneric(), diatomics::Mol_Photo_Diss_Rates(), molcol(), mole_cmp_num_in_out_reactions(), mole_create_react(), mole_effects(), mole_eval_balance(), mole_eval_dynamic_balance(), mole_h_fixup(), mole_h_rate_diagnostics(), mole_h_reactions(), mole_make_groups(), mole_make_list(), mole_return_cached_species(), mole_solve(), mole_update_limiting_reactants(), mole_update_sources(), mole_update_species_cache(), newreact(), newspecies(), OpacityAddTotal(), OpacityCreateAll(), ParseChemistry(), ParseCommands(), ParseDont(), ParseElement(), ParseSet(), ParseSpecies(), plot_sparsity(), PrtComment(), PrtZone(), radius_increment(), radius_next(), RT_tau_reset(), SaveDo(), SaveSpecies(), ScaleAllDensities(), t_mole_local::set_ion_locations(), setProperties(), GroupMap::setup(), speciesCheck(), speciesOff(), test_isMolecule(), total_molecule_deut(), total_molecule_elems(), total_molecules(), total_molecules_gasphase(), GroupMap::updateMolecules(), and t_mole_local::zero().

◆ nuclide_list

◆ null_mole

◆ null_molezone

◆ null_nuclide

◆ SMALLABUND

const double SMALLABUND = 1e-24
static