From 31cc3cfcddc01a56766f447391b16bb202d2435c Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 20 Dec 2023 16:26:45 -0700 Subject: [PATCH 1/3] Fix bug in the passive PLM --- Source/Hydro/Godunov/PLM_eb.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Hydro/Godunov/PLM_eb.H b/Source/Hydro/Godunov/PLM_eb.H index 225389d..86b2020 100644 --- a/Source/Hydro/Godunov/PLM_eb.H +++ b/Source/Hydro/Godunov/PLM_eb.H @@ -274,7 +274,7 @@ hydro_plm_d_eb ( qp(iv, n) = 0.0; } - if (area(iv) > 0.0) + if (area(ivp) > 0.0) { const amrex::Real spzero = vel_ad >= 0 ? vel_ad * dtdx : 1.0; const amrex::Real acmpleft = 0.5 * (1.0 - spzero) * slope[n]; From c816b03b2c0f6b8eef4e140a6c2f70e6e6951a67 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Fri, 22 Dec 2023 12:23:42 -0700 Subject: [PATCH 2/3] Found another bug --- Source/Hydro/Hydro_utils_eb_K.H | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Hydro/Hydro_utils_eb_K.H b/Source/Hydro/Hydro_utils_eb_K.H index 047d506..f4a0e78 100644 --- a/Source/Hydro/Hydro_utils_eb_K.H +++ b/Source/Hydro/Hydro_utils_eb_K.H @@ -166,8 +166,8 @@ eb_pdivu (int i, int j, int k, (q1(i+1,j,k, GDU ) - q1(i,j,k, GDU )) *dxinv[0] +(q2(i,j+1,k, GDPRES) + q2(i,j,k, GDPRES)) * (q2(i,j+1,k, GDV ) - q2(i,j,k, GDV )) * dxinv[1] - +(q2(i,j,k+1, GDPRES) + q2(i,j,k, GDPRES)) * - (q2(i,j,k+1, GDW ) - q2(i,j,k, GDW )) * dxinv[2]); + +(q3(i,j,k+1, GDPRES) + q3(i,j,k, GDPRES)) * + (q3(i,j,k+1, GDW ) - q3(i,j,k, GDW )) * dxinv[2]); divu(i,j,k,UEINT) += pdivu; } From 366c24cca80b80aba26e151f5434c634d0f895e3 Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Wed, 3 Jan 2024 09:22:17 -0700 Subject: [PATCH 3/3] Fix sign on ueint pdivu --- Source/Hydro/Hydro_utils_eb_K.H | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Hydro/Hydro_utils_eb_K.H b/Source/Hydro/Hydro_utils_eb_K.H index f4a0e78..e910234 100644 --- a/Source/Hydro/Hydro_utils_eb_K.H +++ b/Source/Hydro/Hydro_utils_eb_K.H @@ -104,7 +104,7 @@ eb_pdivu (int i, int j, int k, (q1(i + 1, j, k, GDU ) - q1(i, j, k, GDU )) *dxinv[0] +(q2(i, j + 1, k, GDPRES) + q2(i, j, k, GDPRES)) * (q2(i, j + 1, k, GDV ) - q2(i, j, k, GDV )) * dxinv[1]); - divu(i,j,k,UEINT) += pdivu; + divu(i,j,k,UEINT) -= pdivu; } else if (!flag(i,j,k).isCovered()) { @@ -153,7 +153,7 @@ eb_pdivu (int i, int j, int k, fyp = amrex::Real(0.0); } - divu(i,j,k,UEINT) += (1.0/vfrc(i,j,k)) * q(i,j,k,QPRES)* + divu(i,j,k,UEINT) -= (1.0/vfrc(i,j,k)) * q(i,j,k,QPRES)* ( dxinv[0] * (apx(i+1,j,k)*fxp-apx(i,j,k)*fxm) + dxinv[1] * (apy(i,j+1,k)*fyp-apy(i,j,k)*fym) ); } @@ -169,7 +169,7 @@ eb_pdivu (int i, int j, int k, +(q3(i,j,k+1, GDPRES) + q3(i,j,k, GDPRES)) * (q3(i,j,k+1, GDW ) - q3(i,j,k, GDW )) * dxinv[2]); - divu(i,j,k,UEINT) += pdivu; + divu(i,j,k,UEINT) -= pdivu; } else if (!flag(i,j,k).isCovered()) { @@ -271,7 +271,7 @@ eb_pdivu (int i, int j, int k, fzp = amrex::Real(0.0); } - divu(i,j,k,UEINT) += (1.0/vfrc(i,j,k)) * q(i,j,k,QPRES)* + divu(i,j,k,UEINT) -= (1.0/vfrc(i,j,k)) * q(i,j,k,QPRES)* ( dxinv[0] * (apx(i+1,j,k)*fxp-apx(i,j,k)*fxm) + dxinv[1] * (apy(i,j+1,k)*fyp-apy(i,j,k)*fym) + dxinv[2] * (apz(i,j,k+1)*fzp-apz(i,j,k)*fzm) );