84#ifndef Foam_zoneBlended_H
85#define Foam_zoneBlended_H
89#include "surfaceInterpolate.H"
104 public surfaceInterpolationScheme<Type>,
137 const surfaceInterpolationScheme<Type>& scheme
142 return schemePtrs_[schemei]();
146 template<
class FieldType>
147 void setFaceZoneValues
150 const FieldType& src,
155 template<
class FieldType>
156 void zeroFaceZoneValues(FieldType& dest,
const faceZone& fz)
const;
159 zoneBlended(
const zoneBlended&) =
delete;
162 void operator=(
const zoneBlended&) =
delete;
178 surfaceInterpolationScheme<Type>(
mesh),
197 surfaceInterpolationScheme<Type>(
mesh),
213 const VolumeField& vf
218 auto& bf = tbf.ref();
219 auto& bbf = bf.boundaryFieldRef();
222 const auto&
pbm =
mesh.boundaryMesh();
223 const auto& zones =
mesh.faceZones();
226 for (label zonei=1; zonei<zoneNames_.size(); ++zonei)
228 const word&
name = zoneNames_[zonei];
229 const auto& fz = zones[
name];
231 for (
const label facei : fz)
233 if (
mesh.isInternalFace(facei))
240 auto& pbf = bbf[pf.
first()];
254 tmp<surfaceScalarField>
weights(
const VolumeField& vf)
const
256 const auto&
mesh = vf.mesh();
259 auto&
weights = tweights.ref();
262 weights = this->scheme(0).weights(vf);
265 const auto& zones =
mesh.faceZones();
267 for (label schemei=1; schemei<schemePtrs_.size(); ++schemei)
269 const auto& scheme = this->scheme(schemei);
271 auto tschemeWeights = scheme.weights(vf);
272 const auto& schemeWeights = tschemeWeights();
273 const auto& fz = zones[zoneNames_[schemei]];
275 setFaceZoneValues(
weights, schemeWeights, fz);
309 const auto&
mesh = vf.mesh();
312 auto& corr = tcorr.ref();
316 const auto& scheme0 = this->scheme(0);
317 if (scheme0.corrected())
319 corr = scheme0.correction(vf);
323 if (schemePtrs_.
size() == 1)
return tcorr;
326 const auto& zones =
mesh.faceZones();
328 for (label schemei=1; schemei<schemePtrs_.size(); ++schemei)
330 const auto& scheme = this->scheme(schemei);
332 if (scheme.corrected())
334 auto tschemeCorr = scheme.correction(vf);
335 const auto& schemeCorr = tschemeCorr();
336 const auto& fz = zones[zoneNames_[schemei]];
338 setFaceZoneValues(corr, schemeCorr, fz);
342 if (scheme0.corrected())
345 const auto& fz = zones[zoneNames_[schemei]];
346 zeroFaceZoneValues(corr, fz);
const polyBoundaryMesh & pbm
const Mesh & mesh() const noexcept
Return const reference to mesh.
const dimensionSet & dimensions() const noexcept
Return dimensions.
Generic GeometricField class.
static tmp< GeometricField< scalar, fvsPatchField, surfaceMesh > > New(const word &name, IOobjectOption::registerOption regOpt, const Mesh &mesh, const dimensionSet &dims, const word &patchFieldType=fvsPatchField< scalar >::calculatedType())
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const T & first() const noexcept
Access the first element.
const T & second() const noexcept
Access the second element.
void size(const label n)
Older name for setAddressableSize.
blendedSchemeBase()=default
Constructor.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A subset of mesh faces organised as a primitive patch.
Mesh data needed to do the Finite Volume discretisation.
static tmp< GeometricField< Type, fvsPatchField, surfaceMesh > > interpolate(const GeometricField< Type, fvPatchField, volMesh > &, const tmp< surfaceScalarField > &, const tmp< surfaceScalarField > &)
Return the face-interpolate of the given cell field.
const fvMesh & mesh() const
Return mesh reference.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
Multi-faceZone based blending differencing scheme.
virtual bool corrected() const
Return true if this scheme uses an explicit correction.
tmp< surfaceScalarField > weights(const VolumeField &vf) const
Return the interpolation weighting factors.
zoneBlended(const fvMesh &mesh, Istream &is)
Construct from mesh and Istream.
TypeName("zoneBlended")
Runtime type information.
tmp< SurfaceField > interpolate(const VolumeField &vf) const
Return the face-interpolate of the given cell field.
zoneBlended(const fvMesh &mesh, const surfaceScalarField &faceFlux, Istream &is)
Construct from mesh, faceFlux and Istream.
virtual tmp< SurfaceField > correction(const VolumeField &vf) const
Return the explicit correction to the face-interpolate for the given field.
virtual tmp< surfaceScalarField > blendingFactor(const VolumeField &vf) const
Return the face-based blending factor.
Pair< label > labelPair
A pair of labels.
List< word > wordList
List of word.
const dimensionSet dimless
Dimensionless.
GeometricField< Type, fvPatchField, volMesh > VolumeField
A volume field for a given type.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.