modelSurgeTank
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:
- Simple surge tank - Basic vertical open pipe
- Air cushion surge tank - Includes compressed air chamber
- Sharp orifice surge tank - With orifice restriction
- 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
| Type | Name | Default | Description |
|---|---|---|---|
| Friction | |||
| Types.FrictionMethod | FrictionMethod (from FrictionSpec) | data.FrictionMethod | Method for specifying pipe friction |
| SI.Height | p_eps_input (from FrictionSpec) | data.p_eps | Pipe roughness height (absolute) |
| Real | f_moody (from FrictionSpec) | data.f_moody | Moody friction factor (dimensionless, typically 0.01-0.05) |
| Real | m_manning (from FrictionSpec) | data.m_manning | Manning M (Strickler) coefficient M=1/n (typically 60-110 for steel, 30-60 for rock tunnels) |
| Boolean | use_n (from FrictionSpec) | data.use_n | If true, use Mannings coefficient n (=1/M) instead of Manning's M (Strickler) |
| Real | n_manning (from FrictionSpec) | data.n_manning | Manning's n coefficient (typically 0.009-0.017 for steel/concrete, 0.017-0.030 for rock tunnels) |
| SI.Diameter | D_h (from FrictionSpec) | Hydraulic diameter used for friction conversion | |
| Surge tank types | |||
| Types.SurgeTank | SurgeTankType | OpenHPL.Types.SurgeTank.STSimple | Types of surge tank |
| Geometry | |||
| SI.Height | H | 100 | Vertical component of the length of the surge shaft |
| SI.Length | L | H | Length of the surge shaft |
| SI.Diameter | D | 3 | Diameter of the surge shaft |
| SI.Position | H_creek | H | Position of the creek intake above the surge tank base |
| SI.Diameter | D_so | D | If Sharp orifice type: Diameter of sharp orifice |
| SI.Diameter | D_t | D | If Throttle value type: Diameter of throat |
| SI.Length | L_t | L | If Throttle value type: Length of throat |
| Initialization | |||
| Boolean | SteadyState | data.SteadyState | If true, starts in steady state |
| SI.VolumeFlowRate | Vdot_0 | 0 | Initial volume flow rate in the surge tank |
| SI.Height | h_0 | 50 | Initial water level in the surge tank above inlet |
| SI.Pressure | p_ac | 4*data.p_a | Initial pressure of air-cushion inside the surge tank |
| SI.Temperature | T_ac | 298.15 | Initial air-cushion temperature |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Contact_i | i (from TwoContacts) | Inlet contact (positive design flow direction is from i to o) | |
| Contact_o | o (from TwoContacts) | Outlet contact (positive design flow direction is from i to o) | |
| Interfaces.Contact_i | creek | Creek intake connector (connects to VolumeFlowSource) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Data | data | Using standard data set | |
| SI.Length | h_ds (from Surge) | Height of watercolumn in the surge shaft (for DynamicSelect) | |
| SI.Length | H_ds (from Surge) | Height of the surge shaft (for DynamicSelect) | |
| SI.Position | h_abs_ds (from Surge) | Absolut height of watercolumn in the surge shaft (for DynamicSelect) | |
| Boolean | show (from Surge) | Show additional level info | |
| SI.Mass | m | Water mass | |
| SI.MassFlowRate | mdot | Mass flow rate | |
| SI.Mass | m_a | p_ac*A*(L - h_0/cos_theta)*data.M_a/(Modelica.Constants.R*T_ac) | Air mass inside surge tank |
| SI.Momentum | M | Water momentum | |
| SI.Force | Mdot | Difference in influent and effulent momentum | |
| SI.Force | F | Total force acting in the surge tank | |
| SI.Area | A | (C.pi*D^2)/4 | Cross sectional area of the surge tank |
| SI.Area | A_t | (C.pi*D_t^2)/4 | Cross sectional area of the throttle valve surge tank |
| SI.Length | l | h/cos_theta | Length of water in the surge tank |
| Real | cos_theta | H/L | Slope ratio |
| SI.Velocity | v | Water velocity | |
| SI.Force | F_p | Pressure force | |
| SI.Force | F_f | Friction force | |
| SI.Force | F_g | Gravity force | |
| SI.Pressure | p_t | Pressure at top of the surge tank | |
| SI.Pressure | p_b | Pressure at bottom of the surge tank | |
| Real | phiSO | Dimensionless factor based on the type of fitting | |
| SI.Height | h | Water height in the surge tank | |
| SI.Position | h_abs | h + o.elevation.z | Absolute water level |
| SI.VolumeFlowRate | Vdot | Volume flow rate |