Skip to content
Snippets Groups Projects
Commit 9207140e authored by Sergio Ferraris's avatar Sergio Ferraris Committed by Andrew Heather
Browse files

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
parent d7b1a666
Branches
Tags
1 merge request!406ENH: MPPIC dynamic mesh
......@@ -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;
......
......@@ -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
(
......
......@@ -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
......
......@@ -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:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment