45 int ghosts = solver->
ghosts;
47 offset[_MODEL_NDIMS_], d, done;
55 double p0 = param->
p0;
56 double rho0 = param->
rho0;
57 double RT = p0 / rho0;
58 double gamma= param->
gamma;
60 double Cp = gamma*R / (gamma-1.0);
61 double T0 = p0 / (rho0 * R);
64 double Nbv = param->
N_bv;
73 f[p] = exp( (gx*xcoord+gy*ycoord)/RT);
74 g[p] = exp(-(gx*xcoord+gy*ycoord)/RT);
77 }
else if (param->
HB == 2) {
82 f[p] =
raiseto((1.0-(gx*xcoord+gy*ycoord)/(Cp*T0)), (-1.0 /(gamma-1.0)));
83 g[p] =
raiseto((1.0-(gx*xcoord+gy*ycoord)/(Cp*T0)), (gamma/(gamma-1.0)));
86 }
else if (param->
HB == 3) {
92 fprintf(stderr,
"Error in NavierStokes2DGravityField(): HB = 3 is implemented only for ");
93 fprintf(stderr,
"gravity force along the y-coordinate.\n");
97 double Pexner = 1 + ((gy*gy)/(Cp*T0*Nbv*Nbv)) * (exp(-(Nbv*Nbv/gy)*ycoord)-1.0);
98 f[p] =
raiseto(Pexner, (-1.0 /(gamma-1.0))) * exp(Nbv*Nbv*ycoord/gy);
99 g[p] =
raiseto(Pexner, (gamma/(gamma-1.0)));
125 _ArrayCopy1D_(indexb,indexi,_MODEL_NDIMS_); indexi[d] = ghosts-1-indexb[d];
134 if (mpi->
ip[d] == mpi->
iproc[d]-1) {
139 _ArrayCopy1D_(indexb,indexi,_MODEL_NDIMS_); indexi[d] = dim[d]-1-indexb[d];
#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)
Contains function definitions for common mathematical functions.
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
#define _ArrayCopy1D_(x, y, size)
Contains structure definition for hypar.
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.
int NavierStokes2DGravityField(void *s, void *m)
Structure of MPI-related variables.
Structure containing all solver-specific variables and functions.