r/OpenFOAM • • 12h ago

Does rhopimplefoam neglect viscous work in the energy equation?

2 Upvotes

I'm currently running axial compressor rotor simulations using rhoPimpleFoam in OpenFOAM v2512 with MRF and k-omega SST. I've consistently noticed that the work calculated from total blade torque is approximately 1.5% higher than the work calculated from total temperature rise, regardless of mesh refinement or operating point. Interestingly, when I exclude the viscous contribution from the reported torque and use only the pressure torque, the discrepancy drops to around 0.1%. After looking through EEqn.H, I noticed that there is an explicit MRF pressure-work term, but seemingly no viscous stress-work divergence term. My theory is that the momentum equation accounts for viscous forces, but the energy equation neglects their associated work, resulting in a slight underprediction of total temperature rise. Has anyone encountered this before, or am I misunderstanding how rhoPimpleFoam handles viscous work? Would adding a viscous stress-work divergence term to EEqn.H be an appropriate solution?


r/OpenFOAM • • 1d ago

Hello im trying to install open foam but im stuck on this step

0 Upvotes

r/OpenFOAM • • 1d ago

[v2106+] Lessons from a year of using an AI agent to set up and run OpenFOAM cases

33 Upvotes

I'm a developer in naval engineering. I used Ansys for years, then a large, automatable CFD workload had to move to OpenFOAM. For the past year I've had an AI agent (through MCP) editing case files, running the steps and reading results. Some lessons, in case they're useful to anyone trying the same:

**1. The model rarely gets the physics wrong — it gets the mesh setup wrong.** Most failed runs were meshing details: surfaceFeatureExtractDict entries in the wrong format for the version, snappy features pointing to the .stl instead of the extracted edge mesh, mergeTol not matching writePrecision. Checking these before running saved more time than any prompt tweak.

**2. Agents over-refine.** Left alone, it would put level 6–7 on a 250 m hull and blow up the cell count. Capping refinement levels from the base cell size and the part's smallest dimension fixed it.

**3. Error loops are the real token sink.** When a step fails (e.g. "No surfaces found" because a geometry reference is wrong), the agent tends to retry variations of the same thing. Checking case consistency first — geometry references, patches in 0/ vs. the mesh, initial conditions — stops the loop before it starts.

**4. Don't let it reason about the pipeline.** Which utilities to run, and in what order, can be inferred deterministically from which dictionaries exist (blockMeshDict, snappyHexMeshDict, setFieldsDict…). I validated that against the 350+ tutorial Allruns; the model doesn't need to spend tokens on it.

**5. Raw output is expensive.** Reading full solver logs and plotting from scratch burned most of the tokens. Returning short summaries (residual trends, windowed force averages) instead made it practical: I now run 20+ cases over 3 days without watching them.

**6. Give it tools, not scripts.** Writing an STL by hand or a matplotlib script for every figure is slow and inconsistent. Giving the agent operations instead — build a part by extrude/revolve/sweep/loft, set up a scene with camera, lights, arrows and dimensions, then capture it — made geometry changes and report images fast and repeatable.

**7. It doesn't replace judgment.** The setup decisions and judging the results are still on the engineer. What it removes is the manual editing and clicking.

I ended up wrapping all of this into a Windows GUI — NavStokes — with its own VTK-based 3D viewport where you see the mesh, fields and convergence while the agent works, a part modeler (extrude, revolve, sweep, loft, shell, piping) and scene tools for report images. It's free and uses your own OpenFOAM install (ESI/OpenCFD, openfoam.com, v2106 and newer) and your own AI subscription. The prompt/validator core is closed, but I can share the interface code with anyone interested in the project — just DM me. It needs an account because remote access over the internet runs through our relay server (encrypted end to end; your PC still does the computing) and your AI preferences sync across machines; case files stay on your PC.

Link at the bottom for anyone curious, but I'm mainly interested in the discussion:

- Has anyone else tried agents with OpenFOAM? What broke for you?

- Next I want to map OpenFOAM surface pressure/shear onto CalculiX or Code_Aster, then two-way FSI with preCICE. If you've done that coupling, what was the painful part?

www.navstokes.com


r/OpenFOAM • • 3d ago

I don't understand what I'm doing wrong

Thumbnail gallery
6 Upvotes

r/OpenFOAM • • 6d ago

[v2606] Running the variants of an OpenFOAM study side by side on several machines

4 Upvotes

A note first: I am the developer of the tool this post describes.

A parameter study in OpenFOAM is usually one case run several times with a few numbers changed: a range of inlet speeds, or the same case on four meshes. The runs can take hours each and none depends on another, yet they often wait for each other on one workstation.

WitSweep, our desktop application for such studies, sends each variant to a machine of its own. The machines come from OmnibusCloud. If the name is new to you: the idea is close to BOINC or Folding@home, where work goes to ordinary computers in the hours they would otherwise sit idle. Here the work is your own, and you decide whose computers take it: your own machines, or those of colleagues you invite into a private group.

WitSweep opens the case folder as it is and reads the case's own Allrun as the recipe. Every line it reads differently is listed as a note. The values that can vary are highlighted in the dictionaries; you click one and give it a list or a range.

Each variant runs whole on one machine, meshing included. Nothing is split between machines, so a single run is as fast as the machine it lands on and needs a machine with enough memory.

What comes back is one table with a row per variant: the responses you named, the cell count, checkMesh's verdict and the iterations. The postProcessing folder comes back on request, and any variant opens in ParaView.

About the OpenFOAM on those machines. It comes to the OmnibusCloud client with the controller that runs it, and an OpenFOAM already installed on a machine is never used. It is v2606, the openfoam.com line, built for Linux x86-64, macOS arm64 and Windows x86-64. The upstream source pack is in the repository unmodified, and the patches folder is empty. Open MPI comes with the kit on Linux and macOS; a Windows machine runs in parallel when MS-MPI is installed on it and serially without it. Source and build pipeline: https://github.com/OmnibusCloud/OpenFOAM

What it does not do. A case written for a Foundation release or another version needs a check first. A recipe is made of the solvers and utilities of that build: there is no shell step and no custom command, and a solver you compiled yourself is outside it. The machines have no compiler, so codeStream is refused, with the file and the line, before anything is uploaded. The kit is built without METIS, kahip, CGAL, ADIOS2 and HDF5. There is no optimiser in it: it runs the plan you give it.

The controller is open source, in the same place as our other public controllers: https://github.com/OmnibusCloud/Controllers

WitSweep itself is a closed application for Windows, macOS and Linux.

A first study, step by step, on OpenFOAM's own tutorial cases: https://omnibuscloud.io/getting-started/witsweep/

The same on video, under two minutes: the motorBike tutorial at three speeds, run by its own Allrun: https://youtu.be/YytKY6-MIEQ

How do you run such series today? I am curious where the time goes: into the runs themselves, or into setting up each case and collecting the results.


r/OpenFOAM • • 8d ago

Airbox Simulation

Post image
8 Upvotes

Hey guys! Is OpenFOAM enough to use if I need to simulate how a custom airbox will perform on an NA bike? Especially the pulse of the engine. Any suggestions, please? Thank you!


r/OpenFOAM • • 9d ago

Stokes update: live GPU flow preview, in-app implicit CAD, and a gyroid heat exchanger case

7 Upvotes

r/OpenFOAM • • 10d ago

Help compiling openfoam-com arch linux

2 Upvotes

[SOLVED] I'm trying to install openfoam-com v2606 from this AUR repository: https://aur.archlinux.org/packages/openfoam-com, but every time it tries to compile OpenFoam I get an error. I've even tried manually downloading/compiling older versions of OpenFoam but they give the exact same error. Here is the error output from the AUR compilation:

g++ -std=c++17 -m64 -pthread -DOPENFOAM=2606 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -Wno-unknown-pragmas -O3 -DNoRepository -ftemplate-depth=1000 -I/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/src/finiteVolume/lnInclude -I/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/src/meshTools/lnInclude -I/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/src/transportModels/compressible/lnInclude -I/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/src/thermophysicalModels/basic/lnInclude -I/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/src/thermophysicalModels/specie/lnInclude -I/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/src/thermophysicalModels/solidSpecie/lnInclude -I/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/src/thermophysicalModels/thermophysicalProperties/lnInclude -I/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/src/functionObjects/field/lnInclude -iquote. -IlnInclude -I/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/src/OpenFOAM/lnInclude -I/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/src/OSspecific/POSIX/lnInclude -fPIC -c derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.C -o /home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/build/linux64GccDPInt32Opt/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/speciesSorption/speciesSorptionFvPatchScalarField.o

chemistryReaders/chemkinReader/chemkinLexer.L:49:38: error: ‘YY_BUF_SIZE’ was not declared in this scope

49 | int Foam::chemkinReader::yyBufSize = YY_BUF_SIZE;

| ^~~~~~~~~~~

chemistryReaders/chemkinReader/chemkinLexer.L:49:38: note: the macro ‘YY_BUF_SIZE’ had not yet been defined

/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/build/linux64GccDPInt32Opt/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L.cc:33791:9: note: it was later defined here

33791 | #define YY_BUF_SIZE (2 * YY_READ_BUF_SIZE)

| ^~~~~~~~~~~

make: *** [/home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/wmake/rules/General/transform:42: /home/sandwich/.cache/yay/openfoam-com/src/OpenFOAM-v2606/build/linux64GccDPInt32Opt/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.o] Error 1

make: *** Waiting for unfinished jobs....

I have no idea what is causing this and can't find anyone else with this problem. If anyone has ideas I would be so thankful!!!


r/OpenFOAM • • 12d ago

Open source FEA Software - thermal /Vibration /CFD /structural

28 Upvotes

r/OpenFOAM • • 13d ago

Dear experts, please evaluate my humble project.

Post image
15 Upvotes

r/OpenFOAM • • 15d ago

Advice for affordable/free computational resources for 3D CFD simulations (SITVC research)

Thumbnail reddit.com
1 Upvotes

r/OpenFOAM • • 16d ago

Took an OpenFOAM Class Taught by Greenshields and Saw the OG Simulation From his Book Cover

Post image
53 Upvotes

Evidently it's not a velocity field but a temperature field where the bottom wall is heated, left boundary is the inlet and top boundary is outlet. If you take a CFD Direct class you should ask him to see the simulation!


r/OpenFOAM • • 16d ago

Undergrad ML researcher learning CFD: tried predicting full flow fields from a few OpenFOAM runs. Would love a reality check from people who do this for real

Post image
2 Upvotes

r/OpenFOAM • • 17d ago

What AI Model and setup is best for OpenFOAM Simulations

Post image
45 Upvotes

I was able to put together in a couple of weekends models that would take me months to setup previously. I have a macmini pro where I run OpenFOAM and host dashboards I ask the LLMs to setup based on the CfdOF/FreeCAD dashboard. My best success has been using Fable5.1/Opus5.5/GPT6.1Sol (not sure if there is an overall best) and asking them to search for similar situations/examples and a lot of handholding. Is there a setup/available skill that anyone has been able to use ?


r/OpenFOAM • • 17d ago

Does rhoCentralFoam need normalized values?

2 Upvotes

I'm trying to make a modified version of the tutorial rhoCentralFoam/wedge15Ma5 case, but when I change the thermophysicalProperties and initial conditions to be no longer normalized, it refuses to run. I get the error

```--> FOAM FATAL IO ERROR: (openfoam-2512)

Entry 'e' not found in dictionary "system/fvSolution/solvers"```

despite the minimal changes. It isn't related to the timestep either, as dropping the timestep had no effect and encountered the same error. Does rhoCentralFoam not support regular SI values, or am I missing something I needed to change? This is in v2512.

My attempted conditions are T=300K, p=100,000Pa, U=650m/s.


r/OpenFOAM • • 19d ago

OpenFoam GUI project

37 Upvotes

This is an OpenFoam GUI I am working on. Most of it is AI-generated.

I'd be happy to receive your suggestions for improvements or ideas for additional features the GUI should include, since I'm considering publishing this small project on GitHub.

foamCaseGUI is a graphical interface that generates, runs and evaluates complete, ready-to-run OpenFOAM-14 cases, so no dictionaries have to be written by hand. It guides the user step by step from the geometry (any STL file or a template) through patches, meshing with snappyHexMesh or blockMesh, physics, boundary conditions and numerics to the solver run with live convergence monitoring. It is designed for a wide range of flow problems:

- Flow regimes: incompressible and compressible, steady and transient, laminar, RANS and LES flows.

- Heat: heat transfer.

- Multiphase: volume-of-fluid (VoF) and Euler–Euler multiphase flows.

- Viscosity models: Newtonian and non-Newtonian fluids, including custom temperature-dependent models.

Typical applications are internal flows in pipes, ducts, nozzles and manifolds as well as external aerodynamics, with NACA aerofoil templates and a one-click wind tunnel around arbitrary STL bodies.

The results page reports the key engineering quantities: pressure drop, flow distribution across multiple outlets, residence time, shear rates, viscosities, temperatures and force coefficients (lift, drag, moment). Mesh studies and dimensionless numbers help with analytical plausibility checks. This makes the tool well suited to setting up and comparing design variants quickly and reproducibly with consistent settings.


r/OpenFOAM • • 19d ago

Ansys or OpenFOAM ?

Thumbnail reddit.com
4 Upvotes

r/OpenFOAM • • 21d ago

I made an OpenFOAM → SU2 mesh converter that handles snappyHexMesh polyhedra (of2su2, pip install of2su2)

Thumbnail
reddit.com
4 Upvotes

r/OpenFOAM • • 23d ago

Stokes - A modern GUI with all meshing options

48 Upvotes

Stokes, an OpenFOAM GUI for Windows and Linux | Stokes

Hi all,

This was sitting in my folders for too long, few years back I made a custom pre/post processor for my previous employer with all bells and whistles namely

- blockMesh, snappyHexMesh, cfmesh and poly hexcore

- geometry import to results under single window

- Ubuntu, WSL and native Windows support

- support for remote cluster or local etc.

Recently got access to Claude and Deepseek which gave me the idea to revisit old stuff, rewrite most of it to remove any licensing issue and update it to support OpenFOAM 14.

This is my attempt at it. It's fully opensource and can be downloaded here. I intend to keep it free for personal and business use cases other than reselling etc as SaaS or something. So, haven't figured out exact licensing but that's a later problem as I don't intend to monetize and keep a gate on any features.

Give it a try here available for both Linus and Windows - dhanninacs/stokes-cfd: Stokes: a desktop CFD workbench on OpenFOAM. CAD in, results out, every action available as a tool call.

Haven't built full installers but using my other repo dhanninacs/foamWin: FoamWin brings OpenFOAM 14 to native Windows, with a PowerShell launcher, installer, and validated cavity examples. you should be able to run on Windows without the need for any installations etc. Of course, Linux version with installed OpenFoam 14 natively will be the fastest option (mostly tested on Ubuntu only)

I intend to add more features and add tool calls, skills and api in the background so you can completely use it with LLM's with minimal issues. My initial idea is to have an inbuilt local AI doing tool calls, let's see where that ends.

I know another AI slop but it was there in my githib private for too long and may as well release it for everyone.


r/OpenFOAM • • 22d ago

PhD in CFD and Data-Driven Methods / SciML!!

Thumbnail reddit.com
2 Upvotes

r/OpenFOAM • • 24d ago

Meshing OPENFOAM using a coplanar patch as a separate boundary.

Post image
1 Upvotes

r/OpenFOAM • • 29d ago

Has anyone tested the new GPU acceleration in OpenFOAM v2606 for large-scale CFD simulations?

Thumbnail reddit.com
7 Upvotes

r/OpenFOAM • • Nov 02 '26

Very high temperatures in a hypersonic OpenFOAM [v2512] simulation – how should I approach this?

5 Upvotes

Very high temperatures and low density in a hypersonic OpenFOAM simulation – what should I check?

Hi everyone,

I’m running a 2D simulation of an airfoil section under hypersonic re-entry conditions in OpenFOAM v2512. CFD isn’t something we do much at my workplace, so I’d appreciate some help understanding my results.

The case has a high Mach number and a relatively high angle of attack. I’m using rhoCentralFoam with a laminar model, a perfect gas with constant heat capacity, and a prescribed, spatially varying wall temperature.

The simulation didn’t crash, but during the initial part of the run I noticed that the maximum gas temperature became extremely high (19000 K), while pressure and density dropped to very low values in parts of the flow, particularly near the upper surface. I stopped the run early, so the flow had not yet reached a settled state.

Could these values be a consequence of the perfect-gas model and the strong expansion around the airfoil, or are they more likely to indicate a problem with the setup, mesh, boundary conditions, or initialisation?

What would you check first to distinguish a numerical or setup issue from behaviour that is expected under these modelling assumptions?

Thanks for any advice!