本文整理汇总了C++中parcel::patchFace方法的典型用法代码示例。如果您正苦于以下问题:C++ parcel::patchFace方法的具体用法?C++ parcel::patchFace怎么用?C++ parcel::patchFace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parcel
的用法示例。
在下文中一共展示了parcel::patchFace方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mag
// Return 'keepParcel'
bool reflectParcel::wallTreatment
(
parcel& p,
const label globalFacei
) const
{
label patchi = p.patch(globalFacei);
label facei = p.patchFace(patchi, globalFacei);
const polyMesh& mesh = spray_.mesh();
if (mesh_.boundaryMesh()[patchi].isWall())
{
// wallNormal defined to point outwards of domain
vector Sf = mesh_.Sf().boundaryField()[patchi][facei];
Sf /= mag(Sf);
if (!mesh.moving())
{
// static mesh
scalar Un = p.U() & Sf;
if (Un > 0)
{
p.U() -= (1.0 + elasticity_)*Un*Sf;
}
}
else
{
// moving mesh
vector Ub1 = U_.boundaryField()[patchi][facei];
vector Ub0 = U_.oldTime().boundaryField()[patchi][facei];
scalar dt = spray_.runTime().deltaT().value();
const vectorField& oldPoints = mesh.oldPoints();
const vector& Cf1 = mesh.faceCentres()[globalFacei];
vector Cf0 = mesh.faces()[globalFacei].centre(oldPoints);
vector Cf = Cf0 + p.stepFraction()*(Cf1 - Cf0);
vector Sf0 = mesh.faces()[globalFacei].normal(oldPoints);
// for layer addition Sf0 = vector::zero and we use Sf
if (mag(Sf0) > SMALL)
{
Sf0 /= mag(Sf0);
}
else
{
Sf0 = Sf;
}
scalar magSfDiff = mag(Sf - Sf0);
vector Ub = Ub0 + p.stepFraction()*(Ub1 - Ub0);
if (magSfDiff > SMALL)
{
// rotation + translation
vector Sfp = Sf0 + p.stepFraction()*(Sf - Sf0);
vector omega = Sf0 ^ Sf;
scalar magOmega = mag(omega);
omega /= magOmega+SMALL;
scalar phiVel = ::asin(magOmega)/dt;
scalar dist = (p.position() - Cf) & Sfp;
vector pos = p.position() - dist*Sfp;
vector vrot = phiVel*(omega ^ (pos - Cf));
vector v = Ub + vrot;
scalar Un = ((p.U() - v) & Sfp);
if (Un > 0.0)
{
p.U() -= (1.0 + elasticity_)*Un*Sfp;
}
}
else
{
// translation
vector Ur = p.U() - Ub;
scalar Urn = Ur & Sf;
/*
if (mag(Ub-v) > SMALL)
{
Info << "reflectParcel:: v = " << v
<< ", Ub = " << Ub
<< ", facei = " << facei
<< ", patchi = " << patchi
<< ", globalFacei = " << globalFacei
<< ", name = " << mesh_.boundaryMesh()[patchi].name()
<< endl;
}
*/
if (Urn > 0.0)
//.........这里部分代码省略.........