ECOGEN 6.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 ~ModUEq() override;
59
60 void allocateCons(Flux** cons) override;
61 void allocatePhase(Phase** phase) override;
62 void allocateMixture(Mixture** mixture) override;
63 void allocatePhaseGradient(GradPhase** phase) override;
64 void allocateMixtureGradient(GradMixture** mixture) override;
65
67 void fulfillState(Phase** phases, Mixture* mixture) override;
68
70 void fulfillStateResume(Phase** /*phases*/, Mixture* /*mixture*/) override {};
71
73 void initializeAugmentedVariables(Cell* /*cell*/) override {};
74
75 //Fluid-flow Riemann solvers
76 //--------------------------
77 void solveRiemannIntern(Cell& cellLeft,
78 Cell& cellRight,
79 const double& dxLeft,
80 const double& dxRight,
81 double& dtMax,
82 std::vector<double>& boundData = DEFAULT_VEC_INTERFACE_DATA) const override; // Riemann between two computed cells
83 void solveRiemannInternMRF(Cell& cellLeft,
84 Cell& cellRight,
85 const double& dxLeft,
86 const double& dxRight,
87 double& dtMax,
88 const Coord& omega,
89 const Coord& normal,
90 const Coord& tangent,
91 const Coord& binormal,
92 const Coord& position) const override;
93 void solveRiemannWall(Cell& cellLeft,
94 const double& dxLeft,
95 double& dtMax,
96 std::vector<double>& boundData) const override; // Riemann between left cell and wall
97 void
98 solveRiemannMovingWall(Cell& cellLeft, const double& dxLeft, double& dtMax, double wallVelocity, std::vector<double>& boundData) const override;
99 void solveRiemannInletTank(Cell& cellLeft,
100 const double& dxLeft,
101 double& dtMax,
102 const double* ak0,
103 const double* rhok0,
104 const double& p0,
105 const double& /*T0*/,
106 std::vector<double>& boundData) const override;
107 void solveRiemannInletInjStagState(Cell& cellLeft,
108 const double& dxLeft,
109 double& dtMax,
110 const double m0,
111 const double* ak0,
112 const double* rhok0,
113 const double* pk0,
114 std::vector<double>& boundData) const override;
115 void solveRiemannInletInjTemp(Cell& cellLeft,
116 const double& dxLeft,
117 double& dtMax,
118 const double m0,
119 const double* Tk0,
120 const double* ak0,
121 std::vector<double>& boundData) const override;
122 void
123 solveRiemannOutletPressure(Cell& cellLeft, const double& dxLeft, double& dtMax, const double p0, std::vector<double>& boundData) const override;
124 void
125 solveRiemannOutletMassflow(Cell& cellLeft, const double& dxLeft, double& dtMax, const double m0, std::vector<double>& boundData) const override;
126 void solveRiemannNullFlux() const override;
127
128 //Transports Riemann solvers
129 //--------------------------
130 void solveRiemannTransportIntern(Cell& cellLeft, Cell& cellRight) override;
131 void solveRiemannTransportWall() override;
132 void solveRiemannTransportMovingWall(Cell& cellLeft, double wallVelocity) override;
133 void solveRiemannTransportInletTank(Cell& cellLeft, double* valueTransports) override;
134 void solveRiemannTransportInletInjStagState(Cell& cellLeft, double* valueTransports) override;
135 void solveRiemannTransportOutletPressure(Cell& cellLeft, double* valueTransport) override;
136
137 void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const override;
138
139 //Low-Mach preconditioning
140 //------------------------
142 double& machRef, const double& uL, double& cL, const double& uR = Errors::defaultDouble, double& cR = Tools::uselessDouble) const override;
143
144 //Moving Reference Frame
145 //----------------------
146 void addNonConsMrfFlux(Phase** phases) override;
147 void reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const override;
148
149 //Accessors
150 //---------
157 double selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num = 0) const override;
158 const double& getSM() override;
159 const Coord& getVelocity(const Cell* cell) const override { return cell->getMixture()->getVelocity(); };
160 Coord& getVelocity(Cell* cell) override { return cell->getMixture()->getVelocity(); };
161
162 const std::string& whoAmI() const override { return m_name; };
163
164 void setSmoothCrossSection1d(const bool& applySmooth) override { m_smoothCrossSection1d = applySmooth; };
165
166 private:
167 static const std::string NAME;
168
169 friend class FluxUEq;
170};
171
172#endif // MODUEQ_H
static std::vector< double > DEFAULT_VEC_INTERFACE_DATA(VarBoundary::SIZE, 0.)
Variable
Enumeration for the flow variables.
Definition Tools.h:163
Base class for a mesh cell.
Definition Cell.h:59
virtual Mixture * getMixture(Prim=vecPhases) const
Definition Cell.cpp:906
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:99
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:364
Model class for the velocity-equilibrium system of equations.
Definition ModUEq.h:48
~ModUEq() override
Definition ModUEq.cpp:57
void solveRiemannTransportIntern(Cell &cellLeft, Cell &cellRight) override
Cell to cell Riemann solver for transport equations.
Definition ModUEq.cpp:1394
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 override
Inlet injection using stagnation state half Riemann solver.
Definition ModUEq.cpp:902
void solveRiemannTransportWall() override
Wall half Riemann solver for transport equations.
Definition ModUEq.cpp:1405
void lowMachSoundSpeed(double &machRef, const double &uL, double &cL, const double &uR=Errors::defaultDouble, double &cR=Tools::uselessDouble) const override
Definition ModUEq.cpp:1516
const double & getSM() override
Return the local fluid velocity.
Definition ModUEq.cpp:1503
void setSmoothCrossSection1d(const bool &applySmooth) override
Definition ModUEq.h:164
void reverseProjectionMrfFlux(const Coord normal, const Coord tangent, const Coord binormal) const override
Definition ModUEq.cpp:1556
void solveRiemannWall(Cell &cellLeft, const double &dxLeft, double &dtMax, std::vector< double > &boundData) const override
Wall half Riemann solver.
Definition ModUEq.cpp:482
void solveRiemannIntern(Cell &cellLeft, Cell &cellRight, const double &dxLeft, const double &dxRight, double &dtMax, std::vector< double > &boundData=DEFAULT_VEC_INTERFACE_DATA) const override
Cell to cell Riemann solver.
Definition ModUEq.cpp:103
double selectScalar(Phase **phases, Mixture *mixture, Transport *transports, Variable nameVariable, int num=0) const override
Select a specific scalar variable.
Definition ModUEq.cpp:1454
const Coord & getVelocity(const Cell *cell) const override
Return the fluid velocity of the corresponding cell.
Definition ModUEq.h:159
void solveRiemannTransportInletTank(Cell &cellLeft, double *valueTransports) override
Inlet tank half Riemann solver for transport equations.
Definition ModUEq.cpp:1423
ModUEq(const int &numbTransports, const int &numbPhases)
UEq model constructor.
Definition ModUEq.cpp:37
void allocatePhase(Phase **phase) override
Instanciate fluid phase variable.
Definition ModUEq.cpp:73
const std::string & whoAmI() const override
Definition ModUEq.h:162
void allocateMixture(Mixture **mixture) override
Instanciate mixture variable.
Definition ModUEq.cpp:77
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 override
Inlet tank half Riemann solver.
Definition ModUEq.cpp:698
void addNonConsMrfFlux(Phase **phases) override
Definition ModUEq.cpp:1552
void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const override
Flux reverse projection in the absolute Cartesian coordinate system.
Definition ModUEq.cpp:1509
void allocateCons(Flux **cons) override
Allocate conservative variable arrays.
Definition ModUEq.cpp:69
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 override
Cell to cell Riemann solver + compute fluxBuffMRF for MRF interface.
Definition ModUEq.cpp:278
void allocateMixtureGradient(GradMixture **mixture) override
Instanciate gradient mixture variable.
Definition ModUEq.cpp:85
void fulfillStateResume(Phase **, Mixture *) override
Definition ModUEq.h:70
friend class FluxUEq
Definition ModUEq.h:169
void solveRiemannNullFlux() const override
No flux half Riemann solver (return null flux to use with 1D geometry with smooth varying cross secti...
Definition ModUEq.cpp:1375
void solveRiemannTransportMovingWall(Cell &cellLeft, double wallVelocity) override
Moving wall half Riemann solver for transport equations.
Definition ModUEq.cpp:1414
void solveRiemannOutletPressure(Cell &cellLeft, const double &dxLeft, double &dtMax, const double p0, std::vector< double > &boundData) const override
Outlet at imposed pressure half Riemann solver.
Definition ModUEq.cpp:1160
void solveRiemannTransportOutletPressure(Cell &cellLeft, double *valueTransport) override
Outlet at imposed pressure half Riemann solver for transport equations.
Definition ModUEq.cpp:1443
void allocatePhaseGradient(GradPhase **phase) override
Instanciate gradient phase variable.
Definition ModUEq.cpp:81
void solveRiemannTransportInletInjStagState(Cell &cellLeft, double *valueTransports) override
Inlet injection using stagnation state half Riemann solver for transport equations.
Definition ModUEq.cpp:1432
void initializeAugmentedVariables(Cell *) override
Definition ModUEq.h:73
static const std::string NAME
Definition ModUEq.h:167
void solveRiemannInletInjTemp(Cell &cellLeft, const double &dxLeft, double &dtMax, const double m0, const double *Tk0, const double *ak0, std::vector< double > &boundData) const override
Inlet injection using temperature half Riemann solver.
Definition ModUEq.cpp:1048
void solveRiemannOutletMassflow(Cell &cellLeft, const double &dxLeft, double &dtMax, const double m0, std::vector< double > &boundData) const override
Outlet at imposed massflow half Riemann solver.
Definition ModUEq.cpp:1252
void solveRiemannMovingWall(Cell &cellLeft, const double &dxLeft, double &dtMax, double wallVelocity, std::vector< double > &boundData) const override
Moving wall half Riemann solver.
Definition ModUEq.cpp:526
void fulfillState(Phase **phases, Mixture *mixture) override
Definition ModUEq.cpp:89
Coord & getVelocity(Cell *cell) override
Definition ModUEq.h:160
std::string m_name
Name of the required model.
Definition Model.h:576
bool m_smoothCrossSection1d
1D geometry with smooth cross section variation (default: false)
Definition Model.h:581
Model(const std::string &name, const int &numbTransports)
Generic model constructor.
Definition Model.cpp:35
Abstract class for a phase.
Definition Phase.h:47
static double uselessDouble
Definition Tools.h:306
Class for additional transport equations.
Definition Transport.h:41