44 skewCorrectionVectors_(NULL)
54 void Foam::skewCorrectionVectors::makeSkewCorrectionVectors()
const
58 Info<<
"surfaceInterpolation::makeSkewCorrectionVectors() : "
59 <<
"Constructing skew correction vectors"
67 "skewCorrectionVectors",
68 mesh_.pointsInstance(),
89 if (!mesh_.orthogonal())
91 d -= mesh_.correctionVectors()/mesh_.deltaCoeffs();
96 vector Cpf = Cf[faceI] - C[owner[faceI]];
99 Cpf - ((Sf[faceI] & Cpf)/(Sf[faceI] & d[faceI]))*d[faceI];
103 forAll(SkewCorrVecs.boundaryField(), patchI)
106 SkewCorrVecs.boundaryField()[patchI];
108 if (!patchSkewCorrVecs.coupled())
114 const fvPatch&
p = patchSkewCorrVecs.patch();
116 const vectorField& patchFaceCentres = Cf.boundaryField()[patchI];
117 const vectorField& patchSf = Sf.boundaryField()[patchI];
118 const vectorField& patchD = d.boundaryField()[patchI];
123 patchFaceCentres[patchFaceI] - C[faceCells[patchFaceI]];
125 patchSkewCorrVecs[patchFaceI] =
128 (patchSf[patchFaceI] & Cpf)/
129 (patchSf[patchFaceI] & patchD[patchFaceI])
130 )*patchD[patchFaceI];
135 scalar skewCoeff = 0.0;
137 if (Sf.internalField().size())
139 skewCoeff =
max(
mag(SkewCorrVecs)/
mag(d)).value();
144 Info<<
"surfaceInterpolation::makeSkewCorrectionVectors() : "
145 <<
"skew coefficient = " << skewCoeff <<
endl;
150 if (skewCoeff < 1
e-5)
162 Info<<
"surfaceInterpolation::makeSkewCorrectionVectors() : "
163 <<
"Finished constructing skew correction vectors"
171 if (skew_ ==
true && !skewCorrectionVectors_)
173 makeSkewCorrectionVectors();
185 <<
"Cannot return correctionVectors; mesh is not skewed"
189 return *skewCorrectionVectors_;