From 7bf7aaea915c530f41876d7589cf037a65df014c Mon Sep 17 00:00:00 2001 From: sergio Date: Tue, 19 Jun 2018 12:04:27 -0700 Subject: [PATCH] ENH: Further enhancements to stabilizationSchemes --- .../stabilityBlendingFactor.C | 87 +++++++++++-------- .../stabilityBlendingFactor.H | 3 + .../motorBike/system/stabilizationSchemes | 1 - 3 files changed, 56 insertions(+), 35 deletions(-) diff --git a/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C b/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C index d7c660adf0..12b05143bc 100644 --- a/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C +++ b/src/functionObjects/field/stabilityBlendingFactor/stabilityBlendingFactor.C @@ -48,6 +48,37 @@ namespace functionObjects // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +void Foam::functionObjects::stabilityBlendingFactor::calcStats +( + label& nCellsScheme1, + label& nCellsScheme2, + label& nCellsBlended +) const +{ + forAll(indicator_, celli) + { + scalar i = indicator_[celli]; + + if (i < tolerance_) + { + nCellsScheme2++; + } + else if (i > (1 - tolerance_)) + { + nCellsScheme1++; + } + else + { + nCellsBlended++; + } + } + + reduce(nCellsScheme1, sumOp