Public Interface
This page lists the main user-facing types and controls added by EnergyModelsGasNetworks.
Controls
EnergyModelsGasNetworks.set_step_pressure! — Function
set_step_pressure!(step_pressure)Set the spacing of the pressures used to generate piecewise-affine Weymouth cuts for blended gases. Default is 10 (e.g., bars).
EnergyModelsGasNetworks.set_optimizer_pwa! — Function
set_optimizer_pwa!(opt)Set the optimizer used by EnergyModelsGasNetworks for PWA approximations.
EnergyModelsGasNetworks.delete_cache — Function
delete_cache()Deletes all files in the cache directory. Use with caution, as this will remove all cached PWA approximations.
Resources and blends
EnergyModelsGasNetworks.ResourcePressure — Type
ResourcePressure{T<:Real} <: CompoundResourceResource with an associated pressure potential in addition to a flow rate.
Fields
idis the name/identifier of the resource.co2_int::Tis the CO₂ intensity (e.g. t/MWh).
EnergyModelsGasNetworks.ResourcePooling — Type
ResourcePooling{T<:Real} <: EMB.ResourceResource that represents a blend of subresources.
Note! When the subresources are ResourcePressure, the pressure formulation is also activated for the blend. Otherwise, the blend activates only the pooling constraints.
Nodes
EnergyModelsGasNetworks.SimpleCompressor — Type
SimpleCompressor <: CompressorCompressor that adds a pressure increase (potential_Δ) and pays variable cost through an energy input proportional to cap_use.
Fields
id::Anyis the name/identifier of the link.cap::TimeProfileis the maximum flow that the compressor can handle.opex_var::TimeProfileis the variable operational expenditure of the compressor, based on inflow.opex_fixed::TimeProfileis the fixed operational expenditure of the compressor.input::Dict{<:Resource,<:Real}is the input flow into the SimpleCompressor. Include both the inflow resource and the energy resource needed for the potential increase.output::Dict{<:Resource,<:Real}is the output flow from the SimpleCompressor. Only include the outflow resource.max_incr_potential::TimeProfileis the maximum potential increase the SimpleCompressor can provide.
EnergyModelsGasNetworks.PoolingNode — Type
New NetworkNode that overwrite the function constraints flowin such that capuse is the sum of the flowin for blend resources. The constraint flowout remain as standard NetworkNodes where capuse = flowout (only one resource is out of PoolingNode)
TODO: Define a check that guarantees that only one resource is in output.
EnergyModelsGasNetworks.RefConversion — Type
struct RefConversion <: UnitConversionDefault UnitConversion node to convert units.
Fields
id::Anyis the name/identifier of the node.input::Dict{<:Resource,<:Real}is the input flow into the RefConversion. The conversion valueRealis not used. #TODO: As the conversion value is not used, should we consider changing the type ofinputtoVector{<:Resource}?output::Dict{<:Resource,<:Real}is the output flow from the RefConversion. The conversion valueRealis not used. #TODO: As the conversion value is not used, should we consider changing the type ofoutputtoVector{<:Resource}?data::Vector{<:EMB.ExtensionData}is the vector ofExtensionData. This data will define the type of conversion (e.g., volumetric flow to energy).
Links
EnergyModelsGasNetworks.CapDirect — Type
struct CapDirect{T} <: LinkA direct link between two nodes with a maximum capacity and data.
Fields
idis the name/identifier of the link.from::Nodeis the node from which there is flow into the link.to::Nodeis the node to which there is flow out of the link.formulation::Formulationis the used formulation of links. If not specified, aLinearlink is assumed.cap::Tis the maximum capacity of the link.data::Vector{<:ExtensionData}is a vector of extension data associated with the link.
Data structures
EnergyModelsGasNetworks.PressureLinkData — Type
PressureLinkData <: AbstractLinkPressureDataData for Links necessary to model the flow-pressure behaviour.
Fields
weymouth::Realactual weymouth constant value of the line (pipe)max_potential::Realis the maximum inlet pressure of the link, used to calculate the approximations.min_potential::Realis the minimum inlet pressure of the link, used to calculate the approximations.
EnergyModelsGasNetworks.FixPressureData — Type
FixPressureDataSet a fixed pressure in nodes or links.
EnergyModelsGasNetworks.MaxPressureData — Type
MaxPressureDataSet a maximum pressure in nodes or links.
EnergyModelsGasNetworks.MinPressureData — Type
MinPressureDataSet a minimum pressure in nodes or links.
EnergyModelsGasNetworks.RefBlendData — Type
RefBlendData{T<:CompoundResource} <: BlendDataBlending data for controlling the quality of Nodes. #TODO: Create a check that guarantees that the resources in maxproportion and minproportion are either ResourceComponent or ResourceComponentPotential.
EnergyModelsGasNetworks.BlendLinkData — Type
BlendLinkData{T<:CompoundResource} <: BlendDataBlending data for Links. #TODO: Create a check that guarantees that the resources in maxproportion and minproportion are either ResourceComponent or ResourceComponentPotential.
EnergyModelsGasNetworks.FlowToEnergyData — Type
struct FlowToEnergyData <: UnitsDataData structure for converting flow units to energy units in UnitConversion nodes.
Fields
specific_energy_content::Union{Real, Dict{<:Resource,<:Real}}it contains the specific energy content of the resources involved in the conversion.
If the input into the UnitConversion node is a single resource, it is enough to provide the value as a Real. If the input into the UnitConversion node is a ResourcePooling, one must provide a Dict{<:Resource,<:Real} with the specific energy content of each resource in the blend.