OpenFOAM installation on mac

OpenFOAM (OF) is installed through Docker. This went fine, but there were display problems on Mac when trying to run parafoam.

This was remedied as follows:

  1. Install XQuartz
  2. In XQuartz preferences –> security –> check the box to allow connections from network clients. Then restart XQuartz.
  3. Install and start Docker.
  4. run the script installMacOpenFOAM , which is slightly edited from the version on the OF website (added the line with DISPLAY)
  5. Now, to start OF run the script startMacOpenFOAM , which is slightly edited from the version on the OF website (added the line with xhost). This is the only step needed on subsequent running of OF.

Alternatively (but not conveniently), you can copy files from the docker container to your host (computer running docker).

  • Run command docker ps to get the container id: something like 9a3e2c3d6cd7
  • Then run command docker cp 9a3e2c3d6cd7:/home/ofuser/case_dir localPath
  • Then in the case directory put an empty file called foam.foam.
  • Then in a regular paraview installation you can open file foam.foam.