Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)

Forgot password? | Forgot username? | Register

OM ver 1.14 and use of redeclare etc

OM ver 1.14 and use of redeclare etc

I try to use OpenModelica 1.14 nightly build 2019-03-18.
It works directly for the most basic models I have.

For more recent models where I use “redeclare” etc like in the enclosed example  I get all the translation error message like

“Translation error:
Cannot instantiate DEMO_v10 due to class specialisation PACKAGE”

If I check the code for the system Test that I want to run and that combine the different components then I get the error:

“Translation error:
Class Medium.Concentration not found in scope DEMO_v10.Equipment.LiquidCon

In one way I can understand the comment but in another not.
The “LiquidCon” is used as a kind formal parameter for the package and is defined outside the package when Equipment3 is made from Equipment using redeclare and giving Medium the “value” Medium3”.

I think this is the technique to make packages parametrizesed and easy to adapt to various application codes. So what is wrong here?

The code works both in OpenModelica 1.13 as well as in JModelica.

Thanks for your help!

Jan Peter

Edited by: janpeter - Mar-22-19 13:12:32
There are 0 guests and 0 other users also viewing this topic
You are here: