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