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-2026 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  fvPatchField<scalar>::calculatedType()
61  ),
62 
63  mu_
64  (
65  IOobject
66  (
67  phasePropertyName("mu", phaseName),
68  mesh.time().name(),
69  mesh,
70  IOobject::NO_READ,
71  IOobject::NO_WRITE
72  ),
73  mesh,
74  dimensionSet(1, -1, -1, 0, 0),
75  fvPatchField<scalar>::calculatedType()
76  )
77 {}
78 
79 
80 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
81 
83 (
84  const fvMesh& mesh,
85  const word& phaseName
86 )
87 {
88  return basicThermo::New<fluidThermo>(mesh, phaseName);
89 }
90 
91 
92 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
93 
95 {}
96 
97 
99 {}
100 
101 
102 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
103 
105 {
106  return mu()/rho();
107 }
108 
109 
112 {
113  return mu().boundaryField()[patchi]/rho(patchi);
114 }
115 
116 
118 {
119  return p_;
120 }
121 
122 
124 {
125  return p_;
126 }
127 
128 
130 {
131  return psi_;
132 }
133 
134 
136 {
137  return mu_;
138 }
139 
140 
141 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Dimension set for the base types.
Definition: dimensionSet.H:125
virtual ~implementation()
Destructor.
Definition: fluidThermo.C:98
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:117
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition: fluidThermo.C:129
virtual const volScalarField & mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition: fluidThermo.C:135
Base-class for fluid thermodynamic properties.
Definition: fluidThermo.H:56
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:104
virtual ~fluidThermo()
Destructor.
Definition: fluidThermo.C:94
static autoPtr< fluidThermo > New(const fvMesh &, const word &phaseName=word::null)
Standard selection based on fvMesh.
Definition: fluidThermo.C:83
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:98
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:90
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
label patchi
const dimensionSet time
Namespace for OpenFOAM.
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
defineRunTimeSelectionTable(fvConstraint, dictionary)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
dictionary dict