PLUTO
4.4-patch2
|
PLUTO main header file. More...
#include <stdio.h>
#include <stdarg.h>
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include "definitions.h"
#include <al.h>
#include "macros.h"
#include "structs.h"
#include "mod_defs.h"
#include "MHD/Hall_MHD/hall_mhd.h"
#include "MHD/ShearingBox/shearingbox.h"
#include "States/plm_coeffs.h"
#include "States/ppm_coeffs.h"
#include "Math_Tools/math_tools.h"
#include "eos.h"
#include "prototypes.h"
Go to the source code of this file.
Macros | |
#define | INITIAL_SMOOTHING NO |
#define | NGHOST_USR -1 |
#define | RECONSTRUCT_4VEL NO |
#define | UNIT_DENSITY (CONST_mp) |
#define | UNIT_LENGTH (CONST_au) |
#define | UNIT_VELOCITY (1.e5) |
#define | KELVIN (UNIT_VELOCITY*UNIT_VELOCITY*CONST_amu/CONST_kB) |
#define | NIONS 0 |
#define | NFLX_LOOP(n) for ((n) = NFLX; (n)--; ) |
Labels identifying different boundary and domain regions. | |
These are useful in Boundary() and when setting RBox structures in different points of the code. | |
#define | X1_BEG 101 |
#define | X1_END 102 |
#define | X2_BEG 103 |
#define | X2_END 104 |
#define | X3_BEG 105 |
#define | X3_END 106 |
#define | DOM 107 |
#define | TOT 108 |
Bit flag labels. | |
The following macros define the bits that can be turned on or off in an uint16_t (2 bytes integer, 1 byte = 8 bits) variable. Different bit flags allow to enable or disable certain actions in a given cell at different points in the code, see also flag.c. The 3D, 16-bit Individual bits can also be turned off, e.g., | |
#define | FLAG_MINMOD 1 |
#define | FLAG_FLAT 2 |
#define | FLAG_HLL 4 |
#define | FLAG_ENTROPY 8 |
#define | FLAG_SPLIT_CELL 16 |
#define | FLAG_INTERNAL_BOUNDARY 32 |
#define | FLAG_CONS2PRIM_FAIL 64 |
#define | FLAG_NEGATIVE_PRESSURE 128 |
#define | FLAG_NEGATIVE_ENERGY 256 |
#define | FLAG_NEGATIVE_DENSITY 512 |
#define | FLAG_BIT_11 1024 |
#define | FLAG_BIT_12 2048 |
#define | FLAG_BIT_13 4096 |
#define | FLAG_BIT_14 8192 |
#define | FLAG_BIT_15 16384 |
#define | FLAG_GCA_FAILURE 32768 |
Physical constants in c.g.s units. | |
The following set of macros express some useful physical constants in c.g.s units (erg, cm and sec). Values have been taken from http://physic.nist.gov/cuu/Constants/index.html | |
#define | CONST_AH 1.008 |
#define | CONST_AHe 4.004 |
#define | CONST_AZ 30.0 |
#define | CONST_amu 1.66053886e-24 |
#define | CONST_au 1.49597892e13 |
#define | CONST_c 2.99792458e10 |
#define | CONST_e 4.80320425e-10 |
#define | CONST_eV 1.602176463158e-12 |
#define | CONST_G 6.6726e-8 |
#define | CONST_h 6.62606876e-27 |
#define | CONST_kB 1.3806505e-16 |
#define | CONST_ly 0.9461e18 |
#define | CONST_mp 1.67262171e-24 |
#define | CONST_mn 1.67492728e-24 |
#define | CONST_me 9.1093826e-28 |
#define | CONST_mH 1.6733e-24 |
#define | CONST_Msun 2.e33 |
#define | CONST_Mearth 5.9736e27 |
#define | CONST_NA 6.0221367e23 |
#define | CONST_pc 3.0856775807e18 |
#define | CONST_PI 3.14159265358979 |
#define | CONST_Rearth 6.378136e8 |
#define | CONST_Rgas 8.3144598e7 |
#define | CONST_Rsun 6.96e10 |
#define | CONST_sigma 5.67051e-5 |
#define | CONST_sigmaT 6.6524e-25 |
Variables | |
int | prank |
long int | IBEG |
long int | IEND |
long int | JBEG |
long int | JEND |
long int | KBEG |
long int | KEND |
long int | NX1 |
long int | NX2 |
long int | NX3 |
long int | NX1_TOT |
long int | NX2_TOT |
long int | NX3_TOT |
long int | NMAX_POINT |
int | g_i |
int | g_j |
int | g_k |
int | g_dir |
int | g_intStage |
int | g_maxIMEXIter |
int | g_maxRiemannIter |
int | g_maxRootIter |
int | g_nprocs |
long int | g_stepNumber |
long int | g_usedMemory |
double | g_maxCoolingRate |
double | g_minCoolingTemp |
double | g_smallDensity |
double | g_smallPressure |
double | g_time |
double | g_dt |
double | g_maxMach |
double | g_domBeg [3] |
double | g_domEnd [3] |
double | g_inputParam [32] |
Contains basic macro definitions, structure definitions and global variable declarations used by the code.
#define CONST_AH 1.008 |
Atomic weight of Hydrogen
#define CONST_AHe 4.004 |
Atomic weight of Helium
#define CONST_amu 1.66053886e-24 |
Atomic mass unit.
#define CONST_au 1.49597892e13 |
Astronomical unit.
#define CONST_AZ 30.0 |
Mean atomic weight of heavy elements
#define CONST_c 2.99792458e10 |
Speed of Light.
#define CONST_e 4.80320425e-10 |
Elementary (proton) charge
#define CONST_eV 1.602176463158e-12 |
Electron Volt in erg.
#define CONST_G 6.6726e-8 |
Gravitational Constant.
#define CONST_h 6.62606876e-27 |
Planck Constant.
#define CONST_kB 1.3806505e-16 |
Boltzmann constant.
#define CONST_ly 0.9461e18 |
Light year.
#define CONST_me 9.1093826e-28 |
Electron mass.
#define CONST_Mearth 5.9736e27 |
Earth Mass.
#define CONST_mH 1.6733e-24 |
Hydrogen atom mass.
#define CONST_mn 1.67492728e-24 |
Neutron mass.
#define CONST_mp 1.67262171e-24 |
Proton mass.
#define CONST_Msun 2.e33 |
Solar Mass.
#define CONST_NA 6.0221367e23 |
Avogadro Contant.
#define CONST_pc 3.0856775807e18 |
Parsec.
#define CONST_PI 3.14159265358979 |
.
#define CONST_Rearth 6.378136e8 |
Earth Radius.
#define CONST_Rgas 8.3144598e7 |
Perfect gas constant
#define CONST_Rsun 6.96e10 |
Solar Radius.
#define CONST_sigma 5.67051e-5 |
Stephan Boltmann constant.
#define CONST_sigmaT 6.6524e-25 |
Thomson Cross section.
#define DOM 107 |
Computational domain (interior)
#define FLAG_BIT_11 1024 |
Free bit
#define FLAG_BIT_12 2048 |
Free bit
#define FLAG_BIT_13 4096 |
Free bit
#define FLAG_BIT_14 8192 |
Free bit
#define FLAG_BIT_15 16384 |
Free bit
#define FLAG_ENTROPY 8 |
Update pressure using entropy equation.
#define FLAG_FLAT 2 |
Reconstruct using FLAT limiter.
#define FLAG_GCA_FAILURE 32768 |
Singularity in the GCA because of E_ > B (incomplete stencil error)
#define FLAG_HLL 4 |
Switch to HLL Riemann solver.
#define FLAG_INTERNAL_BOUNDARY 32 |
Zone belongs to an internal boundary region and should be excluded from being updated in time
#define FLAG_MINMOD 1 |
Reconstruct using MINMOD limiter.
#define FLAG_NEGATIVE_DENSITY 512 |
A negative density has been found
#define FLAG_NEGATIVE_ENERGY 256 |
A negative energy has been found
#define FLAG_NEGATIVE_PRESSURE 128 |
A negative pressure has been found
#define FLAG_SPLIT_CELL 16 |
Zone is covered by a finer level (AMR only).
#define INITIAL_SMOOTHING NO |
Assign initial conditions by averaging multiple values inside the cell
#define KELVIN (UNIT_VELOCITY*UNIT_VELOCITY*CONST_amu/CONST_kB) |
Define the conversion constant between dimensionless temperature prs/rho and physical temperature in Kelvin, T = (prs/rho)*KELVIN*mu
#define NFLX_LOOP | ( | n | ) | for ((n) = NFLX; (n)--; ) |
The total number of variables that are evolved in time. This includes:
NFLX:
number of equations defining the system of conservation laws. For example, for the HD module, it consists of density, momentum and energy. Defined in the physics module header file mod_defs.h.NIONS:
number of chemical species; defined in the cooling modules cooling.h, if present.NTRACER:
number of user-defined tracers; defined in the problem directory header file definitions.hNFLX NIONS NTRACER ENTR NDUST_FLUID <----------------------> NSCL <----------------------------------------------> NVAR
#define NGHOST_USR -1 |
When positive, it specifes a user-provided number of ghost zones.
#define NIONS 0 |
Set the number of scalars including:
NTRACER
(user-supplied)NIONS
chemical fractions (cooling modules)In total, there are NSCL = NIONS+NTRACER+ENTROPY
passive scalar to be advected.
#define RECONSTRUCT_4VEL NO |
When set to YES, reconstruct 4-velocity rather than 3-velocity (only for RHD and RMHD physics modules)
#define TOT 108 |
Computational domain (total)
#define UNIT_DENSITY (CONST_mp) |
Unit density in gr/cm^3.
#define UNIT_LENGTH (CONST_au) |
Unit Length in cm.
#define UNIT_VELOCITY (1.e5) |
Unit velocity in cm/sec.
#define X1_BEG 101 |
Boundary region at X1 beg
#define X1_END 102 |
Boundary region at X1 end
#define X2_BEG 103 |
Boundary region at X2 beg
#define X2_END 104 |
Boundary region at X2 end
#define X3_BEG 105 |
Boundary region at X3 beg
#define X3_END 106 |
Boundary region at X3 end
int g_dir |
Specifies the current sweep or direction of integration. Its value is set usually in the time stepping functions and can take the values
double g_domBeg[3] |
Lower limits of the computational domain.
double g_domEnd[3] |
Upper limits of the computational domain.
double g_dt |
The current integration time step.
int g_i |
x1 grid index when sweeping along the x2 or x3 direction.
double g_inputParam[32] |
Array containing the user-defined parameters. The index names of this array are defined in definitions.h through the python interface.
int g_intStage |
Gives the current integration stage of the time stepping method (predictor = 0, 1st corrector = 1, and so on).
int g_j |
x2 grid index when sweeping along the x1 or x3 direction.
int g_k |
x3 grid index when sweeping along the x1 or x2 direction.
double g_maxCoolingRate |
The maximum fractional variation due to cooling from one step to the next.
int g_maxIMEXIter |
Maximum number if iterations in IMEX scheme
double g_maxMach |
The maximum Mach number computed during integration.
int g_maxRiemannIter |
Maximum number of iterations for iterative Riemann Solver.
int g_maxRootIter |
Maximum number of iterations for root finder
double g_minCoolingTemp |
The minimum temperature (in K) below which cooling is suppressed.
int g_nprocs |
The total number of processors
double g_smallDensity |
Small value for density fix.
double g_smallPressure |
Small value for pressure fix.
long int g_stepNumber |
Gives the current integration step number.
double g_time |
The current integration time.
long int g_usedMemory |
Amount of used memory in bytes.
long int IBEG |
Lower grid index of the computational domain in the the X1 direction for the local processor.
long int IEND |
Upper grid index of the computational domain in the the X1 direction for the local processor.
long int JBEG |
Lower grid index of the computational domain in the the X2 direction for the local processor.
long int JEND |
Upper grid index of the computational domain in the the X2 direction for the local processor.
long int KBEG |
Lower grid index of the computational domain in the the X3 direction for the local processor.
long int KEND |
Upper grid index of the computational domain in the the X3 direction for the local processor.
long int NMAX_POINT |
Maximum number of points among the three directions, boundaries excluded.
long int NX1 |
Number of interior zones in the X1 directions (boundaries excluded) for the local processor.
long int NX1_TOT |
Total number of zones in the X1 direction (boundaries included) for the local processor.
long int NX2 |
Number of interior zones in the X2 directions (boundaries excluded) for the local processor.
long int NX2_TOT |
Total number of zones in the X2 direction (boundaries included) for the local processor.
long int NX3 |
Number of interior zones in the X3 directions (boundaries excluded) for the local processor.
long int NX3_TOT |
Total number of zones in the X3 direction (boundaries included) for the local processor.
int prank |
Processor rank. In serial mode it is defined to be 0.