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-2021 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  //- Heat capacity using pressure and temperature
178  (
179  const scalarField& p,
180  const scalarField& T,
181  const labelList& cells
182  ) const
183  {
185  return tmp<scalarField>::New(p);
186  }
187 
188  //- Return Cv of the mixture
189  virtual tmp<volScalarField> Cv() const;
190 
191  //- Heat capacity at constant volume for patch [J/kg/K]
192  virtual tmp<scalarField> Cv
193  (
194  const scalarField& p,
195  const scalarField& T,
196  const label patchI
197  ) const;
198 
199  //- Density from pressure and temperature
201  (
202  const scalarField& p,
203  const scalarField& T,
204  const labelList& cells
205  ) const
206  {
208  return tmp<scalarField>::New(p);
209  }
210 
211  //- Gamma = Cp/Cv []
212  virtual tmp<volScalarField> gamma() const;
213 
214  //- Gamma = Cp/Cv for patch []
215  virtual tmp<scalarField> gamma
216  (
217  const scalarField& p,
218  const scalarField& T,
219  const label patchi
220  ) const;
221 
222  //- Heat capacity at constant pressure/volume [J/kg/K]
223  virtual tmp<volScalarField> Cpv() const;
224 
225  //- Heat capacity at constant pressure/volume for patch [J/kg/K]
226  virtual tmp<scalarField> Cpv
227  (
228  const scalarField& p,
229  const scalarField& T,
230  const label patchi
231  ) const;
232 
233  //- Heat capacity ratio []
234  virtual tmp<volScalarField> CpByCpv() const;
235 
236  //- Heat capacity ratio for patch []
237  virtual tmp<scalarField> CpByCpv
238  (
239  const scalarField& p,
240  const scalarField& T,
241  const label patchi
242  ) const;
243 
244  //- Molecular weight [kg/kmol]
245  virtual tmp<volScalarField> W() const;
246 
247  //- Thermal diffusivity for temperature of mixture [J/m/s/K]
248  virtual tmp<volScalarField> kappa() const;
249 
250  //- Thermal diffusivity for temperature
251  //- of mixture for patch [J/m/s/K]
252  virtual tmp<scalarField> kappa
253  (
254  const label patchi
255  ) const;
256 
257  //- Thermal diffusivity for energy of mixture [kg/m/s]
258  virtual tmp<volScalarField> alphahe() const;
259 
260  //- Thermal diffusivity for energy of mixture for patch [kg/m/s]
261  virtual tmp<scalarField> alphahe(const label patchi) const;
262 
263  //- Effective thermal diffusivity for temperature
264  //- of mixture [J/m/s/K]
266  (
267  const volScalarField&
268  ) const;
269 
270  //- Effective thermal diffusivity for temperature
271  //- of mixture for patch [J/m/s/K]
272  virtual tmp<scalarField> kappaEff
273  (
274  const scalarField& alphat,
275  const label patchi
276  ) const;
277 
278  //- Effective thermal diffusivity of mixture [kg/m/s]
280  (
281  const volScalarField& alphat
282  ) const;
283 
284  //- Effective thermal diffusivity of mixture for patch [kg/m/s]
285  virtual tmp<scalarField> alphaEff
286  (
287  const scalarField& alphat,
288  const label patchi
289  ) const;
290 
291 
292  //- Correct the thermo fields
293  virtual void correct();
294 
295  //- Return the name of the thermo physics
296  virtual word thermoName() const;
297 
298  //- Read properties
299  virtual bool read();
300 
301 
302  // Access to thermodynamic state variables
303 
304  //- Return const-access to the saturation temperature
305  const dimensionedScalar& TSat() const
306  {
307  return TSat_;
308  }
309 
310  //- Return transport properties dictionary
312  {
313  return *this;
314  }
315 };
316 
317 
318 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
319 
320 } // End namespace Foam
321 
322 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
323 
324 #endif
325 
326 // ************************************************************************* //
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:65
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:602
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:517
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:304
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::rhoEoS
virtual tmp< scalarField > rhoEoS(const scalarField &p, const scalarField &T, const labelList &cells) const
Density from pressure and temperature.
Definition: twoPhaseMixtureEThermo.H:200
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:614
Foam::twoPhaseMixtureEThermo::transportPropertiesDict
const incompressibleTwoPhaseMixture & transportPropertiesDict()
Return transport properties dictionary.
Definition: twoPhaseMixtureEThermo.H:310
Foam::List< label >
Foam::tmp::New
static tmp< T > New(Args &&... args)
Construct tmp of T with forwarding arguments.
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.