Resources

Machine Learning on CFD Predictions: Use of Stochos on a Benchmark Application

Written by Ertan Taskin | Jan 8, 2025 10:17:06 PM

Harnessing the power of machine learning to revolutionize computational fluid dynamics predictions with Stochos.

Challenges

Computational Fluid Dynamics (CFD) is a complex field that requires extensive computational resources and time. Traditional CFD methods may often struggle with the high computational cost and time consumption, making it difficult to apply these techniques to large-scale problems or to run multiple simulations for optimization purposes.

Engineering Solution

To address these challenges, innovative engineering solutions are necessary. This involves leveraging advanced computational techniques and integrating them with modern technologies. The use of Machine Learning (ML) in CFD is one such solution that holds promise in overcoming the traditional limitations.

By incorporating ML algorithms, engineers can enhance the efficiency and accuracy of CFD simulations. These algorithms can learn from data, identify patterns, and make predictions, thereby reducing the computational load and speeding up the simulation process. This approach not only saves time but also opens up new possibilities for optimization and experimentation.

Stochos: A Game Changer in CFD Predictions

Stochos represents a significant advancement in the field of CFD predictions. It is an innovative tool that leverages the power of Machine Learning to enhance the accuracy and speed of CFD simulations. By using sophisticated ML algorithms, Stochos can learn from previous simulations and make more accurate predictions for new scenarios.

This capability makes Stochos a game changer, as it reduces the need for extensive computational resources and allows for more rapid prototyping and testing. Engineers can now run multiple simulations in a fraction of the time required by traditional methods, leading to faster development cycles and improved product designs.

Benchmark Application: 

A tube compressed from it's middle location with a valve is utilized as a benchmark application. Tube geometries with different levels of closings were saved from Ansys Mechanical. The geometries were post-processed to generate fluid domain in SpaceClaim, and further meshed. Ansys CFX was used to perform the CFD calculations (Figure 1). 

Figure 1. The CFD framework of the benchmark application

This benchmark study was thought for a medical device application. Therefore, blood properties were applied for fluid. The CFD model inputs were the closing of the tube (dictated with the geometry), and the flow rate. The model outputs were pressure drop (DP) and maximum hemolysis index (MaxHI). Hemolysis is the destruction of red blood cells resulting in release of hemoglobin. The details of the hemolysis prediction application were demonstrated before1

For the Stochos application, the above-mentioned inputs were used to determine the DOE (Design of Experiment) matrix. The range of the inputs was arbitrarily determined as [0.6, 2.75] for the closing (in mm), and [0.5, 4] for the flowrate (in L/min). The size of the matrix was selected as eight which means eight different CFD simulations need to be performed to generate data for ML application. Figure 2 shows the corresponding code. Note that, corresponding Stochos optimization libraries, and numpy (well-known Pyhton library) are needed to perform this task.   

The DOE matrix with the Stochos suggested inputs and the CFD predicted outputs are shown in Figure 3. The combined matrix of inputs and outputs will be utilized for the Stochos regression analysis to generate a Stochos model.  

 Figure 3. The DOE matrix, inputs and outputs 

The Stochos regression and sensitivity analyses begin with reading the data, performing the evaluation and developing the model (Figure 4). 

Figure 4. The code for regression, sensitivity analyses, and model generation

Considering the inputs and outputs, the best fitting model results was presented with the associated contours (Figure 5).

Figure 5. The Stochos model predictions for the entire design space using the eight data points (black dots). The DP on the left, and the MaxHI on the right.

As can be seen, the entire design space was predicted with the code. One can also notice that, the certain region on the MaxHI plot indicates negative values which is physically not possible. This indicates that, more CFD data is needed particularly at that region to enhance the Stochos model.

The sensitivity analyses demonstrated that, the system inputs are not significant over each other for the DP predictions. However, for the hemolysis closing has higher impact! (Figure 6).

Figure 6. The impact of the input parameters on the outputs: DP in the left, MaxHI on the right

In order to test the model, we used three test conditions. The corresponding conditions mapped on the design space, and ML model predictions were compared to the CFD ones (Figure 7).

Figure 7. Testing the ML model

As can be seen, the ML predictions are fairly close at test 1 and 2 data for DP. For MaxHI, the test 1 data ML prediction is very close to the CFD data. Test 3 data predictions are not as close which indicates there is a room to improve. 

In order to enhance the model, there is a Stochos function to suggest additional design points. The corresponding code for asking three new design suggestions is shown in Figure 8.

Figure 8. The code for new design suggestions

The suggested design points are shown in Figure 9 with the red dots. In order to make the hemolysis model better on the negative predicting region, another data point is added (green dot). The original designs are shown with the blue dots.

The Stochos model with these new data, enhanced the sensitivity response (Figure 10-left). The higher K-fold numbers and distinguished colors indicate that, flow and closing are significant contributors on DP and MaxHI respectively.

Similarly, the contour plots have improved, particularly with an elimination of negative hemolysis region (Figure 10-right).

Figure 10, The sensitivity analysis (left), and Input/output contours (right)

The next step is to test this new improved model with the previous test points (Figure 11).       

Figure 11. The test data points on the design space, and comparison of the predictions

This time, both DP and MaxHI are predicted well with ML for test points 1 and 2. For test point 3 the results are still off, but closer compared to the previous ML model. 

For better ML predictions, adding few data points will definitely enhance the model. 

Benefits

Regarding the above benchmark application, one can conclude that, the benefits of integrating Machine Learning with CFD are numerous. Firstly, it significantly reduces the time and computational resources required for simulations, making it possible to run multiple iterations and optimize designs more effectively.

Secondly, the increased accuracy of ML-enhanced CFD predictions leads to better performance and reduced risk of errors. This reliability is crucial in critical applications such as aerospace and automotive engineering. Lastly, the ability to rapidly prototype and test different scenarios opens up new avenues for innovation and experimentation, driving advancements in various fields of engineering.

Ozen Engineering Expertise

Ozen Engineering Inc. leverages its extensive consulting expertise in CFD, FEA, optics, photonics, and electromagnetic simulations to achieve exceptional results across various engineering projects, addressing complex challenges like multiphase flows, erosion modeling, and channel flows using Ansys software.

We offer support, mentoring, and consulting services to enhance the performance and reliability of your mining equipment and systems. Trust our proven track record to accelerate projects, optimize performance, and deliver high-quality, cost-effective results for both new and existing systems. For more information, please visit https://ozeninc.com.

 

Reference

1 How to Evaluate Hemolysis Risk in Medical Devices using Ansys CFD