solidThermo.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) 2011-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::solidThermo
26 
27 Description
28  Base-class for solid thermodynamic properties.
29 
30 See also
31  Foam::basicThermo
32 
33 SourceFiles
34  solidThermo.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef solidThermo_H
39 #define solidThermo_H
40 
41 #include "SolidThermo.H"
42 #include "pureThermo.H"
43 #include "rhoThermo.H"
44 #include "uniformGeometricFields.H"
45 #include "fvScalarMatrix.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class solidThermo Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class solidThermo
57 :
58  virtual public basicThermo,
59  virtual public rhoThermo
60 {
61 public:
62 
63  // Public Classes
64 
65  //- Forward declare the implementation class
66  class implementation;
67 
68  //- Forward declare the composite class
69  class composite;
70 
71 
72  // Public Typedefs
73 
74  //- The derived type
75  template<class MixtureType>
76  using DerivedThermoType =
78 
79  //- The derived name
80  static const word derivedThermoName;
81 
82 
83  //- Runtime type information
84  TypeName("solidThermo");
85 
86 
87  // Declare run-time constructor selection tables
89  (
90  autoPtr,
92  fvMesh,
93  (const fvMesh& mesh, const word& phaseName),
94  (mesh, phaseName)
95  );
96 
97 
98  // Selectors
99 
100  //- Standard selection based on fvMesh
102  (
103  const fvMesh&,
104  const word& phaseName = word::null
105  );
106 
107 
108  //- Destructor
109  virtual ~solidThermo();
110 
111 
112  // Member Functions
113 
114  //- Should the dpdt term be included in the enthalpy equation
115  virtual Switch dpdt() const = 0;
116 
117  //- Return true if thermal conductivity is isotropic
118  virtual bool isotropic() const = 0;
119 
120  //- Anisotropic thermal conductivity [W/m/K]
121  virtual const volVectorField& Kappa() const = 0;
122 };
123 
124 
125 /*---------------------------------------------------------------------------*\
126  Class solidThermo::implementation Declaration
127 \*---------------------------------------------------------------------------*/
128 
130 :
131  virtual public solidThermo
132 {
133 protected:
134 
135  // Protected data
136 
137  // Fields
138 
139  //- Pressure [Pa]
140  // Note: This value should never be used. Solid thermo should only
141  // be instantiated with thermo models that do not depend on
142  // pressure. This uniform field takes a value of NaN, so that if
143  // any thermo models that do depend on pressure are used then the
144  // code will exit.
146 
147 
148 public:
149 
150  // Constructors
151 
152  //- Construct from dictionary, mesh and phase name
153  implementation(const dictionary&, const fvMesh&, const word&);
154 
155 
156  //- Destructor
157  virtual ~implementation();
158 
159 
160  // Member Functions
161 
162  //- The dpdt term should not be included in the enthalpy equation
163  virtual Switch dpdt() const
164  {
165  return false;
166  }
167 };
168 
169 
170 /*---------------------------------------------------------------------------*\
171  Class solidThermo::composite Declaration
172 \*---------------------------------------------------------------------------*/
173 
175 :
177  public pureThermo,
180 {
181 public:
182 
183  // Constructors
184 
185  //- Construct from dictionary, mesh and phase name
186  composite
187  (
188  const dictionary& dict,
189  const fvMesh& mesh,
190  const word& phaseName
191  )
192  :
196  {}
197 
198  //- Construct from dictionary, mesh and phase name
199  template<class MixtureType>
200  composite
201  (
202  const dictionary& dict,
203  const MixtureType& mixture,
204  const fvMesh& mesh,
205  const word& phaseName
206  )
207  :
209  {}
210 
211 
212  // Member Functions
213 
214  //- The dpdt term should not be included in the enthalpy equation
215  virtual Switch dpdt() const
216  {
217  return false;
218  }
219 };
220 
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 } // End namespace Foam
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
Generic GeometricField class.
Thermo implementation for a solid.
Definition: SolidThermo.H:52
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:61
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
virtual const fvMesh & mesh() const
Return const access to the mesh.
Definition: basicThermo.H:496
virtual const word & phaseName() const
Phase name.
Definition: basicThermo.H:502
Base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:78
virtual const fvMesh & mesh() const =0
Return const access to the mesh.
virtual const word & phaseName() const =0
Phase name.
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Base-class for multi-component thermodynamic properties.
Definition: pureThermo.H:54
Base-class for thermodynamic properties based on density.
Definition: rhoThermo.H:54
virtual Switch dpdt() const
The dpdt term should not be included in the enthalpy equation.
Definition: solidThermo.H:214
composite(const dictionary &dict, const fvMesh &mesh, const word &phaseName)
Construct from dictionary, mesh and phase name.
Definition: solidThermo.H:186
virtual Switch dpdt() const
The dpdt term should not be included in the enthalpy equation.
Definition: solidThermo.H:162
virtual ~implementation()
Destructor.
Definition: solidThermo.C:82
uniformGeometricScalarField p_
Pressure [Pa].
Definition: solidThermo.H:144
implementation(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
Definition: solidThermo.C:43
Base-class for solid thermodynamic properties.
Definition: solidThermo.H:59
virtual const volVectorField & Kappa() const =0
Anisotropic thermal conductivity [W/m/K].
virtual bool isotropic() const =0
Return true if thermal conductivity is isotropic.
static const word derivedThermoName
The derived name.
Definition: solidThermo.H:79
declareRunTimeSelectionTable(autoPtr, solidThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
TypeName("solidThermo")
Runtime type information.
virtual Switch dpdt() const =0
Should the dpdt term be included in the enthalpy equation.
virtual ~solidThermo()
Destructor.
Definition: solidThermo.C:78
static autoPtr< solidThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: solidThermo.C:67
A class for handling words, derived from string.
Definition: word.H:62
static const word null
An empty word.
Definition: word.H:77
A scalar instance of fvMatrix.
Namespace for OpenFOAM.
dictionary dict