GasPipe struct
#include <gtopt/gas_pipe.hpp>
Gas pipeline (radial tangents or linearised) with line pack.
Public static variables
- static LPClassName class_name
- Canonical class name (LP labels, outputs, PAMPL
gas_pipe).
Public functions
- auto linearization_enum() const -> std::optional<GasLinearization> noexcept
- Parsed
linearization(secantwhen unset, nullopt = unknown). -
auto tangent_layout_enum() const -> std::optional<gas::
TangentLayout> noexcept - auto weymouth_mode_enum() const -> std::optional<GasWeymouthMode> noexcept
- Parsed
weymouth_mode(radialwhen unset, nullopt = unknown).
Public variables
- OptActive active
- Activation status (default: active).
- OptReal diameter
- Inner diameter [mm].
- OptReal efficiency
- OptReal elevation_exponent
- OptTRealFieldSched fmax
- Flow capacity [km³/h] per stage (also the tangent range). Required.
- SingleId gas_node_a
- Inlet (upstream) node.
- SingleId gas_node_b
- Outlet (downstream) node.
- OptReal gravity
- Gas specific gravity (default
gas_options.gas_specific_gravity). - OptReal length
- Length [km].
- OptName linearization
- OptBool linepack
- Model line pack (pipe storage). Default false.
- OptReal linepack_coeff
- OptReal linepack_ini
- OptReal linepack_pressure_ref
- Name name
- Human-readable name.
- OptReal reference_flow
- OptInt segments
- Number of Weymouth tangents N (default 8).
- OptName tangent_layout
"uniform"(default) or"relative_pressure".- OptReal temperature
- Flowing temperature [K] (default
gas_options.gas_temperature). - OptName type
- Optional tag ("transmission", "lateral", …).
- Uid uid
- Unique identifier.
- OptReal weymouth_k
- Weymouth constant K [bar² / (km³/h)²]. Unset = from the geometry.
- OptName weymouth_mode
- OptReal z
- Compressibility factor (default
gas_options.compressibility).
Function documentation
std::optional<gas:: TangentLayout> gtopt:: GasPipe:: tangent_layout_enum() const noexcept
Parsed tangent_layout (uniform when unset, nullopt = unknown).
Variable documentation
OptReal gtopt:: GasPipe:: efficiency
Pipeline efficiency E [p.u.] (default 0.92)
OptReal gtopt:: GasPipe:: elevation_exponent
Elevation exponent s of π_a − e^s π_b = K_e f|f|. Unset = 2 g M (h_b − h_a) / (Z R T) from the end nodes' elevation.
OptName gtopt:: GasPipe:: linearization
Linearised mode: "secant" (default) π_a − e^s π_b = K_e|f₀| f, or "tangent" π_a − e^s π_b = 2 K_e|f₀| f − K_e f₀|f₀|.
OptReal gtopt:: GasPipe:: linepack_coeff
Line pack per bar of average pressure [km³ / bar]. Unset = from length and diameter.
OptReal gtopt:: GasPipe:: linepack_ini
Initial (and minimum terminal) line pack [km³]. Unset = from the end nodes' p_init.
OptReal gtopt:: GasPipe:: linepack_pressure_ref
Linearisation pressure p_r [bar]. Unset = mean of the end nodes' pmin / pmax.
OptReal gtopt:: GasPipe:: reference_flow
Linearised mode: signed reference flow f₀ [km³/h] of the first pass. Unset = slp_initial_flow · fmax (a warning is logged when no SLP iteration corrects it).
OptName gtopt:: GasPipe:: weymouth_mode
"radial" (default): fixed direction a → b, tangent outer approximation (exact on radial networks). "linearized": signed flow in [−fmax, fmax] and one equality per block linearised at a reference flow f₀ (meshed networks; re-linearised by the SLP of gas_options.slp_iterations).