From 44e6de2f308240f41966cd157a0c1d5c8ce1b46b Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Mon, 6 Apr 2026 15:52:21 -0700 Subject: [PATCH 1/4] Corrected unit propagation error (maint_12.x) This integrates changes from https://github.com/lbl-srg/modelica-buildings/pull/4526 --- .../Relay/BaseClasses/TuningMonitor.mo | 22 ++- .../Validation/ChillerHeatRecoveryGroup.mo | 11 +- .../BaseClasses/PartialTwoWayValve.mo | 7 +- .../CHPs/BaseClasses/EnergyConversion.mo | 131 ++++++++++-------- .../Performance/BaseClasses/Example1.mo | 10 +- .../Examples/ResistanceVolumeFlowReversal.mo | 11 +- .../Fluid/FixedResistances/PressureDrop.mo | 18 ++- .../Validation/FiniteLineSource_Integrand.mo | 10 +- .../FiniteLineSource_Integrand_Equivalent.mo | 10 +- .../FiniteLineSource_Integrand_Length.mo | 29 ++-- .../HeatExchangers/WetCoilEffectivenessNTU.mo | 83 ++++++----- .../Frosting/Validation/WetterAfjei1997.mo | 36 +++-- .../Validation/MixingVolumeZeroFlow.mo | 10 +- .../Validation/HydraulicEfficiencyMethods.mo | 12 +- .../Examples/BaseClasses/CoolingCoilValve.mo | 8 +- .../Validation/CoolingCoilValve.mo | 17 ++- 16 files changed, 281 insertions(+), 144 deletions(-) diff --git a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/TuningMonitor.mo b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/TuningMonitor.mo index efaee3a1775..b4aedb32bb0 100644 --- a/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/TuningMonitor.mo +++ b/Buildings/Controls/OBC/Utilities/PIDWithAutotuning/Relay/BaseClasses/TuningMonitor.mo @@ -1,6 +1,6 @@ within Buildings.Controls.OBC.Utilities.PIDWithAutotuning.Relay.BaseClasses; block TuningMonitor "Monitor the tuning process" - constant Modelica.Units.SI.Time minHorLen = 1E-5 + constant Modelica.Units.SI.Time eps = 1E-5 "A small tolerance applied to determine whether a variable is greater than zero"; Buildings.Controls.OBC.CDL.Interfaces.RealInput tOn( final quantity="Time", @@ -33,19 +33,23 @@ protected "Check if either the length for the on period or the length for the off period are larger than 0" annotation (Placement(transformation(origin={-40,10}, extent = {{-40, 40}, {-20, 60}}))); Buildings.Controls.OBC.CDL.Reals.Sources.Constant minLen( - final k=minHorLen) + final k=eps) "Minimum value for the horizon length" annotation (Placement(transformation(extent={{-140,90},{-120,110}}))); Buildings.Controls.OBC.CDL.Discrete.TriggeredSampler samAddtOntOff "Sample the minimum period when the minimum period is greater than 0" annotation (Placement(transformation(extent={{-40,-20},{-20,0}}))); - Buildings.Controls.OBC.CDL.Reals.Greater tInc + Buildings.Controls.OBC.CDL.Reals.Greater tInc( + u1(unit="s"), + u2(unit="s")) "Check if either the length for the on period or the length for the off period increases after they both become positive" annotation (Placement(transformation(extent={{40,20},{60,40}}))); Buildings.Controls.OBC.CDL.Reals.Add addtOntOff "Block that calculates the sum of the length for the on period and the length for the off period" annotation (Placement(transformation(extent={{-130,-20},{-110,0}}))); - Buildings.Controls.OBC.CDL.Reals.Greater tDec + Buildings.Controls.OBC.CDL.Reals.Greater tDec( + u1(unit="s"), + u2(unit="s")) "Check if either the length for the on period or the length for the off period decreases after they both become positive" annotation (Placement(transformation(extent={{40,-70},{60,-50}}))); Buildings.Controls.OBC.CDL.Logical.Or tCha @@ -146,6 +150,16 @@ annotation (defaultComponentName = "tunMon", Documentation(revisions="