cloudy trunk
Loading...
Searching...
No Matches
conv.h File Reference

Go to the source code of this file.

Data Structures

struct  t_conv

Enumerations

enum  counter_type {
  MOLE_SOLVE , MOLE_SOLVE_STEPS , NEWTON , NEWTON_LOOP ,
  CONV_BASE_CALLS , CONV_BASE_LOOPS , CONV_BASE_ACCELS , ION_SOLVES ,
  ISO_LOOPS , EDEN_CHANGES , TEMP_CHANGES , PRES_CHANGES ,
  NTYPES
}

Functions

void ConvIterCheck (void)
bool ConvInitSolution ()
int ConvPresTempEdenIoniz (void)
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)
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

Definition in file conv.h.

Enumeration Type Documentation

◆ counter_type

Enumerator
MOLE_SOLVE 
MOLE_SOLVE_STEPS 
NEWTON 
NEWTON_LOOP 
CONV_BASE_CALLS 
CONV_BASE_LOOPS 
CONV_BASE_ACCELS 
ION_SOLVES 
ISO_LOOPS 
EDEN_CHANGES 
TEMP_CHANGES 
PRES_CHANGES 
NTYPES 

Definition at line 69 of file conv.h.

Function Documentation

◆ ConvBase()

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

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

Definition at line 163 of file conv_base.cpp.

References ASSERT, atmdat, atmdat_3body(), ChargTranEval(), ChargTranSumHeat(), conv, CONV_BASE_ACCELS, CONV_BASE_CALLS, CONV_BASE_LOOPS, CoolEvaluate(), DEBUG_ENTRY, molezone::den, dense, deut, diatoms, DumpLine(), DynaIonize(), dynamics, eden_sum(), findspecieslocal(), fixit(), fnzone, fp_equal(), GrainDrive(), gv, HeatSum(), HeatZero(), highen(), hmi, INPUT_LINE_LENGTH, ion_recom_calculate(), ion_trim(), ion_wrapper(), ionbal, ioQQQ, ipH_LIKE, ipHELIUM, ipHYDROGEN, ipNICKEL, ipOXYGEN, iso_collapsed_update(), iso_renorm(), iso_sp, iso_update_rates(), iteration, lgAbort, lgElemsConserved(), lgNetEdenSrcSmall(), lgStatesConserved(), LIMELM, MAX2, MIN2, mole, mole_drive(), mole_global, mole_update_sources(), NISO, nzone, opac, OpacityAddTotal(), phycon, PresTotCurrent(), rfield, RT_line_all(), RT_OTS(), RT_OTS_PrtRate(), RT_OTS_Update(), save, SDIV(), secondaries, SetDeuteriumIonization(), SMALLFLOAT, StopCalc, TauLines, thermal, TorF(), trace, UpdateUTAs(), x0, x1, and x2.

Referenced by ConvInitSolution(), ConvIoniz(), and ion_recombAGN().

Here is the call graph for this function:

◆ ConvEdenIoniz()

int ConvEdenIoniz ( void )

ConvEdenIoniz called by ConvTempEdenIoniz and ConvInitIonize, it calls ConvIoniz and converges the electron density

Returns
returns 1 if error condition, 0 if ok

Definition at line 21 of file conv_eden_ioniz.cpp.

References iter_track::add(), iter_track::bracket_width(), iter_track::clear(), conv, DEBUG_ENTRY, dense, iter_track::deriv(), EdenError(), fp_equal(), iter_track::in_bounds(), iter_track::init_bracket(), ioQQQ, lgConvEden(), min(), iter_track::next_val(), iter_track::print_history(), safe_div(), iter_track::set_tol(), ShowMe(), sign(), SMALLFLOAT, TorF(), and trace.

Referenced by ConvTempEdenIoniz(), CoolHeatError(), lgCoolNetConverge(), and map_do().

Here is the call graph for this function:

◆ 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

Definition at line 18 of file conv_fail.cpp.

References ASSERT, called, cdEXIT, conv, DEBUG_ENTRY, dense, EXIT_FAILURE, fnzone, hcmap, hextra, ioQQQ, ipHYDROGEN, iteration, lgAbort, map_do(), MAX2, MIN2, nzone, phycon, pressure, PrtZone(), ShowMe(), and thermal.

Referenced by ConvPresTempEdenIoniz(), GrainChargeTemp(), and diatomics::H2_Level_low_matrix().

Here is the call graph for this function:

◆ ConvInitSolution()

bool ConvInitSolution ( )

ConvInitSolution drive search for initial solution at illuminated face, called by cloudy, returns 1 if outside conditions appropriate for cloudy

Definition at line 242 of file conv_init_solution.cpp.

References ASSERT, conv, ConvBase(), ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), CoolSave(), dCoolNetDTOld, DEBUG_ENTRY, dense, dynamics, EE, FindTempChangeFactor(), fp_equal(), FracMoleMax, geometry, Heavy, ioQQQ, ipHYDROGEN, ipOXYGEN, iteration, lgAbort, lgCoolNetConverge(), LIMELM, max(), MAX2, MIN2, mole_global, OxyInGrains, phycon, pressure, PresTotCurrent(), radius, radius_first(), rfield, rfield_opac_zero(), SDIV(), set_NaN(), ShowMe(), SMALLDOUBLE, SMALLFLOAT, StopCalc, struc, TempChange(), thermal, TotalInsanity(), and trace.

Referenced by cloudy().

Here is the call graph for this function:

◆ ConvIoniz()

int ConvIoniz ( void )

ConvIoniz called by ConvEdenIonz, it calls ConvBase until converged

Returns
returns 1 if error condition, 0 if ok

Definition at line 11 of file conv_ioniz.cpp.

References conv, ConvBase(), DEBUG_ENTRY, ioQQQ, lgAbort, thermal, TorF(), and trace.

Referenced by EdenError().

Here is the call graph for this function:

◆ ConvIterCheck()

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, cdLine(), colden, conv, DEBUG_ENTRY, dense, dynamics, elementnames, ipCOL_HTOT, ipH2s, ipH3p, ipH_LIKE, ipHe2p3P2, ipHe2s3S, ipHE_LIKE, iso_ctrl, iso_sp, iteration, iterations, LIMELM, MIN2, mole, mole_global, NCOLD, NISO, nLevel1, nzone, phycon, rt, save, StopCalc, TauLines, and TotalInsanity().

Referenced by cloudy().

Here is the call graph for this function:

◆ ConvPresTempEdenIoniz()

int ConvPresTempEdenIoniz ( void )

ConvPresTempEdenIoniz solve for current pressure, calls PressureChange, ConvTempEdenIoniz, called by cloudy returns 0 if ok, 1 if disaster

Definition at line 23 of file conv_pres_temp_eden_ioniz.cpp.

References AbundChange(), conv, ConvFail(), ConvTempEdenIoniz(), DEBUG_ENTRY, dense, fnzone, geometry, GrainDrift(), gv, ioQQQ, ipHYDROGEN, iteration, lgAbort, max(), MAX2, min(), MIN2, nzone, phycon, PRES_CHANGES, 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()

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(), iter_track::clear(), colden, conv, ConvEdenIoniz(), CoolHeatError(), DEBUG_ENTRY, dense, fp_equal(), hmi, iter_track::init_bracket(), ioQQQ, ipCOL_HTOT, ipHYDROGEN, lgAbort, lgConvTemp(), max(), min(), iter_track::next_val(), phycon, POW4, PresTotCurrent(), iter_track::print_history(), safe_div(), iter_track::set_tol(), ShowMe(), sign(), SQRT2, TempChange(), thermal, TorF(), TotalInsanity(), and trace.

Referenced by ConvInitSolution(), and ConvPresTempEdenIoniz().

Here is the call graph for this function:

◆ eden_sum()

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 18 of file eden_sum.cpp.

References ASSERT, DEBUG_ENTRY, dense, deut, fnzone, fp_equal(), 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

Definition at line 12 of file eden_change.cpp.

References ASSERT, COLL_CONST, conv, DEBUG_ENTRY, dense, ELECTRON_MASS, ELEM_CHARGE_ESU, fp_equal(), FR1RYD, ipHYDROGEN, MAX2, nzone, phycon, PI, rfield, and RT_line_all().

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

Definition at line 5 of file conv.cpp.

Referenced by advection_set_default(), atom_levelN(), cdNwcns(), ChargTranEval(), check_co_ion_converge(), cloudy(), ConvBase(), ConvEdenIoniz(), ConvFail(), ConvInitSolution(), ConvIoniz(), ConvIterCheck(), ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), CoolEvaluate(), CoolHeatError(), CoolSave(), dBase_solve(), EdenChange(), EdenError(), Fe2_cooling(), 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(), IonHelium(), iso_collapsed_update(), iso_collide(), iso_continuum_lower(), iso_ionize_recombine(), iso_level(), 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(), TransitionProxy::outline(), ParseCommands(), ParseFail(), ParseIterations(), ParseSet(), PressureChange(), PresTotCurrent(), PrtComment(), PrtFinal(), PrtZone(), radius_increment(), RT_DestProb(), RT_iso_integrate_RRC(), 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(), GroupMap::setup(), ShowMe(), store_new_densities(), tauff(), TempChange(), UpdateUTAs(), zero(), and ZoneStart().