openfoam计算旋转体滑移网格方法和MRF方法(附案例代码)

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

  • 7
    点赞
  • 35
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
OpenFOAM中的MRF是指多块旋转框架(Moving Reference Frame)方法。这是一种在CFD仿真中用于模拟旋转机械设备的技术。 当我们需要研究旋转机械设备(如风扇、涡轮机等)中的流体行为时,MRF方法就发挥了重要作用。在这些设备中,流体的运动会受到设备自身的旋转影响。传统的CFD网格在考虑设备旋转时会非常复杂,而MRF方法则通过引入旋转坐标系来简化整个计算过程。 在OpenFOAM中实现MRF方法的基本步骤如下: 1. 创建求解区域:通过确定设备的几何形状和尺寸来定义有限体积计算区域。 2. 定义旋转部分:将设备几何体根据旋转轴划分为静止和旋转部分。例如,圆柱体的前半部分可能是静止,后半部分是旋转的风扇。 3. 设置边界条件:根据设备的运动,设置旋转部分的固体壁面为MRF类型边界,而其他静止部分保持常规固体壁面类型。 4. 求解:使用OpenFOAM中的MRF求解器开始计算。通过在旋转部分引入旋转坐标系,实现设备的旋转运动对流动场的影响。同时,还需要考虑设备表面的速度和旋转速率。 通过以上步骤,我们可以模拟并分析旋转机械设备中的流体行为。使用MRF方法,我们能够在简化的计算网格上实现CFD模拟,从而更高效地研究旋转机械设备的性能和流动特性。OpenFOAM提供了丰富的MRF求解器和工具,使得这一过程更加便捷和可靠。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值