modelPenstockKP

Detailed model of the pipe. Could have elastic walls and compressible water. KP scheme

Extends from OpenHPL.Icons.Pipe (Pipe icon), Types.FrictionSpec (Reusable friction specification with multiple input methods), OpenHPL.Interfaces.TwoContacts (Model of two connectors).

Information

Elastic Penstock with KP Method

Note: The older Penstock model using the Staggered Grid scheme is now marked as obsolete. This PenstockKP model, which implements the more accurate and numerically stable KP (Kurganov-Petrova) method, is the recommended choice for all elastic penstock modeling.

This is a detailed model for the pipe that can be used for proper modelling of the penstock or other conduits. Unlike simple conduits, the penstock has considerable pressure variations due to substantial height drop. To make the model more realistic, compressible water and elastic walls are taken into account.

Compressibility

The isothermal compressibility βT relates density and pressure:

$$ \rho \approx \rho^\mathrm{atm}(1 + \beta_T(p - p^\mathrm{atm})) $$

Similarly for pipe cross-section area due to elastic walls:

$$ A \approx A^\mathrm{atm}(1 + \beta^\mathrm{eq}(p - p^\mathrm{atm})) $$

The total compressibility βtot = βT + βeq is related to the speed of sound in water inside the pipe. The parameter PipeElasticity controls whether elastic walls are included.

PDE Formulation and KP Discretization

The model includes elastic walls and compressible water using the Kurganov-Petrova central upwind scheme (KP). Using the compressibility relationships, the ODEs for mass and momentum balances develop into PDEs:

$$ \frac{\partial U}{\partial t} + \frac{\partial F}{\partial x} = S $$

where \(U = [p_\mathrm{p}, \dot{m}_\mathrm{p}]^T\) is the state vector containing pressure and mass flow rate.

Figure: Geometry of the penstock model.

Conservation laws are solved by finite-volume methods. The pipe is divided into N segments, with inlet and outlet pressures as boundary conditions. The given cell is denoted by j (the jth cell). Cell averages are calculated at the center of the cell, and U denotes the average values of the conserved variables. The left and right interfaces are denoted by j-1/2 and j+1/2 respectively. At each cell interface, the right(+)/left(-) point values are reconstructed.

Figure: Discretization scheme showing cell j with interfaces and reconstruction points.

To determine the fluxes at the cell interface and the source term S, the KP scheme is used, which is a second-order scheme that is well-balanced.

Implementation

The PenstockKP model uses the KP07.KPmethod function to discretize PDEs into ODEs. The eigenvalues λ1,2 determine the wave propagation speeds and are related to the speed of sound c = √(Ap/(Apatm ρatm βtot)).

Parameters

User specifies:

  • Geometry: length L, height difference H, inlet/outlet diameters D_i/D_o, roughness p_eps
  • Discretization: number of cells N
  • Model fidelity: PipeElasticity checkbox to enable/disable elastic walls
  • Initialization: flow rate Vdot_0 and pressure p_p0 vectors, or SteadyState flag
More Information

More info about the KP penstock model can be found in [Vytvytskyi2017] and [Vytvytskyi2019].

Parameters

TypeNameDefaultDescription
Icon
Booleanslanted (from Pipe)falseDisplay slanted icon instead
Friction
Types.FrictionMethodFrictionMethod (from FrictionSpec)data.FrictionMethodMethod for specifying pipe friction
SI.Heightp_eps_input (from FrictionSpec)data.p_epsPipe roughness height (absolute)
Realf_moody (from FrictionSpec)data.f_moodyMoody friction factor (dimensionless, typically 0.01-0.05)
Realm_manning (from FrictionSpec)data.m_manningManning M (Strickler) coefficient M=1/n (typically 60-110 for steel, 30-60 for rock tunnels)
Booleanuse_n (from FrictionSpec)data.use_nIf true, use Mannings coefficient n (=1/M) instead of Manning's M (Strickler)
Realn_manning (from FrictionSpec)data.n_manningManning's n coefficient (typically 0.009-0.017 for steel/concrete, 0.017-0.030 for rock tunnels)
SI.DiameterD_h (from FrictionSpec)Hydraulic diameter used for friction conversion
Geometry
SI.HeightH420Height difference from the inlet to the outlet of the pipe
SI.LengthL600length of the pipe
SI.DiameterD_i3.3Diametr from the inlet side of the pipe
SI.DiameterD_oD_iDiametr from the outlet side of the pipe
Initialization
BooleanSteadyStatedata.SteadyStateIf true, starts in steady state
SI.VolumeFlowRate[N]Vdot_0data.Vdot_0*ones(N)Initial flow rate in the pipe vector
SI.Heighth_s069Initial water head before the pipe, m
SI.Pressure[N]p_p01.013e5 + 997*9.81*(h_s0 + H/N/2):997*9.81*H/N:1.013e5 + 997*9.81*(h_s0 + H/N*(N - 1/2))Initial presure vector, bar
Discretization
IntegerN10Number of segments
Properties
BooleanPipeElasticitytrueif checked - include pipe elasticity to the model

Connectors

TypeNameDefaultDescription
Contact_ii (from TwoContacts)Inlet contact (positive design flow direction is from i to o)
Contact_oo (from TwoContacts)Outlet contact (positive design flow direction is from i to o)

Components

TypeNameDefaultDescription
OpenHPL.DatadataUsing standard data set
SI.DiameterdD(D_i - D_o)/Nstep in diameter change
SI.Diameter[N]Dlinspace(D_i + dD/2, D_o - dD/2, N)centered diameter vector in atm. p.
SI.Diameter[N + 1]D_linspace(D_i, D_o, N + 1)boundary diameter vector in atm. p.
SI.Area[N]A_atmD.*D*pi/4centered cross are vector in atm. p.
SI.Area[N + 1]A_atm_D_.*D_*pi/4boundary cross are vector in atm. p.
SI.Area[N]Acentered cross are vector
SI.Area[N,4]A_boundary cross are vector
SI.Area[N,4]_A_atmboundary cross are matrix in atm. p.
SI.Pressure[N]p_pcentered pressure
SI.Pressuredpdata.rho*data.g*H/Ninitial p. step
SI.Pressurep_iInlet pressure (LHS)
SI.Pressurep_oOutlet Pressure (RHS)
SI.Pressure[N,4]p_boundary p. matrix
SI.LengthdxL/Nlength step
SI.LengthdhH/Nheight step
SI.MassFlowRate[N]mdotcentered mass flow
SI.MassFlowRatemdot_Rleft bound mdot
SI.MassFlowRatemdot_Vright bound mdot
SI.MassFlowRate[N,4]mdot_boundary mdot matrix
Real[2*N]Ucentered states
Real[8,N]U_boundary states
Real[N]F_apcentered A*rho
Real[N,4]F_ap_bounddary A*rho
Real[2*N]S_source term
Real[2*N,4]F_F matrix
Real[N,4]lam1eigenvalue '+'
Real[N,4]lam2eigenvalue '-'
SI.Density[N]rhocentered density
SI.Density[N,4]rho_boundary density
SI.Velocity[N,4]v_bounds velocity
SI.Velocity[N]vcentered velocity
SI.VolumeFlowRate[N]Vdotcentered volumetric flow
SI.Force[N]F_fcentered friction force vector
Realtheta1.3parameter for slope limiter
Functions.KP07.KPmethodKP