Skip to content
Merged
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: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
* Early retirement changes the model behavior.
* No other changes required.

### Other changes

* Minor modifications to documentation.

## Version 0.1.4 (2025-12-17)

* Updated the format of `descriptive_names.yaml` to [`EnergyModelsGUI` v0.6.0](https://github.com/EnergyModelsX/EnergyModelsGUI.jl/releases/tag/v0.6.0).
Expand Down
3 changes: 3 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ using TimeStruct
using EnergyModelsBase
using EnergyModelsHeat

const EMB = EnergyModelsBase
const EMH = EnergyModelsHeat

DocMeta.setdocmeta!(
EnergyModelsHeat,
:DocTestSetup,
Expand Down
26 changes: 13 additions & 13 deletions docs/src/library/internals/methods-EMB.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,37 @@ Pages = ["methods-EMB.md"]
## [Extension methods](@id lib-int-met_emb-ext)

```@docs
EnergyModelsBase.create_link
EnergyModelsBase.variables_link
EMB.create_link
EMB.variables_link
```

## [Constraint methods](@id lib-int-met_emb-con)

```@docs
EnergyModelsBase.constraints_level_iterate
EnergyModelsBase.constraints_capacity
EnergyModelsBase.constraints_flow_in
EnergyModelsBase.constraints_flow_out
EMB.constraints_level_iterate
EMB.constraints_capacity
EMB.constraints_flow_in
EMB.constraints_flow_out
```

## [Check methods](@id lib-int-met_emb-check)

```@docs
EnergyModelsBase.check_node
EnergyModelsBase.check_link
EMB.check_node
EMB.check_link
```

## [Field extraction methods](@id lib-int-met_emb-field)

```@docs
EnergyModelsBase.co2_int
EnergyModelsBase.capacity
EnergyModelsBase.inputs
EnergyModelsBase.outputs
EMB.co2_int
EMB.capacity
EMB.inputs
EMB.outputs
```

## [Identification methods](@id lib-int-met_emb-identi)

```@docs
EnergyModelsBase.has_capacity
EMB.has_capacity
```
15 changes: 7 additions & 8 deletions docs/src/library/internals/methods-EMH.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ Pages = ["methods-EMH.md"]

## [Extension methods](@id lib-int-met_emb-ext)


## [Constraint methods](@id lib-int-met_emb-con)

## [Utility methods](@id lib-int-met-util)

```@docs
EnergyModelsHeat.dh_fraction
EnergyModelsHeat.dh_upgrade
EnergyModelsHeat.fraction_equal_mass
EnergyModelsHeat.is_heat
EnergyModelsHeat.t_return
EnergyModelsHeat.upgrade_equal_mass
EnergyModelsHeat.upgradeable_fraction
EMH.dh_fraction
EMH.dh_upgrade
EMH.fraction_equal_mass
EMH.is_heat
EMH.t_return
EMH.upgrade_equal_mass
EMH.upgradeable_fraction
```
29 changes: 14 additions & 15 deletions docs/src/library/internals/methods-fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,32 @@ Pages = ["methods-fields.md"]
## [`DHPipe`](@id lib-int-met_field-dhpipe)

```@docs
EnergyModelsHeat.pipe_length
EnergyModelsHeat.pipe_loss_factor
EnergyModelsHeat.t_ground
EnergyModelsHeat.resource_heat
EnergyModelsHeat.t_supply
EMH.pipe_length
EMH.pipe_loss_factor
EMH.t_ground
EMH.resource_heat
EMH.t_supply
```

## [`HeatPump`](@id lib-int-met_field-heatpump)

```@docs
EnergyModelsHeat.eff_carnot
EnergyModelsHeat.t_sink
EnergyModelsHeat.t_source
EnergyModelsHeat.cap_lower_bound
EnergyModelsHeat.heat_in_resource
EnergyModelsHeat.driving_force_resource
EMH.eff_carnot
EMH.t_sink
EMH.t_source
EMH.cap_lower_bound
EMH.heat_in_resource
EMH.driving_force_resource
```

## [`ThermalEnergyStorage`](@id lib-int-met_field-thermalenergystorage)

```@docs
EnergyModelsHeat.heat_loss_factor
EnergyModelsHeat.level_discharge
EnergyModelsHeat.level_charge
EMH.heat_loss_factor
EMH.level_discharge
EMH.level_charge
```

## [`HeatExchanger`](@id lib-int-met_field-heatexchanger)


## [`PinchData`](@id lib-int-met_field-pinchdata)
10 changes: 5 additions & 5 deletions docs/src/library/internals/types-EMH.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ Pages = ["types-EMH.md"]
## [Nodal supertypes](@id lib-int-types-node)

```@docs
EnergyModelsHeat.AbstractHeatExchanger
EnergyModelsHeat.AbstractTES
EMH.AbstractHeatExchanger
EMH.AbstractTES
```

## [Parameter supertypes](@id lib-int-types-para)

```@docs
EnergyModelsHeat.HeatExchangerAssumptions
EMH.HeatExchangerAssumptions
```

## [Auxiliary types](@id lib-int-types-aux)

```@docs
EnergyModelsHeat.DifferentMassFlows
EnergyModelsHeat.EqualMassFlows
EMH.DifferentMassFlows
EMH.EqualMassFlows
```
2 changes: 1 addition & 1 deletion src/checks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function EMB.check_node(
end

# Also perform the default checks
EnergyModelsBase.check_node_default(n, 𝒯, modeltype, check_timeprofiles)
EMB.check_node_default(n, 𝒯, modeltype, check_timeprofiles)
end

"""
Expand Down
54 changes: 37 additions & 17 deletions src/constraint_functions.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
"""
EMB.constraints_capacity(m, n::HeatPump, 𝒯::TimeStructure, modeltype::EnergyModel)

Function for creating the constraint on the minimum capacity utilization of a [`HeatPump`](@ref).
Method for creating the constraints on the maximum capacity of a [`HeatPump`](@ref).

It adds in the addition to the constraints of the standard method the lower bound constraints.
"""
function EMB.constraints_capacity(m, n::HeatPump, 𝒯::TimeStructure, modeltype::EnergyModel)
#Part Load Constraint
Expand All @@ -17,7 +19,10 @@ end
"""
EMB.constraints_flow_in(m, n::HeatPump, 𝒯::TimeStructure, modeltype::EnergyModel)

Function for creating the constraint on the heat and electricity input of a [`HeatPump`](@ref).
Method for creating the constraint on the inlet flow to a [`HeatPump`](@ref).

It is utlizing the specified temperature levels, [`heat_in_resource`](@ref) and
[`driving_force_resource`](@ref) for calculating the values.
"""
function EMB.constraints_flow_in(m, n::HeatPump, 𝒯::TimeStructure, modeltype::EnergyModel)
# Calculate the multiplier
Expand All @@ -35,13 +40,15 @@ function EMB.constraints_flow_in(m, n::HeatPump, 𝒯::TimeStructure, modeltype:
end

"""
constraints_flow_in(m, n::DirectHeatUpgrade, 𝒯::TimeStructure, modeltype::EnergyModel)
EMB.constraints_flow_in(m, n::DirectHeatUpgrade, 𝒯::TimeStructure, modeltype::EnergyModel)

Create the constraints for flow in to [`DirectHeatUpgrade`](@ref). The constraint is only for power as the proportion of the inputs
depends on the need for upgrade computed from the temperatures of the input/output [`ResourceHeat`](@ref) and the ΔT_min, and the
capacity is linked to the power consumption.
Method for creating the constraint on the inlet flow to a [`DirectHeatUpgrade`](@ref).

The constraint is only for power as the proportion of the inputs depends on the need for
upgrade computed from the temperatures of the input/output [`ResourceHeat`](@ref) and the
ΔT_min. The capacity is linked to the power consumption.
"""
function EnergyModelsBase.constraints_flow_in(
function EMB.constraints_flow_in(
m,
n::DirectHeatUpgrade,
𝒯::TimeStructure,
Expand All @@ -59,7 +66,10 @@ end
"""
EMB.constraints_flow_out(m, n::HeatExchanger{A,T}, 𝒯::TimeStructure, modeltype::EnergyModel)

Create the constraints for the flow out from a [`HeatExchanger`](@ref). The flow of available heat energy is calculated from the temperatures in the heat flows using the function [`dh_fraction`](@ref).
Method for creating the constraint on the outlet flow from a [`HeatExchanger`](@ref).

The flow of available heat energy is calculated from the temperatures in the heat flows
using the function [`dh_fraction`](@ref).
"""
function EMB.constraints_flow_out(
m,
Expand All @@ -79,13 +89,19 @@ function EMB.constraints_flow_out(
end

"""
constraints_flow_out(m, n::DirectHeatUpgrade{A,T}, 𝒯::TimeStructure, modeltype::EnergyModel) where {A,T}
EMB.constraints_flow_out(m, n::DirectHeatUpgrade{A,T}, 𝒯::TimeStructure, modeltype::EnergyModel) where {A,T}

Create the constraints for flow out from a [`DirectHeatUpgrade`](@ref).
The flow of available heat energy is calculated from the temperatures in the heat flows using the function [`upgradeable_fraction`](@ref), and the heat needed to upgrade to the required temperature is calculated by the function [`dh_upgrade`](@ref).
Note that the node may dump some of the ingoing heat energy, and the power needed for the upgrade is calculated from the resulting energy outflow.
Method for creating the constraint on the outlet flow from a [`DirectHeatUpgrade`](@ref).

The flow of available heat energy is calculated from the temperatures in the heat flows
using the function [`upgradeable_fraction`](@ref), and the heat needed to upgrade to the
required temperature is calculated by the function [`dh_upgrade`](@ref).

!!! note
The node may dump some of the ingoing heat energy, and the power needed for the upgrade
is calculated from the resulting energy outflow.
"""
function EnergyModelsBase.constraints_flow_out(
function EMB.constraints_flow_out(
m,
n::DirectHeatUpgrade{A,T},
𝒯::TimeStructure,
Expand Down Expand Up @@ -122,7 +138,7 @@ function EnergyModelsBase.constraints_flow_out(
end

"""
constraints_level_iterate(
EMB.constraints_level_iterate(
m,
n::AbstractTES,
prev_pers::PreviousPeriods,
Expand All @@ -132,7 +148,8 @@ end
modeltype::EnergyModel,
)

In the case of a [`AbstractTES`](@ref), the lowest level iterator is adjusted as the loss is dependent on the level at the beginning of the operational period.
In the case of a [`AbstractTES`](@ref), the lowest level iterator is adjusted as the loss
is dependent on the level at the beginning of the operational period.
"""
function EMB.constraints_level_iterate(
m,
Expand Down Expand Up @@ -165,14 +182,17 @@ function EMB.constraints_level_iterate(
end

"""
constraints_capacity(
EMB.constraints_capacity(
m,
n::BoundRateTES,
𝒯::TimeStructure,
modeltype::EnergyModel,
)

Adjust the constraints on the capacity of a [`BoundRateTES`](@ref) to account for the maximum charge and discharge rates in relation to the installed storage level.
Method for creating the constraints on the maximum capacity of a [`BoundRateTES`](@ref)

It adjusts the constraints on the capacity of a [`BoundRateTES`](@ref) to account for the
maximum charge and discharge rates in relation to the installed storage level.
"""

function EMB.constraints_capacity(
Expand Down
2 changes: 1 addition & 1 deletion src/structures/link.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
DHPipe
struct DHPipe <: EMB.Link

A district heating pipe between two nodes. The district heating pipe only transports the
specified resource with a specified loss factor. It has a maximum capacity.
Expand Down
Loading
Loading