{"id":9146,"date":"2019-12-16T05:43:06","date_gmt":"2019-12-16T10:43:06","guid":{"rendered":"https:\/\/blogs.sw.siemens.com\/simcenter\/?p=9146"},"modified":"2025-12-17T13:02:43","modified_gmt":"2025-12-17T18:02:43","slug":"python-and-simcenter-flomaster-make-your-own-apps","status":"publish","type":"post","link":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/python-and-simcenter-flomaster-make-your-own-apps\/","title":{"rendered":"Python and Simcenter Flomaster &#8211; Make your own apps"},"content":{"rendered":"\n<p>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\u2019t 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.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"702\" height=\"187\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/Python.png\" alt=\"\" data-id=\"9178\" data-full-url=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/Python.png\" data-link=\"https:\/\/blogs.sw.siemens.com\/simcenter\/?attachment_id=9178\" class=\"wp-image-9178\" srcset=\"https:\/\/blogs.stage.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/Python.png 702w, https:\/\/blogs.stage.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/Python-600x160.png 600w\" sizes=\"auto, (max-width: 702px) 100vw, 702px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>Using a\nsimple Jupyter notebook we can create custom apps which run natively within a\nHTML environment or through a notebook. <\/p>\n\n\n\n<p>We take\na simple Simcenter Flomaster model looking at the surge in feed water line and\nmonitor the effect of upstream pressure and valve closure times on the\nresultant pressure surge. <\/p>\n\n\n\n<p>Python\nhas several libraries of widgets which can be used for creating these\ndashboards. These can be useful for data input into the Simcenter Flomaster\nmodelling environment. <\/p>\n\n\n\n<p>Radio\nbuttons can be used to select types of valves, slider bars for continuous data\ninputs and text fields for user defined values. <\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"71\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/User-form-1.jpg\" alt=\"\" data-id=\"9152\" data-full-url=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/User-form-1.jpg\" data-link=\"https:\/\/blogs.sw.siemens.com\/simcenter\/?attachment_id=9152\" class=\"wp-image-9152\" srcset=\"https:\/\/blogs.stage.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/User-form-1.jpg 620w, https:\/\/blogs.stage.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/User-form-1-600x69.jpg 600w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>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. <\/p>\n\n\n\n<figure class=\"wp-block-gallery columns-1 is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\"><ul class=\"blocks-gallery-grid\"><li class=\"blocks-gallery-item\"><figure><img loading=\"lazy\" decoding=\"async\" width=\"1022\" height=\"743\" src=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/pythonworkvisual.gif\" alt=\"\" data-id=\"9153\" data-full-url=\"https:\/\/blogs.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/pythonworkvisual.gif\" data-link=\"https:\/\/blogs.sw.siemens.com\/simcenter\/?attachment_id=9153\" class=\"wp-image-9153\"\/><\/figure><\/li><\/ul><\/figure>\n\n\n\n<p>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!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Simulation software, has traditionally been the domain of the experts, however more recently simulation has been extended to the wider&#8230;<\/p>\n","protected":false},"author":69184,"featured_media":9178,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spanish_translation":"","french_translation":"","german_translation":"","italian_translation":"","polish_translation":"","japanese_translation":"","chinese_translation":"","footnotes":""},"categories":[123,182],"tags":[],"industry":[137,171],"product":[502],"coauthors":[6255],"class_list":["post-9146","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spotlight-on","category-tips-tricks","industry-consumer-products-retail","industry-software-development","product-simcenter-flomaster"],"featured_image_url":"https:\/\/blogs.stage.sw.siemens.com\/wp-content\/uploads\/sites\/6\/2019\/12\/Python.png","_links":{"self":[{"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/posts\/9146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/users\/69184"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/comments?post=9146"}],"version-history":[{"count":5,"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/posts\/9146\/revisions"}],"predecessor-version":[{"id":17518,"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/posts\/9146\/revisions\/17518"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/media\/9178"}],"wp:attachment":[{"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/media?parent=9146"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/categories?post=9146"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/tags?post=9146"},{"taxonomy":"industry","embeddable":true,"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/industry?post=9146"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/product?post=9146"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/blogs.stage.sw.siemens.com\/simcenter\/wp-json\/wp\/v2\/coauthors?post=9146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}