With the model based interface it's possible to share MultiPhaseMixture.Interfaces between an external code based media and a native Modelica based media.

Advantages with a native Modelica media

An advantage of using native Modelica code over external code is that the Modelica compiler has access to structural information on the dependency between inputs and outputs. This makes it possible to automatically differentiate, create analytical Jacobians and explore sparsity patterns that will increase robustness and performance of a simulation.

Flash calculations

With the model based apporach it's possible to implement a medium using a declarative approach as demonstrated in (Olsson et al, 2005). It makes it possible to quickly create a medium with good performance. A difficulty with the equation based approach is the initialization part, where often start values close to the solution is required in order for the solver to find a solution. It would be interesting to see how property models can be formulated to better support initialization. For example by using the homotopy operator.  This could be an interesting research topic on how to best formulate these algorithms in a declarative way.

Example - DryAir mixture medium

See MultiPhaseMixture.PreDefined.Mixtures.NativeModelica.DryAir


  1. Hans Olsson, Hubertus Tummescheit and Hilding Elmqvist. Using Automatic Differentiation for Partial Derivatives of Functions in Modelica, Proceedings of the 4th International Modelica 2005 Conference, Hamburg, Germany, March 7-8 2005.


Generated at 2024-05-24T18:15:57Z by OpenModelicaOpenModelica 1.22.4 using GenerateDoc.mos