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 | Copyright (C) 2015 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 hierarcy 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 phaseModel 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  //- Thermophysical model
68  ThermoType* thermo_;
69 
70 
71 public:
72 
73  // Constructors
74 
76  (
77  const phaseSystem& fluid,
78  const word& phaseName,
79  const label index,
80  const bool createThermo = true
81  );
82 
83 
84  //- Destructor
85  virtual ~ThermoPhaseModel();
86 
87 
88  // Member Functions
89 
90  // Thermo
91 
92  //- Return const access to the thermophysical model
93  virtual const rhoThermo& thermo() const;
94 
95  //- Return non-const access to the thermophysical model
96  // for correction
97  virtual rhoThermo& thermo();
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  //- Access the laminar dynamic viscosity
109  virtual tmp<scalarField> mu(const label patchi) const;
110 
111  //- Return the laminar kinematic viscosity
112  virtual tmp<volScalarField> nu() const;
113 
114  //- Access the laminar kinematic viscosity
115  virtual tmp<scalarField> nu(const label patchi) const;
116 
117  //- Return the laminar thermal conductivity
118  virtual tmp<volScalarField> kappa() const;
119 
120  //- Access the laminar thermal conductivity
121  virtual tmp<scalarField> kappa(const label patchi) const;
122 
123  //- Return the laminar thermal conductivity
125  (
126  const volScalarField& alphat
127  ) const;
128 
129  //- Access the laminar thermal conductivity
130  virtual tmp<scalarField> kappaEff
131  (
132  const scalarField& alphat,
133  const label patchi
134  ) const;
135 
136  //- Return the thermal diffusivity for enthalpy
137  virtual tmp<volScalarField> alpha() const;
138 
139  //- Return the thermal diffusivity for enthalpy on a patch
140  virtual tmp<scalarField> alpha(const label patchi) const;
141 
142  //- Return the thermal diffusivity for enthalpy
144  (
145  const volScalarField& alphat
146  ) const;
147 
148  //- Return the thermal diffusivity for enthalpy on a patch
149  virtual tmp<scalarField> alphaEff
150  (
151  const scalarField& alphat,
152  const label patchi
153  ) const;
154 };
155 
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 } // End namespace Foam
160 
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 
163 #ifdef NoRepository
164 # include "ThermoPhaseModel.C"
165 #endif
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
virtual const rhoThermo & thermo() const
Return const access to the thermophysical model.
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Return the thermal diffusivity for enthalpy.
multiphaseSystem & fluid
Definition: createFields.H:10
Class which represents a phase with a thermodynamic model. Provides access to the thermodynamic varia...
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:67
virtual tmp< volScalarField > mu() const
Return the laminar dynamic viscosity.
virtual tmp< volScalarField > alpha() const
Return the thermal diffusivity for enthalpy.
A class for handling words, derived from string.
Definition: word.H:59
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
virtual tmp< volScalarField > nu() const
Return the laminar kinematic viscosity.
Basic thermodynamic properties based on density.
Definition: rhoThermo.H:49
virtual tmp< volScalarField > kappa() const
Return the laminar thermal conductivity.
Namespace for OpenFOAM.
virtual tmp< volScalarField > kappaEff(const volScalarField &alphat) const
Return the laminar thermal conductivity.
virtual tmp< volScalarField > rho() const
Return the density field.
label patchi
ThermoType * thermo_
Thermophysical model.
virtual ~ThermoPhaseModel()
Destructor.
A class for managing temporary objects.
Definition: PtrList.H:118
autoPtr< ThermoType > thermoPtr_
Thermophysical model.
ThermoPhaseModel(const phaseSystem &fluid, const word &phaseName, const label index, const bool createThermo=true)