From 1d1a9896d3081dab5604c956f665e3327eeff573 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20R=C3=B6mer?= Date: Thu, 19 Feb 2026 10:33:11 +0100 Subject: [PATCH 01/13] fixes for open-modelica usage --- .../BaseClasses/PartialBESRulesSystem.mo | 2 +- BESMod/Examples/BAUSimStudy/Case1Standard.mo | 4 +- .../PartialBuildingEnergySystem.mo | 2 +- .../BaseClasses/PartialFluidSubsystem.mo | 2 +- .../Control/BaseClasses/PartialControl.mo | 2 +- .../Building/BaseClasses/PartialDemand.mo | 2 +- .../Demand/Building/TEASERThermalZone.mo | 19 ++-- .../Demand/DHW/BaseClasses/PartialDHW.mo | 6 +- BESMod/Systems/Demand/DHW/StandardProfiles.mo | 3 +- .../BaseClasses/PartialElectricalSystem.mo | 2 +- .../Control/BaseClasses/PartialControl.mo | 2 +- .../BaseClasses/PartialDistribution.mo | 2 +- .../BaseClasses/PartialGeneration.mo | 2 +- .../Transfer/BaseClasses/PartialTransfer.mo | 2 +- .../Control/BaseClasses/PartialControl.mo | 2 +- .../BaseClasses/PartialTwoStorageParallel.mo | 22 ----- .../RecordsCollection/DHWDesignParameters.mo | 6 +- .../BaseClasses/PartialWithPipingLosses.mo | 39 ++++----- .../Transfer/IdealValveRadiator.mo | 2 +- .../Transfer/RadiatorPressureBased.mo | 87 +++++++++---------- .../Tests/TestIdealValveRadiatorSystem.mo | 7 +- .../Hydraulical/Transfer/Tests/package.order | 1 + .../Control/BaseClasses/PartialControl.mo | 2 +- .../BaseClasses/CustomRadiator.mo | 2 +- BESMod/package.mo | 2 +- 25 files changed, 93 insertions(+), 131 deletions(-) diff --git a/BESMod/BESRules/BaseClasses/PartialBESRulesSystem.mo b/BESMod/BESRules/BaseClasses/PartialBESRulesSystem.mo index 3436ade0..74d1b56c 100644 --- a/BESMod/BESRules/BaseClasses/PartialBESRulesSystem.mo +++ b/BESMod/BESRules/BaseClasses/PartialBESRulesSystem.mo @@ -5,7 +5,7 @@ partial model PartialBESRulesSystem redeclare replaceable BESMod.BESRules.DesignOptimization.DesignOptimizationVariables parameterStudy, redeclare replaceable BESMod.Systems.UserProfiles.TEASERInputsStoIntGai userProfiles, - final use_openModelica=false, + final use_openModelica=true, redeclare BESMod.BESRules.BaseClasses.SystemParameters systemParameters( QBui_flow_nominal=building.QRec_flow_nominal, THydSup_nominal=fill( THyd_nominal, systemParameters.nZones)), diff --git a/BESMod/Examples/BAUSimStudy/Case1Standard.mo b/BESMod/Examples/BAUSimStudy/Case1Standard.mo index ab51e384..c36a2ad9 100644 --- a/BESMod/Examples/BAUSimStudy/Case1Standard.mo +++ b/BESMod/Examples/BAUSimStudy/Case1Standard.mo @@ -1,8 +1,6 @@ within BESMod.Examples.BAUSimStudy; model Case1Standard - extends PartialCase(building(redeclare - BESMod.Systems.Demand.Building.RecordsCollection.ACoolHeadAndBEStPar.NoRetrofit1918_SingleDwelling - oneZoneParam), + extends PartialCase(building(redeclare BESMod.Systems.Demand.Building.RecordsCollection.ACoolHeadAndBEStPar.NoRetrofit1918_SingleDwelling oneZoneParam, use_verboseEnergyBalance = false), systemParameters(TOda_nominal=263.15, THydSup_nominal={328.15})); extends Modelica.Icons.Example; diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index ec3a7166..edbdff59 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -1,7 +1,7 @@ within BESMod.Systems.BaseClasses; partial model PartialBuildingEnergySystem "Partial BES" - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); diff --git a/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo b/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo index 1747ce10..959f3ad7 100644 --- a/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo +++ b/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo @@ -2,7 +2,7 @@ within BESMod.Systems.BaseClasses; model PartialFluidSubsystem "Model for a partial subsystem based on the IBPSA fluid core" extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations; - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); diff --git a/BESMod/Systems/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Control/BaseClasses/PartialControl.mo index 22dd5687..f2e92ce9 100644 --- a/BESMod/Systems/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Control/BaseClasses/PartialControl.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Control.BaseClasses; partial model PartialControl "Model for a partial HEMS control" extends BESMod.Utilities.Icons.ControlIcon; - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); BESMod.Systems.Hydraulical.Interfaces.SystemControlBus sigBusHyd annotation (Placement( diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo index 337370fd..4da17e99 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Demand.Building.BaseClasses; partial model PartialDemand "Partial demand model for HPS" extends BESMod.Utilities.Icons.BuildingIcon; - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nZones(min=1) "Number of zones /rooms"; diff --git a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo index 3997263e..04860fb6 100644 --- a/BESMod/Systems/Demand/Building/TEASERThermalZone.mo +++ b/BESMod/Systems/Demand/Building/TEASERThermalZone.mo @@ -15,6 +15,7 @@ model TEASERThermalZone parameter Real ventRate[nZones]=fill(0, nZones) "Constant mechanical ventilation rate"; parameter Boolean use_verboseEnergyBalance=true "=false to disable the integration of the verbose energy balance"; + final parameter Boolean use_verboseEnergyBalanceInternal = not use_openModelica and use_verboseEnergyBalance; parameter Modelica.Units.SI.TemperatureDifference dTComfort=2 "Temperature difference to room set temperature at which the comfort is still acceptable. In DIN EN 15251, all temperatures below 22 °C - 2 K count as discomfort. Hence the default value. If your room set temperature is lower, consider using smaller values."; parameter Boolean incElePro = false @@ -55,14 +56,14 @@ model TEASERThermalZone Modelica.Blocks.Sources.RealExpression QVent[nZones](y= portVent_in.m_flow.*inStream(portVent_in.h_outflow) .+ portVent_out.m_flow - .*portVent_out.h_outflow) if use_ventilation and use_verboseEnergyBalance + .*portVent_out.h_outflow) if use_ventilation and use_verboseEnergyBalanceInternal "Internal gains" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-90,-216}))); Modelica.Blocks.Sources.RealExpression QAirExc[nZones](y= - thermalZone.airExc.Q_flow) if use_verboseEnergyBalance "Internal gains" annotation ( + thermalZone.airExc.Q_flow) if use_verboseEnergyBalanceInternal "Internal gains" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -73,7 +74,7 @@ model TEASERThermalZone Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor heatFlowSensorConv[ nZones] annotation (Placement(transformation(extent={{-80,40},{-60,60}}))); - Modelica.Blocks.Math.Add addTra[nZones] if use_verboseEnergyBalance + Modelica.Blocks.Math.Add addTra[nZones] if use_verboseEnergyBalanceInternal annotation (Placement(transformation(extent={{-10,10},{10,-10}}, rotation=0, origin={-90,-198}))); @@ -115,10 +116,10 @@ model TEASERThermalZone Utilities.KPIs.ZoneEnergyBalance zoneEneBal[nZones](each final with_ventilation=use_ventilation, each final with_floor=zoneParam[1].AFloor > 0) - if use_verboseEnergyBalance "Zone energy balance" + if use_verboseEnergyBalanceInternal "Zone energy balance" annotation (Placement(transformation(extent={{-60,-200},{-22,-140}}))); Modelica.Blocks.Sources.RealExpression QExtWall_flow[nZones](y=thermalZone.ROM.extWall.Q_flow) - if use_verboseEnergyBalance "External wall heat flow rate" annotation ( + if use_verboseEnergyBalanceInternal "External wall heat flow rate" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -132,20 +133,20 @@ model TEASERThermalZone "Zone temperature KPIs for operative temperature" annotation (Placement(transformation(extent={{0,-80},{20,-60}}))); Modelica.Blocks.Sources.RealExpression QRoof_flow[nZones](y=thermalZone.ROM.roof.Q_flow) - if use_verboseEnergyBalance "Roof heat flow rate" annotation (Placement( + if use_verboseEnergyBalanceInternal "Roof heat flow rate" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-90,-120}))); Modelica.Blocks.Sources.RealExpression QFloor_flow[nZones](y=thermalZone.ROM.floor.Q_flow) - if use_verboseEnergyBalance and zoneParam[1].AFloor > 0 + if use_verboseEnergyBalanceInternal and zoneParam[1].AFloor > 0 "Floor heat flow rate" annotation (Placement( transformation( extent={{-10,-10},{10,10}}, rotation=0, origin={-90,-134}))); Modelica.Blocks.Sources.RealExpression QWin_flow[nZones](y=thermalZone.ROM.window.Q_flow) - if use_verboseEnergyBalance "Window heat flow rate" annotation ( + if use_verboseEnergyBalanceInternal "Window heat flow rate" annotation ( Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -153,7 +154,7 @@ model TEASERThermalZone Modelica.Blocks.Sources.RealExpression QSol_flow[nZones](y={if ATot[i] > 0 then sum({thermalZone[i].ROM.solRad[n]*thermalZone[i].ROM.ATransparent[n]* thermalZone[i].ROM.gWin for n in 1:thermalZone[i].ROM.nOrientations}) - else 0 for i in 1:nZones}) if use_verboseEnergyBalance + else 0 for i in 1:nZones}) if use_verboseEnergyBalanceInternal "Solar radiative heat flow rate" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, diff --git a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo index b7685d57..853673d5 100644 --- a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo +++ b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHW.mo @@ -19,10 +19,8 @@ partial model PartialDHW "Partial model for domestic hot water (DHW)" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem")); parameter Modelica.Units.SI.HeatFlowRate QDHW_flow_nominal = mDHW_flow_nominal * cp * (TDHW_nominal - TDHWCold_nominal) "Nominal heat flow rate of DHW system" annotation (Dialog(group= "Design - Bottom Up: Parameters are defined by the subsystem")); - parameter Modelica.Units.SI.Time tCrit(displayUnit="h") "Time for critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem", enable=designType - <> BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.NoStorage)); - parameter Real QCrit "Energy demand in kWh during critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem", enable=designType - == BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage)); + parameter Modelica.Units.SI.Time tCrit(displayUnit="h") "Time for critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem")); + parameter Real QCrit "Energy demand in kWh during critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem")); Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare final package Medium = Medium) "Inlet for the demand of DHW" annotation (Placement( diff --git a/BESMod/Systems/Demand/DHW/StandardProfiles.mo b/BESMod/Systems/Demand/DHW/StandardProfiles.mo index 036e88b2..000284e2 100644 --- a/BESMod/Systems/Demand/DHW/StandardProfiles.mo +++ b/BESMod/Systems/Demand/DHW/StandardProfiles.mo @@ -9,8 +9,7 @@ model StandardProfiles "DHW profiles based on EU 812/2013" mDHW_flow_nominal=DHWProfile.m_flow_nominal, combiTimeTableDHWInput(tableOnFile=false, table=DHWProfile.table)); replaceable parameter Systems.Demand.DHW.RecordsCollection.ProfileM - DHWProfile constrainedby Systems.Demand.DHW.RecordsCollection.PartialDHWTap annotation (choicesAllMatching=true, Dialog( - enable=not use_dhwCalc and use_dhw)); + DHWProfile constrainedby Systems.Demand.DHW.RecordsCollection.PartialDHWTap annotation (choicesAllMatching=true); annotation (Documentation(info="

diff --git a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo index 00d02321..3b121263 100644 --- a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo +++ b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.BaseClasses; partial model PartialElectricalSystem "Partial model for electrical system" - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nLoadsExtSubSys(min=1) = 4 "Number of external subsystems which result in electrical load / generation"; diff --git a/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo index c1f37918..55f608d6 100644 --- a/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Control.BaseClasses; partial model PartialControl "Partial electrical control model" - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nParallelDem(min=1) diff --git a/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo b/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo index 2dd35aef..d458d637 100644 --- a/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo +++ b/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Distribution.BaseClasses; partial model PartialDistribution - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nSubSys(min=2) diff --git a/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo b/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo index b47d4f25..b7cbe9c6 100644 --- a/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo +++ b/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Electrical.Generation.BaseClasses; partial model PartialGeneration "Basic model with interfaces for electrical generation package" - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer numGenUnits(min=1) "Number of generation (e.g. PV module) units" diff --git a/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo b/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo index cfdf460b..e97fa7a3 100644 --- a/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo +++ b/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Transfer.BaseClasses; partial model PartialTransfer "Partial model for transfer subsystems" - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nParallelDem(min=1) diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo index b0c53ad5..b0f0c4d6 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; partial model PartialControl "Partial controller for HPS" extends BESMod.Utilities.Icons.ControlIcon; parameter Boolean use_dhw "=false to disable DHW"; - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo index a62ec1dc..e641515c 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo @@ -228,16 +228,6 @@ partial model PartialTwoStorageParallel rotation=180, origin={76,80}))); - BESMod.Utilities.KPIs.EnergyKPICalculator eneKPICalDHWHeaRod(use_inpCon=false, y= - QHRStoDHWPre_flow.Q_flow) if parStoDHW.use_hr annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-50,-170}))); - BESMod.Utilities.KPIs.EnergyKPICalculator eneKPICalBufHeaRod(use_inpCon=false, y= - QHRStoBufPre_flow.Q_flow) if parStoBuf.use_hr - annotation (Placement(transformation(extent={{-100,-180},{-80,-160}}))); - Modelica.Blocks.Math.MultiSum multiSum(nu=4) annotation (Placement( transformation( extent={{-9,-9},{9,9}}, @@ -345,18 +335,6 @@ equation index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); - connect(eneKPICalBufHeaRod.KPI, outBusDist.PEleHRPreBuf) annotation (Line( - points={{-77.8,-170},{0,-170},{0,-100}}, color={135,135,135}), Text( - string="%second", - index=1, - extent={{-3,6},{-3,6}}, - horizontalAlignment=TextAlignment.Right)); - connect(eneKPICalDHWHeaRod.KPI, outBusDist.PEleHRPreDHW) annotation (Line( - points={{-37.8,-170},{0,-170},{0,-100}},color={135,135,135}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); connect(multiSum.y, realToElecCon.PEleLoa) annotation (Line(points={{-38.47,-111},{-38.47,-110},{-40,-110},{-40,-106}, {18,-106}}, color={0,0,127})); diff --git a/BESMod/Systems/Hydraulical/RecordsCollection/DHWDesignParameters.mo b/BESMod/Systems/Hydraulical/RecordsCollection/DHWDesignParameters.mo index 90ab5489..11919da9 100644 --- a/BESMod/Systems/Hydraulical/RecordsCollection/DHWDesignParameters.mo +++ b/BESMod/Systems/Hydraulical/RecordsCollection/DHWDesignParameters.mo @@ -10,10 +10,8 @@ record DHWDesignParameters parameter Modelica.Units.SI.Volume VDHWDayAt60 "Daily volume of DHW tapping" annotation (Dialog(group="DHW")); parameter Modelica.Units.SI.HeatFlowRate QDHW_flow_nominal "Nominal heat flow rate of DHW system" annotation (Dialog(group= "DHW")); - parameter Modelica.Units.SI.Time tCrit(displayUnit="h") "Time for critical period. Based on EN 15450" annotation (Dialog(group="Design - Top Down: Parameters are given by the parent system", enable=designType - <> BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.NoStorage)); - parameter Real QCrit "Energy demand in kWh during critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem", enable=designType - == BESMod.Systems.Hydraulical.Distribution.Types.DHWDesignType.PartStorage)); + parameter Modelica.Units.SI.Time tCrit(displayUnit="h") "Time for critical period. Based on EN 15450" annotation (Dialog(group="Design - Top Down: Parameters are given by the parent system")); + parameter Real QCrit "Energy demand in kWh during critical period. Based on EN 15450" annotation (Dialog(group="Design - Bottom Up: Parameters are defined by the subsystem")); end DHWDesignParameters; diff --git a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLosses.mo b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLosses.mo index 9b89948d..4c9152e6 100644 --- a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLosses.mo +++ b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLosses.mo @@ -2,10 +2,10 @@ within BESMod.Systems.Hydraulical.Transfer.BaseClasses; partial model PartialWithPipingLosses "Partial model with piping pressure losses" extends PartialTransfer( - dPip_design={max(12/1000, sqrt(4*mOld_flow_design[i] / rho / v_design[i] / Modelica.Constants.pi)) for i in 1:nParallelDem}, - dpSup_design={dpPipSupSca_design[1] + (mSup_flow_design[1]/sum({sqrt(m_flow_design[i]^2/dp_design[i]) for i in 1:nParallelDem})) ^2}, - dpSupOld_design={resMaiLin[1].dp_nominal + (mSupOld_flow_design[1]/sum({sqrt(mOld_flow_design[i]^2/dpOld_design[i]) for i in 1:nParallelDem})) ^2}, - dpSup_nominal={dpPipSupSca_nominal[1] + (mSup_flow_nominal[1]/sum({sqrt(m_flow_nominal[i]^2/dp_nominal[i]) for i in 1:nParallelDem})) ^2}, + dPip_design={12/1000 for i in 1:nParallelDem}, + dpSup_design={10}, + dpSupOld_design={10}, + dpSup_nominal={10}, final nParallelSup=1); // Pressure @@ -27,17 +27,17 @@ partial model PartialWithPipingLosses parameter Modelica.Units.SI.Velocity vSup_design[nParallelSup] = fill(max(v_design), nParallelSup) "Design velocity of main supply lines" annotation(Dialog(tab="Pressure losses")); - IBPSA.Fluid.FixedResistances.HydraulicDiameter res[nParallelDem]( + IBPSA.Fluid.FixedResistances.HydraulicDiameter res( redeclare package Medium = Medium, - final m_flow_nominal=mOld_flow_design, - each final show_T=show_T, - final dh=dPip_design, - final length=lenDisPerUnit, - each final ReC=ReC, - final v_nominal=v_design, - each final roughness=roughness, - each final fac=facPip, - each disableComputeFlowResistance=true) + final m_flow_nominal=mOld_flow_design[1], + final show_T=show_T, + final dh=dPip_design[1], + final length=lenDisPerUnit[1], + final ReC=ReC, + final v_nominal=v_design[1], + final roughness=roughness, + final fac=facPip, + disableComputeFlowResistance=true) if withPressureLossPerZone "Hydraulic resistance of supply and radiator to set dp allways to m_flow_nominal" annotation (Placement(transformation( @@ -58,15 +58,12 @@ partial model PartialWithPipingLosses extent={{-10,-10},{10,10}}, rotation=0, origin={-70,40}))); -protected - parameter Modelica.Units.SI.PressureDifference dpPipSca_design[nParallelDem]= - res.dp_nominal .* (m_flow_design ./ mOld_flow_design).^2 + + parameter Modelica.Units.SI.PressureDifference dpPipSca_design[nParallelDem] "Pipe pressure losses scaled to design flow rate of radiators"; - parameter Modelica.Units.SI.PressureDifference dpPipSupSca_design[nParallelSup]= - resMaiLin.dp_nominal .* (mSup_flow_design ./ mSupOld_flow_design).^2 + parameter Modelica.Units.SI.PressureDifference dpPipSupSca_design[nParallelSup] "Pipe pressure losses scaled to design flow rate of radiators"; - parameter Modelica.Units.SI.PressureDifference dpPipSupSca_nominal[nParallelSup]= - resMaiLin.dp_nominal .* (mSup_flow_nominal ./ mSupOld_flow_design).^2 + parameter Modelica.Units.SI.PressureDifference dpPipSupSca_nominal[nParallelSup] "Pipe pressure losses scaled to design flow rate of radiators"; parameter Boolean withPressureLossPerZone=true; initial algorithm diff --git a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo index 153bb4be..e32210c6 100644 --- a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo +++ b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo @@ -10,7 +10,7 @@ model IdealValveRadiator TTra_design={if use_oldRad_design[i] then TTraOld_design[i] else TTra_nominal[i] for i in 1:nParallelDem}, res(each final disableComputeFlowResistance=false)); - parameter Boolean use_oldRad_design[nParallelDem]={not QOld_flow_design[i]==Q_flow_nominal[i] for i in 1:nParallelDem} + parameter Boolean use_oldRad_design[nParallelDem]={abs(QOld_flow_design[i]-Q_flow_nominal[i])>1 for i in 1:nParallelDem} "If true, radiator design of old building state is used" annotation (Dialog(group="Design - Internal: Parameters are defined by the subsystem")); replaceable parameter diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 1fe48006..4ca67131 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -5,11 +5,11 @@ model RadiatorPressureBased "Pressure Based transfer system" nHeaTra=parRad.n, ABui=1, hBui=1, - final dp_design=val.dpFixed_nominal .+ val.dpValve_nominal, + final dp_design={val.dpFixed_nominal + val.dpValve_nominal}, Q_flow_design={if use_oldRad_design[i] then QOld_flow_design[i] else Q_flow_nominal[i] for i in 1:nParallelDem}, TTra_design={if use_oldRad_design[i] then TTraOld_design[i] else TTra_nominal[i] for i in 1:nParallelDem}); - final parameter Modelica.Units.SI.PressureDifference dpFixedTotal_nominal[nParallelDem] = dpPipSca_design.*(1 + parRad.perPreLosRad); - parameter Boolean use_oldRad_design[nParallelDem]={not QOld_flow_design[i]==Q_flow_nominal[i] for i in 1:nParallelDem} + parameter Modelica.Units.SI.PressureDifference dpFixedTotal_nominal[nParallelDem] = dpPipSca_design.*(1 + 0.05); + parameter Boolean use_oldRad_design[nParallelDem]={abs(QOld_flow_design[i]-Q_flow_nominal[i])>1 for i in 1:nParallelDem} "If true, radiator design of the building with no retrofit (old state) is used" annotation (Dialog(group="Design - Internal: Parameters are defined by the subsystem")); @@ -19,7 +19,7 @@ model RadiatorPressureBased "Pressure Based transfer system" "Percentage of nominal pressure difference at which the pressure relief valve starts to open" annotation(Dialog(group="Component choices", enable=use_preRelVal)); - // Valves +// Valves parameter Real valveAutho[nParallelDem](each min=0.2, each max=0.8, each unit="1")= fill(0.5, nParallelDem) "Assumed valve authority (typical value: 0.5)" @@ -31,7 +31,7 @@ model RadiatorPressureBased "Pressure Based transfer system" "may be useful for simulation stability. Always check the influence it has on your results" annotation(Dialog(group="Thermostatic Valve")); - // Volume +// Volume parameter BESMod.Systems.Hydraulical.Transfer.Types.HeatTransferSystemType traType= BESMod.Systems.Hydraulical.Transfer.Types.HeatTransferSystemType.SteelRadiator "Heat transfer system type" @@ -45,40 +45,39 @@ model RadiatorPressureBased "Pressure Based transfer system" parRad annotation (choicesAllMatching=true, Placement(transformation(extent={{-96,82},{-82,96}}))); - IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad[nParallelDem]( - each final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=m_flow_design, - each final show_T=show_T, - each final energyDynamics=energyDynamics, - each final p_start=p_start, - each final nEle=parRad.nEle, - each final fraRad=parRad.fraRad, - final Q_flow_nominal=Q_flow_design .* f_design, - final T_a_nominal=TTra_design, - final T_b_nominal=TTra_design .- dTTra_design, - final TAir_nominal=TDem_nominal, - final TRad_nominal=TDem_nominal, - each final n=parRad.n, - each final deltaM=0.3, - each final dp_nominal=0, + IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad( + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_design[1], + final show_T=show_T, + final energyDynamics=energyDynamics, + final p_start=p_start, + final nEle=5, + final fraRad=parRad.fraRad, + final Q_flow_nominal=Q_flow_design[1], + final T_a_nominal=TTra_design[1], + final T_b_nominal=TTra_design[1] - dTTra_design[1], + final TAir_nominal=TDem_nominal[1], + final TRad_nominal=TDem_nominal[1], + final n=parRad.n, + final deltaM=0.3, + final dp_nominal=0, redeclare package Medium = Medium, - each final T_start=T_start) "Radiator" annotation (Placement(transformation( + final T_start=T_start) "Radiator" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=90, origin={-10,-30}))); - IBPSA.Fluid.Actuators.Valves.TwoWayLinear val[nParallelDem]( + IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( redeclare package Medium = Medium, - each final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=m_flow_design, - each final show_T=show_T, - each final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, - final dpValve_nominal=valveAutho .* dpFixedTotal_nominal ./ (1 .- valveAutho), - each final use_strokeTime=false, - final dpFixed_nominal=if use_hydrBalAutom then fill(max(dpFixedTotal_nominal), nParallelDem) - else dpFixedTotal_nominal, - each final l=leakageOpening, - dp(start=val.dpFixed_nominal .+ val.dpValve_nominal)) + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_design[1], + final show_T=show_T, + final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, + final dpValve_nominal=dpFixedTotal_nominal[1], + final use_strokeTime=false, + final dpFixed_nominal=dpFixedTotal_nominal[1], + final l=leakageOpening, + dp(start=val.dpFixed_nominal + val.dpValve_nominal)) annotation (Placement(transformation( extent={{-10,-11},{10,11}}, rotation=270, @@ -91,7 +90,7 @@ model RadiatorPressureBased "Pressure Based transfer system" final T_start=T_start, final mSenFac=1, final m_flow_nominal=mSup_flow_design[1], - final m_flow_small=1E-4*abs(sum(rad.m_flow_nominal)), + final m_flow_small=1E-4*abs(rad.m_flow_nominal), final allowFlowReversal=allowFlowReversal, V(displayUnit="l") = vol/2, final use_C_flow=false, @@ -114,7 +113,7 @@ model RadiatorPressureBased "Pressure Based transfer system" extent={{10,-10},{-10,10}}, rotation=90, origin={-90,-10}))); - Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe[nParallelDem] annotation (Placement(transformation( + Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={30,70}))); @@ -125,7 +124,7 @@ model RadiatorPressureBased "Pressure Based transfer system" final T_start=T_start, final mSenFac=1, final m_flow_nominal=mSup_flow_design[1], - final m_flow_small=1E-4*abs(sum(rad.m_flow_nominal)), + final m_flow_small=1E-4*abs(rad.m_flow_nominal), final allowFlowReversal=allowFlowReversal, V(displayUnit="l") = vol/2, final use_C_flow=false, @@ -154,18 +153,16 @@ model RadiatorPressureBased "Pressure Based transfer system" rotation=0, origin={-30,-54}))); equation - connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-2.8,-32},{40, + connect(rad.heatPortRad, heatPortRad[1]) annotation (Line(points={{-2.8,-32},{40, -32},{40,-40},{100,-40}}, color={191,0,0})); - connect(rad.heatPortCon, heatPortCon) annotation (Line(points={{-2.8,-28},{-2.8, + connect(rad.heatPortCon, heatPortCon[1]) annotation (Line(points={{-2.8,-28},{-2.8, -26},{40,-26},{40,40},{100,40}}, color={191,0,0})); - for i in 1:nParallelDem loop - connect(rad[i].port_b, volRet.ports[i + 1]) annotation (Line(points={{-10,-40}, - {-62,-40},{-62,-32}}, - color={0,127,255})); - connect(res[i].port_a, volSup.ports[i + 1]) annotation (Line(points={{-40,40}, - {-44,40},{-44,30},{-50,30}}, color={0,127,255})); - end for; + connect(rad.port_b, volRet.ports[2]) annotation (Line(points={{-10,-40}, + {-62,-40},{-62,-32}}, + color={0,127,255})); + connect(res.port_a, volSup.ports[2]) annotation (Line(points={{-40,40}, + {-44,40},{-44,30},{-50,30}}, color={0,127,255})); connect(val.port_b, rad.port_a) annotation (Line(points={{-10,-1},{-10,-20}}, color={0,127,255})); diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo index ccebe1b0..f33fbedb 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo @@ -1,12 +1,7 @@ within BESMod.Systems.Hydraulical.Transfer.Tests; model TestIdealValveRadiatorSystem extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest( - redeclare - BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator - transfer(redeclare - BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - parRad, - redeclare BESMod.Systems.RecordsCollection.Movers.DPVar parPum)); + redeclare BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad, use_oldRad_design = {false}, TTra_design = {333.15}, Q_flow_design = transfer.Q_flow_nominal, redeclare BESMod.Systems.RecordsCollection.Movers.DPVar parPum), pumDis(each externalCtrlTyp = BESMod.Systems.Hydraulical.Components.PreconfiguredControlledMovers.Types.ExternalControlType.speed, each y = 1)); extends Modelica.Icons.Example; annotation (experiment(StopTime=12000, Tolerance=1e-06, Interval=100), diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order index 820d4c30..8a70fee6 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order @@ -3,3 +3,4 @@ TestIdealValveRadiatorSystem TestPressureBasedSystem TestPressureBasedSystemWithReliefValve TestUnderfloorHeating +PartialTestNew diff --git a/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo index 2f7bff5b..506d6e73 100644 --- a/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Ventilation.Control.BaseClasses; partial model PartialControl extends BESMod.Utilities.Icons.ControlIcon; - parameter Boolean use_openModelica=false + parameter Boolean use_openModelica=true "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); replaceable parameter diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo index 56cf9e3a..b0a19c27 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo @@ -9,7 +9,7 @@ model CustomRadiator "Custom radiator with radiative fractions" Q_flow_design={if use_oldRad_design[i] then QOld_flow_design[i] else Q_flow_nominal[i] for i in 1:nParallelDem}, TTra_design={if use_oldRad_design[i] then TTraOld_design[i] else TTra_nominal[i] for i in 1:nParallelDem}); parameter Boolean use_dynamicFraRad=true; - parameter Boolean use_oldRad_design[nParallelDem]={not QOld_flow_design[i]==Q_flow_nominal[i] for i in 1:nParallelDem} + parameter Boolean use_oldRad_design[nParallelDem]={abs(QOld_flow_design[i]-Q_flow_nominal[i])>1 for i in 1:nParallelDem} "If true, radiator design of the building with no retrofit (old state) is used" annotation (Dialog(group="Design - Internal: Parameters are defined by the subsystem")); diff --git a/BESMod/package.mo b/BESMod/package.mo index 9503d63d..063ca0e1 100644 --- a/BESMod/package.mo +++ b/BESMod/package.mo @@ -6,7 +6,7 @@ package BESMod version="0.7.0", uses( Modelica(version="4.0.0"), - SDF(version="0.4.2"), + SDF(version="0.4.3"), IBPSA(version="4.0.0"), AixLib(version="3.0.0"), ModelicaServices(version="4.0.0")), From e8e67020b442fb2444fe8591750be27560e3c3b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20R=C3=B6mer?= Date: Thu, 19 Feb 2026 11:08:02 +0100 Subject: [PATCH 02/13] add file --- .../Transfer/Tests/PartialTestNew.mo | 42 +++++++++++++++++++ .../Hydraulical/Transfer/Tests/package.order | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 BESMod/Systems/Hydraulical/Transfer/Tests/PartialTestNew.mo diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTestNew.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTestNew.mo new file mode 100644 index 00000000..55293aac --- /dev/null +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTestNew.mo @@ -0,0 +1,42 @@ +within BESMod.Systems.Hydraulical.Transfer.Tests; +model TestOpenModelica + extends Modelica.Icons.Example; + extends Systems.BaseClasses.PartialBESExample; + BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased transfer( + redeclare Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad, dTTra_nominal = {15}, dTTra_design = {15}, dTTraOld_design = {15}, m_flow_nominal = {0.16941387735728294}, mOld_flow_design = {0.16941387735728294}, QSup_flow_nominal = {10632.4149429430780}, QSupOld_flow_design = {10632.4149429430780}, mSup_flow_nominal = {0.16941387735728294}, mSup_flow_design = {0.16941387735728294}, mSupOld_flow_design = {0.16941387735728294},dpSup_nominal(each displayUnit = "Pa") = {1000},dpSup_design(each displayUnit = "Pa") = {1000},dpSupOld_design(each displayUnit = "Pa") = {1000}, Q_flow_design = {10632.4149429430780}, m_flow_design = {0.16941387735728294}, use_oldRad_design = {true}, TSup_nominal = {328.15}, TSupOld_design = {328.15}, TTra_design = {328.15}, dpOld_design(each displayUnit = "Pa") = {1000}, dp_nominal = {1000}, dpPipSca_design = {1000}, + dpFixedTotal_nominal={1100}, dpPipSupSca_design = {1000}, dpPipSupSca_nominal = {1100}, + nParallelDem = 1, redeclare package Medium = IBPSA.Media.Water, energyDynamics = Modelica.Fluid.Types.Dynamics.FixedInitial, Q_flow_nominal = systemParameters.QBui_flow_nominal, TOda_nominal = systemParameters.TOda_nominal, TDem_nominal = systemParameters.TSetZone_nominal, TAmb = systemParameters.TAmbHyd, TTra_nominal = {328.15}, TTraOld_design = {328.15}, AZone = {100}, hZone = {2.6}, ABui = 100, hBui = 2.6) annotation( + choicesAllMatching = true, + Placement(transformation(extent = {{-32, -26}, {36, 44}}))); + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTZone[transfer.nParallelDem](T = systemParameters.TSetZone_nominal) annotation( + Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin = {70, 8}))); + IBPSA.Fluid.Sources.Boundary_pT bou1[transfer.nParallelSup](redeclare package Medium = IBPSA.Media.Water, each final p = 200000, each nPorts = 1) annotation( + Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0, origin = {-70, -50}))); + Interfaces.TransferControlBus traControlBus annotation( + Placement(transformation(extent = {{0, 60}, {20, 80}}), iconTransformation(extent = {{0, 60}, {20, 80}}))); + Modelica.Blocks.Sources.Ramp ramp[1](each duration = 100, each startTime = 250) annotation( + Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0, origin = {-90, 70}))); + Modelica.Blocks.Sources.RealExpression Q_flow[transfer.nParallelDem](y = fixTZone.port.Q_flow) "Difference between trajectory and nominal heat flow rate" annotation( + Placement(transformation(extent = {{60, 80}, {80, 100}}))); + IBPSA.Fluid.Sources.MassFlowSource_T boundary[1](redeclare package Medium = IBPSA.Media.Water, m_flow = {0.16941387735728294}, T = {328.15}, each nPorts = 1) annotation( + Placement(transformation(origin = {-74, 40}, extent = {{-10, -10}, {10, 10}}))); +equation + connect(traControlBus, transfer.traControlBus) annotation( + Line(points = {{10, 70}, {10, 50}, {2, 50}, {2, 44}}, color = {255, 204, 51}, thickness = 0.5), + Text(string = "%first", index = -1, extent = {{-3, 6}, {-3, 6}}, horizontalAlignment = TextAlignment.Right)); + connect(ramp.y, traControlBus.opening) annotation( + Line(points = {{-79, 70}, {10, 70}}, color = {0, 0, 127}), + Text(string = "%second", index = 1, extent = {{6, 3}, {6, 3}}, horizontalAlignment = TextAlignment.Left)); + connect(fixTZone.port, transfer.heatPortCon) annotation( + Line(points = {{60, 8}, {46, 8}, {46, 23}, {36, 23}}, color = {191, 0, 0})); + connect(fixTZone.port, transfer.heatPortRad) annotation( + Line(points = {{60, 8}, {46, 8}, {46, -5}, {36, -5}}, color = {191, 0, 0})); + connect(bou1.ports[1], transfer.portTra_out) annotation( + Line(points = {{-60, -50}, {-46, -50}, {-46, -6}, {-32, -6}, {-32, -6}}, color = {0, 127, 255}, thickness = 0.5)); + connect(boundary.ports[1], transfer.portTra_in) annotation( + Line(points = {{-64, 40}, {-32, 40}, {-32, 24}}, color = {0, 127, 255}, thickness = 0.5)); + annotation( + Documentation(info = " +

This test sets the nominal zone and supply temperature to check if heat and mass flow rates as well as pressure drops are match the design conditions.

+")); +end TestOpenModelica; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order index 8a70fee6..52a78ead 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order @@ -3,4 +3,4 @@ TestIdealValveRadiatorSystem TestPressureBasedSystem TestPressureBasedSystemWithReliefValve TestUnderfloorHeating -PartialTestNew +TestOpenModelica From be19a43b5e1951cc92dbced4577ef69b9d728930 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 19 Feb 2026 11:21:35 +0100 Subject: [PATCH 03/13] revert changes and use proper new models to test OM --- .../BaseClasses/PartialWithPipingLosses.mo | 39 +-- .../PartialWithPipingLossesOpenModelica.mo | 81 +++++++ .../Transfer/BaseClasses/package.order | 1 + .../Functions/GetAverageVolumeOfWater.mo | 2 +- .../Transfer/RadiatorPressureBased.mo | 87 +++---- .../RadiatorPressureBasedOpenModelica.mo | 225 ++++++++++++++++++ ...{PartialTestNew.mo => TestOpenModelica.mo} | 61 ++++- .../Transfer/Tests/TestPressureBasedSystem.mo | 8 +- .../TestPressureBasedSystemWithReliefValve.mo | 9 +- .../Hydraulical/Transfer/package.order | 3 +- 10 files changed, 433 insertions(+), 83 deletions(-) create mode 100644 BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLossesOpenModelica.mo create mode 100644 BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBasedOpenModelica.mo rename BESMod/Systems/Hydraulical/Transfer/Tests/{PartialTestNew.mo => TestOpenModelica.mo} (54%) diff --git a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLosses.mo b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLosses.mo index 4c9152e6..9b89948d 100644 --- a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLosses.mo +++ b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLosses.mo @@ -2,10 +2,10 @@ within BESMod.Systems.Hydraulical.Transfer.BaseClasses; partial model PartialWithPipingLosses "Partial model with piping pressure losses" extends PartialTransfer( - dPip_design={12/1000 for i in 1:nParallelDem}, - dpSup_design={10}, - dpSupOld_design={10}, - dpSup_nominal={10}, + dPip_design={max(12/1000, sqrt(4*mOld_flow_design[i] / rho / v_design[i] / Modelica.Constants.pi)) for i in 1:nParallelDem}, + dpSup_design={dpPipSupSca_design[1] + (mSup_flow_design[1]/sum({sqrt(m_flow_design[i]^2/dp_design[i]) for i in 1:nParallelDem})) ^2}, + dpSupOld_design={resMaiLin[1].dp_nominal + (mSupOld_flow_design[1]/sum({sqrt(mOld_flow_design[i]^2/dpOld_design[i]) for i in 1:nParallelDem})) ^2}, + dpSup_nominal={dpPipSupSca_nominal[1] + (mSup_flow_nominal[1]/sum({sqrt(m_flow_nominal[i]^2/dp_nominal[i]) for i in 1:nParallelDem})) ^2}, final nParallelSup=1); // Pressure @@ -27,17 +27,17 @@ partial model PartialWithPipingLosses parameter Modelica.Units.SI.Velocity vSup_design[nParallelSup] = fill(max(v_design), nParallelSup) "Design velocity of main supply lines" annotation(Dialog(tab="Pressure losses")); - IBPSA.Fluid.FixedResistances.HydraulicDiameter res( + IBPSA.Fluid.FixedResistances.HydraulicDiameter res[nParallelDem]( redeclare package Medium = Medium, - final m_flow_nominal=mOld_flow_design[1], - final show_T=show_T, - final dh=dPip_design[1], - final length=lenDisPerUnit[1], - final ReC=ReC, - final v_nominal=v_design[1], - final roughness=roughness, - final fac=facPip, - disableComputeFlowResistance=true) + final m_flow_nominal=mOld_flow_design, + each final show_T=show_T, + final dh=dPip_design, + final length=lenDisPerUnit, + each final ReC=ReC, + final v_nominal=v_design, + each final roughness=roughness, + each final fac=facPip, + each disableComputeFlowResistance=true) if withPressureLossPerZone "Hydraulic resistance of supply and radiator to set dp allways to m_flow_nominal" annotation (Placement(transformation( @@ -58,12 +58,15 @@ partial model PartialWithPipingLosses extent={{-10,-10},{10,10}}, rotation=0, origin={-70,40}))); - - parameter Modelica.Units.SI.PressureDifference dpPipSca_design[nParallelDem] +protected + parameter Modelica.Units.SI.PressureDifference dpPipSca_design[nParallelDem]= + res.dp_nominal .* (m_flow_design ./ mOld_flow_design).^2 "Pipe pressure losses scaled to design flow rate of radiators"; - parameter Modelica.Units.SI.PressureDifference dpPipSupSca_design[nParallelSup] + parameter Modelica.Units.SI.PressureDifference dpPipSupSca_design[nParallelSup]= + resMaiLin.dp_nominal .* (mSup_flow_design ./ mSupOld_flow_design).^2 "Pipe pressure losses scaled to design flow rate of radiators"; - parameter Modelica.Units.SI.PressureDifference dpPipSupSca_nominal[nParallelSup] + parameter Modelica.Units.SI.PressureDifference dpPipSupSca_nominal[nParallelSup]= + resMaiLin.dp_nominal .* (mSup_flow_nominal ./ mSupOld_flow_design).^2 "Pipe pressure losses scaled to design flow rate of radiators"; parameter Boolean withPressureLossPerZone=true; initial algorithm diff --git a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLossesOpenModelica.mo b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLossesOpenModelica.mo new file mode 100644 index 00000000..8987b088 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLossesOpenModelica.mo @@ -0,0 +1,81 @@ +within BESMod.Systems.Hydraulical.Transfer.BaseClasses; +partial model PartialWithPipingLossesOpenModelica + "Partial model with piping pressure losses" + extends PartialTransfer( + dPip_design={12/1000 for i in 1:nParallelDem}, + dpSup_design={10}, + dpSupOld_design={10}, + dpSup_nominal={10}, + final nParallelSup=1); + + // Pressure + parameter BESMod.Systems.Hydraulical.Transfer.Types.HydraulicResistanceType typeOfHydRes=BESMod.Systems.Hydraulical.Transfer.Types.HydraulicResistanceType. + FittingAndThermostatAndCheckValve + "Type of the hydraulic restistances to be considered for parameter zf" + annotation(Dialog(tab="Pressure losses")); + parameter Real facPip(unit="1")= + BESMod.Systems.Hydraulical.Transfer.Functions.GetSurchargeFactorForHydraulicResistances( + typeOfHydRes) + "Factor for additional pressure resistances in piping network such as bows. Acc. to [Babusch, 2009]" + annotation(Dialog(tab="Pressure losses")); + parameter Modelica.Units.SI.Length lenDisToTra[nParallelSup]=fill(2*hBui, nParallelSup) + "Length of main line between distribution pump and individual transfer units" + annotation(Dialog(tab="Pressure losses")); + parameter Modelica.Units.SI.Length lenDisPerUnit[nParallelDem]=fill(2*sqrt(ABui), nParallelDem) + "Length between main line and each transfer system, default is worst point but leads to hydraulically balanced system (factor 2 for flow and return)" + annotation(Dialog(tab="Pressure losses")); + parameter Modelica.Units.SI.Velocity vSup_design[nParallelSup] = fill(max(v_design), nParallelSup) + "Design velocity of main supply lines" + annotation(Dialog(tab="Pressure losses")); + IBPSA.Fluid.FixedResistances.HydraulicDiameter res( + redeclare package Medium = Medium, + final m_flow_nominal=mOld_flow_design[1], + final show_T=show_T, + final dh=dPip_design[1], + final length=lenDisPerUnit[1], + final ReC=ReC, + final v_nominal=v_design[1], + final roughness=roughness, + final fac=facPip, + disableComputeFlowResistance=true) + if withPressureLossPerZone + "Hydraulic resistance of supply and radiator to set dp allways to m_flow_nominal" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-30,40}))); + IBPSA.Fluid.FixedResistances.HydraulicDiameter resMaiLin[nParallelSup]( + redeclare package Medium = Medium, + final m_flow_nominal=mSupOld_flow_design, + each final show_T=show_T, + final dh=sqrt(4*mSupOld_flow_design ./ rho ./ vSup_design ./ Modelica.Constants.pi), + final length=lenDisToTra, + each final ReC=ReC, + final v_nominal=vSup_design, + each final roughness=roughness, + each final fac=1) "Hydraulic resistance of main line" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-70,40}))); + + parameter Modelica.Units.SI.PressureDifference dpPipSca_design[nParallelDem] + "Pipe pressure losses scaled to design flow rate of radiators"; + parameter Modelica.Units.SI.PressureDifference dpPipSupSca_design[nParallelSup] + "Pipe pressure losses scaled to design flow rate of radiators"; + parameter Modelica.Units.SI.PressureDifference dpPipSupSca_nominal[nParallelSup] + "Pipe pressure losses scaled to design flow rate of radiators"; + parameter Boolean withPressureLossPerZone=true; +initial algorithm + for i in 1:nParallelSup loop + assert(dpSupOld_design[i] / (max(lenDisToTra) + max(lenDisPerUnit)) < 100, "Pressure drop per meter should roughly be below 100 Pa/m, but is " + + String(dpSupOld_design[i] / (max(lenDisToTra) + max(lenDisPerUnit))) + " Pa/m for supply line" + String(i), AssertionLevel.warning); + end for; + +equation + connect(resMaiLin.port_a, portTra_in) annotation (Line(points={{-80,40},{-86,40}, + {-86,38},{-100,38}}, color={0,127,255})); +annotation (Documentation(info=" +

This partial model adds the pressure losses through piping in the building from the distribution pump to the transfer units (e.g. radiators).

As a default assumption, the pipes are always desinged on the old heat load, as pipes in walls are typically never replaced.

It was a design choice to keep the piping which distributes water from the pump in the distrubution in the transfer system (even though it may be interpreted as distribution) as this piping heavily depends on the number of zones and building parameters. Furthermore, an automatic hydraulic balance requires less top-down and bottom-up parameters if all relevent pressure losses are inside the transfer system.

+")); +end PartialWithPipingLossesOpenModelica; diff --git a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/package.order index db17f53d..a558716d 100644 --- a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/package.order @@ -1,2 +1,3 @@ PartialTransfer PartialWithPipingLosses +PartialWithPipingLossesOpenModelica diff --git a/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo b/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo index 21fd7793..f7eab54e 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo @@ -1,4 +1,4 @@ -within BESMod.Systems.Hydraulical.Transfer.Functions; +within BESMod.Systems.Hydraulical.Transfer.Functions; function GetAverageVolumeOfWater "Calculate the average water volume for the whole heating unit based on the type of the unit and the installed heating load" input Modelica.Units.SI.HeatFlowRate Q_flow_nominal "Nominal heat flow rate"; diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 4ca67131..1fe48006 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -5,11 +5,11 @@ model RadiatorPressureBased "Pressure Based transfer system" nHeaTra=parRad.n, ABui=1, hBui=1, - final dp_design={val.dpFixed_nominal + val.dpValve_nominal}, + final dp_design=val.dpFixed_nominal .+ val.dpValve_nominal, Q_flow_design={if use_oldRad_design[i] then QOld_flow_design[i] else Q_flow_nominal[i] for i in 1:nParallelDem}, TTra_design={if use_oldRad_design[i] then TTraOld_design[i] else TTra_nominal[i] for i in 1:nParallelDem}); - parameter Modelica.Units.SI.PressureDifference dpFixedTotal_nominal[nParallelDem] = dpPipSca_design.*(1 + 0.05); - parameter Boolean use_oldRad_design[nParallelDem]={abs(QOld_flow_design[i]-Q_flow_nominal[i])>1 for i in 1:nParallelDem} + final parameter Modelica.Units.SI.PressureDifference dpFixedTotal_nominal[nParallelDem] = dpPipSca_design.*(1 + parRad.perPreLosRad); + parameter Boolean use_oldRad_design[nParallelDem]={not QOld_flow_design[i]==Q_flow_nominal[i] for i in 1:nParallelDem} "If true, radiator design of the building with no retrofit (old state) is used" annotation (Dialog(group="Design - Internal: Parameters are defined by the subsystem")); @@ -19,7 +19,7 @@ model RadiatorPressureBased "Pressure Based transfer system" "Percentage of nominal pressure difference at which the pressure relief valve starts to open" annotation(Dialog(group="Component choices", enable=use_preRelVal)); -// Valves + // Valves parameter Real valveAutho[nParallelDem](each min=0.2, each max=0.8, each unit="1")= fill(0.5, nParallelDem) "Assumed valve authority (typical value: 0.5)" @@ -31,7 +31,7 @@ model RadiatorPressureBased "Pressure Based transfer system" "may be useful for simulation stability. Always check the influence it has on your results" annotation(Dialog(group="Thermostatic Valve")); -// Volume + // Volume parameter BESMod.Systems.Hydraulical.Transfer.Types.HeatTransferSystemType traType= BESMod.Systems.Hydraulical.Transfer.Types.HeatTransferSystemType.SteelRadiator "Heat transfer system type" @@ -45,39 +45,40 @@ model RadiatorPressureBased "Pressure Based transfer system" parRad annotation (choicesAllMatching=true, Placement(transformation(extent={{-96,82},{-82,96}}))); - IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad( - final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=m_flow_design[1], - final show_T=show_T, - final energyDynamics=energyDynamics, - final p_start=p_start, - final nEle=5, - final fraRad=parRad.fraRad, - final Q_flow_nominal=Q_flow_design[1], - final T_a_nominal=TTra_design[1], - final T_b_nominal=TTra_design[1] - dTTra_design[1], - final TAir_nominal=TDem_nominal[1], - final TRad_nominal=TDem_nominal[1], - final n=parRad.n, - final deltaM=0.3, - final dp_nominal=0, + IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad[nParallelDem]( + each final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_design, + each final show_T=show_T, + each final energyDynamics=energyDynamics, + each final p_start=p_start, + each final nEle=parRad.nEle, + each final fraRad=parRad.fraRad, + final Q_flow_nominal=Q_flow_design .* f_design, + final T_a_nominal=TTra_design, + final T_b_nominal=TTra_design .- dTTra_design, + final TAir_nominal=TDem_nominal, + final TRad_nominal=TDem_nominal, + each final n=parRad.n, + each final deltaM=0.3, + each final dp_nominal=0, redeclare package Medium = Medium, - final T_start=T_start) "Radiator" annotation (Placement(transformation( + each final T_start=T_start) "Radiator" annotation (Placement(transformation( extent={{10,10},{-10,-10}}, rotation=90, origin={-10,-30}))); - IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( + IBPSA.Fluid.Actuators.Valves.TwoWayLinear val[nParallelDem]( redeclare package Medium = Medium, - final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=m_flow_design[1], - final show_T=show_T, - final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, - final dpValve_nominal=dpFixedTotal_nominal[1], - final use_strokeTime=false, - final dpFixed_nominal=dpFixedTotal_nominal[1], - final l=leakageOpening, - dp(start=val.dpFixed_nominal + val.dpValve_nominal)) + each final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_design, + each final show_T=show_T, + each final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, + final dpValve_nominal=valveAutho .* dpFixedTotal_nominal ./ (1 .- valveAutho), + each final use_strokeTime=false, + final dpFixed_nominal=if use_hydrBalAutom then fill(max(dpFixedTotal_nominal), nParallelDem) + else dpFixedTotal_nominal, + each final l=leakageOpening, + dp(start=val.dpFixed_nominal .+ val.dpValve_nominal)) annotation (Placement(transformation( extent={{-10,-11},{10,11}}, rotation=270, @@ -90,7 +91,7 @@ model RadiatorPressureBased "Pressure Based transfer system" final T_start=T_start, final mSenFac=1, final m_flow_nominal=mSup_flow_design[1], - final m_flow_small=1E-4*abs(rad.m_flow_nominal), + final m_flow_small=1E-4*abs(sum(rad.m_flow_nominal)), final allowFlowReversal=allowFlowReversal, V(displayUnit="l") = vol/2, final use_C_flow=false, @@ -113,7 +114,7 @@ model RadiatorPressureBased "Pressure Based transfer system" extent={{10,-10},{-10,10}}, rotation=90, origin={-90,-10}))); - Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe annotation (Placement(transformation( + Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe[nParallelDem] annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, origin={30,70}))); @@ -124,7 +125,7 @@ model RadiatorPressureBased "Pressure Based transfer system" final T_start=T_start, final mSenFac=1, final m_flow_nominal=mSup_flow_design[1], - final m_flow_small=1E-4*abs(rad.m_flow_nominal), + final m_flow_small=1E-4*abs(sum(rad.m_flow_nominal)), final allowFlowReversal=allowFlowReversal, V(displayUnit="l") = vol/2, final use_C_flow=false, @@ -153,16 +154,18 @@ model RadiatorPressureBased "Pressure Based transfer system" rotation=0, origin={-30,-54}))); equation - connect(rad.heatPortRad, heatPortRad[1]) annotation (Line(points={{-2.8,-32},{40, + connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-2.8,-32},{40, -32},{40,-40},{100,-40}}, color={191,0,0})); - connect(rad.heatPortCon, heatPortCon[1]) annotation (Line(points={{-2.8,-28},{-2.8, + connect(rad.heatPortCon, heatPortCon) annotation (Line(points={{-2.8,-28},{-2.8, -26},{40,-26},{40,40},{100,40}}, color={191,0,0})); - connect(rad.port_b, volRet.ports[2]) annotation (Line(points={{-10,-40}, - {-62,-40},{-62,-32}}, - color={0,127,255})); - connect(res.port_a, volSup.ports[2]) annotation (Line(points={{-40,40}, - {-44,40},{-44,30},{-50,30}}, color={0,127,255})); + for i in 1:nParallelDem loop + connect(rad[i].port_b, volRet.ports[i + 1]) annotation (Line(points={{-10,-40}, + {-62,-40},{-62,-32}}, + color={0,127,255})); + connect(res[i].port_a, volSup.ports[i + 1]) annotation (Line(points={{-40,40}, + {-44,40},{-44,30},{-50,30}}, color={0,127,255})); + end for; connect(val.port_b, rad.port_a) annotation (Line(points={{-10,-1},{-10,-20}}, color={0,127,255})); diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBasedOpenModelica.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBasedOpenModelica.mo new file mode 100644 index 00000000..009de0d7 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBasedOpenModelica.mo @@ -0,0 +1,225 @@ +within BESMod.Systems.Hydraulical.Transfer; +model RadiatorPressureBasedOpenModelica + "Pressure Based transfer system" + // Abui =1 and hBui =1 to avaoid warnings, will be overwritten anyway + extends BaseClasses.PartialWithPipingLossesOpenModelica( + nHeaTra=parRad.n, + ABui=1, + hBui=1, + final dp_design={val.dpFixed_nominal + val.dpValve_nominal}, + Q_flow_design={if use_oldRad_design[i] then QOld_flow_design[i] else Q_flow_nominal[i] for i in 1:nParallelDem}, + TTra_design={if use_oldRad_design[i] then TTraOld_design[i] else TTra_nominal[i] for i in 1:nParallelDem}); + parameter Modelica.Units.SI.PressureDifference dpFixedTotal_nominal[nParallelDem] = dpPipSca_design.*(1 + 0.05); + parameter Boolean use_oldRad_design[nParallelDem]={abs(QOld_flow_design[i]-Q_flow_nominal[i])>1 for i in 1:nParallelDem} + "If true, radiator design of the building with no retrofit (old state) is used" + annotation (Dialog(group="Design - Internal: Parameters are defined by the subsystem")); + + parameter Boolean use_preRelVal=false "=false to disable pressure relief valve" + annotation(Dialog(group="Component choices")); + parameter Real perPreRelValOpens=0.99 + "Percentage of nominal pressure difference at which the pressure relief valve starts to open" + annotation(Dialog(group="Component choices", enable=use_preRelVal)); + +// Valves + parameter Real valveAutho[nParallelDem](each min=0.2, each max=0.8, each unit="1")= + fill(0.5, nParallelDem) + "Assumed valve authority (typical value: 0.5)" + annotation(Dialog(group="Thermostatic Valve")); + parameter Boolean use_hydrBalAutom = true + "Use automatic hydraluic balancing to set dpFixed_nominal in valve" + annotation(Dialog(group="Thermostatic Valve")); + parameter Real leakageOpening = 0.0001 + "may be useful for simulation stability. Always check the influence it has on your results" + annotation(Dialog(group="Thermostatic Valve")); + +// Volume + parameter BESMod.Systems.Hydraulical.Transfer.Types.HeatTransferSystemType traType= + BESMod.Systems.Hydraulical.Transfer.Types.HeatTransferSystemType.SteelRadiator + "Heat transfer system type" + annotation(Dialog(group="Volume")); + parameter Modelica.Units.SI.Volume vol= + BESMod.Systems.Hydraulical.Transfer.Functions.GetAverageVolumeOfWater(sum( + Q_flow_nominal), traType) + "Volume of water in whole heat distribution and transfer system" + annotation (Dialog(group="Volume")); + replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + parRad + annotation (choicesAllMatching=true, + Placement(transformation(extent={{-96,82},{-82,96}}))); + IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad( + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_design[1], + final show_T=show_T, + final energyDynamics=energyDynamics, + final p_start=p_start, + final nEle=5, + final fraRad=parRad.fraRad, + final Q_flow_nominal=Q_flow_design[1], + final T_a_nominal=TTra_design[1], + final T_b_nominal=TTra_design[1] - dTTra_design[1], + final TAir_nominal=TDem_nominal[1], + final TRad_nominal=TDem_nominal[1], + final n=parRad.n, + final deltaM=0.3, + final dp_nominal=0, + redeclare package Medium = Medium, + final T_start=T_start) "Radiator" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={-10,-30}))); + + IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( + redeclare package Medium = Medium, + final allowFlowReversal=allowFlowReversal, + final m_flow_nominal=m_flow_design[1], + final show_T=show_T, + final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, + final dpValve_nominal=dpFixedTotal_nominal[1], + final use_strokeTime=false, + final dpFixed_nominal=dpFixedTotal_nominal[1], + final l=leakageOpening, + dp(start=val.dpFixed_nominal + val.dpValve_nominal)) + annotation (Placement(transformation( + extent={{-10,-11},{10,11}}, + rotation=270, + origin={-10,9}))); + + IBPSA.Fluid.MixingVolumes.MixingVolume volSup( + redeclare package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final mSenFac=1, + final m_flow_nominal=mSup_flow_design[1], + final m_flow_small=1E-4*abs(rad.m_flow_nominal), + final allowFlowReversal=allowFlowReversal, + V(displayUnit="l") = vol/2, + final use_C_flow=false, + nPorts=nParallelDem + 1) "Volume of supply pipes" annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={-50,20}))); + + Utilities.Electrical.ZeroLoad zeroLoad + annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); + Distribution.Components.Valves.PressureReliefValve pressureReliefValve( + redeclare final package Medium = Medium, + m_flow_nominal=mSup_flow_design[1], + final dpFullOpen_nominal=dpSup_design[1], + final dpThreshold_nominal=perPreRelValOpens*dpSup_design[1], + final facDpValve_nominal=valveAutho[1], + final l=leakageOpening) if use_preRelVal annotation (Placement( + transformation( + extent={{10,-10},{-10,10}}, + rotation=90, + origin={-90,-10}))); + Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=270, + origin={30,70}))); + IBPSA.Fluid.MixingVolumes.MixingVolume volRet( + redeclare package Medium = Medium, + final energyDynamics=energyDynamics, + final p_start=p_start, + final T_start=T_start, + final mSenFac=1, + final m_flow_nominal=mSup_flow_design[1], + final m_flow_small=1E-4*abs(rad.m_flow_nominal), + final allowFlowReversal=allowFlowReversal, + V(displayUnit="l") = vol/2, + final use_C_flow=false, + nPorts=nParallelDem + 1) "Volume of return pipes" annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-62,-22}))); + Modelica.Blocks.Sources.RealExpression senTRet[nParallelSup](final y( + each final unit="K", + each displayUnit="degC") = Medium.temperature(Medium.setState_phX( + portTra_out.p, + actualStream(portTra_out.h_outflow), + inStream(portTra_out.Xi_outflow)))) "Real expression for return temperature" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-30,-74}))); + Modelica.Blocks.Sources.RealExpression senTSup[nParallelSup](final y( + each final unit="K", + each displayUnit="degC") = Medium.temperature(Medium.setState_phX( + portTra_in.p, + inStream(portTra_in.h_outflow), + inStream(portTra_in.Xi_outflow)))) "Real expression for supply temperature" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-30,-54}))); +equation + connect(rad.heatPortRad, heatPortRad[1]) annotation (Line(points={{-2.8,-32},{40, + -32},{40,-40},{100,-40}}, color={191,0,0})); + connect(rad.heatPortCon, heatPortCon[1]) annotation (Line(points={{-2.8,-28},{-2.8, + -26},{40,-26},{40,40},{100,40}}, color={191,0,0})); + + connect(rad.port_b, volRet.ports[2]) annotation (Line(points={{-10,-40}, + {-62,-40},{-62,-32}}, + color={0,127,255})); + connect(res.port_a, volSup.ports[2]) annotation (Line(points={{-40,40}, + {-44,40},{-44,30},{-50,30}}, color={0,127,255})); + + connect(val.port_b, rad.port_a) annotation (Line(points={{-10,-1},{-10,-20}}, + color={0,127,255})); + connect(res.port_b, val.port_a) annotation (Line(points={{-20,40},{-10,40},{-10, + 19}}, color={0,127,255})); + + connect(val.y, traControlBus.opening) annotation (Line(points={{3.2,9},{8,9},{ + 8,74},{0,74},{0,100}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( + Line( + points={{60,-70},{72,-70},{72,-98}}, + color={0,0,0}, + thickness=1)); + connect(pressureReliefValve.port_b, portTra_out[1]) annotation (Line(points={{-90,-20}, + {-90,-42},{-100,-42}}, color={0,127,255})); + connect(reaPasThrOpe.u, traControlBus.opening) annotation (Line(points={{30, + 82},{30,94},{0,94},{0,100}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(reaPasThrOpe.y, outBusTra.opening) annotation (Line(points={{30,59},{ + 30,-90},{0,-90},{0,-104}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(volRet.ports[1], portTra_out[1]) annotation (Line(points={{-62,-32},{-62, + -42},{-100,-42}}, color={0,127,255})); + connect(pressureReliefValve.port_a, portTra_in[1]) + annotation (Line(points={{-90,0},{-90,38},{-100,38}}, color={0,127,255})); + connect(volSup.ports[1], resMaiLin[1].port_b) annotation (Line(points={{-50,30}, + {-54,30},{-54,40},{-60,40}}, + color={0,127,255})); + connect(senTSup.y, outBusTra.TSup) annotation (Line(points={{-19,-54},{0,-54}, + {0,-104}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + connect(senTRet.y, outBusTra.TRet) annotation (Line(points={{-19,-74},{0,-74}, + {0,-104}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); + annotation (Documentation(info=" +

Known Limitations

+

+ When enabling the pressure relief valve, the design pressure losses and mass flow rates are + not met 100 %, see the simulate and plot script of BESMod.Systems.Hydraulical.Transfer.Tests.TestPressureBasedSystemWithReliefValve. +

+ +")); +end RadiatorPressureBasedOpenModelica; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTestNew.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelica.mo similarity index 54% rename from BESMod/Systems/Hydraulical/Transfer/Tests/PartialTestNew.mo rename to BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelica.mo index 55293aac..966e36ad 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/PartialTestNew.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelica.mo @@ -2,20 +2,61 @@ within BESMod.Systems.Hydraulical.Transfer.Tests; model TestOpenModelica extends Modelica.Icons.Example; extends Systems.BaseClasses.PartialBESExample; - BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased transfer( - redeclare Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad, dTTra_nominal = {15}, dTTra_design = {15}, dTTraOld_design = {15}, m_flow_nominal = {0.16941387735728294}, mOld_flow_design = {0.16941387735728294}, QSup_flow_nominal = {10632.4149429430780}, QSupOld_flow_design = {10632.4149429430780}, mSup_flow_nominal = {0.16941387735728294}, mSup_flow_design = {0.16941387735728294}, mSupOld_flow_design = {0.16941387735728294},dpSup_nominal(each displayUnit = "Pa") = {1000},dpSup_design(each displayUnit = "Pa") = {1000},dpSupOld_design(each displayUnit = "Pa") = {1000}, Q_flow_design = {10632.4149429430780}, m_flow_design = {0.16941387735728294}, use_oldRad_design = {true}, TSup_nominal = {328.15}, TSupOld_design = {328.15}, TTra_design = {328.15}, dpOld_design(each displayUnit = "Pa") = {1000}, dp_nominal = {1000}, dpPipSca_design = {1000}, - dpFixedTotal_nominal={1100}, dpPipSupSca_design = {1000}, dpPipSupSca_nominal = {1100}, - nParallelDem = 1, redeclare package Medium = IBPSA.Media.Water, energyDynamics = Modelica.Fluid.Types.Dynamics.FixedInitial, Q_flow_nominal = systemParameters.QBui_flow_nominal, TOda_nominal = systemParameters.TOda_nominal, TDem_nominal = systemParameters.TSetZone_nominal, TAmb = systemParameters.TAmbHyd, TTra_nominal = {328.15}, TTraOld_design = {328.15}, AZone = {100}, hZone = {2.6}, ABui = 100, hBui = 2.6) annotation( - choicesAllMatching = true, - Placement(transformation(extent = {{-32, -26}, {36, 44}}))); + BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBasedOpenModelica + transfer( + redeclare + Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + parRad, + dTTra_nominal={15}, + dTTra_design={15}, + dTTraOld_design={15}, + m_flow_nominal={0.16941387735728294}, + mOld_flow_design={0.16941387735728294}, + QSup_flow_nominal={10632.4149429430780}, + QSupOld_flow_design={10632.4149429430780}, + mSup_flow_nominal={0.16941387735728294}, + mSup_flow_design={0.16941387735728294}, + mSupOld_flow_design={0.16941387735728294}, + dpSup_nominal(each displayUnit="Pa") = {1000}, + dpSup_design(each displayUnit="Pa") = {1000}, + dpSupOld_design(each displayUnit="Pa") = {1000}, + Q_flow_design={10632.4149429430780}, + m_flow_design={0.16941387735728294}, + use_oldRad_design={true}, + TSup_nominal={328.15}, + TSupOld_design={328.15}, + TTra_design={328.15}, + dpOld_design(each displayUnit="Pa") = {1000}, + dp_nominal={1000}, + dpPipSca_design={1000}, + dpFixedTotal_nominal={1100}, + dpPipSupSca_design={1000}, + dpPipSupSca_nominal={1100}, + nParallelDem=1, + redeclare package Medium = IBPSA.Media.Water, + energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, + Q_flow_nominal=systemParameters.QBui_flow_nominal, + TOda_nominal=systemParameters.TOda_nominal, + TDem_nominal=systemParameters.TSetZone_nominal, + TAmb=systemParameters.TAmbHyd, + TTra_nominal={328.15}, + TTraOld_design={328.15}, + AZone={100}, + hZone={2.6}, + ABui=100, + hBui=2.6) annotation (choicesAllMatching=true, Placement(transformation( + extent={{-32,-26},{36,44}}))); Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTZone[transfer.nParallelDem](T = systemParameters.TSetZone_nominal) annotation( Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin = {70, 8}))); IBPSA.Fluid.Sources.Boundary_pT bou1[transfer.nParallelSup](redeclare package Medium = IBPSA.Media.Water, each final p = 200000, each nPorts = 1) annotation( Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0, origin = {-70, -50}))); Interfaces.TransferControlBus traControlBus annotation( Placement(transformation(extent = {{0, 60}, {20, 80}}), iconTransformation(extent = {{0, 60}, {20, 80}}))); - Modelica.Blocks.Sources.Ramp ramp[1](each duration = 100, each startTime = 250) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0, origin = {-90, 70}))); + Modelica.Blocks.Sources.Ramp ramp(each duration=100, each startTime=250) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,70}))); Modelica.Blocks.Sources.RealExpression Q_flow[transfer.nParallelDem](y = fixTZone.port.Q_flow) "Difference between trajectory and nominal heat flow rate" annotation( Placement(transformation(extent = {{60, 80}, {80, 100}}))); IBPSA.Fluid.Sources.MassFlowSource_T boundary[1](redeclare package Medium = IBPSA.Media.Water, m_flow = {0.16941387735728294}, T = {328.15}, each nPorts = 1) annotation( @@ -32,9 +73,9 @@ equation connect(fixTZone.port, transfer.heatPortRad) annotation( Line(points = {{60, 8}, {46, 8}, {46, -5}, {36, -5}}, color = {191, 0, 0})); connect(bou1.ports[1], transfer.portTra_out) annotation( - Line(points = {{-60, -50}, {-46, -50}, {-46, -6}, {-32, -6}, {-32, -6}}, color = {0, 127, 255}, thickness = 0.5)); + Line(points={{-60,-50},{-46,-50},{-46,-6},{-32,-6},{-32,-5.7}}, color = {0, 127, 255}, thickness = 0.5)); connect(boundary.ports[1], transfer.portTra_in) annotation( - Line(points = {{-64, 40}, {-32, 40}, {-32, 24}}, color = {0, 127, 255}, thickness = 0.5)); + Line(points={{-64,40},{-32,40},{-32,23}}, color = {0, 127, 255}, thickness = 0.5)); annotation( Documentation(info = "

This test sets the nominal zone and supply temperature to check if heat and mass flow rates as well as pressure drops are match the design conditions.

diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo index 882389e5..82b96eca 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo @@ -1,10 +1,8 @@ within BESMod.Systems.Hydraulical.Transfer.Tests; model TestPressureBasedSystem - extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest( - redeclare + extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest(redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased - transfer( - redeclare + transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad), pumDis(each ctrlType=AixLib.Fluid.Movers.DpControlledMovers.Types.CtrlType.dpVar)); extends Modelica.Icons.Example; @@ -15,7 +13,7 @@ model TestPressureBasedSystem Documentation(info="

Test for - BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased. + BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased.

")); end TestPressureBasedSystem; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo index ca6bb260..e12cfd87 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo @@ -1,11 +1,8 @@ within BESMod.Systems.Hydraulical.Transfer.Tests; model TestPressureBasedSystemWithReliefValve - extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest( - redeclare + extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest(redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased - transfer( - use_preRelVal=true, - redeclare + transfer(use_preRelVal=true, redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad)); extends Modelica.Icons.Example; @@ -15,7 +12,7 @@ model TestPressureBasedSystemWithReliefValve Documentation(info="

Test for - BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased. + BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased. with pressure relief valve.

")); diff --git a/BESMod/Systems/Hydraulical/Transfer/package.order b/BESMod/Systems/Hydraulical/Transfer/package.order index 613e3821..9b275fa3 100644 --- a/BESMod/Systems/Hydraulical/Transfer/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/package.order @@ -1,9 +1,10 @@ IdealValveRadiator NoHeatTransfer -RadiatorPressureBased +RadiatorPressureBasedOpenModelica UFHTransferSystem Functions RecordsCollection Tests Types BaseClasses +RadiatorPressureBased From 17c0188ada2933124367749a46839ff8068286d8 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 19 Feb 2026 11:35:31 +0100 Subject: [PATCH 04/13] add clean example --- .../Transfer/Tests/TestOpenModelicaClean.mo | 87 +++++++++++++++++++ .../Hydraulical/Transfer/Tests/package.order | 1 + 2 files changed, 88 insertions(+) create mode 100644 BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelicaClean.mo diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelicaClean.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelicaClean.mo new file mode 100644 index 00000000..547d8562 --- /dev/null +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelicaClean.mo @@ -0,0 +1,87 @@ +within BESMod.Systems.Hydraulical.Transfer.Tests; +model TestOpenModelicaClean + extends Modelica.Icons.Example; + extends Systems.BaseClasses.PartialBESExample; + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=0.16941387735728294; + + Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTZone(T=293.15) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=180, + origin={70,8}))); + IBPSA.Fluid.Sources.Boundary_pT bou1( + redeclare package Medium = IBPSA.Media.Water, + each final p=200000, + nPorts=1) annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-70,-50}))); + Modelica.Blocks.Sources.Ramp ramp(each duration=100, each startTime=250) + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-90,70}))); + IBPSA.Fluid.Sources.MassFlowSource_T boundary( + redeclare package Medium = IBPSA.Media.Water, + m_flow=m_flow_nominal, + T=328.15, + nPorts=1) annotation (Placement(transformation(origin={-74,40}, extent={{-10, + -10},{10,10}}))); + IBPSA.Fluid.FixedResistances.HydraulicDiameter res( + redeclare package Medium = IBPSA.Media.Water "Water", + final m_flow_nominal=m_flow_nominal, + final dh=0.02, + final length=100, + final v_nominal=0.5, + disableComputeFlowResistance=true) + "Hydraulic resistance of supply and radiator to set dp allways to m_flow_nominal" + annotation (Placement(transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-18,38}))); + IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( + redeclare package Medium = IBPSA.Media.Water "Water", + final m_flow_nominal=m_flow_nominal, + final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, + final dpValve_nominal=res.dp_nominal, + final use_strokeTime=false, + final dpFixed_nominal=res.dp_nominal, + dp(start=val.dpFixed_nominal + val.dpValve_nominal)) + annotation (Placement(transformation( + extent={{-10,-11},{10,11}}, + rotation=270, + origin={2,7}))); + IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad( + final m_flow_nominal=m_flow_nominal, + final nEle=5, + final Q_flow_nominal=10000, + final T_a_nominal=328.15, + final T_b_nominal=318.15, + final TAir_nominal=293.15, + final TRad_nominal=293.15, + final deltaM=0.3, + final dp_nominal=0, + redeclare package Medium = IBPSA.Media.Water "Water") "Radiator" annotation (Placement(transformation( + extent={{10,10},{-10,-10}}, + rotation=90, + origin={2,-32}))); +equation + connect(res.port_b,val. port_a) annotation (Line(points={{-8,38},{2,38},{2,17}}, + color={0,127,255})); + connect(val.port_b,rad. port_a) annotation (Line(points={{2,-3},{2,-22}}, + color={0,127,255})); + connect(ramp.y, val.y) annotation (Line(points={{-79,70},{18,70},{18,7},{15.2, + 7}}, color={0,0,127})); + connect(fixTZone.port, rad.heatPortRad) annotation (Line(points={{60,8},{44,8}, + {44,-34},{9.2,-34}}, color={191,0,0})); + connect(fixTZone.port, rad.heatPortCon) annotation (Line(points={{60,8},{24,8}, + {24,-22},{38,-22},{38,-2},{22,-2},{22,-30},{9.2,-30}}, color={191,0,0})); + connect(boundary.ports[1], res.port_a) annotation (Line(points={{-64,40},{-32, + 40},{-32,38},{-28,38}}, color={0,127,255})); + connect(bou1.ports[1], rad.port_b) annotation (Line(points={{-60,-50},{-32,-50}, + {-32,-52},{2,-52},{2,-42}}, color={0,127,255})); + annotation( + Documentation(info = " +

This test sets the nominal zone and supply temperature to check if heat and mass flow rates as well as pressure drops are match the design conditions.

+")); +end TestOpenModelicaClean; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order index 52a78ead..476f6354 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order @@ -4,3 +4,4 @@ TestPressureBasedSystem TestPressureBasedSystemWithReliefValve TestUnderfloorHeating TestOpenModelica +TestOpenModelicaClean From 18a22e546d0e33ddcdf0c5b4c4380e95af459598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20R=C3=B6mer?= Date: Thu, 19 Feb 2026 12:55:01 +0100 Subject: [PATCH 05/13] fix OM errors in transfer --- BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo | 4 ++-- BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo | 4 ++-- BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo | 4 ++-- .../TimeConstantEstimation/BaseClasses/CustomRadiator.mo | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo index e32210c6..c8aa1146 100644 --- a/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo +++ b/BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo @@ -89,7 +89,7 @@ model IdealValveRadiator each displayUnit="degC") = Medium.temperature(Medium.setState_phX( portTra_in.p, inStream(portTra_in.h_outflow), - inStream(portTra_in.Xi_outflow)))) "Real expression for supply temperature" + inStream(portTra_in.Xi_outflow)))) if not use_openModelica "Real expression for supply temperature" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -99,7 +99,7 @@ model IdealValveRadiator each displayUnit="degC") = Medium.temperature(Medium.setState_phX( portTra_out.p, actualStream(portTra_out.h_outflow), - inStream(portTra_out.Xi_outflow)))) "Real expression for return temperature" + inStream(portTra_out.Xi_outflow)))) if not use_openModelica "Real expression for return temperature" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 1fe48006..72bc4913 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -138,7 +138,7 @@ model RadiatorPressureBased "Pressure Based transfer system" each displayUnit="degC") = Medium.temperature(Medium.setState_phX( portTra_out.p, actualStream(portTra_out.h_outflow), - inStream(portTra_out.Xi_outflow)))) "Real expression for return temperature" + inStream(portTra_out.Xi_outflow)))) if not use_openModelica "Real expression for return temperature" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -148,7 +148,7 @@ model RadiatorPressureBased "Pressure Based transfer system" each displayUnit="degC") = Medium.temperature(Medium.setState_phX( portTra_in.p, inStream(portTra_in.h_outflow), - inStream(portTra_in.Xi_outflow)))) "Real expression for supply temperature" + inStream(portTra_in.Xi_outflow)))) if not use_openModelica "Real expression for supply temperature" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, diff --git a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo index 6867e57f..ae9f8b25 100644 --- a/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo @@ -98,7 +98,7 @@ model UFHTransferSystem each displayUnit="degC") = Medium.temperature(Medium.setState_phX( portTra_out.p, actualStream(portTra_out.h_outflow), - inStream(portTra_out.Xi_outflow)))) "Real expression for return temperature" + inStream(portTra_out.Xi_outflow)))) if not use_openModelica "Real expression for return temperature" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -108,7 +108,7 @@ model UFHTransferSystem each displayUnit="degC") = Medium.temperature(Medium.setState_phX( portTra_in.p, inStream(portTra_in.h_outflow), - inStream(portTra_in.Xi_outflow)))) "Real expression for supply temperature" + inStream(portTra_in.Xi_outflow)))) if not use_openModelica "Real expression for supply temperature" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, diff --git a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo index b0a19c27..3d86aafe 100644 --- a/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo +++ b/BESMod/Utilities/TimeConstantEstimation/BaseClasses/CustomRadiator.mo @@ -138,7 +138,7 @@ model CustomRadiator "Custom radiator with radiative fractions" each displayUnit="degC") = Medium.temperature(Medium.setState_phX( portTra_out.p, actualStream(portTra_out.h_outflow), - inStream(portTra_out.Xi_outflow)))) "Real expression for return temperature" + inStream(portTra_out.Xi_outflow)))) if not use_openModelica "Real expression for return temperature" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, @@ -148,7 +148,7 @@ model CustomRadiator "Custom radiator with radiative fractions" each displayUnit="degC") = Medium.temperature(Medium.setState_phX( portTra_in.p, inStream(portTra_in.h_outflow), - inStream(portTra_in.Xi_outflow)))) "Real expression for supply temperature" + inStream(portTra_in.Xi_outflow)))) if not use_openModelica "Real expression for supply temperature" annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=0, From 599628a724cbe7a126c075aad035750a79b55324 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Thu, 19 Feb 2026 15:40:55 +0100 Subject: [PATCH 06/13] enable option for non-fixed dpFullOpen parameter --- .../Hydraulical/Transfer/RadiatorPressureBased.mo | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index 72bc4913..bd0d011e 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -106,14 +106,14 @@ model RadiatorPressureBased "Pressure Based transfer system" Distribution.Components.Valves.PressureReliefValve pressureReliefValve( redeclare final package Medium = Medium, m_flow_nominal=mSup_flow_design[1], - final dpFullOpen_nominal=dpSup_design[1], + final dpFullOpen_nominal=dpFullOpen_nominal, final dpThreshold_nominal=perPreRelValOpens*dpSup_design[1], final facDpValve_nominal=valveAutho[1], final l=leakageOpening) if use_preRelVal annotation (Placement( transformation( extent={{10,-10},{-10,10}}, rotation=90, - origin={-90,-10}))); + origin={-90,-8}))); Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe[nParallelDem] annotation (Placement(transformation( extent={{-10,-10},{10,10}}, rotation=270, @@ -153,6 +153,9 @@ model RadiatorPressureBased "Pressure Based transfer system" extent={{-10,-10},{10,10}}, rotation=0, origin={-30,-54}))); + parameter Modelica.Units.SI.PressureDifference dpFullOpen_nominal= + dpSup_design[1] "Pressure difference at which valve is fully open" + annotation (Dialog(tab="Pressure losses", group="Relief Valve")); equation connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-2.8,-32},{40, -32},{40,-40},{100,-40}}, color={191,0,0})); @@ -183,7 +186,7 @@ equation points={{60,-70},{72,-70},{72,-98}}, color={0,0,0}, thickness=1)); - connect(pressureReliefValve.port_b, portTra_out[1]) annotation (Line(points={{-90,-20}, + connect(pressureReliefValve.port_b, portTra_out[1]) annotation (Line(points={{-90,-18}, {-90,-42},{-100,-42}}, color={0,127,255})); connect(reaPasThrOpe.u, traControlBus.opening) annotation (Line(points={{30, 82},{30,94},{0,94},{0,100}}, color={0,0,127}), Text( @@ -200,7 +203,7 @@ equation connect(volRet.ports[1], portTra_out[1]) annotation (Line(points={{-62,-32},{-62, -42},{-100,-42}}, color={0,127,255})); connect(pressureReliefValve.port_a, portTra_in[1]) - annotation (Line(points={{-90,0},{-90,38},{-100,38}}, color={0,127,255})); + annotation (Line(points={{-90,2},{-90,38},{-100,38}}, color={0,127,255})); connect(volSup.ports[1], resMaiLin[1].port_b) annotation (Line(points={{-50,30}, {-54,30},{-54,40},{-60,40}}, color={0,127,255})); From d9f29575af1edda591958ec100f3bac83fcaa739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20R=C3=B6mer?= Date: Thu, 19 Feb 2026 16:05:16 +0100 Subject: [PATCH 07/13] rm om test models again --- .../Tests/BaseClasses/PartialTest.mo | 4 +- .../PartialWithPipingLossesOpenModelica.mo | 81 ------- .../Transfer/BaseClasses/package.order | 1 - .../RadiatorPressureBasedOpenModelica.mo | 225 ------------------ .../Transfer/Tests/TestOpenModelica.mo | 83 ------- .../Transfer/Tests/TestOpenModelicaClean.mo | 87 ------- .../Hydraulical/Transfer/Tests/package.order | 2 - .../Hydraulical/Transfer/package.order | 1 - 8 files changed, 2 insertions(+), 482 deletions(-) delete mode 100644 BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLossesOpenModelica.mo delete mode 100644 BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBasedOpenModelica.mo delete mode 100644 BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelica.mo delete mode 100644 BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelicaClean.mo diff --git a/BESMod/Systems/Hydraulical/Distribution/Tests/BaseClasses/PartialTest.mo b/BESMod/Systems/Hydraulical/Distribution/Tests/BaseClasses/PartialTest.mo index 127e4451..cbb2a2f3 100644 --- a/BESMod/Systems/Hydraulical/Distribution/Tests/BaseClasses/PartialTest.mo +++ b/BESMod/Systems/Hydraulical/Distribution/Tests/BaseClasses/PartialTest.mo @@ -12,9 +12,9 @@ partial model PartialTest Modelica.Media.Interfaces.PartialMedium annotation (choicesAllMatching=true); replaceable - .BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialDistribution distribution + BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialDistribution distribution constrainedby - .BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialDistribution( + BESMod.Systems.Hydraulical.Distribution.BaseClasses.PartialDistribution( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, Q_flow_nominal=fill(sum(systemParameters.QBui_flow_nominal), distribution.nParallelDem), diff --git a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLossesOpenModelica.mo b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLossesOpenModelica.mo deleted file mode 100644 index 8987b088..00000000 --- a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/PartialWithPipingLossesOpenModelica.mo +++ /dev/null @@ -1,81 +0,0 @@ -within BESMod.Systems.Hydraulical.Transfer.BaseClasses; -partial model PartialWithPipingLossesOpenModelica - "Partial model with piping pressure losses" - extends PartialTransfer( - dPip_design={12/1000 for i in 1:nParallelDem}, - dpSup_design={10}, - dpSupOld_design={10}, - dpSup_nominal={10}, - final nParallelSup=1); - - // Pressure - parameter BESMod.Systems.Hydraulical.Transfer.Types.HydraulicResistanceType typeOfHydRes=BESMod.Systems.Hydraulical.Transfer.Types.HydraulicResistanceType. - FittingAndThermostatAndCheckValve - "Type of the hydraulic restistances to be considered for parameter zf" - annotation(Dialog(tab="Pressure losses")); - parameter Real facPip(unit="1")= - BESMod.Systems.Hydraulical.Transfer.Functions.GetSurchargeFactorForHydraulicResistances( - typeOfHydRes) - "Factor for additional pressure resistances in piping network such as bows. Acc. to [Babusch, 2009]" - annotation(Dialog(tab="Pressure losses")); - parameter Modelica.Units.SI.Length lenDisToTra[nParallelSup]=fill(2*hBui, nParallelSup) - "Length of main line between distribution pump and individual transfer units" - annotation(Dialog(tab="Pressure losses")); - parameter Modelica.Units.SI.Length lenDisPerUnit[nParallelDem]=fill(2*sqrt(ABui), nParallelDem) - "Length between main line and each transfer system, default is worst point but leads to hydraulically balanced system (factor 2 for flow and return)" - annotation(Dialog(tab="Pressure losses")); - parameter Modelica.Units.SI.Velocity vSup_design[nParallelSup] = fill(max(v_design), nParallelSup) - "Design velocity of main supply lines" - annotation(Dialog(tab="Pressure losses")); - IBPSA.Fluid.FixedResistances.HydraulicDiameter res( - redeclare package Medium = Medium, - final m_flow_nominal=mOld_flow_design[1], - final show_T=show_T, - final dh=dPip_design[1], - final length=lenDisPerUnit[1], - final ReC=ReC, - final v_nominal=v_design[1], - final roughness=roughness, - final fac=facPip, - disableComputeFlowResistance=true) - if withPressureLossPerZone - "Hydraulic resistance of supply and radiator to set dp allways to m_flow_nominal" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-30,40}))); - IBPSA.Fluid.FixedResistances.HydraulicDiameter resMaiLin[nParallelSup]( - redeclare package Medium = Medium, - final m_flow_nominal=mSupOld_flow_design, - each final show_T=show_T, - final dh=sqrt(4*mSupOld_flow_design ./ rho ./ vSup_design ./ Modelica.Constants.pi), - final length=lenDisToTra, - each final ReC=ReC, - final v_nominal=vSup_design, - each final roughness=roughness, - each final fac=1) "Hydraulic resistance of main line" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-70,40}))); - - parameter Modelica.Units.SI.PressureDifference dpPipSca_design[nParallelDem] - "Pipe pressure losses scaled to design flow rate of radiators"; - parameter Modelica.Units.SI.PressureDifference dpPipSupSca_design[nParallelSup] - "Pipe pressure losses scaled to design flow rate of radiators"; - parameter Modelica.Units.SI.PressureDifference dpPipSupSca_nominal[nParallelSup] - "Pipe pressure losses scaled to design flow rate of radiators"; - parameter Boolean withPressureLossPerZone=true; -initial algorithm - for i in 1:nParallelSup loop - assert(dpSupOld_design[i] / (max(lenDisToTra) + max(lenDisPerUnit)) < 100, "Pressure drop per meter should roughly be below 100 Pa/m, but is " + - String(dpSupOld_design[i] / (max(lenDisToTra) + max(lenDisPerUnit))) + " Pa/m for supply line" + String(i), AssertionLevel.warning); - end for; - -equation - connect(resMaiLin.port_a, portTra_in) annotation (Line(points={{-80,40},{-86,40}, - {-86,38},{-100,38}}, color={0,127,255})); -annotation (Documentation(info=" -

This partial model adds the pressure losses through piping in the building from the distribution pump to the transfer units (e.g. radiators).

As a default assumption, the pipes are always desinged on the old heat load, as pipes in walls are typically never replaced.

It was a design choice to keep the piping which distributes water from the pump in the distrubution in the transfer system (even though it may be interpreted as distribution) as this piping heavily depends on the number of zones and building parameters. Furthermore, an automatic hydraulic balance requires less top-down and bottom-up parameters if all relevent pressure losses are inside the transfer system.

-")); -end PartialWithPipingLossesOpenModelica; diff --git a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/package.order b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/package.order index a558716d..db17f53d 100644 --- a/BESMod/Systems/Hydraulical/Transfer/BaseClasses/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/BaseClasses/package.order @@ -1,3 +1,2 @@ PartialTransfer PartialWithPipingLosses -PartialWithPipingLossesOpenModelica diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBasedOpenModelica.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBasedOpenModelica.mo deleted file mode 100644 index 009de0d7..00000000 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBasedOpenModelica.mo +++ /dev/null @@ -1,225 +0,0 @@ -within BESMod.Systems.Hydraulical.Transfer; -model RadiatorPressureBasedOpenModelica - "Pressure Based transfer system" - // Abui =1 and hBui =1 to avaoid warnings, will be overwritten anyway - extends BaseClasses.PartialWithPipingLossesOpenModelica( - nHeaTra=parRad.n, - ABui=1, - hBui=1, - final dp_design={val.dpFixed_nominal + val.dpValve_nominal}, - Q_flow_design={if use_oldRad_design[i] then QOld_flow_design[i] else Q_flow_nominal[i] for i in 1:nParallelDem}, - TTra_design={if use_oldRad_design[i] then TTraOld_design[i] else TTra_nominal[i] for i in 1:nParallelDem}); - parameter Modelica.Units.SI.PressureDifference dpFixedTotal_nominal[nParallelDem] = dpPipSca_design.*(1 + 0.05); - parameter Boolean use_oldRad_design[nParallelDem]={abs(QOld_flow_design[i]-Q_flow_nominal[i])>1 for i in 1:nParallelDem} - "If true, radiator design of the building with no retrofit (old state) is used" - annotation (Dialog(group="Design - Internal: Parameters are defined by the subsystem")); - - parameter Boolean use_preRelVal=false "=false to disable pressure relief valve" - annotation(Dialog(group="Component choices")); - parameter Real perPreRelValOpens=0.99 - "Percentage of nominal pressure difference at which the pressure relief valve starts to open" - annotation(Dialog(group="Component choices", enable=use_preRelVal)); - -// Valves - parameter Real valveAutho[nParallelDem](each min=0.2, each max=0.8, each unit="1")= - fill(0.5, nParallelDem) - "Assumed valve authority (typical value: 0.5)" - annotation(Dialog(group="Thermostatic Valve")); - parameter Boolean use_hydrBalAutom = true - "Use automatic hydraluic balancing to set dpFixed_nominal in valve" - annotation(Dialog(group="Thermostatic Valve")); - parameter Real leakageOpening = 0.0001 - "may be useful for simulation stability. Always check the influence it has on your results" - annotation(Dialog(group="Thermostatic Valve")); - -// Volume - parameter BESMod.Systems.Hydraulical.Transfer.Types.HeatTransferSystemType traType= - BESMod.Systems.Hydraulical.Transfer.Types.HeatTransferSystemType.SteelRadiator - "Heat transfer system type" - annotation(Dialog(group="Volume")); - parameter Modelica.Units.SI.Volume vol= - BESMod.Systems.Hydraulical.Transfer.Functions.GetAverageVolumeOfWater(sum( - Q_flow_nominal), traType) - "Volume of water in whole heat distribution and transfer system" - annotation (Dialog(group="Volume")); - replaceable parameter BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - parRad - annotation (choicesAllMatching=true, - Placement(transformation(extent={{-96,82},{-82,96}}))); - IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad( - final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=m_flow_design[1], - final show_T=show_T, - final energyDynamics=energyDynamics, - final p_start=p_start, - final nEle=5, - final fraRad=parRad.fraRad, - final Q_flow_nominal=Q_flow_design[1], - final T_a_nominal=TTra_design[1], - final T_b_nominal=TTra_design[1] - dTTra_design[1], - final TAir_nominal=TDem_nominal[1], - final TRad_nominal=TDem_nominal[1], - final n=parRad.n, - final deltaM=0.3, - final dp_nominal=0, - redeclare package Medium = Medium, - final T_start=T_start) "Radiator" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={-10,-30}))); - - IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( - redeclare package Medium = Medium, - final allowFlowReversal=allowFlowReversal, - final m_flow_nominal=m_flow_design[1], - final show_T=show_T, - final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, - final dpValve_nominal=dpFixedTotal_nominal[1], - final use_strokeTime=false, - final dpFixed_nominal=dpFixedTotal_nominal[1], - final l=leakageOpening, - dp(start=val.dpFixed_nominal + val.dpValve_nominal)) - annotation (Placement(transformation( - extent={{-10,-11},{10,11}}, - rotation=270, - origin={-10,9}))); - - IBPSA.Fluid.MixingVolumes.MixingVolume volSup( - redeclare package Medium = Medium, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final mSenFac=1, - final m_flow_nominal=mSup_flow_design[1], - final m_flow_small=1E-4*abs(rad.m_flow_nominal), - final allowFlowReversal=allowFlowReversal, - V(displayUnit="l") = vol/2, - final use_C_flow=false, - nPorts=nParallelDem + 1) "Volume of supply pipes" annotation (Placement( - transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={-50,20}))); - - Utilities.Electrical.ZeroLoad zeroLoad - annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); - Distribution.Components.Valves.PressureReliefValve pressureReliefValve( - redeclare final package Medium = Medium, - m_flow_nominal=mSup_flow_design[1], - final dpFullOpen_nominal=dpSup_design[1], - final dpThreshold_nominal=perPreRelValOpens*dpSup_design[1], - final facDpValve_nominal=valveAutho[1], - final l=leakageOpening) if use_preRelVal annotation (Placement( - transformation( - extent={{10,-10},{-10,10}}, - rotation=90, - origin={-90,-10}))); - Modelica.Blocks.Routing.RealPassThrough reaPasThrOpe annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={30,70}))); - IBPSA.Fluid.MixingVolumes.MixingVolume volRet( - redeclare package Medium = Medium, - final energyDynamics=energyDynamics, - final p_start=p_start, - final T_start=T_start, - final mSenFac=1, - final m_flow_nominal=mSup_flow_design[1], - final m_flow_small=1E-4*abs(rad.m_flow_nominal), - final allowFlowReversal=allowFlowReversal, - V(displayUnit="l") = vol/2, - final use_C_flow=false, - nPorts=nParallelDem + 1) "Volume of return pipes" annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-62,-22}))); - Modelica.Blocks.Sources.RealExpression senTRet[nParallelSup](final y( - each final unit="K", - each displayUnit="degC") = Medium.temperature(Medium.setState_phX( - portTra_out.p, - actualStream(portTra_out.h_outflow), - inStream(portTra_out.Xi_outflow)))) "Real expression for return temperature" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-30,-74}))); - Modelica.Blocks.Sources.RealExpression senTSup[nParallelSup](final y( - each final unit="K", - each displayUnit="degC") = Medium.temperature(Medium.setState_phX( - portTra_in.p, - inStream(portTra_in.h_outflow), - inStream(portTra_in.Xi_outflow)))) "Real expression for supply temperature" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-30,-54}))); -equation - connect(rad.heatPortRad, heatPortRad[1]) annotation (Line(points={{-2.8,-32},{40, - -32},{40,-40},{100,-40}}, color={191,0,0})); - connect(rad.heatPortCon, heatPortCon[1]) annotation (Line(points={{-2.8,-28},{-2.8, - -26},{40,-26},{40,40},{100,40}}, color={191,0,0})); - - connect(rad.port_b, volRet.ports[2]) annotation (Line(points={{-10,-40}, - {-62,-40},{-62,-32}}, - color={0,127,255})); - connect(res.port_a, volSup.ports[2]) annotation (Line(points={{-40,40}, - {-44,40},{-44,30},{-50,30}}, color={0,127,255})); - - connect(val.port_b, rad.port_a) annotation (Line(points={{-10,-1},{-10,-20}}, - color={0,127,255})); - connect(res.port_b, val.port_a) annotation (Line(points={{-20,40},{-10,40},{-10, - 19}}, color={0,127,255})); - - connect(val.y, traControlBus.opening) annotation (Line(points={{3.2,9},{8,9},{ - 8,74},{0,74},{0,100}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(zeroLoad.internalElectricalPin, internalElectricalPin) annotation ( - Line( - points={{60,-70},{72,-70},{72,-98}}, - color={0,0,0}, - thickness=1)); - connect(pressureReliefValve.port_b, portTra_out[1]) annotation (Line(points={{-90,-20}, - {-90,-42},{-100,-42}}, color={0,127,255})); - connect(reaPasThrOpe.u, traControlBus.opening) annotation (Line(points={{30, - 82},{30,94},{0,94},{0,100}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{-6,3},{-6,3}}, - horizontalAlignment=TextAlignment.Right)); - connect(reaPasThrOpe.y, outBusTra.opening) annotation (Line(points={{30,59},{ - 30,-90},{0,-90},{0,-104}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(volRet.ports[1], portTra_out[1]) annotation (Line(points={{-62,-32},{-62, - -42},{-100,-42}}, color={0,127,255})); - connect(pressureReliefValve.port_a, portTra_in[1]) - annotation (Line(points={{-90,0},{-90,38},{-100,38}}, color={0,127,255})); - connect(volSup.ports[1], resMaiLin[1].port_b) annotation (Line(points={{-50,30}, - {-54,30},{-54,40},{-60,40}}, - color={0,127,255})); - connect(senTSup.y, outBusTra.TSup) annotation (Line(points={{-19,-54},{0,-54}, - {0,-104}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - connect(senTRet.y, outBusTra.TRet) annotation (Line(points={{-19,-74},{0,-74}, - {0,-104}}, color={0,0,127}), Text( - string="%second", - index=1, - extent={{6,3},{6,3}}, - horizontalAlignment=TextAlignment.Left)); - annotation (Documentation(info=" -

Known Limitations

-

- When enabling the pressure relief valve, the design pressure losses and mass flow rates are - not met 100 %, see the simulate and plot script of BESMod.Systems.Hydraulical.Transfer.Tests.TestPressureBasedSystemWithReliefValve. -

- -")); -end RadiatorPressureBasedOpenModelica; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelica.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelica.mo deleted file mode 100644 index 966e36ad..00000000 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelica.mo +++ /dev/null @@ -1,83 +0,0 @@ -within BESMod.Systems.Hydraulical.Transfer.Tests; -model TestOpenModelica - extends Modelica.Icons.Example; - extends Systems.BaseClasses.PartialBESExample; - BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBasedOpenModelica - transfer( - redeclare - Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData - parRad, - dTTra_nominal={15}, - dTTra_design={15}, - dTTraOld_design={15}, - m_flow_nominal={0.16941387735728294}, - mOld_flow_design={0.16941387735728294}, - QSup_flow_nominal={10632.4149429430780}, - QSupOld_flow_design={10632.4149429430780}, - mSup_flow_nominal={0.16941387735728294}, - mSup_flow_design={0.16941387735728294}, - mSupOld_flow_design={0.16941387735728294}, - dpSup_nominal(each displayUnit="Pa") = {1000}, - dpSup_design(each displayUnit="Pa") = {1000}, - dpSupOld_design(each displayUnit="Pa") = {1000}, - Q_flow_design={10632.4149429430780}, - m_flow_design={0.16941387735728294}, - use_oldRad_design={true}, - TSup_nominal={328.15}, - TSupOld_design={328.15}, - TTra_design={328.15}, - dpOld_design(each displayUnit="Pa") = {1000}, - dp_nominal={1000}, - dpPipSca_design={1000}, - dpFixedTotal_nominal={1100}, - dpPipSupSca_design={1000}, - dpPipSupSca_nominal={1100}, - nParallelDem=1, - redeclare package Medium = IBPSA.Media.Water, - energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, - Q_flow_nominal=systemParameters.QBui_flow_nominal, - TOda_nominal=systemParameters.TOda_nominal, - TDem_nominal=systemParameters.TSetZone_nominal, - TAmb=systemParameters.TAmbHyd, - TTra_nominal={328.15}, - TTraOld_design={328.15}, - AZone={100}, - hZone={2.6}, - ABui=100, - hBui=2.6) annotation (choicesAllMatching=true, Placement(transformation( - extent={{-32,-26},{36,44}}))); - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTZone[transfer.nParallelDem](T = systemParameters.TSetZone_nominal) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 180, origin = {70, 8}))); - IBPSA.Fluid.Sources.Boundary_pT bou1[transfer.nParallelSup](redeclare package Medium = IBPSA.Media.Water, each final p = 200000, each nPorts = 1) annotation( - Placement(transformation(extent = {{-10, -10}, {10, 10}}, rotation = 0, origin = {-70, -50}))); - Interfaces.TransferControlBus traControlBus annotation( - Placement(transformation(extent = {{0, 60}, {20, 80}}), iconTransformation(extent = {{0, 60}, {20, 80}}))); - Modelica.Blocks.Sources.Ramp ramp(each duration=100, each startTime=250) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-90,70}))); - Modelica.Blocks.Sources.RealExpression Q_flow[transfer.nParallelDem](y = fixTZone.port.Q_flow) "Difference between trajectory and nominal heat flow rate" annotation( - Placement(transformation(extent = {{60, 80}, {80, 100}}))); - IBPSA.Fluid.Sources.MassFlowSource_T boundary[1](redeclare package Medium = IBPSA.Media.Water, m_flow = {0.16941387735728294}, T = {328.15}, each nPorts = 1) annotation( - Placement(transformation(origin = {-74, 40}, extent = {{-10, -10}, {10, 10}}))); -equation - connect(traControlBus, transfer.traControlBus) annotation( - Line(points = {{10, 70}, {10, 50}, {2, 50}, {2, 44}}, color = {255, 204, 51}, thickness = 0.5), - Text(string = "%first", index = -1, extent = {{-3, 6}, {-3, 6}}, horizontalAlignment = TextAlignment.Right)); - connect(ramp.y, traControlBus.opening) annotation( - Line(points = {{-79, 70}, {10, 70}}, color = {0, 0, 127}), - Text(string = "%second", index = 1, extent = {{6, 3}, {6, 3}}, horizontalAlignment = TextAlignment.Left)); - connect(fixTZone.port, transfer.heatPortCon) annotation( - Line(points = {{60, 8}, {46, 8}, {46, 23}, {36, 23}}, color = {191, 0, 0})); - connect(fixTZone.port, transfer.heatPortRad) annotation( - Line(points = {{60, 8}, {46, 8}, {46, -5}, {36, -5}}, color = {191, 0, 0})); - connect(bou1.ports[1], transfer.portTra_out) annotation( - Line(points={{-60,-50},{-46,-50},{-46,-6},{-32,-6},{-32,-5.7}}, color = {0, 127, 255}, thickness = 0.5)); - connect(boundary.ports[1], transfer.portTra_in) annotation( - Line(points={{-64,40},{-32,40},{-32,23}}, color = {0, 127, 255}, thickness = 0.5)); - annotation( - Documentation(info = " -

This test sets the nominal zone and supply temperature to check if heat and mass flow rates as well as pressure drops are match the design conditions.

-")); -end TestOpenModelica; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelicaClean.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelicaClean.mo deleted file mode 100644 index 547d8562..00000000 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestOpenModelicaClean.mo +++ /dev/null @@ -1,87 +0,0 @@ -within BESMod.Systems.Hydraulical.Transfer.Tests; -model TestOpenModelicaClean - extends Modelica.Icons.Example; - extends Systems.BaseClasses.PartialBESExample; - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=0.16941387735728294; - - Modelica.Thermal.HeatTransfer.Sources.FixedTemperature fixTZone(T=293.15) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=180, - origin={70,8}))); - IBPSA.Fluid.Sources.Boundary_pT bou1( - redeclare package Medium = IBPSA.Media.Water, - each final p=200000, - nPorts=1) annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-70,-50}))); - Modelica.Blocks.Sources.Ramp ramp(each duration=100, each startTime=250) - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-90,70}))); - IBPSA.Fluid.Sources.MassFlowSource_T boundary( - redeclare package Medium = IBPSA.Media.Water, - m_flow=m_flow_nominal, - T=328.15, - nPorts=1) annotation (Placement(transformation(origin={-74,40}, extent={{-10, - -10},{10,10}}))); - IBPSA.Fluid.FixedResistances.HydraulicDiameter res( - redeclare package Medium = IBPSA.Media.Water "Water", - final m_flow_nominal=m_flow_nominal, - final dh=0.02, - final length=100, - final v_nominal=0.5, - disableComputeFlowResistance=true) - "Hydraulic resistance of supply and radiator to set dp allways to m_flow_nominal" - annotation (Placement(transformation( - extent={{-10,-10},{10,10}}, - rotation=0, - origin={-18,38}))); - IBPSA.Fluid.Actuators.Valves.TwoWayLinear val( - redeclare package Medium = IBPSA.Media.Water "Water", - final m_flow_nominal=m_flow_nominal, - final CvData=IBPSA.Fluid.Types.CvTypes.OpPoint, - final dpValve_nominal=res.dp_nominal, - final use_strokeTime=false, - final dpFixed_nominal=res.dp_nominal, - dp(start=val.dpFixed_nominal + val.dpValve_nominal)) - annotation (Placement(transformation( - extent={{-10,-11},{10,11}}, - rotation=270, - origin={2,7}))); - IBPSA.Fluid.HeatExchangers.Radiators.RadiatorEN442_2 rad( - final m_flow_nominal=m_flow_nominal, - final nEle=5, - final Q_flow_nominal=10000, - final T_a_nominal=328.15, - final T_b_nominal=318.15, - final TAir_nominal=293.15, - final TRad_nominal=293.15, - final deltaM=0.3, - final dp_nominal=0, - redeclare package Medium = IBPSA.Media.Water "Water") "Radiator" annotation (Placement(transformation( - extent={{10,10},{-10,-10}}, - rotation=90, - origin={2,-32}))); -equation - connect(res.port_b,val. port_a) annotation (Line(points={{-8,38},{2,38},{2,17}}, - color={0,127,255})); - connect(val.port_b,rad. port_a) annotation (Line(points={{2,-3},{2,-22}}, - color={0,127,255})); - connect(ramp.y, val.y) annotation (Line(points={{-79,70},{18,70},{18,7},{15.2, - 7}}, color={0,0,127})); - connect(fixTZone.port, rad.heatPortRad) annotation (Line(points={{60,8},{44,8}, - {44,-34},{9.2,-34}}, color={191,0,0})); - connect(fixTZone.port, rad.heatPortCon) annotation (Line(points={{60,8},{24,8}, - {24,-22},{38,-22},{38,-2},{22,-2},{22,-30},{9.2,-30}}, color={191,0,0})); - connect(boundary.ports[1], res.port_a) annotation (Line(points={{-64,40},{-32, - 40},{-32,38},{-28,38}}, color={0,127,255})); - connect(bou1.ports[1], rad.port_b) annotation (Line(points={{-60,-50},{-32,-50}, - {-32,-52},{2,-52},{2,-42}}, color={0,127,255})); - annotation( - Documentation(info = " -

This test sets the nominal zone and supply temperature to check if heat and mass flow rates as well as pressure drops are match the design conditions.

-")); -end TestOpenModelicaClean; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order index 476f6354..820d4c30 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/package.order @@ -3,5 +3,3 @@ TestIdealValveRadiatorSystem TestPressureBasedSystem TestPressureBasedSystemWithReliefValve TestUnderfloorHeating -TestOpenModelica -TestOpenModelicaClean diff --git a/BESMod/Systems/Hydraulical/Transfer/package.order b/BESMod/Systems/Hydraulical/Transfer/package.order index 9b275fa3..2dae68e3 100644 --- a/BESMod/Systems/Hydraulical/Transfer/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/package.order @@ -1,6 +1,5 @@ IdealValveRadiator NoHeatTransfer -RadiatorPressureBasedOpenModelica UFHTransferSystem Functions RecordsCollection From 2f9c55dc68b95d4abacddbec2ab3e195e2b34429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20R=C3=B6mer?= Date: Wed, 4 Mar 2026 07:07:37 +0100 Subject: [PATCH 08/13] minor om fixes --- .../Demand/Building/Components/AixLibHighOrderOFD.mo | 9 ++++----- .../Demand/DHW/BaseClasses/PartialDHWWithBasics.mo | 2 +- .../Hydraulical/Transfer/RadiatorPressureBased.mo | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo index 4544eec5..b13b9fec 100644 --- a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo +++ b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo @@ -5,7 +5,7 @@ model AixLibHighOrderOFD "High order OFD" parameter Integer nZonesNonHeated = 1 "Non heated rooms of the building"; - // Rooms: +// Rooms: //Groundfloor - 1:LivingRoom_GF, 2:Hobby_GF, 3: Corridor_GF, 4: WC_Storage_GF, 5: Kitchen_GF, //Upperfloor - 6: Bedroom_UF, 7: Child1_UF, 8: Corridor_UF, 9: Bath_UF, 10: Child2_UF, 11: Attic final parameter Modelica.Units.SI.Area ABui = sum(AZone) "Total area of all zones"; @@ -125,8 +125,8 @@ model AixLibHighOrderOFD "High order OFD" Placement(transformation(extent={{-108,90},{-88,110}}), iconTransformation(extent={{-108,90},{-88,110}}))); equation - // Romm Temperatures - /* +// Romm Temperatures +/* TZoneMea[1]= wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.airload.heatPort.T; TZoneMea[2]=wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.airload.heatPort.T; TZoneMea[3]=wholeHouseBuildingEnvelope.groundFloor_Building.Corridor.airload.heatPort.T; @@ -138,7 +138,6 @@ equation TZoneMea[9]=wholeHouseBuildingEnvelope.upperFloor_Building.Bath.airload.heatPort.T; TZoneMea[10]=wholeHouseBuildingEnvelope.upperFloor_Building.Children2.airload.heatPort.T; */ - connect(wholeHouseBuildingEnvelope.groPlateUp, wholeHouseBuildingEnvelope.groFloDown) annotation (Line(points={{-44,-28.8},{-54,-28.8},{-54,-15.36},{-44,-15.36}}, color={191,0,0})); @@ -181,7 +180,7 @@ equation end for; connect(convRadToCombPort.portConvRadComb, wholeHouseBuildingEnvelope.heatingToRooms[11]) annotation (Line(points={{-46,-56}, - {-72,-56},{-72,2.86545},{-44,2.86545}}, + {-76,-56},{-76,-3.13455}, {-58, -3.13455}, {-58, 2.86545},{-44,2.86545}}, color={191,0,0})); connect(intGaiAttRad.port, convRadToCombPort.portRad) annotation (Line(points= {{10,-78},{-20,-78},{-20,-61},{-26,-61}}, color={191,0,0})); diff --git a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo index e3f36d27..0cd528f3 100644 --- a/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo +++ b/BESMod/Systems/Demand/DHW/BaseClasses/PartialDHWWithBasics.mo @@ -29,7 +29,7 @@ Modelica.Blocks.Math.UnitConversions.From_degC fromDegC final m_flow_small=1E-4*abs(mDHW_flow_nominal), final show_T=show_T, final m_flow_nominal=mDHW_flow_nominal, - final dp_nominal(displayUnit="Pa") = if dpDHW_nominal <> 0 then + final dp_nominal(displayUnit="Pa") = if dpDHW_nominal > Modelica.Constants.eps then dpDHW_nominal else 100, final addPowerToMedium=false, final use_riseTime=false) annotation (Placement(transformation( diff --git a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo index bd0d011e..99a0ac35 100644 --- a/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo +++ b/BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo @@ -9,7 +9,7 @@ model RadiatorPressureBased "Pressure Based transfer system" Q_flow_design={if use_oldRad_design[i] then QOld_flow_design[i] else Q_flow_nominal[i] for i in 1:nParallelDem}, TTra_design={if use_oldRad_design[i] then TTraOld_design[i] else TTra_nominal[i] for i in 1:nParallelDem}); final parameter Modelica.Units.SI.PressureDifference dpFixedTotal_nominal[nParallelDem] = dpPipSca_design.*(1 + parRad.perPreLosRad); - parameter Boolean use_oldRad_design[nParallelDem]={not QOld_flow_design[i]==Q_flow_nominal[i] for i in 1:nParallelDem} + parameter Boolean use_oldRad_design[nParallelDem]={abs(QOld_flow_design[i]-Q_flow_nominal[i])>1 for i in 1:nParallelDem} "If true, radiator design of the building with no retrofit (old state) is used" annotation (Dialog(group="Design - Internal: Parameters are defined by the subsystem")); From 507bd32e6a57dbb4983b8fa193fc5488cd3c8403 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 31 Mar 2026 08:12:30 +0200 Subject: [PATCH 09/13] reverts --- BESMod/BESRules/BaseClasses/PartialBESRulesSystem.mo | 2 +- BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo | 2 +- BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo | 2 +- BESMod/Systems/Control/BaseClasses/PartialControl.mo | 2 +- BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo | 2 +- .../Systems/Electrical/BaseClasses/PartialElectricalSystem.mo | 2 +- BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo | 2 +- .../Electrical/Distribution/BaseClasses/PartialDistribution.mo | 2 +- .../Electrical/Generation/BaseClasses/PartialGeneration.mo | 2 +- .../Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo | 2 +- .../Systems/Hydraulical/Control/BaseClasses/PartialControl.mo | 2 +- .../Systems/Ventilation/Control/BaseClasses/PartialControl.mo | 2 +- BESMod/package.mo | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/BESMod/BESRules/BaseClasses/PartialBESRulesSystem.mo b/BESMod/BESRules/BaseClasses/PartialBESRulesSystem.mo index 74d1b56c..3436ade0 100644 --- a/BESMod/BESRules/BaseClasses/PartialBESRulesSystem.mo +++ b/BESMod/BESRules/BaseClasses/PartialBESRulesSystem.mo @@ -5,7 +5,7 @@ partial model PartialBESRulesSystem redeclare replaceable BESMod.BESRules.DesignOptimization.DesignOptimizationVariables parameterStudy, redeclare replaceable BESMod.Systems.UserProfiles.TEASERInputsStoIntGai userProfiles, - final use_openModelica=true, + final use_openModelica=false, redeclare BESMod.BESRules.BaseClasses.SystemParameters systemParameters( QBui_flow_nominal=building.QRec_flow_nominal, THydSup_nominal=fill( THyd_nominal, systemParameters.nZones)), diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index edbdff59..ec3a7166 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -1,7 +1,7 @@ within BESMod.Systems.BaseClasses; partial model PartialBuildingEnergySystem "Partial BES" - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); diff --git a/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo b/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo index 959f3ad7..1747ce10 100644 --- a/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo +++ b/BESMod/Systems/BaseClasses/PartialFluidSubsystem.mo @@ -2,7 +2,7 @@ within BESMod.Systems.BaseClasses; model PartialFluidSubsystem "Model for a partial subsystem based on the IBPSA fluid core" extends IBPSA.Fluid.Interfaces.LumpedVolumeDeclarations; - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); diff --git a/BESMod/Systems/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Control/BaseClasses/PartialControl.mo index f2e92ce9..22dd5687 100644 --- a/BESMod/Systems/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Control/BaseClasses/PartialControl.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Control.BaseClasses; partial model PartialControl "Model for a partial HEMS control" extends BESMod.Utilities.Icons.ControlIcon; - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); BESMod.Systems.Hydraulical.Interfaces.SystemControlBus sigBusHyd annotation (Placement( diff --git a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo index 4da17e99..337370fd 100644 --- a/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo +++ b/BESMod/Systems/Demand/Building/BaseClasses/PartialDemand.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Demand.Building.BaseClasses; partial model PartialDemand "Partial demand model for HPS" extends BESMod.Utilities.Icons.BuildingIcon; - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nZones(min=1) "Number of zones /rooms"; diff --git a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo index 3b121263..00d02321 100644 --- a/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo +++ b/BESMod/Systems/Electrical/BaseClasses/PartialElectricalSystem.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.BaseClasses; partial model PartialElectricalSystem "Partial model for electrical system" - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nLoadsExtSubSys(min=1) = 4 "Number of external subsystems which result in electrical load / generation"; diff --git a/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo index 55f608d6..c1f37918 100644 --- a/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Electrical/Control/BaseClasses/PartialControl.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Control.BaseClasses; partial model PartialControl "Partial electrical control model" - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nParallelDem(min=1) diff --git a/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo b/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo index d458d637..2dd35aef 100644 --- a/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo +++ b/BESMod/Systems/Electrical/Distribution/BaseClasses/PartialDistribution.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Distribution.BaseClasses; partial model PartialDistribution - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nSubSys(min=2) diff --git a/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo b/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo index b7cbe9c6..b47d4f25 100644 --- a/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo +++ b/BESMod/Systems/Electrical/Generation/BaseClasses/PartialGeneration.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Electrical.Generation.BaseClasses; partial model PartialGeneration "Basic model with interfaces for electrical generation package" - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer numGenUnits(min=1) "Number of generation (e.g. PV module) units" diff --git a/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo b/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo index e97fa7a3..cfdf460b 100644 --- a/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo +++ b/BESMod/Systems/Electrical/Transfer/BaseClasses/PartialTransfer.mo @@ -1,6 +1,6 @@ within BESMod.Systems.Electrical.Transfer.BaseClasses; partial model PartialTransfer "Partial model for transfer subsystems" - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); parameter Integer nParallelDem(min=1) diff --git a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo index b0f0c4d6..b0c53ad5 100644 --- a/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Hydraulical/Control/BaseClasses/PartialControl.mo @@ -2,7 +2,7 @@ within BESMod.Systems.Hydraulical.Control.BaseClasses; partial model PartialControl "Partial controller for HPS" extends BESMod.Utilities.Icons.ControlIcon; parameter Boolean use_dhw "=false to disable DHW"; - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); diff --git a/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo b/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo index 506d6e73..2f7bff5b 100644 --- a/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo +++ b/BESMod/Systems/Ventilation/Control/BaseClasses/PartialControl.mo @@ -1,7 +1,7 @@ within BESMod.Systems.Ventilation.Control.BaseClasses; partial model PartialControl extends BESMod.Utilities.Icons.ControlIcon; - parameter Boolean use_openModelica=true + parameter Boolean use_openModelica=false "=true to disable features which are not available in open modelica" annotation(Dialog(tab="Advanced")); replaceable parameter diff --git a/BESMod/package.mo b/BESMod/package.mo index 063ca0e1..9503d63d 100644 --- a/BESMod/package.mo +++ b/BESMod/package.mo @@ -6,7 +6,7 @@ package BESMod version="0.7.0", uses( Modelica(version="4.0.0"), - SDF(version="0.4.3"), + SDF(version="0.4.2"), IBPSA(version="4.0.0"), AixLib(version="3.0.0"), ModelicaServices(version="4.0.0")), From 9028cae89620d7240a0132dfc1813d791c94ae1e Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 31 Mar 2026 09:40:20 +0200 Subject: [PATCH 10/13] revert and fix conditional heaRod usage --- BESMod/Examples/BAUSimStudy/Case1Standard.mo | 6 ++- .../Building/Components/AixLibHighOrderOFD.mo | 11 +++--- .../BaseClasses/PartialTwoStorageParallel.mo | 38 +++++++++++++++---- .../Functions/GetAverageVolumeOfWater.mo | 2 +- .../Tests/TestIdealValveRadiatorSystem.mo | 9 ++++- .../Transfer/Tests/TestPressureBasedSystem.mo | 10 +++-- .../TestPressureBasedSystemWithReliefValve.mo | 11 ++++-- .../Hydraulical/Transfer/package.order | 3 +- 8 files changed, 63 insertions(+), 27 deletions(-) diff --git a/BESMod/Examples/BAUSimStudy/Case1Standard.mo b/BESMod/Examples/BAUSimStudy/Case1Standard.mo index c36a2ad9..ed8875c2 100644 --- a/BESMod/Examples/BAUSimStudy/Case1Standard.mo +++ b/BESMod/Examples/BAUSimStudy/Case1Standard.mo @@ -1,6 +1,8 @@ within BESMod.Examples.BAUSimStudy; model Case1Standard - extends PartialCase(building(redeclare BESMod.Systems.Demand.Building.RecordsCollection.ACoolHeadAndBEStPar.NoRetrofit1918_SingleDwelling oneZoneParam, use_verboseEnergyBalance = false), + extends PartialCase(building(redeclare + BESMod.Systems.Demand.Building.RecordsCollection.ACoolHeadAndBEStPar.NoRetrofit1918_SingleDwelling + oneZoneParam), systemParameters(TOda_nominal=263.15, THydSup_nominal={328.15})); extends Modelica.Icons.Example; @@ -11,4 +13,4 @@ model Case1Standard __Dymola_Algorithm="Dassl"), __Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/BAUSimStudy/Case1Standard.mos" "Simulate and plot")); -end Case1Standard; +end Case1Standard; \ No newline at end of file diff --git a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo index b13b9fec..07eb8db9 100644 --- a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo +++ b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo @@ -5,7 +5,7 @@ model AixLibHighOrderOFD "High order OFD" parameter Integer nZonesNonHeated = 1 "Non heated rooms of the building"; -// Rooms: + // Rooms: //Groundfloor - 1:LivingRoom_GF, 2:Hobby_GF, 3: Corridor_GF, 4: WC_Storage_GF, 5: Kitchen_GF, //Upperfloor - 6: Bedroom_UF, 7: Child1_UF, 8: Corridor_UF, 9: Bath_UF, 10: Child2_UF, 11: Attic final parameter Modelica.Units.SI.Area ABui = sum(AZone) "Total area of all zones"; @@ -125,8 +125,8 @@ model AixLibHighOrderOFD "High order OFD" Placement(transformation(extent={{-108,90},{-88,110}}), iconTransformation(extent={{-108,90},{-88,110}}))); equation -// Romm Temperatures -/* + // Romm Temperatures + /* TZoneMea[1]= wholeHouseBuildingEnvelope.groundFloor_Building.Livingroom.airload.heatPort.T; TZoneMea[2]=wholeHouseBuildingEnvelope.groundFloor_Building.Hobby.airload.heatPort.T; TZoneMea[3]=wholeHouseBuildingEnvelope.groundFloor_Building.Corridor.airload.heatPort.T; @@ -138,6 +138,7 @@ equation TZoneMea[9]=wholeHouseBuildingEnvelope.upperFloor_Building.Bath.airload.heatPort.T; TZoneMea[10]=wholeHouseBuildingEnvelope.upperFloor_Building.Children2.airload.heatPort.T; */ + connect(wholeHouseBuildingEnvelope.groPlateUp, wholeHouseBuildingEnvelope.groFloDown) annotation (Line(points={{-44,-28.8},{-54,-28.8},{-54,-15.36},{-44,-15.36}}, color={191,0,0})); @@ -180,7 +181,7 @@ equation end for; connect(convRadToCombPort.portConvRadComb, wholeHouseBuildingEnvelope.heatingToRooms[11]) annotation (Line(points={{-46,-56}, - {-76,-56},{-76,-3.13455}, {-58, -3.13455}, {-58, 2.86545},{-44,2.86545}}, + {-72,-56},{-72,2.86545},{-44,2.86545}}, color={191,0,0})); connect(intGaiAttRad.port, convRadToCombPort.portRad) annotation (Line(points= {{10,-78},{-20,-78},{-20,-61},{-26,-61}}, color={191,0,0})); @@ -194,4 +195,4 @@ equation Line(points={{-98,100},{-73,100},{-73,72},{-44.94,72}}, color={191,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); -end AixLibHighOrderOFD; +end AixLibHighOrderOFD; \ No newline at end of file diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo index e641515c..7d6978f9 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo @@ -228,6 +228,16 @@ partial model PartialTwoStorageParallel rotation=180, origin={76,80}))); + BESMod.Utilities.KPIs.EnergyKPICalculator eneKPICalDHWHeaRod(use_inpCon=false, + y=heaRodDHW.PEleHea) if parStoDHW.use_hr annotation (Placement( + transformation( + extent={{-10,-10},{10,10}}, + rotation=0, + origin={-50,-170}))); + BESMod.Utilities.KPIs.EnergyKPICalculator eneKPICalBufHeaRod(use_inpCon=false, y= + heaRodBuf.PEleHea) if parStoBuf.use_hr + annotation (Placement(transformation(extent={{-100,-180},{-80,-160}}))); + Modelica.Blocks.Math.MultiSum multiSum(nu=4) annotation (Placement( transformation( extent={{-9,-9},{9,9}}, @@ -241,8 +251,8 @@ partial model PartialTwoStorageParallel BESMod.Systems.Hydraulical.Distribution.Components.ConditionalPrescibedHeater heaRodBuf(Q_flow_nominal=parStoBuf.QHR_flow_nominal, useHeater=parStoBuf.use_hr) "Heating rod in buffer storage" annotation (Placement(transformation(extent={{-90,10},{-70,30}}))); - BESMod.Systems.Hydraulical.Distribution.Components.ConditionalPrescibedHeater heaRodparStoDHW(Q_flow_nominal= - parStoDHW.QHR_flow_nominal, useHeater=parStoDHW.use_hr) + BESMod.Systems.Hydraulical.Distribution.Components.ConditionalPrescibedHeater + heaRodDHW(Q_flow_nominal=parStoDHW.QHR_flow_nominal, useHeater=parStoDHW.use_hr) "Heating rod in DHW storage" annotation (Placement(transformation(extent={{-90,-60},{-70,-40}}))); BESMod.Systems.Hydraulical.Components.PreconfiguredControlledMovers.PreconfiguredDPControlled @@ -335,6 +345,18 @@ equation index=1, extent={{-3,6},{-3,6}}, horizontalAlignment=TextAlignment.Right)); + connect(eneKPICalBufHeaRod.KPI, outBusDist.PEleHRPreBuf) annotation (Line( + points={{-77.8,-170},{0,-170},{0,-100}}, color={135,135,135}), Text( + string="%second", + index=1, + extent={{-3,6},{-3,6}}, + horizontalAlignment=TextAlignment.Right)); + connect(eneKPICalDHWHeaRod.KPI, outBusDist.PEleHRPreDHW) annotation (Line( + points={{-37.8,-170},{0,-170},{0,-100}},color={135,135,135}), Text( + string="%second", + index=1, + extent={{6,3},{6,3}}, + horizontalAlignment=TextAlignment.Left)); connect(multiSum.y, realToElecCon.PEleLoa) annotation (Line(points={{-38.47,-111},{-38.47,-110},{-40,-110},{-40,-106}, {18,-106}}, color={0,0,127})); @@ -375,19 +397,19 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(heaRodparStoDHW.uHea, sigBusDistr.uHRStoDHW) annotation (Line(points={ - {-91.8,-50},{-126,-50},{-126,102},{2,102},{2,101},{0,101}}, color={0,0, - 127}), Text( + connect(heaRodDHW.uHea, sigBusDistr.uHRStoDHW) annotation (Line(points={{-91.8, + -50},{-126,-50},{-126,102},{2,102},{2,101},{0,101}}, color={0,0,127}), + Text( string="%second", index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); - connect(heaRodparStoDHW.port, stoDHW.heatingRod) + connect(heaRodDHW.port, stoDHW.heatingRod) annotation (Line(points={{-70,-50},{-50,-50}}, color={191,0,0})); connect(heaRodBuf.port, stoBuf.heatingRod) annotation (Line(points={{-70,20},{-50,20}}, color={191,0,0})); - connect(heaRodparStoDHW.PEleHea, multiSum.u[1]) annotation (Line(points={{-69,-57}, - {-66,-57},{-66,-113.363},{-58,-113.363}}, color={0,0,127})); + connect(heaRodDHW.PEleHea, multiSum.u[1]) annotation (Line(points={{-69,-57}, + {-66,-57},{-66,-113.363},{-58,-113.363}}, color={0,0,127})); connect(heaRodBuf.PEleHea, multiSum.u[2]) annotation (Line(points={{-69,13},{ -64,13},{-64,-108},{-58,-108},{-58,-111.787}}, color={0,0,127})); diff --git a/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo b/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo index f7eab54e..bd686b6f 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo @@ -39,4 +39,4 @@ algorithm Link to pdf

")); -end GetAverageVolumeOfWater; +end GetAverageVolumeOfWater; \ No newline at end of file diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo index f33fbedb..7f69359a 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo @@ -1,7 +1,12 @@ within BESMod.Systems.Hydraulical.Transfer.Tests; model TestIdealValveRadiatorSystem extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest( - redeclare BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator transfer(redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad, use_oldRad_design = {false}, TTra_design = {333.15}, Q_flow_design = transfer.Q_flow_nominal, redeclare BESMod.Systems.RecordsCollection.Movers.DPVar parPum), pumDis(each externalCtrlTyp = BESMod.Systems.Hydraulical.Components.PreconfiguredControlledMovers.Types.ExternalControlType.speed, each y = 1)); + redeclare + BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator + transfer(redeclare + BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData + parRad, + redeclare BESMod.Systems.RecordsCollection.Movers.DPVar parPum)); extends Modelica.Icons.Example; annotation (experiment(StopTime=12000, Tolerance=1e-06, Interval=100), @@ -13,4 +18,4 @@ model TestIdealValveRadiatorSystem BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator.

")); -end TestIdealValveRadiatorSystem; +end TestIdealValveRadiatorSystem; \ No newline at end of file diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo index 82b96eca..5f5bc06d 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo @@ -1,8 +1,10 @@ within BESMod.Systems.Hydraulical.Transfer.Tests; model TestPressureBasedSystem - extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest(redeclare + extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest( + redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased - transfer(redeclare + transfer( + redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad), pumDis(each ctrlType=AixLib.Fluid.Movers.DpControlledMovers.Types.CtrlType.dpVar)); extends Modelica.Icons.Example; @@ -13,7 +15,7 @@ model TestPressureBasedSystem Documentation(info="

Test for - BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased. + BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased.

")); -end TestPressureBasedSystem; +end TestPressureBasedSystem; \ No newline at end of file diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo index e12cfd87..f5ba5b53 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo @@ -1,8 +1,11 @@ within BESMod.Systems.Hydraulical.Transfer.Tests; model TestPressureBasedSystemWithReliefValve - extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest(redeclare + extends BESMod.Systems.Hydraulical.Transfer.Tests.PartialTest( + redeclare BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased - transfer(use_preRelVal=true, redeclare + transfer( + use_preRelVal=true, + redeclare BESMod.Systems.Hydraulical.Transfer.RecordsCollection.RadiatorTransferData parRad)); extends Modelica.Icons.Example; @@ -12,8 +15,8 @@ model TestPressureBasedSystemWithReliefValve Documentation(info="

Test for - BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased. + BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased. with pressure relief valve.

")); -end TestPressureBasedSystemWithReliefValve; +end TestPressureBasedSystemWithReliefValve; \ No newline at end of file diff --git a/BESMod/Systems/Hydraulical/Transfer/package.order b/BESMod/Systems/Hydraulical/Transfer/package.order index 2dae68e3..5fa14257 100644 --- a/BESMod/Systems/Hydraulical/Transfer/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/package.order @@ -1,9 +1,10 @@ IdealValveRadiator NoHeatTransfer +RadiatorPressureBased UFHTransferSystem Functions RecordsCollection Tests Types BaseClasses -RadiatorPressureBased + From 08063ac9ae024444b8479224322b1b73aead6842 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 31 Mar 2026 09:43:25 +0200 Subject: [PATCH 11/13] further revert --- BESMod/Examples/BAUSimStudy/Case1Standard.mo | 2 +- BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo | 2 +- .../Distribution/BaseClasses/PartialTwoStorageParallel.mo | 2 +- .../Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo | 2 +- .../Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo | 2 +- .../Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo | 2 +- .../Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo | 2 +- BESMod/Systems/Hydraulical/Transfer/package.order | 1 - 8 files changed, 7 insertions(+), 8 deletions(-) diff --git a/BESMod/Examples/BAUSimStudy/Case1Standard.mo b/BESMod/Examples/BAUSimStudy/Case1Standard.mo index ed8875c2..ab51e384 100644 --- a/BESMod/Examples/BAUSimStudy/Case1Standard.mo +++ b/BESMod/Examples/BAUSimStudy/Case1Standard.mo @@ -13,4 +13,4 @@ model Case1Standard __Dymola_Algorithm="Dassl"), __Dymola_Commands(file="modelica://BESMod/Resources/Scripts/Dymola/Examples/BAUSimStudy/Case1Standard.mos" "Simulate and plot")); -end Case1Standard; \ No newline at end of file +end Case1Standard; diff --git a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo index 07eb8db9..4544eec5 100644 --- a/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo +++ b/BESMod/Systems/Demand/Building/Components/AixLibHighOrderOFD.mo @@ -195,4 +195,4 @@ equation Line(points={{-98,100},{-73,100},{-73,72},{-44.94,72}}, color={191,0,0})); annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false))); -end AixLibHighOrderOFD; \ No newline at end of file +end AixLibHighOrderOFD; diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo index 7d6978f9..58696e5a 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo @@ -443,4 +443,4 @@ equation connect(souNoDHW.ports[1], stoDHW.fluidportBottom2) annotation (Line(points={{ -10,-70},{-12,-70.2},{-29.4,-70.2}}, color={0,127,255})); annotation (Diagram(coordinateSystem(extent={{-100,-180},{100,180}}))); -end PartialTwoStorageParallel; +end PartialTwoStorageParallel; \ No newline at end of file diff --git a/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo b/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo index bd686b6f..f7eab54e 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Functions/GetAverageVolumeOfWater.mo @@ -39,4 +39,4 @@ algorithm Link to pdf

")); -end GetAverageVolumeOfWater; \ No newline at end of file +end GetAverageVolumeOfWater; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo index 7f69359a..ccebe1b0 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestIdealValveRadiatorSystem.mo @@ -18,4 +18,4 @@ model TestIdealValveRadiatorSystem BESMod.Systems.Hydraulical.Transfer.IdealValveRadiator.

")); -end TestIdealValveRadiatorSystem; \ No newline at end of file +end TestIdealValveRadiatorSystem; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo index 5f5bc06d..882389e5 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystem.mo @@ -18,4 +18,4 @@ model TestPressureBasedSystem BESMod.Systems.Hydraulical.Transfer.RadiatorPressureBased.

")); -end TestPressureBasedSystem; \ No newline at end of file +end TestPressureBasedSystem; diff --git a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo index f5ba5b53..ca6bb260 100644 --- a/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo +++ b/BESMod/Systems/Hydraulical/Transfer/Tests/TestPressureBasedSystemWithReliefValve.mo @@ -19,4 +19,4 @@ model TestPressureBasedSystemWithReliefValve with pressure relief valve.

")); -end TestPressureBasedSystemWithReliefValve; \ No newline at end of file +end TestPressureBasedSystemWithReliefValve; diff --git a/BESMod/Systems/Hydraulical/Transfer/package.order b/BESMod/Systems/Hydraulical/Transfer/package.order index 5fa14257..613e3821 100644 --- a/BESMod/Systems/Hydraulical/Transfer/package.order +++ b/BESMod/Systems/Hydraulical/Transfer/package.order @@ -7,4 +7,3 @@ RecordsCollection Tests Types BaseClasses - From 041cdf4f9b0236f452e43db81aa0282c7f123ae1 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 31 Mar 2026 09:45:31 +0200 Subject: [PATCH 12/13] end of line --- .../Distribution/BaseClasses/PartialTwoStorageParallel.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo index 58696e5a..7d6978f9 100644 --- a/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo +++ b/BESMod/Systems/Hydraulical/Distribution/BaseClasses/PartialTwoStorageParallel.mo @@ -443,4 +443,4 @@ equation connect(souNoDHW.ports[1], stoDHW.fluidportBottom2) annotation (Line(points={{ -10,-70},{-12,-70.2},{-29.4,-70.2}}, color={0,127,255})); annotation (Diagram(coordinateSystem(extent={{-100,-180},{100,180}}))); -end PartialTwoStorageParallel; \ No newline at end of file +end PartialTwoStorageParallel; From fe01f323bda73f22bed121fb2d65d5dd22844208 Mon Sep 17 00:00:00 2001 From: "fabian.wuellhorst" Date: Tue, 31 Mar 2026 13:39:14 +0200 Subject: [PATCH 13/13] also disable outputs in DHW --- BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo index ec3a7166..50300677 100644 --- a/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo +++ b/BESMod/Systems/BaseClasses/PartialBuildingEnergySystem.mo @@ -55,7 +55,8 @@ partial model PartialBuildingEnergySystem "Partial BES" choicesAllMatching=true, Placement(transformation(extent={{-280,124},{ -224,178}}))); replaceable BESMod.Systems.Demand.DHW.BaseClasses.PartialDHW - DHW if systemParameters.use_hydraulic constrainedby + DHW(final use_openModelica=use_openModelica) + if systemParameters.use_hydraulic constrainedby Demand.DHW.BaseClasses.PartialDHW( redeclare final package Medium = MediumDHW, final TDHW_nominal=systemParameters.TSetDHW,