Methods - EnergyModelsBase
Index
EnergyModelsBase.check_node
EnergyModelsBase.constraints_capacity
EnergyModelsBase.constraints_data
EnergyModelsBase.constraints_flow_out
EnergyModelsBase.constraints_level_aux
EnergyModelsBase.create_node
EnergyModelsBase.inputs
EnergyModelsBase.outputs
EnergyModelsBase.previous_level
EnergyModelsBase.variables_node
Extension methods
EnergyModelsBase.variables_node
— FunctionEMB.variables_node(m, 𝒩::Vector{<:CO2Storage}, 𝒯, modeltype::EnergyModel)
Create the optimization variable :stor_level_Δ_sp
for every CO2Storage
node. This variable accounts the increase in stor_level
during a strategic period.
This method is called from EnergyModelsBase.jl
.
EnergyModelsBase.create_node
— Functioncreate_node(m, n::CO2Storage, 𝒯, 𝒫, modeltype::EnergyModel)
Set all constraints for a CO2Storage
node.
It differs from the function for a standard RefStorage
node through modifying the flow to the node and not calling the functions constraints_flow_in
and constraints_flow_out
. The former is replaced with constraints directly within the function.
Called constraint functions
constraints_data
for allnode_data(n)
,constraints_level
,constraints_capacity
,constraints_opex_fixed
, andconstraints_opex_var
.
create_node(m, n::CCSRetroFit, 𝒯, 𝒫, modeltype::EnergyModel)
Set all constraints for a CCSRetroFit
.
It differs from the function for a standard NetworkNode
node through modifying the flow to the node for the CO₂ proxy resource. The function constraints_flow_in
is hence not called.
Called constraint functions
constraints_data
for allnode_data(n)
,constraints_flow_out
,constraints_capacity
,constraints_opex_fixed
, andconstraints_opex_var
.
Constraint methods
EnergyModelsBase.constraints_flow_out
— FunctionEMB.constraints_flow_out(m, n::CO2Source, 𝒯::TimeStructure, modeltype::EnergyModel)
Function for creating the constraint on the outlet flow from CO2Source
. The standard constraints_flow_out
function does not allow CO₂ as an outlet flow as the CO₂ outlet flow is specified in the constraints_data
function to implement CO₂ capture.
EMB.constraints_flow_out(
m,
n::NetworkNodeWithRetrofit,
𝒯::TimeStructure,
modeltype::EnergyModel
)
Function for creating the constraint on the outlet flow from NetworkNodeWithRetrofit
. The standard constraints_flow_out
function does allow for the CO₂ proxy as an outlet flow. In the case of retrofitting CO2 capture, this flow constraint is handlded
EnergyModelsBase.constraints_level_aux
— FunctionEMB.constraints_level_aux(m, n::Storage, 𝒯, 𝒫, modeltype::EnergyModel)
Function for creating the Δ constraint for the level of a reference storage node with a ResourceCarrier
resource.
EnergyModelsBase.constraints_capacity
— FunctionEMB.constraints_capacity(m, n::CO2Storage, 𝒯::TimeStructure, modeltype::EnergyModel)
Function for creating the constraint on the maximum level of a CO2Storage
node. As a CO2Storage
node is accumulating, the upper bound is provided as well by the sum of the changes in all strategic periods.
EnergyModelsBase.constraints_data
— FunctionEMB.constraints_data(
m,
n::NetworkNodeWithRetrofit,
𝒯,
𝒫,
modeltype::EnergyModel,
data::EmissionsData
)
Constraints functions for calculating both the emissions and amount of CO₂ captured in the process when CO₂ capture is included as retrofit. It works similar to the approach of EnergyModelsBase
.
The functions are updated for a NetworkNodeWithRetrofit
-node as the output is the CO₂ proxy and not CO₂.
EMB.constraints_data(m, n::CCSRetroFit, 𝒯, 𝒫, modeltype::EnergyModel, data::EmissionsData)
Constraints functions for calculating both the emissions and amount of CO₂ captured in the CO₂ capture unit.
There exist several configurations for incorporation of CO₂ capture:
data::CaptureProcessEnergyEmissions
:Capture of both the flue gas emissions, process emissions, and energy usage related emissions.
data::CaptureEnergyEmissions
:Capture of both the flue gas emissions and energy usage related emissions.
data::CaptureProcessEmissions
:Capture of both the flue gas emissions and process emissions.
data::CaptureFlueGas
:Capture only both the flue gas emissions.
The functions are updated for a CCSRetroFit
-node as CO₂ emissions require a different calculation due to the inclusion of the CO₂ proxy resource for the flue gas.
Utility methods
EnergyModelsBase.previous_level
— FunctionEMB.previous_level(
m,
n::CO2Storage,
prev_pers::PreviousPeriods,
cyclic_pers::CyclicPeriods,
modeltype::EnergyModel,
)
Adding methods for the function EnergyModelsBase.previous_level
for a CO2Storage
node. the additional methods are only relevant for the first operational period of a strategic period while the framework utilizes the functions from EneryModelsBase
for all other periods.
prev_pers::PreviousPeriods{Nothing,Nothing,Nothing}
The previous level in the first operational period in the first representative period in the first strategic period is set to 0.
The reason for that is that the storage is considered to be empty in the beginning of the analysis.
prev_pers::PreviousPeriods{<:TS.AbstractStrategicPeriod,Nothing,Nothing}
The previous level in the first operational period in the first representative period in all strategic periods except for the first is set to the accumulated value in the previous strategic periods.
EnergyModelsBase.inputs
— FunctionEMB.inputs(n::CCSRetroFit)
EMB.inputs(n::CCSRetroFit, p::Resource)
When the node is a CCSRetroFit
, it returns the co2_proxy
resource in addition to the keys of the input
dictionary.
If the resource p
is specified, it returns the value of input
resource p
or 0 if p
is the co2_proxy
resource.
EnergyModelsBase.outputs
— FunctionEMB.outputs(n::CO2Storage)
EMB.outputs(n::CO2Storage, p::Resource)
When the node is a CO2Storage
, it returns an empty array.
If the resource p
is specified, it returns a value of 0.
EMB.outputs(n::NetworkNodeWithRetrofit)
EMB.outputs(n::NetworkNodeWithRetrofit, p::Resource)
When the node is a NetworkNodeWithRetrofit
, it returns the co2_proxy
resource in addition to the keys of the output
dictionary.
If the resource p
is specified, it returns the value of output
resource p
or 0 if p
is the co2_proxy
resource.
Check methods
EnergyModelsBase.check_node
— FunctionEMB.check_node(n::CO2Source, 𝒯, modeltype::EnergyModel, check_timeprofiles::Bool)
This method checks that a CO2Source
node is valid.
It reuses the standard checks of a Source
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. - The values of the dictionary
output
are required to be non-negative. - 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 field
data
does not includeCaptureData
.