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:
graham
2010-05-18 11:40:53 +01:00
parent f96feb6491
commit dcb348ddbb
7 changed files with 43 additions and 8 deletions

View File

@ -182,8 +182,8 @@ public:
// Constructors
//- Construct from components
inline trackData
//- Construct from components
inline trackData
(
KinematicCloud<ParcelType>& cloud,
const constantProperties& constProps,

View File

@ -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_;
}
}

View File

@ -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;
};

View File

@ -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()
{}

View File

@ -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();
};

View File

@ -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()
{

View File

@ -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();
};