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

Compiler error when simulating a pipe network

Compiler error when simulating a pipe network

Hi,

I'm simulating pipe networks in OpenModelica 1.18, and I'm getting a CompilerError. I boiled it down to this MWE. Two tanks, connected by two valves, from the Modelica.Fluid library.

Code:


model tanktest
  import Modelica.Media.IdealGases.SingleGases.H2;
  import Modelica.Fluid.Valves.ValveCompressible;
  import Modelica.Fluid.Vessels.ClosedVolume;
  import Modelica.Fluid.System;
 
  inner System system;

  ClosedVolume buffer( redeclare package Medium = H2, T_start = 300,V = 3,nPorts = 1, p_start = 3e5, use_portsData = false);
  ValveCompressible v1( redeclare package Medium = H2, opening = 1, Av = 1e-3, CvData = Modelica.Fluid.Types.CvTypes.Av, m_flow_nominal=1, dp_nominal = 1e5);
  ValveCompressible v2(redeclare package Medium = H2,Av = 1e-4, opening = 1, CvData = Modelica.Fluid.Types.CvTypes.Av, m_flow_nominal=1, dp_nominal = 1e5);
  ClosedVolume tank( redeclare package Medium = H2,T_start = 300, V = 1,nPorts = 1, p_start = 1e5, use_portsData = false);
 
equation
 
  connect(buffer.ports[1], v1.port_a);
  connect(v1.port_b, v2.port_a);
  connect(v2.port_b, tank.ports[1]);
 
  annotation(
    uses(Modelica(version = "3.2.3")));
end tanktest;

I get this error during compilation:

Code:


tanktest_12jac.c:31:259: error: use of undeclared identifier '_omcQ_24cse2'

The model works when I connect the two Volumes by just one Valve. Is this a modelling error, or a bug? Is there a restriction in Modelica.Fluid that wouldn't allow me to chain two valves together?

Any help is appreciated. Thanks!

Re: Compiler error when simulating a pipe network

Have you looked for the string "_omcQ_24cse2" in the instance code?

Re: Compiler error when simulating a pipe network

_omcQ_24cse2 would be a variable called $cse2 (which is introduced by OpenModelica). So most likely a tool bug: https://github.com/OpenModelica/OpenModelica/issues

Re: Compiler error when simulating a pipe network

There are 0 guests and 0 other users also viewing this topic
You are here: