diff --git a/dragonfly_grasshopper/icon/DF Run Modelica DES.png b/dragonfly_grasshopper/icon/DF Run Modelica DES.png index c33c307..96e0f31 100644 Binary files a/dragonfly_grasshopper/icon/DF Run Modelica DES.png and b/dragonfly_grasshopper/icon/DF Run Modelica DES.png differ diff --git a/dragonfly_grasshopper/json/DF_GHE_Thermal_Loop.json b/dragonfly_grasshopper/json/DF_GHE_Thermal_Loop.json index 97de2ae..c2b459a 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.6.1", + "version": "1.6.2", "nickname": "GHELoop", "outputs": [ [ @@ -85,7 +85,7 @@ } ], "subcategory": "3 :: Energy", - "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_linesegment2d, to_polyline2d\n from ladybug_{{cad}}.togeometry import to_polygon2d\n from ladybug_{{cad}}.config import angle_tolerance\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 try:\n lines.append(to_polyline2d(geo))\n except AttributeError:\n lines.append(to_linesegment2d(geo))\n connectors = []\n for i, lin in enumerate(lines):\n connectors.append(ThermalConnector('{}_ThermalConnector_{}'.format(name, i), lin))\n ghes = []\n for i, geo in enumerate(_ghe_geo):\n gp = to_polygon2d(geo)\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 if _name_ is not None:\n des_loop.display_name = _name_\n\n # assign the properties to the loop\n if _bore_depth_ is not None:\n d_min, d_max = _bore_depth_\n if d_min != 0:\n des_loop.borehole_parameters.min_depth = d_min\n elif d_max < 60:\n des_loop.borehole_parameters.min_depth = d_max\n des_loop.borehole_parameters.max_depth = d_max\n if _bore_spacing_ is not None:\n s_min, s_max = _bore_spacing_\n if s_min != 0:\n des_loop.borehole_parameters.max_spacing = s_max\n des_loop.borehole_parameters.min_spacing = s_min\n elif s_max > 10:\n des_loop.borehole_parameters.max_spacing = s_max\n des_loop.borehole_parameters.min_spacing = s_max\n else:\n des_loop.borehole_parameters.min_spacing = s_max\n if _soil_conduct_:\n des_loop.soil_parameters.conductivity = _soil_conduct_\n if _soil_heat_cap_:\n des_loop.soil_parameters.heat_capacity = _soil_heat_cap_\n if _fluid_type_:\n des_loop.fluid_parameters.fluid_type = _fluid_type_.replace(' ', '')\n if concentration_:\n des_loop.fluid_parameters.concentration = concentration_\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_linesegment2d, 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 try:\n lines.append(to_polyline2d(geo))\n except AttributeError:\n lines.append(to_linesegment2d(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 if _name_ is not None:\n des_loop.display_name = _name_\n\n # assign the properties to the loop\n if _bore_depth_ is not None:\n d_min, d_max = _bore_depth_\n if d_min != 0:\n des_loop.borehole_parameters.min_depth = d_min\n elif d_max < 60:\n des_loop.borehole_parameters.min_depth = d_max\n des_loop.borehole_parameters.max_depth = d_max\n if _bore_spacing_ is not None:\n s_min, s_max = _bore_spacing_\n if s_min != 0:\n des_loop.borehole_parameters.max_spacing = s_max\n des_loop.borehole_parameters.min_spacing = s_min\n elif s_max > 10:\n des_loop.borehole_parameters.max_spacing = s_max\n des_loop.borehole_parameters.min_spacing = s_max\n else:\n des_loop.borehole_parameters.min_spacing = s_max\n if _soil_conduct_:\n des_loop.soil_parameters.conductivity = _soil_conduct_\n if _soil_heat_cap_:\n des_loop.soil_parameters.heat_capacity = _soil_heat_cap_\n if _fluid_type_:\n des_loop.fluid_parameters.fluid_type = _fluid_type_.replace(' ', '')\n if concentration_:\n des_loop.fluid_parameters.concentration = concentration_\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/json/DF_Run_Modelica_DES.json b/dragonfly_grasshopper/json/DF_Run_Modelica_DES.json index 2f4b3a0..db87ffb 100644 --- a/dragonfly_grasshopper/json/DF_Run_Modelica_DES.json +++ b/dragonfly_grasshopper/json/DF_Run_Modelica_DES.json @@ -1,5 +1,5 @@ { - "version": "1.6.1", + "version": "1.6.2", "nickname": "RunDES", "outputs": [ [ diff --git a/dragonfly_grasshopper/src/DF GHE Thermal Loop.py b/dragonfly_grasshopper/src/DF GHE Thermal Loop.py index 46eb43b..5cb97d0 100644 --- a/dragonfly_grasshopper/src/DF GHE Thermal Loop.py +++ b/dragonfly_grasshopper/src/DF GHE Thermal Loop.py @@ -77,7 +77,7 @@ ghenv.Component.Name = 'DF GHE Thermal Loop' ghenv.Component.NickName = 'GHELoop' -ghenv.Component.Message = '1.6.1' +ghenv.Component.Message = '1.6.2' ghenv.Component.Category = 'Dragonfly' ghenv.Component.SubCategory = '3 :: Energy' ghenv.Component.AdditionalHelpFromDocStrings = '0' @@ -99,7 +99,7 @@ try: from ladybug_rhino.togeometry import to_linesegment2d, to_polyline2d from ladybug_rhino.togeometry import to_polygon2d - from ladybug_rhino.config import angle_tolerance + from ladybug_rhino.config import angle_tolerance, conversion_to_meters from ladybug_rhino.grasshopper import all_required_inputs, give_warning except ImportError as e: raise ImportError('\nFailed to import ladybug_rhino:\n\t{}'.format(e)) @@ -119,9 +119,10 @@ connectors = [] for i, lin in enumerate(lines): connectors.append(ThermalConnector('{}_ThermalConnector_{}'.format(name, i), lin)) - ghes = [] + 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) @@ -160,3 +161,15 @@ des_loop.fluid_parameters.fluid_type = _fluid_type_.replace(' ', '') if concentration_: des_loop.fluid_parameters.concentration = concentration_ + + # give a warning about RAM if the size of the borehole field is too large + borehole_count = int(total_area / (des_loop.borehole_parameters.min_spacing ** 2)) + MAX_BOREHOLES = 8000 + if borehole_count > MAX_BOREHOLES: + msg = 'The inputs suggest that there may be as many as {} boreholes in the ' \ + 'GHE field\nand this can cause the GHE sizing routine to use ' \ + 'more than 10GB of memory.\nA smaller _ghe_geo or a larger '\ + '_bore_spacing_ is recommended such that fewer\nthan {} boreholes are ' \ + 'generated.'.format(borehole_count, MAX_BOREHOLES) + print(msg) + give_warning(ghenv.Component, msg) diff --git a/dragonfly_grasshopper/src/DF Run Modelica DES.py b/dragonfly_grasshopper/src/DF Run Modelica DES.py index bb7b6a3..fd569c5 100644 --- a/dragonfly_grasshopper/src/DF Run Modelica DES.py +++ b/dragonfly_grasshopper/src/DF Run Modelica DES.py @@ -35,7 +35,7 @@ ghenv.Component.Name = 'DF Run Modelica DES' ghenv.Component.NickName = 'RunDES' -ghenv.Component.Message = '1.6.1' +ghenv.Component.Message = '1.6.2' ghenv.Component.Category = 'Dragonfly' ghenv.Component.SubCategory = '3 :: Energy' ghenv.Component.AdditionalHelpFromDocStrings = '0' diff --git a/dragonfly_grasshopper/user_objects/DF GHE Thermal Loop.ghuser b/dragonfly_grasshopper/user_objects/DF GHE Thermal Loop.ghuser index 3041253..942409f 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/dragonfly_grasshopper/user_objects/DF Run Modelica DES.ghuser b/dragonfly_grasshopper/user_objects/DF Run Modelica DES.ghuser index c07ecd8..6ff656a 100644 Binary files a/dragonfly_grasshopper/user_objects/DF Run Modelica DES.ghuser and b/dragonfly_grasshopper/user_objects/DF Run Modelica DES.ghuser differ diff --git a/samples/des_example.gh b/samples/des_example.gh index c54802e..c887705 100644 Binary files a/samples/des_example.gh and b/samples/des_example.gh differ diff --git a/samples/ghe_example.gh b/samples/ghe_example.gh index 5548eb5..0faa50f 100644 Binary files a/samples/ghe_example.gh and b/samples/ghe_example.gh differ