Skip to content

Commit d84254c

Browse files
committed
fix(post): exchange the chemistry q_T seam ghosts for EVERY chemistry run (post converts over the ghost shell; the diffusion-only condition left rank-seam Newton guesses uninitialized -> NaN T/pres/c, first exposed by the 2-rank chemistry AMR case); seed q_T over the interior in the simulation's order
1 parent c08e8c9 commit d84254c

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

src/common/m_mpi_common.fpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,10 @@ contains
570570
chem_T_comm = .true.
571571
v_size = nVar + 1
572572
#else
573-
else if (present(q_T_sf) .and. chemistry .and. chem_params%diffusion) then
573+
else if (present(q_T_sf) .and. chemistry) then
574+
! post_process converts cons->prim over the ghost-inclusive bounds, so the temperature
575+
! Newton guess must be valid at rank seams for EVERY chemistry run (not only diffusion):
576+
! an unexchanged seam ghost is an uninitialized guess -> NaN T/pres/c in the output
574577
chem_T_comm = .true.
575578
v_size = nVar + 1
576579
#endif

src/post_process/m_start_up.fpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,11 @@ contains
156156
157157
if (amr) call s_read_amr_data(t_step)
158158
159-
if (chemistry) call s_compute_q_T_sf(q_T_sf, q_cons_vf, idwbuff)
159+
! seed the chemistry temperature over the INTERIOR only (mirrors the simulation,
160+
! m_start_up): the ghost q_cons is unread at this point, so a ghost-inclusive sweep
161+
! would Newton-iterate on garbage (NaN under NaN-init builds) at rank seams and
162+
! physical boundaries; s_populate_variables_buffers below extends q_T into the ghosts
163+
if (chemistry) call s_compute_q_T_sf(q_T_sf, q_cons_vf, idwint)
160164
161165
if (buff_size > 0) then
162166
call s_populate_grid_variables_buffers()

0 commit comments

Comments
 (0)