How to generate FMU for Python Driven Co-simulation with Simcenter STAR-CCM+?

2024-12-05T16:52:19.000-0500

Summary

Python needs to be configured with PythonFMU package to build the fmu file from the user Python Script. FMI/FMU co-simulation with Python is enabled through the PythonFMU package. This article will help to configure the windows system to build the fmu file as well as guide you to generate the fmu file through virtual environment.


Details

Introduction:

  • In a co-simulation with Functional Mock-up Units (FMUs), Simcenter STAR-CCM+ communicates with partner software through an imported library that implements a physical model and exposes an interface based on the Functional Mock-up Interface (FMI) standard.
  • This library is created in the partner software and typically represents a time-dependent system, or a component of a time-dependent system, that is simulated by the partner solver. 
  • Simcenter STAR-CCM+:
    • Acts as an interface to the FMU, allowing you to modify parameters and variables that are exposed in the FMU
    • Exchanges data with the imported FMU for co-simulation with the partner software

System Requirements:

  • Python must be installed for all users.
  • In theory, an FMU can support multiple platforms, but not necessarily in practice. FMUs are platform-dependent; hence, a file compiled for Windows may not necessarily work on Linux.
  • FMI co-simulation with Python is enabled through the PythonFMU package.
  • PythonFMU does not bundle Python, which makes it a tool coupling solution. This means that you cannot expect the generated FMU to work on a different system (the system would need a compatible Python version and libraries).
  • The user is responsible for configuring Python. The toolbox PythonFMU contains instructions for installation and FMU library creation. 
  • Please note, PythonFMU does not package a full environment within the FMU. If your python code includes e.g. numpy, scipy etc (non-built-in libraries in Python) the target system also needs to have numpy, scipy installed.

Users need to configure the system or configure virtual environments before creating FMU libraries. Please see the attached PDF for details on the step-by-step instruction to create an FMU file for co-simulation with Simcenter STAR-CCM+.

KB Article ID# KB000155457_EN_US

Contents

SummaryDetails

Associated Components