reacting*EulerFoam: Added pressure referencing for incompressible phase systems

Patch contributed by Institute of Fluid Dynamics,
Helmholtz-Zentrum Dresden - Rossendorf (HZDR)
This commit is contained in:
Will Bainbridge
2020-02-10 13:42:25 +00:00
parent 3d70311c21
commit c829ae0cfc
9 changed files with 130 additions and 19 deletions

View File

@ -407,6 +407,20 @@ Foam::PtrList<Foam::volScalarField> Foam::phaseSystem::dmdts() const
} }
bool Foam::phaseSystem::incompressible() const
{
forAll(phaseModels_, phasei)
{
if (!phaseModels_[phasei].incompressible())
{
return false;
}
}
return true;
}
bool Foam::phaseSystem::implicitPhasePressure(const phaseModel& phase) const bool Foam::phaseSystem::implicitPhasePressure(const phaseModel& phase) const
{ {
return false; return false;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2015-2019 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -421,6 +421,9 @@ public:
//- Return the mass transfer rates for each phase //- Return the mass transfer rates for each phase
virtual PtrList<volScalarField> dmdts() const; virtual PtrList<volScalarField> dmdts() const;
//- Return incompressibility
bool incompressible() const;
// Transfers // Transfers

View File

@ -38,14 +38,30 @@ volScalarField p_rgh
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell if (fluid.incompressible())
( {
p, p = max(p_rgh + fluid.rho()*gh, pMin);
p_rgh,
pimple.dict(), if (p_rgh.needReference())
pRefCell, {
pRefValue setRefCell
); (
p,
p_rgh,
pimple.dict(),
pRefCell,
pRefValue
);
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
p_rgh = p - fluid.rho()*gh;
}
}
mesh.setFluxRequired(p_rgh.name()); mesh.setFluxRequired(p_rgh.name());
PtrList<volScalarField> rAUs; PtrList<volScalarField> rAUs;

View File

@ -335,6 +335,11 @@ while (pimple.correct())
pEqn += pEqnComps[phasei]; pEqn += pEqnComps[phasei];
} }
if (fluid.incompressible())
{
pEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
}
pEqn.solve(); pEqn.solve();
} }
@ -393,6 +398,17 @@ while (pimple.correct())
// Update and limit the static pressure // Update and limit the static pressure
p = max(p_rgh + rho*gh, pMin); p = max(p_rgh + rho*gh, pMin);
// Account for static pressure reference
if (p_rgh.needReference() && fluid.incompressible())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
// Limit p_rgh // Limit p_rgh
p_rgh = p - rho*gh; p_rgh = p - rho*gh;

View File

@ -324,6 +324,11 @@ while (pimple.correct())
pEqn += pEqnComps[phasei]; pEqn += pEqnComps[phasei];
} }
if (fluid.incompressible())
{
pEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
}
pEqn.solve(); pEqn.solve();
} }
@ -370,6 +375,17 @@ while (pimple.correct())
// Update and limit the static pressure // Update and limit the static pressure
p = max(p_rgh + rho*gh, pMin); p = max(p_rgh + rho*gh, pMin);
// Account for static pressure reference
if (p_rgh.needReference() && fluid.incompressible())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
// Limit p_rgh // Limit p_rgh
p_rgh = p - rho*gh; p_rgh = p - rho*gh;

View File

@ -37,14 +37,30 @@ volScalarField p_rgh
label pRefCell = 0; label pRefCell = 0;
scalar pRefValue = 0.0; scalar pRefValue = 0.0;
setRefCell if (fluid.incompressible())
( {
p, p = max(p_rgh + fluid.rho()*gh, pMin);
p_rgh,
pimple.dict(), if (p_rgh.needReference())
pRefCell, {
pRefValue setRefCell
); (
p,
p_rgh,
pimple.dict(),
pRefCell,
pRefValue
);
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
p_rgh = p - fluid.rho()*gh;
}
}
mesh.setFluxRequired(p_rgh.name()); mesh.setFluxRequired(p_rgh.name());
PtrList<volScalarField> rAUs; PtrList<volScalarField> rAUs;

View File

@ -286,6 +286,11 @@ while (pimple.correct())
- fvm::laplacian(rAUf, p_rgh) - fvm::laplacian(rAUf, p_rgh)
); );
if (fluid.incompressible())
{
pEqnIncomp.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
}
// Solve // Solve
solve(pEqnIncomp + pEqnComp1 + pEqnComp2); solve(pEqnIncomp + pEqnComp1 + pEqnComp2);
@ -365,6 +370,17 @@ while (pimple.correct())
// Update and limit the static pressure // Update and limit the static pressure
p = max(p_rgh + rho*gh, pMin); p = max(p_rgh + rho*gh, pMin);
// Account for static pressure reference
if (p_rgh.needReference() && fluid.incompressible())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
// Limit p_rgh // Limit p_rgh
p_rgh = p - rho*gh; p_rgh = p - rho*gh;

View File

@ -298,6 +298,11 @@ while (pimple.correct())
- fvm::laplacian(rAUf, p_rgh) - fvm::laplacian(rAUf, p_rgh)
); );
if (fluid.incompressible())
{
pEqnIncomp.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
}
// Solve // Solve
solve(pEqnIncomp + pEqnComp1 + pEqnComp2); solve(pEqnIncomp + pEqnComp1 + pEqnComp2);
@ -347,6 +352,17 @@ while (pimple.correct())
// Update and limit the static pressure // Update and limit the static pressure
p = max(p_rgh + rho*gh, pMin); p = max(p_rgh + rho*gh, pMin);
// Account for static pressure reference
if (p_rgh.needReference() && fluid.incompressible())
{
p += dimensionedScalar
(
"p",
p.dimensions(),
pRefValue - getRefCellValue(p, pRefCell)
);
}
// Limit p_rgh // Limit p_rgh
p_rgh = p - rho*gh; p_rgh = p - rho*gh;

View File

@ -61,8 +61,6 @@ PIMPLE
nOuterCorrectors 3; nOuterCorrectors 3;
nCorrectors 1; nCorrectors 1;
nNonOrthogonalCorrectors 0; nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 1e5;
partialElimination true; partialElimination true;
} }