ThermoPhaseModel.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) 2015-2018 OpenFOAM Foundation
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::ThermoPhaseModel
28 
29 Description
30  Class which represents a phase with a thermodynamic model. Provides access
31  to the thermodynamic variables. Note that the thermo model itself is not
32  returned as this class could be substituted in the hierarchy for one which
33  mirrors the functionality, but does not include a thermo model; an
34  incompressible phase model, for example.
35 
36 SourceFiles
37  ThermoPhaseModel.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef ThermoPhaseModel_H
42 #define ThermoPhaseModel_H
43 
44 #include "phaseModel.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class rhoThermo;
52 
53 /*---------------------------------------------------------------------------*\
54  Class ThermoPhaseModel Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 template<class BasePhaseModel, class ThermoType>
58 class ThermoPhaseModel
59 :
60  public BasePhaseModel
61 {
62 protected:
63 
64  // Protected data
65 
66  //- Thermophysical model
68 
69 
70 public:
71 
72  // Constructors
73 
75  (
76  const phaseSystem& fluid,
77  const word& phaseName,
78  const label index
79  );
80 
81 
82  //- Destructor
83  virtual ~ThermoPhaseModel();
84 
85 
86  // Member Functions
87 
88  // Thermo
89 
90  //- Return whether the phase is compressible
91  virtual bool compressible() const;
92 
93  //- Return the thermophysical model
94  virtual const rhoThermo& thermo() const;
95 
96  //- Access the thermophysical model
97  virtual rhoThermo& thermoRef();
98 
99  //- Return the density field
100  virtual tmp<volScalarField> rho() const;
101 
102 
103  // Transport
104 
105  //- Return the laminar dynamic viscosity
106  virtual tmp<volScalarField> mu() const;
107 
108  //- Return the laminar dynamic viscosity on a patch
109  virtual tmp<scalarField> mu(const label patchi) const;
110 
111  //- Return the laminar kinematic viscosity
112  virtual tmp<volScalarField> nu() const;
113 
114  //- Return the laminar kinematic viscosity on a patch
115  virtual tmp<scalarField> nu(const label patchi) const;
116 
117  //- Thermal diffusivity for enthalpy of mixture [kg/m/s]
118  virtual tmp<volScalarField> alpha() const;
119 
120  //- Thermal diffusivity for enthalpy of mixture for patch [kg/m/s]
121  virtual tmp<scalarField> alpha(const label patchi) const;
122 
123  //- Thermal diffusivity for temperature of mixture [J/m/s/K]
124  virtual tmp<volScalarField> kappa() const;
125 
126  //- Thermal diffusivity for temperature of mixture
127  // for patch [J/m/s/K]
128  virtual tmp<scalarField> kappa(const label patchi) const;
129 
130  //- Thermal diffusivity for energy of mixture [kg/m/s]
131  virtual tmp<volScalarField> alphahe() const;
132 
133  //- Thermal diffusivity for energy of mixture for patch [kg/m/s]
134  virtual tmp<scalarField> alphahe(const label patchi) const;
135 
136 
137  // Turbulence
138 
139  //- Effective thermal turbulent diffusivity for temperature
140  // of mixture for patch [J/m/s/K]
142 
143  //- Effective thermal turbulent diffusivity for temperature
144  // of mixture [J/m/s/K]
146  (
147  const volScalarField& alphat
148  ) const;
149 
150  //- Effective thermal turbulent diffusivity for temperature
151  // of mixture for patch [J/m/s/K]
152  virtual tmp<scalarField> kappaEff
153  (
154  const scalarField& alphat,
155  const label patchi
156  ) const;
157 
158  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
160 
161  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
163  (
164  const volScalarField& alphat
165  ) const;
166 
167  //- Effective thermal turbulent diffusivity of mixture
168  // for patch [kg/m/s]
169  virtual tmp<scalarField> alphaEff
170  (
171  const scalarField& alphat,
172  const label patchi
173  ) const;
174 };
175 
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 } // End namespace Foam
180 
181 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 
183 #ifdef NoRepository
184  #include "ThermoPhaseModel.C"
185 #endif
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 #endif
190 
191 // ************************************************************************* //
Foam::ThermoPhaseModel::thermo
virtual const rhoThermo & thermo() const
Return the thermophysical model.
Definition: ThermoPhaseModel.C:79
Foam::ThermoPhaseModel::rho
virtual tmp< volScalarField > rho() const
Return the density field.
Definition: ThermoPhaseModel.C:95
Foam::ThermoPhaseModel::mu
virtual tmp< volScalarField > mu() const
Return the laminar dynamic viscosity.
Definition: ThermoPhaseModel.C:103
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::ThermoPhaseModel::compressible
virtual bool compressible() const
Return whether the phase is compressible.
Definition: ThermoPhaseModel.C:71
Foam::ThermoPhaseModel::~ThermoPhaseModel
virtual ~ThermoPhaseModel()
Destructor.
Definition: ThermoPhaseModel.C:64
kappaEff
kappaEff
Definition: TEqn.H:10
Foam::ThermoPhaseModel::thermoRef
virtual rhoThermo & thermoRef()
Access the thermophysical model.
Definition: ThermoPhaseModel.C:87
fluid
twoPhaseSystem & fluid
Definition: setRegionFluidFields.H:3
ThermoPhaseModel.C
Foam::rhoThermo
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:55
Foam::Field< scalar >
Foam::ThermoPhaseModel::ThermoPhaseModel
ThermoPhaseModel(const phaseSystem &fluid, const word &phaseName, const label index)
Definition: ThermoPhaseModel.C:43
Foam::ThermoPhaseModel
Class which represents a phase with a thermodynamic model. Provides access to the thermodynamic varia...
Definition: ThermoPhaseModel.H:57
Foam::ThermoPhaseModel::alpha
virtual tmp< volScalarField > alpha() const
Thermal diffusivity for enthalpy of mixture [kg/m/s].
Definition: ThermoPhaseModel.C:202
Foam::ThermoPhaseModel::nu
virtual tmp< volScalarField > nu() const
Return the laminar kinematic viscosity.
Definition: ThermoPhaseModel.C:122
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::ThermoPhaseModel::thermo_
autoPtr< ThermoType > thermo_
Thermophysical model.
Definition: ThermoPhaseModel.H:66
Foam::ThermoPhaseModel::kappa
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [J/m/s/K].
Definition: ThermoPhaseModel.C:141
Foam::autoPtr< ThermoType >
Foam::ThermoPhaseModel::alphahe
virtual tmp< volScalarField > alphahe() const
Thermal diffusivity for energy of mixture [kg/m/s].
Definition: ThermoPhaseModel.C:160
alphaEff
volScalarField alphaEff("alphaEff", turbulence->nu()/Pr+alphat)
Foam::phaseSystem
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:63
Foam::ThermoPhaseModel::alphaEff
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
Definition: ThermoPhaseModel.C:222
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::ThermoPhaseModel::kappaEff
virtual tmp< volScalarField > kappaEff(const volScalarField &alphat) const
Effective thermal turbulent diffusivity for temperature.
Definition: ThermoPhaseModel.C:180