60 deltaCoeffs_(nullptr),
61 nonOrthDeltaCoeffs_(nullptr),
62 nonOrthCorrectionVectors_(nullptr)
96 return (*deltaCoeffs_);
103 if (!nonOrthDeltaCoeffs_)
105 makeNonOrthDeltaCoeffs();
108 return (*nonOrthDeltaCoeffs_);
115 if (!nonOrthCorrectionVectors_)
117 makeNonOrthCorrectionVectors();
120 return (*nonOrthCorrectionVectors_);
135 void Foam::surfaceInterpolation::makeWeights()
const
139 Pout<<
"surfaceInterpolation::makeWeights() : "
140 <<
"Constructing weighting factors for face interpolation"
149 mesh_.pointsInstance(),
162 const labelUList& neighbour = mesh_.neighbour();
177 const scalar SfdOwn =
mag(Sf[facei]&(Cf[facei] -
C[owner[facei]]));
178 const scalar SfdNei =
mag(Sf[facei]&(
C[neighbour[facei]] - Cf[facei]));
179 const scalar SfdOwnNei = SfdOwn + SfdNei;
181 if (SfdNei/vGreat < SfdOwnNei)
183 w[facei] = SfdNei/SfdOwnNei;
187 const scalar dOwn =
mag(Cf[facei] -
C[owner[facei]]);
188 const scalar dNei =
mag(
C[neighbour[facei]] - Cf[facei]);
189 const scalar dOwnNei = dOwn + dNei;
191 w[facei] = dNei/dOwnNei;
196 weights.boundaryFieldRef();
205 Pout<<
"surfaceInterpolation::makeWeights() : "
206 <<
"Finished constructing weighting factors for face interpolation"
212 void Foam::surfaceInterpolation::makeDeltaCoeffs()
const
216 Pout<<
"surfaceInterpolation::makeDeltaCoeffs() : "
217 <<
"Constructing interpolation factors array for face gradient"
230 mesh_.pointsInstance(),
245 const labelUList& neighbour = mesh_.neighbour();
249 deltaCoeffs[facei] = 1.0/
mag(
C[neighbour[facei]] -
C[owner[facei]]);
253 deltaCoeffs.boundaryFieldRef();
262 void Foam::surfaceInterpolation::makeNonOrthDeltaCoeffs()
const
266 Pout<<
"surfaceInterpolation::makeNonOrthDeltaCoeffs() : "
267 <<
"Constructing interpolation factors array for face gradient"
279 "nonOrthDeltaCoeffs",
280 mesh_.pointsInstance(),
295 const labelUList& neighbour = mesh_.neighbour();
302 vector unitArea = Sf[facei]/magSf[facei];
318 nonOrthDeltaCoeffs.boundaryFieldRef();
324 nonOrthDeltaCoeffsBf[
patchi] =
330 void Foam::surfaceInterpolation::makeNonOrthCorrectionVectors()
const
334 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
335 <<
"Constructing non-orthogonal correction vectors"
343 "nonOrthCorrectionVectors",
344 mesh_.pointsInstance(),
358 const labelUList& neighbour = mesh_.neighbour();
365 vector unitArea = Sf[facei]/magSf[facei];
368 corrVecs[facei] = unitArea -
delta*NonOrthDeltaCoeffs[facei];
376 corrVecs.boundaryFieldRef();
382 if (!patchCorrVecs.coupled())
384 patchCorrVecs =
Zero;
389 = NonOrthDeltaCoeffs.boundaryField()[
patchi];
391 const fvPatch&
p = patchCorrVecs.patch();
398 Sf.boundaryField()[
patchi][patchFacei]
399 /magSf.boundaryField()[
patchi][patchFacei];
403 patchCorrVecs[patchFacei] =
404 unitArea -
delta*patchNonOrthDeltaCoeffs[patchFacei];
411 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
412 <<
"Finished constructing non-orthogonal correction vectors"
static const Foam::dimensionedScalar C("C", Foam::dimTemperature, 234.5)
#define forAll(list, i)
Loop across all elements in list.
Generic GeometricField class.
GeometricBoundaryField< Type, PatchField, GeoMesh > Boundary
Type of the boundary field.
Mesh data needed to do the Finite Volume discretisation.
Cell to surface interpolation scheme. Included in fvMesh.
bool movePoints()
Do what is necessary if the mesh has moved.
const surfaceVectorField & nonOrthCorrectionVectors() const
Return reference to non-orthogonality correction vectors.
const surfaceScalarField & weights() const
Return reference to linear difference weighting factors.
const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
surfaceInterpolation(const fvMesh &)
Construct given an fvMesh.
const surfaceScalarField & nonOrthDeltaCoeffs() const
Return reference to non-orthogonal cell-centre difference.
void clearOut()
Clear all geometry and addressing.
~surfaceInterpolation()
Destructor.
Template functions to aid in the implementation of demand driven data.
VolField< vector > volVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
void deleteDemandDrivenData(DataType *&dataPtr)
const dimensionSet dimless
SurfaceField< scalar > surfaceScalarField
const dimensionSet dimLength
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
Vector< scalar > vector
A scalar version of the templated Vector.
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
Field< vector > vectorField
Specialisation of Field<T> for vector.
prefixOSstream Pout(cout, "Pout")
SurfaceField< vector > surfaceVectorField
UList< label > labelUList
fvsPatchField< vector > fvsPatchVectorField
fvsPatchField< scalar > fvsPatchScalarField