In s_compute_additional_physics_rhs (src/simulation/m_rhs.fpp) each of the three direction blocks has this shape:
if (surface_tension .or. viscous .or. heat_conduction) then
do i = eqn_idx%mom%beg, eqn_idx%E ! <-- includes E
rhs_vf(i) = rhs_vf(i) + (flux_src(i, prev) - flux_src(i, cur))/d
end do
end if
if (chem_params%diffusion) then
do i = eqn_idx%species%beg, eqn_idx%species%end
...
end do
if (.not. viscous) then ! <-- adds E again
rhs_vf(eqn_idx%E) = rhs_vf(eqn_idx%E) + (flux_src(E, prev) - flux_src(E, cur))/d
end if
end if
The .not. viscous guard on the second energy contribution was correct when viscous was the only other thing that could take the first branch. It no longer is: with chemistry + surface_tension and viscous = F, the first loop already added the energy source flux over mom%beg:E, and the chem block adds it a second time. The energy diffusion flux is applied twice in every direction.
The guard should match the condition on the first block:
if (.not. (viscous .or. surface_tension .or. heat_conduction)) then
(The heat_conduction combination is rejected at input check as of #1906, so the live case today is chemistry + surface_tension without viscous. The surface_tension half predates that PR.)
Found while adding Fourier heat conduction (#1906).
In
s_compute_additional_physics_rhs(src/simulation/m_rhs.fpp) each of the three direction blocks has this shape:The
.not. viscousguard on the second energy contribution was correct whenviscouswas the only other thing that could take the first branch. It no longer is: withchemistry + surface_tensionandviscous = F, the first loop already added the energy source flux overmom%beg:E, and the chem block adds it a second time. The energy diffusion flux is applied twice in every direction.The guard should match the condition on the first block:
(The
heat_conductioncombination is rejected at input check as of #1906, so the live case today ischemistry + surface_tensionwithoutviscous. Thesurface_tensionhalf predates that PR.)Found while adding Fourier heat conduction (#1906).