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 }
36 
37 
38 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 
41 (
42  const fvMesh& mesh,
43  const word& phaseName
44 )
45 :
46  p_
47  (
48  IOobject
49  (
50  phasePropertyName("p", phaseName),
51  mesh.time().timeName(),
52  mesh,
55  ),
56  dimensionedScalar(phasePropertyName("p", phaseName), dimPressure, NaN)
57  ),
58  rho_
59  (
60  IOobject
61  (
62  phasePropertyName("rho", phaseName),
63  mesh.time().timeName(),
64  mesh,
67  ),
68  mesh,
70  )
71 {}
72 
73 
75 (
76  const fvMesh& mesh,
77  const dictionary& dict,
78  const word& phaseName
79 )
80 :
81  p_
82  (
83  IOobject
84  (
85  phasePropertyName("p", phaseName),
86  mesh.time().timeName(),
87  mesh,
90  ),
91  dimensionedScalar(phasePropertyName("p", phaseName), dimPressure, NaN)
92  ),
93  rho_
94  (
95  IOobject
96  (
97  phasePropertyName("rho", phaseName),
98  mesh.time().timeName(),
99  mesh,
102  ),
103  mesh,
104  dimDensity
105  )
106 {}
107 
108 
109 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
110 
112 (
113  const fvMesh& mesh,
114  const word& phaseName
115 )
116 {
117  return basicThermo::New<solidThermo>(mesh, phaseName);
118 }
119 
120 
121 // Foam::autoPtr<Foam::solidThermo> Foam::solidThermo::New
122 // (
123 // const fvMesh& mesh,
124 // const dictionary& dict,
125 // const word& phaseName
126 // )
127 // {
128 // return basicThermo::New<solidThermo>(mesh, dict, phaseName);
129 // }
130 
131 
132 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
133 
135 {}
136 
137 
139 {}
140 
141 
142 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
143 
145 {
146  return rho_;
147 }
148 
149 
151 (
152  const label patchi
153 ) const
154 {
155  return rho_.boundaryField()[patchi];
156 }
157 
158 
160 {
161  return rho_;
162 }
163 
164 
166 {
167  return rho_.oldTime();
168 }
169 
170 
171 // ************************************************************************* //
virtual ~implementation()
Destructor.
Definition: solidThermo.C:138
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:112
virtual ~solidThermo()
Destructor.
Definition: solidThermo.C:134
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:372
fvMesh & mesh
static word timeName(const scalar, const int precision=curPrecision_)
Return time name of given scalar time.
Definition: Time.C:666
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:144
implementation(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition: solidThermo.C:41
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
virtual tmp< volScalarField > rho0() const
Old-time density [kg/m^3].
Definition: solidThermo.C:165
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:95
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:98
Namespace for OpenFOAM.