openFoam中的滑移网格教程

本次教程主要试一下openFoam中的滑移网格,本次的算例的网格采用的是simCafe.org网站上的网格文件,将网格文件拷到新建的AMI文件夹中,创建system文件夹和system文件夹下的controlDict文件,然后执行fluentMeshToFoam命令将fluent网格转换为openFoam格式网格,命令输入如下图所示,注意fluentMeshToFoam命令后要添加一个选项-writeZones,则转换完后openFoam网格单元组cellZone文件中会有各个旋转域的信息,省去后续的网格操作,此外该命令只能转换ascii码的fluent网格格式,需将2进制网格文件转换为ascii码格式。
转换成功后如下图所示:
该算例模拟了在来流以10m/s的速度流过轴流二维风扇,如下图中所示,风扇的转速为40RPM。
后面我们需要将修改网格的boundary文件,将各个流体域的交界面边界设置为cyclicAMI,修改界面如下图所示:
接着,我们创建constant下的dynamicMeshDict,由于该算例中有多个滑移旋转区域,因此选用的动网格方法为multiSolidBodyMotionFvMesh,solidBodyMotionFvMesh只支持一个网格旋转域,具体参数输入如下图中所示:
该算例中有四个旋转域,因此,有四个对应旋转的域参数字典信息。
后面修改边界条件参数,本例中湍流模型采用kepsilon模型,因此,其边界条件包含k和epsilon。压力边界条件设置分别如下所示:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -2 0 0 0 0];
internalField uniform 0;
boundaryField
{
FARFIELD2
{
type freestreamPressure;
}
FARFIELD1
{
type freestreamPressure;
}
"WALL.*"
{
type zeroGradient;
}
frontAndBackPlanes
{
type empty;
}
"HUB.*|BLADE.*"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //
速度边界设置如下:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField uniform (10 0 0);
boundaryField
{
FARFIELD1
{
type freestream;
freestreamValue uniform (10 0 0);
}
FARFIELD2
{
type freestream;
freestreamValue uniform (10 0 0);
}
"WALL.*"
{
type rotatingWallVelocity;
origin (0 0 0);
axis (0 0 1);
omega 0;
}
frontAndBackPlanes
{
type empty;
}
"HUB.*|BLADE.*"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //
k边界设置:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -2 0 0 0 0 ];
internalField uniform 1;
boundaryField
{
FARFIELD1
{
type turbulentIntensityKineticEnergyInlet;
intensity 0.05;
value uniform 1;
}
FARFIELD2
{
type zeroGradient;
}
"WALL.*"
{
type kqRWallFunction;
value uniform 0;
}
frontAndBackPlanes
{
type empty;
}
"HUB.*|BLADE.*"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //
epsilon设置如下:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object epsilon;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -3 0 0 0 0 ];
internalField uniform 0;
boundaryField
{
FARFIELD1
{
type turbulentMixingLengthDissipationRateInlet;
mixingLength 1;
value uniform 20;
}
FARFIELD2
{
type zeroGradient;
}
"WALL.*"
{
type epsilonWallFunction;
value $internalField;
}
frontAndBackPlanes
{
type empty;
}
"HUB.*|BLADE.*"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //
nut边界设置:
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.4.0 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [ 0 2 -1 0 0 0 0 ];
internalField uniform 0;
boundaryField
{
FARFIELD1
{
type calculated;
}
FARFIELD2
{
type zeroGradient;
}
"WALL.*"
{
type nutkWallFunction;
value uniform 0;
}
frontAndBackPlanes
{
type empty;
}
"HUB.*|BLADE.*"
{
type cyclicAMI;
value $internalField;
}
}
// ************************************************************************* //
最后执行命令pimpleDyMFoam进行计算求解,最终求解结果文件如下图所示。
至于后处理方面本处只简单展示一下0.3s时的速度云图。

工程师必备
- 项目客服
- 培训客服
- 平台客服
TOP
