Cloudy
Spectral Synthesis Code for Astrophysics
|
#include "module.h"
Go to the source code of this file.
Classes | |
struct | t_conv |
class | ConvergenceCounter |
Functions | |
void | ConvIterCheck () |
void | ConvInitSolution (double) |
void | ConvPresTempEdenIoniz () |
void | ConvTempEdenIoniz () |
void | ConvEdenIoniz () |
void | ConvIoniz () |
void | ConvFail (const char chMode[], const char chDetail[]) |
void | ConvBase (long loopi) |
void | eden_sum () |
void | EdenChange (double EdenNew) |
Variables | |
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
void 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 |
References ASSERT, atmdat, atmdat_3body(), ChargTranEval(), ChargTranSumHeat(), conv, CoolEvaluate(), CoolSave(), DEBUG_ENTRY, molezone::den, dense, deut, diatoms, DumpLine(), DynaIonize(), dynamics, eden_sum(), elementnames, findspecies(), findspecieslocal(), fnzone, fp_equal(), fprintf(), GrainDrive(), grid, gv, HeatSum(), HeatZero(), highen(), hmi, ion_recom_calculate(), ion_trim(), ion_trim2(), ion_trim_from_set(), ion_trim_validate(), ion_widen(), ion_wrapper(), ionbal, ioQQQ, ipH_LIKE, ipHELIUM, ipHYDROGEN, ipOXYGEN, iso_collapsed_update(), iso_multiplet_opacities(), iso_renorm(), iso_solve(), iso_sp, iso_update_rates(), iteration, lgConvBaseHeatTest, lgElemsConserved(), lgNetEdenSrcSmall(), lgStatesConserved(), LIMELM, MAX2, MIN2, mole, mole_dominant_rates(), mole_drive(), mole_global, mole_save(), mole_update_sources(), t_atmdat::NCX, NISO, NULL, nzone, opac, OpacityAddTotal(), phycon, PresTotCurrent(), RandomCrash(), rfield, RT_line_all_escape(), RT_OTS(), RT_OTS_PrtRate(), RT_OTS_Update(), save, SaveHeat(), SDIV(), SecIoniz(), secondaries, SetDeuteriumIonization(), SMALLFLOAT, thermal, TorF(), trace, UpdateUTAs(), x0, x1, and x2.
Referenced by ConvInitSolution(), ConvIoniz(), and ion_recombAGN().
void ConvEdenIoniz | ( | ) |
ConvEdenIoniz called by ConvTempEdenIoniz and ConvInitIonize, it calls ConvIoniz and converges the electron density
References iter_track::add(), iter_track::bracket_width(), iter_track::clear(), conv, CoolEvaluate(), DEBUG_ENTRY, dense, iter_track::deriv(), EdenError(), fp_equal(), fprintf(), HeatSum(), iter_track::in_bounds(), iter_track::init_bracket(), ioQQQ, lgConvBaseHeatTest, lgConvEden(), min(), iter_track::next_val(), nzone, iter_track::print_history(), safe_div(), iter_track::set_tol(), ShowMe(), sign(), SMALLFLOAT, thermal, 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 |
References ASSERT, BIGFLOAT, called, cdEXIT, conv, DEBUG_ENTRY, dense, EXIT_FAILURE, fnzone, fprintf(), hcmap, hextra, ioQQQ, ipHYDROGEN, iteration, map_do(), MAX2, MIN2, nzone, phycon, pressure, PrtZone(), safe_div(), ShowMe(), and thermal.
Referenced by ConvPresTempEdenIoniz(), and GrainChargeTemp().
void ConvInitSolution | ( | double | TeStart | ) |
ConvInitSolution drive search for initial solution at illuminated face, called by cloudy
References ASSERT, conv, ConvBase(), ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), CoolSave(), dCoolNetDTOld, DEBUG_ENTRY, dense, dynamics, FindTempChangeFactor(), fp_equal(), fprintf(), FracMoleMax, geometry, Heavy, ioQQQ, ipHYDROGEN, ipOXYGEN, iteration, lgCoolNetConverge(), LIMELM, max(), MAX2, MIN2, mole_global, OxyInGrains, phycon, pow(), pressure, PresTotCurrent(), radius, radius_first(), rfield, rfield_opac_zero(), SDIV(), set_NaN(), SMALLDOUBLE, SMALLFLOAT, StopCalc, struc, TempChange(), thermal, TotalInsanity(), and trace.
Referenced by cloudy().
void ConvIoniz | ( | ) |
ConvIoniz called by ConvEdenIonz, it calls ConvBase until converged
References conv, ConvBase(), DEBUG_ENTRY, fprintf(), ioQQQ, thermal, TorF(), and trace.
Referenced by EdenError().
void ConvIterCheck | ( | ) |
ConvIterCheck check whether model has converged or whether more iterations are needed - implements the iter to converg comnd
References AllTransitions, ASSERT, cdLine(), chLineLbl(), colden, conv, dBaseSpecies, dBaseTrans, DEBUG_ENTRY, dense, dynamics, elementnames, fprintf(), Hbeta_WavLen, ipCOL_HTOT, ipH2s, ipH3p, ipH_LIKE, ipHe2p3P2, ipHe2s3S, ipHE_LIKE, iso_ctrl, iso_sp, iteration, iterations, LIMELM, MIN2, mole, mole_global, NCOLD, NISO, nSpecies, nzone, phycon, rt, save, StopCalc, and TotalInsanity().
Referenced by cloudy().
void ConvPresTempEdenIoniz | ( | ) |
ConvPresTempEdenIoniz solve for current pressure, calls PressureChange, ConvTempEdenIoniz, called by cloudy
References AbundChange(), conv, ConvFail(), ConvTempEdenIoniz(), DEBUG_ENTRY, dense, fnzone, fprintf(), geometry, GrainDrift(), gv, ioQQQ, ipHYDROGEN, iteration, max(), MAX2, min(), MIN2, nzone, phycon, solverState::press, pressure, PressureChange(), pressureZone(), PresTotCurrent(), RT_OTS_ChkSum(), ScaleAllDensities(), scalingDensity(), PresMode::set(), sign(), SMALLFLOAT, TempChange(), thermal, TorF(), trace, and zoneDensity().
Referenced by AGN_Hemis(), cloudy(), and ConvInitSolution().
void ConvTempEdenIoniz | ( | ) |
ConvTempEdenIoniz determine temperature, called by ConPresTempEdenIoniz, calls ConvEdenIoniz to get electron density and ionization
References iter_track::add(), iter_track::bracket_width(), iter_track::clear(), colden, conv, ConvEdenIoniz(), CoolHeatError(), DEBUG_ENTRY, dense, fp_equal(), fprintf(), hmi, iter_track::init_bracket(), ioQQQ, ipCOL_HTOT, ipHYDROGEN, lgConvTemp(), max(), min(), iter_track::next_val(), phycon, POW4, PresTotCurrent(), iter_track::print_history(), radius, safe_div(), iter_track::set_tol(), ShowMe(), sign(), TempChange(), thermal, TorF(), TotalInsanity(), and trace.
Referenced by ConvInitSolution(), ConvPresTempEdenIoniz(), and PressureChange().
void eden_sum | ( | ) |
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
References ASSERT, DEBUG_ENTRY, dense, deut, fnzone, fp_equal(), fprintf(), gv, ioQQQ, ipH1s, ipH2p, ipH_LIKE, ipHYDROGEN, ipLITHIUM, iso_sp, LIMELM, mole, mole_global, rfield, safe_div(), and trace.
Referenced by ConvBase().
void EdenChange | ( | double | EdenNew | ) |
EdenChange - changes electron density and dependent variables
References ASSERT, conv, DEBUG_ENTRY, dense, fp_equal(), ipHYDROGEN, MAX2, NULL, nzone, phycon, rfield, RT_line_all_escape(), and TotalInsanity().
Referenced by ContSetIntensity(), EdenError(), ion_recombAGN(), IterRestart(), SaveLineData(), ScaleAllDensities(), and ZoneStart().
|
extern |
Referenced by advection_set_default(), cdNwcns(), ChargTranEval(), check_co_ion_converge(), cloudy(), ConvBase(), ConvEdenIoniz(), ConvFail(), ConvInitSolution(), ConvIoniz(), ConvIterCheck(), ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), CoolEvaluate(), CoolHeatError(), CoolSave(), dBase_solve(), dBaseAbund(), dBaseTrim(), EdenChange(), EdenError(), find_solution(), get_total_abundance_ions(), GrainCharge(), GrainChargeTemp(), GrainDrive(), GrainsInit(), grid_do(), H21_cm_pops(), diatomics::H2_Cooling(), diatomics::H2_LevelPops(), HeatSum(), HomogeneousSource(), ion_photo(), ion_solver(), ion_trim(), ion_trim2(), ion_trim_validate(), IonHelium(), iso_collapsed_update(), iso_collide(), iso_continuum_lower(), iso_ionize_recombine(), iso_level(), iso_rad_rec_cooling_discrete(), iso_radiative_recomb(), iso_renorm(), iso_update_rates(), iter_end_check(), IterStart(), lgCheckMonitors(), lgConvEden(), lgConvTemp(), lgCoolHeatCheckConverge(), lgElemsConserved(), lgNetEdenSrcSmall(), lgStatesConserved(), lgTestPressureConvergence(), limitedDensityScaling(), logPressureState(), map_do(), mole_h_reactions(), mole_solve(), MyAssert(), newton_step(), OpacityAddTotal(), Atom_LevelN::operator()(), TransitionProxy::outline(), ParseCommands(), ParseFail(), ParseIterations(), ParseSet(), PressureChange(), PresTotCurrent(), PrintRates(), PrtComment(), PrtFinal(), PrtZone(), radius_increment(), renorm_solution(), RT_DestProb(), RT_line_all_escape(), RT_line_escape(), RT_line_pumping(), RT_OTS_PrtRate(), RT_tau_inc(), RT_tau_init(), SaveDo(), SaveHeat(), GroupMap::setup(), ShowMe(), tauff(), TempChange(), UpdateUTAs(), and ZoneStart().