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-2023 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& thermo();
104 
105  //- Return the density field
106  virtual const volScalarField& rho() const;
107 
108  //- Access the the density field
109  virtual volScalarField& rho();
110 
111 
112  // Transport
113 
114  //- Return the laminar dynamic viscosity
115  virtual tmp<volScalarField> mu() const;
116 
117  //- Return the laminar dynamic viscosity on a patch
118  virtual tmp<scalarField> mu(const label patchi) const;
119 
120  //- Return the laminar kinematic viscosity
121  virtual tmp<volScalarField> nu() const;
122 
123  //- Return the laminar kinematic viscosity on a patch
124  virtual tmp<scalarField> nu(const label patchi) const;
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #ifdef NoRepository
135  #include "ThermoPhaseModel.C"
136 #endif
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 #endif
141 
142 // ************************************************************************* //
Generic GeometricField class.
Class which represents a phase with a thermodynamic model. Provides access to the thermodynamic varia...
virtual const rhoThermo & thermo() const
Return the thermophysical model.
ThermoPhaseModel(const phaseSystem &fluid, const word &phaseName, const bool referencePhase, const label index)
virtual const volScalarField & rho() const
Return the density field.
virtual tmp< volScalarField > mu() const
Return the laminar dynamic viscosity.
virtual tmp< volScalarField > nu() const
Return the laminar kinematic viscosity.
virtual ~ThermoPhaseModel()
Destructor.
autoPtr< ThermoModel > thermo_
Thermophysical model.
virtual bool isochoric() const
Return whether the phase is constant density.
virtual bool incompressible() const
Return whether the phase is incompressible.
Class to represent a system of phases and model interfacial transfers between them.
Definition: phaseSystem.H:73
Base-class for fluid thermodynamic properties based on density.
Definition: rhoThermo.H:55
A class for managing temporary objects.
Definition: tmp.H:55
Abstract base class for all fluid physical properties.
Definition: viscosity.H:50
A class for handling words, derived from string.
Definition: word.H:62
label patchi
Namespace for OpenFOAM.
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