twoPhaseMixtureEThermo.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::twoPhaseMixtureEThermo
28 
29 Description
30 
31 SourceFiles
32  twoPhaseMixtureEThermo.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef twoPhaseMixtureEThermo_H
37 #define twoPhaseMixtureEThermo_H
38 
39 #include "volFields.H"
40 
41 #include "basicThermo.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class twoPhaseMixtureEThermo Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public basicThermo,
57 {
58 
59 protected:
60 
61  // Protected Data
62 
63  //- Saturation Temperature
65 
66 public:
67 
68  TypeName("twoPhaseMixtureEThermo");
69 
70  // Constructor
72  (
73  const volVectorField& U,
74  const surfaceScalarField& phi
75  );
76 
77 
78  //- Destructor
79  virtual ~twoPhaseMixtureEThermo() = default;
80 
81 
82  // Member Functions
83 
84 
85  //- Return access to the internal energy field [J/Kg]
86  virtual volScalarField& he()
87  {
89  return p();
90  }
91 
92  //- Return access to the internal energy field [J/Kg]
93  virtual const volScalarField& he() const
94  {
96  return p();
97  }
98 
99  //- Enthalpy/Internal energy
100  //- for given pressure and temperature [J/kg]
101  virtual tmp<volScalarField> he
102  (
103  const volScalarField& p,
104  const volScalarField& T
105  ) const;
106 
107  //- Enthalpy/Internal energy for cell-set [J/kg]
108  virtual tmp<scalarField> he
109  (
110  const scalarField& p,
111  const scalarField& T,
112  const labelList& cells
113  ) const;
114 
115  //- Enthalpy/Internal energy for patch [J/kg]
116  virtual tmp<scalarField> he
117  (
118  const scalarField& p,
119  const scalarField& T,
120  const label patchi
121  ) const;
122 
123  //- Chemical enthalpy [J/kg]
124  virtual tmp<volScalarField> hc() const;
125 
126  //- Temperature from enthalpy/internal energy for cell-set
127  virtual tmp<scalarField> THE
128  (
129  const scalarField& h,
130  const scalarField& p,
131  const scalarField& T0, // starting temperature
132  const labelList& cells
133  ) const;
134 
135  //- Temperature from enthalpy/internal energy for patch
136  virtual tmp<scalarField> THE
137  (
138  const scalarField& h,
139  const scalarField& p,
140  const scalarField& T0, // starting temperature
141  const label patchi
142  ) const;
143 
144 
145  //- Return true if the equation of state is incompressible
146  //- i.e. rho != f(p)
147  bool incompressible() const
148  {
149  return true;
150  }
151 
152  //- Return true if the equation of state is isochoric
153  //- i.e. rho = const
154  bool isochoric() const
155  {
156  return false;
157  }
158 
159  //- Return rho of the mixture
160  virtual tmp<volScalarField> rho() const;
161 
162  //- Return rho for patch
163  virtual tmp<scalarField> rho(const label patchi) const;
164 
165  //- Return Cp of the mixture
166  virtual tmp<volScalarField> Cp() const;
167 
168  //- Heat capacity at constant pressure for patch [J/kg/K]
169  virtual tmp<scalarField> Cp
170  (
171  const scalarField& p,
172  const scalarField& T,
173  const label patchi
174  ) const;
175 
176  //- Return Cv of the mixture
177  virtual tmp<volScalarField> Cv() const;
178 
179  //- Heat capacity at constant volume for patch [J/kg/K]
180  virtual tmp<scalarField> Cv
181  (
182  const scalarField& p,
183  const scalarField& T,
184  const label patchI
185  ) const;
186 
187  //- Gamma = Cp/Cv []
188  virtual tmp<volScalarField> gamma() const;
189 
190  //- Gamma = Cp/Cv for patch []
191  virtual tmp<scalarField> gamma
192  (
193  const scalarField& p,
194  const scalarField& T,
195  const label patchi
196  ) const;
197 
198  //- Heat capacity at constant pressure/volume [J/kg/K]
199  virtual tmp<volScalarField> Cpv() const;
200 
201  //- Heat capacity at constant pressure/volume for patch [J/kg/K]
202  virtual tmp<scalarField> Cpv
203  (
204  const scalarField& p,
205  const scalarField& T,
206  const label patchi
207  ) const;
208 
209  //- Heat capacity ratio []
210  virtual tmp<volScalarField> CpByCpv() const;
211 
212  //- Heat capacity ratio for patch []
213  virtual tmp<scalarField> CpByCpv
214  (
215  const scalarField& p,
216  const scalarField& T,
217  const label patchi
218  ) const;
219 
220  //- Molecular weight [kg/kmol]
221  virtual tmp<volScalarField> W() const;
222 
223  //- Thermal diffusivity for temperature of mixture [J/m/s/K]
224  virtual tmp<volScalarField> kappa() const;
225 
226  //- Thermal diffusivity for temperature
227  //- of mixture for patch [J/m/s/K]
228  virtual tmp<scalarField> kappa
229  (
230  const label patchi
231  ) const;
232 
233  //- Thermal diffusivity for energy of mixture [kg/m/s]
234  virtual tmp<volScalarField> alphahe() const;
235 
236  //- Thermal diffusivity for energy of mixture for patch [kg/m/s]
237  virtual tmp<scalarField> alphahe(const label patchi) const;
238 
239  //- Effective thermal diffusivity for temperature
240  //- of mixture [J/m/s/K]
242  (
243  const volScalarField&
244  ) const;
245 
246  //- Effective thermal diffusivity for temperature
247  //- of mixture for patch [J/m/s/K]
248  virtual tmp<scalarField> kappaEff
249  (
250  const scalarField& alphat,
251  const label patchi
252  ) const;
253 
254  //- Effective thermal diffusivity of mixture [kg/m/s]
256  (
257  const volScalarField& alphat
258  ) const;
259 
260  //- Effective thermal diffusivity of mixture for patch [kg/m/s]
261  virtual tmp<scalarField> alphaEff
262  (
263  const scalarField& alphat,
264  const label patchi
265  ) const;
266 
267 
268  //- Correct the thermo fields
269  virtual void correct();
270 
271  //- Return the name of the thermo physics
272  virtual word thermoName() const;
273 
274  //- Read properties
275  virtual bool read();
276 
277 
278  // Access to thermodynamic state variables
279 
280  //- Return const-access to the saturation temperature
281  const dimensionedScalar& TSat() const
282  {
283  return TSat_;
284  }
285 
286  //- Return transport properties dictionary
288  {
289  return *this;
290  }
291 };
292 
293 
294 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
295 
296 } // End namespace Foam
297 
298 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
299 
300 #endif
301 
302 // ************************************************************************* //
volFields.H
Foam::twoPhaseMixtureEThermo::correct
virtual void correct()
Correct the thermo fields.
Foam::twoPhaseMixtureEThermo::hc
virtual tmp< volScalarField > hc() const
Chemical enthalpy [J/kg].
basicThermo.H
Foam::twoPhaseMixtureEThermo::Cv
virtual tmp< volScalarField > Cv() const
Return Cv of the mixture.
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::twoPhaseMixtureEThermo::he
virtual const volScalarField & he() const
Return access to the internal energy field [J/Kg].
Definition: twoPhaseMixtureEThermo.H:92
Foam::twoPhaseMixtureEThermo::isochoric
bool isochoric() const
Definition: twoPhaseMixtureEThermo.H:153
Foam::basicThermo::p
virtual volScalarField & p()
Pressure [Pa].
Definition: basicThermo.C:512
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
thermoIncompressibleTwoPhaseMixture.H
Foam::twoPhaseMixtureEThermo::incompressible
bool incompressible() const
Definition: twoPhaseMixtureEThermo.H:146
Foam::twoPhaseMixtureEThermo::alphaEff
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal diffusivity of mixture [kg/m/s].
Foam::twoPhaseMixtureEThermo::gamma
virtual tmp< volScalarField > gamma() const
Gamma = Cp/Cv [].
Foam::basicThermo
Abstract base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:63
Foam::twoPhaseMixtureEThermo::TypeName
TypeName("twoPhaseMixtureEThermo")
Foam::twoPhaseMixtureEThermo::he
virtual volScalarField & he()
Return access to the internal energy field [J/Kg].
Definition: twoPhaseMixtureEThermo.H:85
Foam::twoPhaseMixtureEThermo
Definition: twoPhaseMixtureEThermo.H:52
Foam::twoPhaseMixtureEThermo::twoPhaseMixtureEThermo
twoPhaseMixtureEThermo(const volVectorField &U, const surfaceScalarField &phi)
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:445
Foam::Field< scalar >
Foam::constant::universal::h
const dimensionedScalar h
Planck constant.
Definition: setRegionSolidFields.H:33
Foam::twoPhaseMixtureEThermo::TSat_
dimensionedScalar TSat_
Saturation Temperature.
Definition: twoPhaseMixtureEThermo.H:63
Foam::twoPhaseMixtureEThermo::CpByCpv
virtual tmp< volScalarField > CpByCpv() const
Heat capacity ratio [].
phi
surfaceScalarField & phi
Definition: setRegionFluidFields.H:8
Foam::twoPhaseMixtureEThermo::TSat
const dimensionedScalar & TSat() const
Return const-access to the saturation temperature.
Definition: twoPhaseMixtureEThermo.H:280
Foam::dimensioned< scalar >
Foam::twoPhaseMixtureEThermo::rho
virtual tmp< volScalarField > rho() const
Return rho of the mixture.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::twoPhaseMixtureEThermo::~twoPhaseMixtureEThermo
virtual ~twoPhaseMixtureEThermo()=default
Destructor.
Foam::twoPhaseMixtureEThermo::kappa
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [J/m/s/K].
Foam::twoPhaseMixtureEThermo::Cp
virtual tmp< volScalarField > Cp() const
Return Cp of the mixture.
Foam::thermoIncompressibleTwoPhaseMixture
A two-phase incompressible transportModel.
Definition: thermoIncompressibleTwoPhaseMixture.H:50
Foam::incompressibleTwoPhaseMixture
A two-phase incompressible transportModel.
Definition: incompressibleTwoPhaseMixture.H:55
Foam::twoPhaseMixtureEThermo::W
virtual tmp< volScalarField > W() const
Molecular weight [kg/kmol].
Foam::twoPhaseMixtureEThermo::Cpv
virtual tmp< volScalarField > Cpv() const
Heat capacity at constant pressure/volume [J/kg/K].
Foam::basicThermo::T
virtual const volScalarField & T() const
Temperature [K].
Definition: basicThermo.C:524
Foam::twoPhaseMixtureEThermo::transportPropertiesDict
const incompressibleTwoPhaseMixture & transportPropertiesDict()
Return transport properties dictionary.
Definition: twoPhaseMixtureEThermo.H:286
Foam::List< label >
Foam::incompressibleTwoPhaseMixture::U
const volVectorField & U() const
Return const-access to the mixture velocity.
Definition: incompressibleTwoPhaseMixture.H:129
Foam::twoPhaseMixtureEThermo::thermoName
virtual word thermoName() const
Return the name of the thermo physics.
Foam::twoPhaseMixtureEThermo::read
virtual bool read()
Read properties.
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::twoPhaseMixtureEThermo::kappaEff
virtual tmp< volScalarField > kappaEff(const volScalarField &) const
Foam::twoPhaseMixtureEThermo::alphahe
virtual tmp< volScalarField > alphahe() const
Thermal diffusivity for energy of mixture [kg/m/s].
Foam::GeometricField< vector, fvPatchField, volMesh >
T0
scalar T0
Definition: createFields.H:22
Foam::twoPhaseMixtureEThermo::THE
virtual tmp< scalarField > THE(const scalarField &h, const scalarField &p, const scalarField &T0, const labelList &cells) const
Temperature from enthalpy/internal energy for cell-set.