新浪博客

openfaom Adaptive mesh refinement 自适应网格

2013-04-26 20:15阅读:
forwardStep算例进行说明:
/opt/openfoam201/tutorials/compressible/sonicFoam/laminar/forwardStep

一:网格

1加密前计算网格(5025




2加密后计算网格(6369
1、图2分别为加密前后的网格分布。

: 加密方法

加密的要求: 压力梯度比较大的区域进行网格加密
openfoam中,可以使用topoSetrefineMeshmapField一系列命令对网格进行加密。这里为了更好的捕捉激波,选择归一化压力梯度进行加密。normalisedGradP= openfaom <wbr>Adaptive <wbr>mesh <wbr>refinement <wbr>自适应网格
命令:
1 topoSet //得到要加密区域的网格节点位置,这里选择normalisedGradP
2 refineMesh –dict //利用得到的节点位置进行网格加密过程
3 mapField ../orig –sourceTime latestTime –consistent //将粗网格上的结果作为细网格的初始值进行计算
第一步topoSet命令需要在system中加入topoSetDict文件,格式为:

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object topoSetDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

actions
(
// Example:pick up internal faces on outside of cellSet
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Load initial cellSet
{
name c0;
type cellSet;
action new;
source fieldToCell;
sourceInfo
{
fieldName normalisedGradP;
min 0.1;
max 1.00;
}
}
);
第二步refineMesh –dict命令需要在system中加入refineMeshDict文件,格式为:

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object refineMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Cells to refine; name of cell set
set c0;
// Type of coordinate system:
// - global : coordinate system same for every cell. Usually aligned with
// x,y,z axis. Specify in globalCoeffs section below.
// - patchLocal : coordinate system different for every cell. Specify in
// patchLocalCoeffs section below.
coordinateSystem global;
//coordinateSystem patchLocal;
// .. and its coefficients. x,y in this case. (normal direction is calculated
// as tan1^tan2)
globalCoeffs
{
tan1 (1 0 0);
tan2 (0 1 0);
}

//patchLocalCoeffs
//{
// patch outside; // Normal direction is facenormal of zero'th face of patch
// tan1 (1 0 0);
//}
// List of directions to refine
directions
(
tan1
tan2
);

// 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 false;

// Cut purely geometric (will cut hexes through vertices) or take topology
// into account. Incompatible with useHexTopology
geometricCut true;

我的更多文章

下载客户端阅读体验更佳

APP专享