psiThermo.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2017 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "psiThermo.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  defineTypeNameAndDebug(psiThermo, 0);
36  defineRunTimeSelectionTable(psiThermo, fvMesh);
37  defineRunTimeSelectionTable(psiThermo, fvMeshDictPhase);
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
43 Foam::psiThermo::psiThermo(const fvMesh& mesh, const word& phaseName)
44 :
45  fluidThermo(mesh, phaseName),
46 
47  psi_
48  (
49  IOobject
50  (
51  phasePropertyName("thermo:psi"),
52  mesh.time().timeName(),
53  mesh,
54  IOobject::NO_READ,
55  IOobject::NO_WRITE
56  ),
57  mesh,
58  dimensionSet(0, -2, 2, 0, 0)
59  ),
60 
61  mu_
62  (
63  IOobject
64  (
65  phasePropertyName("thermo:mu"),
66  mesh.time().timeName(),
67  mesh,
68  IOobject::NO_READ,
69  IOobject::NO_WRITE
70  ),
71  mesh,
72  dimensionSet(1, -1, -1, 0, 0)
73  )
74 {}
75 
76 
78 (
79  const fvMesh& mesh,
80  const word& phaseName,
81  const word& dictionaryName
82 )
83 :
84  fluidThermo(mesh, phaseName, dictionaryName),
85 
86  psi_
87  (
88  IOobject
89  (
90  phasePropertyName("thermo:psi"),
91  mesh.time().timeName(),
92  mesh,
95  ),
96  mesh,
97  dimensionSet(0, -2, 2, 0, 0)
98  ),
99 
100  mu_
101  (
102  IOobject
103  (
104  phasePropertyName("thermo:mu"),
105  mesh.time().timeName(),
106  mesh,
109  ),
110  mesh,
111  dimensionSet(1, -1, -1, 0, 0)
112  )
113 {}
114 
115 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
116 
118 (
119  const fvMesh& mesh,
120  const word& phaseName
121 )
122 {
123  return basicThermo::New<psiThermo>(mesh, phaseName);
124 }
125 
126 
128 (
129  const fvMesh& mesh,
130  const word& phaseName,
131  const word& dictionaryName
132 )
133 {
134  return basicThermo::New<psiThermo>(mesh, phaseName, dictionaryName);
135 }
136 
137 
138 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
139 
141 {}
142 
143 
144 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
145 
147 {
148  return p_*psi_;
149 }
150 
151 
153 {
154  return p_.boundaryField()[patchi]*psi_.boundaryField()[patchi];
155 }
156 
157 
159 (
160  const Foam::volScalarField& deltaRho,
161  const dimensionedScalar& rhoMin,
163 )
164 {}
165 
167 (
168  const Foam::volScalarField& deltaRho
169 )
170 {}
171 
173 {
174  return psi_;
175 }
176 
177 
179 {
180  return mu_;
181 }
182 
183 
185 {
186  return mu_.boundaryField()[patchi];
187 }
188 
189 
190 // ************************************************************************* //
Foam::IOobject::NO_WRITE
Definition: IOobject.H:195
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:169
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::psiThermo::~psiThermo
virtual ~psiThermo()
Destructor.
Definition: psiThermo.C:140
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::defineRunTimeSelectionTable
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
Foam::Time::timeName
static word timeName(const scalar t, const int precision=precision_)
Definition: Time.C:780
Foam::fluidThermo
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:52
Foam::dimensionSet
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:108
Foam::psiThermo::rho
virtual tmp< volScalarField > rho() const
Density [kg/m^3] - uses current value of pressure.
Definition: psiThermo.C:146
Foam::psiThermo::correctRho
virtual void correctRho(const volScalarField &deltaRho, const dimensionedScalar &rhoMin, const dimensionedScalar &rhoMax)
Add the given density correction to the density field.
Definition: psiThermo.C:159
rhoMin
const dimensionedScalar rhoMin
Definition: setRegionFluidFields.H:67
Foam::psiThermo::psiThermo
psiThermo(const psiThermo &)
Construct as copy (not implemented)
timeName
word timeName
Definition: getTimeIndex.H:3
Foam::psiThermo::psi
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: psiThermo.C:172
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::dimensioned< scalar >
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::psiThermo::mu
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: psiThermo.C:178
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
psiThermo.H
rhoMax
const dimensionedScalar rhoMax
Definition: setRegionFluidFields.H:66
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:280
Foam::psiThermo::New
static autoPtr< psiThermo > New(const fvMesh &mesh, const word &phaseName=word::null)
Selector.
Definition: psiThermo.C:118
Foam::GeometricField< scalar, fvPatchField, volMesh >
Foam::IOobject::NO_READ
Definition: IOobject.H:188
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)