Skip to content

Commit b754322

Browse files
committed
Add a h_abs variable for absolute level information
1 parent 4cb092d commit b754322

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

OpenHPL/Waterway/Reservoir.mo

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ model Reservoir "Model of the reservoir"
44
extends OpenHPL.Icons.Reservoir;
55
parameter SI.Height h_0=50 "Initial water level above intake"
66
annotation (Dialog(group="Setup", enable=not useLevel));
7-
parameter SI.Height z_0=0 "Elevation of the reservoir outlet (sets absolute reference)"
8-
annotation (Dialog(group="Geometry"));
9-
parameter Boolean fixElevation=true "If true (fixed), z_0 is enforced as initial value; if false (derived), elevation is determined by connected topology"
7+
parameter Boolean fixElevation=false "If true (fixed), z_0 is enforced as initial value; if false (derived), elevation is determined by connected topology"
108
annotation (Dialog(group="Geometry"), choices(checkBox=true));
9+
parameter SI.Height z_0=0 "Elevation of the reservoir outlet (sets absolute reference)"
10+
annotation (Dialog(group="Geometry", enable=fixElevation));
1111
parameter Boolean constantLevel=false "If checked, the reservoir keeps the constant water level h_0"
1212
annotation (
1313
Dialog(group="Setup", enable=not (useInflow or useLevel)),
@@ -42,6 +42,7 @@ model Reservoir "Model of the reservoir"
4242
SI.Momentum M "Water momentum";
4343
SI.Force F_f "Friction force";
4444
SI.Height h "Water level";
45+
SI.Height h_abs = h + o.z "Absolute water level";
4546
SI.Pressure p_o "Outlet pressure";
4647

4748
OpenHPL.Interfaces.Contact_o o(p=p_o) "Outflow from reservoir" annotation (Placement(transformation(extent={{90,-10},{110,10}}), iconTransformation(extent={{90,-10},{110,10}})));

OpenHPL/Waterway/SurgeTank.mo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ model SurgeTank "Model of the surge tank/shaft"
3030
parameter Boolean SteadyState=data.SteadyState "If true, starts in steady state" annotation (Dialog(group="Initialization"));
3131
parameter SI.VolumeFlowRate Vdot_0 = 0 "Initial volume flow rate in the surge tank" annotation (
3232
Dialog(group = "Initialization"));
33-
parameter SI.Height h_0 = 50 "Initial water level in the surge tank" annotation (
33+
parameter SI.Height h_0 = 50 "Initial water level in the surge tank above inlet" annotation (
3434
Dialog(group = "Initialization"));
3535
parameter SI.Pressure p_ac = 4*data.p_a "Initial pressure of air-cushion inside the surge tank" annotation (
3636
Dialog(group = "Initialization",enable=SurgeTankType == OpenHPL.Types.SurgeTank.STAirCushion));
@@ -55,6 +55,7 @@ model SurgeTank "Model of the surge tank/shaft"
5555
SI.Pressure p_b "Pressure at bottom of the surge tank";
5656
Real phiSO "Dimensionless factor based on the type of fitting ";
5757
SI.Height h(start = h_0) "Water height in the surge tank";
58+
SI.Height h_abs = h + o.z "Absolute water level";
5859
SI.VolumeFlowRate Vdot(start = Vdot_0, fixed=true) "Volume flow rate";
5960

6061
Interfaces.Contact_i creek(

OpenHPL/Waterway/VolumeFlowSource.mo

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ model VolumeFlowSource "Volume flow source (either fixed or variable)"
1111
annotation (choices(checkBox = true),Dialog(enable=useInput));
1212
parameter SI.Time T_f=0.01 "Time constant of the first order filter."
1313
annotation (Dialog(enable=useInput and useFilter));
14-
parameter SI.Height z_0=0 "Elevation of the outlet connection"
15-
annotation (Dialog(group="Geometry"));
16-
parameter Boolean fixElevation=true "If true (fixed), z_0 is enforced as initial value; if false (derived), elevation is determined by connected topology"
14+
parameter Boolean fixElevation=false "If true (fixed), z_0 is enforced as initial value; if false (derived), elevation is determined by connected topology"
1715
annotation (Dialog(group="Geometry"), choices(checkBox=true));
18-
16+
parameter SI.Height z_0=0 "Elevation of the outlet connection"
17+
annotation (Dialog(group="Geometry", enable=fixElevation));
1918
Interfaces.Contact_o o "Outlet flow connector"
2019
annotation (Placement(transformation(extent={{90,-10},{110,10}})));
2120
Modelica.Blocks.Interfaces.RealInput outFlow if useInput "Conditional input for defining the outlet flow [m3/s]"

0 commit comments

Comments
 (0)