$ show Terry-cyx/MetaOpenFOAM
The MetaOpenFOAM repository is an application that automates the setup and execution of OpenFOAM CFD simulations using a multi-agent system powered by Large Language Models (LLMs). It integrates the MetaGPT framework to define specialized agents (Architect, TaskDivide, InputWriter, Runner, Reviewer) that collaboratively interpret user requirements, generate OpenFOAM input files, run simulations, and review results. Additionally, it incorporates the active_subspaces library for parameter optimization and sensitivity analysis in the `OptMetaOpenfoam.py` workflow. The system processes OpenFOAM tutorials to build retrieval-augmented generation (RAG) vector databases, enabling the LLM agents to access relevant case information when generating simulation inputs. Configuration and path management are handled via a centralized YAML configuration, and the application relies on external dependencies including OpenFOAM-10, Conda, and LLM APIs (OpenAI or DeepSeek). While the project demonstrates a sophisticated integration of CFD simulation, LLM agents, and sensitivity analysis, it is marked as deprecated in favor of a successor tool (sim-cli).
The LLM identified 4 files worth highlighting for reuse:
This script processes OpenFOAM tutorial directories to extract structured metadata (case name, solver, domain, category) and file contents. It then builds FAISS vector databases for efficient retrieval using HuggingFace embeddings. The component is self-contained and demonstrates a reusable pattern for converting structured documentation into a searchable knowledge base.
This module manages application configuration by reading a YAML file, setting up environment-specific paths (source, base, run, database), and updating the configuration for LLM provider details. It encapsulates configuration logic in a reusable, isolated manner that could be adapted to other projects requiring flexible environment setup.
This module sets up a RetrievalQA chain using LangChain, combining a FAISS vector store with a language model (such as OpenAI or HuggingFace). It abstracts the process of loading the vector store and configuring the QA chain, providing a reusable component for any application needing retrieval-augmented question answering.
As part of the MetaGPT-based multi-agent system, this action defines the behavior of the InputWriter agent, responsible for generating OpenFOAM input files based on user requirements and retrieved context from the vector databases. It exemplifies the action pattern where specific tasks are encapsulated in reusable classes, leveraging LLMs and retrieval-augmented generation to produce domain-specific outputs.