35 int dim = boundary->
dim;
36 int face = boundary->
face;
44 double inv_gamma_m1 = 1.0/(gamma-1.0);
47 int bounds[ndims], indexb[ndims], indexi[ndims];
55 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
56 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
62 double rho, uvel, energy, pressure;
63 double rho_gpt, uvel_gpt, energy_gpt, pressure_gpt;
67 pressure_gpt = pressure;
69 energy_gpt = inv_gamma_m1*pressure_gpt
70 + 0.5 * rho_gpt * uvel_gpt*uvel_gpt;
72 phi[nvars*p1+0] = rho_gpt;
73 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
74 phi[nvars*p1+2] = energy_gpt;
80 }
else if (ndims == 2) {
86 double inv_gamma_m1 = 1.0/(gamma-1.0);
89 int bounds[ndims], indexb[ndims], indexi[ndims];
97 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
98 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
104 double rho, uvel, vvel, energy, pressure;
105 double rho_gpt, uvel_gpt, vvel_gpt, energy_gpt, pressure_gpt;
109 pressure_gpt = pressure;
113 }
else if (dim ==
_YDIR_) {
120 energy_gpt = inv_gamma_m1*pressure_gpt
121 + 0.5 * rho_gpt * (uvel_gpt*uvel_gpt + vvel_gpt*vvel_gpt);
123 phi[nvars*p1+0] = rho_gpt;
124 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
125 phi[nvars*p1+2] = rho_gpt * vvel_gpt;
126 phi[nvars*p1+3] = energy_gpt;
132 }
else if (ndims == 3) {
136 gamma = boundary->
gamma;
137 double inv_gamma_m1 = 1.0/(gamma-1.0);
140 int bounds[ndims], indexb[ndims], indexi[ndims];
148 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
149 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
155 double rho, uvel, vvel, wvel, energy, pressure;
156 double rho_gpt, uvel_gpt, vvel_gpt, wvel_gpt, energy_gpt, pressure_gpt;
160 pressure_gpt = pressure;
165 }
else if (dim ==
_YDIR_) {
169 }
else if (dim ==
_ZDIR_) {
178 energy_gpt = inv_gamma_m1*pressure_gpt
180 * (uvel_gpt*uvel_gpt + vvel_gpt*vvel_gpt + wvel_gpt*wvel_gpt);
182 phi[nvars*p1+0] = rho_gpt;
183 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
184 phi[nvars*p1+2] = rho_gpt * vvel_gpt;
185 phi[nvars*p1+3] = rho_gpt * wvel_gpt;
186 phi[nvars*p1+4] = energy_gpt;
Containts the structures and definitions for boundary condition implementation.
Structure containing variables and parameters specific to the 1D Euler equations. This structure cont...
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 BCSlipWallU(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)
1D Euler Equations (inviscid, compressible flows)
#define _Euler1DGetFlowVar_(u, rho, v, e, P, p)
#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)