PLUTO
init.c File Reference

Hydrodynamic jet propagation in 2D cylindrical coordinates. More...

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

Go to the source code of this file.

Functions

void Init (double *v, 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

Hydrodynamic jet propagation in 2D cylindrical coordinates.

This problem considers the propagation of a hydrodynamic jet into a static uniform medium with constant density and pressure. The ambient density, in units of the jet density, is prescribed to be $ \rho_a = \eta $ where $\eta$ is the ambient/jet density ratio. The ambient pressure is $ p = 1/\Gamma $ when an IDEAL EoS is used or it is computed from temperature as $ p = p(\rho_a, T_a) $ for the PVTE_LAW EoS (here Ta is the ambient temperature). These values are set in Init() while the jet inflow is set through a user-defined boundary condition at the lower z-boundary. A simple top-hat injection nozzle is used.

The configuration is defined in terms of the following parameters:

  • g_inputParam[ETA]: density ratio between ambient and jet;
  • g_inputParam[MACH]: jet Mach number;
  • g_inputParam[TJET]: jet temperature (only for PVTE_LAW EoS).

defined in pluto.ini. The reference density and length are given by the jet density and radius while the reference velocity is 1 Km/s. The actual numerical values are needed only when using the PVTE_LAW EoS.

  • Configuration #01 uses an IDEAL EoS
  • Configurations #02 and #03 set a highly supersonic molecular jet evolving with the PVTE_LAW EoS. The first one adopts the root-finder version while the second one adopts the tabulated version.
hd_jet.jpg
Pressure (left) and density (right) maps for configuration #01 at t=15
Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
April 13, 2014

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 62 of file init.c.

66 { }
void Init ( double *  v,
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 42 of file init.c.

46 {
47  double Ta = 50.0; /* Ambient temperature */
48 
49  v[RHO] = g_inputParam[ETA];
50  v[VX1] = 0.0;
51  v[VX2] = 0.0;
52 
53  #if EOS == IDEAL
54  g_gamma = 5.0/3.0;
55  v[PRS] = 1.0/g_gamma;
56  #elif EOS == PVTE_LAW
57  v[PRS] = Pressure(v,Ta);
58  #endif
59 
60 }
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
static double Ta
Definition: init.c:136
double g_inputParam[32]
Array containing the user-defined parameters.
Definition: globals.h:131
double Pressure(double *v, double T)
Definition: thermal_eos.c:179
#define ETA

Here is the call graph for this function:

void UserDefBoundary ( const Data d,
RBox box,
int  side,
Grid grid 
)

Assign user-defined boundary conditions in the lower boundary ghost zones. The profile is top-hat:

\[ V_{ij} = \left\{\begin{array}{ll} V_{\rm jet} & \quad\mathrm{for}\quad r_i < 1 \\ \noalign{\medskip} \mathrm{Reflect}(V) & \quad\mathrm{otherwise} \end{array}\right. \]

where $ V_{\rm jet} = (\rho,v,p)_{\rm jet} = (1,M,1/\Gamma)$ and M is the flow Mach number (the unit velocity is the jet sound speed, so $ v = M$).

Definition at line 68 of file init.c.

83 {
84  int i, j, k, nv;
85  double *x1, *x2, *x3;
86  double cs, Tj, vj[NVAR];
87 
88  x1 = grid[IDIR].xgc; /* -- array pointer to x1 coordinate -- */
89  x2 = grid[JDIR].xgc; /* -- array pointer to x2 coordinate -- */
90  x3 = grid[KDIR].xgc; /* -- array pointer to x3 coordinate -- */
91 
92  vj[RHO] = 1.0;
93  #if EOS == IDEAL
94  vj[PRS] = 1.0/g_gamma; /* -- Pressure-matched jet -- */
95  vj[VX2] = g_inputParam[MACH]; /* -- Sound speed is one in this case -- */
96  #elif EOS == PVTE_LAW
97  Tj = g_inputParam[TJET];
98  vj[PRS] = Pressure(vj,Tj);
99  cs = sqrt(vj[PRS]/vj[RHO]); /* -- For simplicity, isothermal cs is used -- */
100  vj[VX2] = g_inputParam[MACH]*cs;
101  #endif
102 
103  if (side == X2_BEG){ /* -- select the boundary side -- */
104  BOX_LOOP(box,k,j,i){ /* -- Loop over boundary zones -- */
105  if (x1[i] <= 1.0){ /* -- set jet values for r <= 1 -- */
106  d->Vc[RHO][k][j][i] = vj[RHO];
107  d->Vc[VX1][k][j][i] = 0.0;
108  d->Vc[VX2][k][j][i] = vj[VX2];
109  d->Vc[PRS][k][j][i] = vj[PRS];
110  }else{ /* -- reflective boundary for r > 1 --*/
111  VAR_LOOP(nv) d->Vc[nv][k][j][i] = d->Vc[nv][k][2*JBEG-j-1][i];
112  d->Vc[VX2][k][j][i] *= -1.0;
113 /*
114  d->Vc[RHO][k][j][i] = d->Vc[RHO][k][2*JBEG - j - 1][i];
115  d->Vc[VX1][k][j][i] = d->Vc[VX1][k][2*JBEG - j - 1][i];
116  d->Vc[VX2][k][j][i] = -d->Vc[VX2][k][2*JBEG - j - 1][i];
117  d->Vc[PRS][k][j][i] = d->Vc[PRS][k][2*JBEG - j - 1][i];
118 */
119  }
120  }
121  }
122 }
double g_gamma
Definition: globals.h:112
#define MACH
#define VX2
Definition: mod_defs.h:29
#define RHO
Definition: mod_defs.h:19
#define BOX_LOOP(B, k, j, i)
Definition: macros.h:70
double **** Vc
The main four-index data array used for cell-centered primitive variables.
Definition: structs.h:31
#define TJET
#define VX1
Definition: mod_defs.h:28
#define KDIR
Definition: pluto.h:195
#define VAR_LOOP(n)
Definition: macros.h:226
#define IDIR
Definition: pluto.h:193
double g_inputParam[32]
Array containing the user-defined parameters.
Definition: globals.h:131
int j
Definition: analysis.c:2
int k
Definition: analysis.c:2
double * xgc
Cell volumetric centroid (!= x when geometry != CARTESIAN).
Definition: structs.h:84
int i
Definition: analysis.c:2
double Pressure(double *v, double T)
Definition: thermal_eos.c:179
#define X2_BEG
Boundary region at X2 beg.
Definition: pluto.h:148
#define JDIR
Definition: pluto.h:194
long int JBEG
Lower grid index of the computational domain in the the X2 direction for the local processor...
Definition: globals.h:39
#define NVAR
Definition: pluto.h:609

Here is the call graph for this function: