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-2025 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 word derivedThermoName()
81  {
82  return "heSolidThermo";
83  }
84 
85 
86  //- Runtime type information
87  TypeName("solidThermo");
88 
89 
90  // Declare run-time constructor selection tables
92  (
93  autoPtr,
95  fvMesh,
96  (const fvMesh& mesh, const word& phaseName),
97  (mesh, phaseName)
98  );
99 
100 
101  // Selectors
102 
103  //- Standard selection based on fvMesh
105  (
106  const fvMesh&,
107  const word& phaseName = word::null
108  );
109 
110 
111  //- Destructor
112  virtual ~solidThermo();
113 
114 
115  // Member Functions
116 
117  //- Should the dpdt term be included in the enthalpy equation
118  virtual Switch dpdt() const = 0;
119 
120  //- Return true if thermal conductivity is isotropic
121  virtual bool isotropic() const = 0;
122 
123  //- Anisotropic thermal conductivity [W/m/K]
124  virtual const volVectorField& Kappa() const = 0;
125 };
126 
127 
128 /*---------------------------------------------------------------------------*\
129  Class solidThermo::implementation Declaration
130 \*---------------------------------------------------------------------------*/
131 
133 :
134  virtual public solidThermo
135 {
136 protected:
137 
138  // Protected data
139 
140  // Fields
141 
142  //- Pressure [Pa]
143  // Note: This value should never be used. Solid thermo should only
144  // be instantiated with thermo models that do not depend on
145  // pressure. This uniform field takes a value of NaN, so that if
146  // any thermo models that do depend on pressure are used then the
147  // code will exit.
148  uniformGeometricScalarField p_;
149 
150 
151 public:
152 
153  // Constructors
154 
155  //- Construct from dictionary, mesh and phase name
156  implementation(const dictionary&, const fvMesh&, const word&);
157 
158 
159  //- Destructor
160  virtual ~implementation();
161 
162 
163  // Member Functions
164 
165  //- The dpdt term should not be included in the enthalpy equation
166  virtual Switch dpdt() const
167  {
168  return false;
169  }
170 };
171 
172 
173 /*---------------------------------------------------------------------------*\
174  Class solidThermo::composite Declaration
175 \*---------------------------------------------------------------------------*/
176 
178 :
180  public pureThermo,
183 {
184 public:
185 
186  // Constructors
187 
188  //- Construct from dictionary, mesh and phase name
189  composite
190  (
191  const dictionary& dict,
192  const fvMesh& mesh,
193  const word& phaseName
194  )
195  :
199  {}
200 
201  //- Construct from dictionary, mesh and phase name
202  template<class MixtureType>
203  composite
204  (
205  const dictionary& dict,
206  const MixtureType& mixture,
207  const fvMesh& mesh,
208  const word& phaseName
209  )
210  :
212  {}
213 
214 
215  // Member Functions
216 
217  //- The dpdt term should not be included in the enthalpy equation
218  virtual Switch dpdt() const
219  {
220  return false;
221  }
222 };
223 
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 } // End namespace Foam
228 
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230 
231 #endif
232 
233 // ************************************************************************* //
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:539
virtual const word & phaseName() const
Phase name.
Definition: basicThermo.H:545
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
Base-class for pure (i.e., single-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:217
composite(const dictionary &dict, const fvMesh &mesh, const word &phaseName)
Construct from dictionary, mesh and phase name.
Definition: solidThermo.H:189
virtual Switch dpdt() const
The dpdt term should not be included in the enthalpy equation.
Definition: solidThermo.H:165
virtual ~implementation()
Destructor.
Definition: solidThermo.C:80
uniformGeometricScalarField p_
Pressure [Pa].
Definition: solidThermo.H:147
implementation(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
Definition: solidThermo.C:41
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 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:76
static autoPtr< solidThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: solidThermo.C:65
A class for handling words, derived from string.
Definition: word.H:63
static const word null
An empty word.
Definition: word.H:78
A scalar instance of fvMatrix.
Namespace for OpenFOAM.
dictionary dict
Typedefs for UniformGeometricField.