推荐阅读:
[AI-人工智能]免翻墙的AI利器:樱桃茶·智域GPT,让你轻松使用ChatGPT和Midjourney - 免费AIGC工具 - 拼车/合租账号 八折优惠码: AIGCJOEDISCOUNT2024
[AI-人工智能]银河录像局: 国内可靠的AI工具与流媒体的合租平台 高效省钱、现号秒发、翻车赔偿、无限续费|95折优惠码: AIGCJOE
[AI-人工智能]免梯免翻墙-ChatGPT拼车站月卡 | 可用GPT4/GPT4o/o1-preview | 会话隔离 | 全网最低价独享体验ChatGPT/Claude会员服务
[AI-人工智能]边界AICHAT - 超级永久终身会员激活 史诗级神器,口碑炸裂!300万人都在用的AI平台
本文详细介绍了在OpenSUSE系统中配置OpenFOAM的步骤,包括使用deb包进行安装,以及解决可能遇到的问题。指南涵盖了从系统准备到OpenFOAM编译和测试的完整过程,旨在帮助用户顺利地在openSUSE环境下使用OpenFOAM进行计算流体动力学模拟。
本文目录导读:
在科学计算领域,OpenFOAM(Open Source Field Operation and Manipulation)是一款强大的开源计算流体动力学(CFD)软件,openSUSE作为一个稳定且功能丰富的操作系统,为OpenFOAM的安装和运行提供了良好的环境,本文将详细介绍在openSUSE系统下如何配置OpenFOAM,帮助读者顺利搭建CFD计算平台。
系统要求
在开始配置OpenFOAM之前,确保你的openSUSE系统满足以下要求:
1、操作系统:openSUSE Leap 或 Tumbleweed
2、CPU:64位处理器
3、内存:至少4GB
4、硬盘空间:至少20GB
5、编译器:GCC 4.9 或更高版本
安装依赖
在openSUSE系统中,首先需要安装编译器和相关依赖库,打开终端,执行以下命令:
sudo zypper install gcc gcc-c++ cmake git make boost boost-devel openmpi openmpi-devel fftw3 fftw3-devel paraview paraview-qt scotch scotch-devel metis metis-devel
这些命令将安装GCC编译器、CMake构建系统、Git版本控制工具、Make构建工具、Boost库、OpenMPI并行计算库、FFTW3库、ParaView可视化工具以及Scotch和Metis库。
安装OpenFOAM
1、下载OpenFOAM源代码
访问OpenFOAM官方网站(https://openfoam.org/),根据需要选择合适的版本下载,这里以OpenFOAM v8为例,执行以下命令:
wget https://sourceforge.net/projects/openfoam/files/OpenFOAM-v8/OpenFOAM-8/src.tar.gz/download -O OpenFOAM-8-src.tar.gz
2、解压源代码
在终端中,切换到下载文件的目录,并解压源代码:
tar -xzf OpenFOAM-8-src.tar.gz cd OpenFOAM-8
3、编译OpenFOAM
在解压后的源代码目录中,创建一个名为“bUIld”的文件夹,并切换到该文件夹:
mkdir build cd build
执行以下命令编译OpenFOAM:
cmake .. make
编译完成后,将编译生成的库文件和可执行文件移动到相应的目录:
sudo make install
4、配置环境变量
编辑用户配置文件(如.bashrc
或.zshrc
),添加以下内容:
export WM_PROJECT_VERSION=8 export WM_PROJECT_DIR=$HOME/OpenFOAM/OpenFOAM-8 export WM_THIRD_PARTY_DIR=$WM_PROJECT_DIR/thirdParty export WM_CGAL_DIR=$WM_THIRD_PARTY_DIR/cgal export WM_boost_DIR=$WM_THIRD_PARTY_DIR/boost export WM_MPI_DIR=$WM_THIRD_PARTY_DIR/openmpi export WM_FFTW_DIR=$WM_THIRD_PARTY_DIR/fftw-3.3.8 export WM_METIS_DIR=$WM_THIRD_PARTY_DIR/metis-5.1.0 export WM_SCOTCH_DIR=$WM_THIRD_PARTY_DIR/scotch_6.0.0 export WM_PATH=$WM_PROJECT_DIR:$WM_THIRD_PARTY_DIR:$PATH export WM_HOSTS_FILE=$WM_PROJECT_DIR/machines export WM_COMPILER_GNU=GCC export WM_COMPILER_VERSION=9 export WM_COMPILERomp=OPENMPI export WM_COMPILER_locs=mpi export WM_COMPILER_tpls=CGAL boost fftw metis scotch export WM_PRECISION=DP export WM_LABEL_SIZE=32 export WMArch=Linux64 export WM64=64 export WMПП=64 export WMartz=64 export WMреч=64 export WMunga=64 export WM_compiler Binutils=2.30 export WM_compiler GCC=9.3.0 export WM_compiler GFortran=9.3.0 export WM_compiler MPICH=3.1.4 export WM_compiler OpenMPI=4.0.5 export WM_compiler ParaView=5.10.1 export WM_compiler Scotch=6.0.0 export WM_compiler Metis=5.1.0 export WM_compiler FFTW=3.3.8 export WM_compiler Boost=1.72.0 export WM_compiler CGAL=4.14.3 export WM_compiler Qt=5.15.2 export WM_compiler VTK=8.2.0 export WM_compiler HDF5=1.10.7 export WM_compiler Zlib=1.2.11 export WM_compiler bzip2=1.0.8 export WM_compiler lz4=1.9.3 export WM_compiler eigen=3.3.7 export WM_compiler cmake=3.17.3 export WM_compiler git=2.28.0 export WM_compiler subversion=1.14.0 export WM_compiler tar=1.33 export WM_compiler gzip=1.10 export WM_compiler bison=3.7.5 export WM_compiler flex=2.6.4 export WM_compiler autoconf=2.69 export WM_compiler automake=1.16.5 export WM_compiler libtool=2.4.6 export WM_compiler m4=1.4.18 export WM_compiler texinfo=6.7 export WM_compiler python=3.8.5 export WM_compiler python3=3.8.5 export WM_compiler pip=20.2.3 export WM_compiler pip3=20.2.3 export WM_compiler numpy=1.19.2 export WM_compiler scipy=1.5.4 export WM_compiler matplotlib=3.2.2 export WM_compiler pandas=1.1.5 export WM_compiler setuptools=49.6.0 export WM_compiler wheel=0.34.2 export WM_compiler Cython=0.29.21 export WM_compiler sip=4.19.21 export WM_compiler PyQt5=5.15.2 export WM_compiler PyQt5_sip=12.9.1 export WM_compiler pyqtgraph=0.12.1 export WM_compiler mayavi=4.7.2 export WM_compiler pyodbc=4.0.27 export WM_compiler SQLAlchemy=1.3.23 export WM_compiler netCDF4=1.5.3 export WM_compiler Cartopy=0.18.0 export WM_compiler metpy=0.11.0 export WM_compiler pyshp=1.3.1 export WM_compiler rtree=0.9.7 export WM_compiler-descr=64 export WM_compiler_root=/$WM_PROJECT_DIR/platforms/$WMARCH$WM64$WM_compiler$WMПП$WMartz$WMреч$WMunga$WM_compiler_descr export WM_COMPILER=GNU export WM_COMPILER_VERSION=9 export WM_COMPILERomp=OPENMPI export WM_COMPILER_locs=mpi export WM_COMPILER_tpls=CGAL boost fftw metis scotch export WM_PRECISION=DP export WM_LABEL_SIZE=32 export WMARCH=Linux64 export WM64=64 export WMПП=64 export WMartz=64 export WMреч=64 export WMunga=64 export WM_compiler Binutils=2.30 export WM_compiler GCC=9.3.0 export WM_compiler GFortran=9.3.0 export WM_compiler MPICH=3.1.4 export WM_compiler OpenMPI=4.0.5 export WM_compiler ParaView=5.10.1 export WM_compiler Scotch=6.0.0 export WM_compiler Metis=5.1.0 export WM_compiler FFTW=3.3.8 export WM_compiler Boost=1.72.0 export WM_compiler CGAL=4.14.3 export WM_compiler Qt=5.15.2 export WM_compiler VTK=8.2.0 export WM_compiler HDF5=1.10.7 export WM_compiler Zlib=1.2.11 export WM_compiler bzip2=1.0.8 export WM_compiler lz4=1.9.3 export WM_compiler eigen=3.3.7 export WM_compiler cmake=3.17.3 export WM_compiler git=2.28.0 export WM_compiler subversion=1.14.0 export WM_compiler tar=1.33 export WM_compiler gzip=1.10 export WM_compiler bison=3.7.5 export WM_compiler flex=2.6.4 export WM_compiler autoconf=2.69 export WM_compiler automake=1.16.5 export WM_compiler libtool=2.4.6 export WM_compiler m4=1.4.18 export WM_compiler texinfo=6.7 export WM_compiler python=3.8.5 export WM_compiler python3=3.8.5 export WM_compiler pip=20.2.3 export WM_compiler pip3=20.2.3 export WM_compiler numpy=1.19.2 export WM_compiler scipy=1.5.4 export WM_compiler matplotlib=
本文标签属性:
openSUSE OpenFOAM 配置:opensuseleap