1 旋转体数值模拟
openfoam中处理旋转体的方法主要包括两种方法:滑移网格法和多重参考系方法,在滑移网格方法中主要采用的为任意网格界面法(AMI),多重参考系方法则是通过设定多重参考系区域,该区域包括将旋转体包括在内部,集体设为一个cellzone,通过旋转区域旋转来实现。
2 滑移网格法
openfoam中滑移网格通过字典文件dynamicMeshDict设置,具体设置方法可见 http://openfoamwiki.net/index.php/DynamicMeshDict
,在动网格求解器中,对于旋转运动主要采用solidBodyMotionFvMesh(单旋转体)和 multiSolidBodyMotionSolver(多旋转体),不同版本可能有不同的命名方法,具体可查阅 /openfoam/src/dynamicMesh/motionSolvers/displacement/solidBody
在滑移网格方法中需要对旋转区域设置AMI面。
具体实现:
在旋转体外部设置一个区域innerCylinder,将旋转区域全部包纳,区域属性为cellZone和faceZone,采用creatpatch或者creatbaffle创建一对AMI面,此时AMI贴合在innerCylinder上(该过程应用了innerCylinder faceZone属性),之后在dynamicMeshDict设置旋转区域为innerCylinder(该过程需要innerCylinder的cellZone属性)
代码可参考:
/openfoam/tutorials/incompressible/pimpleFoam/RAS/propeller
对于多旋转体则修改dynamicMeshDict
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object dynamicMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dynamicFvMesh dynamicMotionSolverFvMesh;
motionSolverLibs ("libfvMotionSolvers.so");
solver multiSolidBodyMotionSolver;
multiSolidBodyMotionSolverCoeffs
{
innerCylinder1
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0 0 0);//旋转中心
axis (0 1 0);//旋转轴
omega 50; // rad/s
}
}
innerCylinder2
{
solidBodyMotionFunction rotatingMotion;
rotatingMotionCoeffs
{
origin (0 0 0);
axis (0 1 0);
omega 50; // rad/s
}
}
}
3 MRF方法:
多重参考系方法:具体理论不再介绍,通过在计算区域设置两个参考系实现,具体则是可以设置MRF区域(cellZone),之后在区域内旋转体的相对速度应为0;即此时速度边界设置为:
propeller
{
type fixedValue;
value uniform (0 0 0);
}
在该设置中需要再去设置AMI面,只需要将innerCylinder设定为MRF区域,设置旋转中心,在snappyHexMeshDict文件中,对于innerCylinder设置为:
innerCylinder
{
level (4 4);
cellZone innerCylinder;
faceZone innerCylinder;
cellZoneInside inside;
}
cellZone将其设置为一个区域,此时可以将其设置为MRF区域,faceZone则是使得区域内部的旋转体propeller也可以将其划分网格,inside则指innerCylinder包括的为内部区域。
也可采用topoSet进行设置:
https://mp.weixin.qq.com/s/cTmcjdTrh-OeZWdyOHWIEg
旋转区域设置:MRFProperties
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: dev
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "constant";
object MRFProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
MRF1
{
cellZone innerCylinder;
active yes;
// Fixed patches (by default they 'move' with the MRF zone)
nonRotatingPatches ();
origin (0 0 0);
axis (0 1 0);
omega 158; // rad/s
}
// ************************************************************************* //
附完整代码:
https://download.csdn.net/download/zhaoyunye01/13606525