动态管道系统

Dynamic piping system

我尝试使用 Modelica 在 Twinbuilder 中为液压系统建模。但是我总是遇到我认为与收敛问题有关的错误。为了解问题所在,我将我的系统简化为动态管道、固定边界和扫描体积,其运动将由正弦函数给出。但是在这个简化的案例中我仍然遇到错误。即使收到警告,我也能够编译模型。当我尝试解决模型时,。它没有解决。我想请问您是否可以就此问题给我建议?

这是模型的框图

我尝试求解模型时遇到的错误如下:

Error occured when entering initialization mode on Hochdruckreiniger3_1.

Error encountered in the Initialize function of user model.

Error encountered while initializing the simulators

Residual function evaluation failed at initial point for "1" From Hochdruckreiniger3_1: Jacobian evaluation failed at initial point for "1" From Hochdruckreiniger3_1: Failed to find a consistent solution in event iteration in "1", 0 at 0.0000000000000000E+000 From Hochdruckreiniger3_1: Residual function evaluation failed at initial point for "3" "#r171#" From Hochdruckreiniger3_1: Initialization failed.

代码如下:

model Hochdruckreiniger3
    //Declaration(s)
    Real V_max = 0.000003;
    Real V_tod = 0.000002;
    Real pi = 3.14;
    Real N = 2800;
    //Component(s)
    Modelica.Fluid.Machines.SweptVolume Swept1 (
        pistonCrossArea = 0.0001131,
        clearance = 0.00000250621,
        redeclare package Medium = Modelica.Media.Water.StandardWater,
        nPorts = 1,
        use_portsData = true,
        use_T_start = true,
        T_start = 293.15);
    inner Modelica.Fluid.System system;
    Modelica.Mechanics.Translational.Sources.Position Posit1 (exact = true, useSupport = false);
    Modelica.Blocks.Sources.Sine Sine1 (
        amplitude = 0.005567,
        freqHz = 46.72,
        offset = 0.005567,
        phase = -pi/2);
    Modelica.Fluid.Sources.FixedBoundary boundary (p = 4e5, redeclare package Medium = Modelica.Media.Water.StandardWater, nPorts = 1);
    Modelica.Fluid.Pipes.DynamicPipe pipe1 (
        length = 0.5,
        diameter = 0.03,
        redeclare package Medium = Modelica.Media.Water.StandardWater,
        modelStructure = Modelica.Fluid.Types.ModelStructure.av_b);


equation

    //Connection(s)
    connect(Posit1.flange, Swept1.flange);
    connect(Sine1.y, Posit1.s_ref);
    connect(pipe1.port_b, Swept1.ports[1]);
    connect(boundary.ports[1], pipe1.port_a);
end  Hochdruckreiniger3;

Dymola 在您的模型中显示两个错误:

  1. pi 必须是 constantparameter 以符合 sine 块中参数 phase 的可变性。顺便说一下,参考Modelica.Constants.pi.
  2. 是个好习惯
  3. swept1 中您设置了 use_portsData = true 但没有提供任何端口数据。

解决这两个问题后,模型会模拟但会警告您未明确设置初始值。