mus_particle_boundary_module Module

mus_particle_boundary_module contains routines and data types to handle the interaction of particles with (periodic) boundaries


Uses


Variables

Type Visibility Attributes Name Initial
type(mus_particle_boundarydata_type), public, save :: pgBndData

Derived Types

type, public ::  mus_particle_boundarydata_type

Components

Type Visibility Attributes Name Initial
real(kind=rk), public :: bnd(6)

boundary locations [xmin, xmax, ymin, ymax, zmin, zma]

real(kind=rk), public :: domain_size(3)

length of domain in x, y, z directions

integer, public :: bnd_coord(6)

integer coordinates of bnd in x, y, z directions

logical, public :: useBnd

logical set to TRUE if particle domain boundaries are active

logical, public :: periodicBnd(6)
logical, public :: wallBnd(6)

Functions

public function getNeighborCoord(coord, nx, ny, nz, boundaryData) result(neighborCoord)

getNeighborCoord gets the coordinate of the element offset from input coord by (nx,ny,nz) while taking into account periodicity

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: coord(4)
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
type(mus_particle_boundarydata_type), intent(in) :: boundaryData

Return Value integer, (4)

public function computeDisplacement(x1, x2, boundaryData) result(r12)

computeDistance computes the shortest distance between points x1 and x2 In doing so it takes possible periodic boundaries into account.

Arguments

Type IntentOptional Attributes Name
real(kind=rk) :: x1(3)

xyz coordinates of point 1

real(kind=rk) :: x2(3)

xyz coordinates of point 2

type(mus_particle_boundarydata_type), intent(in) :: boundaryData

Boundary data tells us the domain bounds and if we have periodic bounds

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


Subroutines

public subroutine wrapPeriodicCoord(coord, boundaryData)

wrapPeriodicCoord modifies the input coord to take into account periodicity

Arguments

Type IntentOptional Attributes Name
integer, intent(inout) :: coord(4)
type(mus_particle_boundarydata_type), intent(in) :: boundaryData

public subroutine wrapPeriodicPos(pos, boundaryData)

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(inout) :: pos(3)
type(mus_particle_boundarydata_type) :: boundaryData

public subroutine calcPeriodicRsurface(r, R_particle, boundaryData)

calcPeriodicRsurface is used to calculate the vector from the particle origin to a point on the surface in presence of periodic boundaries. Usage: first calculate the distance from the particle origin to a surface element using r = baryOfSurface - x_origin. If the particle is close to a periodic boundary this vector may not be correct. In that case a call to calcPeriodicRsurface modifies the vector r to take into account the periodicity. This is done by checking if the magnitude of r is less than the particle radius R_particle (which can be modified with some tolerance if needed). This routine is used for fully resolved (MEM) particles only.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(inout) :: r(3)

Original vector r

real(kind=rk), intent(inout) :: R_particle

Particle radius + a tolerance if desired

type(mus_particle_boundarydata_type), intent(in) :: boundaryData

Datatype containing periodic boundary data

private subroutine calcPeriodicDistanceToSurface(ri, R, L)

wrap_periodic checks whether a distance r from x_particle to

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(inout) :: ri

Distance (in one of the Cartesian directions xi) from the particle origin to the barycenter of a point on the surface.

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

Radius of the particle

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

Length of the periodic domain (in direction xi )