30 template<
class ParticleType>
36 const scalar stepFraction
40 bool movingMesh = mesh.
moving();
49 if (!cloud_.internalFace(facei))
51 label
patchi = patch(facei);
55 if (isA<wallPolyPatch>(patch))
58 scalar CCf =
mag((C - Cf) & Sf);
61 const ParticleType&
p =
62 static_cast<const ParticleType&
>(*this);
63 if (CCf > p.wallImpactDistance(Sf))
65 Cf -=p.wallImpactDistance(Sf)*Sf;
75 vector Cf00 = mesh.
faces()[facei].centre(oldPoints);
76 vector Cf0 = Cf00 + stepFraction*(Cf - Cf00);
78 vector Sf00 = mesh.
faces()[facei].normal(oldPoints);
81 if (
mag(Sf00) > SMALL)
90 scalar magSfDiff =
mag(Sf - Sf00);
93 if (magSfDiff > SMALL)
95 vector Sf0 = Sf00 + stepFraction*(Sf - Sf00);
99 scalar magOmega =
mag(omega);
100 omega /= magOmega + SMALL;
102 scalar lam = ((Cf - Cf0) & Sf)/(n0 & Sf);
112 scalar a = beta & (Sf - Sf0);
113 scalar
b = (alpha & (Sf - Sf0)) + (beta & Sf0);
114 scalar c = alpha & Sf0;
121 scalar
cp = ap*ap - 4.0*bp;
130 scalar l1 = -0.5*(ap -
::sqrt(cp));
131 scalar l2 = -0.5*(ap +
::sqrt(cp));
153 vector alpha = from - Cf0;
155 scalar lambdaNominator = alpha & Sf;
156 scalar lambdaDenominator = beta & Sf;
159 if (
mag(lambdaDenominator) < SMALL)
161 if (lambdaDenominator < 0.0)
163 lambdaDenominator = -SMALL;
167 lambdaDenominator = SMALL;
171 return (-lambdaNominator/lambdaDenominator);
177 return lambda(from, to, facei);
182 template<
class ParticleType>
197 if (!cloud_.internalFace(facei))
199 label
patchi = patch(facei);
203 if (isA<wallPolyPatch>(patch))
206 scalar CCf =
mag((C - Cf) & Sf);
209 const ParticleType&
p =
static_cast<const ParticleType&
>(*this);
210 if (CCf > p.wallImpactDistance(Sf))
212 Cf -=p.wallImpactDistance(Sf)*Sf;
217 scalar lambdaNominator = (Cf - from) & Sf;
218 scalar lambdaDenominator = (to - from) & Sf;
221 if (
mag(lambdaDenominator) < SMALL)
223 if (lambdaDenominator < 0.0)
225 lambdaDenominator = -SMALL;
229 lambdaDenominator = SMALL;
233 return lambdaNominator/lambdaDenominator;
237 template<
class ParticleType>
241 findFaces(position_, faces);
243 return (!faces.
size());
247 template<
class ParticleType>
252 const scalar stepFraction
256 findFaces(position, celli, stepFraction, faces);
258 return (!faces.
size());
264 template<
class ParticleType>
274 template<
class ParticleType>
284 template<
class ParticleType>
292 template<
class ParticleType>
299 template<
class ParticleType>
306 template<
class ParticleType>
313 template<
class ParticleType>
320 template<
class ParticleType>
327 template<
class ParticleType>
334 template<
class ParticleType>
341 template<
class ParticleType>
348 template<
class ParticleType>
355 template<
class ParticleType>
362 template<
class ParticleType>
369 template<
class ParticleType>
373 cloud_.pMesh().time().value()
378 template<
class ParticleType>
381 return cloud_.facePatch(facei);
385 template<
class ParticleType>
392 return cloud_.patchFace(patchi, facei);
396 template<
class ParticleType>
404 template<
class ParticleType>