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

corrections to model

parent 27ecaba4
No related branches found
No related tags found
No related merge requests found
...@@ -29,17 +29,20 @@ License ...@@ -29,17 +29,20 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template <class CloudType> 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) 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 ...@@ -75,7 +78,11 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
DynamicList<word> badWalls; DynamicList<word> badWalls;
forAll(bMesh, patchI) 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()); badWalls.append(bMesh[patchI].name());
} }
...@@ -115,7 +122,9 @@ bool Foam::LocalInteraction<CloudType>::correct ...@@ -115,7 +122,9 @@ bool Foam::LocalInteraction<CloudType>::correct
vector& U vector& U
) const ) const
{ {
if (applyToPatch(pp)) label patchI = applyToPatch(pp.index());
if (patchI >= 0)
{ {
vector nw = pp.faceAreas()[pp.whichFace(faceId)]; vector nw = pp.faceAreas()[pp.whichFace(faceId)];
nw /= mag(nw); nw /= mag(nw);
...@@ -125,10 +134,10 @@ bool Foam::LocalInteraction<CloudType>::correct ...@@ -125,10 +134,10 @@ bool Foam::LocalInteraction<CloudType>::correct
if (Un > 0) 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; return true;
} }
......
...@@ -132,8 +132,8 @@ class LocalInteraction ...@@ -132,8 +132,8 @@ class LocalInteraction
// Private member functions // Private member functions
//- Returns true if patch is in patchIds_ list //- Returns local patchI if patch is in patchIds_ list
bool applyToPatch(const polyPatch& pp) const; label applyToPatch(const label globalPatchI) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment