Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Unreleased-main] - 2026-02-05
# [Unreleased-main] - 2026-02-09

## Added
- xxx
- heat_transfer_coeff variable of HeatStorage is read from dischargeEfficiency attribute in esdl

## Changed
- xxx
Expand Down
13 changes: 12 additions & 1 deletion src/mesido/esdl/esdl_heat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,12 +428,23 @@ def convert_heat_buffer(self, asset: Asset) -> Tuple[Type[HeatBuffer], MODIFIERS
else 10.0e6
)

# Todo: Currently esdl does not have "heatTransferCoefficient" attribute for
# heat_buffer asset. Temporarily we are using "dischargeEfficiency" attribute
# of HeatStorage asset attribute in ESDL to define heat_transfer_coeff.
# Once, "heatTransferCoefficient" attribute is added into esdl,
# we can update this part.
heat_transfer_coeff = (
asset.attributes.get("heatTransferCoefficient")
or asset.attributes.get("dischargeEfficiency")
or 1.0
)

q_nominal = self._get_connected_q_nominal(asset)

modifiers = dict(
height=r,
radius=r,
heat_transfer_coeff=1.0,
heat_transfer_coeff=heat_transfer_coeff,
min_fraction_tank_volume=min_fraction_tank_volume,
Stored_heat=dict(min=min_heat, max=max_heat),
Heat_buffer=dict(min=-hfr_discharge_max, max=hfr_charge_max),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, name, **modifiers):

self.component_type = "heat_buffer"

self.heat_transfer_coeff = 1.0
self.heat_transfer_coeff = nan
self.height = 5.0
self.radius = 10.0
self.volume = math.pi * self.radius**2 * self.height
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@
</investmentCosts>
</costInformation>
</asset>
<asset xsi:type="esdl:HeatStorage" name="HeatStorage_74c1" id="74c13eed-9ca8-4247-bd72-a68e242d8e1b" maxDischargeRate="10000000.0" maxChargeRate="10000000.0" volume="500.0">
<asset xsi:type="esdl:HeatStorage" name="HeatStorage_74c1" id="74c13eed-9ca8-4247-bd72-a68e242d8e1b" maxDischargeRate="10000000.0" maxChargeRate="10000000.0" volume="500.0" dischargeEfficiency="0.85">
<geometry xsi:type="esdl:Point" lon="4.313871860504151" CRS="WGS84" lat="52.042658996032856"/>
<port xsi:type="esdl:InPort" id="8c09b9ff-5070-4fbc-97fe-db7a501932dc" name="In" connectedTo="636a1943-2289-4d57-a2dd-33aaa4f25b49" carrier="7b32e287-d775-480c-b317-64ffdacf12c9"/>
<port xsi:type="esdl:OutPort" id="cc725203-e648-490f-a12d-91fa85ee58f2" name="Out" connectedTo="a581c340-3cab-46b1-924f-c5ddc0120de6" carrier="7b32e287-d775-480c-b317-64ffdacf12c9_ret"/>
Expand Down
15 changes: 15 additions & 0 deletions tests/test_max_size_and_optional_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_max_size_and_aggr_count(self):
assets should not be placed by the optmizer because of heat losses.

Checks:
- Check that heat_transfer_coeff can be read from esdl
- Check that source 1 is utilized and also placed
- Check that source 2 is utilized and placed
- Check that the geothermal source is not placed
Expand Down Expand Up @@ -60,6 +61,20 @@ def test_max_size_and_aggr_count(self):
results = solution.extract_results()
parameters = solution.parameters(0)

# Test that heat_transfer_coeff can be read from esdl
esdl_asset = solution.esdl_assets[solution.esdl_asset_name_to_id_map["HeatStorage_74c1"]]
try:
heat_transfer_coeff = esdl_asset.attributes["heatTransferCoefficient"]
except KeyError:
# Currently, "heatTransferCoefficient" attribute is not available in esdl.
# We are temporariliy using "dischargeEfficiency" attribute in esdl
# to define heat_transfer_coeff
heat_transfer_coeff = esdl_asset.attributes["dischargeEfficiency"]

np.testing.assert_allclose(
parameters["HeatStorage_74c1.heat_transfer_coeff"], heat_transfer_coeff
)

# Producer 1 and geothermal source should not produce due to higher cost
# Producer 2 should produce
heat_1 = results["HeatProducer_1.Heat_source"]
Expand Down