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-2020 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 #include "phaseSystem.H"
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class BasePhaseModel, class ThermoModel>
33 (
34  const phaseSystem& fluid,
35  const word& phaseName,
36  const bool referencePhase,
37  const label index
38 )
39 :
40  BasePhaseModel(fluid, phaseName, referencePhase, index),
41  thermo_(ThermoModel::New(fluid.mesh(), this->name()))
42 {
43  thermo_->validate
44  (
46  "h",
47  "e"
48  );
49 }
50 
51 
52 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
53 
54 template<class BasePhaseModel, class ThermoModel>
56 {}
57 
58 
59 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
60 
61 template<class BasePhaseModel, class ThermoModel>
63 {
64  return thermo_().incompressible();
65 }
66 
67 
68 template<class BasePhaseModel, class ThermoModel>
70 {
71  return thermo_().isochoric();
72 }
73 
74 
75 template<class BasePhaseModel, class ThermoModel>
76 const Foam::rhoThermo&
78 {
79  return thermo_();
80 }
81 
82 
83 template<class BasePhaseModel, class ThermoModel>
86 {
87  return thermo_();
88 }
89 
90 
91 template<class BasePhaseModel, class ThermoModel>
94 {
95  return thermo_->rho();
96 }
97 
98 
99 template<class BasePhaseModel, class ThermoModel>
102 {
103  return thermo_->mu();
104 }
105 
106 
107 template<class BasePhaseModel, class ThermoModel>
110 (
111  const label patchi
112 ) const
113 {
114  return thermo_->mu(patchi);
115 }
116 
117 
118 template<class BasePhaseModel, class ThermoModel>
121 {
122  return thermo_->nu();
123 }
124 
125 
126 template<class BasePhaseModel, class ThermoModel>
129 (
130  const label patchi
131 ) const
132 {
133  return thermo_->nu(patchi);
134 }
135 
136 
137 // ************************************************************************* //
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:105
virtual bool incompressible() const
Return whether the phase is incompressible.
virtual bool isochoric() const
Return whether the phase is constant density.
virtual rhoThermo & thermoRef()
Access the thermophysical model.
virtual const rhoThermo & thermo() const
Return the thermophysical model.
virtual tmp< volScalarField > mu() const
Return the laminar dynamic viscosity.
dynamicFvMesh & mesh
autoPtr< BasicCompressibleMomentumTransportModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleMomentumTransportModel::transportModel &transport)
static word groupName(Name name, const word &group)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
virtual tmp< volScalarField > rho() const
Return the density field.
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:49
ThermoPhaseModel(const phaseSystem &fluid, const word &phaseName, const bool referencePhase, const label index)
A class for managing temporary objects.
Definition: PtrList.H:53
virtual ~ThermoPhaseModel()
Destructor.
virtual tmp< volScalarField > nu() const
Return the laminar kinematic viscosity.