Setting up your environment this way avoids most errors on this page.
| Practice | What happens if you skip it |
|---|---|
| Install the prebuilt packages from the openfoam.org or openfoam.com repository instead of building from source. | A source build takes hours and leaves you to handle the compiler, MPI and make yourself. |
| Add the command that loads the environment script (for example . /opt/openfoam13/etc/bashrc) to ~/.bashrc. | Every new terminal reports blockMesh, simpleFoam and other commands as not found. |
| Copy a tutorial case to your own folder and run commands inside that case folder. | Running elsewhere fails with cannot find system/controlDict. |
| On Windows, keep cases in the WSL2 Linux file system (for example ~/), not under /mnt/c. | Cross-file-system access is slow and becomes the I/O bottleneck for large meshes. |
| Do not install the openfoam.org and openfoam.com distributions side by side. | Their environment scripts overwrite each other and commands point at different versions. |
Troubleshooting by error message
Find your exact error message. Each entry gives the cause, the fix, and what may come up after the fix.
Command 'blockMesh' not found, but can be installed with: sudo apt install openfoam
Cause: The OpenFOAM environment script has not been loaded in this terminal.
Fix: Run . /opt/openfoam13/etc/bashrc (use your installed version number) and add that line to ~/.bashrc.
What may come next: Do not follow the hint to run sudo apt install openfoam; it installs an older version from the Ubuntu archive that conflicts with yours.
Command 'blockMesh' not found (OpenFOAM installed on another drive or folder)
Cause: etc/bashrc hard-codes the install path, so after moving the install the script points to a folder that no longer exists.
Fix: Edit the install path variable in etc/bashrc to the actual folder and load it again.
What may come next: A source build that has been moved also has library paths baked in and usually needs recompiling.
--> FOAM FATAL ERROR: cannot find file "/home/user/system/controlDict"
Cause: The command was not run in a case folder, so OpenFOAM cannot find system/controlDict in the current directory.
Fix: cd into the case folder that contains system, constant and 0, then run blockMesh.
Windows Subsystem for Linux has no installed distributions.
Cause: WSL is enabled but no Linux distribution has been installed.
Fix: Run wsl --install -d Ubuntu-22.04 in PowerShell, then install OpenFOAM inside Ubuntu.
What may come next: Pick an Ubuntu version OpenFOAM supports; for other versions the repository may have no matching package.
The following packages have unmet dependencies: openfoam13
Cause: The Ubuntu universe repository is not enabled, so packages OpenFOAM needs are missing.
Fix: Run sudo apt-add-repository universe, then sudo apt update and install again.
What may come next: If unmet dependencies remain, your Ubuntu version is probably not supported.
E: Unable to fetch some archives
Cause: The network dropped while downloading packages, or the OpenFOAM repository is too slow to reach.
Fix: Run sudo apt update and retry; switch to a more stable network if it keeps failing.
Warning: Skipping acquire of configured file 'main/binary-amd64v3/Packages' (Ubuntu 26.04)
Cause: Ubuntu 26.04 also requests an amd64v3 package list, which the OpenFOAM repository does not provide.
Fix: As openfoam.org describes, add [arch=amd64] to the repository line, then run sudo apt update.
wmake: line 409: make: command not found
Cause: make and a compiler are missing when building OpenFOAM utilities or a custom solver.
Fix: Run sudo apt install build-essential to install make and gcc.
What may come next: After the compiler, custom code may still need flex, zlib and other development packages, one error at a time.
--> FOAM FATAL ERROR: exec(wmake, ...) failed (when using #codeStream)
Cause: #codeStream or codedFixedValue in the case compiles C++ at runtime, and no build tools are installed.
Fix: Install build-essential and rerun; if you only use prebuilt packages, switch to boundary conditions that need no compiling.
gcc: error: unrecognized command line option '--showme:link'
Cause: The system default MPI is not OpenMPI, while the OpenFOAM build scripts use OpenMPI options.
Fix: Run sudo update-alternatives --set mpi /usr/lib/openmpi/include to switch the default back to OpenMPI.
What may come next: Switching the default MPI affects other MPI software on the system, which may need rebuilding.
QStandardPaths: wrong permissions on runtime directory /run/user/1000/, 0755 instead of 0700
Cause: When running ParaView or other GUI programs in WSL, the runtime directory has the wrong permissions. It is only a warning.
Fix: Add chmod 0700 /run/user/1000 to ~/.bashrc.
Scientify is a cloud computer with research software installed and AI agents such as Codex and Claude Code built in. Describe what you need in one sentence, for example "use simpleFoam to compute the lift and drag coefficients of this airfoil at a 5 degree angle of attack", and the agent uses the preinstalled OpenFOAM to do the modeling and computation, with no software to install and no code to write.
Compared with installing more on your own computer, the cloud computer already has OpenFOAM, the official tutorial cases and ParaView, with no WSL or environment script to set up, and post-processing images can be rendered directly, and runs continue after you close your laptop.
The cloud computer comes with more computing power: CPU and GPU clusters can be called on demand for large-scale scientific computing. Compute is billed by the minutes you actually use, so nothing is wasted.
- Cloud computer
- 4 vCPU · 8 GB
- Top configuration, for data processing and small to medium jobs
- Callable GPU
- 96 GB VRAM
- Up to an RTX PRO 6000 per GPU; H800 80 GB and up to 8 × A10G also available
- Callable CPU
- 224 cores · 3 TB
- Largest spec, for large parallel computations
References
- openfoam.org: Ubuntu installation — Repository, environment script and common errors
- openfoam.org: Windows installation — WSL and runtime directory permissions
- CFD Online: blockMesh not found — Environment script not loaded
- CFD Online: cannot find controlDict — Not running inside the case folder
- CFD Online: wmake error for OpenFOAM 5 — Missing build tools
- CFD Online: wmake error with #codeStream — Runtime compiling needs build tools