From 8c424561ceca41e3df3f8c897ebd18bc434a60d3 Mon Sep 17 00:00:00 2001 From: Michael Alletto <> Date: Wed, 30 Mar 2022 11:54:58 +0100 Subject: [PATCH] BUG: nutUBlendedWallFunction: avoid pressure spikes (fixes #2299) --- .../nutUBlendedWallFunctionFvPatchScalarField.C | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.C index 38899885b4c..47bdfbbd558 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUBlendedWallFunction/nutUBlendedWallFunctionFvPatchScalarField.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2016-2020 OpenCFD Ltd. + Copyright (C) 2016-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -103,7 +103,8 @@ Foam::nutUBlendedWallFunctionFvPatchScalarField::calcUTau { const scalar yPlus = y[facei]*ut/nuw[facei]; const scalar uTauVis = magUp[facei]/yPlus; - const scalar uTauLog = kappa_*magUp[facei]/log(E_*yPlus); + const scalar uTauLog = + kappa_*magUp[facei]/log(max(E_*yPlus, 1 + 1e-4)); const scalar utNew = pow(pow(uTauVis, n_) + pow(uTauLog, n_), 1.0/n_); -- GitLab