1.在ICEM中换分网格,把将要组合的两个面命名为“INTERFACE_A”和“INTERFACE_AA”, 注意,不要将这两个面上的节点合并。
2.将ICEM中划分好的网格放在算例文件夹中,使用下面命令转化成OpenFOAM网格:
fluent3DMeshToFoam XXX.msh
3.在算例文件夹/system/路径下创建createPatchDict文件:
touch createPatchDict
在createPatchDict中复制下面内容:
/*--------------------------------*- C++ -*----------------------------------* | ========= | | | \ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \ / O peration | Version: 5 | | \ / A nd | Web: www.OpenFOAM.org | | \/ M anipulation | | *---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object createPatchDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // pointSync false; patches ( { name AMI_A; //交界面的名字 patchInfo { type cyclicAMI; //交界面类型 neighbourPatch AMI_AA; //与之相匹配的交界面名字 transform noOrdering; } constructFrom patches; //使用patches的方法创建cyclicAMI patches (INTERFACE_A); //patches的名字 } { name AMI_AA; patchInfo { type cyclicAMI; neighbourPatch AMI_A; transform noOrdering; } constructFrom patches; patches (INTERFACE_AA); } ); // ************************************************************************* //
之后在终端输入
createPatch -overwrite
便生成名字为“AMI_A”和“AMI_AA”的两个cyclicAMI面,在算例/0/文件夹下,这两个壁面的边界条件的值均与内部流场InternalField一致,比如p文件和U文件:
p文件:
dimensions [0 2 -2 0 0 0 0]; internalField uniform 0; boundaryField { WALL { type zeroGradient; } INLET { type zeroGradient; } OUTLET { type fixedValue; value uniform 0; } AMI_A { type cyclicAMI; value uniform 0; } AMI_AA { type cyclicAMI; value uniform 0; } }
U文件
dimensions [0 1 -1 0 0 0 0]; internalField uniform (0 0 0); boundaryField { WALL { type noSlip; } INLET { type fixedValue; value uniform (15 0 0); } OUTLET { type zeroGradient; } AMI_A { type cyclicAMI; value uniform (0 0 0); } AMI_AA { type cyclicAMI; value uniform (0 0 0); } }
应该注意:互为cyclicAMI的两个面,应该大小相等。