openmodelica

OpenModelica internal time strictly seconds?


Trying to run a model with rates defined as "per day", while Modelica expects "per second". Changing the model rates is complex and potentially troublesome.

I wonder if Modelica can be set to a different time unit for simulation.

Probably using the wrong vocabulary to search as I can't find much helpful information on this. It seems that the time unit of seconds is or at least was built in to Modelica.

Did try to convert model to rates "per second". It kind of works, but than flow rates and controllers also need to be set to this time unit. This is totally impractical from an engineering point of view.

Would be easier to change internal time unit.

Can anyone confirm that seconds are compulsory for rates? Or even better: Can anyone point me to changing the defautl "internal" time unit?

Thank you!


Solution

  • I know this is old, but I'd like to comment in case it ever is useful for someone else:

    1. I haven't found a way to change the "internal" unit of time, but, that unit is a "dummy" unit. If everything else in your model is using (day)^(-1) for time, then your resolution in Openmodelica will be according to that unit of time. It is the plot that will show seconds in Openmodelica's window, but the numbers will be correct, so the tick for time = 10 sec for example, will correspond to the correct value for your simulation in time = 10 days. You can leave your model as it is, and only take in consideration that the time says "seconds" but it will actually be the time unit you are using. Just make sure that everything else is using day for time.
    2. The simulation time unit suggested in another answer only changes the unit used in the plot, so if the simulation was done "from t= 0 sec to t=60 sec", it will NOT change it to "t=0 min to t=60 min", but to "t=0 min to t=1 min" which will actually be wrong.
    3. As said, I have the same issue, hope someone can ever comment how to change it, or make an option in the Options menu of Openmodelica. Cheers.