Never miss a story from Computational Fluid Dynamics. Subscribe for in-depth analysis and articles.
Welcome back to the third and final part of this blog series! So far, we have discussed why Python is the preferred language for computational fluid dynamics (CFD) workflows, how to run Python scripts on the Fidelity CFD platform, API descriptions, various available packages, and how to access entities in the geometry tree. Now we will explain how to create a project template and automate repetitive tasks in a CFD workflow or automate the entire workflow, with specific examples and the knowledge acquired in executing scripts from Part I and Part II of this blog series.
With the Fidelity CFD platform, you can create your templates or projects using scripts beforehand. You can customize or design your own templates to cater to your team's requirements and preferences. This includes adding new views, preferences, cell ranges, GUI styles, and more.
Switching to Family Tree
As a user, you can set default settings for each family of applications using the "Family tree" feature. While the Turbomachinery template already has this feature enabled, you can easily activate it for other templates in just a few minutes. Instead of manually switching between the views, you can use a script to define default generic settings for assemblies and sub-assemblies automatically. The figure below illustrates switching from a geometry view to a family view.
Scripting the pre-processing part of a CFD workflow can be useful for many tasks. A non-exhaustive list is jotted below:
Last year, TOYOTA Motor Europe hosted a webinar that showcased their use of the Fidelity AutoSeal and Hexpress in automating the pre-processing step of their CFD workflow. They can now automatically import and clean up geometries, create watertight surfaces, and generate a volume mesh.
Example 1: Script for automatic refinement area creation as primitives
The script below creates refinement volumes around the relevant locations of any vehicle (car, truck, etc.). These boxes around the car can be fine-tuned manually after their creation as they are primitives.
Example 2: Automatic definition of all proximity groups and refinements
This script scans the entire geometry and automatically defines proximity groups to make sure there will always be enough mesh refinements between geometry surfaces.
2. Preparing and checking data
This is a hook script that runs during each and every simulation. Its purpose is to verify the boundary conditions settings automatically. Usually, a text file and some images are generated to confirm the setup.
A mesh or simulation can be automatically post-processed to verify its state and results by creating different pictures, probes, animations, plots, or reports. The script below automates the post-processing producing volume streamlines to analyze the simulation results.
KJ66 Micro Turbo Jet Engine
Cadence CFD has automated the entire CFD workflow for the KJ66 Micro Turbo Jet Engine, with high-quality structured meshes for rotating parts and unstructured meshes for non-rotating and dirty geometry. As illustrated in the figure below, the entire simulation, including combustion modeling of the turbojet engine with one- or two-way coupling, is carried out in the Fidelity DBS platform.
If you are looking to automate repetitive tasks in your CFD workflow or the entire workflow, then Fidelity Python API is the right choice. By integrating it into your workflow, you can eliminate manual processes and take control of your tasks. We encourage you to try the Fidelity Python API today to experience its transformational impact on your CFD workflow productivity.
To learn more about Fidelity Python API, watch the CadenceTECHTALK on 'Boost Your CFD Simulation Productivity with Python'