From 0c0bba36ec47d2f9d95eb235a5eba1750bae8d8b Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Tue, 24 May 2022 20:41:19 +0200 Subject: [PATCH] openmodelica compatibility fixes for #1254 --- .../SolarIrradiation/RadSolData.mo | 11 +++++++-- IDEAS/Buildings/Components/Window.mo | 24 +++++++++---------- .../Buildings/Examples/OpenDoorComparison.mo | 9 +++++++ .../RunningMeanTemperatureEN15251.mo | 7 +++++- IDEAS/Examples/Benchmark/ScalingComponents.mo | 9 +++++++ .../TwinHouses/Interfaces/PartialTwinHouse.mo | 17 +++++++------ .../AC/Examples/TestGridGeneral1PEq.mo | 13 +++++++--- .../AC/Examples/TestGridGeneral3P.mo | 14 +++++++---- .../Distribution/Examples/TestGridGeneral.mo | 14 +++++++---- .../Examples/TestGridAndPVFromFile.mo | 17 +++++++------ .../Examples/TestGridAndPVSystemGeneral.mo | 16 ++++++++----- .../Photovoltaics/Examples/UsePVGeneral.mo | 13 +++++++--- .../Interfaces/BaseClasses/HeatingSystem.mo | 16 ++++++------- .../BaseClasses/VentilationSystem.mo | 23 ++++++++++++++---- 14 files changed, 142 insertions(+), 61 deletions(-) diff --git a/IDEAS/BoundaryConditions/SolarIrradiation/RadSolData.mo b/IDEAS/BoundaryConditions/SolarIrradiation/RadSolData.mo index d980a9925e..3d2c01c3c6 100644 --- a/IDEAS/BoundaryConditions/SolarIrradiation/RadSolData.mo +++ b/IDEAS/BoundaryConditions/SolarIrradiation/RadSolData.mo @@ -40,6 +40,8 @@ public annotation (Placement(transformation(extent={{96,-150},{116,-130}}))); Modelica.Blocks.Interfaces.RealOutput Tdes "Design tempearture" annotation (Placement(transformation(extent={{96,-170},{116,-150}}))); + parameter Boolean solDataInBus = numMatches==1 + "True if the {inc,azi} combination is found in incAndAziInBus" annotation(Evaluate=true); protected final parameter Integer numMatches= sum( {if IDEAS.Utilities.Math.Functions.isAngle(sim.incAndAziInBus[i,1],inc) @@ -49,8 +51,7 @@ protected then 1 else 0 for i in 1:sim.numIncAndAziInBus}) annotation(Evaluate=true); - final parameter Boolean solDataInBus = numMatches==1 - "True if the {inc,azi} combination is found in incAndAziInBus" annotation(Evaluate=true); + final parameter Integer solDataIndex= sum( {if IDEAS.Utilities.Math.Functions.isAngle(sim.incAndAziInBus[i,1],inc) and (IDEAS.Utilities.Math.Functions.isAngle(sim.incAndAziInBus[i,2],azi) @@ -190,6 +191,12 @@ If the correct data is not contained by the bus, custom solar data is calculated ", revisions="