thorade / HelmholtzMedia

Modelica library for the calculation of fluid properties from a Helmholtz energy equation of state (EoS).
BSD 3-Clause "New" or "Revised" License
35 stars 16 forks source link

OpenModelica compatibility #21

Closed thorade closed 4 years ago

thorade commented 10 years ago

Currently, trying to use HelmholtzMedia in OpenModelica results in errors similar to Variable fluidConstants[1].molarMass ... and Illegal subscript [1] for dimensions in component ...

thorade commented 10 years ago

Comment by @casella: If you check the Helium package in Dymola with Advanced.PedanticModelica=true, you get lots of errors regarding instatiation of stuff from partial packages. This means the code is actually not legal Modelica, though Dymola accepts it, hence it is unlikely to work in OpenModelica. Please make sure you are not instatiating anything from partial packages.

thorade commented 10 years ago

Starting with 10608aef5d84f1bfde108250075660b7f3ccbb36 the code seems to be legal Modelica, tested with Dymola 2015 in pedantic mode. One exception: Still using NumberOfIntervals in some places.

thorade commented 10 years ago

OpenModelica Developer Documentation: https://openmodelica.org/developersresources/devdocumentation Writing OpenModelica Compliant Libraries https://trac.openmodelica.org/OpenModelica/wiki/WritingCompliantLibraries

OpenModelica Coverage: https://trac.openmodelica.org/OpenModelica/wiki/CoverageIssues#HelmholtzMedia https://libraries.openmodelica.org/branches/master/HelmholtzMedia/HelmholtzMedia.html

thorade commented 10 years ago

Created a new topic in the OpenModelica forum: https://www.openmodelica.org/forum/default-topic/1382-helmholtzmedia-library

casella commented 10 years ago

Hi Matthis,

lookup problems have plagued omc for years. Adrian Pop (who replied to your post) and Per Ostlund have worked hard on a new module for instatiating models, which is now 99.9% complete - Adrian is fighting hard to get rid of the last few bugs. I hope that would solve all (or most) of those problems at once.

In the meantime, thanks for the clean-up. We'll follow the progress closely, and we can definitely help you getting the library going with OMC, as this is among our primary interests. Please let me know if I can help in any way.

            Francesco

Il 24/09/2014 13:13, Matthis Thorade ha scritto:

Created a new topic in the OpenModelica forum: https://www.openmodelica.org/forum/default-topic/1382-helmholtzmedia-library

— Reply to this email directly or view it on GitHub https://github.com/thorade/HelmholtzMedia/issues/21#issuecomment-56655403.

Francesco Casella - Ph.D. Dipartimento di Elettronica, Informazione e Bioingegneria Politecnico di Milano Via Ponzio 34/5 I-20133 MILANO - ITALY

Tel: +39-02-2399-3465 (Leonardo) +39-02-2399-7749 (Polo di Cremona) Fax: +39-02-2399-3412 e-mail: francesco.casella@polimi.it web: http://home.dei.polimi.it/casella Skype: callto://francesco.casella

thorade commented 6 years ago

Two constructs seem to cause most of the trouble:

thorade commented 6 years ago

Nice progress with OpenModelica new frontend: https://libraries.openmodelica.org/branches/newInst/HelmholtzMedia/HelmholtzMedia.html https://libraries.openmodelica.org/branches/history/newInst/00_history.html https://libraries.openmodelica.org/branches/history/newInst/HelmholtzMedia.svg https://libraries.openmodelica.org/branches/history/newInst/HelmholtzMedia-recent.svg Looks like it will work some time soon!

casella commented 6 years ago

@perost is working on improving function partial application and record constructor handling, which are key constructs for all Media library. I expect major improvements anytime soon

perost commented 6 years ago

@perost is working on improving function partial application and record constructor handling, which are key constructs for all Media library. I expect major improvements anytime soon

I can't see any HelmholtzMedia models that fail because of those issues. Many of them fail because the backend uses an absurd amount of memory and is killed by Hudson, while others cause the Hudson job script to fail and not return any results at all (they seem to get stuck in a loop somewhere in the backend based on my testing).

From my quick testing it seems like all the models we test from HelmholtzMedia actually passes the new frontend. The few that also pass the backend seem to have some issues with package constants, an issue that also affects other libraries and will be fixed in due time. Otherwise it mostly looks like backend issues, at least superficially.

casella commented 6 years ago

@perost you are right. In the case of MSL there are many cases of back-end failure due to the fact that the new front end produces a different output than the old one, which is possibly correct but that the back-end cannot handle. In these cases, at least as an interim measure, we try to obtain the same output, even in those cases where this could be sub-optimal.

In this case, unfortunately, the old front-end could basically not handle these models (see report), so we cannot try to restore the old front-end output, because there was none.

So, I agree with @perost that we should have to work a bit on the back-end.

@thorade, I currently see three failure modes in the library, I'll open tickets on them and put you in cc:.

thorade commented 4 years ago

Closing this, tracking the last few issues in #34 instead

casella commented 4 years ago

Looking at how long it took us to get through this I am a bit embarrassed, but it seems we are finally getting there 😃

thorade commented 4 years ago

https://en.wikipedia.org/wiki/Pareto_principle https://en.wikipedia.org/wiki/Pareto_principle#In_computing