2

I am trying to install openFoam on Mac OS X 10.10.5 (http://www.openfoam.com/download/install-binary.php) by using Docker-toolbox. I can do without problems all the suggested steps, but then, when I try to run the example included in the installation guide, I cannot open paraFoam, since it returns the following error:

paraview: cannot connect to X server

I have also installed XQuartz but it doesn't seem to help much!

Marco
  • 45
  • 1
  • 4

1 Answers1

4

Why don't you get the latest paraview from Kitware. It has a native OpenFOAM reader built-in, which I always use. The only thing you have to do, instead of calling

paraFoam

is to create an empty file with a foam extension. Like so:

touch foo.foam

Then you can run start paraview like any other mac application, browse to to the respective case-directory and "open" the empty foo.foam file:

paraview foo.foam

If you would like to use a command similar to paraFoam or paraview in the command line, then use your command line to change into the Paraview.app and find paraview, which is the actual executable. Create a symbolic link pointing to that executable. I do the same, since I like to use the latest paraview instead of the one provided with OpenFOAM.

jhoepken
  • 1,842
  • 3
  • 17
  • 24
  • Hi, thank you for the reply. I tried to do what you suggested, but when I try to open the empty file on the terminal it tells me either command not found or cannot connect to X server again. About the last lines you wrote, could you please explain it again? I'm sorry, I'm not very practical with all these stuff! – Marco Mar 16 '16 at 14:15
  • Have you tried to do execute the downloaded `Paraview.app` and open the `foo.foam` file, that you have created using the `touch` command? – jhoepken Mar 16 '16 at 15:32
  • Ah ok sorry, now I got it, and it actually works! One last question if you don't mind: so, if I understood correctly, every time I'm working with openFoam I can create the file from the terminal and then open it directly from the folder with Paraview, but touch creates an empty file, is then this file automatically modified when I do the blockMesh? Thank you again – Marco Mar 16 '16 at 17:04
  • This file is only used to "trick" paraview into opening an OpenFOAM case, which is a directory and not a single file. Paraview itself cannot open a directory and needs a file. For this purpose the empty `.foam` file is created. This file stays empty and is not touched. `blockMesh` does not touch it, it only changes the contents of `constant/polyMesh`. Welcome to Stackoverflow btw ;). – jhoepken Mar 16 '16 at 17:08
  • Well, I can open parafoam now as you told me, but I'm now trying to understand how to use it when programming, so how to make it show the geometry I wrote in the blockMeshDict document. It has been a steep learning curve for both terminal stuffs and openFoam itself! – Marco Mar 17 '16 at 10:28
  • Well, OpenFOAM in general has a very steep lerning curve. This is due to the lack of of documentation and the complexity of the field. Maybe [OpenFOAM Primer](http://www.sourceflux.de/book) helps, it's a book on OpenFOAM. As you are new to Stackoverflow, have a look at [this page](http://stackoverflow.com/help/someone-answers) :). – jhoepken Mar 17 '16 at 10:36
  • You have read the user's guide, haven't you? The tutorial on `blockMesh`, that's in there is quite useful, actually. Don't start with the hole in the plate thing, but with something with the cavity. – jhoepken Mar 17 '16 at 10:45