openfaom Adaptive mesh refinement 自适应网格

分类: 科研技术 |
以forwardStep算例进行说明:
(/opt/openfoam201/tutorials/compressible/sonicFoam/laminar/forwardStep)
一:网格
图1、图2分别为加密前后的网格分布。
二: 加密方法
加密的要求: 压力梯度比较大的区域进行网格加密
在 openfoam中,可以使用topoSet、refineMesh、mapField一系列命令对网格进行加密。这里为了更好的捕捉激波,选择归一化压力梯度进行加密。normalisedGradP=
命令:
1
2
3
第一步topoSet命令需要在system中加入topoSetDict文件,格式为:
FoamFile
{
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
actions
(
);
第二步refineMesh –dict命令需要在system中加入refineMeshDict文件,格式为:
FoamFile
{
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Cells to refine; name of cell set
set c0;
// Type of coordinate system:
// - global : coordinate system same for every cell. Usually aligned with
//
// - patchLocal : coordinate system different for every cell. Specify in
//
coordinateSystem global;
//coordinateSystem patchLocal;
// .. and its coefficients. x,y in this case. (normal direction is calculated
// as tan1^tan2)
globalCoeffs
{
}
//patchLocalCoeffs
//{
//
//
//}
// List of directions to refine
directions
(
);
// Whether to use hex topology. This will
// - if patchLocal: all cells on selected patch should be hex
// - split all hexes in 2x2x2 through the middle of edges.
useHexTopology
// Cut purely geometric (will cut hexes through vertices) or take topology
// into account. Incompatible with useHexTopology
geometricCut
// Write meshes from intermediate steps
writeMesh
// ************************************************************************* //
第三:mapField ../orig –sourceTime
三:结果对比