Skip to Main Content

      

ANSYS BLOG

November 21, 2023

Grad Student Applies PyFluent and Machine Learning to Advance Sustainable Materials Processing

Students and researchers in the Mechanics for Materials Design Lab at Cornell University have added a new tool to their simulation workflow. The lab, run by associate professor Meredith Silberstein, Ph.D., explores mechanical experiments and modeling methods in material design with particular focus on multifunctional, active, and polymeric materials.

Looking at composite materials from a fluids perspective, graduate student Rahul Ghosh recently integrated Ansys PyFluent and a machine learning (ML) method into ongoing lab research to optimize resin transfer molding (RTM). RTM is a process used to create composite materials in the aerospace and automotive industries. With sustainability concerns rising around the world, RTM has become a favorable choice for materials processing because it decreases emissions and offers more efficient production.

With access to Ansys’ tools through the Ansys Academic Program, Ghosh and his team implemented PyFluent to explore fluid flow issues during RTM, which can cause design failure. PyFluent is part of PyAnsys, a suite of open source software that lets you interact with several Ansys solvers at once within the Python ecosystem using a programmable interface. This means you can create specialized solutions in Python while integrating Ansys’ solvers and other computer-aided engineering (CAE) applications and tools. Python is a common language used for artificial intelligence (AI) and ML with its ease of use, vast libraries, and large developer community.

Rahul Ghosh

Rahul Ghosh, M.S. in mechanical engineering, Cornell University

Henkel’s high-pressure resin transfer molding (RTM) system

Henkel’s high-pressure resin transfer molding (RTM) system, courtesy of PR News

By combining the capabilities of Python-based tools, ML techniques, and Ansys simulation, Ghosh established a new workflow to examine issues during RTM, which can improve sustainable materials processing in the future. This project was funded by the U.S. Air Force Office of Scientific Research under grant number FA9550-22-1-0030.

Enhance Fluid Dynamics with PyFluent and ML

Ghosh’s research began in 2021 as part of Cornell’s program requirements to complete a Master of Science in mechanical engineering. The program requires students to conduct two years of research and publish a thesis on their findings.

According to Ghosh, the main issue with RTM is that voids, such as dry spots or air bubbles, often occur during composite material production, which become points of design failure or weakness down the line. This is something that the Air Force and most people in the aerospace and automotive industries who use RTM are trying to reduce, he says.

First, Ghosh and his team used Ansys Fluent to explore two main fluid flows: resin and air. Ghosh appreciated Fluent’s computational fluid dynamics (CFD) features, including parallelization and post-processing capabilities, which enabled them to define variables and observe values at different points in the domain.

Next, the team took a novel approach to examine the voids by using non-Newtonian fluids, which act differently under greater amounts of force.

dry spot (blue) formed in resin molds using inserts

Ansys Fluent simulation of dry spot (blue) formed in resin molds using inserts (white) to create complex geometry.

dry spot (blue) reduced in resin molds using inserts

Fluent simulation of dry spot (blue) reduced in resin molds using inserts (white) to create complex geometry.

For example, some non-Newtonian fluids become more viscous when force is applied on them, while others become less viscous. Conversely, Newtonian fluids, such as water, do not change viscosity when force is applied. Ghosh wanted to explore possible ways to reduce the dry spot or air bubble formation in these voids by completely changing the behavior and rheology of the fluid. However, this required the group to review a large sample space of fluid properties to determine which property and set of parameters would provide the best fill for a composite part — a tedious and burdensome task.

Restricted by their search algorithm, Ghosh preferred to implement a statistical optimization technique using a ML method known as Bayesian optimization, which considers probability and would provide an estimation of where the best performance might occur. But how would they incorporate Bayesian optimization into Fluent? Ghosh needed a code that would search the entire sample space, find a set of parameters to test, run a Fluent simulation using those parameters, and then — using that output —determine where to look again or if the best result was achieved.

PyFluent enabled Ghosh to create a code with seamless integration of Fluent, calling on it as a command line, and run simulations without needing to enter manual inputs. Additionally, the PyFluent text user interface allowed Ghosh to change material properties without ever having to go into Fluent, which saved time by eliminating back-and-forth efforts between applications. Similarly, its user-defined functions allowed Ghosh to model the viscosity of the material more quickly and easily.

PyFluent interface

GitHub interface for PyFluent code

“I was able to take all the files and data, run a Fluent simulation, use the various data processing capabilities of PyFluent and Python to obtain results, and then set the next set of simulations,” he explains. “To quantify how this helped, I was able to complete about 2,000 simulations — some of which take within two to three days — in roughly two months. I can’t even imagine how long it would have taken if I had done them manually.”

Resin volume

Ghosh used PyFluent to obtain data from thousands of simulations at an accelerated pace.

Although Ghosh’s initial objective was to find a set of parameters that works best in all scenarios, he discovered that due to changing geometries and process parameters, the fill — and the resin that gives the best fill — will also change.

“So, what we’ve established is more of a new approach and workflow using Fluent, PyFluent, and ML optimization, rather than a definitive answer to the question,” he says.

Ghosh’s thesis, “Analysis of dry spot formation in RTM through optimization of non-Newtonian resin parameters,” was recently published by ProQuest.

dry spot (blue) formed in cases of non-uniform permeability

Fluent simulation of dry spot (blue) formed in cases of non-uniform permeability. (Resin volume is shown in red.)

dry spot (blue) reduced in cases of non-uniform permeability

Fluent simulation of dry spot (blue) reduced in cases of non-uniform permeability. (Resin volume is shown in red.)

Access to Industry Tools

Before attending graduate school, Ghosh had limited exposure to simulation in his Indian hometown, where simulation was not a standard part of undergraduate curriculum. However, Ghosh easily accessed Ansys’ free student software.

“The thing I really appreciate about Ansys is that you’re making simulation accessible for students all across the globe,” he says.

Free student software has been a key component of the Ansys Academic Program since 2015. The program provides universities with deeply discounted software for use in the classroom or in research while supplying students with free resources for self-learning. Currently, the program reaches more than 3,100 universities across 86 countries.

As an advocate of simulation integration within academia, Ansys collaborates with universities to develop courses and programs. Cornell’s popular free edX course “A Hands-on Introduction to Engineering Simulations” describes how to analyze real-world engineering problems using Ansys simulation software. The course is taught by Rajesh Bhaskaran, director of the Swanson Engineering Simulation Program at Cornell University.

Ghosh enrolled in the course a couple of years ago and both the course — and Bhaskaran — boosted his interest in attending Cornell for graduate school.

“It had about an 80% to 85% influence on my decision,” he says. “When I met him in person, I was like, ‘I can't believe I’m seeing someone I’ve seen on a screen for like two years,’ but it only got better from there. During one of his courses, I met John Swanson himself. I met the person who actually made Ansys.”

As a recent graduate this summer, Ghosh is preparing for industry and advises engineering students from all backgrounds to gain experience with Ansys simulation and tools.

“The reason having an Ansys background is very important is because those skills are transferable,” he says. “You’re able to utilize various different software as long as you know how commercial simulation software works and what you’re trying to solve. Also, Ansys is widely used in the industry, so if you have these skills, it translates really well into your job.”

Ghosh would like to explore mechanical design and believes his Ansys simulation and Python skills will come in hand.

“I want to emphasize that I don’t believe a modern day engineer can survive in the current industry without having basic coding skills,” he adds.

Uncrack the Code to Industry

Committed to democratizing simulation and improving the developer experience, Ansys launched the Ansys Developer portal in early 2023. The one-stop digital platform centralizes technical documentation, expert interaction, and developer tools across Ansys’ portfolio with direct access to the PyAnsys project, which includes PyFluent, PyMechanical, and several other Python packages designed for Ansys products.

To learn more about PyFluent and the latest Fluent release features, register for the on-demand webinar Ansys 2023 R2: Ansys Fluent What’s New.

To discover educational opportunities at Ansys, free resources, student incentives, and more visit Ansys Academic.

Découvrez ce qu'Ansys peut faire pour vous

Contactez-nous aujourd'hui

* = Champ requis

Merci de nous avoir contacté !

Nous sommes à votre disposition pour répondre à toutes vos questions. Un membre de l'équipe commerciale Ansys vous contactera sous peu.

Image de pied de page