Modify

Opened 4 years ago

Closed 2 years ago

Last modified 19 months ago

#4235 closed defect (fixed)

assigning Medium package in replaceable class fails

Reported by: mwetter Owned by: perost
Priority: blocker Milestone: 2.0.0
Component: New Instantiation Version: v1.12.0
Keywords: Cc:

Description (last modified by mwetter)

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

Attachments (0)

Change History (8)

comment:1 Changed 4 years ago by mwetter

  • Description modified (diff)

comment:2 Changed 3 years ago by anonymous

i have the same issue too

comment:3 Changed 3 years ago by casella

  • Component changed from Frontend to New Instantiation
  • Milestone changed from Future to 2.0.0
  • Owner changed from somebody to perost
  • Priority changed from high to blocker

comment:4 Changed 2 years ago by casella

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 Changed 2 years ago by casella

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

comment:6 Changed 2 years ago by casella

  • Resolution set to fixed
  • Status changed from new to closed

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 follow-up: Changed 19 months ago by 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

comment:8 in reply to: ↑ 7 Changed 19 months ago by perost

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.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain perost.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.