No, I am not referring to the invasive species of snake that is currently wreaking havoc in the Everglades of southern Florida. Rather, the focus of this post is the popular scripting language known as Python.
As CFD consultants who perform fluid and thermal simulations on a daily basis, we are often faced with processing large amounts of results data or performing redundant tasks that consume a lot of time. In these situations, we find it valuable to invest some time upfront to develop Python scripts to automate these tasks.
For example, consider the files which are output by Autodesk CFD when running a Motion simulation. These .csv files (comma-delimited) can be readily imported into Excel to create graphs. However, when processing a large number of these files, this can become very tedious. With just a few lines of Python code, the same plots can be created with just one click.
Figure 1: This concise Python script makes quick working of plotting multiple .csv files.
Many simulation packages, including Autodesk CFD, contain API (Application Programming Interface) modules based on Python. The API can be used to develop macros to automate functions normally performed manually in the software interface (e.g., adding cut planes and extracting bulk values from them).
Of course, Python has many uses outside of simulation and can help automate a wide variety of engineering tasks. Perhaps the best aspect of Python is that it is freeware!
To see Python in action, consider downloading this free Volumetric Flow Calculator. This handy utility calculate flow rate parameters while allowing the user to mix units.
Figure 2: This free flow utility was developed using Python.
Not comfortable with coding software programs? No problem. We can evaluate your needs and propose a solution that will provide a return on your investment by saving you time.