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:
@ -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;
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,12 @@ volScalarField p_rgh
|
|||||||
|
|
||||||
label pRefCell = 0;
|
label pRefCell = 0;
|
||||||
scalar pRefValue = 0.0;
|
scalar pRefValue = 0.0;
|
||||||
|
if (fluid.incompressible())
|
||||||
|
{
|
||||||
|
p = max(p_rgh + fluid.rho()*gh, pMin);
|
||||||
|
|
||||||
|
if (p_rgh.needReference())
|
||||||
|
{
|
||||||
setRefCell
|
setRefCell
|
||||||
(
|
(
|
||||||
p,
|
p,
|
||||||
@ -46,6 +52,16 @@ setRefCell
|
|||||||
pRefCell,
|
pRefCell,
|
||||||
pRefValue
|
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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,12 @@ volScalarField p_rgh
|
|||||||
|
|
||||||
label pRefCell = 0;
|
label pRefCell = 0;
|
||||||
scalar pRefValue = 0.0;
|
scalar pRefValue = 0.0;
|
||||||
|
if (fluid.incompressible())
|
||||||
|
{
|
||||||
|
p = max(p_rgh + fluid.rho()*gh, pMin);
|
||||||
|
|
||||||
|
if (p_rgh.needReference())
|
||||||
|
{
|
||||||
setRefCell
|
setRefCell
|
||||||
(
|
(
|
||||||
p,
|
p,
|
||||||
@ -45,6 +51,16 @@ setRefCell
|
|||||||
pRefCell,
|
pRefCell,
|
||||||
pRefValue
|
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;
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user