![]() |
ECOGEN 4.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
|
Abstract class for mathematical flow models. More...
#include <Model.h>
Inherited by ModEuler, ModEulerHomogeneous, ModEulerKorteweg, ModPTUEq, ModUEq, and ModUEqTotEnergy.
Public Member Functions | |
Model (const std::string &name, const int &numbTransports) | |
Generic model constructor. | |
virtual | ~Model () |
virtual void | allocateCons (Flux **) |
Allocate conservative variable arrays. | |
virtual void | allocatePhase (Phase **) |
Instanciate fluid phase variable. | |
virtual void | allocatePhaseSolid (Phase **) |
Instanciate solid phase variable. | |
virtual void | allocatePhaseGradient (GradPhase **) |
Instanciate gradient phase variable. | |
virtual void | allocatePhaseSolidGradient (GradPhase **) |
Instanciate gradient solid-phase variable. | |
virtual void | allocateMixture (Mixture **) |
Instanciate mixture variable. | |
virtual void | allocateMixtureGradient (GradMixture **) |
Instanciate gradient mixture variable. | |
void | allocateEos (Cell &cell) const |
Associate equations of state. | |
void | initializeRelaxation (Cell *cell) const |
Initialize the theoritical critical pressure of the fluid (only required for PTMu relax) | |
virtual void | fulfillState (Phase **, Mixture *) |
Complete a thermodynamics state frome minimum variables depending on the model. | |
virtual void | fulfillStateRestart (Phase **, Mixture *) |
Complete some variables if necessary when restarting a simulation. | |
virtual void | initializeAugmentedVariables (Cell *) |
Complete the augmented variables (such as the ones of Euler-Korteweg model) | |
virtual void | solveRiemannIntern (Cell &, Cell &, const double &, const double &, double &, std::vector< double > &=DEFAULT_VEC_INTERFACE_DATA) const |
Cell to cell Riemann solver. | |
virtual void | solveRiemannInternMRF (Cell &, Cell &, const double &, const double &, double &, const Coord &, const Coord &, const Coord &, const Coord &, const Coord &) const |
Cell to cell Riemann solver + compute fluxBuffMRF for MRF interface. | |
virtual void | solveRiemannWall (Cell &, const double &, double &, std::vector< double > &) const |
Wall half Riemann solver. | |
virtual void | solveRiemannPiston (Cell &, const double &, double &, std::vector< double > &, const double &) const |
Piston half Riemann solver. | |
virtual void | solveRiemannInletTank (Cell &, const double &, double &, const double *, const double *, const double &, const double &, std::vector< double > &) const |
Inlet tank half Riemann solver. | |
virtual void | solveRiemannInletInjStagState (Cell &, const double &, double &, const double, const double *, const double *, const double *, std::vector< double > &) const |
Inlet injection using stagnation state half Riemann solver. | |
virtual void | solveRiemannInletInjTemp (Cell &, const double &, double &, const double, const double *, const double *, std::vector< double > &) const |
Inlet injection using temperature half Riemann solver. | |
virtual void | solveRiemannOutletPressure (Cell &, const double &, double &, const double, std::vector< double > &) const |
Outlet at imposed pressure half Riemann solver. | |
virtual void | solveRiemannOutletMassflow (Cell &, const double &, double &, const double, std::vector< double > &) const |
Outlet at imposed massflow half Riemann solver. | |
virtual void | solveRiemannNullFlux () const |
No flux half Riemann solver (return null flux to use with 1D geometry with smooth varying cross section) | |
virtual void | solveRiemannTransportIntern (Cell &, Cell &) |
Cell to cell Riemann solver for transport equations. | |
virtual void | solveRiemannTransportWall () |
Wall half Riemann solver for transport equations. | |
virtual void | solveRiemannTransportPiston (Cell &, double) |
Piston half Riemann solver for transport equations. | |
virtual void | solveRiemannTransportInletInjStagState (Cell &, double *) |
Inlet injection using stagnation state half Riemann solver for transport equations. | |
virtual void | solveRiemannTransportInletTank (Cell &, double *) |
Inlet tank half Riemann solver for transport equations. | |
virtual void | solveRiemannTransportOutletPressure (Cell &, double *) |
Outlet at imposed pressure half Riemann solver for transport equations. | |
virtual void | reverseProjection (const Coord, const Coord, const Coord) const |
Flux reverse projection in the absolute Cartesian coordinate system. | |
void | relaxations (Cell *cell, const double &dt, Prim type=vecPhases) const |
virtual void | lowMachSoundSpeed (double &, const double &, double &, const double &=Errors::defaultDouble, double &=Tools::uselessDouble) const |
virtual void | addNonConsMrfFlux (Phase **) |
virtual void | reverseProjectionMrfFlux (const Coord, const Coord, const Coord) const |
virtual void | readCompactionParameters (tinyxml2::XMLElement *, std::string, const int &) |
Read compaction parameters. | |
virtual bool | compaction (const int &) const |
Return if compaction is activated or not. | |
virtual const double & | getDensityReference (const int &) const |
Return the compaction reference density of phase k. | |
virtual double | computeEnergyCompaction (const int &, const double &, const double &, const double &) const |
Return the compaction energy of the fluid/solid. | |
virtual double | computeCompactionPressure (const int &, const double &, const double &, const double &) const |
Compute the compaction pressure of the fluid/solid for relaxation. | |
virtual double | computeDerivativeCompactionFunctionF (const int &, const double &, const double &) const |
Compute the derivative of the compaction function f with respect to xi. | |
virtual double | computeCompactionPlasticity (const int &, const double &, const double &, const double &, const double &) const |
Compute the compaction plasticity term of the fluid/solid for relaxation. | |
virtual void | readSolidParameters (tinyxml2::XMLElement *, std::string, const int &) |
Read solid parameters. | |
virtual const double * | getDensityReference () const |
Return the reference density for each phase. | |
virtual const double * | getElasticParameterA () const |
Return the elastic parameter a of the one-parameter model for each phase. | |
virtual const double * | getShearModulus () const |
Return the shear modulus for each phase. | |
virtual const double * | getElasticityLimit () const |
Return the limit of elasticity for each phase. | |
virtual double | computeElasticEnergy (const int &, const Tensor &) const |
Compute the elastic energy of the solid. | |
virtual void | computeElasticEnergyAndStressTensor (const int &, const Tensor &, const double &, const double &, double &, Tensor &) const |
Compute the elastic energy and stress tensor of the solid. | |
virtual double | computeSquareLongitudinalWaveSpeed (const int &, const Phase &) |
Compute the square longitudinal wave speed of the solid. | |
virtual double | selectScalar (Phase **, Mixture *, Transport *, Variable, int=0) const |
Select a specific scalar variable. | |
virtual const double & | getSM () |
Return the local fluid velocity. | |
virtual const Coord & | getVelocity (const Cell *) const |
Return the fluid velocity of the corresponding cell. | |
virtual Coord & | getVelocity (Cell *) |
virtual const Coord & | getVectorP (const Cell *) const |
virtual Coord & | getVectorP (Cell *) |
std::vector< Relaxation * > * | getRelaxations () |
void | printInfo () const |
virtual const std::string & | whoAmI () const |
virtual void | setSmoothCrossSection1d (const bool &) |
virtual const bool & | isSmoothCrossSection1d () const |
virtual void | setLowMach (const bool &) |
virtual void | setMachRefMin (const double &) |
Protected Attributes | |
std::string | m_name |
Name of the required model. | |
std::vector< Relaxation * > | m_relaxations |
Vector of relaxation procedure. | |
bool | m_lowMach |
Low-Mach preconditioning (default: false) | |
double | m_machRefMin |
Minimum Mach number limit for L-M preconditionning used when local Mach number is below this value (default: 0.01) | |
bool | m_smoothCrossSection1d |
1D geometry with smooth cross section variation (default: false) | |
Abstract class for mathematical flow models.
Model::Model | ( | const std::string & | name, |
const int & | numbTransports | ||
) |
Generic model constructor.
name | model name |
numbTransports | number of additional transport equations |
|
virtual |
|
inlinevirtual |
|
inlinevirtual |
Allocate conservative variable arrays.
cons | conservative variable array to allocate |
Reimplemented in ModEuler, ModEulerHomogeneous, ModEulerKorteweg, ModNonLinearSchrodinger, ModPTUEq, ModPUEq, ModUEq, and ModUEqTotEnergy.
void Model::allocateEos | ( | Cell & | cell | ) | const |
Associate equations of state.
cell | original cell for equation of state linking |
|
inlinevirtual |
Instanciate mixture variable.
mixture | mixture to instanciate |
Reimplemented in ModEuler, ModEulerHomogeneous, ModEulerKorteweg, ModNonLinearSchrodinger, ModPTUEq, ModPUEq, ModUEq, and ModUEqTotEnergy.
|
inlinevirtual |
Instanciate gradient mixture variable.
mixture | mixture to instanciate |
Reimplemented in ModEuler, ModEulerHomogeneous, ModPTUEq, and ModUEq.
|
inlinevirtual |
Instanciate fluid phase variable.
phase | phase to instanciate |
Reimplemented in ModEuler, ModEulerHomogeneous, ModEulerKorteweg, ModNonLinearSchrodinger, ModPTUEq, ModPUEq, ModUEq, and ModUEqTotEnergy.
|
inlinevirtual |
Instanciate gradient phase variable.
phase | phase to instanciate |
Reimplemented in ModEuler, ModEulerHomogeneous, ModPTUEq, and ModUEq.
|
inlinevirtual |
Instanciate solid phase variable.
phase | phase to instanciate |
|
inlinevirtual |
Instanciate gradient solid-phase variable.
phase | phase to instanciate |
|
inlinevirtual |
Return if compaction is activated or not.
k | phase number |
|
inlinevirtual |
Compute the compaction plasticity term of the fluid/solid for relaxation.
k | phase number |
alpha | volume fraction ( \( \alpha \)) |
density | density ( \( \rho \)) |
lambda | compaction variable ( \( \lambda \)) |
pc | compaction pressure ( \( p_c \)) return \( \dlambda \) (compaction plasticity) |
|
inlinevirtual |
Compute the compaction pressure of the fluid/solid for relaxation.
k | phase number |
alpha | volume fraction ( \( \alpha \)) |
density | density ( \( \rho \)) |
lambda | compaction variable ( \( \lambda \)) return \( p_c \) (compaction pressure) |
|
inlinevirtual |
Compute the derivative of the compaction function f with respect to xi.
k | phase number |
density | density ( \( \rho \)) |
lambda | compaction variable ( \( \lambda \)) return \( \partial f / \partial \xi \) |
|
inlinevirtual |
Compute the elastic energy of the solid.
k | phase number |
cobase | cobase tensor ( \( e^\beta \)) |
|
inlinevirtual |
Compute the elastic energy and stress tensor of the solid.
k | phase number |
cobase | cobase tensor ( \( e^\beta \)) |
pressure | pressure ( \( p \)) |
density | density ( \( \rho \)) |
elasticEnergy | elastic energy ( \( e^e \)) |
stressTensor | stress tensor ( \( \sigma \)) |
|
inlinevirtual |
Return the compaction energy of the fluid/solid.
k | phase number |
alpha | volume fraction ( \( \alpha \)) |
density | density ( \( \rho \)) |
lambda | compaction variable ( \( \lambda \)) return \( \kappa \) (compaction energy) |
|
inlinevirtual |
Compute the square longitudinal wave speed of the solid.
k | phase number |
phase | phase object |
Complete a thermodynamics state frome minimum variables depending on the model.
phases | phases array variables |
mixture | mixture variables |
Reimplemented in ModEulerKorteweg, ModEuler, ModEulerHomogeneous, ModPTUEq, ModUEq, and ModUEqTotEnergy.
Complete some variables if necessary when restarting a simulation.
phases | phases array variables |
mixture | mixture variables |
Reimplemented in ModEuler, ModEulerHomogeneous, ModEulerKorteweg, ModPTUEq, ModUEq, ModUEqTotEnergy, and ModPUEq.
|
inlinevirtual |
Return the reference density for each phase.
|
inlinevirtual |
Return the compaction reference density of phase k.
k | phase number |
|
inlinevirtual |
Return the limit of elasticity for each phase.
|
inlinevirtual |
Return the elastic parameter a of the one-parameter model for each phase.
|
inline |
|
inlinevirtual |
Return the shear modulus for each phase.
|
inlinevirtual |
Return the local fluid velocity.
Reimplemented in ModEuler, ModEulerHomogeneous, ModEulerKorteweg, ModPTUEq, ModUEq, and ModUEqTotEnergy.
Reimplemented in ModEuler, ModEulerHomogeneous, ModEulerKorteweg, ModPTUEq, ModUEq, and ModUEqTotEnergy.
Return the fluid velocity of the corresponding cell.
cell | pointer to corresponding cell |
Reimplemented in ModEuler, ModEulerHomogeneous, ModEulerKorteweg, ModPTUEq, ModUEq, and ModUEqTotEnergy.
|
inlinevirtual |
Complete the augmented variables (such as the ones of Euler-Korteweg model)
cell | cell |
Reimplemented in ModEuler, ModEulerHomogeneous, ModPTUEq, ModUEq, ModUEqTotEnergy, and ModEulerKorteweg.
void Model::initializeRelaxation | ( | Cell * | cell | ) | const |
Initialize the theoritical critical pressure of the fluid (only required for PTMu relax)
cell | cell to get the eos |
|
inlinevirtual |
|
inlinevirtual |
void Model::printInfo | ( | ) | const |
|
inlinevirtual |
Read compaction parameters.
elementCompaction | XML element |
fileName | string name of readed XML file |
k | phase number |
|
inlinevirtual |
Read solid parameters.
elementSolid | XML element |
fileName | string name of readed XML file |
k | phase number |
|
inlinevirtual |
Flux reverse projection in the absolute Cartesian coordinate system.
normal | normal vector associated to the cell interface |
tangent | tangent vector associated to the cell interface |
binormal | binormal vector associated to the cell interface |
Reimplemented in ModEuler, ModEulerHomogeneous, ModEulerKorteweg, ModPTUEq, ModUEq, and ModUEqTotEnergy.
|
inlinevirtual |
Select a specific scalar variable.
phases | phases array variables |
mixture | mixture variables |
vecTransports | vector of transport variables |
nameVariables | Name of the variable to select |
numPhases | Phases number's |
Reimplemented in ModEuler, ModEulerKorteweg, ModEulerHomogeneous, ModPTUEq, ModPUEq, ModUEq, and ModUEqTotEnergy.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in ModEuler, ModEulerHomogeneous, and ModUEq.
|
inlinevirtual |
Inlet injection using stagnation state half Riemann solver.
cellLeft | left cell |
dxLeft | left characteristic lenght |
dtMax | maximum explicit time step |
m0 | specific mass flow rate (kg.s-1.m-2) |
ak0 | volume fraction array of injected fluids |
rhok0 | density array of injected fluids |
pk0 | pressure array of injected fluids |
boundData | boundary dataset used for output |
|
inlinevirtual |
Inlet injection using temperature half Riemann solver.
cellLeft | left cell |
dxLeft | left characteristic lenght |
dtMax | maximum explicit time step |
m0 | specific mass flow rate (kg.s-1.m-2) |
Tk0 | temperature of injected fluid (same for both phases) |
ak0 | volume fraction of each injected phase |
boundData | boundary dataset used for output |
|
inlinevirtual |
Inlet tank half Riemann solver.
cellLeft | left cell |
dxLeft | left characteristic lenght |
dtMax | maximum explicit time step |
ak0 | volume fraction array of fluids in tank |
rhok0 | density array of fluids in tank |
pk0 | pressure array of fluids in tank |
boundData | boundary dataset used for output |
|
inlinevirtual |
Cell to cell Riemann solver.
cellLeft | left cell |
cellRight | right cell |
dxLeft | left characteristic lenght |
dxRight | right characteristic lenght |
dtMax | maximum explicit time step |
boundData | boundary dataset used for output |
Reimplemented in ModEulerKorteweg, ModEuler, ModEulerHomogeneous, ModPTUEq, ModUEq, and ModUEqTotEnergy.
|
inlinevirtual |
Cell to cell Riemann solver + compute fluxBuffMRF for MRF interface.
cellLeft | left cell |
cellRight | right cell |
dxLeft | left characteristic lenght |
dxRight | right characteristic lenght |
dtMax | maximum explicit time step |
omega | rotating velocity |
normal | face normal |
tangent | face tangent |
binormal | face binormal |
position | face position |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Piston half Riemann solver.
cellLeft | left cell |
dxLeft | left characteristic lenght |
dtMax | maximum explicit time step |
boundData | boundary dataset used for output |
uPiston | piston velocity |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
Reimplemented in ModEuler, ModEulerHomogeneous, ModEulerKorteweg, ModPTUEq, ModUEq, and ModUEqTotEnergy.
|
protected |
Low-Mach preconditioning (default: false)
|
protected |
Minimum Mach number limit for L-M preconditionning used when local Mach number is below this value (default: 0.01)
|
protected |
Name of the required model.
|
protected |
Vector of relaxation procedure.
|
protected |
1D geometry with smooth cross section variation (default: false)