Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
conv.h File Reference
#include "module.h"
Include dependency graph for conv.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
 

Detailed Description

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

Function Documentation

◆ ConvBase()

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

Parameters
loopithis 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
Todo
0 PvH prefers test against err/10

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().

Here is the call graph for this function:

◆ ConvEdenIoniz()

◆ ConvFail()

void ConvFail ( const char chMode[],
const char chDetail[] )

ConvFail handle convergence failure

Parameters
chMode[]chMode is one of "pres", "eden", "ioni", "pops", "grai", "temp"
chDetailstring 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().

Here is the call graph for this function:

◆ ConvInitSolution()

◆ ConvIoniz()

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().

Here is the call graph for this function:

◆ ConvIterCheck()

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().

Here is the call graph for this function:

◆ ConvPresTempEdenIoniz()

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().

Here is the call graph for this function:

◆ ConvTempEdenIoniz()

void ConvTempEdenIoniz ( )

◆ eden_sum()

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().

Here is the call graph for this function:

◆ EdenChange()

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().

Here is the call graph for this function:

Variable Documentation

◆ conv

t_conv conv
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().