mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
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
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,7 +32,6 @@ License
|
|||||||
#include "NoInteraction.H"
|
#include "NoInteraction.H"
|
||||||
#include "Rebound.H"
|
#include "Rebound.H"
|
||||||
#include "StandardWallInteraction.H"
|
#include "StandardWallInteraction.H"
|
||||||
#include "MultiInteraction.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -43,8 +42,7 @@ License
|
|||||||
makePatchInteractionModelType(LocalInteraction, CloudType); \
|
makePatchInteractionModelType(LocalInteraction, CloudType); \
|
||||||
makePatchInteractionModelType(NoInteraction, CloudType); \
|
makePatchInteractionModelType(NoInteraction, CloudType); \
|
||||||
makePatchInteractionModelType(Rebound, CloudType); \
|
makePatchInteractionModelType(Rebound, CloudType); \
|
||||||
makePatchInteractionModelType(StandardWallInteraction, CloudType); \
|
makePatchInteractionModelType(StandardWallInteraction, CloudType);
|
||||||
makePatchInteractionModelType(MultiInteraction, CloudType);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "MultiInteraction.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
bool Foam::MultiInteraction<CloudType>::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<CloudType>::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<class CloudType>
|
|
||||||
Foam::MultiInteraction<CloudType>::MultiInteraction
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
CloudType& cloud
|
|
||||||
)
|
|
||||||
:
|
|
||||||
PatchInteractionModel<CloudType>(dict, cloud, typeName)
|
|
||||||
{
|
|
||||||
read(this->coeffDict());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
Foam::MultiInteraction<CloudType>::MultiInteraction
|
|
||||||
(
|
|
||||||
const MultiInteraction<CloudType>& pim
|
|
||||||
)
|
|
||||||
:
|
|
||||||
PatchInteractionModel<CloudType>(pim),
|
|
||||||
oneInteractionOnly_(pim.oneInteractionOnly_),
|
|
||||||
models_(pim.models_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
Foam::MultiInteraction<CloudType>::~MultiInteraction()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
bool Foam::MultiInteraction<CloudType>::active() const
|
|
||||||
{
|
|
||||||
forAll(models_, i)
|
|
||||||
{
|
|
||||||
if (models_[i].active())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
|
||||||
bool Foam::MultiInteraction<CloudType>::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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -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 <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
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 CloudType>
|
|
||||||
class MultiInteraction
|
|
||||||
:
|
|
||||||
public PatchInteractionModel<CloudType>
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
Switch oneInteractionOnly_;
|
|
||||||
|
|
||||||
//- Submodels
|
|
||||||
PtrList<PatchInteractionModel<CloudType>> 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<CloudType>& pim);
|
|
||||||
|
|
||||||
//- Construct and return a clone using supplied owner cloud
|
|
||||||
virtual autoPtr<PatchInteractionModel<CloudType>> clone() const
|
|
||||||
{
|
|
||||||
return autoPtr<PatchInteractionModel<CloudType>>
|
|
||||||
(
|
|
||||||
new MultiInteraction<CloudType>(*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
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user