32 int dim = boundary->
dim;
33 int face = boundary->
face;
41 double inv_gamma_m1 = 1.0/(gamma-1.0);
44 int bounds[ndims], indexb[ndims], indexi[ndims];
52 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
53 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
59 double rho, uvel, vvel, energy, pressure;
60 double rho_gpt, uvel_gpt, vvel_gpt, energy_gpt, pressure_gpt;
64 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;
113 energy_gpt = inv_gamma_m1*pressure_gpt
115 * (uvel_gpt*uvel_gpt + vvel_gpt*vvel_gpt + wvel_gpt*wvel_gpt);
117 phi[nvars*p1+0] = rho_gpt;
118 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
119 phi[nvars*p1+2] = rho_gpt * vvel_gpt;
120 phi[nvars*p1+3] = rho_gpt * wvel_gpt;
121 phi[nvars*p1+4] = energy_gpt;
Containts the structures and definitions for boundary condition implementation.
Some basic definitions and macros.
Structure containing the variables and function pointers defining a boundary.
3D Navier Stokes equations (compressible flows)
#define _Euler2DGetFlowVar_(u, rho, vx, vy, e, P, p)
#define _ArraySubtract1D_(x, a, b, size)
int BCSubsonicOutflowU(void *b, void *m, int ndims, int nvars, int *size, int ghosts, double *phi, double waqt)
#define _ArrayAdd1D_(x, a, b, size)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
static const int _NavierStokes3D_stride_
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
#define _ArrayCopy1D_(x, y, size)
Contains macros and function definitions for common array operations.
#define _NavierStokes3DGetFlowVar_(u, stride, rho, vx, vy, vz, e, P, gamma)