OpenFOAM中添加多孔介质区域及进行相关计算可通过DarcyForchheimer模型来实现。具体步骤如下:
(一)设置多孔介质区域
在“system”文件夹下添加“topoSetDict”文件
eg:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
{
name porousSet; 需要生成的集合的名字
type cellSet;//集合类型,pointSet, pointZoneSet,faceSet, faceZoneSet,,,
action new;//操作类型,new, add, delete, subset(交集)
source boxToCell;//操作对象,boxToCell 含义是将某个box内的所有cell作为本次 action 的操作对象
sourceInfo 操作对象的信息
{
box (0 0 -1) (0.2 1 1);
}
}
{
name porous;//需要生成的集合的名字
type cellZoneSet;//表示需要生成一个cellZone
action new;//新建
source setToCellZone;//表示是要将某个 cellSet 中的所有网格作为操作对象
sourceInfo
{
set porousSet;//指定这个将被操作的 cellSet 的名字
}
}
)
(二)设置多孔介质属性
在“constant”文件夹中添加“porosityProperties”文件
eg:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object porosityProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
porosity1
{
type DarcyForchheimer;
cellZone porostity;
d (5e7 5e3 5e3);//粘性阻力系数
f (0 0 0 );//惯性阻力阻力系数
coordinateSystem//坐标设置
{
type cartesian;
origin (0 0 0);
coordinateRotation
{
type axesRotation;
e1 (1 0 0);
e2 (0 1 0);
}
}
}
(三)生成多孔介质区域
主体网格生成或转化完成后,运行以下命令
topoSet
会在constant/polyMesh 目录下生成一个 cellZones 文件,里面存放cellZone 信息;同时,在 constant/polyMesh 会生成一个目录 sets ,里面存放的是 set 的信息。
(四)运用求解器进行计算
参考资料:
https://mp.weixin.qq.com/s/cTmcjdTrh-OeZWdyOHWIEg
http://openfoamwiki.net/index.php/DarcyForchheimer