117 #ifndef Foam_DEShybrid_H 118 #define Foam_DEShybrid_H 121 #include "surfaceInterpolate.H" 138 public surfaceInterpolationScheme<Type>,
139 public blendedSchemeBase<Type>
141 typedef GeometricField<Type, fvPatchField, volMesh> VolFieldType;
142 typedef GeometricField<Type, fvsPatchField, surfaceMesh> SurfaceFieldType;
186 void operator=(
const DEShybrid&) =
delete;
194 if (U0_.
value() <= 0)
197 <<
"U0 coefficient must be > 0. " 200 if (L0_.
value() <= 0)
203 <<
"L0 coefficient must be > 0. " 209 <<
"sigmaMin coefficient must be >= 0. " 215 <<
"sigmaMax coefficient must be >= 0. " 221 <<
"sigmaMin coefficient must be <= 1. " 227 <<
"sigmaMax coefficient must be <= 1. " 234 <<
" delta : " << deltaName_ <<
nl 235 <<
" CDES : " << CDES_ <<
nl 236 <<
" U0 : " << U0_.
value() <<
nl 237 <<
" L0 : " << L0_.
value() <<
nl 238 <<
" sigmaMin : " << sigmaMin_ <<
nl 239 <<
" sigmaMax : " << sigmaMax_ <<
nl 240 <<
" OmegaLim : " << OmegaLim_ <<
nl 241 <<
" nutLim : " << nutLim_ <<
nl 242 <<
" CH1 : " << CH1_ <<
nl 243 <<
" CH2 : " << CH2_ <<
nl 244 <<
" CH3 : " << CH3_ <<
nl 245 <<
" Cs : " << Cs_ <<
nl 254 const VolFieldType& vf,
268 CH3_*Omega*
max(S, Omega)
282 /(
pow(0.09, 1.5)*tK),
292 CDES_*
delta/
max(tlTurb*tg, SMALL*L0_) - 0.5
326 auto& factor = *factorPtr;
328 factor =
max(sigmaMax_*
tanh(
pow(
A, CH1_)), sigmaMin_);
332 vf.name() +
"BlendingFactor",
346 vf.name() +
"BlendingFactor",
364 DEShybrid(
const fvMesh&
mesh, Istream& is)
370 CDES_(readScalar(is)),
373 sigmaMin_(readScalar(is)),
374 sigmaMax_(readScalar(is)),
375 OmegaLim_(readScalar(is)),
376 nutLim_(readScalarOrDefault(is, scalar(1))),
403 CDES_(readScalar(is)),
406 sigmaMin_(readScalar(is)),
407 sigmaMax_(readScalar(is)),
408 OmegaLim_(readScalar(is)),
409 nutLim_(readScalarOrDefault(is, scalar(1))),
434 const auto* modelPtr =
442 const auto& model = *modelPtr;
444 return calcBlendingFactor
446 vf, model.nut(), model.nu(), model.U(),
delta 451 <<
"Scheme requires a turbulence model to be present. " 452 <<
"Unable to retrieve turbulence model from the mesh " 460 tmp<surfaceScalarField>
weights(
const VolFieldType& vf)
const 465 (scalar(1) - bf)*tScheme1_().weights(vf)
466 + bf*tScheme2_().weights(vf);
477 (scalar(1) - bf)*tScheme1_().interpolate(vf)
478 + bf*tScheme2_().interpolate(vf);
485 return tScheme1_().corrected() || tScheme2_().corrected();
491 virtual tmp<SurfaceFieldType>
correction(
const VolFieldType& vf)
const
dimensionedScalar tanh(const dimensionedScalar &ds)
const Type & value() const noexcept
Return const reference to value.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const Type & lookupObject(const word &name, const bool recursive=false) const
Lookup and return const reference to the object of the given Type. Fatal if not found or the wrong ty...
Improved hybrid convection scheme of Travin et al. for hybrid RAS/LES calculations with enhanced Grey...
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedTensor skew(const dimensionedTensor &dt)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
surfaceInterpolationScheme(const fvMesh &mesh)
Construct from mesh.
TypeName("DEShybrid")
Runtime type information.
dimensionedScalar sqrt(const dimensionedScalar &ds)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
bool store()
Register object with its registry and transfer ownership to the registry.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
const fvMesh & mesh() const
Return mesh reference.
const Time & time() const
Return the top-level database.
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Abstract base class for turbulence models (RAS, LES and laminar).
tmp< surfaceScalarField > weights(const VolFieldType &vf) const
Return the interpolation weighting factors.
GeometricField< scalar, fvPatchField, volMesh > volScalarField
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
static word scopedName(const std::string &scope, const word &name)
Create scope:name or scope_name string.
virtual tmp< surfaceScalarField > blendingFactor(const GeometricField< Type, fvPatchField, volMesh > &vf) const
Return the face-based blending factor.
Calculate the gradient of the given field.
static const word propertiesName
Default name of the turbulence properties dictionary.
A class for handling words, derived from Foam::string.
static tmp< surfaceInterpolationScheme< Type > > New(const fvMesh &mesh, Istream &schemeData)
Return new tmp interpolation scheme.
Type * getObjectPtr(const word &name, const bool recursive=false) const
Return non-const pointer to the object of the given Type, using a const-cast to have it behave like a...
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
static word timeName(const scalar t, const int precision=precision_)
Return time name of given scalar time formatted with the given precision.
int debug
Static debugging option.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &tvf, const surfaceScalarField &faceFlux, Istream &schemeData)
Interpolate field onto faces using scheme given by Istream.
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
virtual tmp< SurfaceFieldType > correction(const VolFieldType &vf) const
Return the explicit correction to the face-interpolate for the given field.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensioned< scalar > dimensionedScalar
Dimensioned scalar obtained from generic dimensioned type.
Mesh data needed to do the Finite Volume discretisation.
dimensionedScalar pow4(const dimensionedScalar &ds)
const dimensionSet dimTime(0, 0, 1, 0, 0, 0, 0)
messageStream Info
Information stream (stdout output on master, null elsewhere)
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
Defines the attributes of an object for which implicit objectRegistry management is supported...
tmp< SurfaceFieldType > interpolate(const VolFieldType &vf) const
Return the face-interpolate of the given cell field with explicit correction.
static constexpr const zero Zero
Global zero (0)