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

Are there any restrictions for own libraries?

Are there any restrictions for own libraries?

Hy there,


since my last enquiry for the FLUID Library ( thanks for your interest) I tried to build a basic model of an heat exchanger HX, combined with the Modelica.Media Library.
I took out the basic classes from Modelica.Fluid (I work parallel with an Demo Version of Dymola) and combine them to a summary package and a single Model for defining simulation parameters (mass flow, start value for temperatures, etc.); All previous classes from Fluid, which were not important for the HX, I did not copy!
In Dymola the package + simulation model were checked successfully. Afterwards I have tried to import these 2 classes in OM. There were some error messages, e.g. signs, like " \\ \" could not get identified, therefore I isolated them. So there seem to be no formal mistakes more, but OM always crashes down, when I try to simulate. Furthermore, my two classes both contain about 2,600 equations together and I have read, OM is able to handle at least 10,000. It did not make any differences, when I had tried to split the summary packages up into single models and smaller packages, because I previously thought, OM can not load a model of about 3000 lines, but there were no success. I tried to study the OMDocumetation for finding an hint for modelling limits in OM, but found nothing.

So you see, I did not simply try to copy parts of FLUID Library hoping they are going to work somehow, but tried to addapt and simplify all classes, I need. 

May anybody can explain me, what important limits one have to consider concerning my problem?
If somebody like, I will paste here my Modelica Code of course! If there any further questions, please ask me.


Have a nice weekend!
Georg

Edited by: Georg2011 - Nov-05-11 21:29:18

Re: Are there any restrictions for own libraries?

Hi,

Is not a problem of lines of code or even number of equations in your model.

Most of the issues in OpenModelica come from complicated lookup in the presence of redeclares.
Modelica.Media and Modelica.Fluid use a lot of redeclares in a lot of different ways (redeclare as element,
redeclare model extends, redeclare in components, extends clause and short class definitions) and
several depths in the model hierarchy. Lookup in OpenModelica will sometime go into an infinite loop
and crash the compiler and that is mostly the only reason why you get crashes.

If you want strict limits, then they are easy: don't use really complicated replaceable classes
and redeclares and your model will most likely work (i know this is not reasonable).

We do handle Modelica.Media now (simulation of some examples is still an issue due to more functionality
we need in the back-end)  and some parts of Modelica.Fluid and the goal is of course to get these to work.
But it will take some time to get there. As far as we known Dymola is the only tool right now that can actually
handle Modelica.Fluid (I know that the guys at SimulationX are working on it, they might have fixed it by now,
but I don't know for sure).

If you want, you can add your code in our bug tracker as a bug or just send it to us by email at
OpenModelica@ida.liu.se and we can have a look at it and see if we can fix some of your issues.
Let us know if the code is public or not as if it is public we can add it in the bug tracker.

If you want to know which models we support from Media and Fluid just search for Modelica.Media and Modelica.Fluid in the trace of our testsuite:
http://build.openmodelica.org/omc/build … -trace.txt
Note that by support I mean that the compiler can flatten the model hierarchy (without crashing) and generate flat Modelica code.

Cheers,
Adrian Pop/

Re: Are there any restrictions for own libraries?

Hy Adrian Pop,


thank you very much for your detailed answer. Please find my explanations and the code in my mail I send to the mentioned address.


Greetings
Georg


P.S. If I accomplish a workable code in near futue, I can publicise it here, if somebody wants to see it.

There are 0 guests and 0 other users also viewing this topic
You are here: