45 Foam::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();
333 tmp<surfaceScalarField> tNonOrthDeltaCoeffs(nonOrthDeltaCoeffs());
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,
fvsPatchField< vector > fvsPatchVectorField
fvsPatchField< scalar > fvsPatchScalarField
const fvMesh & mesh_
Hold reference to mesh.
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 > weights() const
Return linear difference weighting factors.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
Ignore writing from objectRegistry::writeObject()
const dimensionSet dimless
Dimensionless.
GeometricField< vector, fvPatchField, volMesh > volVectorField
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
Default geometry calculation scheme. Slight stabilisation for bad meshes.
#define forAll(list, i)
Loop across all elements in list.
virtual tmp< surfaceVectorField > nonOrthCorrectionVectors() const
Return non-orthogonality correction vectors.
vectorField pointField
pointField is a vectorField.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
virtual void updateGeom()
Update all geometric data.
virtual tmp< surfaceScalarField > nonOrthDeltaCoeffs() const
Return non-orthogonal cell-centre difference coefficients.
int debug
Static debugging option.
defineTypeNameAndDebug(combustionModel, 0)
const dimensionSet dimLength(0, 1, 0, 0, 0, 0, 0)
Mesh data needed to do the Finite Volume discretisation.
virtual void movePoints()
Update basic geometric properties from provided points.
Field< vector > vectorField
Specialisation of Field<T> for vector.
A class for managing temporary objects.
GeometricField< scalar, fvsPatchField, surfaceMesh > surfaceScalarField
virtual void movePoints()
Do what is necessary if the mesh has moved.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Do not request registration (bool: false)
virtual tmp< surfaceScalarField > deltaCoeffs() const
Return cell-centre difference coefficients.
Abstract base class for geometry calculation schemes.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)