OpenFOAM 10
安装环境
mkdir -p /opt/app
yum -y install flex bison cmake cmake3 zlib-devel zlib qt5-qtbase-devel openssl openssl-devel libXt-devel libX11-devel qt5-qtx11extras-devel qt5-qttools-devel
export PATH=/usr/lib64/qt5/bin:$PATH
gcc 5.4.0
cd /opt/app
wget http://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.gz
tar zxvf http://ftp.gnu.org/gnu/gcc/gcc-5.4.0/gcc-5.4.0.tar.gz
cd gcc-5.4.0
./contrib/download_prerequisites
mkdir build && cd build
../configure --prefix=/opt/app/gcc/5.4.0 --enable-checking=release --enable-languages=c,c++ --disable-multilib
make -j && make install
export PATH=/opt/app/gcc/5.4.0/bin:$PATH
export LD_LIBRARY_PATH=/opt/app/gcc/5.4.0/lib64:$LD_LIBRARY_PATH
cmake 3.29.6
wget https://github.com/Kitware/CMake/releases/download/v3.29.6/cmake-3.29.6.tar.gz
tar zxvf cmake-3.29.6.tar.gz
cd cmake-3.29.6
./bootstrap
./configure --prefix=/opt/app/cmake/3.29.6
make -j && make install
export PATH=/opt/app/cmake/3.29.6/bin:$PATH
openmpi 5.0.3
wget https://download.open-mpi.org/release/open-mpi/v5.0/openmpi-5.0.3.tar.gz
tar zxvf openmpi-5.0.3.tar.gz
cd openmpi-5.0.3
./configure --prefix=/opt/app/openmpi/5.0.3
make -j && make install
export MPI_ARCH_PATH=/opt/app/openmpi/5.0.3/
export PATH=/opt/app/openmpi/5.0.3/bin:$PATH
export LD_LIBRARY_PATH=/opt/app/openmpi/5.0.3/lib:$LD_LIBRARY_PATH
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/opt/app/openmpi/5.0.3/include
编译
cd /opt/app
mkdir openfoam && cd openfoam
wget https://github.com/OpenFOAM/OpenFOAM-10/archive/refs/tags/version-10.tar.gz
tar zxvf version-10.tar.gz
mv OpenFOAM-10-version-10 OpenFOAM-10
rm -rf version-10.tar.gz
wget https://github.com/OpenFOAM/ThirdParty-11/archive/refs/tags/version-10.tar.gz
tar zxvf version-10.tar.gz
mv ThirdParty-11-version-10 ThirdParty-10
cd /opt/app/openfoam/OpenFOAM-10
## 在第五十一行添加
vim etc/bashrc
"export FOAM_INST_DIR=/opt/app/openfoam"
source etc/bashrc
cd /opt/app/openfoam/ThirdParty-10
./Allclean
./Allwmake
cd /opt/app/openfoam/OpenFOAM-10
wcleanPlatform
./Allwmake -j -k
测试
mkdir -p $FOAM_RUN
cd $FOAM_RUN
cp -r $FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily .
cd pitzDaily
blockMesh
simpleFoam