ENH: yPlus: add a flag to enable/disable wall-function predictions

This commit is contained in:
Kutalmis Bercin
2021-07-16 16:04:03 +01:00
committed by Andrew Heather
parent 91439bb30d
commit f3d0db18bb
2 changed files with 29 additions and 7 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2016-2020 OpenCFD Ltd.
Copyright (C) 2016-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -70,7 +70,8 @@ Foam::functionObjects::yPlus::yPlus
)
:
fvMeshFunctionObject(name, runTime, dict),
writeFile(obr_, name, typeName, dict)
writeFile(obr_, name, typeName, dict),
useWallFunction_(true)
{
read(dict);
@ -101,10 +102,14 @@ Foam::functionObjects::yPlus::yPlus
bool Foam::functionObjects::yPlus::read(const dictionary& dict)
{
fvMeshFunctionObject::read(dict);
writeFile::read(dict);
if (fvMeshFunctionObject::read(dict) && writeFile::read(dict))
{
useWallFunction_ = dict.getOrDefault("useWallFunction", true);
return true;
return true;
}
return false;
}
@ -139,7 +144,11 @@ bool Foam::functionObjects::yPlus::execute()
{
const fvPatch& patch = patches[patchi];
if (isA<nutWallFunctionFvPatchScalarField>(nutBf[patchi]))
if
(
isA<nutWallFunctionFvPatchScalarField>(nutBf[patchi])
&& useWallFunction_
)
{
const nutWallFunctionFvPatchScalarField& nutPf =
dynamic_cast<const nutWallFunctionFvPatchScalarField&>

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2016 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd.
Copyright (C) 2015-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -50,6 +50,9 @@ Usage
type yPlus;
libs (fieldFunctionObjects);
// Optional entries
useWallFunction true;
// Optional (inherited) entries
...
}
@ -60,6 +63,10 @@ Usage
Property | Description | Type | Req'd | Dflt
type | Type name: yPlus | word | yes | -
libs | Library name: fieldFunctionObjects | word | yes | -
useWallFunction | Flag to use the local expressions of <!--
--> the selected nut wall function to compute yPlus, <!--
--> otherwise directly compute yPlus from flow field <!--
--> | bool | no | true
\endtable
The inherited entries are elaborated in:
@ -106,6 +113,12 @@ class yPlus
public fvMeshFunctionObject,
public writeFile
{
// Private Data
//- Flag to use the wall function expressions to compute yPlus
bool useWallFunction_;
// Private Member Functions
//- File header information