added wall check for particle lambda calc

This commit is contained in:
andy 2009-09-07 13:37:58 +01:00
parent b82e21a815
commit 75b0c7d1f8

View File

@ -25,6 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "polyMesh.H"
#include "wallPolyPatch.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -46,21 +47,25 @@ inline Foam::scalar Foam::Particle<ParticleType>::lambda
Sf /= mag(Sf);
vector Cf = mesh.faceCentres()[facei];
// move reference point for wall
// patch interaction
if (!cloud_.internalFace(facei))
{
const vector& C = mesh.cellCentres()[celli_];
scalar CCf = mag((C - Cf) & Sf);
// check if distance between cell centre and face centre
// is larger than wallImpactDistance
if
(
CCf
> static_cast<const ParticleType&>(*this).wallImpactDistance(Sf)
)
label patchi = patch(facei);
const polyPatch& patch = mesh.boundaryMesh()[patchi];
// move reference point for wall
if (isA<wallPolyPatch>(patch))
{
Cf -= static_cast<const ParticleType&>(*this)
.wallImpactDistance(Sf)*Sf;
const vector& C = mesh.cellCentres()[celli_];
scalar CCf = mag((C - Cf) & Sf);
// check if distance between cell centre and face centre
// is larger than wallImpactDistance
const ParticleType& p =
static_cast<const ParticleType&>(*this);
if (CCf > p.wallImpactDistance(Sf))
{
Cf -=p.wallImpactDistance(Sf)*Sf;
}
}
}
@ -190,21 +195,24 @@ inline Foam::scalar Foam::Particle<ParticleType>::lambda
Sf /= mag(Sf);
vector Cf = mesh.faceCentres()[facei];
// move reference point for wall
// patch interaction
if (!cloud_.internalFace(facei))
{
const vector& C = mesh.cellCentres()[celli_];
scalar CCf = mag((C - Cf) & Sf);
// check if distance between cell centre and face centre
// is larger than wallImpactDistance
if
(
CCf
> static_cast<const ParticleType&>(*this).wallImpactDistance(Sf)
)
label patchi = patch(facei);
const polyPatch& patch = mesh.boundaryMesh()[patchi];
// move reference point for wall
if (isA<wallPolyPatch>(patch))
{
Cf -= static_cast<const ParticleType&>(*this)
.wallImpactDistance(Sf)*Sf;
const vector& C = mesh.cellCentres()[celli_];
scalar CCf = mag((C - Cf) & Sf);
// check if distance between cell centre and face centre
// is larger than wallImpactDistance
const ParticleType& p = static_cast<const ParticleType&>(*this);
if (CCf > p.wallImpactDistance(Sf))
{
Cf -=p.wallImpactDistance(Sf)*Sf;
}
}
}