modelSurgeTank

Model of the surge tank/shaft

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

Information

Surge Tank Model

The surge shaft/tank is modeled as a vertical open pipe with constant diameter together with a manifold connecting the conduit, surge volume, and penstock. Four different surge tank configurations are available:

  1. Simple surge tank - Basic vertical open pipe

  2. Air cushion surge tank - Includes compressed air chamber

  3. Sharp orifice surge tank - With orifice restriction

  4. Throttle valve surge tank - With restricted throat section

Mass and Momentum Balances

All surge tank types are modeled using mass and momentum balance equations:

$$ \frac{\mathrm{d}m}{\mathrm{d}t} = \dot{m}_\mathrm{s,in} = \rho \dot{V} $$

$$ \frac{\mathrm{d}(mv)}{\mathrm{d}t} = \dot{m}_\mathrm{i}v_\mathrm{i} + F_\mathrm{p} + F_\mathrm{g} + F_\mathrm{f} $$

Water Mass and Geometry

The water mass in the surge tank is: $$ m = \rho V = \rho lA = \rho A\frac{h}{\cos\theta} $$ where ρ is water density, V is volume, h and l are height and length of water column, and A = πD²/4 is the cross-sectional area.

Water velocities: $$ v = \frac{\dot{V}}{A}, \quad v_\mathrm{i} = \frac{\dot{V}}{A} $$

Force Terms

Pressure force: $$ F_\mathrm{p} = A(p_\mathrm{i} - p^\mathrm{atm}) $$ where pi is inlet pressure and patm is atmospheric pressure.

Gravity force: $$ F_\mathrm{g} = m g \cos\theta $$ where θ = arccos(H/L) is the slope angle.

Friction force: $$ F_\mathrm{f} = -\frac{1}{8}lf_\mathrm{D}\pi\rho Dv|v| $$ calculated using the Darcy friction factor fD,s.

Manifold Connection

The manifold preserves mass in steady-state: $$ \dot{V}_\mathrm{i} = \dot{V}_\mathrm{p} + \dot{V} $$ The manifold pressure is equal for all three connections. This is implemented via ContactNode connectors.

Creek Intake

The surge tank has a creek inlet connector that can be attached to a VolumeFlowSource to model lateral inflow (e.g., a creek or groundwater seepage) entering the surge tank. The connector is always present; when left unconnected, the flow is zero by Modelica's default flow-variable semantics and has no effect on the model. The parameter H_creek specifies the height of the intake above the surge tank base (default: equal to H). The boolean useCreekIntake controls the visibility of H_creek in the parameter dialog.

The connector pressure is set hydrostatically from the water surface down to the intake elevation, so it correctly follows the actual water level h in the tank:

$$ p_\mathrm{creek} = p_\mathrm{t} + \rho g (h - H_\mathrm{creek}) $$

The creek connector participates in the overconstrained elevation graph via Connections.branch(creek.elevation, o.elevation), ensuring that its elevation is consistent with the rest of the waterway: $$ z_\mathrm{creek} = z_\mathrm{o} + H_\mathrm{creek} $$

The creek inflow is included in the mass balance:

$$ \frac{\mathrm{d}m}{\mathrm{d}t} = \rho \dot{V} + \dot{m}_\mathrm{creek} $$

Parameters and Initialization

Required geometry parameters: length L, height H, diameter D, roughness pε, and atmospheric pressure patm. Initialize with flow rate V̇0 and water height h0. Option for steady-state initialization is available.

Parameters

TypeNameDefaultDescription
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
Surge tank types
Types.SurgeTankSurgeTankTypeOpenHPL.Types.SurgeTank.STSimpleTypes of surge tank
Geometry
SI.HeightH100Vertical component of the length of the surge shaft
SI.LengthLHLength of the surge shaft
SI.DiameterD3Diameter of the surge shaft
SI.PositionH_creekHPosition of the creek intake above the surge tank base
SI.DiameterD_soDIf Sharp orifice type: Diameter of sharp orifice
SI.DiameterD_tDIf Throttle value type: Diameter of throat
SI.LengthL_tLIf Throttle value type: Length of throat
Initialization
BooleanSteadyStatedata.SteadyStateIf true, starts in steady state
SI.VolumeFlowRateVdot_00Initial volume flow rate in the surge tank
SI.Heighth_050Initial water level in the surge tank above inlet
SI.Pressurep_ac4*data.p_aInitial pressure of air-cushion inside the surge tank
SI.TemperatureT_ac298.15Initial air-cushion temperature

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)
Interfaces.Contact_icreekCreek intake connector (connects to VolumeFlowSource)

Components

TypeNameDefaultDescription
DatadataUsing standard data set
SI.Lengthh_ds (from Surge)Height of watercolumn in the surge shaft (for DynamicSelect)
SI.LengthH_ds (from Surge)Height of the surge shaft (for DynamicSelect)
SI.Positionh_abs_ds (from Surge)Absolut height of watercolumn in the surge shaft (for DynamicSelect)
Booleanshow (from Surge)Show additional level info
SI.MassmWater mass
SI.MassFlowRatemdotMass flow rate
SI.Massm_ap_ac*A*(L - h_0/cos_theta)*data.M_a/(Modelica.Constants.R*T_ac)Air mass inside surge tank
SI.MomentumMWater momentum
SI.ForceMdotDifference in influent and effulent momentum
SI.ForceFTotal force acting in the surge tank
SI.AreaA(C.pi*D^2)/4Cross sectional area of the surge tank
SI.AreaA_t(C.pi*D_t^2)/4Cross sectional area of the throttle valve surge tank
SI.Lengthlh/cos_thetaLength of water in the surge tank
Realcos_thetaH/LSlope ratio
SI.VelocityvWater velocity
SI.ForceF_pPressure force
SI.ForceF_fFriction force
SI.ForceF_gGravity force
SI.Pressurep_tPressure at top of the surge tank
SI.Pressurep_bPressure at bottom of the surge tank
RealphiSODimensionless factor based on the type of fitting
SI.HeighthWater height in the surge tank
SI.Positionh_absh + o.elevation.zAbsolute water level
SI.VolumeFlowRateVdotVolume flow rate