calcPeriodicRsurface Subroutine

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