Thursday, July 28, 2016

OpenFOAM on Domain Computer

Problem: OpenFOAM does not work linux machine added to a Windows domain.  When you source OpenFOAM bashrc file, it overwrites the PATH so no terminal commands are recognized (ls, sudo, etc.)

Solution:
cd /opt/openfoam4/etc (or whichever version is installed)

sudo vim bashrc

comment line 153:
# cleaned=`$foamClean "$PATH" "$foamOldDirs"` && PATH="$cleaned"

save and quit (:wq)

For some reason, this line destroys the path when the machine is on the domain.  This is not a problem for machines not on a domain.


*NOTE: for zsh shell, there may be an error stating that "-t" flag is not recognized, if so:

sudo vim config.sh/aliases

delete the "-t" from line 73

the line should read:
[ "$(type wmRefresh)" = "alias" ] && unalias wmRefresh || unset wmRefresh

No comments: