diff --git a/OpenHPL/Types/FrictionMethod.mo b/OpenHPL/Types/FrictionMethod.mo new file mode 100644 index 00000000..21e29803 --- /dev/null +++ b/OpenHPL/Types/FrictionMethod.mo @@ -0,0 +1,5 @@ +within OpenHPL.Types; +type FrictionMethod = enumeration( + PipeRoughness "Direct pipe roughness height (p_eps)", + MoodyFriction "Moody friction factor (f)", + ManningFriction "Manning roughness coefficient (M or n)") "Enumeration defining method for specifying pipe friction"; diff --git a/OpenHPL/Types/package.order b/OpenHPL/Types/package.order index 5ec69b5b..1f93386e 100644 --- a/OpenHPL/Types/package.order +++ b/OpenHPL/Types/package.order @@ -1,4 +1,5 @@ DraftTube Fitting +FrictionMethod Lambda SurgeTank diff --git a/OpenHPL/Waterway/Pipe.mo b/OpenHPL/Waterway/Pipe.mo index 8790ab90..6e962bf5 100644 --- a/OpenHPL/Waterway/Pipe.mo +++ b/OpenHPL/Waterway/Pipe.mo @@ -13,8 +13,21 @@ model Pipe "Model of a pipe" Dialog(group = "Geometry")); parameter SI.Diameter D_o = D_i "Diameter of the outlet side" annotation ( Dialog(group = "Geometry")); - parameter SI.Height p_eps = data.p_eps "Pipe roughness height" annotation ( - Dialog(group = "Geometry")); + + // Friction specification: + parameter Types.FrictionMethod friction_method = Types.FrictionMethod.PipeRoughness "Method for specifying pipe friction" annotation ( + Dialog(group = "Friction")); + parameter SI.Height p_eps_input = data.p_eps "Pipe roughness height (absolute)" annotation ( + Dialog(group = "Friction", enable = friction_method == Types.FrictionMethod.PipeRoughness)); + parameter Real f_moody(min=0) = 0.02 "Moody friction factor (dimensionless, typically 0.01-0.05)" annotation ( + Dialog(group = "Friction", enable = friction_method == Types.FrictionMethod.MoodyFriction)); + parameter Real m_manning(unit="m(1/3)/s", min=0) = 40 "Manning M (Strickler) coefficient M=1/n (typically 60-110 for steel, 30-60 for rock tunnels)" annotation ( + Dialog(group = "Friction", enable = friction_method == Types.FrictionMethod.ManningFriction and not use_n)); + parameter Boolean use_n = false "If true, use Mannings coefficient n (=1/M) instead of Manning's M (Strickler)" annotation ( + Dialog(group = "Friction", enable = friction_method == Types.FrictionMethod.ManningFriction), choices(checkBox=true)); + parameter Real n_manning(unit="s/m(1/3)", min=0) = 0.025 "Manning's n coefficient (typically 0.009-0.017 for steel/concrete, 0.017-0.030 for rock tunnels)" annotation ( + Dialog(group = "Friction", enable = friction_method == Types.FrictionMethod.ManningFriction and use_n)); + // Steady state: parameter Boolean SteadyState=data.SteadyState "If true, starts in steady state" annotation (Dialog(group="Initialization")); @@ -29,6 +42,10 @@ model Pipe "Model of a pipe" SI.VolumeFlowRate Vdot "Volume flow rate"; protected + parameter Real n_eff = if use_n then n_manning else 1/m_manning "Effective Manning's n coefficient"; + parameter SI.Height p_eps = if friction_method == Types.FrictionMethod.PipeRoughness then p_eps_input + elseif friction_method == Types.FrictionMethod.MoodyFriction then 3.7 * D_ * 10^(-1/(2*sqrt(f_moody))) + else D_*3.0971 *exp(-0.118/n_eff) "Equivalent pipe roughness height"; parameter SI.Diameter D_ = ( D_i + D_o) / 2 "Average diameter"; parameter SI.Area A_i = D_i ^ 2 * C.pi / 4 "Inlet cross-sectional area"; parameter SI.Area A_o = D_o ^ 2 * C.pi / 4 "Outlet cross-sectional area"; @@ -56,8 +73,7 @@ equation mdot = i.mdot "Inlet direction for mdot"; annotation ( - Documentation(info= " -
The simple model of the pipe gives possibilities + Documentation(info="
The simple model of the pipe gives possibilities for easy modelling of different conduit: intake race, penstock, tail race, etc.
This model is described by the momentum differential equation, which depends on pressure drop through the pipe together with friction and gravity forces. @@ -72,8 +88,29 @@ equation
If the pipe is slightly tapered then this can be taken into account by adjusting
K_c based on your taper geometry: 0.05–0.15 for gentle cones,
up to 0.6 for sharp contractions.
The pipe friction can be specified using one of three methods via the friction_method parameter:
use_n to enable this notation.The conversions are simplified for hydropower applications assuming fully turbulent flow, + so they depend only on fixed pipe dimensions and the chosen friction coefficient.
+ +More info about the pipe model can be found in [Vytvytskyi2017] - and [Splavska2017a].
Updated formulation for non-equal inlet- and outlet diameter.