psiThermo.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 "psiThermo.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
32  defineTypeNameAndDebug(psiThermo, 0);
33  defineRunTimeSelectionTable(psiThermo, fvMesh);
34 }
35 
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
40 (
41  const fvMesh& mesh,
42  const word& phaseName
43 )
44 :
45  psi_
46  (
47  IOobject
48  (
49  phasePropertyName("thermo:psi", phaseName),
50  mesh.time().timeName(),
51  mesh,
54  ),
55  mesh,
56  dimensionSet(0, -2, 2, 0, 0)
57  ),
58 
59  mu_
60  (
61  IOobject
62  (
63  phasePropertyName("thermo:mu", phaseName),
64  mesh.time().timeName(),
65  mesh,
68  ),
69  mesh,
70  dimensionSet(1, -1, -1, 0, 0)
71  )
72 {}
73 
74 
75 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
76 
78 (
79  const fvMesh& mesh,
80  const word& phaseName
81 )
82 {
83  return basicThermo::New<psiThermo>(mesh, phaseName);
84 }
85 
86 
87 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
88 
90 {}
91 
92 
94 {}
95 
96 
97 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
98 
100 {}
101 
102 
104 {
105  return p()*psi_;
106 }
107 
108 
110 (
111  const label patchi
112 ) const
113 {
114  return p().boundaryField()[patchi]*psi_.boundaryField()[patchi];
115 }
116 
117 
119 {
120  return p().oldTime()*psi_.oldTime();
121 }
122 
123 
125 {
126  return psi_;
127 }
128 
129 
131 {
132  return mu_;
133 }
134 
135 
137 (
138  const label patchi
139 ) const
140 {
141  return mu_.boundaryField()[patchi];
142 }
143 
144 
145 // ************************************************************************* //
const GeometricField< Type, PatchField, GeoMesh > & oldTime() const
Return old time field.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
implementation(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition: psiThermo.C:40
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: psiThermo.C:130
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:372
fvMesh & mesh
virtual ~psiThermo()
Destructor.
Definition: psiThermo.C:89
Dimension set for the base types.
Definition: dimensionSet.H:121
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
virtual tmp< volScalarField > rho() const
Density [kg/m^3] - uses current value of pressure.
Definition: psiThermo.C:103
virtual void correctRho(const volScalarField &deltaRho)
Add the given density correction to the density field.
Definition: psiThermo.C:99
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
static autoPtr< psiThermo > New(const fvMesh &mesh, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: psiThermo.C:78
defineTypeNameAndDebug(combustionModel, 0)
virtual ~implementation()
Destructor.
Definition: psiThermo.C:93
label patchi
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:95
virtual tmp< volScalarField > rho0() const
Old-time density [kg/m^3].
Definition: psiThermo.C:118
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
volScalarField & p
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
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: psiThermo.C:124
Namespace for OpenFOAM.