diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.C b/src/functionObjects/field/turbulenceFields/turbulenceFields.C index b8bf12f982..aa519db3f9 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFields.C +++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2013-2016 OpenFOAM Foundation - Copyright (C) 2015-2021 OpenCFD Ltd. + Copyright (C) 2015-2022 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -29,6 +29,7 @@ License #include "turbulenceFields.H" #include "turbulentTransportModel.H" #include "turbulentFluidThermoModel.H" +#include "DESModelBase.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -60,6 +61,8 @@ Foam::functionObjects::turbulenceFields::compressibleFieldNames_ { compressibleField::cfDevRhoReff, "devRhoReff" }, { compressibleField::cfL, "L" }, { compressibleField::cfI, "I" }, + { compressibleField::cfLESRegion, "LESRegion" }, + { compressibleField::cffd, "fd" }, }); @@ -79,6 +82,8 @@ Foam::functionObjects::turbulenceFields::incompressibleFieldNames_ { incompressibleField::ifDevReff, "devReff" }, { incompressibleField::ifL, "L" }, { incompressibleField::ifI, "I" }, + { incompressibleField::ifLESRegion, "LESRegion" }, + { incompressibleField::iffd, "fd" }, }); @@ -267,6 +272,36 @@ bool Foam::functionObjects::turbulenceFields::execute() processField(f, I(model)); break; } + case cfLESRegion: + { + auto* DESPtr = mesh_.cfindObject(modelName_); + if (!DESPtr) + { + WarningInFunction + << "Turbulence model is not a DES model - " + << "skipping request for LESRegion" << endl; + + break; + } + + processField(f, DESPtr->LESRegion()); + break; + } + case cffd: + { + auto* DESPtr = mesh_.cfindObject(modelName_); + if (!DESPtr) + { + WarningInFunction + << "Turbulence model is not a DES model - " + << "skipping request for fd" << endl; + + break; + } + + processField(f, DESPtr->fd()); + break; + } default: { FatalErrorInFunction @@ -334,6 +369,36 @@ bool Foam::functionObjects::turbulenceFields::execute() processField(f, I(model)); break; } + case ifLESRegion: + { + auto* DESPtr = mesh_.cfindObject(modelName_); + if (!DESPtr) + { + WarningInFunction + << "Turbulence model is not a DES model - " + << "skipping request for LESRegion" << endl; + + break; + } + + processField(f, DESPtr->LESRegion()); + break; + } + case iffd: + { + auto* DESPtr = mesh_.cfindObject(modelName_); + if (!DESPtr) + { + WarningInFunction + << "Turbulence model is not a DES model - " + << "skipping request for fd" << endl; + + break; + } + + processField(f, DESPtr->fd()); + break; + } default: { FatalErrorInFunction diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.H b/src/functionObjects/field/turbulenceFields/turbulenceFields.H index de483bfa3c..9061a63595 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFields.H +++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.H @@ -182,7 +182,9 @@ public: cfR, //!< "Reynolds stress tensor" cfDevRhoReff, //!< "Divergence of the Reynolds stress" cfL, //!< "Integral-length/Mixing-length scale" - cfI //!< "Turbulence intensity" + cfI, //!< "Turbulence intensity" + cfLESRegion, //!< "DES model LES region indicator field" + cffd //!< "DES model shielding function" }; //- Names for compressibleField turbulence fields @@ -200,7 +202,9 @@ public: ifR, //!< "Reynolds stress tensor" ifDevReff, //!< "Deviatoric part of the effective Reynolds stress" ifL, //!< "Integral-length/Mixing-length scale" - ifI //!< "Turbulence intensity" + ifI, //!< "Turbulence intensity" + ifLESRegion, //!< "DES model LES region indicator field" + iffd //!< "DES model shielding function" }; //- Names for incompressibleField turbulence fields