From e456ccf965fd206332bd4356b2b06569955db779 Mon Sep 17 00:00:00 2001 From: cgilet Date: Mon, 22 Apr 2024 11:55:45 -0400 Subject: [PATCH] In diffuse_tensor_velocity, for momenta (rho_flag==3), multiply Unew by rho^(n+1) for RHS. i.e. we want rho^(n+1) * Unew = rho^(n+1) * [(rho^n U^n - dt U dot grad U + ...)/rho^(n+1)] --- Source/Diffusion.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Diffusion.cpp b/Source/Diffusion.cpp index d7983c07..062df39d 100644 --- a/Source/Diffusion.cpp +++ b/Source/Diffusion.cpp @@ -816,7 +816,7 @@ Diffusion::diffuse_tensor_velocity (Real dt, const Box& bx = mfi.tilebox(); auto const& rhs = Rhs.array(mfi); auto const& unew = U_new.array(mfi,Xvel); - auto const& rho = (rho_flag == 1) ? rho_half.array(mfi) : navier_stokes->get_old_data(State_Type).array(mfi,Density); + auto const& rho = (rho_flag == 1) ? rho_half.array(mfi) : navier_stokes->get_new_data(State_Type).array(mfi,Density); auto const& deltarhs = (has_delta_rhs) ? delta_rhs->array(mfi,rhsComp) : U_new.array(mfi); amrex::ParallelFor(bx, [rhs, unew, rho, deltarhs, has_delta_rhs, dt] AMREX_GPU_DEVICE(int i, int j, int k) noexcept