Methods - EnergyModelsBase
Index
EnergyModelsBase.capacityEnergyModelsBase.check_linkEnergyModelsBase.check_nodeEnergyModelsBase.co2_intEnergyModelsBase.constraints_capacityEnergyModelsBase.constraints_flow_inEnergyModelsBase.constraints_flow_outEnergyModelsBase.constraints_level_iterateEnergyModelsBase.create_linkEnergyModelsBase.has_capacityEnergyModelsBase.inputsEnergyModelsBase.outputsEnergyModelsBase.variables_link
Extension methods
EnergyModelsBase.create_link — Function
EMB.create_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 — Function
EMB.variables_link(m, ℒˢᵘᵇ::Vector{<:DHPipe}, 𝒯, modeltype::EnergyModel)Creates the following additional variable for ALL district heating pipe links:
dh_loss[l, t]is a continuous variable describing the heat los ofDHPipeloperational periodt.
Constraint methods
EnergyModelsBase.constraints_level_iterate — Function
EMB.constraints_level_iterate(
m,
n::AbstractTES,
prev_pers::PreviousPeriods,
cyclic_pers::CyclicPeriods,
per,
_::SimpleTimes,
modeltype::EnergyModel,
)In the case of a AbstractTES, the lowest level iterator is adjusted as the loss is dependent on the level at the beginning of the operational period.
EnergyModelsBase.constraints_capacity — Function
EMB.constraints_capacity(m, n::HeatPump, 𝒯::TimeStructure, modeltype::EnergyModel)Method for creating the constraints on the maximum capacity of a HeatPump.
It adds in the addition to the constraints of the standard method the lower bound constraints.
EnergyModelsBase.constraints_flow_in — Function
EMB.constraints_flow_in(m, n::HeatPump, 𝒯::TimeStructure, modeltype::EnergyModel)Method for creating the constraint on the inlet flow to a HeatPump.
It is utlizing the specified temperature levels, heat_in_resource and driving_force_resource for calculating the values.
EMB.constraints_flow_in(m, n::DirectHeatUpgrade, 𝒯::TimeStructure, modeltype::EnergyModel)Method for creating the constraint on the inlet flow to a 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. The capacity is linked to the power consumption.
EnergyModelsBase.constraints_flow_out — Function
EMB.constraints_flow_out(m, n::HeatExchanger{A,T}, 𝒯::TimeStructure, modeltype::EnergyModel)Method for creating the constraint on the outlet flow from a HeatExchanger.
The flow of available heat energy is calculated from the temperatures in the heat flows using the function dh_fraction.
EMB.constraints_flow_out(m, n::DirectHeatUpgrade{A,T}, 𝒯::TimeStructure, modeltype::EnergyModel) where {A,T}Method for creating the constraint on the outlet flow 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.
Check methods
EnergyModelsBase.check_node — Function
check_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
capis required to be non-negative (similar to theNetworkNodecheck). - The value of the field
fixed_opexis required to be non-negative and accessible through aStrategicPeriodas outlined in the functioncheck_fixed_opex(n, 𝒯ᴵⁿᵛ, check_timeprofiles). - The values of the dictionary
inputandoutputare required to be non-negative (similar to theNetworkNodecheck). - The field
cap_lower_boundis required to be in the range $[0, 1]$ for all time steps $t ∈ \mathcal{T}$. - The field
eff_carnotis required to be in the range $[0, 1]$ for all time steps $t ∈ \mathcal{T}$. - The field
t_sinkis required to be greater than or equal to the fieldt_sourcefor all time steps $t ∈ \mathcal{T}$.
EMB.check_node(n::AbstractTES{T}, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool) where {T<:StorageBehavior}This method checks that nodes of the type AbstractTES are 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
TimeProfileof the fieldcapacityin the type in the fieldchargeis required to be non-negative if the chosen composite type has the fieldcapacity. - The
TimeProfileof the fieldcapacityin the type in the fieldlevelis required to be non-negative`. - The
TimeProfileof the fieldcapacityin the type in the fielddischargeis required to be non-negative if the chosen composite type has the fieldcapacity. - The
TimeProfileof the fieldfixed_opexis required to be non-negative and accessible through aStrategicPeriodas outlined in the function [check_fixed_opex(n, 𝒯ᴵⁿᵛ, check_timeprofiles)] for the chosen composite type . - The values of the dictionary
inputare required to be non-negative. - The values of the dictionary
outputare required to be non-negative. - The value of the field
heat_loss_factoris required to be in the range $[0, 1]$.
Warnings
- The
StorageBehaviorshould not beCyclicStrategicwhen usingRepresentativePeriods.
EMB.check_node(n::BoundRateTES{T}, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool) where {T<:EMB.StorageBehavior}This method checks that the BoundRateTES 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
TimeProfileof the fieldcapacityin the type in the fieldchargeis required to be non-negative if the chosen composite type has the fieldcapacity. - The
TimeProfileof the fieldcapacityin the type in the fieldlevelis required to be non-negative`. - The
TimeProfileof the fieldcapacityin the type in the fielddischargeis required to be non-negative if the chosen composite type has the fieldcapacity. - The
TimeProfileof the fieldfixed_opexis required to be non-negative and accessible through aStrategicPeriodas outlined in the function [check_fixed_opex(n, 𝒯ᴵⁿᵛ, check_timeprofiles)] for the chosen composite type . - The values of the dictionary
inputare required to be non-negative. - The values of the dictionary
outputare required to be non-negative. - The value of the field
heat_loss_factoris required to be in the range $[0, 1]$. - The value of the field
level_dischargeis required to be non-negative. - The value of the field
level_chargeis required to be non-negative.
Warnings
- The
StorageBehaviorshould not beCyclicStrategicwhen usingRepresentativePeriods.
EnergyModelsBase.check_link — Function
EMB.check_link(l::DHPipe, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)This method checks that the DHPipe link is valid.
Checks
- The field
capis required to be non-negative. - The field
pipe_lengthis required to be non-negative. - The field
pipe_loss_factoris required to be non-negative.
Field extraction methods
EnergyModelsBase.co2_int — Function
co2_int(::ResourceHeat)Returns 0.0 for all ResourceHeat.
EnergyModelsBase.capacity — Function
capacity(l::DHPipe)
capacity(l::DHPipe, t)Returns the capacity of a DHPipe l as TimeProfile or in operational period t.
EnergyModelsBase.inputs — Function
inputs(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 — Function
EMB.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 — Function
has_capacity(l::DHPipe)The DHPipe has a capacity, and hence, requires the declaration of capacity variables.