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-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::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 "basicThermo.H"
42 #include "uniformGeometricFields.H"
43 #include "fvScalarMatrix.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class solidThermo Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class solidThermo
55 :
56  virtual public basicThermo
57 {
58 public:
59 
60  // Public Classes
61 
62  //- Forward declare the implementation class
63  class implementation;
64 
65  //- Forward declare the composite class
66  class composite;
67 
68 
69  //- Runtime type information
70  TypeName("solidThermo");
71 
72 
73  // Declare run-time constructor selection tables
75  (
76  autoPtr,
78  fvMesh,
79  (const fvMesh& mesh, const word& phaseName),
80  (mesh, phaseName)
81  );
82 
83 
84  // Selectors
85 
86  //- Standard selection based on fvMesh
88  (
89  const fvMesh&,
90  const word& phaseName = word::null
91  );
92 
93 
94  //- Destructor
95  virtual ~solidThermo();
96 
97 
98  // Member Functions
99 
100  //- Density [kg/m^3]
101  virtual tmp<volScalarField> rho() const = 0;
102 
103  //- Density for patch [kg/m^3]
104  virtual tmp<scalarField> rho(const label patchi) const = 0;
105 
106  //- Return non-const access to the local density field [kg/m^3]
107  virtual volScalarField& rho() = 0;
108 
109  //- Old-time density [kg/m^3]
110  virtual tmp<volScalarField> rho0() const = 0;
111 
112  //- Return true if thermal conductivity is isotropic
113  virtual bool isotropic() const = 0;
114 
115  //- Anisotropic thermal conductivity [W/m/K]
116  virtual tmp<volVectorField> Kappa() const = 0;
117 
118  //- Anisotropic thermal conductivity for patch [W/m/K]
119  virtual tmp<vectorField> Kappa(const label patchi) const = 0;
120 
121  //- Anisotropic thermal conductivity for patch
122  // in the local coordinate system [W/m/K]
123  virtual tmp<symmTensorField> KappaLocal(const label patchi) const = 0;
124 
125  //- Return the heat flux [W]
126  virtual tmp<surfaceScalarField> q() const = 0;
127 
128  //- Return the source term for the energy equation
129  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const = 0;
130 };
131 
132 
133 /*---------------------------------------------------------------------------*\
134  Class solidThermo::implementation Declaration
135 \*---------------------------------------------------------------------------*/
138 :
139  virtual public solidThermo
140 {
141 protected:
142 
143  // Protected data
144 
145  // Fields
146 
147  //- Pressure [Pa]
148  // Note: This value should never be used. Solid thermo should only
149  // be instantiated with thermo models that do not depend on
150  // pressure. This uniform field takes a value of NaN, so that if
151  // any thermo models that do depend on pressure are used then the
152  // code will exit.
154 
155  //- Density field [kg/m^3]
156  volScalarField rho_;
157 
158 
159 public:
160 
161  // Constructors
162 
163  //- Construct from mesh and phase name
164  implementation(const fvMesh&, const word& phaseName);
165 
166  //- Construct from mesh, dictionary and phase name
168  (
169  const fvMesh&,
170  const dictionary& dict,
171  const word& phaseName
172  );
173 
174 
175  //- Destructor
176  virtual ~implementation();
177 
178 
179  // Member Functions
180 
181  //- Density [kg/m^3]
182  virtual tmp<volScalarField> rho() const;
183 
184  //- Density for patch [kg/m^3]
185  virtual tmp<scalarField> rho(const label patchi) const;
186 
187  //- Return non-const access to the local density field [kg/m^3]
188  virtual volScalarField& rho();
189 
190  //- Old-time density [kg/m^3]
191  virtual tmp<volScalarField> rho0() const;
192 };
193 
194 
195 /*---------------------------------------------------------------------------*\
196  Class solidThermo::composite Declaration
197 \*---------------------------------------------------------------------------*/
200 :
203 {
204 public:
205 
206  // Constructors
207 
208  //- Construct from mesh and phase name
210  (
211  const fvMesh& mesh,
212  const word& phaseName
213  )
214  :
215  basicThermo::implementation(mesh, phaseName),
216  solidThermo::implementation(mesh, phaseName)
217  {}
218 };
219 
220 
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
222 
223 } // End namespace Foam
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 #endif
228 
229 // ************************************************************************* //
virtual tmp< symmTensorField > KappaLocal(const label patchi) const =0
Anisotropic thermal conductivity for patch.
dictionary dict
Base-class for fluid and solid thermodynamic properties.
Definition: basicThermo.H:77
virtual tmp< volScalarField > rho0() const =0
Old-time density [kg/m^3].
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
static autoPtr< solidThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: solidThermo.C:112
virtual tmp< volVectorField > Kappa() const =0
Anisotropic thermal conductivity [W/m/K].
virtual ~solidThermo()
Destructor.
Definition: solidThermo.C:134
fvMesh & mesh
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
TypeName("solidThermo")
Runtime type information.
virtual const word & phaseName() const =0
Phase name.
virtual bool isotropic() const =0
Return true if thermal conductivity is isotropic.
A class for handling words, derived from string.
Definition: word.H:59
static const word null
An empty word.
Definition: word.H:77
virtual tmp< volScalarField > rho() const =0
Density [kg/m^3].
Base-class for solid thermodynamic properties.
Definition: solidThermo.H:53
label patchi
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const =0
Return the source term for the energy equation.
A scalar instance of fvMatrix.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
virtual tmp< surfaceScalarField > q() const =0
Return the heat flux [W].
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
A class for managing temporary objects.
Definition: PtrList.H:53
Namespace for OpenFOAM.
declareRunTimeSelectionTable(autoPtr, solidThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))