All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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  // Declare run-time constructor selection tables
85  (
86  autoPtr,
88  dictionary,
89  (const fvMesh& mesh, const dictionary& dict, const word& phaseName),
90  (mesh, dict, phaseName)
91  );
92 
93 
94  // Selectors
95 
96  //- Standard selection based on fvMesh
98  (
99  const fvMesh&,
100  const word& phaseName = word::null
101  );
102 
103  //- Selection using a specified dictionary
105  (
106  const fvMesh&,
107  const dictionary&,
108  const word& phaseName = word::null
109  );
110 
111 
112  //- Destructor
113  virtual ~solidThermo();
114 
115 
116  // Member Functions
117 
118  //- Density [kg/m^3]
119  virtual tmp<volScalarField> rho() const = 0;
120 
121  //- Density for patch [kg/m^3]
122  virtual tmp<scalarField> rho(const label patchi) const = 0;
123 
124  //- Return non-const access to the local density field [kg/m^3]
125  virtual volScalarField& rho() = 0;
126 
127  //- Old-time density [kg/m^3]
128  virtual tmp<volScalarField> rho0() const = 0;
129 
130  //- Return true if thermal conductivity is isotropic
131  virtual bool isotropic() const = 0;
132 
133  //- Anisotropic thermal conductivity [W/m/K]
134  virtual tmp<volVectorField> Kappa() const = 0;
135 
136  //- Anisotropic thermal conductivity for patch [W/m/K]
137  virtual tmp<vectorField> Kappa(const label patchi) const = 0;
138 
139  //- Anisotropic thermal conductivity for patch
140  // in the local coordinate system [W/m/K]
141  virtual tmp<symmTensorField> KappaLocal(const label patchi) const = 0;
142 
143  //- Return the heat flux [W]
144  virtual tmp<surfaceScalarField> q() const = 0;
145 
146  //- Return the source term for the energy equation
147  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const = 0;
148 };
149 
150 
151 /*---------------------------------------------------------------------------*\
152  Class solidThermo::implementation Declaration
153 \*---------------------------------------------------------------------------*/
156 :
157  virtual public solidThermo
158 {
159 protected:
160 
161  // Protected data
162 
163  // Fields
164 
165  //- Pressure [Pa]
166  // Note: This value should never be used. Solid thermo should only
167  // be instantiated with thermo models that do not depend on
168  // pressure. This uniform field takes a value of NaN, so that if
169  // any thermo models that do depend on pressure are used then the
170  // code will exit.
172 
173  //- Density field [kg/m^3]
174  volScalarField rho_;
175 
176 
177 public:
178 
179  // Constructors
180 
181  //- Construct from mesh and phase name
182  implementation(const fvMesh&, const word& phaseName);
183 
184  //- Construct from mesh, dictionary and phase name
186  (
187  const fvMesh&,
188  const dictionary& dict,
189  const word& phaseName
190  );
191 
192 
193  //- Destructor
194  virtual ~implementation();
195 
196 
197  // Member Functions
198 
199  //- Density [kg/m^3]
200  virtual tmp<volScalarField> rho() const;
201 
202  //- Density for patch [kg/m^3]
203  virtual tmp<scalarField> rho(const label patchi) const;
204 
205  //- Return non-const access to the local density field [kg/m^3]
206  virtual volScalarField& rho();
207 
208  //- Old-time density [kg/m^3]
209  virtual tmp<volScalarField> rho0() const;
210 };
211 
212 
213 /*---------------------------------------------------------------------------*\
214  Class solidThermo::composite Declaration
215 \*---------------------------------------------------------------------------*/
218 :
221 {
222 public:
223 
224  // Constructors
225 
226  //- Construct from mesh and phase name
228  (
229  const fvMesh& mesh,
230  const word& phaseName
231  )
232  :
233  basicThermo::implementation(mesh, phaseName),
234  solidThermo::implementation(mesh, phaseName)
235  {}
236 
237  //- Construct from mesh, dictionary and phase name
239  (
240  const fvMesh& mesh,
241  const dictionary& dict,
242  const word& phaseName
243  )
244  :
245  basicThermo::implementation(mesh, dict, phaseName),
246  solidThermo::implementation(mesh, dict, phaseName)
247  {}
248 };
249 
250 
251 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
252 
253 } // End namespace Foam
254 
255 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
256 
257 #endif
258 
259 // ************************************************************************* //
virtual tmp< symmTensorField > KappaLocal(const label patchi) const =0
Anisotropic thermal conductivity for patch.
dictionary dict
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
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:113
virtual tmp< volVectorField > Kappa() const =0
Anisotropic thermal conductivity [W/m/K].
virtual ~solidThermo()
Destructor.
Definition: solidThermo.C:135
virtual volScalarField & he()=0
Enthalpy/Internal energy [J/kg].
TypeName("solidThermo")
Runtime type information.
virtual const word & phaseName() const =0
Return the phase name.
dynamicFvMesh & mesh
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:78
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))