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




















