Skip to content

fix(post): exchange chemistry temperature seam ghosts for chemistry#1649

Merged
sbryngelson merged 1 commit into
MFlowCode:masterfrom
sbryngelson:fix-chem-post-qt-seam
Jul 17, 2026
Merged

fix(post): exchange chemistry temperature seam ghosts for chemistry#1649
sbryngelson merged 1 commit into
MFlowCode:masterfrom
sbryngelson:fix-chem-post-qt-seam

Conversation

@sbryngelson

Copy link
Copy Markdown
Member

post_process converts conservative → primitive variables over the ghost-inclusive bounds, so the temperature Newton guess must be valid at rank seams for every chemistry run. Previously the temperature seam ghost was exchanged only when chem_params%diffusion was set, so a multi-rank non-diffusion chemistry run left the rank-seam Newton guess uninitialized → NaN temperature / pressure / sound-speed in the output.

Fix:

  • m_mpi_common: exchange the temperature seam ghost for any chemistry run in post_process (simulation keeps the diffusion-only condition, since it does not convert over the ghost shell) via an #ifdef MFC_SIMULATION split.
  • post_process/m_start_up: seed q_T over the interior (idwint) rather than the ghost-inclusive bounds (idwbuff) — the ghost q_cons is unread at that point, so a ghost-inclusive Newton sweep iterates on uninitialized data; s_populate_variables_buffers extends q_T into the ghosts afterward.

Extracted as a standalone fix from the AMR/scaling work (up/mega); the AMR-specific coupling in the original change was dropped for this general fix. CI runs the full matrix as the gate.

@sbryngelson
sbryngelson marked this pull request as ready for review July 16, 2026 18:48
Copilot AI review requested due to automatic review settings July 16, 2026 18:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a post-processing MPI seam/ghost-cell initialization issue for chemistry runs by ensuring the temperature Newton initial guess (q_T) is valid at rank seams before conservative→primitive conversion is performed over ghost-inclusive bounds. This prevents uninitialized-temperature propagation that can yield NaN temperature/pressure/sound speed in multi-rank, non-diffusion chemistry post-processing runs.

Changes:

  • Seed chemistry temperature (q_T_sf) over interior bounds (idwint) in post_process startup, then extend into ghosts via the existing buffer-population step.
  • In m_mpi_common, exchange temperature seam ghosts for any chemistry run in non-simulation builds, while keeping the diffusion-only exchange behavior in simulation via an #ifdef MFC_SIMULATION split.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/post_process/m_start_up.fpp Seeds q_T_sf over interior bounds to avoid Newton iteration on unread ghost q_cons, relying on later buffer population to fill ghosts.
src/common/m_mpi_common.fpp Ensures q_T_sf seam ghost exchange occurs for all chemistry post-processing runs (not only diffusion), while preserving simulation’s diffusion-only behavior.

@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@aed0d74). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/common/m_mpi_common.fpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1649   +/-   ##
=========================================
  Coverage          ?   59.56%           
=========================================
  Files             ?       83           
  Lines             ?    21112           
  Branches          ?     3128           
=========================================
  Hits              ?    12576           
  Misses            ?     6434           
  Partials          ?     2102           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…stry run, not only diffusion; seed q_T over the interior
@sbryngelson
sbryngelson force-pushed the fix-chem-post-qt-seam branch from b606661 to eb0dd30 Compare July 16, 2026 20:59
@sbryngelson sbryngelson changed the title fix(post): exchange chemistry temperature seam ghosts for every chemistry run fix(post): exchange chemistry temperature seam ghosts for chemistry Jul 17, 2026
@sbryngelson
sbryngelson merged commit 597f3c5 into MFlowCode:master Jul 17, 2026
86 of 87 checks passed
@sbryngelson
sbryngelson deleted the fix-chem-post-qt-seam branch July 17, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants