Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix apply_av in spherical #3000

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Source/hydro/advection_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,19 @@ Castro::apply_av(const Box& bx,
Array4<Real> const& flux) {

const auto dx = geom.CellSizeArray();
const auto coord = geom.Coord();
const auto problo = geom.ProbLoArray();

Real diff_coeff = difmag;

amrex::ParallelFor(bx,
[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{
Real dL = dx[idir];
if (coord == 2 && idir == 1) {
Real r = problo[0] + (static_cast<Real>(i) + 0.5_rt) * dx[0];
dL *= r;
}

Real div1;
if (idir == 0) {
Expand Down Expand Up @@ -405,7 +412,7 @@ Castro::apply_av(const Box& bx,
div_var = div1 * (uin(i,j,k,n) - uin(i,j,k-dg2,n));
}

flux(i,j,k,n) += dx[idir] * div_var;
flux(i,j,k,n) += dL * div_var;
}
});
}
Expand Down