本文整理汇总了C++中parcelType::position方法的典型用法代码示例。如果您正苦于以下问题:C++ parcelType::position方法的具体用法?C++ parcelType::position怎么用?C++ parcelType::position使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parcelType
的用法示例。
在下文中一共展示了parcelType::position方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: breakup
void Foam::SprayCloud<CloudType>::checkParcelProperties
(
parcelType& parcel,
const scalar lagrangianDt,
const bool fullyDescribed
)
{
CloudType::checkParcelProperties(parcel, lagrangianDt, fullyDescribed);
// store the injection position and initial drop size
parcel.position0() = parcel.position();
parcel.d0() = parcel.d();
parcel.y() = breakup().y0();
parcel.yDot() = breakup().yDot0();
parcel.liquidCore() = atomization().initLiquidCore();
}
示例2: mag
//.........这里部分代码省略.........
if (mag(n00) > SMALL)
{
// If the old normal is zero (for example in layer
// addition) then use the current normal, meaning that the
// motion can only be translational, and dn remains zero,
// otherwise, calculate dn:
n00 /= mag(n00);
dn = n - n00;
}
// Total fraction through the timestep of the motion,
// including stepFraction before the current tracking step
// and the current trackFraction
// i.e.
// let s = stepFraction, t = trackFraction
// Motion of x in time:
// |-----------------|---------|---------|
// x00 x0 xi x
//
// where xi is the correct value of x at the required
// tracking instant.
//
// x0 = x00 + s*(x - x00) = s*x + (1 - s)*x00
//
// i.e. the motion covered by previous tracking portions
// within this timestep, and
//
// xi = x0 + t*(x - x0)
// = t*x + (1 - t)*x0
// = t*x + (1 - t)*(s*x + (1 - s)*x00)
// = (s + t - s*t)*x + (1 - (s + t - s*t))*x00
//
// let m = (s + t - s*t)
//
// xi = m*x + (1 - m)*x00 = x00 + m*(x - x00);
//
// In the same form as before.
scalar m =
p.stepFraction()
+ trackFraction
- (p.stepFraction()*trackFraction);
// When the mesh is moving, the velocity field on wall patches
// will contain the velocity associated with the motion of the
// mesh, in which case it is interpolated in time using m.
// For other patches the face velocity will need to be
// reconstructed from the face centre motion.
const vector& Cf = mesh_.faceCentres()[p.face()];
vector Cf00 = mesh_.faces()[p.face()].centre(mesh_.oldPoints());
if (isA<wallPolyPatch>(pp))
{
Up = U00 + m*(U - U00);
}
else
{
Up = (Cf - Cf00)/mesh_.time().deltaTValue();
}
if (mag(dn) > SMALL)
{
// Rotational motion, nw requires interpolation and a
// rotational velocity around face centre correction to Up
// is required.
nw = n00 + m*dn;
// Cf at tracking instant
vector Cfi = Cf00 + m*(Cf - Cf00);
// Normal vector cross product
vector omega = (n00 ^ n);
scalar magOmega = mag(omega);
// magOmega = sin(angle between unit normals)
// Normalise omega vector by magOmega, then multiply by
// angle/dt to give the correct angular velocity vector.
omega *= Foam::asin(magOmega)/(magOmega*mesh_.time().deltaTValue());
// Project position onto face and calculate this position
// relative to the face centre.
vector facePos =
p.position()
- ((p.position() - Cfi) & nw)*nw
- Cfi;
Up += (omega ^ facePos);
}
// No further action is required if the motion is
// translational only, nw and Up have already been set.
}
}