尝试将 GMSH 网格转换为其他格式

问题描述 投票:0回答:1

我打算使用

Nek5000
库中的 gmsh2nek 工具将
gmsh
网格转换为
re2
格式。到目前为止,我已经能够成功使用
gmsh2nek
工具来处理以下
cube.geo
文件。

//Sets the mesh element order
Mesh.ElementOrder = 2;

//Sets the mesh version for exporting the mesh
Mesh.MshFileVersion = 2.2;

Point(1) = {0, 0, 0, 1.0};
Point(2) = {1, 0, 0, 1.0};
Point(3) = {1, 1, 0, 1.0};
Point(4) = {0, 1, 0, 1.0};

Line(1) = {4, 3};
Line(2) = {3, 2};
Line(3) = {2, 1};
Line(4) = {1, 4};

Line Loop(5) = {1, 2, 3, 4};
Plane Surface(6) = {5};

Transfinite Line {1, 2, 3, 4} = 4 Using Progression 1;
Transfinite Surface {6};
Recombine Surface {6};

//+
Extrude {0, 0, 1} {
  Surface{6};
  Layers{3};
  Recombine;
}

Physical Surface("inlet", 29) = {15};
Physical Surface("outlet", 30) = {23};
Physical Surface("walls", 31) = {28, 27, 6, 19};
Physical Volume("fluid", 32) = {1};

我想对反应堆燃料棒进行建模,我首先在

FreeCAD
中暂时绘制圆柱体内部的圆柱体(颗粒内部包覆),以
STEP
格式导出并打开它
gmsh
。生成的网格对我来说似乎很好。但是,由于以下错误,
gmsh2nek
无法工作:

only line3 and quad8/9 elements are accepted
please choose "set order 2" option to set all elements to 2nd order
please uncheck "save all elements" when exporting mesh
please see readme for more information

我已将生成的网格保存为 ASCII 2 格式。网格对我来说看起来很好。

fuelpinmeshGMSH

但是,当我观察立方体的

.msh
文件(
gmsh2nek
工作的地方)和我的 2 个圆柱体的文件时,我发现
$Elements
cube.msh
部分仅具有
gmsh
元素类型和
element_ids
10(四边形9 - (称为偶然性二次四边形的东西)和12(我无法弄清楚)。我认为这与要求我使用line3或quad8/9元素的错误相关。

cube.msh 片段

// Comment - Each line is element_id element_type number_of_tags <tags> node_1 node_2 ... node_n. 
// Comment - 2nd digit is of our use - element_type

$Elements
81
1 10 2 31 6 4 9 69 25 11 73 74 28 75
2 10 2 31 6 25 69 70 24 74 76 77 27 78
3 10 2 31 6 24 70 20 1 77 79 23 26 80
4 10 2 31 6 9 10 71 69 12 81 82 73 83
....
55 12 2 32 1 69 9 4 25 219 94 49 171 73 74 227 11 98 28 51 181 228 229 99 189 75 230 231 100 190 232 233
56 12 2 32 1 219 94 49 171 220 95 50 172 228 229 234 99 101 189 52 184 235 236 102 191 232 237 238 103 192 239 240
....
$EndElements

OTOH,我的圆柱体

$Elements
文件的
.msh
有各种不同的
gmsh
元素类型 - 5 -> Hexahedron8(线性六面体),3 -> Quadriside4(线性四边形),1 -> Line2(线性)线)和15。

如何使用错误指示我使用的

gmsh
元素类型创建圆柱体?

到目前为止我已经尝试过什么?

  • 尝试使用
    .geo
    文件制作圆柱体 - 同样的错误
  • 尝试使用
    gmsh Python API
    制作气缸 - 同样的错误

我是 3D 建模和所有这些软件的初学者,所以我可能错误地理解了一些非常基本的东西。请为我指出正确的方向。

fluid-dynamics freecad gmsh
1个回答
0
投票

gmsh 版本是什么?你能提供整个msh文件吗?

© www.soinside.com 2019 - 2024. All rights reserved.