Methods - EnergyModelsBase
Index
EnergyModelsBase.capacity
EnergyModelsBase.check_link
EnergyModelsBase.check_node
EnergyModelsBase.co2_int
EnergyModelsBase.constraints_capacity
EnergyModelsBase.constraints_flow_in
EnergyModelsBase.constraints_flow_out
EnergyModelsBase.constraints_level_iterate
EnergyModelsBase.create_link
EnergyModelsBase.has_capacity
EnergyModelsBase.inputs
EnergyModelsBase.outputs
EnergyModelsBase.variables_link
Extension methods
EnergyModelsBase.create_link
— Functioncreate_link(m, l::DHPipe, 𝒯, 𝒫, modeltype::EnergyModel)
When the link is a DHPipe
, the constraints for a link include a loss based on the difference in the temperature of the district heating resource and the ground.
In addition, a DHPipe
includes a capacity with the potential for investments.
EnergyModelsBase.variables_link
— Functionvariables_link(m, ℒˢᵘᵇ::Vector{<:DHPipe}, 𝒯, modeltype::EnergyModel)
Define variable dh_loss for heat losses in DH pipes
Constraint methods
EnergyModelsBase.constraints_level_iterate
— Functionconstraints_level_iterate(
m,
n::ThermalEnergyStorage,
prev_pers::PreviousPeriods,
cyclic_pers::CyclicPeriods,
per,
_::SimpleTimes,
modeltype::EnergyModel,
)
In the case of a ThermalEnergyStorage
, the lowest level iterator is adjusted as the loss is dependent on the level at the beginning of the operational period.
EnergyModelsBase.constraints_capacity
— Functionconstraints_capacity(m, n::HeatPump, 𝒯::TimeStructure, modeltype::EnergyModel)
Function for creating the constraint on the minimum capacity utilization of a HeatPump
.
EnergyModelsBase.constraints_flow_in
— Functionconstraints_flow_in(m, n::HeatPump, 𝒯::TimeStructure, modeltype::EnergyModel)
Function for creating the constraint on the heat and electricity input of a HeatPump
.
constraints_flow_in(m, n::DirectHeatUpgrade, 𝒯::TimeStructure, modeltype::EnergyModel)
Create the constraints for flow in to DirectHeatUpgrade
. 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
and the ΔT_min, and the capacity is linked to the power consumption.
EnergyModelsBase.constraints_flow_out
— FunctionEMB.constraints_flow_out(m, n::HeatExchanger{A,T}, 𝒯::TimeStructure, modeltype::EnergyModel)
Create the constraints for the flow out from a HeatExchanger
. The flow of available heat energy is calculated from the temperatures in the heat flows using the function dh_fraction
.
constraints_flow_out(m, n::DirectHeatUpgrade{A,T}, 𝒯::TimeStructure, modeltype::EnergyModel) where {A,T}
Create the constraints for flow out from a DirectHeatUpgrade
. The flow of available heat energy is calculated from the temperatures in the heat flows using the function upgradeable_fraction
, and the heat needed to upgrade to the required temperature is calculated by the function dh_upgrade
. 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.
Check methods
EnergyModelsBase.check_node
— Functioncheck_node(
n::DirectHeatUpgrade{A, T},
𝒯,
modeltype::EnergyModel,
check_timeprofiles::Bool,
) where {A, T}
Check if a DirectHeatUpgrade
node has reasonable values for the return/supply temperatures and error if the upgrade is ≥ 1 (should only happen with data errors).
EMB.check_node(n::HeatPump, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
This method checks that the HeatPump
node is valid.
It reuses the standard checks of a NetworkNode
node through calling the function EMB.check_node_default
, but adds an additional check on the data.
Checks
- The field
cap
is required to be non-negative (similar to theNetworkNode
check). - The value of the field
fixed_opex
is required to be non-negative and accessible through aStrategicPeriod
as outlined in the functioncheck_fixed_opex(n, 𝒯ᴵⁿᵛ, check_timeprofiles)
. - The values of the dictionary
input
andoutput
are required to be non-negative (similar to theNetworkNode
check). - The field
cap_lower_bound
is required to be in the range $[0, 1]$ for all time steps $t ∈ \mathcal{T}$. - The field
eff_carnot
is required to be in the range $[0, 1]$ for all time steps $t ∈ \mathcal{T}$. - The field
t_sink
is required to be greater than or equal to the fieldt_source
for all time steps $t ∈ \mathcal{T}$.
EMB.check_node(n::ThermalEnergyStorage, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
This method checks that the ThermalEnergyStorage
node is valid.
It reuses the standard checks of a Storage
node through calling the function EMB.check_node_default
, but adds an additional check on the data.
Checks
- The
TimeProfile
of the fieldcapacity
in the type in the fieldcharge
is required to be non-negative if the chosen composite type has the fieldcapacity
. - The
TimeProfile
of the fieldcapacity
in the type in the fieldlevel
is required to be non-negative`. - The
TimeProfile
of the fieldcapacity
in the type in the fielddischarge
is required to be non-negative if the chosen composite type has the fieldcapacity
. - The
TimeProfile
of the fieldfixed_opex
is required to be non-negative and accessible through aStrategicPeriod
as outlined in the function [check_fixed_opex(n, 𝒯ᴵⁿᵛ, check_timeprofiles)
] for the chosen composite type . - The values of the dictionary
input
are required to be non-negative. - The values of the dictionary
output
are required to be non-negative. - The value of the field
heat_loss_factor
is required to be in the range $[0, 1]$.
EnergyModelsBase.check_link
— FunctionEMB.check_link(l::DHPipe, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
This method checks that the DHPipe
link is valid.
Checks
- The field
cap
is required to be non-negative. - The field
pipe_length
is required to be non-negative. - The field
pipe_loss_factor
is required to be non-negative.
Field extraction methods
EnergyModelsBase.co2_int
— Functionco2_int(::ResourceHeat)
Returns 0.0 for all ResourceHeat
.
EnergyModelsBase.capacity
— Functioncapacity(l::DHPipe)
capacity(l::DHPipe, t)
Returns the capacity of a DHPipe l
as TimeProfile
or in operational period t
.
EnergyModelsBase.inputs
— Functioninputs(n::HeatPump)
inputs(n::HeatPump, p::Resource)
Returns the input resources of a HeatPump n
, specified via the fields heat_in_resource
and driving_force_resource
.
If the resource p
is specified, it returns a value of 1. This behaviour should in theory not occur.
EMB.inputs(l::DHPipe)
Return the resources transported into a given DHPipe l
. This resource is in a standard DHPipe
given by the function resource_heat
.
EnergyModelsBase.outputs
— FunctionEMB.outputs(l::DHPipe)
Return the resources transported out from a given DHPipe l
. This resource is in a standard DHPipe
given by the function resource_heat
.
Identification methods
EnergyModelsBase.has_capacity
— Functionhas_capacity(l::DHPipe)
The DHPipe
has a capacity, and hence, requires the declaration of capacity variables.