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 :
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 tmp<volScalarField> Cp() const;
172 
173  //- Heat capacity at constant volume [J/kg/K]
174  virtual tmp<volScalarField> Cv() const;
175 
176 
177  // Fields derived from thermodynamic state variables
178 
179  //- Enthalpy/Internal energy
180  // for given pressure and temperature [J/kg]
181  virtual tmp<volScalarField> he
182  (
183  const volScalarField& p,
184  const volScalarField& T
185  ) const;
186 
187  //- Enthalpy/Internal energy for cell-set [J/kg]
188  virtual tmp<scalarField> he
189  (
190  const scalarField& T,
191  const labelList& cells
192  ) const;
193 
194  //- Enthalpy/Internal energy for patch [J/kg]
195  virtual tmp<scalarField> he
196  (
197  const scalarField& T,
198  const label patchi
199  ) const;
200 
201  //- Sensible enthalpy [J/kg]
202  virtual tmp<volScalarField> hs() const;
203 
204  //- Sensible enthalpy
205  // for given pressure and temperature [J/kg]
206  virtual tmp<volScalarField> hs
207  (
208  const volScalarField& p,
209  const volScalarField& T
210  ) const;
211 
212  //- Sensible enthalpy for cell-set [J/kg]
213  virtual tmp<scalarField> hs
214  (
215  const scalarField& T,
216  const labelList& cells
217  ) const;
218 
219  //- Sensible enthalpy for patch [J/kg]
220  virtual tmp<scalarField> hs
221  (
222  const scalarField& T,
223  const label patchi
224  ) const;
225 
226  //- Absolute enthalpy [J/kg/K]
227  virtual tmp<volScalarField> ha() const;
228 
229  //- Absolute enthalpy
230  // for given pressure and temperature [J/kg]
231  virtual tmp<volScalarField> ha
232  (
233  const volScalarField& p,
234  const volScalarField& T
235  ) const;
236 
237  //- Absolute enthalpy for patch [J/kg/K]
238  virtual tmp<scalarField> ha
239  (
240  const scalarField& T,
241  const label patchi
242  ) const;
243 
244  //- Absolute enthalpy for cell-set [J/kg]
245  virtual tmp<scalarField> ha
246  (
247  const scalarField& T,
248  const labelList& cells
249  ) const;
250 
251  //- Enthalpy of formation [J/kg]
252  virtual tmp<volScalarField> hc() const;
253 
254  //- Temperature from enthalpy/internal energy
255  virtual tmp<volScalarField> THE
256  (
257  const volScalarField& h,
258  const volScalarField& p,
259  const volScalarField& T0 // starting temperature
260  ) const;
261 
262  //- Temperature from enthalpy/internal energy for cell-set
263  virtual tmp<scalarField> THE
264  (
265  const scalarField& he,
266  const scalarField& T0, // starting temperature
267  const labelList& cells
268  ) const;
269 
270  //- Temperature from enthalpy/internal energy for patch
271  virtual tmp<scalarField> THE
272  (
273  const scalarField& he,
274  const scalarField& T0, // starting temperature
275  const label patchi
276  ) const;
277 
278  //- Heat capacity at constant pressure for patch [J/kg/K]
279  virtual tmp<scalarField> Cp
280  (
281  const scalarField& T,
282  const label patchi
283  ) const;
284 
285  //- Heat capacity at constant volume for patch [J/kg/K]
286  virtual tmp<scalarField> Cv
287  (
288  const scalarField& T,
289  const label patchi
290  ) const;
291 
292  //- Heat capacity at constant pressure/volume [J/kg/K]
293  virtual tmp<volScalarField> Cpv() const;
294 
295  //- Heat capacity at constant pressure/volume for patch [J/kg/K]
296  virtual tmp<scalarField> Cpv
297  (
298  const scalarField& T,
299  const label patchi
300  ) const;
301 
302 
303  // Fields derived from transport state variables
304 
305  //- Thermal diffusivity for temperature of mixture [W/m/K]
306  virtual tmp<volScalarField> kappa() const;
307 
308  //- Thermal diffusivity for temperature of mixture for patch [W/m/K]
309  virtual tmp<scalarField> kappa(const label patchi) const;
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].
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 > 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.
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [W/m/K].
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 & T() const
Temperature [K].
Definition: basicThermo.C:449
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].
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:515
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