HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
euler1d.h File Reference

1D Euler Equations (inviscid, compressible flows) More...

#include <basic.h>
#include <math.h>
#include <matops.h>

Go to the source code of this file.

Data Structures

struct  Euler1D
 Structure containing variables and parameters specific to the 1D Euler equations. This structure contains the physical parameters, variables, and function pointers specific to the 1D Euler equations. More...
 

Macros

#define _EULER_1D_   "euler1d"
 
#define _MODEL_NDIMS_   1
 
#define _MODEL_NVARS_   3
 
#define _ROE_   "roe"
 
#define _RF_   "rf-char"
 
#define _LLF_   "llf-char"
 
#define _SWFS_   "steger-warming"
 
#define _RUSANOV_   "rusanov"
 
#define _XDIR_   0
 
#define _Euler1DGetFlowVar_(u, rho, v, e, P, p)
 
#define _Euler1DSetFlux_(f, rho, v, e, P)
 
#define _Euler1DSetStiffFlux_(f, rho, v, e, P, gamma)
 
#define _Euler1DSetLinearizedStiffFlux_(f, u, J)
 
#define _Euler1DSetStiffJac_(J, rho, v, e, P, gamma)
 
#define _Euler1DRoeAverage_(uavg, uL, uR, p)
 
#define _Euler1DEigenvalues_(u, D, p, dir)
 
#define _Euler1DLeftEigenvectors_(u, L, p, dir)
 
#define _Euler1DRightEigenvectors_(u, R, p, dir)
 

Functions

int Euler1DInitialize (void *, void *)
 
int Euler1DCleanup (void *)
 

Detailed Description

1D Euler Equations (inviscid, compressible flows)

Author
Debojyoti Ghosh

1D Euler Equations for Inviscid, Compressible Flows (includes gravitational force terms)

\begin{equation} \frac {\partial} {\partial t} \left[\begin{array}{c} \rho \\ \rho u \\ e \end{array}\right] + \frac {\partial} {\partial x} \left[\begin{array}{c} \rho u \\ \rho u^2 + p \\ (e+p) u\end{array}\right] = \left[\begin{array}{c} 0 \\ -\rho g \\ -\rho u g \end{array}\right] \end{equation}

where

\begin{equation} e = \frac {p} {\gamma-1} + \frac{1}{2} \rho u^2 \end{equation}

Reference for the governing equations:

  • Laney, C. B., Computational Gasdynamics, Cambridge University Press, 1998

For the partitioning of the flux into its stiff (acoustic) and non-stiff (convective) components, refer to:

  • Ghosh, D., Constantinescu, E. M., Semi-Implicit Time Integration of Atmospheric Flows with Characteristic-Based Flux Partitioning, SIAM Journal on Scientific Computing, 38 (3), 2016, A1848-A1875, http://dx.doi.org/10.1137/15M1044369

For the treatment of gravitational source terms, refer to:

  • Xing, Y., Shu, C.-W., "High Order Well-Balanced WENO Scheme for the Gas Dynamics Equations Under Gravitational Fields", Journal of Scientific Computing, 54, 2013, pp. 645-662. http://dx.doi.org/10.1007/s10915-012-9585-8

Definition in file euler1d.h.

Macro Definition Documentation

#define _EULER_1D_   "euler1d"

1D Euler equations

Definition at line 50 of file euler1d.h.

#define _MODEL_NDIMS_   1

Number of spatial dimensions

Definition at line 56 of file euler1d.h.

#define _MODEL_NVARS_   3

Number of variables per grid point

Definition at line 58 of file euler1d.h.

#define _ROE_   "roe"

Roe upwinding scheme

Definition at line 62 of file euler1d.h.

#define _RF_   "rf-char"

Roe-Fixed upwinding scheme (characteristic-based Roe scheme with local Lax-Friedrich entropy fix)

Definition at line 64 of file euler1d.h.

#define _LLF_   "llf-char"

Local Lax-Friedrich upwinding scheme

Definition at line 66 of file euler1d.h.

#define _SWFS_   "steger-warming"

Steger-Warming flux splitting

Definition at line 68 of file euler1d.h.

#define _RUSANOV_   "rusanov"

Rusanov flux splitting

Definition at line 70 of file euler1d.h.

#define _XDIR_   0

dimension corresponding to the x spatial dimension

Definition at line 75 of file euler1d.h.

#define _Euler1DGetFlowVar_ (   u,
  rho,
  v,
  e,
  P,
 
)
Value:
{ \
double gamma = p->gamma; \
rho = u[0]; \
v = u[1] / rho; \
e = u[2]; \
P = (e - 0.5*rho*v*v) * (gamma-1.0); \
}

Compute the flow variables (density, pressure, velocity) from the conserved solution vector.

Definition at line 81 of file euler1d.h.

#define _Euler1DSetFlux_ (   f,
  rho,
  v,
  e,
 
)
Value:
{ \
f[0] = (rho) * (v); \
f[1] = (rho) * (v) * (v) + (P); \
f[2] = ((e) + (P)) * (v); \
}

Set the flux vector given the flow variables (density, velocity, pressure).

Definition at line 94 of file euler1d.h.

#define _Euler1DSetStiffFlux_ (   f,
  rho,
  v,
  e,
  P,
  gamma 
)
Value:
{ \
double gamma_inv = 1.0 / (gamma); \
f[0] = gamma_inv * (rho)*(v); \
f[1] = gamma_inv * (rho)*(v)*(v) + (P); \
f[2] = ((e)+(P)) * (v) - 0.5*gamma_inv*((gamma)-1)*(rho)*(v)*(v)*(v); \
}

Set the stiff flux vector given the flow variables (density, velocity, pressure). The stiff flux vector is defines as the part of the total flux that represents the two acoustic waves. This is used in a characteristic-based split-flux method for implicit-explicit time-integration. The stiff flux is integrated in time implicitly.

See Also
_Euler1DSetStiffJac_, _Euler1DSetLinearizedStiffFlux_

Reference:

  • Ghosh, D., Constantinescu, E. M., Semi-Implicit Time Integration of Atmospheric Flows with Characteristic-Based Flux Partitioning, SIAM Journal on Scientific Computing, 38 (3), 2016, A1848-A1875, http://dx.doi.org/10.1137/15M1044369

Definition at line 115 of file euler1d.h.

#define _Euler1DSetLinearizedStiffFlux_ (   f,
  u,
 
)
Value:
{ \
}
#define _MODEL_NVARS_
Definition: euler1d.h:58
#define _MatVecMultiply_(A, x, y, N)
Definition: matops.h:67

Linearized version of _Euler1DSetStiffFlux_, where the Jacobian of the stiff flux is evaluated at the beginning of each time step.

See Also
_Euler1DSetStiffJac_

Reference:

  • Ghosh, D., Constantinescu, E. M., Semi-Implicit Time Integration of Atmospheric Flows with Characteristic-Based Flux Partitioning, SIAM Journal on Scientific Computing, 38 (3), 2016, A1848-A1875, http://dx.doi.org/10.1137/15M1044369

Definition at line 134 of file euler1d.h.

#define _Euler1DSetStiffJac_ (   J,
  rho,
  v,
  e,
  P,
  gamma 
)
Value:
{ \
double gm1 = (gamma)-1; \
double inv_gm = 1.0/(gamma); \
double gm1_inv_gm = gm1 * inv_gm; \
J[0] = 0.5*gm1_inv_gm*(rho)*(v)*(v)*(v)/(P) - (v); \
J[1] = 1.0 - gm1_inv_gm*(rho)*(v)*(v)/(P); \
J[2] = gm1_inv_gm*(rho)*(v)/(P); \
J[3] = 0.5*gm1_inv_gm*(rho)*(v)*(v)*(v)*(v)/(P) + 0.5*((gamma)-5.0)*(v)*(v); \
J[4] = (3.0-(gamma))*(v) - gm1_inv_gm*(rho)*(v)*(v)*(v)/(P); \
J[5] = gm1_inv_gm*(rho)*(v)*(v)/(P) + gm1; \
J[6] = 0.25*gm1_inv_gm*(rho)*(v)*(v)*(v)*(v)*(v)/(P) - (gamma)*(v)*(e)/(rho) + 0.5*(2.0*(gamma)-3.0)*(v)*(v)*(v); \
J[7] = (gamma)*(e)/(rho) - 1.5*gm1*(v)*(v) - 0.5*gm1_inv_gm*(rho)*(v)*(v)*(v)*(v)/(P); \
J[8] = 0.5*gm1_inv_gm*(rho)*(v)*(v)*(v)/(P) + (gamma)*(v); \
}

Compute the Jacobian of the stiff flux defined in _Euler1DSetStiffFlux_. The Jacobian is stored in the row-major format.

Reference:

  • Ghosh, D., Constantinescu, E. M., Semi-Implicit Time Integration of Atmospheric Flows with Characteristic-Based Flux Partitioning, SIAM Journal on Scientific Computing, 38 (3), 2016, A1848-A1875, http://dx.doi.org/10.1137/15M1044369

Definition at line 149 of file euler1d.h.

#define _Euler1DRoeAverage_ (   uavg,
  uL,
  uR,
 
)
Value:
{ \
double rho ,v ,e ,P ,H ,csq; \
double rhoL,vL,eL,PL,HL,cLsq; \
double rhoR,vR,eR,PR,HR,cRsq; \
double gamma = p->gamma; \
rhoL = uL[0]; \
vL = uL[1] / rhoL; \
eL = uL[2]; \
PL = (eL - 0.5*rhoL*vL*vL) * (gamma-1.0); \
cLsq = gamma * PL/rhoL; \
HL = 0.5*vL*vL + cLsq / (gamma-1.0); \
rhoR = uR[0]; \
vR = uR[1] / rhoR; \
eR = uR[2]; \
PR = (eR - 0.5*rhoR*vR*vR) * (gamma-1.0); \
cRsq = gamma * PR/rhoR; \
HR = 0.5*vR*vR + cRsq / (gamma-1.0); \
double tL = sqrt(rhoL); \
double tR = sqrt(rhoR); \
rho = tL * tR; \
v = (tL*vL + tR*vR) / (tL + tR); \
H = (tL*HL + tR*HR) / (tL + tR); \
csq = (gamma-1.0) * (H-0.5*v*v); \
P = csq * rho / gamma; \
e = P/(gamma-1.0) + 0.5*rho*v*v; \
\
uavg[0] = rho; \
uavg[1] = rho*v; \
uavg[2] = e; \
}

Compute the Roe average of two conserved solution vectors.

Definition at line 169 of file euler1d.h.

#define _Euler1DEigenvalues_ (   u,
  D,
  p,
  dir 
)
Value:
{ \
double gamma = p->gamma; \
double rho,v,e,P,c; \
rho = u[0]; \
v = u[1] / rho; \
e = u[2]; \
P = (e - 0.5*rho*v*v) * (gamma-1.0); \
c = sqrt(gamma*P/rho); \
D[0*_MODEL_NVARS_+0] = v; D[0*_MODEL_NVARS_+1] = 0; D[0*_MODEL_NVARS_+2] = 0; \
D[1*_MODEL_NVARS_+0] = 0; D[1*_MODEL_NVARS_+1] = (v-c); D[1*_MODEL_NVARS_+2] = 0; \
D[2*_MODEL_NVARS_+0] = 0; D[2*_MODEL_NVARS_+1] = 0; D[2*_MODEL_NVARS_+2] = (v+c); \
}
#define _MODEL_NVARS_
Definition: euler1d.h:58

Compute the eigenvalues, given the conserved solution vector. The eigenvalues are returned as a 3x3 matrix stored in row-major format. It is a diagonal matrix with the eigenvalues as diagonal elements. Admittedly, it is a wasteful way of storing the eigenvalues.

Definition at line 207 of file euler1d.h.

#define _Euler1DLeftEigenvectors_ (   u,
  L,
  p,
  dir 
)
Value:
{ \
double gamma = p->gamma; \
double rho,v,e,P,c; \
rho = u[0]; \
v = u[1] / rho; \
e = u[2]; \
P = (e - 0.5*rho*v*v) * (gamma-1.0); \
c = sqrt(gamma*P/rho); \
L[1*_MODEL_NVARS_+0] = ((gamma - 1)/(rho*c)) * (-(v*v)/2 - c*v/(gamma-1)); \
L[1*_MODEL_NVARS_+1] = ((gamma - 1)/(rho*c)) * (v + c/(gamma-1)); \
L[1*_MODEL_NVARS_+2] = ((gamma - 1)/(rho*c)) * (-1); \
L[0*_MODEL_NVARS_+0] = ((gamma - 1)/(rho*c)) * (rho*(-(v*v)/2+c*c/(gamma-1))/c); \
L[0*_MODEL_NVARS_+1] = ((gamma - 1)/(rho*c)) * (rho*v/c); \
L[0*_MODEL_NVARS_+2] = ((gamma - 1)/(rho*c)) * (-rho/c); \
L[2*_MODEL_NVARS_+0] = ((gamma - 1)/(rho*c)) * ((v*v)/2 - c*v/(gamma-1)); \
L[2*_MODEL_NVARS_+1] = ((gamma - 1)/(rho*c)) * (-v + c/(gamma-1)); \
L[2*_MODEL_NVARS_+2] = ((gamma - 1)/(rho*c)) * (1); \
}
#define _MODEL_NVARS_
Definition: euler1d.h:58

Compute the matrix that has the left-eigenvectors as its rows. Stored in row-major format.

Definition at line 225 of file euler1d.h.

#define _Euler1DRightEigenvectors_ (   u,
  R,
  p,
  dir 
)
Value:
{ \
double gamma = p->gamma; \
double rho,v,e,P,c; \
rho = u[0]; \
v = u[1] / rho; \
e = u[2]; \
P = (e - 0.5*rho*v*v) * (gamma-1.0); \
c = sqrt(gamma*P/rho); \
R[0*_MODEL_NVARS_+1] = - rho/(2*c); R[1*_MODEL_NVARS_+1] = -rho*(v-c)/(2*c); R[2*_MODEL_NVARS_+1] = -rho*((v*v)/2+(c*c)/(gamma-1)-c*v)/(2*c); \
R[0*_MODEL_NVARS_+0] = 1; R[1*_MODEL_NVARS_+0] = v; R[2*_MODEL_NVARS_+0] = v*v / 2; \
R[0*_MODEL_NVARS_+2] = rho/(2*c); R[1*_MODEL_NVARS_+2] = rho*(v+c)/(2*c); R[2*_MODEL_NVARS_+2] = rho*((v*v)/2+(c*c)/(gamma-1)+c*v)/(2*c); \
}
#define _MODEL_NVARS_
Definition: euler1d.h:58

Compute the matrix that has the right-eigenvectors as its columns. Stored in row-major format.

Definition at line 249 of file euler1d.h.

Function Documentation

int Euler1DInitialize ( void *  s,
void *  m 
)

Function to initialize the 1D Euler module

Function to initialize the 1D inviscid Euler equations (Euler1D) module: Sets the default parameters, read in and set physics-related parameters, and set the physics-related function pointers in HyPar.

This file reads the file "physics.inp" that must have the following format:

begin
    <keyword>   <value>
    <keyword>   <value>
    <keyword>   <value>
    ...
    <keyword>   <value>
end

where the list of keywords are:

Keyword name Type Variable Default value
gamma double Euler1D::gamma 1.4
gravity double Euler1D::grav 0.0
grav_type int Euler1D::grav_type 0
upwinding char[] Euler1D::upw_choice "roe" (_ROE_)

Note: "physics.inp" is optional; if absent, default values will be used.

Parameters
sSolver object of type HyPar
mObject of type MPIVariables containing MPI-related info

Definition at line 71 of file Euler1DInitialize.c.

75 {
76  HyPar *solver = (HyPar*) s;
77  MPIVariables *mpi = (MPIVariables*) m;
78  Euler1D *physics = (Euler1D*) solver->physics;
79  int ferr, d;
80 
81  static int count = 0;
82 
83  if (solver->nvars != _MODEL_NVARS_) {
84  fprintf(stderr,"Error in Euler1DInitialize(): nvars has to be %d.\n",_MODEL_NVARS_);
85  return(1);
86  }
87  if (solver->ndims != _MODEL_NDIMS_) {
88  fprintf(stderr,"Error in Euler1DInitialize(): ndims has to be %d.\n",_MODEL_NDIMS_);
89  return(1);
90  }
91 
92  /* default values */
93  physics->gamma = 1.4;
94  physics->grav = 0.0;
95  physics->grav_type = 0;
96  strcpy(physics->upw_choice,"roe");
97 
98  /* reading physical model specific inputs */
99  if (!mpi->rank) {
100  FILE *in;
101  if (!count) printf("Reading physical model inputs from file \"physics.inp\".\n");
102  in = fopen("physics.inp","r");
103  if (!in) printf("Warning: File \"physics.inp\" not found. Using default values.\n");
104  else {
105  char word[_MAX_STRING_SIZE_];
106  ferr = fscanf(in,"%s",word); if (ferr != 1) return(1);
107  if (!strcmp(word, "begin")){
108  while (strcmp(word, "end")){
109  ferr = fscanf(in,"%s",word); if (ferr != 1) return(1);
110  if (!strcmp(word, "gamma")) {
111  ferr = fscanf(in,"%lf",&physics->gamma);
112  if (ferr != 1) return(1);
113  } else if (!strcmp(word, "gravity")) {
114  ferr = fscanf(in,"%lf",&physics->grav);
115  if (ferr != 1) return(1);
116  } else if (!strcmp(word, "gravity_type")) {
117  ferr = fscanf(in,"%d",&physics->grav_type);
118  if (ferr != 1) return(1);
119  } else if (!strcmp(word,"upwinding")) {
120  ferr = fscanf(in,"%s",physics->upw_choice);
121  if (ferr != 1) return(1);
122  } else if (strcmp(word,"end")) {
123  char useless[_MAX_STRING_SIZE_];
124  ferr = fscanf(in,"%s",useless); if (ferr != 1) return(ferr);
125  printf("Warning: keyword %s in file \"physics.inp\" with value %s not ",word,useless);
126  printf("recognized or extraneous. Ignoring.\n");
127  }
128  }
129  } else {
130  fprintf(stderr,"Error: Illegal format in file \"physics.inp\".\n");
131  return(1);
132  }
133  }
134  fclose(in);
135  }
136 
137 #ifndef serial
138  IERR MPIBroadcast_double (&physics->gamma ,1,0,&mpi->world); CHECKERR(ierr);
139  IERR MPIBroadcast_double (&physics->grav ,1,0,&mpi->world); CHECKERR(ierr);
140  IERR MPIBroadcast_integer (&physics->grav_type,1,0,&mpi->world); CHECKERR(ierr);
142 #endif
143 
144  if ((physics->grav != 0.0) && (strcmp(physics->upw_choice,_LLF_)) && (strcmp(physics->upw_choice,_ROE_))) {
145  if (!mpi->rank) {
146  fprintf(stderr,"Error in Euler1DInitialize: %s or %s upwinding is needed for flows ",_LLF_,_ROE_);
147  fprintf(stderr,"with gravitational forces.\n");
148  }
149  return(1);
150  }
151 
152  /* initializing physical model-specific functions */
153  solver->PreStep = Euler1DPreStep;
154  solver->ComputeCFL = Euler1DComputeCFL;
155  solver->FFunction = Euler1DFlux;
156  solver->SFunction = Euler1DSource;
158  if (!strcmp(physics->upw_choice,_ROE_ )) solver->Upwind = Euler1DUpwindRoe;
159  else if (!strcmp(physics->upw_choice,_RF_ )) solver->Upwind = Euler1DUpwindRF;
160  else if (!strcmp(physics->upw_choice,_LLF_ )) solver->Upwind = Euler1DUpwindLLF;
161  else if (!strcmp(physics->upw_choice,_SWFS_ )) solver->Upwind = Euler1DUpwindSWFS;
162  else if (!strcmp(physics->upw_choice,_RUSANOV_)) solver->Upwind = Euler1DUpwindRusanov;
163  else {
164  if (!mpi->rank) fprintf(stderr,"Error in Euler1DInitialize(): %s is not a valid upwinding scheme.\n",
165  physics->upw_choice);
166  return(1);
167  }
168  if (!strcmp(solver->SplitHyperbolicFlux,"yes")) {
169  solver->dFFunction = Euler1DStiffFlux;
171  if (!strcmp(physics->upw_choice,_ROE_ )) solver->UpwinddF = Euler1DUpwinddFRoe;
172  else if (!strcmp(physics->upw_choice,_RF_ )) solver->UpwinddF = Euler1DUpwinddFRF;
173  else if (!strcmp(physics->upw_choice,_LLF_ )) solver->UpwinddF = Euler1DUpwinddFLLF;
174  else {
175  if (!mpi->rank) {
176  fprintf(stderr,"Error in Euler1DInitialize(): %s is not a valid upwinding scheme ",
177  physics->upw_choice);
178  fprintf(stderr,"when split form of the hyperbolic flux is used. Use %s, %s or %s.\n",
179  _ROE_,_RF_,_LLF_);
180  }
181  return(1);
182  }
183  } else {
184  solver->dFFunction = NULL;
185  solver->UpwinddF = NULL;
186  solver->JFunction = Euler1DJacobian;
187  }
191 
192  if (!strcmp(physics->upw_choice,_LLF_ )) physics->SourceUpwind = Euler1DSourceUpwindLLF;
193  else if (!strcmp(physics->upw_choice,_ROE_ )) physics->SourceUpwind = Euler1DSourceUpwindRoe;
194 
195  /* allocate array to hold the gravity field */
196  int *dim = solver->dim_local;
197  int ghosts = solver->ghosts;
198  int size = 1; for (d=0; d<_MODEL_NDIMS_; d++) size *= (dim[d] + 2*ghosts);
199  physics->grav_field = (double*) calloc (size, sizeof(double));
200  physics->fast_jac = (double*) calloc (size*_MODEL_NVARS_*_MODEL_NVARS_, sizeof(double));
201  physics->solution = (double*) calloc (size*_MODEL_NVARS_, sizeof(double));
202  IERR Euler1DGravityField(solver,mpi); CHECKERR(ierr);
203 
204  count++;
205  return(0);
206 }
int(* JFunction)(double *, double *, void *, int, int, int)
Definition: hypar.h:326
int(* dFFunction)(double *, double *, int, void *, double)
Definition: hypar.h:280
int Euler1DUpwindSWFS(double *, double *, double *, double *, double *, double *, int, void *, double)
double(* ComputeCFL)(void *, void *, double, double)
Definition: hypar.h:269
int Euler1DPreStep(double *, void *, void *, double)
int MPIBroadcast_double(double *, int, int, void *)
Definition: MPIBroadcast.c:9
int Euler1DModifiedSolution(double *, double *, int, void *, void *, double)
#define _MODEL_NVARS_
Definition: euler1d.h:58
double Euler1DComputeCFL(void *s, void *m, double dt, double t)
int Euler1DGravityField(void *s, void *m)
void * physics
Definition: hypar.h:266
int(* Upwind)(double *, double *, double *, double *, double *, double *, int, void *, double)
Definition: hypar.h:295
int(* GetRightEigenvectors)(double *, double *, void *, int)
Definition: hypar.h:359
#define _LLF_
Definition: euler1d.h:66
int(* UpwinddF)(double *, double *, double *, double *, double *, double *, int, void *, double)
Definition: hypar.h:300
int * dim_local
Definition: hypar.h:37
int Euler1DRightEigenvectors(double *u, double *R, void *p, int dir)
Definition: Euler1DEigen.c:38
int(* FFunction)(double *, double *, int, void *, double)
Definition: hypar.h:276
#define _MODEL_NDIMS_
Definition: euler1d.h:56
int ghosts
Definition: hypar.h:52
#define _SWFS_
Definition: euler1d.h:68
MPI_Comm world
#define _MAX_STRING_SIZE_
Definition: basic.h:14
int(* AveragingFunction)(double *, double *, double *, void *)
Definition: hypar.h:354
int Euler1DStiffFlux(double *f, double *u, int dir, void *s, double t)
Definition: Euler1DFlux.c:64
int Euler1DRoeAverage(double *uavg, double *uL, double *uR, void *p)
#define _RUSANOV_
Definition: euler1d.h:70
int(* GetLeftEigenvectors)(double *, double *, void *, int)
Definition: hypar.h:357
int Euler1DUpwinddFLLF(double *, double *, double *, double *, double *, double *, int, void *, double)
int Euler1DSourceUpwindRoe(double *, double *, double *, double *, int, void *, double)
#define _ROE_
Definition: euler1d.h:62
double * fast_jac
Definition: euler1d.h:289
int(* SFunction)(double *, double *, void *, void *, double)
Definition: hypar.h:317
int Euler1DUpwindRF(double *, double *, double *, double *, double *, double *, int, void *, double)
int nvars
Definition: hypar.h:29
#define CHECKERR(ierr)
Definition: basic.h:18
int Euler1DSourceUpwindLLF(double *, double *, double *, double *, int, void *, double)
double * solution
Definition: euler1d.h:290
int Euler1DLeftEigenvectors(double *u, double *L, void *p, int dir)
Definition: Euler1DEigen.c:19
int(* UFunction)(double *, double *, int, void *, void *, double)
Definition: hypar.h:321
int MPIBroadcast_character(char *, int, int, void *)
Definition: MPIBroadcast.c:37
int grav_type
Definition: euler1d.h:286
int Euler1DUpwindLLF(double *, double *, double *, double *, double *, double *, int, void *, double)
int Euler1DSource(double *, double *, void *, void *, double)
Definition: Euler1DSource.c:23
double * grav_field
Definition: euler1d.h:288
int Euler1DUpwinddFRoe(double *, double *, double *, double *, double *, double *, int, void *, double)
int Euler1DFlux(double *f, double *u, int dir, void *s, double t)
Definition: Euler1DFlux.c:16
char SplitHyperbolicFlux[_MAX_STRING_SIZE_]
Definition: hypar.h:92
int ndims
Definition: hypar.h:26
#define _RF_
Definition: euler1d.h:64
int Euler1DUpwindRoe(double *, double *, double *, double *, double *, double *, int, void *, double)
Definition: Euler1DUpwind.c:30
#define IERR
Definition: basic.h:16
char upw_choice[_MAX_STRING_SIZE_]
Definition: euler1d.h:291
int(* PreStep)(double *, void *, void *, double)
Definition: hypar.h:339
int Euler1DStiffJacobian(double *, double *, void *, int, int, int)
Structure of MPI-related variables.
int(* SourceUpwind)(double *, double *, double *, double *, int, void *, double)
Definition: euler1d.h:300
Structure containing all solver-specific variables and functions.
Definition: hypar.h:23
Structure containing variables and parameters specific to the 1D Euler equations. This structure cont...
Definition: euler1d.h:273
int Euler1DUpwinddFRF(double *, double *, double *, double *, double *, double *, int, void *, double)
double gamma
Definition: euler1d.h:274
double grav
Definition: euler1d.h:275
int Euler1DUpwindRusanov(double *, double *, double *, double *, double *, double *, int, void *, double)
int MPIBroadcast_integer(int *, int, int, void *)
Definition: MPIBroadcast.c:23
int Euler1DJacobian(double *, double *, void *, int, int, int)
int Euler1DCleanup ( void *  s)

Function to clean up the 1D Euler module

Function to clean up all physics-related allocations for the 1D Euler equations

Parameters
sSolver object of type HyPar

Definition at line 10 of file Euler1DCleanup.c.

13 {
14  Euler1D *param = (Euler1D*) s;
15  free(param->grav_field);
16  free(param->fast_jac);
17  free(param->solution);
18  return(0);
19 }
double * fast_jac
Definition: euler1d.h:289
double * solution
Definition: euler1d.h:290
double * grav_field
Definition: euler1d.h:288
Structure containing variables and parameters specific to the 1D Euler equations. This structure cont...
Definition: euler1d.h:273