DOI: https://doi.org/10.1063/5.0257555
تاريخ النشر: 2025-03-01
المؤلف: Sandeep Pandey وآخرون
الموضوع الرئيسي: تقليل النماذج والشبكات العصبية
نظرة عامة
تقدم هذه البحث OpenFOAMGPT، وهو وكيل يعتمد على نموذج لغة كبير (LLM) مصمم خصيصًا لمحاكاة الديناميكا الهوائية الحسابية (CFD) باستخدام OpenFOAM. يستخدم الوكيل نموذجين أساسيين من OpenAI: GPT-4o ونموذج معاينة o1 المدعوم بسلسلة من الأفكار (CoT). بينما يتكبد نموذج o1 تكلفة تزيد ست مرات عن تكلفة GPT-4o، إلا أنه يتفوق باستمرار في المهام المعقدة، بما في ذلك إعدادات الحالات بدون تدريب، وتعديلات شروط الحدود، وتعديلات نموذج الاضطراب، وترجمة الشيفرة. يعالج الوكيل بفعالية سيناريوهات هندسية متنوعة، مثل تدفق الأحادية والمتعددة المراحل وانتقال الحرارة، وغالبًا ما يحقق التقارب في عدد محدود من التكرارات بتكاليف رمزية منخفضة.
لزيادة قدراته الخاصة بالمجال، نفذ المؤلفون خط أنابيب توليد معزز بالاسترجاع (RAG)، مما يسمح للوكيل بالاستفادة من إعدادات المحاكاة الحالية للتخصص في المجالات الفرعية مثل الطاقة والفضاء. على الرغم من الأداء القوي للوكيل، يتم التأكيد على ضرورة الإشراف البشري لضمان الدقة والقدرة على التكيف مع السياقات المتغيرة. تشير التقلبات الملحوظة في أداء النموذج بمرور الوقت إلى أهمية المراقبة في التطبيقات الحرجة. على الرغم من التركيز على OpenFOAM، فإن الإطار القابل للتكيف لـ OpenFOAMGPT يقترح تطبيقات محتملة لتطوير وكلاء مدعومين بـ LLM عبر مجموعة متنوعة من الحلول والشيفرات، مما يسهل محاكاة CFD وقد يسرع التقدم في كل من البحث الأساسي والهندسة الصناعية.
مقدمة
تسلط مقدمة هذه الورقة البحثية الضوء على التكامل المتزايد للمنهجيات المدفوعة بالبيانات في ميكانيكا السوائل، مدفوعة بتوافر بيانات محاكاة عالية الدقة والتقدم في التعلم الآلي. يتم استخدام هذه المنهجيات لنمذجة الاضطراب ومشاكل انتقال الحرارة المعقدة، بالإضافة إلى تعزيز القياسات التجريبية وتسهيل الاكتشاف العلمي من خلال الاستدلال السببي في تدفقات السوائل. مؤخرًا، ظهرت نماذج اللغة الكبيرة (LLMs) كأدوات تحويلية في المجالات العلمية والهندسية، حيث تقدم قدرات في فهم اللغة الطبيعية، والتفكير الآلي، واتخاذ القرارات، مما يحسن سير العمل التقليدي ويسرع الاكتشاف العلمي.
تناقش الورقة تطبيقات متنوعة لـ LLMs في ميكانيكا السوائل، بما في ذلك دورها في اكتشاف المعادلات وتحسين الأشكال. تشمل الأمثلة البارزة استخراج المعادلات الحاكمة من البيانات بشكل مستقل وتحسين الملفات الهندسية لتقليل السحب. بالإضافة إلى ذلك، يتم استخدام LLMs في الميكروفلويديات لتخطيط الحركة الروبوتية وفي التنبؤ بالديناميكا الهوائية غير المستقرة من خلال أطر متقدمة تدمج المعلومات المكانية والزمنية. يقدم المؤلفون أيضًا وكيلًا يعتمد على LLM، مدعومًا بتوليد معزز بالاسترجاع (RAG) لـ OpenFOAM، مصمم لأتمتة سير عمل CFD وتقليل حاجز الخبرة للمستخدمين. يهدف هذا الإطار إلى تعزيز الإنتاجية ويمكن تكييفه لمجموعة متنوعة من الحلول والشيفرات، مما يوضح إمكانية LLMs في إعادة تشكيل مشهد البحث العلمي في ميكانيكا السوائل.
طرق
في هذا القسم، يتم تفصيل المنهجية المستخدمة لتطوير وكيل محدد لـ OpenFOAM، المشار إليه باسم OpenFOAMGPT. يستفيد الوكيل من OpenFOAM، وهو حل ديناميكا هوائية حسابية مفتوح المصدر، معروف بمرونته وقابليته للتكيف في تطبيقات متنوعة، بما في ذلك التدفقات غير القابلة للضغط والقابلة للضغط، وانتقال الحرارة، والأنظمة متعددة المراحل. يتم بناء الوكيل على نموذجين أساسيين من OpenAI: ChatGPT-4o وChatGPT-o1 preview، يتم الوصول إليهما عبر واجهة برمجة تطبيقات OpenAI. يعزز دمج آلية توليد معززة بالاسترجاع (RAG) أداء الوكيل من خلال توفير معرفة خاصة بالمجال مستمدة من دروس OpenFOAM، مما يحسن دقة وملاءمة المخرجات الناتجة.
شمل تقييم قدرات OpenFOAMGPT اختبار ست حالات متميزة، تتراوح من التدفقات اللامتناهية البسيطة إلى الديناميات متعددة المراحل المعقدة. تشير النتائج إلى أنه بينما يمكن للوكيل بنجاح توليد محاكاة لحالات أبسط مثل تدفق التجويف، فإنه يواجه صعوبة في السيناريوهات الأكثر تعقيدًا دون مساعدة من ملفات الإدخال التفصيلية، مثل blockMeshDict. يكشف مقارنة الأداء بين النماذج أن نموذج o1-preview يتفوق على نموذج 4o في توليد الأشكال المعقدة، خاصة عندما يتم دعمه بـ RAG. ومع ذلك، لا تزال هناك تحديات للحالات التي تتطلب حل مشاكل متقدم، مثل سيناريو عمود الجسيمات، حيث يواجه الوكيل قيودًا كبيرة عند الاعتماد فقط على نموذج اللغة. بشكل عام، تؤكد النتائج على إمكانية دمج LLMs مع الموارد الخاصة بالمجال لتعزيز قدرات المحاكاة في تطبيقات CFD.
مناقشة
في هذا القسم، يقيم البحث أداء OpenFOAMGPT، وخاصة نموذج GPT-4 مع قدرات توليد معززة بالاسترجاع (RAG)، في تنفيذ محاكاة الديناميكا الهوائية الحسابية (CFD) المعقدة. تشير النتائج إلى أن تمكين RAG يعزز بشكل كبير قدرة النموذج على التعامل مع سيناريوهات المحاكاة المختلفة، كما يتضح من نجاحه في إعداد جميع الحالات المختبرة، بما في ذلك المهام الأكثر تعقيدًا مثل محاكاة عمود الجسيمات، التي تطلبت عشرة جولات تفاعل وحوالي 96,000 رمز. على الرغم من زيادة استخدام الرموز للمهام المعقدة، تظل التكلفة الإجمالية لكل سيناريو اختبار منخفضة، تتراوح بين 0.03 دولار إلى 0.36 دولار، مما يجعل نموذج GPT-4 خيارًا فعالًا من حيث التكلفة مقارنة بالتكاليف الأعلى المرتبطة بنموذج o1.
بالإضافة إلى ذلك، يناقش القسم قدرة الوكيل على التكيف مع ظروف المحاكاة البديلة، مثل تغير الشروط الأولية وشروط الحدود ونماذج الاضطراب. أظهر نموذج o1 تفكيرًا متقدمًا من خلال تنفيذ شروط الحدود المعقدة بشكل صحيح دون تعليمات صريحة. بينما نجح الوكيل في إدارة معظم السيناريوهات، واجه تحديات مع نموذج الاضطراب k-ϵ في حالة عمود الجسيمات، مما يبرز التعقيدات المعنية في مثل هذه المحاكاة. بشكل عام، تؤكد النتائج على إمكانية OpenFOAMGPT لأتمتة وتبسيط المهام المتقدمة في CFD، مما يقلل من الحاجة إلى تدخل بشري واسع النطاق.
DOI: https://doi.org/10.1063/5.0257555
Publication Date: 2025-03-01
Author(s): Sandeep Pandey et al.
Primary Topic: Model Reduction and Neural Networks
Overview
This research presents OpenFOAMGPT, a large language model (LLM)-based agent specifically designed for computational fluid dynamics (CFD) simulations using OpenFOAM. The agent utilizes two foundational models from OpenAI: GPT-4o and a chain-of-thought (CoT)-enabled o1 preview model. While the o1 model incurs a cost six times greater than that of GPT-4o, it consistently outperforms in complex tasks, including zero-shot case setups, boundary condition modifications, turbulence model adjustments, and code translation. The agent effectively addresses various engineering scenarios, such as single- and multi-phase flow and heat transfer, often achieving convergence in a limited number of iterations at low token costs.
To enhance its domain-specific capabilities, the authors implemented a retrieval-augmented generation (RAG) pipeline, which allows the agent to leverage existing simulation setups for specialization in sub-domains like energy and aerospace. Despite the agent’s strong performance, the necessity for human oversight is emphasized to ensure accuracy and adaptability to changing contexts. The observed fluctuations in model performance over time indicate the importance of monitoring in critical applications. Although the focus is on OpenFOAM, the adaptable framework of OpenFOAMGPT suggests potential applications for developing LLM-driven agents across a variety of solvers and codes, thereby streamlining CFD simulations and potentially accelerating advancements in both fundamental research and industrial engineering.
Introduction
The introduction of this research paper highlights the growing integration of data-driven methodologies in fluid mechanics, driven by the availability of high-fidelity simulation data and advancements in machine learning. These methodologies are being utilized to model turbulence and complex heat transfer problems, as well as to enhance experimental measurements and facilitate scientific discovery through causal inference in fluid flows. Recently, Large Language Models (LLMs) have emerged as transformative tools in scientific and engineering fields, offering capabilities in natural language understanding, automated reasoning, and decision-making, thereby improving traditional workflows and accelerating scientific discovery.
The paper discusses various applications of LLMs in fluid mechanics, including their role in equation discovery and shape optimization. Notable examples include the autonomous extraction of governing equations from data and the optimization of geometric profiles to reduce drag. Additionally, LLMs are being employed in microfluidics for robotic motion planning and in predicting unsteady fluid dynamics through advanced frameworks that integrate spatial and temporal information. The authors also present an LLM-based, retrieval-augmented generation (RAG) agent for OpenFOAM, designed to automate CFD workflows and lower the expertise barrier for users. This framework aims to enhance productivity and can be adapted for various solvers and codes, illustrating the potential of LLMs to reshape the landscape of scientific research in fluid mechanics.
Methods
In this section, the methodology employed for developing an OpenFOAM-specific agent, referred to as OpenFOAMGPT, is detailed. The agent leverages OpenFOAM, an open-source computational fluid dynamics (CFD) solver, known for its flexibility and adaptability in various applications, including incompressible and compressible flows, heat transfer, and multiphase systems. The agent is built upon two foundation models from OpenAI: ChatGPT-4o and ChatGPT-o1 preview, accessed via the OpenAI API. The integration of a retrieval-augmented generation (RAG) mechanism enhances the agent’s performance by providing domain-specific knowledge derived from OpenFOAM tutorials, thus improving the accuracy and relevance of generated outputs.
The evaluation of OpenFOAMGPT’s capabilities involved testing six distinct cases, ranging from simple laminar flows to complex multiphase dynamics. The results indicate that while the agent can successfully generate simulations for simpler cases like Cavity flow, it struggles with more intricate scenarios without the aid of detailed input files, such as blockMeshDict. The performance comparison between the models reveals that the o1-preview model outperforms the 4o model in generating complex geometries, particularly when supplemented with RAG. However, challenges remain for cases requiring advanced problem-solving, such as the Particle column scenario, where the agent encounters significant limitations when relying solely on the language model. Overall, the findings underscore the potential of integrating LLMs with domain-specific resources to enhance simulation capabilities in CFD applications.
Discussion
In this section, the research evaluates the performance of OpenFOAMGPT, particularly the GPT-4 model with retrieval-augmented generation (RAG) capabilities, in executing complex computational fluid dynamics (CFD) simulations. The results indicate that enabling RAG significantly enhances the model’s ability to handle various simulation scenarios, as evidenced by its successful setup of all tested cases, including more intricate tasks like the particle column simulation, which required ten interaction rounds and approximately 96,000 tokens. Despite the increased token usage for complex tasks, the overall cost per test scenario remains low, ranging from $0.03 to $0.36, making the GPT-4 model a cost-effective option compared to the higher costs associated with the o1 model.
Additionally, the section discusses the agent’s capability to adapt to alternate simulation conditions, such as varying initial and boundary conditions and turbulence models. The o1 model demonstrated advanced reasoning by correctly implementing complex boundary conditions without explicit instructions. While the agent successfully managed most scenarios, it faced challenges with the k-ϵ turbulence model in the particle column case, highlighting the complexities involved in such simulations. Overall, the findings underscore the potential of OpenFOAMGPT to automate and streamline advanced CFD tasks, thereby reducing the need for extensive human intervention.
