57 weightingFactors_(NULL),
58 differenceFactors_(NULL),
60 correctionVectors_(NULL)
76 if (!weightingFactors_)
81 return (*weightingFactors_);
87 if (!differenceFactors_)
92 return (*differenceFactors_);
98 if (orthogonal_ ==
false && !correctionVectors_)
100 makeCorrectionVectors();
112 FatalErrorIn(
"surfaceInterpolation::correctionVectors()")
113 <<
"cannot return correctionVectors; mesh is orthogonal"
117 return (*correctionVectors_);
133 void Foam::surfaceInterpolation::makeWeights()
const
137 Info<<
"surfaceInterpolation::makeWeights() : "
138 <<
"Constructing weighting factors for face interpolation"
148 mesh_.pointsInstance(),
178 scalar SfdOwn =
mag(Sf[facei] & (Cf[facei] - C[owner[facei]]));
179 scalar SfdNei =
mag(Sf[facei] & (C[neighbour[facei]] - Cf[facei]));
180 w[facei] = SfdNei/(SfdOwn + SfdNei);
185 mesh_.boundary()[
patchi].makeWeights
187 weightingFactors.boundaryField()[
patchi]
194 Info<<
"surfaceInterpolation::makeWeights() : "
195 <<
"Finished constructing weighting factors for face interpolation"
201 void Foam::surfaceInterpolation::makeDeltaCoeffs()
const
205 Info<<
"surfaceInterpolation::makeDeltaCoeffs() : "
206 <<
"Constructing differencing factors array for face gradient"
218 "differenceFactors_",
219 mesh_.pointsInstance(),
237 vector delta = C[neighbour[facei]] - C[owner[facei]];
238 vector unitArea = Sf[facei]/magSf[facei];
250 DeltaCoeffs[facei] = 1.0/
max(unitArea & delta, 0.05*
mag(delta));
255 mesh_.boundary()[
patchi].makeDeltaCoeffs
257 DeltaCoeffs.boundaryField()[
patchi]
263 void Foam::surfaceInterpolation::makeCorrectionVectors()
const
267 Info<<
"surfaceInterpolation::makeCorrectionVectors() : "
268 <<
"Constructing non-orthogonal correction vectors"
277 mesh_.pointsInstance(),
295 vector unitArea = Sf[facei]/magSf[facei];
296 vector delta = C[neighbour[facei]] - C[owner[facei]];
298 corrVecs[facei] = unitArea - delta*DeltaCoeffs[facei];
309 if (!patchcorrVecs.coupled())
316 = DeltaCoeffs.boundaryField()[
patchi];
318 const fvPatch&
p = patchcorrVecs.patch();
325 Sf.boundaryField()[
patchi][patchFacei]
326 /magSf.boundaryField()[
patchi][patchFacei];
328 const vector& delta = patchDeltas[patchFacei];
330 patchcorrVecs[patchFacei] =
331 unitArea - delta*patchDeltaCoeffs[patchFacei];
336 scalar MaxNonOrthog = 0.0;
346 max(
mag(corrVecs)).value(),
354 Info<<
"surfaceInterpolation::makeCorrectionVectors() : "
355 <<
"maximum non-orthogonality = " << MaxNonOrthog <<
" deg."
361 if (MaxNonOrthog < 5)
373 Info<<
"surfaceInterpolation::makeCorrectionVectors() : "
374 <<
"Finished constructing non-orthogonal correction vectors"