It is possible to run OpenQBMM directly on computers executing Windows 10, on which the Windows Subsystem for Linux (WSL) has been installed. This guide will show you how to install WSL, and run OpenFOAM and OpenQBMM on it. Windows 10 Fall Creators Update or following is required to use this procedure.
Installing WSL on Windows 10
The following steps illustrate how to install the Windows Subsystem for Linux (WSL) on Windows 10 Falls Creators Update or newer. The procedure is slightly different from previous versions of WSL, because the possibility of using different distributions was added in this update. Each distribution can be obtained from the Microsoft Store.
- The first step consists in launching the tool to add extra features to Windows 10. This tool can be found by pressing Win + S, and typing “Features”. The menu will show the icon in the figure.
- In the tool, scroll down and select “Windows Subsystem for Linux”. Check the box, and click on OK.
- Soon after, Windows will confirm the installation was successful. A reboot is necessary to complete it.
- Once the system has rebooted, open the Microsoft Store app, which can be found pressing Win-S, and searching “store”.
- In the Microsoft Store app, search for Ubuntu, and select the Ubuntu app.
- Click on the “Install” button. After the installation is complete you should see the following screen, with the “Launch” button.
- Press the “Launch button”. A terminal will open, asking to wait for the installation to complete.
- When the installation is complete, the system will ask to insert a user name for the UNIX system, and the corresponding password. Select the user name you prefer, and specify a secure password.
- After the password is confirmed successfully, the terminal prompt will appear, indicating that WSL is working properly, as shown below.
- The installation can be tested by typing some commands like
df, which report the amount of free RAM and disc space, respectively.
Installing OpenFOAM on WSL – Ubuntu
The installation steps for OpenFOAM on Ubuntu are straightforward because the OpenFOAM Foundation provides packages for Ubuntu which can be directly used in WSL. The following steps summarize how to rapidly set OpenFOAM up on WSL.
- Open the Ubuntu bash terminal on Windows 10, and add the OpenFOAM repository and the corresponding signatures with the commands:
- Refresh the repository with the command:
sudo apt-get update
- Install OpenFOAM with:
sudo apt-get install openfoam5
- Add the configuration file for OpenFOAM to bashrc with the command:
echo "source /opt/openfoam5/etc/bashrc" >> .bashrc
- Source the user’s bashrc file with:
- Verify the functionality of OpenFOAM by invoking the command:
The installation steps for OpenQBMM are the the following:
- Create a directory called OpenQBMM
- Open a terminal in that directory
- Use the command
git clone https://github.com/OpenQBMM/OpenQBMM.git
- Optional: If the development version is desired, checkout the development branch:
git checkout -b development origin/development
- Build OpenQBMM by running the following command in the OpenQBMM directory:
This will create a working installation of OpenQBMM on Windows 10. Further details on using OpenFOAM with WSL can be found on the OpenFOAM Foundation website here.