(9)

Class to solve the Inviscid compressible fluid flows (Euler equations) for perfect gas in 1-D. More...

Inheritance diagram for ICPG1D:
Muscl1D Muscl

Public Member Functions

 ICPG1D (Mesh &ms)
 Constructor using Mesh instance.
 
 ICPG1D (Mesh &ms, Vect< real_t > &r, Vect< real_t > &v, Vect< real_t > &p)
 Constructor using mesh and initial data. More...
 
 ~ICPG1D ()
 Destructor.
 
void setReconstruction ()
 Set reconstruction from class Muscl.
 
real_t runOneTimeStep ()
 Advance one time step.
 
void Forward (const Vect< real_t > &flux, Vect< real_t > &field)
 Add flux to field. More...
 
void setSolver (SolverType solver)
 Choose solver type.
 
void setGamma (real_t gamma)
 Set value of constant Gamma for gases.
 
void setCv (real_t Cv)
 Set value of Cv (specific heat at constant volume)
 
void setCp (real_t Cp)
 Set value of Cp (specific heat at constant pressure)
 
void setKappa (real_t Kappa)
 Set value of constant Kappa.
 
real_t getGamma () const
 Return value of constant Gamma.
 
real_t getCv () const
 Return value of Cv (specific heat at constant volume)
 
real_t getCp () const
 Return value of Cp (specific heat at constant pressure)
 
real_t getKappa () const
 Return value of constant Kappa.
 
void getMomentum (Vect< real_t > &m) const
 Get vector of momentum at elements. More...
 
void getInternalEnergy (Vect< real_t > &ie) const
 Get vector of internal energy at elements. More...
 
void getTotalEnergy (Vect< real_t > &te) const
 Get vector of total energy at elements. More...
 
void getSoundSpeed (Vect< real_t > &s) const
 Get vector of sound speed at elements. More...
 
void getMach (Vect< real_t > &m) const
 Get vector of elementwise Mach number. More...
 
void setInitialCondition_shock_tube (const LocalVect< real_t, 3 > &BcG, const LocalVect< real_t, 3 > &BcD, real_t x0)
 Initial condition corresponding to the shock tube.
 
void setInitialCondition (const LocalVect< real_t, 3 > &u)
 A constant initial condition. More...
 
void setBC (const Side &sd, real_t u)
 Assign a boundary condition as a constant to a given side. More...
 
void setBC (int code, real_t a)
 Assign a boundary condition value. More...
 
void setBC (real_t a)
 Assign a boundary condition value. More...
 
void setBC (const Side &sd, const LocalVect< real_t, 3 > &u)
 Assign a Dirichlet boundary condition vector. More...
 
void setBC (int code, const LocalVect< real_t, 3 > &U)
 Assign a Dirichlet boundary condition vector. More...
 
void setBC (const LocalVect< real_t, 3 > &u)
 Assign a Dirichlet boundary condition vector. More...
 
void setInOutflowBC (const Side &sd, const LocalVect< real_t, 3 > &u)
 Impose a constant inflow or outflow boundary condition on a given side. More...
 
void setInOutflowBC (int code, const LocalVect< real_t, 3 > &u)
 Impose a constant inflow or outflow boundary condition on sides with a given code. More...
 
void setInOutflowBC (const LocalVect< real_t, 3 > &u)
 Impose a constant inflow or outflow boundary condition on boundary sides. More...
 
- Public Member Functions inherited from Muscl1D
 Muscl1D (Mesh &m)
 Constructor using mesh instance.
 
 ~Muscl1D ()
 Destructor.
 
real_t getMeanLength () const
 Return mean length.
 
real_t getMaximumLength () const
 Return maximal length.
 
real_t getMinimumLength () const
 Return mimal length.
 
real_t getTauLim () const
 Return mean length.
 
void print_mesh_stat ()
 Output mesh information.
 
- Public Member Functions inherited from Muscl
 Muscl (Mesh &m)
 Constructor using mesh instance.
 
virtual ~Muscl ()
 Destructor.
 
void setTimeStep (real_t dt)
 Assign time step value. More...
 
real_t getTimeStep () const
 Return time step value.
 
void setCFL (real_t CFL)
 Assign CFL value. More...
 
real_t getCFL () const
 Return CFL value.
 
void setReferenceLength (real_t dx)
 Assign reference length value. More...
 
real_t getReferenceLength () const
 Return reference length.
 
MeshgetMesh () const
 Return reference to Mesh instance.
 
void setVerbose (int v)
 Set verbosity parameter. More...
 
bool setReconstruction (const Vect< real_t > &U, Vect< real_t > &LU, Vect< real_t > &RU, size_t dof)
 Function to reconstruct by the Muscl method. More...
 
void setMethod (const Method &s)
 Choose a flux solver. More...
 
void setSolidZoneCode (int c)
 Choose a code for solid zone.
 
bool getSolidZone () const
 Return flag for presence of solid zones.
 
int getSolidZoneCode () const
 Return code of solid zone, 0 if this one is not present.
 
void setLimiter (Limiter l)
 Choose a flux limiter. More...
 

Additional Inherited Members

- Public Types inherited from Muscl
enum  Method {
  FIRST_ORDER_METHOD = 0,
  MULTI_SLOPE_Q_METHOD = 1,
  MULTI_SLOPE_M_METHOD = 2
}
 Enumeration for flux choice. More...
 
enum  Limiter {
  MINMOD_LIMITER = 0,
  VANLEER_LIMITER = 1,
  SUPERBEE_LIMITER = 2,
  VANALBADA_LIMITER = 3,
  MAX_LIMITER = 4
}
 Enumeration of flux limiting methods. More...
 
enum  SolverType {
  ROE_SOLVER = 0,
  VFROE_SOLVER = 1,
  LF_SOLVER = 2,
  RUSANOV_SOLVER = 3,
  HLL_SOLVER = 4,
  HLLC_SOLVER = 5,
  MAX_SOLVER = 6
}
 Enumeration of various solvers for the Riemann problem. More...
 

Detailed Description

Class to solve the Inviscid compressible fluid flows (Euler equations) for perfect gas in 1-D.

Solution method is a second-order MUSCL Finite Volume scheme

Author
S. Clain, V. Clauzon

Constructor & Destructor Documentation

◆ ICPG1D()

ICPG1D ( Mesh ms,
Vect< real_t > &  r,
Vect< real_t > &  v,
Vect< real_t > &  p 
)

Constructor using mesh and initial data.

Parameters
[in]msReference to Mesh instance
[in]rVector containing initial (elementwise) density
[in]vVector containing initial (elementwise) velocity
[in]pVector containing initial (elementwise) pressure

Member Function Documentation

◆ Forward()

void Forward ( const Vect< real_t > &  flux,
Vect< real_t > &  field 
)

Add flux to field.

If this function is used, the user must call getFlux himself

Parameters
[in]fluxVector containing fluxes at sides (points)
[out]fieldVector containing solution vector

◆ getInternalEnergy()

void getInternalEnergy ( Vect< real_t > &  ie) const

Get vector of internal energy at elements.

Parameters
[in,out]ieVect instance that contains on output element internal energy

◆ getMach()

void getMach ( Vect< real_t > &  m) const

Get vector of elementwise Mach number.

Parameters
[in,out]mVect instance that contains on output element Mach number

◆ getMomentum()

void getMomentum ( Vect< real_t > &  m) const

Get vector of momentum at elements.

Parameters
[in,out]mVect instance that contains on output element momentum

◆ getSoundSpeed()

void getSoundSpeed ( Vect< real_t > &  s) const

Get vector of sound speed at elements.

Parameters
[in,out]sVect instance that contains on output element sound speed

◆ getTotalEnergy()

void getTotalEnergy ( Vect< real_t > &  te) const

Get vector of total energy at elements.

Parameters
[in,out]teVect instance that contains on output element total energy

◆ setBC() [1/6]

void setBC ( const Side sd,
real_t  u 
)

Assign a boundary condition as a constant to a given side.

Parameters
[in]sdSide to which the value is assigned
[in]uValue to assign

◆ setBC() [2/6]

void setBC ( int  code,
real_t  a 
)

Assign a boundary condition value.

Parameters
[in]codeCode value to which boundary condition is assigned
[in]aValue to assign to sides that have code code

◆ setBC() [3/6]

void setBC ( real_t  a)

Assign a boundary condition value.

Parameters
[in]aValue to assign to all boundary sides

◆ setBC() [4/6]

void setBC ( const Side sd,
const LocalVect< real_t, 3 > &  u 
)

Assign a Dirichlet boundary condition vector.

Parameters
[in]sdSide instance to which the values are assigned
[in]uLocalVect instance that contains values to assign to the side

◆ setBC() [5/6]

void setBC ( int  code,
const LocalVect< real_t, 3 > &  U 
)

Assign a Dirichlet boundary condition vector.

Parameters
[in]codeSide code for which the values are assigned
[in]ULocalVect instance that contains values to assign to sides with code code

◆ setBC() [6/6]

void setBC ( const LocalVect< real_t, 3 > &  u)

Assign a Dirichlet boundary condition vector.

Parameters
[in]uLocalVect instance that contains values to assign to all boundary sides

◆ setInitialCondition()

void setInitialCondition ( const LocalVect< real_t, 3 > &  u)

A constant initial condition.

Parameters
[in]uLocalVect instance containing density, velocity and pressure

◆ setInOutflowBC() [1/3]

void setInOutflowBC ( const Side sd,
const LocalVect< real_t, 3 > &  u 
)

Impose a constant inflow or outflow boundary condition on a given side.

Parameters
[in]sdInstance of Side on which the condition is prescribed
[in]uLocalVect instance that contains values to assign to the side

◆ setInOutflowBC() [2/3]

void setInOutflowBC ( int  code,
const LocalVect< real_t, 3 > &  u 
)

Impose a constant inflow or outflow boundary condition on sides with a given code.

Parameters
[in]codeValue of code for which the condition is prescribed
[in]uLocalVect instance that contains values to assign to the sides

◆ setInOutflowBC() [3/3]

void setInOutflowBC ( const LocalVect< real_t, 3 > &  u)

Impose a constant inflow or outflow boundary condition on boundary sides.

Parameters
[in]uLocalVect instance that contains values to assign to the sides