The FARGO_THORIN code developer's guide
 All Data Structures Files Functions Variables Typedefs Macros
Macros | Functions | Variables
SourceEuler.c File Reference

Contains routines used by the hydrodynamical loop. More...

#include "fargo.h"
Include dependency graph for SourceEuler.c:

Go to the source code of this file.

Macros

#define CFLSECURITY   0.5 /* Maximum fraction of zone size */
 
#define CVNR   1.41 /* Shocks are spread over CVNR zones: */
 

Functions

boolean DetectCrash (PolarGrid *array)
 
void FillPolar1DArrays ()
 
void InitEuler (PolarGrid *Rho, PolarGrid *Vr, PolarGrid *Vt, PolarGrid *En)
 
real min2 (real a, real b)
 
real max2 (real a, real b)
 
void ActualiseGas (PolarGrid *array, PolarGrid *newarray)
 
void AlgoGas (PolarGrid *Rho, PolarGrid *Vrad, PolarGrid *Vtheta, PolarGrid *Energy, PolarGrid *Label, PlanetarySystem *sys, struct reb_simulation *rsim)
 
void SubStep1 (PolarGrid *Vrad, PolarGrid *Vtheta, PolarGrid *Rho, real dt)
 
void SubStep2 (PolarGrid *Rho, PolarGrid *Energy, real dt)
 
void SubStep3 (PolarGrid *Rho, real dt)
 Numerical step reponsible for the energy update. More...
 
int ConditionCFL (PolarGrid *Vrad, PolarGrid *Vtheta, real deltaT)
 
void ComputeSoundSpeed (PolarGrid *Rho, PolarGrid *Energy)
 Updates the sound speed over the mesh. More...
 
void ComputePressureField (PolarGrid *Rho, PolarGrid *Energy)
 Updates the pressure over the mesh. More...
 
void ComputeTemperatureField (PolarGrid *Rho, PolarGrid *Energy)
 Updates the temperature over the mesh. More...
 

Variables

static PolarGridTemperInt
 
static PolarGridVradNew
 
static PolarGridVradInt
 
static PolarGridVthetaNew
 
static PolarGridVthetaInt
 
static real timeCRASH
 
boolean Corotating
 
static PolarGridEnergyNew
 
static PolarGridEnergyInt
 
static int AlreadyCrashed = 0
 
static int GasTimeStepsCFL
 
int TimeStep
 
boolean FastTransport
 
boolean IsDisk
 

Detailed Description

Contains routines used by the hydrodynamical loop.

More specifically, it contains the main loop itself and all the source term substeps (with the exception of the evaluation of the viscous force). The transport substep is treated elsewhere.

Author
THORIN modifications by Ondřej Chrenko chren.nosp@m.ko@s.nosp@m.irrah.nosp@m..tro.nosp@m.ja.mf.nosp@m.f.cu.nosp@m.ni.cz, Copyright (C) 2017; original code by Frédéric Masset

Definition in file SourceEuler.c.

Macro Definition Documentation

#define CFLSECURITY   0.5 /* Maximum fraction of zone size */

Definition at line 16 of file SourceEuler.c.

Referenced by ConditionCFL().

#define CVNR   1.41 /* Shocks are spread over CVNR zones: */

Definition at line 19 of file SourceEuler.c.

Referenced by ConditionCFL(), and SubStep2().

Function Documentation

void ActualiseGas ( PolarGrid array,
PolarGrid newarray 
)

Definition at line 181 of file SourceEuler.c.

References polargrid::Nrad.

Referenced by AlgoGas().

Here is the caller graph for this function:

void AlgoGas ( PolarGrid Rho,
PolarGrid Vrad,
PolarGrid Vtheta,
PolarGrid Energy,
PolarGrid Label,
PlanetarySystem sys,
struct reb_simulation *  rsim 
)
void ComputePressureField ( PolarGrid Rho,
PolarGrid Energy 
)

Updates the pressure over the mesh.

Definition at line 708 of file SourceEuler.c.

References ADIABIND, EnergyEq, polargrid::Field, Pressure, and SoundSpeed.

Referenced by AlgoGas(), and InitEuler().

Here is the caller graph for this function:

void ComputeSoundSpeed ( PolarGrid Rho,
PolarGrid Energy 
)

Updates the sound speed over the mesh.

Definition at line 683 of file SourceEuler.c.

References ADIABIND, AspectRatio(), EnergyEq, polargrid::Field, FLARINGINDEX, G, globcsvec, mpi_make1Dprofile(), Rmed, and SoundSpeed.

Referenced by AlgoGas(), and InitEuler().

Here is the call graph for this function:

Here is the caller graph for this function:

void ComputeTemperatureField ( PolarGrid Rho,
PolarGrid Energy 
)

Updates the temperature over the mesh.

Definition at line 733 of file SourceEuler.c.

References ADIABIND, EnergyEq, polargrid::Field, GASCONST, MOLWEIGHT, Pressure, and Temperature.

Referenced by AlgoGas(), and InitEuler().

Here is the caller graph for this function:

int ConditionCFL ( PolarGrid Vrad,
PolarGrid Vtheta,
real  deltaT 
)

Definition at line 574 of file SourceEuler.c.

References CFLSECURITY, CPU_Rank, CVNR, debug, FastTransport, polargrid::Field, invdtpeb_sq, invdtreb_sq, InvRmed, MAX1D, max2(), Max_or_active, MaxMO_or_active, min2(), NSEC, polargrid::Nsec, One_or_active, Pebbles, PI, Rinf, Rmed, Rsup, SoundSpeed, YES, and Zero_or_active.

Referenced by AlgoGas().

Here is the call graph for this function:

Here is the caller graph for this function:

boolean DetectCrash ( PolarGrid array)

Definition at line 37 of file SourceEuler.c.

References NO, and YES.

Referenced by AlgoGas().

Here is the caller graph for this function:

void FillPolar1DArrays ( )

Definition at line 57 of file SourceEuler.c.

References CPU_Master, GLOBALNRAD, GlobalRmed, IMIN, InvDiffRmed, InvDiffRsup, InvRinf, InvRmed, InvSurf, LogGrid, mastererr(), NRAD, NSEC, OmegaInv, OUTPUTDIR, PI, prs_exit(), Radii, Rinf, RMAX, Rmed, Rmed2, RMIN, Rsup, Surf, and YES.

Referenced by InitEuler().

Here is the call graph for this function:

Here is the caller graph for this function:

void InitEuler ( PolarGrid Rho,
PolarGrid Vr,
PolarGrid Vt,
PolarGrid En 
)
real max2 ( real  a,
real  b 
)

Definition at line 173 of file SourceEuler.c.

References a, and b.

Referenced by ConditionCFL().

Here is the caller graph for this function:

real min2 ( real  a,
real  b 
)

Definition at line 166 of file SourceEuler.c.

References a, and b.

Referenced by ConditionCFL().

Here is the caller graph for this function:

void SubStep1 ( PolarGrid Vrad,
PolarGrid Vtheta,
PolarGrid Rho,
real  dt 
)
void SubStep2 ( PolarGrid Rho,
PolarGrid Energy,
real  dt 
)

Definition at line 402 of file SourceEuler.c.

References CVNR, EnergyEq, polargrid::Field, InvDiffRmed, InvDiffRsup, polargrid::Nrad, polargrid::Nsec, PI, RhoInt, and Rmed.

Referenced by AlgoGas().

Here is the caller graph for this function:

void SubStep3 ( PolarGrid Rho,
real  dt 
)

Numerical step reponsible for the energy update.

Calls the energy equation solver.

Definition at line 493 of file SourceEuler.c.

References ADIABIND, CoolingTimeMed, DivergenceVelocity, EnergyMed, polargrid::Field, FViscosity(), ImplicitRadiativeDiffusion(), ParametricCooling, Qplus, QplusMed, Rmed, SigmaMed, TAUPP, TAURP, and TAURR.

Referenced by AlgoGas().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

int AlreadyCrashed = 0
static

Definition at line 31 of file SourceEuler.c.

Referenced by AlgoGas().

boolean Corotating

Definition at line 30 of file Interpret.c.

Referenced by AlgoGas(), and ReadVariables().

PolarGrid * EnergyInt
static

Definition at line 29 of file SourceEuler.c.

PolarGrid* EnergyNew
static

Definition at line 29 of file SourceEuler.c.

boolean FastTransport

Definition at line 29 of file Interpret.c.

Referenced by ConditionCFL().

int GasTimeStepsCFL
static

Definition at line 31 of file SourceEuler.c.

Referenced by AlgoGas().

boolean IsDisk

Definition at line 30 of file Interpret.c.

Referenced by AlgoGas(), and ReadVariables().

PolarGrid* TemperInt
static

Definition at line 23 of file SourceEuler.c.

real timeCRASH
static

Definition at line 26 of file SourceEuler.c.

Referenced by AlgoGas().

int TimeStep

Definition at line 23 of file global.h.

PolarGrid * VradInt
static

Definition at line 24 of file SourceEuler.c.

PolarGrid* VradNew
static

Definition at line 24 of file SourceEuler.c.

PolarGrid * VthetaInt
static

Definition at line 25 of file SourceEuler.c.

PolarGrid* VthetaNew
static

Definition at line 25 of file SourceEuler.c.