PLUTO
init.c
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief Relativistic shock tube problems.
5 
6  Shock tube problems are widely used for code benchmarking since they
7  directly probe the solver's ability in resolving elementary waves and their
8  propagation.
9  In addition, numerical results can be compared with analytical solutions.
10 
11  Here we provide a simple suite of shock tube for the relativistic hydro
12  module, by following Mignone \& Bodo (2005).
13  \f[
14  \left(\rho,\, v_x,\, p\right) = \left\{\begin{array}{ll}
15  \left(\rho,\, v_x,\, p\right)_L & \quad\mathrm{for}\quad x < 0.5
16  \\ \noalign{\medskip}
17  \left(\rho,\, v_x,\, p\right)_R & \quad\mathrm{otherwise}
18  \end{array}\right.
19  \f]
20  The four available configurations correspond to Problem 1-4 of Mignone
21  \& Bodo (2005):
22 
23  <CENTER>
24  Test | rho | vx | p | Gamma
25  -----|------|-----|-----|--------------
26  1L | 1 | 0.9 | 1 | 4/3
27  1R | 1 | 0.0 | 10 | -
28  2L | 1 |-0.6 | 10 | 5/3
29  2R | 10 | 0.5 | 20 | -
30  3L | 10 |-0.6 | 40/3| 5/3
31  3R | 1 | 0.0 | 0 | -
32  4L | 1 | 0.0 | 1.e3| 5/3
33  4R | 1 | 0.0 |1.e-2| -
34  </CENTER>
35 
36  Results are shown in the four figures below:
37 
38  \image html rhd_shock_tube.01.jpg "Flow profiles for the 1st shock tube problem"
39  \image html rhd_shock_tube.02.jpg "Flow profiles for the 2nd shock tube problem"
40  \image html rhd_shock_tube.03.jpg "Flow profiles for the 3rd shock tube problem"
41  \image html rhd_shock_tube.04.jpg "Flow profiles for the 4th shock tube problem"
42 
43  \author A. Mignone (mignone@ph.unito.it)
44  \date Aug 10, 2015
45 
46  \b References
47  - "An HLLC Riemann solver for relativistic flows - I. Hydrodynamics"
48  Mignone \& Bodo, MNRAS (2005) 364, 126
49 */
50 /* ///////////////////////////////////////////////////////////////////// */
51 #include "pluto.h"
52 
53 /* ********************************************************************* */
54 void Init (double *us, double x, double y, double z)
55 /*
56  *
57  *
58  *
59  *********************************************************************** */
60 {
62  if (x < 0.5){
63  us[RHO] = g_inputParam[DN_L];
64  us[VX1] = g_inputParam[VX_L];
65  us[VX2] = g_inputParam[VY_L];
66  us[PRS] = g_inputParam[PR_L];
67  }else{
68  us[RHO] = g_inputParam[DN_R];
69  us[VX1] = g_inputParam[VX_R];
70  us[VX2] = g_inputParam[VY_R];
71  us[PRS] = g_inputParam[PR_R];
72  }
73 
74 }
75 
76 /* ********************************************************************* */
77 void Analysis (const Data *d, Grid *grid)
78 /*
79  *
80  *
81  *********************************************************************** */
82 {
83 
84 }
85 /* ********************************************************************* */
86 void UserDefBoundary (const Data *d, RBox *box, int side, Grid *grid)
87 /*
88  *
89  *
90  *********************************************************************** */
91 {
92 }
double g_gamma
Definition: globals.h:112
void UserDefBoundary(const Data *d, RBox *box, int side, Grid *grid)
Definition: init.c:98
#define VX2
Definition: mod_defs.h:29
#define RHO
Definition: mod_defs.h:19
#define VX_R
#define VX1
Definition: mod_defs.h:28
#define PR_R
#define DN_R
Definition: structs.h:78
double g_inputParam[32]
Array containing the user-defined parameters.
Definition: globals.h:131
#define VY_R
#define VY_L
#define VX_L
PLUTO main header file.
#define DN_L
Definition: structs.h:30
#define GAMMA_EOS
#define PR_L
Definition: structs.h:346
void Analysis(const Data *d, Grid *grid)
Definition: init.c:66
void Init(double *v, double x1, double x2, double x3)
Definition: init.c:17