MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_particle_cloud Module Reference

Generates particle beds by converting particle_cloud patch specifications into individual immersed boundary patches before domain reduction. Each rank runs the same deterministic placement so no MPI broadcast of particle positions is needed. More...

Functions/Subroutines

impure subroutine, public s_generate_particle_clouds (particle_cloud_ibs)
 Generate all particle beds and fill particle_cloud_ibs. Called on all ranks before s_reduce_ib_patch_array.
subroutine s_particle_cloud_random_box (cloud_idx, ib_idx, particle_cloud_ibs)
 Generates a random distributions of particles in a box with a minimum spacing.
subroutine s_particle_cloud_lattice (cloud_idx, ib_idx, particle_cloud_ibs)
 Places particles on the optimally dense lattice for the cloud region: a triangular lattice in 2D, a face-centered cubic lattice in 3D. The lattice spacing is set by the particle density (num_particles over the region area/volume); if that spacing falls below the required centre-to-centre distance (2*radius + min_spacing), the region is too dense and the run is aborted.
subroutine s_add_cloud_particle (cloud_idx, ib_idx, geom, px, py, pz, particle_cloud_ibs)
 Writes a single placed particle into particle_cloud_ibs at the next free slot, advancing ib_idx. Shared by all packing methods so the per-particle ib_patch_parameters setup stays in one place.
real(wp) function f_xorshift (seed)
 Xorshift PRNG. Advances seed in-place and returns a value in [0, 1).
integer function f_bin_hash (bx, by, bz, hash_size)
 Hash bin coordinates to a 1-indexed slot in [1, hash_size]. Uses large prime multipliers to spread bins across buckets. Hash collisions are benign: the distance check catches false neighbours.

Detailed Description

Generates particle beds by converting particle_cloud patch specifications into individual immersed boundary patches before domain reduction. Each rank runs the same deterministic placement so no MPI broadcast of particle positions is needed.

Function/Subroutine Documentation

◆ f_bin_hash()

integer function m_particle_cloud::f_bin_hash ( integer, intent(in) bx,
integer, intent(in) by,
integer, intent(in) bz,
integer, intent(in) hash_size )
private

Hash bin coordinates to a 1-indexed slot in [1, hash_size]. Uses large prime multipliers to spread bins across buckets. Hash collisions are benign: the distance check catches false neighbours.

Definition at line 322 of file m_particle_cloud.fpp.f90.

Here is the caller graph for this function:

◆ f_xorshift()

real(wp) function m_particle_cloud::f_xorshift ( integer, intent(inout) seed)
private

Xorshift PRNG. Advances seed in-place and returns a value in [0, 1).

Definition at line 307 of file m_particle_cloud.fpp.f90.

Here is the caller graph for this function:

◆ s_add_cloud_particle()

subroutine m_particle_cloud::s_add_cloud_particle ( integer, intent(in) cloud_idx,
integer, intent(inout) ib_idx,
integer, intent(in) geom,
real(wp), intent(in) px,
real(wp), intent(in) py,
real(wp), intent(in) pz,
type(ib_patch_parameters), dimension(:), intent(inout) particle_cloud_ibs )
private

Writes a single placed particle into particle_cloud_ibs at the next free slot, advancing ib_idx. Shared by all packing methods so the per-particle ib_patch_parameters setup stays in one place.

Definition at line 266 of file m_particle_cloud.fpp.f90.

Here is the caller graph for this function:

◆ s_generate_particle_clouds()

impure subroutine, public m_particle_cloud::s_generate_particle_clouds ( type(ib_patch_parameters), dimension(:), intent(out), allocatable particle_cloud_ibs)

Generate all particle beds and fill particle_cloud_ibs. Called on all ranks before s_reduce_ib_patch_array.

Definition at line 24 of file m_particle_cloud.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_particle_cloud_lattice()

subroutine m_particle_cloud::s_particle_cloud_lattice ( integer, intent(in) cloud_idx,
integer, intent(inout) ib_idx,
type(ib_patch_parameters), dimension(:), intent(inout) particle_cloud_ibs )
private

Places particles on the optimally dense lattice for the cloud region: a triangular lattice in 2D, a face-centered cubic lattice in 3D. The lattice spacing is set by the particle density (num_particles over the region area/volume); if that spacing falls below the required centre-to-centre distance (2*radius + min_spacing), the region is too dense and the run is aborted.

Definition at line 181 of file m_particle_cloud.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_particle_cloud_random_box()

subroutine m_particle_cloud::s_particle_cloud_random_box ( integer, intent(in) cloud_idx,
integer, intent(inout) ib_idx,
type(ib_patch_parameters), dimension(:), intent(inout) particle_cloud_ibs )
private

Generates a random distributions of particles in a box with a minimum spacing.

Definition at line 61 of file m_particle_cloud.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function: