16 #define PLUTO_VERSION "4.2"
38 #define UNIFORM_GRID 1
39 #define STRETCHED_GRID 2
40 #define LOGARITHMIC_INC_GRID 3
41 #define LOGARITHMIC_DEC_GRID 4
55 #define CHOMBO_REGRID 3
61 #define CHARACTERISTIC_TRACING 3
68 #define SUPER_TIME_STEPPING 2
69 #define RK_CHEBYSHEV 4
73 #define HYPERBOLIC_STEP 1
74 #define PARABOLIC_STEP 2
82 #define DBL_H5_OUTPUT 4
83 #define FLT_H5_OUTPUT 5
95 #define MAX_OUTPUT_TYPES 11
96 #define MAX_OUTPUT_VARS 128
120 #define EIGHT_WAVES 1
121 #define DIV_CLEANING 2
122 #define CONSTRAINED_TRANSPORT 3
135 #define AXISYMMETRIC 3
136 #define EQTSYMMETRIC 4
179 #define FLAG_MINMOD 1
182 #define FLAG_ENTROPY 8
183 #define FLAG_SPLIT_CELL 16
184 #define FLAG_INTERNAL_BOUNDARY 32
187 #define FLAG_CONS2PRIM_FAIL 64
188 #define FLAG_BIT8 128
203 #define CELL_CENTER 50
204 #define FACE_CENTER 51
205 #define EDGE_CENTER 52
213 #define LINEAR_MULTID 5
234 #define VANALBADA_LIM 3
237 #define VANLEER_LIM 6
239 #define FOURTH_ORDER_LIM 8
248 #define CONST_AH 1.008
249 #define CONST_AHe 4.004
250 #define CONST_AZ 30.0
251 #define CONST_amu 1.66053886e-24
252 #define CONST_au 1.49597892e13
253 #define CONST_c 2.99792458e10
254 #define CONST_eV 1.602176463158e-12
255 #define CONST_G 6.6726e-8
256 #define CONST_h 6.62606876e-27
257 #define CONST_kB 1.3806505e-16
258 #define CONST_ly 0.9461e18
259 #define CONST_mp 1.67262171e-24
260 #define CONST_mn 1.67492728e-24
261 #define CONST_me 9.1093826e-28
262 #define CONST_mH 1.6733e-24
263 #define CONST_Msun 2.e33
264 #define CONST_Mearth 5.9736e27
265 #define CONST_NA 6.0221367e23
266 #define CONST_pc 3.0856775807e18
267 #define CONST_PI 3.14159265358979
268 #define CONST_Rearth 6.378136e8
269 #define CONST_Rsun 6.96e10
270 #define CONST_sigma 5.67051e-5
271 #define CONST_sigmaT 6.6524e-25
278 #include "definitions.h"
286 #ifndef BACKGROUND_FIELD
287 #define BACKGROUND_FIELD NO
290 #ifndef CHAR_LIMITING
291 #define CHAR_LIMITING NO
298 #define CHOMBO_LOGR NO
311 #ifndef CHOMBO_CONS_AM
312 #if (GEOMETRY == CYLINDRICAL) && (COMPONENTS == 3) && (ENTROPY_SWITCH)
313 #define CHOMBO_CONS_AM YES
314 #elif (GEOMETRY == SPHERICAL) && (COMPONENTS == 3) && (ENTROPY_SWITCH)
315 #define CHOMBO_CONS_AM YES
316 #elif (GEOMETRY == POLAR) && (COMPONENTS > 1) && (ENTROPY_SWITCH)
317 #define CHOMBO_CONS_AM YES
319 #define CHOMBO_CONS_AM NO
323 #if CHOMBO_CONS_AM == YES
334 #ifndef ENTROPY_SWITCH
335 #define ENTROPY_SWITCH NO
342 #ifndef INCLUDE_PARTICLES
343 #define INCLUDE_PARTICLES NO
346 #ifndef RECONSTRUCT_4VEL
347 #define RECONSTRUCT_4VEL NO
353 #define RESISTIVITY NO
356 #ifndef ROTATING_FRAME
357 #define ROTATING_FRAME NO
360 #ifndef THERMAL_CONDUCTION
361 #define THERMAL_CONDUCTION NO
365 #define UNIT_DENSITY (CONST_mp)
369 #define UNIT_LENGTH (CONST_au)
372 #ifndef UNIT_VELOCITY
373 #define UNIT_VELOCITY (1.e5)
376 #ifndef UPDATE_VECTOR_POTENTIAL
377 #define UPDATE_VECTOR_POTENTIAL NO
388 #if (EOS == IDEAL) || (EOS == PVTE_LAW) || (EOS == TAUB)
389 #define HAVE_ENERGY YES
391 #define HAVE_ENERGY NO
397 #define KELVIN (UNIT_VELOCITY*UNIT_VELOCITY*CONST_amu/CONST_kB)
407 #define CHECK_EIGENVECTORS NO
412 #define CHECK_CONSERVATIVE_VAR NO
417 #ifndef CHECK_DIVB_CONDITION
418 #define CHECK_DIVB_CONDITION NO
423 #if (TIME_STEPPING == HANCOCK) || (TIME_STEPPING == CHARACTERISTIC_TRACING)
424 #if DIMENSIONAL_SPLITTING == NO
440 #if ((TIME_STEPPING == RK2) || (TIME_STEPPING == RK3)) \
441 && DIMENSIONAL_SPLITTING == NO
442 #define GET_MAX_DT NO
444 #define GET_MAX_DT YES
462 #define PARABOLIC_FLUX (RESISTIVITY|THERMAL_CONDUCTION|VISCOSITY)
486 typedef void Limiter (
double *,
double *,
double *,
int,
int,
Grid *);
487 typedef double Reconstruct (
double *,
double,
int);
494 #include "mod_defs.h"
506 #include "Dust/dust.h"
513 #if THERMAL_CONDUCTION != NO
522 #if RECONSTRUCTION == PARABOLIC
538 #define H_MASS_FRAC 0.7110
541 #if (EOS == PVTE_LAW) && (COOLING == NO)
542 #define He_MASS_FRAC (1 - H_MASS_FRAC)
547 #define He_MASS_FRAC 0.2741
550 #define Z_MASS_FRAC (1.0 - H_MASS_FRAC - He_MASS_FRAC)
551 #define FRAC_He (He_MASS_FRAC/CONST_AHe*CONST_AH/H_MASS_FRAC)
552 #define FRAC_Z (Z_MASS_FRAC /CONST_AZ *CONST_AH/H_MASS_FRAC)
568 #define NSCL (NTRACER + NIONS + (ENTROPY_SWITCH != 0))
573 #define NDUST_BEG (NFLX + NSCL)
574 #define NDUST_END (NDUST_BEG + NDUST - 1)
577 #define TRC (NFLX + NIONS)
579 #define ENTR (TRC + NTRACER)
605 #define NVAR (NFLX + NSCL + NDUST)
609 #define NFLX_LOOP(n) for ((n) = NFLX; (n)--; )
610 #define NIONS_LOOP(n) for ((n) = NFLX; (n) < (NFLX+NIONS); (n)++)
611 #define NTRACER_LOOP(n) for ((n) = TRC; (n) < (TRC+NTRACER); (n)++)
612 #define NSCL_LOOP(n) for ((n) = NFLX; (n) < (NFLX+NSCL); (n)++)
613 #define NDUST_LOOP(n) for ((n) = NDUST_BEG; (n) <= NDUST_END; (n)++)
614 #define NVAR_LOOP(n) for ((n) = NVAR; (n)--; )
625 #define IF_ENERGY(a) a
630 #if (defined FARGO) && (!defined SHEARINGBOX)
631 #define IF_FARGO(a) a
636 #if ROTATING_FRAME == YES
637 #define IF_ROTATING_FRAME(a) a
639 #define IF_ROTATING_FRAME(a)
705 #elif EOS == ISOTHERMAL
706 extern double g_isoSoundSpeed;
710 extern double glm_ch_max, glm_ch_max_loc, g_coeff_dl_min;
711 extern double g_level_dx;
712 extern double g_x2stretch, g_x3stretch;
713 extern int glm_is_defined;
714 #if GEOMETRY == CARTESIAN
715 extern double g_stretch_fact;
723 #define NX1_MAX NMAX_POINT
727 #elif DIMENSIONS == 2
728 #define NX2_MAX NMAX_POINT
731 #define NX2_MAX NMAX_POINT
732 #define NX3_MAX NMAX_POINT
737 #define NX1_MAX NX1_TOT
738 #define NX2_MAX NX2_TOT
739 #define NX3_MAX NX3_TOT
long int JEND
Upper grid index of the computational domain in the the X2 direction for the local processor...
long int NX1_TOT
Total number of zones in the X1 direction (boundaries included) for the local processor.
long int NMAX_POINT
Maximum number of points among the three directions, boundaries excluded.
PLUTO header file for structure declarations.
double g_time
The current integration time.
int g_operatorStep
Gives the current operator step.
long int IEND
Upper grid index of the computational domain in the the X1 direction for the local processor...
long int KBEG
Lower grid index of the computational domain in the the X3 direction for the local processor...
void Riemann_Solver(const State_1D *, int, int, double *, Grid *)
int g_k
x3 grid index when sweeping along the x1 or x2 direction.
long int NX1
Number of interior zones in the X1 directions (boundaries excluded) for the local processor...
double g_maxCoolingRate
The maximum fractional variation due to cooling from one step to the next.
double g_domEnd[3]
Upper limits of the computational domain.
long int JBEG
Lower grid index of the computational domain in the the X2 direction for the local processor...
double g_minCoolingTemp
The minimum temperature (in K) below which cooling is suppressed.
int g_intStage
Gives the current integration stage of the time stepping method (predictor = 0, 1st corrector = 1...
PLUTO header file for function-like macros.
int g_j
x2 grid index when sweeping along the x1 or x3 direction.
ArrayLib main header file.
int g_maxRiemannIter
Maximum number of iterations for iterative Riemann Solver.
int g_maxRootIter
Maximum number of iterations for root finder.
long int NX2_TOT
Total number of zones in the X2 direction (boundaries included) for the local processor.
double Reconstruct(double *, double, int)
double g_maxMach
The maximum Mach number computed during integration.
long int NX3_TOT
Total number of zones in the X3 direction (boundaries included) for the local processor.
double g_smallPressure
Small value for pressure fix.
long int NX3
Number of interior zones in the X3 directions (boundaries excluded) 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 g_usedMemory
Amount of used memory in bytes.
int g_dir
Specifies the current sweep or direction of integration.
double g_inputParam[32]
Array containing the user-defined parameters.
double g_domBeg[3]
Lower limits of the computational domain.
Shearing-Box module header file.
double g_smallDensity
Small value for density fix.
FARGO-MHD module header file.
Reconstruction coefficients header file.
Thermal conduction (TC) module header file.
int g_i
x1 grid index when sweeping along the x2 or x3 direction.
void Limiter(double *, double *, double *, int, int, Grid *)
long int g_stepNumber
Gives the current integration step number.
long int NX2
Number of interior zones in the X2 directions (boundaries excluded) for the local processor...
double g_dt
The current integration time step.
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...