Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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\*---------------------------------------------------------------------------*/
29#include "psiThermo.H"
31// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32
33namespace Foam
34{
37 defineRunTimeSelectionTable(psiThermo, fvMeshDictPhase);
38}
39
40
41// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42
43Foam::psiThermo::psiThermo(const fvMesh& mesh, const word& phaseName)
44:
45 fluidThermo(mesh, phaseName),
46
47 psi_
48 (
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 (
65 (
66 phaseScopedName("thermo", "mu"),
67 mesh.time().timeName(),
68 mesh,
69 IOobject::NO_READ,
70 IOobject::NO_WRITE,
71 IOobject::REGISTER
72 ),
73 mesh,
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 (
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 (
106 (
107 phaseScopedName("thermo", "mu"),
108 mesh.time().timeName(),
109 mesh,
110 IOobject::NO_READ,
111 IOobject::NO_WRITE,
112 IOobject::REGISTER
113 ),
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)
138 return basicThermo::New<psiThermo>(mesh, phaseName, dictionaryName);
139}
140
141
142// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
147
148// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
153}
154
157{
158 return p_.boundaryField()[patchi]*psi_.boundaryField()[patchi];
159}
160
161
164 const Foam::volScalarField& deltaRho,
167)
168{}
171(
172 const Foam::volScalarField& deltaRho
173)
174{}
177{
178 return psi_;
179}
180
185}
186
187
189{
190 return mu_.boundaryField()[patchi];
191}
192
193
194// ************************************************************************* //
@ REGISTER
Request registration (bool: true).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
const Time & time() const noexcept
Return Time associated with the objectRegistry.
Definition IOobject.C:456
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
volScalarField & p_
Pressure [Pa].
word phaseScopedName(const std::string &scope, const word &name) const
The phase property name scoped as scope:property.phase.
static autoPtr< Thermo > New(const fvMesh &, const word &phaseName=word::null)
Generic New for each of the related thermodynamics packages.
Dimension set for the base types, which can be used to implement rigorous dimension checking for alge...
Fundamental fluid thermodynamic properties.
Definition fluidThermo.H:52
fluidThermo(const fvMesh &, const word &phaseName)
Construct from mesh and phase name.
Definition fluidThermo.C:36
Mesh data needed to do the Finite Volume discretisation.
Definition fvMesh.H:85
Basic thermodynamic properties based on compressibility.
Definition psiThermo.H:54
psiThermo(const psiThermo &)
Construct as copy (not implemented).
virtual tmp< volScalarField > mu() const
Dynamic viscosity of mixture [kg/m/s].
Definition psiThermo.C:175
virtual ~psiThermo()
Destructor.
Definition psiThermo.C:137
static autoPtr< psiThermo > New(const fvMesh &mesh, const word &phaseName=word::null)
Selector.
Definition psiThermo.C:115
volScalarField mu_
Dynamic viscosity [kg/m/s].
Definition psiThermo.H:68
virtual tmp< volScalarField > rho() const
Density [kg/m^3] - uses current value of pressure.
Definition psiThermo.C:143
volScalarField psi_
Compressibility [s^2/m^2].
Definition psiThermo.H:63
virtual const volScalarField & psi() const
Compressibility [s^2/m^2].
Definition psiThermo.C:169
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
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
const dimensionedScalar rhoMin
const dimensionedScalar rhoMax
word timeName
Definition getTimeIndex.H:3
Namespace for OpenFOAM.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.