fvConstraints: Added limitPressure which replaces pressureControl.limit

To provide more flexibility, extensibility, run-time modifiability and
consistency the handling of optional pressure limits has been moved from
pressureControl (settings in system/fvSolution) to the new limitPressure
fvConstraint (settings in system/fvConstraints).

All tutorials have been updated which provides guidance when upgrading cases but
also helpful error messages are generated for cases using the old settings
providing specific details as to how the case should be updated, e.g. for the
tutorials/compressible/rhoSimpleFoam/squareBend case which has the pressure
limit specification:

SIMPLE
{
...
    pMinFactor      0.1;
    pMaxFactor      2;
...

generates the error message

--> FOAM FATAL IO ERROR:
Pressure limits should now be specified in fvConstraints:

limitp
{
    type       limitPressure;

    minFactor  0.1;
    maxFactor  2;
}

file: /home/dm2/henry/OpenFOAM/OpenFOAM-dev/tutorials/compressible/rhoSimpleFoam/squareBend/system/fvSolution/SIMPLE from line 41 to line 54.
This commit is contained in:
Henry Weller
2021-04-27 10:25:28 +01:00
parent ad82628b14
commit ab7d010a9a
136 changed files with 1580 additions and 490 deletions

View File

@ -37,7 +37,7 @@ Description
#include "fluidReactionThermophysicalTransportModel.H"
#include "multivariateScheme.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "fvModels.H"
#include "fvConstraints.H"
#include "localEulerDdtScheme.H"

View File

@ -92,7 +92,7 @@ volScalarField p_rgh
// Force p_rgh to be consistent with p
p_rgh = p - rho*gh - pRef;
pressureControl pressureControl
pressureReference pressureReference
(
p,
p_rgh,

View File

@ -38,7 +38,7 @@ volScalarField& p = thermo.p();
#include "compressibleCreatePhi.H"
pressureControl pressureControl(p, rho, pimple.dict(), false);
pressureReference pressureReference(p, rho, pimple.dict(), false);
mesh.setFluxRequired(p.name());

View File

@ -37,7 +37,7 @@ Description
#include "fluidReactionThermophysicalTransportModel.H"
#include "multivariateScheme.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "CorrectPhi.H"
#include "fvModels.H"
#include "fvConstraints.H"

View File

@ -40,7 +40,7 @@ volVectorField U
#include "compressibleCreatePhi.H"
pressureControl pressureControl
pressureReference pressureReference
(
p,
rho,

View File

@ -82,8 +82,8 @@ if (pimple.transonic())
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
pEqn.solve();
@ -121,8 +121,8 @@ else
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
pEqn.solve();
@ -140,12 +140,12 @@ if (mesh.steady())
}
else
{
const bool limitedp = pressureControl.limit(p);
const bool constrained = fvConstraints.constrain(p);
// Thermodynamic density update
thermo.correctRho(psi*p - psip0);
if (limitedp)
if (constrained)
{
rho = thermo.rho();
}
@ -164,7 +164,7 @@ K = 0.5*magSqr(U);
if (mesh.steady())
{
pressureControl.limit(p);
fvConstraints.constrain(p);
}
// For steady compressible closed-volume cases adjust the pressure level

View File

@ -39,7 +39,7 @@ Description
#include "dynamicMomentumTransportModel.H"
#include "fluidThermophysicalTransportModel.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "CorrectPhi.H"
#include "fvModels.H"
#include "fvConstraints.H"

View File

@ -38,7 +38,7 @@ volVectorField U
#include "compressibleCreatePhi.H"
pressureControl pressureControl
pressureReference pressureReference
(
p,
rho,

View File

@ -72,8 +72,8 @@ if (simple.transonic())
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
pEqn.solve();
@ -106,8 +106,8 @@ else
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
pEqn.solve();
@ -128,7 +128,7 @@ U = HbyA - rAAtU*fvc::grad(p);
U.correctBoundaryConditions();
fvConstraints.constrain(U);
pressureControl.limit(p);
fvConstraints.constrain(p);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity

View File

@ -54,8 +54,8 @@
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
pEqn.solve();
@ -83,7 +83,7 @@
U.correctBoundaryConditions();
fvConstraints.constrain(U);
pressureControl.limit(p);
fvConstraints.constrain(p);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity

View File

@ -35,7 +35,7 @@ Description
#include "dynamicMomentumTransportModel.H"
#include "fluidThermophysicalTransportModel.H"
#include "simpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "fvModels.H"
#include "fvConstraints.H"
#include "IOporosityModelList.H"

View File

@ -34,7 +34,7 @@ Description
#include "dynamicMomentumTransportModel.H"
#include "fluidThermophysicalTransportModel.H"
#include "simpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "fvModels.H"
#include "fvConstraints.H"

View File

@ -40,7 +40,7 @@ Description
#include "dynamicMomentumTransportModel.H"
#include "fluidThermophysicalTransportModel.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "CorrectPhi.H"
#include "fvModels.H"
#include "fvConstraints.H"

View File

@ -79,7 +79,7 @@ volScalarField p_rgh
// Force p_rgh to be consistent with p
p_rgh = p - rho*gh - pRef;
pressureControl pressureControl
pressureReference pressureReference
(
p,
p_rgh,

View File

@ -65,8 +65,8 @@ if (pimple.transonic())
p_rghEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
p_rghEqn.solve();
@ -88,8 +88,8 @@ else
p_rghEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
p_rghEqn.solve();
@ -106,12 +106,12 @@ if (mesh.steady())
}
else
{
const bool limitedp = pressureControl.limit(p);
const bool constrained = fvConstraints.constrain(p);
// Thermodynamic density update
thermo.correctRho(psi*p - psip0);
if (limitedp)
if (constrained)
{
rho = thermo.rho();
}
@ -132,7 +132,7 @@ K = 0.5*magSqr(U);
if (mesh.steady())
{
pressureControl.limit(p);
fvConstraints.constrain(p);
}
// For steady closed-volume compressible cases adjust the pressure level

View File

@ -34,7 +34,7 @@ Description
#include "dynamicMomentumTransportModel.H"
#include "fluidThermophysicalTransportModel.H"
#include "simpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "fvModels.H"
#include "fvConstraints.H"

View File

@ -77,7 +77,7 @@ volScalarField p_rgh
// Force p_rgh to be consistent with p
p_rgh = p - rho*gh - pRef;
pressureControl pressureControl
pressureReference pressureReference
(
p,
p_rgh,

View File

@ -48,8 +48,8 @@ if (simple.transonic())
p_rghEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
p_rghEqn.solve();
@ -67,8 +67,8 @@ else
p_rghEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
p_rghEqn.solve();
@ -90,7 +90,7 @@ U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
U.correctBoundaryConditions();
fvConstraints.constrain(U);
pressureControl.limit(p);
fvConstraints.constrain(p);
// For closed-volume compressible cases adjust the pressure level
// to obey overall mass continuity

View File

@ -45,7 +45,7 @@ Description
#include "fvConstraints.H"
#include "coordinateSystem.H"
#include "pimpleMultiRegionControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,11 +1,11 @@
PtrList<pressureControl> pressureControlFluid(fluidRegions.size());
PtrList<pressureReference> pressureReferenceFluid(fluidRegions.size());
forAll(fluidRegions, i)
{
pressureControlFluid.set
pressureReferenceFluid.set
(
i,
new pressureControl
new pressureReference
(
p_rghFluid[i],
rhoFluid[i],

View File

@ -47,7 +47,7 @@
pimpleNoLoopControl& pimple = pimples.pimple(i);
pressureControl& pressureControl = pressureControlFluid[i];
pressureReference& pressureReference = pressureReferenceFluid[i];
scalar cumulativeContErr = cumulativeContErrs[i];

View File

@ -41,7 +41,7 @@ Description
#include "fvModels.H"
#include "fvConstraints.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "CorrectPhi.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"

View File

@ -105,7 +105,7 @@ volScalarField p_rgh
// Force p_rgh to be consistent with p
p_rgh = p - rho*gh;
pressureControl pressureControl
pressureReference pressureReference
(
p,
p_rgh,

View File

@ -64,9 +64,9 @@ while (pimple.correctNonOrthogonal())
p = p_rgh + rho*gh;
bool limitedp = pressureControl.limit(p);
bool constrained = fvConstraints.constrain(p);
if (limitedp)
if (constrained)
{
p_rgh = p - rho*gh;
}
@ -74,7 +74,7 @@ if (limitedp)
// Thermodynamic density update
thermo.correctRho(psi*p - psip0);
if (limitedp)
if (constrained)
{
rho = thermo.rho();
}

View File

@ -87,7 +87,7 @@ volScalarField K("K", 0.5*magSqr(U));
#include "readGravitationalAcceleration.H"
pressureControl pressureControl
pressureReference pressureReference
(
p,
rho,

View File

@ -41,7 +41,7 @@ Description
#include "fvModels.H"
#include "fvConstraints.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "CorrectPhi.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"

View File

@ -58,12 +58,12 @@ U.correctBoundaryConditions();
fvConstraints.constrain(U);
K = 0.5*magSqr(U);
bool limitedp = pressureControl.limit(p);
bool constrained = fvConstraints.constrain(p);
// Thermodynamic density update
thermo.correctRho(psi*p - psip0);
if (limitedp)
if (constrained)
{
rho = thermo.rho();
}

View File

@ -41,7 +41,7 @@ Description
#include "fvModels.H"
#include "fvConstraints.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "CorrectPhi.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"

View File

@ -36,7 +36,7 @@ if (fluid.found("pMin"))
<< pimple.dict().name() << endl;
}
pressureControl pressureControl
pressureReference pressureReference
(
p,
p_rgh,
@ -48,7 +48,6 @@ pressureControl pressureControl
if (fluid.incompressible())
{
p = p_rgh + fluid.rho()*gh;
pressureControl.limit(p);
}
if (p_rgh.needReference() && fluid.incompressible())
@ -57,8 +56,8 @@ if (p_rgh.needReference() && fluid.incompressible())
(
"p",
p.dimensions(),
pressureControl.refValue()
- getRefCellValue(p, pressureControl.refCell())
pressureReference.refValue()
- getRefCellValue(p, pressureReference.refCell())
);
}

View File

@ -38,7 +38,7 @@ Description
#include "phaseSystem.H"
#include "phaseDynamicMomentumTransportModel.H"
#include "pimpleControl.H"
#include "pressureControl.H"
#include "pressureReference.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"

View File

@ -259,8 +259,8 @@ while (pimple.correct())
{
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
}
@ -332,7 +332,7 @@ while (pimple.correct())
// Update and limit the static pressure
p = p_rgh + rho*gh;
pressureControl.limit(p);
fvConstraints.constrain(p);
// Account for static pressure reference
if (p_rgh.needReference() && fluid.incompressible())
@ -341,8 +341,8 @@ while (pimple.correct())
(
"p",
p.dimensions(),
pressureControl.refValue()
- getRefCellValue(p, pressureControl.refCell())
pressureReference.refValue()
- getRefCellValue(p, pressureReference.refCell())
);
}

View File

@ -250,8 +250,8 @@ while (pimple.correct())
{
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
pressureReference.refCell(),
pressureReference.refValue()
);
}
@ -310,7 +310,7 @@ while (pimple.correct())
// Update and limit the static pressure
p = p_rgh + rho*gh;
pressureControl.limit(p);
fvConstraints.constrain(p);
// Account for static pressure reference
if (p_rgh.needReference() && fluid.incompressible())
@ -319,8 +319,8 @@ while (pimple.correct())
(
"p",
p.dimensions(),
pressureControl.refValue()
- getRefCellValue(p, pressureControl.refCell())
pressureReference.refValue()
- getRefCellValue(p, pressureReference.refCell())
);
}

View File

@ -408,7 +408,7 @@ $(general)/constrainHbyA/constrainHbyA.C
$(general)/adjustPhi/adjustPhi.C
$(general)/bound/bound.C
$(general)/CorrectPhi/correctUphiBCs.C
$(general)/pressureControl/pressureControl.C
$(general)/pressureReference/pressureReference.C
$(general)/levelSet/levelSet.C
solutionControl = $(general)/solutionControl

View File

@ -38,17 +38,21 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type>
void Foam::fvConstraint::constrainType
bool Foam::fvConstraint::constrainType
(
fvMatrix<Type>& eqn,
const word& fieldName
) const
{}
{
return false;
}
template<class Type>
void Foam::fvConstraint::constrainType(VolField<Type>& field) const
{}
bool Foam::fvConstraint::constrainType(VolField<Type>& field) const
{
return false;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -76,7 +76,7 @@ class fvConstraint
//- Apply a constraint to an equation
template<class Type>
void constrainType
bool constrainType
(
fvMatrix<Type>& eqn,
const word& fieldName
@ -84,7 +84,7 @@ class fvConstraint
//- Apply constraint to a field
template<class Type>
void constrainType(VolField<Type>& field) const;
bool constrainType(VolField<Type>& field) const;
public:

View File

@ -24,32 +24,32 @@ License
\*---------------------------------------------------------------------------*/
#define DEFINE_FV_CONSTRAINT_CONSTRAIN(Type, nullArg) \
virtual void constrain \
virtual bool constrain \
( \
fvMatrix<Type>& eqn, \
const word& fieldName \
) const;
#define IMPLEMENT_FV_CONSTRAINT_CONSTRAIN(Type, constraintType) \
void Foam::constraintType::constrain \
bool Foam::constraintType::constrain \
( \
fvMatrix<Type>& eqn, \
const word& fieldName \
) const \
{ \
constrainType(eqn, fieldName); \
return constrainType(eqn, fieldName); \
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define DEFINE_FV_CONSTRAINT_CONSTRAIN_FIELD(Type, nullArg) \
virtual void constrain(VolField<Type>& field) const;
virtual bool constrain(VolField<Type>& field) const;
#define IMPLEMENT_FV_CONSTRAINT_CONSTRAIN_FIELD(Type, constraintType) \
void Foam::constraintType::constrain(VolField<Type>& field) const \
bool Foam::constraintType::constrain(VolField<Type>& field) const \
{ \
constrainType(field); \
return constrainType(field); \
}

View File

@ -128,11 +128,11 @@ public:
//- Apply constraints to an equation
template<class Type>
void constrain(fvMatrix<Type>& eqn) const;
bool constrain(fvMatrix<Type>& eqn) const;
//- Apply constraints to a field
template<class Type>
void constrain
bool constrain
(
GeometricField<Type, fvPatchField, volMesh>& field
) const;

View File

@ -26,12 +26,14 @@ License
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
template<class Type>
void Foam::fvConstraints::constrain(fvMatrix<Type>& eqn) const
bool Foam::fvConstraints::constrain(fvMatrix<Type>& eqn) const
{
checkApplied();
const PtrListDictionary<fvConstraint>& constraintList(*this);
bool constrained = false;
forAll(constraintList, i)
{
const fvConstraint& constraint = constraintList[i];
@ -46,14 +48,17 @@ void Foam::fvConstraints::constrain(fvMatrix<Type>& eqn) const
<< " to field " << eqn.psi().name() << endl;
}
constraint.constrain(eqn, eqn.psi().name());
constrained =
constrained || constraint.constrain(eqn, eqn.psi().name());
}
}
return constrained;
}
template<class Type>
void Foam::fvConstraints::constrain
bool Foam::fvConstraints::constrain
(
GeometricField<Type, fvPatchField, volMesh>& field
) const
@ -62,6 +67,8 @@ void Foam::fvConstraints::constrain
const PtrListDictionary<fvConstraint>& constraintList(*this);
bool constrained = false;
forAll(constraintList, i)
{
const fvConstraint& constraint = constraintList[i];
@ -76,9 +83,12 @@ void Foam::fvConstraints::constrain
<< " for field " << fieldName << endl;
}
constraint.constrain(field);
constrained =
constrained || constraint.constrain(field);
}
}
return constrained;
}

View File

@ -1,285 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2020 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/>.
\*---------------------------------------------------------------------------*/
#include "pressureControl.H"
#include "findRefCell.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pressureControl::pressureControl
(
const volScalarField& p,
const volScalarField& pRef,
const volScalarField& rho,
const dictionary& dict,
const bool pRefRequired
)
:
refCell_(-1),
refValue_(0),
pMax_("pMax", dimPressure, great),
pMin_("pMin", dimPressure, 0),
limitMaxP_(false),
limitMinP_(false)
{
bool pLimits = false;
scalar pMax = -great;
scalar pMin = great;
// Set the reference cell and value for closed domain simulations
if (pRefRequired && setRefCell(p, pRef, dict, refCell_, refValue_))
{
pLimits = true;
pMax = refValue_;
pMin = refValue_;
}
if (dict.found("pMax") && dict.found("pMin"))
{
pMax_.value() = dict.lookup<scalar>("pMax");
limitMaxP_ = true;
pMin_.value() = dict.lookup<scalar>("pMin");
limitMinP_ = true;
}
else
{
const volScalarField::Boundary& pbf = p.boundaryField();
const volScalarField::Boundary& rhobf = rho.boundaryField();
scalar rhoRefMax = -great;
scalar rhoRefMin = great;
bool rhoLimits = false;
forAll(pbf, patchi)
{
if (pbf[patchi].fixesValue())
{
pLimits = true;
rhoLimits = true;
pMax = max(pMax, max(pbf[patchi]));
pMin = min(pMin, min(pbf[patchi]));
rhoRefMax = max(rhoRefMax, max(rhobf[patchi]));
rhoRefMin = min(rhoRefMin, min(rhobf[patchi]));
}
}
reduce(rhoLimits, andOp<bool>());
if (rhoLimits)
{
reduce(pMax, maxOp<scalar>());
reduce(pMin, minOp<scalar>());
reduce(rhoRefMax, maxOp<scalar>());
reduce(rhoRefMin, minOp<scalar>());
}
if (dict.found("pMax"))
{
pMax_.value() = dict.lookup<scalar>("pMax");
limitMaxP_ = true;
}
else if (dict.found("pMaxFactor"))
{
if (!pLimits)
{
FatalIOErrorInFunction(dict)
<< "'pMaxFactor' specified rather than 'pMax'" << nl
<< " but the corresponding reference pressure cannot"
" be evaluated from the boundary conditions." << nl
<< " Please specify 'pMax' rather than 'pMaxFactor'"
<< exit(FatalIOError);
}
const scalar pMaxFactor(dict.lookup<scalar>("pMaxFactor"));
pMax_.value() = pMaxFactor*pMax;
limitMaxP_ = true;
}
else if (dict.found("rhoMax"))
{
// For backward-compatibility infer the pMax from rhoMax
IOWarningInFunction(dict)
<< "'rhoMax' specified rather than 'pMax' or 'pMaxFactor'"
<< nl
<< " This is supported for backward-compatibility but "
"'pMax' or 'pMaxFactor' are more reliable." << endl;
if (!pLimits)
{
FatalIOErrorInFunction(dict)
<< "'rhoMax' specified rather than 'pMax'" << nl
<< " but the corresponding reference pressure cannot"
" be evaluated from the boundary conditions." << nl
<< " Please specify 'pMax' rather than 'rhoMax'"
<< exit(FatalIOError);
}
if (!rhoLimits)
{
FatalIOErrorInFunction(dict)
<< "'rhoMax' specified rather than 'pMaxFactor'" << nl
<< " but the corresponding reference density cannot"
" be evaluated from the boundary conditions." << nl
<< " Please specify 'pMaxFactor' rather than 'rhoMax'"
<< exit(FatalIOError);
}
dimensionedScalar rhoMax("rhoMax", dimDensity, dict);
pMax_.value() = max(rhoMax.value()/rhoRefMax, 1)*pMax;
limitMaxP_ = true;
}
if (dict.found("pMin"))
{
pMin_.value() = dict.lookup<scalar>("pMin");
limitMinP_ = true;
}
else if (dict.found("pMinFactor"))
{
if (!pLimits)
{
FatalIOErrorInFunction(dict)
<< "'pMinFactor' specified rather than 'pMin'" << nl
<< " but the corresponding reference pressure cannot"
" be evaluated from the boundary conditions." << nl
<< " Please specify 'pMin' rather than 'pMinFactor'"
<< exit(FatalIOError);
}
const scalar pMinFactor(dict.lookup<scalar>("pMinFactor"));
pMin_.value() = pMinFactor*pMin;
limitMinP_ = true;
}
else if (dict.found("rhoMin"))
{
// For backward-compatibility infer the pMin from rhoMin
IOWarningInFunction(dict)
<< "'rhoMin' specified rather than 'pMin' or 'pMinFactor'" << nl
<< " This is supported for backward-compatibility but"
"'pMin' or 'pMinFactor' are more reliable." << endl;
if (!pLimits)
{
FatalIOErrorInFunction(dict)
<< "'rhoMin' specified rather than 'pMin'" << nl
<< " but the corresponding reference pressure cannot"
" be evaluated from the boundary conditions." << nl
<< " Please specify 'pMin' rather than 'rhoMin'"
<< exit(FatalIOError);
}
if (!rhoLimits)
{
FatalIOErrorInFunction(dict)
<< "'rhoMin' specified rather than 'pMinFactor'" << nl
<< " but the corresponding reference density cannot"
" be evaluated from the boundary conditions." << nl
<< " Please specify 'pMinFactor' rather than 'rhoMin'"
<< exit(FatalIOError);
}
dimensionedScalar rhoMin("rhoMin", dimDensity, dict);
pMin_.value() = min(rhoMin.value()/rhoRefMin, 1)*pMin;
limitMinP_ = true;
}
}
if (limitMaxP_ || limitMinP_)
{
Info<< "pressureControl" << nl;
if (limitMaxP_)
{
Info<< " pMax " << pMax_.value() << nl;
}
if (limitMinP_)
{
Info<< " pMin " << pMin_.value() << nl;
}
Info << endl;
}
}
Foam::pressureControl::pressureControl
(
const volScalarField& p,
const volScalarField& rho,
const dictionary& dict,
const bool pRefRequired
)
:
pressureControl(p, p, rho, dict, pRefRequired)
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::pressureControl::limit(volScalarField& p) const
{
if (limitMaxP_ || limitMinP_)
{
if (limitMaxP_)
{
const scalar pMax = max(p).value();
if (pMax > pMax_.value())
{
Info<< "pressureControl: p max " << pMax << endl;
p = min(p, pMax_);
}
}
if (limitMinP_)
{
const scalar pMin = min(p).value();
if (pMin < pMin_.value())
{
Info<< "pressureControl: p min " << pMin << endl;
p = max(p, pMin_);
}
}
p.correctBoundaryConditions();
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,124 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2021 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/>.
\*---------------------------------------------------------------------------*/
#include "pressureReference.H"
#include "findRefCell.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::pressureReference::pressureReference
(
const volScalarField& p,
const volScalarField& pRef,
const volScalarField& rho,
const dictionary& dict,
const bool pRefRequired
)
:
refCell_(-1),
refValue_(0)
{
// Set the reference cell and value for closed domain simulations
if (pRefRequired)
{
setRefCell(p, pRef, dict, refCell_, refValue_);
}
// Print update message fvSolution -> fvConstraints
if
(
dict.found("pMin")
|| dict.found("pMax")
|| dict.found("pMinFactor")
|| dict.found("pMaxFactor")
|| dict.found("rhoMin")
|| dict.found("rhoMax")
)
{
FatalIOErrorInFunction(dict)
<< "Pressure limits should now be specified in fvConstraints:\n\n"
"limitp\n"
"{\n"
" type limitPressure;\n"
"\n";
if (dict.found("pMin"))
{
FatalIOError
<< " min " << dict.lookup<scalar>("pMin")
<< ";\n";
}
if (dict.found("pMax"))
{
FatalIOError
<< " max " << dict.lookup<scalar>("pMax")
<< ";\n";
}
if (dict.found("pMinFactor"))
{
FatalIOError
<< " minFactor " << dict.lookup<scalar>("pMinFactor")
<< ";\n";
}
if (dict.found("pMaxFactor"))
{
FatalIOError
<< " maxFactor " << dict.lookup<scalar>("pMaxFactor")
<< ";\n";
}
FatalIOError << "}\n";
if
(
dict.found("rhoMin")
|| dict.found("rhoMax")
)
{
FatalIOError
<< "\nrhoMin and rhoMax are no longer supported.\n";
}
FatalIOError << exit(FatalIOError);
}
}
Foam::pressureReference::pressureReference
(
const volScalarField& p,
const volScalarField& rho,
const dictionary& dict,
const bool pRefRequired
)
:
pressureReference(p, p, rho, dict, pRefRequired)
{}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,21 +22,19 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::pressureControl
Foam::pressureReference
Description
Provides controls for the pressure reference in closed-volume simulations
and a general method for limiting the pressure during the startup of
steady-state simulations.
SourceFiles
pressureControlI.H
pressureControl.C
pressureReferenceI.H
pressureReference.C
\*---------------------------------------------------------------------------*/
#ifndef pressureControl_H
#define pressureControl_H
#ifndef pressureReference_H
#define pressureReference_H
#include "dimensionedScalar.H"
#include "volFieldsFwd.H"
@ -47,10 +45,10 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class pressureControl Declaration
Class pressureReference Declaration
\*---------------------------------------------------------------------------*/
class pressureControl
class pressureReference
{
// Private Data
@ -60,18 +58,6 @@ class pressureControl
//- Optional pressure reference level
scalar refValue_;
//- Pressure lower-limit
dimensionedScalar pMax_;
//- Pressure upper-limit
dimensionedScalar pMin_;
//- Pressure lower-limit
bool limitMaxP_;
//- Pressure upper-limit
bool limitMinP_;
public:
@ -79,7 +65,7 @@ public:
//- Construct from the simple/pimple sub-dictionary
// supporting the pressure and derived pressure fields (e.g. p_rgh)
pressureControl
pressureReference
(
const volScalarField& p,
const volScalarField& pRef,
@ -89,7 +75,7 @@ public:
);
//- Construct from the simple/pimple sub-dictionary
pressureControl
pressureReference
(
const volScalarField& p,
const volScalarField& rho,
@ -105,9 +91,6 @@ public:
//- Return the pressure reference level
inline scalar refValue() const;
//- Limit the pressure if necessary and return true if so
bool limit(volScalarField& p) const;
};
@ -117,7 +100,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "pressureControlI.H"
#include "pressureReferenceI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,13 +25,13 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline Foam::label Foam::pressureControl::refCell() const
inline Foam::label Foam::pressureReference::refCell() const
{
return refCell_;
}
inline Foam::scalar Foam::pressureControl::refValue() const
inline Foam::scalar Foam::pressureReference::refValue() const
{
return refValue_;
}

View File

@ -1,6 +1,7 @@
fixedValueConstraint/fixedValueConstraint.C
fixedTemperatureConstraint/fixedTemperatureConstraint.C
limitTemperature/limitTemperature.C
limitPressure/limitPressure.C
limitVelocity/limitVelocity.C
meanVelocityForce/meanVelocityForce.C
meanVelocityForce/patchMeanVelocityForce/patchMeanVelocityForce.C

View File

@ -119,7 +119,7 @@ Foam::wordList Foam::fv::fixedTemperatureConstraint::constrainedFields() const
}
void Foam::fv::fixedTemperatureConstraint::constrain
bool Foam::fv::fixedTemperatureConstraint::constrain
(
fvMatrix<scalar>& eqn,
const word& fieldName
@ -151,6 +151,8 @@ void Foam::fv::fixedTemperatureConstraint::constrain
break;
}
}
return cells.size();
}

View File

@ -149,7 +149,7 @@ public:
virtual wordList constrainedFields() const;
//- Constrain energy equation to fix the temperature
virtual void constrain
virtual bool constrain
(
fvMatrix<scalar>& eqn,
const word& fieldName

View File

@ -70,7 +70,7 @@ void Foam::fv::fixedValueConstraint::readCoeffs()
template<class Type>
void Foam::fv::fixedValueConstraint::constrainType
bool Foam::fv::fixedValueConstraint::constrainType
(
fvMatrix<Type>& eqn,
const word& fieldName
@ -83,6 +83,8 @@ void Foam::fv::fixedValueConstraint::constrainType
set_.cells(),
List<Type>(set_.cells().size(), fieldValues_[fieldName]->value<Type>(t))
);
return set_.cells().size();
}

View File

@ -89,7 +89,7 @@ class fixedValueConstraint
//- Set value on a field
template<class Type>
void constrainType(fvMatrix<Type>& eqn, const word& fieldName) const;
bool constrainType(fvMatrix<Type>& eqn, const word& fieldName) const;
public:

View File

@ -0,0 +1,222 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 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/>.
\*---------------------------------------------------------------------------*/
#include "limitPressure.H"
#include "volFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
defineTypeNameAndDebug(limitPressure, 0);
addToRunTimeSelectionTable
(
fvConstraint,
limitPressure,
dictionary
);
}
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::fv::limitPressure::readCoeffs()
{
const dictionary& dict(coeffs());
if (dict.found("min") && dict.found("max"))
{
pMin_.value() = dict.lookup<scalar>("min");
limitMinP_ = true;
pMax_.value() = dict.lookup<scalar>("max");
limitMaxP_ = true;
}
else
{
const volScalarField& p = mesh().lookupObject<volScalarField>("p");
const volScalarField::Boundary& pbf = p.boundaryField();
bool pLimits = false;
scalar pMin = vGreat;
scalar pMax = -vGreat;
forAll(pbf, patchi)
{
if (pbf[patchi].fixesValue())
{
pLimits = true;
pMin = min(pMin, min(pbf[patchi]));
pMax = max(pMax, max(pbf[patchi]));
}
}
if (dict.found("min"))
{
pMin_.value() = dict.lookup<scalar>("min");
limitMinP_ = true;
}
else if (dict.found("minFactor"))
{
if (!pLimits)
{
FatalIOErrorInFunction(dict)
<< "'minFactor' specified rather than 'min'" << nl
<< " but the corresponding reference pressure cannot"
" be evaluated from the boundary conditions." << nl
<< " Please specify 'min' rather than 'minFactor'"
<< exit(FatalIOError);
}
const scalar pMinFactor(dict.lookup<scalar>("minFactor"));
pMin_.value() = pMinFactor*pMin;
limitMinP_ = true;
}
if (dict.found("max"))
{
pMax_.value() = dict.lookup<scalar>("max");
limitMaxP_ = true;
}
else if (dict.found("maxFactor"))
{
if (!pLimits)
{
FatalIOErrorInFunction(dict)
<< "'maxFactor' specified rather than 'max'" << nl
<< " but the corresponding reference pressure cannot"
" be evaluated from the boundary conditions." << nl
<< " Please specify 'max' rather than 'maxFactor'"
<< exit(FatalIOError);
}
const scalar pMaxFactor(dict.lookup<scalar>("maxFactor"));
pMax_.value() = pMaxFactor*pMax;
limitMaxP_ = true;
}
}
if (limitMinP_ || limitMaxP_)
{
if (limitMinP_)
{
Info<< " min " << pMin_.value() << nl;
}
if (limitMaxP_)
{
Info<< " max " << pMax_.value() << nl;
}
Info << endl;
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::fv::limitPressure::limitPressure
(
const word& name,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
)
:
fvConstraint(name, modelType, dict, mesh),
pMin_("pMin", dimPressure, 0),
pMax_("pMax", dimPressure, great),
limitMinP_(false),
limitMaxP_(false)
{
readCoeffs();
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::wordList Foam::fv::limitPressure::constrainedFields() const
{
return wordList(1, "p");
}
bool Foam::fv::limitPressure::constrain(volScalarField& p) const
{
bool constrained = false;
if (limitMinP_ || limitMaxP_)
{
if (limitMinP_)
{
const scalar pMin = min(p).value();
if (pMin < pMin_.value())
{
Info<< "limitPressure: p min " << pMin << endl;
p = max(p, pMin_);
constrained = true;
}
}
if (limitMaxP_)
{
const scalar pMax = max(p).value();
if (pMax > pMax_.value())
{
Info<< "limitPressure: p max " << pMax << endl;
p = min(p, pMax_);
constrained = true;
}
}
p.correctBoundaryConditions();
}
return constrained;
}
bool Foam::fv::limitPressure::read(const dictionary& dict)
{
if (fvConstraint::read(dict))
{
readCoeffs();
return true;
}
else
{
return false;
}
}
// ************************************************************************* //

View File

@ -0,0 +1,143 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2021 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::fv::limitPressure
Description
Limits the pressure to be between minimum and maximum values.
Usage
Example usage:
\verbatim
limitp
{
type limitPressure;
min 200;
max 500;
}
\endverbatim
SourceFiles
limitPressure.C
\*---------------------------------------------------------------------------*/
#ifndef limitPressure_H
#define limitPressure_H
#include "fvConstraint.H"
#include "dimensionedScalar.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace fv
{
/*---------------------------------------------------------------------------*\
Class limitPressure Declaration
\*---------------------------------------------------------------------------*/
class limitPressure
:
public fvConstraint
{
// Private data
//- Minimum pressure limit
dimensionedScalar pMin_;
//- Maximum pressure limit
dimensionedScalar pMax_;
//- Pressure min-limited
bool limitMinP_;
//- Pressure max-limited
bool limitMaxP_;
// Private Member Functions
//- Non-virtual read
void readCoeffs();
public:
//- Runtime type information
TypeName("limitPressure");
// Constructors
//- Construct from components
limitPressure
(
const word& name,
const word& modelType,
const dictionary& dict,
const fvMesh& mesh
);
//- Disallow default bitwise copy construction
limitPressure(const limitPressure&) = delete;
//- Destructor
virtual ~limitPressure()
{}
// Member Functions
//- Return the list of fields constrained by the fvConstraint
virtual wordList constrainedFields() const;
//- Constrain the energy field
virtual bool constrain(volScalarField& he) const;
//- Read dictionary
virtual bool read(const dictionary& dict);
// Member Operators
//- Disallow default bitwise assignment
void operator=(const limitPressure&) = delete;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fv
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -88,7 +88,7 @@ Foam::wordList Foam::fv::limitTemperature::constrainedFields() const
}
void Foam::fv::limitTemperature::constrain(volScalarField& he) const
bool Foam::fv::limitTemperature::constrain(volScalarField& he) const
{
const basicThermo& thermo =
mesh().lookupObject<basicThermo>
@ -137,6 +137,8 @@ void Foam::fv::limitTemperature::constrain(volScalarField& he) const
}
}
}
return cells.size();
}

View File

@ -122,7 +122,7 @@ public:
virtual wordList constrainedFields() const;
//- Constrain the energy field
virtual void constrain(volScalarField& he) const;
virtual bool constrain(volScalarField& he) const;
//- Update for mesh changes
virtual void updateMesh(const mapPolyMesh&);

View File

@ -80,7 +80,7 @@ Foam::wordList Foam::fv::limitVelocity::constrainedFields() const
}
void Foam::fv::limitVelocity::constrain(volVectorField& U) const
bool Foam::fv::limitVelocity::constrain(volVectorField& U) const
{
const scalar maxSqrU = sqr(max_);
@ -123,6 +123,8 @@ void Foam::fv::limitVelocity::constrain(volVectorField& U) const
}
}
}
return cells.size();
}

View File

@ -116,7 +116,7 @@ public:
virtual wordList constrainedFields() const;
//- Constrain the velocity field
virtual void constrain(volVectorField& U) const;
virtual bool constrain(volVectorField& U) const;
//- Update for mesh changes
virtual void updateMesh(const mapPolyMesh&);

View File

@ -149,7 +149,7 @@ Foam::scalar Foam::fv::meanVelocityForce::magUbarAve
}
void Foam::fv::meanVelocityForce::constrain
bool Foam::fv::meanVelocityForce::constrain
(
fvMatrix<vector>& eqn,
const word& fieldName
@ -201,10 +201,12 @@ void Foam::fv::meanVelocityForce::constrain
gradP0_ += dGradP_;
dGradP_ = 0;
return true;
}
void Foam::fv::meanVelocityForce::constrain(volVectorField& U) const
bool Foam::fv::meanVelocityForce::constrain(volVectorField& U) const
{
const scalarField& rAU = rAPtr_();
@ -240,6 +242,8 @@ void Foam::fv::meanVelocityForce::constrain(volVectorField& U) const
<< ", pressure gradient = " << gradP << endl;
writeProps(gradP);
return true;
}

View File

@ -146,14 +146,14 @@ public:
virtual wordList constrainedFields() const;
//- Add the momentum source and set the 1/A coefficient
virtual void constrain
virtual bool constrain
(
fvMatrix<vector>& eqn,
const word& fieldName
) const;
//- Correct the pressure gradient
virtual void constrain(volVectorField& U) const;
virtual bool constrain(volVectorField& U) const;
//- Update for mesh changes
virtual void updateMesh(const mapPolyMesh&);

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.5;
maxFactor 2;
}
// ************************************************************************* //

View File

@ -52,9 +52,6 @@ PIMPLE
nOuterCorrectors 3;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pMinFactor 0.5;
pMaxFactor 2.0;
}
relaxationFactors

View File

@ -14,11 +14,21 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.1;
maxFactor 2;
}
limitT
{
type limitTemperature;
min 101;
max 1000;
selectionMode all;
}

View File

@ -55,8 +55,6 @@ SIMPLE
}
nNonOrthogonalCorrectors 0;
pMinFactor 0.1;
pMaxFactor 2;
}
PIMPLE
@ -64,8 +62,6 @@ PIMPLE
nCorrectors 2;
nNonOrthogonalCorrectors 1;
nOuterCorrectors 1;
pMinFactor 0.1;
pMaxFactor 2;
}
relaxationFactors

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.9;
maxFactor 1.5;
}
// ************************************************************************* //

View File

@ -56,9 +56,6 @@ PIMPLE
consistent yes;
simpleRho yes;
pMaxFactor 1.5;
pMinFactor 0.9;
outerCorrectorResidualControl
{
"(U|k|epsilon)"

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.9;
maxFactor 1.5;
}
// ************************************************************************* //

View File

@ -56,9 +56,6 @@ PIMPLE
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pMaxFactor 1.5;
pMinFactor 0.9;
maxCo 0.2;
rDeltaTSmoothingCoeff 0.1;
rDeltaTDampingCoeff 1;

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.8;
maxFactor 1.2;
}
// ************************************************************************* //

View File

@ -63,9 +63,6 @@ PIMPLE
nOuterCorrectors 3;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pMaxFactor 1.2;
pMinFactor 0.8;
}
relaxationFactors

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
min 0.8e5;
max 1.2e5;
}
// ************************************************************************* //

View File

@ -59,9 +59,6 @@ PIMPLE
nOuterCorrectors 1;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pMax 1.2e5;
pMin 0.8e5;
}

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
min 0.8e5;
max 1.2e5;
}
// ************************************************************************* //

View File

@ -88,9 +88,6 @@ PIMPLE
nCorrectors 2;
nNonOrthogonalCorrectors 0;
momentumPredictor yes;
pMax 1.2e5;
pMin 0.8e5;
}
relaxationFactors

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.1;
maxFactor 1.5;
}
// ************************************************************************* //

View File

@ -45,8 +45,6 @@ PIMPLE
{
nCorrectors 3;
nNonOrthogonalCorrectors 0;
pMinFactor 0.1;
pMaxFactor 1.5;
transonic no;
consistent no;

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.5;
maxFactor 2;
}
// ************************************************************************* //

View File

@ -52,9 +52,6 @@ PIMPLE
nOuterCorrectors 3;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pMinFactor 0.5;
pMaxFactor 2.0;
}
relaxationFactors

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.5;
maxFactor 1.5;
}
// ************************************************************************* //

View File

@ -54,8 +54,6 @@ solvers
SIMPLE
{
nNonOrthogonalCorrectors 0;
pMinFactor 0.5;
pMaxFactor 1.5;
residualControl
{

View File

@ -15,6 +15,14 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.5;
maxFactor 2;
}
source1
{
type fixedTemperatureConstraint;

View File

@ -48,8 +48,6 @@ SIMPLE
{
nUCorrectors 2;
nNonOrthogonalCorrectors 0;
pMinFactor 0.5;
pMaxFactor 2.0;
residualControl
{

View File

@ -14,6 +14,14 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.1;
maxFactor 2;
}
limitT
{
type limitTemperature;
@ -22,4 +30,4 @@ limitT
selectionMode all;
}
//************************************************************************** //
// ************************************************************************* //

View File

@ -43,8 +43,6 @@ SIMPLE
}
nNonOrthogonalCorrectors 0;
pMinFactor 0.1;
pMaxFactor 2;
}
relaxationFactors

View File

@ -15,6 +15,14 @@ FoamFile
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.4;
maxFactor 1.5;
}
fixedTemperature
{
type fixedTemperatureConstraint;

View File

@ -54,8 +54,6 @@ solvers
SIMPLE
{
nNonOrthogonalCorrectors 0;
pMinFactor 0.4;
pMaxFactor 1.5;
residualControl
{

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.1;
maxFactor 2;
}
// ************************************************************************* //

View File

@ -39,8 +39,6 @@ solvers
SIMPLE
{
nNonOrthogonalCorrectors 0;
pMinFactor 0.1;
pMaxFactor 2;
transonic yes;
consistent yes;

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.1;
maxFactor 1.5;
}
// ************************************************************************* //

View File

@ -39,8 +39,6 @@ solvers
SIMPLE
{
nNonOrthogonalCorrectors 0;
pMinFactor 0.1;
pMaxFactor 1.5;
transonic no;
consistent no;

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.9;
maxFactor 1.5;
}
// ************************************************************************* //

View File

@ -90,9 +90,6 @@ PIMPLE
nCorrectors 3;
nNonOrthogonalCorrectors 0;
momentumPredictor yes;
pMaxFactor 1.5;
pMinFactor 0.9;
}
relaxationFactors

View File

@ -0,0 +1,25 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
minFactor 0.9;
maxFactor 1.5;
}
// ************************************************************************* //

View File

@ -69,9 +69,6 @@ PIMPLE
nNonOrthogonalCorrectors 0;
momentumPredictor yes;
pMaxFactor 1.5;
pMinFactor 0.9;
maxCo 2.5;
rDeltaTSmoothingCoeff 0.5;
alphaTemp 1;

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
min 1e4;
}
// ************************************************************************* //

View File

@ -70,8 +70,6 @@ PIMPLE
nOuterCorrectors 3;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pMin 1e4;
}
relaxationFactors

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
min 1e4;
}
// ************************************************************************* //

View File

@ -76,8 +76,6 @@ PIMPLE
nEnergyCorrectors 1;
faceMomentum yes;
pMin 1e4;
}
relaxationFactors

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
min 1e4;
}
// ************************************************************************* //

View File

@ -92,7 +92,6 @@ PIMPLE
faceMomentum yes;
pMin 1e4;
}
relaxationFactors

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
min 1e4;
}
// ************************************************************************* //

View File

@ -71,7 +71,6 @@ PIMPLE
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pMin 1e4;
}
relaxationFactors

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
min 1e4;
}
// ************************************************************************* //

View File

@ -81,7 +81,6 @@ PIMPLE
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pMin 1e4;
}
relaxationFactors

View File

@ -0,0 +1,24 @@
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object fvConstraints;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
limitp
{
type limitPressure;
min 1e4;
}
// ************************************************************************* //

Some files were not shown because too many files have changed in this diff Show More