Skip to content
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- Maximum profile constraint for PV asset is considered in PV sizing
- Cater for input via esdl constraints to specify the upper limit for OPTIONAL assets in DTK
- Initial implementation of adaptable pipe DN lower limit per pipe
- DischargeEfficiency is parsed from HeatStorage assets in ESDL to a heat loss coefficient


## Changed
- Speed-up timeseries check in from InfluxDB
Expand Down
10 changes: 9 additions & 1 deletion src/mesido/esdl/esdl_heat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,20 @@ def convert_heat_buffer(self, asset: Asset) -> Tuple[Type[HeatBuffer], MODIFIERS
else 10.0e6
)

# The asset attribute "dischargeEfficiency" represents the fraction of stored heat
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two name conventions conflict

  1. efficiency vs fraction
  2. dischargeEfficiency vs stored heat lost
    I would expect that if I put in 98%, that only 2% is lost during the day.

Copy link
Copy Markdown
Collaborator Author

@tolga-akan tolga-akan Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"heat_loss_efficiency " is renamed as "heat_loss_coefficient". With this naming, we are aligned with the "efficiency attribute" definitions of esdl. Besides, using heat_loss_coefficienct looks more logical now

# that is lost per day.
heat_loss_coefficient = (
asset.attributes.get("dischargeEfficiency") / (24.0 * 3600.0)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
asset.attributes.get("dischargeEfficiency") / (24.0 * 3600.0)
asset.attributes.get("dischargeEfficiency") /100 / (24.0 * 3600.0)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do this suggestion, appearantly efficiencies are now always fractions in esdl. Lets atleast in our own code be clear and name it fraction/coefficient etc.

Copy link
Copy Markdown
Collaborator Author

@tolga-akan tolga-akan Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed "heat_loss_efficiency " as "heat_loss_coefficient". Hence, this aligns with the definition of efficiency attributes used in esdl

if asset.attributes.get("dischargeEfficiency")
else 0.01 / (24.0 * 3600.0)
)

q_nominal = self._get_connected_q_nominal(asset)

modifiers = dict(
height=r,
radius=r,
heat_transfer_coeff=1.0,
heat_loss_coefficient=heat_loss_coefficient,
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
15 changes: 11 additions & 4 deletions src/mesido/pycml/component_library/milp/heat/heat_buffer.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ def __init__(self, name, **modifiers):

self.component_type = "heat_buffer"

self.heat_transfer_coeff = 1.0
self.height = 5.0
self.radius = 10.0
self.volume = math.pi * self.radius**2 * self.height
self.heat_loss_coeff = 2 * self.heat_transfer_coeff / (self.radius * self.rho * self.cp)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe keep this old line as commented code as in the future we might want to use a heat transfer coefficient together with its dimensions.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

old definition of "heat_loss_coefficient" is added back again as a comment

self.heat_loss_coefficient = nan
# self.heat_transfer_coeff = 1.0
# self.heat_loss_coefficient = (
# 2 * self.heat_transfer_coeff / (self.radius * self.rho * self.cp)
# )

# The hot/cold tank can have a lower bound on its volume.
# Meaning that they might always be, for e.g., 5% full.
self.min_fraction_tank_volume = 0.05
Expand Down Expand Up @@ -78,7 +82,9 @@ def __init__(self, name, **modifiers):
# 10.0, we aim for a state vector entry of ~0.1 (instead of 1.0)
self._heat_loss_error_to_state_factor = 10.0
self._nominal_heat_loss = (
self._nominal_stored_heat * self.heat_loss_coeff * self._heat_loss_error_to_state_factor
self._nominal_stored_heat
* self.heat_loss_coefficient
* self._heat_loss_error_to_state_factor
)

self.add_variable(Variable, "Heat_loss", min=0.0, nominal=self._nominal_heat_loss)
Expand All @@ -91,7 +97,8 @@ def __init__(self, name, **modifiers):
/ self._heat_loss_eq_nominal_buf
)
self.add_equation(
(self.Heat_loss - self.Stored_heat * self.heat_loss_coeff) / self._nominal_heat_loss
(self.Heat_loss - self.Stored_heat * self.heat_loss_coefficient)
/ self._nominal_heat_loss
)

self.add_equation((self.Heat_flow - self.Heat_buffer) / self.Heat_nominal)
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.01">
<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
Loading
Loading