Skip to content

Commit 75255fa

Browse files
author
Billy Cao
committed
Restore pT equilibrium on phase depletion
When the pTg relaxation depletes one of the reacting phases, the Gibbs equality no longer constrains the state, so the pT solver runs again on the final masses. The seven Phase Change model 6 goldens and the phasechange_bubble example change. Fixes #1820.
1 parent 1466113 commit 75255fa

15 files changed

Lines changed: 674 additions & 647 deletions

File tree

‎src/common/m_phase_change.fpp‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ contains
136136
q_cons_vf(vp + eqn_idx%cont%beg - 1)%sf(j, k, l) = m2
137137

138138
call s_infinite_ptg_relaxation_k(j, k, l, pS, rhoe, q_cons_vf, TS)
139+
140+
! A depleted phase leaves Gibbs equality unconstrained; solve pT equilibrium again for the final masses
141+
if (q_cons_vf(lp + eqn_idx%cont%beg - 1)%sf(j, k, &
142+
& l) == 0.0_wp .or. q_cons_vf(vp + eqn_idx%cont%beg - 1)%sf(j, k, l) == 0.0_wp) then
143+
call s_infinite_pt_relaxation_k(j, k, l, 2, pS, p_infpT, q_cons_vf, rhoe, TS)
144+
end if
139145
end if
140146

141147
! Calculations AFTER equilibrium

‎tests/02BD9B5E/golden-metadata.txt‎

Lines changed: 81 additions & 78 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/02BD9B5E/golden.txt‎

Lines changed: 16 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)