Skip to content

Commit 80cfbe3

Browse files
committed
Adding absolute elevation values.
1 parent 79ef305 commit 80cfbe3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

OpenHPL/Waterway/OpenChannel.mo

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ model OpenChannel "Open channel model with optional spatial discretization"
3636
SI.VolumeFlowRate Vdot "Volume flow rate";
3737
SI.Velocity v "Average water velocity";
3838
SI.Height h_avg "Average water depth in the channel";
39+
SI.Position h_avg_abs = h_avg + o.elevation.z "Absolute average water level";
3940
SI.Pressure p_i "Inlet pressure";
4041
SI.Pressure p_o "Outlet pressure";
4142
SI.Force F_f "Friction force";
4243

4344
// Variables — sectional (only meaningful when useSections = true)
4445
SI.Height h_sec[if useSections then N else 0] "Water depth in each section";
46+
SI.Position h_sec_abs[size(h_sec,1)] = h_sec .+ o.elevation.z "Absolute water level in each section";
4547
SI.Velocity v_sec[if useSections then N else 0] "Velocity in each section";
4648

4749
protected
@@ -73,6 +75,7 @@ equation
7375
i.mdot + o.mdot = 0;
7476
mdot = i.mdot;
7577
Vdot = mdot / data.rho;
78+
o.elevation.z = i.elevation.z - H "Elevation propagation: outlet is H below inlet";
7679

7780
if useSections then
7881
// ===== Sectional mode: N sections with individual water levels =====

0 commit comments

Comments
 (0)