|
MFC
Exascale flow solver
|
Contains module m_collisions. More...
Go to the source code of this file.
Modules | |
| module | m_collisions |
| Ghost-node immersed boundary method: locates ghost/image points, computes interpolation coefficients, and corrects the flow state. | |
Functions/Subroutines | |
| real(wp) function | m_collisions::f_inv_tangential_mass (patch) |
| inverse effective tangential mass of a sphere or circle at its contact point: 1/m + r^2/I | |
| subroutine | m_collisions::s_ib_friction_direction (tangential_vector, normal_force_mag, inv_mass_t) |
| scales the slip velocity into the friction direction, -F_t = mu*|F_n|*v_t/max(|v_t|, eps). With ib_friction_slip_eps > 0, eps is floored at the stick limit mu*|F_n|*dt/m_t, which keeps the explicit update stable. With 0 it is v_t/|v_t|, left unscaled at exactly zero slip. | |
| subroutine, public | m_collisions::s_initialize_collisions_module () |
| subroutine | m_collisions::s_resize_pair_bits (num_bodies) |
| Size the pair bitset for num_bodies IBs, doubled so a growing body count does not reallocate every step (empty on exit). | |
| subroutine, public | m_collisions::s_apply_collision_forces (ghost_points, num_gps, ib_markers, forces, torques) |
| subroutine | m_collisions::s_apply_ib_collision_forces_soft_sphere (num_considered_collisions, forces, torques) |
| applies collision forces to IBs assuming a soft-sphere collision model (all IBs are circles or spheres) | |
| subroutine | m_collisions::s_apply_wall_collision_forces_soft_sphere (forces, torques) |
| applies collision forces to IBs assuming a soft-sphere collision model (all IBs are circles or spheres) | |
| pure integer(kind=8) function | m_collisions::f_pair_bit_index (a, b, num_bodies) |
| Triangular index (0-based) of the unordered pair a < b, both in 1 to num_bodies. | |
| subroutine | m_collisions::s_detect_ib_collisions (gps, ib_markers, num_gps, num_considered_collisions) |
| Uses ghost-point information to find IB pairs that may be colliding, effectively an optimized nearest-neighbor search: every ghost point with another patch's marker within 2 cells gives a candidate pair. Both patches record it: the rank that owns the contact point may hold interior ghost points of only one of them, so one-sided detection can leave that rank blind to a contact within a cell of its boundary. The many duplicate candidates are dropped on the GPU: each candidate is mapped to its sorted neighborhood pair (a, b) and claims that pair's bit in pair_bits with an atomic OR, and only the thread that flips the bit appends the pair. Bits are cleared by s_clear_pair_bits after the forces. A pair's periodic image is taken from the claiming candidate; two different images of one pair would need a domain about two particles across. | |
| subroutine | m_collisions::s_clear_pair_bits (num_considered_collisions) |
| Clear the bits the last s_detect_ib_collisions set (every set bit belongs to a recorded pair, so whole words can be zeroed). | |
| subroutine | m_collisions::s_detect_wall_collisions (any_wall_collision) |
| uses boundary conditions and particle locations to check for wall conditions | |
| logical function, public | m_collisions::f_neighborhood_ranks_own_location (location) |
| function checks if this local MPI processor owns this specific collision | |
| subroutine, public | m_collisions::s_finalize_collisions_module () |
Variables | |
| integer, dimension(:,:), allocatable | m_collisions::collision_lookup |
| real(wp), dimension(:,:), allocatable | m_collisions::wall_overlap_distances |
| real(wp) | m_collisions::spring_stiffness |
| real(wp) | m_collisions::damping_parameter |
| logical, public | m_collisions::collisions_active |
| true when any IB-IB or IB-wall contact was detected on this rank since the last adaptive-dt computation | |
| integer, dimension(:), allocatable | m_collisions::pair_bits |
| One bit per unordered pair (a < b) of this rank's IBs (local + neighborhood indices, a triangular index over pair_bits_capacity): the ghost-point candidate pass claims each pair with an atomic OR, so only the first thread to find a pair records it and duplicates are dropped on the GPU. Bits are cleared after the forces are applied, so the set is empty between calls. Sized from num_ibs and regrown with it; memory is quadratic in the body count (1e4 bodies take 6 MB). | |
| integer | m_collisions::pair_bits_capacity |
| Number of IBs the bitset is indexed for. | |
Contains module m_collisions.
Definition in file m_collisions.fpp.f90.