41 int dim = boundary->
dim;
42 int face = boundary->
face;
50 double inv_gamma_m1 = 1.0/(gamma-1.0);
57 }
else if (dim == 1) {
65 int bounds[ndims], indexb[ndims], indexi[ndims], indexj[ndims];
71 double rho, uvel, vvel, energy, pressure;
79 indexj[dim] = indexi[dim] + 1;
80 }
else if (face == -1) {
81 indexi[dim] = size[dim]-1;
82 indexj[dim] = indexi[dim] - 1;
86 double uvel1, uvel2, uvelb,
90 uvelb = 1.5*uvel1 - 0.5*uvel2;
91 vvelb = 1.5*vvel1 - 0.5*vvel2;
92 double vel_normal = uvelb*nx + vvelb*ny;
96 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
97 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
106 double rho_gpt, uvel_gpt, vvel_gpt, energy_gpt, pressure_gpt;
107 if (vel_normal > 0) {
110 pressure_gpt = pressure;
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);
145 }
else if (dim == 1) {
149 }
else if (dim == 2) {
159 int bounds[ndims], indexb[ndims], indexi[ndims], indexj[ndims];
165 double rho, uvel, vvel, wvel, energy, pressure;
173 indexj[dim] = indexi[dim] + 1;
174 }
else if (face == -1) {
175 indexi[dim] = size[dim]-1;
176 indexj[dim] = indexi[dim] - 1;
180 double uvel1, uvel2, uvelb,
185 uvelb = 1.5*uvel1 - 0.5*uvel2;
186 vvelb = 1.5*vvel1 - 0.5*vvel2;
187 wvelb = 1.5*wvel1 - 0.5*wvel2;
188 double vel_normal = uvelb*nx + vvelb*ny + wvelb*nz;
192 if (face == 1) indexi[dim] = ghosts-1-indexb[dim];
193 else if (face == -1) indexi[dim] = size[dim]-indexb[dim]-1;
202 double rho_gpt, uvel_gpt, vvel_gpt, wvel_gpt, energy_gpt, pressure_gpt;
203 if (vel_normal > 0) {
206 pressure_gpt = pressure;
218 energy_gpt = inv_gamma_m1*pressure_gpt
220 * (uvel_gpt*uvel_gpt + vvel_gpt*vvel_gpt + wvel_gpt*wvel_gpt);
222 phi[nvars*p1+0] = rho_gpt;
223 phi[nvars*p1+1] = rho_gpt * uvel_gpt;
224 phi[nvars*p1+2] = rho_gpt * vvel_gpt;
225 phi[nvars*p1+3] = rho_gpt * wvel_gpt;
226 phi[nvars*p1+4] = energy_gpt;
Containts the structures and definitions for boundary condition implementation.
int BCSubsonicAmbivalentU(void *b, void *m, int ndims, int nvars, int *size, int ghosts, double *phi, double waqt)
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)
#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)