63 deltaCoeffs_(nullptr),
64 nonOrthDeltaCoeffs_(nullptr),
65 nonOrthCorrectionVectors_(nullptr)
97 return (*deltaCoeffs_);
104 if (!nonOrthDeltaCoeffs_)
106 makeNonOrthDeltaCoeffs();
109 return (*nonOrthDeltaCoeffs_);
116 if (!nonOrthCorrectionVectors_)
118 makeNonOrthCorrectionVectors();
121 return (*nonOrthCorrectionVectors_);
136 void Foam::surfaceInterpolation::makeWeights()
const
140 Pout<<
"surfaceInterpolation::makeWeights() : "
141 <<
"Constructing weighting factors for face interpolation"
150 mesh_.pointsInstance(),
160 weights.setOriented();
167 const labelUList& neighbour = mesh_.neighbour();
183 scalar SfdOwn =
mag(Sf[facei] & (Cf[facei] -
C[owner[facei]]));
184 scalar SfdNei =
mag(Sf[facei] & (
C[neighbour[facei]] - Cf[facei]));
185 w[facei] = SfdNei/(SfdOwn + SfdNei);
188 surfaceScalarField::Boundary& wBf = weights.boundaryFieldRef();
190 forAll(mesh_.boundary(), patchi)
192 mesh_.boundary()[patchi].makeWeights(wBf[patchi]);
197 Pout<<
"surfaceInterpolation::makeWeights() : "
198 <<
"Finished constructing weighting factors for face interpolation"
204 void Foam::surfaceInterpolation::makeDeltaCoeffs()
const
208 Pout<<
"surfaceInterpolation::makeDeltaCoeffs() : "
209 <<
"Constructing differencing factors array for face gradient"
222 mesh_.pointsInstance(),
232 deltaCoeffs.setOriented();
238 const labelUList& neighbour = mesh_.neighbour();
242 deltaCoeffs[facei] = 1.0/
mag(
C[neighbour[facei]] -
C[owner[facei]]);
245 surfaceScalarField::Boundary& deltaCoeffsBf =
246 deltaCoeffs.boundaryFieldRef();
248 forAll(deltaCoeffsBf, patchi)
250 deltaCoeffsBf[patchi] = 1.0/
mag(mesh_.boundary()[patchi].delta());
255 void Foam::surfaceInterpolation::makeNonOrthDeltaCoeffs()
const
259 Pout<<
"surfaceInterpolation::makeNonOrthDeltaCoeffs() : "
260 <<
"Constructing differencing factors array for face gradient"
272 "nonOrthDeltaCoeffs",
273 mesh_.pointsInstance(),
283 nonOrthDeltaCoeffs.setOriented();
289 const labelUList& neighbour = mesh_.neighbour();
296 vector unitArea = Sf[facei]/magSf[facei];
311 surfaceScalarField::Boundary& nonOrthDeltaCoeffsBf =
312 nonOrthDeltaCoeffs.boundaryFieldRef();
314 forAll(nonOrthDeltaCoeffsBf, patchi)
318 const fvPatch&
p = patchDeltaCoeffs.patch();
320 const vectorField patchDeltas(mesh_.boundary()[patchi].delta());
325 Sf.boundaryField()[patchi][patchFacei]
326 /magSf.boundaryField()[patchi][patchFacei];
330 patchDeltaCoeffs[patchFacei] =
337 void Foam::surfaceInterpolation::makeNonOrthCorrectionVectors()
const
341 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
342 <<
"Constructing non-orthogonal correction vectors"
350 "nonOrthCorrectionVectors",
351 mesh_.pointsInstance(),
361 corrVecs.setOriented();
366 const labelUList& neighbour = mesh_.neighbour();
373 vector unitArea = Sf[facei]/magSf[facei];
376 corrVecs[facei] = unitArea -
delta*NonOrthDeltaCoeffs[facei];
383 surfaceVectorField::Boundary& corrVecsBf = corrVecs.boundaryFieldRef();
385 forAll(corrVecsBf, patchi)
389 if (!patchCorrVecs.coupled())
391 patchCorrVecs =
Zero;
396 NonOrthDeltaCoeffs.boundaryField()[patchi];
398 const fvPatch&
p = patchCorrVecs.patch();
400 const vectorField patchDeltas(mesh_.boundary()[patchi].delta());
405 Sf.boundaryField()[patchi][patchFacei]
406 /magSf.boundaryField()[patchi][patchFacei];
410 patchCorrVecs[patchFacei] =
411 unitArea -
delta*patchNonOrthDeltaCoeffs[patchFacei];
418 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
419 <<
"Finished constructing non-orthogonal correction vectors"