diff --git a/geojson_modelica_translator/system_parameters/schema.json b/geojson_modelica_translator/system_parameters/schema.json index 4425741c6..3e61c6b81 100644 --- a/geojson_modelica_translator/system_parameters/schema.json +++ b/geojson_modelica_translator/system_parameters/schema.json @@ -217,7 +217,7 @@ "type": "object", "properties": { "geojson_id": { - "description": "The GeoJSON ID as defined in the GeoJSON file. This is used to overwrite the default data for a specific building. This option is not used in the default section.", + "description": "The GeoJSON ID as defined in the GeoJSON file.", "type": "string" }, "load_model": { @@ -243,13 +243,29 @@ "$ref": "#/definitions/time_series_model_parameters" } }, - "additionalProperties": false + "additionalProperties": false, + "anyOf": [ + { + "required": [ + "spawn" + ] + }, + { + "required": [ + "rc" + ] + }, + { + "required": [ + "time_series" + ] + } + ] }, "ets_model": { "description": "Energy transfer station model. One side is connected to the district water loops and the other side is connected to the building water loops.", "type": "string", "enum": [ - "None", "Indirect Heating and Cooling", "Fifth Gen Heat Pump" ] @@ -305,9 +321,23 @@ } } }, + "oneOf": [ + { + "required": [ + "ets_indirect_parameters" + ] + }, + { + "required": [ + "fifth_gen_ets_parameters" + ] + } + ], "required": [ "geojson_id", - "ets_model" + "ets_model", + "load_model", + "load_model_parameters" ] }, "connector_def": { @@ -1053,7 +1083,14 @@ "type": "number", "default": 480 } - } + }, + "required": [ + "net_surface_area", + "surface_tilt", + "surface_azimuth", + "latitude", + "nominal_voltage" + ] }, "wind_turbine_parameters": { "description": "Wind turbine parameters used by the microgrid model.", @@ -1094,7 +1131,10 @@ "description": "Nominal Capacity (var)", "type": "number" } - } + }, + "required": [ + "nominal_capacity" + ] }, "substation_parameters": { "description": "Substation parameters used by the microgrid model.", @@ -1226,38 +1266,7 @@ "fourth_generation_def": { "properties": { "fourth_generation": { - "properties": { - "central_cooling_plant_parameters": { - "$ref": "#/definitions/central_cooling_plant_parameters" - }, - "central_heating_plant_parameters": { - "$ref": "#/definitions/central_heating_plant_parameters" - }, - "combined_heat_and_power_parameters": { - "$ref": "#/definitions/combined_heat_and_power_parameters" - }, - "connected_buildings": { - "items": [ - { - "properties": { - "building_id": { - "description": "This is the geojson_id that is defined in the building object." - } - } - } - ] - }, - "central_pump_parameters": { - "description": "Parameters for central pump", - "type": "object", - "properties": { - "pump_design_head": { - "description": "Measured in Pa", - "type": "number" - } - } - } - } + "$ref": "#/definitions/fourth_generation" } }, "required": [ @@ -1267,38 +1276,7 @@ "fifth_generation_def": { "properties": { "fifth_generation": { - "properties": { - "soil": { - "$ref": "#/definitions/soil_def" - }, - "ghe_parameters": { - "$ref": "#/definitions/ghe_parameters" - }, - "connected_buildings": { - "items": [ - { - "properties": { - "building_id": { - "description": "This is the geojson_id that is defined in the building object." - } - } - } - ] - }, - "central_pump_parameters": { - "description": "Parameters for central pump", - "type": "object", - "properties": { - "pump_design_head": { - "description": "Measured in Pa.", - "type": "number" - } - } - }, - "horizontal_piping_parameters": { - "$ref": "#/definitions/horizontal_piping_parameters" - } - } + "$ref": "#/definitions/fifth_generation" } }, "required": [ @@ -1332,16 +1310,6 @@ "type": "number", "default": 3.5 }, - "pump_flow_rate": { - "description": "Design volume flow rate of the ambient loop pump. (m3/s)", - "type": "number", - "default": 0.01 - }, - "pump_design_head": { - "description": "Design head pressure of the ambient loop pump. (Pa)", - "type": "number", - "default": 150000 - }, "ets_pump_flow_rate": { "description": "Design volume flow rate of the ETS pump. (m3/s)", "type": "number", @@ -1369,8 +1337,6 @@ "hot_water_supply_temp", "cop_heat_pump_heating", "cop_heat_pump_cooling", - "pump_flow_rate", - "pump_design_head", "ets_pump_flow_rate", "ets_pump_head", "fan_design_flow_rate", @@ -1685,6 +1651,102 @@ "max_eft", "min_eft" ] + }, + "central_pump_parameters": { + "description": "Parameters for central pump", + "type": "object", + "properties": { + "pump_design_head": { + "description": "Measured in Pa.", + "type": "number" + }, + "pump_flow_rate": { + "description": "Design volume flow rate of the ambient loop pump. (m3/s)", + "type": "number", + "default": 0.01 + } + }, + "required": [ + "pump_design_head", + "pump_flow_rate" + ] + }, + "fifth_generation": { + "description": "Fifth generation district parameters, for an ambient loop system.", + "type": "object", + "properties": { + "soil": { + "$ref": "#/definitions/soil_def" + }, + "ghe_parameters": { + "$ref": "#/definitions/ghe_parameters" + }, + "connected_buildings": { + "items": [ + { + "properties": { + "building_id": { + "description": "This is the geojson_id that is defined in the building object." + } + } + } + ] + }, + "central_pump_parameters": { + "$ref": "#/definitions/central_pump_parameters" + }, + "horizontal_piping_parameters": { + "$ref": "#/definitions/horizontal_piping_parameters" + } + }, + "required": [ + "soil", + "horizontal_piping_parameters", + "central_pump_parameters" + ] + }, + "fourth_generation": { + "description": "Fourth generation district parameters, for a central loop system.", + "type": "object", + "properties": { + "central_cooling_plant_parameters": { + "$ref": "#/definitions/central_cooling_plant_parameters" + }, + "central_heating_plant_parameters": { + "$ref": "#/definitions/central_heating_plant_parameters" + }, + "combined_heat_and_power_parameters": { + "$ref": "#/definitions/combined_heat_and_power_parameters" + }, + "connected_buildings": { + "items": [ + { + "properties": { + "building_id": { + "description": "This is the geojson_id that is defined in the building object." + } + } + } + ] + } + }, + "anyOf": [ + { + "required": [ + "central_cooling_plant_parameters" + ] + }, + { + "required": [ + "central_heating_plant_parameters" + ] + }, + { + "required": [ + "combined_heat_and_power_parameters" + ] + } + ] } } } diff --git a/geojson_modelica_translator/system_parameters/time_series_template.json b/geojson_modelica_translator/system_parameters/time_series_template.json index e8fcfaf02..2268d3ca5 100644 --- a/geojson_modelica_translator/system_parameters/time_series_template.json +++ b/geojson_modelica_translator/system_parameters/time_series_template.json @@ -73,8 +73,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -116,9 +114,6 @@ "temp_setpoint_hhw": 54, "pressure_drop_hhw_valve_nominal": 6001, "chp_installed": false - }, - "central_pump_parameters": { - "pump_design_head": 60000 } }, "fifth_generation": { @@ -192,7 +187,8 @@ ] }, "central_pump_parameters": { - "pump_design_head": 60000 + "pump_design_head": 60000, + "pump_flow_rate": 0.01 } } }, diff --git a/management/data/baseline_sys_params.json b/management/data/baseline_sys_params.json index 31e6e42a4..9fa4bec53 100644 --- a/management/data/baseline_sys_params.json +++ b/management/data/baseline_sys_params.json @@ -118,9 +118,6 @@ "temp_setpoint_hhw": 68, "pressure_drop_hhw_valve_nominal": 6001, "chp_installed": false - }, - "central_pump_parameters": { - "pump_design_head": 60000 } } }, diff --git a/tests/data_shared/system_params_des_5g.json b/tests/data_shared/system_params_des_5g.json index 1331209ff..c26dce7ac 100644 --- a/tests/data_shared/system_params_des_5g.json +++ b/tests/data_shared/system_params_des_5g.json @@ -28,8 +28,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -63,8 +61,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -98,8 +94,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -109,11 +103,24 @@ ], "district_system": { "fifth_generation": { - "central_cooling_plant_parameters": { - "temp_setpoint_chw": 6 + "horizontal_piping_parameters": { + "hydraulic_diameter": 0.089, + "insulation_thickness": 0.2, + "insulation_conductivity": 2.3, + "diameter_ratio": 11, + "roughness": 1e-06, + "rho_cp": 2139000, + "number_of_segments": 1, + "buried_depth": 1.5 }, - "central_heating_plant_parameters": { - "temp_setpoint_hhw": 54 + "soil": { + "conductivity": 2.0, + "rho_cp": 2343493, + "undisturbed_temp": 18.3 + }, + "central_pump_parameters": { + "pump_design_head": 60000, + "pump_flow_rate": 0.01 } } } diff --git a/tests/model_connectors/data/sdk_output_skeleton_13_buildings/run/baseline_scenario/ghe_dir/sys_params_proportional.json b/tests/model_connectors/data/sdk_output_skeleton_13_buildings/run/baseline_scenario/ghe_dir/sys_params_proportional.json index 54242470e..a8a170c3b 100644 --- a/tests/model_connectors/data/sdk_output_skeleton_13_buildings/run/baseline_scenario/ghe_dir/sys_params_proportional.json +++ b/tests/model_connectors/data/sdk_output_skeleton_13_buildings/run/baseline_scenario/ghe_dir/sys_params_proportional.json @@ -28,8 +28,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -67,8 +65,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -106,8 +102,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -145,8 +139,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -184,8 +176,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -223,8 +213,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -262,8 +250,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -301,8 +287,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -340,8 +324,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -379,8 +361,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -418,8 +398,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -457,8 +435,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -496,8 +472,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -606,6 +580,7 @@ ] }, "central_pump_parameters": { + "pump_flow_rate": 0.01, "pump_design_head": 10000000 } } diff --git a/tests/model_connectors/data/system_params_ghe.json b/tests/model_connectors/data/system_params_ghe.json index 9d7c7dc5c..c050f2074 100644 --- a/tests/model_connectors/data/system_params_ghe.json +++ b/tests/model_connectors/data/system_params_ghe.json @@ -29,8 +29,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -40,8 +38,19 @@ ], "district_system": { "fifth_generation": { + "horizontal_piping_parameters": { + "hydraulic_diameter": 0.089, + "insulation_thickness": 0.2, + "insulation_conductivity": 2.3, + "diameter_ratio": 11, + "roughness": 1e-06, + "rho_cp": 2139000, + "number_of_segments": 1, + "buried_depth": 1.5 + }, "central_pump_parameters": { - "pump_design_head": 60000 + "pump_design_head": 60000, + "pump_flow_rate": 0.01 }, "soil": { "conductivity": 2.0, diff --git a/tests/model_connectors/data/system_params_ghe_3.json b/tests/model_connectors/data/system_params_ghe_3.json index 58df958f8..167e20676 100644 --- a/tests/model_connectors/data/system_params_ghe_3.json +++ b/tests/model_connectors/data/system_params_ghe_3.json @@ -29,8 +29,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -65,8 +63,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -77,7 +73,8 @@ "district_system": { "fifth_generation": { "central_pump_parameters": { - "pump_design_head": 60000 + "pump_design_head": 60000, + "pump_flow_rate": 0.01 }, "horizontal_piping_parameters": { "hydraulic_diameter": 0.089, @@ -119,18 +116,6 @@ "num_months": 240 }, "geometric_constraints": { - "ghe_geometric_params": [ - { - "ghe_id": "0b575a8f-97d1-47e6-b329-7ef7566d26f2", - "length": 100, - "width": 100 - }, - { - "ghe_id": "93b98fa5-a83e-455f-8d95-05a6a81fed74", - "length": 100, - "width": 100 - } - ], "b_min": 3.0, "b_max": 10.0, "max_height": 135.0, diff --git a/tests/model_connectors/data/time_series_5g_sys_params.json b/tests/model_connectors/data/time_series_5g_sys_params.json index f19bbcf7c..d441b72d2 100644 --- a/tests/model_connectors/data/time_series_5g_sys_params.json +++ b/tests/model_connectors/data/time_series_5g_sys_params.json @@ -23,7 +23,15 @@ }, "ets_model": "Fifth Gen Heat Pump", "fifth_gen_ets_parameters": { - "supply_water_temperature_building": 15 + "supply_water_temperature_building": 15, + "chilled_water_supply_temp": 5, + "hot_water_supply_temp": 50, + "cop_heat_pump_heating": 2.5, + "cop_heat_pump_cooling": 3.5, + "ets_pump_flow_rate": 0.0005, + "ets_pump_head": 10000, + "fan_design_flow_rate": 0.25, + "fan_design_head": 150 } }, { @@ -48,19 +56,38 @@ }, "ets_model": "Fifth Gen Heat Pump", "fifth_gen_ets_parameters": { - "supply_water_temperature_building": 15 + "supply_water_temperature_building": 15, + "chilled_water_supply_temp": 5, + "hot_water_supply_temp": 50, + "cop_heat_pump_heating": 2.5, + "cop_heat_pump_cooling": 3.5, + "ets_pump_flow_rate": 0.0005, + "ets_pump_head": 10000, + "fan_design_flow_rate": 0.25, + "fan_design_head": 150 } } ], "district_system": { "fifth_generation": { - "central_pump_parameters": { - "pump_design_head": 60000 + "horizontal_piping_parameters": { + "hydraulic_diameter": 0.089, + "insulation_thickness": 0.2, + "insulation_conductivity": 2.3, + "diameter_ratio": 11, + "roughness": 1e-06, + "rho_cp": 2139000, + "number_of_segments": 1, + "buried_depth": 1.5 }, "soil": { "conductivity": 2.0, "rho_cp": 2343493, "undisturbed_temp": 18.3 + }, + "central_pump_parameters": { + "pump_design_head": 60000, + "pump_flow_rate": 0.01 } } } diff --git a/tests/model_connectors/data/time_series_system_params_no_ets.json b/tests/model_connectors/data/time_series_system_params_no_ets.json deleted file mode 100644 index dd6b70c65..000000000 --- a/tests/model_connectors/data/time_series_system_params_no_ets.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "weather": "../../data_shared/USA_CA_San.Francisco.Intl.AP.724940_TMY3.mos", - "buildings": [ - { - "geojson_id": "5a6b99ec37f4de7f94020090", - "ets_model": "None", - "load_model": "time_series", - "load_model_parameters": { - "time_series": { - "filepath": "../../data_shared/time_series_large_office_2013_5B.mos", - "delta_temp_air_cooling": 10, - "delta_temp_air_heating": 18, - "has_liquid_heating": true, - "has_electric_heating": false, - "has_liquid_cooling": true, - "has_electric_cooling": false, - "temp_chw_supply": 7, - "temp_chw_return": 12, - "temp_hw_supply": 40, - "temp_hw_return": 35, - "temp_setpoint_cooling": 24, - "temp_setpoint_heating": 20 - } - } - } - ], - "district_system": { - "fourth_generation": { - "central_cooling_plant_parameters": { - "heat_flow_nominal": 7999, - "cooling_tower_fan_power_nominal": 4999, - "mass_chw_flow_nominal": 9.9, - "chiller_water_flow_minimum": 9.9, - "mass_cw_flow_nominal": 9.9, - "chw_pump_head": 300000, - "cw_pump_head": 200000, - "pressure_drop_chw_nominal": 5999, - "pressure_drop_cw_nominal": 5999, - "pressure_drop_setpoint": 49999, - "temp_setpoint_chw": 6, - "pressure_drop_chw_valve_nominal": 5999, - "pressure_drop_cw_pum_nominal": 5999, - "temp_air_wb_nominal": 24.9, - "temp_cw_in_nominal": 34.9, - "cooling_tower_water_temperature_difference_nominal": 6.56, - "delta_temp_approach": 3.25, - "ratio_water_air_nominal": 0.6 - }, - "central_heating_plant_parameters": { - "heat_flow_nominal": 8001, - "mass_hhw_flow_nominal": 1, - "boiler_water_flow_minimum": 0.1, - "pressure_drop_hhw_nominal": 55001, - "pressure_drop_setpoint": 50000, - "temp_setpoint_hhw": 54, - "pressure_drop_hhw_valve_nominal": 6001, - "chp_installed": false - } - } - } -} diff --git a/tests/model_connectors/test_time_series.py b/tests/model_connectors/test_time_series.py deleted file mode 100644 index adb007ed3..000000000 --- a/tests/model_connectors/test_time_series.py +++ /dev/null @@ -1,93 +0,0 @@ -# :copyright (c) URBANopt, Alliance for Sustainable Energy, LLC, and other contributors. -# See also https://github.com/urbanopt/geojson-modelica-translator/blob/develop/LICENSE.md - -from pathlib import Path - -import pytest -from modelica_builder.package_parser import PackageParser - -from geojson_modelica_translator.geojson.urbanopt_geojson import UrbanOptGeoJson -from geojson_modelica_translator.model_connectors.load_connectors.time_series import TimeSeries -from geojson_modelica_translator.scaffold import Scaffold -from geojson_modelica_translator.system_parameters.system_parameters import SystemParameters -from tests.base_test_case import TestCaseBase - - -class TimeSeriesModelConnectorSingleBuildingTest(TestCaseBase): - def setUp(self): - super().setUp() - - project_name = "time_series_no_ets" - self.data_dir, self.output_dir = self.set_up(Path(__file__).parent, project_name) - - # load in the example geojson with a single office building - filename = Path(self.data_dir) / "time_series_ex1.json" - self.gj = UrbanOptGeoJson(filename) - # scaffold the project ourselves - self.scaffold = Scaffold(self.output_dir, project_name) - self.scaffold.create() - - def test_build_model(self): - # load system parameter data - filename = Path(self.data_dir) / "time_series_system_params_no_ets.json" - sys_params = SystemParameters(filename) - - # now test the connector (independent of the larger geojson translator) - self.time_series = TimeSeries(sys_params, self.gj.buildings[0]) - - assert self.time_series is not None - assert self.time_series.building is not None - assert self.time_series.system_parameters.get_param("buildings")[0]["load_model"] == "time_series" - - # currently we must setup the root project before we can run to_modelica - package = PackageParser.new_from_template(self.scaffold.project_path, self.scaffold.project_name, order=[]) - package.save() - self.time_series.to_modelica(self.scaffold) - - self.root_path = (Path(self.scaffold.loads_path.files_dir) / "B5a6b99ec37f4de7f94020090").resolve() - files = [ - Path(self.root_path) / "TimeSeriesBuilding.mo", - ] - - # verify that there are only 2 files that matter (coupling and building) - for file in files: - assert Path(file).exists(), f"File does not exist: {file}" - - @pytest.mark.simulation - @pytest.mark.skip( - reason="There is no district in this model so the GMT never instantiates `delTAirHea` and compilation fails." - ) - def test_build_and_simulate_no_ets(self): - # load system parameter data - filename = Path(self.data_dir) / "time_series_system_params_no_ets.json" - sys_params = SystemParameters(filename) - - # now test the connector (independent of the larger geojson translator) - self.time_series = TimeSeries(sys_params, self.gj.buildings[0]) - - assert self.time_series is not None - assert self.time_series.building is not None - assert self.time_series.system_parameters.get_param("buildings")[0]["load_model"] == "time_series" - - # currently we must setup the root project before we can run to_modelica - package = PackageParser.new_from_template(self.scaffold.project_path, self.scaffold.project_name, order=[]) - package.save() - self.time_series.to_modelica(self.scaffold) - - self.root_path = (Path(self.scaffold.loads_path.files_dir) / "B5a6b99ec37f4de7f94020090").resolve() - files = [ - Path(self.root_path) / "TimeSeriesBuilding.mo", - ] - - # verify that there are only 2 files that matter (coupling and building) - for file in files: - assert Path(file).exists(), f"File does not exist: {file}" - - self.run_and_assert_in_docker( - f"{self.scaffold.project_name}.Loads.B5a6b99ec37f4de7f94020090.TimeSeriesBuilding", - file_to_load=self.scaffold.package_path, - run_path=self.scaffold.project_path, - start_time=17280000, # Day 200 (in seconds) (Run in summer to keep chiller happy) - stop_time=17366400, # For 1 day duration (in seconds) - step_size=3600, # (in seconds) - ) diff --git a/tests/model_connectors/test_time_series_heating_indirect.py b/tests/model_connectors/test_time_series_heating_indirect.py index c990f293c..f98f47305 100644 --- a/tests/model_connectors/test_time_series_heating_indirect.py +++ b/tests/model_connectors/test_time_series_heating_indirect.py @@ -39,6 +39,10 @@ def setUp(self): heating_indirect_system = HeatingIndirect(sys_params, geojson_load_id) ts_hi_coupling = Coupling(time_series_load, heating_indirect_system) + assert time_series_load is not None + assert time_series_load.building is not None + assert time_series_load.system_parameters.get_param("buildings")[0]["load_model"] == "time_series" + # create heated water stub for the ets heated_water_stub = NetworkHeatedWaterStub(sys_params) hi_hw_coupling = Coupling(heating_indirect_system, heated_water_stub) diff --git a/tests/system_parameters/data/system_params_1.json b/tests/system_parameters/data/system_params_1.json index bb54ee162..8ce5011ff 100644 --- a/tests/system_parameters/data/system_params_1.json +++ b/tests/system_parameters/data/system_params_1.json @@ -3,7 +3,45 @@ "buildings": [ { "geojson_id": "abcd1234", - "ets_model": "None" + "load_model": "time_series", + "load_model_parameters": { + "time_series": { + "filepath": "To be populated", + "delta_temp_air_cooling": 10, + "delta_temp_air_heating": 18, + "has_liquid_cooling": true, + "has_liquid_heating": true, + "has_electric_cooling": false, + "has_electric_heating": false, + "max_electrical_load": 0, + "temp_chw_return": 12, + "temp_chw_supply": 7, + "temp_hw_return": 35, + "temp_hw_supply": 40, + "temp_setpoint_cooling": 24, + "temp_setpoint_heating": 20 + } + }, + "ets_model": "Indirect Heating and Cooling", + "ets_indirect_parameters": { + "heat_flow_nominal": 8000, + "heat_exchanger_efficiency": 0.8, + "nominal_mass_flow_district": 0.5, + "nominal_mass_flow_building": 0.5, + "valve_pressure_drop": 6000, + "heat_exchanger_secondary_pressure_drop": 500, + "heat_exchanger_primary_pressure_drop": 500, + "cooling_supply_water_temperature_building": 7, + "heating_supply_water_temperature_building": 50, + "delta_temp_chw_building": 5, + "delta_temp_chw_district": 8, + "delta_temp_hw_building": 15, + "delta_temp_hw_district": 20, + "cooling_controller_y_max": 1, + "cooling_controller_y_min": 0, + "heating_controller_y_max": 1, + "heating_controller_y_min": 0 + } }, { "geojson_id": "defgh2345", diff --git a/tests/system_parameters/data/system_params_2.json b/tests/system_parameters/data/system_params_2.json index 6072e1e0f..4af601500 100644 --- a/tests/system_parameters/data/system_params_2.json +++ b/tests/system_parameters/data/system_params_2.json @@ -3,6 +3,25 @@ "buildings": [ { "geojson_id": "abcd1234", + "load_model": "time_series", + "load_model_parameters": { + "time_series": { + "filepath": "To be populated", + "delta_temp_air_cooling": 10, + "delta_temp_air_heating": 18, + "has_liquid_cooling": true, + "has_liquid_heating": true, + "has_electric_cooling": false, + "has_electric_heating": false, + "max_electrical_load": 0, + "temp_chw_return": 12, + "temp_chw_supply": 7, + "temp_hw_return": 35, + "temp_hw_supply": 40, + "temp_setpoint_cooling": 24, + "temp_setpoint_heating": 20 + } + }, "ets_model": "Indirect Heating and Cooling", "ets_indirect_parameters": { "heat_flow_nominal": 8000, diff --git a/tests/system_parameters/data/system_params_ghe.json b/tests/system_parameters/data/system_params_ghe.json index 745638bb4..aa3f9a741 100644 --- a/tests/system_parameters/data/system_params_ghe.json +++ b/tests/system_parameters/data/system_params_ghe.json @@ -29,8 +29,6 @@ "hot_water_supply_temp": 50, "cop_heat_pump_heating": 2.5, "cop_heat_pump_cooling": 3.5, - "pump_flow_rate": 0.01, - "pump_design_head": 150000, "ets_pump_flow_rate": 0.0005, "ets_pump_head": 10000, "fan_design_flow_rate": 0.25, @@ -107,6 +105,20 @@ } } ] + }, + "central_pump_parameters": { + "pump_design_head": 60000, + "pump_flow_rate": 0.01 + }, + "horizontal_piping_parameters": { + "hydraulic_diameter": 0.089, + "insulation_thickness": 0.2, + "insulation_conductivity": 2.3, + "diameter_ratio": 11, + "roughness": 1e-06, + "rho_cp": 2139000, + "number_of_segments": 1, + "buried_depth": 1.5 } } } diff --git a/tests/system_parameters/test_system_parameters.py b/tests/system_parameters/test_system_parameters.py index baa0840ff..5624c2a79 100644 --- a/tests/system_parameters/test_system_parameters.py +++ b/tests/system_parameters/test_system_parameters.py @@ -95,12 +95,13 @@ def test_errors(self): SystemParameters.loadd(incomplete_teaser_params) sp = SystemParameters.loadd(incomplete_teaser_params, validate_on_load=False) - assert len(sp.validate()) == 6 + assert "'None' is not one of ['Indirect Heating and Cooling', 'Fifth Gen Heat Pump']" in sp.validate() assert "'fraction_latent_person' is a required property" in sp.validate() assert "'temp_hw_supply' is a required property" in sp.validate() assert "'temp_setpoint_cooling' is a required property" in sp.validate() assert "'temp_setpoint_heating' is a required property" in sp.validate() assert "5 is not one of [1, 2, 3, 4]" in sp.validate() + assert len(sp.validate()) == 8 def test_get_param(self): data = { @@ -108,7 +109,26 @@ def test_get_param(self): "buildings": [ { "geojson_id": "asdf", - "ets_model": "None", + "ets_model": "Indirect Heating and Cooling", + "ets_indirect_parameters": { + "heat_flow_nominal": 8000, + "heat_exchanger_efficiency": 0.8, + "nominal_mass_flow_district": 0.5, + "nominal_mass_flow_building": 0.5, + "valve_pressure_drop": 6000, + "heat_exchanger_secondary_pressure_drop": 500, + "heat_exchanger_primary_pressure_drop": 500, + "cooling_supply_water_temperature_building": 7, + "heating_supply_water_temperature_building": 50, + "delta_temp_chw_building": 5, + "delta_temp_chw_district": 8, + "delta_temp_hw_building": 15, + "delta_temp_hw_district": 20, + "cooling_controller_y_max": 1, + "cooling_controller_y_min": 0, + "heating_controller_y_max": 1, + "heating_controller_y_min": 0, + }, "load_model": "rc", "load_model_parameters": { "rc": { @@ -133,7 +153,26 @@ def test_get_param(self): assert value == [ { "geojson_id": "asdf", - "ets_model": "None", + "ets_model": "Indirect Heating and Cooling", + "ets_indirect_parameters": { + "heat_flow_nominal": 8000, + "heat_exchanger_efficiency": 0.8, + "nominal_mass_flow_district": 0.5, + "nominal_mass_flow_building": 0.5, + "valve_pressure_drop": 6000, + "heat_exchanger_secondary_pressure_drop": 500, + "heat_exchanger_primary_pressure_drop": 500, + "cooling_supply_water_temperature_building": 7, + "heating_supply_water_temperature_building": 50, + "delta_temp_chw_building": 5, + "delta_temp_chw_district": 8, + "delta_temp_hw_building": 15, + "delta_temp_hw_district": 20, + "cooling_controller_y_max": 1, + "cooling_controller_y_min": 0, + "heating_controller_y_max": 1, + "heating_controller_y_min": 0, + }, "load_model": "rc", "load_model_parameters": { "rc": { @@ -158,7 +197,7 @@ def test_get_param_with_building_id(self): sdp = SystemParameters(filename) self.maxDiff = None value = sdp.get_param_by_id("abcd1234", "ets_model") - assert value == "None" + assert value == "Indirect Heating and Cooling" # grab the schema default value = sdp.get_param_by_id("defgh2345", "ets_model")