From 0cf9ba3379c0238703c805a98805a8f6dda98bf5 Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Tue, 27 Aug 2024 17:45:03 -0700 Subject: [PATCH 01/30] Moved changed from Buildings This refactors the actuator models for #1926 --- .../Actuators/BaseClasses/ActuatorSignal.mo | 42 +++++++++++++++---- .../Movers/BaseClasses/PartialFlowMachine.mo | 28 +++++++++++-- IBPSA/Fluid/Movers/FlowControlled_dp.mo | 15 +++++++ IBPSA/Fluid/Movers/FlowControlled_m_flow.mo | 18 ++++++++ IBPSA/Fluid/Movers/SpeedControlled_y.mo | 12 ++++++ ...d_Actuators_Dampers_Examples_MixingBox.txt | 10 ++--- ...ors_Dampers_Examples_VAVBoxExponential.txt | 12 +++--- ...PSA_Fluid_Movers_Examples_ClosedLoop_y.txt | 10 ++--- ...SA_Fluid_Movers_Examples_PumpsParallel.txt | 14 +++---- ...BPSA_Fluid_Movers_Examples_PumpsSeries.txt | 12 +++--- ...BPSA_Fluid_Movers_Examples_StaticReset.txt | 16 +++---- ...ion_ControlledFlowMachinePreconfigured.txt | 16 +++---- ...overs_Validation_ControlledFlowMachine.txt | 16 +++---- ...alidation_ControlledFlowMachineDynamic.txt | 16 +++---- ..._Fluid_Movers_Validation_PressureCurve.txt | 4 +- ...Fluid_Movers_Validation_Pump_y_stratos.txt | 34 +++++++-------- 16 files changed, 185 insertions(+), 90 deletions(-) diff --git a/IBPSA/Fluid/Actuators/BaseClasses/ActuatorSignal.mo b/IBPSA/Fluid/Actuators/BaseClasses/ActuatorSignal.mo index 3106701fb4..73d94de02d 100644 --- a/IBPSA/Fluid/Actuators/BaseClasses/ActuatorSignal.mo +++ b/IBPSA/Fluid/Actuators/BaseClasses/ActuatorSignal.mo @@ -7,6 +7,11 @@ model ActuatorSignal parameter Boolean use_inputFilter=true "= true, if opening is filtered with a 2nd order CriticalDamping filter" annotation(Dialog(tab="Dynamics", group="Filtered opening")); + + parameter Boolean use_linearDynamics = true + "Set to true to use an actuator dynamics that models the change in actuator position linear in time" + annotation(Dialog(tab="Dynamics", group="Filtered opening")); + parameter Modelica.Units.SI.Time riseTime=120 "Rise time of the filter (time to reach 99.6 % of an opening step)" annotation (Dialog( @@ -52,18 +57,35 @@ protected final f=fCut, final normalized=true, final initType=init, - final y_start=y_start) if use_inputFilter + final y_start=y_start) if use_inputFilter and not use_linearDynamics "Second order filter to approximate actuator opening time, and to improve numerics" - annotation (Placement(transformation(extent={{6,81},{20,95}}))); + annotation (Placement(transformation(extent={{16,89},{24,96}}))); + Modelica.Blocks.Nonlinear.SlewRateLimiter actPos( + Rising=1/riseTime, + Falling=-1/riseTime, + Td=10/riseTime, + initType=init, + y_start=y_start, + strict=true) + if use_inputFilter and use_linearDynamics + "Actuator position" + annotation (Placement(transformation(extent={{16,76},{24,84}}))); equation connect(filter.y, y_filtered) - annotation (Line(points={{20.7,88},{50,88}}, color={0,0,127})); + annotation (Line(points={{24.4,92.5},{34,92.5},{34,88},{50,88}}, + color={0,0,127})); + connect(actPos.y, y_filtered) + annotation (Line(points={{24.4,80},{34,80},{34,88}, + {50,88}}, color={0,0,127})); + if use_inputFilter then - connect(y, filter.u) annotation (Line(points={{1.11022e-15,120},{1.11022e-15, - 88},{4.6,88}}, color={0,0,127})); - connect(filter.y, y_internal) annotation (Line(points={{20.7,88},{30,88},{30, - 70},{50,70}}, color={0,0,127})); + connect(y, filter.u) annotation (Line(points={{0,120},{0,92.5},{15.2,92.5}}, + color={0,0,127})); + connect(actPos.u, y) + annotation (Line(points={{15.2,80},{0,80},{0,120}}, color={0,0,127})); + + connect(y_filtered, y_internal); else connect(y, y_internal) annotation (Line( points={{1.11022e-15,120},{0,120},{0,70},{50,70}}, @@ -72,6 +94,7 @@ equation if not casePreInd then connect(y_internal, y_actual); end if; + annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, -100},{100,100}}), graphics={ Line( @@ -119,6 +142,11 @@ for a description of the filter. ", revisions="