37 int dim = boundary->
dim;
38 int face = boundary->
face;
46 double inv_gamma_m1 = 1.0/(gamma-1.0);
49 int bounds[ndims], indexb[ndims], indexi[ndims];
57 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
58 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
64 double rho, uvel, vvel, energy, pressure;
65 double rho_gpt, uvel_gpt, vvel_gpt, energy_gpt, pressure_gpt;
69 pressure_gpt = pressure;
72 energy_gpt = inv_gamma_m1*pressure_gpt
73 + 0.5 * rho_gpt * (uvel_gpt*uvel_gpt + vvel_gpt*vvel_gpt);
75 phi[nvars*p1+0] = rho_gpt;
76 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
77 phi[nvars*p1+2] = rho_gpt * vvel_gpt;
78 phi[nvars*p1+3] = energy_gpt;
84 }
else if (ndims == 3) {
88 gamma = boundary->
gamma;
89 double inv_gamma_m1 = 1.0/(gamma-1.0);
92 int bounds[ndims], indexb[ndims], indexi[ndims];
100 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
101 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
107 double rho, uvel, vvel, wvel, energy, pressure;
108 double rho_gpt, uvel_gpt, vvel_gpt, wvel_gpt, energy_gpt, pressure_gpt;
112 pressure_gpt = pressure;
116 energy_gpt = inv_gamma_m1*pressure_gpt
118 * (uvel_gpt*uvel_gpt + vvel_gpt*vvel_gpt + wvel_gpt*wvel_gpt);
120 phi[nvars*p1+0] = rho_gpt;
121 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
122 phi[nvars*p1+2] = rho_gpt * vvel_gpt;
123 phi[nvars*p1+3] = rho_gpt * wvel_gpt;
124 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)
Structure containing the variables and function pointers defining a boundary.
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
#define _ArrayCopy1D_(x, y, size)
int BCSupersonicOutflowU(void *, void *, int, int, int *, int, double *, double)
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_