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-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 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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 class rhoThermo;
48 
49 /*---------------------------------------------------------------------------*\
50  Class ThermoPhaseModel Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 template<class BasePhaseModel, class ThermoModel>
54 class ThermoPhaseModel
55 :
56  public BasePhaseModel
57 {
58 protected:
59 
60  // Protected data
61 
62  //- Thermophysical model
64 
65 
66 public:
67 
68  typedef ThermoModel thermoModel;
69 
70 
71  // Constructors
72 
74  (
75  const phaseSystem& fluid,
76  const word& phaseName,
77  const bool referencePhase,
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 incompressible
91  virtual bool incompressible() const;
92 
93  //- Return whether the phase is constant density
94  virtual bool isochoric() const;
95 
96  //- Return the thermophysical model
97  virtual const rhoThermo& thermo() const;
98 
99  //- Access the thermophysical model
100  virtual rhoThermo& thermoRef();
101 
102  //- Return the density field
103  virtual tmp<volScalarField> rho() const;
104 
105 
106  // Transport
107 
108  //- Return the laminar dynamic viscosity
109  virtual tmp<volScalarField> mu() const;
110 
111  //- Return the laminar dynamic viscosity on a patch
112  virtual tmp<scalarField> mu(const label patchi) const;
113 
114  //- Return the laminar kinematic viscosity
115  virtual tmp<volScalarField> nu() const;
116 
117  //- Return the laminar kinematic viscosity on a patch
118  virtual tmp<scalarField> nu(const label patchi) const;
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #ifdef NoRepository
129  #include "ThermoPhaseModel.C"
130 #endif
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
135 
136 // ************************************************************************* //
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 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:67
A class for handling words, derived from string.
Definition: word.H:59
phaseSystem & fluid
Definition: createFields.H:11
virtual tmp< volScalarField > rho() const
Return the density field.
label patchi
autoPtr< ThermoModel > thermo_
Thermophysical model.
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.
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.