PLUTO
init.c
Go to the documentation of this file.
1 #include "pluto.h"
2 /* ///////////////////////////////////////////////////////////////////// */
3 /*!
4  \file
5  \brief Collection of relativistic MHD shock-tube problems.
6 
7  This directory contains several 1D shock-tube configurations
8  commonly used for benchmarking of numerical methods.
9  There are 16 input parameters that can be used to specify entirely
10  the left and right states with respect to the discontinuity initially
11  placed at \c x=1/2.
12  For the left state one has:
13 
14  - <tt>g_inputParam[RHO_LEFT]</tt>: density for the left state
15  - <tt>g_inputParam[VX_LEFT]</tt>: normal (x) velocity for the left state
16  - <tt>g_inputParam[VY_LEFT]</tt>: tangential (y) velocity for the left state
17  - <tt>g_inputParam[VZ_LEFT]</tt>: tangential (z) velocity for the left state
18  - <tt>g_inputParam[BY_LEFT]</tt>: tangential (y) magnetic field for the left state
19  - <tt>g_inputParam[BZ_LEFT]</tt>: tangential (z) magnetic field for the left state
20  - <tt>g_inputParam[PR_LEFT]</tt>: pressure in the left state
21 
22  Similar parameters are used to specify the right states.
23  In addition,
24 
25  - <tt>g_inputParam[BX_CONST]</tt>: normal component of magnetic field (this
26  cannot have jump)
27  - <tt>g_inputParam[GAMMA_EOS]</tt>: the specific heat ratio
28 
29  The IDEAL equation of state is used.
30  The available configurations are taken from
31 
32  <CENTER>
33  Conf | Reference
34  -----|-----------------------
35  01-02| 1st problem in [MB06]
36  03-04| 2nd problem in [MB06]
37  05-06| 3rd problem in [MB06]
38  07-08| 4th problem in [MB06]
39  09-10| 2nd problem in [MUB09]
40  11-12| 4th problem (generic Alfven test) in [MUB09]
41  13-14| [MMB05]
42  </CENTER>
43 
44  \image html rmhd_sod.11.jpg "Results for the generic Alfven test at t = 0.5 on 1600 grid zones for conf. #11."
45 
46  \authors A. Mignone (mignone@ph.unito.it)\n
47  \date Oct 6, 2014 16, 2014
48 
49  \b References
50  - [MB06]: "An HLLC Riemann solver for relativistic flows --
51  II. Magnetohydrodynamics", Mignone & Bodo MNRAS(2006) 368,1040
52  - [MUB09]: "A five-wave Harten-Lax-van Leer Riemann solver for
53  relativistic magnetohydrodynamics", Mignone et al., MNRAS(2009) 393,1141
54  - [MMB05]: "Relativistic MHD simulations of jets with toroidal
55  magnetic fields", Mignone, Massaglia & Bodo, SSRv (2005), 121,21
56  - Balsara, ApJS (2001), 132, 83
57  - Del Zanna, Bucciantini, Londrillo, A&A (2003)
58 */
59 /* ///////////////////////////////////////////////////////////////////// */
60 
61 /* ********************************************************************* */
62 void Init (double *v, double x1, double x2, double x3)
63 /*
64  *
65  *
66  *
67  *********************************************************************** */
68 {
70 
71  if (x1 < 0.5){
73  v[VX1] = g_inputParam[VX_LEFT];
74  v[VX2] = g_inputParam[VY_LEFT];
75  v[VX3] = g_inputParam[VZ_LEFT];
77  v[BX2] = g_inputParam[BY_LEFT];
78  v[BX3] = g_inputParam[BZ_LEFT];
79  v[PRS] = g_inputParam[PR_LEFT];
80  }else{
84  v[VX3] = g_inputParam[VZ_RIGHT];
87  v[BX3] = g_inputParam[BZ_RIGHT];
88  v[PRS] = g_inputParam[PR_RIGHT];
89  }
90 }
91 /* ********************************************************************* */
92 void Analysis (const Data *d, Grid *grid)
93 /*
94  *
95  *
96  *********************************************************************** */
97 {
98 
99 }
100 /* ********************************************************************* */
101 void UserDefBoundary (const Data *d, RBox *box, int side, Grid *grid)
102 /*
103  *
104  *
105  *********************************************************************** */
106 {
107 }
#define BZ_RIGHT
double g_gamma
Definition: globals.h:112
#define PR_RIGHT
void UserDefBoundary(const Data *d, RBox *box, int side, Grid *grid)
Definition: init.c:98
#define VX2
Definition: mod_defs.h:29
#define PR_LEFT
#define RHO
Definition: mod_defs.h:19
#define BY_LEFT
#define VY_RIGHT
#define VX1
Definition: mod_defs.h:28
#define RHO_LEFT
#define RHO_RIGHT
#define VZ_LEFT
#define VY_LEFT
#define BZ_LEFT
Definition: structs.h:78
double g_inputParam[32]
Array containing the user-defined parameters.
Definition: globals.h:131
#define BX3
Definition: mod_defs.h:27
PLUTO main header file.
#define BX_CONST
#define VX_LEFT
Definition: structs.h:30
#define VZ_RIGHT
#define GAMMA_EOS
#define BY_RIGHT
#define BX1
Definition: mod_defs.h:25
#define VX3
Definition: mod_defs.h:30
#define BX2
Definition: mod_defs.h:26
#define VX_RIGHT
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