Skip to content

Commit 6af80f9

Browse files
committed
fix(ibm): initialize the burning-surface fields on particle-cloud IB patches
particle_cloud_ibs is allocated without default initialization, and s_add_cloud_particle set only the geometry/motion members. s_reduce_ib_patch_array then copies the whole struct into patch_ib, overwriting the zeroed defaults from s_assign_default_values_to_user_inputs -- so v_blow, inj_species and burn_rate_exp/pref reached the solver as uninitialized memory. That was latent until this branch added the first read of those members in m_ibm: a garbage v_blow > 0 superimposes a garbage wall-normal velocity on the ghost points, which NaNs the field. It reproduced only where the allocation is not already zero-filled -- Frontier AMD failed 2D_mibm_particle_cloud with 'ICFL is NaN' at step 2 while every NVHPC lane (and local CPU/OMP/ACC) passed. Sets the four fields for the inert particle surfaces; audited that these are exactly the patch_ib members m_ibm reads (airfoil_id/model_id/length_x remain unset but are never read for circle/sphere particles).
1 parent 02a40cc commit 6af80f9

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/simulation/m_particle_cloud.fpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,17 @@ contains
300300
particle_cloud_ibs(ib_idx)%moving_ibm = particle_cloud(cloud_idx)%moving_ibm
301301
particle_cloud_ibs(ib_idx)%slip = .false.
302302

303+
! Particles are inert surfaces. These must be set explicitly: particle_cloud_ibs is
304+
! allocated (not default-initialized) and s_reduce_ib_patch_array copies the whole
305+
! struct into patch_ib, overwriting the defaults from
306+
! s_assign_default_values_to_user_inputs -- so anything left unset here reaches the
307+
! solver as uninitialized memory (a nonzero v_blow injects a garbage wall-normal
308+
! velocity and NaNs the field).
309+
particle_cloud_ibs(ib_idx)%v_blow = 0._wp
310+
particle_cloud_ibs(ib_idx)%inj_species = 0
311+
particle_cloud_ibs(ib_idx)%burn_rate_exp = 0._wp
312+
particle_cloud_ibs(ib_idx)%burn_rate_pref = 0._wp
313+
303314
end subroutine s_add_cloud_particle
304315

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

0 commit comments

Comments
 (0)