ENH: DES models - added access function for shielding function, fd

This commit is contained in:
Andrew Heather
2022-06-20 20:54:35 +01:00
parent 9557cde880
commit 7db69fc22e
13 changed files with 77 additions and 15 deletions

View File

@ -166,6 +166,25 @@ tmp<volScalarField> DESModel<BasicTurbulenceModel>::Ssigma
}
template<class BasicTurbulenceModel>
tmp<volScalarField> DESModel<BasicTurbulenceModel>::fd() const
{
return tmp<volScalarField>::New
(
IOobject
(
"fd",
this->mesh_.time().timeName(),
this->mesh_,
IOobject::NO_READ,
IOobject::NO_WRITE
),
this->mesh_,
dimensionedScalar(dimless, Zero)
);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels

View File

@ -120,7 +120,10 @@ public:
//- Return modified strain rate
// Note: uses Ctrans_ coefficient
tmp<volScalarField> Ssigma(const volTensorField& gradU) const;
virtual tmp<volScalarField> Ssigma(const volTensorField& gradU) const;
//- Return the shielding function
virtual tmp<volScalarField> fd() const;
};

View File

@ -23,16 +23,6 @@ License
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::DESModelBase
Description
Base class for DES models providing an interfaces to the LESRegion
function.
SourceFiles
DESModelBase.C
\*---------------------------------------------------------------------------*/
#include "DESModelBase.H"

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -28,8 +28,7 @@ Class
Foam::DESModelBase
Description
Base class for DES models providing an interfaces to the LESRegion
function.
Base class for DES models providing an interfaces to DES fields.
SourceFiles
DESModelBase.C
@ -70,6 +69,9 @@ public:
//- Return the LES field indicator
virtual tmp<volScalarField> LESRegion() const = 0;
//- Return the shielding function
virtual tmp<volScalarField> fd() const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -189,6 +189,13 @@ bool SpalartAllmarasDDES<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
tmp<volScalarField> SpalartAllmarasDDES<BasicTurbulenceModel>::fd() const
{
return fd(mag(fvc::grad(this->U_)));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels

View File

@ -147,6 +147,9 @@ public:
//- Read from dictionary
virtual bool read();
//- Return the shielding function
virtual tmp<volScalarField> fd() const;
};

View File

@ -236,6 +236,17 @@ bool SpalartAllmarasIDDES<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
tmp<volScalarField> SpalartAllmarasIDDES<BasicTurbulenceModel>::fd() const
{
const volScalarField alpha(this->alpha());
const volScalarField expTerm(exp(sqr(alpha)));
tmp<volScalarField> fB = min(2*pow(expTerm, -9.0), scalar(1));
return max(1 - fdt(mag(fvc::grad(this->U_))), fB);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels

View File

@ -153,6 +153,9 @@ public:
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the shielding function
virtual tmp<volScalarField> fd() const;
};

View File

@ -201,6 +201,13 @@ bool kOmegaSSTDDES<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
tmp<volScalarField> kOmegaSSTDDES<BasicTurbulenceModel>::fd() const
{
return fd(mag(fvc::grad(this->U_)));
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels

View File

@ -157,6 +157,9 @@ public:
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the shielding function
virtual tmp<volScalarField> fd() const;
};

View File

@ -93,7 +93,7 @@ protected:
dimensionedScalar kappa_;
//- DES coefficients
//- DES coefficients
dimensionedScalar CDESkom_;
dimensionedScalar CDESkeps_;

View File

@ -231,6 +231,17 @@ bool kOmegaSSTIDDES<BasicTurbulenceModel>::read()
}
template<class BasicTurbulenceModel>
tmp<volScalarField> kOmegaSSTIDDES<BasicTurbulenceModel>::fd() const
{
const volScalarField alpha(this->alpha());
const volScalarField expTerm(exp(sqr(alpha)));
tmp<volScalarField> fB = min(2*pow(expTerm, -9.0), scalar(1));
return max(1 - fdt(mag(fvc::grad(this->U_))), fB);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace LESModels

View File

@ -149,6 +149,9 @@ public:
//- Re-read model coefficients if they have changed
virtual bool read();
//- Return the shielding function
virtual tmp<volScalarField> fd() const;
};