Skip to content

Heat buffer efficiency#427

Open
tolga-akan wants to merge 11 commits intomainfrom
heat_buffer_efficiency
Open

Heat buffer efficiency#427
tolga-akan wants to merge 11 commits intomainfrom
heat_buffer_efficiency

Conversation

@tolga-akan
Copy link
Collaborator

@tolga-akan tolga-akan commented Feb 9, 2026

Done:

  • Read heat_loss_coefficient of heat_buffer from dischargeEfficiency attributes in esdl. The asset attribute "dischargeEfficiency" represents the fraction of stored heat that is lost per day. If this attribute is not provided in esdl, a default heat loss rate of 1% per day is used. The value is converted to a per‑second loss factor.
  • Modify the old tests with heat buffer asset. Make it adjusted with new heat_loss_coefficient definition. Add a check to ensure that regarding attribute is read from esdl

@tolga-akan tolga-akan marked this pull request as ready for review February 9, 2026 13:14
@tolga-akan tolga-akan closed this Feb 27, 2026
@tolga-akan tolga-akan reopened this Feb 27, 2026
@tolga-akan tolga-akan marked this pull request as draft February 27, 2026 11:01
@tolga-akan tolga-akan marked this pull request as ready for review February 27, 2026 12:02
@tolga-akan
Copy link
Collaborator Author

@FJanssen-TNO Ready for review

else 10.0e6
)

# The asset attribute "dischargeEfficiency" represents the fraction of stored heat
Copy link
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
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

Comment on lines +432 to +433
# that is lost per day. If this attribute is not provided in esdl, a default heat loss rate
# of 1% per day is used. The value is converted to a per‑second loss factor.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The comment "if this attribute is not provided ...." can be removed, this can be seen below.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

rest of the comment is removed

# The asset attribute "dischargeEfficiency" represents the fraction of stored heat
# that is lost per day. If this attribute is not provided in esdl, a default heat loss rate
# of 1% per day is used. The value is converted to a per‑second loss factor.
heat_loss_efficiency = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Name convention is confusing: heat loss efficiency is confliction, so either efficiency or heat loss coefficient. The latter is actually what you are using.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

renamed as "heat_loss_coefficient"

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
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
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

Comment on lines +64 to +75
# Test that if heat_loss_efficiency is incorporated into heat loss calculation of buffer
esdl_asset = solution.esdl_assets[solution.esdl_asset_name_to_id_map["HeatStorage_74c1"]]
np.testing.assert_allclose(
parameters["HeatStorage_74c1.heat_loss_efficiency"],
esdl_asset.attributes["dischargeEfficiency"] / (24.0 * 3600.0),
)
np.testing.assert_allclose(
results["HeatStorage_74c1.Heat_loss"],
results["HeatStorage_74c1.Stored_heat"]
* parameters["HeatStorage_74c1.heat_loss_efficiency"],
)

Copy link
Collaborator

Choose a reason for hiding this comment

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

This test is about sizing. The checks that you have done here, should be for instance in the other test where you are checking the buffer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

checks are removed from "test_max_size_and_optional_assets.py" and placed into "test_warmingup_unit_cases.py". Anyways, one of the check was already done in test_warmingup_unit_cases. I have only added check related to to "dischargeEfficiency" attribute

# that is lost per day. If this attribute is not provided in esdl, a default heat loss rate
# of 1% per day is used. The value is converted to a per‑second loss factor.
heat_loss_efficiency = (
asset.attributes.get("dischargeEfficiency") / (24.0 * 3600.0)
Copy link
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
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
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

CHANGELOG.md Outdated
## Added
- Parsing of ensemble profiles when using input profiles from csv.
- Maximum profile constraint for PV asset is considered in PV sizing
- heat_loss_efficiency of HeatStorage is read from dischargeEfficiency attribute in esdl
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- heat_loss_efficiency of HeatStorage is read from dischargeEfficiency attribute in esdl
- DischargeEfficiency is parsed from HeatStorage assets in ESDL to a heat loss coefficient

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

suggestion is implemented

@tolga-akan
Copy link
Collaborator Author

@FJanssen-TNO Ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants