PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
mod_defs.h
1 /* ****************************************************************
2 
3  Set label, indexes and basic prototyping for the relativistic
4  Hydro (RHD) module.
5 
6  We make extra vector components, when not needed, point
7  to the last element (255) of the array stored by startup.c.
8  **************************************************************** */
9 
10 enum {
11  #if COMPONENTS == 1
12  RHO, MX1, ENG, PRS = ENG,
13  MX2 = 255, MX3 = 255,
14  #elif COMPONENTS == 2
15  RHO, MX1, MX2, ENG, PRS = ENG,
16  MX3 = 255,
17  #elif COMPONENTS == 3
18  RHO, MX1, MX2, MX3, ENG, PRS = ENG,
19  #endif
20  VX1 = MX1, VX2 = MX2, VX3 = MX3,
21 
22 /* -- backward compatibility -- */
23 
24  DN = RHO, PR = PRS, EN = ENG,
25  VX = VX1, VY = VX2, VZ = VX3,
26  MX = MX1, MY = MX2, MZ = MX3
27 
28 };
29 
30 #define NFLX (2 + COMPONENTS)
31 
32 /* *****************************************
33  by turning SUBTRACT_DENSITY to YES, we
34  let PLUTO evolve the total energy minus
35  the mass density contribution.
36  ***************************************** */
37 
38 /* #define SUBTRACT_DENSITY YES */
39 
40 /* *************************************************
41  Now define more convenient and user-friendly
42  pointer labels for geometry setting
43  ************************************************* */
44 
45 #if GEOMETRY == CYLINDRICAL
46 
47  #define iVR VX
48  #define iVZ VY
49  #define iVPHI VZ
50 
51  #define iMR MX
52  #define iMZ MY
53  #define iMPHI MZ
54 
55 #endif
56 
57 #if GEOMETRY == POLAR
58 
59  #define iVR VX
60  #define iVPHI VY
61  #define iVZ VZ
62 
63  #define iMR MX
64  #define iMPHI MY
65  #define iMZ MZ
66 
67 #endif
68 
69 #if GEOMETRY == SPHERICAL
70 
71  #define iVR VX
72  #define iVTH VY
73  #define iVPHI VZ
74 
75  #define iMR MX
76  #define iMTH MY
77  #define iMPHI MZ
78 
79 #endif
80 
81 /* ********************************************************************* */
91 typedef struct MAP_PARAM{
92  double D;
93  double sigma_c;
94  double E;
95  double m2;
97  double rho;
98  double W;
99  double lor;
100  double prs;
101 } Map_param;
102 
103 /* ************************************************************
104  Prototyping goes here
105  ************************************************************ */
106 
107 int ConsToPrim (double **, double **, int, int, unsigned char *);
108 void PrimEigenvectors(double *, double, double, double *, double **, double **);
109 void Enthalpy (double **, double *, int, int);
110 void Entropy (double **v, double *s, int beg, int end);
111 
112 int EnergySolve (Map_param *);
113 int EntropySolve (Map_param *);
114 int PressureFix (Map_param *);
115 
116 void Flux (double **, double **, double *, double **, double *, int, int);
117 void HLL_Speed (double **, double **, double *, double *,
118  double *, double *, int, int);
119 void MaxSignalSpeed (double **, double *, double *, double *, int, int);
120 void PrimToCons (double **, double **, int, int);
121 void PrimRHS (double *, double *, double, double, double *);
122 void PrimSource (const State_1D *, int, int,
123  double *, double *, double **, Grid *);
124 void VelocityLimiter(double *, double *, double *);
125 
126 Riemann_Solver TwoShock_Solver, LF_Solver, HLL_Solver, HLLC_Solver;
127