cd ~/OpenFOAM/ThirdParty-2.4.x tar -zxvf ~/uploads/scotch_6.0.3.tar.gz tar -zxvf ~/uploads/cgal-releases-CGAL-4.6.tar.gz && mv cgal-releases-CGAL-4.6 CGAL-4.6 tar -jxvf ~/uploads/boost_1_55_0.tar.bz2 tar -zxvf ~/uploads/gcc-4.8.5.tar.gz tar -xvf ~/uploads/gmp-5.1.2.tar.xz tar -zxvf ~/uploads/mpfr-3.1.2.tar.gz tar -zxvf ~/uploads/mpc-1.0.1.tar.gz
mkdir ~/Packages && cd ~/Packages tar -zxvf ~/uploads/openmpi-2.1.1.tar.gz cd openmpi-2.1.1 mkdir build && cd build ../configure --prefix=$HOME/Packages/openmpi-2.1.1/install --with-ucx=/usr/local/ucx make make install
cd ~/OpenFOAM sed -i -e 's=boost-system=boost_1_55_0=' OpenFOAM-2.4.x/etc/config/CGAL.sh sed -i -e 's=gcc\-4\.8\.2=gcc-4.8.5=' OpenFOAM-2.4.x/etc/config/settings.sh(这句执行完去验证一下这个文件第245行有没有改成4.8.5)
cd$HOME/Packages/ tar -zxvf ~/upload/lapack-3.10.1.tar.gz tar -zxvf ~/upload/libxml2-v2.8.0.tar.gz mv libxml2-v2.8.0 libxml2-2.8.0 tar -zxf ~/upload/hdf5-1.8.15.tar.gz tar -zxf ~/upload/yaml-cpp-yaml-cpp-0.6.0.tar.gz mv yaml-cpp-yaml-cpp-0.6.0 yaml-cpp-0.6.0 cp ~/upload/cmake-3.26.3-linux-x86_64.sh ./
BLAS&LAPACK
1 2 3 4 5
cd$HOME/Packages/lapack-3.10.1 cp make.inc.example make.inc # 默认直接安装到$HOME/Packages/lapack-3.10.1目录下 make blaslib make lapacklib
LibXml2
1 2 3 4 5
cd$HOME/Packages/libxml2-2.8.0 mkdir build && cd build ../configure --prefix=$HOME/Packages/libxml2-2.8.0/install make make install
HDF5
1 2 3 4 5 6
cd$HOME/Packages/hdf5-1.8.15 mkdir build && cd build ../configure --prefix=$HOME/Packages/hdf5-1.8.15/install make make check make install
yaml-cpp
1 2 3 4 5 6 7
cd$HOME/Packages/yaml-cpp-0.6.0 mkdir build && cd build cmake .. \ -DCMAKE_INSTALL_PREFIX="$HOME/Packages/yaml-cpp-0.6.0/install" \ -DBUILD_SHARED_LIBS=ON make make install
# Unset OpenFOAM environment variables. if [ -z "$FOAM_INST_DIR" ]; then echo"Nothing to unset..." else echo"*Unsetting OpenFOAM environment variables..." . $FOAM_INST_DIR/OpenFOAM-2.4.x/etc/config/unset.sh fi
# Set the OpenFOAM version and installation directory export OPENFOAM_VERSION=2.4.x export OPENFOAM_NAME=OpenFOAM-$OPENFOAM_VERSION export FOAM_INST_DIR=$inst_loc export WM_PROJECT_USER_DIR=$sowfa_loc/SOWFA
foamDotFile=$FOAM_INST_DIR/$OPENFOAM_NAME/etc/bashrc if [ -f $foamDotFile ] ; then echo"Sourcing $foamDotFile..." source$foamDotFile fi
export WM_NCOMPPROCS=1 export WM_COLOURS="white blue green cyan red magenta yellow"
cp -r $SOWFA_DIR/exampleCases/example.ABL.flatTerrain.neutral $FOAM_RUN/ run cd example.ABL.flatTerrain.neutral
修改runscript.preprocess文件
注释掉第13行:
1
# OpenFOAMversion=2.4.x-central
注释掉第71-80行:
1 2 3 4 5 6 7 8 9 10
# if [ $parallel -eq 1 ] # then # cd $PBS_O_WORKDIR # fi
# # Source the bash profile and then call the appropriate OpenFOAM version function # # so that all the modules and environment variables get set. # source $HOME/.bash_profile # OpenFOAM-$OpenFOAMversion
# Run the flow field initializer (parallel) if [ $runNumber -eq 1 ] then mpirun -np $NSLOTS$initializer -parallel > log.$runNumber.$initializer 2>&1 fi # Run the solver (parallel) mpirun -np $NSLOTS$solver -parallel > log.$runNumber.$solver 2>&1