ECOGEN 4.0
Evolutive, Compressible, Open, Genuine, Easy, N-phase
Loading...
Searching...
No Matches
ModEulerKorteweg.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 MODEULERKORTEWEG_H
32#define MODEULERKORTEWEG_H
33
34#include "../Model.h"
35#include "../../Order1/Cell.h"
36#include "FluxEulerKorteweg.h"
37#include "MixEulerKorteweg.h"
38
41class ModEulerKorteweg : public Model
42{
43 public:
46 ModEulerKorteweg(const int& numbTransports);
53 ModEulerKorteweg(const int& numbTransports, const double& alpha, const double &beta, const double &temperature, const double &kappa);
61 ModEulerKorteweg(const std::string& name, const int& numbTransports, const double& alpha, const double &beta, const double &temperature, const double &kappa);
62 virtual ~ModEulerKorteweg();
63
64 virtual void allocateCons(Flux** cons);
65 virtual void allocatePhase(Phase** phase);
66 virtual void allocateMixture(Mixture** mixture);
67
69 virtual void fulfillState(Phase** /*phases*/, Mixture* /*mixture*/) {};
70
72 virtual void fulfillStateRestart(Phase** /*phases*/, Mixture* /*mixture*/) {};
73
76 virtual void initializeAugmentedVariables(Cell* cell);
77
78 //Hydrodynamic Riemann solvers
79 //----------------------------
80 virtual void solveRiemannIntern(Cell& cellLeft, Cell& cellRight, const double& dxLeft, const double& dxRight, double& dtMax, std::vector<double>& /*boundData*/ = DEFAULT_VEC_INTERFACE_DATA) const;
81
82 virtual void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const;
83
84 //Accessors
85 //---------
92 virtual double selectScalar(Phase** phases, Mixture* /*mixture*/, Transport* transports, Variable nameVariable, int num = 0) const;
93 virtual const double& getSM() { Errors::errorMessage("getSM not available for required model"); return Errors::defaultDouble; };
94 virtual const Coord& getVelocity(const Cell* cell) const { return cell->getPhase(0)->getVelocity(); };
95 virtual Coord& getVelocity(Cell* cell) { return cell->getPhase(0)->getVelocity(); };
96
97 virtual const std::string& whoAmI() const { return m_name; };
98
99 //Methods specific to Euler-Korteweg
100 //----------------------------------
101 virtual double kappa(const double& /*density*/) const;
102 virtual double kappaPrime(const double& /*density*/) const;
103 virtual double kappaSecond(const double& /*density*/) const;
104 virtual double epsilonPrime(Cell& cell, const double& density) const;
105 virtual double epsilonSecond(Cell& cell, const double& density) const;
119 virtual double computeMaxWaveSpeed(Cell& cellLeft, Cell& cellRight, const double& rhoL, const double& rhoR, const double& uL, const double& uR,
120 const double& etaL, const double& etaR, const double& vecPxL, const double& vecPxR,
121 const double& vecPyL, const double& vecPyR) const;
122
123 private:
124 static const std::string NAME;
125};
126
127#endif // MODEULERKORTEWEG_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 Phase * getPhase(const int &phaseNumber, Prim=vecPhases) const
Definition Cell.cpp:522
Class for a coordinate system object such as coordinates of the vertex or a vector.
Definition Coord.h:43
static void errorMessage(const std::string &message)
Definition Errors.cpp:56
static constexpr double defaultDouble
Definition Errors.h:93
Abstract class for conservative variables and fluxes.
Definition Flux.h:43
Abstract class for mixture variables.
Definition Mixture.h:43
Model class for Augmented Euler–Korteweg mathematical system of equations (single phase)
Definition ModEulerKorteweg.h:42
static const std::string NAME
Definition ModEulerKorteweg.h:124
virtual void fulfillStateRestart(Phase **, Mixture *)
Definition ModEulerKorteweg.h:72
virtual double selectScalar(Phase **phases, Mixture *, Transport *transports, Variable nameVariable, int num=0) const
Select a specific scalar variable.
Definition ModEulerKorteweg.cpp:255
virtual const std::string & whoAmI() const
Definition ModEulerKorteweg.h:97
virtual double epsilonPrime(Cell &cell, const double &density) const
Definition ModEulerKorteweg.cpp:216
virtual const Coord & getVelocity(const Cell *cell) const
Return the fluid velocity of the corresponding cell.
Definition ModEulerKorteweg.h:94
virtual double kappaPrime(const double &) const
Definition ModEulerKorteweg.cpp:202
virtual void allocateCons(Flux **cons)
Allocate conservative variable arrays.
Definition ModEulerKorteweg.cpp:86
virtual void allocateMixture(Mixture **mixture)
Instanciate mixture variable.
Definition ModEulerKorteweg.cpp:100
virtual void reverseProjection(const Coord normal, const Coord tangent, const Coord binormal) const
Flux reverse projection in the absolute Cartesian coordinate system.
Definition ModEulerKorteweg.cpp:185
virtual void allocatePhase(Phase **phase)
Instanciate fluid phase variable.
Definition ModEulerKorteweg.cpp:93
virtual ~ModEulerKorteweg()
Definition ModEulerKorteweg.cpp:75
virtual const double & getSM()
Return the local fluid velocity.
Definition ModEulerKorteweg.h:93
virtual void fulfillState(Phase **, Mixture *)
Definition ModEulerKorteweg.h:69
virtual double computeMaxWaveSpeed(Cell &cellLeft, Cell &cellRight, const double &rhoL, const double &rhoR, const double &uL, const double &uR, const double &etaL, const double &etaR, const double &vecPxL, const double &vecPxR, const double &vecPyL, const double &vecPyR) const
Compute maximal wave speed using Davis approximation and eigenvalues of hyperbolic equations.
Definition ModEulerKorteweg.cpp:230
virtual Coord & getVelocity(Cell *cell)
Definition ModEulerKorteweg.h:95
virtual void solveRiemannIntern(Cell &cellLeft, Cell &cellRight, const double &dxLeft, const double &dxRight, double &dtMax, std::vector< double > &=DEFAULT_VEC_INTERFACE_DATA) const
Cell to cell Riemann solver.
Definition ModEulerKorteweg.cpp:128
virtual void initializeAugmentedVariables(Cell *cell)
Complete the augmented variables (such as the ones of Euler-Korteweg model)
Definition ModEulerKorteweg.cpp:107
virtual double kappa(const double &) const
Definition ModEulerKorteweg.cpp:195
virtual double kappaSecond(const double &) const
Definition ModEulerKorteweg.cpp:209
virtual double epsilonSecond(Cell &cell, const double &density) const
Definition ModEulerKorteweg.cpp:223
Abstract class for mathematical flow models.
Definition Model.h:50
std::string m_name
Name of the required model.
Definition Model.h:346
Abstract class for a phase.
Definition Phase.h:47
virtual Coord & getVelocity()
Definition Phase.h:132
Class for additional transport equations.
Definition Transport.h:41