Opened 12 years ago

Closed 7 years ago

Last modified 6 years ago

#2059 closed defect (fixed)

Strange look-up errors when dealing with replaceable functions

Reported by: Francesco Casella Owned by: Per Östlund
Priority: blocker Milestone: 2.0.0
Component: New Instantiation Version: trunk
Keywords: Cc:

Description

Please load the attached version of the ThermoPower library, which uses MSL 3.2.1.

Running checkModel(ThermoPower.Examples.RankineCycle.PrescribedSpeedPump) returns the following errors:

[ThermoPower/Examples.mo:2455:68-2455:79:writable] Error: Variable
q_nom not found in scope ThermoPower.Examples.RankineCycle.PrescribedSpeedPump

[ThermoPower/Water.mo:6461:7-6465:36:writable] Error: Class 
flowCharacteristic not found in scope ThermoPower.Water.Pump 
(looking for a function or record).

I cannot explain them: q_nom is declared in PrescribedSpeedPump a few lines above, and it is also the name of one of the inputs of ThermoPower.Functions.PumpCharacteristics.quadraticFlow, while the function flowCharacteristic is defined in the base class of ThermoPower.Water.Pump named ThermoPower.Water.BaseClasses.PumpBase.

What's wrong here?

Attachments (1)

ThermoPower.zip (290.1 KB ) - added by Francesco Casella 12 years ago.
ThermoPower library, development version

Download all attachments as: .zip

Change History (13)

by Francesco Casella, 12 years ago

Attachment: ThermoPower.zip added

ThermoPower library, development version

comment:1 by Martin Sjölund, 11 years ago

Milestone: 1.9.01.9.1

Postponed until 1.9.1

comment:2 by Martin Sjölund, 10 years ago

Milestone: 1.9.11.9.2

This ticket was not closed for 1.9.1, which has now been released. It was batch modified for milestone 1.9.2 (but maybe an empty milestone was more appropriate; feel free to change it).

comment:3 by Martin Sjölund, 10 years ago

Milestone: 1.9.21.9.3

Milestone changed to 1.9.3 since 1.9.2 was released.

comment:4 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:5 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:6 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:7 by Francesco Casella, 8 years ago

Milestone: 1.10.02.0.0
Priority: highblocker

comment:8 by Francesco Casella, 7 years ago

Component: FrontendNew Instantiation
Owner: changed from Adrian Pop to Per Östlund
Status: newassigned

comment:9 by Francesco Casella, 7 years ago

Resolution: fixed
Status: assignedclosed

As of v1.13.0-dev-676-gd9899db2c, checking this model with the NF is successful.

comment:10 by KieranF <kieran.fung@…>, 6 years ago

Was this ever figured out? I understand this was posted quite some time ago. However, whenever using pump components from ThermoPower Library, there is always issues like the one mentioned above.

Thanks for your time! Let me know when you get the chance.

comment:11 by Francesco Casella, 6 years ago

Replying to KieranF <kieran.fung@…>:

Was this ever figured out?

It was, the model has been working with the new frontend for 10 months now.

To summarize, we are currently in the process of replacing the old frontend of the OpenModelica Compiler with a new one, see #4138. The frontend takes the Modelica code and flattens it out to a bunch of variable declarations, function declarations, parameters, variables, and equations.

The new front-end can currently be activated optionally with the compilation flag -d=newInst. We expect that when we release 1.14.0 it will be better than the current one for most libraries, and it will become the default one in 2.0.0, see the roadmap.

The current development policy is that we try to fix this kind of issues in the new frontend only. Those who get fixed, are marked as fixed for 2.0.0 (when the NF will be the default), though you can get them running today with a nightly build, as long as you turn on -d=newInst.

The new frontend still has some issues with ThermoPower, compare the coverage with the old frontend to the coverage with the new frontend. However, most pending issues have been identified already, and I expect the new frontend to take over the old one in a matter of weeks, and to get 100% coverage in a few months at most.

BTW, there are some broken models in ThermoPower, because we updated some basic models several years ago, and made the old ones obsolete, but I haven't had the time to update all the examples yet. This is particularly true for the PowerPlants package. I'm trying to fix that as well, but I can't give you any dates for this process.

comment:12 by Francesco Casella, 6 years ago

@KieranF, I have completely overhauled the ThermoPower.Electric package, and I have applied several fixes to the Examples package. Everything is now pushed to master.

I still need to overhaul the PowerPlants package, that will require some more time.

Note: See TracTickets for help on using tickets.