Commit d0737242 authored by Sergio Ferraris's avatar Sergio Ferraris

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.
parent d3d03de4
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2019 OpenFOAM Foundation Copyright (C) 2013-2019 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -704,7 +705,7 @@ void Foam::multiphaseSystem::solve() ...@@ -704,7 +705,7 @@ void Foam::multiphaseSystem::solve()
phase.alphaRhoPhiRef() = phase.alphaRhoPhiRef() =
fvc::interpolate(phase.rho())*phase.alphaPhi(); fvc::interpolate(phase.rho())*phase.alphaPhi();
phase.clip(0, 1); phase.clip(SMALL, 1 - SMALL);
} }
calcAlphas(); calcAlphas();
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2013-2018 OpenFOAM Foundation Copyright (C) 2013-2018 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
...@@ -339,7 +340,7 @@ void Foam::twoPhaseSystem::solve() ...@@ -339,7 +340,7 @@ void Foam::twoPhaseSystem::solve()
<< endl; << endl;
// Ensure the phase-fractions are bounded // Ensure the phase-fractions are bounded
alpha1.clip(0, 1); alpha1.clip(SMALL, 1 - SMALL);
// Update the phase-fraction of the other phase // Update the phase-fraction of the other phase
alpha2 = scalar(1) - alpha1; alpha2 = scalar(1) - alpha1;
......
  • Hi,

    I think this limitation should be moved to the turbulence models themselves and not affect the alpha-U-p loop causing mass loss (see implementation of the kinetic theory, where this is done too). The scheme should enforce positivity and boundedness, so it is better to clip when using the value than accumulating the error in the alpha-U-p loop.

    Best, Alberto

    Edited by Alberto Passalacqua
  • Hi, Yes, you are correct , that was my first intention. But I was not convinced to change the behavior of all the turbulence models used in single phase (i.e kEpsilon, etc, etc). Thanks Sergio

  • Hi Sergio,

    that's a good point indeed, since alpha is, unfortunately, carried over to single-phase models. I guess it's another reason to split multiphase turbulence out of single-phase implementation on the long run...

    Thanks, Alberto

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