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-2023 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 dictionary& dict,
42  const fvMesh& mesh,
43  const word& phaseName
44 )
45 :
46  p_(lookupOrConstruct(mesh, "p")),
47 
48  psi_
49  (
50  IOobject
51  (
52  phasePropertyName("psi", phaseName),
53  mesh.time().name(),
54  mesh,
55  IOobject::NO_READ,
56  IOobject::NO_WRITE
57  ),
58  mesh,
59  dimensionSet(0, -2, 2, 0, 0)
60  ),
61 
62  mu_
63  (
64  IOobject
65  (
66  phasePropertyName("mu", phaseName),
67  mesh.time().name(),
68  mesh,
69  IOobject::NO_READ,
70  IOobject::NO_WRITE
71  ),
72  mesh,
73  dimensionSet(1, -1, -1, 0, 0)
74  )
75 {}
76 
77 
78 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
79 
81 (
82  const fvMesh& mesh,
83  const word& phaseName
84 )
85 {
86  return basicThermo::New<fluidThermo>(mesh, phaseName);
87 }
88 
89 
90 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
91 
93 {}
94 
95 
97 {}
98 
99 
100 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
101 
103 {
104  return mu()/rho();
105 }
106 
107 
110 {
111  return mu().boundaryField()[patchi]/rho(patchi);
112 }
113 
114 
116 {
117  return p_;
118 }
119 
120 
122 {
123  return p_;
124 }
125 
126 
128 {
129  return psi_;
130 }
131 
132 
134 {
135  return mu_;
136 }
137 
138 
139 // ************************************************************************* //
Generic GeometricField class.
const Boundary & boundaryField() const
Return const-reference to the boundary field.
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].
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Dimension set for the base types.
Definition: dimensionSet.H:125
virtual ~implementation()
Destructor.
Definition: fluidThermo.C:96
implementation(const dictionary &, const fvMesh &, const word &)
Construct from dictionary, mesh and phase name.
Definition: fluidThermo.C:40
virtual const volScalarField & p() const
Pressure [Pa].
Definition: fluidThermo.C:115
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: fluidThermo.C:127
virtual const volScalarField & mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: fluidThermo.C:133
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:57
virtual const volScalarField & mu() const =0
Dynamic viscosity of mixture [kg/m/s].
tmp< volScalarField > nu() const
Kinematic viscosity of mixture [m^2/s].
Definition: fluidThermo.C:102
virtual ~fluidThermo()
Destructor.
Definition: fluidThermo.C:92
static autoPtr< fluidThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: fluidThermo.C:81
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
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
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
defineTypeNameAndDebug(combustionModel, 0)
dictionary dict