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-2022 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  //- Return true if thermal conductivity is isotropic
110  virtual bool isotropic() const = 0;
111 
112  //- Anisotropic thermal conductivity [W/m/K]
113  virtual const volVectorField& Kappa() const = 0;
114 };
115 
116 
117 /*---------------------------------------------------------------------------*\
118  Class solidThermo::implementation Declaration
119 \*---------------------------------------------------------------------------*/
120 
122 :
123  virtual public solidThermo
124 {
125 protected:
126 
127  // Protected data
128 
129  // Fields
130 
131  //- Pressure [Pa]
132  // Note: This value should never be used. Solid thermo should only
133  // be instantiated with thermo models that do not depend on
134  // pressure. This uniform field takes a value of NaN, so that if
135  // any thermo models that do depend on pressure are used then the
136  // code will exit.
138 
139  //- Density field [kg/m^3]
141 
142 
143 public:
144 
145  // Constructors
146 
147  //- Construct from mesh and phase name
148  implementation(const fvMesh&, const word& phaseName);
149 
150  //- Construct from mesh, dictionary and phase name
152  (
153  const fvMesh&,
154  const dictionary& dict,
155  const word& phaseName
156  );
157 
158 
159  //- Destructor
160  virtual ~implementation();
161 
162 
163  // Member Functions
164 
165  //- Density [kg/m^3]
166  virtual tmp<volScalarField> rho() const;
167 
168  //- Density for patch [kg/m^3]
169  virtual tmp<scalarField> rho(const label patchi) const;
170 
171  //- Return non-const access to the local density field [kg/m^3]
172  virtual volScalarField& rho();
173 };
174 
175 
176 /*---------------------------------------------------------------------------*\
177  Class solidThermo::composite Declaration
178 \*---------------------------------------------------------------------------*/
179 
181 :
184 {
185 public:
186 
187  // Constructors
188 
189  //- Construct from mesh and phase name
190  composite
191  (
192  const fvMesh& mesh,
193  const word& phaseName
194  )
195  :
198  {}
199 };
200 
201 
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
203 
204 } // End namespace Foam
205 
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
207 
208 #endif
209 
210 // ************************************************************************* //
Generic GeometricField class.
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:484
virtual const word & phaseName() const
Phase name.
Definition: basicThermo.H:490
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:160
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
composite(const fvMesh &mesh, const word &phaseName)
Construct from mesh and phase name.
Definition: solidThermo.H:190
volScalarField rho_
Density field [kg/m^3].
Definition: solidThermo.H:139
implementation(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition: solidThermo.C:41
virtual ~implementation()
Destructor.
Definition: solidThermo.C:114
uniformGeometricScalarField p_
Pressure [Pa].
Definition: solidThermo.H:136
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Definition: solidThermo.C:120
Base-class for solid thermodynamic properties.
Definition: solidThermo.H:56
virtual const volVectorField & Kappa() const =0
Anisotropic thermal conductivity [W/m/K].
virtual bool isotropic() const =0
Return true if thermal conductivity is isotropic.
declareRunTimeSelectionTable(autoPtr, solidThermo, fvMesh,(const fvMesh &mesh, const word &phaseName),(mesh, phaseName))
TypeName("solidThermo")
Runtime type information.
virtual ~solidThermo()
Destructor.
Definition: solidThermo.C:110
static autoPtr< solidThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: solidThermo.C:88
virtual tmp< volScalarField > rho() const =0
Density [kg/m^3].
A class for managing temporary objects.
Definition: tmp.H:55
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.
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
dictionary dict