mus_particle_creator_module Module

mus_particle_creator_module contains data types and routines for the particle creator object which is used to initialize new particles at specified locations at specified time steps.



Variables

Type Visibility Attributes Name Initial
type(mus_particle_creator_type), public, save :: particle_creator

Derived Types

type, public ::  mus_particle_creator_type

Data type used to create particles with certain properties at specified time steps

Components

Type Visibility Attributes Name Initial
integer, public :: Nparticles

Number of particles in this particle creator object. This is the amount of particles that will be created at each interval.

type(grw_real2darray_type), public :: position

Dynamic array containing positions of particles to be created at each iter First index corresponds to a certain particle, second to x, y, z, rx, ry, rz coordinate

type(grw_real2darray_type), public :: velocity

Dynamic array containing velocities of particles to be created at each iter

type(grw_real2darray_type), public :: force

Dynamic array containing forces of particles to be created at each iter

type(grw_realarray_type), public :: radius

Dynamic array containing radii of particles to be created at each iter

type(grw_realarray_type), public :: mass

Dynamic array containing mass of particles to be created at each iter

type(grw_intarray_type), public :: IDoffset

Dynamic array containing the particleID offsets for each particle These are used to create unique (across all processes) ID's for each particle

logical, public :: init_particle_to_fluid_vel

Logical to indicate whether to initialize particles to the local fluid velocity If this is set to TRUE, particles will be initialized with the local fluid velocity when they are created. In this case the particle_creator%velocities array is not used.

integer, public :: global_Nparticles

Number of particles in the particle creators on all processes

integer, public :: N_times_called = 0

Times that the particleCreator has been called This is the same on all processes

integer, public :: iter_start

Iteration number to start creating particles

integer, public :: iter_end

Iteration number to stop creating particles

integer, public :: iter_interval

Create particles every this many time steps


Functions

public function getNewParticleID(particle_creator, iParticle)

Routine to generate a unique particleID for a particle

Arguments

Type IntentOptional Attributes Name
type(mus_particle_creator_type), intent(in) :: particle_creator

Particle creator object

integer :: iParticle

Index of the particle data we want to use to create this particle in the particle creator object

Return Value integer

public function must_create_new_particles(iter, i_start, i_end, interval)

Function to check whether particles should be created using the particleCreator object at the current iteration iter.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: iter

Current simulation time (in iterations)

integer, intent(in) :: i_start

Start creating new particles at this time (in iterations)

integer, intent(in) :: i_end

Max time (in iterations) to create new particles

integer, intent(in) :: interval

Interval (in iterations) at which to create new particles

Return Value logical

Output logical: TRUE if particles should be created at this instant


Subroutines

public subroutine init_particle_creator(me, Nparticles)

Arguments

Type IntentOptional Attributes Name
type(mus_particle_creator_type), intent(inout) :: me

Particle creator object

integer, intent(in), optional :: Nparticles

Number of particles to create at each time step

public subroutine createNewParticle_MEM(pos, vel, F, radius, mass, particleID, particleGroup, geometry, scheme, myRank)

Routine to create a new particle using the information in the particleCreator object

Arguments

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

Create particle at this position

real(kind=rk), intent(in) :: vel(6)

Initial velocity of particle

real(kind=rk), intent(in) :: F(6)

External forces on particle

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

Particle radius

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

Particle mass

integer, intent(in) :: particleID

ID that should be assigned to this particle

type(mus_particle_group_type), intent(inout) :: particleGroup

ParticleGroup to add this particle to

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

Geometry to initialize particles on the lattice

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

Scheme to initialize particles on the lattice

integer, intent(in) :: myRank

Params for access to dt, dx, etc. This process rank

public subroutine createNewParticle_DPS(pos, vel, F, radius, mass, particleID, particleGroup, geometry, scheme, myRank)

Routine to create a new particle using the information in the particleCreator object

Arguments

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

Create particle at this position

real(kind=rk), intent(in) :: vel(6)

Initial velocity of particle

real(kind=rk), intent(in) :: F(6)

External forces on particle

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

Particle radius

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

Particle mass

integer, intent(in) :: particleID

ID that should be assigned to this particle

type(mus_particle_group_type), intent(inout) :: particleGroup

ParticleGroup to add this particle to

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

Geometry to initialize particles on the lattice

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

Scheme to initialize particles on the lattice

integer, intent(in) :: myRank

Params for access to dt, dx, etc. This process rank

public subroutine create_particles_MEM(particle_creator, particleGroup, scheme, geometry, params, myRank)

Routine to create new fully resolved MEM particles

Arguments

Type IntentOptional Attributes Name
type(mus_particle_creator_type), intent(inout) :: particle_creator

Particle creator object

type(mus_particle_group_type), intent(inout) :: particleGroup

ParticleGroup to add this particle to

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

Scheme to initialize particles on the lattice

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

Geometry to initialize particles on the lattice

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

Params for access to dt, dx, etc.

integer, intent(in) :: myRank

This process rank

public subroutine create_particles_DPS(particle_creator, particleGroup, scheme, geometry, params, myRank)

Routine to create new unresolved DPS particles

Arguments

Type IntentOptional Attributes Name
type(mus_particle_creator_type), intent(inout) :: particle_creator

Particle creator object

type(mus_particle_group_type), intent(inout) :: particleGroup

ParticleGroup to add this particle to

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

Scheme to initialize particles on the lattice

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

Geometry to initialize particles on the lattice

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

Params for access to dt, dx, etc.

integer, intent(in) :: myRank

This process rank

public subroutine check_and_create_new_particles_MEM(particle_creator, iter, particleGroup, scheme, geometry, params, myRank)

Routine that checks if new particles should be created and creates them if so.

Arguments

Type IntentOptional Attributes Name
type(mus_particle_creator_type), intent(inout) :: particle_creator

Particle creator object

integer, intent(in) :: iter

Current LBM iteration

type(mus_particle_group_type), intent(inout) :: particleGroup

particleGroup to add particles to

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

Scheme to initialize particles on the lattice

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

Geometry to initialize particles on the lattice

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

Params

integer, intent(in) :: myRank

This process rank

public subroutine check_and_create_new_particles_DPS(particle_creator, iter, particleGroup, scheme, geometry, params, myRank)

Routine that checks if new particles should be created and creates them if so.

Arguments

Type IntentOptional Attributes Name
type(mus_particle_creator_type), intent(inout) :: particle_creator

Particle creator object

integer, intent(in) :: iter

Current LBM iteration

type(mus_particle_group_type), intent(inout) :: particleGroup

particleGroup to add particles to

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

Scheme to initialize particles on the lattice

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

Geometry to initialize particles on the lattice

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

Params

integer, intent(in) :: myRank

This process rank

public subroutine init_particle_creator_from_blob(particle_creator, particleblob, Nparticles, scheme, geometry, myRank)

Routine to initialize the particle creator object from a particle blob cylinder object Check if particles should be initialized to the local fluid velocity.

Arguments

Type IntentOptional Attributes Name
type(mus_particle_creator_type), intent(inout) :: particle_creator

Particle creator object

type(mus_particle_blob_cylinder_type), intent(inout) :: particleblob

Particle blob object describing the shape of the initial "blob" of particles

integer, intent(in) :: Nparticles

Desired number of particles to fill the ENTIRE blob with (so not just the part of it on this rank, but on all ranks)

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

Scheme to initialize particles on the lattice

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

Geometry to initialize particles on the lattice

integer, intent(in) :: myRank

This process rank

public subroutine init_particle_creator_from_blob_prism(particle_creator, particleblob, Nparticles, scheme, geometry, myRank)

Routine to initialize the particle creator object from a particle blob prism object Check if particles should be initialized to the local fluid velocity.

Arguments

Type IntentOptional Attributes Name
type(mus_particle_creator_type), intent(inout) :: particle_creator

Particle creator object

type(mus_particle_blob_prism_type), intent(inout) :: particleblob

Particle blob object describing the shape of the initial "blob" of particles

integer, intent(in) :: Nparticles

Desired number of particles to fill the ENTIRE blob with (so not just the part of it on this rank, but on all ranks)

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

Scheme to initialize particles on the lattice

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

Geometry to initialize particles on the lattice

integer, intent(in) :: myRank

This process rank

public subroutine fill_blob_positions_gauss(particleblob, positions, Nparticles)

Routine to initialize particle creator object with random positions inside a cylinder described by blob_cylinder type

Arguments

Type IntentOptional Attributes Name
type(mus_particle_blob_cylinder_type), intent(inout) :: particleblob

Particleblob type

type(grw_real2darray_type), intent(inout) :: positions

Positions array to append randomly created values to

integer, intent(in) :: Nparticles

Desired number of particles

public subroutine fill_blob_positions_gauss_prism(particleblob, positions, Nparticles)

Routine to initialize particle creator object with random positions inside a prism described by blob_prism type

Arguments

Type IntentOptional Attributes Name
type(mus_particle_blob_prism_type), intent(inout) :: particleblob

Particleblob type

type(grw_real2darray_type), intent(inout) :: positions

Positions array to append randomly created values to

integer, intent(in) :: Nparticles

Desired number of particles

public subroutine print_particle_creator(particle_creator, logUnit)

Print the data in particle creator object, used for debugging

Arguments

Type IntentOptional Attributes Name
type(mus_particle_creator_type), intent(inout) :: particle_creator

Particle creator object

integer, intent(in) :: logUnit

Unit to write to

public subroutine print_particle_creator_positions(particle_creator, logUnit)

Print the positions in particle creator object, used for debugging

Arguments

Type IntentOptional Attributes Name
type(mus_particle_creator_type), intent(inout) :: particle_creator

Particle creator object

integer, intent(in) :: logUnit

Unit to write to