38void Foam::functionObjects::blendingFactor::calcBlendingFactor
40 const GeometricField<Type, fvPatchField, volMesh>&
field,
41 const typename fv::convectionScheme<Type>& cs
44 if (!
isA<fv::gaussConvectionScheme<Type>>(cs))
47 <<
"Scheme for field " <<
field.name() <<
" is not a "
54 const fv::gaussConvectionScheme<Type>& gcs =
55 refCast<const fv::gaussConvectionScheme<Type>>(cs);
58 const surfaceInterpolationScheme<Type>& interpScheme = gcs.interpScheme();
60 if (!
isA<blendedSchemeBase<Type>>(interpScheme))
63 << interpScheme.type() <<
" is not a blended scheme"
70 const blendedSchemeBase<Type>& blendedScheme =
71 refCast<const blendedSchemeBase<Type>>(interpScheme);
77 auto& indicator = lookupObjectRef<volScalarField>(
resultName_);
79 if (
isA<DEShybrid<Type>>(blendedScheme))
88 indicator.correctBoundaryConditions();
93bool Foam::functionObjects::blendingFactor::calcScheme()
95 typedef GeometricField<Type, fvPatchField, volMesh> FieldType;
97 if (!foundObject<FieldType>(fieldName_,
false))
102 const FieldType&
field = lookupObject<FieldType>(fieldName_);
104 const word divScheme(
"div(" + phiName_ +
',' + fieldName_ +
')');
105 ITstream& its = mesh_.divScheme(divScheme);
109 tmp<fv::convectionScheme<Type>> tcs =
112 if (
isA<fv::boundedConvectionScheme<Type>>(tcs()))
114 const fv::boundedConvectionScheme<Type>& bcs =
115 refCast<const fv::boundedConvectionScheme<Type>>(tcs());
117 calcBlendingFactor(
field, bcs.scheme());
121 const fv::gaussConvectionScheme<Type>& gcs =
122 refCast<const fv::gaussConvectionScheme<Type>>(tcs());
124 calcBlendingFactor(
field, gcs);
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
word resultName_
Name of result field.
Construct a volume field from a surface field using a combine operator.
#define WarningInFunction
Report a warning using Foam::Warning.
tmp< GeometricField< Type, fvPatchField, volMesh > > cellReduce(const GeometricField< Type, fvsPatchField, surfaceMesh > &, const CombineOp &cop, const Type &nullValue=pTraits< Type >::zero)
const TargetType * isA(const Type &t)
Check if dynamic_cast to TargetType is possible.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Ostream & endl(Ostream &os)
Add newline and flush stream.
static const char *const typeName
The type name used in ensight case files.