PLUTO
init.c File Reference

Isentropic vortex problem. More...

#include "pluto.h"
Include dependency graph for init.c:

Go to the source code of this file.

Functions

void Init (double *us, double x1, double x2, double x3)
 
void Analysis (const Data *d, Grid *grid)
 
void UserDefBoundary (const Data *d, RBox *box, int side, Grid *grid)
 

Detailed Description

Isentropic vortex problem.

The isentropic vortex is a smooth exact solution of the 2D Euler equations. It consists of a single vortex centered at (5,5) in pressure equilibrium:

\[ \Big(\delta v_x\,, \delta v_y\Big) = - (y_c,\,x_c)\frac{\epsilon}{2\pi} \exp\left(\frac{1-r_c^2}{2}\right) \,,\quad T = \frac{p}{\rho} = 1 - \frac{(\Gamma-1)\epsilon^2}{8\Gamma\pi^2}\exp(1-r_c^2)\,,\quad s = \frac{p}{\rho^\Gamma} \]

where $ (x_c,\,y_c) = (x-5,\,y-5),\, r_c=\sqrt{x_c^2+y_c^2},\,\epsilon=5$ while $\Gamma = 1.4$ is the adiabatic index. A constant entropy is used with value s=1. The vortex shifts along the main diagonal of the computational domain with uniform velocity (1,1) and returns in its original position after t=10. The domain is assumed to be periodic and its size must be taken large enough to ensure there is no interaction between off-domain vortices.

The vortex problem is often used as computational benchmark to test the accuracy and dissipation of a numerical scheme in reproducing the vortex structure after several revolutions.

There're no input parameters for this problem.

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).
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Oct 3, 2014

References

  • C.W. Shu, "High-order Finite Difference and Finite Volume WENO Schemes and Discontinuous Galerkin Methods for CFD", ICASE Report No.2001-11, NASA/CR-2001-210865

Definition in file init.c.

Function Documentation

void Analysis ( const Data d,
Grid grid 
)

Perform runtime data analysis.

Parameters
[in]dthe PLUTO Data structure
[in]gridpointer to array of Grid structures

Definition at line 76 of file init.c.

80 {}
void Init ( double *  us,
double  x1,
double  x2,
double  x3 
)

The Init() function can be used to assign initial conditions as as a function of spatial position.

Parameters
[out]va pointer to a vector of primitive variables
[in]x1coordinate point in the 1st dimension
[in]x2coordinate point in the 2nd dimension
[in]x3coordinate point in the 3rdt dimension

The meaning of x1, x2 and x3 depends on the geometry:

\[ \begin{array}{cccl} x_1 & x_2 & x_3 & \mathrm{Geometry} \\ \noalign{\medskip} \hline x & y & z & \mathrm{Cartesian} \\ \noalign{\medskip} R & z & - & \mathrm{cylindrical} \\ \noalign{\medskip} R & \phi & z & \mathrm{polar} \\ \noalign{\medskip} r & \theta & \phi & \mathrm{spherical} \end{array} \]

Variable names are accessed by means of an index v[nv], where nv = RHO is density, nv = PRS is pressure, nv = (VX1, VX2, VX3) are the three components of velocity, and so forth.

Definition at line 47 of file init.c.

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 }
tuple T
Definition: Sph_disk.py:33
double g_gamma
Definition: globals.h:112
#define VX2
Definition: mod_defs.h:29
#define RHO
Definition: mod_defs.h:19
#define VX1
Definition: mod_defs.h:28
#define eps
#define s
#define CONST_PI
.
Definition: pluto.h:269
void UserDefBoundary ( const Data d,
RBox box,
int  side,
Grid grid 
)

Assign user-defined boundary conditions.

Parameters
[in,out]dpointer to the PLUTO data structure containing cell-centered primitive quantities (d->Vc) and staggered magnetic fields (d->Vs, when used) to be filled.
[in]boxpointer to a RBox structure containing the lower and upper indices of the ghost zone-centers/nodes or edges at which data values should be assigned.
[in]sidespecifies the boundary side where ghost zones need to be filled. It can assume the following pre-definite values: X1_BEG, X1_END, X2_BEG, X2_END, X3_BEG, X3_END. The special value side == 0 is used to control a region inside the computational domain.
[in]gridpointer to an array of Grid structures.

Definition at line 83 of file init.c.

87 { }