ENH: Adding check for wall interaction when particle is stuck on moving

walls

A new user input parameter UrMax is added to the PatchInteractionModel.
In some occasions the partile remains on a patch face due to extremely
low relative U. If this Ur is lower than UrMax the particle is removed
This commit is contained in:
Sergio Ferraris
2020-08-28 08:38:22 -07:00
committed by Andrew Heather
parent d7b1a666b5
commit 9207140e37
4 changed files with 43 additions and 3 deletions

View File

@ -294,6 +294,18 @@ bool Foam::LocalInteraction<CloudType>::correct
// Calculate motion relative to patch velocity
U -= Up;
if (mag(U) < this->Urmax())
{
WarningInFunction
<< "Particle U the same as patch "
<< " The particle has been removed" << nl << endl;
keepParticle = false;
p.active(false);
U = Zero;
break;
}
scalar Un = U & nw;
vector Ut = U - Un*nw;

View File

@ -137,7 +137,8 @@ Foam::PatchInteractionModel<CloudType>::PatchInteractionModel
functionObjects::writeFile(owner, this->localPath(), typeName, false),
UName_("unknown_U"),
escapedParcels_(0),
escapedMass_(0.0)
escapedMass_(0.0),
Urmax_(1e-4)
{}
@ -160,7 +161,8 @@ Foam::PatchInteractionModel<CloudType>::PatchInteractionModel
),
UName_(this->coeffDict().template getOrDefault<word>("U", "U")),
escapedParcels_(0),
escapedMass_(0.0)
escapedMass_(0.0),
Urmax_(this->coeffDict().template getOrDefault<scalar>("UrMax", 1e-4))
{}
@ -174,7 +176,8 @@ Foam::PatchInteractionModel<CloudType>::PatchInteractionModel
functionObjects::writeFile(pim),
UName_(pim.UName_),
escapedParcels_(pim.escapedParcels_),
escapedMass_(pim.escapedMass_)
escapedMass_(pim.escapedMass_),
Urmax_(pim.Urmax_)
{}
@ -187,6 +190,13 @@ const Foam::word& Foam::PatchInteractionModel<CloudType>::UName() const
}
template<class CloudType>
const Foam::scalar& Foam::PatchInteractionModel<CloudType>::Urmax() const
{
return Urmax_;
}
template<class CloudType>
void Foam::PatchInteractionModel<CloudType>::addToEscapedParcels
(

View File

@ -99,6 +99,9 @@ protected:
//- Mass of parcels escaped
scalar escapedMass_;
//- Maximum relative U with patch for particle to be removed
scalar Urmax_;
// Protected Member Functions
@ -162,6 +165,8 @@ public:
//- Return name of velocity field
const word& UName() const;
//- Return Urmax
const scalar& Urmax() const;
// Member Functions

View File

@ -211,6 +211,18 @@ bool Foam::StandardWallInteraction<CloudType>::correct
// Calculate motion relative to patch velocity
U -= Up;
if (mag(U) < this->Urmax())
{
WarningInFunction
<< "Particle U the same as patch "
<< " The particle has been removed" << nl << endl;
keepParticle = false;
p.active(false);
U = Zero;
break;
}
scalar Un = U & nw;
vector Ut = U - Un*nw;
@ -224,6 +236,7 @@ bool Foam::StandardWallInteraction<CloudType>::correct
// Return velocity to global space
U += Up;
break;
}
default: