Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OpenHPL/Data.mo
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ record Data "Provides a data set of most common used settings"
annotation (Dialog(group = "Waterway properties"));
parameter SI.Compressibility beta_total = 1 / (rho*1000^2) "Total compressibility"
annotation (Dialog(group = "Waterway properties"));
parameter SI.Frequency f_grid=50 "Grid frequency" annotation (Dialog(group = "System properties"));
parameter SI.Frequency f_grid=50 "Grid frequency" annotation (Dialog(group = "System properties"));
parameter Boolean SteadyState=false "If checked, simulation starts in steady state"
annotation (choices(checkBox = true), Dialog(group="Initialization"));
parameter SI.VolumeFlowRate Vdot_0 = 0 "Initial volume flow rate through the system"
Expand Down
2 changes: 1 addition & 1 deletion OpenHPL/ElectroMech/PowerSystem/Grid.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ model Grid "Model of a mechanical grid equivalent"
parameter SI.Power Pgrid=1000000000 "Active power capacity of the grid" annotation (Dialog(group="Electrical"));
parameter Boolean useLambda=false "If checked, specify Lambda, otherwise the droop Rgrid is used"
annotation (choices(checkBox = true), Dialog(group="Electrical"));
parameter Types.Lambda Lambda=Pgrid/(Rgrid*data.f_0) "Network Power-Frequency Characteristic (bias factor)"
parameter Types.Lambda Lambda=Pgrid/(Rgrid*data.f_0*data.f_grid) "Network Power-Frequency Characteristic (bias factor)"
annotation (Dialog(group="Electrical",enable=useLambda));
parameter SI.PerUnit Rgrid=0.1 "Equivalent droop setting of the grid"
annotation (Dialog(group="Electrical",enable=not useLambda));
Expand Down
4 changes: 2 additions & 2 deletions OpenHPL/ElectroMech/Turbines/EmpiricalTurbine.mo
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
within OpenHPL.ElectroMech.Turbines;
model EmpiricalTurbine
parameter SI.Height H_n = 100 "Nominal net head" annotation (Dialog(group = "Nominal values"));
parameter SI.Power P_n(displayUnit="MW")=1000000 "Nominal power" annotation (Dialog(group = "Nominal values"));
parameter SI.Power P_n(displayUnit="MW")=1000000 "Nominal power" annotation (Dialog(group = "Nominal values"));
extends OpenHPL.ElectroMech.BaseClasses.TorqueEquation;
extends OpenHPL.Interfaces.TurbineContacts;
extends Interfaces.TwoContacts;
extends OpenHPL.Icons.Turbine;

SI.VolumeFlowRate Vdot "Turbine flow rate";
Modelica.Blocks.Sources.RealExpression turbineTorque(y=Tt) "Connection between compute hydraulic torque and driving torque in class TorqueEquation" annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
Modelica.Blocks.Sources.RealExpression turbineTorque(y=Tt) "Connection between compute hydraulic torque and driving torque in class TorqueEquation" annotation (Placement(transformation(extent={{-70,-10},{-50,10}})));
Modelica.Blocks.Sources.RealExpression turbinePower(y=Tt*speedSensor.w) annotation (Placement(transformation(extent={{-50,20},{-80,40}})));
Modelica.Blocks.Math.Feedback lossCorrection
annotation (Placement(transformation(extent={{-50,70},{-30,90}})));
Expand Down
2 changes: 1 addition & 1 deletion OpenHPL/ElectroMech/Turbines/Turbine.mo
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ in the <em>Efficiency data</em> group:</p>
<ul>
<li><strong>Constant efficiency</strong> (<code>ConstEfficiency = true</code>, default):
The hydraulic efficiency is fixed at the value given by <code>eta_h</code>
(default 0.9). This is suitable for quick studies where a single
(default 0.9). This is suitable for quick studies where a single
representative efficiency value is sufficient.</li>
<li><strong>Variable efficiency table</strong> (<code>ConstEfficiency = false</code>):
Efficiency varies with guide-vane opening according to a lookup table stored
Expand Down
4 changes: 2 additions & 2 deletions OpenHPL/Examples/BranchingPipes.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
within OpenHPL.Examples;
model BranchingPipes "Model of branching pipes"
extends Modelica.Icons.Example;
Waterway.Reservoir reservoir(fixElevation = true, z_0 = 3) annotation (
Waterway.Reservoir reservoir(fixElevation = true, z_0 = 3) annotation (
Placement(transformation(extent = {{-80, -10}, {-60, 10}})));
Waterway.Pipe mainPipe(D_i = 6, H = 1, L = 100) annotation (
Placement(transformation(extent = {{-52, -10}, {-32, 10}})));
Expand Down Expand Up @@ -30,4 +30,4 @@ equation
Line(points = {{50, 0}, {60, 0}}, color = {0, 128, 255}));
annotation (
experiment(StopTime = 2000, StartTime = 0, Tolerance = 0.0001, Interval = 0.4));
end BranchingPipes;
end BranchingPipes;
2 changes: 1 addition & 1 deletion OpenHPL/Examples/DetailedTurbine.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ model DetailedTurbine "Hydropower system using KP scheme based penstock"
extends SimpleTurbine(
redeclare Waterway.PenstockKP penstock);
annotation (experiment(StopTime = 1000, StartTime = 0, Tolerance = 1e-06, Interval = 2));
end DetailedTurbine;
end DetailedTurbine;
2 changes: 1 addition & 1 deletion OpenHPL/Examples/Gate.mo
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ equation
connect(upstream2.level, up_level.y) annotation (Line(points={{-42,-44},{-52,-44},{-52,0},{-59,0}}, color={0,0,127}));
annotation (
experiment(StopTime=2000, Interval=0.4));
end Gate;
end Gate;
5 changes: 2 additions & 3 deletions OpenHPL/Examples/OpenChannel.mo
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
within OpenHPL.Examples;

model OpenChannel "Model of a hydropower system with open channel model"
extends Modelica.Icons.Example;
Waterway.Reservoir reservoir(h_0 = 5, fixElevation = true, z_0 = 10) annotation(
Expand All @@ -8,7 +7,7 @@ model OpenChannel "Model of a hydropower system with open channel model"
Placement(transformation(extent = {{-40, -10}, {-20, 10}})));
Waterway.Reservoir tail(h_0 = 5) annotation(
Placement(transformation(origin = {70, 0}, extent = {{-10, 10}, {10, -10}}, rotation = 180)));
inner Data data(SteadyState = false, Vdot_0 = 0, f_0(displayUnit = "Hz")) annotation(
inner Data data(SteadyState = false, Vdot_0 = 0) annotation(
Placement(transformation(origin = {-90, 90}, extent = {{-10, -10}, {10, 10}})));
Waterway.OpenChannel openChannel(H = 2, useSections = true, N = 10) annotation(
Placement(transformation(extent = {{-10, -10}, {10, 10}})));
Expand All @@ -25,4 +24,4 @@ equation
Line(points = {{40, 0}, {60, 0}}, color = {0, 128, 255}));
annotation(
experiment(StopTime = 10000));
end OpenChannel;
end OpenChannel;
2 changes: 1 addition & 1 deletion OpenHPL/Examples/Pipes.mo
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ equation
connect(pipeContracting.o, Downstream.o) annotation (Line(points={{10,-20},{30,-20},{30,0},{40,0}}, color={0,128,255}));
annotation (
experiment(StartTime = 0, StopTime = 100, Tolerance = 1e-06, Interval = 0.02));
end Pipes;
end Pipes;
2 changes: 1 addition & 1 deletion OpenHPL/Examples/SimpleGen.mo
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ equation
points={{30,60},{30,10}},
color={0,0,0}));
annotation (experiment(StopTime = 1000, StartTime = 0, Tolerance = 1e-06, Interval = 2));
end SimpleGen;
end SimpleGen;
4 changes: 2 additions & 2 deletions OpenHPL/Examples/SimpleGenFrancis.mo
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ model SimpleGenFrancis "Model of a hydropower system with Francis turbine model"
annotation (Placement(transformation(
origin={30,0},
extent={{-10,-10},{10,10}})));
inner OpenHPL.Data data(SteadyState = false) annotation (Placement(transformation(
inner OpenHPL.Data data(SteadyState = false) annotation (Placement(transformation(
origin={-90,90},
extent={{-10,-10},{10,10}})));
Waterway.Fitting fitting(
Expand Down Expand Up @@ -87,4 +87,4 @@ equation
connect(penstock.o, fitting.i) annotation (
Line(points={{-20,0},{-12,0}}, color = {28, 108, 200}));
annotation (experiment(StopTime = 1000, StartTime = 0, Tolerance = 1e-06, Interval = 2));
end SimpleGenFrancis;
end SimpleGenFrancis;
2 changes: 1 addition & 1 deletion OpenHPL/Examples/SimpleTurbine.mo
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ equation
connect(surgeTank.o, penstock.i) annotation (Line(points={{-20,30},{-10,30}}, color={28,108,200}));
connect(discharge.o, tail.o) annotation (Line(points={{70,0},{80,0}}, color={28,108,200}));
annotation (experiment(StopTime = 1000, StartTime = 0, Tolerance = 1e-06, Interval = 2));
end SimpleTurbine;
end SimpleTurbine;
2 changes: 1 addition & 1 deletion OpenHPL/Examples/SimpleValve.mo
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ Simple model of a water way with only a valve component.
This can be used to investigate the effect of different opening and closing times in the waterway.
</p>
</html>"));
end SimpleValve;
end SimpleValve;
24 changes: 12 additions & 12 deletions OpenHPL/Examples/SimpleValveWithCreek.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ model SimpleValveWithCreek
Waterway.Reservoir reservoir(h_0 = 10, constantLevel = false, fixElevation = true, z_0 = 110) annotation(
Placement(transformation(origin = {-90, 30}, extent = {{-10, -10}, {10, 10}})));
Modelica.Blocks.Sources.Ramp control(duration = 30, height = 0.5, offset = 0, startTime = 500e6) annotation(
Placement(transformation(origin={-10,0}, extent = {{-10, -10}, {10, 10}})));
Placement(transformation(origin={-10,0}, extent = {{-10, -10}, {10, 10}})));
Waterway.Pipe tunnel1(H = 10, D_i = 5) annotation(
Placement(transformation(extent = {{-70, 20}, {-50, 40}})));
Waterway.Pipe discharge(H = 0.5, L = 600, D_i = 5) annotation(
Placement(transformation(origin={0,-50}, extent = {{50, 20}, {70, 40}})));
Placement(transformation(origin={0,-50}, extent = {{50, 20}, {70, 40}})));
Waterway.Reservoir tail(h_0 = 5) annotation(
Placement(transformation(origin = {90, -20}, extent = {{-10, 10}, {10, -10}}, rotation = 180)));
replaceable Waterway.Pipe penstock(D_i = 3, D_o = 3, H = 80, L = 200, slanted = true)
constrainedby Interfaces.TwoContacts annotation(
Placement(transformation(origin={60,30}, extent = {{-10, -10}, {10, 10}})));
Placement(transformation(origin={60,30}, extent = {{-10, -10}, {10, 10}})));
Waterway.SurgeTank creekIntake(H = 25, L = 30, h_0 = 20) annotation(
Placement(transformation(origin = {-30, 30}, extent = {{-10, -10}, {10, 10}})));
inner Data data(Vdot_0 = 0) annotation(
Placement(transformation(origin = {-90, 90}, extent = {{-10, -10}, {10, 10}})));
Waterway.Valve valve(ValveCapacity = false, C_v = 1) annotation(
Placement(transformation(origin={0,-50}, extent = {{20, 20}, {40, 40}})));
Placement(transformation(origin={0,-50}, extent = {{20, 20}, {40, 40}})));
OpenHPL.Waterway.Pipe tunnel2(D_i = 5, H = 10) annotation(
Placement(transformation(origin={58,0}, extent = {{-70, 20}, {-50, 40}})));
Placement(transformation(origin={58,0}, extent = {{-70, 20}, {-50, 40}})));
OpenHPL.Waterway.SurgeTank surgeTank(H = 35, L = 40, h_0 = 30) annotation(
Placement(transformation(origin = {30, 30}, extent = {{-10, -10}, {10, 10}})));
Waterway.VolumeFlowSource volumeFlowSource annotation(
Expand All @@ -33,19 +33,19 @@ equation
connect(tunnel1.o, creekIntake.i) annotation(
Line(points = {{-50, 30}, {-40, 30}}, color = {28, 108, 200}));
connect(valve.o, discharge.i) annotation(
Line(points={{40,-20},{50,-20}}, color = {0, 128, 255}));
Line(points={{40,-20},{50,-20}}, color = {0, 128, 255}));
connect(control.y, valve.opening) annotation(
Line(points={{1,0},{30,0},{30,-12}}, color = {0, 0, 127}));
Line(points={{1,0},{30,0},{30,-12}}, color = {0, 0, 127}));
connect(creekIntake.o, tunnel2.i) annotation(
Line(points={{-20,30},{-12,30}}, color = {0, 128, 255}));
Line(points={{-20,30},{-12,30}}, color = {0, 128, 255}));
connect(tunnel2.o, surgeTank.i) annotation(
Line(points={{8,30},{20,30}}, color = {0, 128, 255}));
Line(points={{8,30},{20,30}}, color = {0, 128, 255}));
connect(surgeTank.o, penstock.i) annotation(
Line(points={{40,30},{50,30}}, color = {0, 128, 255}));
Line(points={{40,30},{50,30}}, color = {0, 128, 255}));
connect(volumeFlowSource.o, creekIntake.creek) annotation(
Line(points = {{-42, 60}, {-30, 60}, {-30, 40}}, color = {0, 128, 255}));
connect(discharge.o, tail.o) annotation(
Line(points={{70,-20},{80,-20}}, color = {0, 128, 255}));
Line(points={{70,-20},{80,-20}}, color = {0, 128, 255}));
connect(penstock.o, valve.i) annotation (Line(points={{70,30},{80,30},{80,10},
{8,10},{8,-20},{20,-20}}, color={0,128,255}));
annotation(
Expand All @@ -56,4 +56,4 @@ Simple model of a water way with one creek intake.
This can be used to investigate the effects of a creek intake.
</p>
</html>"));
end SimpleValveWithCreek;
end SimpleValveWithCreek;
6 changes: 3 additions & 3 deletions OpenHPL/Examples/VolumeFlowSource.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ within OpenHPL.Examples;
model VolumeFlowSource "Example demonstrating the use of VolumeFlowSource"
extends Modelica.Icons.Example;
OpenHPL.Waterway.Reservoir tail1 annotation (Placement(transformation(extent={{60,30},{40,50}})));
inner OpenHPL.Data data(SteadyState = true) annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
OpenHPL.Waterway.VolumeFlowSource volumeFlowConstant(fixElevation = true) annotation (Placement(transformation(extent={{-50,30},{-30,50}})));
inner OpenHPL.Data data(SteadyState = true) annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
OpenHPL.Waterway.VolumeFlowSource volumeFlowConstant(fixElevation = true) annotation (Placement(transformation(extent={{-50,30},{-30,50}})));
Waterway.Pipe pipe1(H=0, useInitialFlow=false) annotation (Placement(transformation(extent={{-10,30},{10,50}})));
Waterway.Pipe pipe2(H=0, useInitialFlow=false) annotation (Placement(transformation(extent={{-10,-10},{10,10}})));
OpenHPL.Waterway.Reservoir tail2 annotation (Placement(transformation(extent={{60,-10},{40,10}})));
Expand All @@ -28,4 +28,4 @@ equation
color={0,128,255}));
connect(volumeFlowFiltered.outFlow, logdata.y[1]) annotation (Line(points={{-50,-40},{-59,-40}}, color={0,0,127}));
annotation (experiment(StopTime=120));
end VolumeFlowSource;
end VolumeFlowSource;
2 changes: 1 addition & 1 deletion OpenHPL/Examples/WithOpenIPSL/DetailedGen.mo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
within OpenHPL.Examples.WithOpenIPSL;
model DetailedGen
extends SimpleGen( redeclare Waterway.PenstockKP penstock(
extends SimpleGen( redeclare Waterway.PenstockKP penstock(
slanted=true,
H=428.5,
D_i=3), data(SteadyState=false));
Expand Down
10 changes: 5 additions & 5 deletions OpenHPL/Examples/WithOpenIPSL/SimpleGen.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ model SimpleGen "Synergy with OpenIPSL library(generator)"
extends OpenIPSL.Tests.BaseClasses.MachineTestBase(pwLine2(displayPF=true), pwLine1(displayPF=true));
OpenHPL.Waterway.Reservoir reservoir(h_0=48,
fixElevation=true,
z_0=500) annotation (Placement(transformation(
z_0=500) annotation (Placement(transformation(
origin={-80,-80},
extent={{-10,-10},{10,10}})));
OpenHPL.Waterway.Pipe intake(H=23, D_i=3)
Expand All @@ -26,7 +26,7 @@ model SimpleGen "Synergy with OpenIPSL library(generator)"
OpenHPL.Waterway.SurgeTank surgeTank(h_0=70.939) annotation (Placement(transformation(
origin={-30,-80},
extent={{-10,-10},{10,10}})));
ElectroMech.Turbines.Turbine turbine(
ElectroMech.Turbines.Turbine turbine(
H_n=460,
Vdot_n=24.3,
Pmax(displayUnit="MW") = 125000000,
Expand All @@ -48,8 +48,8 @@ model SimpleGen "Synergy with OpenIPSL library(generator)"
ra=0.001,
w(fixed=true),
x1d=0.302) annotation (Placement(transformation(extent={{-40,-10},{-20,10}})));
OpenHPL.Controllers.Governor governor(Pn=103, Y_gv_ref = 0.1)
annotation (Placement(transformation(origin={0,-40}, extent = {{-10, -10}, {10, 10}})));
OpenHPL.Controllers.Governor governor(Pn=103, Y_gv_ref = 0.1)
annotation (Placement(transformation(origin={0,-40}, extent = {{-10, -10}, {10, 10}})));
//(a = 7.862E-25, c = 1.108E-08, d = -5.344E-02, b = -1.010E-16)
Modelica.Blocks.Math.Gain fpu_to_fSI(k=SysData.fn) annotation (Placement(transformation(
origin={-60,-52},
Expand All @@ -65,7 +65,7 @@ equation
connect(governor.Y_gv, turbine.u_t) annotation (
Line(points={{11,-40},{24,-40},{24,-68}}, color = {0, 0, 127}));
connect(governor.P_ref, power.y) annotation (
Line(points={{-12,-36},{-27.2,-36}}, color = {0, 0, 127}));
Line(points={{-12,-36},{-27.2,-36}}, color = {0, 0, 127}));
connect(generator.vf, generator.vf0) annotation (Line(points={{-42,5},{-46,5},{-46,14},{-38,14},{-38,11}}, color={0,0,127}));
connect(generator.p, bus1.p) annotation (Line(points={{-20,0},{0,0}}, color={0,0,255}));
connect(discharge.o, tail.o) annotation (Line(points={{68,-80},{74,-80}}, color={28,108,200}));
Expand Down
6 changes: 3 additions & 3 deletions OpenHPL/Examples/WithOpenIPSL/SimpleGenTG.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ model SimpleGenTG "Synergy with OpenIPSL library(generator)"
extends OpenIPSL.Tests.BaseClasses.MachineTestBase(pwLine2(displayPF=true), pwLine1(displayPF=true));
OpenHPL.Waterway.Reservoir reservoir(h_0=48,
fixElevation=true,
z_0=500) annotation (Placement(transformation(
z_0=500) annotation (Placement(transformation(
origin={-80,-80},
extent={{-10,-10},{10,10}})));
OpenHPL.Waterway.Pipe intake(H=23,
D_i=3,
useInitialFlow=false) annotation (Placement(transformation(extent={{-66,-90},{-46,-70}})));
useInitialFlow=false) annotation (Placement(transformation(extent={{-66,-90},{-46,-70}})));
OpenHPL.Waterway.Pipe discharge(L=600, H=0.5) annotation (Placement(transformation(extent={{48,-90},{68,-70}})));
OpenHPL.Waterway.Reservoir tail(h_0=5) annotation (Placement(transformation(
origin={84,-80},
Expand All @@ -27,7 +27,7 @@ model SimpleGenTG "Synergy with OpenIPSL library(generator)"
OpenHPL.Waterway.SurgeTank surgeTank(h_0=70.939) annotation (Placement(transformation(
origin={-30,-80},
extent={{-10,-10},{10,10}})));
ElectroMech.Turbines.Turbine turbine(
ElectroMech.Turbines.Turbine turbine(
H_n=460,
Vdot_n=24.3,
Pmax(displayUnit="MW") = 125000000,
Expand Down
2 changes: 1 addition & 1 deletion OpenHPL/Icons/Reservoir.mo
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ partial class Reservoir "Reservoir icon"
extent = {{-100, 20}, {100, -20}},
textString = DynamicSelect("(level)", "("+String(h_abs_ds, format=".1f") + ")"),
textStyle = {TextStyle.Italic})}));
end Reservoir;
end Reservoir;
2 changes: 1 addition & 1 deletion OpenHPL/Icons/Surge.mo
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ partial class Surge "Surge tank/shaft icon"
}
)
);
end Surge;
end Surge;
2 changes: 1 addition & 1 deletion OpenHPL/Interfaces/Contact.mo
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ arbitrary topologies including parallel pipes and loops.</li>
textColor = {0, 85, 255},
extent = {{-100, 100}, {100, -100}},
textString = DynamicSelect("", if showElevation then String(elevation.z) else ""))}));
end Contact;
end Contact;
2 changes: 1 addition & 1 deletion OpenHPL/Interfaces/package.mo
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ input and output connectors, additionally. This model is used for turbine modell
<pre>
partial model TurbineContacts \"Model of turbine connectors\"
extends TwoContacts;
input Modelica.Blocks.Interfaces.RealInput u_t \"[Guide vane|nozzle] opening of the turbine\" ;
input Modelica.Blocks.Interfaces.RealInput u_t \"[Guide vane|nozzle] opening of the turbine\" ;
Modelica.Blocks.Interfaces.RealOutput P_out \"Mechanical Output power\" ;
end TurbineContacts;
</pre>
Expand Down
Loading
Loading