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-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::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 :
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  //- Heat capacity at constant pressure [J/kg/K]
171  virtual const volScalarField& Cp() const;
172 
173  //- Heat capacity at constant volume [J/kg/K]
174  virtual const volScalarField& Cv() const;
175 
176 
177  // Access to transport state variables
178 
179  //- Thermal diffusivity for temperature of mixture [W/m/K]
180  virtual const volScalarField& kappa() const;
181 
182 
183  // Fields derived from thermodynamic state variables
184 
185  //- Enthalpy/Internal energy
186  // for given pressure and temperature [J/kg]
187  virtual tmp<volScalarField> he
188  (
189  const volScalarField& p,
190  const volScalarField& T
191  ) const;
192 
193  //- Enthalpy/Internal energy for cell-set [J/kg]
194  virtual tmp<scalarField> he
195  (
196  const scalarField& T,
197  const labelList& cells
198  ) const;
199 
200  //- Enthalpy/Internal energy for patch [J/kg]
201  virtual tmp<scalarField> he
202  (
203  const scalarField& T,
204  const label patchi
205  ) const;
206 
207  //- Sensible enthalpy [J/kg]
208  virtual tmp<volScalarField> hs() const;
209 
210  //- Sensible enthalpy
211  // for given pressure and temperature [J/kg]
212  virtual tmp<volScalarField> hs
213  (
214  const volScalarField& p,
215  const volScalarField& T
216  ) const;
217 
218  //- Sensible enthalpy for cell-set [J/kg]
219  virtual tmp<scalarField> hs
220  (
221  const scalarField& T,
222  const labelList& cells
223  ) const;
224 
225  //- Sensible enthalpy for patch [J/kg]
226  virtual tmp<scalarField> hs
227  (
228  const scalarField& T,
229  const label patchi
230  ) const;
231 
232  //- Absolute enthalpy [J/kg/K]
233  virtual tmp<volScalarField> ha() const;
234 
235  //- Absolute enthalpy
236  // for given pressure and temperature [J/kg]
237  virtual tmp<volScalarField> ha
238  (
239  const volScalarField& p,
240  const volScalarField& T
241  ) const;
242 
243  //- Absolute enthalpy for patch [J/kg/K]
244  virtual tmp<scalarField> ha
245  (
246  const scalarField& T,
247  const label patchi
248  ) const;
249 
250  //- Absolute enthalpy for cell-set [J/kg]
251  virtual tmp<scalarField> ha
252  (
253  const scalarField& T,
254  const labelList& cells
255  ) const;
256 
257  //- Enthalpy of formation [J/kg]
258  virtual tmp<volScalarField> hc() const;
259 
260  //- Temperature from enthalpy/internal energy
261  virtual tmp<volScalarField> THE
262  (
263  const volScalarField& h,
264  const volScalarField& p,
265  const volScalarField& T0 // starting temperature
266  ) const;
267 
268  //- Temperature from enthalpy/internal energy for cell-set
269  virtual tmp<scalarField> THE
270  (
271  const scalarField& he,
272  const scalarField& T0, // starting temperature
273  const labelList& cells
274  ) const;
275 
276  //- Temperature from enthalpy/internal energy for patch
277  virtual tmp<scalarField> THE
278  (
279  const scalarField& he,
280  const scalarField& T0, // starting temperature
281  const label patchi
282  ) const;
283 
284  //- Heat capacity at constant pressure for patch [J/kg/K]
285  virtual tmp<scalarField> Cp
286  (
287  const scalarField& T,
288  const label patchi
289  ) const;
290 
291  //- Heat capacity at constant volume for patch [J/kg/K]
292  virtual tmp<scalarField> Cv
293  (
294  const scalarField& T,
295  const label patchi
296  ) const;
297 
298  //- Heat capacity at constant pressure/volume [J/kg/K]
299  virtual tmp<volScalarField> Cpv() const;
300 
301  //- Heat capacity at constant pressure/volume for patch [J/kg/K]
302  virtual tmp<scalarField> Cpv
303  (
304  const scalarField& T,
305  const label patchi
306  ) const;
307 
308 
309  // Fields derived from transport state variables
310 
311  //- Thermal diffusivity for energy of mixture [kg/m/s]
312  virtual tmp<volScalarField> alphahe() const;
313 
314  //- Thermal diffusivity for energy of mixture for patch [kg/m/s]
315  virtual tmp<scalarField> alphahe(const label patchi) const;
316 
317  //- Effective thermal turbulent diffusivity for temperature
318  // of mixture [W/m/K]
320  (
321  const volScalarField&
322  ) const;
323 
324  //- Effective thermal turbulent diffusivity of mixture [kg/m/s]
326  (
327  const volScalarField& alphat
328  ) const;
329 
330  //- Effective thermal turbulent diffusivity for temperature
331  // of mixture for patch [W/m/K]
332  virtual tmp<scalarField> kappaEff
333  (
334  const scalarField& alphat,
335  const label patchi
336  ) const;
337 
338  //- Effective thermal turbulent diffusivity of mixture
339  // for patch [kg/m/s]
340  virtual tmp<scalarField> alphaEff
341  (
342  const scalarField& alphat,
343  const label patchi
344  ) const;
345 
346  //- Return true if thermal conductivity is isotropic
347  virtual bool isotropic() const
348  {
349  return true;
350  }
351 
352  //- Anisotropic thermal conductivity [W/m/K]
353  virtual tmp<volVectorField> Kappa() const;
354 
355  //- Anisotropic thermal conductivity [W/m/K]
356  virtual tmp<vectorField> Kappa(const label patchi) const;
357 
358  //- Anisotropic thermal conductivity for patch
359  // in the local coordinate system [W/m/K]
360  virtual tmp<symmTensorField> KappaLocal(const label patchi) const;
361 
362  //- Return the heat flux
363  virtual tmp<surfaceScalarField> q() const;
364 
365  //- Return the source term for the energy equation
366  virtual tmp<fvScalarMatrix> divq(volScalarField& he) const;
367 
368 
369  //- Update properties
370  virtual void correct();
371 
372 
373  // I-O
374 
375  //- Read thermophysicalProperties dictionary
376  virtual bool read();
377 };
378 
379 
380 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
381 
382 } // End namespace Foam
383 
384 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
385 
386 #endif
387 
388 // ************************************************************************* //
Fundamental solid thermodynamic properties.
virtual tmp< volScalarField > hs() const
Sensible enthalpy [J/kg].
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.
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 word thermoName() const
Return the name of the thermo physics.
virtual tmp< symmTensorField > KappaLocal(const label patchi) const
Anisotropic thermal conductivity for patch.
virtual tmp< surfaceScalarField > q() const
Return the heat flux.
const dimensionedScalar h
Planck constant.
virtual tmp< fvScalarMatrix > divq(volScalarField &he) const
Return the source term for the energy equation.
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 const volScalarField & kappa() const
Thermal diffusivity for temperature of mixture [W/m/K].
virtual const volScalarField & T() const
Temperature [K].
Definition: basicThermo.C:383
virtual tmp< volScalarField > ha() const
Absolute enthalpy [J/kg/K].
static const word null
An empty word.
Definition: word.H:77
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].
virtual tmp< volScalarField > THE(const volScalarField &h, const volScalarField &p, const volScalarField &T0) const
Temperature from enthalpy/internal energy.
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
virtual const word & phaseName() const
Phase name.
Definition: basicThermo.H:487
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
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 const volScalarField & Cv() const
Heat capacity at constant volume [J/kg/K].
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
virtual const volScalarField & Cp() const
Heat capacity at constant pressure [J/kg/K].