conv.h File Reference

Go to the source code of this file.

Data Structures

struct  t_conv

Functions

void ConvIterCheck (void)
bool lgConvPres (void)
bool lgConvTemp (void)
bool lgConvEden (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


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.


Function Documentation

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:
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

Todo:
2 this assert is not passed if error made much smaller. This error should be related to a check on convergence of the molecular networks and their sum rules, with a criteria used here and there

Todo:
0 PvH prefers test against err/10

Definition at line 142 of file conv_base.cpp.

References 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_hmi::chLab, co, CO_drive(), CO_update_rks(), CO_update_species_cache(), COmole, t_co::comole_eden, molecule::comole_save, conv, CoolEvaluate(), EmLine::cs, t_secondaries::csupra, t_thermal::ctot, DEBUG_ENTRY, DEBUG_EXIT, dense, DumpLine(), DynaIonize(), dynamics, t_dense::eden, eden_sum(), t_conv::EdenErrorAllowed, t_dense::EdenTrue, elementnames, EmisLines, fnzone, t_dense::gas_phase, GrainDrive(), gv, t_hmi::H2_total, t_conv::HeatCoolRelErrorAllowed, HeatSum(), HeatZero(), HeLike(), molecule::hevmol, highen(), hmi, hmole_reactions(), t_hmi::Hmolec, t_thermal::htot, Hydrogenic(), ion_recom_calculate(), ion_trim(), IonAlumi(), IonArgon(), ionbal, IonBeryl(), IonBoron(), IonCalci(), IonCarbo(), IonChlor(), IonChrom(), IonCobal(), IonCoppe(), IonFluor(), IonHelium(), t_dense::IonHigh, IonIron(), IonLithi(), t_dense::IonLow, IonMagne(), IonManga(), IonNeon(), IonNicke(), IonNitro(), IonOxyge(), IonPhosi(), IonPotas(), IonScand(), IonSilic(), IonSodiu(), EmLine::IonStg, IonSulph(), IonTitan(), IonVanad(), IonZinc(), ioQQQ, ipH_LIKE, ipHELIUM, ipHYDROGEN, ipMHm, iso, molecule::label, lgAbort, t_dynamics::lgAdvection, t_conv::lgConvIoniz, t_dense::lgElmtOn, 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_trace::lgTrace, t_thermal::lgTSetOn, LIMELM, t_conv::limPres2Ioniz, LOOP_ION_LIMIT, MAX2, mole, N_H_MOLEC, EmLine::nelem, 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, nUTA, nzone, opac, t_opac::opacity_abs, OpacityAddTotal(), phycon, t_iso::Pop2Ion, PresTotCurrent(), EmLine::pump, rfield, RT_line_all(), RT_OTS(), RT_OTS_PrtRate(), RT_OTS_Update(), SDIV(), t_secondaries::sec2total, secondaries, t_dense::SetIoniz, SMALLFLOAT, StopCalc, TauLines, t_phycon::te, t_thermal::te_update, thermal, TorF(), t_gv::TotalEden, trace, t_ionbal::UTA_heat_rate, t_ionbal::UTA_ionize_rate, UTALines, t_dense::xIonDense, and t_dense::xMolecules.

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

int ConvEdenIoniz ( void   ) 

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

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 23 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_conv::chConvIoniz, t_dense::chDenseLaw, COmole, t_thermal::ConstTemp, conv, ConvBase(), ConvEdenIoniz(), ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), t_struc::coolstr, t_thermal::ctot, DEBUG_ENTRY, DEBUG_EXIT, t_struc::DenMass, t_struc::DenParticles, dense, t_struc::drad, t_radius::drad, t_struc::drad_x_fillfac, t_radius::drad_x_fillfac, t_radius::dVeff, t_dense::eden, t_struc::ednstr, t_geometry::FillFac, t_dense::gas_phase, geometry, t_struc::hden, t_struc::heatstr, Heavy, molecule::hevmol, t_struc::hiistr, t_struc::histr, t_thermal::htot, ionbal, t_dense::IonHigh, ioQQQ, t_Heavy::ipHeavy, ipHYDROGEN, ipOXYGEN, iteration, lgAbort, t_thermal::lgColNeg, t_conv::lgConvIoniz, t_dense::lgEdenBad, t_dense::lgElmtOn, molecule::lgGas_Phase, t_ionbal::lgNoDec, t_conv::lgOscilOTS, t_conv::lgSearch, t_thermal::lgTeHigh, t_trace::lgTrace, LIMELM, MAX2, MIN2, mole, molecule::nelem_hevmol, t_rfield::nflux, t_conv::nPres2Ioniz, t_conv::nTotalIoniz, t_conv::nTotalIoniz_start, t_trace::nTrConvg, t_mole::num_comole_calc, t_dense::nzEdenBad, t_struc::o3str, PCHNG, t_dense::pden, phycon, pressure, PresTotCurrent(), t_pressure::PresTotlInit, radius, radius_first(), rfield, rfield_opac_zero(), SDIV(), t_radius::sdrmax, t_radius::sdrmin, ShowMe(), StopCalc, struc, t_phycon::te, t_StopCalc::TeHighest, t_StopCalc::TeLowest, t_struc::testr, tfidle(), thermal, trace, t_struc::volstr, wind, t_wind::windv, t_dense::xIonDense, t_dense::xMassDensity, and XMULTP.

Referenced by cloudy().

Here is the call graph for this function:

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 t_conv::BadConvIoniz, t_conv::chConvIoniz, co, t_co::comole_eden, conv, ConvBase(), t_thermal::ctot, DEBUG_ENTRY, DEBUG_EXIT, dense, t_dense::eden, t_dense::EdenTrue, fnzone, gv, t_thermal::htot, ioQQQ, lgAbort, t_conv::lgConvIoniz, t_conv::lgOscilOTS, t_conv::lgSearch, t_conv::nConvIonizFails, t_conv::nPres2Ioniz, t_trace::nTrConvg, thermal, TorF(), t_gv::TotalEden, and trace.

Referenced by ConvEdenIoniz().

Here is the call graph for this function:

void ConvIterCheck ( void   ) 

int ConvPresTempEdenIoniz ( void   ) 

int ConvTempEdenIoniz ( void   ) 

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, cdEXIT(), co, COmole, t_co::comole_eden, conv, DEBUG_ENTRY, DEBUG_EXIT, dense, t_dense::eden, t_dense::eden_from_metals, t_dense::EdenExtra, t_dense::EdenSet, t_dense::EdenTrue, fnzone, gv, molecule::hevmol, hmi, t_hmi::Hmolec, ioQQQ, ipHELIUM, ipHYDROGEN, ipLITHIUM, lgAbort, t_trace::lgESOURCE, t_gv::lgGrainElectrons, t_trace::lgNeBug, t_conv::lgSearch, t_trace::lgTrace, LIMELM, MAX2, mole, N_H_MOLEC, molecule::nElec, t_hmi::nElectron, t_mole::num_comole_calc, nzone, t_rfield::otslin, rfield, SDIV(), ShowMe(), SMALLFLOAT, TorF(), t_gv::TotalEden, trace, and t_dense::xIonDense.

Referenced by ConvBase().

Here is the call graph for this function:

bool lgConvEden ( void   ) 

returns true if electron density is converged

Definition at line 939 of file conv_eden_ioniz.cpp.

References conv, dense, t_dense::eden, t_conv::EdenErrorAllowed, t_dense::EdenTrue, t_conv::lgConvEden, and SDIV().

Referenced by ConvPresTempEdenIoniz().

Here is the call graph for this function:

bool lgConvPres ( void   ) 

bool lgConvTemp ( void   ) 

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

Parameters:
dP_chng_factor this is change factor, 1 at first, becomes smaller as oscillations occur

Definition at line 33 of file pressure_change.cpp.

References abund, AbundancesTable(), ASSERT, t_dense::cfirst, t_colden::colden, colden, COmole, conv, t_dense::csecnd, DEBUG_ENTRY, DEBUG_EXIT, 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_limit, t_conv::hist_pres_npres, t_conv::hist_pres_nzone, hmi, t_hmi::Hmolec, ioQQQ, ipCOL_HTOT, ipHELIUM, ipHYDROGEN, ipLITHIUM, isnan, iteration, t_abund::lgAbTaON, t_abund::lgAbunTabl, lgConvPres(), t_conv::lgConvPres, t_dense::lgDenFlucOn, t_dense::lgDenFlucRadius, t_dense::lgDenseInitConstant, t_trace::lgNeBug, t_trace::lgTrace, LIMELM, MALLOC, MAX2, MIN2, mole, N_H_MOLEC, t_conv::nTotalIoniz, t_mole::num_comole_calc, nzone, t_pressure::pinzon, t_pressure::pres_radiation_lines_curr, t_pressure::PresGasCurr, t_pressure::PresInteg, t_pressure::PresRamCurr, t_pressure::PresRamInit, pressure, pressure_change_factor, PresTotCurrent(), t_pressure::PresTotlCorrect, t_pressure::PresTotlCurr, t_pressure::PresTotlInit, t_radius::Radius, radius, REALLOC, tfidle(), TorF(), trace, wind, t_wind::windv, t_dense::xIonDense, t_dense::xMassDensity, and t_dense::xMolecules.

Referenced by ConvPresTempEdenIoniz().

Here is the call graph for this function:


Variable Documentation

EXTERN struct t_conv conv


Generated for cloudy by doxygen 1.5.9