diff --git a/OpenHPL/ElectroMech/Turbines/Turbine.mo b/OpenHPL/ElectroMech/Turbines/Turbine.mo index 39a99c69..223671fd 100644 --- a/OpenHPL/ElectroMech/Turbines/Turbine.mo +++ b/OpenHPL/ElectroMech/Turbines/Turbine.mo @@ -28,7 +28,7 @@ model Turbine "Simple turbine model with mechanical connectors" annotation (Dialog(tab = "Advanced"), choices(checkBox = true)); extends BaseClasses.Power2Torque(power(y=Wdot_s)); - extends OpenHPL.Interfaces.TurbineContacts2; + extends OpenHPL.Interfaces.TurbineContacts; SI.Pressure dp "Turbine pressure drop"; SI.EnergyFlowRate Kdot_i_tr "Kinetic energy flow"; diff --git a/OpenHPL/Examples/SimpleGenFrancis.mo b/OpenHPL/Examples/SimpleGenFrancis.mo index 7d9e8996..4c07624f 100644 --- a/OpenHPL/Examples/SimpleGenFrancis.mo +++ b/OpenHPL/Examples/SimpleGenFrancis.mo @@ -52,7 +52,9 @@ model SimpleGenFrancis "Model of a hydropower system with Francis turbine model" u_end_=2.4, u_start_=2.28, w_1_=0.2, - w_v_=0.2) annotation (Placement(transformation( + w_v_=0.2, + enable_P_out=true) + annotation (Placement(transformation( origin={30,0}, extent={{-10,-10},{10,10}}))); inner OpenHPL.Data data(Vdot_0=4.54) annotation (Placement(transformation( @@ -66,7 +68,8 @@ equation connect(generator.w_out, turbine.w_in) annotation ( Line(points={{19,-24},{12,-24},{12,-8},{18,-8}}, color = {0, 0, 127})); connect(turbine.P_out, generator.P_in) annotation ( - Line(points={{30,-11},{30,-18}}, color = {0, 0, 127})); + Line(points={{34,11},{34,18},{30,18},{30,-18}}, + color = {0, 0, 127})); connect(reservoir.o, intake.i) annotation ( Line(points={{-80,50},{-70,50}}, color = {28, 108, 200})); connect(surgeTank.i, intake.o) annotation ( @@ -76,7 +79,7 @@ equation connect(turbine.o, discharge.i) annotation ( Line(points={{40,0},{50,0}}, color = {28, 108, 200})); connect(control.y, turbine.u_t) annotation ( - Line(points={{39,30},{30,30},{30,12}}, color = {0, 0, 127})); + Line(points={{39,30},{22,30},{22,12}}, color = {0, 0, 127})); connect(turbine.i, fitting.o) annotation ( Line(points={{20,0},{8,0}}, color = {28, 108, 200})); connect(tail.o, discharge.o) annotation ( diff --git a/OpenHPL/Interfaces/TurbineContacts.mo b/OpenHPL/Interfaces/TurbineContacts.mo index 57c6c306..a4cd0e5b 100644 --- a/OpenHPL/Interfaces/TurbineContacts.mo +++ b/OpenHPL/Interfaces/TurbineContacts.mo @@ -1,8 +1,18 @@ within OpenHPL.Interfaces; partial model TurbineContacts "Model of turbine connectors" extends Interfaces.ContactPort; - input Modelica.Blocks.Interfaces.RealInput u_t "[Guide vane|nozzle] opening of the turbine" annotation ( - Placement(transformation(extent = {{-20, -20}, {20, 20}}, rotation = -90, origin={0,120}))); - Modelica.Blocks.Interfaces.RealOutput P_out(unit="W") "Mechanical Output power" annotation ( - Placement(transformation(origin={0,-110}, extent={{-10,-10},{10,10}}, rotation = 270))); + parameter Boolean enable_P_out = false "If checked, get a connector for the output power" + annotation (choices(checkBox = true), Dialog(group="Outputs",tab="I/O")); + input Modelica.Blocks.Interfaces.RealInput u_t "[Guide vane|nozzle] opening of the turbine" annotation (Placement(transformation( + extent={{-20,-20},{20,20}}, + rotation=-90, + origin={-80,120}), iconTransformation( + extent={{-20,-20},{20,20}}, + rotation=-90, + origin={-80,120}))); + Modelica.Blocks.Interfaces.RealOutput P_out(unit="W") if enable_P_out "Mechanical Output power" annotation ( + Placement(transformation(origin={40,110}, extent={{-10,-10},{10,10}}, rotation=90), iconTransformation( + extent={{-10,-10},{10,10}}, + rotation=90, + origin={40,110}))); end TurbineContacts; diff --git a/OpenHPL/Interfaces/TurbineContacts2.mo b/OpenHPL/Interfaces/TurbineContacts2.mo deleted file mode 100644 index 70838e27..00000000 --- a/OpenHPL/Interfaces/TurbineContacts2.mo +++ /dev/null @@ -1,18 +0,0 @@ -within OpenHPL.Interfaces; -partial model TurbineContacts2 "Model of turbine connectors" - extends Interfaces.ContactPort; - parameter Boolean enable_P_out = false "If checked, get a connector for the output power" - annotation (choices(checkBox = true), Dialog(group="Outputs",tab="I/O")); - input Modelica.Blocks.Interfaces.RealInput u_t "[Guide vane|nozzle] opening of the turbine" annotation (Placement(transformation( - extent={{-20,-20},{20,20}}, - rotation=-90, - origin={-80,120}), iconTransformation( - extent={{-20,-20},{20,20}}, - rotation=-90, - origin={-80,120}))); - Modelica.Blocks.Interfaces.RealOutput P_out(unit="W") if enable_P_out "Mechanical Output power" annotation ( - Placement(transformation(origin={40,110}, extent={{-10,-10},{10,10}}, rotation=90), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=90, - origin={40,110}))); -end TurbineContacts2; diff --git a/OpenHPL/Interfaces/package.order b/OpenHPL/Interfaces/package.order index 7d93531d..51a499e5 100644 --- a/OpenHPL/Interfaces/package.order +++ b/OpenHPL/Interfaces/package.order @@ -5,4 +5,3 @@ TwoContact ContactPort ContactNode TurbineContacts -TurbineContacts2 diff --git a/OpenHPL/Tests/HPSimplePenstockPelton.mo b/OpenHPL/Tests/HPSimplePenstockPelton.mo index b3d99bd5..4be89fd8 100644 --- a/OpenHPL/Tests/HPSimplePenstockPelton.mo +++ b/OpenHPL/Tests/HPSimplePenstockPelton.mo @@ -29,15 +29,16 @@ model HPSimplePenstockPelton "HP system model with Pelton turbine" inner OpenHPL.Data data annotation (Placement(transformation( origin={-90,92}, extent={{-10,-10},{10,10}}))); - ElectroMech.Turbines.Pelton turbine(R=1.74/2, D_0=1) annotation (Placement(transformation( + ElectroMech.Turbines.Pelton turbine(R=1.74/2, D_0=1, + enable_P_out=true) annotation (Placement(transformation( origin={10,34}, extent={{-10,-10},{10,10}}))); OpenHPL.ElectroMech.Generators.SynchGen aggregate(np=5) annotation (Placement(transformation(extent={{0,-4},{20,16}}))); equation connect(aggregate.P_in, turbine.P_out) annotation ( - Line(points={{4,16},{4,19},{10,19},{10,23}}, color = {0, 0, 127})); + Line(points={{10,18},{10,45},{14,45}}, color = {0, 0, 127})); connect(aggregate.w_out, turbine.w_in) annotation ( - Line(points={{16,16},{16,20},{14,20},{14,23.8}}, color = {0, 0, 127})); + Line(points={{21,12},{21,20},{-2,20},{-2,26}}, color = {0, 0, 127})); connect(reservoir.n, intake.p) annotation ( Line(points={{-82,62},{-77.95,62},{-77.95,60},{-72,60}}, color = {28, 108, 200})); connect(intake.n, surgeTank.p) annotation ( @@ -51,7 +52,7 @@ equation connect(turbine.n, discharge.p) annotation ( Line(points={{20,34},{20,34},{30,34}}, color = {28, 108, 200})); connect(control.y, turbine.u_t) annotation ( - Line(points={{1,84},{10,84},{10,46}}, color = {0, 0, 127})); + Line(points={{1,84},{2,84},{2,46}}, color = {0, 0, 127})); annotation ( experiment(StopTime = 2000, StartTime = 0, Tolerance = 0.0001, Interval = 0.4)); end HPSimplePenstockPelton;