Skip to content

Commit cc2b18c

Browse files
committed
fix apply_av in spherical
1 parent f02444d commit cc2b18c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: Source/hydro/advection_util.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,19 @@ Castro::apply_av(const Box& bx,
358358
Array4<Real> const& flux) {
359359

360360
const auto dx = geom.CellSizeArray();
361+
const auto coord = geom.Coord();
362+
const auto problo = geom.ProbLoArray();
361363

362364
Real diff_coeff = difmag;
363365

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

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

408-
flux(i,j,k,n) += dx[idir] * div_var;
415+
flux(i,j,k,n) += dL * div_var;
409416
}
410417
});
411418
}

0 commit comments

Comments
 (0)