Content:
-
OpenFOAM installation instuctions
-
docker
container with OpenFOAM -
OpenFOAM cases with templates
-
TODO: merge adv1d python code
sudo apt install \
bash \
bzip2 \
cmake \
flex \
gcc \
g++ \
git \
gzip \
libopenmpi-dev \
make \
openmpi-bin \
paraview \
patch \
tar \
vim \
wget \
xz-utils
Install some required packages
sudo zypper install \
bzip2 \
cmake \
flex \
gcc \
gcc-c++ \
gcc-fortran \
git \
gzip \
openmpi4-devel \
paraview \
patch \
tar \
vim-small \
wget \
xz \
zlib-devel
No additional operation required.
Select openmpi
version
mpi-selector --set openmpi4
and relaunch shell.
Set the installation location
export OPENFOAM_ROOT=~/software/openfoam
Clone the source files
mkdir -p $OPENFOAM_ROOT
cd $OPENFOAM_ROOT
git clone https://github.com/OpenFOAM/OpenFOAM-dev.git -b version-12
git clone https://github.com/OpenFOAM/ThirdParty-dev.git -b version-12
Disable zoltan
and paraview
mkdir -p $HOME/.OpenFOAM
echo "export ZOLTAN_TYPE=none" >> $HOME/.OpenFOAM/prefs.sh
echo "export ParaView_TYPE=none" >> $HOME/.OpenFOAM/prefs.sh
Compile third party software
cd $OPENFOAM_ROOT/ThirdParty-dev
source $OPENFOAM_ROOT/OpenFOAM-dev/etc/bashrc
./Allwmake -j
Compile OpenFOAM
cd $OPENFOAM_ROOT/OpenFOAM-dev
source $OPENFOAM_ROOT/OpenFOAM-dev/etc/bashrc
./Allwmake -j
Copy and run the cavity
tutorial
mkdir ~/sandbox
cd ~/sandbox
cp -r $FOAM_TUTORIALS/incompressibleFluid/cavity .
cd cavity
blockMesh
foamRun
export OPENFOAM_ROOT=~/software/openfoam
source $OPENFOAM_ROOT/OpenFOAM-dev/etc/bashrc
Run this once
cat <<EOF >> ~/.bashrc
# configure openfoam
export OPENFOAM_ROOT=~/software/openfoam
source \$OPENFOAM_ROOT/OpenFOAM-dev/etc/bashrc
EOF