From 55f287cd83e5df1573c64e04e0a12fcf304d8f4a Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 16 Mar 2022 15:57:31 +0100 Subject: [PATCH] ENH: limitVelocity, report count and percent of cells/faces (#2414) - percent of cells is taken relative to selection size. - percent of faces is taken relative to the number of boundary faces that do not fix velocity themselves. ENH: avoid correctBoundaryConditions() if values were not limited --- .../corrections/limitVelocity/limitVelocity.C | 47 ++++++++++--- .../velocityDampingConstraint.C | 17 +++-- .../limitTemperature/limitTemperature.C | 66 ++++++++++++------- .../corrections/limitVelocity/limitVelocity.C | 63 +++++++++++++++--- 4 files changed, 149 insertions(+), 44 deletions(-) diff --git a/src/faOptions/corrections/limitVelocity/limitVelocity.C b/src/faOptions/corrections/limitVelocity/limitVelocity.C index 8fbb5756c0..186205ce64 100644 --- a/src/faOptions/corrections/limitVelocity/limitVelocity.C +++ b/src/faOptions/corrections/limitVelocity/limitVelocity.C @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2021 OpenCFD Ltd. + Copyright (C) 2021-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -83,41 +83,70 @@ void Foam::fa::limitVelocity::correct(areaVectorField& U) { const scalar maxSqrU = sqr(max_); + // Count nTotFaces ourselves + // (maybe only applying on a subset) + label nFacesAbove(0); + const label nTotFaces(returnReduce(faces_.size(), sumOp