From dc5a8671bdab8fbfb2a2467aefd6454c393b697b Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Fri, 17 Mar 2017 17:26:39 +0000 Subject: [PATCH] PatchInteractionModel: Skip application of patch interaction model for coupled patches, to prevent rebound/stick/etc... on these patches. Also added "none" interaction type to LocalInteraction, which reverts the patch interaction to the fundamental behaviour. This is primarily useful for non-coupled constraint types. Resolves https://bugs.openfoam.org/view.php?id=2458 --- .../parcels/Templates/KinematicParcel/KinematicParcel.C | 5 +++++ .../LocalInteraction/LocalInteraction.C | 4 ++++ .../LocalInteraction/patchInteractionDataList.C | 1 - .../PatchInteractionModel/PatchInteractionModel.C | 9 +++++++++ .../PatchInteractionModel/PatchInteractionModel.H | 1 + .../StandardWallInteraction/StandardWallInteraction.C | 4 ++++ 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index d159423646..d2d44b92d3 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -410,6 +410,11 @@ bool Foam::KinematicParcel::hitPatch // All interactions done return true; } + else if (pp.coupled()) + { + // Don't apply the patchInteraction models to coupled boundaries + return false; + } else { // Invoke patch interaction model diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C index 42a47f4d45..43eae8a83a 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/LocalInteraction.C @@ -191,6 +191,10 @@ bool Foam::LocalInteraction::correct switch (it) { + case PatchInteractionModel::itNone: + { + return false; + } case PatchInteractionModel::itEscape: { scalar dm = p.mass()*p.nParticle(); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionDataList.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionDataList.C index 5a40981153..8bb4cd5b3b 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionDataList.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionDataList.C @@ -74,7 +74,6 @@ Foam::patchInteractionDataList::patchInteractionDataList ( !pp.coupled() && !isA(pp) - && !isA(pp) && applyToPatch(pp.index()) < 0 ) { diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C index e5788d4033..9493382862 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C @@ -51,6 +51,11 @@ Foam::word Foam::PatchInteractionModel::interactionTypeToWord switch (itEnum) { + case itNone: + { + it = "none"; + break; + } case itRebound: { it = "rebound"; @@ -82,6 +87,10 @@ Foam::PatchInteractionModel::wordToInteractionType const word& itWord ) { + if (itWord == "none") + { + return itNone; + } if (itWord == "rebound") { return itRebound; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H index 3af6abee50..ea761ebf87 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H @@ -65,6 +65,7 @@ public: // Interaction types enum interactionType { + itNone, itRebound, itStick, itEscape, diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C index 253a94c53b..d7641ac389 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/StandardWallInteraction/StandardWallInteraction.C @@ -116,6 +116,10 @@ bool Foam::StandardWallInteraction::correct { switch (interactionType_) { + case PatchInteractionModel::itNone: + { + return false; + } case PatchInteractionModel::itEscape: { keepParticle = false;