You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extracts the Manning velocity calculation into a dedicated, reusable function
to improve modularity.
Introduces the option to specify the Manning friction coefficient 'n' or
the Strickler coefficient 'M' (M = 1/n), providing more flexibility for
model configuration.
Simplifies the channel bed slope definition by replacing separate inlet and
outlet bed elevations with a single total elevation difference 'H'.
Copy file name to clipboardExpand all lines: OpenHPL/Waterway/OpenChannel.mo
+34-50Lines changed: 34 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,15 @@ model OpenChannel "Open channel model with optional spatial discretization"
7
7
// Geometry
8
8
parameter SI.Length L =5000"Channel length"annotation (Dialog(group = "Geometry"));
9
9
parameter SI.Length W =10"Channel width"annotation (Dialog(group = "Geometry"));
10
-
parameter SI.Height H_i =10"Bed elevation at inlet"annotation (Dialog(group = "Geometry"));
11
-
parameter SI.Height H_o =0"Bed elevation at outlet"annotation (Dialog(group = "Geometry"));
10
+
parameter SI.Length H =10"Bed elevation difference between inlet and outlet (positive = downhill inlet to outlet)"annotation (Dialog(group = "Geometry"));
parameterReal m_manning(unit="m(1/3)/s", min=0) =33"Manning M (Strickler) coefficient M=1/n (typically 60-110 for steel, 30-60 for rock tunnels)"annotation (
14
+
Dialog(group = "Friction", enable = not use_n));
15
+
parameterBoolean use_n =true"If true, use Mannings coefficient n (=1/M) instead of Manning's M (Strickler)"annotation (
parameterReal n_manning(unit="s/m(1/3)", min=0) =0.03"Manning's n coefficient (typically 0.009-0.017 for steel/concrete, 0.017-0.030 for rock tunnels)"annotation (
18
+
Dialog(group = "Friction", enable = use_n));
16
19
17
20
// Discretization
18
21
parameterBoolean useSections =false"If true, discretize the channel into N sections with varying water levels"
@@ -42,22 +45,9 @@ model OpenChannel "Open channel model with optional spatial discretization"
42
45
SI.Velocity v_sec[if useSections then N else0] "Velocity in each section";
0 commit comments