Products

Python and Simcenter Flomaster – Make your own apps

Simulation software, has traditionally been the domain of the experts, however more recently simulation has been extended to the wider engineering communities in many different ways. This is done typically by creating a bespoke tool for a certain project or running the software in a well-recognized environment the engineer is most familiar with. This type of working doesn’t make the simulation expert obsolete, these power users are creating simulation models and then distributing these models for engineers to use on a day to day basis.

Within the Simcenter toolsets this can be done leveraging our API to create custom front ends using the COM or .Net interfaces or through platforms like the fantastic Simcenter Webapp Server which allows you upload and share models seamlessly around an organisation.

Using a simple Jupyter notebook we can create custom apps which run natively within a HTML environment or through a notebook.

We take a simple Simcenter Flomaster model looking at the surge in feed water line and monitor the effect of upstream pressure and valve closure times on the resultant pressure surge.

Python has several libraries of widgets which can be used for creating these dashboards. These can be useful for data input into the Simcenter Flomaster modelling environment.

Radio buttons can be used to select types of valves, slider bars for continuous data inputs and text fields for user defined values.

On a run simulation command the Simcenter Flomaster simulator is called and the input data set and then a simulation is initiated. Results are then pulled back into the workbook using Python for visualization.

This simple GUI can be extended to more complex networks and with lots of different ways of customizing and publishing, the possibilities are almost endless!

Richard Euerby
This article first appeared on the Siemens Digital Industries Software blog at https://blogs.stage.sw.siemens.com/simcenter/python-and-simcenter-flomaster-make-your-own-apps/