Class to solve the Inviscid compressible fluid flows (Euler equations) for perfect gas in 1-D. More...
#include <ICPG1D.h>
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. | |
~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. | |
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. | |
void | getInternalEnergy (Vect< real_t > &ie) const |
Get vector of internal energy at elements. | |
void | getTotalEnergy (Vect< real_t > &te) const |
Get vector of total energy at elements. | |
void | getSoundSpeed (Vect< real_t > &s) const |
Get vector of sound speed at elements. | |
void | getMach (Vect< real_t > &m) const |
Get vector of elementwise Mach number. | |
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. | |
void | setBC (const Side &sd, real_t u) |
Assign a boundary condition as a constant to a given side. | |
void | setBC (int code, real_t a) |
Assign a boundary condition value. | |
void | setBC (real_t a) |
Assign a boundary condition value. | |
void | setBC (const Side &sd, const LocalVect< real_t, 3 > &u) |
Assign a Dirichlet boundary condition vector. | |
void | setBC (int code, const LocalVect< real_t, 3 > &U) |
Assign a Dirichlet boundary condition vector. | |
void | setBC (const LocalVect< real_t, 3 > &u) |
Assign a Dirichlet boundary condition vector. | |
void | setInOutflowBC (const Side &sd, const LocalVect< real_t, 3 > &u) |
Impose a constant inflow or outflow boundary condition on a given side. | |
void | setInOutflowBC (int code, const LocalVect< real_t, 3 > &u) |
Impose a constant inflow or outflow boundary condition on sides with a given code. | |
void | setInOutflowBC (const LocalVect< real_t, 3 > &u) |
Impose a constant inflow or outflow boundary condition on boundary sides. | |
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. | |
real_t | getTimeStep () const |
Return time step value. | |
void | setCFL (real_t CFL) |
Assign CFL value. | |
real_t | getCFL () const |
Return CFL value. | |
void | setReferenceLength (real_t dx) |
Assign reference length value. | |
real_t | getReferenceLength () const |
Return reference length. | |
Mesh & | getMesh () const |
Return reference to Mesh instance. | |
void | setVerbose (int v) |
Set verbosity parameter. | |
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. | |
void | setMethod (const Method &s) |
Choose a flux solver. | |
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. | |
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... | |
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
Constructor using mesh and initial data.
[in] | ms | Reference to Mesh instance |
[in] | r | Vector containing initial (elementwise) density |
[in] | v | Vector containing initial (elementwise) velocity |
[in] | p | Vector containing initial (elementwise) pressure |
Add flux to field.
If this function is used, the user must call getFlux himself
[in] | flux | Vector containing fluxes at sides (points) |
[out] | field | Vector containing solution vector |
void getInternalEnergy | ( | Vect< real_t > & | ie | ) | const |
Get vector of internal energy at elements.
[in,out] | ie | Vect instance that contains on output element internal energy |
void getMach | ( | Vect< real_t > & | m | ) | const |
Get vector of elementwise Mach number.
[in,out] | m | Vect instance that contains on output element Mach number |
void getMomentum | ( | Vect< real_t > & | m | ) | const |
Get vector of momentum at elements.
[in,out] | m | Vect instance that contains on output element momentum |
void getSoundSpeed | ( | Vect< real_t > & | s | ) | const |
Get vector of sound speed at elements.
[in,out] | s | Vect instance that contains on output element sound speed |
void getTotalEnergy | ( | Vect< real_t > & | te | ) | const |
Get vector of total energy at elements.
[in,out] | te | Vect instance that contains on output element total energy |
void setBC | ( | const LocalVect< real_t, 3 > & | u | ) |
Assign a Dirichlet boundary condition vector.
[in] | u | LocalVect instance that contains values to assign to all boundary sides |
void setBC | ( | const Side & | sd, |
real_t | u | ||
) |
Assign a boundary condition as a constant to a given side.
[in] | sd | Side to which the value is assigned |
[in] | u | Value to assign |
void setBC | ( | int | code, |
const LocalVect< real_t, 3 > & | U | ||
) |
void setBC | ( | int | code, |
real_t | a | ||
) |
Assign a boundary condition value.
[in] | code | Code value to which boundary condition is assigned |
[in] | a | Value to assign to sides that have code code |
void setBC | ( | real_t | a | ) |
Assign a boundary condition value.
[in] | a | Value to assign to all boundary sides |
void setInitialCondition | ( | const LocalVect< real_t, 3 > & | u | ) |
A constant initial condition.
[in] | u | LocalVect instance containing density, velocity and pressure |
void setInOutflowBC | ( | const LocalVect< real_t, 3 > & | u | ) |
Impose a constant inflow or outflow boundary condition on boundary sides.
[in] | u | LocalVect instance that contains values to assign to the sides |