Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion +CoolPropWrapper
Submodule +CoolPropWrapper updated 3 files
+493 −51 CoolPropWrapper.m
+21 −0 LICENSE
+443 −19 README.md
10 changes: 6 additions & 4 deletions +Solvers/+FourField/@FourFieldSolver/FourFieldSolver.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,11 @@
function initializeSolver(ffSolver)
%INITIALIZESOLVER Initializes solver parameters and constructs film, wave, base, and drop objects.
%
% Sets up the solver's internal state using the provided :class:`Inputs.InputSet`
% and mixture solver solutions. Includes initialization of data structures for
% transient and steady-state simulations.
% Sets up the solver's internal state using the provided
% :class:`Inputs.InputSet` and
% :class:`Solvers.FourField.FourFieldSolver`. This includes
% initialization of data structures for transient and
% steady-state simulations based on the mixture solver solutions.
%
% Operations performed:
%
Expand Down Expand Up @@ -288,7 +290,7 @@ function initializeSolver(ffSolver)
% - Enhanced drop deposition is disabled
% - Uses interpolation for improved convergence
% - Falls back to ad-hoc update if interpolation fails
% - Method update film and drop mass flow rates. Use flm.copy() and drp.copy() as input arguments if used in post-process
% - Updates the film and drop mass flow rates. Use flm.copy() and drp.copy() as input arguments if used in post-process

options = ffSolver.inputSet.options;

Expand Down
14 changes: 7 additions & 7 deletions +Solvers/+FourField/Base.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@

% TODO: requires further investigation
% if base.inputSet.model.POSFILM
% DeltaWLwave = max(0-base.film.wave.WL(zIdx),0); % [kg/m-s] Wave flow is limited by 0
% DeltaMwave = DeltaWLwave ./ base.DZ; % [kg/m^2-s] Wave mass flux
% DeltaWLwave = max(0-base.film.wave.WL(zIdx),0); % [kg/m/s] Wave flow is limited by 0
% DeltaMwave = DeltaWLwave ./ base.DZ; % [kg/m^2/s] Wave mass flux
% Mwave = Mwave - DeltaMwave; % Apply to Mwave
% end

Expand Down Expand Up @@ -455,10 +455,10 @@
end

function tdry = TDRY(base, drop, zIdx)
%TDRY Base film dry-out time [s]
%TDRY Base film dryout time [s]
%
% Estimates the time of base film dry out under current
% evaporation and deposition conditions. Returns zero if dry-out does
% Estimates the time of base film dryout under current
% evaporation and deposition conditions. Returns zero if dryout does
% not occur.
%
% Inputs:
Expand All @@ -477,7 +477,7 @@

tdry = base.TBASE(zIdx) - Wb.*betaB./per./Ub./DeltaM;
tdry(DeltaM<=0) = 0;
% If dry out doesn't occur, set to 0.
% If dryout doesn't occur, set to 0.
tdry = max(tdry, 0);
end

Expand Down Expand Up @@ -530,7 +530,7 @@
end

function wminl = WMINL(base, drop, zIdx)
%WMINL Minimum base film mass flow rate per perimeter [kg/m-s]
%WMINL Minimum base film mass flow rate per perimeter [kg/s/m]
%
% Computes the minimum base film mass flow rate normalized by channel
% perimeter.
Expand Down
7 changes: 3 additions & 4 deletions +Solvers/+FourField/Film.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
TIDX = 1 % Time step index [-]
Z = 1. % Elevation [m]
HFLUX (:,:) double {mustBeNumeric,mustBeNonnegative} = 1. % Film heat flux [W/m^2]
%MEVAP (:,:) double {mustBeNumeric,mustBeNonpositive} =-1. % Evaporation mass flux [kg/s/m^2]

% Iteration properties

Expand All @@ -46,9 +45,9 @@

% Flow properties

W %(:,:) double {mustBeNumeric} = 1. % Mass flow rate [kg/s]
U %(:,:) double {mustBeNumeric} = 1. % Velocity [m/s]
H %(:,:) double {mustBeNumeric} = 1E6 % Enthalpy [J/kg]
W % Mass flow rate [kg/s]
U % Velocity [m/s]
H % Specific enthalpy [J/kg]

end

Expand Down
2 changes: 1 addition & 1 deletion +Solvers/+Mixture/Vapor.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
end

function mflux = MFLUX(vapor, zIdx)
%MFLUX Vapor mass flux [kg/m^2-s]
%MFLUX Vapor mass flux [kg/m^2/s]

if nargin < 2, zIdx = (1:vapor(1).NZ).'; end
mflux = vapor.W(zIdx)./vapor.mix.inputSet.geometry.AREA;
Expand Down
9 changes: 5 additions & 4 deletions +Solvers/+ThreeField/@ThreeFieldSolver/ThreeFieldSolver.m
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,10 @@ function initializeSolver(tfSolver)
%INITIALIZESOLVER Initializes solver parameters and constructs film/drop objects.
%
% Sets up the solver's internal state using the provided
% :class:`Inputs.InputSet` and :class:`Solvers.ThreeField.ThreeFieldSolver`,
% This includes initialization of data structures for transient and steady-state
% simulations based on the mixture solver solutions.
% :class:`Inputs.InputSet` and
% :class:`Solvers.ThreeField.ThreeFieldSolver`. This includes
% initialization of data structures for transient and
% steady-state simulations based on the mixture solver solutions.
%
% Operations performed:
%
Expand Down Expand Up @@ -296,7 +297,7 @@ function initializeSolver(tfSolver)
% - Enhanced drop deposition is disabled
% - Uses interpolation for improved convergence
% - Falls back to ad-hoc update if interpolation fails
% - Method update film and drop mass flow rates. Use flm.copy() and drp.copy() as input arguments if used in post-process
% - Updates the film and drop mass flow rates. Use flm.copy() and drp.copy() as input arguments if used in post-process

options = tfSolver.inputSet.options;

Expand Down
2 changes: 1 addition & 1 deletion +Solvers/AbstractFilm.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
end

function Mevap = MEVAP(absfilm, zIdx)
%MEVAP Evaporation mass flux [kg/s/m^2]
%MEVAP Evaporation mass flux [kg/m^2/s]

if nargin < 2, zIdx = (1:absfilm(1).NZ).'; end

Expand Down
2 changes: 1 addition & 1 deletion +Solvers/SolverPlotter.m
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ function YLimChangedCallback(~, event)
end

function plot(plotters, YData, fieldName, opts)
%PLOTZ Method to plot spatial or temporal data (YData) on the current axes
%PLOT Method to plot spatial or temporal data (YData) on the current axes

arguments
plotters
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ jobs:
# Over multiple versions
matrix:
include: ${{ fromJSON(
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/matlab-ci')
( (github.event_name == 'pull_request') ||
((github.event_name == 'push' || github.event_name == 'workflow_dispatch')
&&
(github.ref == 'refs/heads/main' || github.ref == 'refs/heads/matlab-ci'))
)
&& '[
{"matlab":"R2024b","python":"3.11"},
{"matlab":"R2025b","python":"3.12"},
Expand Down
2 changes: 1 addition & 1 deletion docs/source/Applications/database.rst
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ A typical OpenSTREAM-database workflow consists of the following steps:

.. code-block:: matlab

mixture.makeInputFiles( ...
data.makeInputFiles( ...
inputOptions=opts, ...
ioDirectory="NURETH21/Mixture");

Expand Down
8 changes: 4 additions & 4 deletions docs/source/Community/contribute_documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -106,25 +106,25 @@ committed.
Activate the environment
~~~~~~~~~~~~~~~~~~~~~~~~

On Windows Command Prompt:
Windows Command Prompt:

.. code-block:: bat

.venv\Scripts\activate

On Windows PowerShell:
Windows PowerShell:

.. code-block:: powershell

.\.venv\Scripts\Activate.ps1

On Git Bash, Linux, or macOS:
Git Bash on Windows:

.. code-block:: bash

source .venv/Scripts/activate

On Linux or macOS, the activation path may instead be:
Linux or macOS:

.. code-block:: bash

Expand Down
8 changes: 4 additions & 4 deletions docs/source/Community/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Getting started
general workflow can therefore be used to compare different levels of
physical resolution.

* **State-of-the-art annular-flow modeling.** The three-field solver separates
* **Advanced annular-flow modeling.** The three-field solver separates
the liquid into wall-film and entrained-droplet fields. The four-field
solver further separates the liquid film into base-film and
disturbance-wave fields and includes wave-frequency transport.
Expand Down Expand Up @@ -921,7 +921,7 @@ Numerical convergence
mesh or smallest time step used in a study is a reference solution and
should not automatically be treated as exact.

.. dropdown:: Can OpenSTREAM use a non-uniform axial mesh?
.. dropdown:: Can OpenSTREAM use a nonuniform axial mesh?
:animate: fade-in-slide-down
:chevron: right-down

Expand Down Expand Up @@ -953,7 +953,7 @@ Numerical convergence
spacing but also increases the number of calculated values and the
computational effort throughout the domain.

The absence of a non-uniform mesh option does not necessarily prevent
The absence of a nonuniform mesh option does not necessarily prevent
accurate calculations. A uniform mesh can be adequate when the axial
behavior is sufficiently smooth or when enough nodes are used to resolve
the shortest relevant axial length scale. Mesh adequacy should be
Expand Down Expand Up @@ -1630,7 +1630,7 @@ Physical scope and limitations

* **Straight channels with constant cross-sectional area.** The current
geometry represents a straight flow path with constant flow area.
Multiple wall perimeters and non-uniform wall heating can be defined,
Multiple wall perimeters and nonuniform wall heating can be defined,
and local perturbations can be represented through dedicated models,
but continuous geometric variation is not resolved.

Expand Down
8 changes: 4 additions & 4 deletions docs/source/Guides/theory/FourField_Model_Theory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ The four-field model serves several key roles within OpenSTREAM:
- **Non-equilibrium dynamics**: Includes a Boltzmann-type wave number density transport equation to simulate wave formation, merging, and dissipation.
- **Enhanced predictive capability**: Enables detailed simulation of film dryout, wave-driven mass transport, and hydrodynamic transitions in developing annular flow.

By explicitly modeling disturbance waves and their interactions with other flow fields, the four-field framework offers state-of-the-art capabilities for simulating complex annular flow phenomena, including intermittent film dryout.
By explicitly modeling disturbance waves and their interactions with other flow fields, the four-field framework offers advanced capabilities for simulating complex annular flow phenomena, including intermittent film dryout.

An overview of the four-field model implemented in OpenSTREAM is provided below. A more detailed derivation and theoretical background can be found in :cite:t:`LECORREMODEL` and :cite:t:`LeCorre2025OpenSTREAM`.

Governing equations
-------------------

The conservation equations are formulated at the wall level, indexed by :math:`n`, to support multi-wall geometries with different heating rates. These equations are solved starting from the onset of annular two-phase flow. Upstream of this onset, the solution from the mixture solver is used to initialize the flow fields.
The conservation equations are formulated at the wall level, indexed by :math:`n`, to support multi-wall geometries with different heating rates. The annular-flow field equations are numerically solved over the complete channel, but their physical interpretation applies from the modeled onset of annular flow. Upstream values serve as initialization quantities and evolve smoothly toward the prescribed conditions at the onset.

**1. Mass conservation**

Expand Down Expand Up @@ -105,7 +105,7 @@ Features and assumptions
------------------------

- Supports both steady-state and transient simulations in straight channels
- Supports uniform and non-uniform wall heat flux distribution
- Supports uniform and nonuniform wall heat flux distribution
- Models intermittent wave transport and non-equilibrium wave dynamics
- Includes wave-film exchange and wave number density evolution
- Assumes thermal equilibrium (no temperature difference between phases)
Expand All @@ -115,7 +115,7 @@ Features and assumptions
Role in OpenSTREAM
------------------

The four-field model provides state-of-the-art simulation capabilities for annular two-phase flow, including in developing flow regions. It captures wave dynamics and their impact on mass and momentum transfer.
The four-field model provides an advanced representation of annular two-phase flow, including in developing flow regions. It captures wave dynamics and their impact on mass and momentum transfer.

----

Expand Down
2 changes: 1 addition & 1 deletion docs/source/Guides/theory/Mixture_Model_Theory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Features and assumptions
------------------------

- Supports both steady-state and transient simulations in straight channels
- Supports uniform and non-uniform wall heat flux distribution
- Supports uniform and nonuniform wall heat flux distribution
- Can include thermal non-equilibrium modeling (subcooled boiling or post Critical Heat Flux) via closure models or MRM
- Allows phase velocity slip using drift flux models
- Neglects minor contributions such as frictional heating and temporal pressure gradient contributions
Expand Down
8 changes: 4 additions & 4 deletions docs/source/Guides/theory/ThreeField_Model_Theory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ The three-field model serves several key roles within OpenSTREAM:
- **Film and droplet transport**: Captures deposition and entrainment processes critical to predicting film dryout and droplet behavior.
- **Thermal equilibrium assumption**: Simplifies energy conservation while retaining essential mass and momentum exchanges.

By explicitly modeling the liquid film and droplet fields, the three-field framework enables accurate simulation of saturated annular flow regimes in single channels and supports advanced thermal-hydraulic analysis for various industrial applications.
By explicitly modeling the liquid film and droplet fields, the three-field framework enables detailed simulation of saturated annular flow regimes in single channels and supports advanced thermal-hydraulic analysis for various industrial applications.

An overview of the three-field model implemented in OpenSTREAM is provided below. A more detailed derivation and theoretical background can be found in :cite:t:`LeCorre2025OpenSTREAM`.

Governing equations
-------------------

The conservation equations are formulated at the wall level, indexed by :math:`n`, to support multi-wall geometries with different heating rates. These equations are solved starting from the onset of annular two-phase flow. Upstream of this onset, the solution from the mixture solver is used to initialize the flow fields.
The conservation equations are formulated at the wall level, indexed by :math:`n`, to support multi-wall geometries with different heating rates. The annular-flow field equations are numerically solved over the complete channel, but their physical interpretation applies from the modeled onset of annular flow. Upstream values serve as initialization quantities and evolve smoothly toward the prescribed conditions at the onset.

**1. Mass conservation**

Expand Down Expand Up @@ -90,7 +90,7 @@ Features and assumptions
------------------------

- Supports both steady-state and transient simulations in straight channels
- Supports uniform and non-uniform wall heat flux distribution
- Supports uniform and nonuniform wall heat flux distribution
- Applicable up to film dryout
- Models drop deposition and film entrainment
- Assumes thermal equilibrium (no temperature difference between phases)
Expand All @@ -100,7 +100,7 @@ Features and assumptions
Role in OpenSTREAM
------------------

The three-field model is the preferred framework for simulating annular two-phase flow up to the point of liquid film dryout. It offers detailed modeling of liquid film and droplet dynamics, making it particularly well-suited for advanced thermal-hydraulic analyses in Boiling Water Reactor (BWR) applications.
The three-field model provides a framework for simulating annular two-phase flow up to the point of liquid film dryout. It offers detailed modeling of liquid film and droplet dynamics, intended for advanced thermal-hydraulic analyses in Boiling Water Reactor (BWR) applications.

----

Expand Down
2 changes: 1 addition & 1 deletion docs/source/Guides/theory/TwoFluid_Model_Theory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Features and assumptions
------------------------

- Supports both steady-state and transient simulations in straight channels
- Supports uniform and non-uniform wall heat flux distribution
- Supports uniform and nonuniform wall heat flux distribution
- Captures phase-specific velocities and temperatures
- Includes interfacial mass, momentum, and energy exchange
- Supports wall boiling
Expand Down
4 changes: 3 additions & 1 deletion docs/source/Usage/runSampleScript.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ This is the quickest and easiest way to start exploring what OpenSTREAM can do,
bcFilePath = './inputs/tutorial1.inp', ...
sessionParentDir = fullfile(pwd,'outputs'), ...
overwriteSessionFiles = true, ...
LOGMODE = 'BOTH');
LOGMODE = 'BOTH');

warning on

% Create a mixture solver object
mixSolver = MixtureSolver(inputSet);
Expand Down
7 changes: 4 additions & 3 deletions docs/source/Usage/scope_and_limitations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,9 @@ The formulation is therefore most appropriate when:

- Axial transport is dominant.
- Cross-sectional quantities can be represented using averaged values.
- Local geometric effects can be represented through effective geometry,
loss coefficients, or closure models.
- Local geometric effects can be represented through loss coefficients or
closure models accounting for local effects, such as enhanced droplet
deposition downstream of an obstruction.
- Three-dimensional flow structures are not the principal quantities of
interest.

Expand All @@ -83,7 +84,7 @@ Geometric scope
---------------

The current solver frameworks are designed for straight channels with one
or more wall surfaces.
or more wall surfaces and a constant cross-sectional area.

Supported representations can include:

Expand Down
Loading