Cloudy
Spectral Synthesis Code for Astrophysics
|
#include "cddefines.h"
#include "cddrive.h"
#include "struc.h"
#include "colden.h"
#include "radius.h"
#include "stopcalc.h"
#include "hextra.h"
#include "iterations.h"
#include "conv.h"
#include "timesc.h"
#include "dense.h"
#include "mole.h"
#include "thermal.h"
#include "pressure.h"
#include "phycon.h"
#include "wind.h"
#include "iso.h"
#include "dynamics.h"
#include "cosmology.h"
#include "parser.h"
#include "rfield.h"
#include "container_classes.h"
#include "save.h"
#include "trace.h"
Macros | |
#define | MERGE 0 |
Functions | |
STATIC void | DynaNewStep (void) |
STATIC void | DynaSaveLast (void) |
STATIC bool | lgNeedTimestep () |
STATIC void | InitDynaTimestep () |
STATIC void | save_DT (double dtime, double this_fact, string &reason) |
STATIC double | timestep_next (void) |
void | DynaIonize (void) |
void | DynaStartZone (void) |
void | DynaEndZone (void) |
void | DynaIterEnd (void) |
realnum | DynaFlux (double depth) |
void | DynaCreateArrays () |
STATIC void | advection_set_default (bool lgWind) |
void | ParseDynaTime (Parser &p) |
void | ParseDynaWind (Parser &p) |
void | DynaPrtZone (void) |
void | DynaPunchTimeDep (FILE *ipPnunit, const char *chJob) |
void | DynaSave (FILE *ipPnunit, char chJob) |
void | DynaIterStart (void) |
Variables | |
static const bool | lgPrintDynamics = false |
t_dynamics | dynamics |
static int | ipUpstream =-1 |
static int | iphUpstream =-1 |
static int | ipyUpstream =-1 |
static multi_arr< double, 2 > | UpstreamIon |
static multi_arr< double, 3 > | UpstreamStatesElem |
static vector< double > | UpstreamElem |
static vector< double > | Upstream_molecules |
static vector< double > | time_elapsed_time |
static vector< double > | time_flux_ratio |
static vector< double > | time_dt |
static vector< double > | time_dt_scale_factor |
static bool | lgtime_dt_specified |
static vector< int > | lgtime_Recom |
static const int | NTIME = 200 |
static long int | nTime_flux =0 |
static double | Dyn_dr |
static double | AdvecSpecificEnthalpy |
static vector< double > | Old_depth |
static vector< realnum > | Old_histr |
static vector< realnum > | Old_xLyman_depth |
static vector< realnum > | Old_hiistr |
static vector< realnum > | Old_pressure |
static vector< realnum > | Old_density |
static vector< realnum > | Old_DenMass |
static vector< realnum > | EnthalpyDensity |
static vector< realnum > | Old_ednstr |
static vector< realnum > | Old_EnthalpyDensity |
static multi_arr< realnum, 2 > | Old_molecules |
static multi_arr< realnum, 3 > | Old_xIonDense |
static multi_arr< realnum, 2 > | Old_gas_phase |
static multi_arr< realnum, 4 > | Old_StatesElem |
static long int | nOld_zone |
#define MERGE 0 |
Referenced by t_dynamics::Cool(), and t_dynamics::Heat().
STATIC void advection_set_default | ( | bool | lgWind | ) |
References conv, DEBUG_ENTRY, t_conv::EdenErrorAllowed, t_conv::HeatCoolRelErrorAllowed, t_dynamics::lgAdvection, t_thermal::lgPredNextTe, t_pressure::lgPres_magnetic_ON, t_pressure::lgPres_radiation_ON, t_pressure::lgPres_ram_ON, pressure, t_conv::PressureErrorAllowed, and thermal.
Referenced by InitDynaTimestep(), ParseDynaTime(), and ParseDynaWind().
void DynaCreateArrays | ( | void | ) |
DynaCreateArrays allocate some space needed to save the dynamics structure variables, called from atmdat_readin
References multi_arr< T, d, ALLOC, lgBC >::alloc(), multi_arr< T, d, ALLOC, lgBC >::clone(), DEBUG_ENTRY, dense, EnthalpyDensity, fixit, ipHYDROGEN, iso_sp, t_dense::lgElmtOn, LIMELM, mole_global, t_dynamics::molecules, NISO, t_mole_global::num_calc, t_struc::nzlim, Old_DenMass, Old_density, Old_depth, Old_ednstr, Old_EnthalpyDensity, Old_hiistr, Old_histr, Old_pressure, Old_xLyman_depth, t_dynamics::oldFullDepth, t_dynamics::Rate, multi_arr< T, d, ALLOC, lgBC >::reserve(), t_dynamics::Source, t_dynamics::StatesElem, struc, Upstream_molecules, and UpstreamElem.
Referenced by atmdat_readin().
void DynaEndZone | ( | void | ) |
DynaEndZone called at end of iteration when advection is turned on
References DEBUG_ENTRY, t_radius::depth, t_dynamics::DivergePresInteg, t_radius::drad, DynaFlux(), fprintf(), ioQQQ, t_dynamics::lgTracePrint, radius, wind, and Wind::windv.
Referenced by ZoneEnd().
realnum DynaFlux | ( | double | depth | ) |
References DEBUG_ENTRY, dense, t_dynamics::FluxCenter, t_dynamics::FluxIndex, t_dynamics::FluxScale, t_dynamics::lgFluxDScale, pow(), and t_dense::xMassDensity0.
Referenced by DynaEndZone(), PresTotCurrent(), and stepDensity().
void DynaIonize | ( | void | ) |
DynaIonize, called from ionize to evaluate advective terms for current conditions
References AdvecSpecificEnthalpy, ASSERT, t_dynamics::Cool_r, DEBUG_ENTRY, dense, t_radius::depth, t_dynamics::dHeatdT, Dyn_dr, t_phycon::EnthalpyDensity, EnthalpyDensity, fprintf(), t_dense::gas_phase, t_dynamics::Heat_v, t_thermal::htot, t_dense::IonHigh, t_dense::IonLow, ioQQQ, ipCARBON, ipH_LIKE, ipHYDROGEN, ipUpstream, t_dynamics::isInitialRelaxIteration(), iso_sp, iteration, t_dynamics::lgCoolHeat, t_dense::lgElmtOn, t_dynamics::lgTimeDependentStatic, t_dynamics::lgTracePrint, LIMELM, mole_global, t_dynamics::molecules, NISO, t_mole_global::num_calc, t_iso_sp::numLevels_local, t_struc::nzlim, nzone, Old_depth, t_dynamics::oldFullDepth, phycon, POW2, t_pressure::PresGasCurr, pressure, radius, t_dynamics::Rate, scalingDensity(), t_dynamics::Source, t_dynamics::StatesElem, struc, t_phycon::te, thermal, t_dynamics::timestep, Upstream_molecules, UpstreamElem, wind, Wind::windv, t_dense::xIonDense, and t_dense::xMassDensity.
Referenced by ConvBase().
void DynaIterEnd | ( | void | ) |
routine called at end of iteration when advection is turned on
References t_dynamics::AdvecLengthInit, ASSERT, t_thermal::ConstTemp, t_dynamics::Cool(), cosmology, t_thermal::ctot, DEBUG_ENTRY, t_radius::depth, t_dynamics::discretization_error, t_dynamics::DivergePresInteg, t_radius::dr_max_last_iter, Dyn_dr, DynaNewStep(), DynaSaveLast(), t_dynamics::error_scale2, fprintf(), GetHubbleFactor(), InitDynaTimestep(), ioQQQ, iphUpstream, ipUpstream, ipyUpstream, t_dynamics::isInitialRelaxIteration(), t_iterations::iter_alloc, iteration, iterations, t_dynamics::lg_coronal_time_init, t_cosmology::lgDo, lgNeedTimestep(), lgPrintDynamics, t_dynamics::lgRecom, t_radius::lgSdrmaxRel, Wind::lgStatic(), t_dynamics::lgStatic_completed, t_thermal::lgTemperatureConstant, lgtime_dt_specified, lgtime_Recom, t_dynamics::lgTimeDependentStatic, t_dynamics::lgTracePrint, t_dynamics::n_initial_relax, nTime_flux, phycon, t_pressure::PresGasCurr, pressure, radius, t_cosmology::redshift_current, t_cosmology::redshift_step, rfield, scalingDensity(), t_radius::sdrmax, StopCalc, t_iterations::StopThickness, t_phycon::te, t_StopCalc::TempHiStopIteration, t_StopCalc::TempLoStopIteration, thermal, t_rfield::time_continuum_scale, time_dt, time_dt_scale_factor, t_dynamics::time_elapsed, time_elapsed_time, t_dynamics::timestep, t_dynamics::timestep_factor, timestep_next(), t_dynamics::timestep_stop, wind, and Wind::windv0.
Referenced by IterRestart().
void DynaIterStart | ( | void | ) |
routine called at start of iteration when advection is turned on
References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), hextra, ioQQQ, t_dynamics::isInitialRelaxIteration(), iteration, lgPrintDynamics, t_dynamics::lgRecom, t_dynamics::lgStatic_completed, t_rfield::lgTimeVary, t_hextra::lgTurbHeatVaryTime, linint(), t_rfield::nShape, nTime_flux, rfield, t_rfield::time_continuum_scale, t_dynamics::time_elapsed, time_elapsed_time, time_flux_ratio, t_dynamics::timestep, t_hextra::TurbHeat, and t_hextra::TurbHeatSave.
Referenced by IterStart().
STATIC void DynaNewStep | ( | void | ) |
References ASSERT, BIGFLOAT, t_dynamics::convergence_error, t_dynamics::convergence_tolerance, DEBUG_ENTRY, dense, t_struc::depth, t_dynamics::discretization_error, Dyn_dr, t_dynamics::error_scale1, t_dynamics::error_scale2, fprintf(), ioQQQ, ipH_LIKE, ipHYDROGEN, iso_sp, t_dense::lgElmtOn, LIMELM, mole_global, t_struc::molecules, NISO, nOld_zone, t_mole_global::num_calc, t_iso_sp::numLevels_local, t_struc::nzlim, nzone, Old_density, Old_depth, POW2, scalingZoneDensity(), SMALLFLOAT, t_struc::StatesElem, struc, and t_struc::xIonDense.
Referenced by DynaIterEnd().
void DynaPrtZone | ( | void | ) |
DynaPrtZone - called to print zone results
References AdvecSpecificEnthalpy, ASSERT, t_dynamics::Cool(), t_thermal::ctot, DEBUG_ENTRY, dense, t_phycon::EnergyBinding, t_phycon::EnergyExcitation, t_phycon::EnergyIonization, EnthalpyDensity, fprintf(), t_dynamics::Heat(), ioQQQ, t_struc::nzlim, nzone, phycon, POW2, t_pressure::PresGasCurr, pressure, scalingDensity(), t_timesc::sound_speed_adiabatic, struc, thermal, timesc, wind, Wind::windv, and t_dense::xMassDensity.
Referenced by PrtZone().
void DynaPunchTimeDep | ( | FILE * | ipPnunit, |
const char * | chJob | ||
) |
DynaPunchTimeDep - save info about time dependent solution
ipPnunit | |
*chJob |
References cdIonFrac(), cdTemp(), colden, t_colden::colden, column(), cosmology, DEBUG_ENTRY, dense, t_dense::eden, findspecieslocal(), fprintf(), t_dense::gas_phase, ipCOL_HTOT, ipHYDROGEN, t_cosmology::redshift_current, rfield, scalingDensity(), SDIV(), t_rfield::time_continuum_scale, t_dynamics::time_elapsed, t_dynamics::timestep, and TotalInsanity().
Referenced by SaveDo().
void DynaSave | ( | FILE * | ipPnunit, |
char | chJob | ||
) |
DynaSave save info related to advection
ipPnunit | |
chJob |
References AdvecSpecificEnthalpy, t_dynamics::Cool(), t_dynamics::dCooldT(), DEBUG_ENTRY, t_radius::depth_mid_zone, t_phycon::EnthalpyDensity, fprintf(), t_dynamics::Heat(), t_thermal::htot, ipHYDROGEN, phycon, radius, t_dynamics::Rate, scalingDensity(), t_dynamics::Source, thermal, and TotalInsanity().
Referenced by SaveDo().
STATIC void DynaSaveLast | ( | void | ) |
References ASSERT, DEBUG_ENTRY, t_struc::DenMass, dense, t_struc::depth, t_struc::ednstr, EnthalpyDensity, t_dense::gas_phase, t_struc::hiistr, t_struc::histr, ipH_LIKE, ipHYDROGEN, isnan, iso_sp, t_dense::lgElmtOn, LIMELM, mole_global, t_struc::molecules, NISO, nOld_zone, t_mole_global::num_calc, t_iso_sp::numLevels_max, t_struc::nzlim, nzone, Old_DenMass, Old_density, Old_depth, Old_ednstr, Old_EnthalpyDensity, Old_hiistr, Old_histr, Old_pressure, Old_xLyman_depth, t_dynamics::oldFullDepth, t_struc::pressure, scalingZoneDensity(), t_struc::StatesElem, struc, t_struc::xIonDense, and t_struc::xLyman_depth.
Referenced by DynaIterEnd().
void DynaStartZone | ( | void | ) |
DynaStartZone called at start of iteration when advection is turned on
References AdvecSpecificEnthalpy, ASSERT, BIGFLOAT, DEBUG_ENTRY, dense, t_radius::depth, t_dynamics::discretization_error, t_dynamics::dRad, Dyn_dr, t_dynamics::error_scale2, fp_bound(), fprintf(), ioQQQ, ipH_LIKE, iphUpstream, ipHYDROGEN, ipUpstream, ipyUpstream, isnan, iso_sp, iteration, t_dense::lgElmtOn, t_dynamics::lgTracePrint, LIMELM, t_mole_global::list, MAX2, MIN2, mole, mole_global, NISO, nOld_zone, NULL, t_mole_global::num_calc, t_iso_sp::numLevels_max, nzone, Old_density, Old_depth, Old_EnthalpyDensity, POW2, radius, t_dynamics::Rate, scalingDensity(), SMALLFLOAT, t_dynamics::Source, t_mole_local::species, t_dynamics::Upstream_density, Upstream_molecules, and UpstreamElem.
Referenced by ZoneStart().
STATIC void InitDynaTimestep | ( | ) |
References advection_set_default(), t_timesc::calc_therm_timesc(), DEBUG_ENTRY, Wind::setStatic(), t_timesc::time_therm_short, timesc, t_dynamics::timestep, t_dynamics::timestep_init, wind, Wind::windv, and Wind::windv0.
Referenced by DynaIterEnd().
STATIC bool lgNeedTimestep | ( | ) |
References DEBUG_ENTRY, t_dynamics::lgRecom, t_dynamics::lgTimeDependentStatic, and t_dynamics::timestep_init.
Referenced by DynaIterEnd().
void ParseDynaTime | ( | Parser & | p | ) |
ParseDynaTime parse the time command, called from ParseCommands, in dynamics.c
*chCard |
References advection_set_default(), ASSERT, cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), Parser::getline(), Parser::getNumberCheckAlwaysLog(), Parser::getNumberCheckAlwaysLogLim(), Parser::getNumberDefaultAlwaysLog(), Parser::hasCommand(), ioQQQ, lgPrintDynamics, lgtime_dt_specified, lgtime_Recom, t_dynamics::lgTimeDependentStatic, t_dynamics::lgTracePrint, Parser::m_lgEOF, Parser::nMatch(), NTIME, nTime_flux, Wind::setStatic(), time_dt, time_dt_scale_factor, time_elapsed_time, time_flux_ratio, t_dynamics::timestep, t_dynamics::timestep_init, t_dynamics::timestep_stop, wind, Wind::windv, and Wind::windv0.
Referenced by ParseCommands().
void ParseDynaWind | ( | Parser & | p | ) |
References advection_set_default(), BIGDOUBLE, cdEXIT, t_dense::chDenseLaw, Wind::comass, DEBUG_ENTRY, dense, EXIT_FAILURE, t_dynamics::FluxCenter, t_dynamics::FluxIndex, t_dynamics::FluxScale, fprintf(), Parser::getNumberCheck(), Parser::getNumberDefault(), Parser::getNumberPlain(), ioQQQ, t_pressure::lgContRadPresOn, Wind::lgDisk, t_dynamics::lgFluxDScale, t_dynamics::lgTracePrint, Wind::lgWindOK, Parser::nMatch(), pow(), pressure, Wind::setBallistic(), Wind::setDefault(), Wind::setStatic(), wind, Wind::windv, and Wind::windv0.
Referenced by ParseCommands().
STATIC void save_DT | ( | double | dtime, |
double | this_fact, | ||
string & | reason | ||
) |
References cdTemp(), t_save::chHashString, fprintf(), t_save::ipDTout, iteration, iterations, t_trace::lgDrBug, t_save::lgDTHash, t_save::lgDTOn, t_save::lgDTPLst, t_iterations::lgLastIt, t_trace::lgTrace, t_dynamics::n_initial_relax, save, t_dynamics::time_elapsed, TotalInsanity(), and trace.
Referenced by timestep_next().
STATIC double timestep_next | ( | void | ) |
References cdTemp(), DEBUG_ENTRY, fprintf(), ioQQQ, lgPrintDynamics, t_dynamics::lgRecom, save_DT(), SDIV(), t_dynamics::timestep, t_dynamics::timestep_init, and TotalInsanity().
Referenced by DynaIterEnd().
|
static |
Referenced by DynaIonize(), DynaPrtZone(), DynaSave(), DynaStartZone(), and t_dynamics::zero().
|
static |
Referenced by DynaIonize(), DynaIterEnd(), DynaNewStep(), and DynaStartZone().
t_dynamics dynamics |
Referenced by AbundChange(), check_grid_file(), cloudy(), ConserveEnergy(), ConvBase(), ConvInitSolution(), ConvIterCheck(), CoolEvaluate(), CoolSave(), funjac(), HomogeneousSource(), InitDefaultsPreparse(), ion_trim2(), iso_level(), IterEnd(), IterRestart(), IterStart(), lines_general(), matchGeneric(), mole_eval_dynamic_balance(), Atom_LevelN::operator()(), ParseCoronal(), ParseDont(), ParseSet(), pressureZone(), PresTotCurrent(), PrintRates(), PrintSpectrum(), PrtComment(), PrtZone(), radius_first(), radius_increment(), radius_next(), SaveDo(), SaveHeat(), PresMode::set(), stepDensity(), ZoneEnd(), and ZoneStart().
|
static |
Referenced by DynaCreateArrays(), DynaIonize(), DynaPrtZone(), and DynaSaveLast().
|
static |
Referenced by DynaIterEnd(), and DynaStartZone().
|
static |
Referenced by DynaIonize(), DynaIterEnd(), and DynaStartZone().
|
static |
Referenced by DynaIterEnd(), and DynaStartZone().
|
static |
Referenced by DynaIterEnd(), DynaIterStart(), ParseDynaTime(), and timestep_next().
|
static |
Referenced by DynaIterEnd(), and ParseDynaTime().
|
static |
Referenced by DynaIterEnd(), and ParseDynaTime().
|
static |
Referenced by DynaNewStep(), DynaSaveLast(), DynaStartZone(), and t_dynamics::zero().
|
static |
Referenced by ParseDynaTime().
|
static |
Referenced by DynaIterEnd(), DynaIterStart(), and ParseDynaTime().
|
static |
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Referenced by DynaCreateArrays(), DynaNewStep(), DynaSaveLast(), and DynaStartZone().
|
static |
Referenced by DynaCreateArrays(), DynaIonize(), DynaNewStep(), DynaSaveLast(), and DynaStartZone().
|
static |
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Referenced by DynaCreateArrays(), DynaSaveLast(), and DynaStartZone().
|
static |
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Referenced by DynaIterEnd(), and ParseDynaTime().
|
static |
Referenced by DynaIterEnd(), and ParseDynaTime().
|
static |
Referenced by DynaIterEnd(), DynaIterStart(), and ParseDynaTime().
|
static |
Referenced by DynaIterStart(), and ParseDynaTime().
|
static |
Referenced by DynaCreateArrays(), DynaIonize(), and DynaStartZone().
|
static |
Referenced by DynaCreateArrays(), DynaIonize(), and DynaStartZone().
|
static |
|
static |