45Foam::basicFvGeometryScheme::basicFvGeometryScheme
63 Pout<<
"basicFvGeometryScheme::movePoints() : "
64 <<
"recalculating primitiveMesh centres" <<
endl;
76 Pout<<
"basicFvGeometryScheme::weights() : "
77 <<
"Constructing weighting factors for face interpolation"
87 mesh_.pointsInstance(),
97 auto& weights = tweights.ref();
98 weights.setOriented();
105 const labelUList& neighbour = mesh_.neighbour();
121 scalar SfdOwn =
mag(Sf[facei] & (Cf[facei] -
C[owner[facei]]));
122 scalar SfdNei =
mag(Sf[facei] & (
C[neighbour[facei]] - Cf[facei]));
124 if (
mag(SfdOwn + SfdNei) > ROOTVSMALL)
126 w[facei] = SfdNei/(SfdOwn + SfdNei);
134 auto& wBf = weights.boundaryFieldRef();
136 forAll(mesh_.boundary(), patchi)
138 mesh_.boundary()[patchi].makeWeights(wBf[patchi]);
143 Pout<<
"basicFvGeometryScheme::weights : "
144 <<
"Finished constructing weighting factors for face interpolation"
156 Pout<<
"basicFvGeometryScheme::deltaCoeffs() : "
157 <<
"Constructing differencing factors array for face gradient"
163 (void)mesh_.weights();
171 mesh_.pointsInstance(),
181 auto& deltaCoeffs = tdeltaCoeffs.ref();
182 deltaCoeffs.setOriented();
188 const labelUList& neighbour = mesh_.neighbour();
192 deltaCoeffs[facei] = 1.0/
mag(
C[neighbour[facei]] -
C[owner[facei]]);
195 auto& deltaCoeffsBf = deltaCoeffs.boundaryFieldRef();
197 forAll(deltaCoeffsBf, patchi)
199 const fvPatch&
p = mesh_.boundary()[patchi];
200 deltaCoeffsBf[patchi] = 1.0/
mag(
p.delta());
203 p.makeDeltaCoeffs(deltaCoeffsBf[patchi]);
215 Pout<<
"basicFvGeometryScheme::nonOrthDeltaCoeffs() : "
216 <<
"Constructing differencing factors array for face gradient"
224 auto tnonOrthDeltaCoeffs =
229 "nonOrthDeltaCoeffs",
230 mesh_.pointsInstance(),
240 auto& nonOrthDeltaCoeffs = tnonOrthDeltaCoeffs.ref();
241 nonOrthDeltaCoeffs.setOriented();
247 const labelUList& neighbour = mesh_.neighbour();
254 vector unitArea = Sf[facei]/magSf[facei];
269 auto& nonOrthDeltaCoeffsBf = nonOrthDeltaCoeffs.boundaryFieldRef();
271 forAll(nonOrthDeltaCoeffsBf, patchi)
275 const fvPatch&
p = patchDeltaCoeffs.patch();
277 const vectorField patchDeltas(mesh_.boundary()[patchi].delta());
282 Sf.boundaryField()[patchi][patchFacei]
283 /magSf.boundaryField()[patchi][patchFacei];
287 patchDeltaCoeffs[patchFacei] =
292 p.makeNonOrthoDeltaCoeffs(patchDeltaCoeffs);
294 return tnonOrthDeltaCoeffs;
303 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
304 <<
"Constructing non-orthogonal correction vectors"
308 auto tnonOrthCorrectionVectors =
313 "nonOrthCorrectionVectors",
314 mesh_.pointsInstance(),
324 auto& corrVecs = tnonOrthCorrectionVectors.ref();
325 corrVecs.setOriented();
330 const labelUList& neighbour = mesh_.neighbour();
338 vector unitArea(Sf[facei]/magSf[facei]);
341 corrVecs[facei] = unitArea -
delta*NonOrthDeltaCoeffs[facei];
348 auto& corrVecsBf = corrVecs.boundaryFieldRef();
350 forAll(corrVecsBf, patchi)
354 const fvPatch&
p = patchCorrVecs.patch();
356 if (!patchCorrVecs.coupled())
358 patchCorrVecs =
Zero;
362 const auto& patchNonOrthDeltaCoeffs =
363 NonOrthDeltaCoeffs.boundaryField()[patchi];
365 const vectorField patchDeltas(mesh_.boundary()[patchi].delta());
370 Sf.boundaryField()[patchi][patchFacei]
371 /magSf.boundaryField()[patchi][patchFacei];
375 patchCorrVecs[patchFacei] =
376 unitArea -
delta*patchNonOrthDeltaCoeffs[patchFacei];
381 p.makeNonOrthoCorrVectors(patchCorrVecs);
386 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
387 <<
"Finished constructing non-orthogonal correction vectors"
390 return tnonOrthCorrectionVectors;
397 const refPtr<pointField>& oldPoints,
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Graphite solid properties.
C() noexcept
Default construct.
Boundary & boundaryFieldRef(const bool updateAccessTime=true)
Return a reference to the boundary field.
const Boundary & boundaryField() const noexcept
Return const-reference to the boundary field.
@ NO_REGISTER
Do not request registration (bool: false).
@ NO_READ
Nothing to be read.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Default geometry calculation scheme. Slight stabilisation for bad meshes.
virtual bool updateGeom(const pointField &points, const refPtr< pointField > &oldPoints, pointField &faceCentres, vectorField &faceAreas, pointField &cellCentres, scalarField &cellVolumes) const
Calculate geometry quantities using mesh topology and provided points. If oldPoints provided only doe...
virtual tmp< surfaceScalarField > nonOrthDeltaCoeffs() const
Return non-orthogonal cell-centre difference coefficients.
virtual tmp< surfaceVectorField > nonOrthCorrectionVectors() const
Return non-orthogonality correction vectors.
virtual void movePoints()
Do what is necessary if the mesh has moved.
virtual tmp< surfaceScalarField > weights() const
Return linear difference weighting factors.
virtual tmp< surfaceScalarField > deltaCoeffs() const
Return cell-centre difference coefficients.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Abstract base class for geometry calculation schemes.
const fvMesh & mesh_
Hold reference to mesh.
virtual void movePoints()
Update basic geometric properties from provided points.
const fvMesh & mesh() const
Return mesh reference.
Mesh data needed to do the Finite Volume discretisation.
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
virtual bool coupled() const
True if the patch field is coupled.
const fvPatch & patch() const noexcept
Return the patch.
virtual void updateGeom()
Update all geometric data.
A class for managing references or pointers (no reference counting).
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Namespace for handling debugging switches.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
GeometricField< vector, fvPatchField, volMesh > volVectorField
const dimensionSet dimless
Dimensionless.
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Field< vector > vectorField
Specialisation of Field<T> for vector.
static constexpr const zero Zero
Global zero (0).
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
fvsPatchField< vector > fvsPatchVectorField
fvsPatchField< scalar > fvsPatchScalarField
#define forAll(list, i)
Loop across all elements in list.