52 int v, done, p, p1, p2;
53 double *SourceI = solver->
fluxI;
54 double *SourceC = solver->
fluxC;
55 double *SourceL = solver->
fL;
56 double *SourceR = solver->
fR;
58 int ndims = solver->
ndims;
59 int ghosts = solver->
ghosts;
61 double *x = solver->
x;
62 double *dxinv = solver->
dxinv;
63 double RT = param->
p0 / param->
rho0;
64 int index[ndims],index1[ndims],index2[ndims],dim_interface[ndims];
67 if (param->
grav_x != 0.0) {
87 double rho, uvel, vvel, e, P;
91 source[_MODEL_NVARS_*p+v] += ( (term[v]*param->
grav_field_f[p])
92 * (SourceI[_MODEL_NVARS_*p2+v]-SourceI[_MODEL_NVARS_*p1+v])*dx_inverse );
100 if (param->
grav_y != 0.0) {
121 double rho, uvel, vvel, e, P;
123 double term[
_MODEL_NVARS_] = {0.0, 0.0, rho*RT, rho*RT*vvel};
125 source[_MODEL_NVARS_*p+v] += ( (term[v]*param->
grav_field_f[p])
126 * (SourceI[_MODEL_NVARS_*p2+v]-SourceI[_MODEL_NVARS_*p1+v])*dy_inverse );
164 int ghosts = solver->
ghosts;
166 int ndims = solver->
ndims;
167 int index[ndims], bounds[ndims], offset[ndims];
171 int i;
for (i=0; i<ndims; i++) bounds[i] += 2*ghosts;
214 int ndims = solver->
ndims;
217 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
218 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
219 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
224 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
227 (fI+_MODEL_NVARS_*p)[k] = 0.5 * ((fL+_MODEL_NVARS_*p)[k] + (fR+_MODEL_NVARS_*p)[k]);
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
MPI related function definitions.
#define _GetCoordinate_(dir, i, dim, ghosts, x, coord)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
2D Navier Stokes equations (compressible flows)
int NavierStokes2DSource(double *, double *, void *, void *, double)
Contains function definitions for common array operations on GPU.
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
#define _ArrayCopy1D_(x, y, size)
int(* InterpolateInterfacesHyp)(double *, double *, double *, double *, int, int, void *, void *, int)
Contains structure definition for hypar.
#define _NavierStokes2DGetFlowVar_(u, rho, vx, vy, e, P, gamma)
static int NavierStokes2DSourceFunction(double *, double *, double *, void *, void *, double, int)
Some basic definitions and macros.
Structure containing variables and parameters specific to the 2D Navier Stokes equations. This structure contains the physical parameters, variables, and function pointers specific to the 2D Navier-Stokes equations.
Contains macros and function definitions for common array operations.
Structure of MPI-related variables.
static int NavierStokes2DSourceUpwind(double *, double *, double *, double *, int, void *, double)
Structure containing all solver-specific variables and functions.