fluidThermo.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) 2012-2022 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 "fluidThermo.H"
27 
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
29 
30 namespace Foam
31 {
34 }
35 
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
40 (
41  const fvMesh& mesh,
42  const word& phaseName
43 )
44 :
45  p_(lookupOrConstruct(mesh, "p")),
46 
47  psi_
48  (
49  IOobject
50  (
51  phasePropertyName("psi", phaseName),
52  mesh.time().name(),
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("mu", phaseName),
66  mesh.time().name(),
67  mesh,
68  IOobject::NO_READ,
69  IOobject::NO_WRITE
70  ),
71  mesh,
72  dimensionSet(1, -1, -1, 0, 0)
73  )
74 {}
75 
76 
77 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
78 
80 (
81  const fvMesh& mesh,
82  const word& phaseName
83 )
84 {
85  return basicThermo::New<fluidThermo>(mesh, phaseName);
86 }
87 
88 
89 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
90 
92 {}
93 
94 
96 {}
97 
98 
99 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
100 
102 {
103  return mu()/rho();
104 }
105 
106 
109 {
110  return mu(patchi)/rho(patchi);
111 }
112 
113 
115 {
116  return p_;
117 }
118 
119 
121 {
122  return p_;
123 }
124 
125 
127 {
128  return psi_;
129 }
130 
131 
133 {
134  return mu_;
135 }
136 
137 
139 (
140  const label patchi
141 ) const
142 {
143  return mu_.boundaryField()[patchi];
144 }
145 
146 
147 // ************************************************************************* //
Generic GeometricField class.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
virtual const fvMesh & mesh() const =0
Return const access to the mesh.
virtual const word & phaseName() const =0
Phase name.
virtual tmp< volScalarField > rho() const =0
Density [kg/m^3].
Dimension set for the base types.
Definition: dimensionSet.H:122
implementation(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition: fluidThermo.C:40
virtual volScalarField & p()
Pressure [Pa].
Definition: fluidThermo.C:114
virtual ~implementation()
Destructor.
Definition: fluidThermo.C:95
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: fluidThermo.C:132
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: fluidThermo.C:126
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:57
virtual tmp< volScalarField > mu() const =0
Dynamic viscosity of mixture [kg/m/s].
virtual tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].
Definition: fluidThermo.C:101
virtual ~fluidThermo()
Destructor.
Definition: fluidThermo.C:91
static autoPtr< fluidThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: fluidThermo.C:80
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:101
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
label patchi
Namespace for OpenFOAM.
defineRunTimeSelectionTable(reactionRateFlameArea, dictionary)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
defineTypeNameAndDebug(combustionModel, 0)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47