mus_particle_interactions_module Module

In this module the routines for interactions between particles in the DEM solver are implemented.



Interfaces

public interface isLocalCollision

  • public pure function isLocalCollision_MEM(particleA, particleB, myRank)

    isLocalCollision checks if collision between two particles is local This is the case when they are both owned by this process

    Arguments

    Type IntentOptional Attributes Name
    type(mus_particle_MEM_type), intent(in) :: particleA

    First particle to collide

    type(mus_particle_MEM_type), intent(in) :: particleB

    Second particle to collide

    integer, intent(in) :: myRank

    This process's rank

    Return Value logical

  • public pure function isLocalCollision_DPS(particleA, particleB, myRank)

    isLocalCollision checks if collision between two particles is local This is the case when they are both owned by this process

    Arguments

    Type IntentOptional Attributes Name
    type(mus_particle_DPS_type), intent(in) :: particleA

    First particle to collide

    type(mus_particle_DPS_type), intent(in) :: particleB

    Second particle to collide

    integer, intent(in) :: myRank

    This process's rank

    Return Value logical

public interface DEM_isRemoteCollision

  • public subroutine DEM_isRemoteCollision_MEM(particleA, particleB, myRank, send, isRemoteCollision, otherRank, otherRankIndex)

    Arguments

    Type IntentOptional Attributes Name
    type(mus_particle_MEM_type), intent(in) :: particleA

    First particle to collide

    type(mus_particle_MEM_type), intent(in) :: particleB

    Second particle to collide

    integer, intent(in) :: myRank

    This process's rank

    type(mus_particles_communication_type), intent(in) :: send

    Communication type for sending

    logical, intent(out) :: isRemoteCollision

    logical indicating if this is a remote collision that needs to be resolved on this process

    integer, intent(out) :: otherRank

    Other particle's rank as an output

    integer, intent(out) :: otherRankIndex

    Position of other particle's rank in send%proc

  • public subroutine DEM_isRemoteCollision_DPS(particleA, particleB, myRank, send, isRemoteCollision, otherRank, otherRankIndex)

    Arguments

    Type IntentOptional Attributes Name
    type(mus_particle_DPS_type), intent(in) :: particleA

    First particle to collide

    type(mus_particle_DPS_type), intent(in) :: particleB

    Second particle to collide

    integer, intent(in) :: myRank

    This process's rank

    type(mus_particles_communication_type), intent(in) :: send

    Communication type for sending

    logical, intent(out) :: isRemoteCollision

    logical indicating if this is a remote collision that needs to be resolved on this process

    integer, intent(out) :: otherRank

    Other particle's rank as an output

    integer, intent(out) :: otherRankIndex

    Position of other particle's rank in send%proc

public interface checkAndCollideDEM

  • public subroutine checkAndCollideDEM_MEM(particleA, particleB, hasCollided, eps, Tc, mu)

    checkAndCollideDEM checks if two particles A and B collide This is the case if the continuous representations overlap If there is a collision, a collision force is applied to each particle checkAndCollideDEM checks if two particles A and B collide This is the case if the continuous representations overlap If there is a collision, a collision force is applied to each particle

    Arguments

    Type IntentOptional Attributes Name
    type(mus_particle_MEM_type), intent(inout) :: particleA

    First particle to collide

    type(mus_particle_MEM_type), intent(inout) :: particleB

    Second particle to collide

    logical, intent(out) :: hasCollided

    Logical which indicates whether particles have indeed collided

    real(kind=rk), intent(in) :: eps

    Threshold gap at which to call it a collision

    real(kind=rk), intent(in) :: Tc

    Collision time, used to compute DEM spring and damper constant

    real(kind=rk), intent(in) :: mu

    Dynamic viscosity, in physical units

  • public subroutine checkAndCollideDEM_DPS(particleA, particleB, hasCollided, eps, Tc, mu)

    checkAndCollideDEM checks if two particles A and B collide This is the case if the continuous representations overlap If there is a collision, a collision force is applied to each particle

    Arguments

    Type IntentOptional Attributes Name
    type(mus_particle_DPS_type), intent(inout) :: particleA

    First particle to collide

    type(mus_particle_DPS_type), intent(inout) :: particleB

    Second particle to collide

    logical, intent(out) :: hasCollided

    Logical which indicates whether particles have indeed collided

    real(kind=rk), intent(in) :: eps

    Threshold gap at which to call it a collision

    real(kind=rk), intent(in) :: Tc

    Collision time, used to compute DEM spring and damper constant

    real(kind=rk), intent(in) :: mu

    Dynamic viscosity, in physical units

public interface computeWallPosSum

  • public subroutine computeWallPosSum_MEM(this, BCinteraction, scheme, stencil, geometry, params, rmflag, foundWall, wallPosSum, nWallPos)

    computeWallPosSum computes the sum of the locations of wall boundaries in the area surrounding the particle. It also sets rmflag to true if an open boundary is detected, indicating that this particle should be removed from the global domain (in a different routine)

    Arguments

    Type IntentOptional Attributes Name
    type(mus_particle_MEM_type), intent(inout) :: this
    integer, intent(in) :: BCinteraction(:)

    Array of length nBCs which tells us how particles should interact with each boundary. Indexed using boundary ID!

    type(mus_scheme_type), intent(inout) :: scheme

    Scheme for access to level descriptor

    type(tem_stencilHeader_type), intent(in) :: stencil

    Stencil for access to cq

    type(mus_geom_type), intent(in) :: geometry

    Geometry information to determine TreeIDs of elements 'covered' by particle

    type(mus_param_type), intent(in) :: params

    Parameters for access to conversion factors between units

    logical, intent(out) :: rmflag

    Flag to indicate whether particle should be removed because it just hit a non-wall BC

    logical, intent(out) :: foundWall

    Flag to indicate whether we found a wall or not

    real(kind=rk), intent(out) :: wallPosSum(3)

    Sum of locations (x,y,z) of the detected walls

    integer, intent(out) :: nWallPos

    Number of elements in wallPosSum

  • public subroutine computeWallPosSum_DPS(this, BCinteraction, scheme, stencil, geometry, params, rmflag, foundWall, wallPosSum, nWallPos)

    computeWallPosSum computes the sum of the locations of wall boundaries in the area surrounding the particle. It also sets rmflag to true if an open boundary is detected, indicating that this particle should be removed from the global domain (in a different routine)

    Arguments

    Type IntentOptional Attributes Name
    type(mus_particle_DPS_type), intent(inout) :: this
    integer, intent(in) :: BCinteraction(:)

    Array of length nBCs which tells us how particles should interact with each boundary. Indexed using boundary ID!

    type(mus_scheme_type), intent(inout) :: scheme

    Scheme for access to level descriptor

    type(tem_stencilHeader_type), intent(in) :: stencil

    Stencil for access to cq

    type(mus_geom_type), intent(in) :: geometry

    Geometry information to determine TreeIDs of elements 'covered' by particle

    type(mus_param_type), intent(in) :: params

    Parameters for access to conversion factors between units

    logical, intent(out) :: rmflag

    Flag to indicate whether particle should be removed because it just hit a non-wall BC

    logical, intent(out) :: foundWall

    Flag to indicate whether we found a wall or not

    real(kind=rk), intent(out) :: wallPosSum(3)

    Sum of locations (x,y,z) of the detected walls

    integer, intent(out) :: nWallPos

    Number of elements in wallPosSum

public interface DEM_collideWithWall

  • public subroutine DEM_collideWithWall_MEM(this, BCinteraction, scheme, geometry, params, Tc, eps)

    Arguments

    Type IntentOptional Attributes Name
    type(mus_particle_MEM_type), intent(inout) :: this
    integer, intent(in) :: BCinteraction(:)

    Array of length nBCs which tells us how particles should interact with each boundary. Indexed using boundary ID!

    type(mus_scheme_type), intent(inout) :: scheme

    Scheme for access to level descriptor

    type(mus_geom_type), intent(in) :: geometry

    Geometry information to determine TreeIDs of elements 'covered' by particle

    type(mus_param_type), intent(in) :: params

    Parameters for access to conversion factors between units

    real(kind=rk), intent(in) :: Tc

    Collision time

    real(kind=rk), intent(in) :: eps

    threshold gap for collision

  • public subroutine DEM_collideWithWall_DPS(this, BCinteraction, scheme, geometry, params, Tc, eps)

    Arguments

    Type IntentOptional Attributes Name
    type(mus_particle_DPS_type), intent(inout) :: this
    integer, intent(in) :: BCinteraction(:)

    Array of length nBCs which tells us how particles should interact with each boundary. Indexed using boundary ID!

    type(mus_scheme_type), intent(inout) :: scheme

    Scheme for access to level descriptor

    type(mus_geom_type), intent(in) :: geometry

    Geometry information to determine TreeIDs of elements 'covered' by particle

    type(mus_param_type), intent(in) :: params

    Parameters for access to conversion factors between units

    real(kind=rk), intent(in) :: Tc

    Collision time

    real(kind=rk), intent(in) :: eps

    threshold gap for collision


Functions

public pure function isLocalCollision_MEM(particleA, particleB, myRank)

isLocalCollision checks if collision between two particles is local This is the case when they are both owned by this process

Arguments

Type IntentOptional Attributes Name
type(mus_particle_MEM_type), intent(in) :: particleA

First particle to collide

type(mus_particle_MEM_type), intent(in) :: particleB

Second particle to collide

integer, intent(in) :: myRank

This process's rank

Return Value logical

public pure function isLocalCollision_DPS(particleA, particleB, myRank)

isLocalCollision checks if collision between two particles is local This is the case when they are both owned by this process

Arguments

Type IntentOptional Attributes Name
type(mus_particle_DPS_type), intent(in) :: particleA

First particle to collide

type(mus_particle_DPS_type), intent(in) :: particleB

Second particle to collide

integer, intent(in) :: myRank

This process's rank

Return Value logical

public function calc_surface_vel(om, particle_radius, n) result(usurf)

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: om(3)
real(kind=rk), intent(in) :: particle_radius
real(kind=rk), intent(in) :: n(3)

Return Value real(kind=rk), (3)

public function computeLubForce_normal(h, hc, mu, R, un, norm_rab) result(Flub)

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: h

Gap between particles (physical units)

real(kind=rk), intent(in) :: hc

Critical gap (physical units) If h < hc we use hc to compute the lubrication forces to prevent them from diverging as h -> 0.

real(kind=rk), intent(in) :: mu

Dynamic viscosity (physical units)

real(kind=rk), intent(in) :: R

Radius of the particles

real(kind=rk), intent(in) :: un

Relative velocity in normal direction between the two particles

real(kind=rk), intent(in) :: norm_rab(3)

Unit vector pointing in the direction from particle A to particle B

Return Value real(kind=rk), (3)

public function computeLubForce_tangential(h, hc, mu, R, ut, utr) result(Flub)

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: h

Gap between particles (physical units)

real(kind=rk), intent(in) :: hc

Critical gap (physical units) If h < hc we use hc to compute the lubrication forces to prevent them from diverging as h -> 0.

real(kind=rk), intent(in) :: mu

Dynamic viscosity (physical units)

real(kind=rk), intent(in) :: R

Radius of the particles

real(kind=rk), intent(in) :: ut(3)

Relative velocity in tangential direction between the two particles

real(kind=rk), intent(in) :: utr(3)

Relative velocity in tangential direction caused by rotational motion of particles

Return Value real(kind=rk), (3)

public function computeWallForce_1D(xp, up, Rp, xwall, kn, dn, eps) result(Fwall)

computeWallForce_1D computes the 1D DEM force between a particle at position xp with velocity un to a wall at position xwall.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in) :: xp

Particle position

real(kind=rk), intent(in) :: up

Particle velocity

real(kind=rk), intent(in) :: Rp

Particle radius

real(kind=rk), intent(in) :: xwall

Wall position

real(kind=rk), intent(in) :: kn

Spring constant

real(kind=rk), intent(in) :: dn

Damping coefficient

real(kind=rk), intent(in) :: eps

Threshold distance at which to execute a collision

Return Value real(kind=rk)


Subroutines

public subroutine DEM_isRemoteCollision_MEM(particleA, particleB, myRank, send, isRemoteCollision, otherRank, otherRankIndex)

Arguments

Type IntentOptional Attributes Name
type(mus_particle_MEM_type), intent(in) :: particleA

First particle to collide

type(mus_particle_MEM_type), intent(in) :: particleB

Second particle to collide

integer, intent(in) :: myRank

This process's rank

type(mus_particles_communication_type), intent(in) :: send

Communication type for sending

logical, intent(out) :: isRemoteCollision

logical indicating if this is a remote collision that needs to be resolved on this process

integer, intent(out) :: otherRank

Other particle's rank as an output

integer, intent(out) :: otherRankIndex

Position of other particle's rank in send%proc

public subroutine DEM_isRemoteCollision_DPS(particleA, particleB, myRank, send, isRemoteCollision, otherRank, otherRankIndex)

Arguments

Type IntentOptional Attributes Name
type(mus_particle_DPS_type), intent(in) :: particleA

First particle to collide

type(mus_particle_DPS_type), intent(in) :: particleB

Second particle to collide

integer, intent(in) :: myRank

This process's rank

type(mus_particles_communication_type), intent(in) :: send

Communication type for sending

logical, intent(out) :: isRemoteCollision

logical indicating if this is a remote collision that needs to be resolved on this process

integer, intent(out) :: otherRank

Other particle's rank as an output

integer, intent(out) :: otherRankIndex

Position of other particle's rank in send%proc

public subroutine checkAndCollideDEM_MEM(particleA, particleB, hasCollided, eps, Tc, mu)

checkAndCollideDEM checks if two particles A and B collide This is the case if the continuous representations overlap If there is a collision, a collision force is applied to each particle checkAndCollideDEM checks if two particles A and B collide This is the case if the continuous representations overlap If there is a collision, a collision force is applied to each particle

Arguments

Type IntentOptional Attributes Name
type(mus_particle_MEM_type), intent(inout) :: particleA

First particle to collide

type(mus_particle_MEM_type), intent(inout) :: particleB

Second particle to collide

logical, intent(out) :: hasCollided

Logical which indicates whether particles have indeed collided

real(kind=rk), intent(in) :: eps

Threshold gap at which to call it a collision

real(kind=rk), intent(in) :: Tc

Collision time, used to compute DEM spring and damper constant

real(kind=rk), intent(in) :: mu

Dynamic viscosity, in physical units

public subroutine checkAndCollideDEM_DPS(particleA, particleB, hasCollided, eps, Tc, mu)

checkAndCollideDEM checks if two particles A and B collide This is the case if the continuous representations overlap If there is a collision, a collision force is applied to each particle

Arguments

Type IntentOptional Attributes Name
type(mus_particle_DPS_type), intent(inout) :: particleA

First particle to collide

type(mus_particle_DPS_type), intent(inout) :: particleB

Second particle to collide

logical, intent(out) :: hasCollided

Logical which indicates whether particles have indeed collided

real(kind=rk), intent(in) :: eps

Threshold gap at which to call it a collision

real(kind=rk), intent(in) :: Tc

Collision time, used to compute DEM spring and damper constant

real(kind=rk), intent(in) :: mu

Dynamic viscosity, in physical units

public subroutine computeWallPosSum_MEM(this, BCinteraction, scheme, stencil, geometry, params, rmflag, foundWall, wallPosSum, nWallPos)

computeWallPosSum computes the sum of the locations of wall boundaries in the area surrounding the particle. It also sets rmflag to true if an open boundary is detected, indicating that this particle should be removed from the global domain (in a different routine)

Arguments

Type IntentOptional Attributes Name
type(mus_particle_MEM_type), intent(inout) :: this
integer, intent(in) :: BCinteraction(:)

Array of length nBCs which tells us how particles should interact with each boundary. Indexed using boundary ID!

type(mus_scheme_type), intent(inout) :: scheme

Scheme for access to level descriptor

type(tem_stencilHeader_type), intent(in) :: stencil

Stencil for access to cq

type(mus_geom_type), intent(in) :: geometry

Geometry information to determine TreeIDs of elements 'covered' by particle

type(mus_param_type), intent(in) :: params

Parameters for access to conversion factors between units

logical, intent(out) :: rmflag

Flag to indicate whether particle should be removed because it just hit a non-wall BC

logical, intent(out) :: foundWall

Flag to indicate whether we found a wall or not

real(kind=rk), intent(out) :: wallPosSum(3)

Sum of locations (x,y,z) of the detected walls

integer, intent(out) :: nWallPos

Number of elements in wallPosSum

public subroutine computeWallPosSum_DPS(this, BCinteraction, scheme, stencil, geometry, params, rmflag, foundWall, wallPosSum, nWallPos)

computeWallPosSum computes the sum of the locations of wall boundaries in the area surrounding the particle. It also sets rmflag to true if an open boundary is detected, indicating that this particle should be removed from the global domain (in a different routine)

Arguments

Type IntentOptional Attributes Name
type(mus_particle_DPS_type), intent(inout) :: this
integer, intent(in) :: BCinteraction(:)

Array of length nBCs which tells us how particles should interact with each boundary. Indexed using boundary ID!

type(mus_scheme_type), intent(inout) :: scheme

Scheme for access to level descriptor

type(tem_stencilHeader_type), intent(in) :: stencil

Stencil for access to cq

type(mus_geom_type), intent(in) :: geometry

Geometry information to determine TreeIDs of elements 'covered' by particle

type(mus_param_type), intent(in) :: params

Parameters for access to conversion factors between units

logical, intent(out) :: rmflag

Flag to indicate whether particle should be removed because it just hit a non-wall BC

logical, intent(out) :: foundWall

Flag to indicate whether we found a wall or not

real(kind=rk), intent(out) :: wallPosSum(3)

Sum of locations (x,y,z) of the detected walls

integer, intent(out) :: nWallPos

Number of elements in wallPosSum

public subroutine DEM_collideWithWall_MEM(this, BCinteraction, scheme, geometry, params, Tc, eps)

Arguments

Type IntentOptional Attributes Name
type(mus_particle_MEM_type), intent(inout) :: this
integer, intent(in) :: BCinteraction(:)

Array of length nBCs which tells us how particles should interact with each boundary. Indexed using boundary ID!

type(mus_scheme_type), intent(inout) :: scheme

Scheme for access to level descriptor

type(mus_geom_type), intent(in) :: geometry

Geometry information to determine TreeIDs of elements 'covered' by particle

type(mus_param_type), intent(in) :: params

Parameters for access to conversion factors between units

real(kind=rk), intent(in) :: Tc

Collision time

real(kind=rk), intent(in) :: eps

threshold gap for collision

public subroutine DEM_collideWithWall_DPS(this, BCinteraction, scheme, geometry, params, Tc, eps)

Arguments

Type IntentOptional Attributes Name
type(mus_particle_DPS_type), intent(inout) :: this
integer, intent(in) :: BCinteraction(:)

Array of length nBCs which tells us how particles should interact with each boundary. Indexed using boundary ID!

type(mus_scheme_type), intent(inout) :: scheme

Scheme for access to level descriptor

type(mus_geom_type), intent(in) :: geometry

Geometry information to determine TreeIDs of elements 'covered' by particle

type(mus_param_type), intent(in) :: params

Parameters for access to conversion factors between units

real(kind=rk), intent(in) :: Tc

Collision time

real(kind=rk), intent(in) :: eps

threshold gap for collision

public subroutine DEM_collideWithPlanarWall_DPS(this, dir, xwall, Tc, eps)

Arguments

Type IntentOptional Attributes Name
type(mus_particle_DPS_type), intent(inout) :: this

Particle to collide with wall

integer, intent(in) :: dir

Cartesian direction to collide with (x,y,z) = (1,2,3)

real(kind=rk), intent(in) :: xwall

Wall position (in one of three Cartesian coordinates

real(kind=rk), intent(in) :: Tc

Collision time

real(kind=rk), intent(in) :: eps

threshold gap for collision

public subroutine DEM_computeWallForces_MEM(particleGroup, scheme, geometry, params, Tc, eps)

Arguments

Type IntentOptional Attributes Name
type(mus_particle_group_type), intent(inout) :: particleGroup

particleGroup to search for collisions in

type(mus_scheme_type), intent(inout) :: scheme

Scheme for access to leveldescriptor

type(mus_geom_type), intent(in) :: geometry

Geometry for access to tree

type(mus_param_type), intent(in) :: params

Params for access to dt, dx, etc.

real(kind=rk) :: Tc

Collision time

real(kind=rk) :: eps

Threshold gap for DEM collisions