Skip to content

Comments

421 geothermal asset e consumption#424

Draft
Jaimepatt wants to merge 6 commits intomainfrom
421-geothermal-asset-e-consumption
Draft

421 geothermal asset e consumption#424
Jaimepatt wants to merge 6 commits intomainfrom
421-geothermal-asset-e-consumption

Conversation

@Jaimepatt
Copy link
Collaborator

Work for issue: #421

@Jaimepatt Jaimepatt self-assigned this Feb 4, 2026
@Jaimepatt Jaimepatt linked an issue Feb 4, 2026 that may be closed by this pull request
@Jaimepatt
Copy link
Collaborator Author

@FJanssen-TNO I have written an implementation for this issue. It is not ready for a proper PR, I still need to write some test and do all the formatting and linting, but if you have some time it would be useful for me if you can check if my approach for it makes sense.

Copy link
Collaborator

@FJanssen-TNO FJanssen-TNO left a comment

Choose a reason for hiding this comment

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

First notes on the structure

Comment on lines +261 to +282

elif (
asset.asset_type == "GeothermalSource"
and len(asset.out_ports) == 1
and len(asset.in_ports) == 2
):
for p in [*asset.in_ports, *asset.out_ports]:

if isinstance(p, InPort) and isinstance(
p.carrier, esdl.ElectricityCommodity
):
port_map[p.id] = getattr(component, elec_in_suf)
elif isinstance(p, InPort) and isinstance(p.carrier, esdl.HeatCommodity):
port_map[p.id] = getattr(component, in_suf)
elif isinstance(p, OutPort): # OutPort
port_map[p.id] = getattr(component, out_suf)
else:
raise Exception(
f"{asset.name} has does not have (1 electricity in_port) 1 heat "
f"in port and 1 Heat out_ports "
)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this is a copy of another asset with 2 heat ports and one electricity inport. Therefore please combine with that if statement, no need to have duplicated code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, you are right, I see now that I copied this snipped from the air to water heat pump. I am merging it with that if statement in the next commit.

)
# TODO: A better check might be needed here. Perhaps check for an elec asset.
if len(asset.in_ports) == 2: # Geothermal source with an electricity in port.
_, modifiers = self.convert_geothermal_source_elec(asset)
Copy link
Collaborator

Choose a reason for hiding this comment

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

right now you are not using any of the modifiers that have already been created upto this point and that you need, you basically starting from scratch again.
Instead of creating an entire convert method where you do everything from scratch again, you can just update the modifiers here that are based on the electricity connection. (You can create a method for that you call here, but it doesn't have to contain anything that has already been done above here)


return AirWaterHeatPumpElec, modifiers

def convert_geothermal_source_elec(
Copy link
Collaborator

Choose a reason for hiding this comment

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

See my comment above.

Comment on lines +2718 to +2720
id_mapping = asset.global_properties["carriers"][asset.in_ports[0].carrier.id][
"id_number_mapping"
]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is not required.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The first step was not create a completely new geothermal asset with an additional port. The first step is to calculate the electricity consumption by a geothermal asset. Updating the geothermal asset with a variable "Power_elec" and calculating that variable using an equation.
After that we can create a new geothermal asset, but that will be relatively easy as it then only is based on adding an electricity port.

if isinstance(port.carrier, esdl.ElectricityCommodity):
min_voltage = port.carrier.voltage
i_max, i_nom = self._get_connected_i_nominal_and_max(asset)
cop = asset.attributes["COP"] if asset.attributes["COP"] else 1.0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Think about default values that you would like to use. In case someone hasn't specified the COP (e.g. how much electricity is used), should it then be a ratio of 1 compared to the heat energy produced. Maybe is someone hasn't specified you want it to be 0.

Copy link
Collaborator Author

@Jaimepatt Jaimepatt Feb 23, 2026

Choose a reason for hiding this comment

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

@Jaimepatt check what a reasonable default value is for the COP of a geothermal source asset. For ATES it was 0.1kWh/m3/hr.

self.add_variable(Variable, "Power_elec", min=0.0, nominal=self.elec_power_nominal)

self.add_equation(((self.ElectricityIn.Power - self.Power_elec) / self.elec_power_nominal))
self.add_equation(((self.Power_elec * self.cop - self.Heat_source) / self.Heat_nominal))
Copy link
Collaborator

Choose a reason for hiding this comment

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

This you can move to geothermal asset together with the variable creation.

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.

Geothermal asset e-consumption

2 participants