推荐阅读:
[AI-人工智能]免翻墙的AI利器:樱桃茶·智域GPT,让你轻松使用ChatGPT和Midjourney - 免费AIGC工具 - 拼车/合租账号 八折优惠码: AIGCJOEDISCOUNT2024
[AI-人工智能]银河录像局: 国内可靠的AI工具与流媒体的合租平台 高效省钱、现号秒发、翻车赔偿、无限续费|95折优惠码: AIGCJOE
[AI-人工智能]免梯免翻墙-ChatGPT拼车站月卡 | 可用GPT4/GPT4o/o1-preview | 会话隔离 | 全网最低价独享体验ChatGPT/Claude会员服务
[AI-人工智能]边界AICHAT - 超级永久终身会员激活 史诗级神器,口碑炸裂!300万人都在用的AI平台
本文详细介绍了在Ubuntu系统下如何配置OpenFOAM及其所需的OpenMPI环境,旨在帮助用户高效地安装和使用OpenFOAM,提升计算流体动力学(CFD)模拟的效率。内容包括安装依赖包、编译OpenFOAM和OpenMPI,以及相关环境变量的设置。
本文目录导读:
OpenFOAM(Open Source Field Operation and Manipulation)是一款开源的流体力学模拟软件,广泛应用于计算流体动力学(CFD)领域,在Ubuntu操作系统上配置OpenFOAM,可以充分利用Linux系统的稳定性和高性能,本文将详细介绍在Ubuntu系统下配置OpenFOAM的步骤。
系统要求
1、操作系统:Ubuntu 18.04/20.04 LTS
2、硬件要求:64位处理器,至少4GB内存,建议使用SSD硬盘以提高性能
3、编译工具:g++(C++编译器),make(构建工具)
安装依赖包
在配置OpenFOAM之前,需要先安装一些依赖包,打开终端,执行以下命令:
sudo apt-get update sudo apt-get install g++ make git cmake libopenmpi-dev libmpich-dev libparmetis-dev
下载OpenFOAM源码
1、访问OpenFOAM官网(https://openfoam.org/),找到最新版本的源码下载链接。
2、使用wget命令下载源码包,
wget https://sourceforge.net/projects/openfoam/files/OpenFOAM-9/9.0.1/openfoam-9.0.1.tar.gz/download
3、下载完成后,使用tar命令解压源码包:
tar -xzf openfoam-9.0.1.tar.gz
编译OpenFOAM
1、进入解压后的源码目录:
cd openfoam-9.0.1
2、创建一个构建目录并进入:
mkdir build cd build
3、使用cmake命令配置项目:
cmake ..
4、编译OpenFOAM:
make
5、安装OpenFOAM:
sudo make install
配置环境变量
1、打开终端,编辑用户的bash配置文件(.bashrc):
nano ~/.bashrc
2、在文件末尾添加以下内容:
export WM_PROJECT_VERSION=9.0.1 export WM_PROJECT_DIR=$HOME/openfoam-9.0.1 export WM_THIRD_PARTY_DIR=$WM_PROJECT_DIR/thirdParty export WM_CGAL_DIR=$WM_THIRD_PARTY_DIR/cgal export WM_MPI Parallel=$WM_THIRD_PARTY_DIR/mpi export WM_COMPILER_GNUarch=64 export WM_COMPILER foss export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_compiler_bin=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM_CMAKEwmake=ON export WM_MPLIB=OPENMPI export WM_COMPILER_BIN=$WM_COMPILER export WM_COMPILER是说=GNU export WM_COMPILER_VERSION=4.9 export WM
本文标签属性:
Ubuntu OpenFOAM 配置:ubuntu openmp