/home66/gary/public_html/cloudy/c13_branch/source/mole_reactions.cpp File Reference

#include "cdstd.h"
#include <stdlib.h>
#include "cddefines.h"
#include "colden.h"
#include "physconst.h"
#include "mole.h"
#include "version.h"
#include "mole_priv.h"
#include "hmi.h"
#include "conv.h"
#include "dense.h"
#include "thermal.h"
#include "gammas.h"
#include "grainvar.h"
#include "ionbal.h"
#include "opacity.h"
#include "path.h"
#include "radius.h"
#include "atmdat.h"
#include "taulines.h"
#include "trace.h"
#include "deuterium.h"
#include "phycon.h"
#include "doppvel.h"
#include "rfield.h"
#include "secondaries.h"
#include "hextra.h"
#include "rt.h"
#include "iso.h"
#include "h2.h"
Include dependency graph for mole_reactions.cpp:

Go to the source code of this file.

Defines

#define gzopen(file, mode)   fopen(file,mode)
#define gzgets(fp, buf, siz)   fgets(buf,siz,fp)
#define gzclose(fp)   fclose(fp)
#define gzFile   FILE
#define FLTEQ(a, b)   (fabs((a)-(b)) <= 1e-6*fabs((a)+(b)))

Enumerations

enum  { UDFA = 0 }
enum  
enum  { BUFSIZE = 256 }

Functions

STATIC void newreact (const char label[], const char fun[], double a, double b, double c)
STATIC long parse_reaction (count_ptr< mole_reaction > &rate, const char label[])
STATIC string canonicalize_reaction_label (const char label[])
STATIC void canonicalize_reaction (count_ptr< mole_reaction > &rate)
STATIC void register_reaction_vectors (count_ptr< mole_reaction > rate)
STATIC void mole_check_reverse_reactions (void)
STATIC double mole_get_equilibrium_constant (const char buf[])
STATIC double mole_partition_function (const molecule *const sp)
STATIC void mole_generate_isotopologue_reactions (string atom_old, string atom_new)
STATIC void plot_sparsity (void)
STATIC bool lgReactBalance (const count_ptr< mole_reaction > &rate)
STATIC void read_data (const char file[], void(*parse)(char *s))
STATIC void parse_base (char *s)
STATIC void parse_udfa (char *s)
STATIC void compare_udfa (const count_ptr< mole_reaction > &rate)
double frac_H2star_hminus (void)
double hmirat (double te)
STATIC void mole_h2_grain_form (void)
STATIC void mole_h_reactions (void)
void mole_create_react (void)
void mole_cmp_num_in_out_reactions ()
STATIC char * getcsvfield (char **s, char c)
void mole_update_rks (void)
void mole_rk_bigchange (void)
mole_reactionmole_findrate_s (const char buf[])
void mole_punch (FILE *punit, const char speciesname[], const char args[], bool lgHeader, bool lgData, double depth)

Variables

static realnum albedo = 0.5
static map< formula_species,
struct udfa_reaction_s * > 
udfatab

Define Documentation

#define FLTEQ ( a,
 )     (fabs((a)-(b)) <= 1e-6*fabs((a)+(b)))

Definition at line 2694 of file mole_reactions.cpp.

Referenced by compare_udfa(), and parse_udfa().

#define gzclose ( fp   )     fclose(fp)

Definition at line 2630 of file mole_reactions.cpp.

#define gzFile   FILE

Definition at line 2631 of file mole_reactions.cpp.

#define gzgets ( fp,
buf,
siz   )     fgets(buf,siz,fp)

Definition at line 2629 of file mole_reactions.cpp.

#define gzopen ( file,
mode   )     fopen(file,mode)

Definition at line 2628 of file mole_reactions.cpp.


Enumeration Type Documentation

anonymous enum
Enumerator:
UDFA 

Definition at line 47 of file mole_reactions.cpp.

anonymous enum
Enumerator:
BUFSIZE 

Definition at line 2634 of file mole_reactions.cpp.

anonymous enum

Definition at line 1678 of file mole_reactions.cpp.


Function Documentation

STATIC void canonicalize_reaction ( count_ptr< mole_reaction > &  rate  ) 

Definition at line 2396 of file mole_reactions.cpp.

References DEBUG_ENTRY, and t_mole_global::sort().

Referenced by canonicalize_reaction_label(), and newreact().

Here is the call graph for this function:

STATIC string canonicalize_reaction_label ( const char  label[]  ) 

Definition at line 2380 of file mole_reactions.cpp.

References canonicalize_reaction(), DEBUG_ENTRY, and parse_reaction().

Referenced by mole_findrate_s(), and mole_generate_isotopologue_reactions().

Here is the call graph for this function:

STATIC void compare_udfa ( const count_ptr< mole_reaction > &  rate  ) 

Definition at line 2803 of file mole_reactions.cpp.

References CONFLICT, CORRECT, and FLTEQ.

Referenced by newreact().

double frac_H2star_hminus ( void   ) 

Definition at line 688 of file mole_reactions.cpp.

References h2, t_hmi::H2_forms_hminus, t_hmi::H2star_forms_hminus, hmi, diatomics::lgEnabled, diatomics::lgEvaluated, t_hmi::lgH2_Chemistry_BigH2, and SDIV().

Referenced by mole_h_rate_diagnostics().

Here is the call graph for this function:

STATIC char * getcsvfield ( char **  s,
char  c 
)

Definition at line 2791 of file mole_reactions.cpp.

Referenced by parse_base(), and parse_udfa().

double hmirat ( double  te  ) 

hmirat computes radiative association rate for H-

Parameters:
te 

Definition at line 1601 of file mole_reactions.cpp.

References DEBUG_ENTRY, phycon, t_phycon::sqrte, t_phycon::te001, t_phycon::te003, t_phycon::te01, t_phycon::te03, t_phycon::te10, t_phycon::te20, and t_phycon::te70.

Referenced by mole_h_reactions().

STATIC bool lgReactBalance ( const count_ptr< mole_reaction > &  rate  ) 

Definition at line 2583 of file mole_reactions.cpp.

References sign().

Referenced by newreact().

Here is the call graph for this function:

STATIC void mole_check_reverse_reactions ( void   ) 

Definition at line 2104 of file mole_reactions.cpp.

References DEBUG_ENTRY, fixit(), ioQQQ, t_trace::lgTraceMole, mole_priv::reactab, and trace.

Referenced by mole_create_react().

Here is the call graph for this function:

void mole_cmp_num_in_out_reactions ( void   ) 
void mole_create_react ( void   ) 
mole_reaction* mole_findrate_s ( const char  buf[]  ) 
STATIC void mole_generate_isotopologue_reactions ( string  atom_old,
string  atom_new 
)
STATIC double mole_get_equilibrium_constant ( const char  buf[]  ) 
STATIC void mole_h2_grain_form ( void   ) 

Todo:
2 - put in actual composition dependent Tad - this is only valid for bare surfaces - not ice - for ice Tad is 555K hmi.Tad is binding energy expressed as a temperature note that hmi.Tad is set to 800. in zero tau_nu the first equation in section 2.5 equation one paragraph before equation 2 at low grain temperatures all end in para, J=0

Definition at line 2934 of file mole_reactions.cpp.

References ASSERT, t_dense::AtomicWeight, GrainVar::bin, t_hmi::chJura, dense, fixit(), fnzone, t_dense::gas_phase, GetAveVelocity(), GrainDrive(), gv, h2, hmi, ipHYDROGEN, GrainVar::lgDustOn(), GrainVar::lgGrainPhysicsOn, diatomics::lgH2_grain_deexcitation, MALLOC, MAT_CAR, MAT_CAR2, MAT_SIL, MAT_SIL2, NQGRID, phycon, POW2, qheat(), diatomics::rate_grain_J1_to_J0, diatomics::rate_grain_op_conserve, t_hmi::rate_h2_form_grains_set, GrainVar::rate_h2_form_grains_used_total, t_hmi::ScaleJura, SDIV(), sexp(), t_phycon::sqrte, t_hmi::Tad, and t_phycon::te.

Referenced by mole_update_rks().

Here is the call graph for this function:

STATIC void mole_h_reactions ( void   ) 

hmole_reactions - evaluates hydrogen chemistry reactions

Todo:
2 following always true, why? either remove test or use it - it is here to save time - this step routine is called very often
Todo:
2 this should be done with new populations after converged soln

Definition at line 3277 of file mole_reactions.cpp.

References t_rfield::anu, ASSERT, t_dense::AtomicWeight, t_hmi::chH2_small_model_type, t_colden::colden, colden, t_rfield::ConInterOut, diatomics::Cont_Dissoc_Rate_H2g, diatomics::Cont_Dissoc_Rate_H2s, conv, DEBUG_ENTRY, molezone::den, dense, diatoms, t_dense::eden, EN1RYD, esc_PRD_1side(), t_hmi::exphmi, t_rfield::extin_mag_V_point, t_iso_sp::fb, findspecieslocal(), fixit(), t_rfield::flux, fnzone, fp_equal(), GammaBn(), GammaPrt(), GetDopplerWidth(), diatomics::gs_rate(), h2, t_hmi::H2_H2g_to_H2s_rate_BD96, t_hmi::H2_H2g_to_H2s_rate_BHT90, t_hmi::H2_H2g_to_H2s_rate_ELWERT, t_hmi::H2_H2g_to_H2s_rate_TH85, t_hmi::H2_H2g_to_H2s_rate_used, t_hmi::H2_photodissoc_BHT90, t_hmi::H2_photodissoc_ELWERT_H2g, t_hmi::H2_photodissoc_ELWERT_H2s, t_hmi::H2_photodissoc_TH85, t_hmi::H2_photodissoc_used_H2g, t_hmi::H2_photodissoc_used_H2s, t_hmi::H2_Solomon_dissoc_rate_BD96_H2g, t_hmi::H2_Solomon_dissoc_rate_BD96_H2s, t_hmi::H2_Solomon_dissoc_rate_BHT90_H2g, t_hmi::H2_Solomon_dissoc_rate_BHT90_H2s, t_hmi::H2_Solomon_dissoc_rate_ELWERT_H2g, t_hmi::H2_Solomon_dissoc_rate_ELWERT_H2s, t_hmi::H2_Solomon_dissoc_rate_TH85_H2g, t_hmi::H2_Solomon_dissoc_rate_TH85_H2s, t_hmi::H2_Solomon_dissoc_rate_used_H2g, t_hmi::H2_Solomon_dissoc_rate_used_H2s, t_hmi::H2Opacity, t_phoHeat::HeatNet, hmi, t_hmi::hmicol, t_hmi::HMinus_induc_rec_cooling, t_hmi::HMinus_induc_rec_rate, t_hmi::HMinus_photo_heat, t_hmi::HMinus_photo_rate, hmirat(), ioQQQ, t_rfield::ip1000A, ipCOL_H2g, ipCOL_H2s, t_rfield::ipG0_DB96_hi, t_rfield::ipG0_DB96_lo, t_rfield::ipG0_spec_hi, t_rfield::ipG0_spec_lo, t_rfield::ipG0_TH85_hi, t_rfield::ipG0_TH85_lo, ipHE_LIKE, ipHELIUM, t_hmi::iphmin, t_opac::iphmop, ipHYDROGEN, iso_sp, iteration, diatomics::lgEnabled, diatomics::lgEvaluated, t_hmi::lgH2_Chemistry_BigH2, t_hmi::lgLeidenCRHack, t_mole_global::lgLeidenHack, t_mole_global::lgStancil, MAX2, mole_global, t_conv::nPres2Ioniz, nzone, opac, t_rfield::outlin, t_rfield::outlin_noplot, diatomics::photodissoc_BigH2_H2g, diatomics::photodissoc_BigH2_H2s, phycon, pow(), POW2, t_radius::r1r0sq, radius, diatomics::rel_pop_LTE_g, t_hmi::rel_pop_LTE_H2g, t_hmi::rel_pop_LTE_H2p, t_hmi::rel_pop_LTE_H2s, t_hmi::rel_pop_LTE_H3p, t_hmi::rel_pop_LTE_Hmin, diatomics::rel_pop_LTE_s, rfield, SAHA, secondaries, sexp(), SMALLFLOAT, diatomics::Solomon_dissoc_rate_g, diatomics::Solomon_dissoc_rate_s, t_opac::TauAbsFace, t_phycon::te, t_phycon::te32, TotalInsanity(), t_hmi::UV_Cont_rel2_Draine_DB96_depth, t_hmi::UV_Cont_rel2_Draine_DB96_face, t_hmi::UV_Cont_rel2_Habing_spec_depth, t_hmi::UV_Cont_rel2_Habing_TH85_depth, t_hmi::UV_Cont_rel2_Habing_TH85_face, and t_secondaries::x12tot.

Referenced by mole_update_rks().

Here is the call graph for this function:

STATIC double mole_partition_function ( const molecule *const   sp  ) 
void mole_punch ( FILE *  punit,
const char  speciesname[],
const char  args[],
bool  lgHeader,
bool  lgData,
double  depth 
)
void mole_rk_bigchange ( void   ) 
void mole_update_rks ( void   ) 

mole_update_rks update rate coefficients, only temp part

Definition at line 2849 of file mole_reactions.cpp.

References mole_reaction::a, DEBUG_ENTRY, mole_reaction::index, ioQQQ, mole_reaction::label, mole, mole_h2_grain_form(), mole_h_reactions(), mole_priv::reactab, t_mole_local::reaction_rks, and mole_reaction::rk().

Referenced by mole_drive().

Here is the call graph for this function:

STATIC void newreact ( const char  label[],
const char  fun[],
double  a,
double  b,
double  c 
)
STATIC void parse_base ( char *  s  ) 

Definition at line 2229 of file mole_reactions.cpp.

References getcsvfield(), and newreact().

Referenced by mole_create_react().

Here is the call graph for this function:

STATIC long parse_reaction ( count_ptr< mole_reaction > &  rate,
const char  label[] 
)

Definition at line 2307 of file mole_reactions.cpp.

References ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, findspecies(), ioQQQ, molecule::isEnabled, t_trace::lgTraceMole, MAXPRODUCTS, MAXREACTANTS, null_mole, and trace.

Referenced by canonicalize_reaction_label(), and newreact().

Here is the call graph for this function:

STATIC void parse_udfa ( char *  s  ) 

Definition at line 2695 of file mole_reactions.cpp.

References ASSERT, findspecies(), FLTEQ, getcsvfield(), MALLOC, null_mole, and t_mole_global::sort().

Referenced by mole_create_react().

Here is the call graph for this function:

STATIC void plot_sparsity ( void   ) 
STATIC void read_data ( const char  file[],
void(*)(char *s)  parse 
)

Definition at line 2673 of file mole_reactions.cpp.

References BUFSIZE, fixit(), and open_data().

Referenced by mole_create_react().

Here is the call graph for this function:

STATIC void register_reaction_vectors ( count_ptr< mole_reaction rate  ) 

Definition at line 2428 of file mole_reactions.cpp.

References DEBUG_ENTRY, and lgDifferByExcitation().

Referenced by mole_create_react().

Here is the call graph for this function:


Variable Documentation

realnum albedo = 0.5 [static]

Definition at line 75 of file mole_reactions.cpp.

map<formula_species,struct udfa_reaction_s *> udfatab [static]

Definition at line 2671 of file mole_reactions.cpp.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 15 Nov 2012 for cloudy by  doxygen 1.6.1