From a39ccf71da1d9a18d914dfa385528f5348aed923 Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Tue, 14 Apr 2020 08:26:25 -0700 Subject: [PATCH] Merged IBPSA, branch IBPSASync_issue1341_homotopyInitialization [ci skip] --- .../BaseClasses/PowerLawResistance.mo | 16 +++++++++--- .../BaseClasses/PartialThreeWayValve.mo | 17 +++++++++--- .../Fluid/BaseClasses/PartialResistance.mo | 17 ++++++++++-- .../Fluid/Chillers/BaseClasses/Carnot.mo | 15 ++++++++--- .../BaseClasses/PlugFlowCore.mo | 26 ++++++++++++++----- Buildings/Fluid/FixedResistances/Junction.mo | 15 +++++++++-- .../Fluid/FixedResistances/PlugFlowPipe.mo | 19 +++++++++++--- .../ActiveBeams/BaseClasses/Convector.mo | 19 +++++++++++--- .../HeatExchangers/ActiveBeams/Cooling.mo | 16 +++++++++--- .../BaseClasses/PartialPrescribedOutlet.mo | 16 +++++++++--- .../Radiators/RadiatorEN442_2.mo | 14 ++++++++-- .../BaseClasses/PartialWaterToWater.mo | 16 ++++++++++-- .../Interfaces/EightPortHeatMassExchanger.mo | 21 ++++++++++----- .../Interfaces/FourPortHeatMassExchanger.mo | 16 +++++++++--- .../StaticFourPortHeatMassExchanger.mo | 16 ++++++++++-- .../StaticTwoPortHeatMassExchanger.mo | 16 ++++++++++-- .../Interfaces/TwoPortHeatMassExchanger.mo | 16 +++++++++--- .../BaseClasses/FlowMachineInterface.mo | 16 +++++++++--- .../Movers/BaseClasses/PowerInterface.mo | 15 +++++++++-- .../BaseClasses/IndirectTankHeatExchanger.mo | 17 +++++++++--- bin/verifyFiles.py | 3 ++- 21 files changed, 276 insertions(+), 66 deletions(-) diff --git a/Buildings/Airflow/Multizone/BaseClasses/PowerLawResistance.mo b/Buildings/Airflow/Multizone/BaseClasses/PowerLawResistance.mo index dbaaec6ec96..845764840f6 100644 --- a/Buildings/Airflow/Multizone/BaseClasses/PowerLawResistance.mo +++ b/Buildings/Airflow/Multizone/BaseClasses/PowerLawResistance.mo @@ -5,6 +5,9 @@ partial model PowerLawResistance "Flow resistance that uses the power law" final m_flow_nominal=rho_default*k*dp_turbulent); extends Buildings.Airflow.Multizone.BaseClasses.ErrorControl; + constant Boolean homotopyInitialization = true "= true, use homotopy method" + annotation(HideResult=true); + parameter Real m(min=0.5, max=1) "Flow exponent, m=0.5 for turbulent, m=1 for laminar"; parameter Boolean useDefaultProperties=true @@ -14,9 +17,6 @@ partial model PowerLawResistance "Flow resistance that uses the power law" "Pressure difference where laminar and turbulent flow relation coincide. Recommended = 0.1" annotation(Dialog(tab="Advanced")); - parameter Boolean homotopyInitialization = true "= true, use homotopy method" - annotation(Evaluate=true, Dialog(tab="Advanced")); - Modelica.SIunits.VolumeFlowRate V_flow "Volume flow rate through the component"; Modelica.SIunits.Velocity v(nominal=1) "Average velocity"; @@ -54,6 +54,10 @@ protected "Air mass exchanged (for purpose of error control only)"; initial equation mExc=0; + assert(homotopyInitialization, "In " + getInstanceName() + + ": The constant homotopyInitialization is set to false. This constant will be removed in future releases.", + level = AssertionLevel.warning); + equation if forceErrorControlOnFlow then der(mExc) = port_a.m_flow; @@ -128,6 +132,12 @@ The model is used as a base for the interzonal air flow models. revisions="