Skip to content

Latest commit

 

History

History
200 lines (129 loc) · 6.4 KB

constraints.md

File metadata and controls

200 lines (129 loc) · 6.4 KB

Constraints

CurrentModule = GasModels

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 AbstractGasModel 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 network design options (denoted by \_ne in the name of the function).

constraint_mass_flow_balance
constraint_mass_flow_balance_ne

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_source_flow
constraint_sink_flow
constraint_conserve_flow
constraint_source_flow_ne
constraint_sink_flow_ne
constraint_conserve_flow_ne

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.

constraint_pipe_weymouth
constraint_pipe_weymouth_ne
constraint_pipe_weymouth_ne

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 naming conventions.

constraint_pipe_mass_flow
constraint_pipe_pressure

Network expansion constraints

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

constraint_pipe_ne

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_pipe_parallel_flow
constraint_ne_pipe_parallel_flow

Resistor Constraints

Weymouth's law constraints

The primary constraints related to resistor ensure that that pressure drop and flow across a resistor is related through the Weymouth relationships.

constraint_resistor_weymouth

Mass flow and pressure drop constraints

Secondarily, there are constraints associated with limits on pressure drop or mass flow across pipes.

constraint_resistor_mass_flow
constraint_resistor_pressure

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_resistor_parallel_flow

Loss Resistor Constraints

The primary constraints related to loss resistors ensure that the pressure drop is constant along each edge. They also ensure that squared pressure variables are somehow related to (nonsquared) pressure variables.

Mass flow and pressure drop constraints

constraint_loss_resistor_mass_flow
constraint_loss_resistor_pressure

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 naming conventions to denote constraints where the compressor is an expansion option.

constraint_compressor_ratios
constraint_compressor_ratios_ne
constraint_compressor_mass_flow
constraint_compressor_energy

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.

constraint_compressor_parallel_flow
constraint_ne_compressor_parallel_flow

Network Expansion Constraints

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

constraint_compressor_ne

Regulator Constraints

Operations Constraints

The primary constraints related to regulator ensure that that the valves operate within the limits of their capability (pressure reduction). The control valve also has an open/close variable to determine whether or not flow is allowed through the valve

constraint_on_off_regulator_mass_flow
constraint_on_off_regulator_pressure

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.

constraint_regulator_parallel_flow

Valve Constraints

Operations Constraints

The primary function of a valve is to open or close a pipe.

constraint_on_off_valve_mass_flow
constraint_on_off_valve_pressure

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.

constraint_valve_parallel_flow

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.

constraint_short_pipe_pressure
constraint_short_pipe_mass_flow

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.

constraint_short_pipe_parallel_flow