diff --git a/.cspell.json b/.cspell.json
index 45a1f1e31..81a8d98f9 100644
--- a/.cspell.json
+++ b/.cspell.json
@@ -2,6 +2,7 @@
"version": "0.2",
"language": "en",
"words": [
+ "armhf",
"autoload",
"borefield",
"buildingspy",
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d26d13f19..5bfab2687 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -19,7 +19,7 @@ jobs:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.12"]
test_env: [python, docs, mypy]
- mbl_tag: [v10.0.0]
+ mbl_tag: [v11.0.0]
exclude:
# only test mypy on linux for all versions of python
- os: windows-latest
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 618b1092d..eec19b4b9 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -8,7 +8,7 @@ exclude: |
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v4.6.0
+ rev: v5.0.0
hooks:
- id: check-ast
- id: check-added-large-files
@@ -44,7 +44,7 @@ repos:
pass_filenames: false
# https://docs.astral.sh/ruff/integrations/#pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.6.8
+ rev: v0.6.9
hooks:
# Run the linter
- id: ruff
diff --git a/geojson_modelica_translator/model_connectors/couplings/5G_templates/NetworkAmbientWaterStub_Borefield/ComponentDefinitions.mopt b/geojson_modelica_translator/model_connectors/couplings/5G_templates/NetworkAmbientWaterStub_Borefield/ComponentDefinitions.mopt
deleted file mode 100644
index fd8f493b3..000000000
--- a/geojson_modelica_translator/model_connectors/couplings/5G_templates/NetworkAmbientWaterStub_Borefield/ComponentDefinitions.mopt
+++ /dev/null
@@ -1 +0,0 @@
- // No components for borefield and ambient water stub coupling
diff --git a/geojson_modelica_translator/model_connectors/couplings/5G_templates/NetworkAmbientWaterStub_Borefield/ConnectStatements.mopt b/geojson_modelica_translator/model_connectors/couplings/5G_templates/NetworkAmbientWaterStub_Borefield/ConnectStatements.mopt
deleted file mode 100644
index c73ee9ea6..000000000
--- a/geojson_modelica_translator/model_connectors/couplings/5G_templates/NetworkAmbientWaterStub_Borefield/ConnectStatements.mopt
+++ /dev/null
@@ -1,10 +0,0 @@
-// Borefield ambient coupling connections
-{% 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 %}
diff --git a/geojson_modelica_translator/model_connectors/couplings/5G_templates/TimeSeries_UnidirectionalSeries/ConnectStatements.mopt b/geojson_modelica_translator/model_connectors/couplings/5G_templates/TimeSeries_UnidirectionalSeries/ConnectStatements.mopt
index cc8755118..f2af52c6c 100644
--- a/geojson_modelica_translator/model_connectors/couplings/5G_templates/TimeSeries_UnidirectionalSeries/ConnectStatements.mopt
+++ b/geojson_modelica_translator/model_connectors/couplings/5G_templates/TimeSeries_UnidirectionalSeries/ConnectStatements.mopt
@@ -13,6 +13,9 @@
{% 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 %}{% 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 %}
{% endfor %}
diff --git a/geojson_modelica_translator/model_connectors/couplings/5G_templates/UnidirectionalSeries_Borefield/ComponentDefinitions.mopt b/geojson_modelica_translator/model_connectors/couplings/5G_templates/UnidirectionalSeries_Borefield/ComponentDefinitions.mopt
index 073427a3e..3a4105f1e 100644
--- a/geojson_modelica_translator/model_connectors/couplings/5G_templates/UnidirectionalSeries_Borefield/ComponentDefinitions.mopt
+++ b/geojson_modelica_translator/model_connectors/couplings/5G_templates/UnidirectionalSeries_Borefield/ComponentDefinitions.mopt
@@ -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 %}
diff --git a/geojson_modelica_translator/model_connectors/couplings/5G_templates/UnidirectionalSeries_Borefield/ConnectStatements.mopt b/geojson_modelica_translator/model_connectors/couplings/5G_templates/UnidirectionalSeries_Borefield/ConnectStatements.mopt
index b0f9972c3..70a11caf2 100644
--- a/geojson_modelica_translator/model_connectors/couplings/5G_templates/UnidirectionalSeries_Borefield/ConnectStatements.mopt
+++ b/geojson_modelica_translator/model_connectors/couplings/5G_templates/UnidirectionalSeries_Borefield/ConnectStatements.mopt
@@ -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 %}
diff --git a/geojson_modelica_translator/model_connectors/districts/templates/DistrictEnergySystem5G.mot b/geojson_modelica_translator/model_connectors/districts/templates/DistrictEnergySystem5G.mot
index ba4fdaee3..d4d04bfb6 100644
--- a/geojson_modelica_translator/model_connectors/districts/templates/DistrictEnergySystem5G.mot
+++ b/geojson_modelica_translator/model_connectors/districts/templates/DistrictEnergySystem5G.mot
@@ -13,7 +13,7 @@ model DistrictEnergySystem
parameter Modelica.Units.SI.TemperatureDifference delHeaWatTemDis(displayUnit="degC")=12;
parameter Modelica.Units.SI.TemperatureDifference delHeaWatTemBui(displayUnit="degC")=5;
parameter Integer numberofchillers = 2;
- inner parameter Buildings.Experimental.DHC.Examples.Combined.BaseClasses.DesignDataSeries datDes(
+ inner parameter Buildings.DHC.Examples.Combined.BaseClasses.DesignDataSeries datDes(
nBui=1,
mPumDis_flow_nominal=95,
mPipDis_flow_nominal=95,
diff --git a/geojson_modelica_translator/model_connectors/load_connectors/teaser.py b/geojson_modelica_translator/model_connectors/load_connectors/teaser.py
index 2872b80c0..b72137741 100644
--- a/geojson_modelica_translator/model_connectors/load_connectors/teaser.py
+++ b/geojson_modelica_translator/model_connectors/load_connectors/teaser.py
@@ -264,21 +264,17 @@ def post_process(self, scaffold, keep_original_models=False):
],
)
- fraction_latent_person = self.system_parameters.get_param(
- "buildings.load_model_parameters.rc.fraction_latent_person"
- )
+ fraction_latent_person = (
+ self.system_parameters.get_param("buildings.load_model_parameters.rc.fraction_latent_person") or 1.25
+ ) # Fraction latent of sensible persons load = 0.8 for home, 1.25 for office.
- use_moisture_balance = self.system_parameters.get_param(
- "buildings.load_model_parameters.rc.use_moisture_balance"
- )
- if use_moisture_balance is None:
- use_moisture_balance = "false"
+ use_moisture_balance = (
+ self.system_parameters.get_param("buildings.load_model_parameters.rc.use_moisture_balance") or "false"
+ ) # If true, input connector QLat_flow is enabled and room air computes moisture balance.
- # TODO: Determine why we are looking for use_moisture_balance & nPorts in the sys-param file.
+ # TODO: Determine why we are looking for these values in the sys-param file.
# Is this just an allowance for future flexibility?
- n_ports = self.system_parameters.get_param("buildings.load_model_parameters.rc.nPorts")
- if n_ports is None:
- n_ports = 1
+ n_ports = self.system_parameters.get_param("buildings.load_model_parameters.rc.nPorts") or 1
# create a new parameter for fraction latent person
mofile.add_parameter(
diff --git a/geojson_modelica_translator/model_connectors/load_connectors/templates/SpawnBuilding.mot b/geojson_modelica_translator/model_connectors/load_connectors/templates/SpawnBuilding.mot
index 845518326..cabe5f9c7 100644
--- a/geojson_modelica_translator/model_connectors/load_connectors/templates/SpawnBuilding.mot
+++ b/geojson_modelica_translator/model_connectors/load_connectors/templates/SpawnBuilding.mot
@@ -1,7 +1,7 @@
within {{project_name}}.Loads.{{model_name}};
model building
"n-zone EnergyPlus building model based on URBANopt GeoJSON export, with distribution pumps"
- extends Buildings.Experimental.DHC.Loads.BaseClasses.PartialBuilding(
+ extends Buildings.DHC.Loads.BaseClasses.PartialBuilding(
redeclare package Medium=Buildings.Media.Water,
final have_eleHea={{ data['nominal_values']['has_electric_heating'] }},
final have_eleCoo={{ data['nominal_values']['has_electric_cooling'] }},
@@ -94,7 +94,7 @@ model building
Buildings.Controls.OBC.CDL.Reals.MultiSum mulSum3(
nin=2) if have_pum
annotation (Placement(transformation(extent={{260,70},{280,90}})));
- Buildings.Experimental.DHC.Loads.BaseClasses.Examples.BaseClasses.FanCoil4Pipe terUni[nZon](
+ Buildings.DHC.Loads.BaseClasses.Examples.BaseClasses.FanCoil4Pipe terUni[nZon](
each T_aChiWat_nominal=T_aChiWat_nominal,
each T_bChiWat_nominal=T_bChiWat_nominal,
redeclare each final package Medium1=MediumW,
@@ -112,7 +112,7 @@ model building
final mLoaCoo_flow_nominal=mLoaCoo_flow_nominal)
"Terminal unit"
annotation (Placement(transformation(extent={{-140,-2},{-120,20}})));
- Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution disFloHea(
+ Buildings.DHC.Loads.BaseClasses.FlowDistribution disFloHea(
redeclare package Medium=MediumW,
allowFlowReversal=true,
m_flow_nominal=sum(
@@ -123,12 +123,12 @@ model building
nPorts_b1=nZon)
"Heating water distribution system"
annotation (Placement(transformation(extent={{-236,-188},{-216,-168}})));
- Buildings.Experimental.DHC.Loads.BaseClasses.FlowDistribution disFloCoo(
+ Buildings.DHC.Loads.BaseClasses.FlowDistribution disFloCoo(
redeclare package Medium=MediumW,
allowFlowReversal=true,
m_flow_nominal=sum(
terUni.mChiWat_flow_nominal .* terUni.facMulZon),
- typDis=Buildings.Experimental.DHC.Loads.BaseClasses.Types.DistributionType.ChilledWater,
+ typDis=Buildings.DHC.Loads.BaseClasses.Types.DistributionType.ChilledWater,
dp_nominal=100000,
have_pum=have_pum,
nPorts_a1=nZon,
@@ -212,8 +212,8 @@ model building
It was generated from translating a GeoJSON model specified within URBANopt UI.
The heating and cooling loads are computed with a four-pipe
fan coil unit model derived from
-
- Buildings.Experimental.DHC.Loads.BaseClasses.PartialTerminalUnit
+
+ Buildings.DHC.Loads.BaseClasses.PartialTerminalUnit
and connected to the room model by means of fluid ports.