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 a 2D Riemann problem in terms of 4 four
7  constant states at each corner of the computational domain.
8 
9  For example, the top right corner, \f$x > 0\f$, \f$y > 0\f$, is denoted
10  with \c PP and its initial values are:
11 
12  \f[
13  \rho = \rho_{\rm PP}
14  \,,\quad\quad
15  P = P_{\rm PP}
16  \,,\quad\quad
17  v_x = v_{x\,{\rm PP}}
18  \,,\quad\quad
19  v_y = v_{y\,{\rm PP}}\,.
20  \f]
21 
22  Similar conditions hold for
23  the bottom right corner (\f$x > 0\f$, \f$y < 0\f$; \c PM),
24  the top left (\f$x < 0\f$, \f$y > 0\f$; \c MP), and
25  the bottom left (\f$x < 0\f$, \f$y < 0\f$; \c MM).
26  The 4 flow quantities of each corner are defined by the 16 parameters
27  that are read from pluto.ini.
28  - <tt>DN_PP, PR_PP, VX_PP, VY_PP</tt>
29  - <tt>DN_MP, PR_MP, VX_MP, VY_MP</tt>
30  - <tt>DN_PM, PR_PM, VX_PM, VY_PM</tt>
31  - <tt>DN_MM, PR_MM, VX_MM, VY_MM</tt>
32 
33 
34  - Configurations #01, #02 and #05 involve the interaction between four contact
35  discontinuities (see fig. below).
36  - Configurations #03 and #04 (with AMR) involve the interaction of shocks.
37 
38  \image html hd_riemann2D.05.jpg "Final state for configuration #05."
39 
40  \author A. Mignone (mignone@ph.unito.it)
41  \date Sept 15, 2014
42 
43  \b References
44  - C. W. Schulz-Rinne, "Classification of the Riemann problem for
45  two-dimensional gas dynamics", SIAM J. Math. Anal., 24
46  (1993), pp. 76-88.
47  - C. W. Schulz-Rinne, J. P. Collins and H. M. Glaz,
48  "Numerical solution of the Riemann problem for two-dimensional gas
49  dynamics", SIAM J. Sci. Comp., 14 (1993), pp. 1394-1414.
50 */
51 /* ///////////////////////////////////////////////////////////////////// */
52 #include "pluto.h"
53 
54 /* ********************************************************************* */
55 void Init (double *us, double x1, double x2, double x3)
56 /*
57  *
58  *
59  *********************************************************************** */
60 {
61  double x,y;
62 
63  x = x1;
64  y = x2;
65  #if EOS == IDEAL
66  g_gamma = 1.4;
67  #elif EOS == ISOTHERMAL
68  g_isoSoundSpeed = 1.0;
69  #endif
70 
71  if (x > 0.0 && y > 0.0){
72  us[RHO] = g_inputParam[DN_PP];
73  #if EOS == IDEAL
74  us[PRS] = g_inputParam[PR_PP];
75  #endif
76  us[VX1] = g_inputParam[VX_PP];
77  us[VX2] = g_inputParam[VY_PP];
78  }else if(x < 0.0 && y > 0.0){
79  us[RHO] = g_inputParam[DN_MP];
80  #if EOS == IDEAL
81  us[PRS] = g_inputParam[PR_MP];
82  #endif
83  us[VX1] = g_inputParam[VX_MP];
84  us[VX2] = g_inputParam[VY_MP];
85  }else if(x < 0.0 && y < 0.0){
86  us[RHO] = g_inputParam[DN_MM];
87  #if EOS == IDEAL
88  us[PRS] = g_inputParam[PR_MM];
89  #endif
90  us[VX1] = g_inputParam[VX_MM];
91  us[VX2] = g_inputParam[VY_MM];
92  }else if(x > 0.0 && y < 0.0){
93  us[RHO] = g_inputParam[DN_PM];
94  #if EOS == IDEAL
95  us[PRS] = g_inputParam[PR_PM];
96  #endif
97  us[VX1] = g_inputParam[VX_PM];
98  us[VX2] = g_inputParam[VY_PM];
99  }
100 }
101 /* ********************************************************************* */
102 void Analysis (const Data *d, Grid *grid)
103 /*
104  *
105  *
106  *********************************************************************** */
107 {
108 
109 }
110 
111 /* ********************************************************************* */
112 void UserDefBoundary (const Data *d, RBox *box, int side, Grid *grid)
113 /*
114  *
115  *********************************************************************** */
116 { }
117 
#define PR_PM
#define VX_MP
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 DN_MP
#define RHO
Definition: mod_defs.h:19
#define VX_MM
#define PR_PP
#define VX1
Definition: mod_defs.h:28
#define DN_MM
#define VX_PM
Definition: structs.h:78
double g_inputParam[32]
Array containing the user-defined parameters.
Definition: globals.h:131
#define VY_PP
#define PR_MP
#define VX_PP
PLUTO main header file.
Definition: structs.h:30
#define VY_PM
#define DN_PM
Definition: structs.h:346
#define DN_PP
#define VY_MP
#define PR_MM
void Analysis(const Data *d, Grid *grid)
Definition: init.c:66
#define VY_MM
void Init(double *v, double x1, double x2, double x3)
Definition: init.c:17