Skip to content

Commit cba81dd

Browse files
authored
Merge pull request #54 from boerrebj/52-merge-or-consolidate-turbinecontact-a
52 Merge or consolidate TurbineContact and TurbineContacts2
2 parents d5ba1ae + af40a31 commit cba81dd

File tree

6 files changed

+26
-31
lines changed

6 files changed

+26
-31
lines changed

OpenHPL/ElectroMech/Turbines/Turbine.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ model Turbine "Simple turbine model with mechanical connectors"
2828
annotation (Dialog(tab = "Advanced"), choices(checkBox = true));
2929

3030
extends BaseClasses.Power2Torque(power(y=Wdot_s));
31-
extends OpenHPL.Interfaces.TurbineContacts2;
31+
extends OpenHPL.Interfaces.TurbineContacts;
3232

3333
SI.Pressure dp "Turbine pressure drop";
3434
SI.EnergyFlowRate Kdot_i_tr "Kinetic energy flow";

OpenHPL/Examples/SimpleGenFrancis.mo

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ model SimpleGenFrancis "Model of a hydropower system with Francis turbine model"
5252
u_end_=2.4,
5353
u_start_=2.28,
5454
w_1_=0.2,
55-
w_v_=0.2) annotation (Placement(transformation(
55+
w_v_=0.2,
56+
enable_P_out=true)
57+
annotation (Placement(transformation(
5658
origin={30,0},
5759
extent={{-10,-10},{10,10}})));
5860
inner OpenHPL.Data data(Vdot_0=4.54) annotation (Placement(transformation(
@@ -66,7 +68,8 @@ equation
6668
connect(generator.w_out, turbine.w_in) annotation (
6769
Line(points={{19,-24},{12,-24},{12,-8},{18,-8}}, color = {0, 0, 127}));
6870
connect(turbine.P_out, generator.P_in) annotation (
69-
Line(points={{30,-11},{30,-18}}, color = {0, 0, 127}));
71+
Line(points={{34,11},{34,18},{30,18},{30,-18}},
72+
color = {0, 0, 127}));
7073
connect(reservoir.o, intake.i) annotation (
7174
Line(points={{-80,50},{-70,50}}, color = {28, 108, 200}));
7275
connect(surgeTank.i, intake.o) annotation (
@@ -76,7 +79,7 @@ equation
7679
connect(turbine.o, discharge.i) annotation (
7780
Line(points={{40,0},{50,0}}, color = {28, 108, 200}));
7881
connect(control.y, turbine.u_t) annotation (
79-
Line(points={{39,30},{30,30},{30,12}}, color = {0, 0, 127}));
82+
Line(points={{39,30},{22,30},{22,12}}, color = {0, 0, 127}));
8083
connect(turbine.i, fitting.o) annotation (
8184
Line(points={{20,0},{8,0}}, color = {28, 108, 200}));
8285
connect(tail.o, discharge.o) annotation (
Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
within OpenHPL.Interfaces;
22
partial model TurbineContacts "Model of turbine connectors"
33
extends Interfaces.ContactPort;
4-
input Modelica.Blocks.Interfaces.RealInput u_t "[Guide vane|nozzle] opening of the turbine" annotation (
5-
Placement(transformation(extent = {{-20, -20}, {20, 20}}, rotation = -90, origin={0,120})));
6-
Modelica.Blocks.Interfaces.RealOutput P_out(unit="W") "Mechanical Output power" annotation (
7-
Placement(transformation(origin={0,-110}, extent={{-10,-10},{10,10}}, rotation = 270)));
4+
parameter Boolean enable_P_out = false "If checked, get a connector for the output power"
5+
annotation (choices(checkBox = true), Dialog(group="Outputs",tab="I/O"));
6+
input Modelica.Blocks.Interfaces.RealInput u_t "[Guide vane|nozzle] opening of the turbine" annotation (Placement(transformation(
7+
extent={{-20,-20},{20,20}},
8+
rotation=-90,
9+
origin={-80,120}), iconTransformation(
10+
extent={{-20,-20},{20,20}},
11+
rotation=-90,
12+
origin={-80,120})));
13+
Modelica.Blocks.Interfaces.RealOutput P_out(unit="W") if enable_P_out "Mechanical Output power" annotation (
14+
Placement(transformation(origin={40,110}, extent={{-10,-10},{10,10}}, rotation=90), iconTransformation(
15+
extent={{-10,-10},{10,10}},
16+
rotation=90,
17+
origin={40,110})));
818
end TurbineContacts;

OpenHPL/Interfaces/TurbineContacts2.mo

Lines changed: 0 additions & 18 deletions
This file was deleted.

OpenHPL/Interfaces/package.order

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ TwoContact
55
ContactPort
66
ContactNode
77
TurbineContacts
8-
TurbineContacts2

OpenHPL/Tests/HPSimplePenstockPelton.mo

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ model HPSimplePenstockPelton "HP system model with Pelton turbine"
2929
inner OpenHPL.Data data annotation (Placement(transformation(
3030
origin={-90,92},
3131
extent={{-10,-10},{10,10}})));
32-
ElectroMech.Turbines.Pelton turbine(R=1.74/2, D_0=1) annotation (Placement(transformation(
32+
ElectroMech.Turbines.Pelton turbine(R=1.74/2, D_0=1,
33+
enable_P_out=true) annotation (Placement(transformation(
3334
origin={10,34},
3435
extent={{-10,-10},{10,10}})));
3536
OpenHPL.ElectroMech.Generators.SynchGen aggregate(np=5) annotation (Placement(transformation(extent={{0,-4},{20,16}})));
3637
equation
3738
connect(aggregate.P_in, turbine.P_out) annotation (
38-
Line(points={{4,16},{4,19},{10,19},{10,23}}, color = {0, 0, 127}));
39+
Line(points={{10,18},{10,45},{14,45}}, color = {0, 0, 127}));
3940
connect(aggregate.w_out, turbine.w_in) annotation (
40-
Line(points={{16,16},{16,20},{14,20},{14,23.8}}, color = {0, 0, 127}));
41+
Line(points={{21,12},{21,20},{-2,20},{-2,26}}, color = {0, 0, 127}));
4142
connect(reservoir.n, intake.p) annotation (
4243
Line(points={{-82,62},{-77.95,62},{-77.95,60},{-72,60}}, color = {28, 108, 200}));
4344
connect(intake.n, surgeTank.p) annotation (
@@ -51,7 +52,7 @@ equation
5152
connect(turbine.n, discharge.p) annotation (
5253
Line(points={{20,34},{20,34},{30,34}}, color = {28, 108, 200}));
5354
connect(control.y, turbine.u_t) annotation (
54-
Line(points={{1,84},{10,84},{10,46}}, color = {0, 0, 127}));
55+
Line(points={{1,84},{2,84},{2,46}}, color = {0, 0, 127}));
5556
annotation (
5657
experiment(StopTime = 2000, StartTime = 0, Tolerance = 0.0001, Interval = 0.4));
5758
end HPSimplePenstockPelton;

0 commit comments

Comments
 (0)