Skip to content
Snippets Groups Projects
Commit 75b0c7d1 authored by Andrew Heather's avatar Andrew Heather
Browse files

added wall check for particle lambda calc

parent b82e21a8
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,7 @@ License ...@@ -25,6 +25,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "polyMesh.H" #include "polyMesh.H"
#include "wallPolyPatch.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
...@@ -46,21 +47,25 @@ inline Foam::scalar Foam::Particle<ParticleType>::lambda ...@@ -46,21 +47,25 @@ inline Foam::scalar Foam::Particle<ParticleType>::lambda
Sf /= mag(Sf); Sf /= mag(Sf);
vector Cf = mesh.faceCentres()[facei]; vector Cf = mesh.faceCentres()[facei];
// move reference point for wall // patch interaction
if (!cloud_.internalFace(facei)) if (!cloud_.internalFace(facei))
{ {
const vector& C = mesh.cellCentres()[celli_]; label patchi = patch(facei);
scalar CCf = mag((C - Cf) & Sf); const polyPatch& patch = mesh.boundaryMesh()[patchi];
// check if distance between cell centre and face centre
// is larger than wallImpactDistance // move reference point for wall
if if (isA<wallPolyPatch>(patch))
(
CCf
> static_cast<const ParticleType&>(*this).wallImpactDistance(Sf)
)
{ {
Cf -= static_cast<const ParticleType&>(*this) const vector& C = mesh.cellCentres()[celli_];
.wallImpactDistance(Sf)*Sf; 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 ...@@ -190,21 +195,24 @@ inline Foam::scalar Foam::Particle<ParticleType>::lambda
Sf /= mag(Sf); Sf /= mag(Sf);
vector Cf = mesh.faceCentres()[facei]; vector Cf = mesh.faceCentres()[facei];
// move reference point for wall // patch interaction
if (!cloud_.internalFace(facei)) if (!cloud_.internalFace(facei))
{ {
const vector& C = mesh.cellCentres()[celli_]; label patchi = patch(facei);
scalar CCf = mag((C - Cf) & Sf); const polyPatch& patch = mesh.boundaryMesh()[patchi];
// check if distance between cell centre and face centre
// is larger than wallImpactDistance // move reference point for wall
if if (isA<wallPolyPatch>(patch))
(
CCf
> static_cast<const ParticleType&>(*this).wallImpactDistance(Sf)
)
{ {
Cf -= static_cast<const ParticleType&>(*this) const vector& C = mesh.cellCentres()[celli_];
.wallImpactDistance(Sf)*Sf; 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;
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment