Mixture solver

The Solvers.MixtureSolver module in OpenSTREAM provides classes and tools for simulating two-phase flows using a mixture approach. In this method, all phases are treated as a single continuum with averaged properties, making it suitable for cases where phase separation is minimal or not explicitly resolved. Additionally, the solver supports a Homogeneous Relaxation Model (HRM), which introduces thermal non-equilibrium between phases by solving separate mass and energy conservation equations for the vapor phase.

This module includes:


Solvers.Mixture.MixtureSolver.solve(mixSolver)

SOLVE Executes the mixture solver for steady-state and transient simulations.

Runs the full solution process for the Solvers.Mixture.MixtureSolver object. It manages initialization, time stepping, axial sweeps, inner iterations, convergence checks, and logging.

Workflow:

  • Enables logging and opens persistent log file

  • Validates solver state before execution

  • Runs steady-state initialization (solveINIT = true)

  • If initial step converges, proceeds with transient simulation

  • Handles exceptions and ensures proper log closure

Notes:

  • Uses internal solver function to handle both steady-state and transient modes

  • Applies relaxation factors for flow, pressure, enthalpy, and vapor properties

  • Supports thermal non-equilibrium modeling via vapor relaxation

  • Logs progress and outputs to session directory

class Solvers.Mixture.MixtureSolver.MixtureSolver(inputSet)

Bases: Solvers.AbstractSolver

MIXTURESOLVER Solver for initializing, solving, and visualizing mixture flow.

The MixtureSolver class handles the setup, execution, and visualization of thermal-hydraulic simulations using a two-phase mixture approach or a Homogeneous Relaxation Model (HRM).

Responsibilities:

  • Initializes solver parameters from an Inputs.InputSet object

  • Interpolates boundary conditions in time and space

  • Constructs Solvers.Mixture.Mixture objects for transient and steady-state analysis

  • Provides plotting utilities for spatial and temporal distributions

Key Components:

  • Mixture construction and phase separation (liquid/vapor)

  • Mixture mass/momentum/energy transport modeling

  • Support for relaxation models and near-wall phenomena

  • Visualization of results across time and axial domains

Constructor Summary
MixtureSolver(inputSet)

MIXTURESOLVER Constructor for the MixtureSolver class.

Creates a new instance of the MixtureSolver class using the provided Inputs.InputSet. This constructor initializes the solver by calling the abstract Solvers.AbstractSolver superclass constructor and then sets up all necessary solver parameters and internal data structures via Solvers.Mixture.MixtureSolver.initializeSolver

Input:

  • inputSet — An Inputs.InputSet object containing model configuration, geometry, boundary conditions, and solver options.

Notes:

  • This constructor assumes Inputs.InputSet is fully validated.

  • Solver initialization includes time/space discretization, boundary condition interpolation, and mixture object setup.

Property Summary
DT = 0

Time step size [s] from Inputs.Options.TSTEP

DZ = 0

Axial step size [m]

NTIME = 0

Number of time steps [-]

NZ = 0

Number of axial steps [-] from Inputs.Model.NNODES

TIME = 0

Time series [s]

Z = 1.

Elevation [m]

boundaryConditions

Boundary conditions object Inputs.BoundaryConditions

fluid

Fluid object Inputs.FluidProperties

inputSet

Input set object Inputs.InputSet

mixture

Mixture object

mixtureInit

Null transient mixture object

Method Summary
axialInterpolate(mix, x, y)

AXIALINTERPOLATE Performs axial interpolation of data using a specified method.

Interpolates the values in y at positions defined by mix.Z using the interpolation method specified in Inputs.options.AXIALINTERP. The interpolation is performed over the domain defined by x.

If the interpolation returns NaN (e.g., due to points slightly outside the interpolation range when using methods like ‘next’), linear extrapolation is applied to those specific points to ensure continuity.

This function ensures robust handling of out-of-bound values by using extrapolation and fallback strategies.

initializeSolver(mixSolver)

INITIALIZESOLVER Initializes solver parameters and constructs mixture objects.

Sets up the solver’s internal state using the provided Inputs.InputSet. This includes discretization of time and space, interpolation of boundary conditions, and initialization of data structures for transient and steady-state simulations.

Operations performed:

  • Computes time steps and axial node positions

  • Interpolates boundary conditions in time and space

  • Initializes mixture array for each time step

  • Constructs data structures for:

    • Pressure drops (DP, DPSUM)

    • Momentum and energy derivatives (MDER)

    • Homogeneous Relaxation Model (HRM)

    • Near-wall transport (NEARWALL)

    • Iteration tracking (ITR)

  • Initializes fluid property objects

  • Sets up phase-specific objects (Liquid, Vapor)

  • Assigns initial conditions for mass flow rate, pressure, enthalpy

Notes:

  • The function assumes uniform axial discretization.

  • Wall heat flux is computed from interpolated boundary conditions.

  • HRM fields are initialized after enthalpy to ensure correct vapor quality (XEQ) computation.

interpBoundaryConditions(mixSolver)

INTERPBOUNDARYCONDITIONS Interpolates boundary conditions in time and space.

Expands user-defined Inputs.BoundaryConditions to match the solver’s spatial grid and time steps. It performs interpolation of relevant boundary condition parameters both temporally and axially, and computes derived quantities such as wall heat flux.

Operations performed:

  • Interpolates time-dependent boundary condition parameters: ‘TIME’, ‘PRESSURE’, ‘HIN’, ‘MFLOW’, ‘POWER’

  • Interpolates wall power distribution in space (axially)

  • Interpolates wall power in time across all walls

  • Computes wall heat flux at each axial node and time step

Notes:

plott(mixSolver, zIdx, opt)

PLOTT Plots temporal distributions of mixture parameters at a given axial location.

Generates time-series plots of selected mixture parameters at a specified axial index. The method supports multiple display modes, wall selections, and plot arrangements.

Inputs:

  • mixSolver — Solvers.Mixture.MixtureSolver object containing simulation data

  • zIdx — Axial index (scalar, positive integer)

  • opt.display — Parameters to display (e.g., ‘HFLUX’, ‘W’, ‘DP’, etc.)

  • opt.solveMode — Solve mode: ‘REAL’ or ‘NULL’

  • opt.wall — Wall index(es) to plot

  • opt.tIdx — Time indices to include in the plot

  • opt.reverseTime — Logical flag to reverse time axis

  • opt.unitTemp — Temperature unit: ‘K’ or ‘C’

  • opt.arrangement — Plot arrangement: ‘flow’, ‘vertical’, or ‘horizontal’

  • opt.resize — Resize factor for plot scaling

  • opt.nearWall — Logical flag to include near-wall parameters

Notes:

  • If opt.display is set to ‘ALL’, all supported parameters are plotted.

  • The function validates that at least two time indices are provided.

  • Temperature unit conversion is applied if ‘C’ is selected.

  • Near-wall data is included if opt.nearWall is true.

  • Each wall is plotted in a separate tile with appropriate legends and axis scaling.

plotz(mixSolver, tIdx, opts)

PLOTZ Plots spatial (axial) distributions of mixture parameters.

Generates axial plots of selected mixture parameters at specified time indices. The function supports multiple display modes, wall selections, near-wall data, and optional animation over time.

Inputs:

  • mixSolver — Solvers.Mixture.MixtureSolver object containing simulation data

  • tIdx — Time index or indices (vector of positive integers)

  • opts.display — Parameters to display (e.g., ‘HFLUX’, ‘W’, ‘DP’, etc.)

  • opts.solveMode — Solve mode: ‘REAL’ or ‘NULL’

  • opts.wall — Wall index(es) to plot

  • opts.zIdx — Axial indices to include in the plot

  • opts.obstructions — Logical flag to display obstruction locations

  • opts.unitTemp — Temperature unit: ‘K’ or ‘C’

  • opts.arrangement — Plot arrangement: ‘flow’, ‘vertical’, or ‘horizontal’

  • opts.resize — Resize factor for plot scaling

  • opts.nearWall — Logical flag to include near-wall parameters

Notes:

  • If multiple time indices are provided, the function creates an animated plot.

  • At least two axial indices must be specified to enable spatial plotting.

  • Temperature unit conversion is applied if ‘C’ is selected.

  • Obstruction locations are plotted if opts.obstructions is true.

  • Each wall is plotted in a separate tile with appropriate legends and axis scaling.

plotzt(mixSolver, opt)

PLOTZT Plots 2D time/elevation distributions of mixture parameters.

Generates surface plots of selected mixture-related parameters over time and axial (elevation) positions. It supports plotting for mixture, liquid and vapor fields, and can handle both real and null (initial) transient data.

Inputs:

  • mixSolver — Solvers.Mixture.MixtureSolver object containing simulation data

  • opt.display — Parameter(s) to display (e.g., ‘HFLUX’, ‘U’, etc.)

  • opt.label — Corresponding labels for display parameters

  • opt.unit — Units for each parameter

  • opt.field — Field to plot: ‘mixture’, ‘liquid’, or ‘vapor’

  • opt.solveMode — Solve mode: ‘REAL’ or ‘NULL’

  • opt.wall — Wall index(es) to plot

  • opt.zIdx — Axial indices (must include at least 2)

  • opt.tIdx — Time indices (must include at least 2)

  • opt.reverseTime — Logical flag to reverse time axis

  • opt.shading — Surface shading style: ‘faceted’, ‘flat’, or ‘interp’

  • opt.view — View angle for 3D plot [azimuth elevation]

Notes:

  • If ‘ALL’ is passed to opt.display, all supported parameters are plotted.

  • The function validates that at least two axial and time indices are provided to enable meaningful 2D plotting.

  • Each wall is plotted in a separate figure window with appropriate titles and subplot grouping.

timeInterpolate(mix, y)

TIMEINTERPOLATE Performs temporal interpolation of data using a specified method.

Interpolates the values in y at the time points defined by mix.TIME using the interpolation method specified in Inputs.options.TIMEINTERP.

If the boundary condition time vector (mix.inputSet.bc.TIME) is scalar, interpolation is skipped and the original data y is returned unchanged.

This function supports flexible interpolation strategies and handles cases where interpolation is unnecessary.


class Solvers.Mixture.Liquid(mix)

Bases: Solvers.AbstractPhase

LIQUID Represents the liquid phase in a mixture solver simulation.

The Liquid class provides access to liquid-specific properties and calculations derived from the mixture solution. It encapsulates methods for computing flow, thermodynamic, and transport properties of the liquid phase at each axial node.

Responsibilities:

  • Compute liquid mass fraction and volumetric fraction

  • Calculate liquid velocity, enthalpy, and temperature

  • Evaluate wall heat flux contributions to the liquid phase

  • Support derived quantities such as Reynolds number and mass flux

Notes:

  • All methods assume access to a valid Solvers.Mixture.Mixture object

  • Axial indexing is optional; defaults to full axial domain

  • Velocity and enthalpy calculations include fallback logic to handle single-phase vapor regions and numerical stability

Constructor Summary
Liquid(mix)

LIQUID Constructor

Initializes the Liquid object from one or more instances of the Solvers.Mixture.Mixture class. Each Liquid instance stores a reference to its corresponding Mixture object and the number of axial nodes (NZ).

Input:

Notes:

  • Supports vectorized initialization for transient simulations

  • Assumes each Solvers.Mixture.Mixture object is fully initialized

Method Summary
H(liquid, zIdx)

H Liquid enthalpy [J/kg]

Calculated based on mixture and vapor enthalpies, and vapor quality.

HFLUX(liquid, zIdx)

HFLUX Wall heat flux to liquid phase [W/m^2]

HWALL(liquid, zIdx)

HWALLLIQ Single-phase liquid wall heat transfer coefficient [W/m^2/K]

Computes the wall heat transfer coefficient using liquid thermal conductivity and Nusselt number.

MFLUX(liquid, zIdx)

MFLUX Liquid mass flux [kg/m^2/s]

NU(liquid, zIdx)

NU Liquid wall Nusselt number [-]

Computes the Nusselt number for wall heat transfer to liquid based on Inputs.Model.SPHTM model.

RE(liquid, zIdx)

RE Liquid Reynolds number [-]

T(liquid, zIdx)

T Liquid temperature [K]

TIME(liquid)

TIME Time series [s]

U(liquid, zIdx)

U Liquid velocity [m/s]

VF(liquid, zIdx)

VF Liquid volumetric fraction [-]

W(liquid, zIdx)

W Liquid mass flow rate [kg/s]

X(liquid, zIdx)

X Liquid mass fraction [-]

Z(liquid, zIdx)

Z Axial node positions [m]

class Solvers.Mixture.Vapor(mix)

Bases: Solvers.AbstractPhase

VAPOR Represents the vapor phase in a mixture solver simulation.

The Vapor class provides access to vapor-specific properties and calculations derived from the mixture solution. It encapsulates methods for computing flow, thermodynamic, and transport properties of the vapor phase at each axial node.

Responsibilities:

  • Compute vapor mass fraction and void fraction

  • Calculate vapor velocity, enthalpy, and temperature

  • Evaluate wall heat flux and wall evaporation contributions

  • Support derived quantities such as Reynolds number and mass flux

Notes:

  • All methods assume access to a valid Solvers.Mixture.Mixture object

  • Axial indexing is optional; defaults to full axial domain

  • Enthalpy calculations adapt to thermal non-equilibrium models

  • Velocity and enthalpy calculations include fallback logic to handle single-phase liquid regions and numerical stability

Constructor Summary
Vapor(mix)

VAPOR Constructor of the Vapor class

Initializes the Vapor object from one or more instances of the Solvers.Mixture.Mixture class. Each Vapor instance stores a reference to its corresponding Mixture object and the number of axial nodes (NZ).

Input:

Notes:

  • Supports vectorized initialization for transient simulations

  • Assumes each Solvers.Mixture.Mixture object is fully initialized

Method Summary
FW(vapor, zIdx)

FW Vapor wall friction factor [-]

Computes the Fanning wall friction factor based on Inputs.Model.SPMTM model.

Supported models

  • BLASIUS: Blasius model (\(f = C(1) Re^{C(2)} + C(3)\)) using user-defined Inputs.Model.FRICTION coefficients

H(vapor, zIdx)

H Vapor enthalpy [J/kg]

Calculation depends on Inputs.Model.THERMALNONEQ model.

HFLUX(vapor, zIdx)

HFLUX Wall heat flux to vapor [W/m^2]

HFLUXWALEVAP(vapor, zIdx)

HFLUX Wall evaporation heat flux [W/m^2]

HWALL(vapor, zIdx)

HWALLLIQ Single-phase vapor wall heat transfer coefficient [W/m^2/K]

Computes the wall heat transfer coefficient using vapor thermal conductivity and Nusselt number.

MFLUX(vapor, zIdx)

MFLUX Vapor mass flux [kg/m^2-s]

NU(vapor, zIdx)

NU Vapor wall Nusselt number [-]

Computes the Nusselt number for wall heat transfer to vapor based on Inputs.Model.SPHTM model.

RE(vapor, zIdx)

RE Vapor Reynolds number [-]

T(vapor, zIdx)

T Vapor temperature [K]

TAUW(vapor, zIdx)

TAUW Vapor wall shear stress [N/m^2]

TIME(vapor)

TIME Time series [s]

U(vapor, zIdx)

U Vapor velocity [m/s]

VF(vapor, zIdx)

VF Void fraction [-]

W(vapor, zIdx)

W Vapor mass flow rate [kg/s]

X(vapor, zIdx)

X Vapor mass fraction [-]

Z(vapor, zIdx)

Z Axial nodes [m]

class Solvers.Mixture.Mixture(inputSet, fluid)

Bases: Solvers.AbstractField

MIXTURE Class for modeling two-phase mixture field in mixture solver

This class encapsulates the physical and numerical properties of a fluid mixture, including flow variables, phase interactions, pressure losses, heat transfer, and relaxation models. It supports multiple solver models and provides methods for computing derived quantities and handling transitions such as boiling and annular flow.

Constructor Summary
Mixture(inputSet, fluid)

MIXTURE Constructor for Mixture class

Initializes the mixture object with input configuration and fluid properties. Sets up flow property tracking for simulation.

Inputs:

Property Summary
DP

Saved detailed pressure drops [Pa]

DPSUM

Saved detailed cumulative pressure drops [Pa]

DT = 0

Time step size [s] from Inputs.options.TSTEP

DZ = 0

Axial step size [m]

H = 1E6

Enthalpy [J/kg]

HFLUX = 1.

Wall heat flux [W/m^2]

HRM

Homogeneous relaxation terms

ITR

Iteration tracking

MDER

Saved detailed material derivative terms

NEARWALL

Near-wall terms

NTIME = 0

Number of time steps [-]

NZ = 0

Number of axial steps [-] from Inputs.Model.NNODES

P = 7E6

Pressure [Pa]

TIDX = 1

Time step index [-]

TIME = 0

Time series [s]

W = 1.

Mass flow rate [kg/s]

Z = 1.

Elevation [m]

cbt = false

Critical Boiling Transition flag [-]

fluid

Inputs.FluidProperties object

inputSet

Inputs.InputSet object

liquid

Liquid phase object

mfbt = false

Minimum Film Boiling Transition flag [-]

vapor

Vapor phase object

Method Summary
AFDISTR(mix, param1, param2, zIdx)

AFDISTR Computes annular flow distribution over axial positions.

Evaluates a weighted distribution between param1 and param2 using the annular flow fraction defined in Solvers.Mixture.Mixture.AFFNC.

Inputs:

  • mix — Solvers.Mixture.Mixture object containing axial grid and flow fractions

  • param1 — First flow property

  • param2 — Second flow property

  • zIdx — Axial indices to evaluate (optional; defaults to full axial range)

Notes:

  • The annular flow fraction is extracted from Solvers.Mixture.Mixture.AFFNC at zIdx

  • The output is a linear interpolation: (1 - affnc) * param1 + affnc * param2

  • mix(1).NZ is used for default indexing, assuming mix may be an array

AFFNC(mix, zIdx)

AFFNC Computes annular flow fraction over axial positions.

Evaluates the annular flow fraction using a sigmoid function parameterized by the transition model and geometry. The sigmoid is evaluated via the cached sigm method.

Inputs:

  • mix — Solvers.Mixture.Mixture object containing model and geometry data

  • zIdx — Axial indices to evaluate (optional; defaults to full axial range)

Notes:

  • Sigmoid parameters are scaled by node density (NNODES / LENGTH)

  • The center of the transition is offset by mix.OAFIDX()

  • Uses mix.sigm(…) to evaluate the sigmoid function

CBT(mix, zIdx)

CBT Critical Boiling Transition flag [-], wall dependent

Retrieves precomputed CBT flags by Solvers.Mixture.Mixture.CBT_CALC, updated when mix.H is set.

Inputs:

CHF(mix, zIdx)

CHF Critical Heat Flux [W/m^2], wall dependent

Retrieves precomputed CHF values by Solvers.Mixture.Mixture.CBT_CALC, updated when mix.H is set.

Inputs:

DPACCT(mix, Uold, zIdx)

DPACCT Temporal acceleration pressure drop [Pa]

Computes the pressure drop due to temporal acceleration between time steps.

Inputs:

  • mix — Solvers.Mixture.Mixture object

  • Uold — Previous axial velocity [m/s]

  • zIdx — Axial indices to evaluate (optional)

DPACCZ(mix, zIdx)

DPACCZ Spatial acceleration pressure drop [Pa]

Computes the pressure drop due to spatial acceleration of the flow.

Inputs:

DPGRAV(mix, zIdx)

DPGRAV Gravitational pressure loss [Pa]

Computes the pressure loss due to gravity along the axial direction.

Inputs:

DPK(mix, zIdx)

DPK Local pressure loss [Pa]

Computes the pressure loss due to localized effects (e.g., flow mixers).

Inputs:

DPPARTS(mix, Uold, zIdx)

DPPARTS All pressure loss components [Pa]

Returns a structure containing all individual pressure loss components.

Inputs:

  • mix — Solvers.Mixture.Mixture object

  • Uold — Previous axial velocity [m/s]

  • zIdx — Axial indices to evaluate (optional)

Returns:

  • dpparts — Struct with fields:

    • GRAV : Gravitational loss [Pa]

    • WALL : Wall friction loss [Pa]

    • ACCZ : Spatial acceleration loss [Pa]

    • ACCT : Temporal acceleration loss [Pa]

    • K : Local loss [Pa]

    • TOT : Total pressure loss [Pa]

DPTOT(mix, Uold, zIdx)

DPTOT Total pressure loss [Pa]

Computes the total pressure loss by summing all contributing components.

Inputs:

  • mix — Solvers.Mixture.Mixture object

  • Uold — Previous axial velocity [m/s]

  • zIdx — Axial indices to evaluate (optional)

DPWALL(mix, zIdx)

DPWALL Wall friction pressure drop [Pa]

Computes the pressure drop due to wall friction.

Inputs:

FW(mix, zIdx)

FW Fanning wall friction factor [-]

Computes the Fanning wall friction factor based on Inputs.Model.SPMTM model.

Inputs:

Supported models

  • BLASIUS: Blasius model (\(f = C(1) Re^{C(2)} + C(3)\)) using user-defined Inputs.Model.FRICTION coefficients

FWL(mix, zIdx)

FWL Liquid-equivalent Fanning wall friction factor [-]

Computes the Fanning friction factor, using liquid-equivalent Reynolds number, based on Inputs.Model.SPMTM model.

Inputs:

Supported models

HINT(mix, zIdx)

HINT Linear interfacial heat transfer rate [W/m]

Computes the interfacial heat transfer rates due to condensation and evaporation, based on interfacial mass transfer and enthalpy differences.

Inputs:

  • mix — Solvers.Mixture.Mixture object with flow and enthalpy data

  • zIdx — Axial indices to evaluate (optional; defaults to full axial range)

Notes:

HINTCOND(mix, zIdx)

HINTCOND Linear interfacial heat condensation rate [W/m]

Extracts the condensation component from Solvers.Mixture.Mixture.HINT.

Inputs:

HINTEVAP(mix, zIdx)

HINTEVAP Linear interfacial heat evaporation rate [W/m]

Extracts the evaporation component from Solvers.Mixture.Mixture.HINT.

Inputs:

HTOT(mix, zIdx)

HTOT Total linear vapor heat rate [W/m]

Computes the total vapor heat transfer rate by summing interfacial and wall contributions.

Inputs:

HVTOT(mix, zIdx)

HVTOT Total linear vapor specific enthalpy transfer [J/kg/m]

Computes the specific enthalpy input to the vapor per unit mass flow. Uses a lumped wall approach for now.

Inputs:

Notes:

  • Uses lumped wall approach: sums WV and Htot across walls

  • Set to zero when WV is negligible

HWALEVAP(mix, zIdx)

HWALEVAP Linear wall heat evaporation (boiling) rate [W/m]

Computes the heat transfer rate associated with wall boiling.

Inputs:

  • mix — Solvers.Mixture.Mixture object with boiling and enthalpy data

  • zIdx — Axial indices to evaluate (optional)

Notes:

  • Behavior depends on Inputs.Model.INTTRANSH:

    • BULK: Consideration of bulk enthalpy

    • SATURATED: Consideration of saturated enthalpy

HWALHEAT(mix, zIdx)

HWALHEAT Linear wall heat to vapor rate [W/m]

Returns the wall heat generation rate (LHGR) at boiling transition nodes.

Inputs:

Notes:

  • Applies only at nodes flagged by

Solvers.Mixture.Mixture.CBT or Solvers.Mixture.Mixture.MFBT.

HWALL(mix, zIdx)

HWALL Wall heat transfer coefficient [W/m^2/K]

Computes the effective wall heat transfer coefficient by combining single-phase and boiling models. Supports multiple walls and adjusts for boiling transition conditions using Inputs.Model.BTHTM model.

Inputs:

Supported boiling transition models

  • VAPOR: Heat transfer to vapor phase

HWALLBOIL(mix, zIdx)

HWALLBOIL Boiling wall heat transfer coefficient [W/m^2/K]

Computes the boiling wall heat transfer coefficient using selected Inputs.Model.TPHTM model.

Inputs:

Supported models

  • THOM: Thom’s correlation

JG(mix, zIdx)

JG Superficial vapor velocity [m/s]

Computes the superficial velocity of the vapor phase.

Inputs:

JL(mix, zIdx)

JL Superficial liquid velocity [m/s]

Computes the superficial velocity of the liquid phase.

Inputs:

KDIST(mix, zIdx)

KDIST Distance from upstream obstruction [m]

Computes the axial distance from the nearest upstream obstruction or inlet, based on Inputs.Model.KLOC.

Inputs:

  • mix — Solvers.Mixture.Mixture object with axial grid and obstruction location

  • zIdx — Axial indices to evaluate (optional)

KIDX(mix, zIdx)

KIDX Obstruction index

Returns the axial node index of the obstruction closest to Inputs.Model.KLOC.

Inputs:

KLOCZ(mix, zIdx)

KLOCZ Obstruction positions [m]

Returns the axial position of the obstruction closest to Inputs.Model.KLOC.

Inputs:

KLOSS(mix, zIdx)

KLOSS Local pressure loss coefficient [-]

Returns the pressure loss coefficient at the elevation closest to Inputs.Model.KLOC.

Inputs:

KTRELAX(mix, zIdx)

KTRELAX Local relaxation time [s]

Returns the relaxation time at the elevation closest to Inputs.Model.KLOC. All other axial positions are set to NaN.

Inputs:

  • mix — Solvers.Mixture.Mixture object with axial grid and model parameters

  • zIdx — Axial indices to evaluate (optional; defaults to full axial range)

LHGR(mix, zIdx)

LHGR Linear heat generation rate [W/m]

Computes the linear heat generation rate by multiplying wall perimeter with local heat flux.

Inputs:

  • mix — Solvers.Mixture.Mixture object with geometry and heat flux data

  • zIdx — Axial indices to evaluate (optional)

MFBT(mix, zIdx)

MFBT Minimum Film Boiling Transition flag [-], wall dependent

Retrieves precomputed MFBT flags by Solvers.Mixture.Mixture.MFBT_CALC, updated when mix.H is set.

Inputs:

MFLUX(mix, zIdx)

MFLUX Mass flux [kg/m^2/s]

Retrieves precomputed mass flux values by Solvers.Mixture.Mixture.MFLUX_CALC, updated when mix.W is set.

Inputs:

MINT(mix, zIdx)

MINT Linear interfacial mass transfer rates [kg/s/m]

Computes condensation and evaporation mass transfer rates based on deviation from equilibrium vapor flow and time relaxation.

Inputs:

  • mix — Solvers.Mixture.Mixture object with flow and relaxation data

  • zIdx — Axial indices to evaluate (optional; defaults to full axial range)

Notes:

  • Uses mix.HRM.WV for equilibrium deviation

  • UVeq is the approximated vapor velocity

MINTCOND(mix, zIdx)

MINTCOND Linear interfacial condensation rate [kg/s/m]

Extracts the condensation component from Solvers.Mixture.Mixture.MINT.

Inputs:

MINTEVAP(mix, zIdx)

MINTEVAP Linear interfacial evaporation rate [kg/s/m]

Extracts the evaporation component from Solvers.Mixture.Mixture.MINT.

Inputs:

MTOT(mix, zIdx)

MTOT Total linear vapor mass transfer rate [kg/s/m]

Computes the total vapor mass transfer rate by summing interfacial condensation, evaporation, and wall boiling contributions.

Inputs:

MTRANSV(mix, zIdx)

MTRANSV Linear transversal mass exchange [kg/s/m]

Models transverse vapor mass exchange between wall regions using a time relaxation approach. Currently not used.

Inputs:

Notes:

  • Uses a fixed relaxation time for now (RELAXT = 0.01 s)

MU(mix, zIdx)

MU Dynamic viscosity [Pa·s]

Computes the mixture dynamic viscosity using vapor and liquid phase contributions weighted by vapor quality.

Inputs:

MWALEVAP(mix, zIdx)

MWALEVAP Linear wall mass evaporation rate [kg/s/m]

Computes the wall boiling mass transfer rate using latent heat and wall heat generation rate.

Inputs:

  • mix — Solvers.Mixture.Mixture object with heat transfer and boiling data

  • zIdx — Axial indices to evaluate (optional)

Notes:

OAFIDX(mix)

OAFIDX Onset of annular flow node.

Returns the axial node index corresponding to the onset of annular flow, determined by comparing the equilibrium quality to the onset threshold. The result is cached in mix.oafidx_const to avoid recomputation.

Inputs:

Notes:

  • If no node satisfies the condition, the most upstream node (1) is returned

OAFWL(mix)

OAFWL Liquid mass flow rate at onset of annular flow.

Returns the liquid mass flow rate at the axial index corresponding to the onset of annular flow, as defined by Solvers.Mixture.Mixture.OAFIDX.

Inputs:

OAFX(mix, zIdx)

OAFX Onset of annular flow equilibrium quality.

Computes the equilibrium quality at the onset of annular flow using a model selected in Inputs.Model.OAF. The quality is evaluated over the specified axial indices.

Inputs:

  • mix — Solvers.Mixture.Mixture object containing model, geometry, and fluid data

  • zIdx — Axial indices to evaluate (optional; defaults to full axial range)

Supported Models:

  • WALLIS: Full Wallis model

  • WALLIS_SIMP: Simplified Wallis model

OAFZ(mix)

OAFZ Onset of annular flow elevation.

Returns the axial elevation (in meters) corresponding to the onset of annular flow, as defined by Solvers.Mixture.Mixture.OAFIDX.

Inputs:

PHI2F(mix, zIdx)

PHI2F Two-phase wall friction multiplier [-]

Computes the two-phase wall friction multiplier using selected Inputs.Model.TPFM model.

Inputs:

Supported models

  • HOMOGENEOUS: Homogeneous model

  • SLIP: Constant velocity slip ratio

  • EPRI: EPRI multiplier

PHI2K(mix, zIdx)

PHI2K Two-phase local pressure drop multiplier [-]

Computes the multiplier for local pressure drop in two-phase flow using selected Inputs.Model.TPKM model.

Inputs:

Supported models

  • HOMOGENEOUS: Homogeneous model

  • SLIP: Constant velocity slip ratio

  • ROMIE: Romie multiplier

RE(mix, zIdx)

RE Reynolds number [-]

Computes the Reynolds number based on total mass flow rate and mixture viscosity.

Inputs:

REL(mix, zIdx)

REL Liquid-equivalent Reynolds number [-]

Computes the Reynolds number using liquid viscosity and total mass flow.

Inputs:

RELAXTCOND(mix, zIdx)

RELAXTCOND Time relaxation for interfacial evaporation [s]

Retrieves precomputed time relaxation values for condensation by Solvers.Mixture.Mixture.RELAXTCOND_CALC, updated when mix.H is set.

Inputs:

RELAXTEVAP(mix, zIdx)

RELAXTEVAP Time relaxation for interfacial evaporation [s]

Retrieves precomputed time relaxation values for evaporation by Solvers.Mixture.Mixture.RELAXTEVAP_CALC, updated when mix.H is set.

Inputs:

RHO(mix, zIdx)

RHO Density [kg/m^3]

Retrieves precomputed mixture density values by Solvers.Mixture.Mixture.RHO_CALC, updated when mix.H is set.

Inputs:

T(mix, zIdx)

T Temperature [K]

Returns the fluid temperature corresponding to the local enthalpy.

Inputs:

TAUW(mix, zIdx)

TAUW Wall shear stress [N/m^2], wall dependent

Computes the wall shear stress for each wall segment using the friction factor, mass flux and two-phase multiplier. Supports multiple walls and adjusts for boiling transition conditions using Inputs.Model.BTMTM model.

Inputs:

  • mix — Solvers.Mixture.Mixture object containing flow and geometry data

  • zIdx — Axial indices to evaluate (optional)

Supported boiling transition models

  • TPFM: Two-phase friction multiplier

  • VAPOR: Shear stress to vapor phase

TWALL(mix, zIdx)

TWALL Wall temperature [K]

Computes the wall temperature based on heat flux and wall heat transfer coefficient. Uses liquid bulk temperature pre-CBT and vapor bulk temperature post-CBT.

Inputs:

U(mix, zIdx)

U Velocity [m/s]

Computes the mixture velocity from mass flow rate and density.

Inputs:

VF(mix, zIdx)

VF Void fraction [-]

Retrieves precomputed void fraction values by Solvers.Mixture.Mixture.VF_CALC, updated when mix.H is set.

Inputs:

WALEVAPRATIO(mix, zIdx)

WALEVAPRATIO Wall mass evaporation ratio [-]

Computes the fraction of liquid mass undergoing wall boiling based on equilibrium quality and boiling onset thresholds Inputs.Model.WBOILINGXSUB and Inputs.Model.WBOILINGXSAT.

Inputs:

  • mix — Solvers.Mixture.Mixture object with boiling model parameters

  • zIdx — Axial indices to evaluate (optional)

Notes:

  • Ratio is clamped between 0 and 1

  • CBT and MFBT flags suppress boiling at transition nodes

WWALL(mix, zIdx)

WWALL Mixture mass flow distribution per wall [kg/s]

Computes the wall-distributed mass flow rate by scaling the total flow with the wall perimeter ratio.

Inputs:

  • mix — Solvers.Mixture.Mixture object with geometry and flow data

  • zIdx — Axial indices to evaluate (optional; defaults to full axial range)

X(mix, zIdx)

X Vapor quality [-]

Retrieves precomputed vapor quality values by Solvers.Mixture.Mixture.X_CALC, updated when mix.H is set.

Inputs:

XEQ(mix, zIdx)

XEQ Equilibrium quality [-]

Retrieves precomputed equilibrium quality values by Solvers.Mixture.Mixture.XEQ_CALC, updated when mix.H is set.

Inputs: