PLUTO
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
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
{
69
g_gamma
=
g_inputParam
[
GAMMA_EOS
];
70
71
if
(x1 < 0.5){
72
v[
RHO
] =
g_inputParam
[
RHO_LEFT
];
73
v[
VX1
] =
g_inputParam
[
VX_LEFT
];
74
v[
VX2
] =
g_inputParam
[
VY_LEFT
];
75
v[
VX3
] =
g_inputParam
[
VZ_LEFT
];
76
v[
BX1
] =
g_inputParam
[
BX_CONST
];
77
v[
BX2
] =
g_inputParam
[
BY_LEFT
];
78
v[
BX3
] =
g_inputParam
[
BZ_LEFT
];
79
v[PRS] =
g_inputParam
[
PR_LEFT
];
80
}
else
{
81
v[
RHO
] =
g_inputParam
[
RHO_RIGHT
];
82
v[
VX1
] =
g_inputParam
[
VX_RIGHT
];
83
v[
VX2
] =
g_inputParam
[
VY_RIGHT
];
84
v[
VX3
] =
g_inputParam
[
VZ_RIGHT
];
85
v[
BX1
] =
g_inputParam
[
BX_CONST
];
86
v[
BX2
] =
g_inputParam
[
BY_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
}
BZ_RIGHT
#define BZ_RIGHT
Definition:
definitions_01.h:38
g_gamma
double g_gamma
Definition:
globals.h:112
PR_RIGHT
#define PR_RIGHT
Definition:
definitions_01.h:39
UserDefBoundary
void UserDefBoundary(const Data *d, RBox *box, int side, Grid *grid)
Definition:
init.c:98
VX2
#define VX2
Definition:
mod_defs.h:29
PR_LEFT
#define PR_LEFT
Definition:
definitions_01.h:32
RHO
#define RHO
Definition:
mod_defs.h:19
BY_LEFT
#define BY_LEFT
Definition:
definitions_01.h:30
VY_RIGHT
#define VY_RIGHT
Definition:
definitions_01.h:35
VX1
#define VX1
Definition:
mod_defs.h:28
RHO_LEFT
#define RHO_LEFT
Definition:
definitions_01.h:26
RHO_RIGHT
#define RHO_RIGHT
Definition:
definitions_01.h:33
VZ_LEFT
#define VZ_LEFT
Definition:
definitions_01.h:29
VY_LEFT
#define VY_LEFT
Definition:
definitions_01.h:28
BZ_LEFT
#define BZ_LEFT
Definition:
definitions_01.h:31
GRID
Definition:
structs.h:78
g_inputParam
double g_inputParam[32]
Array containing the user-defined parameters.
Definition:
globals.h:131
BX3
#define BX3
Definition:
mod_defs.h:27
pluto.h
PLUTO main header file.
BX_CONST
#define BX_CONST
Definition:
definitions_01.h:40
VX_LEFT
#define VX_LEFT
Definition:
definitions_01.h:27
DATA
Definition:
structs.h:30
VZ_RIGHT
#define VZ_RIGHT
Definition:
definitions_01.h:36
GAMMA_EOS
#define GAMMA_EOS
Definition:
definitions_01.h:41
BY_RIGHT
#define BY_RIGHT
Definition:
definitions_01.h:37
BX1
#define BX1
Definition:
mod_defs.h:25
VX3
#define VX3
Definition:
mod_defs.h:30
BX2
#define BX2
Definition:
mod_defs.h:26
VX_RIGHT
#define VX_RIGHT
Definition:
definitions_01.h:34
RBOX
Definition:
structs.h:346
Analysis
void Analysis(const Data *d, Grid *grid)
Definition:
init.c:66
Init
void Init(double *v, double x1, double x2, double x3)
Definition:
init.c:17
Test_Problems
RMHD
Sod
init.c
Generated by
1.8.10