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);
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  ),
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,
93  IOobject::NO_READ,
94  IOobject::NO_WRITE
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,
107  IOobject::NO_READ,
108  IOobject::NO_WRITE
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 * * * * * * * * * * * * * * * //
141 {}
142 
143 
144 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
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 {}
167 (
168  const Foam::volScalarField& deltaRho
169 )
170 {}
173 {
174  return psi_;
175 }
176 
179 {
180  return mu_;
181 }
182 
183 
184 Foam::tmp<Foam::scalarField> Foam::psiThermo::mu(const label patchi) const
185 {
186  return mu_.boundaryField()[patchi];
187 }
188 
189 
190 // ************************************************************************* //
const dimensionedScalar rhoMin
virtual ~psiThermo()
Destructor.
Definition: psiThermo.C:133
word timeName
Definition: getTimeIndex.H:3
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Definition: dimensionSet.H:105
dynamicFvMesh & mesh
A class for handling words, derived from Foam::string.
Definition: word.H:63
Fundamental fluid thermodynamic properties.
Definition: fluidThermo.H:48
virtual void correctRho(const volScalarField &deltaRho, const dimensionedScalar &rhoMin, const dimensionedScalar &rhoMax)
Add the given density correction to the density field.
Definition: psiThermo.C:152
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: psiThermo.C:171
virtual tmp< volScalarField > rho() const
Density [kg/m^3] - uses current value of pressure.
Definition: psiThermo.C:139
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
static autoPtr< psiThermo > New(const fvMesh &mesh, const word &phaseName=word::null)
Selector.
Definition: psiThermo.C:111
defineTypeNameAndDebug(combustionModel, 0)
psiThermo(const psiThermo &)
Construct as copy (not implemented)
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: psiThermo.C:165
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Defines the attributes of an object for which implicit objectRegistry management is supported...
Definition: IOobject.H:172
Basic thermodynamic properties based on compressibility.
Definition: psiThermo.H:51
Namespace for OpenFOAM.
const dimensionedScalar rhoMax