|
[Sponsors] |
[OpenFOAM.com] Installing OpenFOAM on secondary drive |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 21, 2020, 18:37 |
Installing OpenFOAM on secondary drive
|
#1 |
New Member
Join Date: Jun 2020
Posts: 4
Rep Power: 6 |
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: sudo apt install openFOAM. 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 sudo chown -R mnt/f/OpenFOAM Code:
echo "source /mnt/f/OpenFOAM/OpenFOAM/OpenFOAM-v1912/etc/bashrc" >> ~/.bashrc source ~/.bashrc Thanks. |
|
June 21, 2020, 20:49 |
|
#2 |
New Member
Tu Can
Join Date: Jul 2017
Location: China
Posts: 16
Rep Power: 9 |
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 index 7e7423522..383dde079 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -44,7 +44,7 @@ export WM_PROJECT_VERSION=dev # [ "$BASH" -o "$ZSH_NAME" ] && \ export FOAM_INST_DIR=$(cd $(dirname ${BASH_SOURCE:-$0})/../.. && pwd -P) || \ -export FOAM_INST_DIR=$HOME/$WM_PROJECT +export FOAM_INST_DIR=$HOME/opt/$WM_PROJECT # export FOAM_INST_DIR=~$WM_PROJECT # export FOAM_INST_DIR=/opt/$WM_PROJECT # export FOAM_INST_DIR=/usr/local/$WM_PROJECT @@ -105,7 +105,7 @@ export FOAM_SIGFPE= # The old dirs to be cleaned from the environment variables foamOldDirs="$WM_PROJECT_DIR $WM_THIRD_PARTY_DIR \ - $HOME/$WM_PROJECT/$USER $FOAM_USER_APPBIN $FOAM_USER_LIBBIN \ + $HOME/opt/$WM_PROJECT/$USER $FOAM_USER_APPBIN $FOAM_USER_LIBBIN \ $WM_PROJECT_SITE $FOAM_SITE_APPBIN $FOAM_SITE_LIBBIN" # Location of installation @@ -149,7 +149,8 @@ fi # Location of user files # ~~~~~~~~~~~~~~~~~~~~~~ -export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION +export WM_PROJECT_USER_DIR=$HOME/opt/$WM_PROJECT/$USER-$WM_PROJECT_VERSION +source $FOAM_INST_DIR/my_environment/$USER-$WM_PROJECT_VERSION # Source initialization functions # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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 +export WM_PROJECT_USER_DIR=$HOME/opt/$WM_PROJECT/$USER-$WM_PROJECT_VERSION Code:
export WM_PROJECT_USER_DIR=$HOME/Documents/openfoam/$USER-$WM_PROJECT_VERSION export WM_PROJECT_USER_CODE_DIR=$HOME/Documents/code/C/openfoam/$USER-$WM_PROJECT_VERSION #------------------------------------------------------------------------------- export FOAM_USER_SRC=$WM_PROJECT_USER_CODE_DIR/src; #------------------------------------------------------------------------------- export FOAM_USER_APP=$WM_PROJECT_USER_CODE_DIR/applications; export FOAM_USER_SOLVERS=$WM_PROJECT_USER_CODE_DIR/applications/solvers; export FOAM_USER_UTILITIES=$WM_PROJECT_USER_CODE_DIR/applications/utilities; #------------------------------------------------------------------------------- export FOAM_USER_TUTORIALS=$WM_PROJECT_USER_DIR/run/tutorials alias msrc='cd $FOAM_USER_SRC' #------------------------------------------------------------------------------- alias mapp='cd $FOAM_USER_APP' alias msol='cd $FOAM_USER_SOLVERS' alias mutil='cd $FOAM_USER_UTILITIES' #------------------------------------------------------------------------------- alias mtut='cd $FOAM_USER_TUTORIALS' alias mappb='cd $FOAM_USER_APPBIN' alias mlibb='cd $FOAM_USER_LIBBIN' |
|
June 23, 2020, 00:10 |
|
#3 |
New Member
Join Date: Jun 2020
Posts: 4
Rep Power: 6 |
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. |
|
June 25, 2020, 02:18 |
|
#4 | |
New Member
Join Date: May 2020
Posts: 21
Rep Power: 6 |
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. |
||
June 25, 2020, 05:04 |
|
#5 |
New Member
Join Date: May 2020
Posts: 21
Rep Power: 6 |
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! |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.com] Installing OpenFOAM on secondary drive | CronusX | OpenFOAM Installation | 0 | June 21, 2020 16:14 |
OpenFOAM course for beginners | Jibran | OpenFOAM Announcements from Other Sources | 2 | November 4, 2019 08:51 |
[Other] Basic questions about OpenFOAM cluster running and installing | Fauster | OpenFOAM Installation | 0 | May 25, 2018 15:00 |
OpenFOAM Training Jan-Jul 2017, Virtual, London, Houston, Berlin | CFDFoundation | OpenFOAM Announcements from Other Sources | 0 | January 4, 2017 06:15 |
OpenFOAM Training Jan-Apr 2017, Virtual, London, Houston, Berlin | cfd.direct | OpenFOAM Announcements from Other Sources | 0 | September 21, 2016 11:50 |