45 int ghosts = solver->
ghosts;
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)));
137 if (mpi->
ip[d] == mpi->
iproc[d]-1) {
MPI related function definitions.
Contains function definitions for common mathematical functions.
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.
3D Navier Stokes equations (compressible flows)
Structure containing all solver-specific variables and functions.
Contains structure definition for hypar.
int NavierStokes3DGravityField(void *s, void *m)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
#define _GetCoordinate_(dir, i, dim, ghosts, x, coord)
Structure of MPI-related variables.
#define _ArrayCopy1D_(x, y, size)
Contains macros and function definitions for common array operations.