diff --git a/+CoolPropWrapper b/+CoolPropWrapper index 6c96625..a7c4090 160000 --- a/+CoolPropWrapper +++ b/+CoolPropWrapper @@ -1 +1 @@ -Subproject commit 6c9662573859851168877705ecf0404ed646118a +Subproject commit a7c40902ff66faf6ed668986398bb1b9faa16e13 diff --git a/+Solvers/+FourField/@FourFieldSolver/FourFieldSolver.m b/+Solvers/+FourField/@FourFieldSolver/FourFieldSolver.m index 17c2da9..a4717d2 100644 --- a/+Solvers/+FourField/@FourFieldSolver/FourFieldSolver.m +++ b/+Solvers/+FourField/@FourFieldSolver/FourFieldSolver.m @@ -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: % @@ -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; diff --git a/+Solvers/+FourField/Base.m b/+Solvers/+FourField/Base.m index ab82f09..c757930 100644 --- a/+Solvers/+FourField/Base.m +++ b/+Solvers/+FourField/Base.m @@ -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 @@ -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: @@ -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 @@ -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. diff --git a/+Solvers/+FourField/Film.m b/+Solvers/+FourField/Film.m index 66ed828..5793959 100644 --- a/+Solvers/+FourField/Film.m +++ b/+Solvers/+FourField/Film.m @@ -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 @@ -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 diff --git a/+Solvers/+Mixture/Vapor.m b/+Solvers/+Mixture/Vapor.m index 180a571..6ba83ba 100644 --- a/+Solvers/+Mixture/Vapor.m +++ b/+Solvers/+Mixture/Vapor.m @@ -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; diff --git a/+Solvers/+ThreeField/@ThreeFieldSolver/ThreeFieldSolver.m b/+Solvers/+ThreeField/@ThreeFieldSolver/ThreeFieldSolver.m index 86c2a0d..4b6772d 100644 --- a/+Solvers/+ThreeField/@ThreeFieldSolver/ThreeFieldSolver.m +++ b/+Solvers/+ThreeField/@ThreeFieldSolver/ThreeFieldSolver.m @@ -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: % @@ -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; diff --git a/+Solvers/AbstractFilm.m b/+Solvers/AbstractFilm.m index 6183ceb..7bd3239 100644 --- a/+Solvers/AbstractFilm.m +++ b/+Solvers/AbstractFilm.m @@ -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 diff --git a/+Solvers/SolverPlotter.m b/+Solvers/SolverPlotter.m index 6c66e06..1c81801 100644 --- a/+Solvers/SolverPlotter.m +++ b/+Solvers/SolverPlotter.m @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76bd1d7..b49600e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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"}, diff --git a/docs/source/Applications/database.rst b/docs/source/Applications/database.rst index 349d41a..61b127f 100644 --- a/docs/source/Applications/database.rst +++ b/docs/source/Applications/database.rst @@ -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"); diff --git a/docs/source/Community/contribute_documentation.rst b/docs/source/Community/contribute_documentation.rst index 68f42df..09646e2 100644 --- a/docs/source/Community/contribute_documentation.rst +++ b/docs/source/Community/contribute_documentation.rst @@ -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 diff --git a/docs/source/Community/faq.rst b/docs/source/Community/faq.rst index ad6efe1..85d09aa 100644 --- a/docs/source/Community/faq.rst +++ b/docs/source/Community/faq.rst @@ -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. @@ -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 @@ -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 @@ -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. diff --git a/docs/source/Guides/theory/FourField_Model_Theory.rst b/docs/source/Guides/theory/FourField_Model_Theory.rst index 11269f0..7fee4a1 100644 --- a/docs/source/Guides/theory/FourField_Model_Theory.rst +++ b/docs/source/Guides/theory/FourField_Model_Theory.rst @@ -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** @@ -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) @@ -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. ---- diff --git a/docs/source/Guides/theory/Mixture_Model_Theory.rst b/docs/source/Guides/theory/Mixture_Model_Theory.rst index bd8510c..02f4035 100644 --- a/docs/source/Guides/theory/Mixture_Model_Theory.rst +++ b/docs/source/Guides/theory/Mixture_Model_Theory.rst @@ -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 diff --git a/docs/source/Guides/theory/ThreeField_Model_Theory.rst b/docs/source/Guides/theory/ThreeField_Model_Theory.rst index 74a8a2d..8113905 100644 --- a/docs/source/Guides/theory/ThreeField_Model_Theory.rst +++ b/docs/source/Guides/theory/ThreeField_Model_Theory.rst @@ -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** @@ -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) @@ -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. ---- diff --git a/docs/source/Guides/theory/TwoFluid_Model_Theory.rst b/docs/source/Guides/theory/TwoFluid_Model_Theory.rst index aa47f57..4e7cfb9 100644 --- a/docs/source/Guides/theory/TwoFluid_Model_Theory.rst +++ b/docs/source/Guides/theory/TwoFluid_Model_Theory.rst @@ -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 diff --git a/docs/source/Usage/runSampleScript.rst b/docs/source/Usage/runSampleScript.rst index 4d34534..6c6a9c4 100644 --- a/docs/source/Usage/runSampleScript.rst +++ b/docs/source/Usage/runSampleScript.rst @@ -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); diff --git a/docs/source/Usage/scope_and_limitations.rst b/docs/source/Usage/scope_and_limitations.rst index 65061d3..93fe061 100644 --- a/docs/source/Usage/scope_and_limitations.rst +++ b/docs/source/Usage/scope_and_limitations.rst @@ -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. @@ -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: