推荐阅读:
[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的指南,帮助用户在Ubuntu环境下顺利安装和设置OpenFOAM,以实现流体动力学的模拟和分析。
本文目录导读:
在科学计算与工程领域,OpenFOAM(Open Source Field Operation and Manipulation)是一款强大的开源流体动力学模拟软件,要在Ubuntu系统中安装和配置OpenFOAM,可以遵循以下步骤,本文将详细介绍如何在Ubuntu系统中安装OpenFOAM,并进行基本配置。
系统要求
在安装OpenFOAM之前,请确保您的Ubuntu系统满足以下要求:
1、Ubuntu版本:建议使用Ubuntu 18.04、20.04或更高版本。
2、GCC版本:建议使用GCC 7.4或更高版本。
3、CMake版本:建议使用CMake 3.10或更高版本。
安装依赖
1、更新系统软件包:
sudo apt update sudo apt upgrade
2、安装编译工具:
sudo apt install g++ cmake git
3、安装并行计算库:
sudo apt install mpich libmpich-dev
4、安装其他依赖:
sudo apt install libopenmpi-dev lib ParaView
下载OpenFOAM
1、访问OpenFOAM官网(https://openfoam.org/),找到最新版本的OpenFOAM源代码。
2、使用wget命令下载源代码:
wget https://openfoam.org/download/source/8.0/openfoam-8.0.tar.gz
3、解压源代码:
tar -zxvf openfoam-8.0.tar.gz
编译安装OpenFOAM
1、切换到解压后的目录:
cd openfoam-8.0
2、创建编译目录:
mkdir -p build cd build
3、使用CMake编译:
cmake .. make
4、将编译好的OpenFOAM安装到系统路径:
sudo make install
配置环境变量
1、打开终端,编辑用户配置文件:
nano ~/.bashrc
2、在文件末尾添加以下内容:
export WM_PROJECT_VERSION=8.0 export WM_PROJECT_DIR="/usr/local/openfoam" export WM_THIRD_PARTY_DIR="$WM_PROJECT_DIR/thirdParty" export WM_CGAL_DIR="$WM_THIRD_PARTY_DIR/cgal" export WM_FREETYPE_DIR="$WM_THIRD_PARTY_DIR/freetype" export WM_MXML_DIR="$WM_THIRD_PARTY_DIR/mxml" export WM_PETSC_DIR="$WM_THIRD_PARTY_DIR/petsc" export WM_METIS_DIR="$WM_THIRD_PARTY_DIR/metis" export WMuperlaneset_DIR="$WM_THIRD_PARTY_DIR/uperlaneset" export WM_SVnid_DIR="$WM_THIRD_PARTY_DIR/svnid" export WM_PARMETIS_DIR="$WM_THIRD_PARTY_DIR/parmetis" export WM_SCOTCH_DIR="$WM_THIRD_PARTY_DIR/scotch" export WM_ptscotch_DIR="$WM_THIRD_PARTY_DIR/ptscotch" export WM_CCSE_DIR="$WM_THIRD_PARTY_DIR/ccse" export WM_CGNS_DIR="$WM_THIRD_PARTY_DIR/cgns" export WM_ZOLTAN_DIR="$WM_THIRD_PARTY_DIR/zoltan" export WM_X JScrollPane_DIR="$WM_THIRD_PARTY_DIR/x JScrollPane" export WM_mpi_DIR="$WM_THIRD_PARTY_DIR/mpi" export WM_openmpi_DIR="$WM_THIRD_PARTY_DIR/openmpi" export WM_PARMGRIDGEN_DIR="$WM_THIRD_PARTY_DIR/parmgridgen" export WMisis_DIR="$WM_THIRD_PARTY_DIR/isis" export WM_Xylene_DIR="$WM_THIRD_PARTY_DIR/xylene" export WM_TETGEN_DIR="$WM_THIRD_PARTY_DIR/tetgen" export WM_BLAS_DIR="$WM_THIRD_PARTY_DIR/blas" export WM_LAPACK_DIR="$WM_THIRD_PARTY_DIR/lapack" export WM_SCALAPACK_DIR="$WM_THIRD_PARTY_DIR/scalapack" export WM_yaml-cpp_DIR="$WM_THIRD_PARTY_DIR/yaml-cpp" export WM_boost_DIR="$WM_THIRD_PARTY_DIR/boost" export WM_openssl_DIR="$WM_THIRD_PARTY_DIR/openssl" export WM_openssh_DIR="$WM_THIRD_PARTY_DIR/openssh" export WM_zlib_DIR="$WM_THIRD_PARTY_DIR/zlib" export WM_bzip2_DIR="$WM_THIRD_PARTY_DIR/bzip2" export WM_curl_DIR="$WM_THIRD_PARTY_DIR/curl" export WM_glib_DIR="$WM_THIRD_PARTY_DIR/glib" export WM_gtk_DIR="$WM_THIRD_PARTY_DIR/gtk" export WM_gtkglext_DIR="$WM_THIRD_PARTY_DIR/gtkglext" export WM_libX11_DIR="$WM_THIRD_PARTY_DIR/libX11" export WM_libXt_DIR="$WM_THIRD_PARTY_DIR/libXt" export WM_libXmu_DIR="$WM_THIRD_PARTY_DIR/libXmu" export WM_libXext_DIR="$WM_THIRD_PARTY_DIR/libXext" export WM_libXau_DIR="$WM_THIRD_PARTY_DIR/libXau" export WM_libXdmcp_DIR="$WM_THIRD_PARTY_DIR/libXdmcp" export WM_libpng_DIR="$WM_THIRD_PARTY_DIR/libpng" export WM_libjpeg_DIR="$WM_THIRD_PARTY_DIR/libjpeg" export WM_libtiff_DIR="$WM_THIRD_PARTY_DIR/libtiff" export WM_libungif_DIR="$WM_THIRD_PARTY_DIR/libungif" export WM_libXpm_DIR="$WM_THIRD_PARTY_DIR/libXpm" export WM_libXrandr_DIR="$WM_THIRD_PARTY_DIR/libXrandr" export WM_libXcursor_DIR="$WM_THIRD_PARTY_DIR/libXcursor" export WM_libXcomposite_DIR="$WM_THIRD_PARTY_DIR/libXcomposite" export WM_libXrender_DIR="$WM_THIRD_PARTY_DIR/libXrender" export WM_libXfixes_DIR="$WM_THIRD_PARTY_DIR/libXfixes" export WM_libXi_DIR="$WM_THIRD_PARTY_DIR/libXi" export WM_libXtst_DIR="$WM_THIRD_PARTY_DIR/libXtst" export WM_libXv_DIR="$WM_THIRD_PARTY_DIR/libXv" export WM_libXvMC_DIR="$WM_THIRD_PARTY_DIR/libXvMC" export WM_libXxf86vm_DIR="$WM_THIRD_PARTY_DIR/libXxf86vm" export WM_libXxf86dga_DIR="$WM_THIRD_PARTY_DIR/libXxf86dga" export WM_libXxf86rush_DIR="$WM_THIRD_PARTY_DIR/libXxf86rush" export WM_libXxf86misc_DIR="$WM_THIRD_PARTY_DIR/libXxf86misc" export WM_libXau_DIR="$WM_THIRD_PARTY_DIR/libXau" export WM_libXdmcp_DIR="$WM_THIRD_PARTY_DIR/libXdmcp" export WM_libXpm_DIR="$WM_THIRD_PARTY_DIR/libXpm" export WM_libXrandr_DIR="$WM_THIRD_PARTY_DIR/libXrandr" export WM_libXcursor_DIR="$WM_THIRD_PARTY_DIR/libXcursor" export WM_libXcomposite_DIR="$WM_THIRD_PARTY_DIR/libXcomposite" export WM_libXrender_DIR="$WM_THIRD_PARTY_DIR/libXrender" export WM_libXfixes_DIR="$WM_THIRD_PARTY_DIR/libXfixes" export WM_libXi_DIR="$WM_THIRD_PARTY_DIR/libXi" export WM_libXtst_DIR="$WM_THIRD_PARTY_DIR/libXtst" export WM_libXv_DIR="$WM_THIRD_PARTY_DIR/libXv" export WM_libXvMC_DIR="$WM_THIRD_PARTY_DIR/libXvMC" export WM_libXxf86vm_DIR="$WM_THIRD_PARTY_DIR/libXxf86vm" export WM_libXxf86dga_DIR="$WM_THIRD_PARTY_DIR/libXxf86dga" export WM_libXxf86rush_DIR="$WM_THIRD_PARTY_DIR/libXxf86rush" export WM_libXxf86misc_DIR="$WM_THIRD_PARTY_DIR/libXxf86misc" export WM_libXau_DIR="$WM_THIRD_PARTY_DIR/libXau" export WM_libXdmcp_DIR="$WM_THIRD_PARTY_DIR/libXdmcp" export WM_libXpm_DIR="$WM_THIRD_PARTY_DIR/libXpm" export WM_libXrandr_DIR="$WM_THIRD_PARTY_DIR/libXrandr" export WM_libXcursor_DIR="$WM_THIRD_PARTY_DIR/libXcursor" export WM_libXcomposite_DIR="$WM_THIRD_PARTY_DIR/libXcomposite" export WM_libXrender_DIR="$WM_THIRD_PARTY_DIR/libXrender" export WM_libXfixes_DIR="$WM_THIRD_PARTY_DIR/libXfixes" export WM_libXi_DIR="$WM_THIRD_PARTY_DIR/libXi" export WM_libXtst_DIR="$WM_THIRD_PARTY_DIR/libXtst" export WM_libXv_DIR="$WM_THIRD_PARTY_DIR/libXv" export WM_libXvMC_DIR="$WM_THIRD_PARTY_DIR/libXvMC" export WM_libXxf86vm_DIR="$WM_THIRD_PARTY_DIR/libX
本文标签属性:
Ubuntu:ubuntu启动后黑屏
OpenFOAM配置:openfoam配置要求
Ubuntu OpenFOAM 配置:ubuntu配置opencv