From 598ea115636841674420fffb6f27e418bac6bcd8 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Wed, 16 May 2018 12:50:12 +0100 Subject: [PATCH] PatchInteractionModel: Removed MultiInteraction MultiInteraction appeared to have been written for combining the usual patch interaction models with a model called CoincidentBaffleInteraction, which was never released. None of the remaining patch interaction models make sense operating in combination, so the MultiInteraction model has been removed. All documentation references to CoincidentBaffleInteraction have also been deleted. Resolves bug report https://bugs.openfoam.org/view.php?id=2939 --- .../makeParcelPatchInteractionModels.H | 6 +- .../MultiInteraction/MultiInteraction.C | 184 ------------------ .../MultiInteraction/MultiInteraction.H | 163 ---------------- 3 files changed, 2 insertions(+), 351 deletions(-) delete mode 100644 src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/MultiInteraction/MultiInteraction.C delete mode 100644 src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/MultiInteraction/MultiInteraction.H diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H index 3f53216a3..f4a0d80df 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelPatchInteractionModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,7 +32,6 @@ License #include "NoInteraction.H" #include "Rebound.H" #include "StandardWallInteraction.H" -#include "MultiInteraction.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,8 +42,7 @@ License makePatchInteractionModelType(LocalInteraction, CloudType); \ makePatchInteractionModelType(NoInteraction, CloudType); \ makePatchInteractionModelType(Rebound, CloudType); \ - makePatchInteractionModelType(StandardWallInteraction, CloudType); \ - makePatchInteractionModelType(MultiInteraction, CloudType); + makePatchInteractionModelType(StandardWallInteraction, CloudType); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/MultiInteraction/MultiInteraction.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/MultiInteraction/MultiInteraction.C deleted file mode 100644 index bdd8a542c..000000000 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/MultiInteraction/MultiInteraction.C +++ /dev/null @@ -1,184 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "MultiInteraction.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -template -bool Foam::MultiInteraction::read(const dictionary& dict) -{ - // Count dictionaries - - Info<< "Patch interaction model " << typeName << nl - << "Executing in turn " << endl; - - label nModels = 0; - forAllConstIter(dictionary, dict, iter) - { - if (iter().isDict()) - { - Info<< " " << iter().name() << endl; - - nModels++; - } - } - - models_.setSize(nModels); - nModels = 0; - forAllConstIter(dictionary, dict, iter) - { - if (iter().isDict()) - { - models_.set - ( - nModels++, - PatchInteractionModel::New - ( - iter().dict(), - this->owner() - ) - ); - } - } - - oneInteractionOnly_ = Switch(dict.lookup("oneInteractionOnly")); - - if (oneInteractionOnly_) - { - Info<< "Stopping upon first model that interacts with particle." - << nl << endl; - } - else - { - Info<< "Allowing multiple models to interact." - << nl << endl; - } - - return true; -} - - -// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // - -template -Foam::MultiInteraction::MultiInteraction -( - const dictionary& dict, - CloudType& cloud -) -: - PatchInteractionModel(dict, cloud, typeName) -{ - read(this->coeffDict()); -} - - -template -Foam::MultiInteraction::MultiInteraction -( - const MultiInteraction& pim -) -: - PatchInteractionModel(pim), - oneInteractionOnly_(pim.oneInteractionOnly_), - models_(pim.models_) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::MultiInteraction::~MultiInteraction() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -template -bool Foam::MultiInteraction::active() const -{ - forAll(models_, i) - { - if (models_[i].active()) - { - return true; - } - } - return false; -} - - -template -bool Foam::MultiInteraction::correct -( - typename CloudType::parcelType& p, - const polyPatch& pp, - bool& keepParticle -) -{ - label origFacei = p.face(); - label patchi = pp.index(); - - bool interacted = false; - - forAll(models_, i) - { - bool myInteracted = models_[i].correct - ( - p, - this->owner().pMesh().boundaryMesh()[patchi], - keepParticle - ); - - if (myInteracted && oneInteractionOnly_) - { - break; - } - - interacted = (interacted || myInteracted); - - - // Check if perhaps the interaction model has changed patches - // (CoincidentBaffleInteraction can do this) - - if (p.face() != origFacei) - { - origFacei = p.face(); - patchi = p.patch(); - - // Interaction model has moved particle off wall? - if (patchi == -1) - { - break; - } - } - } - - return interacted; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/MultiInteraction/MultiInteraction.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/MultiInteraction/MultiInteraction.H deleted file mode 100644 index 3b70b5ff4..000000000 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/MultiInteraction/MultiInteraction.H +++ /dev/null @@ -1,163 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::MultiInteraction - -Description - Runs multiple patch interaction models in turn. Takes dictionary - where all the subdictionaries are the interaction models. - - // Exit upon first successful interaction or continue doing other - // models. Returned nteraction status will be true if there has been any - // interaction (so logical or) - oneInteractionOnly true; - - model1 - { - patchInteractionModel coincidentBaffleInteraction; - coincidentBaffleInteractionCoeffs - { - coincidentPatches - ( - (pipetteWall_A pipetteCyclic_half0) - (pipetteWall_B pipetteCyclic_half1) - ); - } - } - model2 - { - patchInteractionModel localInteraction; - localInteractionCoeffs - { - patches - ( - cWall - { - type rebound; - } - pipetteWall_A - { - type rebound; - } - pipetteWall_B - { - type rebound; - } - ); - } - } - - -\*---------------------------------------------------------------------------*/ - -#ifndef MultiInteraction_H -#define MultiInteraction_H - -#include "PatchInteractionModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -/*---------------------------------------------------------------------------*\ - Class MultiInteraction Declaration -\*---------------------------------------------------------------------------*/ - -template -class MultiInteraction -: - public PatchInteractionModel -{ - // Private data - - Switch oneInteractionOnly_; - - //- Submodels - PtrList> models_; - - - // Private Member Functions - - //- Read settings - bool read(const dictionary&); - -public: - - //- Runtime type information - TypeName("multiInteraction"); - - - // Constructors - - //- Construct from dictionary - MultiInteraction(const dictionary& dict, CloudType& cloud); - - //- Construct copy from owner cloud and patch interaction model - MultiInteraction(const MultiInteraction& pim); - - //- Construct and return a clone using supplied owner cloud - virtual autoPtr> clone() const - { - return autoPtr> - ( - new MultiInteraction(*this) - ); - } - - - //- Destructor - virtual ~MultiInteraction(); - - - // Member Functions - - //- Flag to indicate whether model activates patch interaction model - virtual bool active() const; - - //- Apply velocity correction - // Returns true if particle remains in same cell - virtual bool correct - ( - typename CloudType::parcelType& p, - const polyPatch& pp, - bool& keepParticle - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "MultiInteraction.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* //