r/CFD • • Oct 22 '26 • Bravo 2 Heartwarming 2

Made an open source gui for openFOAM

So iv been working on this project for a couple of months, I wanted to show it because I finally believe it is a bit presentable now, it is basically a gui with openFOAM, and additionally I added TENO schemes from Fu et al, I thought it was an interesting paper and I wanted to add higher order schemes to achieve higher accuracy (note that I also like swirly lines), going through this project I will be extending it to Ji, Liang & Fu 2021 for unstructured meshes when I have the time. Since most of the coding in this project is human slop, apologies in advance for any bugs that may arise (I lost sleep because of segfaults in cpp)

Source code: https://github.com/CakeCFD/cake-studio

Website: https://cakecfd.org/

I would like opinions from fellow engineers on how to improve this further and make this better, or more specifically what validation case would you trust before using the TENO schemes?

655 Upvotes

39 comments sorted by

44

u/_padla_ Oct 22 '26

I see several ways to develop this project further.

  1. Add support for cfmesh mesher (the earlier versions are open-source and free).
  2. Add support for importing meshes from different formats.
  3. Add the templates, so that solvers/models which are not implemented in your code could be implemented by a user without messing with your source code.

As for TENO schemes, I would test them as any other scheme: shocktube, wedge, backward step, Poiselle's flow...

7

u/trigodil Oct 22 '26

Interesting, I will work towards these.

4

u/Ultravis66 Oct 22 '26 edited Oct 23 '26

so, I have been trying to get CFMesh working with OpenFoam 13 for a while and found tons of thing wrong with it... I got it working with AI assist to find the issues and fix it, but even still... Its not up to my standard for a mesher.

My end goal is as close to a commercial style meshing tool; I am still working on it 8 months later and after 1500 hours of my personal time.

2

u/trigodil Oct 23 '26 edited Oct 23 '26

Good luck with that mate, ESI's v2412 (openfoam.com), is where cfMesh is better maintained, so I haven't hit those issues myself. Right now I only drive blockMesh and snappyHexMesh, but adding cfMesh as a second meshing backend is something ive certainly thought about, what does your tool do that stock cfMesh doesn't? I would love to hear more

5

u/Ultravis66 Oct 23 '26 edited Oct 23 '26

When I first ported CFMesh and fixed all of the api issues to get it working with OF12 and 13 (the abandoned version), I couldnt even get it to mesh anything. There were inverted cells, all kinds of protrusions and crumpling of the geometry. Boundary layer failures. Failing most of the checkMesh flags.

I have it all documented:

CategoryOriginal problem
Inverted cellsNegative-volume cells, inverted boundary faces, and incorrectly oriented face pyramids.
Surface protrusionsMesh vertices and faces projecting outside the STL geometry.
Crumpled surfacesSurface folds, pinching, overlapping faces, and badly stretched elements.
Surface snappingVertices failing to snap to the CAD/STL surface.
Feature preservationSharp corners and edges rounded off, displaced, or incorrectly detected.
Boundary intersectionsSevere deformation where blades, hub, shroud, inlet, outlet, and periodic patches meet.
Boundary-layer generationCollapsed, inverted, intersecting, and highly skewed prism/layer cells.
Boundary-layer coverageMissing or prematurely terminated layers, especially near corners and interfaces.
Face orientationReversed normals, inverted boundary pyramids, and incorrect face ordering.
Cell topologyOpen cells, nonmanifold connections, and cells sharing multiple faces.
Cell qualityExtreme skewness, non-orthogonality, concavity, and poor volume ratios.
Surface mappingFailed projections, unstable vertex movements, and incorrect patch assignments.
Optimizer instabilityGeometry optimization making previously acceptable cells worse.
Infinite loops and hangsUntangling, octree traversal, edge extraction, and geometry-search routines failing to terminate.
Runtime crashesFloating-point exceptions, invalid geometric calculations, and memory failures.
Numerical robustnessDivision by zero, uninitialized coordinates, and degenerate geometry calculations.

here is a list of things, form my documentation:

May 2026 Basic meshes crashing or hanging; inversion, surface corruption, broken boundary layers

June 2026 Completing increasingly complex Rotor37 meshes; small numbers of residual quality failures; much better BL coverage

July 2026 Tackling boundary-contact defects, topology consistency, surface repair, and robust layer construction

August 2026 Developing guarded geometric repairs, rollback mechanisms, and more systematic mesh-quality validation

September 2026 Stable Rotor37 checkpoint with zero negative-volume cells and zero faces at non-orthogonality ≥90°, although skewness issues remained

October 2026 Focusing on geometric fidelity, difficult corner/seam constraints, determinant safeguards, and repeatable repair acceptance

Every night for the last few months, I would have the bots ($20/month subs to claude and GPT) write me scripts to run the mesher over and over and over trying different things and break the mesher, then fix the problems as they arise.

You can find it here: https://github.com/Ultravis66/cfMesh-OpenFOAM13

The unreleased version I am working on; I basically built a controller that tries to prevent "failed" elements from being built ahead of time. It has many recovery levels... I am still working on it every day when I have time. I am trying to essintially build a "smart controller".

I tried building my own mesher a long time ago before LLM's (the bots) were a thing, but it was extraordinarily hard. I managed to get tet meshing and structured hex meshing working, but when I got into boundary layer generation, I gave up... it was way too hard for a single person to do.

→ More replies (1)

44

u/Bluefury Oct 22 '26

Even if it were slop I'd take human over artificial slop because at least I know real time went into this. And bugs can be fixed without using a prompt. (I say after just making a pile of my own slop).

18

u/trigodil Oct 22 '26

Yeah i would say I stayed up late a couple of weeks working on this, couldn't stop once I started curiously.

4

u/B7r0n22 Oct 23 '26

Thank you for the hard work you put into this! I truly appreciate having an opensource gui for Open-foam but i've come across an issue- im currently trying to install it on a Mac running a VM of Ubuntu but for some reason it just wont compile no matter how many times I try :/ . Im on the ARM M4 chip if that's of any concern?

4

u/trigodil Oct 23 '26

The build currently has some x86_64 library paths hard coded, so it breaks on ARM64 Ubuntu, I will build ARM support soon, oversight on my part.

4

u/Pioneer_11 Oct 23 '26

This is awesome.

Out of curiosity though why the fairly old stack. QT5 rather than QT6, X11 rather than wayland and OpenFOAM 24.06 rather than 26.06? has this been a work in progress for a long time?

1

u/trigodil Oct 23 '26

Fairly long, yes I stuck to what Ubuntu 24.04 ships so it installs without building anything from source, so its VTK is tied to Qt5 and X11. Also, it's built in OpenFOAM v2412, I didn't care to update it since I was working on the features.

1

u/cumminsrover 28d ago

I got everything to build on Ubuntu 24.04, and modded to build and load the GUI on 26.04, but I do get crashes that I have yet to debug (or even look at the errors).

It would be helpful if you would kindly include your examples on GitHub please. I have very limited experience with OpenFOAM.

I did get a test case with a NACA 0012 section to run, but I haven't figured out how to get your pretty output graphics to shoot up yet 😂

Maybe I need to build the AI connector, but I have to figure that out with a local LLM.

Anyways, I do appreciate your work here, it's going to be great with a bit more polishing! Hopefully you can get some help with it. I am not a programmer so I won't be off much help.

Thank you!

1

u/trigodil 28d ago

There should be a button called "iso", "flow", "particles" etc did you happen to enable those?

→ More replies (1)

3

u/LettuceBeHappy3 Oct 23 '26

Here is a website that is easier to use, at least for myself a complete noob. If you are looking for ways to improve yours, you could check out the features it has. https://yovaraj-collab.github.io/WindTunnel/

Id be interested in how the two compare, if one produces better results than the other.

3

u/trigodil Oct 23 '26

Interesting, il check it out

2

u/mechanicalroll13 Oct 24 '26

Wow this seems sick I'll check it later. Sorry if this is in the documentation, I didn't have much time these days, but does this allow running the simulation with the gpu? With the normal openFoam I've been using brae for simulations because my cpu is fairly old and slow compared to my gpu.

4

u/trigodil Oct 25 '26

Yes it does support gpu, the Vram usage can be modified as well

19

u/Happy_Chief Oct 22 '26

Where was this during my masters 😭

12

u/Kevin_0429 Oct 23 '26

As a newbie to openfoam, ot was a veryyy steep learning curve, i couldn't get a hold of the complete workflow. This is literally godsend

4

u/start3ch Oct 23 '26

Nice! This looks better than the openscad plugin, which was the best GUI I’d found for openfoam

1

u/LeptonWrangler Oct 23 '26

finally!!

Please do fenics and SU2 next!

Featool multiphysics is essentially charging a boatload of cash for a mediocre GUI for a solver they didnt create and seemingly pass none of the money back to the developers they are standing on the shoulders of

1

u/trigodil Oct 23 '26 edited Oct 23 '26

I do not think there is much juice left in me to port to these.

→ More replies (1)

1

u/0blivion09 Oct 23 '26

How do we go from a regular GUI user with a basic CFD skills to someone like you ? any road map or ressources

1

u/trigodil Oct 23 '26

Just a whole lot of experience and learning, I'm still learning too, about new numerical methods, I would suggest dropping the GUI and run OpenFOAM from the terminal, write a 1D finite volume solver in Python, then learn enough C++ to read OpenFOAM’s source. Moukalled’s “The Finite Volume Method in CFD” plus Fluid Mechanics 101 on YouTube cover most of it.

2

u/NSADataBot Oct 25 '26

Very cool, good job!

2

u/Comfortable_Ad_2041 Oct 26 '26

Wow, this Is great.😯

2

u/alinapetrei 29d ago

Don't worry about bugs. No one expects the first variant to be bug free.

Even commercial software (e.g. Ansys Icepak) have bugs :)

1

u/House13Games Oct 23 '26

3.6. Not great, not terrible.

44

u/Big_Lope Oct 22 '26

Hey it’s not slop if you coded it! That’s spaghetti code, slop is reserved for cuck coders.

10

u/trigodil Oct 22 '26

Pretty much, the references and pointers are messy in the current state

1

u/[deleted] 23d ago

[removed] — view removed comment

1

u/AutoModerator 23d ago

Automoderator detected account_age <5 days, red alert /u/overunderrated

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.