Applies the slip-wall boundary condition: This is specific to the two and three dimensional Euler and Navier-Stokes systems (Euler2D, NavierStokes2D, NavierStokes3D). It is used for simulating inviscid walls or symmetric boundaries. The pressure, density, and tangential velocity at the ghost points are extrapolated from the interior, while the normal velocity at the ghost points is set such that the interpolated value at the boundary face is equal to the specified wall velocity.
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;
#define _NavierStokes3DGetFlowVar_(u, stride, rho, vx, vy, vz, e, P, gamma)
#define _ArraySetValue_(x, size, value)
#define _Euler1DGetFlowVar_(u, rho, v, e, P, p)
#define _ArrayIncrementIndex_(N, imax, i, done)
#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)
Structure containing variables and parameters specific to the 1D Euler equations. This structure cont...
#define _ArrayAdd1D_(x, a, b, size)
static const int _NavierStokes3D_stride_