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);
65 double Nbv = param->
N_bv;
75 f[p] = exp( (gx*xcoord+gy*ycoord+gz*zcoord)/RT);
76 g[p] = exp(-(gx*xcoord+gy*ycoord+gz*zcoord)/RT);
79 }
else if (param->
HB == 2) {
85 f[p] =
raiseto((1.0-(gx*xcoord+gy*ycoord+gz*zcoord)/(Cp*T0)), (-1.0 /(gamma-1.0)));
86 g[p] =
raiseto((1.0-(gx*xcoord+gy*ycoord+gz*zcoord)/(Cp*T0)), (gamma/(gamma-1.0)));
89 }
else if (param->
HB == 3) {
93 if ((gx != 0) || (gy != 0)) {
95 fprintf(stderr,
"Error in NavierStokes3DGravityField(): HB = 3 is implemented only for ");
96 fprintf(stderr,
"gravity force along the z-coordinate.\n");
100 double Pexner = 1 + ((gz*gz)/(Cp*T0*Nbv*Nbv)) * (exp(-(Nbv*Nbv/gz)*zcoord)-1.0);
101 f[p] =
raiseto(Pexner, (-1.0 /(gamma-1.0))) * exp(Nbv*Nbv*zcoord/gz);
102 g[p] =
raiseto(Pexner, (gamma/(gamma-1.0)));
128 _ArrayCopy1D_(indexb,indexi,_MODEL_NDIMS_); indexi[d] = ghosts-1-indexb[d];
137 if (mpi->
ip[d] == mpi->
iproc[d]-1) {
142 _ArrayCopy1D_(indexb,indexi,_MODEL_NDIMS_); indexi[d] = dim[d]-1-indexb[d];
#define _ArraySetValue_(x, size, value)
3D Navier Stokes equations (compressible flows)
#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)
int NavierStokes3DGravityField(void *s, void *m)
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 3D Navier Stokes equations. This structure contains the physical parameters, variables, and function pointers specific to the 3D Navier-Stokes equations.
Contains macros and function definitions for common array operations.
Structure of MPI-related variables.
Structure containing all solver-specific variables and functions.