mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Making the collision model able to say whether or not it controls
wall interactions. If it does, then make the wallImpactDistance 0, if it doesn't make it d/2.
This commit is contained in:
@ -182,8 +182,8 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
inline trackData
|
||||
//- Construct from components
|
||||
inline trackData
|
||||
(
|
||||
KinematicCloud<ParcelType>& cloud,
|
||||
const constantProperties& constProps,
|
||||
|
||||
@ -439,14 +439,23 @@ inline Foam::scalar Foam::KinematicParcel<ParcelType>::wallImpactDistance
|
||||
const vector&
|
||||
) const
|
||||
{
|
||||
// Do not use a wall impact distance to allow proper multiple face
|
||||
// collisions. In a twisted mesh the particle can be within range
|
||||
// of a wall but not in the cell attached to a wall face, hence
|
||||
// miss the interaction.
|
||||
const KinematicCloud<ParcelType>& c =
|
||||
dynamic_cast<const KinematicCloud<ParcelType>&>(this->cloud());
|
||||
|
||||
return 0.0;
|
||||
if (c.collision().controlsWallInteraction())
|
||||
{
|
||||
// Do not use a wall impact distance if the collision model
|
||||
// controls wall interactions to allow proper multiple face
|
||||
// collisions. In a twisted mesh the particle can be within
|
||||
// range of a wall but not in the cell attached to a wall
|
||||
// face, hence miss the interaction.
|
||||
|
||||
// return 0.5*d_;
|
||||
return 0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0.5*d_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -141,6 +141,10 @@ public:
|
||||
//- Flag to indicate whether model activates injection model
|
||||
virtual bool active() const = 0;
|
||||
|
||||
//- Indicates whether model determines wall collisions or not,
|
||||
// used to determine what value to use for wallImpactDistance
|
||||
virtual bool controlsWallInteraction() const = 0;
|
||||
|
||||
// Collision function
|
||||
virtual void collide() = 0;
|
||||
};
|
||||
|
||||
@ -61,6 +61,13 @@ bool Foam::NoCollision<CloudType>::active() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::NoCollision<CloudType>::controlsWallInteraction() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::NoCollision<CloudType>::collide()
|
||||
{}
|
||||
|
||||
@ -82,6 +82,10 @@ public:
|
||||
//- Flag to indicate whether model activates injection model
|
||||
virtual bool active() const;
|
||||
|
||||
//- Indicates whether model determines wall collisions or not,
|
||||
// used to determine what value to use for wallImpactDistance
|
||||
virtual bool controlsWallInteraction() const;
|
||||
|
||||
// Collision function
|
||||
virtual void collide();
|
||||
};
|
||||
|
||||
@ -611,6 +611,13 @@ bool Foam::PairCollision<CloudType>::active() const
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
bool Foam::PairCollision<CloudType>::controlsWallInteraction() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::PairCollision<CloudType>::collide()
|
||||
{
|
||||
|
||||
@ -174,6 +174,10 @@ public:
|
||||
//- Flag to indicate whether model activates injection model
|
||||
virtual bool active() const;
|
||||
|
||||
//- Indicates whether model determines wall collisions or not,
|
||||
// used to determine what value to use for wallImpactDistance
|
||||
virtual bool controlsWallInteraction() const;
|
||||
|
||||
// Collision function
|
||||
virtual void collide();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user