ENH: yPlus: add option to disable wall function contributions (#1773)
Summary
See the self-explanatory commit messages.
Resolved bugs (If applicable)
#1773
Details of new models (If applicable)
Small test cases: GL1773-pre-fix.zip vs GL1773-post-fix
Test-case characteristics:
- One-dimensional smooth-wall plane channel flow, ReTau=5200
- Number of cells = 20
- nu = 0.000192827 [m2/s]
- The case was designed to produce => -1*sqrt(mag(wallShearStress)) = 1
- The y1+ set (expected) = {0.05, 0.5, 1, 5, 10, 20, 30, 50, 100,
1000} - kOmegaSST/SpalartAllmaras, simpleFoam
Main field of interest:
- mag(wallShearStress) function object returns ~ 1 for all test cases, therefore the expected y1+
- yPlus function object (min) results for
lowerWall
rounded up to 2 decimals:
y1+ = 0.05:
Wall function | Pre-fix yPlus | Post-fix yPlus (when useWallFunction=false ) |
---|---|---|
nutUWallFunction | 0.12 | 0.05 |
nutkWallFunction | 0.00025 | 0.05 |
nutUSpaldingWallFunction | 0.05 | 0.05 |
nutUBlendedWallFunction | 0.05 | 0.05 |
nutLowReWallFunction | 0.05 | 0.05 |
y1+ = 0.5:
Wall function | Pre-fix yPlus | Post-fix yPlus (when useWallFunction=false ) |
---|---|---|
nutUWallFunction | 0.18 | 0.50 |
nutkWallFunction | 0.025 | 0.50 |
nutUSpaldingWallFunction | 0.50 | 0.50 |
nutUBlendedWallFunction | 0.50 | 0.50 |
y1+ = 1:
Wall function | Pre-fix yPlus | Post-fix yPlus (when useWallFunction=false ) |
---|---|---|
nutUWallFunction | 0.34 | 1.00 |
nutkWallFunction | 0.1 | 1.00 |
nutUSpaldingWallFunction | 1.00 | 1.00 |
nutUBlendedWallFunction | 1.00 | 1.00 |
y1+ = 5:
Wall function | Pre-fix yPlus | Post-fix yPlus (when useWallFunction=false ) |
---|---|---|
nutUWallFunction | 3.02 | 5.00 |
nutkWallFunction | 2.75 | 5.00 |
nutUSpaldingWallFunction | 5.00 | 5.00 |
nutUBlendedWallFunction | 5.00 | 5.00 |
y1+ = 10:
Wall function | Pre-fix yPlus | Post-fix yPlus (when useWallFunction=false ) |
---|---|---|
nutUWallFunction | 9.12 | 10.00 |
nutkWallFunction | 8.31 | 10.00 |
nutUSpaldingWallFunction | 10.00 | 10.00 |
nutUBlendedWallFunction | 10.00 | 10.00 |
y1+ = 20:
Wall function | Pre-fix yPlus | Post-fix yPlus (when useWallFunction=false ) |
---|---|---|
nutUWallFunction | 20.00 | 20.02 |
nutkWallFunction | 19.30 | 20.01 |
nutUSpaldingWallFunction | 20.00 | 20.00 |
nutUBlendedWallFunction | 20.00 | 20.01 |
y1+ = 30:
Wall function | Pre-fix yPlus | Post-fix yPlus (when useWallFunction=false ) |
---|---|---|
nutUWallFunction | 30.09 | 30.09 |
nutkWallFunction | 29.91 | 30.12 |
nutUSpaldingWallFunction | 30.08 | 30.08 |
nutUBlendedWallFunction | 30.09 | 30.09 |
y1+ = 50:
Wall function | Pre-fix yPlus | Post-fix yPlus (when useWallFunction=false ) |
---|---|---|
nutUWallFunction | 50.16 | 50.16 |
nutkWallFunction | 50.51 | 50.19 |
nutUSpaldingWallFunction | 50.17 | 50.17 |
nutUBlendedWallFunction | 50.16 | 50.16 |
y1+ = 100:
Wall function | Pre-fix yPlus | Post-fix yPlus (when useWallFunction=false ) |
---|---|---|
nutUWallFunction | 100.01 | 100.01 |
nutkWallFunction | 100.96 | 100.01 |
nutUSpaldingWallFunction | 100.01 | 100.01 |
nutUBlendedWallFunction | 100.01 | 100.01 |
Risks
- Compiled with Gcc-7.4.1/Clang-9.0, DPInt32Opt
- No regression issue: 1-pre-fix-yPlus.zip vs 2-post-fix-yPlus.zip (Test:
incompressible/pisoFoam/RAS/cavity
) - No changes in the default behaviour.
- User can now select the new behaviour by
useWallFunction=false
which is by defaulttrue
.
- User can now select the new behaviour by
Merge request reports
Activity
changed milestone to %v2012
added bug enhancement integration: openfoam.org labels
I think there is no issue in the prediction performance of nutU and nutk wall functions in the y+ < 10 range. The predictions made by the modified
yPlus
FO for the same flow field prove this.The problem is the
yPlus
prediction functions inside these wall functions:For example, say
nutkWallFunction
:In
calcNut()
:const scalar yPlus = Cmu25*y[facei]*sqrt(k[celli])/nuw[facei];
is computed and used only for the log region with respect toyPlusLam_
.But, when
Foam::tmp<Foam::scalarField> Foam::nutkWallFunctionFvPatchScalarField::yPlus()
is invoked,yPlus()
returnspow025(Cmu_)*y*sqrt(kwc)/nuw;
irrespective ofyPlusLam_
, hence irrational yPlus predictions for the viscous sublayer.Potential solution-1: Introduce
yPlusLam_
branching/blending intoyPlus()
, which already exists incalcNut()
funcs viablend()
func.Potential solution-2: Deprecate wall functions'
yPlus
functions in favour of the official y+ definition (y+=y*utau/nu) since i) the definitions do/will not match with the correct definition of y+ ii) blending approaches will makeyPlusLam_
branching complex.Edited by Kutalmış Berçin- Resolved by Kutalmış Berçin
mentioned in issue #1838 (closed)
The issue has been revealed more severe and involved than expected at the submission of this merge request.
To devise and provide a more generic solution, this minimal-extent merge request is now closed, so that all necessary changes from all relevant parties can be reviewed under a single merge request.
Please keep an eye on (or if already submitted at the time of your reading, navigate to) the oncoming merge request.
Edited by Kutalmış Berçin