From 0a3d2d712f714f0cf1c5f59b80a8ff450da65cb5 Mon Sep 17 00:00:00 2001 From: Spencer Bryngelson Date: Fri, 9 Oct 2026 23:30:58 -0400 Subject: [PATCH] Default and broadcast particle_cloud shell_axis in pre_process pre_process reads particle_cloud(i)%shell_axis in s_sample_cloud_candidate but never gave it a default or broadcast it; only simulation, which does not use it, did both. Under file_per_process every rank samples the cloud itself, so non-root ranks placed hemisphere-shell particles with an uninitialized axis, and without a namelist value even rank 0 read garbage. Default it to 3 (+z) and broadcast it with the other hand-written particle_cloud members, mirroring simulation. Verified with a 3D hemisphere-shell cloud (shell_axis = 1, file_per_process, 20 particles): the IB state from 2 ranks now matches the 1-rank run exactly and every particle lies on the +x side. --- src/pre_process/m_global_parameters.fpp | 1 + src/pre_process/m_mpi_proxy.fpp | 1 + 2 files changed, 2 insertions(+) diff --git a/src/pre_process/m_global_parameters.fpp b/src/pre_process/m_global_parameters.fpp index b358516fbf..130a25a0bd 100644 --- a/src/pre_process/m_global_parameters.fpp +++ b/src/pre_process/m_global_parameters.fpp @@ -396,6 +396,7 @@ contains particle_cloud(i)%moving_ibm = 0 particle_cloud(i)%seed = 0 particle_cloud(i)%cloud_geometry = 1 + particle_cloud(i)%shell_axis = 3 particle_cloud(i)%packing_method = dflt_int particle_cloud(i)%periodic = 0 end do diff --git a/src/pre_process/m_mpi_proxy.fpp b/src/pre_process/m_mpi_proxy.fpp index 6753d818c3..592b2995bc 100644 --- a/src/pre_process/m_mpi_proxy.fpp +++ b/src/pre_process/m_mpi_proxy.fpp @@ -147,6 +147,7 @@ contains call MPI_BCAST(particle_cloud(i)%moving_ibm, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) call MPI_BCAST(particle_cloud(i)%seed, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) call MPI_BCAST(particle_cloud(i)%cloud_geometry, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) + call MPI_BCAST(particle_cloud(i)%shell_axis, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) call MPI_BCAST(particle_cloud(i)%packing_method, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) call MPI_BCAST(particle_cloud(i)%periodic, 1, MPI_INTEGER, 0, MPI_COMM_WORLD, ierr) end do