Package Overview
This page sketches the two pillars of EnergyModelsGasNetworks: gas transport based on flow-pressure relationship and quality-tracking pooling.
The detailed documentation on the methodology behind EnergyModelsGasNetworks can be found in Theoretical Background.
Flow–pressure coupling
- Potentials on nodes and links. Defining resources of type
ResourcePressureactivates the flow-pressure constraints (see Internal Constraints) on nodes and links. Potentials can be bounded withFixPressureData,MaxPressureData, orMinPressureData. - Weymouth relationship. For single-component flows, the pressure-flow curve is linearised with the first-order Taylor. The defined cuts will be defined between the minimum and maximum inlet pressures stored in
PressureLinkData. For blended gases, the non-convex surface is outer-approximated with planes generated by PiecewiseAffineApprox. - Optimiser The PWA planes require a MIP-capable solver; set it with
set_optimizer_pwa!(e.g., HiGHS, Xpress, Gurobi) before building the model. The discretisation step of the pressure grid for the approximations can be tuned viaset_step_pressure!.
Pooling and quality tracking
- Pooling formulation. Defining a resource of type
ResourcePoolingstores a blended resource and its subresources. Subresources can be of typeResourceCarrierorResourcePressure. The former activates only the pooling formulation, the latter the pooling formuation and flow-pressure constraints. - Quality limits.
RefBlendData(for nodes) andBlendLinkData(for links) subtypes specify maximum and minimum qualities for subresource at nodes or links. Quality is enforced at pooling nodes and sinks, and component proportions are tracked so they can be reused by the pressure formulation of blended gases.