From 38bb6d0c54c40ee339d7e23ec42dbef15a0be67c Mon Sep 17 00:00:00 2001 From: Anand Date: Wed, 18 Jun 2025 18:09:04 -0400 Subject: [PATCH 1/3] IBM frontier fix --- src/simulation/m_ibm.fpp | 38 +++++--------------------------------- 1 file changed, 5 insertions(+), 33 deletions(-) diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index 806b45c2da..29756cb66f 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -18,8 +18,6 @@ module m_ibm use m_helper - use m_helper_basic !< Functions to compare floating point numbers - use m_constants implicit none @@ -147,7 +145,7 @@ contains real(wp) :: qv_K real(wp), dimension(num_fluids) :: Gs - real(wp) :: pres_IP + real(wp) :: pres_IP, coeff real(wp), dimension(3) :: vel_IP, vel_norm_IP real(wp) :: c_IP real(wp), dimension(num_fluids) :: alpha_rho_IP, alpha_IP @@ -166,7 +164,7 @@ contains type(ghost_point) :: gp type(ghost_point) :: innerp - !$acc parallel loop gang vector private(physical_loc, dyn_pres, alpha_rho_IP, alpha_IP, pres_IP, vel_IP, vel_g, vel_norm_IP, r_IP, v_IP, pb_IP, mv_IP, nmom_IP, presb_IP, massv_IP, rho, gamma, pi_inf, Re_K, G_K, Gs, gp, innerp, norm, buf, j, k, l, q) + !$acc parallel loop gang vector private(physical_loc, dyn_pres, alpha_rho_IP, alpha_IP, pres_IP, vel_IP, vel_g, vel_norm_IP, r_IP, v_IP, pb_IP, mv_IP, nmom_IP, presb_IP, massv_IP, rho, gamma, pi_inf, Re_K, G_K, Gs, gp, innerp, norm, buf, j, k, l, q, coeff) do i = 1, num_gps gp = ghost_points(i) @@ -226,7 +224,7 @@ contains alpha_rho_IP, Re_K) end if end if - + ! Calculate velocity of ghost cell if (gp%slip) then norm(1:3) = levelset_norm%sf(gp%loc(1), gp%loc(2), gp%loc(3), gp%ib_patch_id, 1:3) @@ -313,40 +311,14 @@ contains !$acc parallel loop gang vector private(physical_loc, dyn_pres, alpha_rho_IP, alpha_IP, vel_g, rho, gamma, pi_inf, Re_K, innerp, j, k, l, q) do i = 1, num_inner_gps - vel_g = 0._wp innerp = inner_points(i) j = innerp%loc(1) k = innerp%loc(2) l = innerp%loc(3) - patch_id = inner_points(i)%ib_patch_id - - ! Calculate physical location of GP - if (p > 0) then - physical_loc = [x_cc(j), y_cc(k), z_cc(l)] - else - physical_loc = [x_cc(j), y_cc(k), 0._wp] - end if - - !$acc loop seq - do q = 1, num_fluids - q_prim_vf(q)%sf(j, k, l) = alpha_rho_IP(q) - q_prim_vf(advxb + q - 1)%sf(j, k, l) = alpha_IP(q) - end do - - if (surface_tension) then - q_prim_vf(c_idx)%sf(j, k, l) = c_IP - end if - - call s_convert_species_to_mixture_variables_acc(rho, gamma, pi_inf, qv_K, alpha_IP, & - alpha_rho_IP, Re_K) - - dyn_pres = 0._wp !$acc loop seq do q = momxb, momxe - q_cons_vf(q)%sf(j, k, l) = rho*vel_g(q - momxb + 1) - dyn_pres = dyn_pres + q_cons_vf(q)%sf(j, k, l)* & - vel_g(q - momxb + 1)/2._wp + q_cons_vf(q)%sf(j, k, l) = 0._wp end do end do @@ -410,7 +382,7 @@ contains bound = p end if - if (f_approx_equal(norm(dim), 0._wp)) then + if (norm(dim) == 0) then ghost_points(q)%ip_grid(dim) = ghost_points(q)%loc(dim) else if (norm(dim) > 0) then From 6ea719c2b35d0432f8f81685f94edf53aae2ad9a Mon Sep 17 00:00:00 2001 From: Anand Date: Wed, 18 Jun 2025 18:23:35 -0400 Subject: [PATCH 2/3] Merge --- src/simulation/m_ibm.fpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index 29756cb66f..569e112d33 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -18,6 +18,8 @@ module m_ibm use m_helper + use m_helper_basic !< Functions to compare floating point numbers + use m_constants implicit none @@ -164,7 +166,7 @@ contains type(ghost_point) :: gp type(ghost_point) :: innerp - !$acc parallel loop gang vector private(physical_loc, dyn_pres, alpha_rho_IP, alpha_IP, pres_IP, vel_IP, vel_g, vel_norm_IP, r_IP, v_IP, pb_IP, mv_IP, nmom_IP, presb_IP, massv_IP, rho, gamma, pi_inf, Re_K, G_K, Gs, gp, innerp, norm, buf, j, k, l, q, coeff) + !$acc parallel loop gang vector private(physical_loc, dyn_pres, alpha_rho_IP, alpha_IP, pres_IP, vel_IP, vel_g, vel_norm_IP, r_IP, v_IP, pb_IP, mv_IP, nmom_IP, presb_IP, massv_IP, rho, gamma, pi_inf, Re_K, G_K, Gs, gp, innerp, norm, buf, j, k, l, q) do i = 1, num_gps gp = ghost_points(i) @@ -224,7 +226,7 @@ contains alpha_rho_IP, Re_K) end if end if - + ! Calculate velocity of ghost cell if (gp%slip) then norm(1:3) = levelset_norm%sf(gp%loc(1), gp%loc(2), gp%loc(3), gp%ib_patch_id, 1:3) @@ -382,7 +384,7 @@ contains bound = p end if - if (norm(dim) == 0) then + if (f_approx_equal(norm(dim), 0._wp)) then ghost_points(q)%ip_grid(dim) = ghost_points(q)%loc(dim) else if (norm(dim) > 0) then From f46f69ceb2b285c2c06071ae399b8e94168a6b1f Mon Sep 17 00:00:00 2001 From: anandrdbz <62814442+anandrdbz@users.noreply.github.com> Date: Wed, 18 Jun 2025 18:51:12 -0400 Subject: [PATCH 3/3] Update m_ibm.fpp --- src/simulation/m_ibm.fpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulation/m_ibm.fpp b/src/simulation/m_ibm.fpp index 569e112d33..05107dbb19 100644 --- a/src/simulation/m_ibm.fpp +++ b/src/simulation/m_ibm.fpp @@ -147,7 +147,7 @@ contains real(wp) :: qv_K real(wp), dimension(num_fluids) :: Gs - real(wp) :: pres_IP, coeff + real(wp) :: pres_IP real(wp), dimension(3) :: vel_IP, vel_norm_IP real(wp) :: c_IP real(wp), dimension(num_fluids) :: alpha_rho_IP, alpha_IP