Skip to content

Commit

Permalink
Clean up using ttws
Browse files Browse the repository at this point in the history
  • Loading branch information
dietmarw committed Sep 7, 2022
1 parent 5759990 commit dca5007
Show file tree
Hide file tree
Showing 61 changed files with 1,091 additions and 1,402 deletions.
2 changes: 1 addition & 1 deletion OpenHPL/ElectroMech/Generators/SimpleGen.mo
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ model SimpleGen "Model of a simple generator with mechanical connectors"
<p>
The generator can be loaded either:</p>
<ul>
<li>via the mechanical shaft connector (e.g., using the
<li>via the mechanical shaft connector (e.g., using the
<a href=\"OpenHPL.ElectroMech.PowerSystem.Grid\">Grid</a> model).
The input <code>Pload</code> should be set to 0 in this case.</li>
<li>or via the input connector <code>Pload</code> specifying the connected electrical load.</li>
Expand Down
36 changes: 16 additions & 20 deletions OpenHPL/Tests/CaseStudingValentynasCase.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,31 @@ within OpenHPL.Tests;
model CaseStudingValentynasCase "HP system model for Valentyna's Master case"
extends Modelica.Icons.Example;
Real coef2, coef3;
OpenHPL.Waterway.Reservoir reservoir(h_0=48) annotation (Placement(visible=true, transformation(
OpenHPL.Waterway.Reservoir reservoir(h_0=48) annotation (Placement(transformation(
origin={-92,68},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Sources.Ramp control(duration = 1980, height = 0.75, offset = 0.04, startTime = 10) annotation (
Placement(visible = true, transformation(origin = {10, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Placement(transformation(origin = {10, 80}, extent = {{-10, -10}, {10, 10}})));
OpenHPL.Waterway.Pipe intake(
D_i=5,
D_o=5,
H=15.5,
L=3000) annotation (Placement(visible=true, transformation(extent={{-78,58},{-58,78}}, rotation=0)));
L=3000) annotation (Placement(transformation(extent={{-78,58},{-58,78}})));
OpenHPL.Waterway.Pipe discharge(
D_i=5,
D_o=5,
H=0.5,
L=600) annotation (Placement(visible=true, transformation(extent={{50,4},{70,24}}, rotation=0)));
Waterway.Reservoir tail(h_0=5) annotation (Placement(visible=true, transformation(
L=600) annotation (Placement(transformation(extent={{50,4},{70,24}})));
Waterway.Reservoir tail(h_0=5) annotation (Placement(transformation(
origin={94,18},
extent={{-10,10},{10,-10}},
rotation=180)));
OpenHPL.ElectroMech.Generators.SynchGen generator(UseFrequencyOutput=false) annotation (Placement(visible=true, transformation(extent={{24,-18},{44,2}}, rotation=0)));
OpenHPL.ElectroMech.Generators.SynchGen generator(UseFrequencyOutput=false) annotation (Placement(transformation(extent={{24,-18},{44,2}})));
Waterway.Pipe penstock(
D_i=4,
D_o=4,
H=133,
L=300) annotation (Placement(visible=true, transformation(
L=300) annotation (Placement(transformation(
origin={-26,62},
extent={{-10,-10},{10,10}},
rotation=-90)));
Expand All @@ -53,31 +52,28 @@ model CaseStudingValentynasCase "HP system model for Valentyna's Master case"
u_end=2.11,
u_start=2,
w_1_=0.26,
w_v_=0.259) annotation (Placement(visible=true, transformation(
w_v_=0.259) annotation (Placement(transformation(
origin={34,20},
extent={{-10,-10},{10,10}},
rotation=0)));
inner OpenHPL.Data data(Vdot_0=5.2) annotation (Placement(visible=true, transformation(
extent={{-10,-10},{10,10}})));
inner OpenHPL.Data data(Vdot_0=5.2) annotation (Placement(transformation(
origin={-90,92},
extent={{-10,-10},{10,10}},
rotation=0)));
OpenHPL.Waterway.Fitting fitting(D_1=3, D_2=1.73) annotation (Placement(visible=true, transformation(extent={{0,-4},{20,16}}, rotation=0)));
extent={{-10,-10},{10,10}})));
OpenHPL.Waterway.Fitting fitting(D_1=3, D_2=1.73) annotation (Placement(transformation(extent={{0,-4},{20,16}})));
OpenHPL.Waterway.Pipe penstock1(
D_i=3,
D_o=3,
H=89,
L=200) annotation (Placement(visible=true, transformation(
L=200) annotation (Placement(transformation(
origin={-10,18},
extent={{-10,-10},{10,10}},
rotation=-90)));
Waterway.Fitting fitting1(D_1=4, D_2=3) annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={-16,40})));
Waterway.SurgeTank surgeTank(D=4.5, h_0=48 + 45.5) annotation (Placement(visible=true, transformation(
Waterway.SurgeTank surgeTank(D=4.5, h_0=48 + 45.5) annotation (Placement(transformation(
origin={-42,74},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
equation
connect(generator.w_out, turbine.w_in) annotation (
Line(points={{40,2},{38,2},{38,10},{38,9.8},{38,9.8}}, color = {0, 0, 127}));
Expand Down
45 changes: 19 additions & 26 deletions OpenHPL/Tests/HPBjarneBorresen.mo
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
within OpenHPL.Tests;
model HPBjarneBorresen "Model of HP system with simplified models for penstock, turbine, etc."
extends Modelica.Icons.Example;
OpenHPL.Waterway.Reservoir reservoir(h_0=503 - 499.5) annotation (Placement(visible=true, transformation(
OpenHPL.Waterway.Reservoir reservoir(h_0=503 - 499.5) annotation (Placement(transformation(
origin={-94,64},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
OpenHPL.Waterway.Pipe PN6(
D_i=1.4,
D_o=1.4,
H=499.5 - 470,
L=3372) annotation (Placement(visible=true, transformation(extent={{-76,50},{-56,70}}, rotation=0)));
OpenHPL.Waterway.Reservoir tail(h_0=218 - 217) annotation (Placement(visible=true, transformation(
L=3372) annotation (Placement(transformation(extent={{-76,50},{-56,70}})));
OpenHPL.Waterway.Reservoir tail(h_0=218 - 217) annotation (Placement(transformation(
origin={88,-20},
extent={{-10,10},{10,-10}},
rotation=180)));
Expand All @@ -19,48 +18,43 @@ model HPBjarneBorresen "Model of HP system with simplified models for penstock,
D_o=1.4,
H=238 - 217,
L=147,
PipeElasticity=true) annotation (Placement(visible=true, transformation(
PipeElasticity=true) annotation (Placement(transformation(
origin={46,-8},
extent={{-10,-10},{10,10}},
rotation=-90)));
inner OpenHPL.Data data(Vdot_0=2.4) annotation (Placement(visible=true, transformation(
inner OpenHPL.Data data(Vdot_0=2.4) annotation (Placement(transformation(
origin={-90,92},
extent={{-10,-10},{10,10}},
rotation=0)));
OpenHPL.ElectroMech.Turbines.Turbine turbine(C_v=0.8) annotation (Placement(visible=true, transformation(
extent={{-10,-10},{10,10}})));
OpenHPL.ElectroMech.Turbines.Turbine turbine(C_v=0.8) annotation (Placement(transformation(
origin={62,-26},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
OpenHPL.Waterway.Pipe PN10(
D_i=1.4,
D_o=1.4,
H=470 - 440,
L=972) annotation (Placement(visible=true, transformation(
L=972) annotation (Placement(transformation(
origin={-40,54},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
OpenHPL.Waterway.Pipe PN16(
D_i=1.4,
D_o=1.4,
H=440 - 380,
L=300) annotation (Placement(visible=true, transformation(
L=300) annotation (Placement(transformation(
origin={-12,48},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
OpenHPL.Waterway.Pipe PN20(
D_i=1.4,
D_o=1.4,
H=380 - 340,
L=252) annotation (Placement(visible=true, transformation(
L=252) annotation (Placement(transformation(
origin={14,44},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
OpenHPL.Waterway.PenstockKP K91(
D_i=1.4,
D_o=1.4,
H=340 - 268,
L=335,
PipeElasticity=true) annotation (Placement(visible=true, transformation(
PipeElasticity=true) annotation (Placement(transformation(
origin={24,28},
extent={{-10,-10},{10,10}},
rotation=-90)));
Expand All @@ -69,12 +63,11 @@ model HPBjarneBorresen "Model of HP system with simplified models for penstock,
D_o=1.4,
H=268 - 238,
L=122,
PipeElasticity=true) annotation (Placement(visible=true, transformation(
PipeElasticity=true) annotation (Placement(transformation(
origin={36,10},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Sources.Ramp control(duration = 1, height = 0.2, offset = 0.6, startTime = 500) annotation (
Placement(visible = true, transformation(origin = {44, 66}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Placement(transformation(origin = {44, 66}, extent = {{-10, -10}, {10, 10}})));
equation
connect(control.y, turbine.u_t) annotation (
Line(points = {{56, 66}, {62, 66}, {62, -16}, {62, -16}}, color = {0, 0, 127}));
Expand Down
86 changes: 36 additions & 50 deletions OpenHPL/Tests/HPDraftTube.mo
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
within OpenHPL.Tests;
model HPDraftTube "Testing the draft tube models."
extends Modelica.Icons.Example;
OpenHPL.Waterway.Reservoir reservoir(h_0=48) annotation (Placement(visible=true, transformation(
OpenHPL.Waterway.Reservoir reservoir(h_0=48) annotation (Placement(transformation(
origin={-88,50},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Sources.Ramp control(duration = 1, height = -0.04615, offset = 0.7493, startTime = 600) annotation (
Placement(visible = true, transformation(origin={22,70}, extent = {{-10, -10}, {10, 10}}, rotation=270)));
OpenHPL.Waterway.Pipe intake(H=23) annotation (Placement(visible=true, transformation(extent={{-68,40},{-48,60}}, rotation=0)));
Placement(transformation(origin={22,70}, extent = {{-10, -10}, {10, 10}}, rotation=270)));
OpenHPL.Waterway.Pipe intake(H=23) annotation (Placement(transformation(extent={{-68,40},{-48,60}})));
OpenHPL.Waterway.Pipe discharge(
H=4.92,
L=5,
D_i=3,
D_o=4.73) annotation (Placement(visible=true, transformation(extent={{54,30},{74,50}}, rotation=0)));
OpenHPL.Waterway.Reservoir tail(h_0=5) annotation (Placement(visible=true, transformation(
D_o=4.73) annotation (Placement(transformation(extent={{54,30},{74,50}})));
OpenHPL.Waterway.Reservoir tail(h_0=5) annotation (Placement(transformation(
origin={90,40},
extent={{-10,10},{10,-10}},
rotation=180)));
Expand All @@ -22,36 +21,31 @@ model HPDraftTube "Testing the draft tube models."
D_o=3,
H=428.5,
L=600,
vertical=true) annotation (Placement(visible=true, transformation(
vertical=true) annotation (Placement(transformation(
origin={2,50},
extent={{-10,-10},{10,10}},
rotation=0)));
OpenHPL.Waterway.SurgeTank surgeTank(h_0=69.9) annotation (Placement(visible=true, transformation(
extent={{-10,-10},{10,10}})));
OpenHPL.Waterway.SurgeTank surgeTank(h_0=69.9) annotation (Placement(transformation(
origin={-28,50},
extent={{-10,-10},{10,10}},
rotation=0)));
ElectroMech.Turbines.Turbine turbine(C_v=3.7, ConstEfficiency=false) annotation (Placement(visible=true, transformation(
extent={{-10,-10},{10,10}})));
ElectroMech.Turbines.Turbine turbine(C_v=3.7, ConstEfficiency=false) annotation (Placement(transformation(
origin={30,40},
extent={{-10,-10},{10,10}},
rotation=0)));
inner OpenHPL.Data data annotation (Placement(visible=true, transformation(
extent={{-10,-10},{10,10}})));
inner OpenHPL.Data data annotation (Placement(transformation(
origin={-90,90},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
Waterway.Reservoir reservoir1(h_0=48)
annotation (Placement(visible=true, transformation(
annotation (Placement(transformation(
origin={-90,-10},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Sources.Ramp control1(
duration=1,
height=-0.04615,
offset=0.7493,
startTime=600) annotation (
Placement(visible = true, transformation(origin={22,10}, extent = {{-10, -10}, {10, 10}}, rotation=270)));
Placement(transformation(origin={22,10}, extent = {{-10, -10}, {10, 10}}, rotation=270)));
Waterway.Pipe intake1(H=23)
annotation (Placement(visible=true, transformation(extent={{-70,-20},{-50,0}}, rotation=0)));
Waterway.Reservoir tail1(h_0=5) annotation (Placement(visible=true, transformation(
annotation (Placement(transformation(extent={{-70,-20},{-50,0}})));
Waterway.Reservoir tail1(h_0=5) annotation (Placement(transformation(
origin={90,-20},
extent={{-10,10},{10,-10}},
rotation=180)));
Expand All @@ -60,41 +54,36 @@ model HPDraftTube "Testing the draft tube models."
D_o=3,
H=428.5,
L=600,
vertical=true) annotation (Placement(visible=true, transformation(
vertical=true) annotation (Placement(transformation(
origin={0,-10},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
Waterway.SurgeTank surgeTank1(h_0=69.9)
annotation (Placement(visible=true, transformation(
annotation (Placement(transformation(
origin={-30,-10},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
ElectroMech.Turbines.Turbine turbine1(C_v=3.7, ConstEfficiency=false)
annotation (Placement(visible=true, transformation(
annotation (Placement(transformation(
origin={30,-20},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
Waterway.DraftTube draftTube1(
DraftTubeType=OpenHPL.Types.DraftTube.MoodySpreadingPipe,
H=4.92,
L=5,
D_i=3,
D_o=4.73) annotation (Placement(transformation(extent={{54,-30},{74,-10}})));
Waterway.Reservoir reservoir2(h_0=48)
annotation (Placement(visible=true, transformation(
annotation (Placement(transformation(
origin={-90,-70},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
Modelica.Blocks.Sources.Ramp control2(
duration=1,
height=-0.04615,
offset=0.7493,
startTime=600) annotation (
Placement(visible = true, transformation(origin={24,-50}, extent = {{-10, -10}, {10, 10}}, rotation=270)));
Placement(transformation(origin={24,-50}, extent = {{-10, -10}, {10, 10}}, rotation=270)));
Waterway.Pipe intake2(H=23)
annotation (Placement(visible=true, transformation(extent={{-68,-80},{-48,-60}},
rotation=0)));
Waterway.Reservoir tail2(h_0=5) annotation (Placement(visible=true, transformation(
annotation (Placement(transformation(extent={{-68,-80},{-48,-60}})));
Waterway.Reservoir tail2(h_0=5) annotation (Placement(transformation(
origin={90,-80},
extent={{-10,10},{10,-10}},
rotation=180)));
Expand All @@ -103,20 +92,17 @@ model HPDraftTube "Testing the draft tube models."
D_o=3,
H=428.5,
L=600,
vertical=true) annotation (Placement(visible=true, transformation(
vertical=true) annotation (Placement(transformation(
origin={2,-70},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
Waterway.SurgeTank surgeTank2(h_0=69.9)
annotation (Placement(visible=true, transformation(
annotation (Placement(transformation(
origin={-30,-70},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
ElectroMech.Turbines.Turbine turbine2(C_v=3.7, ConstEfficiency=false)
annotation (Placement(visible=true, transformation(
annotation (Placement(transformation(
origin={32,-80},
extent={{-10,-10},{10,10}},
rotation=0)));
extent={{-10,-10},{10,10}})));
Waterway.DraftTube draftTube2(
DraftTubeType=OpenHPL.Types.DraftTube.MoodySpreadingPipe,
H=4.92,
Expand Down
Loading

0 comments on commit dca5007

Please sign in to comment.