Modelica - Internal error for overconstrained stewart platform model - modelica

OpenModelica v1.17.0 (64-bit)
OMSimulator v2.0.0.post284-gc8ec782-mingw
Modelica Standard Library 3.2.3
Hello,
I'm currently working on the implementation of a dynamic model of a Stewart Platform in OpenModelica similar to the one in https://www.xarg.org/paper/inverse-kine … -platform/ (6RSS parallel robot) and apparently, I'm not able to connect multiple legs to the same platform due to the following error:
[1] 13:08:36 Translation Error
Internal error It is not possible to select continuous time states because Number of Equations 18 greater than number of States 17 to select from.
[2] 13:08:36 Translation Error
Internal error - IndexReduction.dynamicStateSelectionWork failed!
From what I have seen in the documentation of Modelica, this might be caused by some loop in the spanning tree generated during the translation phase of the model where some non-flow equations became dependent on each other resulting in an overconstrained (even if still solvable) system. It follows the source code of the package that I have created in which there are present a base, a platform, and only two RSS legs which create the issue.
package sixRSS_parallelRobot
model platform
import Modelica.SIunits;
import Modelica.Math;
constant SIunits.Length l = 0.7;
constant StateSelect stateSelect = StateSelect.prefer annotation(
Dialog(tab = "Advanced"));
final constant Real pi = 2 * Modelica.Math.asin(1.0);
parameter Boolean useQuat = false;
Modelica.Mechanics.MultiBody.Parts.Body body(enforceStates = stateSelect == StateSelect.always,m = 1, r_0(each fixed = true, start = {0, 0.5, 0}), r_CM = {0, 0, 0}, useQuaternions = useQuat, v_0(each fixed = true, start = {0, 0, 0}), w_a(each fixed = true)) annotation(
Placement(visible = true, transformation(origin = {70, 2}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation1(r = {l * cos(0 * (pi / 180) + (-5) * (pi / 180)), 0, l * sin(0 * (pi / 180) + (-5) * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {-18, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation2(r = {l * cos(0 * (pi / 180) + 5 * (pi / 180)), 0, l * sin(0 * (pi / 180) + 5 * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {-14, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation3(r = {l * cos(120 * (pi / 180) + (-5) * (pi / 180)), 0, l * sin(120 * (pi / 180) + (-5) * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {-18, 24}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation4(r = {l * cos(120 * (pi / 180) + 5 * (pi / 180)), 0, l * sin(120 * (pi / 180) + 5 * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {-12, 2}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation5(r = {l * cos(240 * (pi / 180) + (-5) * (pi / 180)), 0, l * sin(240 * (pi / 180) + (-5) * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {-14, -24}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
Modelica.Mechanics.MultiBody.Parts.FixedTranslation fixedTranslation6(r = {l * cos(240 * (pi / 180) + 5 * (pi / 180)), 0, l * sin(240 * (pi / 180) + 5 * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {-16, -46}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
//outer Modelica.Mechanics.MultiBody.World world;
Modelica.Mechanics.MultiBody.Interfaces.Frame_b frame_b[6] annotation(
Placement(visible = true, transformation(origin = {-76, 10}, extent = {{-16, -16}, {16, 16}}, rotation = 0), iconTransformation(origin = {-100, 6}, extent = {{-16, -16}, {16, 16}}, rotation = 0)));
equation
connect(fixedTranslation1.frame_a, body.frame_a) annotation(
Line(points = {{-8, 68}, {30, 68}, {30, 2}, {60, 2}}, color = {95, 95, 95}));
connect(fixedTranslation2.frame_a, body.frame_a) annotation(
Line(points = {{-4, 50}, {30, 50}, {30, 2}, {60, 2}}, color = {95, 95, 95}));
connect(fixedTranslation3.frame_a, body.frame_a) annotation(
Line(points = {{-8, 24}, {30, 24}, {30, 2}, {60, 2}}));
connect(fixedTranslation4.frame_a, body.frame_a) annotation(
Line(points = {{-2, 2}, {60, 2}}));
connect(fixedTranslation5.frame_a, body.frame_a) annotation(
Line(points = {{-4, -24}, {30, -24}, {30, 2}, {60, 2}}, color = {95, 95, 95}));
connect(fixedTranslation6.frame_a, body.frame_a) annotation(
Line(points = {{-6, -46}, {30, -46}, {30, 2}, {60, 2}}, color = {95, 95, 95}));
connect(fixedTranslation2.frame_b, frame_b[2]) annotation(
Line(points = {{-24, 50}, {-56, 50}, {-56, 10}, {-76, 10}}, color = {95, 95, 95}));
connect(fixedTranslation3.frame_b, frame_b[3]) annotation(
Line(points = {{-28, 24}, {-56, 24}, {-56, 10}, {-76, 10}}, color = {95, 95, 95}));
connect(fixedTranslation4.frame_b, frame_b[4]) annotation(
Line(points = {{-22, 2}, {-56, 2}, {-56, 10}, {-76, 10}}, color = {95, 95, 95}));
connect(fixedTranslation5.frame_b, frame_b[5]) annotation(
Line(points = {{-24, -24}, {-56, -24}, {-56, 10}, {-76, 10}}, color = {95, 95, 95}));
connect(fixedTranslation6.frame_b, frame_b[6]) annotation(
Line(points = {{-26, -46}, {-56, -46}, {-56, 10}, {-76, 10}}, color = {95, 95, 95}));
connect(fixedTranslation1.frame_b, frame_b[1]) annotation(
Line(points = {{-28, 68}, {-56, 68}, {-56, 10}, {-76, 10}}, color = {95, 95, 95}));
annotation(
uses(Modelica(version = "3.2.3")));
end platform;
model base
import Modelica.SIunits;
import Modelica.Math;
constant SIunits.Length l = 0.7;
constant StateSelect stateSelect = StateSelect.prefer annotation(
Dialog(tab = "Advanced"));
final constant Real pi = 2 * Modelica.Math.asin(1.0);
parameter Boolean useQuat = false;
Modelica.Mechanics.MultiBody.Parts.Fixed fixed annotation(
Placement(visible = true, transformation(origin = {-16, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.Fixed fixed1(r = {l * cos(0 * (pi / 180) + (-5) * (pi / 180)), 0, l * sin(0 * (pi / 180) + (-5) * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {54, -2}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.Fixed fixed2(r = {l * cos(0 * (pi / 180) + 5 * (pi / 180)), 0, l * sin(0 * (pi / 180) + 5 * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {52, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.Fixed fixed3(r = {l * cos(120 * (pi / 180) + (-5) * (pi / 180)), 0, l * sin(120 * (pi / 180) + (-5) * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {-46, 76}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.Fixed fixed4(r = {l * cos(120 * (pi / 180) + 5 * (pi / 180)), 0, l * sin(120 * (pi / 180) + 5 * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {-74, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.Fixed fixed5(r = {l * cos(240 * (pi / 180) + (-5) * (pi / 180)), 0, l * sin(240 * (pi / 180) + (-5) * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {-68, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.Fixed fixed6(r = {l * cos(240 * (pi / 180) + 5 * (pi / 180)), 0, l * sin(240 * (pi / 180) + 5 * (pi / 180))}) annotation(
Placement(visible = true, transformation(origin = {-44, -68}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.Body body(enforceStates = stateSelect == StateSelect.always,m = 5, r_CM = {0, 0, 0}, useQuaternions = useQuat) annotation(
Placement(visible = true, transformation(origin = {12, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
outer Modelica.Mechanics.MultiBody.World world;
Modelica.Mechanics.MultiBody.Interfaces.Frame_a frame_a[6] annotation(
Placement(visible = true, transformation(origin = {104, 16}, extent = {{-16, -16}, {16, 16}}, rotation = 0), iconTransformation(origin = {108, 0}, extent = {{-16, -16}, {16, 16}}, rotation = 0)));
equation
connect(fixed.frame_b, body.frame_a) annotation(
Line(points = {{-6, 12}, {2, 12}}, color = {95, 95, 95}));
connect(fixed1.frame_b, frame_a[1]) annotation(
Line(points = {{64, -2}, {86, -2}, {86, 16}, {104, 16}}));
connect(fixed2.frame_b, frame_a[2]) annotation(
Line(points = {{62, 30}, {86, 30}, {86, 16}, {104, 16}}, color = {95, 95, 95}));
connect(fixed3.frame_b, frame_a[3]) annotation(
Line(points = {{-36, 76}, {86, 76}, {86, 16}, {104, 16}}));
connect(fixed4.frame_b, frame_a[4]) annotation(
Line(points = {{-64, 50}, {86, 50}, {86, 16}, {104, 16}}));
connect(fixed5.frame_b, frame_a[5]) annotation(
Line(points = {{-58, -26}, {86, -26}, {86, 16}, {104, 16}}));
connect(fixed6.frame_b, frame_a[6]) annotation(
Line(points = {{-34, -68}, {86, -68}, {86, 16}, {104, 16}}));
annotation(
uses(Modelica(version = "3.2.3")));
end base;
model fullmodel
inner Modelica.Mechanics.MultiBody.World world annotation(
Placement(visible = true, transformation(origin = {-68, 14}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
sixRSS_parallelRobot.platform platform(useQuat = true) annotation(
Placement(visible = true, transformation(origin = {106, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
sixRSS_parallelRobot.base base(useQuat = true) annotation(
Placement(visible = true, transformation(origin = {-26, 14}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Joints.Revolute revolute(n = {1, 0, 0}, phi(displayUnit = "rad")) annotation(
Placement(visible = true, transformation(origin = {-1, 29}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.BodyShape bodyShape(m = 0.01, r = {0, 0, -0.2}, r_CM = {0, 0, -0.1}) annotation(
Placement(visible = true, transformation(origin = {19, 29}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Joints.Spherical spherical annotation(
Placement(visible = true, transformation(origin = {35, 29}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.BodyShape bodyShape1(m = 0.002, r = {0, 0.5, 0.2}, r_CM = {0, 0.25, 0.1}) annotation(
Placement(visible = true, transformation(origin = {51, 29}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Joints.Spherical spherical1 annotation(
Placement(visible = true, transformation(origin = {71, 29}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Joints.Revolute revolute1(n = {1, 0, 0}, phi(displayUnit = "rad")) annotation(
Placement(visible = true, transformation(origin = {1, -1}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.BodyShape bodyShape2(m = 0.01, r = {0, 0, 0.2}, r_CM = {0, 0, 0.1}) annotation(
Placement(visible = true, transformation(origin = {21, -1}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Joints.Spherical spherical2 annotation(
Placement(visible = true, transformation(origin = {37, -1}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Parts.BodyShape bodyShape3(m = 0.002, r = {0, 0.5, -0.2}, r_CM = {0, 0.25, -0.1}) annotation(
Placement(visible = true, transformation(origin = {53, -1}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
Modelica.Mechanics.MultiBody.Joints.Spherical spherical3 annotation(
Placement(visible = true, transformation(origin = {73, -1}, extent = {{-7, -7}, {7, 7}}, rotation = 0)));
equation
connect(revolute.frame_b, bodyShape.frame_a) annotation(
Line(points = {{6, 29}, {12, 29}}));
connect(bodyShape.frame_b, spherical.frame_a) annotation(
Line(points = {{26, 29}, {28, 29}}, color = {95, 95, 95}));
connect(spherical.frame_b, bodyShape1.frame_a) annotation(
Line(points = {{42, 29}, {44, 29}}, color = {95, 95, 95}));
connect(bodyShape1.frame_b, spherical1.frame_a) annotation(
Line(points = {{58, 30}, {64, 30}}));
connect(revolute.frame_a, base.frame_a[1]) annotation(
Line(points = {{-8, 30}, {-10, 30}, {-10, 14}, {-16, 14}}));
connect(spherical1.frame_b, platform.frame_b[1]) annotation(
Line(points = {{78, 30}, {88, 30}, {88, 12}, {96, 12}}, color = {95, 95, 95}));
connect(base.frame_a[2], revolute1.frame_a) annotation(
Line(points = {{-16, 14}, {-10, 14}, {-10, 0}, {-6, 0}}, color = {95, 95, 95}));
connect(revolute1.frame_b, bodyShape2.frame_a) annotation(
Line(points = {{8, 0}, {14, 0}}, color = {95, 95, 95}));
connect(bodyShape2.frame_b, spherical2.frame_a) annotation(
Line(points = {{28, 0}, {30, 0}}, color = {95, 95, 95}));
connect(spherical2.frame_b, bodyShape3.frame_a) annotation(
Line(points = {{44, 0}, {46, 0}}, color = {95, 95, 95}));
connect(bodyShape3.frame_b, spherical3.frame_a) annotation(
Line(points = {{60, 0}, {66, 0}}));
connect(spherical3.frame_b, platform.frame_b[2]) annotation(
Line(points = {{80, 0}, {88, 0}, {88, 12}, {96, 12}}));
end fullmodel;
annotation(
uses(Modelica(version = "3.2.3")));
end sixRSS_parallelRobot;
Since I'm new to Modelica, I think I'm missing some basic concepts of modelling multibody mechanics especially when kinematics loops take place. I've already made some tests on the planar loop fourbar example in the Modelica library but I think this is something different. Is there a way to solve this error and finally obtain a working model of the 6RSS parallel robot?
Thank you in advance for your help!

Not actually an answer, I know, but with a comment only, adding the gif below wouldn't be possible.
The model works in Dymola 2022 (after converting to MSL 4.0.0) and Dymola 2020x (with MSL 3.2.3) without any important warning. So, given the result below is what you would expect, then there is no fundamental error within the model. The resulting animation looks like this:
Dymola does dynamic state selection for the model - I'm not sure whether OpenModelica is able to do that as well. Generally I can't really help with OpenModelica unfortunately. But Probably this is already of help for you...

Related

Changing the Heat transfer model of the ClosedVolume of the Modelica Standard Library lead to an unbalanced model

The documentation of the Modelica.Fluid.Vessels.ClosedVolume says that IdealHeatTransfer is considered by default. I'd like to use ConstantFlowHeatTransfer instead. I declare it in the Text View. However, doing so leads to an unbalanced model : 939 equations and 943 variables.
Here is the model :
And here is the code used :
model Closed_volume_test
replaceable package Medium=Modelica.Media.Water.ConstantPropertyLiquidWater constrainedby Modelica.Media.Interfaces.PartialMedium;
replaceable model HeatTransfer_1 = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.ConstantFlowHeatTransfer(alpha0=1800);
replaceable model HeatTransfer_2 = Modelica.Fluid.Pipes.BaseClasses.HeatTransfer.ConstantFlowHeatTransfer(alpha0=8000);
Modelica.Fluid.Vessels.ClosedVolume volume(redeclare package Medium = Medium, redeclare final model HeatTransfer = HeatTransfer_1, V = 20, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, nPorts= 2, use_HeatTransfer = true, use_portsData = false) annotation(
Placement(visible = true, transformation(origin = {0, -36}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe(redeclare package Medium = Medium,diameter = 0.15, length = 1) annotation(
Placement(visible = true, transformation(origin = {26, -54}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.MassFlowSource_T boundary1(redeclare package Medium = Medium, T = 328.15, m_flow = 1,nPorts = 1) annotation(
Placement(visible = true, transformation(origin = {-56, -54}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.Boundary_pT boundary(redeclare package Medium = Medium,T = 328.15, nPorts = 1, p = 1e5) annotation(
Placement(visible = true, transformation(origin = {56, -54}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
inner Modelica.Fluid.System system annotation(
Placement(visible = true, transformation(origin = {-88, 32}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe1(redeclare package Medium = Medium,diameter = 0.15, length = 1) annotation(
Placement(visible = true, transformation(origin = {-26, -54}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.DynamicPipe pipe2(redeclare package Medium = Medium, redeclare final model HeatTransfer = HeatTransfer_2, diameter = 38e-3, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, length = 15, massDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, momentumDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, nNodes = 10, use_HeatTransfer = true) annotation(
Placement(visible = true, transformation(origin = {0, 28}, extent = {{-10, 10}, {10, -10}}, rotation = 0)));
Modelica.Fluid.Sources.Boundary_pT boundary2(redeclare package Medium = Medium,T = 311.15, nPorts = 1, p = 14.6e5) annotation(
Placement(visible = true, transformation(origin = {-36, 28}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sources.MassFlowSource_T boundary3(redeclare package Medium = Medium,m_flow = -0.25, nPorts = 1) annotation(
Placement(visible = true, transformation(origin = {36, 28}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
Modelica.Fluid.Examples.HeatExchanger.BaseClasses.WallConstProps wallConstProps(area_h = 0.89, c_wall = 510, energyDynamics = Modelica.Fluid.Types.Dynamics.SteadyState, k_wall = 60.5, n = 10, rho_wall = 7850, s = 3e-3) annotation(
Placement(visible = true, transformation(origin = {0, 8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Thermal.HeatTransfer.Components.ThermalCollector thermalCollector(m = 10) annotation(
Placement(visible = true, transformation(origin = {0, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(boundary1.ports[1], pipe1.port_a) annotation(
Line(points = {{-46, -54}, {-36, -54}}, color = {0, 127, 255}));
connect(pipe.port_b, boundary.ports[1]) annotation(
Line(points = {{36, -54}, {46, -54}}, color = {0, 127, 255}));
connect(volume.ports[1], pipe1.port_b) annotation(
Line(points = {{0, -46}, {-16, -46}, {-16, -54}}, color = {0, 127, 255}));
connect(volume.ports[2], pipe.port_a) annotation(
Line(points = {{0, -46}, {16, -46}, {16, -54}}, color = {0, 127, 255}));
connect(boundary2.ports[1], pipe2.port_a) annotation(
Line(points = {{-26, 28}, {-10, 28}}, color = {0, 127, 255}));
connect(pipe2.port_b, boundary3.ports[1]) annotation(
Line(points = {{10, 28}, {26, 28}}, color = {0, 127, 255}));
connect(pipe2.heatPorts, wallConstProps.heatPort_a) annotation(
Line(points = {{0, 24}, {0, 13}}, color = {127, 0, 0}, thickness = 0.5));
connect(wallConstProps.heatPort_b, thermalCollector.port_a) annotation(
Line(points = {{0, 3}, {0, 0}}, color = {191, 0, 0}, thickness = 0.5));
connect(thermalCollector.port_b, volume.heatPort) annotation(
Line(points = {{0, -20}, {-10, -20}, {-10, -36}}, color = {191, 0, 0}));
annotation(
uses(Modelica(version = "3.2.3")));
end Closed_volume_test;
Is it possible to use another model for the heat transfer for the ClosedVolume ? If so, does anyone know how can I solve this problem?
Best regards
Maxime
ConstantFlowHeatTransfer is inherited from PartialFlowHeatTransfer which uses quantities such as length and nParallel which are not defined (and have no meaning) in the volume model. This is why you cannot use it.
ClosedVolume uses heat transfer models that inherit from PartialVesselHeatTransfer. You can build your own heat transfer model based on this.
If you need to consider the convective heat transfer in the "lower" medium of your model you could replace pipe, pipe1 and volume with a DynamicPipe model (with modelStructure=a_v_b and nNodes=1).

Is there a Block component to keep the PID controller signal steady and unchanged for 100 seconds

I got PID controller, I want to add a block so that the PID output signal would keep steady and unchanged at some timepoint, and after 100 seconds, the PID output signal would begin to work normally again. Is there a block component like this in MSL?
Not in MSL. As far as I recall, only the integrator block has a reset/tracking option.
If you use a PID from 'Modelica Buildings Library' or from the 'Industrial Control Systems' library it has a Boolean and an analogue tracking/reset input. Connect the analogue input to the controller output and the output will 'pause' when the Bolan input is 'true'
You can can sample and hold the output. For example, here I used a sine wave in place of the PID, and a timetable to indicate when to hold and when to use that output:
model Hold_test
Modelica.Blocks.Discrete.TriggeredSampler triggeredSampler annotation(
Placement(visible = true, transformation(origin = {2, 8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Sine PIDPlaceholder(f = 0.01, phase = 0.5235987755982988) annotation(
Placement(visible = true, transformation(origin = {-74, 6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Logical.Switch switch1 annotation(
Placement(visible = true, transformation(origin = {8, 58}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.TimeTable timeTable(table = [0, 0; 50, 0; 51, 1; 150, 1; 151, 0; 200, 0]) annotation(
Placement(visible = true, transformation(origin = {-70, -82}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Logical.LessThreshold lessThreshold(threshold = 1) annotation(
Placement(visible = true, transformation(origin = {-24, -80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Logical.Not not1 annotation(
Placement(visible = true, transformation(origin = {26, -78}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(timeTable.y, lessThreshold.u) annotation(
Line(points = {{-58, -82}, {-47, -82}, {-47, -80}, {-36, -80}}, color = {0, 0, 127}));
connect(lessThreshold.y, not1.u) annotation(
Line(points = {{-12, -80}, {12, -80}, {12, -78}, {14, -78}}, color = {255, 0, 255}));
connect(not1.y, triggeredSampler.trigger) annotation(
Line(points = {{38, -78}, {48, -78}, {48, -24}, {2, -24}, {2, -4}, {2, -4}, {2, -4}}, color = {255, 0, 255}));
connect(lessThreshold.y, switch1.u2) annotation(
Line(points = {{-12, -80}, {-6, -80}, {-6, -30}, {-34, -30}, {-34, 58}, {-4, 58}, {-4, 58}, {-4, 58}}, color = {255, 0, 255}));
connect(PIDPlaceholder.y, triggeredSampler.u) annotation(
Line(points = {{-62, 6}, {-10, 6}, {-10, 8}, {-10, 8}}, color = {0, 0, 127}));
connect(triggeredSampler.y, switch1.u3) annotation(
Line(points = {{14, 8}, {28, 8}, {28, 38}, {-18, 38}, {-18, 50}, {-4, 50}, {-4, 50}}, color = {0, 0, 127}));
connect(PIDPlaceholder.y, switch1.u1) annotation(
Line(points = {{-62, 6}, {-48, 6}, {-48, 66}, {-4, 66}, {-4, 66}}, color = {0, 0, 127}));
annotation(
uses(Modelica(version = "4.0.0")),
experiment(StartTime = 0, StopTime = 200, Tolerance = 1e-6, Interval = 0.4));
end Hold_test;

How do I solve Modelica errors of variables, where the variables are parameters of extensions that your model is using?

I've been trying to build a Rankine Power Cycle on OpenModelica for quite some time now and have been running into a reoccurring issue that I'm just not sure how to troubleshoot.
My Issue:
I'm able to get the majority of all of my Rankine Power Cycle model iterations to at least get a checked model as well as a successful instantiation. At this point I deem my model ready to try and simulate. The types of errors that usually break my simulation are variables that are located within extended models that my model is using.
For example:
Currently I am checking and verifying sub assemblies of the Rankine Power Cycle to be able to properly verify which components work and which do not under x,y,z circumstances. My heat exchanger model is checked and is able to instantiate but upon simulation I get error codes that read:
[22] 14:34:06 Symbolic Error
[ThermoPower.Gas: 1053:5-1053:66]: Model is structurally singular, error
found sorting equations
125: 0.0 = 0.0;
for variables
HX.gasFlow.vbar[5](140), HX.gasFlow.drbdX1[2,4](125)
What the issue here for me is that the error above, or all errors of these types, are hyperlinked to either partial models or packages that my own model extends. So the variables above "vbar" or "drbdX1" are no where within my HeatExchanger Model that I built, but the components inside of my own model somehow extend to these variables that are inevitably causing the error.
Things I've tried:
I've tried adding values to the extended hyperlinked models/packages in order to fix the error. This does not do anything.
I've tried copy and pasting said lines of code into my own model in order to declare whatever package/function that has already been declared within the extension. This does not work as usually produces an error for incorrect declaration.
The hyperlinked error does little to not help on how exactly I should fix the model, or where or which model I should fix it on.
If you have any insight or recommendations on how to fix such an issue, please feel free to comment below! Thank you for your time and reading this far into my plea for help :)
Heat Exchanger Code:
model HX_Turbine_Check
ThermoPower.PowerPlants.HRSG.Components.HE HX(
FluidPhaseStart = ThermoPower.Choices.FluidPhase.FluidPhases.Steam,
N_F = 6,
N_G = 6, Tstartbar_G(displayUnit = "K") = 800,
exchSurface_F = 2000,
exchSurface_G = 1000,
extSurfaceTub = 1500,
fluidNomFlowRate = 10,
fluidNomPressure = 2e+06,
fluidVol = 5,
gasNomFlowRate = 100,
gasNomPressure = 101325,
gasVol = 10,
lambda = 20,
metalVol = 10,
pstart_F = 2e+06,
pstart_G = 101325,
rhomcm = 7900,
rhonom_F(displayUnit = "kg/m3") = 0.6,
rhonom_G(displayUnit = "kg/m3") = 0.33) annotation(
Placement(visible = true, transformation(origin = {-30, 30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SourceMassFlow FlueGasSource(
redeclare package Medium = ThermoPower.Media.FlueGas,
T = 800,
p0 = 101325,
w0 = 100) annotation(
Placement(visible = true, transformation(origin = {-92, 30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SinkMassFlow FlueGasSink(
redeclare package Medium = ThermoPower.Media.FlueGas,
p0 = 101325,
w0 = 100) annotation(
Placement(visible = true, transformation(origin = {32, 30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SourceMassFlow WaterSource(
T = 212.4 + 273,
h = 2799500,
p0 = 20e5,
w0 = 10) annotation(
Placement(visible = true, transformation(origin = {-30, 92}, extent =
{{-10, -10}, {10, 10}}, rotation = -90)));
ThermoPower.Water.SinkMassFlow SteamSink(
p0 = 1.01325e5,
w0 = 10) annotation(
Placement(visible = true, transformation(origin = {48, 0}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SensT TGas_Inlet(
redeclare package Medium = ThermoPower.Media.FlueGas) annotation(
Placement(visible = true, transformation(origin = {-58, 34}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.SensT TGas_Outlet(
redeclare package Medium = ThermoPower.Media.FlueGas) annotation(
Placement(visible = true, transformation(origin = {0, 34}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SensT TWater_Inlet annotation(
Placement(visible = true, transformation(origin = {-26, 60}, extent =
{{-10, -10}, {10, 10}}, rotation = -90)));
ThermoPower.Water.SensT TSteam_Outlet annotation(
Placement(visible = true, transformation(origin = {16, 4}, extent = {{-10,
-10}, {10, 10}}, rotation = 0)));
ThermoPower.Water.SteamTurbineStodola SteamTurbine(
Kt = 0.0131,
PRstart = 20,
pnom = 20e5,
wnom = 10,
wstart = 10) annotation(
Placement(visible = true, transformation(origin = {-20, -30}, extent =
{{-12, -12}, {12, 12}}, rotation = 0)));
inner ThermoPower.System system annotation(
Placement(visible = true, transformation(origin = {50, 88}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Rotational.Sensors.PowerSensor powerSensor1 annotation(
Placement(visible = true, transformation(origin = {14, -30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Electrical.Generator generator1 annotation(
Placement(visible = true, transformation(origin = {44, -30}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Continuous.FirstOrder firstOrder1 annotation(
Placement(visible = true, transformation(origin = {30, -70}, extent =
{{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput y annotation(
Placement(visible = true, transformation(origin = {108, -70}, extent =
{{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {108,
-70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(firstOrder1.y, y) annotation(
Line(points = {{42, -70}, {100, -70}, {100, -70}, {108, -70}}, color = {0,
0, 127}));
connect(powerSensor1.power, firstOrder1.u) annotation(
Line(points = {{6, -42}, {6, -42}, {6, -70}, {18, -70}, {18, -70}}, color
= {0, 0, 127}));
connect(powerSensor1.flange_b, generator1.shaft) annotation(
Line(points = {{24, -30}, {36, -30}, {36, -30}, {36, -30}}));
connect(SteamTurbine.shaft_b, powerSensor1.flange_a) annotation(
Line(points = {{-12, -30}, {4, -30}, {4, -30}, {4, -30}}));
connect(SteamTurbine.outlet, TSteam_Outlet.inlet) annotation(
Line(points = {{-10, -20}, {0, -20}, {0, 0}, {10, 0}}, color = {0, 0,
255}));
connect(TSteam_Outlet.outlet, SteamSink.flange) annotation(
Line(points = {{22, 0}, {38, 0}}, color = {0, 0, 255}));
connect(HX.waterOut, SteamTurbine.inlet) annotation(
Line(points = {{-30, 20}, {-30, -20}}, color = {0, 0, 255}));
connect(TWater_Inlet.outlet, HX.waterIn) annotation(
Line(points = {{-30, 54}, {-30, 54}, {-30, 40}, {-30, 40}}, color = {0, 0,
255}));
connect(WaterSource.flange, TWater_Inlet.inlet) annotation(
Line(points = {{-30, 82}, {-30, 82}, {-30, 66}, {-30, 66}}, color = {0, 0,
255}));
connect(TGas_Outlet.outlet, FlueGasSink.flange) annotation(
Line(points = {{6, 30}, {14, 30}, {14, 30}, {22, 30}, {22, 30}, {22, 30}},
color = {159, 159, 223}));
connect(HX.gasOut, TGas_Outlet.inlet) annotation(
Line(points = {{-20, 30}, {-13, 30}, {-13, 30}, {-6, 30}, {-6, 30}, {-6,
30}, {-6, 30}, {-6, 30}}, color = {159, 159, 223}));
connect(TGas_Inlet.outlet, HX.gasIn) annotation(
Line(points = {{-52, 30}, {-46, 30}, {-46, 30}, {-40, 30}, {-40, 30},
{-40, 30}, {-40, 30}, {-40, 30}}, color = {159, 159, 223}));
connect(FlueGasSource.flange, TGas_Inlet.inlet) annotation(
Line(points = {{-82, 30}, {-64, 30}, {-64, 30}, {-64, 30}}, color = {159,
159, 223}));
connect(HX.gasOut, HX.gasIn) annotation(
Line(points = {{-20, 30}, {-40, 30}}, color = {159, 159, 223}));
annotation(
uses(ThermoPower(version = "3.1"), Modelica(version = "3.2.3")));end
HX_Turbine_Check;

Fixing illogical "incompatibility components" error copied from OpenModelica Library

I am trying to model and replicate the "Open Brayton Power Cycle" from the OpenModelica Library and have come across an error message that makes little sense. The error message is the result of incompatibility between sourceMassflow.mo and CombustionChamber.mo, all taken from the modelica library and connected in the same fashion as the library Brayton example has been done.
This error has occurred after completely replicating the "Brayton Power Cycle - Open" from the modelica library.
This is the error I am receiving. This message almost proves that the two components are compatible with one another however I cannot figure out the reason why they are "not working" together.
[11] 14:18:40 Translation Error
[BraytonCycle_First: 49:3-50:84]: Incompatible components in connect statement: connect(sourceMassFlow1.flange, combustionChamber1.inf)
- sourceMassFlow1.flange has components {C_outflow, Xi_outflow, h_outflow, m_flow, p}
- combustionChamber1.inf has components {C_outflow, Xi_outflow, h_outflow, m_flow, p}
I copied all of the library's component parameters into my model and expected this to solve the issue. Nothing I have done fixes this issue, where it seems that these models would be compatible due to the error message above.
Any help or advice would be greatly appreciated.
This model compiles but has issues with simulation. Maybe you can fix those. I changed all the redeclares to use ThermoPower.Media.* mediums.
model BraytonCycleLibraryReplica "Brayton Cycle iterations with re-declared mediums and copied values from Library Plant"
//Figure out the importance of table values//
parameter Real tableEtaC[6, 4]=[0, 95, 100, 105; 1, 82.5e-2, 81e-2,
80.5e-2; 2, 84e-2, 82.9e-2, 82e-2; 3, 83.2e-2, 82.2e-2, 81.5e-2; 4,
82.5e-2, 81.2e-2, 79e-2; 5, 79.5e-2, 78e-2, 76.5e-2];
parameter Real tablePhicC[6, 4]=[0, 95, 100, 105; 1, 38.3e-3, 43e-3,
46.8e-3; 2, 39.3e-3, 43.8e-3, 47.9e-3; 3, 40.6e-3, 45.2e-3, 48.4e-3;
4, 41.6e-3, 46.1e-3, 48.9e-3; 5, 42.3e-3, 46.6e-3, 49.3e-3];
parameter Real tablePR[6, 4]=[0, 95, 100, 105; 1, 22.6, 27, 32; 2, 22,
26.6, 30.8; 3, 20.8, 25.5, 29; 4, 19, 24.3, 27.1; 5, 17, 21.5, 24.2];
parameter Real tablePhicT[5, 4]=[1, 90, 100, 110; 2.36, 4.68e-3, 4.68e-3,
4.68e-3; 2.88, 4.68e-3, 4.68e-3, 4.68e-3; 3.56, 4.68e-3, 4.68e-3,
4.68e-3; 4.46, 4.68e-3, 4.68e-3, 4.68e-3];
parameter Real tableEtaT[5, 4]=[1, 90, 100, 110; 2.36, 89e-2, 89.5e-2,
89.3e-2; 2.88, 90e-2, 90.6e-2, 90.5e-2; 3.56, 90.5e-2, 90.6e-2,
90.5e-2; 4.46, 90.2e-2, 90.3e-2, 90e-2];
ThermoPower.Gas.Turbine turbine1(
redeclare package Medium = ThermoPower.Media.FlueGas,
Ndesign = 157.08,
Table = ThermoPower.Choices.TurboMachinery.TableTypes.matrix,
Tdes_in = 1400,
Tstart_in = 1370,
Tstart_out = 800,
pstart_in = 7.85e5,
pstart_out = 1.52e5, tableEta = tableEtaT, tablePhic = tablePhicT)
annotation(
Placement(visible = true, transformation(origin = {40, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.Compressor compressor1(
redeclare package Medium = ThermoPower.Media.Air,
Ndesign = 157.08,
Table = ThermoPower.Choices.TurboMachinery.TableTypes.matrix,
Tdes_in = 244.4,
Tstart_in = 244.4,
Tstart_out = 600.4,
explicitIsentropicEnthalpy = true,
pstart_in = 0.343e5,
pstart_out = 8.3e5, tableEta = tableEtaC, tablePR = tablePR, tablePhic = tablePhicC)
annotation(
Placement(visible = true, transformation(origin = {-40, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.CombustionChamber combustionChamber1(
Cm = 1,
HH = 41.6e6,
S = 0.05,
Tstart = 1370,
V = 0.05,
gamma = 1,
initOpt = ThermoPower.Choices.Init.Options.steadyState,
pstart = 8.11e5)
annotation(
Placement(visible = true, transformation(origin = {0, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Gas.PressDrop pressDrop1(
redeclare package Medium = ThermoPower.Media.Air, A = 1, FFtype = ThermoPower.Choices.PressDrop.FFtypes.OpPoint, Tstart = 600, dpnom = 19000, pstart = 8.3e5, rhonom = 4.7, wnom = 100)
annotation(
Placement(visible = true, transformation(origin = {-32, 14}, extent = {{-6, -6}, {6, 6}}, rotation = -90)));
ThermoPower.Gas.PressDrop pressDrop2(
redeclare package Medium = ThermoPower.Media.FlueGas,
FFtype = ThermoPower.Choices.PressDrop.FFtypes.OpPoint,
Tstart = 1370,
dpnom = 26000,
pstart = 811000,
rhonom = 2,
wnom = 102)
annotation(
Placement(visible = true, transformation(origin = {32, 14}, extent = {{-6, -6}, {6, 6}}, rotation = -90)));
ThermoPower.Gas.SourceMassFlow sourceMassFlow1(
redeclare package Medium = ThermoPower.Media.NaturalGas, T = 300, p0 = 811000, use_in_w0 = true, w0 = 2.02)
annotation(
Placement(visible = true, transformation(origin = {-44, 40}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
ThermoPower.Gas.SourcePressure sourcePressure1(
redeclare package Medium = ThermoPower.Media.Air,
T = 244.4,
p0 = 34300)
annotation(
Placement(visible = true, transformation(origin = {-92, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.PowerPlants.HRSG.Components.StateReader_gas stateReader_gas1(
redeclare package Medium = ThermoPower.Media.Air)
annotation(
Placement(visible = true, transformation(origin = {-22, 30}, extent = {{-8, -8}, {8, 8}}, rotation = 0)));
ThermoPower.PowerPlants.HRSG.Components.StateReader_gas stateReader_gas2(
redeclare package Medium = ThermoPower.Media.FlueGas)
annotation(
Placement(visible = true, transformation(origin = {22, 30}, extent = {{-8, -8}, {8, 8}}, rotation = 0)));
Modelica.Blocks.Continuous.FirstOrder firstOrder1(
T = 4,
initType = Modelica.Blocks.Types.Init.SteadyState,
y_start = 500)
annotation(
Placement(visible = true, transformation(origin = {-85, 51}, extent = {{-5, -5}, {5, 5}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealInput FuelFlowRate
annotation(
Placement(visible = true, transformation(origin = {-142, 18}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-142, 18}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
ThermoPower.Gas.SinkPressure sinkPressure1(
redeclare package Medium = ThermoPower.Media.FlueGas,
T = 800,
p0 = 1.52e5)
annotation(
Placement(visible = true, transformation(origin = {66, 20}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
Modelica.Mechanics.Rotational.Sensors.PowerSensor powerSensor1
annotation(
Placement(visible = true, transformation(origin = {60, -8}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
ThermoPower.Electrical.Generator generator1(
J = 30,
initOpt = ThermoPower.Choices.Init.Options.steadyState,
shaft(phi(start=0, fixed=true)))
annotation(
Placement(visible = true, transformation(origin = {80, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Continuous.FirstOrder firstOrder2(
T = 1,
initType = Modelica.Blocks.Types.Init.SteadyState,
k = 1,
y_start = 56.8e6)
annotation(
Placement(visible = true, transformation(origin = {80, -36}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
Modelica.Blocks.Interfaces.RealOutput GeneratedPower
annotation(
Placement(visible = true, transformation(origin = {106, 16}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {106, 16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
ThermoPower.Electrical.NetworkGrid_Pmax networkGrid_Pmax1(
J = 30000,
Pmax = 10e6,
deltaStart = 0.4,
initOpt = ThermoPower.Choices.Init.Options.steadyState)
annotation(
Placement(visible = true, transformation(origin = {106, -8}, extent = {{-8, -8}, {8, 8}}, rotation = 0)));
inner ThermoPower.System system annotation(
Placement(visible = true, transformation(origin = {-130, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(firstOrder2.y, GeneratedPower) annotation(
Line(points = {{86, -36}, {92, -36}, {92, 16}, {106, 16}, {106, 16}}, color = {0, 0, 127}));
connect(powerSensor1.power, firstOrder2.u) annotation(
Line(points = {{56, -14}, {56, -36}, {73, -36}}, color = {0, 0, 127}));
connect(powerSensor1.flange_b, generator1.shaft) annotation(
Line(points = {{66, -8}, {72, -8}, {72, -8}, {72, -8}}));
connect(turbine1.shaft_b, powerSensor1.flange_a) annotation(
Line(points = {{46, -8}, {54, -8}, {54, -8}, {54, -8}, {54, -8}}));
connect(turbine1.outlet, sinkPressure1.flange) annotation(
Line(points = {{48, 0}, {48, 0}, {48, 20}, {60, 20}, {60, 20}}, color = {159, 159, 223}));
connect(sourcePressure1.flange, compressor1.inlet) annotation(
Line(points = {{-82, 0}, {-48, 0}, {-48, 0}, {-48, 0}}, color = {159, 159, 223}));
connect(firstOrder1.y, sourceMassFlow1.in_w0) annotation(
Line(points = {{-80, 52}, {-48, 52}, {-48, 44}, {-48, 44}, {-48, 44}}, color = {0, 0, 127}));
connect(sourceMassFlow1.flange, combustionChamber1.inf) annotation(
Line(points = {{-38, 40}, {0, 40}, {0, 40}, {0, 40}}, color = {159, 159, 223}));
connect(FuelFlowRate, firstOrder1.u) annotation(
Line(points = {{-142, 18}, {-100, 18}, {-100, 51}, {-91, 51}}, color = {0, 0, 127}));
connect(pressDrop2.outlet, turbine1.inlet) annotation(
Line(points = {{32, 8}, {32, 8}, {32, 0}, {32, 0}}, color = {159, 159, 223}));
connect(pressDrop1.outlet, compressor1.outlet) annotation(
Line(points = {{-32, 8}, {-32, 8}, {-32, 0}, {-32, 0}}, color = {159, 159, 223}));
connect(stateReader_gas2.outlet, pressDrop2.inlet) annotation(
Line(points = {{26, 30}, {32, 30}, {32, 20}, {32, 20}}, color = {159, 159, 223}));
connect(combustionChamber1.out, stateReader_gas2.inlet) annotation(
Line(points = {{10, 30}, {18, 30}, {18, 30}, {18, 30}}, color = {159, 159, 223}));
connect(stateReader_gas1.outlet, combustionChamber1.ina) annotation(
Line(points = {{-18, 30}, {-10, 30}, {-10, 30}, {-10, 30}}, color = {159, 159, 223}));
connect(pressDrop1.inlet, stateReader_gas1.inlet) annotation(
Line(points = {{-32, 20}, {-32, 20}, {-32, 30}, {-26, 30}, {-26, 30}}, color = {159, 159, 223}));
connect(compressor1.shaft_b, turbine1.shaft_a) annotation(
Line(points = {{-34, -8}, {34, -8}}));
annotation(
uses(ThermoPower(version = "3.1"), Modelica(version = "3.2.2")));
end BraytonCycleLibraryReplica;

Open MOdelica Pumping Fluid through Swept volume

I have the following code, it is throwing errors related to Translation warning. I am using a swept volume to pump fluid from a tank to pipe and to the sink. ANy help would be appreciated.
model Trial2 "Model of a pumping system"
import Modelica.Fluid;
inner Modelica.Fluid.System system annotation(
Placement(visible = true, transformation(origin = {30, -42}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Pipes.StaticPipe pipe(redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, allowFlowReversal = true, diameter = 0.3, height_ab = 100, length = 100) annotation(
Placement(visible = true, transformation(origin = {46, -6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Sensors.Pressure pressuretranducer annotation(
Placement(visible = true, transformation(origin = {37, 29}, extent = {{-11, -11}, {11, 11}}, rotation = 0)));
Modelica.Fluid.Sources.FixedBoundary sink(redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, nPorts = 1, p = 0, use_p = true) annotation(
Placement(visible = true, transformation(origin = {48, 66}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
Modelica.Fluid.Machines.SweptVolume sweptVolume1(redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, T_start = system.T_start, clearance = 5, nPorts = 2, pistonCrossArea = 50, portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.3), Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.3)}, use_HeatTransfer = false, use_T_start = true, use_portsData = true) annotation(
Placement(visible = true, transformation(origin = {6, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Sine sine1(amplitude = 50, freqHz = 5) annotation(
Placement(visible = true, transformation(origin = {-62, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Mechanics.Translational.Sources.Force force1(useSupport = false) annotation(
Placement(visible = true, transformation(origin = {-18, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Fluid.Vessels.OpenTank tank(redeclare package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater, crossArea = 50, height = 60, level(start = 50), level_start = 50, nPorts = 1, portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.3)}, use_HeatTransfer = false, use_T_start = true, use_portsData = true) annotation(
Placement(visible = true, transformation(origin = {-37, 23}, extent = {{-9, -9}, {9, 9}}, rotation = 0)));
equation
connect(tank.ports[1], sweptVolume1.ports[1]) annotation(
Line(points = {{-37, 14}, {4, 14}, {4, 20}, {6, 20}}, color = {0, 127, 255}, thickness = 0.5));
connect(pressuretranducer.port, pipe.port_a) annotation(
Line(points = {{37, 18}, {16, 18}, {16, -6}, {36, -6}}, color = {0, 127, 255}));
connect(force1.flange, sweptVolume1.flange) annotation(
Line(points = {{-8, 62}, {6, 62}, {6, 40}, {6, 40}}, color = {0, 127, 0}));
connect(sine1.y, force1.f) annotation(
Line(points = {{-50, 62}, {-30, 62}, {-30, 62}, {-30, 62}}, color = {0, 0, 127}));
connect(pipe.port_b, sink.ports[1]) annotation(
Line(points = {{56, -6}, {73, -6}, {73, 66}, {38, 66}}, color = {0, 127, 255}));
connect(sweptVolume1.ports[2], pipe.port_a) annotation(
Line(points = {{6, 20}, {9, 20}, {9, -6}, {36, -6}}, color = {0, 127, 255}, thickness = 0.5));
annotation(
uses(Modelica(version = "3.2.2")));
end Trial2;
You have forgotten to set the medium to water in the pressureTransducer (similarly as in all the other components).
I haven't checked with OpenModelica - but at least with Dymola that suffices to make it simulate.