PLUTO
init.c
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief Two-dimensional Riemann problem.
5 
6  Sets the initial condition for the 2D Riemann problem
7  described in Mignone et al. (2005).
8  The computational domain is initially divided into four
9  states and the outcoming wave pattern involves the formtation of
10  2 shocks and two contact waves.
11 
12  \image html rhd_riemann2D.01.jpg "Final state for configuration #01."
13 
14  \authors A. Mignone (mignone@ph.unito.it)
15  \date July 09, 2014
16 
17  \b Reference:
18  - "The Piecewise Parabolic Method for Multidimensional Relativistic
19  Fluid Dynamics", Mignone, Plewa & Bodo, ApJS (2005)
20 */
21 /* ///////////////////////////////////////////////////////////////////// */
22 #include "pluto.h"
23 
24 /* ********************************************************************* */
25 void Init (double *us, double x1, double x2, double x3)
26 /*
27  *
28  *
29  *
30  *********************************************************************** */
31 {
32  double x, y, scrh;
33 
34  x = x1;
35  y = x2;
36 
37  us[VX1] = us[VX2] = 0.0;
38  if (x > 0.0 && y > 0.0){
39  us[RHO] = 5.477875e-3;
40  us[PRS] = 2.762987e-3;
41  us[VX1] = 0.0;
42  us[VX2] = 0.0;
43  }else if(x < 0.0 && y > 0.0){
44  us[RHO] = 0.1;
45  us[PRS] = 1.0;
46  us[VX1] = 0.99;
47  us[VX2] = 0.0;
48  }else if(x < 0.0 && y < 0.0){
49  us[RHO] = 0.5;
50  us[PRS] = 1.0;
51  us[VX1] = 0.0;
52  us[VX2] = 0.0;
53  }else if(x > 0.0 && y < 0.0){
54  us[RHO] = 0.1;
55  us[PRS] = 1.0;
56  us[VX1] = 0.0;
57  us[VX2] = 0.99;
58  }
59 
60  #if USE_FOUR_VELOCITY == YES
61  scrh = 1.0/sqrt(1.0 - us[VX1]*us[VX1] - us[VX2]*us[VX2]);
62  us[VX1] *= scrh;
63  us[VX2] *= scrh;
64  #endif
65 
66 }
67 /* ********************************************************************* */
68 void Analysis (const Data *d, Grid *grid)
69 /*
70  *
71  *
72  *********************************************************************** */
73 {
74 
75 }
76 /* ********************************************************************* */
77 void UserDefBoundary (const Data *d, RBox *box, int side, Grid *grid)
78 /*
79  *
80  *
81  *********************************************************************** */
82 { }
83 
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
tuple scrh
Definition: configure.py:200
#define VX1
Definition: mod_defs.h:28
Definition: structs.h:78
PLUTO main header file.
Definition: structs.h:30
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