ECOGEN 4.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
ModUEq.h
Go to the documentation of this file.
1//
2// ,---. ,--, .---. ,--, ,---. .-. .-.
3// | .-' .' .') / .-. ) .' .' | .-' | \| |
4// | `-. | |(_) | | |(_) | | __ | `-. | | |
5// | .-' \ \ | | | | \ \ ( _) | .-' | |\ |
6// | `--. \ `-. \ `-' / \ `-) ) | `--. | | |)|
7// /( __.' \____\ )---' )\____/ /( __.' /( (_)
8// (__) (_) (__) (__) (__)
9// Official webSite: https://code-mphi.github.io/ECOGEN/
10//
11// This file is part of ECOGEN.
12//
13// ECOGEN is the legal property of its developers, whose names
14// are listed in the copyright file included with this source
15// distribution.
16//
17// ECOGEN is free software: you can redistribute it and/or modify
18// it under the terms of the GNU General Public License as published
19// by the Free Software Foundation, either version 3 of the License,
20// or (at your option) any later version.
21//
22// ECOGEN is distributed in the hope that it will be useful,
23// but WITHOUT ANY WARRANTY; without even the implied warranty of
24// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25// GNU General Public License for more details.
26//
27// You should have received a copy of the GNU General Public License
28// along with ECOGEN (file LICENSE).
29// If not, see <http://www.gnu.org/licenses/>.
30
31#ifndef MODUEQ_H
32#define MODUEQ_H
33
34#include "../Model.h"
35#include "../../Order1/Cell.h"
36#include "MixUEq.h"
37#include "PhaseUEq.h"
38#include "GradPhaseUEq.h"
39#include "GradMixUEq.h"
40
41class ModUEq;
42
43#include "FluxUEq.h"
44
47class ModUEq : public Model
48{
49 public:
53 ModUEq(const int& numbTransports, const int& numbPhases);
57 ModUEq(const std::string& name, const int& numbTransports);
58 virtual ~ModUEq();
59
60 virtual void allocateCons(Flux** cons);
61 virtual void allocatePhase(Phase** phase);
62 virtual void allocateMixture(Mixture** mixture);
63 virtual void allocatePhaseGradient(GradPhase** phase);
64 virtual void allocateMixtureGradient(GradMixture** mixture);
65
67 virtual void fulfillState(Phase** phases, Mixture* mixture);
68
70 virtual void fulfillStateRestart(Phase** /*phases*/, Mixture* /*mixture*/) {};
71
73 virtual void initializeAugmentedVariables(Cell* /*cell*/) {};
74
75 //Hydrodynamic Riemann solvers
76 //----------------------------
77 virtual void solveRiemannIntern(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, std::vector<double> &boundData = DEFAULT_VEC_INTERFACE_DATA) const; // Riemann between two computed cells
78 virtual void solveRiemannInternMRF(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, const Coord& omega, const Coord& normal, const Coord& tangent, const Coord& binormal, const Coord& position) const;
79 virtual void solveRiemannWall(Cell& cellLeft, const double& dxLeft, double& dtMax, std::vector<double> &boundData) const; // Riemann between left cell and wall
80 virtual void solveRiemannInletTank(Cell& cellLeft, const double& dxLeft, double& dtMax, const double* ak0, const double* rhok0, const double& p0, const double& /*T0*/, std::vector<double> &boundData) const;
81 virtual void solveRiemannInletInjStagState(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* ak0, const double* rhok0, const double* pk0, std::vector<double> &boundData) const;
82 virtual void solveRiemannInletInjTemp(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, const double* Tk0, const double* ak0, std::vector<double> &boundData) const;
83 virtual void solveRiemannOutletPressure(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector<double> &boundData) const;
84 virtual void solveRiemannOutletMassflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, std::vector<double>& boundData) const;
85 virtual void solveRiemannNullFlux() const;
86
87 //Transports Riemann solvers
88 //--------------------------
89 virtual void solveRiemannTransportIntern(Cell& cellLeft, Cell& cellRight);
90 virtual void solveRiemannTransportWall();
91 virtual void solveRiemannTransportPiston(Cell& cellLeft, double uPiston);
92 virtual void solveRiemannTransportInletTank(Cell& cellLeft, double* valueTransports);
93 virtual void solveRiemannTransportInletInjStagState(Cell& cellLeft, double* valueTransports);
94 virtual void solveRiemannTransportOutletPressure(Cell& cellLeft, double* valueTransport);
95
96 virtual void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const;
97
98 //Low-Mach preconditioning
99 //------------------------
100 virtual void lowMachSoundSpeed(double& machRef, const double& uL, double& cL, const double& uR = Errors::defaultDouble, double& cR = Tools::uselessDouble) const;
101 virtual void setLowMach(const bool& lowMach) { m_lowMach = lowMach; };
102 virtual void setMachRefMin(const double& machRefMin) { m_machRefMin = machRefMin; };
103
104 //Moving Reference Frame
105 //----------------------
106 virtual void addNonConsMrfFlux(Phase** phases);
107 virtual void reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const;
108
109 //Accessors
110 //---------
117 virtual double selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num = 0) const;
118 virtual const double& getSM();
119 virtual const Coord& getVelocity(const Cell* cell) const { return cell->getMixture()->getVelocity(); };
120 virtual Coord& getVelocity(Cell* cell) { return cell->getMixture()->getVelocity(); };
121
122 virtual const std::string& whoAmI() const { return m_name; };
123
124 virtual void setSmoothCrossSection1d(const bool& applySmooth) { m_smoothCrossSection1d = applySmooth; };
125
126 private:
127 static const std::string NAME;
128
129 friend class FluxUEq;
130};
131
132#endif // MODUEQ_H
static std::vector< double > DEFAULT_VEC_INTERFACE_DATA(VarBoundary::SIZE, 0.)
Variable
Enumeration for the flow variables.
Definition Tools.h:78
Base class for a mesh cell.
Definition Cell.h:59
virtual Mixture * getMixture(Prim=vecPhases) const
Definition Cell.cpp:536
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
static constexpr double defaultDouble
Definition Errors.h:93
Flux class for the velocity-equilibrium system of equations.
Definition FluxUEq.h:43
Abstract class for conservative variables and fluxes.
Definition Flux.h:43
Mixture variable gradients. Stored for 2nd-order computation on unstructured mesh (O2 NS)
Definition GradMixture.h:45
Phase variable gradients. Stored for 2nd-order computation on unstructured mesh (O2 NS)
Definition GradPhase.h:44
Abstract class for mixture variables.
Definition Mixture.h:43
virtual const Coord & getVelocity() const
Definition Mixture.h:194
Model class for the velocity-equilibrium system of equations.
Definition ModUEq.h:48
virtual void fulfillState(Phase **phases, Mixture *mixture)
Definition ModUEq.cpp:99
virtual void solveRiemannTransportInletTank(Cell &cellLeft, double *valueTransports)
Inlet tank half Riemann solver for transport equations.
Definition ModUEq.cpp:1155
virtual void solveRiemannOutletPressure(Cell &cellLeft, const double &dxLeft, double &dtMax, const double p0, std::vector< double > &boundData) const
Outlet at imposed pressure half Riemann solver.
Definition ModUEq.cpp:905
virtual void solveRiemannTransportIntern(Cell &cellLeft, Cell &cellRight)
Cell to cell Riemann solver for transport equations.
Definition ModUEq.cpp:1127
virtual double selectScalar(Phase **phases, Mixture *mixture, Transport *transports, Variable nameVariable, int num=0) const
Select a specific scalar variable.
Definition ModUEq.cpp:1184
virtual void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const
Flux reverse projection in the absolute Cartesian coordinate system.
Definition ModUEq.cpp:1241
virtual void solveRiemannTransportPiston(Cell &cellLeft, double uPiston)
Piston half Riemann solver for transport equations.
Definition ModUEq.cpp:1145
virtual void solveRiemannNullFlux() const
No flux half Riemann solver (return null flux to use with 1D geometry with smooth varying cross secti...
Definition ModUEq.cpp:1108
virtual const std::string & whoAmI() const
Definition ModUEq.h:122
virtual void solveRiemannTransportWall()
Wall half Riemann solver for transport equations.
Definition ModUEq.cpp:1136
virtual void solveRiemannTransportInletInjStagState(Cell &cellLeft, double *valueTransports)
Inlet injection using stagnation state half Riemann solver for transport equations.
Definition ModUEq.cpp:1164
virtual void setLowMach(const bool &lowMach)
Definition ModUEq.h:101
virtual void lowMachSoundSpeed(double &machRef, const double &uL, double &cL, const double &uR=Errors::defaultDouble, double &cR=Tools::uselessDouble) const
Definition ModUEq.cpp:1248
virtual void addNonConsMrfFlux(Phase **phases)
Definition ModUEq.cpp:1284
virtual void initializeAugmentedVariables(Cell *)
Definition ModUEq.h:73
virtual void allocatePhaseGradient(GradPhase **phase)
Instanciate gradient phase variable.
Definition ModUEq.cpp:85
virtual void solveRiemannInternMRF(Cell &cellLeft, Cell &cellRight, const double &dxLeft, const double &dxRight, double &dtMax, const Coord &omega, const Coord &normal, const Coord &tangent, const Coord &binormal, const Coord &position) const
Cell to cell Riemann solver + compute fluxBuffMRF for MRF interface.
Definition ModUEq.cpp:273
virtual void allocateMixture(Mixture **mixture)
Instanciate mixture variable.
Definition ModUEq.cpp:78
virtual void setSmoothCrossSection1d(const bool &applySmooth)
Definition ModUEq.h:124
virtual const Coord & getVelocity(const Cell *cell) const
Return the fluid velocity of the corresponding cell.
Definition ModUEq.h:119
virtual void solveRiemannIntern(Cell &cellLeft, Cell &cellRight, const double &dxLeft, const double &dxRight, double &dtMax, std::vector< double > &boundData=DEFAULT_VEC_INTERFACE_DATA) const
Cell to cell Riemann solver.
Definition ModUEq.cpp:113
virtual const double & getSM()
Return the local fluid velocity.
Definition ModUEq.cpp:1232
virtual void allocatePhase(Phase **phase)
Instanciate fluid phase variable.
Definition ModUEq.cpp:71
virtual void fulfillStateRestart(Phase **, Mixture *)
Definition ModUEq.h:70
virtual Coord & getVelocity(Cell *cell)
Definition ModUEq.h:120
virtual void solveRiemannOutletMassflow(Cell &cellLeft, const double &dxLeft, double &dtMax, const double m0, std::vector< double > &boundData) const
Outlet at imposed massflow half Riemann solver.
Definition ModUEq.cpp:988
virtual void allocateCons(Flux **cons)
Allocate conservative variable arrays.
Definition ModUEq.cpp:64
virtual void solveRiemannTransportOutletPressure(Cell &cellLeft, double *valueTransport)
Outlet at imposed pressure half Riemann solver for transport equations.
Definition ModUEq.cpp:1173
static const std::string NAME
Definition ModUEq.h:127
virtual ~ModUEq()
Definition ModUEq.cpp:52
virtual void solveRiemannInletTank(Cell &cellLeft, const double &dxLeft, double &dtMax, const double *ak0, const double *rhok0, const double &p0, const double &, std::vector< double > &boundData) const
Inlet tank half Riemann solver.
Definition ModUEq.cpp:496
virtual void solveRiemannWall(Cell &cellLeft, const double &dxLeft, double &dtMax, std::vector< double > &boundData) const
Wall half Riemann solver.
Definition ModUEq.cpp:452
virtual void solveRiemannInletInjStagState(Cell &cellLeft, const double &dxLeft, double &dtMax, const double m0, const double *ak0, const double *rhok0, const double *pk0, std::vector< double > &boundData) const
Inlet injection using stagnation state half Riemann solver.
Definition ModUEq.cpp:674
virtual void reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const
Definition ModUEq.cpp:1291
virtual void setMachRefMin(const double &machRefMin)
Definition ModUEq.h:102
virtual void allocateMixtureGradient(GradMixture **mixture)
Instanciate gradient mixture variable.
Definition ModUEq.cpp:92
virtual void solveRiemannInletInjTemp(Cell &cellLeft, const double &dxLeft, double &dtMax, const double m0, const double *Tk0, const double *ak0, std::vector< double > &boundData) const
Inlet injection using temperature half Riemann solver.
Definition ModUEq.cpp:803
Abstract class for mathematical flow models.
Definition Model.h:50
double m_machRefMin
Minimum Mach number limit for L-M preconditionning used when local Mach number is below this value (d...
Definition Model.h:350
std::string m_name
Name of the required model.
Definition Model.h:346
bool m_smoothCrossSection1d
1D geometry with smooth cross section variation (default: false)
Definition Model.h:351
bool m_lowMach
Low-Mach preconditioning (default: false)
Definition Model.h:349
Abstract class for a phase.
Definition Phase.h:47
static double uselessDouble
Definition Tools.h:144
Class for additional transport equations.
Definition Transport.h:41