Go to the source code of this file.
Data Structures | |
struct | t_conv |
Functions | |
void | ConvIterCheck (void) |
bool | lgConvPres (void) |
int | ConvInitSolution (void) |
int | ConvPresTempEdenIoniz (void) |
int | PressureChange (double dP_chng_factor) |
int | ConvTempEdenIoniz (void) |
int | ConvEdenIoniz (void) |
int | ConvIoniz (void) |
void | ConvFail (const char chMode[], const char chDetail[]) |
int | ConvBase (long loopi) |
int | eden_sum (void) |
Variables | |
EXTERN struct t_conv | conv |
this is the series of routines that converge the pressure, temperature, electron density, and ionization, for a zone. Ideally, only the top routine, ConvPresTempEdenIoniz, should be public
Definition in file conv.h.
int ConvBase | ( | long | loopi | ) |
ConvBase main routine to drive ionization solution for all species, find total opacity called by ConvIoniz/ lgConverg check whether ionization of element nelem has converged
loopi | this tells how many times ConvBase has been called by ConvIoniz while trying to converge electron density == 0 on first call - allows logic in ConvBase to check for ots oscillations |
Definition at line 139 of file conv_base.cpp.
References abund, ASSERT, atmdat_3body(), atmdat_DielSupres(), t_conv::BadConvIoniz, t_thermal::char_tran_cool, t_thermal::char_tran_heat, ChargTranEval(), ChargTranSumHeat(), t_conv::chConvIoniz, t_elementnames::chElementSym, t_save::chHashString, t_hmi::chLab, t_iso::chTypeAtomUsed, co, CO_drive(), CO_update_rks(), CO_update_species_cache(), COmole, t_co::comole_eden, molecule::comole_save, conv, CoolEvaluate(), t_secondaries::csupra, t_thermal::ctot, DEBUG_ENTRY, dense, DumpLine(), DynaIonize(), dynamics, t_dense::eden, eden_sum(), t_conv::EdenErrorAllowed, t_dense::EdenTrue, elementnames, transition::Emis, fixit(), fnzone, fp_equal(), t_dense::gas_phase, GrainDrive(), gv, t_hmi::H2_total, t_conv::HeatCoolRelErrorAllowed, HeatSum(), HeatZero(), molecule::hevmol, highen(), hmi, hmole_reactions(), t_hmi::Hmolec, t_thermal::htot, ion_recom_calculate(), ion_trim(), ion_wrapper(), ionbal, t_dense::IonHigh, t_dense::IonLow, ioQQQ, ipH_LIKE, ipHELIUM, ipHYDROGEN, ipMHm, t_save::ipTraceConvergeBase, iso, iso_drive(), iteration, molecule::label, lgAbort, t_dynamics::lgAdvection, t_conv::lgConvIoniz, t_dense::lgElmtOn, t_conv::lgFirstSweepThisZone, GrainVar::lgGrainElectrons, t_ionbal::lgInnerShellLine_on, lgIonizConverg(), t_rfield::lgIonizReevaluate, t_conv::lgIonStageTrimed, t_rfield::lgOpacityReevaluate, t_opac::lgOpacStatic, t_conv::lgOscilOTS, t_trace::lgOTSBug, t_opac::lgRedoStatic, t_conv::lgSearch, t_dense::lgSetIoniz, t_thermal::lgTemperatureConstant, t_trace::lgTrace, t_save::lgTraceConvergeBase, t_save::lgTraceConvergeBaseHash, LIMELM, t_conv::limPres2Ioniz, LOOP_ION_LIMIT, MAX2, MAX_DENSITY, mole, N_H_MOLEC, molecule::nelem_hevmol, NISO, t_co::nitro_dissoc_rate, t_conv::nPres2Ioniz, t_conv::nTotalIoniz, t_StopCalc::nTotalIonizStop, t_trace::nTrConvg, t_mole::num_comole_calc, t_iso::numLevels_local, nUTA, nzone, opac, t_opac::opacity_abs, OpacityAddTotal(), t_emission::ots, phycon, PresTotCurrent(), rfield, RT_line_all(), RT_OTS(), RT_OTS_PrtRate(), RT_OTS_Update(), save, SDIV(), t_secondaries::sec2total, secondaries, t_dense::SetIoniz, SMALLFLOAT, StatesElemNEW, StopCalc, TauLines, t_phycon::te, t_thermal::te_update, thermal, TorF(), GrainVar::TotalEden, trace, Transitions, t_ionbal::UTA_heat_rate, t_ionbal::UTA_ionize_rate, UTALines, t_dense::xIonDense, t_dense::xMolecules, and t_dense::xNucleiTotal.
Referenced by ConvInitSolution(), ConvIoniz(), and ion_recombAGN().
int ConvEdenIoniz | ( | void | ) |
ConvEdenIoniz called by ConvTempEdenIoniz and ConvInitIonize, it calls ConvIoniz and converges the electron density
Definition at line 24 of file conv_eden_ioniz.cpp.
References iter_track::add(), iter_track::bracket_width(), t_conv::chConvIoniz, t_conv::chSolverEden, iter_track::clear(), conv, DEBUG_ENTRY, dense, iter_track::deriv(), t_dense::eden, EdenError(), t_dense::EdenTrue, fp_equal(), iter_track::init_bracket(), ioQQQ, lgConvEden(), t_conv::lgConvEden, t_conv::lgSearch, t_trace::lgTrace, min(), iter_track::next_val(), t_trace::nTrConvg, iter_track::print_history(), safe_div(), iter_track::set_tol(), ShowMe(), sign(), SMALLFLOAT, TorF(), and trace.
Referenced by ConvTempEdenIoniz(), CoolHeatError(), lgCoolNetConverge(), and map_do().
void ConvFail | ( | const char | chMode[], | |
const char | chDetail[] | |||
) |
ConvFail handle convergence failure
chMode[] | chMode is one of "pres", "eden", "ioni", "pops", "grai", "temp" | |
chDetail | string giving details about the convergence failure |
Definition at line 18 of file conv_fail.cpp.
References ASSERT, t_conv::BadConvIoniz, called, cdEXIT, t_conv::chConvIoniz, t_dense::chDenseLaw, conv, t_hextra::cryden, t_thermal::ctot, DEBUG_ENTRY, dense, t_dense::eden, t_dense::EdenTrue, t_conv::failmx, fnzone, t_dense::gas_phase, hcmap, t_conv::HeatCoolRelErrorAllowed, hextra, t_thermal::htot, t_conv::ifailz, ioQQQ, ipHYDROGEN, iteration, lgAbort, Wind::lgBallistic(), t_conv::lgConvIoniz, t_conv::lgConvPops, t_conv::lgConvTemp, t_conv::lgMap, t_hcmap::lgMapBeingDone, t_pressure::lgSonicPoint, Wind::lgStatic(), t_called::lgTalk, t_conv::LimFail, map_do(), MAX2, MIN2, t_conv::nGrainFail, t_conv::nIonFail, t_conv::nNeFail, t_conv::nPopFail, t_conv::nPreFail, t_conv::nTeFail, t_conv::nTotalFailures, nzone, t_pressure::pbeta, phycon, t_pressure::PresGasCurr, t_pressure::PresRamCurr, pressure, t_pressure::PresTotlCorrect, t_pressure::PresTotlCurr, PrtZone(), t_hcmap::RangeMap, ShowMe(), t_phycon::te, thermal, and wind.
Referenced by CO_drive(), CO_solve(), ConvPresTempEdenIoniz(), GrainChargeTemp(), H2_Level_low_matrix(), H2_LevelPops(), and hmole().
int ConvInitSolution | ( | void | ) |
ConvInitSolution drive search for initial solution at illuminated face, called by cloudy, returns 1 if outside conditions appropriate for cloudy
Definition at line 236 of file conv_init_solution.cpp.
References t_rfield::anu, ASSERT, t_conv::AverEdenError, t_conv::AverHeatCoolError, t_conv::AverPressError, t_conv::BigEdenError, t_conv::BigHeatCoolError, t_conv::BigPressError, t_dense::chDenseLaw, t_thermal::ConstTemp, conv, ConvBase(), ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), CoolSave(), t_struc::coolstr, t_thermal::ctot, dCoolNetDTOld, DEBUG_ENTRY, t_struc::DenMass, t_struc::DenParticles, dense, t_struc::drad, t_radius::drad, t_radius::drad_mid_zone, t_struc::drad_x_fillfac, t_radius::drad_x_fillfac, t_radius::dVeffAper, dynamics, t_dense::eden, t_struc::ednstr, EE, t_geometry::FillFac, FindTempChangeFactor(), fp_equal(), FracMoleMax, t_dense::gas_phase, geometry, t_struc::hden, t_conv::HeatCoolRelErrorAllowed, t_struc::heatstr, Heavy, t_struc::hiistr, t_conv::hist_pres_nzone, t_conv::hist_temp_nzone, t_struc::histr, hmi, t_thermal::htot, ioQQQ, t_Heavy::ipHeavy, ipHYDROGEN, ipOXYGEN, iteration, lgAbort, Wind::lgBallistic(), lgCoolNetConverge(), t_dense::lgDenseInitConstant, t_dense::lgEdenBad, t_conv::lgFirstSweepThisZone, t_conv::lgLastSweepThisZone, t_hmi::lgNoH2Mole, t_conv::lgOscilOTS, t_pressure::lgPressureInitialSpecified, t_dense::lgPressureVaryTime, t_radius::lgSdrmaxRel, t_conv::lgSearch, Wind::lgStatic(), t_thermal::lgTeHigh, t_thermal::lgTemperatureConstant, t_dynamics::lgTimeDependentStatic, t_trace::lgTrace, LIMELM, max(), MAX2, MIN2, t_dynamics::n_initial_relax, t_rfield::nflux, t_conv::nPres2Ioniz, t_conv::nTotalIoniz, t_conv::nTotalIoniz_start, t_trace::nTrConvg, t_dense::nzEdenBad, t_struc::o3str, OxyInGrains, PCHNG, t_dense::pden, phycon, pow(), pressure, t_pressure::PressureInitialSpecified, t_dense::PressureVaryTimeIndex, t_dense::PressureVaryTimeTimescale, PresTotCurrent(), t_pressure::PresTotlCurr, t_pressure::PresTotlInit, t_radius::Radius, radius, radius_first(), rfield, rfield_opac_zero(), SDIV(), t_radius::sdrmax, t_radius::sdrmin, set_NaN(), ShowMe(), SMALLDOUBLE, SMALLFLOAT, StopCalc, struc, t_phycon::te, t_StopCalc::TeFloor, t_phycon::TEMP_LIMIT_HIGH, t_phycon::TEMP_LIMIT_LOW, TempChange(), t_phycon::TEnerDen, t_struc::testr, thermal, t_dynamics::time_elapsed, TotalInsanity(), trace, t_struc::volstr, wind, t_dense::xIonDense, and t_dense::xMassDensity.
Referenced by cloudy().
int ConvIoniz | ( | void | ) |
ConvIoniz called by ConvEdenIonz, it calls ConvBase until converged
Definition at line 11 of file conv_ioniz.cpp.
References t_conv::BadConvIoniz, t_conv::chConvIoniz, conv, ConvBase(), t_thermal::ctot, DEBUG_ENTRY, t_thermal::htot, ioQQQ, lgAbort, t_conv::lgConvIoniz, t_conv::lgOscilOTS, t_conv::lgSearch, t_conv::nPres2Ioniz, t_trace::nTrConvg, thermal, TorF(), and trace.
Referenced by EdenError().
void ConvIterCheck | ( | void | ) |
ConvIterCheck check whether model has converged or whether more iterations are needed - implements the iter to converg comnd
Definition at line 23 of file conv_itercheck.cpp.
References ASSERT, t_conv::autocv, cdLine(), t_elementnames::chElementSym, t_conv::chNotConverged, t_colden::colden, colden, t_colden::colden_old, COmole, conv, t_dynamics::convergence_error, t_dynamics::convergence_tolerance, DEBUG_ENTRY, dense, t_dynamics::discretization_error, t_rt::DoubleTau, dynamics, elementnames, t_dynamics::error_scale2, molecule::hevcol, molecule::hevcol_old, ipCOL_HTOT, ipH2s, ipH3p, ipH_LIKE, ipHe2p3P2, ipHe2s3S, ipHE_LIKE, t_save::ipPunConv, iso, iteration, iterations, t_iterations::itermx, t_dynamics::lgAdvection, t_conv::lgAutoIt, t_dense::lgElmtOn, t_save::lgPunConv, LIMELM, MIN2, mole, NCOLD, NISO, t_iso::nLyaLevel, t_mole::num_comole_calc, nzone, phycon, pow(), rt, save, StopCalc, t_phycon::te, t_StopCalc::TempLoStopZone, TotalInsanity(), and Transitions.
Referenced by cloudy().
int ConvPresTempEdenIoniz | ( | void | ) |
ConvPresTempEdenIoniz solve for current pressure, calls PressureChange, ConvTempEdenIoniz, called by cloudy returns 0 if ok, 1 if disaster
Definition at line 24 of file conv_pres_temp_eden_ioniz.cpp.
References conv, ConvFail(), ConvTempEdenIoniz(), DEBUG_ENTRY, dense, t_dense::eden, fnzone, t_dense::gas_phase, GrainDrift(), gv, ioQQQ, ipHYDROGEN, iteration, lgAbort, t_conv::lgConvEden, t_conv::lgConvIoniz, t_conv::lgConvPops, t_conv::lgConvPres, t_conv::lgConvTemp, GrainVar::lgDustOn(), t_conv::lgFirstSweepThisZone, GrainVar::lgGrainPhysicsOn, t_conv::lgLastSweepThisZone, t_pressure::lgPressureInitialSpecified, LOOPMAX, max(), MAX2, min(), MIN2, t_conv::nPres2Ioniz, t_trace::nTrConvg, nzone, phycon, pressure, PressureChange(), t_pressure::PresTotlCorrect, t_pressure::PresTotlCurr, RT_OTS_ChkSum(), sign(), SMALLFLOAT, t_phycon::te, thermal, t_thermal::thist, t_thermal::tlowst, TorF(), and trace.
Referenced by AGN_Hemis(), cloudy(), and ConvInitSolution().
int ConvTempEdenIoniz | ( | void | ) |
ConvTempEdenIoniz determine temperature, called by ConPresTempEdenIoniz, calls ConvEdenIoniz to get electron density and ionization returns 0 if ok, 1 if disaster
Definition at line 36 of file conv_temp_eden_ioniz.cpp.
References iter_track::add(), iter_track::bracket_width(), t_conv::chSolverTemp, iter_track::clear(), t_colden::colden, colden, conv, ConvEdenIoniz(), CoolHeatError(), t_thermal::ctot, t_conv::dCmHdT, DEBUG_ENTRY, dense, iter_track::deriv(), t_dense::gas_phase, t_hmi::H2_total, hmi, t_thermal::htot, iter_track::init_bracket(), ioQQQ, ipCOL_HTOT, ipHYDROGEN, lgAbort, lgConvTemp(), t_conv::lgConvTemp, t_thermal::lgTeBD96, t_thermal::lgTemperatureConstant, t_thermal::lgTeSN99, t_thermal::lgTLaw, t_trace::lgTrace, t_thermal::lgUnstable, min(), iter_track::next_val(), t_trace::nTrConvg, phycon, POW4, PresTotCurrent(), iter_track::print_history(), safe_div(), iter_track::set_tol(), ShowMe(), t_conv::sigma_dCmHdT, t_thermal::SigmaBD96, sign(), t_thermal::T0BD96, t_thermal::T0SN99, t_phycon::te, t_phycon::TEMP_LIMIT_HIGH, TempChange(), thermal, TorF(), TotalInsanity(), and trace.
Referenced by ConvInitSolution(), and ConvPresTempEdenIoniz().
int eden_sum | ( | void | ) |
eden_sum sum free electron density over all species, sets variable erredn.EdenTrue called by ConvEdenIoniz which actually controls the electron density updates returns 0 if all is ok, 1 if need to abort calc
Definition at line 16 of file eden_sum.cpp.
References ASSERT, co, COmole, t_co::comole_eden, DEBUG_ENTRY, dense, t_dense::eden, t_dense::eden_from_metals, t_dense::EdenExtra, t_dense::EdenSet, t_dense::EdenTrue, fnzone, fp_equal(), gv, molecule::hevmol, hmi, t_hmi::Hmolec, ioQQQ, ipH1s, ipH2p, ipH_LIKE, ipHYDROGEN, ipLITHIUM, t_trace::lgESOURCE, GrainVar::lgGrainElectrons, t_trace::lgNeBug, t_trace::lgTrace, LIMELM, mole, N_H_MOLEC, molecule::nElec, t_hmi::nElectron, t_mole::num_comole_calc, t_rfield::otslin, rfield, safe_div(), GrainVar::TotalEden, trace, Transitions, and t_dense::xIonDense.
Referenced by ConvBase().
bool lgConvPres | ( | void | ) |
returns true if pressure is converged
fp_equal( radius.depth, rsave ) &&
Definition at line 309 of file pressure_change.cpp.
References Wind::AccelGravity, Wind::AccelTotalOutward, ASSERT, cdEXIT, t_dense::cfirst, t_dense::chDenseLaw, t_colden::colden, colden, conv, cosmology, t_dense::csecnd, dark, DEBUG_ENTRY, t_dense::den0, dense, dense_fabden(), dense_parametric_wind(), dense_tabden(), t_dense::DensityPower, t_radius::depth, t_radius::drad, DynaPresChngFactor(), Wind::emdot, fixit(), t_dense::flcPhase, t_dense::flong, t_dense::gas_phase, GetDensity(), t_radius::glbden, t_radius::glbdst, t_radius::glbpow, t_radius::glbrad, t_pressure::gravity_symmetry, t_pressure::IntegRhoGravity, ioQQQ, ipCOL_HTOT, ipHYDROGEN, Wind::lgBallistic(), t_pressure::lgContRadPresOn, t_conv::lgConvPres, t_dense::lgDenFlucRadius, Wind::lgDisk, t_cosmology::lgDo, t_dark_matter::lgNFW_Set, Wind::lgStatic(), t_trace::lgTrace, Wind::lgVelPos, t_trace::lgWind, nzone, pow(), POW2, t_pressure::PresInteg, t_pressure::PresPowerlaw, pressure, pressure_change_factor, t_conv::PressureErrorAllowed, t_pressure::PresTotlCorrect, t_pressure::PresTotlCurr, t_pressure::PresTotlInit, t_radius::r1r0sq, t_radius::Radius, radius, t_cosmology::redshift_current, t_radius::rinner, t_dense::rscale, ShowMe(), struc, TorF(), TotalInsanity(), trace, wind, Wind::windv, and t_struc::windv.
Referenced by PressureChange().
int PressureChange | ( | double | dP_chng_factor | ) |
PressureChange evaluate the current pressure, and change needed to get it to PresTotlInit, return value is true is density was changed, false if no changes were necessary
dP_chng_factor | this is change factor, 1 at first, becomes smaller as oscillations occur |
Definition at line 35 of file pressure_change.cpp.
References abund, AbundancesTable(), ASSERT, t_dense::cfirst, t_colden::colden, colden, COmole, conv, t_dense::csecnd, DEBUG_ENTRY, dense, t_radius::depth, t_dense::eden, t_geometry::FillFac, t_dense::flcPhase, t_dense::flong, t_dense::gas_phase, geometry, t_hmi::H2_total, molecule::hevmol, t_conv::hist_pres_correct, t_conv::hist_pres_current, t_conv::hist_pres_density, t_conv::hist_pres_nzone, hmi, t_hmi::Hmolec, ioQQQ, ipCOL_HTOT, ipHELIUM, ipHYDROGEN, ipLITHIUM, isnan, t_abund::lgAbTaON, t_abund::lgAbunTabl, lgConvPres(), t_conv::lgConvPres, t_dense::lgDenFlucOn, t_dense::lgDenFlucRadius, t_trace::lgNeBug, t_trace::lgTrace, LIMELM, MAX2, MIN2, mole, N_H_MOLEC, t_mole::num_comole_calc, nzone, phycon, t_pressure::pinzon, t_pressure::pres_radiation_lines_curr, t_pressure::PresGasCurr, t_pressure::PresInteg, t_pressure::PresRamCurr, pressure, pressure_change_factor, PresTotCurrent(), t_pressure::PresTotlCorrect, t_pressure::PresTotlCurr, t_pressure::PresTotlInit, t_radius::Radius, radius, t_phycon::te, TempChange(), TorF(), trace, wind, Wind::windv, t_dense::xIonDense, t_dense::xMassDensity, and t_dense::xMolecules.
Referenced by ConvPresTempEdenIoniz().
the variables that deal with the convergence of the model
Referenced by advection_set_default(), atom_levelN(), cdNwcns(), ChargTranEval(), CO_drive(), CO_solve(), ConvBase(), ConvEdenIoniz(), ConvFail(), ConvInitSolution(), ConvIoniz(), ConvIterCheck(), ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), CoolEvaluate(), CoolHeatError(), CoolSave(), dBase_solve(), EdenError(), Fe2_cooling(), fill_array(), find_solution(), get_total_abundance_ions(), GrainCharge(), GrainChargeTemp(), GrainDrive(), GrainsInit(), grid_do(), H21_cm_pops(), H2_Cooling(), H2_LevelPops(), hmole(), hmole_reactions(), hmole_step(), ion_photo(), ion_trim(), IonHelium(), IonHydro(), iso_collide(), iso_continuum_lower(), iso_drive(), iso_ionize_recombine(), iso_level(), iso_radiative_recomb(), iso_update_rates(), iter_end_check(), IterStart(), lgCheckMonitors(), lgConvEden(), lgConvPres(), lgConvTemp(), lgCoolHeatCheckConverge(), lgHomogeneousSource(), lgIonizConverg(), map_do(), MyAssert(), OpacityAddTotal(), transition::outline(), ParseCommands(), ParseFail(), ParseIterations(), ParseSet(), PressureChange(), PresTotCurrent(), PrtComment(), PrtFinal(), PrtZone(), radius_increment(), RT_DestProb(), RT_line_all(), RT_line_escape(), RT_line_fine_opacity(), RT_line_one(), RT_line_pumping(), RT_OTS_PrtRate(), RT_tau_inc(), RT_tau_init(), SaveDo(), SaveHeat(), ShowMe(), store_new_densities(), vib_evap(), and zero().