Commit 75b0c7d1 authored by Andrew Heather's avatar Andrew Heather
Browse files

added wall check for particle lambda calc

parent b82e21a8
......@@ -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;
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment