ECOGEN 6.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
ModPTUEq.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 MODPTUEQ_H
32#define MODPTUEQ_H
33
34#include "../Model.h"
35#include "../../Order1/Cell.h"
36#include "FluxPTUEq.h"
37#include "MixPTUEq.h"
38
41class ModPTUEq : public Model
42{
43 public:
47 ModPTUEq(const int& numbTransports, const int& numbPhases);
48 ~ModPTUEq() override;
49
50 void allocateCons(Flux** cons) override;
51 void allocatePhase(Phase** phase) override;
52 void allocateMixture(Mixture** mixture) override;
53 void allocatePhaseGradient(GradPhase** phase) override;
54 void allocateMixtureGradient(GradMixture** mixture) override;
55
56 void fulfillState(Phase** phases, Mixture* mixture) override;
57
59 void fulfillStateResume(Phase** /*phases*/, Mixture* /*mixture*/) override {};
60
62 void initializeAugmentedVariables(Cell* /*cell*/) override {};
63
64 //Fluid-flow Riemann solvers
65 //--------------------------
66 void solveRiemannIntern(Cell& cellLeft,
67 Cell& cellRight,
68 const double& dxLeft,
69 const double& dxRight,
70 double& dtMax,
71 std::vector<double>& boundData = DEFAULT_VEC_INTERFACE_DATA) const override; // Riemann between two computed cells
72 void solveRiemannWall(Cell& cellLeft,
73 const double& dxLeft,
74 double& dtMax,
75 std::vector<double>& boundData) const override; // Riemann between left cell and wall
76 void solveRiemannInletTank(Cell& cellLeft,
77 const double& dxLeft,
78 double& dtMax,
79 const double* ak0,
80 const double* rhok0,
81 const double& p0,
82 const double& T0,
83 std::vector<double>& boundData) const override; // Riemann for tank
84 void solveRiemannOutletPressure(Cell& cellLeft,
85 const double& dxLeft,
86 double& dtMax,
87 const double p0,
88 std::vector<double>& boundData) const override; // Riemann for outflow with imposed pressure
89
90 void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const override;
91
92 //Accessors
93 //---------
100 double selectScalar(Phase** phases, Mixture* mixture, Transport* transports, Variable nameVariable, int num = 0) const override;
101 const double& getSM() override;
102 const Coord& getVelocity(const Cell* cell) const override { return cell->getMixture()->getVelocity(); };
103 Coord& getVelocity(Cell* cell) override { return cell->getMixture()->getVelocity(); };
104
105 const std::string& whoAmI() const override { return m_name; };
106
107 private:
108 static const std::string NAME;
109};
110
111#endif // MODPTUEQ_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
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
const double & getSM() override
Return the local fluid velocity.
Definition ModPTUEq.cpp:524
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 ModPTUEq.cpp:422
void fulfillStateResume(Phase **, Mixture *) override
Definition ModPTUEq.h:59
void allocateMixtureGradient(GradMixture **mixture) override
Instanciate gradient mixture variable.
Definition ModPTUEq.cpp:77
void allocatePhase(Phase **phase) override
Instanciate fluid phase variable.
Definition ModPTUEq.cpp:65
void fulfillState(Phase **phases, Mixture *mixture) override
Complete a thermodynamics state frome minimum variables depending on the model.
Definition ModPTUEq.cpp:81
void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const override
Flux reverse projection in the absolute Cartesian coordinate system.
Definition ModPTUEq.cpp:530
static const std::string NAME
Definition ModPTUEq.h:108
double selectScalar(Phase **phases, Mixture *mixture, Transport *transports, Variable nameVariable, int num=0) const override
Select a specific scalar variable.
Definition ModPTUEq.cpp:485
void allocateMixture(Mixture **mixture) override
Instanciate mixture variable.
Definition ModPTUEq.cpp:69
ModPTUEq(const int &numbTransports, const int &numbPhases)
Thermal equilibrium model constructor.
Definition ModPTUEq.cpp:40
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 override
Inlet tank half Riemann solver.
Definition ModPTUEq.cpp:268
~ModPTUEq() override
Definition ModPTUEq.cpp:50
void solveRiemannWall(Cell &cellLeft, const double &dxLeft, double &dtMax, std::vector< double > &boundData) const override
Wall half Riemann solver.
Definition ModPTUEq.cpp:234
const std::string & whoAmI() const override
Definition ModPTUEq.h:105
void allocatePhaseGradient(GradPhase **phase) override
Instanciate gradient phase variable.
Definition ModPTUEq.cpp:73
const Coord & getVelocity(const Cell *cell) const override
Return the fluid velocity of the corresponding cell.
Definition ModPTUEq.h:102
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 ModPTUEq.cpp:96
void allocateCons(Flux **cons) override
Allocate conservative variable arrays.
Definition ModPTUEq.cpp:61
void initializeAugmentedVariables(Cell *) override
Definition ModPTUEq.h:62
Coord & getVelocity(Cell *cell) override
Definition ModPTUEq.h:103
std::string m_name
Name of the required model.
Definition Model.h:576
Model(const std::string &name, const int &numbTransports)
Generic model constructor.
Definition Model.cpp:35
Abstract class for a phase.
Definition Phase.h:47
Class for additional transport equations.
Definition Transport.h:41