From 0cf555fb8a04e507065b2102548ca28f69b04308 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 8 Jul 2024 10:52:48 -0600 Subject: [PATCH] Enable multiple IB boxes to be defined --- amr-wind/immersed_boundary/bluff_body/box_ops.H | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/amr-wind/immersed_boundary/bluff_body/box_ops.H b/amr-wind/immersed_boundary/bluff_body/box_ops.H index 4c2175f7a0..11567c6366 100644 --- a/amr-wind/immersed_boundary/bluff_body/box_ops.H +++ b/amr-wind/immersed_boundary/bluff_body/box_ops.H @@ -76,21 +76,23 @@ struct InitDataOp const amrex::Real y = problo[1] + (j + 0.5) * dx[1]; const amrex::Real z = problo[2] + (k + 0.5) * dx[2]; + amrex::Real phi_loc = 0; if ((std::abs(x - x0) <= 0.5 * l) && (std::abs(y - y0) <= 0.5 * w) && (std::abs(z - z0) <= 0.5 * h)) { - phi(i, j, k) = std::max( + phi_loc = std::max( std::abs(x - x0) - 0.5 * l, std::max( std::abs(y - y0) - 0.5 * w, std::abs(z - z0) - 0.5 * h)); } else { - phi(i, j, k) = std::min( + phi_loc = std::min( std::abs(std::abs(x - x0) - 0.5 * l), std::min( std::abs(std::abs(y - y0) - 0.5 * w), std::abs(std::abs(z - z0) - 0.5 * h))); } + phi(i, j, k) = std::min(phi_loc, phi(i, j, k)); }); const auto& nbx = mfi.nodaltilebox(); amrex::ParallelFor(