rhoSimpleFoam now instantiates the lower-level fluidThermo which instantiates
either a psiThermo or rhoThermo according to the 'type' specification in
thermophysicalProperties, e.g.
thermoType
{
type hePsiThermo;
mixture pureMixture;
transport sutherland;
thermo janaf;
equationOfState perfectGas;
specie specie;
energy sensibleInternalEnergy;
}
instantiates a psiThermo for a perfect gas with JANAF thermodynamics, whereas
thermoType
{
type heRhoThermo;
mixture pureMixture;
properties liquid;
energy sensibleInternalEnergy;
}
mixture
{
H2O;
}
instantiates a rhoThermo for water, see new tutorial
compressible/rhoSimpleFoam/squareBendLiq.
In order to support complex equations of state the pressure can no longer be
unlimited and rhoSimpleFoam now limits the pressure rather than the density to
handle start-up more robustly.
For backward compatibility 'rhoMin' and 'rhoMax' can still be used in the SIMPLE
sub-dictionary of fvSolution which are converted into 'pMax' and 'pMin' but it
is better to set either 'pMax' and 'pMin' directly or use the more convenient
'pMinFactor' and 'pMinFactor' from which 'pMax' and 'pMin' are calculated using
the fixed boundary pressure or reference pressure e.g.
SIMPLE
{
nNonOrthogonalCorrectors 0;
pMinFactor 0.1;
pMaxFactor 1.5;
transonic yes;
consistent yes;
residualControl
{
p 1e-3;
U 1e-4;
e 1e-3;
"(k|epsilon|omega)" 1e-3;
}
}
108 lines
3.1 KiB
C++
108 lines
3.1 KiB
C++
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration |
|
|
\\ / A nd | Copyright (C) 2017 OpenFOAM Foundation
|
|
\\/ M anipulation |
|
|
-------------------------------------------------------------------------------
|
|
License
|
|
This file is part of OpenFOAM.
|
|
|
|
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
Class
|
|
Foam::pressureControl
|
|
|
|
Description
|
|
Provides controls for the pressure reference is closed-volume simulations
|
|
and a general method for limiting the pressure during the startup of
|
|
steady-state simulations.
|
|
|
|
SourceFiles
|
|
pressureControlI.H
|
|
pressureControl.C
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef pressureControl_H
|
|
#define pressureControl_H
|
|
|
|
#include "dimensionedScalar.H"
|
|
#include "volFieldsFwd.H"
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
namespace Foam
|
|
{
|
|
|
|
/*---------------------------------------------------------------------------*\
|
|
Class pressureControl Declaration
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
class pressureControl
|
|
{
|
|
// Private data
|
|
|
|
//- Optional cell in which the reference pressure is set
|
|
label refCell_;
|
|
|
|
//- Optional pressure reference level
|
|
scalar refValue_;
|
|
|
|
//- Pressure lower-limit
|
|
dimensionedScalar pMax_;
|
|
|
|
//- Pressure upper-limit
|
|
dimensionedScalar pMin_;
|
|
|
|
|
|
public:
|
|
|
|
// Constructors
|
|
|
|
//- Construct from the SIMPLE/PIMPLE sub-dictionary
|
|
pressureControl
|
|
(
|
|
const volScalarField& p,
|
|
const volScalarField& rho,
|
|
const dictionary& dict
|
|
);
|
|
|
|
|
|
// Member Functions
|
|
|
|
//- Return the cell in which the reference pressure is set
|
|
inline label refCell() const;
|
|
|
|
//- Return the pressure reference level
|
|
inline scalar refValue() const;
|
|
|
|
//- Limit the pressure
|
|
void limit(volScalarField& p) const;
|
|
};
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
} // End namespace Foam
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
#include "pressureControlI.H"
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
#endif
|
|
|
|
// ************************************************************************* //
|