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

corrections to model

parent 27ecaba4
Branches
Tags
No related merge requests found
......@@ -29,17 +29,20 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template <class CloudType>
bool Foam::LocalInteraction<CloudType>::applyToPatch(const polyPatch& pp) const
Foam::label Foam::LocalInteraction<CloudType>::applyToPatch
(
const label globalPatchI
) const
{
forAll(patchIds_, patchI)
{
if (patchIds_[patchI] == pp.index())
if (patchIds_[patchI] == globalPatchI)
{
return true;
return patchI;
}
}
return false;
return -1;
}
......@@ -75,7 +78,11 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
DynamicList<word> badWalls;
forAll(bMesh, patchI)
{
if (isA<wallPolyPatch>(bMesh[patchI]) && !applyToPatch(bMesh[patchI]))
if
(
isA<wallPolyPatch>(bMesh[patchI])
&& applyToPatch(bMesh[patchI].index()) < 0
)
{
badWalls.append(bMesh[patchI].name());
}
......@@ -115,7 +122,9 @@ bool Foam::LocalInteraction<CloudType>::correct
vector& U
) const
{
if (applyToPatch(pp))
label patchI = applyToPatch(pp.index());
if (patchI >= 0)
{
vector nw = pp.faceAreas()[pp.whichFace(faceId)];
nw /= mag(nw);
......@@ -125,10 +134,10 @@ bool Foam::LocalInteraction<CloudType>::correct
if (Un > 0)
{
U -= (1.0 + patchData_[pp.index()].e())*Un*nw;
U -= (1.0 + patchData_[patchI].e())*Un*nw;
}
U -= patchData_[pp.index()].mu()*Ut;
U -= patchData_[patchI].mu()*Ut;
return true;
}
......
......@@ -132,8 +132,8 @@ class LocalInteraction
// Private member functions
//- Returns true if patch is in patchIds_ list
bool applyToPatch(const polyPatch& pp) const;
//- Returns local patchI if patch is in patchIds_ list
label applyToPatch(const label globalPatchI) const;
......
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