solidDisplacementThermo.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) 2019-2020 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::solidDisplacementThermo
26 
27 Description
28  Fundamental solid thermodynamic properties
29 
30 SourceFiles
31  solidDisplacementThermo.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef solidDisplacementThermo_H
36 #define solidDisplacementThermo_H
37 
38 #include "solidThermo.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class solidDisplacementThermo Declaration
47 \*---------------------------------------------------------------------------*/
48 
50 :
51  public solidThermo
52 {
53  // Private data
54 
55  //- Switch to enable plane stress
56  Switch planeStress_;
57 
58  //- Switch to enable thermal stress
59  Switch thermalStress_;
60 
61  //- Heat capacity at constant pressure [J/kg/K]
62  volScalarField Cp_;
63 
64  //- Thermal diffusivity for temperature [W/m/K]
65  volScalarField kappa_;
66 
67  //- Youngs modulus [Pa]
68  volScalarField E_;
69 
70  //- Poisson's ratio []
71  volScalarField nu_;
72 
73  //- Volumetric thermal expansion coefficient [1/T]
74  volScalarField alphav_;
75 
76 
77  // Private Member Functions
78 
79  void readProperty(volScalarField& prop) const;
80 
81 
82 public:
83 
84  //- Runtime type information
85  TypeName("solidDisplacementThermo");
86 
87 
88  // Constructors
89 
90  //- Construct from mesh and phase name
92  (
93  const fvMesh&,
94  const word& phaseName = word::null
95  );
96 
97 
98  //- Destructor
99  virtual ~solidDisplacementThermo();
100 
101 
102  // Member Functions
103 
104  //- Return the name of the thermo physics
105  virtual word thermoName() const
106  {
107  return type();
108  }
109 
110  //- Return true if the equation of state is incompressible
111  // i.e. rho != f(p)
112  virtual bool incompressible() const
113  {
114  return true;
115  }
116 
117  //- Return true if the equation of state is isochoric
118  // i.e. rho = const
119  virtual bool isochoric() const
120  {
121  return true;
122  }
123 
124  //- Returns true to enable plane stress
125  bool planeStress() const
126  {
127  return planeStress_;
128  }
129 
130  //- Returns true to enable thermal stress
131  bool thermalStress() const
132  {
133  return thermalStress_;
134  }
135 
136 
137  // Access to thermophysical state variables
138 
139  //- Density [kg/m^3]
140  virtual tmp<volScalarField> rho() const;
141 
142  //- Density for patch [kg/m^3]
143  virtual tmp<scalarField> rho(const label patchi) const;
144 
145  //- Youngs modulus [Pa]
146  virtual const volScalarField& E() const;
147 
148  //- Youngs modulus for a patch [Pa]
149  virtual const scalarField& E(const label patchi) const;
150 
151  //- Poisson's ratio []
152  virtual const volScalarField& nu() const;
153 
154  //- Poisson's ratio for a patch[]
155  virtual const scalarField& nu(const label patchi) const;
156 
157  //- Volumetric thermal expansion coefficient [1/T]
158  virtual const volScalarField& alphav() const;
159 
160  //- Volumetric thermal expansion coefficient for a patch [1/T]
161  virtual const scalarField& alphav(const label patchi) const;
162 
163  //- Enthalpy/Internal energy [J/kg]
164  // Non-const access allowed for transport equations
165  virtual volScalarField& he();
166 
167  //- Enthalpy/Internal energy [J/kg]
168  virtual const volScalarField& he() const;
169 
170 
171  // Fields derived from thermodynamic state variables
172 
173  //- Enthalpy/Internal energy
174  // for given pressure and temperature [J/kg]
175  virtual tmp<volScalarField> he
176  (
177  const volScalarField& p,
178  const volScalarField& T
179  ) const;
180 
181  //- Enthalpy/Internal energy for cell-set [J/kg]
182  virtual tmp<scalarField> he
183  (
184  const scalarField& T,
185  const labelList& cells
186  ) const;
187 
188  //- Enthalpy/Internal energy for patch [J/kg]
189  virtual tmp<scalarField> he
190  (
191  const scalarField& T,
192  const label patchi
193  ) const;
194 
195  //- Sensible enthalpy [J/kg]
196  virtual tmp<volScalarField> hs() const;
197 
198  //- Sensible enthalpy
199  // for given pressure and temperature [J/kg]
200  virtual tmp<volScalarField> hs
201  (
202  const volScalarField& p,
203  const volScalarField& T
204  ) const;
205 
206  //- Sensible enthalpy for cell-set [J/kg]
207  virtual tmp<scalarField> hs
208  (
209  const scalarField& T,
210  const labelList& cells
211  ) const;
212 
213  //- Sensible enthalpy for patch [J/kg]
214  virtual tmp<scalarField> hs
215  (
216  const scalarField& T,
217  const label patchi
218  ) const;
219 
220  //- Absolute enthalpy [J/kg/K]
221  virtual tmp<volScalarField> ha() const;
222 
223  //- Absolute enthalpy
224  // for given pressure and temperature [J/kg]
225  virtual tmp<volScalarField> ha
226  (
227  const volScalarField& p,
228  const volScalarField& T
229  ) const;
230 
231  //- Absolute enthalpy for patch [J/kg/K]
232  virtual tmp<scalarField> ha
233  (
234  const scalarField& T,
235  const label patchi
236  ) const;
237 
238  //- Absolute enthalpy for cell-set [J/kg]
239  virtual tmp<scalarField> ha
240  (
241  const scalarField& T,
242  const labelList& cells
243  ) const;
244 
245  //- Enthalpy of formation [J/kg]
246  virtual tmp<volScalarField> hc() const;
247 
248  //- Temperature from enthalpy/internal energy for cell-set
249  virtual tmp<scalarField> THE
250  (
251  const scalarField& he,
252  const scalarField& T0, // starting temperature
253  const labelList& cells
254  ) const;
255 
256  //- Temperature from enthalpy/internal energy for patch
257  virtual tmp<scalarField> THE
258  (
259  const scalarField& he,
260  const scalarField& T0, // starting temperature
261  const label patchi
262  ) const;
263 
264  //- Heat capacity at constant pressure [J/kg/K]
265  virtual tmp<volScalarField> Cp() const;
266 
267  //- Heat capacity at constant pressure for patch [J/kg/K]
268  virtual tmp<scalarField> Cp
269  (
270  const scalarField& T,
271  const label patchi
272  ) const;
273 
274  //- Heat capacity at constant volume [J/kg/K]
275  virtual tmp<volScalarField> Cv() const;
276 
277  //- Heat capacity at constant volume for patch [J/kg/K]
278  virtual tmp<scalarField> Cv
279  (
280  const scalarField& T,
281  const label patchi
282  ) const;
283 
284  //- Heat capacity at constant pressure/volume [J/kg/K]
285  virtual tmp<volScalarField> Cpv() const;
286 
287  //- Heat capacity at constant pressure/volume for patch [J/kg/K]
288  virtual tmp<scalarField> Cpv
289  (
290  const scalarField& T,
291  const label patchi
292  ) const;
293 
294  //- Heat capacity ratio []
295  virtual tmp<volScalarField> CpByCpv() const;
296 
297  //- Heat capacity ratio for patch []
298  virtual tmp<scalarField> CpByCpv
299  (
300  const scalarField& T,
301  const label patchi
302  ) const;
303 
304 
305  // Fields derived from transport state variables
306 
307  //- Thermal diffusivity for temperature of mixture [W/m/K]
308  virtual tmp<volScalarField> kappa() const;
309 
310  //- Thermal diffusivity for temperature of mixture for patch [W/m/K]
311  virtual tmp<scalarField> kappa(const label patchi) const;
312 
313  //- Thermal diffusivity for energy of mixture [kg/m/s]
314  virtual tmp<volScalarField> alphahe() const;
315 
316  //- Thermal diffusivity for energy of mixture for patch [kg/m/s]
317  virtual tmp<scalarField> alphahe(const label patchi) const;
318 
319  //- Effective thermal turbulent diffusivity for temperature
320  // of mixture [W/m/K]
322  (
323  const volScalarField&
324  ) const;
325 
326  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
328  (
329  const volScalarField& alphat
330  ) const;
331 
332  //- Effective thermal turbulent diffusivity for temperature
333  // of mixture for patch [W/m/K]
334  virtual tmp<scalarField> kappaEff
335  (
336  const scalarField& alphat,
337  const label patchi
338  ) const;
339 
340  //- Effective thermal turbulent diffusivity of mixture
341  // for patch [kg/m/s]
342  virtual tmp<scalarField> alphaEff
343  (
344  const scalarField& alphat,
345  const label patchi
346  ) const;
347 
348  //- Return true if thermal conductivity is isotropic
349  virtual bool isotropic() const
350  {
351  return true;
352  }
353 
354  //- Anisotropic thermal conductivity [W/m/K]
355  virtual tmp<volVectorField> Kappa() const;
356 
357  //- Anisotropic thermal conductivity [W/m/K]
358  virtual tmp<vectorField> Kappa
359  (
360  const label patchi
361  ) const;
362 
363 
364  //- Update properties
365  virtual void correct();
366 
367 
368  // I-O
369 
370  //- Read thermophysicalProperties dictionary
371  virtual bool read();
372 };
373 
374 
375 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
376 
377 } // End namespace Foam
378 
379 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
380 
381 #endif
382 
383 // ************************************************************************* //
Fundamental solid thermodynamic properties.
virtual tmp< volScalarField > hs() const
Sensible enthalpy [J/kg].
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
virtual tmp< volScalarField > CpByCpv() const
Heat capacity ratio [].
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
virtual volScalarField & he()
Enthalpy/Internal energy [J/kg].
virtual ~solidDisplacementThermo()
Destructor.
virtual bool isochoric() const
Return true if the equation of state is isochoric.
virtual bool incompressible() const
Return true if the equation of state is incompressible.
virtual tmp< scalarField > THE(const scalarField &he, const scalarField &T0, const labelList &cells) const
Temperature from enthalpy/internal energy for cell-set.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
virtual const volScalarField & T() const
Temperature [K].
Definition: basicThermo.C:482
virtual word thermoName() const
Return the name of the thermo physics.
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [W/m/K].
solidDisplacementThermo(const fvMesh &, const word &phaseName=word::null)
Construct from mesh and phase name.
const cellShapeList & cells
virtual tmp< volScalarField > hc() const
Enthalpy of formation [J/kg].
A class for handling words, derived from string.
Definition: word.H:59
virtual tmp< volScalarField > Cpv() const
Heat capacity at constant pressure/volume [J/kg/K].
TypeName("solidDisplacementThermo")
Runtime type information.
virtual tmp< volScalarField > ha() const
Absolute enthalpy [J/kg/K].
static const word null
An empty word.
Definition: word.H:77
virtual tmp< volScalarField > Cv() const
Heat capacity at constant volume [J/kg/K].
virtual tmp< volScalarField > alphahe() const
Thermal diffusivity for energy of mixture [kg/m/s].
virtual tmp< volScalarField > alphaEff(const volScalarField &alphat) const
Effective thermal turbulent diffusivity of mixture [kg/m/s].
virtual const volScalarField & alphav() const
Volumetric thermal expansion coefficient [1/T].
virtual tmp< volVectorField > Kappa() const
Anisotropic thermal conductivity [W/m/K].
Fundamental solid thermodynamic properties.
Definition: solidThermo.H:48
virtual const volScalarField & E() const
Youngs modulus [Pa].
bool thermalStress() const
Returns true to enable thermal stress.
virtual const volScalarField & nu() const
Poisson&#39;s ratio [].
label patchi
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual tmp< volScalarField > Cp() const
Heat capacity at constant pressure [J/kg/K].
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
bool planeStress() const
Returns true to enable plane stress.
virtual void correct()
Update properties.
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:53
virtual bool read()
Read thermophysicalProperties dictionary.
virtual bool isotropic() const
Return true if thermal conductivity is isotropic.
virtual tmp< volScalarField > kappaEff(const volScalarField &) const
Effective thermal turbulent diffusivity for temperature.
Namespace for OpenFOAM.
scalar T0
Definition: createFields.H:22