Installing OpenFOAM on secondary drive
I'm installing OpenFOAM via Ubuntu Bash for Windows.
Instead of installing OpenFOAM on the C: drive, I want to install it on my F: drive (secondary hard drive). I thought I was manipulating the instructions on openFOAM's website properly, but evidently now because when I try to do the test of the cravity tutorial I get the error. Code:
Command 'blockMesh' not found, but can be installed with: Copied .tgz to bash-environment f drive folder OpenFOAM Code:
cp -ar /mnt/c/Users/<USER>/Downloads/OpenFOAM-v1912-windows10.tgz /mnt/f/OpenFOAM Code:
sudo tar -xvzf OpenFOAM-v1912-windows10.tgz -C /mnt/e/OpenFOAM Code:
echo "source /mnt/f/OpenFOAM/OpenFOAM/OpenFOAM-v1912/etc/bashrc" >> ~/.bashrc Thanks. |
that's a shortcoming of OpenFOAM. not easy to change install path.
cause it's install path is written down in script as environment variable. here is my step(first step already change install path. Second step could change path which OpenFOAM used to generate file and something else.): 1. replace "$HOME" with "$path/to/where/I/want" in etc/bashrc. here is my change log. (Just look the line start with "+" and "-") Code:
diff --git a/etc/bashrc b/etc/bashrc Code:
source $FOAM_INST_DIR/my_environment/$USER-$WM_PROJECT_VERSION in my PC, it is Code:
source home/user/opt/my_environment/user-dev Code:
-export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION Code:
export WM_PROJECT_USER_DIR=$HOME/Documents/openfoam/$USER-$WM_PROJECT_VERSION |
Thanks, bestucan.
It was actually much easier than that. I pointed the install at the secondary drive, but my main bashrc was wrong. After making the adjustments and having that grab the source from my secondary drive, the program works fine. Thanks for the suggestion though. |
Quote:
I run Windows 10 with WSL enabled and have Ubuntu installed via the MS Store. After untarring the .tar file on the secondary drive, I did change the default location on the bashrc file to: source /mnt/h/OF/OpenFOAM/OpenFOAM-v1912/etc/bashrc (OF is the folder containing the OpenFOAM untarred) I get an error message when I run 'blockMesh' command: command 'blockMesh' not found, but can be installed with: sudo apt install openfoam Please help. |
Looks like I fixed my issue by myself too. I had forgotten to use "chown" command, and I fixed the location of my bashrc file back into the 'etc' folder.
Then it worked! |
All times are GMT -4. The time now is 15:37. |