The ExternalMedia library provides a framework for interfacing external codes computing fluid properties to Modelica.Media-compatible component models.
The latest releases of the library can be downloaded here:
- The precompiled Modelica library can be found in the zip-file
- The manual can be downloaded as PDF
- The full source code is also available as compressed file
The ExternalMedia library provides a framework for interfacing external codes computing fluid properties to Modelica.Media-compatible component models. The latest 4.x.x releases are compatible with Modelica Standard Library (MSL) 4.0.0 and later, while 3.3.x versions are provided for legacy models that still use MSL 3.2.3.
The current version of the library supports pure and pseudo-pure fluids models, possibly two-phase, compliant with the Modelica.Media.Interfaces.PartialTwoPhaseMedium interface. Please have a look at the dedicated introduction section for an in-depth description of the architecture.
The latest releases of the library include built-in access to the open-source CoolProp software and a pre-compiled interface to the FluidProp commercial software. CoolProp medium models work out of the box without the need of any further installation. FluidProp medium models require to install the FluidProp software with proper licensing to access the media of your interest and to compute the property derivatives, which are required by ExternalMedia. The library works with FluidProp version 3.0 and later. It might work with previous versions of that software, but compatibility is no longer guaranteed. Please refer to the chapter on FluidProp and the dedicated chapter on CoolProp for further details.
The latest releases were tested with Dymola and OpenModelica on Windows and Linux. Support for more tools and operating systems might be added in the future, please let us know if you want to contribute.
You can modify the library to add an interface to your own solver. If your solver is open-source, please contact the developers, so we can add it to the official ExternalMedia library.
For OpenModelica, you can install and manage ExternalMedia using the
built-in Package Manager.
Please note that due to currently unresolved issues about the definition of backwards compatibility, if you have installed both
version 3.3.x and version 4.x.x, the class loader will always load version 4.x.x even in case of a uses annotation requiring version 3.3.2. In that case, please load ExternalMedia 3.3.2 manually when you start the OMEdit session, you can find it in your .openmodelica/libraries
directory.
For use with Dymola, you can download the zip file with the library and unzip it in your file system. The released library already contains all the pre-compiled binaries for all operating systems, so it should work out of the box.
Install the latest version 3.3.x of External Media if your models still uses Modelica Standard Library 3.2.3, otherwise install the latest version 4.x.x.
If you want to experiment with the code and recompile the libraries, check the compilation instructions.
The Modelica Language Specification mentions annotations for External Libraries and Include Files in section 12.9.4. Following the concepts put forward there, the ExternalMedia package provides several pre-compiled shared libraries supporting a selection of operating systems, C-compilers and Modelica tools.
Please open the package.mo
file inside the ExternalMedia
folder to
load the library. If your Modelica tool is able to find a matching precompiled
binary for your configuration, you should now be able to run the examples.
ExternalMedia extensively relies of external functions using code from pre-compiled dynamic libraries. The released versions include binaries for Windows and Linux, supporting CoolProp and FluidProp. If you want to experiment with other external codes or operating systems, you can build the ExternalMedia binary libraries yourself. All you need to compile ExternalMedia, besides your C/C++ compiler, is the CMake software by Kitware. If you would like to include the CoolProp library, you also need a working Python installation.
Please consult the compilation guide for further instructions and details on how to compile ExternalMedia for different Modelica tools and operating systems.
This Modelica package is free software and the use is completely at your own risk; it can be redistributed and/or modified under the terms of the BSD 3-clause license.
ExternalMedia has been around since 2006 and many different people have contributed to it. The history page provides a lot of useful insights and explains how the software became what it is today.
Current main developers:
- Francesco Casella started the development in 2006 and coordinates the current development effort.
- Jorrit Wronski and Ian Bell took care of the integration of CoolProp in the library and of CMake-based compilation.
- Federico Terraneo helped getting the library to work with different Modelica tools and operating systems.
Please report problems using the library GitHub issue tracker.