From d073724232feba68254ad84357eadcc38b459975 Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 28 Jul 2020 12:22:09 -0700 Subject: [PATCH] BUG: Limiting min alpha to SMALL to avoid zero transient term of turbulence model In certain turbulence models such as kEpsilon, kOmegaSST, etc when used in the multiphase context throw an error in the preconditioner. This is due to alpha being zero. Fixes #1789. --- .../multiphaseSystem/multiphaseSystem.C | 3 ++- .../reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C index 7eec4c61b0..d66041e205 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingMultiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2019 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -704,7 +705,7 @@ void Foam::multiphaseSystem::solve() phase.alphaRhoPhiRef() = fvc::interpolate(phase.rho())*phase.alphaPhi(); - phase.clip(0, 1); + phase.clip(SMALL, 1 - SMALL); } calcAlphas(); diff --git a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C index be6aa9d40d..c52aae49ed 100644 --- a/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C +++ b/src/phaseSystemModels/reactingEulerFoam/reactingTwoPhaseEulerFoam/twoPhaseSystem/twoPhaseSystem.C @@ -6,6 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2018 OpenFOAM Foundation + Copyright (C) 2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -339,7 +340,7 @@ void Foam::twoPhaseSystem::solve() << endl; // Ensure the phase-fractions are bounded - alpha1.clip(0, 1); + alpha1.clip(SMALL, 1 - SMALL); // Update the phase-fraction of the other phase alpha2 = scalar(1) - alpha1; -- GitLab