MFC
Exascale flow solver
Loading...
Searching...
No Matches
m_phase_change Module Reference

Phase transition relaxation solvers for liquid-vapor flows with cavitation and boiling. More...

Functions/Subroutines

impure subroutine, public s_relaxation_solver (q_cons_vf)
 Dispatch to the correct relaxation solver. Replaces the procedure pointer, which CCE is breaking on.
impure subroutine, public s_initialize_phasechange_module
 Initialize the phase change module (no module-level state to set up; the pT/pTg relaxation solvers are self-contained).
subroutine, public s_infinite_relaxation_k (q_cons_vf)
 Apply pT- or pTg-equilibrium relaxation with mass depletion based on the incoming state conditions.
subroutine s_infinite_pt_relaxation_k (j, k, l, mfl, ps, p_infpt, q_cons_vf, rhoe, ts)
 Apply pT-equilibrium relaxation for N fluids.
subroutine s_compute_ptg_residual (ml, mt, ps, j, k, l, q_cons_vf, rhoe, r2d, ts, mcp, mq, mcvgp, mcvgp2, mcpd)
 Evaluate the pTg-equilibrium residual R2D and temperature TS at a trial state (ml, pS) WITHOUT mutating q_cons_vf, so the Newton driver can line-search. The total reacting mass mT is conserved, so the reacting masses are (ml, mT - ml) and only the inert fluids are read from q_cons_vf. Also returns the mixture sums the Jacobian and the final temperature need.
subroutine s_infinite_ptg_relaxation_k (j, k, l, ps, rhoe, q_cons_vf, ts)
 Apply pTg-equilibrium relaxation: a damped (backtracking line search) Newton solve for the reacting liquid mass ml and pressure pS enforcing Gibbs equality and energy conservation, converging on the residual norm (absolute ptgalpha_eps, or the rhoe-relative branch). Every step is projected onto the physical bounds 0 <= ml <= mT, pS > pmin. This converges in a handful of iterations with a bounded, uniform count (no GPU warp divergence), unlike the former fixed 1e-3 underrelaxation that stalled far from the root.
impure subroutine, public s_finalize_relaxation_solver_module
 Finalize the phase change module.

Variables

Parameters for the first order transition phase change
integer, parameter max_iter = 100000
 max Newton iterations before accepting the last iterate
real(wp), parameter pcr = 4.94e7_wp
 Critical pressure of water [Pa].
real(wp), parameter tcr = 385.05_wp + 273.15_wp
 Critical temperature of water [K].
integer, parameter ptg_ls_max = 30
 max backtracking-line-search halvings in the pTg solver
real(wp), parameter mixm = 1.0e-8_wp
 Mixture mass fraction threshold for triggering phase change.
integer, parameter lp = 1
 index for the liquid phase of the reacting fluid
integer, parameter vp = 2
 index for the vapor phase of the reacting fluid

Detailed Description

Phase transition relaxation solvers for liquid-vapor flows with cavitation and boiling.

Function/Subroutine Documentation

◆ s_compute_ptg_residual()

subroutine m_phase_change::s_compute_ptg_residual ( real(wp), intent(in) ml,
real(wp), intent(in) mt,
real(wp), intent(in) ps,
integer, intent(in) j,
integer, intent(in) k,
integer, intent(in) l,
type(scalar_field), dimension(sys_size), intent(in) q_cons_vf,
real(wp), intent(in) rhoe,
real(wp), dimension(2), intent(out) r2d,
real(wp), intent(out) ts,
real(wp), intent(out) mcp,
real(wp), intent(out) mq,
real(wp), intent(out) mcvgp,
real(wp), intent(out) mcvgp2,
real(wp), intent(out) mcpd )
private

Evaluate the pTg-equilibrium residual R2D and temperature TS at a trial state (ml, pS) WITHOUT mutating q_cons_vf, so the Newton driver can line-search. The total reacting mass mT is conserved, so the reacting masses are (ml, mT - ml) and only the inert fluids are read from q_cons_vf. Also returns the mixture sums the Jacobian and the final temperature need.

Definition at line 745 of file m_phase_change.fpp.f90.

Here is the caller graph for this function:

◆ s_finalize_relaxation_solver_module()

impure subroutine, public m_phase_change::s_finalize_relaxation_solver_module

Finalize the phase change module.

Definition at line 1020 of file m_phase_change.fpp.f90.

◆ s_infinite_pt_relaxation_k()

subroutine m_phase_change::s_infinite_pt_relaxation_k ( integer, intent(in) j,
integer, intent(in) k,
integer, intent(in) l,
integer, intent(in) mfl,
real(wp), intent(out) ps,
real(wp), dimension(1:), intent(out) p_infpt,
type(scalar_field), dimension(sys_size), intent(in) q_cons_vf,
real(wp), intent(in) rhoe,
real(wp), intent(out) ts )
private

Apply pT-equilibrium relaxation for N fluids.

Parameters
MFLflag: 0=gas, 1=liquid, 2=mixture

Definition at line 589 of file m_phase_change.fpp.f90.

Here is the caller graph for this function:

◆ s_infinite_ptg_relaxation_k()

subroutine m_phase_change::s_infinite_ptg_relaxation_k ( integer, intent(in) j,
integer, intent(in) k,
integer, intent(in) l,
real(wp), intent(inout) ps,
real(wp), intent(in) rhoe,
type(scalar_field), dimension(sys_size), intent(inout) q_cons_vf,
real(wp), intent(inout) ts )
private

Apply pTg-equilibrium relaxation: a damped (backtracking line search) Newton solve for the reacting liquid mass ml and pressure pS enforcing Gibbs equality and energy conservation, converging on the residual norm (absolute ptgalpha_eps, or the rhoe-relative branch). Every step is projected onto the physical bounds 0 <= ml <= mT, pS > pmin. This converges in a handful of iterations with a bounded, uniform count (no GPU warp divergence), unlike the former fixed 1e-3 underrelaxation that stalled far from the root.

Definition at line 816 of file m_phase_change.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_infinite_relaxation_k()

subroutine, public m_phase_change::s_infinite_relaxation_k ( type(scalar_field), dimension(sys_size), intent(inout) q_cons_vf)

Apply pT- or pTg-equilibrium relaxation with mass depletion based on the incoming state conditions.

Generic loop iterators

Definition at line 385 of file m_phase_change.fpp.f90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ s_initialize_phasechange_module()

impure subroutine, public m_phase_change::s_initialize_phasechange_module

Initialize the phase change module (no module-level state to set up; the pT/pTg relaxation solvers are self-contained).

Definition at line 380 of file m_phase_change.fpp.f90.

Here is the caller graph for this function:

◆ s_relaxation_solver()

impure subroutine, public m_phase_change::s_relaxation_solver ( type(scalar_field), dimension(sys_size), intent(inout) q_cons_vf)

Dispatch to the correct relaxation solver. Replaces the procedure pointer, which CCE is breaking on.

Definition at line 364 of file m_phase_change.fpp.f90.

Variable Documentation

◆ lp

integer, parameter m_phase_change::lp = 1
private

index for the liquid phase of the reacting fluid

Definition at line 357 of file m_phase_change.fpp.f90.

◆ max_iter

integer, parameter m_phase_change::max_iter = 100000
private

max Newton iterations before accepting the last iterate

Definition at line 352 of file m_phase_change.fpp.f90.

◆ mixm

real(wp), parameter m_phase_change::mixm = 1.0e-8_wp
private

Mixture mass fraction threshold for triggering phase change.

Definition at line 356 of file m_phase_change.fpp.f90.

◆ pcr

real(wp), parameter m_phase_change::pcr = 4.94e7_wp
private

Critical pressure of water [Pa].

Definition at line 353 of file m_phase_change.fpp.f90.

◆ ptg_ls_max

integer, parameter m_phase_change::ptg_ls_max = 30
private

max backtracking-line-search halvings in the pTg solver

Definition at line 355 of file m_phase_change.fpp.f90.

◆ tcr

real(wp), parameter m_phase_change::tcr = 385.05_wp + 273.15_wp
private

Critical temperature of water [K].

Definition at line 354 of file m_phase_change.fpp.f90.

◆ vp

integer, parameter m_phase_change::vp = 2
private

index for the vapor phase of the reacting fluid

Definition at line 358 of file m_phase_change.fpp.f90.