PLUTO
init.c
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief Relativistic shock-cloud interaction.
5 
6  Sets initial condition for the relativistic shock-cloud interaction
7  problem in 2D or 3D.
8  A high-density spherical cloud with \f$ \rho = 10 \f$ is initially
9  located at \f$ (0.8,0) \f$ adjacent to a shock wave located at
10  \f$ x=0 \f$.
11  The post-shock region (\f$ x < 0 \f$) is at rest with
12  \f[
13  \begin{array}{lcll}
14  (\rho,\, v_z,\, B_z,\, p) &=& (42.5942,\,0,\, -2.12971,\, 127.9483)
15  & \qquad\mathrm{Ideal}\quad\mathrm{EOS, [MB06]}
16  \\ \noalign{\medskip}
17  (\rho,\, v_z,\, B_z,\, p) &=& (39.5052,\,0,\, 1.9753,\, 129.72386)
18  & \qquad\mathrm{TM}\quad\mathrm{EOS, [Mig12]}
19  \end{array}
20  \f]
21  while the upstream region is characterized by
22  \f[
23  (\rho,\, v_z,\, B_z,\, p) = (1, \, -\sqrt{0.99}, \,0.5,\, 10^{-3})
24  \f]
25  This test has no input parameters
26 
27  The first two configurations employ adaptive mesh refinement.
28 
29  \image html rmhd_shock_cloud.01.jpg "Density map (in log scale) for configuration #01"
30 
31  \b References
32  - [MB06]: "An HLLC Riemann solver for relativistic flows --
33  II. Magnetohydrodynamics", Mignone & Bodo MNRAS(2006) 368,1040
34  - [Mig12]: "The PLUTO Code for Adaptive Mesh Computations in Astrophysical
35  Fluid dynamics", Mignone et al., ApJS (2012), 198:7
36 
37  \authors A. Mignone (mignone@ph.unito.it)\n
38  \date Aug 31, 2015
39 */
40 /* ///////////////////////////////////////////////////////////////////// */
41 #include "pluto.h"
42 
43 /* ************************************************************** */
44 void Init (double *us, double x1, double x2, double x3)
45 /*
46  *
47  *
48  *
49  *
50  **************************************************************** */
51 {
52  double x,y,z,r;
53  double c,s,alpha;
54 
55  #if EOS == IDEAL
56  g_gamma = 4./3.;
57  #endif
58 
59  alpha = 0.0*CONST_PI/4.0;
60 
61  x = x1; y = x2; z = x3;
62 
63  if (x < 0.6){
64 
65  #if EOS == IDEAL
66  us[RHO] = 42.5942;
67  us[PRS] = 127.9483;
68  us[BX3] = -2.12971;
69  #elif EOS == TAUB
70  us[RHO] = 39.5052;
71  us[PRS] = 129.72386;
72  us[BX3] = 1.9753;
73  #endif
74  us[VX1] = 0.0;
75  us[VX2] = 0.0;
76  us[VX3] = 0.0;
77  us[BX1] = 0.0;
78  us[BX2] = 0.0;
79 
80  }else{
81 
82  us[RHO] = 1.0;
83  us[PRS] = 1.e-3;
84  us[VX1] = -sqrt(1.0 - 1.0/100.);
85  us[VX2] = 0.0;
86  us[VX3] = 0.0;
87  us[BX1] = 0.0;
88  us[BX2] = 0.0;
89  us[BX3] = 0.5;
90 
91  }
92 /*
93  #if DIMENSIONS == 3
94  us[BX3] /= sqrt(2.0);
95  us[BX2] = us[BX3];
96  #endif
97 */
98 
99  r = D_EXPAND( (x-0.8)*(x-0.8), + y*y, + z*z);
100  r = sqrt(r);
101  if (r < 0.15) us[RHO] = 10.0;
102 
103 }
104 /* ************************************************************** */
105 void Analysis (const Data *d, Grid *grid)
106 /*
107  *
108  *
109  *
110  **************************************************************** */
111 {
112 
113 }
114 
115 /* ************************************************************** */
116 void UserDefBoundary (const Data *d, RBox *box, int side, Grid *grid)
117 /*
118  *
119  *
120  *
121  **************************************************************** */
122 {
123  int i, j, k, nv;
124  real x1, x2, x3;
125 
126  if (side == X2_BEG){ /* -- X2_BEG boundary -- */
127  X2_BEG_LOOP(k,j,i){}
128  }
129 
130  if (side == X2_END){ /* -- X2_END boundary -- */
131  X2_END_LOOP(k,j,i){}
132  }
133 }
134 
135 
static double alpha
Definition: init.c:3
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
double real
Definition: pluto.h:488
#define RHO
Definition: mod_defs.h:19
#define VX1
Definition: mod_defs.h:28
#define X2_BEG_LOOP(k, j, i)
Definition: macros.h:47
#define X2_END_LOOP(k, j, i)
Definition: macros.h:51
#define X2_END
Boundary region at X2 end.
Definition: pluto.h:149
Definition: structs.h:78
int j
Definition: analysis.c:2
int k
Definition: analysis.c:2
tuple c
Definition: menu.py:375
#define s
#define BX3
Definition: mod_defs.h:27
PLUTO main header file.
D_EXPAND(tot/[n]=(double) grid[IDIR].np_int_glob;, tot/[n]=(double) grid[JDIR].np_int_glob;, tot/[n]=(double) grid[KDIR].np_int_glob;)
Definition: analysis.c:27
Definition: structs.h:30
int i
Definition: analysis.c:2
#define BX1
Definition: mod_defs.h:25
#define VX3
Definition: mod_defs.h:30
#define CONST_PI
.
Definition: pluto.h:269
#define X2_BEG
Boundary region at X2 beg.
Definition: pluto.h:148
#define BX2
Definition: mod_defs.h:26
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