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 - -// ************************************************************************* //