33 int dim = boundary->
dim;
34 int face = boundary->
face;
42 double inv_gamma_m1 = 1.0/(gamma-1.0);
45 int bounds[ndims], indexb[ndims], indexi[ndims];
53 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
54 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
60 double rho, uvel, vvel, energy, pressure;
61 double rho_gpt, uvel_gpt, vvel_gpt, energy_gpt, pressure_gpt;
65 pressure_gpt = pressure;
68 energy_gpt = inv_gamma_m1*pressure_gpt
69 + 0.5 * rho_gpt * (uvel_gpt*uvel_gpt + vvel_gpt*vvel_gpt);
71 phi[nvars*p1+0] = rho_gpt;
72 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
73 phi[nvars*p1+2] = rho_gpt * vvel_gpt;
74 phi[nvars*p1+3] = energy_gpt;
80 }
else if (ndims == 3) {
84 gamma = boundary->
gamma;
85 double inv_gamma_m1 = 1.0/(gamma-1.0);
88 int bounds[ndims], indexb[ndims], indexi[ndims];
96 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
97 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
103 double rho, uvel, vvel, wvel, energy, pressure;
104 double rho_gpt, uvel_gpt, vvel_gpt, wvel_gpt, energy_gpt, pressure_gpt;
108 pressure_gpt = pressure;
112 energy_gpt = inv_gamma_m1*pressure_gpt
114 * (uvel_gpt*uvel_gpt + vvel_gpt*vvel_gpt + wvel_gpt*wvel_gpt);
116 phi[nvars*p1+0] = rho_gpt;
117 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
118 phi[nvars*p1+2] = rho_gpt * vvel_gpt;
119 phi[nvars*p1+3] = rho_gpt * wvel_gpt;
120 phi[nvars*p1+4] = energy_gpt;
#define _NavierStokes3DGetFlowVar_(u, stride, rho, vx, vy, vz, e, P, gamma)
#define _ArraySetValue_(x, size, value)
3D Navier Stokes equations (compressible flows)
#define _ArrayIncrementIndex_(N, imax, i, done)
Containts the structures and definitions for boundary condition implementation.
#define _Euler2DGetFlowVar_(u, rho, vx, vy, e, P, p)
#define _ArraySubtract1D_(x, a, b, size)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
int BCSubsonicInflowU(void *, void *, int, int, int *, int, double *, double)
Structure containing the variables and function pointers defining a boundary.
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
#define _ArrayCopy1D_(x, y, size)
Some basic definitions and macros.
Contains macros and function definitions for common array operations.
#define _ArrayAdd1D_(x, a, b, size)
static const int _NavierStokes3D_stride_