diff --git a/geojson_modelica_translator/model_connectors/districts/district.py b/geojson_modelica_translator/model_connectors/districts/district.py index d04dcb5ff..1944b1691 100644 --- a/geojson_modelica_translator/model_connectors/districts/district.py +++ b/geojson_modelica_translator/model_connectors/districts/district.py @@ -37,9 +37,9 @@ class District: def __init__(self, root_dir, project_name, system_parameters, coupling_graph, geojson_file=None): self._scaffold = Scaffold(root_dir, project_name) - self.system_parameters = system_parameters - self.gj = geojson_file - self._coupling_graph = coupling_graph + self.system_parameters = system_parameters # SystemParameters object + self.gj = geojson_file # UrbanOptGeoJson object + self._coupling_graph = coupling_graph # CouplingGraph object self.district_model_filepath = None # Modelica can't handle spaces in project name or path if (len(str(root_dir).split()) > 1) or (len(str(project_name).split()) > 1): @@ -105,18 +105,37 @@ def to_modelica(self): "data": loop_order, } - if self.gj: - # get horizontal pipe lengths from geojson, starting from the outlet of the (first) ghe - # TODO: only check for total_length if type==ThermalConnector - # I thought this was the right syntax, but not quite: .properties[?type=ThermalConnector].total_length - # TODO: make sure the list of lengths is starting from the outlet of the ghe - list_of_pipe_lengths = self.gj.get_feature("$.features.[*].properties.total_length") - for i in range(len(list_of_pipe_lengths)): - list_of_pipe_lengths[i] = convert_ft_to_m(list_of_pipe_lengths[i]) - common_template_params["globals"]["lDis"] = ( - str(list_of_pipe_lengths[:-1]).replace("[", "{").replace("]", "}") - ) - common_template_params["globals"]["lEnd"] = list_of_pipe_lengths[-1] + # This indent level requires the District to include a GHE, because the only way we get a loop_order + # is by running ThermalNetwork for sizing. + # TODO: determine loop order some other way, so thermal networks without GHEs can have horizontal piping + # or: Ensure TN is used for all networks, so loop order is generated that way. + if self.gj: + # get horizontal pipe lengths from geojson, starting from the beginning of the loop + feature_properties = self.gj.get_feature("$.features.[*].properties") + dict_of_pipe_lengths = { + feature_prop.get("startFeatureId"): feature_prop["total_length"] + for feature_prop in feature_properties + if feature_prop["type"] == "ThermalConnector" + } + ordered_feature_list = [] + ordered_pipe_list = [] + for loop in loop_order: + ordered_feature_list.extend(loop["list_bldg_ids_in_group"]) + ordered_feature_list.extend(loop["list_ghe_ids_in_group"]) + + for feature in ordered_feature_list: + for dict_feature, pipe_length in dict_of_pipe_lengths.items(): + if dict_feature == feature: + ordered_pipe_list.append(pipe_length) + + for i in range(len(ordered_pipe_list)): + ordered_pipe_list[i] = convert_ft_to_m(ordered_pipe_list[i]) + common_template_params["globals"]["lDis"] = ( + str(ordered_pipe_list[:-1]).replace("[", "{").replace("]", "}") + ) + common_template_params["globals"]["lEnd"] = ordered_pipe_list[-1] + else: + raise SystemExit("No geojson file provided, unable to determine thermal network loop order") # render each coupling load_num = 1 diff --git a/geojson_modelica_translator/system_parameters/time_series_template.json b/geojson_modelica_translator/system_parameters/time_series_template.json index 2268d3ca5..a7e3f45b3 100644 --- a/geojson_modelica_translator/system_parameters/time_series_template.json +++ b/geojson_modelica_translator/system_parameters/time_series_template.json @@ -187,7 +187,7 @@ ] }, "central_pump_parameters": { - "pump_design_head": 60000, + "pump_design_head": 200000, "pump_flow_rate": 0.01 } } diff --git a/geojson_modelica_translator/utils.py b/geojson_modelica_translator/utils.py index 3ba56f84a..5de6ed041 100644 --- a/geojson_modelica_translator/utils.py +++ b/geojson_modelica_translator/utils.py @@ -34,9 +34,9 @@ def convert_ft_to_m(f): """Converts a length in foot to meter :param f: float, length in ft - :return: float, length in meter + :return: float, length in meters, to 3 decimal places """ - return 0.3048 * f + return round(0.3048 * f, 3) def linecount(filename: Path) -> int: diff --git a/tests/management/data/sdk_project_scraps/example_project_combine_GHE_2.json b/tests/management/data/sdk_project_scraps/example_project_combine_GHE_2.json deleted file mode 100644 index f6c751715..000000000 --- a/tests/management/data/sdk_project_scraps/example_project_combine_GHE_2.json +++ /dev/null @@ -1,1121 +0,0 @@ -{ - "type": "FeatureCollection", - "project": { - "id": "7c33a001-bccb-413e-ac87-67558b5d4b07", - "name": "New Project", - "surface_elevation": null, - "import_surrounding_buildings_as_shading": null, - "weather_filename": "USA_NY_Buffalo-Greater.Buffalo.Intl.AP.725280_TMY3.epw", - "tariff_filename": null, - "climate_zone": "6A", - "cec_climate_zone": null, - "begin_date": "2017-01-01T07:00:00.000Z", - "end_date": "2017-12-31T07:00:00.000Z", - "timesteps_per_hour": 1, - "default_template": "90.1-2013" - }, - "features": [ - { - "type": "Feature", - "properties": { - "id": "53340c2c-ab20-40db-aba1-11ac607c52a7", - "name": "Site Origin", - "type": "Site Origin", - "begin_date": "2017-01-01T07:00:00.000Z", - "end_date": "2017-12-31T07:00:00.000Z", - "cec_climate_zone": null, - "climate_zone": "6A", - "default_template": "90.1-2013", - "import_surrounding_buildings_as_shading": null, - "surface_elevation": null, - "tariff_filename": null, - "timesteps_per_hour": 1, - "weather_filename": "USA_NY_Buffalo-Greater.Buffalo.Intl.AP.725280_TMY3.epw", - "only_lv_customers": null, - "underground_cables_ratio": null, - "max_number_of_lv_nodes_per_building": null - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.84948467732347, - 42.81677154451123 - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "1", - "name": "Mixed_use 1", - "type": "Building", - "building_type": "Mixed use", - "floor_area": 752184, - "footprint_area": 188046, - "number_of_stories": 4, - "mixed_type_1": "Office", - "mixed_type_1_percentage": 50, - "mixed_type_2": "Food service", - "mixed_type_2_percentage": 50, - "mixed_type_3": "Strip shopping mall", - "mixed_type_3_percentage": 0, - "mixed_type_4": "Lodging", - "mixed_type_4_percentage": 0 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84650338745196, - 42.81331301863236 - ], - [ - -78.84652443964629, - 42.81463974371101 - ], - [ - -78.84680142363833, - 42.815293654042534 - ], - [ - -78.84744455124724, - 42.81514110006128 - ], - [ - -78.84728610028628, - 42.81478165791734 - ], - [ - -78.84786797764677, - 42.814643631760134 - ], - [ - -78.84721106637106, - 42.813153418927016 - ], - [ - -78.84650338745196, - 42.81331301863236 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "2", - "name": "Restaurant 1", - "type": "Building", - "building_type": "Food service", - "floor_area": 22313, - "footprint_area": 22313, - "number_of_stories": 1 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.8500120420453, - 42.81812185529549 - ], - [ - -78.85038975191084, - 42.81803226424341 - ], - [ - -78.850630729414, - 42.81857888627522 - ], - [ - -78.85025301954843, - 42.81866847653532 - ], - [ - -78.8500120420453, - 42.81812185529549 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "3", - "name": "Restaurant 10", - "type": "Building", - "building_type": "Food service", - "floor_area": 125631, - "footprint_area": 41877, - "number_of_stories": 3 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84962224800356, - 42.81329273502644 - ], - [ - -78.84929833482822, - 42.81337083838241 - ], - [ - -78.84983265832118, - 42.814563298664666 - ], - [ - -78.85015657149653, - 42.81448519681467 - ], - [ - -78.84962224800356, - 42.81329273502644 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "4", - "name": "Restaurant 12", - "type": "Building", - "building_type": "Food service", - "floor_area": 31623, - "footprint_area": 10541, - "number_of_stories": 3 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84907318596754, - 42.81342719667407 - ], - [ - -78.84862090048105, - 42.81353625345659 - ], - [ - -78.84871721918239, - 42.813751210926796 - ], - [ - -78.84916950466888, - 42.81364215452331 - ], - [ - -78.84907318596754, - 42.81342719667407 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "5", - "name": "Restaurant 14", - "type": "Building", - "building_type": "Food service", - "floor_area": 8804, - "footprint_area": 8804, - "number_of_stories": 1 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84809175426629, - 42.81367038997507 - ], - [ - -78.84848670778973, - 42.81357515750889 - ], - [ - -78.84857883872144, - 42.81378076888831 - ], - [ - -78.84818388519801, - 42.81387600103781 - ], - [ - -78.84809175426629, - 42.81367038997507 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "6", - "name": "Restaurant 15", - "type": "Building", - "building_type": "Food service", - "floor_area": 10689, - "footprint_area": 10689, - "number_of_stories": 1 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84846106738529, - 42.814495803077364 - ], - [ - -78.8486903952376, - 42.81444050756261 - ], - [ - -78.8484977578349, - 42.81401059666683 - ], - [ - -78.84826842998261, - 42.81406589256599 - ], - [ - -78.84846106738529, - 42.814495803077364 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "7", - "name": "Office 1", - "type": "Building", - "building_type": "Office", - "number_of_stories": 6, - "detailed_model_filename": "7.osm" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84733878006863, - 42.816466983030836 - ], - [ - -78.84854275129324, - 42.81617669028003 - ], - [ - -78.848356395545, - 42.81576080994094 - ], - [ - -78.84715242432038, - 42.81605110464406 - ], - [ - -78.84733878006863, - 42.816466983030836 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "8", - "name": "Hospital 1", - "type": "Building", - "building_type": "Outpatient health care", - "number_of_stories": 10, - "detailed_model_filename": "8.osm" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84973966335251, - 42.8154441454509 - ], - [ - -78.85049562542395, - 42.81525669280299 - ], - [ - -78.85078257620685, - 42.81588131780643 - ], - [ - -78.8505086568277, - 42.81594736368234 - ], - [ - -78.85041233812638, - 42.815732413845666 - ], - [ - -78.84991755499783, - 42.81585689105046 - ], - [ - -78.84973966335251, - 42.8154441454509 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "9", - "name": "Hospital 2", - "type": "Building", - "building_type": "Inpatient health care", - "number_of_stories": 3, - "detailed_model_filename": "9.osm" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.85083627755732, - 42.81600678613279 - ], - [ - -78.85056039001891, - 42.816076133580566 - ], - [ - -78.85072568130569, - 42.816450649528036 - ], - [ - -78.84940134236577, - 42.81677160705479 - ], - [ - -78.84958014898304, - 42.81716858994267 - ], - [ - -78.8507262115271, - 42.816890840117026 - ], - [ - -78.8508565789851, - 42.81719595796099 - ], - [ - -78.85132137101688, - 42.81708331517635 - ], - [ - -78.85083627755732, - 42.81600678613279 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "10", - "name": "Mixed use 2", - "type": "Building", - "building_type": "Mixed use", - "floor_area": 1278384, - "footprint_area": 159798, - "number_of_stories": 8, - "mixed_type_1": "Strip shopping mall", - "mixed_type_1_percentage": 25, - "mixed_type_2": "Food service", - "mixed_type_2_percentage": 25, - "mixed_type_3": "Office", - "mixed_type_3_percentage": 15, - "mixed_type_4": "Lodging", - "mixed_type_4_percentage": 35 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.85115264550463, - 42.81786093060211 - ], - [ - -78.85163483958878, - 42.81774467026972 - ], - [ - -78.85246596719499, - 42.819583261120755 - ], - [ - -78.85082390085432, - 42.819979162017745 - ], - [ - -78.85060552295334, - 42.81947573727234 - ], - [ - -78.85174564783776, - 42.81920483484765 - ], - [ - -78.85115264550463, - 42.81786093060211 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "11", - "name": "Restaurant 13", - "type": "Building", - "building_type": "Food service", - "floor_area": 32511, - "footprint_area": 10837, - "number_of_stories": 3 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84961163640645, - 42.81460851835703 - ], - [ - -78.84914661048371, - 42.81472064501696 - ], - [ - -78.84905029178236, - 42.81450569091638 - ], - [ - -78.84951531770513, - 42.81439356386673 - ], - [ - -78.84961163640645, - 42.81460851835703 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "12", - "name": "Mall 1", - "type": "Building", - "building_type": "Strip shopping mall", - "floor_area": 374409, - "footprint_area": 124803, - "number_of_stories": 3 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84768338040897, - 42.817161656757065 - ], - [ - -78.8482630702579, - 42.8170218879136 - ], - [ - -78.84915297130291, - 42.81900776764229 - ], - [ - -78.84857328145401, - 42.81914753199706 - ], - [ - -78.84768338040897, - 42.817161656757065 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "13", - "name": "Hotel 1", - "type": "Building", - "building_type": "Lodging", - "floor_area": 316160, - "footprint_area": 31616, - "number_of_stories": 10 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.8494955083645, - 42.819748790984335 - ], - [ - -78.84891089471263, - 42.81989327725856 - ], - [ - -78.8491389243777, - 42.82038967009544 - ], - [ - -78.84972353802956, - 42.82024518498119 - ], - [ - -78.8494955083645, - 42.819748790984335 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "14", - "name": "Residential 1", - "type": "Building", - "building_type": "Single-Family Detached", - "floor_area": 3055, - "footprint_area": 3055, - "number_of_stories_above_ground": 1, - "number_of_stories": 1, - "number_of_bedrooms": 3, - "foundation_type": "crawlspace - unvented", - "attic_type": "attic - vented", - "system_type": "Residential - furnace and central air conditioner", - "heating_system_fuel_type": "natural gas", - "template": "Residential IECC 2015 - Customizable Template Sep 2020" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84782863379475, - 42.81308406513335 - ], - [ - -78.84789445741784, - 42.813211653666144 - ], - [ - -78.8481085224459, - 42.81315222398479 - ], - [ - -78.84804269882281, - 42.813024635329356 - ], - [ - -78.84782863379475, - 42.81308406513335 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "15", - "name": "Residential 2", - "type": "Building", - "building_type": "Single-Family Detached", - "floor_area": 4260, - "footprint_area": 2130, - "number_of_stories_above_ground": 2, - "number_of_stories": 3, - "number_of_bedrooms": 4, - "foundation_type": "basement - unconditioned", - "attic_type": "attic - unvented", - "system_type": "Residential - boiler and room air conditioner", - "heating_system_fuel_type": "propane", - "template": "Residential IECC 2015 - Customizable Template Sep 2020" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84841249573596, - 42.81294385519362 - ], - [ - -78.8484849661432, - 42.81308642712324 - ], - [ - -78.84861900200103, - 42.81304976336804 - ], - [ - -78.84854653159381, - 42.8129071913539 - ], - [ - -78.84841249573596, - 42.81294385519362 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "16", - "name": "Residenital 3", - "type": "Building", - "building_type": "Single-Family Detached", - "floor_area": 5500, - "footprint_area": 4655, - "number_of_stories_above_ground": 1, - "number_of_stories": 2, - "number_of_bedrooms": 5, - "foundation_type": "basement - conditioned", - "attic_type": "attic - conditioned", - "system_type": "Residential - electric resistance and no cooling", - "heating_system_fuel_type": "electricity", - "template": "Residential IECC 2015 - Customizable Template Sep 2020" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.84901642777548, - 42.81281054264619 - ], - [ - -78.8492166996002, - 42.81276856688589 - ], - [ - -78.8492882250648, - 42.81294171638328 - ], - [ - -78.84919524192809, - 42.812957457222666 - ], - [ - -78.84925246216879, - 42.81307288984212 - ], - [ - -78.84915232658385, - 42.8130833837933 - ], - [ - -78.84901642777548, - 42.81281054264619 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", - "geometryType": "Rectangle", - "name": "New District System_1", - "type": "District System", - "district_system_type": "Ground Heat Exchanger", - "footprint_area": 45601, - "footprint_perimeter": 873, - "floor_area": 45601 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.85372193709603, - 42.818301199899366 - ], - [ - -78.85339382171796, - 42.81761835371546 - ], - [ - -78.85278669937853, - 42.81777531839998 - ], - [ - -78.8531148147566, - 42.818458162850504 - ], - [ - -78.85372193709603, - 42.818301199899366 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "geometryType": "Rectangle", - "name": "New District System_2", - "type": "District System", - "district_system_type": "Ground Heat Exchanger", - "footprint_area": 32651, - "footprint_perimeter": 735, - "floor_area": 32651 - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [ - -78.85234092847948, - 42.81546939083259 - ], - [ - -78.85207796196407, - 42.814903219676495 - ], - [ - -78.85154987199657, - 42.815035203681305 - ], - [ - -78.85181283851198, - 42.81560137362911 - ], - [ - -78.85234092847948, - 42.81546939083259 - ] - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "54972e87-4681-4050-a534-c6c6fa9dc197", - "type": "ThermalJunction", - "DSId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "is_ghe_start_loop": true - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.85210623275802, - 42.81552804715616 - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "b38eeb88-9fb8-415f-9551-6f3da6a082ed", - "type": "ThermalJunction", - "DSId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.85315065120615, - 42.81768122277698 - ] - } - }, - { - "type": "Feature", - "properties": { - "type": "ThermalConnector", - "id": "a251809f-00a2-4982-8dc3-96d34fcb5727", - "startJunctionId": "54972e87-4681-4050-a534-c6c6fa9dc197", - "endJunctionId": "b38eeb88-9fb8-415f-9551-6f3da6a082ed", - "startFeatureId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "endFeatureId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", - "total_length": 834 - }, - "geometry": { - "type": "LineString", - "coordinates": [ - [ - -78.85210623275802, - 42.81552804715616 - ], - [ - -78.85315065120615, - 42.81768122277698 - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "0142e75a-2a98-4b2d-9016-b6636922a8c3", - "type": "ThermalJunction", - "DSId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.85296702354428, - 42.81815059389858 - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "2bb7fb78-dfe0-4ffe-9aa2-98766c500ab3", - "type": "ThermalJunction", - "buildingId": "10" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.85193472950549, - 42.81840808235308 - ] - } - }, - { - "type": "Feature", - "properties": { - "type": "ThermalConnector", - "id": "09340c8f-5e8d-443b-96e4-8b49f174a9a7", - "startJunctionId": "0142e75a-2a98-4b2d-9016-b6636922a8c3", - "endJunctionId": "2bb7fb78-dfe0-4ffe-9aa2-98766c500ab3", - "startFeatureId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", - "endFeatureId": "10", - "total_length": 292 - }, - "geometry": { - "type": "LineString", - "coordinates": [ - [ - -78.85296702354428, - 42.81815059389858 - ], - [ - -78.85193472950549, - 42.81840808235308 - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "8c6064ee-f9b7-440b-95cd-e2a163fd39a5", - "type": "ThermalJunction", - "buildingId": "10" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.85142736592312, - 42.817794693633836 - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "f621584e-4a8b-413d-b405-eb44ff16a927", - "type": "ThermalJunction", - "buildingId": "9" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.85109324705694, - 42.81713860125753 - ] - } - }, - { - "type": "Feature", - "properties": { - "type": "ThermalConnector", - "id": "1cadebde-30a0-4f6d-aee0-0d544a586de3", - "startJunctionId": "8c6064ee-f9b7-440b-95cd-e2a163fd39a5", - "endJunctionId": "f621584e-4a8b-413d-b405-eb44ff16a927", - "startFeatureId": "10", - "endFeatureId": "9", - "total_length": 256 - }, - "geometry": { - "type": "LineString", - "coordinates": [ - [ - -78.85142736592312, - 42.817794693633836 - ], - [ - -78.85109324705694, - 42.81713860125753 - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "d038f83c-0232-4058-9116-fed1520085f7", - "type": "ThermalJunction", - "buildingId": "9" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.85083627755733, - 42.81600678613278 - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "92603808-dd2e-48d8-93b6-55afd352ac9d", - "type": "ThermalJunction", - "buildingId": "8" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.85078257620687, - 42.81588131780642 - ] - } - }, - { - "type": "Feature", - "properties": { - "type": "ThermalConnector", - "id": "9b07a783-e0d9-4ab6-a820-148c61014cb5", - "startJunctionId": "d038f83c-0232-4058-9116-fed1520085f7", - "endJunctionId": "92603808-dd2e-48d8-93b6-55afd352ac9d", - "startFeatureId": "9", - "endFeatureId": "8", - "total_length": 48 - }, - "geometry": { - "type": "LineString", - "coordinates": [ - [ - -78.85083627755733, - 42.81600678613278 - ], - [ - -78.85078257620687, - 42.81588131780642 - ] - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "7803cfb8-3e1e-497e-b8e5-628dbd9cc6ba", - "type": "ThermalJunction", - "buildingId": "8" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.85061207392705, - 42.81551017482588 - ] - } - }, - { - "type": "Feature", - "properties": { - "id": "43f1cb29-0b84-47ec-afff-4f982dc794ab", - "type": "ThermalJunction", - "DSId": "15a25e2f-c425-46e9-8036-b1d0d09127e2" - }, - "geometry": { - "type": "Point", - "coordinates": [ - -78.85165903746848, - 42.815270238833634 - ] - } - }, - { - "type": "Feature", - "properties": { - "type": "ThermalConnector", - "id": "cef57522-03e4-44ae-816e-ac54a554fd07", - "startJunctionId": "7803cfb8-3e1e-497e-b8e5-628dbd9cc6ba", - "endJunctionId": "43f1cb29-0b84-47ec-afff-4f982dc794ab", - "startFeatureId": "8", - "endFeatureId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "total_length": 294 - }, - "geometry": { - "type": "LineString", - "coordinates": [ - [ - -78.85061207392705, - 42.81551017482588 - ], - [ - -78.85165903746848, - 42.815270238833634 - ] - ] - } - } - ], - "mappers": [], - "scenarios": [ - { - "feature_mappings": [], - "id": "72301739-c6c3-4dd7-bf1a-f37c8eff40db", - "name": "New Scenario" - } - ] -} diff --git a/tests/management/data/sdk_project_scraps/example_project_combine_GHE.json b/tests/management/data/sdk_project_scraps/exportGeo_combine_GHE.json similarity index 87% rename from tests/management/data/sdk_project_scraps/example_project_combine_GHE.json rename to tests/management/data/sdk_project_scraps/exportGeo_combine_GHE.json index 08eee2eb8..768620b48 100644 --- a/tests/management/data/sdk_project_scraps/example_project_combine_GHE.json +++ b/tests/management/data/sdk_project_scraps/exportGeo_combine_GHE.json @@ -806,62 +806,54 @@ { "type": "Feature", "properties": { - "id": "d038f83c-0232-4058-9116-fed1520085f7", + "id": "e3a9db66-9844-478d-a54c-d5f78c773dba", "type": "ThermalJunction", - "buildingId": "9", - "junction_type": "DES", - "connection_type": "Series" + "buildingId": "2" }, "geometry": { "type": "Point", "coordinates": [ - -78.8508362775573, - 42.8160067861328 + -78.8500120420453, + 42.81812185529547 ] } }, { "type": "Feature", "properties": { - "id": "92603808-dd2e-48d8-93b6-55afd352ac9d", + "id": "fff6e9c3-aecd-4318-b54b-581d91fe8d0e", "type": "ThermalJunction", - "buildingId": "8", - "junction_type": "DES", - "connection_type": "Series" + "buildingId": "5" }, "geometry": { "type": "Point", "coordinates": [ - -78.8507825762069, - 42.8158813178064 + -78.848183885198, + 42.81387600103779 ] } }, { "type": "Feature", "properties": { - "id": "9b07a783-e0d9-4ab6-a820-148c61014cb5", "type": "ThermalConnector", - "startJunctionId": "d038f83c-0232-4058-9116-fed1520085f7", - "endJunctionId": "92603808-dd2e-48d8-93b6-55afd352ac9d", - "startFeatureId": "9", - "endFeatureId": "8", - "total_length": 48, - "connector_type": "OnePipe", - "fluid_temperature_type": "Ambient", - "flow_direction": "Supply", - "junction_type": "DES" + "id": "fd6da451-05be-4ad1-b1f5-a482f0bc6e04", + "startJunctionId": "e3a9db66-9844-478d-a54c-d5f78c773dba", + "endJunctionId": "fff6e9c3-aecd-4318-b54b-581d91fe8d0e", + "startFeatureId": "2", + "endFeatureId": "5", + "total_length": 1624 }, "geometry": { "type": "LineString", "coordinates": [ [ - -78.8508362775573, - 42.8160067861328 + -78.8500120420453, + 42.81812185529547 ], [ - -78.8507825762069, - 42.8158813178064 + -78.848183885198, + 42.81387600103779 ] ] } @@ -869,62 +861,54 @@ { "type": "Feature", "properties": { - "id": "7803cfb8-3e1e-497e-b8e5-628dbd9cc6ba", + "id": "dcca8d87-5609-432b-90f1-7015aaf0aebf", "type": "ThermalJunction", - "buildingId": "8", - "junction_type": "DES", - "connection_type": "Series" + "buildingId": "5" }, "geometry": { "type": "Point", "coordinates": [ - -78.8506120739271, - 42.8155101748259 + -78.8485788387214, + 42.8137807688883 ] } }, { "type": "Feature", "properties": { - "id": "43f1cb29-0b84-47ec-afff-4f982dc794ab", + "id": "8eb3c9fc-9c0a-4bfd-a9f4-df7c8f971ef6", "type": "ThermalJunction", - "DSId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "junction_type": "DES", - "connection_type": "Series" + "DSId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2" }, "geometry": { "type": "Point", "coordinates": [ - -78.8516590374685, - 42.8152702388336 + -78.85154987199661, + 42.81503520368131 ] } }, { "type": "Feature", "properties": { - "id": "cef57522-03e4-44ae-816e-ac54a554fd07", "type": "ThermalConnector", - "startJunctionId": "7803cfb8-3e1e-497e-b8e5-628dbd9cc6ba", - "endJunctionId": "43f1cb29-0b84-47ec-afff-4f982dc794ab", - "startFeatureId": "8", - "endFeatureId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "total_length": 294, - "connector_type": "OnePipe", - "fluid_temperature_type": "Ambient", - "flow_direction": "Supply", - "junction_type": "DES" + "id": "9805b110-4a93-4aac-b5fe-a06d403bc826", + "startJunctionId": "dcca8d87-5609-432b-90f1-7015aaf0aebf", + "endJunctionId": "8eb3c9fc-9c0a-4bfd-a9f4-df7c8f971ef6", + "startFeatureId": "5", + "endFeatureId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", + "total_length": 917 }, "geometry": { "type": "LineString", "coordinates": [ [ - -78.8506120739271, - 42.8155101748259 + -78.8485788387214, + 42.8137807688883 ], [ - -78.8516590374685, - 42.8152702388336 + -78.85154987199661, + 42.81503520368131 ] ] } @@ -932,34 +916,30 @@ { "type": "Feature", "properties": { - "id": "bcc2cbda-8278-453a-a3ab-db565de83d56", + "id": "e3a27a3f-28f8-4065-87e0-3d7189b9fb2a", "type": "ThermalJunction", - "buildingId": "9", - "junction_type": "DES", - "connection_type": "Series" + "DSId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2" }, "geometry": { "type": "Point", "coordinates": [ - -78.8510658329957, - 42.8165162224585 + -78.85181283851202, + 42.81560137362911 ] } }, { "type": "Feature", "properties": { - "id": "7ac39fb9-8a88-464e-aea5-c074a2b13df5", + "id": "4efdfb4a-a715-4eaa-8463-3bbc9d74c340", "type": "ThermalJunction", - "DSId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "junction_type": "DES", - "connection_type": "Series" + "buildingId": "2" }, "geometry": { "type": "Point", "coordinates": [ - -78.852043400832, - 42.8155437504146 + -78.85038975191081, + 42.81803226424341 ] } }, @@ -967,27 +947,23 @@ "type": "Feature", "properties": { "type": "ThermalConnector", - "id": "84c33637-74a1-4721-b37a-2e286cc30b73", - "startJunctionId": "bcc2cbda-8278-453a-a3ab-db565de83d56", - "endJunctionId": "7ac39fb9-8a88-464e-aea5-c074a2b13df5", - "startFeatureId": "9", - "endFeatureId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "total_length": 441, - "connector_type": "OnePipe", - "fluid_temperature_type": "Ambient", - "flow_direction": "Supply", - "junction_type": "DES" + "id": "08f73e68-b07a-4732-a5b2-d5cec1c099a5", + "startJunctionId": "e3a27a3f-28f8-4065-87e0-3d7189b9fb2a", + "endJunctionId": "4efdfb4a-a715-4eaa-8463-3bbc9d74c340", + "startFeatureId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", + "endFeatureId": "2", + "total_length": 965 }, "geometry": { "type": "LineString", "coordinates": [ [ - -78.8510658329957, - 42.8165162224585 + -78.85181283851202, + 42.81560137362911 ], [ - -78.852043400832, - 42.8155437504146 + -78.85038975191081, + 42.81803226424341 ] ] } diff --git a/tests/management/data/sdk_project_scraps/example_project_germany_ghe.json b/tests/management/data/sdk_project_scraps/exportGeo_germany_ghe.json similarity index 88% rename from tests/management/data/sdk_project_scraps/example_project_germany_ghe.json rename to tests/management/data/sdk_project_scraps/exportGeo_germany_ghe.json index f5fd23541..6afc8b4c4 100644 --- a/tests/management/data/sdk_project_scraps/example_project_germany_ghe.json +++ b/tests/management/data/sdk_project_scraps/exportGeo_germany_ghe.json @@ -806,62 +806,57 @@ { "type": "Feature", "properties": { - "id": "d038f83c-0232-4058-9116-fed1520085f7", + "id": "4e280530-5250-480c-b58c-1399df99f899", "type": "ThermalJunction", - "buildingId": "9", - "junction_type": "DES", - "connection_type": "Series" + "buildingId": "5" }, "geometry": { "type": "Point", "coordinates": [ - -78.8508362775573, - 42.8160067861328 + -78.848183885198, + 42.81387600103779 ] } }, { "type": "Feature", "properties": { - "id": "92603808-dd2e-48d8-93b6-55afd352ac9d", + "id": "394db500-2448-485f-97e3-4636cc47f195", "type": "ThermalJunction", - "buildingId": "8", - "junction_type": "DES", - "connection_type": "Series" + "buildingId": "2" }, "geometry": { "type": "Point", "coordinates": [ - -78.8507825762069, - 42.8158813178064 + -78.8500120420453, + 42.81812185529547 ] } }, { "type": "Feature", "properties": { - "id": "9b07a783-e0d9-4ab6-a820-148c61014cb5", "type": "ThermalConnector", - "startJunctionId": "d038f83c-0232-4058-9116-fed1520085f7", - "endJunctionId": "92603808-dd2e-48d8-93b6-55afd352ac9d", - "startFeatureId": "9", - "endFeatureId": "8", - "total_length": 48, + "id": "f0e38704-b75f-4294-8353-2d6b8de5c0fa", + "startJunctionId": "4e280530-5250-480c-b58c-1399df99f899", + "endJunctionId": "394db500-2448-485f-97e3-4636cc47f195", + "startFeatureId": "5", + "endFeatureId": "2", + "total_length": 1624, "connector_type": "OnePipe", "fluid_temperature_type": "Ambient", - "flow_direction": "Supply", - "junction_type": "DES" + "flow_direction": "Supply" }, "geometry": { "type": "LineString", "coordinates": [ [ - -78.8508362775573, - 42.8160067861328 + -78.848183885198, + 42.81387600103779 ], [ - -78.8507825762069, - 42.8158813178064 + -78.8500120420453, + 42.81812185529547 ] ] } @@ -869,62 +864,57 @@ { "type": "Feature", "properties": { - "id": "7803cfb8-3e1e-497e-b8e5-628dbd9cc6ba", + "id": "a4c6187e-1c04-42af-a6b4-52f645812a15", "type": "ThermalJunction", - "buildingId": "8", - "junction_type": "DES", - "connection_type": "Series" + "buildingId": "2" }, "geometry": { "type": "Point", "coordinates": [ - -78.8506120739271, - 42.8155101748259 + -78.85038975191081, + 42.81803226424341 ] } }, { "type": "Feature", "properties": { - "id": "43f1cb29-0b84-47ec-afff-4f982dc794ab", + "id": "66a8b55f-02b0-489a-9fcb-ada0d0ca28a5", "type": "ThermalJunction", - "DSId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "junction_type": "DES", - "connection_type": "Series" + "DSId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2" }, "geometry": { "type": "Point", "coordinates": [ - -78.8516590374685, - 42.8152702388336 + -78.85175811642833, + 42.8154835567774 ] } }, { "type": "Feature", "properties": { - "id": "cef57522-03e4-44ae-816e-ac54a554fd07", "type": "ThermalConnector", - "startJunctionId": "7803cfb8-3e1e-497e-b8e5-628dbd9cc6ba", - "endJunctionId": "43f1cb29-0b84-47ec-afff-4f982dc794ab", - "startFeatureId": "8", - "endFeatureId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "total_length": 294, + "id": "442dbae7-e79a-487f-a883-5275b2422148", + "startJunctionId": "a4c6187e-1c04-42af-a6b4-52f645812a15", + "endJunctionId": "66a8b55f-02b0-489a-9fcb-ada0d0ca28a5", + "startFeatureId": "2", + "endFeatureId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", + "total_length": 999, "connector_type": "OnePipe", "fluid_temperature_type": "Ambient", - "flow_direction": "Supply", - "junction_type": "DES" + "flow_direction": "Supply" }, "geometry": { "type": "LineString", "coordinates": [ [ - -78.8506120739271, - 42.8155101748259 + -78.85038975191081, + 42.81803226424341 ], [ - -78.8516590374685, - 42.8152702388336 + -78.85175811642833, + 42.8154835567774 ] ] } @@ -932,34 +922,30 @@ { "type": "Feature", "properties": { - "id": "bcc2cbda-8278-453a-a3ab-db565de83d56", + "id": "46e0ab73-9259-4980-b3f3-2a67732a663e", "type": "ThermalJunction", - "buildingId": "9", - "junction_type": "DES", - "connection_type": "Series" + "DSId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2" }, "geometry": { "type": "Point", "coordinates": [ - -78.8510658329957, - 42.8165162224585 + -78.8515942952002, + 42.81513084771607 ] } }, { "type": "Feature", "properties": { - "id": "7ac39fb9-8a88-464e-aea5-c074a2b13df5", + "id": "34e67115-6fde-43bc-9f18-b9022bdd7478", "type": "ThermalJunction", - "DSId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "junction_type": "DES", - "connection_type": "Series" + "buildingId": "5" }, "geometry": { "type": "Point", "coordinates": [ - -78.852043400832, - 42.8155437504146 + -78.8485788387214, + 42.8137807688883 ] } }, @@ -967,27 +953,26 @@ "type": "Feature", "properties": { "type": "ThermalConnector", - "id": "84c33637-74a1-4721-b37a-2e286cc30b73", - "startJunctionId": "bcc2cbda-8278-453a-a3ab-db565de83d56", - "endJunctionId": "7ac39fb9-8a88-464e-aea5-c074a2b13df5", - "startFeatureId": "9", - "endFeatureId": "15a25e2f-c425-46e9-8036-b1d0d09127e2", - "total_length": 441, + "id": "c8e31c37-5c51-4394-83f2-140efdcfa670", + "startJunctionId": "46e0ab73-9259-4980-b3f3-2a67732a663e", + "endJunctionId": "34e67115-6fde-43bc-9f18-b9022bdd7478", + "startFeatureId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", + "endFeatureId": "5", + "total_length": 945, "connector_type": "OnePipe", "fluid_temperature_type": "Ambient", - "flow_direction": "Supply", - "junction_type": "DES" + "flow_direction": "Supply" }, "geometry": { "type": "LineString", "coordinates": [ [ - -78.8510658329957, - 42.8165162224585 + -78.8515942952002, + 42.81513084771607 ], [ - -78.852043400832, - 42.8155437504146 + -78.8485788387214, + 42.8137807688883 ] ] } diff --git a/tests/management/test_uo_des.py b/tests/management/test_uo_des.py index fe7de8813..6fd81fbb8 100644 --- a/tests/management/test_uo_des.py +++ b/tests/management/test_uo_des.py @@ -22,8 +22,8 @@ def setUp(self): self.output_dir.mkdir(exist_ok=True) self.scenario_file_path = self.data_dir / "sdk_project_scraps" / "baseline_scenario.csv" self.feature_file_path = self.data_dir / "sdk_project_scraps" / "example_project.json" - self.feature_file_path_ghe = self.data_dir / "sdk_project_scraps" / "example_project_combine_GHE.json" - self.feature_file_path_germany = self.data_dir / "sdk_project_scraps" / "example_project_germany_ghe.json" + self.feature_file_path_ghe = self.data_dir / "sdk_project_scraps" / "exportGeo_combine_GHE.json" + self.feature_file_path_germany = self.data_dir / "sdk_project_scraps" / "exportGeo_germany_ghe.json" self.sys_param_path = ( self.data_dir / "sdk_project_scraps" / "run" / "baseline_scenario" / "system_parameter.json" ) diff --git a/tests/model_connectors/data/time_series_ex2.json b/tests/model_connectors/data/time_series_ex2.json index 3201670fe..a986e3eca 100644 --- a/tests/model_connectors/data/time_series_ex2.json +++ b/tests/model_connectors/data/time_series_ex2.json @@ -153,7 +153,7 @@ "properties": { "id": "06dd2fa1-d276-4a99-8519-d4d50a4a8ddd", "type": "ThermalJunction", - "DSId": "39fce05d-6b08-430d-9813-223ac4cb6fef", + "DSId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", "junction_type": "DES", "connection_type": "Series" }, @@ -173,7 +173,7 @@ "startJunctionId": "b5999589-588f-4e27-a60e-71bdcc8f9c94", "endJunctionId": "06dd2fa1-d276-4a99-8519-d4d50a4a8ddd", "startFeatureId": "5a6b99ec37f4de7f94020090", - "endFeatureId": "39fce05d-6b08-430d-9813-223ac4cb6fef", + "endFeatureId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", "total_length": 44, "connector_type": "OnePipe", "fluid_temperature_type": "Ambient", @@ -198,7 +198,7 @@ "properties": { "id": "95c1831f-3ae6-480e-910e-6d3c440b035c", "type": "ThermalJunction", - "DSId": "39fce05d-6b08-430d-9813-223ac4cb6fef", + "DSId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", "is_ghe_start_loop": true, "junction_type": "DES", "connection_type": "Series" @@ -216,7 +216,7 @@ "properties": { "id": "68a041f4-0f1a-456d-923d-9fdeb247e697", "type": "ThermalJunction", - "buildingId": "6a9a4b9d-08b0-4634-8dfc-0b2a5c6b7fd7", + "buildingId": "abcdefghijklmnopqrstuvwx", "junction_type": "DES", "connection_type": "Series" }, @@ -235,8 +235,8 @@ "id": "6898f4d5-b8ce-4bcb-b204-0d5719d800fb", "startJunctionId": "95c1831f-3ae6-480e-910e-6d3c440b035c", "endJunctionId": "68a041f4-0f1a-456d-923d-9fdeb247e697", - "startFeatureId": "39fce05d-6b08-430d-9813-223ac4cb6fef", - "endFeatureId": "6a9a4b9d-08b0-4634-8dfc-0b2a5c6b7fd7", + "startFeatureId": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", + "endFeatureId": "abcdefghijklmnopqrstuvwx", "total_length": 39, "connector_type": "OnePipe", "fluid_temperature_type": "Ambient", @@ -261,7 +261,7 @@ "properties": { "id": "12fd2a2f-45b5-45d8-acea-4a58e32fb3a4", "type": "ThermalJunction", - "buildingId": "6a9a4b9d-08b0-4634-8dfc-0b2a5c6b7fd7", + "buildingId": "abcdefghijklmnopqrstuvwx", "junction_type": "DES", "connection_type": "Series" }, @@ -297,7 +297,7 @@ "id": "94b2a31c-8476-47c9-bed7-302004eba55f", "startJunctionId": "12fd2a2f-45b5-45d8-acea-4a58e32fb3a4", "endJunctionId": "5edaff69-dfe8-485a-b656-cf850f63264c", - "startFeatureId": "6a9a4b9d-08b0-4634-8dfc-0b2a5c6b7fd7", + "startFeatureId": "abcdefghijklmnopqrstuvwx", "endFeatureId": "5a6b99ec37f4de7f94020090", "total_length": 62, "connector_type": "OnePipe",