34 for(
long ion=0; ion < LIMELM+1; ion++ )
73 fprintf(
ioQQQ,
" EDEN change PressureChange from to %10.3e %10.3e %10.3e\n",
93 for(
long ion=0; ion < (nelem + 2); ion++ )
96 if (nelem-ion >= 0 && nelem-ion <
NISO)
126 long nelem = (*nuc)->el->Z-1;
128 double sum_monatomic = 0.;
132 if( (*nuc)->label() ==
"D" )
144 for(
long ion=0; ion<nelem+2; ++ion )
155 if( sum_monatomic + sum_molecules <=
SMALLFLOAT &&
158 fprintf(
ioQQQ,
"PROBLEM non-conservation of nuclei %s\tions %g moles %g error %g of %g\n",
159 (*nuc)->label().c_str(),
162 sum_monatomic + sum_molecules-sum_gas_phase,
171 if( fabs( sum_monatomic + sum_molecules - sum_gas_phase ) >
174 fprintf(
ioQQQ,
"PROBLEM non-conservation of nuclei %s\t nzone %li atoms %.12e moles %.12e sum %.12e tot gas %.12e rel err %.3e\n",
175 (*nuc)->label().c_str(),
179 sum_monatomic + sum_molecules,
181 (sum_monatomic + sum_molecules - sum_gas_phase)/sum_gas_phase );
203 for (
long ipLev=0; ipLev<numStates; ipLev++)
205 abund += states[ipLev].Pop();
213 if( rel_err > err_tol )
216 if( 0 &&
nzone > 0 && loop_ion > 0 )
218 fprintf(
ioQQQ,
"PROBLEM Inconsistent states/stage pops nzone %3ld loop_ion %2ld nelem %2ld ion %2ld states = %e stage = %e error = %e\n",
228 sprintf( chConvIoniz ,
"States!=stage pops nelem %ld ion %ld ", nelem, ionStage );
247 for(
long ion=0; ion<=nelem+1; ++ion )
261 fprintf(
ioQQQ,
"PROBLEM DISASTER SumDensities has found "
262 "dense.xNucleiTotal with an insane density.\n");
275 for(
long i=0; i <
LIMELM; i++ )
304 fixit(
"AbundChange breaks conservation if molecular abundance is finite");
315 bool lgChange =
false;
322 for(
long nelem=1; nelem <
LIMELM; nelem++ )
332 for(
long ion=0; ion < (nelem + 2); ion++ )
346 static double FacAbunSav;
347 double OldAbun = 0.0;
352 OldAbun = FacAbunSav;
371 FacAbun = FacAbunSav/OldAbun;
406 const int SCALE_NEW = 1;
void ScaleIonDensities(const long nelem, const realnum factor)
t_mole_global mole_global
void SetGasPhaseDensity(const long nelem, const realnum density)
realnum xMolecules(long nelem)
NORETURN void TotalInsanity(void)
realnum GasPhaseAbundErrorAllowed
ChemNuclideList nuclide_list
void lgStatesConserved(long nelem, long ionStage, qList states, long numStates, realnum err_tol, long loop_ion)
void TempChange(double TempNew, bool lgForceUpdate)
t_elementnames elementnames
double xIonDense[LIMELM][LIMELM+1]
void ScaleAllDensities(realnum factor)
molecule * findspecies(const char buf[])
valarray< class molezone > species
realnum m_xMolecules[LIMELM]
const int INPUT_LINE_LENGTH
realnum total_molecules_gasphase(void)
diatomics h2("h2", 4100.,&hmi.H2_total, Yan_H2_CS)
double AbundancesTable(double r0, double depth, long int iel)
void SetGasPhaseDeuterium(const realnum &Hdensity)
realnum scalingZoneDensity(long i)
char chElementSym[LIMELM][CHARS_ELEMENT_SYM]
realnum gas_phase[LIMELM]
realnum AtomicWeight[LIMELM]
void ScaleDensitiesDeuterium(const realnum &factor)
double density(const genericState &gs)
#define DEBUG_ENTRY(funcname)
realnum scalingDensity(void)
void iso_renorm(long nelem, long ipISO, double &renorm)
int fprintf(const Output &stream, const char *format,...)
sys_float SDIV(sys_float x)
void setConvIonizFail(const char *reason, double oldval, double newval)
void EdenChange(double EdenNew)
bool lgElemsConserved(void)
void total_molecule_elems(realnum total[LIMELM])
void mole_print_species_reactions(molecule *speciesToPrint)