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-2023 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  phaseScopedName("thermo", "psi"),
52  mesh.time().timeName(),
53  mesh,
54  IOobject::NO_READ,
55  IOobject::NO_WRITE,
56  IOobject::REGISTER
57  ),
58  mesh,
59  dimensionSet(0, -2, 2, 0, 0)
60  ),
61 
62  mu_
63  (
64  IOobject
65  (
66  phaseScopedName("thermo", "mu"),
67  mesh.time().timeName(),
68  mesh,
69  IOobject::NO_READ,
70  IOobject::NO_WRITE,
71  IOobject::REGISTER
72  ),
74  dimensionSet(1, -1, -1, 0, 0)
75  )
76 {}
77 
78 
80 (
81  const fvMesh& mesh,
82  const word& phaseName,
83  const word& dictionaryName
84 )
85 :
86  fluidThermo(mesh, phaseName, dictionaryName),
87 
88  psi_
89  (
90  IOobject
91  (
92  phaseScopedName("thermo", "psi"),
93  mesh.time().timeName(),
94  mesh,
95  IOobject::NO_READ,
96  IOobject::NO_WRITE,
97  IOobject::REGISTER
98  ),
99  mesh,
100  dimensionSet(0, -2, 2, 0, 0)
101  ),
102 
103  mu_
104  (
105  IOobject
106  (
107  phaseScopedName("thermo", "mu"),
108  mesh.time().timeName(),
109  mesh,
110  IOobject::NO_READ,
111  IOobject::NO_WRITE,
112  IOobject::REGISTER
113  ),
114  mesh,
115  dimensionSet(1, -1, -1, 0, 0)
116  )
117 {}
118 
119 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
120 
122 (
123  const fvMesh& mesh,
124  const word& phaseName
125 )
126 {
127  return basicThermo::New<psiThermo>(mesh, phaseName);
128 }
129 
130 
132 (
133  const fvMesh& mesh,
134  const word& phaseName,
135  const word& dictionaryName
136 )
137 {
138  return basicThermo::New<psiThermo>(mesh, phaseName, dictionaryName);
139 }
140 
141 
142 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
145 {}
146 
147 
148 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
151 {
152  return p_*psi_;
153 }
154 
155 
157 {
158  return p_.boundaryField()[patchi]*psi_.boundaryField()[patchi];
159 }
160 
161 
163 (
164  const Foam::volScalarField& deltaRho,
165  const dimensionedScalar& rhoMin,
167 )
168 {}
171 (
172  const Foam::volScalarField& deltaRho
173 )
174 {}
177 {
178  return psi_;
179 }
180 
183 {
184  return mu_;
185 }
186 
187 
188 Foam::tmp<Foam::scalarField> Foam::psiThermo::mu(const label patchi) const
189 {
190  return mu_.boundaryField()[patchi];
191 }
192 
193 
194 // ************************************************************************* //
const dimensionedScalar rhoMin
virtual ~psiThermo()
Destructor.
Definition: psiThermo.C:137
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:156
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: psiThermo.C:175
virtual tmp< volScalarField > rho() const
Density [kg/m^3] - uses current value of pressure.
Definition: psiThermo.C:143
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
static autoPtr< psiThermo > New(const fvMesh &mesh, const word &phaseName=word::null)
Selector.
Definition: psiThermo.C:115
defineTypeNameAndDebug(combustionModel, 0)
psiThermo(const psiThermo &)
Construct as copy (not implemented)
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: psiThermo.C:169
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:180
Basic thermodynamic properties based on compressibility.
Definition: psiThermo.H:51
Namespace for OpenFOAM.
const dimensionedScalar rhoMax