Skip to content

Bump tags for Tecnalia models, fix incorrect scaling and improve documentation#10

Open
Zetison wants to merge 18 commits intomainfrom
fix/buildings
Open

Bump tags for Tecnalia models, fix incorrect scaling and improve documentation#10
Zetison wants to merge 18 commits intomainfrom
fix/buildings

Conversation

@Zetison
Copy link
Collaborator

@Zetison Zetison commented Dec 19, 2025

Based on the output of the Tecnalia_Building-Stock-Energy-Model the 1e6 scaling is removed and test updated accordingly. The submodules SHA are also updated. Also, added documentation for the nodes and a how-to section for the sampling constructors of these nodes.

@Zetison Zetison self-assigned this Dec 19, 2025
@Zetison Zetison added the bug Something isn't working label Dec 19, 2025
@Zetison Zetison requested a review from magnuask December 19, 2025 11:13
@Zetison Zetison changed the title Bump tags for Tecnalia models and fix incorrect scaling Bump tags for Tecnalia models, fix incorrect scaling and improve documentation Dec 28, 2025
@Zetison Zetison assigned JulStraus and unassigned Zetison Dec 28, 2025
Copy link
Collaborator

@magnuask magnuask left a comment

Choose a reason for hiding this comment

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

The structure is better with these additions. I left a number of inline comments with suggested fixes and clarifications (mainly related to a few inconsistencies, minor errors, and some places where the wording could be clearer).

The [`MultipleBuildingTypes`](@ref) node creates sinks for all demand resources with penalties for both surplus and deficit.
The implementation uses `Dict` structures for the fields `cap`, `penalty_surplus`, and `penalty_deficit` to facilitate multiple [Resource](@extref EnergyModelsBase.Resource)s.
This approach allows modeling building demands with flexible penalty mechanisms for over- and under-supply.
The type is also used to enable specialized constructors that samples the [`Tecnalia_Building-Stock-Energy-Model`](https://github.com/iDesignRES/Tecnalia_Building-Stock-Energy-Model) module.
Copy link
Collaborator

Choose a reason for hiding this comment

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

“constructors that samples” → “constructors that sample”

Copy link
Member

Choose a reason for hiding this comment

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

Fixed it.


PV and CSP source generate, respectively, electricity and heat from solar power.
The implementation of the node is similar to that of [NonDisRES](@extref EnergyModelsRenewableProducers nodes-nondisres) but uses `Dict` structures for the fields `cap`, `profile`, `opex_var` and `opex_fixed` to facilitate multiple [Resource](@extref EnergyModelsBase.Resource)s (both electricity and heat outputs).
The type is also used to enable specialized constructors that samples the [Tecnalia_Solar-Energy-Model](https://github.com/iDesignRES/Tecnalia_Solar-Energy-Model) module.
Copy link
Collaborator

Choose a reason for hiding this comment

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

“constructors that samples” → “constructors that sample”

Copy link
Member

Choose a reason for hiding this comment

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

Fixed

# [Wind power source node](@id nodes-WindPower)

Wind power source generate electricity from wind sources.
The implementation of the node is identical to that of [NonDisRES](@extref EnergyModelsRenewableProducers nodes-nondisres) and is here used to enable specialized constructors that samples the [`wind_power_timeseries`](https://gitlab.sintef.no/harald.svendsen/wind_power_timeseries) module.
Copy link
Collaborator

Choose a reason for hiding this comment

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

“constructors that samples” → “constructors that sample”

Copy link
Member

Choose a reason for hiding this comment

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

Fixed


The nodes [`WindPower`](@ref WindPower), [`CSPandPV`](@ref CSPandPV) and [`MultipleBuildingTypes`](@ref MultipleBuildingTypes) have [constructors](@ref lib-pub-sampling_constructors) that samples [`wind_power_timeseries`](https://gitlab.sintef.no/harald.svendsen/wind_power_timeseries), [`Tecnalia_Solar-Energy-Model`](https://github.com/iDesignRES/Tecnalia_Solar-Energy-Model) and [`Tecnalia_Building-Stock-Energy-Model`](https://github.com/iDesignRES/Tecnalia_Building-Stock-Energy-Model), respectively. These modules are python based and the usage of these [constructors](@ref lib-pub-sampling_constructors) requires installation of these as documented [below](@ref how_to-utilize-use_nodes-python_modules).

Additionally, the node [`BioCHP`](@ref BioCHP) have a [constructor](@ref lib-pub-sampling_constructors) that samples the [CHP_modelling](https://github.com/iDesignRES/CHP_modelling) module. This module is `C++` based and the [constructor](@ref lib-pub-sampling_constructors) then requires compilation and build before usage as described further [below](@ref how_to-utilize-use_nodes-cpp_modules).
Copy link
Collaborator

Choose a reason for hiding this comment

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

have a constructor” → “has a constructor”

Copy link
Member

Choose a reason for hiding this comment

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

Fixed it.

All values have to be non-negative.
- **`penalty_surplus::Dict{<:Resource,<:TimeProfile}`**:\
The penalties applied for surplus (over-supply) for each of the input resources.
These penalties affect the variable operational expenses.
Copy link
Collaborator

Choose a reason for hiding this comment

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

“These penalties affect the variable operational expenses.” → “These penalties are added to the variable operational cost.”

Copy link
Member

Choose a reason for hiding this comment

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

Changed, but kept expenses (as we use OPEX).

@@ -0,0 +1,154 @@
# [PV and CSV source node](@id nodes-CSPandPV)
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be “PV and CSP source node”

Copy link
Member

Choose a reason for hiding this comment

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

Fixed

Copy link
Collaborator

Choose a reason for hiding this comment

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

It is not entirely clear whether this node represents a combined PV + CSP system, or a generic multi-resource solar source

Copy link
Member

Choose a reason for hiding this comment

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

It is in practice a combined PV+CSP system if the constructor for the model from Tecnalia is used. I updated the documentation.

- [``\texttt{cap\_inst}``](@extref EnergyModelsBase man-opt_var-cap)
- [``\texttt{flow\_out}``](@extref EnergyModelsBase man-opt_var-flow)
- [``\texttt{emissions\_node}``](@extref EnergyModelsBase man-opt_var-emissions) if `EmissionsData` is added to the field `data`.
- [``\texttt{curtailment}[n, t]``](@extref EnergyModelsRenewableProducers nodes-nondisres-math-add): For [`CSPandPV`](@ref), this variable is the sum of curtailed capacity of source ``n`` in operational period ``t``.\
Copy link
Collaborator

Choose a reason for hiding this comment

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

“curtailed capacity” is misleading. Curtailment usually refers to unused generation (energy) rather than capacity.

Copy link
Member

Choose a reason for hiding this comment

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

Fixed

@@ -0,0 +1,161 @@
# [Wind power source node](@id nodes-WindPower)

Wind power source generate electricity from wind sources.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider simplifying to “Wind power sources generate electricity from wind.”

Copy link
Member

Choose a reason for hiding this comment

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

Changed.

- [``\texttt{cap\_inst}``](@extref EnergyModelsBase man-opt_var-cap)
- [``\texttt{flow\_out}``](@extref EnergyModelsBase man-opt_var-flow)
- [``\texttt{emissions\_node}``](@extref EnergyModelsBase man-opt_var-emissions) if `EmissionsData` is added to the field `data`.
- [``\texttt{curtailment}[n, t]``](@extref EnergyModelsRenewableProducers nodes-nondisres-math-add): Curtailed capacity of source ``n`` in operational period ``t`` with a typical unit of MW.\
Copy link
Collaborator

Choose a reason for hiding this comment

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

Curtailment usually refers to unused generation (energy/output) rather than capacity.

Copy link
Member

Choose a reason for hiding this comment

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

Fixed

Copy link
Member

@JulStraus JulStraus left a comment

Choose a reason for hiding this comment

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

Implemented the changes within 7e24573. Can you please resolve all comments that I answered?

Copy link
Member

Choose a reason for hiding this comment

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

While I agree with this, I would leave it to another PR.

To use the [constructor](@ref lib-pub-sampling_constructors) that samples the [CHP_modelling](https://github.com/iDesignRES/CHP_modelling) module, follow the installation in the [Use nodes](@ref how_to-utilize-use_nodes) section.

The `BioCHP` utilizes linear, time-independent conversion rates from the `input` [`Resource`](@extref EnergyModelsBase.Resource)s to the `output` [`Resource`](@extref EnergyModelsBase.Resource)s, subject to the available capacity.
The capacity is normalized such that a conversion value of 1 corresponds to the nominal capacity in the fields `input` and `output`.
Copy link
Member

Choose a reason for hiding this comment

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

I removed it, as it is the same as it is the case for the standard EMB nodes.

The capacity is normalized such that a conversion value of 1 corresponds to the nominal capacity in the fields `input` and `output`.

Compared to a standard [`NetworkNode`](@extref EnergyModelsBase.NetworkNode), `BioCHP` differs in its outlet-flow constraints:
the produced heat does not have to be used (e.g., heat outputs are allowed to be zero), while electric output is enforced according to the given conversion factor.
Copy link
Member

Choose a reason for hiding this comment

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

I did a rework on this. Let me know what you think

This is similar to the approach utilized in `EnergyModelsBase`.

- **`cap::TimeProfile`**:\
Specifies the installed capacity, that is the heat the heat pump can deliver.\
Copy link
Member

Choose a reason for hiding this comment

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

That is not entirely correct. It is for the standard node not defined in heat as the conversion factors may impact the system. I extended the description.


- **`output::Dict{<:Resource, <:Real}`**:\
The field `output` includes the output [`Resource`](@extref EnergyModelsBase.Resource)s with their corresponding conversion factors as dictionaries.
It is also possible to include other resources which are produced with a given correlation with the heat.\
Copy link
Member

Choose a reason for hiding this comment

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

Changed it


The nodes [`WindPower`](@ref WindPower), [`CSPandPV`](@ref CSPandPV) and [`MultipleBuildingTypes`](@ref MultipleBuildingTypes) have [constructors](@ref lib-pub-sampling_constructors) that samples [`wind_power_timeseries`](https://gitlab.sintef.no/harald.svendsen/wind_power_timeseries), [`Tecnalia_Solar-Energy-Model`](https://github.com/iDesignRES/Tecnalia_Solar-Energy-Model) and [`Tecnalia_Building-Stock-Energy-Model`](https://github.com/iDesignRES/Tecnalia_Building-Stock-Energy-Model), respectively. These modules are python based and the usage of these [constructors](@ref lib-pub-sampling_constructors) requires installation of these as documented [below](@ref how_to-utilize-use_nodes-python_modules).

Additionally, the node [`BioCHP`](@ref BioCHP) have a [constructor](@ref lib-pub-sampling_constructors) that samples the [CHP_modelling](https://github.com/iDesignRES/CHP_modelling) module. This module is `C++` based and the [constructor](@ref lib-pub-sampling_constructors) then requires compilation and build before usage as described further [below](@ref how_to-utilize-use_nodes-cpp_modules).
Copy link
Member

Choose a reason for hiding this comment

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

Fixed it.

git clone --recurse-submodules git@github.com:EnergyModelsX/EnergyModelsLanguageInterfaces.jl.git
```

You should now be enabled to enter the main folder in which the other modules are located (under the submodules folder)
Copy link
Member

Choose a reason for hiding this comment

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

Fixed it.


### [Test modules](@id how_to-utilize-use_nodes-test)

All the mentioned [constructors](@ref lib-pub-sampling_constructors) have been included in the tests of the repository and you may therefore check if everyting is properly setup by running these in julia.
Copy link
Member

Choose a reason for hiding this comment

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

Fixed it.

The [`MultipleBuildingTypes`](@ref) node creates sinks for all demand resources with penalties for both surplus and deficit.
The implementation uses `Dict` structures for the fields `cap`, `penalty_surplus`, and `penalty_deficit` to facilitate multiple [Resource](@extref EnergyModelsBase.Resource)s.
This approach allows modeling building demands with flexible penalty mechanisms for over- and under-supply.
The type is also used to enable specialized constructors that samples the [`Tecnalia_Building-Stock-Energy-Model`](https://github.com/iDesignRES/Tecnalia_Building-Stock-Energy-Model) module.
Copy link
Member

Choose a reason for hiding this comment

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

Fixed it.

Copy link
Member

Choose a reason for hiding this comment

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

It is in practice a combined PV+CSP system if the constructor for the model from Tecnalia is used. I updated the documentation.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants