Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

How to redeclare a partial class to any package?

How to redeclare a partial class to any package?

Hi,

I am trying to simulate the same model as available in the ThermoPower library_Examples_BraytonCycle_Plant. However, I am receiving the follow errors. Could you please help me how to redeclare the partial class (Medium in this case).

Errors:



_________________________________________________________________________________________________________
[1] 16:15:12 Translation Notification
[ThermoPower.Gas: 247:17-248:44]: From here:

[2] 16:15:12 Translation Error
[mymodel_ThermoPower_Library: 35:3-36:112]: component sourceMassFlow1 contains the definition of a partial class Medium.
Please redeclare it to any package compatible with Modelica.Media.Interfaces.PartialMedium.

[3] 16:15:12 Translation Error
Error occurred while flattening model mymodel_ThermoPower_Library.Plant_1

___________________________________________________________________________________________________________

MODEL
--------------------------------------
model Plant_1
Modelica.Blocks.Interfaces.RealInput u annotation(
    Placement(visible = true, transformation(origin = {-100, 22}, extent = {{-12, -12}, {12, 12}}, rotation = 0), iconTransformation(origin = {-100, 22}, extent = {{-12, -12}, {12, 12}}, rotation = 0)));
Modelica.Blocks.Continuous.FirstOrder firstOrder1 annotation(
    Placement(visible = true, transformation(origin = {-68, 50}, extent = {{-4, -4}, {4, 4}}, rotation = 0)));


ThermoPower.Gas.SourceMassFlow sourceMassFlow1 annotation(
    Placement(visible = true, transformation(origin = {-44, 40}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
ThermoPower.Gas.CombustionChamber combustionChamber1 annotation(
    Placement(visible = true, transformation(origin = {-28, 20}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
ThermoPower.PowerPlants.HRSG.Components.StateReader_gas stateReader_gas1 annotation(
    Placement(visible = true, transformation(origin = {-43, 21}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
ThermoPower.PowerPlants.HRSG.Components.StateReader_gas stateReader_gas2 annotation(
    Placement(visible = true, transformation(origin = {-13, 19}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
ThermoPower.Gas.PressDrop pressDrop1 annotation(
    Placement(visible = true, transformation(origin = {-49, 3}, extent = {{-5, -5}, {5, 5}}, rotation = 90)));
ThermoPower.Gas.PressDrop pressDrop2 annotation(
    Placement(visible = true, transformation(origin = {-9,3}, extent = {{-5, -5}, {5, 5}}, rotation = -90)));
ThermoPower.Gas.Compressor compressor1 annotation(
    Placement(visible = true, transformation(origin = {-62, -22}, extent = {{-12, -12}, {12, 12}}, rotation = 0)));
ThermoPower.Gas.SourcePressure sourcePressure1 annotation(
    Placement(visible = true, transformation(origin = {-89, -1}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
ThermoPower.Gas.Turbine turbine1 annotation(
    Placement(visible = true, transformation(origin = {-4, -22}, extent = {{-12, -12}, {12, 12}}, rotation = 0)));
ThermoPower.Gas.SinkPressure sinkPressure1 annotation(
    Placement(visible = true, transformation(origin = {36, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Electrical.Generator generator1 annotation(
    Placement(visible = true, transformation(origin = {58, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(turbine1.shaft_b, generator1.shaft) annotation(
    Line(points = {{4, -22}, {48, -22}, {48, -20}, {50, -20}}));
  connect(compressor1.shaft_b, turbine1.shaft_a) annotation(
    Line(points = {{-54, -22}, {-12, -22}, {-12, -22}, {-12, -22}}));
  connect(sourcePressure1.flange, compressor1.inlet) annotation(
    Line(points = {{-82, 0}, {-72, 0}, {-72, -12}, {-72, -12}}, color = {159, 159, 223}));
  connect(turbine1.outlet, sinkPressure1.flange) annotation(
    Line(points = {{6, -12}, {4, -12}, {4, 0}, {26, 0}, {26, 0}}, color = {159, 159, 223}));
  connect(pressDrop2.outlet, turbine1.inlet) annotation(
    Line(points = {{-8, -2}, {-14, -2}, {-14, -12}, {-14, -12}}, color = {159, 159, 223}));
  connect(stateReader_gas2.outlet, pressDrop2.inlet) annotation(
    Line(points = {{-8, 20}, {-8, 20}, {-8, 8}, {-8, 8}}, color = {159, 159, 223}));
  connect(combustionChamber1.out, stateReader_gas2.inlet) annotation(
    Line(points = {{-22, 20}, {-18, 20}, {-18, 20}, {-18, 20}}, color = {159, 159, 223}));
  connect(pressDrop1.inlet, compressor1.outlet) annotation(
    Line(points = {{-48, -2}, {-52, -2}, {-52, -12}, {-52, -12}}, color = {159, 159, 223}));
  connect(stateReader_gas1.inlet, pressDrop1.outlet) annotation(
    Line(points = {{-50, 20}, {-50, 20}, {-50, 8}, {-48, 8}}, color = {159, 159, 223}));
  connect(combustionChamber1.ina, stateReader_gas1.outlet) annotation(
    Line(points = {{-34, 20}, {-40, 20}, {-40, 20}, {-40, 20}}, color = {159, 159, 223}));
  connect(sourceMassFlow1.flange, combustionChamber1.inf) annotation(
    Line(points = {{-38, 40}, {-28, 40}, {-28, 26}, {-28, 26}}, color = {159, 159, 223}));
  connect(firstOrder1.y, sourceMassFlow1.in_w0) annotation(
    Line(points = {{-64, 50}, {-48, 50}, {-48, 44}, {-48, 44}, {-48, 44}}, color = {0, 0, 127}));
  connect(u, firstOrder1.u) annotation(
    Line(points = {{-100, 22}, {-80, 22}, {-80, 50}, {-73, 50}}, color = {0, 0, 127}));
end Plant_1;

There are 0 guests and 0 other users also viewing this topic
You are here: