Skip to content

Commit

Permalink
Enable multiple IB boxes to be defined
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf committed Jul 9, 2024
1 parent b8ab898 commit 0cf555f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions amr-wind/immersed_boundary/bluff_body/box_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,23 @@ struct InitDataOp<Box>
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(
Expand Down

0 comments on commit 0cf555f

Please sign in to comment.