OpenFOAM-7
deal.ii 9.2.0
preCICE 2.1.1(版本一致)
(Open MPI) 4.0.3
blastFOAM2.0
openfoam-adapter1.2.3for oepfoam7
dealii-adapter(要适用于precice2.1.1,这里用的学长发的旧版本的)
注意:22.04和20.04的区别,服务器上自己的是22.04,工作站是22.04
一、技巧:
Perpendicular flap | preCICE - The Coupling Library
通过Perpendicular flap 案例,测试precice和openfoam,OpenFOAM-preCICE adapter三个是否安装成功
通过OpenFOAM-7/blastfoam_2_0/tutorials/twoChargeDetonation这个案例,测试openfoam7和blastfoam是否安装成功。
二.安装软件及安装顺序
0.安装顺序:
先安装openfoam7,再安装blastfoam2.0.0.然后通过blastfoam_2_0/tutorials/twoChargeDetonation这个案例验证安装是否成功。
然后依次安装precice2.11,openfoam-adapter1.2.3for oepnfoam7。通过通过Perpendicular flap 案例,测试precice和openfoam,OpenFOAM-preCICE adapter三个是否安装成功
最后再安装dealii9.2.0,dealii-adapter(版本要对应,这个用学长发的,在我的csdn资源里有)
最后通过pbf3爆轰案例验证上面所有软件是否安装成功。
1.安装方法
1.安装openfoam7
应该可以直接安装focal(22.04用jammy)的lib文件。中间顺便安装好依赖项和环境变量cmake,gcc,mpi等,大多可通过命令apt install安装
软件包安装方法如下:找到对应的openfoam7直接安装,不用编译
debian · Wiki · Development / openfoam · GitLab
下面方法是需要编译的,比较费时间,2小时可能
GitHub - OpenFOAM/OpenFOAM-7: OpenFOAM Foundation repository for OpenFOAM version 7
2.安装blastFoam2.0版本
(网上最老的是3.0版本,这里也用学长的),可参考的安装方法如下
https://github.com/synthetik-technologies/blastfoam
blastfoam2.0.0不用配置blastfoam的环境变量,文件夹放在openfoam7下面就可,然后Allwmake编译就能用了,前提是openfoam7要安装成功。
3.最快安装precice2.1.1和openfoam-adapter1.2.3教程
*****************************开始***********************
Quickstart | preCICE - The Coupling Library这个网页中命令安装很容易。
1.先在https://github.com/precice/precice/releases/tag/v2.1.1 下载好focal(适用于ubuntu20.04LTS,如果说22.04,需要换成Jammy)二进制包(服务器不行的话通用ftp本地下载上传),以deb文件结尾,
2.这时候使用命令sudo apt install ./libprecice2_2.1.1.focal.deb(以deb结尾就行,这种deb文件是编译过的,只适合ubuntu20,22的一些版本,而tar.gz是需要自己再编译的,费事)
3.这时候再下载openfoam对应版本的openfoam-adapter.
https://github.com/precice/openfoam-adapter/releases/tag/v1.2.3
Get the OpenFOAM adapter | preCICE - The Coupling Library
上面这个是安装适配器及其安装前的要求。
要构建openfoam-adapter.适配器,您需要安装一些依赖项,然后执行Allwmake脚本。
- 安装兼容的OpenFOAM7发行版。
- 安装preCICE v3。如果您需要preCICE v2,请安装旧版本的适配器(v1.2.3是支持preCICE v2的最新版本)。这里选择precice2.1.1,故选择v1.2.3
- 执行openfoam-adapter构建脚本: ./Allwmake -j79 .
- 适配器还需要pkg-config来链接到preCICE。这是Linux上非常常见的依赖项,通常已经安装。
至此,openfoam-adapter1.2.3foroopenfoam7,precice2.1.1和openfoam7都安装成功。
*****************************结束**********************
4.安装dealii9.2.0,见
https://github.com/dealii/dealii/tree/dealii-9.2 1.Windows系统下利用Ubuntu安装Deal.ii_ubuntu下载deal.ii9.3.3-CSDN博客
编译时候权限不够的话加上sudo make -j79 ……
export PATH=/home/***/dealii-9.2.0
3.安装dealii-adapter(用学长发的deal--adapter适用于2.1.1的版本,现在网上已经找不到)
dealll和dealii-adapter的安装方法如下(不能下载下面提供的,版本不对应,只参考安装方法):
deal.ii、deal.ii adapter安装方法(preCICE) - 哔哩哔哩
至此,所有安装完毕,具体细节可参照安装过程的4个word文档以及各种bug解决。上传到csdn资源文件中。
三.了解precice
- precice-config文件介绍 Introduction to configuration | preCICE - The Coupling Library
- linear_elasticity.prm参数文件介绍 Configure the deal.II codes | preCICE - The Coupling Library (特别重要1,2)
2.了解precice工作原理 Configuration overview | preCICE - The Coupling Library
3. preCICE configuration file配置文件从preicce2移动到3.x版本 Porting from 2.x to 3.x | preCICE - The Coupling Library
4.配置文件从preicce2移动到3.x版本 https://precice.org/couple-your-code-porting-v2-3.html#precice-configuration-file
5.upgrade from preCICE 2.x to preCICE 3.x. Porting from 2.x to 3.x | preCICE - The Coupling Library (特别重要)
Porting from 2.x to 3.x | preCICE - The Coupling Library (特别重要),报括preCICE configuration file的变化
6.版本控制中,红色代表不可用或无效。绿色代表可用有效。
7.案例中xml文件的参考: XML reference | preCICE - The Coupling Library
notes: Troubles in trying to run the OpenFOAM-Deal.II FSI tutorials - Official adapters and tutorials - preCICE Forum on Discourse precice,dealii的各种问题可以在这个社区网站上搜索,类似于csdn。