Commit 82ed8758 authored by Henry Weller's avatar Henry Weller Committed by Andrew Heather
Browse files

reactingMultiphaseEulerFoam: Limited phase-fractions

for consistency with reactingTwoPhaseEulerFoam and to ensure correct operation
of models requiring formal boundedness of phase-fractions.

Resolves bug-report https://bugs.openfoam.org/view.php?id=2589
parent e67525ce
......@@ -699,6 +699,9 @@ void Foam::multiphaseSystem::solve()
{
phaseModel& phase = phases()[phasei];
phase.alphaRhoPhi() = fvc::interpolate(phase.rho())*phase.alphaPhi();
// Ensure the phase-fractions are bounded
phase.maxMin(0, 1);
}
calcAlphas();
......
......@@ -403,8 +403,7 @@ void Foam::twoPhaseSystem::solve()
<< endl;
// Ensure the phase-fractions are bounded
alpha1.max(0);
alpha1.min(1);
alpha1.maxMin(0, 1);
// Update the phase-fraction of the other phase
alpha2 = scalar(1) - alpha1;
......
......@@ -1153,6 +1153,20 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::min
}
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::maxMin
(
const dimensioned<Type>& minDt,
const dimensioned<Type>& maxDt
)
{
Foam::max(primitiveFieldRef(), primitiveField(), minDt.value());
Foam::max(boundaryFieldRef(), boundaryField(), minDt.value());
Foam::min(primitiveFieldRef(), primitiveField(), maxDt.value());
Foam::min(boundaryFieldRef(), boundaryField(), maxDt.value());
}
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::GeometricField<Type, PatchField, GeoMesh>::negate()
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
......@@ -564,6 +564,12 @@ public:
void max(const dimensioned<Type>&);
void min(const dimensioned<Type>&);
void maxMin
(
const dimensioned<Type>& minDt,
const dimensioned<Type>& maxDt
);
void max
(
const GeometricField<Type, PatchField, GeoMesh>&,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment