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

Errors when adding pipe

Errors when adding pipe

Hi!

I’m trying to work with openModelica but I keep running in to bugs (or more likely user mistakes) like this. The model shown below works when the pipe is removed, but as soon as I add it I get errors. My biggest issue is not knowing where to start to debug this. Can one able to help?

Code:


model test
replaceable package Medium =
      Modelica.Media.Water.ConstantPropertyLiquidWater                           constrainedby
    Modelica.Media.Interfaces.PartialMedium "Medium in the component"
      annotation (choicesAllMatching = true);
     
  Modelica.Fluid.Vessels.OpenTank tank(redeclare package Medium = Medium, crossArea = 1, height = 4, level(start = 4 * 0.8), nPorts = 1, portsData = {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.3, height = 0)}, use_portsData = true)  annotation(
    Placement(visible = true, transformation(origin = {-42, 64}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = Medium, nPorts = 1, p = 200000) annotation(
    Placement(visible = true, transformation(origin = {44, 8}, extent = {{-10, -10}, {10, 10}}, rotation = 180)));
  inner Modelica.Fluid.System system annotation(
    Placement(visible = true, transformation(origin = {-78, 84}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Machines.PrescribedPump pump(
  redeclare function flowCharacteristic =
        Modelica.Fluid.Machines.BaseClasses.PumpCharacteristics.quadraticFlow (
          V_flow_nominal={0.1,0.25,0.46}, head_nominal={46,40,30}), redeclare package Medium = Medium,N_const = 300, N_nominal = 1200, T_start = system.T_start, V = 50, checkValve = true, energyDynamics = Modelica.Fluid.Types.Dynamics.FixedInitial, massDynamics = Modelica.Fluid.Types.Dynamics.FixedInitial, use_N_in = false
  )  annotation(
    Placement(visible = true, transformation(origin = {-40, 8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
  Modelica.Fluid.Pipes.StaticPipe pipe(redeclare package Medium = Medium, diameter = 0.3, length = 5)  annotation(
    Placement(visible = true, transformation(origin = {0, 8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
  connect(tank.ports[1], pump.port_a) annotation(
    Line(points = {{-42, 54}, {-50, 54}, {-50, 8}, {-50, 8}}, color = {0, 127, 255}));
  connect(pump.port_b, pipe.port_a) annotation(
    Line(points = {{-30, 8}, {-10, 8}, {-10, 8}, {-10, 8}}, color = {0, 127, 255}));
  connect(pipe.port_b, boundary.ports[1]) annotation(
    Line(points = {{10, 8}, {34, 8}, {34, 8}, {34, 8}}, color = {0, 127, 255}));

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

Errors:

Code:


[3] 08:22:04 Translation Error
Internal error IndexReduction.pantelidesIndexReduction failed! System is structurally singular and cannot be handled because the number of unassigned equations is larger than the number of states. Use -d=bltdump to get more information.

[4] 08:22:04 Translation Error
Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!

[5] 08:22:04 Translation Error
[C:/OM116/OM64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 4491:9-4491:59]: Internal error function createStateSetsSets failed.

[6] 08:22:04 Translation Error
[C:/OM116/OM64bit/OMCompiler/Compiler/SimCode/SimCodeUtil.mo: 746:5-746:146]: Internal error function createSimCode failed [Transformation from optimised DAE to simulation code structure failed]

Adding more complexity made it work again. So I think this must be a bug
Using OpenModelica v1.16.0-dev.beta1 (64-bit)

Edited by: victor - Oct-23-20 12:34:49
There are 0 guests and 0 other users also viewing this topic