lanl-ansi/GasPowerModels.jl

Gas flow in parallel pipelines

Closed this issue · 3 comments

Hi,

I am trying to replicate the power gas model (belgium gas with IEEE14 bus) in python following the formulation in Convex Optimization for Joint Expansion Planning of Natural Gas and Power Systems. I ran into an issues with gas flow in parallel pipelines. I wonder if you have encountered the same issue. My model gave a very similar results for the gas flow as the gaspowermodel julia package. The only issue is that only one pipe has gas flow among parallel pipelines. For example, pipeline 1 and pipeline 2 are parallel pipelines that connect junction 1 and junction 2. The gas flow of pipeline 1 in my model is the sum of the gas flow of pipeline1 and pipeline 2 in the julia package model. I wonder whether this is an issue with the second order cone relaxation. Because equation 17 in the paper is greater or equal to, the flow can be 0 in pipeline2, which satisfies the weymouth equation. Meanwhile, the gas mass flow balance is met through pipeline1's transportation of gas. I have already set the binary flow direction variables of parallel pipelines to be the same. May I ask whether you have encountered the same issue and whether there is a fix? A picture of comparison of flow variables are attached? Thanks very much for your help.
image

Yes, since the second order cone model is a relaxation, there is no guarantee that that the Weymouth relationship (physics) will hold with equality. Indeed, with parallel pipes, for the same total flow through the parallel pipes, the relaxation will allow many different ways for the flow to split and the solver will choose an arbitrary one. So, there is not really a fix since the relaxations allow this. If you need the Weymouth equations to be solved with equality, you will need to use WP or DWP model (NLP or MINLP in the deprecated naming conventions). Of course, these models are harder to solve since they are not convex, but I expect the IEEE 14 + belgian is small enough that it might be solved.

When using the relaxation, you get a solution that is bound on the solution you would get if all the physics were satisfied with equality (see https://pubsonline.informs.org/doi/abs/10.1287/ijoc.2016.0697 for some more discussion)

Thanks for the response. For the NLP formulation, will the direction of pipe and compressor be fixed to transform the binary variable into parameters? Or the sign function can be used to substitute the binary direction variable and the model is NLP?
If the solver chooses an arbitrary spilt of flow for parallel pipes, are the results on the left side of picture, which was obtained when I specified g_type as MISOCPGasModel, just one possibility among many possibilities of splits? (I think so but just want to ask to make sure because there is no 0 flow in any pipe in julia results). Or was the julia package actually running MINLP formulation? Thanks.

We have adopted this model for defining directionality gas edges https://lanl-ansi.github.io/GasModels.jl/latest/direction/. For those models which have binary directionality variables (DWP, CRDWP, and LRDWP), we replace the directionality variables with constants if 0 is not a valid value for flow, i.e. f_min > 0 or f_max < 0. We can't remove the directionality variables we need to preserve the equivalence of DWP and WP. Think of the following (contrived) example. Think of two parallel pipes from i -> j, one with directionality defined from i to j and the other from j to i. The only feasible solution is no flow on this edge (pressure at i = pressure at j), which is what the WP model would compute. However, with the DWP model, if we replaced the direction variables with constants (one edge would have y = 0 and the other y =1), the DWP would report "infeasible" since 0 = 1 is not valid (this constraint gets added because of the parallel edge cutting plane constraint). We can come up with a lot more complicated examples where DWP != WP if we force a specified directionality when there is 0 flow. So, the only valid model of DWP with constants instead of variables is when f_min > 0 or f_max < 0

The latest version of GasPowerModels uses these conventions. And all example data follows these conventions to (some is in the examples branch which will be pushed to the master branch soon).