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 "
48 << fv::gaussConvectionScheme<Type>::typeName
54 const fv::gaussConvectionScheme<Type>& gcs =
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 =
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 =
117 calcBlendingFactor(
field, bcs.scheme());
121 const fv::gaussConvectionScheme<Type>& gcs =
124 calcBlendingFactor(
field, gcs);
word resultName_
Name of result field.
ObjectType & lookupObjectRef(const word &fieldName) const
Lookup and return object (eg, a field) from the (sub) objectRegistry.
static tmp< convectionScheme< Type > > New(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &schemeData)
Return a pointer to a new convectionScheme created on freestore.
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)
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.