Skip to content

Commit

Permalink
fix incorrect calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhichen3 committed Sep 11, 2024
1 parent 79562a8 commit ca04f9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/hydro/Castro_ctu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ Castro::consup_hydro(const Box& bx,
} 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 = geomdata.ProbLoArray()[0] + (static_cast<Real>(i) + 0.5_rt) * geomdata.Coord()[0];
U_new(i,j,k,UMY) += - dt * (qy(i,j+1,k,GDPRES) - qy(i,j,k,GDPRES)) / (r * geomdata.CellSize()[0]);
Real r = geomdata.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]);

}
});
Expand Down
2 changes: 1 addition & 1 deletion Source/hydro/Castro_mol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ Castro::mol_consup(const Box& bx, // NOLINT(readability-convert-member-function
} else if (n == UMY && !mom_flux_has_p(1, 1, coord)) {
// Add gradp term to polar(theta) momentum equation for Spherical 2D geometry

Real r = prob_lo[0] + (static_cast<Real>(i) + 0.5_rt)*dx[0];
Real r = prob_lo[0] + (static_cast<Real>(i) + 0.5_rt) * dx[0];
update(i,j,k,UMY) -= (q1(i,j+1,k,GDPRES) - q1(i,j,k,GDPRES)) / (r * dx[1]);
}
}
Expand Down

0 comments on commit ca04f9e

Please sign in to comment.