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

update mom_flux_has_p to address with 2D spherical #2958

Merged
merged 11 commits into from
Sep 16, 2024
6 changes: 3 additions & 3 deletions Source/hydro/Castro_ctu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ Castro::consup_hydro(const Box& bx,
// Add gradp term to momentum equation -- only for axisymmetric
// coords (and only for the radial flux).

U_new(i,j,k,UMX) += - dt * (qx(i+1,j,k,GDPRES) - qx(i,j,k,GDPRES)) / geomdata.CellSize()[0];
U_new(i,j,k,UMX) += - dt * (qx(i+1,j,k,GDPRES) - qx(i,j,k,GDPRES)) / geomdata.CellSize(1);
zingale marked this conversation as resolved.
Show resolved Hide resolved

#if AMREX_SPACEDIM >= 2
} else if (n == UMY && !mom_flux_has_p(1, 1, geomdata.Coord())) {
// Add gradp term to polar(theta) momentum equation for Spherical 2D geometry

Real r = geom.ProbLoArray()[0] + (static_cast<Real>(i) + 0.5_rt) * geomdata.CellSize()[0];
U_new(i,j,k,UMY) += - dt * (qy(i,j+1,k,GDPRES) - qy(i,j,k,GDPRES)) / (r * geomdata.CellSize()[1]);
Real r = geomdata.ProbLo(0) + (static_cast<Real>(i) + 0.5_rt) * geomdata.CellSize(0);
U_new(i,j,k,UMY) += - dt * (qy(i,j+1,k,GDPRES) - qy(i,j,k,GDPRES)) / (r * geomdata.CellSize(1));
#endif
}
});
Expand Down