44 Foam::basicFvGeometryScheme::basicFvGeometryScheme
62 Pout<<
"basicFvGeometryScheme::movePoints() : " 63 <<
"recalculating primitiveMesh centres" <<
endl;
75 Pout<<
"basicFvGeometryScheme::weights() : " 76 <<
"Constructing weighting factors for face interpolation" 86 mesh_.pointsInstance(),
96 auto& weights = tweights.ref();
97 weights.setOriented();
104 const labelUList& neighbour = mesh_.neighbour();
120 scalar SfdOwn =
mag(Sf[facei] & (Cf[facei] -
C[owner[facei]]));
121 scalar SfdNei =
mag(Sf[facei] & (
C[neighbour[facei]] - Cf[facei]));
123 if (
mag(SfdOwn + SfdNei) > ROOTVSMALL)
125 w[facei] = SfdNei/(SfdOwn + SfdNei);
133 auto& wBf = weights.boundaryFieldRef();
135 forAll(mesh_.boundary(), patchi)
137 mesh_.boundary()[patchi].makeWeights(wBf[patchi]);
142 Pout<<
"basicFvGeometryScheme::weights : " 143 <<
"Finished constructing weighting factors for face interpolation" 155 Pout<<
"basicFvGeometryScheme::deltaCoeffs() : " 156 <<
"Constructing differencing factors array for face gradient" 162 (void)mesh_.weights();
170 mesh_.pointsInstance(),
180 auto& deltaCoeffs = tdeltaCoeffs.ref();
181 deltaCoeffs.setOriented();
187 const labelUList& neighbour = mesh_.neighbour();
191 deltaCoeffs[facei] = 1.0/
mag(
C[neighbour[facei]] -
C[owner[facei]]);
194 auto& deltaCoeffsBf = deltaCoeffs.boundaryFieldRef();
196 forAll(deltaCoeffsBf, patchi)
198 const fvPatch&
p = mesh_.boundary()[patchi];
199 deltaCoeffsBf[patchi] = 1.0/
mag(
p.delta());
202 p.makeDeltaCoeffs(deltaCoeffsBf[patchi]);
214 Pout<<
"basicFvGeometryScheme::nonOrthDeltaCoeffs() : " 215 <<
"Constructing differencing factors array for face gradient" 223 auto tnonOrthDeltaCoeffs =
228 "nonOrthDeltaCoeffs",
229 mesh_.pointsInstance(),
239 auto& nonOrthDeltaCoeffs = tnonOrthDeltaCoeffs.ref();
240 nonOrthDeltaCoeffs.setOriented();
246 const labelUList& neighbour = mesh_.neighbour();
253 vector unitArea = Sf[facei]/magSf[facei];
268 auto& nonOrthDeltaCoeffsBf = nonOrthDeltaCoeffs.boundaryFieldRef();
270 forAll(nonOrthDeltaCoeffsBf, patchi)
274 const fvPatch&
p = patchDeltaCoeffs.patch();
276 const vectorField patchDeltas(mesh_.boundary()[patchi].delta());
281 Sf.boundaryField()[patchi][patchFacei]
282 /magSf.boundaryField()[patchi][patchFacei];
286 patchDeltaCoeffs[patchFacei] =
291 p.makeNonOrthoDeltaCoeffs(patchDeltaCoeffs);
293 return tnonOrthDeltaCoeffs;
302 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : " 303 <<
"Constructing non-orthogonal correction vectors" 307 auto tnonOrthCorrectionVectors =
312 "nonOrthCorrectionVectors",
313 mesh_.pointsInstance(),
323 auto& corrVecs = tnonOrthCorrectionVectors.ref();
324 corrVecs.setOriented();
329 const labelUList& neighbour = mesh_.neighbour();
332 tmp<surfaceScalarField> tNonOrthDeltaCoeffs(nonOrthDeltaCoeffs());
337 vector unitArea(Sf[facei]/magSf[facei]);
340 corrVecs[facei] = unitArea -
delta*NonOrthDeltaCoeffs[facei];
347 auto& corrVecsBf = corrVecs.boundaryFieldRef();
349 forAll(corrVecsBf, patchi)
353 const fvPatch&
p = patchCorrVecs.patch();
355 if (!patchCorrVecs.coupled())
357 patchCorrVecs =
Zero;
361 const auto& patchNonOrthDeltaCoeffs =
362 NonOrthDeltaCoeffs.boundaryField()[patchi];
364 const vectorField patchDeltas(mesh_.boundary()[patchi].delta());
369 Sf.boundaryField()[patchi][patchFacei]
370 /magSf.boundaryField()[patchi][patchFacei];
374 patchCorrVecs[patchFacei] =
375 unitArea -
delta*patchNonOrthDeltaCoeffs[patchFacei];
380 p.makeNonOrthoCorrVectors(patchCorrVecs);
385 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : " 386 <<
"Finished constructing non-orthogonal correction vectors" 389 return tnonOrthCorrectionVectors;
fvsPatchField< vector > fvsPatchVectorField
fvsPatchField< scalar > fvsPatchScalarField
const fvMesh & mesh_
Hold reference to mesh.
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.
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)