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

The primary constraints related to junctions ensure that mass flow is balanced at these nodes. The specifics of the constraint implementation will change if there are variable or constant injections (variable injections are denoted by ls in the name of the function) and if there are network design options (denoted by \_ne in the name of the function).

Constraint: standard mass flow balance equation where demand and production are constants

source

Template: Constraints for mass flow balance equation where demand and production are constants

source

Constraint: standard mass flow balance equation where demand and production are constants

source

Constraint: standard flow balance equation where demand and production are variables

source

Template: Constraints for mass flow balance equation where demand and production is are a mix of constants and variables

source

Constraint: standard flow balance equation where demand and production are variables

source

Constraint: standard flow balance equation where demand and production are constants and there are expansion connections

source

Template: Constraints for mass flow balance equation where demand and production are constants and there are expansion connections

source

Constraint: standard flow balance equation where demand and production are constants and there are expansion connections

source

Constraint: standard flow balance equation where demand and production are variables and there are expansion connections

source

Template: Constraints for mass flow balance equation where demand and production is are a mix of constants and variables and there are expansion connections

source

Constraint: standard flow balance equation where demand and production are variables and there are expansion connections

source

Direction On/off Constraints

The disjunctive forms of problems (where directions are controlled by on/off variables) include special (redundant) constraints which tie the direction variables together. Examples include ensuring that ensure at least one edge of junction that has only sources of natural gas has outgoing flow.

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

source

Template: Constraints for ensuring that at least one direction is set to take flow away from a junction (typically used on source nodes)

source

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

source

Template: Constraints for ensuring that at least one direction is set to take flow away from a junction (typically used on sink nodes)

source

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

source

Template: Constraints to ensure that flow is the same direction through a node with degree 2 and no production or consumption

source

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

source

Template: Constraints for ensuring that at least one direction is set to take flow away from a junction (typically used on source nodes)

source

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

source

Template: Constraints for ensuring that at least one direction is set to take flow away from a junction (typically used on sink nodes)

source

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

source

Template: Constraints to ensure that flow is the same direction through a node with degree 2 and no production or consumption

source

Pipe Constraints

Weymouth's law constraints

The primary constraints related to pipes ensure that that pressure drop and flow across a pipe is related through the Weymouth relationships. Here, the naming convention ne is used to denote the form of the constraint used for expansion pipes and directed is used to denote the form of the constraint used when the direction of flow is constrained.

Template: Weymouth equation for defining the relationship between pressure drop and flow across a pipe

source

Constraint: Weymouth equation–not applicable for MIP models

source

Constraint: Weymouth equation–not applicable for LP models

source

Weymouth equation with absolute value

source

Weymouth equation with discrete direction variables

source

Weymouth equation for an undirected pipe

source

Template: Weymouth equation for expansion pipes

source

Constraint: Weymouth equation–not applicable for MIP models–not applicable for MIP models

source

Constraint: Weymouth equation–not applicable for MIP models–not applicable for LP models

source

Weymouth equation for an undirected expansion pipe

source

Weymouth equation for an undirected expansion pipe

source

Weymouth equation for an undirected expansion pipe

source

Template: Weymouth equation for defining the relationship between pressure drop and flow across a pipe where flow is constrained in one direction

source

Constraint: Weymouth equation with one way direction–not applicable for MIP models

source

Constraint: Weymouth equation with one way direction–not applicable for LP models

source

Weymouth equation with one way direction

source

Weymouth equation with one way direction

source

Weymouth equation with a pipe with one way flow

source

Template: Weymouth equation for expansion pipes where flow is restricted to one direction

source

Constraint: Weymouth equation–not applicable for MIP models–not applicable for MIP models

source

Constraint: Weymouth equation–not applicable for MIP models–not applicable for LP models

source

Weymouth equation for directed expansion pipes

source

Weymouth equation for directed expansion pipes

source

Weymouth equation for expansion pipes with undirected expansion pipes

source

Mass flow and pressure drop constraints

Secondarily, there are constraints associated with limits on pressure drop or mass flow across pipes. These constraints also use the ne and directed naming conventions.

Constraint: Constraint on mass flow across the pipe

source

Template: Constraint on mass flow across a pipe

source

Constraint: Constraint on flow across a pipe when there are on/off direction variables

source

Constraint: Constraints which define pressure drop across a pipe

source

Template: Pressure drop across pipes with on/off direction variables

source

Constraint: Constraints which define pressure drop across a pipe

source

Constraint: Constraints which define pressure drop across a pipe

source

Constraint: Constraints which define pressure drop across a pipe when there are on/off direction variables

source

Network expansion constraints

These constraints turn on or off the association between pressure and flow for pipes desiginated as expansion options.

Constraint: on/off constraints on flow across pipes for expansion pipes

source

Template: Constraint associatd with turning off flow depending on the status of expansion pipes

source

Direction on/off constraints

The disjunctive forms of problems (where directions are controlled by on/off variables) include special (redundant) constraints which tie the direction variables together. Examples include ensuring that ensuring that parallel pipes have flow in the same direction.

Constraint: ensures that parallel lines have flow in the same direction

source

Template: Constraints which ensure that parallel lines have flow in the same direction

source

Constraint: ensures that parallel lines have flow in the same direction

source

Template: Constraints which ensure that parallel lines have flow in the same direction

source

Compressor Constraints

Operations Constraints

The primary constraints related to compressors ensure that that the compressors operate within the limits of their capability (boost ratio, energy consumption, etc.). These constraints use the ne and directed naming conventions to denote constraints where the compressor is an expansion option or direction of flow is fixed, respectively.

Template: Compression ratios for a compressor

source

Constraint: Compressor ratio constraints on pressure differentials–not applicable for MIP models

source

Constraint: Compressor ratio constraints on pressure differentials–not applicable for LP models

source

enforces pressure changes bounds that obey compression ratios for an undirected compressor.

source

Constraint: enforces pressure changes bounds that obey compression ratios for a compressor with on/off direction variables

source

Constraint: Compressor ratio when the flow direction is constrained

source

Template: Constraints on compressor ratios when flow is restricted to one direction

source

Constraint: Compressor ratio when the flow direction is constrained–not applicable for MIP models

source

Constraint: Compressor ratio when the flow direction is constrained–not applicable for LP models

source

Template: constraints on pressure drop across a compressor

source

Constraint: compressor ratios on a new compressor–not applicable for MIP models-not applicable for MIP models

source

Constraint: compressor ratios on a new compressor–not applicable for MIP models-not applicable for LP models

source

constraints on pressure drop across a compressor

source

Constraint: constraints on pressure drop across expansion compressors with on/off decision variables

source

Constraint: Pressure drop across an expansion compressor when direction is constrained

source

Template: Constraints on compressor ratios when flow is restricted to one direction and the compressor is an expanson option

source

Constraint: Pressure drop across an expansion compressor when direction is constrained-not applicable for MIP models

source

Constraint: Pressure drop across an expansion compressor when direction is constrained-not applicable for LP models

source

Constraint: constraints on flow across a compressor with on/off direction variables

source

Template: constraints on flow across a compressor

source

Constraint: constraints on flow across a compressor with on/off direction variables

source

Direction On/off Constraints

The disjunctive forms of problems (where directions are controlled by on/off variables) include special constraints to connect direction of flow with the choice of the binary variable.

Missing docstring.

Missing docstring for constraint_parallel_flow. Check Documenter's build log for details.

Missing docstring.

Missing docstring for constraint_parallel_flow_ne. Check Documenter's build log for details.

Network Expansion Constraints

Constraints are also used to turn on/off flow through a compressor in expansion planning formulations

Constraint: on/off constraints on flow across compressors for expansion variables

source

Template: Constraint for turning on or off flow through expansion compressor

source

Control Valve Constraints

Operations Constraints

The primary constraints related to control valves ensure that that the valves operate within the limits of their capability (pressure reduction). These constraints use the directed naming conventions to denote constraints where the control valve direction of flow is fixed. The control valve also has an open/close variable to determine whether or not flow is allowed through the valve

constraints on flow across control valves that are undirected

source

Template: constraints on flow across control valves with on/off direction variables

source

Constraint: Constraints on flow across control valves with on/off direction variables

source

Constraint Enforces pressure changes bounds that obey decompression ratios for

source

constraints on pressure drop across control valves that are undirected–not applicable for MIP models

source

constraints on pressure drop across control valves that are undirected–not applicable for LP models

source

constraints on pressure drop across control valves that are undirected

source

Constraint: Constraints on pressure drop across control valves that have on/off direction variables

source

Constraint: Flow across control valves when direction is constrained

source

Template: Constraints on control valve flows when flow is restricted to one direction

source

Constraint: Pressure drop across a control valves when directions is constrained

source

Template: Constraints on control valve pressure when flow is restricted to one direction

source

Constraint: Pressure drop across a control valves when directions is constrained–not applicable for MIP models

source

Constraint: Pressure drop across a control valves when directions is constrained–not applicable for LP models

source

Direction On/off Constraints

The disjunctive forms of problems (where directions are controlled by on/off variables) include special constraints to connect direction of flow with the choice of the binary variable.

Missing docstring.

Missing docstring for constraint_parallel_flow. Check Documenter's build log for details.

Missing docstring.

Missing docstring for constraint_parallel_flow_ne. Check Documenter's build log for details.

Valve Constraints

Operations Constraints

The primary function of a valve is to open or close a pipe. These constraints use the directed naming conventions to denote constraints where the valve direction of flow is fixed.

constraints on flow across undirected valves

source

Template: constraints on flow across valves modeled with on/off direction variables

source

Constraint: Constraints on flow across valves with on/off direction variables

source

Constraint: Constraints on pressure drop across valves where the valve can open or close

source

Template: Constraint on pressure drop across valves, where the valve may be closed or opened

source

Constraint: Constraints on pressure drop across valves where the valve can open or close–not applicable for MIP models

source

Constraint: Constraints on pressure drop across valves where the valve can open or close–not applicable for LP models

source

Direction On/off Constraints

The disjunctive forms of problems (where directions are controlled by on/off variables) include special constraints to connect direction of flow with the choice of the binary variable.

Missing docstring.

Missing docstring for constraint_parallel_flow. Check Documenter's build log for details.

Missing docstring.

Missing docstring for constraint_parallel_flow_ne. Check Documenter's build log for details.

Short Pipes

Pressure Constraints

Short pipes are used to model frictionless connections between junctions. The primary constraint ensures the pressure on both sides of the short pipe are the same. These constraints use the directed naming conventions to denote constraints where the control valve direction of flow is fixed.

Constraint: Constraint on pressure drop across a short pipe

source

Template: Constraint on pressure drop across a short pipe

source

Constraint: Constraint on pressure drop across a short pipe–not applicable for MIP models

source

Constraint: Constraint on pressure drop across a short pipe–not applicable for LP models

source

Constraint: Constraints on flow across a short pipe with on/off direction variables

source

Constraint: constraints on flow across a short pipe

source

Constraint: Constraints on flow across a short pipe with on/off direction variables

source
Missing docstring.

Missing docstring for cconstraint_short_pipe_mass_flow_directed. Check Documenter's build log for details.

Direction On/off Constraints

The disjunctive forms of problems (where directions are controlled by on/off variables) include special constraints to connect direction of flow with the choice of the binary variable.

Missing docstring.

Missing docstring for constraint_parallel_flow. Check Documenter's build log for details.

Missing docstring.

Missing docstring for constraint_parallel_flow_ne. Check Documenter's build log for details.