PLUTO
mod_defs.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief Set labels, indexes and prototypes for the RHD module.
5 
6  Contains variable names and prototypes for the RHD module
7 
8  \author A. Mignone (mignone@ph.unito.it)
9  \date April, 2, 2015
10 */
11 /* ///////////////////////////////////////////////////////////////////// */
12 
13 /* *********************************************************
14  Set flow variable indices.
15  Extra vector components, when not needed, point to the
16  last element (255) of the array stored by startup.c.
17  ********************************************************* */
18 
19 #define RHO 0
20 #define MX1 1
21 #define MX2 (COMPONENTS >= 2 ? 2: 255)
22 #define MX3 (COMPONENTS == 3 ? 3: 255)
23 #if HAVE_ENERGY
24  #define ENG (COMPONENTS + 1)
25  #define PRS ENG
26 #endif
27 
28 #define VX1 MX1
29 #define VX2 MX2
30 #define VX3 MX3
31 
32 #define NFLX (2 + COMPONENTS)
33 
34 /* *************************************************
35  Now define more convenient and user-friendly
36  pointer labels for geometry setting
37  ************************************************* */
38 
39 #if GEOMETRY == CYLINDRICAL
40 
41  #define iVR VX1
42  #define iVZ VX2
43  #define iVPHI VX3
44 
45  #define iMR MX1
46  #define iMZ MX2
47  #define iMPHI MX3
48 
49 #endif
50 
51 #if GEOMETRY == POLAR
52 
53  #define iVR VX1
54  #define iVPHI VX2
55  #define iVZ VX3
56 
57  #define iMR MX1
58  #define iMPHI MX2
59  #define iMZ MX3
60 
61 #endif
62 
63 #if GEOMETRY == SPHERICAL
64 
65  #define iVR VX1
66  #define iVTH VX2
67  #define iVPHI VX3
68 
69  #define iMR MX1
70  #define iMTH MX2
71  #define iMPHI MX3
72 
73 #endif
74 
75 /* ********************************************************************* */
76 /*! The Map_param structure is used to pass input/output arguments
77  during the conversion from conservative to primitive variables
78  operated by the ConsToPrim() function.
79  The output parameter, rho, W, lor and p, must be set at the end
80  of every root-finder routine (EnergySolve(), EntropySolve() and
81  PressureFix()).
82  Additionally, some of the input parameters must be re-computed in
83  EntropySolve() and PressureFix().
84  ********************************************************************* */
85 typedef struct MAP_PARAM{
86  double D; /**< Lab density (input). */
87  double sigma_c; /**< Conserved entropy (input). */
88  double E; /**< Total energy (input). */
89  double m2; /**< Square of total momentum (input). */
90 
91  double rho; /**< proper density (output) */
92  double W; /**< D*h*lor (output). */
93  double lor; /**< Lorentz factor (output). */
94  double prs; /**< Thermal pressure (output). */
95 } Map_param;
96 
97 /* ---- Function prototyping ---- */
98 
99 int ConsToPrim (double **, double **, int, int, unsigned char *);
100 void PrimEigenvectors(double *, double, double, double *, double **, double **);
101 
102 int EnergySolve (Map_param *);
103 int EntropySolve (Map_param *);
104 int PressureFix (Map_param *);
105 
106 void Flux (double **, double **, double *, double **, double *, int, int);
107 void HLL_Speed (double **, double **, double *, double *,
108  double *, double *, int, int);
109 void MaxSignalSpeed (double **, double *, double *, double *, int, int);
110 void PrimToCons (double **, double **, int, int);
111 void PrimRHS (double *, double *, double, double, double *);
112 void PrimSource (const State_1D *, int, int,
113  double *, double *, double **, Grid *);
114 void VelocityLimiter(double *, double *, double *);
115 void ConvertTo4vel (double **, int, int);
116 void ConvertTo3vel (double **, int, int);
117 
118 
120 
void Flux(double **, double **, double *, double **, double *, int, int)
Definition: fluxes.c:23
void VelocityLimiter(double *, double *, double *)
Definition: vel_limiter.c:16
struct MAP_PARAM Map_param
void ConvertTo4vel(double **, int, int)
Definition: four_vel.c:4
int EnergySolve(Map_param *)
Definition: energy_solve.c:23
double m2
Square of total momentum (input).
Definition: mod_defs.h:89
double D
Lab density (input).
Definition: mod_defs.h:86
void Riemann_Solver(const State_1D *, int, int, double *, Grid *)
Definition: pluto.h:489
int PressureFix(Map_param *)
Definition: pressure_fix.c:22
Riemann_Solver HLLC_Solver
Definition: mod_defs.h:106
void PrimToCons(double **, double **, int, int)
Definition: mappers.c:26
Riemann_Solver TwoShock_Solver
Definition: mod_defs.h:106
int ConsToPrim(double **, double **, int, int, unsigned char *)
Definition: mappers.c:89
void HLL_Speed(double **, double **, double *, double *, double *, double *, int, int)
Definition: hll_speed.c:24
double rho
proper density (output)
Definition: mod_defs.h:91
Definition: structs.h:78
double W
D*h*lor (output).
Definition: mod_defs.h:92
void ConvertTo3vel(double **, int, int)
Definition: four_vel.c:25
void PrimSource(const State_1D *, int, int, double *, double *, double **, Grid *)
Definition: prim_eqn.c:71
double lor
Lorentz factor (output).
Definition: mod_defs.h:93
void MaxSignalSpeed(double **, double *, double *, double *, int, int)
Definition: eigenv.c:34
Riemann_Solver HLL_Solver
Definition: mod_defs.h:106
double prs
Thermal pressure (output).
Definition: mod_defs.h:94
int EntropySolve(Map_param *)
Definition: entropy_solve.c:21
Riemann_Solver LF_Solver
Definition: mod_defs.h:106
void PrimRHS(double *, double *, double, double, double *)
Definition: prim_eqn.c:31
double sigma_c
Conserved entropy (input).
Definition: mod_defs.h:87
void PrimEigenvectors(double *, double, double, double *, double **, double **)
Definition: eigenv.c:91
double E
Total energy (input).
Definition: mod_defs.h:88