When working with OpenFOAM on Linux - especially after restaging your system or buying a new laptop, you might run into version compatibility issues with Paraview. OpenFOAM often comes bundled with an older version of Paraview, which may not run smoothly or support the latest features you need. In this article, I’ll will help you resolve these issues by linking the latest version of Paraview to your environment variables and ensuring compatibility across all installed versions of OpenFOAM. Cutting all the fluff let’s dive right into it.
To begin, you’ll need to download the latest pre-compiled version of Paraview. This ensures you’re working with the most up-to-date and feature-rich version.
Before installing the new version, it’s important to remove the old version of Paraview that came with your OpenFOAM installation (say you have v5.10). This avoids any conflicts that might arise from having multiple versions.
sudo apt-get remove paraviewopenfoam510
If you have any other versions of Paraview installed, make sure to remove them as well to prevent any version conflicts.
Next, move the downloaded Paraview version to the directory, which is a common location for optional software packages.
sudo cp -r ParaView-5.13.0-MPI-Linux-Python3.10-x86_64 /opt/
To make future references easier, rename the Paraview directory to something simpler.
sudo mv /opt/ParaView-5.13.0-MPI-Linux-Python3.10-x86_64/ /opt/ParaView-5.13/
~/.bashrc
file:export PATH=$PATH:/opt/ParaView-5.13/bin/
~/.bashrc
, run source ~/.bashrc
to update your terminal session.To ensure that your system points to the correct version of Paraview, you’ll need to create new symbolic links.
sudo rm /usr/bin/paraview sudo rm -r /usr/lib/paraview-*
sudo ln -s /opt/ParaView-5.13/bin/paraview /usr/bin/paraview; sudo ln -s /opt/ParaView-5.13/lib/paraview-5.13/ /usr/lib/paraview-5.13
For a smoother experience, you can create a desktop entry for Paraview, allowing you to launch it easily from your application menu.
sudo gedit /usr/share/applications/paraview.desktop
In the file you just created, add the following content to set up Paraview as an application on your system:
[Desktop Entry]
Version=1.0
Name=ParaView 5.13
Exec=paraview
Terminal=false
Icon=/opt/ParaView-5.13/share/icons/hicolor/96x96/apps/paraview.png Type=Application
x-Ayatana-Desktop-Shortcuts=NewWindow
[NewWindow Shortcut Group]
Name=New Window
Exec=paraview
TargetEnvironment=Unity
Now, Paraview should be easily accessible from your application menu, but also you can launch it from any local destination in your terminal. By following the above steps, you’ll have the latest version of Paraview integrated with OpenFOAM - make sure you don’t ignore any error and try to resolve all steps.
Happy simulating!