-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
93 changed files
with
231,548 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import json | ||
from pathlib import Path | ||
|
||
|
||
def load_loop_order(system_parameters_file: Path) -> list: | ||
"""Loads the loop order from a JSON file | ||
loop_order file is always saved next to the system parameters file | ||
:param system_parameters_file: Path to the system parameters file | ||
:return: list of building & ghe ids in loop order | ||
""" | ||
loop_order_path = Path(system_parameters_file).parent / "_loop_order.json" | ||
if not loop_order_path.is_file(): | ||
raise FileNotFoundError(f"Loop order file not found at {loop_order_path}") | ||
return json.loads(loop_order_path.read_text()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...odel_connectors/couplings/5G_templates/GroundCoupling_Borefield/ComponentDefinitions.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
// No components for ground coupling and borefield coupling | ||
// No components for borefield and ground coupling |
5 changes: 1 addition & 4 deletions
5
...r/model_connectors/couplings/5G_templates/GroundCoupling_Borefield/ConnectStatements.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
// Connections between ground coupling and distribution | ||
connect(dis.heatPortGro,{{ coupling.network.id }}.ports[1, :]) | ||
{% raw %}annotation (Line(points={{70,-20},{70,-36},{104,-36},{104,28},{150,28},{150,40}},color={191,0,0})); | ||
{% endraw %} | ||
// Borefield and ground coupling connections |
14 changes: 9 additions & 5 deletions
14
...onnectors/couplings/5G_templates/NetworkAmbientWaterStub_Borefield/ConnectStatements.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
// Borefield ambient coupling connections | ||
connect(supHeaWat_1.ports[1], {{ coupling.plant.id }}.port_a) | ||
{% raw %}annotation (Line(points={{-70,10},{-10,10}}, color={0,127,255})); | ||
{% endraw %}connect({{ coupling.plant.id }}.port_b, sinHeaWat.ports[1]) | ||
{% raw %}annotation (Line(points={{10,10},{60,10}}, color={0,127,255})); | ||
{% endraw %} | ||
{% for group_num in range(sys_params.district_system.fifth_generation.ghe_parameters.ghe_specific_params|length) %} | ||
{% if graph.get_ghe_id(coupling.id) == sys_params.district_system.fifth_generation.ghe_parameters.ghe_specific_params[group_num].ghe_id %} | ||
connect(supHeaWat_1.ports[{{ group_num+1 }}], {{ coupling.plant.id }}.port_a) | ||
{% raw %}annotation (Line(points={{-70,10},{-10,10}}, color={0,127,255})); | ||
{% endraw %}connect({{ coupling.plant.id }}.port_b, sinHeaWat.ports[{{ group_num+1 }}]) | ||
{% raw %}annotation (Line(points={{10,10},{60,10}}, color={0,127,255})); | ||
{% endraw %} | ||
{% endif %} | ||
{% endfor %} |
2 changes: 1 addition & 1 deletion
2
...ectors/couplings/5G_templates/NetworkDistributionPump_Borefield/ComponentDefinitions.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
// No components for borefield and ambient loop coupling | ||
// No components for network distribution pump and borefield coupling |
7 changes: 1 addition & 6 deletions
7
...onnectors/couplings/5G_templates/NetworkDistributionPump_Borefield/ConnectStatements.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1 @@ | ||
// Borefield ambient coupling connections | ||
connect(pumDis.port_b, {{ coupling.plant.id }}.port_a) | ||
{% raw %}annotation (Line(points={{-44,-50},{-44,-10},{-20,-10}},color={0,127,255})); | ||
{% endraw %}connect({{ coupling.plant.id }}.port_b, TOut.port_a) | ||
{% raw %}annotation (Line(points={{-10,10},{6,10}}, color={0,127,255})); | ||
{% endraw %} | ||
// Network distribution pump and borefield connections |
22 changes: 0 additions & 22 deletions
22
...gs/5G_templates/NetworkDistributionPump_NetworkDistributionPump/ComponentDefinitions.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,3 @@ | ||
inner parameter | ||
Buildings.Experimental.DHC.Examples.Combined.BaseClasses.DesignDataSeries | ||
datDes( | ||
nBui={{ sys_params.num_buildings }}, | ||
{% 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* | ||
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 }}, | ||
{% 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 ) %} | ||
{{ graph.couplings_by_type(coupling.network.id).load_couplings[building].load.id }}.ets.mSerWat_flow_nominal, | ||
{% endfor %} | ||
{{ graph.couplings_by_type(coupling.network.id).load_couplings[sys_params.num_buildings-1].load.id }}.ets.mSerWat_flow_nominal}, | ||
lDis={{ globals["lDis"] }}, | ||
lEnd={{ globals["lEnd"] }}) | ||
"Design data" | ||
{% raw %}annotation (Placement(transformation(extent={{-140,100},{-120,120}}))); | ||
parameter Boolean allowFlowReversalSer = true | ||
"Set to true to allow flow reversal in the service lines" | ||
annotation(Dialog(tab="Assumptions"), Evaluate=true); | ||
{% endraw %} |
14 changes: 1 addition & 13 deletions
14
...lings/5G_templates/NetworkDistributionPump_NetworkDistributionPump/ConnectStatements.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
// Connections for sub-components | ||
{% raw %}connect(dis.port_bDisSup, TIn.port_a) | ||
annotation (Line(points={{90,10},{110,10},{110,-20}}, color={0,127,255})); | ||
connect(TIn.port_b, pumDis.port_a) | ||
annotation (Line(points={{110,-40},{110,-80},{-44,-80},{-44,-70}}, color={0,127,255})); | ||
connect(expVes.ports[1], pumDis.port_a) | ||
{% raw %}connect(expVes.ports[1], pumDis.port_a) | ||
annotation (Line(points={{-20,-100},{-20,-80},{-44,-80},{-44,-70}}, color={0,127,255})); | ||
connect(conPum.y, gai.u) | ||
annotation (Line(points={{-98,-90},{-82,-90}}, color={0,0,127})); | ||
connect(gai.y, pumDis.m_flow_in) | ||
annotation (Line(points={{-58,-90},{-26,-90},{-26,-60},{-32,-60}}, color={0,0,127})); | ||
connect(dis.TOut, conPum.TMix) | ||
annotation (Line(points={{92,4},{128,4},{128,-112},{-134,-112},{-134,-84},{-122,-84}}, color={0,0,127})); | ||
connect(TIn.T, conPum.TSouIn[1]) | ||
annotation (Line(points={{121,-30},{128,-30},{128,-112},{-130,-112},{-130,-90},{-122,-90}}, color={0,0,127})); | ||
connect(TOut.port_b, dis.port_aDisSup) | ||
annotation (Line(points={{26,10},{50,10}}, color={0,127,255})); | ||
connect(TOut.T, conPum.TSouOut[1]) | ||
annotation (Line(points={{16,-1},{16,-112},{-126,-112},{-126,-96},{-122,-96}},color={0,0,127})); | ||
{% endraw %} |
1 change: 1 addition & 0 deletions
1
...l_connectors/couplings/5G_templates/TimeSeries_DesignDataSeries/ComponentDefinitions.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// No components for time series and design data coupling |
1 change: 1 addition & 0 deletions
1
...odel_connectors/couplings/5G_templates/TimeSeries_DesignDataSeries/ConnectStatements.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// No connections for time series and design data coupling |
17 changes: 1 addition & 16 deletions
17
...ctors/couplings/5G_templates/TimeSeries_NetworkDistributionPump/ComponentDefinitions.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1 @@ | ||
Buildings.Controls.OBC.CDL.Reals.Sources.Constant THeaWatSupMaxSet_{{ coupling.id }}(k=38 + | ||
273.15) "Heating water supply temperature set point - Maximum value" | ||
{% raw %}annotation (Placement(transformation(extent={{-120,40},{-100,60}}))); | ||
{% endraw %}Buildings.Controls.OBC.CDL.Reals.Sources.Constant TChiWatSupSet_{{ coupling.id }}(k=18 + 273.15) | ||
"Chilled water supply temperature set point" | ||
{% raw %}annotation (Placement(transformation(extent={{-120,10},{-100,30}}))); | ||
{% endraw %}Buildings.Controls.OBC.CDL.Reals.Sources.Constant THeaWatSupMinSet_{{ coupling.id }}(k=28 | ||
+ 273.15) "Heating water supply temperature set point - Minimum value" | ||
{% raw %}annotation (Placement(transformation(extent={{-120,70},{-100,90}}))); | ||
{% endraw %}Buildings.Controls.OBC.CDL.Reals.Sources.Constant THotWatSupSet_{{ coupling.id }}(k=63 + 273.15) | ||
"Hot water supply temperature set point" | ||
{% raw %}annotation (Placement(transformation(extent={{-120,-20},{-100,0}}))); | ||
{% endraw %}Buildings.Controls.OBC.CDL.Reals.Sources.Constant TColWat_{{ coupling.id }}(k=15 + 273.15) | ||
"Cold water temperature" | ||
{% raw %}annotation (Placement(transformation(extent={{-120,-50},{-100,-30}}))); | ||
{% endraw %} | ||
// No components for time series and network coupling |
15 changes: 0 additions & 15 deletions
15
...nnectors/couplings/5G_templates/TimeSeries_NetworkDistributionPump/ConnectStatements.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1 @@ | ||
// Timeseries load and network coupling connections | ||
connect(dis.ports_bCon[{{ sys_params.load_num }}], {{ coupling.load.id }}.port_aSerAmb) | ||
{% raw %}annotation (Line(points={{58,0},{58,6},{46,6},{46,30},{60,30}}, color={0,127,255})); | ||
{% endraw %}connect({{ coupling.load.id }}.port_bSerAmb, dis.ports_aCon[{{ sys_params.load_num }}]) | ||
{% raw %}annotation (Line(points={{80,30},{92,30},{92,6},{82,6},{82,0}}, color={0,127,255})); | ||
{% endraw %}connect(THeaWatSupMinSet_{{ coupling.id }}.y, {{ coupling.load.id }}.THeaWatSupMinSet) | ||
{% raw %}annotation (Line(points={{-98,80},{-80,80},{-80,100},{26,100},{26,39},{58,39}}, color={0,0,127})); | ||
{% endraw %}connect(THeaWatSupMaxSet_{{ coupling.id }}.y, {{ coupling.load.id }}.THeaWatSupMaxSet) | ||
{% raw %}annotation (Line(points={{-98,50},{34,50},{34,37},{58,37}}, color={0,0,127})); | ||
{% endraw %}connect(TChiWatSupSet_{{ coupling.id }}.y, {{ coupling.load.id }}.TChiWatSupSet) | ||
{% raw %}annotation (Line(points={{-98,20},{42,20},{42,35},{58,35}}, color={0,0,127})); | ||
{% endraw %}connect(THotWatSupSet_{{ coupling.id }}.y, {{ coupling.load.id }}.THotWatSupSet) | ||
{% raw %}annotation (Line(points={{-98,-10},{-66,-10},{-66,16},{52,16},{52,33},{58,33}}, color={0,0,127})); | ||
{% endraw %}connect(TColWat_{{ coupling.id }}.y, {{ coupling.load.id }}.TColWat) | ||
{% raw %}annotation (Line(points={{-98,-40},{-62,-40},{-62,4},{62,4},{62,18}}, color={0,0,127})); | ||
{% endraw %} |
16 changes: 16 additions & 0 deletions
16
...nnectors/couplings/5G_templates/TimeSeries_UnidirectionalSeries/ComponentDefinitions.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Buildings.Controls.OBC.CDL.Reals.Sources.Constant THeaWatSupMaxSet_{{ coupling.id }}(k=38 + | ||
273.15) "Heating water supply temperature set point - Maximum value" | ||
{% raw %}annotation (Placement(transformation(extent={{-120,40},{-100,60}}))); | ||
{% endraw %}Buildings.Controls.OBC.CDL.Reals.Sources.Constant TChiWatSupSet_{{ coupling.id }}(k=18 + 273.15) | ||
"Chilled water supply temperature set point" | ||
{% raw %}annotation (Placement(transformation(extent={{-120,10},{-100,30}}))); | ||
{% endraw %}Buildings.Controls.OBC.CDL.Reals.Sources.Constant THeaWatSupMinSet_{{ coupling.id }}(k=28 | ||
+ 273.15) "Heating water supply temperature set point - Minimum value" | ||
{% raw %}annotation (Placement(transformation(extent={{-120,70},{-100,90}}))); | ||
{% endraw %}Buildings.Controls.OBC.CDL.Reals.Sources.Constant THotWatSupSet_{{ coupling.id }}(k=63 + 273.15) | ||
"Hot water supply temperature set point" | ||
{% raw %}annotation (Placement(transformation(extent={{-120,-20},{-100,0}}))); | ||
{% endraw %}Buildings.Controls.OBC.CDL.Reals.Sources.Constant TColWat_{{ coupling.id }}(k=15 + 273.15) | ||
"Cold water temperature" | ||
{% raw %}annotation (Placement(transformation(extent={{-120,-50},{-100,-30}}))); | ||
{% endraw %} |
31 changes: 31 additions & 0 deletions
31
..._connectors/couplings/5G_templates/TimeSeries_UnidirectionalSeries/ConnectStatements.mopt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Timeseries load and network coupling connections | ||
{% for group_num in range(loop_order.number_of_loops) %} | ||
{% if graph.get_ghe_id(graph.couplings_by_type(coupling.network.id).plant_couplings[0].id) == loop_order.data[group_num].list_ghe_ids_in_group[0] %} | ||
{% for bldg_num in range(loop_order.data[group_num].list_bldg_ids_in_group|length) %} | ||
{% if loop_order.data[group_num].list_bldg_ids_in_group[bldg_num][0].isnumeric() %} | ||
{% set bldg_id = "TimeSerLoa_B" ~ loop_order.data[group_num].list_bldg_ids_in_group[bldg_num] %} | ||
{% else %} | ||
{% set bldg_id = "TimeSerLoa_" ~ loop_order.data[group_num].list_bldg_ids_in_group[bldg_num] %} | ||
{% endif %} | ||
{% if bldg_id == coupling.load.id %} | ||
connect({{ coupling.network.id }}.ports_bCon[{{ bldg_num+1 }}], {{ coupling.load.id }}.port_aSerAmb) | ||
{% raw %}annotation (Line(points={{58,0},{58,6},{46,6},{46,30},{60,30}}, color={0,127,255})); | ||
{% 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 %} | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} | ||
connect(THeaWatSupMinSet_{{ coupling.id }}.y, {{ coupling.load.id }}.THeaWatSupMinSet) | ||
{% raw %}annotation (Line(points={{-98,80},{-80,80},{-80,100},{26,100},{26,39},{58,39}}, color={0,0,127})); | ||
{% endraw %}connect(THeaWatSupMaxSet_{{ coupling.id }}.y, {{ coupling.load.id }}.THeaWatSupMaxSet) | ||
{% raw %}annotation (Line(points={{-98,50},{34,50},{34,37},{58,37}}, color={0,0,127})); | ||
{% endraw %}connect(TChiWatSupSet_{{ coupling.id }}.y, {{ coupling.load.id }}.TChiWatSupSet) | ||
{% raw %}annotation (Line(points={{-98,20},{42,20},{42,35},{58,35}}, color={0,0,127})); | ||
{% endraw %}connect(THotWatSupSet_{{ coupling.id }}.y, {{ coupling.load.id }}.THotWatSupSet) | ||
{% raw %}annotation (Line(points={{-98,-10},{-66,-10},{-66,16},{52,16},{52,33},{58,33}}, color={0,0,127})); | ||
{% endraw %}connect(TColWat_{{ coupling.id }}.y, {{ coupling.load.id }}.TColWat) | ||
{% raw %}annotation (Line(points={{-98,-40},{-62,-40},{-62,4},{62,4},{62,18}}, color={0,0,127})); | ||
{% endraw %} |
Oops, something went wrong.