cloudy
trunk
|
#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"
Go to the source code of this file.
Macros | |
#define | NTIME 200 |
#define | MERGE 0 |
Functions | |
STATIC void | DynaNewStep (void) |
STATIC void | DynaSaveLast (void) |
STATIC bool | lgNeedTimestep () |
STATIC void | InitDynaTimestep () |
STATIC double | timestep_next (void) |
void | DynaIonize (void) |
void | DynaStartZone (void) |
void | DynaEndZone (void) |
void | DynaIterEnd (void) |
realnum | DynaFlux (double depth) |
void | DynaCreateArrays (void) |
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 double ** | UpstreamIon |
static double *** | 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 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 realnum ** | Old_molecules |
static realnum *** | Old_xIonDense |
static realnum ** | Old_gas_phase |
static realnum **** | Old_StatesElem |
static long int | nOld_zone |
#define MERGE 0 |
Definition at line 2192 of file dynamics.cpp.
Referenced by t_dynamics::Cool(), and t_dynamics::Heat().
#define NTIME 200 |
Definition at line 76 of file dynamics.cpp.
Referenced by ParseDynaTime().
STATIC void advection_set_default | ( | bool | lgWind | ) |
Definition at line 1602 of file dynamics.cpp.
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
Definition at line 1400 of file dynamics.cpp.
References DEBUG_ENTRY, dense, EnthalpyDensity, fixit, ipH_LIKE, ipHYDROGEN, iso_sp, t_dense::lgElmtOn, LIMELM, MALLOC, mole_global, t_dynamics::molecules, NISO, t_mole_global::num_calc, t_iso_sp::numLevels_max, t_struc::nzlim, Old_DenMass, Old_density, Old_depth, Old_ednstr, Old_EnthalpyDensity, Old_gas_phase, Old_hiistr, Old_histr, Old_molecules, Old_pressure, Old_StatesElem, Old_xIonDense, Old_xLyman_depth, t_dynamics::oldFullDepth, t_dynamics::Rate, t_dynamics::Source, t_dynamics::StatesElem, struc, Upstream_molecules, UpstreamElem, UpstreamIon, and UpstreamStatesElem.
Referenced by atmdat_readin().
void DynaEndZone | ( | void | ) |
DynaEndZone called at end of iteration when advection is turned on
Definition at line 835 of file dynamics.cpp.
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 | ) |
Definition at line 1292 of file dynamics.cpp.
References DEBUG_ENTRY, dense, t_dynamics::FluxCenter, t_dynamics::FluxIndex, t_dynamics::FluxScale, t_dynamics::lgFluxDScale, and t_dense::xMassDensity0.
Referenced by DynaEndZone(), PresTotCurrent(), and stepDensity().
void DynaIonize | ( | void | ) |
DynaIonize, called from ionize to evaluate advective terms for current conditions
Definition at line 160 of file dynamics.cpp.
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, iso_sp, iteration, t_dynamics::lgCoolHeat, t_dense::lgElmtOn, t_dynamics::lgTimeDependentStatic, t_dynamics::lgTracePrint, LIMELM, mole_global, t_dynamics::molecules, t_dynamics::n_initial_relax, NISO, t_mole_global::num_calc, t_iso_sp::numLevels_local, t_struc::nzlim, nzone, Old_depth, Old_xIonDense, 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, UpstreamIon, UpstreamStatesElem, 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
Definition at line 856 of file dynamics.cpp.
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_iterations::iter_malloc, 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
Definition at line 2227 of file dynamics.cpp.
References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, fprintf(), hextra, ioQQQ, iteration, lgPrintDynamics, t_dynamics::lgRecom, t_dynamics::lgStatic_completed, t_rfield::lgTimeVary, t_hextra::lgTurbHeatVaryTime, linint(), t_dynamics::n_initial_relax, 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 | ) |
Definition at line 1100 of file dynamics.cpp.
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(), t_struc::hden, 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, Old_molecules, Old_StatesElem, Old_xIonDense, POW2, scalingZoneDensity(), SMALLFLOAT, t_struc::StatesElem, struc, and t_struc::xIonDense.
Referenced by DynaIterEnd().
void DynaPrtZone | ( | void | ) |
DynaPrtZone - called to print zone results
Definition at line 2029 of file dynamics.cpp.
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 |
Definition at line 2059 of file dynamics.cpp.
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 |
Definition at line 2168 of file dynamics.cpp.
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 | ) |
Definition at line 1232 of file dynamics.cpp.
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_gas_phase, Old_hiistr, Old_histr, Old_molecules, Old_pressure, Old_StatesElem, Old_xIonDense, 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
Definition at line 377 of file dynamics.cpp.
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, t_mole_global::num_calc, t_iso_sp::numLevels_max, nzone, Old_density, Old_depth, Old_EnthalpyDensity, Old_molecules, Old_StatesElem, Old_xIonDense, POW2, radius, t_dynamics::Rate, scalingDensity(), SMALLFLOAT, t_dynamics::Source, t_mole_local::species, t_dynamics::Upstream_density, Upstream_molecules, UpstreamElem, UpstreamIon, and UpstreamStatesElem.
Referenced by ZoneStart().
STATIC void InitDynaTimestep | ( | ) |
Definition at line 1652 of file dynamics.cpp.
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 | ( | ) |
Definition at line 1642 of file dynamics.cpp.
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 |
Definition at line 1671 of file dynamics.cpp.
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 | ) |
Definition at line 1818 of file dynamics.cpp.
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(), pressure, Wind::setBallistic(), Wind::setDefault(), Wind::setStatic(), wind, Wind::windv, and Wind::windv0.
Referenced by ParseCommands().
STATIC double timestep_next | ( | void | ) |
Definition at line 137 of file dynamics.cpp.
References DEBUG_ENTRY, fprintf(), ioQQQ, lgPrintDynamics, t_dynamics::lgRecom, t_timesc::time_therm_short, timesc, t_dynamics::timestep, and t_dynamics::timestep_init.
Referenced by DynaIterEnd().
|
static |
Definition at line 94 of file dynamics.cpp.
Referenced by DynaIonize(), DynaPrtZone(), DynaSave(), DynaStartZone(), and t_dynamics::zero().
|
static |
Definition at line 91 of file dynamics.cpp.
Referenced by DynaIonize(), DynaIterEnd(), DynaNewStep(), and DynaStartZone().
t_dynamics dynamics |
Definition at line 42 of file dynamics.cpp.
Referenced by AbundChange(), check_grid_file(), cloudy(), ConvBase(), ConvInitSolution(), ConvIterCheck(), CoolEvaluate(), CoolSave(), funjac(), HomogeneousSource(), InitDefaultsPreparse(), ion_trim2(), iso_level(), IterEnd(), IterRestart(), IterStart(), lgConserveEnergy(), 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 |
Definition at line 100 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaIonize(), DynaPrtZone(), and DynaSaveLast().
|
static |
Definition at line 43 of file dynamics.cpp.
Referenced by DynaIterEnd(), and DynaStartZone().
|
static |
Definition at line 43 of file dynamics.cpp.
Referenced by DynaIonize(), DynaIterEnd(), and DynaStartZone().
|
static |
Definition at line 43 of file dynamics.cpp.
Referenced by DynaIterEnd(), and DynaStartZone().
|
static |
Definition at line 40 of file dynamics.cpp.
Referenced by DynaIterEnd(), DynaIterStart(), ParseDynaTime(), and timestep_next().
|
static |
Definition at line 74 of file dynamics.cpp.
Referenced by DynaIterEnd(), and ParseDynaTime().
|
static |
Definition at line 75 of file dynamics.cpp.
Referenced by DynaIterEnd(), and ParseDynaTime().
|
static |
Definition at line 130 of file dynamics.cpp.
Referenced by DynaNewStep(), DynaSaveLast(), DynaStartZone(), and t_dynamics::zero().
|
static |
Definition at line 79 of file dynamics.cpp.
Referenced by DynaIterEnd(), DynaIterStart(), and ParseDynaTime().
|
static |
Definition at line 100 of file dynamics.cpp.
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Definition at line 100 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaNewStep(), DynaSaveLast(), and DynaStartZone().
|
static |
Definition at line 97 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaIonize(), DynaNewStep(), DynaSaveLast(), and DynaStartZone().
|
static |
Definition at line 100 of file dynamics.cpp.
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Definition at line 100 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaSaveLast(), and DynaStartZone().
|
static |
Definition at line 124 of file dynamics.cpp.
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Definition at line 100 of file dynamics.cpp.
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Definition at line 100 of file dynamics.cpp.
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Definition at line 118 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaNewStep(), DynaSaveLast(), and DynaStartZone().
|
static |
Definition at line 100 of file dynamics.cpp.
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Definition at line 127 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaNewStep(), DynaSaveLast(), and DynaStartZone().
|
static |
Definition at line 121 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaIonize(), DynaNewStep(), DynaSaveLast(), and DynaStartZone().
|
static |
Definition at line 100 of file dynamics.cpp.
Referenced by DynaCreateArrays(), and DynaSaveLast().
|
static |
Definition at line 70 of file dynamics.cpp.
Referenced by DynaIterEnd(), and ParseDynaTime().
|
static |
Definition at line 70 of file dynamics.cpp.
Referenced by DynaIterEnd(), and ParseDynaTime().
|
static |
Definition at line 70 of file dynamics.cpp.
Referenced by DynaIterEnd(), DynaIterStart(), and ParseDynaTime().
|
static |
Definition at line 70 of file dynamics.cpp.
Referenced by DynaIterStart(), and ParseDynaTime().
|
static |
Definition at line 64 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaIonize(), and DynaStartZone().
|
static |
Definition at line 61 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaIonize(), and DynaStartZone().
|
static |
Definition at line 58 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaIonize(), and DynaStartZone().
|
static |
Definition at line 59 of file dynamics.cpp.
Referenced by DynaCreateArrays(), DynaIonize(), and DynaStartZone().