17 DEBUG_ENTRY(
"diatomics::Read_Mol_Diss_cross_sections()" );
26 const int ipNUM_FILES = 1;
28 char chFileNames[ipNUM_FILES][17] =
40 for(
int iVibLo=0; iVibLo<=
nVib_hi[iElecLo]; ++iVibLo )
49 strcpy( chDirectory,
"h2\\" );
51 strcpy( chDirectory,
"h2/" );
55 strcpy( chPath, chDirectory );
56 strcat( chPath, chFileNames[0] );
62 while(
read_whole_line( chLine , (
int)
sizeof(chLine) , ioDATA ) != NULL )
64 static bool skipData =
false;
65 long ini=0, inf, iv, ij;
69 if(
sizeof(chLine) >= 2 && chLine[0] ==
'#' && chLine[1] ==
'!' && chLine[4] ==
'n' && chLine[5] ==
'e' )
71 sscanf(chLine,
"#! nei=%li, nef=%li, vi= %li, ji= %li",&ini, &inf, &iv, &ij);
77 else if( ij >
nRot_hi[ini][iv] )
96 double energy, xsection;
97 const double AngSquared = 1e-16;
98 sscanf(chLine,
"%lf,%lf",&energy, &xsection);
104 Diss_Trans.back().xsections.push_back( xsection*AngSquared );
125 double photodiss_cs = 0.;
132 else if(Mol_Ene > tran.
energies.back())
150 DEBUG_ENTRY(
"diatomics::Mol_Photo_Diss_Rates()" );
163 for( vector< diss_tran >::const_iterator dt =
Diss_Trans.begin(); dt !=
Diss_Trans.end(); ++dt )
165 double rate = (*this).GetDissociationRate( *dt );
167 Cont_Dissoc_Rate[dt->initial.n][dt->initial.v][dt->initial.j] += dt->rate_coeff;
197 index_max =
MIN2( index_max,
rfield.nflux-1 );
200 for(
long i = index_min; i <= index_max; ++i)
237 double Cont_Dissoc_Heat_Rate = 0.0;
238 for( vector< diss_tran >::const_iterator dt =
Diss_Trans.begin(); dt !=
Diss_Trans.end(); ++dt )
239 Cont_Dissoc_Heat_Rate += (*this).GetHeatRate( *dt );
241 return Cont_Dissoc_Heat_Rate;
250 index_max =
MIN2( index_max,
rfield.nflux-1 );
257 for(
long i = index_min; i<= index_max; ++i )
266 double Rate_Coeff = photodiss_cs*(
rfield.flux[0][i] +
rfield.ConInterOut[i]+
272 rate +=
EN1RYD * energy * Rate_Coeff * density;
const int FILENAME_PATH_LENGTH_2
char * read_whole_line(char *chLine, int nChar, FILE *ioIN)
sys_float SDIV(sys_float x)
#define DEBUG_ENTRY(funcname)
double powi(double, long int)
double Cont_Dissoc_Rate_H2g
void Mol_Photo_Diss_Rates(void)
double Cont_Diss_Heat_Rate(void)
double GetDissociationRate(const diss_tran &tran)
double MolDissocOpacity(const diss_tran &tran, const double &Mol_Ene)
vector< diss_tran > Diss_Trans
const double ENERGY_H2_STAR
void Read_Mol_Diss_cross_sections(void)
double GetHeatRate(const diss_tran &tran)
double Cont_Dissoc_Rate_H2s
valarray< long > nRot_hi[N_ELEC]
multi_arr< long int, 3 > ipEnergySort
multi_arr< double, 3 > Cont_Dissoc_Rate
vector< double > xsections
vector< double > energies
long ipoint(double energy_ryd)
FILE * open_data(const char *fname, const char *mode, access_scheme scheme)
double MolDissocCrossSection(const diss_tran &tran, const double &Mol_Ene)
STATIC double cross_section(double EgammaRyd, double EthRyd, long nelem, long n, long l, long s)
t_mole_global mole_global
STATIC void GetDissociationRateCoeff(diss_tran &tran)
double MolDissocCrossSection(const diss_tran &tran, const double &Mol_Ene)
UNUSED const double EN1RYD
UNUSED const double WAVNRYD
double linint(const double x[], const double y[], long n, double xval)