Skip to content

Restore pT equilibrium after phase depletion - #1830

Closed
aliencaocao wants to merge 1 commit into
MFlowCode:masterfrom
aliencaocao:fix/phase-depletion-equilibrium
Closed

Restore pT equilibrium after phase depletion#1830
aliencaocao wants to merge 1 commit into
MFlowCode:masterfrom
aliencaocao:fix/phase-depletion-equilibrium

Conversation

@aliencaocao

@aliencaocao aliencaocao commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #1820. For context and description of issue and fix, please refer to the issue thread.

Contribution Policy

We do not accept pull requests generated primarily by AI without genuine understanding or real-world usage context.

All contributions are expected to demonstrate:

  • A clear understanding of the codebase
  • Alignment with product direction
  • Thoughtful reasoning behind changes
  • Evidence of real-world usage or hands-on experience with the problem

If these expectations are not met, we would prefer to implement the changes ourselves rather than spend time reviewing low-effort submissions.


Acknowledgement

  • I confirm this PR meets the above expectations and reflects my own understanding and real-world context.

PR template credit: junegunn

Copilot AI lite review requested due to automatic review settings September 5, 2026 19:14
@sbryngelson

Copy link
Copy Markdown
Member

pr no checkmark

@sbryngelson sbryngelson closed this Sep 5, 2026
@aliencaocao

Copy link
Copy Markdown
Contributor Author

done. same for the other PRs.

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

This PR restores pressure/temperature equilibrium when one phase becomes depleted during phase-change handling, addressing issue #1820.

Changes:

  • Adds a post-PTG-relaxation check for phase depletion (liquid/vapor reaching zero).
  • Triggers an additional infinite pT relaxation step when depletion is detected.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

call s_infinite_ptg_relaxation_k(j, k, l, pS, rhoe, q_cons_vf, TS)

if (q_cons_vf(lp + eqn_idx%cont%beg - 1)%sf(j, k, &
& l) == 0.0_wp .or. q_cons_vf(vp + eqn_idx%cont%beg - 1)%sf(j, k, l) == 0.0_wp) then

if (q_cons_vf(lp + eqn_idx%cont%beg - 1)%sf(j, k, &
& l) == 0.0_wp .or. q_cons_vf(vp + eqn_idx%cont%beg - 1)%sf(j, k, l) == 0.0_wp) then
call s_infinite_pt_relaxation_k(j, k, l, 2, pS, p_infpT, q_cons_vf, rhoe, TS)
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

Lines of Code

File Lines Diff
src/common/m_phase_change.fpp 281 +4
Directory Lines Diff
common 9782 +4
total 45633 +4

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.

Bug: pTg phase depletion violates volume and energy closure

3 participants