ThermoPhaseModel.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "ThermoPhaseModel.H"
27 
28 #include "phaseSystem.H"
29 
30 #include "fvmDdt.H"
31 #include "fvmDiv.H"
32 #include "fvmSup.H"
33 #include "fvmLaplacian.H"
34 #include "fvcDdt.H"
35 #include "fvcDiv.H"
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
39 template<class BasePhaseModel, class ThermoType>
41 (
42  const phaseSystem& fluid,
43  const word& phaseName,
44  const label index
45 )
46 :
47  BasePhaseModel(fluid, phaseName, index),
48  thermo_(ThermoType::New(fluid.mesh(), this->name()))
49 {
50  thermo_->validate
51  (
53  "h",
54  "e"
55  );
56 }
57 
58 
59 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
60 
61 template<class BasePhaseModel, class ThermoType>
63 {}
64 
65 
66 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
67 
68 template<class BasePhaseModel, class ThermoType>
70 {
71  return !thermo_().incompressible();
72 }
73 
74 
75 template<class BasePhaseModel, class ThermoType>
76 const Foam::rhoThermo&
78 {
79  return thermo_();
80 }
81 
82 
83 template<class BasePhaseModel, class ThermoType>
86 {
87  return thermo_();
88 }
89 
90 
91 template<class BasePhaseModel, class ThermoType>
94 {
95  return thermo_->rho();
96 }
97 
98 
99 template<class BasePhaseModel, class ThermoType>
102 {
103  return thermo_->mu();
104 }
105 
106 
107 template<class BasePhaseModel, class ThermoType>
110 (
111  const label patchi
112 ) const
113 {
114  return thermo_->mu(patchi);
115 }
116 
117 
118 template<class BasePhaseModel, class ThermoType>
121 {
122  return thermo_->nu();
123 }
124 
125 
126 template<class BasePhaseModel, class ThermoType>
129 (
130  const label patchi
131 ) const
132 {
133  return thermo_->nu(patchi);
134 }
135 
136 
137 template<class BasePhaseModel, class ThermoType>
140 {
141  return thermo_->kappa();
142 }
143 
144 
145 template<class BasePhaseModel, class ThermoType>
148 (
149  const label patchi
150 ) const
151 {
152  return thermo_->kappa(patchi);
153 }
154 
155 
156 template<class BasePhaseModel, class ThermoType>
159 {
160  return thermo_->alphahe();
161 }
162 
163 
164 template<class BasePhaseModel, class ThermoType>
167 (
168  const label patchi
169 ) const
170 {
171  return thermo_->alphahe(patchi);
172 }
173 
174 
175 template<class BasePhaseModel, class ThermoType>
178 (
179  const volScalarField& alphat
180 ) const
181 {
182  return thermo_->kappaEff(alphat);
183 }
184 
185 
186 template<class BasePhaseModel, class ThermoType>
189 (
190  const scalarField& alphat,
191  const label patchi
192 ) const
193 {
194  return thermo_->kappaEff(alphat, patchi);
195 }
196 
197 
198 template<class BasePhaseModel, class ThermoType>
201 {
202  return thermo_->alpha();
203 }
204 
205 
206 template<class BasePhaseModel, class ThermoType>
209 (
210  const label patchi
211 ) const
212 {
213  return thermo_->alpha(patchi);
214 }
215 
216 
217 template<class BasePhaseModel, class ThermoType>
220 (
221  const volScalarField& alphat
222 ) const
223 {
224  return thermo_->alphaEff(alphat);
225 }
226 
227 
228 template<class BasePhaseModel, class ThermoType>
231 (
232  const scalarField& alphat,
233  const label patchi
234 ) const
235 {
236  return thermo_->alphaEff(alphat, patchi);
237 }
238 
239 
240 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
static const char *const typeName
Definition: Field.H:94
virtual bool compressible() const
Return whether the phase is compressible.
Calculate the matrix for the laplacian of the field.
virtual tmp< volScalarField > alphahe() const
Thermal diffusivity for energy of mixture [kg/m/s].
virtual tmp< volScalarField > kappaEff(const volScalarField &alphat) const
Effective thermal turbulent diffusivity for temperature.
virtual rhoThermo & thermoRef()
Access the thermophysical model.
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
virtual const rhoThermo & thermo() const
Return the thermophysical model.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
virtual tmp< volScalarField > mu() const
Return the laminar dynamic viscosity.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:52
Calculate the first temporal derivative.
dynamicFvMesh & mesh
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static word groupName(Name name, const word &group)
Calculate the matrix for the first temporal derivative.
virtual tmp< volScalarField > alpha() const
Thermal diffusivity for enthalpy of mixture [kg/m/s].
ThermoPhaseModel(const phaseSystem &fluid, const word &phaseName, const label index)
Calculate the divergence of the given field.
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Calculate the matrix for the divergence of the given field and flux.
virtual tmp< volScalarField > rho() const
Return the density field.
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:49
A class for managing temporary objects.
Definition: PtrList.H:53
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [J/m/s/K].
virtual ~ThermoPhaseModel()
Destructor.
Calculate the matrix for implicit and explicit sources.
virtual tmp< volScalarField > nu() const
Return the laminar kinematic viscosity.