MBL Version 7.1

Modelon Library 7.1 is part of Modelon's 2026.2 release.

New Features

Modelon.ThermoFluid

  • Tanks that change size during simulation. The tank shape models in Modelon.ThermoFluid.Volumes.SubComponents.TankShapes now take their dimensions as time-varying inputs rather than parameters, so the enclosed volume, the wall surfaces, the liquid-vapor interface area and the tank height all follow those signals while the model runs. Compression and expansion of a stored two-phase fluid - a piston, a bellows, a deforming tank - can therefore be modelled with the same volume, wall and heat transfer components already used for fixed-size tanks. Feeding constant dimensions reproduces the previous behaviour exactly.
  • Variable fluid height on a fixed wall discretization. Modelon.ThermoFluid.Volumes.TanksWithDetailedWall.VerticalCylinderFlatEnds has a new parameter variableFluidHeight and input L_fluid. The discretized wall stays on the physical tank length while the fluid occupies only the part below L_fluid, and wall segments above the fluid exchange no heat with it. This gives a moving piston boundary without re-gridding the wall, and keeps the wall thermal history continuous as the boundary sweeps across segments.
  • Either phase may disappear completely. Modelon.ThermoFluid.Volumes.NonEquilibriumVolume is regularized so that the liquid or the vapor volume may reach zero without the model becoming singular. Boil-off to a dry tank, and filling to a liquid-full tank, now simulate through instead of failing. The regularization is confined to a band set by V_eps_rel (default 1e-5 of the initial volume) and L_eps_rel (default 1e-4 of the initial height); outside that band the blending functions are exactly one, so established results are unaffected. Both ports hand over between phases rather than drawing from a phase that is no longer there: as the liquid surface reaches a vapor port at the top, that port changes over from vapor to liquid across L_eps, and as the liquid is exhausted a liquid port at the bottom changes over from liquid to vapor in the same way. A tank can therefore be drawn down to exhaustion with the outlet enthalpy moving continuously from the liquid to the vapor value instead of jumping. The two attribution factors vapFrac and liqFrac are public, so the hand-over can be observed and used downstream. Wall heat is handed over in the same way: the flat end caps of VerticalCylinderFlatEnds pass from the vanishing bulk to the remaining one, instead of loading their full heat flow onto a phase whose extent goes to zero. The liquid volume state carries a nominal value scaled with the tank volume, so that a vanishing vapor volume is resolved by the solver well below V_eps.
  • Operation at and above the critical pressure. The two-phase description of the non-equilibrium volume is now faded out as the pressure approaches critical - between p_2ph_lo_rel and p_2ph_hi_rel times the critical pressure, by default 0.95 and 0.98 - and the two bulks are merged thermally with a user-settable time constant tau_mix, representing the very fast thermal equalization of the critical piston effect. A tank can now be compressed out of the two-phase dome, through the critical pressure and into the supercritical region, held there, and expanded back down into the dome, with the phase split re-establishing itself continuously on re-entry.
  • Inner wall surface heat ports. All templates in Modelon.ThermoFluid.Volumes.TanksWithDetailedWall.Templates have a new parameter useInnerWallPorts. When enabled, thermal connectors mirroring the existing outer surface connectors are exposed on the inner wall surface, so user-supplied convection or boiling correlations, instrumentation or additional wall-side phenomena can be attached there without modifying the template.
  • Modelon.Thermal.Routing.VariableHeatConnection1D has a new input topLevel, the upper boundary of the fluid region. Segments of the fixed grid that lie above it are excluded from the mapping rather than being treated as vapor-wetted. This is what allows a fixed wall grid to serve a fluid domain that grows and shrinks.
  • Heat exchanger parameterized from a single nominal operating point. Modelon.ThermoFluid.HeatExchangers.EpsNTUNominalbased is an eps-NTU heat exchanger that needs no geometry. Its thermal behaviour is set by the nominal duty Q_nom and the four nominal temperatures T_prim_in, T_prim_out, T_sec_in and T_sec_out, which is the data a datasheet or a design specification normally gives. The capacity rates, the capacity ratio and the effectiveness at that point follow from them, and UA_nom is obtained by inverting the effectiveness relation for NTU_nom. The primary side is the hot side and the secondary side the cold side; asserts check the nominal data for a temperature cross and for a duty above the thermodynamic maximum. Away from the nominal point, UA is built from two thermal resistances in series, one per fluid side, split by r_prim and each scaling with its own mass flow (exponents n_prim, n_sec) and its own dynamic viscosity (exponents n_mu_prim, n_mu_sec), so the model can be fitted against a flow sweep on either side; UA_corr is a global multiplier for a systematic offset against measured data. m_flow_prim_nom and m_flow_sec_nom are the reference flows for that scaling and at the same time the operating point of the pressure drop, together with dp_prim_nom and dp_sec_nom. As on the other quasi-static heat exchangers, heatFlowDynamics puts a filter of order order and rise time riseTime on the heat flow.
  • Inverse effectiveness functions. Deriving UA from rated data needs NTU from a given effectiveness, the opposite direction to the usual correlation. Modelon.ThermoFluid.HeatExchangers.Functions has a new interface baseInverseEpsilon and two implementations: counterFlowInverseEps, the exact analytical inverse of counterFlowEps, and crossFlowUnmixedTriboixInverseEps for cross flow with both fluids unmixed, a closed-form inverse that needs no iteration (Triboix, 2009). Its forward counterpart crossFlowUnmixedTriboix is new as well. The replaceable epsFun and inverseEpsFun of EpsNTUNominalbased must be chosen as a matched pair, because the nominal parameterization inverts the relation and the simulation then evaluates it forward again; an unmatched pair leaves a round-trip error at the nominal point itself.

Modelon.Media

  • The density-from-pressure-and-temperature inverse of the two-phase Helmholtz equation of state now uses a safeguarded, bracketed Newton iteration. Property calls evaluated from (p,T) converge close to and at the critical point, where the previous iteration could diverge. Bubble and dew line evaluation near the critical pressure was hardened in the same way.

Improvements

  • NonEquilibriumVolume exposes h_liq_reg and h_vap_reg, the liquid column height and the vapor space height floored at L_eps. Wall heat transfer correlations that divide by a characteristic height, or raise it to a positive power inside a Rayleigh number, should use these instead of the raw heights so the heat transfer coefficient stays finite as a phase vanishes.
  • Modelon.Thermal.Convection.TwoPhaseFluids.PoolBoiling no longer divides by a vanishing enthalpy of vaporization, no longer returns a negative critical heat flux above the critical pressure, and is faded smoothly into single-phase convection as the pressure approaches critical. Boiling correlations are therefore usable on a tank that crosses into the supercritical region.
  • Modelon.ThermoFluid.Valves.CheckValve has a new parameter generateEvents (default false). When enabled, a state event is generated where the valve closes, so that a variable-step solver does not step across the closing point, and the opening approaches full opening smoothly instead of through a kink. This is recommended for check valves on stiff, nearly incompressible volumes. The closed valve can now also be given a leakage: minimumOpening (default 0) is the leakage area as a fraction of A_open, in the same flow path as the valve, and backFlowFraction scales the reverse leakage. The defaults reproduce the previous behaviour exactly.
  • The discretized wall templates in Modelon.ThermoFluid.Solids.Templates have a new option surfaceState (default false). With the thermal resistance enabled, the heat capacity of each segment is then lumped at the two surfaces, each with the volume of its half of the wall thickness, and the two half-thickness conduction resistances are in series between them. The surface temperatures become states, so a nonlinear heat transfer model at a surface, e.g. pool boiling, no longer requires iteration on the surface temperature at every model evaluation. The half volumes are computed exactly from the geometry of each wall model, including thick curved layers such as insulation. The wall models now set their segment volumes through the new template input V_segment.
  • The quasi-static flow models built on Modelon.ThermoFluid.Templates.PartialAdiabaticFlow (valves, check valves, flow resistances, static pipes) have a new Advanced parameter computeOutletState (default true), and Modelon.ThermoFluid.Volumes.MultiportVolume a corresponding computeInflowState (default true, dynamic energy balance only). When disabled, the outlet state state_out / T_out, respectively the inflow state state_in / T_in, are no longer evaluated at the pressure of the other side, but set equal to the inlet respectively volume state; flows and balances are unchanged. Disable them where that state may not exist, e.g. a cold liquid at a large pressure difference against the flow direction, such as a closed valve: a real-fluid medium then fails its (p,h) inversion at every model evaluation.
  • Modelon.ThermoFluid.Volumes.HeatTransfer.Buoyancy accepts its volume V as an input, so it can be combined with a volume whose size varies.
  • All tank shape models, tank templates and the tanks built on them were reviewed for Modelica variability compliance and now pass a check in pedantic mode. Several non-standardized graphical annotations were also corrected; among them the dynamic pressure readout on the NonEquilibriumVolume icon, which referenced a non-existent component and therefore never displayed a value.

Bug fixes

  • Modelon.ThermoFluid.Volumes.NonEquilibriumVolume: the wall heat connectors heat_liquid and heat_vapor limited the bulk temperatures by the saturation temperature also above the critical pressure, where the saturation temperature is held at the critical temperature. A supercritical bulk was therefore presented to the wall at the critical temperature regardless of its actual temperature, which gave wrong wall heat flows and could drive a small bulk far out of its valid range. The same limit also applied to a vanishing bulk, whose extent no longer supports a saturation interface. The limit is now faded out with the two-phase existence factor f_2ph and with the phase volume over V_eps; results where both phases exist below the supercritical hand-over are unchanged.
  • Modelon.ThermoFluid.Volumes.NonEquilibriumVolume: the vapor connector heat_vapor carries the vapor bulk temperature. It was limited from below by the saturation temperature, which only acts for a vapor bulk colder than saturation, i.e. one holding liquid-like fluid; the wall then cooled that bulk as if it were saturated vapor, without a latent heat path, and could drive it out of the medium validity range. A vapor volume that becomes slightly negative in the vanishing band is now restored towards zero by relocating liquid into it at the liquid enthalpy (mflow_fill_vap, exactly zero for a non-negative vapor volume), so that such an excursion is not carried over and amplified by later density changes of the vanished bulk.
  • Modelon.Thermal.Routing.VariableHeatConnection1D: the level is capped at topLevel in the fractional mapping, so that a level marginally above the upper boundary of the fluid region no longer gives the vapor a negative share of a wall segment.
  • Modelon.ThermoFluid.Solids.FlatWall_1d did not set the volume of its wall segments, so its heat capacity was that of a fixed default volume (1e-3 m3) regardless of the thickness t and area A. The segment volume is now t*A. This changes the thermal inertia of models using it, e.g. Modelon.Thermal.SkinHeatTransfer.TwoLayeredWall.
  • Fixed an index inconsistency in Modelon.DataAccess.Internal.ModelonTable2D and Modelon.DataAccess.Internal.ModelonTable3D where maxColY and maxRowY returned raw table indices (including the header row/column) while getY expects data-only indices (excluding the header). The returned index from maxColY/maxRowY can now be used directly in getY without adjustment.

Conversion of User Libraries

Making the tank geometry time-varying raises the variability of a number of quantities that were previously parameters. No conversion script can do this automatically, because the correct replacement depends on what the quantity was used for. Two points need manual attention.

1. Increased variability in the tank shape models

In Modelon.ThermoFluid.Volumes.SubComponents.TankShapes.TankGeometry the derived quantities V, V_outer, A_inner, A_outer, V_wall, a_wall and h changed from parameter to output, and the shape dimensions of the individual shapes - r_internal, L, H, W, r_vertical, r_horizontal1, r_horizontal2, s_end - changed from parameter to input with default bindings.

Supplying a dimension through an ordinary modifier still works and still gives a constant geometry, so most user models are unaffected. What no longer compiles is a reference to any of these quantities from a context that requires parameter variability: a parameter binding or an array dimension.

2. Use the initial-value snapshots in parameter expressions

NonEquilibriumVolume publishes V_start, h_start and A_outer_start for exactly this purpose. They are declared final parameter (fixed=false) and solved during initialization, so they hold the geometry as it was at the start of the simulation and may be used wherever a parameter is required:

  parameter SI.Volume V_ref = tank.geo.V;                        // no longer valid
  parameter SI.Volume V_ref = tank.nonEquilibriumVolume.V_start; // use this instead

  gridFixed = linspace(0, nonEquilibriumVolume.geo.h, n + 1);    // no longer valid
  gridFixed = linspace(0, nonEquilibriumVolume.h_start, n + 1);  // use this instead

For a shape dimension that has no published snapshot, declare one in the same way:

  final parameter SI.Length L_wall(fixed=false) "Cylinder length used to build the wall";
initial equation
  L_wall = tank.geo.L;

This is the pattern the tank templates now use internally (r_internal_wall, L_wall, a_wall_semi, b_wall_semi, c_wall_semi), and it is the recommended conversion for user models that sized a wall, a discretization grid or a table from the tank geometry.

Two related changes on the templates in Modelon.ThermoFluid.Volumes.TanksWithDetailedWall.Templates: V is now a variable rather than a final parameter, and the initialization parameters V_liq_start and level_start are now derived from nonEquilibriumVolume.V_start and nonEquilibriumVolume.h_start instead of geo.V and geo.h. User models that overrode either of these keep working; user models that read tank.V into a parameter must take a snapshot.

Back to top