diff --git a/dragonfly_grasshopper/icon/DF GHE Thermal Loop.png b/dragonfly_grasshopper/icon/DF GHE Thermal Loop.png index 853fb7b..4d970f7 100644 Binary files a/dragonfly_grasshopper/icon/DF GHE Thermal Loop.png and b/dragonfly_grasshopper/icon/DF GHE Thermal Loop.png differ diff --git a/dragonfly_grasshopper/json/DF_GHE_Thermal_Loop.json b/dragonfly_grasshopper/json/DF_GHE_Thermal_Loop.json index e295a33..4db68ff 100644 --- a/dragonfly_grasshopper/json/DF_GHE_Thermal_Loop.json +++ b/dragonfly_grasshopper/json/DF_GHE_Thermal_Loop.json @@ -1,5 +1,5 @@ { - "version": "1.8.1", + "version": "1.8.2", "nickname": "GHELoop", "outputs": [ [ @@ -17,7 +17,7 @@ "access": "list", "name": "_ghe_geo", "description": "Horizontal Rhino surfaces representing the footprints of ground heat\nexchangers. These ground heat exchanging fields contain the\nboreholes that supply the loop with thermal capacity. Multiple\nborehole fields can be located along the loop created by the\n_connector_geo.", - "type": "Curve", + "type": "Brep", "default": null }, { @@ -78,7 +78,7 @@ } ], "subcategory": "5 :: District Thermal", - "code": "\nimport math\n\ntry: # import the core honeybee dependencies\n from honeybee.typing import clean_ep_string\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the core dragonfly_energy dependencies\n from dragonfly_energy.des.connector import ThermalConnector\n from dragonfly_energy.des.ghe import GroundHeatExchanger\n from dragonfly_energy.des.loop import {{PLGN}}EThermalLoop\nexcept ImportError as e:\n raise ImportError('\\nFailed to import dragonfly_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.togeometry import to_polyline2d\n from ladybug_{{cad}}.togeometry import to_polygon2d\n from ladybug_{{cad}}.config import angle_tolerance, conversion_to_meters\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs, give_warning\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # set a default name\n name = clean_ep_string(_name_) if _name_ is not None else 'unnamed'\n\n # create the {{PLGN}}E fields and the Thermal Connectors\n lines = []\n for geo in _connector_geo:\n lines.append(to_polyline2d(geo))\n connectors = []\n for i, lin in enumerate(lines):\n connectors.append(ThermalConnector('{}_ThermalConnector_{}'.format(name, i), lin))\n ghes, total_area = [], 0\n for i, geo in enumerate(_ghe_geo):\n gp = to_polygon2d(geo)\n total_area += gp.area * conversion_to_meters()\n if not gp.is_rectangle(math.radians(angle_tolerance)):\n msg = 'The ground heat exchanger with index {} is not a perfect rectangle ' \\\n 'but it will be approximated as such in the DES simulation.'.format(i)\n print(msg)\n give_warning(ghenv.Component, msg)\n ghes.append(GroundHeatExchanger('{}_{{PLGN}}E_{}'.format(name, i), gp))\n\n # create the loop\n des_loop = {{PLGN}}EThermalLoop(name, ghes, connectors, _clockwise_,\n _soil_, _fluid_, _pipe_, _borehole_, _design_)\n if _name_ is not None:\n des_loop.display_name = _name_\n\n # give a warning about RAM if the size of the borehole field is too large\n borehole_count = int(total_area / (des_loop.borehole_parameters.min_spacing ** 2))\n MAX_BOREHOLES = 8000\n if borehole_count > MAX_BOREHOLES:\n msg = 'The inputs suggest that there may be as many as {} boreholes in the ' \\\n '{{PLGN}}E field\\nand this can cause the {{PLGN}}E sizing routine to use ' \\\n 'more than 10GB of memory.\\nA smaller _ghe_geo or a larger '\\\n '_bore_spacing_ is recommended such that fewer\\nthan {} boreholes are ' \\\n 'generated.'.format(borehole_count, MAX_BOREHOLES)\n print(msg)\n give_warning(ghenv.Component, msg)\n", + "code": "\nimport math\n\ntry: # import the core honeybee dependencies\n from honeybee.typing import clean_ep_string\nexcept ImportError as e:\n raise ImportError('\\nFailed to import honeybee:\\n\\t{}'.format(e))\n\ntry: # import the core dragonfly_energy dependencies\n from dragonfly_energy.des.connector import ThermalConnector\n from dragonfly_energy.des.ghe import GroundHeatExchanger\n from dragonfly_energy.des.loop import {{PLGN}}EThermalLoop\nexcept ImportError as e:\n raise ImportError('\\nFailed to import dragonfly_energy:\\n\\t{}'.format(e))\n\ntry:\n from ladybug_{{cad}}.togeometry import to_polyline2d\n from ladybug_{{cad}}.togeometry import to_face3d\n from ladybug_{{cad}}.config import angle_tolerance, conversion_to_meters\n from ladybug_{{cad}}.{{plugin}} import all_required_inputs, give_warning\nexcept ImportError as e:\n raise ImportError('\\nFailed to import ladybug_{{cad}}:\\n\\t{}'.format(e))\n\n\nif all_required_inputs(ghenv.Component):\n # set a default name\n name = clean_ep_string(_name_) if _name_ is not None else 'unnamed'\n\n # create the {{PLGN}}E fields and the Thermal Connectors\n lines = []\n for geo in _connector_geo:\n lines.append(to_polyline2d(geo))\n connectors = []\n for i, lin in enumerate(lines):\n connectors.append(ThermalConnector('{}_ThermalConnector_{}'.format(name, i), lin))\n ghes, total_area = [], 0\n for i, geo in enumerate(_ghe_geo):\n faces = to_face3d(geo)\n for gp in faces:\n print(gp)\n total_area += gp.area * conversion_to_meters()\n ghes.append(GroundHeatExchanger('{}_{{PLGN}}E_{}'.format(name, i), gp))\n\n # create the loop\n des_loop = {{PLGN}}EThermalLoop(name, ghes, connectors, _clockwise_,\n _soil_, _fluid_, _pipe_, _borehole_, _design_)\n if _name_ is not None:\n des_loop.display_name = _name_\n\n # give a warning about RAM if the size of the borehole field is too large\n borehole_count = int(total_area / (des_loop.borehole_parameters.min_spacing ** 2))\n MAX_BOREHOLES = 8000\n if borehole_count > MAX_BOREHOLES:\n msg = 'The inputs suggest that there may be as many as {} boreholes in the ' \\\n '{{PLGN}}E field\\nand this can cause the {{PLGN}}E sizing routine to use ' \\\n 'more than 10GB of memory.\\nA smaller _ghe_geo or a larger '\\\n '_bore_spacing_ is recommended such that fewer\\nthan {} boreholes are ' \\\n 'generated.'.format(borehole_count, MAX_BOREHOLES)\n print(msg)\n give_warning(ghenv.Component, msg)\n", "category": "Dragonfly", "name": "DF GHE Thermal Loop", "description": "Create an Ground Heat Exchanger Thermal Loop, which represents all infrastructure\nfor a District Energy Simulation (DES) simulation.\n_\nThis includes a ground heat exchanger and all thermal connectors needed\nto connect these objects to Dragonfly Buildings.\n-" diff --git a/dragonfly_grasshopper/src/DF GHE Thermal Loop.py b/dragonfly_grasshopper/src/DF GHE Thermal Loop.py index d71104c..53f2359 100644 --- a/dragonfly_grasshopper/src/DF GHE Thermal Loop.py +++ b/dragonfly_grasshopper/src/DF GHE Thermal Loop.py @@ -58,7 +58,7 @@ ghenv.Component.Name = 'DF GHE Thermal Loop' ghenv.Component.NickName = 'GHELoop' -ghenv.Component.Message = '1.8.1' +ghenv.Component.Message = '1.8.2' ghenv.Component.Category = 'Dragonfly' ghenv.Component.SubCategory = '5 :: District Thermal' ghenv.Component.AdditionalHelpFromDocStrings = '2' @@ -79,7 +79,7 @@ try: from ladybug_rhino.togeometry import to_polyline2d - from ladybug_rhino.togeometry import to_polygon2d + from ladybug_rhino.togeometry import to_face3d from ladybug_rhino.config import angle_tolerance, conversion_to_meters from ladybug_rhino.grasshopper import all_required_inputs, give_warning except ImportError as e: @@ -99,14 +99,11 @@ connectors.append(ThermalConnector('{}_ThermalConnector_{}'.format(name, i), lin)) ghes, total_area = [], 0 for i, geo in enumerate(_ghe_geo): - gp = to_polygon2d(geo) - total_area += gp.area * conversion_to_meters() - if not gp.is_rectangle(math.radians(angle_tolerance)): - msg = 'The ground heat exchanger with index {} is not a perfect rectangle ' \ - 'but it will be approximated as such in the DES simulation.'.format(i) - print(msg) - give_warning(ghenv.Component, msg) - ghes.append(GroundHeatExchanger('{}_GHE_{}'.format(name, i), gp)) + faces = to_face3d(geo) + for gp in faces: + print(gp) + total_area += gp.area * conversion_to_meters() + ghes.append(GroundHeatExchanger('{}_GHE_{}'.format(name, i), gp)) # create the loop des_loop = GHEThermalLoop(name, ghes, connectors, _clockwise_, diff --git a/dragonfly_grasshopper/user_objects/DF GHE Thermal Loop.ghuser b/dragonfly_grasshopper/user_objects/DF GHE Thermal Loop.ghuser index 2ef7ccb..a70866a 100644 Binary files a/dragonfly_grasshopper/user_objects/DF GHE Thermal Loop.ghuser and b/dragonfly_grasshopper/user_objects/DF GHE Thermal Loop.ghuser differ diff --git a/samples/ghe_example.gh b/samples/ghe_example.gh index 3bec0d8..4a4b6aa 100644 Binary files a/samples/ghe_example.gh and b/samples/ghe_example.gh differ