Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tanushree04 committed Jul 17, 2023
1 parent 8e1abca commit e3daa50
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,51 +86,36 @@
}
],
"district_system": {
"fifth_generation": {
"ghe_parameters": {
"version": "1.0",
"ghe_dir": "C:\\Users\\tcharan\\Desktop\\NRELWork\\Gitrepos\\geojson-modelica-translator\\tests\\management\\data\\sdk_project_scraps\\run\\baseline_scenario\\ghe_dir",
"fluid": {
"fluid_name": "Water",
"concentration_percent": 0.0,
"temperature": 20
},
"grout": {
"conductivity": 1.0,
"rho_cp": 3901000
},
"soil": {
"conductivity": 2.0,
"rho_cp": 2343493,
"undisturbed_temp": 18.3
},
"pipe": {
"inner_diameter": 0.0216,
"outer_diameter": 0.0266,
"shank_spacing": 0.0323,
"roughness": 1e-06,
"conductivity": 0.4,
"rho_cp": 1542000,
"arrangement": "singleutube"
},
"simulation": {
"num_months": 240
},
"geometric_constraints": {
"b_min": 3.0,
"b_max": 10.0,
"max_height": 135.0,
"min_height": 60.0,
"method": "rectangle"
},
"design": {
"method": "AREAPROPORTIONAL",
"flow_rate": 0.2,
"flow_type": "borehole",
"max_eft": 35.0,
"min_eft": 5.0
},
"ghe_specific_params": []
"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": 11,
"boiler_water_flow_minimum": 11,
"pressure_drop_hhw_nominal": 55001,
"pressure_drop_setpoint": 50000,
"temp_setpoint_hhw": 54,
"pressure_drop_hhw_valve_nominal": 6001,
"chp_installed": false
}
}
},
Expand Down
20 changes: 20 additions & 0 deletions tests/management/test_uo_des.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,29 @@ def test_cli_makes_model(self):
if (self.output_dir / project_name).exists():
rmtree(self.output_dir / project_name)

if (self.sys_param_path).exists():
(self.sys_param_path).unlink()

# run subprocess as if we're an end-user
res = self.runner.invoke(
cli,
[
'build-sys-param',
str(self.scenario_file_path.resolve()),
str(self.feature_file_path.resolve())
]
)

assert res.exit_code == 0

# If this file exists, the cli command ran successfully
assert (self.sys_param_path).exists()

sys_params_filepath = self.sys_param_path
geojson_filepath = self.feature_file_path

# TO DO : we need error handling when system parameter is created for fifth gen GHE system.
# Currently this method raises an error : 'dict object' has no attribute 'temp_setpoint_chw'
gmt = GeoJsonModelicaTranslator(
geojson_filepath,
sys_params_filepath,
Expand Down

0 comments on commit e3daa50

Please sign in to comment.