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
This commit is contained in:
Henry Weller
2017-06-26 16:24:57 +01:00
parent 0f50efd333
commit 5caadae42b
4 changed files with 25 additions and 3 deletions

View File

@ -698,6 +698,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();

View File

@ -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;

View File

@ -1111,6 +1111,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()
{

View File

@ -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 |
-------------------------------------------------------------------------------
License
@ -557,6 +557,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>&,