OpenFOAM: Difference between revisions

From LWP-Wiki
Jump to navigation Jump to search
(Created page with "OpenFOAM cnd this can cause conflicts with extensions and/or versions. The people creating the foam extensions are aware of this thankfully and have made it so that you can in...")
 
No edit summary
 
(18 intermediate revisions by one other user not shown)
Line 1: Line 1:
OpenFOAM cnd this can cause conflicts with extensions and/or versions. The people creating the foam extensions are aware of this thankfully and have made it so that you can install the extensions into your own home directory without requiring elevated privileges. This way multiple users on the same system can use their own versions and extensions. I've just verified that it works, with an unprivileged account, on your system. I've added the actual commands I've used for the installation below, which are pretty much the instructions from the links you've sent. Compilation of the extensions will take some time. Run the following commands to make it happen.
[[Category:software-faq]]


Both openFOAM repositories (org & com) are available on the LWP. Instructions on how to install packages on the LWP can be found [[install packages| here]]. Students do not have permission to install software, because the PCs in the computer rooms need to diverge as little as possible, but you can send us a request to install it on your system, by using the "support request" icon on the desktop or selecting it from the menu. 


# apt install openfoam2112 openfoam2112-dev gfortran-10
Since there are quite a few versions of openFOAM(com/org) and it's extensions floating around, installing a version on a system can cause conflicts for other users on that system. Thankfully it's possible to install a version or extensions into your own home directory without requiring elevated privileges. This way multiple users on the same system can use their own versions and extensions. Compilation of some of these will take some time. 


# First set up the requirements for openFOAM:
The FOAM extensions described here have been verified to work for unprivileged users.
cd ~
mkdir foam
cd foam
curl https://www.paraview.org/paraview-downloads/download.php\?submit=Download\&version=v5.10\&type=binary\&os=Linux\&downloadFile=ParaView-5.10.1-MPI-Linux-Python3.9-x86_64.tar.gz -o ParaView-5.10.1-MPI-Linux-Python3.9-x86_64.tar.gz
tar xzf ParaView-5.10.1-MPI-Linux-Python3.9-x86_64.tar.gz
echo "export PATH=~/foam/ParaView-5.10.1-MPI-Linux-Python3.9-x86_64/bin:$PATH" >> ~/.bashrc
echo "source /usr/lib/openfoam/openfoam2112/etc/bashrc" >> ~/.bashrc
source ~/.bashrc
openfoam2112
exit


# Installing foam-extend-4.1:
'''Install (''or request we install if you login with a S#'') the following packages on your system''':
cd ~
$ sudo apt install openfoam2112 openfoam2112-dev
mkdir foam
cd foam
git clone git://git.code.sf.net/p/foam-extend/foam-extend-4.1
cd ~/foam/foam-extend-4.1
source etc/bashrc
echo "alias fe41='. ~/foam/foam-extend-4.1/etc/bashrc'" >> ~/.bashrc
source ~/.bashrc
./Allwmake.firstInstall -j8


# Installing OlaFlow:
'''Requirements for openFOAM''':
git clone git://github.com/phicau/olaFlow.git
cd ~
cd olaFlow
mkdir foam
./allMake -j8
cd foam
echo "source /usr/lib/openfoam/openfoam2112/etc/bashrc" >> ~/.bashrc
source ~/.bashrc
openfoam2112
exit


# Installing solids4foam:
'''Installing foam-extend-4.1''':<br>
mkdir -p $FOAM_RUN
If you've skipped the "Requirements" part then run the following commands first:
cd $FOAM_RUN/..
source /usr/lib/openfoam/openfoam2112/etc/bashrc
git clone https://bitbucket.org/philip_cardiff/solids4foam-release.git
fe41
./Allwmake -j8
 
cd ~/foam/
git clone git://git.code.sf.net/p/foam-extend/foam-extend-4.1
cd foam-extend-4.1
source etc/bashrc
echo "alias fe41='. ~/foam/foam-extend-4.1/etc/bashrc'" >> ~/.bashrc
./Allwmake.firstInstall -j8  ''# the -j<number> refers to the number of CPU cores to use for compiling the software (more = faster)''
# You will be asked to proceed WITHOUT compiling Paraview; Choose ''yes''. The supplied version is much older then the one currently installed.
Proceed without compiling ParaView [Y/n] y
 
''To use the latest version of Paraview, follow the instructions [[Paraview| here]]''
 
'''Installing OlaFlow''':<br>
If you've skipped the "Requirements" part then run the following command first:
source /usr/lib/openfoam/openfoam2112/etc/bashrc
 
cd ~/foam/
git clone https://github.com/phicau/olaFlow.git
cd olaFlow
./allMake -j8
 
'''Installing solids4foam''':<br>
If you've skipped the "Requirements" part then run the following command first:
source /usr/lib/openfoam/openfoam2112/etc/bashrc
 
cd ~/foam/
mkdir -p $FOAM_RUN
cd $FOAM_RUN/..
git clone https://bitbucket.org/philip_cardiff/solids4foam-release.git
cd solids4foam-release
./Allwmake -j8

Latest revision as of 10:00, 28 February 2023


Both openFOAM repositories (org & com) are available on the LWP. Instructions on how to install packages on the LWP can be found here. Students do not have permission to install software, because the PCs in the computer rooms need to diverge as little as possible, but you can send us a request to install it on your system, by using the "support request" icon on the desktop or selecting it from the menu.

Since there are quite a few versions of openFOAM(com/org) and it's extensions floating around, installing a version on a system can cause conflicts for other users on that system. Thankfully it's possible to install a version or extensions into your own home directory without requiring elevated privileges. This way multiple users on the same system can use their own versions and extensions. Compilation of some of these will take some time.

The FOAM extensions described here have been verified to work for unprivileged users.

Install (or request we install if you login with a S#) the following packages on your system:

$ sudo apt install openfoam2112 openfoam2112-dev

Requirements for openFOAM:

cd ~
mkdir foam
cd foam
echo "source /usr/lib/openfoam/openfoam2112/etc/bashrc" >> ~/.bashrc
source ~/.bashrc
openfoam2112
exit

Installing foam-extend-4.1:
If you've skipped the "Requirements" part then run the following commands first:

source /usr/lib/openfoam/openfoam2112/etc/bashrc
fe41
cd ~/foam/
git clone git://git.code.sf.net/p/foam-extend/foam-extend-4.1
cd foam-extend-4.1
source etc/bashrc
echo "alias fe41='. ~/foam/foam-extend-4.1/etc/bashrc'" >> ~/.bashrc
./Allwmake.firstInstall -j8   # the -j<number> refers to the number of CPU cores to use for compiling the software (more = faster)

# You will be asked to proceed WITHOUT compiling Paraview; Choose yes. The supplied version is much older then the one currently installed.
Proceed without compiling ParaView [Y/n] y

To use the latest version of Paraview, follow the instructions here

Installing OlaFlow:
If you've skipped the "Requirements" part then run the following command first:

source /usr/lib/openfoam/openfoam2112/etc/bashrc
cd ~/foam/
git clone https://github.com/phicau/olaFlow.git
cd olaFlow
./allMake -j8

Installing solids4foam:
If you've skipped the "Requirements" part then run the following command first:

source /usr/lib/openfoam/openfoam2112/etc/bashrc
cd ~/foam/
mkdir -p $FOAM_RUN
cd $FOAM_RUN/..
git clone https://bitbucket.org/philip_cardiff/solids4foam-release.git
cd solids4foam-release
./Allwmake -j8