Tuesday, June 25, 2024

Fixing "command not found" errors during OpenFOAM 11 installation on WSL

 I am trying to install the OpenFOAM 11 version of thew software on my Windows server 22 OS through WSL. I followed the documentation based on the 4 steps mentioned here.

https://openfoam.org/download/source...g-environment/

While sourcing the bashrc file through my $HOME directory, I am getting the following errors as shown in the image attached. Do I need to make any changes in the User editable portion of the bashrc script?


The errors you're encountering, "command not found," indicate that the shell cannot locate the foamSource and foamParams commands. This typically happens when the source path in your .bashrc file isn't set correctly.

Here's how to troubleshoot the issue:

 * Verify source path:

   * Open the .bashrc file in your WSL $HOME directory (e.g., using nano or vi editor).

   * Look for lines containing source or .. These lines should specify the path to the OpenFOAM environment setup script.

   * Ensure the path points to the correct location of the script within your WSL installation.

 * Check environment variables:

   * Some OpenFOAM functionalities rely on environment variables specific to the Linux environment.

   * Consult the OpenFOAM documentation for any required environment variables and set them accordingly in your WSL terminal using the export command (e.g., export WM_PROJECT_DIR=/path/to/openfoam).

No comments:

Post a Comment

Popular posts