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(),
165 const labelUList& neighbour = mesh_.neighbour();
181 const scalar SfdOwn =
mag(Sf[facei]&(Cf[facei] -
C[owner[facei]]));
182 const scalar SfdNei =
mag(Sf[facei]&(
C[neighbour[facei]] - Cf[facei]));
183 const scalar SfdOwnNei = SfdOwn + SfdNei;
185 if (SfdNei/vGreat < SfdOwnNei)
187 w[facei] = SfdNei/SfdOwnNei;
191 const scalar dOwn =
mag(Cf[facei] -
C[owner[facei]]);
192 const scalar dNei =
mag(
C[neighbour[facei]] - Cf[facei]);
193 const scalar dOwnNei = dOwn + dNei;
195 w[facei] = dNei/dOwnNei;
200 weights.boundaryFieldRef();
209 Pout<<
"surfaceInterpolation::makeWeights() : "
210 <<
"Finished constructing weighting factors for face interpolation"
216 void Foam::surfaceInterpolation::makeDeltaCoeffs()
const
220 Pout<<
"surfaceInterpolation::makeDeltaCoeffs() : "
221 <<
"Constructing interpolation factors array for face gradient"
234 mesh_.pointsInstance(),
249 const labelUList& neighbour = mesh_.neighbour();
253 deltaCoeffs[facei] = 1.0/
mag(
C[neighbour[facei]] -
C[owner[facei]]);
257 deltaCoeffs.boundaryFieldRef();
266 void Foam::surfaceInterpolation::makeNonOrthDeltaCoeffs()
const
270 Pout<<
"surfaceInterpolation::makeNonOrthDeltaCoeffs() : "
271 <<
"Constructing interpolation factors array for face gradient"
283 "nonOrthDeltaCoeffs",
284 mesh_.pointsInstance(),
299 const labelUList& neighbour = mesh_.neighbour();
306 vector unitArea = Sf[facei]/magSf[facei];
322 nonOrthDeltaCoeffs.boundaryFieldRef();
328 nonOrthDeltaCoeffsBf[
patchi] =
334 void Foam::surfaceInterpolation::makeNonOrthCorrectionVectors()
const
338 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
339 <<
"Constructing non-orthogonal correction vectors"
347 "nonOrthCorrectionVectors",
348 mesh_.pointsInstance(),
362 const labelUList& neighbour = mesh_.neighbour();
369 vector unitArea = Sf[facei]/magSf[facei];
372 corrVecs[facei] = unitArea -
delta*NonOrthDeltaCoeffs[facei];
380 corrVecs.boundaryFieldRef();
386 if (!patchCorrVecs.coupled())
388 patchCorrVecs =
Zero;
393 = NonOrthDeltaCoeffs.boundaryField()[
patchi];
395 const fvPatch&
p = patchCorrVecs.patch();
402 Sf.boundaryField()[
patchi][patchFacei]
403 /magSf.boundaryField()[
patchi][patchFacei];
407 patchCorrVecs[patchFacei] =
408 unitArea -
delta*patchNonOrthDeltaCoeffs[patchFacei];
415 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
416 <<
"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.
const dimensionSet dimless
SurfaceField< scalar > surfaceScalarField
const dimensionSet dimLength
void deleteDemandDrivenData(DataPtr &dataPtr)
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