Thought Leadership

From Outdated to Up to Date: Modernizing Deprecated Code with Multi-Agents

Automation in Simcenter STAR-CCM+ with Java Macro

Automation in Simcenter STAR-CCM+ has revolutionized how users interact with CFD simulations, providing a streamlined and efficient approach to complex engineering problems. The software allows for extensive customization capabilities through its Java APIs, enabling users to tailor the simulation environment to their specific needs. Companies heavily rely on these automation tools, creating macros and scripts to handle recurring tasks and reduce user errors. This massively enhances productivity and guarantees consistency across projects.

Users particularly appreciate Simcenter STAR-CCM+ for its flexibility and powerful scripting features, which enable the complete automation of simulation workflows. The software’s scripting capabilities allow users to automate everything from geometry import through to post-processing. While the Java API can be intricate and may involve a learning curve, the potential for unlimited customization makes it a preferred choice for engineers seeking to optimize their simulation processes. Despite the requirement for advanced programming knowledge, the option to create and use scripts directly within the program underscores Simcenter STAR-CCM+’s approach to user accessibility and efficiency, making it a highly valued tool in the CFD community .

Deprecated Code Issue

Like any sophisticated software, it undergoes continuous updates and improvements. As new features are introduced and existing functionalities are enhanced, certain API methods and classes become outdated and are marked for future removal. One common challenge users face is dealing with such deprecated code, particularly within the Java API. 

For users, this means that their existing scripts and customizations may contain deprecated code that needs to be revised. The accumulation of such code is a common scenario in long-term projects where initial scripts were written using older versions of the API. As the software evolves, these scripts must be updated to align with the current standards, ensuring optimal performance and avoiding potential issues.

Solution with Multi-Agent System

Enter Large Language Models (LLMs) – a groundbreaking advancement in artificial intelligence that offers promise in solving the problems of automatic macro updates. LLMs understand Java code quite well due to their extensive training on diverse programming language datasets. When provided with well-structured information about the changes in software releases, LLMs can update scripts accurately and automatically. This significantly reduces the manual effort required for code maintenance, allowing users to focus on more critical aspects of their projects, such as innovation and optimization.

However, this efficiency is contingent upon the quality of the input data fed into the LLMs. Those who think that all that’s required is to feed the LLM with chunks of blindly extracted information from documentation PDFs and code from different sources might be disappointed. The accuracy and effectiveness of the LLMs are significantly enhanced when the retrieved data is precise, and the instructions are clear. This principle is particularly evident when using techniques like Retrieval Augmented Generation, which optimize the performance of LLMs by providing highly specific and relevant context. The better the data and instructions, the more accurate the script updates performed by the LLMs will be.

Another effective approach involves splitting the task into smaller steps and introducing a Multi-agent System. In this configuration, individual agents can tackle specific tasks, passing error-free results to subsequent agents. This method increases the probability of accurately completing the overall task since each agent operates with clearer input data and more specific instructions. For instance, one agent could be responsible for filtering sources and extracting crucial chunks of information, while another focuses on updating the code based on provided instructions.

In our prototype, a specific role is assigned to an agent for filtering sources and extracting only the relevant information necessary for updates. Another crucial role is played by an agent responsible for updating the code according to the filtered instructions and input data. By dividing responsibilities among specialized agents, the Multi-Agent System enhances the accuracy and efficiency of the automation process, ensuring that updates are performed seamlessly and effectively. Finally, the third agent summarizes the performed changes together with the links to the documentation sources.

Adaptive Intelligence

In addition to simplifying the process of updating deprecated code, LLMs also offer the potential for continuous improvement and learning. As these models are exposed to more data and user feedback, they become increasingly adept at understanding the nuances of specific coding environments and requirements. This means that over time, LLMs can provide even more accurate and efficient suggestions, further reducing the burden on those responsible for automation maintenance. By integrating LLMs into their workflow, users of Simcenter STAR-CCM+ can not only keep their codebase up to date, but also leverage the latest advancements in AI to enhance their overall productivity and thus increase their innovation.

Acknowledgments

Special thanks to Viorica Puscas, Alexandru Grigore, Roberta Luca, Cosmin Ivan and Evelina Popa for their contributions.

Maria Bonner
SE Associate Manager
Robin Bornoff
Innovation Roadmap Manager

Leave a Reply

This article first appeared on the Siemens Digital Industries Software blog at https://blogs.sw.siemens.com/art-of-the-possible/from-outdated-to-up-to-date-modernizing-deprecated-code-with-multi-agents/