🌊

HarnessFOAM

An End‑to‑End Composable Multi‑Agent Framework for Automating CFD Simulation in OpenFOAM. Driven by LangGraph, MCP, and Vision-Language models.

🐍 Python 3.10+
🟒 OpenFOAM Compatible
πŸ“œ MIT License
View on GitHub

πŸ–₯️ Live Web User Interface

HarnessFOAM Premium Web UI

πŸ”„ The Multi-Agent Workflow

User Query
βž”
Architect
βž”
Meshing
βž”
Input Writer
βž”
Runner
βž”
Visualizer
βž”
Visual Feedback / Review
1

Architect Agent

Interprets prompts and structures the OpenFOAM directory case plan.

2

Meshing Agent

Autonomously handles blockMesh Dict structures or compiles custom python-gmsh geometry scripts.

3

Input Writer

Writes mesh, control boundary, scheme, and physical property dictionaries using robust streaming.

4

Runner Agent

Executes simulations locally, via WSL/Docker, or drafts Slurm parallel schedules for HPCs.

5

Reviewer Agent

Performs visual (VLM) and semantic inspections of raw simulation logs, correcting divergence bugs.

6

Visualizer

Compiles PyVista post-processing scripts to extract pressure and velocity contours directly.

πŸš€ Getting Started

CLI Shell bash
# Clone and install dependencies
git clone git@github.com:isabecurtis023-lang/HarnessFOAM.git
cd HarnessFOAM
pip install -e .
# Start the real-time FastAPI WebSocket Server
harnessfoam serve --host 127.0.0.1 --port 8000

πŸ§ͺ Verified Automation Pipeline

1

RAG Context

Architect and Input Writer receive canonical guidance plus 100 indexed dictionary files from the vendored official OpenFOAM 13 tutorials (cavity, pitzDaily, motorBike, damBreak, hotRoom and shockTube).

2

Preflight

Required files, FoamFile headers, solver dependencies, and mesh/field patch consistency are checked before execution.

3

checkMesh

Mesh topology and geometry are validated before the solver is launched.

4

Runtime Metrics

Residuals, continuity errors, Courant numbers, time steps, and completion markers are parsed automatically.

5

Post-Process

Deep Driving automatically calls the Visualizer Agent and returns a PyVista result image.

Current smoke verificationicoFoam / cavity
Preflight: PASSED
Mesh: 400 cells / checkMesh OK
Runtime: 501 time steps / max Co 0.170424
Post-process: visualization.png generated

🧠 Memory, Assistant Tools & Benchmarks

1

Opt-in memory

Every agent has a local lesson document with its own token budget. Full documents are compressed automatically; memory is off by default.

2

Safe framework edits

The assistant can search and read the repository, then propose a reviewable patch. Writes require explicit confirmation and remain inside the project.

3

OpenFOAM 13 matrix

CLI, Web API/UI and MCP paths are checked against cavity, pitzDaily, damBreak and shockTube tutorial regressions.

🌟 Visionary Future Roadmap

1. Distributed Compute Network

Leveraging De-Sci blockchain protocols to scale Large Eddy Simulations across peer-to-peer compute nodes.

2. Generative Physical Diffusion

Leveraging 4D Flow-Diffusion models to synthesize transient flow fields directly in milliseconds, bypassing grid discretisation.

3. Closed-Loop VLA Aero-Robotics

A Vision-Language-Action agent managing aerodynamic shapes from concept prompts down to physical wind-tunnel verification.

4. Quantum-Accelerated CFD

Developing hybrid solvers using VQE and HHL algorithms to resolve Naviers-Stokes matrices on QPUs.

5. Self-Evolution Physics Autopilot

Autonomously constructing local numerical discretisation schemes and turbulence closures via agent reinforcement loops.

6. HPC SSH Remote Dispatch

Fully integrating SSH connections to remote supercomputers for automated case dispatch, Slurm job submission, and live log feedback.