gas_pipe.hpp file
Gas pipeline: Weymouth outer approximation + line pack.
A GasPipe carries gas from gas_node_a to gas_node_b (fixed direction, radial network, flow in [0, fmax] km³/h). The steady-state Weymouth equation π_a − π_b = K f² is relaxed to the convex π_a − π_b ≥ K f² and outer-approximated by segments tangent planes
π_a − π_b ≥ K (2 t_k f − t_k²), k = 1..N
at the tangent points of tangent_layout (uniform or relative_pressure). K is weymouth_k when given, otherwise derived from length, diameter, efficiency, gravity, temperature and z (SI Weymouth).
With linepack: true the pipe also stores gas: inlet and outlet flows split (flow_in, flow_out), the Weymouth rows use their average, and the line pack LP = c (p_a + p_b)/2 (pressure linearised at linepack_pressure_ref) follows LP_b = LP_{b−1} + (flow_in − flow_out) Δt_b within each stage, starting from linepack_ini and closing with LP_end ≥ linepack_ini (daily cycle).
JSON example
{"uid": 1, "name": "S_T", "gas_node_a": "S", "gas_node_b": "T", "length": 80, "diameter": 406, "fmax": 300, "segments": 8, "linepack": true}
Namespaces
- namespace gtopt
Classes
- struct gtopt::GasPipe
- Gas pipeline (radial tangents or linearised) with line pack.