Skip to content

Commit

Permalink
fix apply_av in spherical (#3000)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 authored Nov 22, 2024
1 parent cb3ccf4 commit 4f80f87
Showing 1 changed file with 8 additions and 1 deletion.
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

0 comments on commit 4f80f87

Please sign in to comment.