Opened 10 years ago

Last modified 10 years ago

#3307 new defect

translation fails because of (lack of) potential and flow variables where all signals are inputs or outputs

Reported by: Michael Wetter Owned by: somebody
Priority: high Milestone: Future
Component: Backend Version: trunk
Keywords: Cc:

Description

I want to export a fluid flow component (similar to Modelica.Fluid) as an FMU. The translation fails because the number of potential variables is not equal to the number of flow variables. The model has, however, only input or output signals, and no flow variable should be used in this case.

I created the following test case that reproduces the error. It does not use any Fluid or Media, but rather only has input or output signals. In my view, this model is well-posed:

package MIMO

    connector FluidProperties "Type definition for fluid properties"
      // No input or output is declared here, as the whole connector
      // can be all input or all output variables.
      Modelica.SIunits.SpecificEnthalpy h "Specific thermodynamic enthalpy";
      Real X_w "Water vapor mass fractions per kg total air";
    end FluidProperties;

    connector inlet
      input Modelica.SIunits.MassFlowRate m_flow;
      input Modelica.SIunits.AbsolutePressure p;
      input FluidProperties proFor;
      output FluidProperties proBac;
    end inlet;

    connector outlet
      output Modelica.SIunits.MassFlowRate m_flow;
      output Modelica.SIunits.AbsolutePressure p;
      input FluidProperties proBac;
      output FluidProperties proFor;
    end outlet;

block MIMO "Test model"

  inlet inlet1 annotation (Placement(transformation(extent={{-110,-10},{-90,10}}),
        iconTransformation(extent={{-110,-10},{-90,10}})));
  outlet outlet1 annotation (Placement(transformation(extent={{90,-10},{110,10}}),
        iconTransformation(extent={{90,-10},{110,10}})));
equation 

  connect(inlet1, outlet1)
    annotation (Line(points={{-100,0},{100,0},{100,0}}, color={0,0,0}));
  annotation (uses(Modelica(version="3.2.1")), Diagram(coordinateSystem(
          preserveAspectRatio=false, extent={{-100,-100},{100,100}})));
end MIMO;
  annotation (uses(Modelica(version="3.2.1")));
end MIMO;

The detailed message is:

[1] 14:50:53 Translation Warning
[MIMO: 12:5-17:14]: Connector .MIMO.inlet is not balanced: The number of potential variables (4) is not equal to the number of flow variables (0).

[2] 14:50:53 Translation Warning
[MIMO: 4:5-10:24]: Connector .MIMO.FluidProperties is not balanced: The number of potential variables (2) is not equal to the number of flow variables (0).

[3] 14:50:53 Translation Warning
[MIMO: 19:5-24:15]: Connector .MIMO.outlet is not balanced: The number of potential variables (4) is not equal to the number of flow variables (0).

[4] 14:50:53 Symbolic Error
[: 0:0-0:0]: Too few equations, under-determined system. The model has 6 equation(s) and 10 variable(s).

[5] 14:50:53 Translation Error
[: 0:0-0:0]: Internal error pre-optimization module clockPartitioning failed.

A slightly more complex model is Buildings/Fluid/FMI/Examples/FMUs/TwoPortPassThrough from

git clone git@github.com:lbl-srg/modelica-buildings.git
cd modelica-buildings
git checkout issue313_fmi

Attachments (1)

MIMO.mo (1.4 KB ) - added by Michael Wetter 10 years ago.
test model to reproduce the error

Download all attachments as: .zip

Change History (2)

by Michael Wetter, 10 years ago

Attachment: MIMO.mo added

test model to reproduce the error

comment:1 by Per Östlund, 10 years ago

Component: UnknownBackend

I improved the connector balance check to handle this better in 8806a1661d, but it doesn't really affect anything since those messages were only warnings. The real issue is the equation counting in the back end.

Note: See TracTickets for help on using tickets.