PLUTO
init.c
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief Isentropic vortex problem.
5 
6  The isentropic vortex is a smooth exact solution of the 2D Euler
7  equations.
8  It consists of a single vortex centered at \c (5,5) in pressure
9  equilibrium:
10  \f[
11  \Big(\delta v_x\,, \delta v_y\Big)
12  = - (y_c,\,x_c)\frac{\epsilon}{2\pi}
13  \exp\left(\frac{1-r_c^2}{2}\right) \,,\quad
14  T = \frac{p}{\rho}
15  = 1 - \frac{(\Gamma-1)\epsilon^2}{8\Gamma\pi^2}\exp(1-r_c^2)\,,\quad
16  s = \frac{p}{\rho^\Gamma}
17  \f]
18  where \f$ (x_c,\,y_c) = (x-5,\,y-5),\, r_c=\sqrt{x_c^2+y_c^2},\,\epsilon=5\f$
19  while \f$\Gamma = 1.4\f$ is the adiabatic index.
20  A constant entropy is used with value \c s=1.
21  The vortex shifts along the main diagonal of the computational domain
22  with uniform velocity \c (1,1) and returns in its original position
23  after \c t=10.
24  The domain is assumed to be periodic and its size must be taken large
25  enough to ensure there is no interaction between off-domain vortices.
26 
27  The vortex problem is often used as computational benchmark to test
28  the accuracy and dissipation of a numerical scheme in reproducing
29  the vortex structure after several revolutions.
30 
31  There're no input parameters for this problem.
32 
33  \image html hd_isentropic_vortex.13.jpg "Density cut at y=5 after 10 revolutions using PPM and Finite difference WENOZ and PPM (conf #01 and #03)."
34 
35  \author A. Mignone (mignone@ph.unito.it)
36  \date Oct 3, 2014
37 
38  \b References
39  - C.W. Shu, "High-order Finite Difference and Finite Volume WENO
40  Schemes and Discontinuous Galerkin Methods for CFD",
41  ICASE Report No.2001-11, NASA/CR-2001-210865
42 */
43 /* ///////////////////////////////////////////////////////////////////// */
44 #include "pluto.h"
45 
46 /* ********************************************************************* */
47 void Init (double *us, double x1, double x2, double x3)
48 /*
49  *
50  *
51  *
52  *********************************************************************** */
53 {
54  double s, T, r2, xt, yt, eps;
55  double k0;
56 
57  g_gamma = 1.4;
58 
59  xt = x1 - 5.0;
60  yt = x2 - 5.0;
61 
62  r2 = xt*xt + yt*yt;
63 
64  eps = 5.0;
65 
66  s = 1.0;
67  T = 1.0 - (g_gamma - 1.0)*eps*eps/(8.0*g_gamma*CONST_PI*CONST_PI)*exp(1.0 - r2);
68 
69  k0 = eps/(2.0*CONST_PI)*exp(0.5*(1.0 - r2));
70  us[RHO] = pow(T/s, 1.0/(g_gamma - 1.0));
71  us[VX1] = 1.0 - k0*yt;
72  us[VX2] = 1.0 + k0*xt;
73  us[PRS] = T*us[RHO];
74 }
75 /* ********************************************************************* */
76 void Analysis (const Data *d, Grid *grid)
77 /*
78  *
79  *********************************************************************** */
80 {}
81 
82 /* ********************************************************************* */
83 void UserDefBoundary (const Data *d, RBox *box, int side, Grid *grid)
84 /*
85  *
86  *********************************************************************** */
87 { }
tuple T
Definition: Sph_disk.py:33
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 RHO
Definition: mod_defs.h:19
#define VX1
Definition: mod_defs.h:28
#define eps
Definition: structs.h:78
#define s
PLUTO main header file.
Definition: structs.h:30
#define CONST_PI
.
Definition: pluto.h:269
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