Cloudy
Spectral Synthesis Code for Astrophysics
Loading...
Searching...
No Matches
dynamics.cpp File Reference
#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"
Include dependency graph for dynamics.cpp:

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< realnumOld_histr
 
static vector< realnumOld_xLyman_depth
 
static vector< realnumOld_hiistr
 
static vector< realnumOld_pressure
 
static vector< realnumOld_density
 
static vector< realnumOld_DenMass
 
static vector< realnumEnthalpyDensity
 
static vector< realnumOld_ednstr
 
static vector< realnumOld_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
 

Macro Definition Documentation

◆ MERGE

#define MERGE   0

Function Documentation

◆ advection_set_default()

STATIC void advection_set_default ( bool lgWind)

◆ DynaCreateArrays()

void DynaCreateArrays ( void )

◆ DynaEndZone()

void DynaEndZone ( void )

DynaEndZone called at end of iteration when advection is turned on

References DEBUG_ENTRY, DynaFlux(), dynamics, fprintf(), ioQQQ, radius, and wind.

Referenced by ZoneEnd().

Here is the call graph for this function:

◆ DynaFlux()

realnum DynaFlux ( double depth)

References DEBUG_ENTRY, dense, dynamics, and pow().

Referenced by DynaEndZone(), PresTotCurrent(), and stepDensity().

Here is the call graph for this function:

◆ DynaIonize()

void DynaIonize ( void )

DynaIonize, called from ionize to evaluate advective terms for current conditions

References AdvecSpecificEnthalpy, ASSERT, DEBUG_ENTRY, dense, Dyn_dr, dynamics, EnthalpyDensity, fprintf(), ioQQQ, ipCARBON, ipH_LIKE, ipHYDROGEN, ipUpstream, iso_sp, iteration, LIMELM, mole_global, NISO, nzone, Old_depth, Old_xIonDense, phycon, POW2, pressure, radius, scalingDensity(), struc, thermal, Upstream_molecules, UpstreamElem, UpstreamIon, UpstreamStatesElem, and wind.

Referenced by ConvBase().

Here is the call graph for this function:

◆ DynaIterEnd()

◆ DynaIterStart()

void DynaIterStart ( void )

routine called at start of iteration when advection is turned on

References cdEXIT, DEBUG_ENTRY, dynamics, EXIT_FAILURE, fprintf(), hextra, ioQQQ, iteration, lgPrintDynamics, linint(), nTime_flux, rfield, time_elapsed_time, and time_flux_ratio.

Referenced by IterStart().

Here is the call graph for this function:

◆ DynaNewStep()

◆ DynaPrtZone()

void DynaPrtZone ( void )

DynaPrtZone - called to print zone results

References AdvecSpecificEnthalpy, ASSERT, DEBUG_ENTRY, dense, dynamics, EnthalpyDensity, fprintf(), ioQQQ, nzone, phycon, POW2, pressure, scalingDensity(), struc, thermal, timesc, and wind.

Referenced by PrtZone().

Here is the call graph for this function:

◆ DynaPunchTimeDep()

void DynaPunchTimeDep ( FILE * ipPnunit,
const char * chJob )

DynaPunchTimeDep - save info about time dependent solution

Parameters
ipPnunit
*chJob

References cdIonFrac(), cdTemp(), colden, column(), cosmology, DEBUG_ENTRY, dense, dynamics, findspecieslocal(), fprintf(), ipCOL_HTOT, ipHYDROGEN, rfield, scalingDensity(), SDIV(), and TotalInsanity().

Referenced by SaveDo().

Here is the call graph for this function:

◆ DynaSave()

void DynaSave ( FILE * ipPnunit,
char chJob )

DynaSave save info related to advection

Parameters
ipPnunit
chJob

References AdvecSpecificEnthalpy, DEBUG_ENTRY, dynamics, fprintf(), ipHYDROGEN, phycon, radius, scalingDensity(), thermal, and TotalInsanity().

Referenced by SaveDo().

Here is the call graph for this function:

◆ DynaSaveLast()

◆ DynaStartZone()

◆ InitDynaTimestep()

STATIC void InitDynaTimestep ( )

References advection_set_default(), DEBUG_ENTRY, dynamics, STATIC, timesc, and wind.

Referenced by DynaIterEnd().

Here is the call graph for this function:

◆ lgNeedTimestep()

STATIC bool lgNeedTimestep ( )

References DEBUG_ENTRY, dynamics, and STATIC.

Referenced by DynaIterEnd().

◆ ParseDynaTime()

◆ ParseDynaWind()

void ParseDynaWind ( Parser & p)
Todo
2 Need to include divergence terms in pressure balance if flux index is != 0
Todo
2 Need to include divergence terms in pressure balance if flux index is != 0

References advection_set_default(), BIGDOUBLE, cdEXIT, DEBUG_ENTRY, dense, dynamics, EXIT_FAILURE, fprintf(), Parser::getNumberCheck(), Parser::getNumberDefault(), Parser::getNumberPlain(), ioQQQ, Parser::nMatch(), pow(), pressure, and wind.

Referenced by ParseCommands().

Here is the call graph for this function:

◆ save_DT()

STATIC void save_DT ( double dtime,
double this_fact,
string & reason )

References cdTemp(), dynamics, fprintf(), iteration, iterations, save, STATIC, TotalInsanity(), and trace.

Referenced by timestep_next().

Here is the call graph for this function:

◆ timestep_next()

STATIC double timestep_next ( void )

References cdTemp(), DEBUG_ENTRY, dynamics, fprintf(), ioQQQ, lgPrintDynamics, save_DT(), SDIV(), STATIC, and TotalInsanity().

Referenced by DynaIterEnd().

Here is the call graph for this function:

Variable Documentation

◆ AdvecSpecificEnthalpy

double AdvecSpecificEnthalpy
static

◆ Dyn_dr

double Dyn_dr
static

◆ dynamics

◆ EnthalpyDensity

vector<realnum> EnthalpyDensity
static

◆ iphUpstream

int iphUpstream =-1
static

Referenced by DynaIterEnd(), and DynaStartZone().

◆ ipUpstream

int ipUpstream =-1
static

◆ ipyUpstream

int ipyUpstream =-1
static

Referenced by DynaIterEnd(), and DynaStartZone().

◆ lgPrintDynamics

const bool lgPrintDynamics = false
static

◆ lgtime_dt_specified

bool lgtime_dt_specified
static

Referenced by DynaIterEnd(), and ParseDynaTime().

◆ lgtime_Recom

vector<int> lgtime_Recom
static

Referenced by DynaIterEnd(), and ParseDynaTime().

◆ nOld_zone

long int nOld_zone
static

◆ NTIME

const int NTIME = 200
static

Referenced by ParseDynaTime().

◆ nTime_flux

long int nTime_flux =0
static

◆ Old_DenMass

vector<realnum> Old_DenMass
static

Referenced by DynaCreateArrays(), and DynaSaveLast().

◆ Old_density

vector<realnum> Old_density
static

◆ Old_depth

vector<double> Old_depth
static

◆ Old_ednstr

vector<realnum> Old_ednstr
static

Referenced by DynaCreateArrays(), and DynaSaveLast().

◆ Old_EnthalpyDensity

vector<realnum> Old_EnthalpyDensity
static

◆ Old_gas_phase

multi_arr<realnum,2> Old_gas_phase
static

Referenced by DynaCreateArrays(), and DynaSaveLast().

◆ Old_hiistr

vector<realnum> Old_hiistr
static

Referenced by DynaCreateArrays(), and DynaSaveLast().

◆ Old_histr

vector<realnum> Old_histr
static

Referenced by DynaCreateArrays(), and DynaSaveLast().

◆ Old_molecules

multi_arr<realnum,2> Old_molecules
static

◆ Old_pressure

vector<realnum> Old_pressure
static

Referenced by DynaCreateArrays(), and DynaSaveLast().

◆ Old_StatesElem

multi_arr<realnum,4> Old_StatesElem
static

◆ Old_xIonDense

◆ Old_xLyman_depth

vector<realnum> Old_xLyman_depth
static

Referenced by DynaCreateArrays(), and DynaSaveLast().

◆ time_dt

vector<double> time_dt
static

Referenced by DynaIterEnd(), and ParseDynaTime().

◆ time_dt_scale_factor

vector<double> time_dt_scale_factor
static

Referenced by DynaIterEnd(), and ParseDynaTime().

◆ time_elapsed_time

vector<double> time_elapsed_time
static

◆ time_flux_ratio

vector<double> time_flux_ratio
static

Referenced by DynaIterStart(), and ParseDynaTime().

◆ Upstream_molecules

vector<double> Upstream_molecules
static

◆ UpstreamElem

vector<double> UpstreamElem
static

◆ UpstreamIon

multi_arr<double,2> UpstreamIon
static

◆ UpstreamStatesElem

multi_arr<double,3> UpstreamStatesElem
static