From 0f4c6572bc2fe4ab3ab802e425eafb48dbf4dbbd Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Thu, 27 Sep 2018 12:46:48 +0100 Subject: [PATCH 1/3] ENH: polyPatch - added areaFraction method Helper function to calculate the current face area vs the area returned from the current point locations. Useful for ACMI-type baffles where we scale the face areas without moving points. --- .../polyPatches/polyPatch/polyPatch.C | 19 +++++++++++++++++++ .../polyPatches/polyPatch/polyPatch.H | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C index d48d7e30ca..324203cf26 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C @@ -330,6 +330,25 @@ Foam::tmp Foam::polyPatch::faceCellCentres() const } +Foam::tmp Foam::polyPatch::areaFraction() const +{ + tmp tfraction(new scalarField(size())); + scalarField& fraction = tfraction.ref(); + + const vectorField::subField faceAreas = this->faceAreas(); + const pointField& points = this->points(); + + forAll(*this, facei) + { + const face& curFace = this->operator[](facei); + fraction[facei] = + mag(faceAreas[facei])/(curFace.mag(points) + ROOTVSMALL); + } + + return tfraction; +} + + const Foam::labelUList& Foam::polyPatch::faceCells() const { if (!faceCellsPtr_) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H index a43c9e9844..0a185878d4 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H @@ -372,6 +372,10 @@ public: //- Return face cell centres tmp faceCellCentres() const; + //- Return the area fraction as the ratio of the stored face area + //- and the area given by the face points + tmp areaFraction() const; + // Addressing into mesh From 731ebc91261c58bf03b5e1d1ab42d2f9b6073554 Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Thu, 27 Sep 2018 12:51:13 +0100 Subject: [PATCH 2/3] ENH: Particle interaction lists - do not include partially open wall faces. See #957 --- .../basic/InteractionLists/InteractionLists.C | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C index 922ee09185..360f2a3cbc 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.C +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C @@ -324,10 +324,15 @@ void Foam::InteractionLists::buildInteractionLists() if (isA(patch)) { - localWallFaces.append - ( - identity(patch.size(), patch.start()) - ); + const scalarField areaFraction(patch.areaFraction()); + + forAll(areaFraction, facei) + { + if (areaFraction[facei] > 0.5) + { + localWallFaces.append(facei + patch.start()); + } + } } } @@ -335,10 +340,12 @@ void Foam::InteractionLists::buildInteractionLists() forAll(wallFaceBbs, i) { - wallFaceBbs[i] = treeBoundBox - ( - mesh_.faces()[localWallFaces[i]].points(mesh_.points()) - ); + wallFaceBbs[i] = + treeBoundBox + ( + mesh_.points(), + mesh_.faces()[localWallFaces[i]] + ); } // IAndT: index and transform From 1135f1572dbcd4eaa97a1d4a856d74d8ce83bb3a Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Thu, 27 Sep 2018 16:34:44 +0100 Subject: [PATCH 3/3] TUT: Removed unused/misleading entries - see #1020 --- tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon | 1 - tutorials/incompressible/SRFSimpleFoam/mixer/0/epsilon | 2 -- tutorials/incompressible/SRFSimpleFoam/mixer/0/nut | 2 -- 3 files changed, 5 deletions(-) diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon index bc0943db35..e745051d37 100644 --- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon +++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/0/epsilon @@ -24,7 +24,6 @@ boundaryField rotor { type epsilonWallFunction; - U Urel; value uniform 3.75e-4; } diff --git a/tutorials/incompressible/SRFSimpleFoam/mixer/0/epsilon b/tutorials/incompressible/SRFSimpleFoam/mixer/0/epsilon index 63fc38dadb..5c7829c027 100644 --- a/tutorials/incompressible/SRFSimpleFoam/mixer/0/epsilon +++ b/tutorials/incompressible/SRFSimpleFoam/mixer/0/epsilon @@ -34,13 +34,11 @@ boundaryField innerWall { type epsilonWallFunction; - U Urel; value uniform 14.855; } outerWall { type epsilonWallFunction; - U Urel; value uniform 14.855; } cyclic_half0 diff --git a/tutorials/incompressible/SRFSimpleFoam/mixer/0/nut b/tutorials/incompressible/SRFSimpleFoam/mixer/0/nut index 00a1844db8..2e05aa24b3 100644 --- a/tutorials/incompressible/SRFSimpleFoam/mixer/0/nut +++ b/tutorials/incompressible/SRFSimpleFoam/mixer/0/nut @@ -34,13 +34,11 @@ boundaryField innerWall { type nutkWallFunction; - U Urel; value uniform 0; } outerWall { type nutkWallFunction; - U Urel; value uniform 0; } cyclic_half0