From ca04f9ec6d9397f8822ada8640518998ae17eaa8 Mon Sep 17 00:00:00 2001 From: Zhi Date: Wed, 11 Sep 2024 18:24:13 -0400 Subject: [PATCH] fix incorrect calculation --- Source/hydro/Castro_ctu.cpp | 4 ++-- Source/hydro/Castro_mol.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/hydro/Castro_ctu.cpp b/Source/hydro/Castro_ctu.cpp index 7da960180d..c2f5e3fc40 100644 --- a/Source/hydro/Castro_ctu.cpp +++ b/Source/hydro/Castro_ctu.cpp @@ -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(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(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]); } }); diff --git a/Source/hydro/Castro_mol.cpp b/Source/hydro/Castro_mol.cpp index 49bbf9d2bc..688b298a70 100644 --- a/Source/hydro/Castro_mol.cpp +++ b/Source/hydro/Castro_mol.cpp @@ -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(i) + 0.5_rt)*dx[0]; + Real r = prob_lo[0] + (static_cast(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]); } }