33 int dim = boundary->
dim;
34 int face = boundary->
face;
40 gamma = boundary->
gamma;
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;
67 energy_gpt = inv_gamma_m1*pressure_gpt
68 + 0.5 * rho_gpt * (uvel_gpt*uvel_gpt + vvel_gpt*vvel_gpt);
70 phi[nvars*p1+0] = rho_gpt;
71 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
72 phi[nvars*p1+2] = rho_gpt * vvel_gpt;
73 phi[nvars*p1+3] = energy_gpt;
79 }
else if (ndims == 3) {
82 gamma = boundary->
gamma;
83 double inv_gamma_m1 = 1.0/(gamma-1.0);
86 int bounds[ndims], indexb[ndims], indexi[ndims];
94 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
95 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
101 double rho, uvel, vvel, wvel, energy, pressure;
102 double rho_gpt, uvel_gpt, vvel_gpt, wvel_gpt, energy_gpt, pressure_gpt;
106 pressure_gpt = pressure;
110 energy_gpt = inv_gamma_m1*pressure_gpt
112 * (uvel_gpt*uvel_gpt + vvel_gpt*vvel_gpt + wvel_gpt*wvel_gpt);
114 phi[nvars*p1+0] = rho_gpt;
115 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
116 phi[nvars*p1+2] = rho_gpt * vvel_gpt;
117 phi[nvars*p1+3] = rho_gpt * wvel_gpt;
118 phi[nvars*p1+4] = energy_gpt;
int BCNoslipWallU(void *b, void *m, int ndims, int nvars, int *size, int ghosts, double *phi, double waqt)
Containts the structures and definitions for boundary condition implementation.
#define _NavierStokes2DGetFlowVar_(u, rho, vx, vy, e, P, gamma)
Some basic definitions and macros.
Structure containing the variables and function pointers defining a boundary.
3D Navier Stokes equations (compressible flows)
#define _ArraySubtract1D_(x, a, b, size)
#define _ArrayAdd1D_(x, a, b, size)
2D Navier Stokes equations (compressible flows)
#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)