From 2339ffb33ce9ff91f444c2fbc4134adec9aefc11 Mon Sep 17 00:00:00 2001 From: jbb Date: Thu, 8 Oct 2026 15:15:14 -0700 Subject: [PATCH] Fix issue #206: don't divide Laplacian_S tracer viscous reflux by rho_half In reflux, the viscous flux-register correction of every NonConservative scalar was divided by rho_half. That is right only for scalars diffused in the RhoInverse_Laplacian_S form (rho dS/dt = div beta grad S, e.g. Temp). The default tracer is NonConservative but uses Laplacian_S (dS/dt = div beta grad S), and the rest of the sync path treats its Ssync as a rate of S without rho, so its viscous reflux was off by a factor 1/rho_half. Restrict the division to NonConservative scalars with diffusionType RhoInverse_Laplacian_S. Co-Authored-By: Claude Opus 5.5 --- Source/NavierStokes.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/NavierStokes.cpp b/Source/NavierStokes.cpp index 49bdc576..07b2af45 100644 --- a/Source/NavierStokes.cpp +++ b/Source/NavierStokes.cpp @@ -1812,9 +1812,15 @@ NavierStokes::reflux () } } + // + // The viscous register holds the flux of the equation that was solved: + // only RhoInverse_Laplacian_S (rho dS/dt = div beta grad S, e.g. Temp) + // needs the increment divided by rho. Laplacian_S tracers carry no rho. + // for (int istate = AMREX_SPACEDIM; istate < NUM_STATE; istate++) { - if (advectionType[istate] == NonConservative) + if (advectionType[istate] == NonConservative && + diffusionType[istate] == RhoInverse_Laplacian_S) { MultiFab::Divide(Ssync,Rh,0,istate-AMREX_SPACEDIM,1,0); }