Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify templates to support branched off configuration of GHEs #669

Merged
merged 50 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
9522f55
use MBLv11 paths in templates
vtnate Aug 9, 2024
336ad05
experiment with new Ubuntu and OM versions
vtnate Jun 28, 2024
f303b72
use OM 1.23.0 with Ubuntu 20 in Dockerfile
vtnate Jul 2, 2024
97f342a
update dependencies
vtnate Aug 9, 2024
25d3b32
more code/template changes to work with MBLv11
vtnate Aug 9, 2024
94f5495
update Dockerfile to load new MBL version
vtnate Aug 9, 2024
e914a4f
go back to what OM has in their Dockerfile (mostly)
vtnate Aug 12, 2024
496b047
cleaned up Dockerfile after Netskope shenanigans
vtnate Aug 15, 2024
483c968
even newer dependency versions [skip ci]
vtnate Aug 15, 2024
66a5416
document the MBL version in the runner readme
vtnate Aug 15, 2024
2a161a0
update mbl version in CI
vtnate Aug 20, 2024
c1ad333
bump gmt version, and use modelica-builder branch
vtnate Oct 8, 2024
c9a1625
bump dependencies
vtnate Oct 8, 2024
4caaa59
Merge branch 'bump-om' into mblv11
vtnate Oct 8, 2024
df64532
Merge branch 'bump-om' into mblv11
vtnate Oct 9, 2024
3af6fa0
update modelica runner readme
vtnate Oct 9, 2024
e531c3c
point to docker image that only exists on my computer
vtnate Oct 9, 2024
b28dd7e
read mbl version from utils function
vtnate Oct 9, 2024
7572da7
bump pre-commit hook versions
vtnate Oct 9, 2024
236d0e3
linting
vtnate Oct 9, 2024
b96a132
bump dependencies
vtnate Oct 9, 2024
87c47fa
redeclare ETS type and update variable name to fix broken tests due t…
JingWang-CUB Oct 14, 2024
914742b
change the required mo file name
JingWang-CUB Oct 14, 2024
9b81d3b
replace the mo file with the new version in MBLv11
JingWang-CUB Oct 14, 2024
5e8b596
update function path
JingWang-CUB Oct 14, 2024
9bd9400
new pump controller parameter input
JingWang-CUB Oct 14, 2024
369761a
connect statements for new pump controller
JingWang-CUB Oct 14, 2024
2e5034d
remove parameters no longer needed
JingWang-CUB Oct 14, 2024
a770515
additional parameters required by distribution 2 pipe
JingWang-CUB Oct 14, 2024
eaa9b68
update path for terUni
JingWang-CUB Oct 14, 2024
f208aad
update paths and add dis
JingWang-CUB Oct 14, 2024
f7e7b8d
new required parameter for pump control
JingWang-CUB Oct 14, 2024
1e365c1
pre-commit changes
JingWang-CUB Oct 14, 2024
1d595dc
merge mblv11 changes
JingWang-CUB Oct 22, 2024
d94ddf7
change class of the district pump
JingWang-CUB Oct 22, 2024
7738978
update mass flow rate in datDes
JingWang-CUB Oct 28, 2024
31b855c
add pump and controller to borefield instance
JingWang-CUB Oct 28, 2024
77446c2
modify medium and parameter redeclaration
JingWang-CUB Nov 4, 2024
36c1c95
add district supply and return sensors for control
JingWang-CUB Nov 4, 2024
af148ef
connect statements for each borefield
JingWang-CUB Nov 4, 2024
308daed
pre-commit changes
JingWang-CUB Nov 4, 2024
f4a1ac1
rename file
JingWang-CUB Nov 5, 2024
5a310a5
remove unused input file
JingWang-CUB Nov 5, 2024
7fedb52
use renamed input file
JingWang-CUB Nov 5, 2024
87ca99d
fix class name
JingWang-CUB Nov 5, 2024
530c249
bug fix
JingWang-CUB Nov 5, 2024
4c146a5
fix connection of QCoo_flow
JingWang-CUB Nov 6, 2024
0616123
increase pump head for multi-ghe
JingWang-CUB Nov 6, 2024
f7f8003
remove test_borefield and the corresponding coupling
JingWang-CUB Nov 11, 2024
aec5cc4
merge branch bump-om
JingWang-CUB Nov 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
{% endraw %}
connect({{ coupling.load.id }}.port_bSerAmb, {{ coupling.network.id }}.ports_aCon[{{ bldg_num+1 }}])
{% raw %}annotation (Line(points={{80,30},{92,30},{92,6},{82,6},{82,0}}, color={0,127,255}));
{% endraw %}connect({{ coupling.load.id }}.QCoo_flow, conPum.QCoo_flow[{{ bldg_num+1 }}])
{% endraw %}{% set sum_bldg = loop_order.data[:group_num]|map(attribute='list_bldg_ids_in_group')|map('length')|sum %}
connect({{ coupling.load.id }}.QCoo_flow, conPum.QCoo_flow[{{ sum_bldg+bldg_num+1 }}])
{% raw %}annotation (Line(points={{67,-12},{128,-12},{128,-112},{-124,-112},{-124,-96},{-121.692,-96}}, color={0,0,127}));
{% endraw %}
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ redeclare final package Medium = {{ globals.medium_w }},
m_flow_nominal=datDes.mPumDis_flow_nominal)
{% raw %}annotation (Placement(transformation(extent={{-10,10},{10,-10}},rotation=0,origin={16,10})));
{% endraw %}
Buildings.Fluid.Sensors.TemperatureTwoPort TDisSup_{{ coupling.id }}(
redeclare final package Medium = {{ globals.medium_w }},
m_flow_nominal=datDes.mPumDis_flow_nominal)
{% raw %}annotation (Placement(transformation(extent={{-10,10},{10,-10}},rotation=0,origin={34,10})));
{% endraw %}Buildings.Fluid.Sensors.TemperatureTwoPort TDisRet_{{ coupling.id }}(
redeclare final package Medium = {{ globals.medium_w }},
m_flow_nominal=datDes.mPumDis_flow_nominal)
{% raw %}annotation (Placement(transformation(extent={{-10,10},{10,-10}},rotation=-90,origin={100,-30})));
{% endraw %}
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,55 @@
{% raw %}annotation (Line(points={{-44,-50},{-44,10},{-40,10}}, color={0,127,255}));
{% endraw %}
{% endif %}
connect(TIn_{{ coupling.id }}.port_b, {{ coupling.plant.id }}.port_a)
connect(TIn_{{ coupling.id }}.port_b, conSto_{{ coupling.plant.id }}.port_aDis)
{% raw %}annotation (Line(points={{-20,10},{-10,10}}, color={0,127,255}));
{% endraw %}connect({{ coupling.plant.id }}.port_b, TOut_{{ coupling.id }}.port_a)
{% endraw %}connect(conSto_{{ coupling.plant.id }}.port_bDis, TOut_{{ coupling.id }}.port_a)
{% raw %}annotation (Line(points={{10,10},{6,10}}, color={0,127,255}));
{% endraw %}connect(TOut_{{ coupling.id }}.port_b, {{ coupling.network.id }}.port_aDisSup)
{% raw %}annotation (Line(points={{26,10},{38,10},{38,-10},{50,-10}}, color={0,127,255}));
{% endraw %}connect(conSto_{{ coupling.plant.id }}.port_bCon, pumSto_{{ coupling.plant.id }}.port_a)
{% raw %}annotation (Line(points={{-18,20},{-18,32},{-50,32},{-50,50},{-40,50}}, color={0,127,255}));
{% endraw %}connect(pumSto_{{ coupling.plant.id }}.port_b, {{ coupling.plant.id }}.port_a)
{% raw %}annotation (Line(points={{-20,50},{-10,50}}, color={0,127,255}));
{% endraw %}connect({{ coupling.plant.id }}.port_b, conSto_{{ coupling.plant.id }}.port_aCon)
{% raw %}annotation (Line(points={{10,50},{20,50},{20,32},{-12,32},{-12,20}}, color={0,127,255}));
{% endraw %}connect(TOut_{{ coupling.id }}.port_b, TDisSup_{{ coupling.id }}.port_a)
{% raw %}annotation (Line(points={{20,10},{24,10}}, color={0,127,255}));
{% endraw %}connect(TDisSup_{{ coupling.id }}.port_b, {{ coupling.network.id }}.port_aDisSup)
{% raw %}annotation (Line(points={{44,10},{50,10}}, color={0,127,255}));
{% endraw %}connect({{ coupling.network.id }}.port_bDisSup, TDisRet_{{ coupling.id }}.port_a)
{% raw %}annotation (Line(points={{90,10},{100,10},{100,-20}}, color={0,127,255}));
{% endraw %}
{% for group_num in range(loop_order.number_of_loops) %}
{% if graph.get_ghe_id(coupling.id) == loop_order.data[group_num].list_ghe_ids_in_group[0] %}
{% if group_num == loop_order.number_of_loops-1 %}
connect({{ coupling.network.id }}.port_bDisSup, pumDis.port_a)
{% raw %}annotation (Line(points={{90,-10},{110,-10},{110,-20}}, color={0,127,255}));
connect(TDisRet_{{ coupling.id }}.port_b, pumDis.port_a)
{% raw %}annotation (Line(points={{100,-40},{100,-74},{-72,-74},{-72,-70}}, color={0,127,255}));
{% endraw %}
{% else %}
{% set ground_id = graph.couplings_by_type(coupling.network.id).network_couplings[0].network.id %}
{% set next_borefield_id = graph.couplings_by_type(ground_id).plant_couplings[group_num+1].plant.id %}
{% set next_dis_id = graph.couplings_by_type(next_borefield_id).network_couplings[0].network.id %}
connect({{ coupling.network.id }}.port_bDisSup, TIn_{{ graph.couplings_by_type(next_dis_id).plant_couplings[0].id }}.port_a)
connect(TDisRet_{{ coupling.id }}.port_b, TIn_{{ graph.couplings_by_type(next_dis_id).plant_couplings[0].id }}.port_a)
{% raw %}annotation (Line(points={{-44,-50},{-44,10},{-40,10}}, color={0,127,255}));
{% endraw %}
{% endif %}
{% endif %}
{% endfor %}
// control related connections
connect(conBor_{{ coupling.plant.id }}.y, gai1_{{ coupling.plant.id }}.u)
{% raw %}annotation (Line(points={{-38.4615,90},{-32,90}}, color={0,0,127}));
{% endraw %}connect(gai1_{{ coupling.plant.id }}.y, pumSto_{{ coupling.plant.id }}.m_flow_in)
{% raw %}annotation (Line(points={{-8,90},{0,90},{0,70},{-30,70},{-30,62}}, color={0,0,127}));
{% endraw %}connect({{ coupling.plant.id }}.TBorAve, conBor_{{ coupling.plant.id }}.TSou)
{% raw %}annotation (Line(points={{11,54.4},{22,54.4},{22,70},{-78,70},{-78,93},{-61.5385,93}}, color={0,0,127}));
{% endraw %}connect(TIn_{{ coupling.id }}.T, conBor_{{ coupling.plant.id }}.TSouIn)
{% raw %}annotation (Line(points={{-58,-1},{-58,-4},{-78,-4},{-78,97},{-61.5385,97}}, color={0,0,127}));
{% endraw %}connect(TOut_{{ coupling.id }}.T, conBor_{{ coupling.plant.id }}.TSouOut)
{% raw %}annotation (Line(points={{10,-1},{10,-4},{-78,-4},{-78,89},{-61.5385,89}}, color={0,0,127}));
{% endraw %}connect(TDisSup_{{ coupling.id }}.T, conBor_{{ coupling.plant.id }}.TSupDis)
{% raw %}annotation (Line(points={{34,-1},{34,-30},{-78,-30},{-78,82},{-61.5385,82}}, color={0,0,127}));
{% endraw %}connect(TDisRet_{{ coupling.id }}.T, conBor_{{ coupling.plant.id }}.TRetDis)
{% raw %}annotation (Line(points={{89,-30},{-78,-30},{-78,85},{-61.5385,85}}, color={0,0,127}));
{% endraw %}
{% for group_num in range(loop_order.number_of_loops) %}
{% if graph.get_ghe_id(coupling.id) == loop_order.data[group_num].list_ghe_ids_in_group[0] %}
{% if group_num == 0 %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
inner parameter
{{ model.modelica_type }} {{ model.id }}(
nBui={{ sys_params.num_buildings }},
mPumDis_flow_nominal=max(datDes.mCon_flow_nominal) + datDes.mSto_flow_nominal,
mPipDis_flow_nominal=datDes.mPumDis_flow_nominal,
{% if sys_params.district_system.fifth_generation.ghe_parameters.design.flow_type == 'borehole' %}
mPumDis_flow_nominal={{ sys_params.district_system.fifth_generation.ghe_parameters.design.flow_rate*
mSto_flow_nominal={{ sys_params.district_system.fifth_generation.ghe_parameters.design.flow_rate*
sys_params.district_system.fifth_generation.ghe_parameters.ghe_specific_params[0].borehole.number_of_boreholes }},
{% else %}
mPumDis_flow_nominal={{ sys_params.district_system.fifth_generation.ghe_parameters.design.flow_rate }},
mSto_flow_nominal={{ sys_params.district_system.fifth_generation.ghe_parameters.design.flow_rate }},
{% endif %}
mPipDis_flow_nominal=datDes.mPumDis_flow_nominal,
dp_length_nominal=250,
final mCon_flow_nominal={
{% for building in range( sys_params.num_buildings - 1 ) %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
// ambient loop pump
Buildings.Fluid.Movers.FlowControlled_m_flow pumDis(
Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumDis(
redeclare final package Medium = {{ globals.medium_w }},
allowFlowReversal=true,
redeclare Buildings.Fluid.Movers.Data.Generic per,
inputType=Buildings.Fluid.Types.InputType.Continuous,
use_inputFilter=true,
riseTime=20,
m_flow_nominal=datDes.mPumDis_flow_nominal,
dp_nominal={{ sys_params.district_system.fifth_generation.central_pump_parameters.pump_design_head }})
"Distribution pump"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
parameter Modelica.Units.SI.Length dhSto_{{ model.id }}(fixed=false,start=0.05,min=0.01)
"Hydraulic diameter of the distribution pipe before each connection";
Buildings.DHC.ETS.BaseClasses.Pump_m_flow pumSto_{{ model.id }}(
dp_nominal=30000,
redeclare final package Medium = {{ globals.medium_w }},
m_flow_nominal=datDes.mSto_flow_nominal)
"Bore field pump"
{% raw %}annotation (Placement(transformation(extent={{10,10},{-10,-10}},rotation=180,origin={-30,50})));
{% endraw %}
Buildings.DHC.Networks.Connections.Connection1Pipe_R conSto_{{ model.id }}(
redeclare final package Medium = {{ globals.medium_w }},
final mDis_flow_nominal=datDes.mPipDis_flow_nominal,
final mCon_flow_nominal=datDes.mSto_flow_nominal,
lDis=0,
final allowFlowReversal=allowFlowReversalSer,
dhDis=dhSto_{{ model.id }})
"Connection to the bore field (pressure drop lumped in plant and network model)"
{% raw %}annotation (Placement(transformation(extent={{-10,-10},{10,10}},rotation=0,origin={-18,10})));
{% endraw %}
Buildings.DHC.Networks.Controls.AgentPump1Pipe conBor_{{ model.id }}(
yPumMin=0,
dToff=0.45,
k=1.1,
Ti=600,
uLowHea=0.25,
uHighHea=0.5,
uLowCoo=0.15,
uHighCoo=0.4) "Borefield GHE pump controller"
{% raw %}annotation (Placement(transformation(extent={{-60,80},{-40,100}})));
{% endraw %}
Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gai1_{{ model.id }}(k=datDes.mSto_flow_nominal)
"Scale with nominal mass flow rate"
{% raw %}annotation (Placement(transformation(extent={{-30,80},{-10,100}})));
{% endraw %}
{{ model.modelica_type }} {{ model.id }}
{% raw %}annotation (Placement(transformation(extent={{-10,0},{10,20}})));
{% endraw %}
11 changes: 0 additions & 11 deletions tests/model_connectors/data/_loop_order_2.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@
},
"central_pump_parameters": {
"pump_flow_rate": 0.01,
"pump_design_head": 10000000
"pump_design_head": 600000000
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"district_system": {
"fifth_generation": {
"central_pump_parameters": {
"pump_design_head": 60000,
"pump_design_head": 300000,
"pump_flow_rate": 0.01
},
"horizontal_piping_parameters": {
Expand Down
58 changes: 0 additions & 58 deletions tests/model_connectors/test_borefield.py

This file was deleted.

2 changes: 1 addition & 1 deletion tests/model_connectors/test_district_single_ghe.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def setUp(self):
self.gj = UrbanOptGeoJson(geojson_filename)

# load system parameter data
sys_param_filename = Path(self.data_dir) / "system_params_ghe_3.json"
sys_param_filename = Path(self.data_dir) / "system_params_ghe_2.json"
sys_params = SystemParameters(sys_param_filename)

# read the loop order and create building groups
Expand Down