gas_pipe_lp.hpp file
LP wrapper for GasPipe — Weymouth tangents + line pack.
Steady state, per block:
flow[b] ∈ [0, F] −1 at node a, +1 at node b weymouth_k[b]: π_a − π_b − 2 K t_k flow ≥ −K t_k² (k = 1..N)
With line pack, per block:
flow_in[b], flow_out[b] ∈ [0, F] (−flow_in at a, +flow_out at b) weymouth_k[b] on f̄ = (flow_in + flow_out)/2 linepack_def[b]: LP − α (π_a + π_b) = β, α = c/(4 p_r), β = c p_r/2 linepack_balance[b]: Δt (flow_in − flow_out) − LP[b] + LP[b−1] = 0 (LP[0] = linepack_ini) linepack_end: LP[last] ≥ linepack_ini
weymouth_mode: linearized (meshed networks): flows are signed in [−F, F] and the N tangents become one equality per block,
weymouth[b]: π_a − e^s π_b − c f̄ = r secant: c = K_e |f₀|, r = 0 tangent: c = 2 K_e |f₀|, r = −K_e f₀|f₀|
re-linearised at the last solution by update_lp (the SLP of gas_options.slp_iterations, see gas_slp.hpp).
Outputs GasPipe/flow_sol (steady) or flow_in_sol, flow_out_sol, linepack_sol; linepack_balance_dual; the exactness report weymouth_gap_sol [bar²] and pressure_error_sol [bar].
Namespaces
- namespace gtopt
Classes
- class gtopt::GasPipeLP