Search code examples
modelicaopenmodelica

Do replaceable classes work in the OpenModelica Compiler?


I understand that replaceable classes currently do not work in OMEdit, as captured in issue #2079 on their trac.
What I don't understand and can't seem to find an answer for is, does this issue lie with OMEdit, or the underlying OM Compiler?
I have tried to run the sample model Modelica.Fluid.Examples.PumpingSystem from command line. I received the following error:
messages = "Failed to build model: PumpingSystem"

Code used to run in command line:
myscript.mos:

loadModel(Modelica);
loadFile("PumpingSystem.mo");
simulate(PumpingSystem);

command line:

%OPENMODELICAHOME%\bin\omc myscript.mos

As a secondary, are there any open source modelica compilers that support replaceable classes, or do I need to use Dymola?


Solution

  • Replaceable classes should work fine (in most cases) in OpenModelica. Support for replaceable/redeclare classes in OMEdit (select the redeclare class and change its parameters) is in the testing phase now and should be available soon.

    Unfortunately if you don't provide your model is quite hard to tell what the problem is. If the model is not public you can sent it to [email protected] and we will use it to debug your problem and then delete it. If your models is public, then just open a ticket about it here: http://trac.openmodelica.org/OpenModelica/ and attach the model to it.

    Ok, I had another look. It seems that particular model has some issues in the back-end but most of the other Fluid examples work fine. You can see which models work from the MSL 3.2.2 here: https://libraries.openmodelica.org/branches/master/Modelica_3.2.2/Modelica_3.2.2.html