Skip to content

Commit

Permalink
Simplify sys params to closer match reality (#659)
Browse files Browse the repository at this point in the history
* update borefield.py to accept a ghe_id when instantiated

* add debug logging to get_param_by_id method

* pass the list of ghes to borefield when instantiating in single_ghe test

* WIP new test for multi-ghe

* improve error message for missing g-function file

* additional g-function files to match the test sys-param files

* update borefield test to work in the multi-ghe paradigm

* improve help text in CLI

* more explicitly process different types of district sys-params

* clean up generation call, load loop order, load multiple ghes

* use new parameter for district_type argument

* load ghe loop order in the correct place

* move soil parameters out of ghe-specific and into all 5G parameters

* use new location of soil parameters

* don't require soil in the incorrect place, duh

* use new fifth_generation tag properly in 5G tests

* fix test sys-param files for 5G districts

* add graceful error message when sizing output from TN is not found

* remove outdated TODO message

* remove unused test sys-param file

* comment noisy debug log lines

* update geojson and sys_param paths

* add project folder for testing multi-ghe

* update building load profiles

* modify paths pointing to mos files and ghe_dir

* add ghe sizing results to ghe_dir

* move soil and add horizontal piping parameters

* pre-commit formatting

* read the loop order file for later use

* py file for new distribution template

* new distribution template file

* new distribution template instance file

* correct name

* correct name

* take out dis and temp sensors

* move dis and sensor connections elsewhere

* coupling no longer needed

* new distribution couplings

* read loop_order in district.py for use in couplings

* remove accidental `endraw` tag in jinja template

* new placeholder coupling templates

* WIP: first steps in reading & handling multiple ghes during regular usage

* update dependencies

* linting & formatting

* rename loop order file

* update loop order file name

* change how gmt access loop order

* distribution network coupling for multi-ghe

* fix and add _loop_order.json files where needed for tests

* fix call to _loop_order.json in multi_ghe test

* move endraw tags and use python indenting for modelica logic

* make loop_order available the right way, at the right time

* use number_of_loops in network instance

* allow more statements in a method

* hacky way to ensure we only include one GroundTemperatureResponse in the package_order

* Rename coupling

* Modify nSeg for ground coupling

* pipe lengths in dis instance

* remove repeated mo files

* update nSou to be number of ghes

* delete unneeded coupling

* modify multi-ghe test

* rename coupling dir

* put brackets in proper place in unidirectionalseries template

* update test loop_order file to be current style

* fix iteration through _loop_order in multi-ghe test

* rename multi-ghe tests for clarity in debugging

* util function to parse loop_order.json

* use util function to access loop_order info

* use loop_order data in ground_coupling template

* clean up main gmt workflow now that models can access loop_order

* add endraw tags to template

* remove accidental jinja tags from code

* add python spacing to code inside jinja tags

* empty coupling between time series and network distribution pump

* remove unnecessary statement

* linting & formatting

* call out `id` instead of `ghe_id`

* add additional coupling to pass info

* use parameter directly from sys_params

* only look for loop_order if sys params have ghe parameters

* another blank 5G coupling

* enable build tests for GMT_Lib that should always have been active

* enforce Path type to load loop_order

* fix typo in comment

* linting & formatting

* remove unneeded mo file

* add new function for getting ghe_id

* fix jinja bugs

* change model name

* new function for getting the other model in the coupling

* apply to connection pipe mass flow rates

* fix coupling between borefield and dis

* fix coupling between dis and ground coupling

* linting

* use ghe_id for borefield id & name

* add comment for loading loop_order

* continue using uuid for borefield

* new template for district data

* coupling for district data

* move datDes instance somewhere else

* use loop_data to locate building order in loop for coupling

* add connection between dis and next TIn

* add additional couplings

* this makes sure the model simulates

* update geojson & sys-params with ghe sizes to meet load

* hack to only keep a single autosize instance in Networks.order

* linting & formatting

* align with how load_base name buildings

* fix for a single-ghe loop

* add additional instances and couplings

* update content for single ghe test

* change ghe id to align with sys_params

* fix for multi ghes

* expand number of ports for multi ghes

* fix dict lookup in instance template

* allow more statements in ruff

* linting & formatting

* increase central pump head for the multi-ghe test

* reduce flow rate per borehole

* only simulate multi-ghe with Dymola, temporarily

* clarify comment in test_uo_des.py

* fix couplings so test_uo_des won't break

* formatting

* copy scenario file to test 13-building data dir

* ignore new files generated by updated CLI test

* Revert "ignore new files generated by updated CLI test"

This reverts commit 10ca170.

* Revert "copy scenario file to test 13-building data dir"

This reverts commit 22b2061.

* remove pump_design_head from individual ets properties

* remove TN output that isn't necessary for our tests

* clean up sys-params

* put district parameters inside the correct layer in test sys-param files

* remove non-sensical `central_pump_parameters` from 4G test files

* don't require  in 4G schemas

* require at least one central plant for 4G schemas

* remove one more unnecessary line from 4G schema

* remove one more bit mistakenly missed when fixing merge conflicts

* set more validation requirements in schema

* update test sys-param files to conform to newly tightened schema requirements

* update test to look for new sys-param value

* require ETS parameters in schema

* remove old tests that no longer make sense. Functionality captured in other tests

* update sys-param tests to match new schema

---------

Co-authored-by: Jing Wang <[email protected]>
  • Loading branch information
vtnate and JingWang-CUB authored Oct 1, 2024
1 parent f8cd8d0 commit 40525ac
Show file tree
Hide file tree
Showing 15 changed files with 328 additions and 312 deletions.
226 changes: 144 additions & 82 deletions geojson_modelica_translator/system_parameters/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
]
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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.",
Expand Down Expand Up @@ -1094,7 +1131,10 @@
"description": "Nominal Capacity (var)",
"type": "number"
}
}
},
"required": [
"nominal_capacity"
]
},
"substation_parameters": {
"description": "Substation parameters used by the microgrid model.",
Expand Down Expand Up @@ -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": [
Expand All @@ -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": [
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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"
]
}
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -192,7 +187,8 @@
]
},
"central_pump_parameters": {
"pump_design_head": 60000
"pump_design_head": 60000,
"pump_flow_rate": 0.01
}
}
},
Expand Down
3 changes: 0 additions & 3 deletions management/data/baseline_sys_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@
"temp_setpoint_hhw": 68,
"pressure_drop_hhw_valve_nominal": 6001,
"chp_installed": false
},
"central_pump_parameters": {
"pump_design_head": 60000
}
}
},
Expand Down
27 changes: 17 additions & 10 deletions tests/data_shared/system_params_des_5g.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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
}
}
}
Expand Down
Loading

0 comments on commit 40525ac

Please sign in to comment.