Opened 8 years ago

Closed 7 years ago

Last modified 6 years ago

#4235 closed defect (fixed)

assigning Medium package in replaceable class fails

Reported by: Michael Wetter Owned by: Per Östlund
Priority: blocker Milestone: 2.0.0
Component: New Instantiation Version: v1.12.0
Keywords: Cc:

Description (last modified by Michael Wetter)

Translating various models fail with the message

Buildings.Fluid.Boilers.Examples.BoilerPolynomial: 28:3-39:70]: component boi1 contains the definition of a partial class Medium.
Please redeclare it to any package compatible with Modelica.Media.Interfaces.PartialMedium.

or similarly

[5] 21:45:22 Translation Error
[Buildings.Examples.Tutorial.Boiler.System3: 153:3-160:72]: component boi contains the definition of a partial class Medium.
Please redeclare it to any package compatible with Modelica.Media.Interfaces.PartialMedium.

The problematic code seems to be in Buildings.Fluid.Interfaces.TwoPortHeatMassExchanger:

 replaceable Buildings.Fluid.MixingVolumes.MixingVolume vol
  constrainedby Buildings.Fluid.MixingVolumes.BaseClasses.PartialMixingVolume(
    redeclare final package Medium = Medium,
    ...

This is a blocker if users want to use OpenModelica during the tutorial at the MODPROD workshop.

The error from our other tutorial that we could use also seems related as we use a similar construct in the cooling coil:

[/var/lib/hudson/jobs/OpenModelica_TEST_ALL_LIBRARIES/workspace/OpenModelica/build/lib/omlibrary/Buildings latest/Fluid/Interfaces/PartialFourPort.mo:4:15-6:45:writable] Notification: From here:
[/var/lib/hudson/jobs/OpenModelica_TEST_ALL_LIBRARIES/workspace/OpenModelica/build/lib/omlibrary/Buildings latest/Examples/Tutorial/SpaceCooling/System2.mo:82:3-100:28:writable] Error: component cooCoi contains the definition of a partial class Medium1.
Please redeclare it to any package compatible with Modelica.Media.Interfaces.PartialMedium.
Error: Error occurred while flattening model Buildings.Examples.Tutorial.SpaceCooling.System2

Change History (8)

comment:1 by Michael Wetter, 8 years ago

Description: modified (diff)

comment:2 by anonymous, 7 years ago

i have the same issue too

comment:3 by Francesco Casella, 7 years ago

Component: FrontendNew Instantiation
Milestone: Future2.0.0
Owner: changed from somebody to Per Östlund
Priority: highblocker

comment:4 by Francesco Casella, 7 years ago

As of May 7 2018, the new FE reports this error message:

Notification: Performance of NFInst.instantiate(Buildings.Fluid.Boilers.Examples.BoilerPolynomial):
time 0.5755/0.5756, allocations: 121.1 MB / 0.6233 GB, free: 12.68 MB / 0.5105 GB
[/var/lib/hudson/slave/workspace/OpenModelica_TEST_LIBS/OpenModelica/OMCompiler/Compiler/NFFrontEnd/NFRecord.mo:183:9-183:99:writable]
Error: Internal error NFRecord.collectRecordParams got non-instantiated function

I'm not sure if the NF actually manages to get to the point reported in this ticket or if it breakes earlier.

comment:5 by Francesco Casella, 7 years ago

See also the discussion in ticket:4172#comment:3

comment:6 by Francesco Casella, 7 years ago

Resolution: fixed
Status: newclosed

The reported problem seems to be solved now. The model cited in this ticket still fails to simulate but due to other issues.

comment:7 by sullivbj, 6 years ago

Hello,
I am working through the Buildings library tutorials and it would appear that this problem is not fixed as the same error still appears. The library author, Michael Wetter, reports that the model works fine in Dymola and Jmodelica therefore the problem must be with OpenModelica. Any ideas?

Thanks,
Brendan

in reply to:  7 comment:8 by Per Östlund, 6 years ago

Replying to sullivbj:

Hello,
I am working through the Buildings library tutorials and it would appear that this problem is not fixed as the same error still appears. The library author, Michael Wetter, reports that the model works fine in Dymola and Jmodelica therefore the problem must be with OpenModelica. Any ideas?

Thanks,
Brendan

Are you using the new frontend? It's not enabled by default, you need to enable it by turning on the "Enable experimental new instantiation phase" in Tools->Options->Simulation in OMEdit. If you don't have this option you're using an old version of OM and should upgrade, preferably to the latest nightly build since the new frontend is work in progress.

According to our library coverage testing at least the mentioned BoilerPolynomial model simulates correctly using the new frontend, but there's still some work left before we have full coverage of the Buildings library.

Note: See TracTickets for help on using tickets.