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();
182 scalar SfdOwn =
mag(Sf[facei] & (Cf[facei] -
C[owner[facei]]));
183 scalar SfdNei =
mag(Sf[facei] & (
C[neighbour[facei]] - Cf[facei]));
184 w[facei] = SfdNei/(SfdOwn + SfdNei);
187 surfaceScalarField::Boundary& wBf = weights.boundaryFieldRef();
189 forAll(mesh_.boundary(), patchi)
191 mesh_.boundary()[patchi].makeWeights(wBf[patchi]);
196 Pout<<
"surfaceInterpolation::makeWeights() : "
197 <<
"Finished constructing weighting factors for face interpolation"
203 void Foam::surfaceInterpolation::makeDeltaCoeffs()
const
207 Pout<<
"surfaceInterpolation::makeDeltaCoeffs() : "
208 <<
"Constructing differencing factors array for face gradient"
221 mesh_.pointsInstance(),
231 deltaCoeffs.setOriented();
237 const labelUList& neighbour = mesh_.neighbour();
241 deltaCoeffs[facei] = 1.0/
mag(
C[neighbour[facei]] -
C[owner[facei]]);
244 surfaceScalarField::Boundary& deltaCoeffsBf =
245 deltaCoeffs.boundaryFieldRef();
247 forAll(deltaCoeffsBf, patchi)
249 const fvPatch&
p = mesh_.boundary()[patchi];
250 deltaCoeffsBf[patchi] = 1.0/
mag(
p.delta());
253 p.makeDeltaCoeffs(deltaCoeffsBf[patchi]);
258 void Foam::surfaceInterpolation::makeNonOrthDeltaCoeffs()
const
262 Pout<<
"surfaceInterpolation::makeNonOrthDeltaCoeffs() : "
263 <<
"Constructing differencing factors array for face gradient"
275 "nonOrthDeltaCoeffs",
276 mesh_.pointsInstance(),
286 nonOrthDeltaCoeffs.setOriented();
292 const labelUList& neighbour = mesh_.neighbour();
299 vector unitArea = Sf[facei]/magSf[facei];
314 surfaceScalarField::Boundary& nonOrthDeltaCoeffsBf =
315 nonOrthDeltaCoeffs.boundaryFieldRef();
317 forAll(nonOrthDeltaCoeffsBf, patchi)
321 const fvPatch&
p = patchDeltaCoeffs.patch();
323 const vectorField patchDeltas(mesh_.boundary()[patchi].delta());
328 Sf.boundaryField()[patchi][patchFacei]
329 /magSf.boundaryField()[patchi][patchFacei];
333 patchDeltaCoeffs[patchFacei] =
338 p.makeNonOrthoDeltaCoeffs(patchDeltaCoeffs);
343 void Foam::surfaceInterpolation::makeNonOrthCorrectionVectors()
const
347 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
348 <<
"Constructing non-orthogonal correction vectors"
356 "nonOrthCorrectionVectors",
357 mesh_.pointsInstance(),
367 corrVecs.setOriented();
372 const labelUList& neighbour = mesh_.neighbour();
379 vector unitArea = Sf[facei]/magSf[facei];
382 corrVecs[facei] = unitArea -
delta*NonOrthDeltaCoeffs[facei];
389 surfaceVectorField::Boundary& corrVecsBf = corrVecs.boundaryFieldRef();
391 forAll(corrVecsBf, patchi)
395 const fvPatch&
p = patchCorrVecs.patch();
397 if (!patchCorrVecs.coupled())
399 patchCorrVecs =
Zero;
404 NonOrthDeltaCoeffs.boundaryField()[patchi];
406 const vectorField patchDeltas(mesh_.boundary()[patchi].delta());
411 Sf.boundaryField()[patchi][patchFacei]
412 /magSf.boundaryField()[patchi][patchFacei];
416 patchCorrVecs[patchFacei] =
417 unitArea -
delta*patchNonOrthDeltaCoeffs[patchFacei];
422 p.makeNonOrthoCorrVectors(patchCorrVecs);
427 Pout<<
"surfaceInterpolation::makeNonOrthCorrectionVectors() : "
428 <<
"Finished constructing non-orthogonal correction vectors"