Python interface for MolFlow files

While MolFlow itself is written in C++, mainly to run very fast, Python is the most popular scripting language with plenty of examples and support.

MolFlow saves the geometry, the simulation settings and also the results in an XML file (or the default ZIP format containing this XML).

The new XML interface allows to...

  • Read a saved file (ZIP or XML)
    • Extract geometry data, like coordinates of a facet or its area
    • Get physical parameters (like sticking on a facet, or the gas mass)
    • Interpret results (get pressure on a facet, or the cell of a texture)
  • Modify the file and save the result
    • Change coordinates of a facet
    • Change physical parameters (on a facet or globally)

Combining this with the command line interface, one can run simulations with the geometry or parameters changing between runs. (See Python example at the end of the page)

More features will be added over time. Some functions (getting a facet's area, and physical quantities, such as the pressure) require files to be saved with MolFlow 2.9.25 or later.


Last update: October 10, 2024