动画 OpenModelica

问题描述 投票:0回答:1

我想为下面的示例创建一个动画:

model toto
  Modelica.Fluid.Vessels.ClosedVolume volume(redeclare package Medium = Modelica.Media.Examples.TwoPhaseWater, V = 1e-3, nPorts = 1, p_start = 400e5, use_HeatTransfer = true, use_T_start = true, use_portsData = false) annotation(
    Placement(visible = true, transformation(origin = {-80, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
  Modelica.Fluid.Pipes.StaticPipe pipe1( redeclare package Medium = Modelica.Media.Examples.TwoPhaseWater,diameter = 6.2e-3, length = 127e-3, nParallel = 1) annotation(
    Placement(visible = true, transformation(origin = {-4, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  inner Modelica.Fluid.System system(T_start(displayUnit = "K") = 300, p_start(displayUnit = "Pa") = 100000) annotation(
    Placement(visible = true, transformation(origin = {-86, 84}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.StaticPipe pipe(redeclare package Medium = Modelica.Media.Examples.TwoPhaseWater, diameter = 6.2e-3, length = 484e-3, nParallel = 1) annotation(
    Placement(visible = true, transformation(origin = {-54, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  CurvedBendModel curvedBendModel(redeclare package Medium = Modelica.Media.Examples.TwoPhaseWater, geometry = Geometry(d_hyd = 6.2e-3, R_0 = 20.37e-3, delta = 90)) annotation(
    Placement(visible = true, transformation(origin = {-30, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Mechanics.Translational.Components.MassWithStopAndFriction NoirStop(F_Coulomb = 0, F_Stribeck = 0, F_prop = 0, m = 1, s(fixed = true, start = 0), smax = 0.2, smin = 0) annotation(
    Placement(visible = true, transformation(origin = {54, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Machines.SweptVolume NoirCylinder(redeclare package Medium = Modelica.Media.Examples.TwoPhaseWater, clearance = 7982e-9, nPorts = 1, pistonCrossArea = 301e-6, use_T_start = true, use_portsData = false) annotation(
    Placement(visible = true, transformation(origin = {24, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
  Modelica.Mechanics.Translational.Components.Mass mass(m = 482, s(fixed = true, start = 0)) annotation(
    Placement(visible = true, transformation(origin = {84, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(volume.ports[1], pipe.port_a) annotation(
    Line(points = {{-70, 0}, {-64, 0}}, color = {0, 127, 255}));
  connect(curvedBendModel.port_b, pipe1.port_a) annotation(
    Line(points = {{-20, 0}, {-14, 0}}, color = {0, 127, 255}));
  connect(pipe.port_b, curvedBendModel.port_a) annotation(
    Line(points = {{-44, 0}, {-40, 0}}, color = {0, 127, 255}));
  connect(NoirCylinder.flange, NoirStop.flange_a) annotation(
    Line(points = {{34, 0}, {44, 0}}, color = {0, 127, 0}));
  connect(NoirStop.flange_b, mass.flange_a) annotation(
    Line(points = {{64, 0}, {74, 0}}, color = {0, 127, 0}));
  connect(pipe1.port_b, NoirCylinder.ports[1]) annotation(
    Line(points = {{6, 0}, {14, 0}}, color = {0, 127, 255}));
  annotation(
    uses(Modelica(version = "4.0.0")));
end toto;

能够执行与 OpenModelica 示例 Modelica.Mechanics.MultiBody.Examples.Elementary.DoublePendulum 相同的操作。 但是我不知道该怎么做,请问您有什么想法吗?

animation simulation modelica openmodelica
1个回答
0
投票

对于 3D 动画,您可以使用 Modelica.Mechanics.MultiBody.Visualizers 提供的可视化工具组件。

© www.soinside.com 2019 - 2024. All rights reserved.