|
| 1 | +within OpenHPL.Examples.WithOpenIPSL; |
| 2 | +model SimpleGen "Synergy with OpenIPSL library(generator)" |
| 3 | + extends Modelica.Icons.Example; |
| 4 | + extends OpenIPSL.Tests.BaseClasses.MachineTestBase(pwLine2(displayPF=true), pwLine1(displayPF=true)); |
| 5 | + OpenHPL.Waterway.Reservoir reservoir(h_0=48, |
| 6 | + fixElevation=true, |
| 7 | + z_0=500) annotation (Placement(transformation( |
| 8 | + origin={-80,-80}, |
| 9 | + extent={{-10,-10},{10,10}}))); |
| 10 | + OpenHPL.Waterway.Pipe intake(H=23, D_i=3) |
| 11 | + annotation (Placement(transformation(extent={{-66,-90},{-46,-70}}))); |
| 12 | + OpenHPL.Waterway.Pipe discharge(L=600, H=0.5) annotation (Placement(transformation(extent={{48,-90},{68,-70}}))); |
| 13 | + OpenHPL.Waterway.Reservoir tail(h_0=5) annotation (Placement(transformation( |
| 14 | + origin={84,-80}, |
| 15 | + extent={{-10,10},{10,-10}}, |
| 16 | + rotation=180))); |
| 17 | + replaceable |
| 18 | + Waterway.Pipe penstock( |
| 19 | + vertical=true, |
| 20 | + L=600, |
| 21 | + H=428.5, |
| 22 | + D_i=3) constrainedby Interfaces.TwoContacts |
| 23 | + annotation (Placement(transformation( |
| 24 | + origin={0,-80}, |
| 25 | + extent={{-10,-10},{10,10}}))); |
| 26 | + OpenHPL.Waterway.SurgeTank surgeTank(h_0=70.939) annotation (Placement(transformation( |
| 27 | + origin={-30,-80}, |
| 28 | + extent={{-10,-10},{10,10}}))); |
| 29 | + ElectroMech.Turbines.Turbine turbine( |
| 30 | + H_n=460, |
| 31 | + Vdot_n=24.3, |
| 32 | + Pmax(displayUnit="MW") = 125000000, |
| 33 | + enable_P_out=true) |
| 34 | + annotation (Placement(transformation( |
| 35 | + origin={32,-80}, |
| 36 | + extent={{-10,-10},{10,10}}))); |
| 37 | + inner OpenHPL.Data data(SteadyState=true, Vdot_0=4.49) |
| 38 | + annotation (Placement(transformation( |
| 39 | + origin={-90,70}, |
| 40 | + extent={{-10,-10},{10,10}}))); |
| 41 | + OpenIPSL.Electrical.Machines.PSAT.Order2 generator( |
| 42 | + D=0, |
| 43 | + M=10, |
| 44 | + P_0=16035269.869201, |
| 45 | + Q_0=11859436.505981, |
| 46 | + Sn=120000000, |
| 47 | + Vn=400000, |
| 48 | + ra=0.001, |
| 49 | + w(fixed=true), |
| 50 | + x1d=0.302) annotation (Placement(transformation(extent={{-40,-10},{-20,10}}))); |
| 51 | + OpenHPL.Controllers.Governor governor(Pn=103, Y_gv_ref = 0.1) |
| 52 | + annotation (Placement(transformation(origin={0,-40}, extent = {{-10, -10}, {10, 10}}))); |
| 53 | + //(a = 7.862E-25, c = 1.108E-08, d = -5.344E-02, b = -1.010E-16) |
| 54 | + Modelica.Blocks.Math.Gain fpu_to_fSI(k=SysData.fn) annotation (Placement(transformation( |
| 55 | + origin={-60,-52}, |
| 56 | + extent={{6,6},{-6,-6}}, |
| 57 | + rotation=180))); |
| 58 | + Modelica.Blocks.Sources.Ramp power(duration = 1, height = +1e6, offset = 12e6, |
| 59 | + startTime=200) annotation ( |
| 60 | + Placement(transformation(origin={-36,-36}, extent={{-8,-8},{8,8}}))); |
| 61 | +equation |
| 62 | + connect(fpu_to_fSI.y, governor.f) annotation ( |
| 63 | + Line(points={{-53.4,-52},{-22,-52},{-22,-44},{-12,-44}}, |
| 64 | + color = {0, 0, 127})); |
| 65 | + connect(governor.Y_gv, turbine.u_t) annotation ( |
| 66 | + Line(points={{11,-40},{24,-40},{24,-68}}, color = {0, 0, 127})); |
| 67 | + connect(governor.P_ref, power.y) annotation ( |
| 68 | + Line(points={{-12,-36},{-27.2,-36}}, color = {0, 0, 127})); |
| 69 | + connect(generator.vf, generator.vf0) annotation (Line(points={{-42,5},{-46,5},{-46,14},{-38,14},{-38,11}}, color={0,0,127})); |
| 70 | + connect(generator.p, bus1.p) annotation (Line(points={{-20,0},{0,0}}, color={0,0,255})); |
| 71 | + connect(discharge.o, tail.o) annotation (Line(points={{68,-80},{74,-80}}, color={28,108,200})); |
| 72 | + connect(turbine.o, discharge.i) annotation (Line(points={{42,-80},{48,-80}}, color={28,108,200})); |
| 73 | + connect(turbine.i, penstock.o) annotation (Line(points={{22,-80},{10,-80}}, color={28,108,200})); |
| 74 | + connect(penstock.i, surgeTank.o) annotation (Line(points={{-10,-80},{-20,-80}},color={28,108,200})); |
| 75 | + connect(surgeTank.i, intake.o) annotation (Line(points={{-40,-80},{-46,-80}}, color={28,108,200})); |
| 76 | + connect(intake.i, reservoir.o) annotation (Line(points={{-66,-80},{-70,-80}}, color={28,108,200})); |
| 77 | + connect(turbine.P_out, generator.pm) annotation (Line(points={{36,-69},{36,-22},{-52,-22},{-52,-5},{-42,-5}}, color={0,0,127})); |
| 78 | + connect(generator.w, fpu_to_fSI.u) annotation (Line(points={{-19,9},{-14,9},{-14,20},{-72,20},{-72,-52},{-67.2,-52}}, color={0,0,127})); |
| 79 | +annotation (experiment(StopTime = 2000)); |
| 80 | +end SimpleGen; |
0 commit comments