Opened 9 years ago

Last modified 3 years ago

#3944 closed defect

Check of models with partial Medium packages fails — at Initial Version

Reported by: Francesco Casella Owned by: somebody
Priority: high Milestone: 1.19.0
Component: New Instantiation Version:
Keywords: Cc: buchner@…

Description

Consider this simple model:

model check
  inner Modelica.Fluid.System system;
  replaceable package gas = Modelica.Media.Interfaces.PartialMedium;
  Modelica.Fluid.Vessels.ClosedVolume free_volume(
    V = 0.01, use_portsData = false, 
    redeclare package Medium = gas);
end check;

The model is perfectly legitimate for a library. It cannot be simulated directly, because it lacks an actual medium implementation, but is othewise locally balanced and well defined.

Checking in OMC produces the following error:

[1] 10:08:59 Translation Warning
[Modelica.Media: 4475:17-4600:23]: Forcing full instantiation of partial class BaseProperties$free_volume$medium during checkModel.

[2] 10:08:59 Translation Error
Internal error - InstUtil.moveBindings: Mismatched number of equations and variables.

[3] 10:08:59 Translation Error
Error occurred while flattening model check

A better implementation should recognize that partial classes are involved and only perform local balancedness tests, possibly warning that Medium must be redeclared in order to actually use the model.

Change History (0)

Note: See TracTickets for help on using tickets.