From 4273c849e8df48dd7ff2aa4ddf2dfd58f04f5ffc Mon Sep 17 00:00:00 2001 From: danieljvickers Date: Sun, 15 Mar 2026 07:51:06 -0400 Subject: [PATCH 1/2] Remove interior point conservative variable protection for stationary boundaries --- src/simulation/m_ibm.fpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index b87f5a1b19..d5eeb527cb 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -192,7 +192,7 @@ contains type(ghost_point) :: gp type(ghost_point) :: innerp - ! set the Moving IBM interior Pressure Values + ! set the Moving IBM interior conservative variables $:GPU_PARALLEL_LOOP(private='[i,j,k,patch_id,rho]', copyin='[E_idx,momxb]', collapse=3) do l = 0, p do k = 0, n @@ -200,18 +200,16 @@ contains patch_id = ib_markers%sf(j, k, l) if (patch_id /= 0) then q_prim_vf(E_idx)%sf(j, k, l) = 1._wp - if (patch_ib(patch_id)%moving_ibm > 0) then - rho = 0._wp - do i = 1, num_fluids - rho = rho + q_prim_vf(contxb + i - 1)%sf(j, k, l) - end do + rho = 0._wp + do i = 1, num_fluids + rho = rho + q_prim_vf(contxb + i - 1)%sf(j, k, l) + end do - ! Sets the momentum - do i = 1, num_dims - q_cons_vf(momxb + i - 1)%sf(j, k, l) = patch_ib(patch_id)%vel(i)*rho - q_prim_vf(momxb + i - 1)%sf(j, k, l) = patch_ib(patch_id)%vel(i) - end do - end if + ! Sets the momentum + do i = 1, num_dims + q_cons_vf(momxb + i - 1)%sf(j, k, l) = patch_ib(patch_id)%vel(i)*rho + q_prim_vf(momxb + i - 1)%sf(j, k, l) = patch_ib(patch_id)%vel(i) + end do end if end do end do From b497afc221380ad4eb3dc8fe219c9d3c7542d76b Mon Sep 17 00:00:00 2001 From: danieljvickers Date: Wed, 15 Apr 2026 18:55:43 -0400 Subject: [PATCH 2/2] Fixed addaptive timestep bug --- src/simulation/m_collisions.fpp | 2 +- src/simulation/m_data_output.fpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simulation/m_collisions.fpp b/src/simulation/m_collisions.fpp index 5f5fcf0b5e..fe860cb055 100644 --- a/src/simulation/m_collisions.fpp +++ b/src/simulation/m_collisions.fpp @@ -148,7 +148,7 @@ contains $:GPU_ATOMIC(atomic='update') forces(pid2, l) = forces(pid2, l) - (normal_force(l) + tangental_force(l)) $:GPU_ATOMIC(atomic='update') - torques(pid2, l) = torques(pid2, l) - torque(l)*patch_ib(pid2)%radius/patch_ib(pid1)%radius + torques(pid2, l) = torques(pid2, l) + torque(l)*patch_ib(pid2)%radius/patch_ib(pid1)%radius end do end if end if diff --git a/src/simulation/m_data_output.fpp b/src/simulation/m_data_output.fpp index 394882ef73..d0b0c895c2 100644 --- a/src/simulation/m_data_output.fpp +++ b/src/simulation/m_data_output.fpp @@ -170,7 +170,7 @@ contains call s_create_directory(trim(case_dir) // '/restart_data') write (file_loc, '(A)') 'ib_state.dat' file_loc = trim(case_dir) // '/restart_data/' // trim(file_loc) - if (t_step_start /= 0) then + if (t_step_start > 0) then ! On restart, append to existing file to preserve history open (newunit=ib_state_unit, file=trim(file_loc), form='unformatted', access='stream', status='old', & & position='append', iostat=ios)