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-2021 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 ThermoModel>
56 class ThermoPhaseModel
57 :
58  public BasePhaseModel,
59  public viscosity
60 {
61 protected:
62 
63  // Protected data
64 
65  //- Thermophysical model
67 
68 
69 public:
70 
71  typedef ThermoModel thermoModel;
72 
73 
74  // Constructors
75 
77  (
78  const phaseSystem& fluid,
79  const word& phaseName,
80  const bool referencePhase,
81  const label index
82  );
83 
84 
85  //- Destructor
86  virtual ~ThermoPhaseModel();
87 
88 
89  // Member Functions
90 
91  // Thermo
92 
93  //- Return whether the phase is incompressible
94  virtual bool incompressible() const;
95 
96  //- Return whether the phase is constant density
97  virtual bool isochoric() const;
98 
99  //- Return the thermophysical model
100  virtual const rhoThermo& thermo() const;
101 
102  //- Access the thermophysical model
103  virtual rhoThermo& thermoRef();
104 
105  //- Return the density field
106  virtual tmp<volScalarField> rho() const;
107 
108 
109  // Transport
110 
111  //- Return the laminar dynamic viscosity
112  virtual tmp<volScalarField> mu() const;
113 
114  //- Return the laminar dynamic viscosity on a patch
115  virtual tmp<scalarField> mu(const label patchi) const;
116 
117  //- Return the laminar kinematic viscosity
118  virtual tmp<volScalarField> nu() const;
119 
120  //- Return the laminar kinematic viscosity on a patch
121  virtual tmp<scalarField> nu(const label patchi) const;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #ifdef NoRepository
132  #include "ThermoPhaseModel.C"
133 #endif
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
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.
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:68
A class for handling words, derived from string.
Definition: word.H:59
phaseSystem & fluid
Definition: createFields.H:11
Abstract base class for all fluid physical properties.
Definition: viscosity.H:49
virtual tmp< volScalarField > rho() const
Return the density field.
label patchi
autoPtr< ThermoModel > thermo_
Thermophysical model.
Base-class for fluid thermodynamic properties based on density.
Definition: rhoThermo.H:52
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.
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.