ChatCFD is a LLM-driven pipeline that automates computational fluid dynamics (CFD) workflows within the OpenFOAM framework, enabling users to configure and execute complex simulations from natural language prompts or published literature with minimal prior expertise. Further details can be found in our arXiv preprint, with a full Appendix available on ResearchGate. Through a conversational chat interface, users can:
- Upload and specify which CFD case from a paper they want to simulate
- Provide the corresponding mesh files for the simulation
The system automatically interprets the paper's specifications, configures the OpenFOAM case, and handles the simulation setup, making CFD more accessible to users without extensive domain expertise.
ChatCFD is part of an ongoing research effort on autonomous CFD agents. Since its initial release, this direction has continued into PhyNiKCE, a neurosymbolic agentic framework for autonomous CFD. ChatCFD remains the open-source foundation for this work, and future maintenance will focus on documentation, benchmark cases, CI, safer automation, and community contributions.
- 🤖 Interactive Multimodal Interface: Supports PDF papers, mesh files, and natural language dialogue through a ChatGPT-like interface
- 🧠 Intelligent Case Configuration: Automatically configures OpenFOAM cases based on academic literature
- 🤝 Multi-Agent Architecture: Utilizes specialized AI agents with Retrieval-Augmented Generation (RAG)
- 🔧 Robust Error Correction: Implements a multi-category error correction system for enhanced simulation reliability
- 🔄 OpenFOAM Integration: Seamlessly works with OpenFOAM framework for CFD simulations
- Python 3.11.4 or higher
- OpenFOAM v2406 installation
- CUDA-capable GPU (optional, but recommended for better performance)
-
Machine Learning & AI:
- PyTorch 2.6.0
- Transformers 4.50.3
- Sentence-Transformers 4.0.1
- FAISS-CPU 1.7.4 (for vector similarity search)
- Scikit-learn 1.6.1
- NumPy 1.26.4
- Pandas 2.2.3
-
Web & API:
- Streamlit 1.41.1 (for web interface)
- OpenAI 1.39.0
- LangChain 0.1.19
- FastAPI and related dependencies
-
PDF Processing:
- PDFPlumber 0.11.5
- PyPDF2 3.0.1
- PDFMiner.six 20231228
-
OpenFOAM Integration:
- PyFoam 2023.7
- Linux (recommended for OpenFOAM compatibility)
- Windows with WSL2 (Windows Subsystem for Linux)
- Create the conda environment:
conda env create -f chatcfd_env.yml- Activate the environment:
conda activate chatcfd- Verify key components:
# Test FAISS installation
python -c "import faiss; print(faiss.IndexFlatL2(10))"
# Test PyFoam installation
python -c "from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile; print('PyFoam OK')"- Download and verify
SentenceTransformer:
# Download the model
python test_env/download_model.py
# Test the model
python test_env/test_all_mpnet_base_v2.pyExpected output (CPU):
GPU Available: False
GPU Name: None
Similarity 0-1: 0.383
Similarity 0-2: 0.182
Note: Results will differ if using GPU.
Configure the system by editing inputs/chatcfd_config.json:
- Set your API keys, urls, and model names for
DeepSeekmodels - Configure OpenFOAM paths
- Adjust other parameters as needed
Start the ChatCFD interface:
streamlit run src/chatbot.pyThe interface should look similar to:

Then the user should upload the pdf file, specify the CFD case, and upload the CFD mesh file following the guidance of ChatCFD.
- 📄 Upload Documents: Start by uploading relevant academic papers in PDF format
- 📦 Provide Mesh: Upload your mesh files (supported formats: OpenFOAM, Fluent)
- 💬 Interactive Configuration: Use natural language to describe your simulation requirements
- ⚙️ Case Execution: Let ChatCFD handle the case setup and execution
- 🔍 Error Handling: The system will automatically detect and correct common errors
ChatCFD has demonstrated:
- 📊 30-40% success rate in direct case configuration from literature
- 🎯 60-80% operational success rate for incompressible and compressible CFD cases
- 🛡️ Robust error handling and correction capabilities
@misc{fan2025chatcfd,
title={ChatCFD: an End-to-End CFD Agent with Domain-specific Structured Thinking},
author={E Fan and Weizong Wang and Tianhan Zhang},
year={2025},
eprint={2506.02019},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
