OpenFoam is the reference open source software for Computational Fluid Dynamics (CFD) simulations. Although primarily used for fluid simulations, it also features solvers for all kinds of physical phenomena. Running your OpenFoam simulation on Qarnot is as simple as uploading your case and running a script. Here is an overview of the different steps.
If needed, you can easily integrate your own libraries into the Openfoam version available on Qarnot. Contact our teams at support-compute@qarnot-computing.com to learn more.
The Openfoam versions available on Qarnot are available via the catalog.
If you are interested in another version, please send us an email at support-compute@qarnot-computing.com.
To launch a task with a button click from our web interface, you can use this step-by-step tutorial. If needed, here is a test case motorbike.
To do this, the prerequisites are:
The following examples will show you in detail how to launch a task using a Python script.
This test case will show you how to launch a simulation of the classic Motorbike case. It is based on the tutorial simulation of a motorcycle. It contains the elements for meshing and the case configuration files.
Once the file is downloaded, you can decompress it and place it in your working directory, at the same level as the launch scripts below.
Once everything is configured, use the script run_openfoam.py below to launch a minimalist computation on Qarnot. If you want to explore more advanced options, the next scripts ("Batch Launch" and "SSH Launch") will surely interest you more.
To launch these scripts, simply copy the preceding code into a Python script, place it at the same level as the motorbike/ folder, and then execute, in your terminal:
python3 run_openfoam.py
The structure of your files should look like this:
├─ motorbike/
├─ run_openfoam.py
Make sure you have copied your authentication token into the script (in place of <QARNOT_TOKEN>) so you can launch the task on Qarnot. Retrieve it here.
For example, your input data will appear in the web interface as:

The script presented below allows you to explore the more advanced features of the platform for a batch launch.
The script presented below allows you to connect to your container using the SSH protocol.
To launch it, simply copy the preceding code into a Python script, place it at the same level as the motorbike/ folder, and define your SSH key in the DOCKER_SSH parameters.
Also make sure you have copied your authentication token into the script (in place of "QARNOT_TOKEN") so you can launch the task on Qarnot.
Then execute the following command in your terminal:
python3 run_openfoam_ssh.py
You should now be able to connect to the host by following the information displayed in your console. Your test case is available in /share. Go to the /share directory (by doing cd ../share) and you can execute your test case by doing ./Allrun.
In the future, if you want to launch your own cases and want to configure your /Allrun to optimize your Openfoam simulation at Qarnot, the use case downloaded above thus gives an example of the parameters to configure. More specifically, the following lines of code allow you to define the number of domains based on the number of cores available on your instances at Qarnot:
NB_PROCESS=$(($SETUP_CLUSTER_NB_SLOTS*$INSTANCE_COUNT))
sed -i "s/numberOfSubdomains.\*/numberOfSubdomains ${NB_PROCESS};/" system/decomposeParDict.6
You can monitor the status of your task on the general web interface at any time.

You should now have a motorbike-out folder in your working directory on your computer and/or a motorbike-out bucket on the HPC platform containing all the output files.

You can visualize certain images and log files generated by the simulation directly on the HPC platform, which are located in your output bucket. Your results will be stored in the motorbike-out bucket and can be retrieved in three ways:
For a large quantity of files or more than 5GB of data, it is advisable to use rclone (linux) or cyberduck (windows). These are two opensource S3 bucket management applications.
For more information on Openfoam, you can consult the Openfoam user manual. Also, do not hesitate to contact us for an onboarding and a more personalized presentation of our services via: support-compute@qarnot-computing.com.