From 1897410c935b433bb40fbd4c049025ca29e592c8 Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Wed, 8 May 2024 09:29:58 -0700 Subject: [PATCH 01/20] temporarily elevated assert warnings to errors --- .../Movers/BaseClasses/FlowMachineInterface.mo | 3 +-- .../Movers/BaseClasses/PartialFlowMachine.mo | 15 +++++---------- .../Fluid/Movers/BaseClasses/PowerInterface.mo | 3 +-- 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/Buildings/Fluid/Movers/BaseClasses/FlowMachineInterface.mo b/Buildings/Fluid/Movers/BaseClasses/FlowMachineInterface.mo index 59b4b665669..1057ed643b1 100644 --- a/Buildings/Fluid/Movers/BaseClasses/FlowMachineInterface.mo +++ b/Buildings/Fluid/Movers/BaseClasses/FlowMachineInterface.mo @@ -438,8 +438,7 @@ the simulation stops."); assert(homotopyInitialization, "In " + getInstanceName() + ": The constant homotopyInitialization has been modified from its default - value. This constant will be removed in future releases.", - level = AssertionLevel.warning); + value. This constant will be removed in future releases."); equation // Assign values of dp and r_N, depending on which variable exists and is prescribed diff --git a/Buildings/Fluid/Movers/BaseClasses/PartialFlowMachine.mo b/Buildings/Fluid/Movers/BaseClasses/PartialFlowMachine.mo index e8fec9e99f0..1472b5bbc2d 100644 --- a/Buildings/Fluid/Movers/BaseClasses/PartialFlowMachine.mo +++ b/Buildings/Fluid/Movers/BaseClasses/PartialFlowMachine.mo @@ -392,8 +392,7 @@ initial algorithm "*** Warning in " + getInstanceName() + ": Mover is flow or pressure controlled and uses default pressure curve. This leads to an approximate power consumption. -Set nominalValuesDefineDefaultPressureCurve=true to suppress this warning.", - level=AssertionLevel.warning); +Set nominalValuesDefineDefaultPressureCurve=true to suppress this warning."); // The control signal is dp or m_flow but the user did not provide a fan or pump curve. // Hence, the speed is computed using default values, which likely are wrong. @@ -411,8 +410,7 @@ Set nominalValuesDefineDefaultPressureCurve=true to suppress this warning.", ": Mover is flow or pressure controlled, uses default pressure curve and has per.etaHydMet=.Power_VolumeFlowRate. As this can cause wrong power consumption, the model overrides this setting by using per.etaHydMet=.NotProvided. -Set nominalValuesDefineDefaultPressureCurve=true to suppress this warning.", - level=AssertionLevel.warning); +Set nominalValuesDefineDefaultPressureCurve=true to suppress this warning."); assert(per.havePressureCurve or not (per.etaHydMet == @@ -423,8 +421,7 @@ Set nominalValuesDefineDefaultPressureCurve=true to suppress this warning.", ": Mover has per.etaHydMet=.Power_VolumeFlowRate or per.etaHydMet=.EulerNumber. This requires per.pressure to be provided. Because it is not, the model overrides this setting by using per.etaHydMet=.NotProvided. -Also consider using models under Movers.Preconfigured which autopopulate a pressure curve.", - level=AssertionLevel.warning); +Also consider using models under Movers.Preconfigured which autopopulate a pressure curve."); assert(per.havePressureCurve or per.haveWMot_nominal or not (per.etaMotMet == @@ -435,8 +432,7 @@ Also consider using models under Movers.Preconfigured which autopopulate a press ": Mover has per.etaMotMet=.Efficiency_MotorPartLoadRatio or per.etaMotMet=.GenericCurve. This requires per.WMot_nominal or per.pressure to be provided. Because neither is provided, the model overrides this setting and by using per.etaMotMet=.NotProvided. -Also consider using models under Movers.Preconfigured which autopopulate a pressure curve.", - level=AssertionLevel.warning); +Also consider using models under Movers.Preconfigured which autopopulate a pressure curve."); assert(per.powerOrEfficiencyIsHydraulic or not (per.etaMotMet == @@ -447,8 +443,7 @@ Also consider using models under Movers.Preconfigured which autopopulate a press ": Mover has per.etaMotMet=.Efficiency_MotorPartLoadRatio or per.etaMotMet=.GenericCurve and provides information for total electric power instead of hydraulic power. This forms an algebraic loop. If simulation fails to converge, -see the \"Motor efficiency\" section in the users guide for how to correct it.", - level=AssertionLevel.warning); +see the \"Motor efficiency\" section in the users guide for how to correct it."); equation connect(prePow.port, vol.heatPort) annotation (Line( diff --git a/Buildings/Fluid/Movers/BaseClasses/PowerInterface.mo b/Buildings/Fluid/Movers/BaseClasses/PowerInterface.mo index 28b3c175ee4..c0bb70e989d 100644 --- a/Buildings/Fluid/Movers/BaseClasses/PowerInterface.mo +++ b/Buildings/Fluid/Movers/BaseClasses/PowerInterface.mo @@ -48,8 +48,7 @@ protected initial equation assert(homotopyInitialization, "In " + getInstanceName() + - ": The constant homotopyInitialization has been modified from its default value. This constant will be removed in future releases.", - level = AssertionLevel.warning); + ": The constant homotopyInitialization has been modified from its default value. This constant will be removed in future releases."); equation // Hydraulic power (transmitted by shaft), etaHyd = WFlo/WHyd From 0ff57ed51f2dc93782781e60b12f1aa9b421f90e Mon Sep 17 00:00:00 2001 From: hcasperfu Date: Thu, 9 May 2024 10:50:00 -0700 Subject: [PATCH 02/20] default efficiency methods now depend on pressure curve availability --- Buildings/Fluid/Movers/Data/Generic.mo | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Buildings/Fluid/Movers/Data/Generic.mo b/Buildings/Fluid/Movers/Data/Generic.mo index fd6ba3839c3..46880cf3711 100644 --- a/Buildings/Fluid/Movers/Data/Generic.mo +++ b/Buildings/Fluid/Movers/Data/Generic.mo @@ -29,12 +29,14 @@ record Generic "Generic data record for movers" // Efficiency computation choices parameter Buildings.Fluid.Movers.BaseClasses.Types.HydraulicEfficiencyMethod etaHydMet= - Buildings.Fluid.Movers.BaseClasses.Types.HydraulicEfficiencyMethod.EulerNumber + if havePressureCurve + then Buildings.Fluid.Movers.BaseClasses.Types.HydraulicEfficiencyMethod.EulerNumber + else Buildings.Fluid.Movers.BaseClasses.Types.HydraulicEfficiencyMethod.NotProvided "Efficiency computation method for the hydraulic efficiency etaHyd" annotation (Dialog(group="Power computation")); parameter Buildings.Fluid.Movers.BaseClasses.Types.MotorEfficiencyMethod etaMotMet= - if powerOrEfficiencyIsHydraulic - then Buildings.Fluid.Movers.BaseClasses.Types.MotorEfficiencyMethod.GenericCurve + if powerOrEfficiencyIsHydraulic and havePressureCurve + then Buildings.Fluid.Movers.BaseClasses.Types.MotorEfficiencyMethod.GenericCurve else Buildings.Fluid.Movers.BaseClasses.Types.MotorEfficiencyMethod.NotProvided "Efficiency computation method for the motor efficiency etaMot" annotation (Dialog(group="Power computation")); @@ -159,6 +161,12 @@ record Generic "Generic data record for movers" Documentation(revisions="