From 3f7d595a82ea89a70ebbae889090d532a4c02314 Mon Sep 17 00:00:00 2001 From: David Paul Jansen Date: Fri, 18 Oct 2024 11:31:22 +0200 Subject: [PATCH] temporary fix test for aixlib but further work needed in #733 --- bim2sim/elements/hvac_elements.py | 1 + bim2sim/export/modelica/standardlibrary.py | 2 ++ .../bim2sim_aixlib/models/__init__.py | 18 ++++++++++++++++++ .../test/integration/test_aixlib.py | 5 +++-- bim2sim/tasks/hvac/reduce.py | 1 + 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/bim2sim/elements/hvac_elements.py b/bim2sim/elements/hvac_elements.py index 9827ac970..48655a1c7 100644 --- a/bim2sim/elements/hvac_elements.py +++ b/bim2sim/elements/hvac_elements.py @@ -40,6 +40,7 @@ class HVACPort(Port): re.IGNORECASE) # TODO: extend pattern rl_pattern = re.compile('.*rücklauf.*', re.IGNORECASE) + # TODO #733 Clean port flow side setup def __init__( self, *args, groups: Set = None, flow_direction: int = 0, **kwargs): diff --git a/bim2sim/export/modelica/standardlibrary.py b/bim2sim/export/modelica/standardlibrary.py index b699976fc..6e8db5612 100644 --- a/bim2sim/export/modelica/standardlibrary.py +++ b/bim2sim/export/modelica/standardlibrary.py @@ -55,6 +55,8 @@ def get_port_name(self, port): return 'port_a' if port.verbose_flow_direction == 'SOURCE': return 'port_b' + # TODO #733 find port if sourceandsink or sinkdansource + # if port.flow_direction == 0. # SOURCEANDSINK and SINKANDSOURCE else: return super().get_port_name(port) diff --git a/bim2sim/plugins/PluginAixLib/bim2sim_aixlib/models/__init__.py b/bim2sim/plugins/PluginAixLib/bim2sim_aixlib/models/__init__.py index 04aa4241d..074af4260 100644 --- a/bim2sim/plugins/PluginAixLib/bim2sim_aixlib/models/__init__.py +++ b/bim2sim/plugins/PluginAixLib/bim2sim_aixlib/models/__init__.py @@ -576,3 +576,21 @@ def __init__(self, element): value={'hTank': self.parameters['hTank'], "dTank": self.parameters['dTank']}) + # def get_port_name(self, port): + # TODO #733 + # TODO function to determine ports. One Idea would be to use the + # geometric positions of ports to determine input and output. + # Top port with input: fluidportTop1 + # Bottom port with input: fluidportBottom1 + # Top port with output: fluidportTop2 + # Bottom port with input: fluidportBottom2 + + # Additionally, the number of ports can be used to determine if its a + # direct loaded or indirect loaded storage: + # 4 ports -> direct, + # 6 or any other even number > 4 -> indirect load + # with n=n_ports /2 -4 -> number of heating coils + # Then again used height of port to determine port name + # top port of first heating coil: portHC1In + # bottom port of first heating coil: portHC1Out + # etc. diff --git a/bim2sim/plugins/PluginAixLib/test/integration/test_aixlib.py b/bim2sim/plugins/PluginAixLib/test/integration/test_aixlib.py index e77a6e387..38846d260 100644 --- a/bim2sim/plugins/PluginAixLib/test/integration/test_aixlib.py +++ b/bim2sim/plugins/PluginAixLib/test/integration/test_aixlib.py @@ -35,8 +35,9 @@ def test_vereinshaus1_aixlib(self): project = self.create_project(ifc_names, 'aixlib') answers = ('HVAC-HeatPump', 'HVAC-Storage', 'HVAC-Storage', '2lU4kSSzH16v7KPrwcL7KZ', '0t2j$jKmf74PQpOI0ZmPCc', - # 1x expansion tank and 17x dead end - *(True,) * 18, + # TODO #733 + # 1x expansion tank and 20x dead end + *(True,) * 21, # boiler efficiency 0.9, # boiler flow temperature diff --git a/bim2sim/tasks/hvac/reduce.py b/bim2sim/tasks/hvac/reduce.py index 5f6bfe141..a1ec6792e 100644 --- a/bim2sim/tasks/hvac/reduce.py +++ b/bim2sim/tasks/hvac/reduce.py @@ -102,6 +102,7 @@ def set_flow_sides(graph: HvacGraph): DecisionBunch: A collection of decisions may be yielded during the task. """ + # TODO #733 # TODO: needs testing! # TODO: at least one master element required accepted = []