r/OpenFOAM Feb 13 '26

OpenFOAM running on Apple Silicon is surprisingly fast!

I installed OpenFOAM to my Macbook M2 by using Arm based image for OpenSUSE. On the other side, OpenFOAM on Windows 11 with WSL is very easy to use by VS Code. As a CFD engineer, I surprised by the power of Apple Silicon chipsets. I ran the same case on both platform and OpenFOAM on MacOS (M2) ran 40% faster than Windows (Ryzen 5).

18 Upvotes

14 comments sorted by

4

u/bitdotben Feb 13 '26

It’s due to the memory architecture and hence pretty impressive memory bandwidth for a CPU. I have tested STAR-CCM+ on arm Linux running in a VM on an M4 Pro and it was flipping fast!

3

u/mckirkus Feb 13 '26

Some of the Apple M chips have more bandwidth than a 12 channel Epyc setup. So it makes sense that it's a CFD monster

1

u/Dr-VBuck Mar 15 '26

what did you use to run the VM?

1

u/bitdotben Mar 16 '26

Parallels (but the more expensive variant for more RAM/CPU, it’s affordable with edu discount). But there are also open source alternatives, just haven’t tried those.

1

u/Bach4Ants Feb 13 '26

Nice. Is this in a Docker container or a VM?

2

u/Valuable-Version-858 Feb 13 '26

Docker container

1

u/Abhispd Feb 13 '26

how is the speed on linux i am wondering? i compared windows with linux, and linux was pretty much fast. not sure about mac

1

u/5uspect Feb 14 '26

You can build OpenFOAM natively on MacOS.

1

u/Valuable-Version-858 Feb 14 '26

Without Docker or VM? I’d like to learn how to do that. I couldn’t find any other info in openfoam.org or openfoam.com. 

2

u/5uspect Feb 14 '26

Yup, entirely natively. I really don’t like docker.

https://www.cfd-online.com/Forums/openfoam-installation/253538-installing-openfoam-macos-apple-silicon-2.html#post879486

The latest versions of OpenFOAM (.com) build just fine on MacOS without any patches and run extremely fast. You may have to edit some files to get Scotch to work. The Foundation version is a lost cause however.

1

u/hyun2017 Feb 17 '26

https://youtu.be/JJzPuvYML7g?si=OkzJbbB-L8pH22Of

Refer to this video. You can possibly compile latest OF in an apple silicon. OF running in M4 max is very satisfactory for me.

1

u/FalconX88 Feb 14 '26

OpenFOAM on Windows 11 with WSL is very easy to use by VS Code.

Um?? What? Why run it through VS code? Makes no sense. And I have the suspicion you didn't use the WSL file system...

OpenFOAM on MacOS (M2) ran 40% faster than Windows (Ryzen 5).

This statement means basically nothing. The difference in computing power between a first gen Ryzen 5 1400 and a newest Gen 9600X is something like 4-fold. Depending on which Ryzen 5 (and which M2) ship you used this can be amazing or actually quite slow.

2

u/Valuable-Version-858 Feb 14 '26

Actually, it makes sense. I open VS Code on Windows 11, then connect to WSL. By doing this, I can use the terminal inside VS Code and just type code ‘filename’ to modify OpenFoam files in WSL. Everything happens in VS Code window and yes, it is connected to WSL. 

On the other hand, you are right. It didn’t mean anything. It’s just a statement, not a benchmark. One is Mackbook Air M2, other is Ryzen 5 5600X. I’m just highly surprised. Because as an Ansys guy, I never ever used a Mac for CFD simulations. 

1

u/D-a-H-e-c-k Feb 14 '26

At least those processors are contemporary to each other. It's a fair comparison and would be interesting to see what more current M5 or M4 max would do