Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 committed Sep 19, 2024
1 parent 950b9c4 commit 058febb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Source/driver/timestep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Castro::estdt_cfl (int is_new)
Real dt2;
#if AMREX_SPACEDIM >= 2
dt2 = dx[1]/(c + std::abs(uy));
if (geom.IsSPHERICAL) {
if (geom.IsSPHERICAL()) {
// dx[1] in Spherical2D is just dtheta, need rdtheta for physical length
// so just multiply by the smallest r
dt2 *= geom.ProbLo(0) + 0.5_rt * dx[0];
Expand Down Expand Up @@ -211,7 +211,7 @@ Castro::estdt_mhd (int is_new)
Real dt2;
#if AMREX_SPACEDIM >= 2
dt2 = dx[1]/(cy + std::abs(uy));
if (geom.IsSPHERICAL) {
if (geom.IsSPHERICAL()) {
dt2 *= geom.ProbLo(0) + 0.5_rt * dx[0];
}
#else
Expand Down Expand Up @@ -295,7 +295,7 @@ Castro::estdt_temp_diffusion (int is_new)
Real dt2;
#if AMREX_SPACEDIM >= 2
dt2 = 0.5_rt * dx[1]*dx[1] / D;
if (geom.IsSPHERICAL) {
if (geom.IsSPHERICAL()) {
Real r = geom.ProbLo(0) + 0.5_rt * dx[0];
dt2 *= r * r;
}
Expand Down Expand Up @@ -382,7 +382,7 @@ Castro::estdt_burning (int is_new)
#else
Real r = 1.0_rt;
#if AMREX_SPACEDIM >= 2
if (geom.IsSPHERICAL) {
if (geom.IsSPHERICAL()) {
r = geom.ProbLo(0) + 0.5_rt * dx[0];
}
#endif
Expand Down Expand Up @@ -541,7 +541,7 @@ Castro::estdt_rad (int is_new)
Real dt1 = dx[0] / (c + std::abs(ux));
#if AMREX_SPACEDIM >= 2
Real dt2 = dx[1] / (c + std::abs(uy));
if (geom.IsSPHERICAL) {
if (geom.IsSPHERICAL()) {
dt2 *= geom.ProbLo(0) + 0.5_rt * dx[0];
}
#else
Expand Down
2 changes: 1 addition & 1 deletion Source/hydro/Castro_hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ Castro::check_for_cfl_violation(const MultiFab& State, const Real dt)
Real dtdy = 0.0_rt;
if (AMREX_SPACEDIM >= 2) {
dtdy = dt / dx[1];
if (geom.IsSPHERICAL) {
if (geom.IsSPHERICAL()) {
// dx[1] in Spherical2D is just rdtheta, need rdtheta for physical length
// Just choose to divide by the smallest r
dtdy /= geom.ProbLo(0) + 0.5_rt * dx[0];
Expand Down

0 comments on commit 058febb

Please sign in to comment.