solidDisplacementThermo.C
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 \*---------------------------------------------------------------------------*/
25 
27 #include "fvMesh.H"
28 
29 /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
30 
31 namespace Foam
32 {
33  defineTypeNameAndDebug(solidDisplacementThermo, 0);
34 }
35 
36 
37 void Foam::solidDisplacementThermo::readProperty(volScalarField& prop) const
38 {
39  const dictionary& propDict(subDict(prop.name()));
40  const word propType(propDict.lookup("type"));
41 
42  if (propType == "uniform")
43  {
44  prop == dimensionedScalar
45  (
46  prop.name(),
47  prop.dimensions(),
48  propDict.lookup<scalar>("value")
49  );
50  }
51  else if (propType == "field")
52  {
53  const volScalarField propField
54  (
55  IOobject
56  (
57  prop.name(),
58  prop.mesh().time().timeName(0),
59  prop.mesh(),
62  ),
63  prop.mesh()
64  );
65  prop == propField;
66  }
67  else
68  {
70  << "Valid type entries are uniform or field for " << prop.name()
71  << abort(FatalError);
72  }
73 }
74 
75 
76 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
77 
79 (
80  const fvMesh& mesh,
81  const word& phaseName
82 )
83 :
84  solidThermo(mesh, phaseName),
85  planeStress_(lookup("planeStress")),
86  thermalStress_(lookup("thermalStress")),
87  Cp_
88  (
89  IOobject
90  (
91  phasePropertyName("Cp"),
92  mesh.time().timeName(),
93  mesh,
94  IOobject::NO_READ,
95  IOobject::NO_WRITE
96  ),
97  mesh,
99  ),
100  kappa_
101  (
102  IOobject
103  (
104  phasePropertyName("kappa"),
105  mesh.time().timeName(),
106  mesh,
107  IOobject::NO_READ,
108  IOobject::NO_WRITE
109  ),
110  mesh,
111  Cp_.dimensions()*dimensionSet(1, -1, -1, 0, 0)
112  ),
113  E_
114  (
115  IOobject
116  (
117  phasePropertyName("E"),
118  mesh.time().timeName(),
119  mesh,
120  IOobject::NO_READ,
121  IOobject::NO_WRITE
122  ),
123  mesh,
125  ),
126  nu_
127  (
128  IOobject
129  (
130  phasePropertyName("nu"),
131  mesh.time().timeName(),
132  mesh,
133  IOobject::NO_READ,
134  IOobject::NO_WRITE
135  ),
136  mesh,
137  dimless
138  ),
139  alphav_
140  (
141  IOobject
142  (
143  phasePropertyName("alphav"),
144  mesh.time().timeName(),
145  mesh,
146  IOobject::NO_READ,
147  IOobject::NO_WRITE
148  ),
149  mesh,
151  )
152 {
153  readProperty(rho_);
154  readProperty(Cp_);
155  readProperty(kappa_);
156  readProperty(E_);
157  readProperty(nu_);
158  readProperty(alphav_);
159 }
160 
161 
162 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
163 
165 {}
166 
167 
168 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
169 
171 {
172  return rho_;
173 }
174 
175 
177 (
178  const label patchi
179 ) const
180 {
181  return rho_.boundaryField()[patchi];
182 }
183 
184 
186 {
187  return E_;
188 }
189 
190 
192 (
193  const label patchi
194 ) const
195 {
196  return E_.boundaryField()[patchi];
197 }
198 
199 
201 {
202  return nu_;
203 }
204 
205 
207 (
208  const label patchi
209 ) const
210 {
211  return nu_.boundaryField()[patchi];
212 }
213 
214 
216 {
217  return alphav_;
218 }
219 
220 
222 (
223  const label patchi
224 ) const
225 {
226  return alphav_.boundaryField()[patchi];
227 }
228 
229 
231 {
233  return rho_;
234 }
235 
236 
238 {
240  return rho_;
241 }
242 
243 
245 (
246  const scalarField& T,
247  const labelList& cells
248 ) const
249 {
251  return tmp<scalarField>(nullptr);
252 }
253 
255 (
256  const volScalarField& p,
257  const volScalarField& T
258 ) const
259 {
261  return tmp<volScalarField>(nullptr);
262 }
263 
264 
266 (
267  const scalarField& T,
268  const label patchi
269 ) const
270 {
272  return tmp<scalarField>(nullptr);
273 }
274 
275 
277 {
279  return tmp<volScalarField>(nullptr);
280 }
281 
282 
284 (
285  const volScalarField& p,
286  const volScalarField& T
287 ) const
288 {
290  return tmp<volScalarField>(nullptr);
291 }
292 
293 
295 (
296  const scalarField& T,
297  const label patchi
298 ) const
299 {
301  return tmp<scalarField>(nullptr);
302 }
303 
304 
306 (
307  const scalarField& T,
308  const labelList& cells
309 ) const
310 {
312  return tmp<scalarField>(nullptr);
313 }
314 
315 
317 {
319  return tmp<volScalarField>(nullptr);
320 }
321 
322 
324 (
325  const volScalarField& p,
326  const volScalarField& T
327 ) const
328 {
330  return tmp<volScalarField>(nullptr);
331 }
332 
333 
335 (
336  const scalarField& T,
337  const label patchi
338 ) const
339 {
341  return tmp<scalarField>(nullptr);
342 }
343 
344 
346 (
347  const scalarField& T,
348  const labelList& cells
349 ) const
350 {
352  return tmp<scalarField>(nullptr);
353 }
354 
355 
357 {
359  return tmp<volScalarField>(nullptr);
360 }
361 
362 
364 (
365  const scalarField& he,
366  const scalarField& T0,
367  const labelList& cells
368 ) const
369 {
371  return tmp<scalarField>(nullptr);
372 }
373 
374 
376 (
377  const scalarField& he,
378  const scalarField& T0,
379  const label patchi
380 ) const
381 {
383  return tmp<scalarField>(nullptr);
384 }
385 
386 
388 {
389  return Cp_;
390 }
391 
392 
394 (
395  const scalarField& T,
396  const label patchi
397 ) const
398 {
399  return Cp_.boundaryField()[patchi];
400 }
401 
402 
404 {
405  return Cp_;
406 }
407 
408 
410 (
411  const scalarField& T,
412  const label patchi
413 ) const
414 {
415  return Cp_.boundaryField()[patchi];
416 }
417 
418 
420 {
421  return Cp_;
422 }
423 
424 
426 (
427  const scalarField& T,
428  const label patchi
429 ) const
430 {
431  return Cp_.boundaryField()[patchi];
432 }
433 
434 
436 {
438  return tmp<volScalarField>(nullptr);
439 }
440 
441 
443 (
444  const scalarField& T,
445  const label patchi
446 ) const
447 {
449  return tmp<scalarField>(nullptr);
450 }
451 
452 
453 
455 {
456  return kappa_;
457 }
458 
459 
461 (
462  const label patchi
463 ) const
464 {
465  return kappa_.boundaryField()[patchi];
466 }
467 
468 
470 {
472  return tmp<volScalarField>(nullptr);
473 }
474 
475 
477 (
478  const label patchi
479 ) const
480 {
482  return tmp<scalarField>(nullptr);
483 }
484 
485 
487 (
488  const volScalarField& alphat
489 ) const
490 {
492  return tmp<volScalarField>(nullptr);
493 }
494 
495 
497 (
498  const scalarField& alphat,
499  const label patchi
500 ) const
501 {
503  return tmp<scalarField>(nullptr);
504 }
505 
506 
508 (
509  const volScalarField& alphat
510 ) const
511 {
513  return tmp<volScalarField>(nullptr);
514 }
515 
516 
518 (
519  const scalarField& alphat,
520  const label patchi
521 ) const
522 {
524  return tmp<scalarField>(nullptr);
525 }
526 
527 
529 {
531  return tmp<volVectorField>(nullptr);
532 }
533 
534 
536 (
537  const label patchi
538 ) const
539 {
541  return tmp<vectorField>(nullptr);
542 }
543 
544 
546 {}
547 
548 
550 {
551  return regIOobject::read();
552 }
553 
554 
555 // ************************************************************************* //
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 bool read()
Read object.
error FatalError
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:319
virtual ~solidDisplacementThermo()
Destructor.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
virtual tmp< scalarField > THE(const scalarField &he, const scalarField &T0, const labelList &cells) const
Temperature from enthalpy/internal energy for cell-set.
virtual tmp< volScalarField > kappa() const
Thermal diffusivity for temperature of mixture [W/m/K].
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
stressControl lookup("compactNormalStress") >> compactNormalStress
dynamicFvMesh & mesh
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].
volScalarField rho_
Density field [kg/m^3].
Definition: solidThermo.H:58
virtual tmp< volScalarField > Cpv() const
Heat capacity at constant pressure/volume [J/kg/K].
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
const dimensionSet dimTemperature(0, 0, 0, 1, 0, 0, 0)
Definition: dimensionSets.H:52
virtual tmp< volScalarField > ha() const
Absolute enthalpy [J/kg/K].
virtual tmp< volScalarField > Cv() const
Heat capacity at constant volume [J/kg/K].
word timeName
Definition: getTimeIndex.H:3
List< label > labelList
A List of labels.
Definition: labelList.H:56
const dimensionSet dimPressure
errorManip< error > abort(error &err)
Definition: errorManip.H:131
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].
defineTypeNameAndDebug(combustionModel, 0)
virtual const volScalarField & E() const
Youngs modulus [Pa].
const dimensionSet dimEnergy
virtual const volScalarField & nu() const
Poisson&#39;s ratio [].
label patchi
const dimensionSet dimless(0, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:47
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
virtual tmp< volScalarField > Cp() const
Heat capacity at constant pressure [J/kg/K].
virtual void correct()
Update properties.
const dimensionSet dimMass(1, 0, 0, 0, 0, 0, 0)
Definition: dimensionSets.H:49
volScalarField & p
A class for managing temporary objects.
Definition: PtrList.H:53
virtual bool read()
Read thermophysicalProperties dictionary.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
virtual tmp< volScalarField > kappaEff(const volScalarField &) const
Effective thermal turbulent diffusivity for temperature.
Namespace for OpenFOAM.
scalar T0
Definition: createFields.H:22