Constraints

Constraints

Constraint Templates

Constraint templates help simplify data wrangling across multiple Gas Flow formulations by providing an abstraction layer between the network data and network constraint definitions. The constraint template's job is to extract the required parameters from a given network data structure and pass the data as named arguments to the Gas Flow formulations.

These templates should be defined over GenericGasModel and should not refer to model variables. For more details, see the files: core/constraint_template.jl and core/constraint.jl.

Junction Constraints

Flow Balance Constraints

constraint_junction_flow_balance

Load Shedding Constraints

constraint_junction_flow_balance_ls

Network Expansion Constraints

constraint_junction_flow_balance_ne
constraint_junction_flow_balance_ne_ls

Pipe Constraints

Weymouth's Law Constraints

Weymouth equation with discrete direction variables

source

Weymouth equation with discrete direction variables

source

Weymouth equation with fixed direction variables

source

Weymouth equation with discrete direction variables

source

Weymouth equation with directed flow

source

Direction On/off Constraints

constraints on pressure drop across pipes

source

constraints on pressure drop across pipes

source

constraints on pressure drop across pipes

source

constraints on flow across pipes

source

constraints on flow across pipes where the directions are fixed

source

constraints on flow across pipes

source

Network Expansion Constraints

Weymouth equation with discrete direction variables for MINLP

source

Weymouth equation with discrete direction variables for MINLP

source

Weymouth equation with fixed directions for MINLP

source

Weymouth equation with discrete direction variables for MINLP

source

Weymouth equation with fixed direction

source

constraints on pressure drop across pipes

source

constraints on pressure drop across pipes when the direction is fixed

source

constraints on pressure drop across pipes

source

constraints on flow across pipes

source

constraints on flow across pipes when directions are fixed

source

constraints on flow across pipes

source

Compressor Constraints

Direction On/off Constraints

constraints on flow across compressors

source

constraints on flow across compressors when directions are constants

source

constraints on flow across compressors

source

enforces pressure changes bounds that obey compression ratios

source

on/off constraint for compressors when the flow direction is constant

source

enforces pressure changes bounds that obey compression ratios

source

Network Expansion Constraints

constraints on flow across compressors

source

constraints on flow across compressors when the directions are constants

source

constraints on flow across compressors

source

constraints on pressure drop across control valves

source

constraints on pressure drop across control valves

source

Control Valve Constraints

Direction On/off Constraints

constraints on flow across control valves

source

constraints on flow across control valves when directions are constants

source

constraints on flow across control valves

source

constraints on pressure drop across control valves

source

constraints on pressure drop across control valves when directions are constants

source

constraints on pressure drop across control valves

source

Valve Constraints

Direction On/off Constraints

constraints on flow across valves

source

constraints on flow across valves when directions are constants

source

constraints on flow across valves

source

constraints on pressure drop across valves

source

constraints on pressure drop across valves

source

Short Pipes

Direction On/off Constraints

constraints on flow across short pipes

source

constraints on flow across short pipes when the directions are constants

source

constraints on flow across short pipes

source

constraints on pressure drop across pipes

source

constraints on pressure drop across pipes

source

Direction Cutting Constraints

Make sure there is at least one direction set to take flow away from a junction (typically used on source nodes)

source

Make sure there is at least one direction set to take flow away from a junction (typically used on source nodes)

source

Make sure there is at least one direction set to take flow to a junction (typically used on sink nodes)

source

Make sure there is at least one direction set to take flow to a junction (typically used on sink nodes)

source

This constraint is intended to ensure that flow is on direction through a node with degree 2 and no production or consumption

source

This constraint is intended to ensure that flow is on direction through a node with degree 2 and no production or consumption

source

ensures that parallel lines have flow in the same direction

source

ensures that parallel lines have flow in the same direction

source

Network Expansion Constraints

Make sure there is at least one direction set to take flow away from a junction (typically used on source nodes)

source

Make sure there is at least one direction set to take flow away from a junction (typically used on source nodes)

source

Make sure there is at least one direction set to take flow to a junction (typically used on sink nodes)

source

Make sure there is at least one direction set to take flow to a junction (typically used on sink nodes)

source

This constraint is intended to ensure that flow is on direction through a node with degree 2 and no production or consumption

source

This constraint is intended to ensure that flow is on direction through a node with degree 2 and no production or consumption

source

ensures that parallel lines have flow in the same direction

source

ensures that parallel lines have flow in the same direction

source