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
GasModels.constraint_weymouth
— Function.Weymouth equation with discrete direction variables
Weymouth equation with discrete direction variables
Weymouth equation with fixed direction variables
Weymouth equation with discrete direction variables
Weymouth equation with directed flow
Direction On/off Constraints
GasModels.constraint_on_off_pressure_drop
— Function.constraints on pressure drop across pipes
constraints on pressure drop across pipes
constraints on pressure drop across pipes
GasModels.constraint_on_off_pipe_flow_direction
— Function.constraints on flow across pipes
constraints on flow across pipes where the directions are fixed
constraints on flow across pipes
Network Expansion Constraints
GasModels.constraint_weymouth_ne
— Function.Weymouth equation with discrete direction variables for MINLP
Weymouth equation with discrete direction variables for MINLP
Weymouth equation with fixed directions for MINLP
Weymouth equation with discrete direction variables for MINLP
Weymouth equation with fixed direction
GasModels.constraint_on_off_pressure_drop_ne
— Function.constraints on pressure drop across pipes
constraints on pressure drop across pipes when the direction is fixed
constraints on pressure drop across pipes
constraints on flow across pipes
constraints on flow across pipes when directions are fixed
constraints on flow across pipes
Compressor Constraints
Direction On/off Constraints
constraints on flow across compressors
constraints on flow across compressors when directions are constants
constraints on flow across compressors
GasModels.constraint_on_off_compressor_ratios
— Function.enforces pressure changes bounds that obey compression ratios
on/off constraint for compressors when the flow direction is constant
enforces pressure changes bounds that obey compression ratios
Network Expansion Constraints
constraints on flow across compressors
constraints on flow across compressors when the directions are constants
constraints on flow across compressors
GasModels.constraint_on_off_compressor_ratios_ne
— Function.constraints on pressure drop across control valves
constraints on pressure drop across control valves
Control Valve Constraints
Direction On/off Constraints
constraints on flow across control valves
constraints on flow across control valves when directions are constants
constraints on flow across control valves
constraints on pressure drop across control valves
constraints on pressure drop across control valves when directions are constants
constraints on pressure drop across control valves
Valve Constraints
Direction On/off Constraints
GasModels.constraint_on_off_valve_flow_direction
— Function.constraints on flow across valves
constraints on flow across valves when directions are constants
constraints on flow across valves
GasModels.constraint_on_off_valve_pressure_drop
— Function.constraints on pressure drop across valves
constraints on pressure drop across valves
Short Pipes
Direction On/off Constraints
constraints on flow across short pipes
constraints on flow across short pipes when the directions are constants
constraints on flow across short pipes
GasModels.constraint_short_pipe_pressure_drop
— Function.constraints on pressure drop across pipes
constraints on pressure drop across pipes
Direction Cutting Constraints
GasModels.constraint_source_flow
— Function.Make sure there is at least one direction set to take flow away from a junction (typically used on source nodes)
Make sure there is at least one direction set to take flow away from a junction (typically used on source nodes)
GasModels.constraint_sink_flow
— Function.Make sure there is at least one direction set to take flow to a junction (typically used on sink nodes)
Make sure there is at least one direction set to take flow to a junction (typically used on sink nodes)
GasModels.constraint_conserve_flow
— Function.This constraint is intended to ensure that flow is on direction through a node with degree 2 and no production or consumption
This constraint is intended to ensure that flow is on direction through a node with degree 2 and no production or consumption
GasModels.constraint_parallel_flow
— Function.ensures that parallel lines have flow in the same direction
ensures that parallel lines have flow in the same direction
Network Expansion Constraints
GasModels.constraint_source_flow_ne
— Function.Make sure there is at least one direction set to take flow away from a junction (typically used on source nodes)
Make sure there is at least one direction set to take flow away from a junction (typically used on source nodes)
GasModels.constraint_sink_flow_ne
— Function.Make sure there is at least one direction set to take flow to a junction (typically used on sink nodes)
Make sure there is at least one direction set to take flow to a junction (typically used on sink nodes)
GasModels.constraint_conserve_flow_ne
— Function.This constraint is intended to ensure that flow is on direction through a node with degree 2 and no production or consumption
This constraint is intended to ensure that flow is on direction through a node with degree 2 and no production or consumption
GasModels.constraint_parallel_flow_ne
— Function.ensures that parallel lines have flow in the same direction
ensures that parallel lines have flow in the same direction