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);
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)));
134 if (mpi->
ip[d] == mpi->
iproc[d]-1) {
MPI related function definitions.
Contains function definitions for common mathematical functions.
int NavierStokes2DGravityField(void *s, void *m)
Structure containing all solver-specific variables and functions.
Contains structure definition for hypar.
2D Navier Stokes equations (compressible flows)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
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.
#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.