packageExternalPropertyPackages
Information
MultiPhaseMixture has an interface to the C-interface ExternalMultiPhaseMixture which makes it possible to use fluids from an external property package. The overall structure of the framework can be seen below.

Using a external fluid in Modelica
To use a fluid from an external property package:
- Create a new fluid in Modelica be extending the Modelica package MultiPhaseMixture.Templates.ExternalTwoPhaseMixture and specify required settings (different fluid property packages as e.g. RefProp, FluidProp and Cape-Open may require different settings. A recommended way is to duplicate a predefined media and modify it.
Challenges with external property code
Most of the available external property packages have not been designed to be used for dynamic simulations. General problems are:
- Error handling when calling properties outside their validity region.
- Limited support for partial derivatives.
- Lack of support to speed up iterative calculation by providing good start values.
- No access to the used tolerances, which may cause numerical problems when creating numerical derivatives.
- Non converging regions.
We have seen in this project that without any additional handling of the validity region issue, simulation will often crash during initialization or simulation. An explanation is that even if a simulation model is set-up to operate within the validity region, the solver might call property routines with invalid inputs when it tries to find a solution for a system of non-linear equations or when it test a large step-size.
In the external interface we decided that it should be the property calculator responsibility to handle this as different property types such as e.g. transport and equation of state based properties may have different validity regions and might be a function of composition.
Contents
| Name | Description |
|---|---|
| RefProp | |
| CapeOpen | |
| Derivatives | |
| Debugging |