/home66/gary/public_html/cloudy/c08_branch/source/conv.h File Reference

This graph shows which files directly or indirectly include this file:

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 139 of file conv_base.cpp.

References ASSERT, co, t_co::comole_eden, conv, t_thermal::ctot, DEBUG_ENTRY, dense, eden_sum(), t_dense::EdenTrue, fnzone, fp_equal(), gv, t_thermal::htot, ipH_LIKE, t_dense::lgElmtOn, LIMELM, N_H_MOLEC, NISO, t_conv::nPres2Ioniz, t_conv::nTotalIoniz, nzone, phycon, PresTotCurrent(), StatesElem, t_phycon::te, t_thermal::te_update, thermal, and t_gv::TotalEden.

Referenced by ConvIoniz(), and ion_recombAGN().

Here is the call graph for this function:

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

References ASSERT, cdEXIT, t_conv::chConvEden, t_conv::chConvIoniz, t_conv::chNotConverged, t_conv::chSolverEden, conv, ConvIoniz(), t_thermal::ctot, damp, DEBUG_ENTRY, dense, t_dense::eden, t_dense::eden_from_metals, t_conv::EdenErrorAllowed, t_dense::EdenTrue, fnzone, t_dense::gas_phase, gv, t_conv::hist_temp_cool, t_conv::hist_temp_heat, t_conv::hist_temp_limit, t_conv::hist_temp_ntemp, t_conv::hist_temp_nzone, t_conv::hist_temp_temp, t_thermal::htot, INPUT_LINE_LENGTH, ioQQQ, ipHYDROGEN, iteration, KASE_EDEN_NOT_ION, lgAbort, t_conv::lgConvEden, t_conv::lgEdenOscl, t_trace::lgNeBug, t_conv::lgSearch, t_trace::lgTrace, linfit(), LOOPMAX, MALLOC, MAX2, MIN2, t_conv::nConvIonizFails, t_conv::nPres2Ioniz, t_conv::nTotalIoniz, t_trace::nTrConvg, nzone, OLDFAC, phycon, PRT_EDEN_OSCIL, PRT_FAIL_LAST_TRY, PRT_NEW, REALLOC, SDIV(), ShowMe(), SMALLFLOAT, t_phycon::te, thermal, TorF(), t_gv::TotalEden, trace, and USE_NEW.

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

Here is the call graph for this function:

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

ConvFail handle convergence failure

Parameters:
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, called, cdEXIT, t_conv::chConvIoniz, t_dense::chDenseLaw, conv, t_hextra::cryden, t_thermal::ctot, DEBUG_ENTRY, dense, t_thermal::dTemper, 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, t_conv::lgCmHOsc, t_conv::lgConvIoniz, t_conv::lgConvPops, t_conv::lgConvTemp, t_conv::lgEdenOscl, t_conv::lgMap, t_hcmap::lgMapBeingDone, t_pressure::lgSonicPoint, t_called::lgTalk, t_conv::lgTOscl, 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, wind, and t_wind::windv.

Referenced by ConvPresTempEdenIoniz(), and hmole().

Here is the call graph for this function:

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 223 of file conv_init_solution.cpp.

References ASSERT, t_conv::AverEdenError, t_conv::AverHeatCoolError, t_conv::AverPressError, t_conv::BigEdenError, t_conv::BigHeatCoolError, t_conv::BigPressError, t_thermal::ConstTemp, conv, ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), t_struc::coolstr, t_thermal::ctot, dCoolNetDTOld, DEBUG_ENTRY, t_struc::DenMass, t_struc::DenParticles, dense, t_radius::drad, t_struc::drad, t_radius::drad_x_fillfac, t_struc::drad_x_fillfac, t_radius::dVeff, 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_struc::histr, t_thermal::htot, ioQQQ, t_Heavy::ipHeavy, ipHYDROGEN, ipOXYGEN, iteration, lgAbort, lgCoolNetConverge(), t_dense::lgDenseInitConstant, t_dense::lgEdenBad, t_conv::lgOscilOTS, t_pressure::lgPressureInitialSpecified, t_conv::lgSearch, t_thermal::lgTeHigh, t_trace::lgTrace, LIMELM, MAX2, MIN2, t_rfield::nflux, t_conv::nPres2Ioniz, t_conv::nTotalIoniz, t_conv::nTotalIoniz_start, t_trace::nTrConvg, t_dense::nzEdenBad, t_struc::o3str, OxyInGrains, t_dense::pden, phycon, pressure, t_pressure::PressureInitialSpecified, PresTotCurrent(), t_pressure::PresTotlCurr, t_pressure::PresTotlInit, radius, radius_first(), rfield, 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_struc::testr, thermal, TorF(), TotalInsanity(), trace, t_struc::volstr, t_dense::xIonDense, and t_dense::xMassDensity.

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, 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   ) 

ConvIterCheck check whether model has converged or whether more iterations are needed - implements the iter to converg comnd

Definition at line 22 of file conv_itercheck.cpp.

References t_conv::autocv, t_elementnames::chElementSym, t_conv::chNotConverged, conv, DEBUG_ENTRY, dense, t_rt::DoubleTau, elementnames, ipH2s, ipH3p, ipH_LIKE, ipHe2p3P2, ipHe2s3S, ipHE_LIKE, t_punch::ipPunConv, iso, iteration, t_conv::lgAutoIt, t_dense::lgElmtOn, t_punch::lgPunConv, LIMELM, NISO, t_iso::nLyaLevel, punch, rt, TotalInsanity(), and Transitions.

Referenced by cloudy().

Here is the call graph for this function:

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 conv, ConvFail(), ConvTempEdenIoniz(), DEBUG_ENTRY, dense, t_dense::eden, fnzone, t_dense::gas_phase, GrainDrift(), gv, ioQQQ, ipHYDROGEN, iteration, lgAbort, lgConvEden(), t_conv::lgConvEden, t_conv::lgConvIoniz, t_conv::lgConvPops, t_conv::lgConvPres, lgConvTemp(), t_conv::lgConvTemp, t_gv::lgDustOn, t_gv::lgGrainPhysicsOn, t_pressure::lgPressureInitialSpecified, LOOPMAX, MAX2, 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, TorF(), and trace.

Referenced by AGN_Hemis(), cloudy(), and ConvInitSolution().

Here is the call graph for this function:

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 52 of file conv_temp_eden_ioniz.cpp.

References cdEXIT, t_conv::chSolverTemp, colden, t_colden::colden, conv, ConvEdenIoniz(), CoolHeatError(), t_thermal::ctot, t_thermal::dCooldT, DEBUG_ENTRY, dense, t_thermal::dHeatdT, t_thermal::dTemper, t_dense::eden, t_dense::gas_phase, h2, t_hmi::H2_total, t_conv::HeatCoolRelErrorAllowed, t_hmi::HeatH2Dexc_BigH2, hmi, t_thermal::htot, hydro, ioQQQ, ipCOL_HTOT, ipH_LIKE, ipHYDROGEN, iso, lgAbort, t_conv::lgCmHOsc, t_conv::lgConvEden, t_conv::lgConvIoniz, lgConvTemp(), t_conv::lgConvTemp, t_h2::lgH2ON, t_hydro::lgHColionImp, t_conv::lgOscilOTS, t_thermal::lgTeBD96, t_thermal::lgTemperatureConstant, t_thermal::lgTeSN99, t_thermal::lgTLaw, t_conv::lgTOscl, t_trace::lgTrace, t_thermal::lgUnstable, LIMDEF, MakeDeriv(), MAX2, MIN2, t_trace::nTrConvg, nzone, phycon, PresTotCurrent(), PutHetCol(), t_iso::RecomCollisFrac, ShowMe(), t_thermal::SigmaBD96, sign(), t_thermal::T0BD96, t_thermal::T0SN99, t_phycon::te, TeBrent(), TempChange(), thermal, t_thermal::thist, t_thermal::tlowst, TotalInsanity(), trace, USENUMER, and t_dense::xIonDense.

Referenced by ConvInitSolution(), and ConvPresTempEdenIoniz().

Here is the call graph for this function:

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, co, COmole, t_co::comole_eden, conv, DEBUG_ENTRY, dense, t_dense::EdenExtra, t_dense::EdenTrue, molecule::hevmol, hmi, t_hmi::Hmolec, ipHYDROGEN, ipLITHIUM, t_conv::lgSearch, LIMELM, mole, N_H_MOLEC, molecule::nElec, t_hmi::nElectron, t_mole::num_comole_calc, and t_dense::xIonDense.

Referenced by ConvBase().

bool lgConvEden ( void   ) 

returns true if electron density is converged

Definition at line 931 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   ) 

returns true if pressure is converged

fp_equal( radius.depth, rsave ) &&

Definition at line 336 of file pressure_change.cpp.

References t_wind::AccelCont, t_wind::AccelGravity, t_wind::AccelLine, t_wind::AccelPres, t_wind::AccelTot, ASSERT, cdEXIT, t_dense::cfirst, t_dense::chDenseLaw, colden, t_colden::colden, conv, t_dense::csecnd, da(), t_dynamics::dDensityDT, DEBUG_ENTRY, t_dense::den0, dense, dense_fabden(), dense_tabden(), t_dense::DensityPower, t_radius::depth, t_radius::drad, t_radius::drNext, dynamics, DynaPresChngFactor(), t_wind::emdot, t_dense::flcPhase, t_dense::flong, t_dense::gas_phase, t_radius::glbden, t_radius::glbdst, t_radius::glbpow, t_radius::glbrad, ioQQQ, ipCOL_HTOT, ipHYDROGEN, t_pressure::lgContRadPresOn, t_conv::lgConvPres, t_dense::lgDenFlucRadius, t_dense::lgDenseInitConstant, t_wind::lgDisk, t_dynamics::lgStatic, t_trace::lgTrace, t_wind::lgVelPos, t_trace::lgWind, nzone, POW2, t_pressure::pres_radiation_lines_curr, 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, radius, t_radius::Radius, t_radius::rinner, t_dense::rscale, ShowMe(), struc, TorF(), TotalInsanity(), trace, wind, t_wind::windv, t_struc::windv, and t_dense::xMassDensity.

Referenced by PressureChange().

Here is the call graph for this function:

bool lgConvTemp ( void   ) 

returns true if heating-cooling is converged

Definition at line 809 of file conv_temp_eden_ioniz.cpp.

References conv, t_thermal::ctot, DEBUG_ENTRY, t_conv::HeatCoolRelErrorAllowed, t_thermal::htot, t_conv::lgConvTemp, t_thermal::lgTemperatureConstant, phycon, t_phycon::te, t_phycon::TEMP_LIMIT_LOW, and thermal.

Referenced by ConvPresTempEdenIoniz(), and ConvTempEdenIoniz().

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(), conv, DEBUG_ENTRY, dense, t_radius::depth, t_dense::eden, t_dense::gas_phase, 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, ioQQQ, ipHYDROGEN, t_abund::lgAbTaON, t_abund::lgAbunTabl, t_conv::lgConvPres, lgConvPres(), LIMELM, MALLOC, MAX2, MIN2, t_conv::nTotalIoniz, nzone, t_pressure::pres_radiation_lines_curr, t_pressure::PresGasCurr, pressure, pressure_change_factor, PresTotCurrent(), t_pressure::PresTotlCorrect, t_pressure::PresTotlCurr, radius, t_radius::Radius, REALLOC, and t_dense::xIonDense.

Referenced by ConvPresTempEdenIoniz().

Here is the call graph for this function:


Variable Documentation

EXTERN struct t_conv conv

the variables that deal with the convergence of the model

Referenced by advection_set_detault(), atmol_popsolve(), cdNwcns(), ChargTranEval(), ConvBase(), ConvEdenIoniz(), ConvFail(), ConvInitSolution(), ConvIoniz(), ConvIterCheck(), ConvPresTempEdenIoniz(), ConvTempEdenIoniz(), CoolDima(), CoolEvaluate(), eden_sum(), Fe2_cooling(), GrainCharge(), GrainChargeTemp(), GrainDrive(), grid_do(), H2_LevelPops(), hmole(), hmole_reactions(), ion_photo(), ion_solver(), ion_trim(), IonHelium(), IonNitro(), iso_collide(), iso_radiative_recomb(), lgCheckAsserts(), lgConvEden(), lgConvPres(), lgConvTemp(), lgCoolHeatCheckConverge(), lgIonizConverg(), MyAssert(), ParseSet(), PressureChange(), PresTotCurrent(), PrtComment(), PrtZone(), radius_increment(), RT_DestProb(), RT_line_all(), RT_line_one(), RT_line_static(), RT_OTS_PrtRate(), ShowMe(), TeBrent(), vib_evap(), and zero().


Generated on Mon Feb 16 12:04:30 2009 for cloudy by  doxygen 1.4.7