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

Mass flow rate in OMPython

Mass flow rate in OMPython

Hi everybody. I created a simple model:
model MFR
  inner Modelica.Fluid.System system annotation(
    Placement(visible = true, transformation(origin = {-102, 88}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.StaticPipe pipe(redeclare package Medium =
  Modelica.Media.Water.StandardWater, diameter = 2.25e-2, length = 10)  annotation(
    Placement(visible = true, transformation(origin = {-38, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium =
  Modelica.Media.Water.StandardWater, nPorts = 1) annotation(
    Placement(visible = true, transformation(origin = {112, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
  Modelica.Fluid.Sources.MassFlowSource_T boundary1(redeclare package Medium =
  Modelica.Media.Water.StandardWater, m_flow = 10, nPorts = 1)  annotation(
    Placement(visible = true, transformation(origin = {-100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Sensors.MassFlowRate massFlowRate (redeclare package Medium =
  Modelica.Media.Interfaces.PartialMedium) annotation(
    Placement(visible = true, transformation(origin = {28, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(boundary1.ports[1], pipe.port_a) annotation(
    Line(points = {{-90, 0}, {-48, 0}, {-48, 0}, {-48, 0}}, color = {0, 127, 255}));
  connect(pipe.port_b, massFlowRate.port_a) annotation(
    Line(points = {{-28, 0}, {18, 0}, {18, 0}, {18, 0}}, color = {0, 127, 255}));
  connect(massFlowRate.port_b, boundary.ports[1]) annotation(
    Line(points = {{38, 0}, {102, 0}, {102, 0}, {102, 0}}, color = {0, 127, 255}));

annotation(
    uses(Modelica(version = "3.2.3")));
end MFR;

I tried to simulate the model on OMPython but it gave me this error: Error: component massFlowRate contains the definition of a partial class Medium.
Please redeclare it to any package compatible with Modelica.Media.Interfaces.PartialMedium.
Error: Error occurred while flattening model MFR
How can I solve this problem?
Thank you.

There are 0 guests and 0 other users also viewing this topic