Skip to content

Commit 1ef4615

Browse files
committed
Add a dummy flow variable for balance
1 parent 3ff1273 commit 1ef4615

6 files changed

Lines changed: 8 additions & 1 deletion

File tree

OpenHPL/Interfaces/Contact.mo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ connector Contact "Water flow connector"
44
//SI.Temperature T "Contact temperature";
55
flow SI.MassFlowRate mdot "Mass flow rate through the contact";
66
SI.Height z "Elevation at connection point";
7+
flow Real gz(unit="m2/s") "Auxiliary elevation flow variable (always zero, for connector balance)";
78
annotation (
89
Documentation(info = "<html>
910
<p>Contact is a basic water flow connector, which consists of water pressure, mass flow rate,

OpenHPL/Interfaces/TwoContacts.mo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ partial model TwoContacts "Model of two connectors"
66
Contact_o o "Outlet contact (positive design flow direction is from i to o)"
77
annotation (
88
Placement(transformation(extent={{90,-10},{110,10}})));
9+
equation
10+
i.gz = 0 "Elevation auxiliary variable (no elevation source/sink at this connection point)";
911
annotation (
1012
Documentation(info = "<html>
1113
<p>TwoContact is a partial model, which consists of two Contacts <em>i</em>and <em>o</em>.

OpenHPL/Waterway/Reservoir.mo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ equation
8080

8181
o.mdot = -data.rho * Vdot_o "Output flow connector";
8282
o.z = z_0 "Set absolute elevation at outlet";
83+
o.gz = 0 "Elevation auxiliary variable";
8384
//o.T = T_0 "TBD: Output temperature connector";
8485
annotation (preferredView="info", Documentation(info="<html>
8586
<h4>Reservoir Model</h4>

OpenHPL/Waterway/ReservoirChannel.mo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ equation
3333
o.mdot =-q*W*data.rho;
3434
o.p = data.p_a + data.rho * data.g * openChannel.h[N];
3535
o.z = z_0 "Set absolute elevation at outlet";
36+
o.gz = 0 "Elevation auxiliary variable";
3637
annotation (
3738
Documentation(preferredView="info", info="<html>
3839
<h4>Reservoir Channel Model</h4>

OpenHPL/Waterway/SurgeTank.mo

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ model SurgeTank "Model of the surge tank/shaft"
5959

6060
Interfaces.Contact_i creek(
6161
p = p_t + data.rho * data.g * (h - H_creek),
62-
mdot = mdot_creek) if useCreekIntake "Creek intake connector (connects to VolumeFlowSource)"
62+
mdot = mdot_creek,
63+
gz = 0) if useCreekIntake "Creek intake connector (connects to VolumeFlowSource)"
6364
annotation (Placement(transformation(extent = {{-10, 90}, {10, 110}})));
6465

6566
protected

OpenHPL/Waterway/VolumeFlowSource.mo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ equation
3939
pattern=LinePattern.Dot));
4040
o.mdot = -data.rho*Vdot;
4141
o.z = z_0 "Set absolute elevation at outlet";
42+
o.gz = 0 "Elevation auxiliary variable";
4243
connect(constantVolumeFlow.y, Vdot) annotation (Line(points={{-39,40},{40,40},{40,0},{80,0}}, color={0,0,127}));
4344
connect(firstOrder.u, outFlow) annotation (Line(
4445
points={{-62,-20},{-80,-20},{-80,0},{-120,0}},

0 commit comments

Comments
 (0)