All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
solidThermo.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) 2011-2021 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 
26 #include "solidThermo.H"
27 #include "fvMesh.H"
28 
29 /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */
30 
31 namespace Foam
32 {
33  defineTypeNameAndDebug(solidThermo, 0);
34  defineRunTimeSelectionTable(solidThermo, fvMesh);
35  defineRunTimeSelectionTable(solidThermo, dictionary);
36 }
37 
38 
39 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
40 
42 (
43  const fvMesh& mesh,
44  const word& phaseName
45 )
46 :
47  p_
48  (
49  IOobject
50  (
51  phasePropertyName("p", phaseName),
52  mesh.time().timeName(),
53  mesh,
56  ),
57  dimensionedScalar(phasePropertyName("p", phaseName), dimPressure, NaN)
58  ),
59  rho_
60  (
61  IOobject
62  (
63  phasePropertyName("rho", phaseName),
64  mesh.time().timeName(),
65  mesh,
68  ),
69  mesh,
71  )
72 {}
73 
74 
76 (
77  const fvMesh& mesh,
78  const dictionary& dict,
79  const word& phaseName
80 )
81 :
82  p_
83  (
84  IOobject
85  (
86  phasePropertyName("p", phaseName),
87  mesh.time().timeName(),
88  mesh,
91  ),
92  dimensionedScalar(phasePropertyName("p", phaseName), dimPressure, NaN)
93  ),
94  rho_
95  (
96  IOobject
97  (
98  phasePropertyName("rho", phaseName),
99  mesh.time().timeName(),
100  mesh,
103  ),
104  mesh,
105  dimDensity
106  )
107 {}
108 
109 
110 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
111 
113 (
114  const fvMesh& mesh,
115  const word& phaseName
116 )
117 {
118  return basicThermo::New<solidThermo>(mesh, phaseName);
119 }
120 
121 
123 (
124  const fvMesh& mesh,
125  const dictionary& dict,
126  const word& phaseName
127 )
128 {
129  return basicThermo::New<solidThermo>(mesh, dict, phaseName);
130 }
131 
132 
133 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
134 
136 {}
137 
138 
140 {}
141 
142 
143 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
144 
146 {
147  return rho_;
148 }
149 
150 
152 (
153  const label patchi
154 ) const
155 {
156  return rho_.boundaryField()[patchi];
157 }
158 
159 
161 {
162  return rho_;
163 }
164 
165 
167 {
168  return rho_.oldTime();
169 }
170 
171 
172 // ************************************************************************* //
dictionary dict
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 ~implementation()
Destructor.
Definition: solidThermo.C:139
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
const dimensionSet dimPressure
static autoPtr< solidThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: solidThermo.C:113
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Definition: Time.C:636
virtual ~solidThermo()
Destructor.
Definition: solidThermo.C:135
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:239
dynamicFvMesh & mesh
A class for handling words, derived from string.
Definition: word.H:59
const dimensionSet dimDensity
virtual tmp< volScalarField > rho() const
Density [kg/m^3].
Definition: solidThermo.C:145
implementation(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition: solidThermo.C:42
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
virtual tmp< volScalarField > rho0() const
Old-time density [kg/m^3].
Definition: solidThermo.C:166
defineTypeNameAndDebug(combustionModel, 0)
label patchi
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
A class for managing temporary objects.
Definition: PtrList.H:53
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
Namespace for OpenFOAM.