如何解决 gmsh Mesh 生成错误

Posted

技术标签:

【中文标题】如何解决 gmsh Mesh 生成错误【英文标题】:How to resolve gmsh Mesh generation errors 【发布时间】:2020-03-16 12:53:34 【问题描述】:

我正在尝试对具有各种纵横比的 10 个椭圆进行 3D 网格化,以进行 OpenFOAM 模拟。我注意到,当我尝试生成 3D 网格时,我遇到了相同的 3 个网格划分错误。 3 条错误消息是:

    错误:无法恢复曲线 1000(表面 1)上的边缘 405 (1/1219) 错误:在表面 1026 中找不到拉伸节点 (0.9090634994349311, -0.0009576995469135237, 1) 错误:第 1 卷中没有元素

这些消息出现在大多数椭圆上,但其余网格没有问题。

我是 gmsh 的新手,所以我希望能解释一下导致这些错误的原因以及我应该如何解决这些错误。

我计划使用更复杂/无定形的形状,因此我需要知道这些形状的网格化将是稳健的。任何有关使用此设置实现稳健网格的提示也将不胜感激。

这是其中一种形状的 3D 网格文件(如果需要,可以提供更多):

Point(1000) =  0.14286, 0.0, 0.00000000, 0.005;
Point(1001) =  0.14256, 0.06407, 0.00000000, 0.005;
Point(1002) =  0.14168, 0.12788, 0.00000000, 0.005;
Point(1003) =  0.14022, 0.19116, 0.00000000, 0.005;
Point(1004) =  0.13818, 0.25365, 0.00000000, 0.005;
Point(1005) =  0.13558, 0.31511, 0.00000000, 0.005;
Point(1006) =  0.13242, 0.37527, 0.00000000, 0.005;
Point(1007) =  0.12871, 0.43388, 0.00000000, 0.005;
Point(1008) =  0.12447, 0.49072, 0.00000000, 0.005;
Point(1009) =  0.11973, 0.54553, 0.00000000, 0.005;
Point(1010) =  0.11449, 0.59811, 0.00000000, 0.005;
Point(1011) =  0.10878, 0.64823, 0.00000000, 0.005;
Point(1012) =  0.10262, 0.69568, 0.00000000, 0.005;
Point(1013) =  0.096043, 0.74028, 0.00000000, 0.005;
Point(1014) =  0.08907, 0.78183, 0.00000000, 0.005;
Point(1015) =  0.081731, 0.82017, 0.00000000, 0.005;
Point(1016) =  0.074056, 0.85514, 0.00000000, 0.005;
Point(1017) =  0.066077, 0.8866, 0.00000000, 0.005;
Point(1018) =  0.057826, 0.91441, 0.00000000, 0.005;
Point(1019) =  0.049338, 0.93847, 0.00000000, 0.005;
Point(1020) =  0.040647, 0.95867, 0.00000000, 0.005;
Point(1021) =  0.031789, 0.97493, 0.00000000, 0.005;
Point(1022) =  0.0228, 0.98718, 0.00000000, 0.005;
Point(1023) =  0.013718, 0.99538, 0.00000000, 0.005;
Point(1024) =  0.0045788, 0.99949, 0.00000000, 0.005;
Point(1025) =  -0.0045788, 0.99949, 0.00000000, 0.005;
Point(1026) =  -0.013718, 0.99538, 0.00000000, 0.005;
Point(1027) =  -0.0228, 0.98718, 0.00000000, 0.005;
Point(1028) =  -0.031789, 0.97493, 0.00000000, 0.005;
Point(1029) =  -0.040647, 0.95867, 0.00000000, 0.005;
Point(1030) =  -0.049338, 0.93847, 0.00000000, 0.005;
Point(1031) =  -0.057826, 0.91441, 0.00000000, 0.005;
Point(1032) =  -0.066077, 0.8866, 0.00000000, 0.005;
Point(1033) =  -0.074056, 0.85514, 0.00000000, 0.005;
Point(1034) =  -0.081731, 0.82017, 0.00000000, 0.005;
Point(1035) =  -0.08907, 0.78183, 0.00000000, 0.005;
Point(1036) =  -0.096043, 0.74028, 0.00000000, 0.005;
Point(1037) =  -0.10262, 0.69568, 0.00000000, 0.005;
Point(1038) =  -0.10878, 0.64823, 0.00000000, 0.005;
Point(1039) =  -0.11449, 0.59811, 0.00000000, 0.005;
Point(1040) =  -0.11973, 0.54553, 0.00000000, 0.005;
Point(1041) =  -0.12447, 0.49072, 0.00000000, 0.005;
Point(1042) =  -0.12871, 0.43388, 0.00000000, 0.005;
Point(1043) =  -0.13242, 0.37527, 0.00000000, 0.005;
Point(1044) =  -0.13558, 0.31511, 0.00000000, 0.005;
Point(1045) =  -0.13818, 0.25365, 0.00000000, 0.005;
Point(1046) =  -0.14022, 0.19116, 0.00000000, 0.005;
Point(1047) =  -0.14168, 0.12788, 0.00000000, 0.005;
Point(1048) =  -0.14256, 0.06407, 0.00000000, 0.005;
Point(1049) =  -0.14286, 1.2246e-16, 0.00000000, 0.005;
Point(1050) =  -0.14256, -0.06407, 0.00000000, 0.005;
Point(1051) =  -0.14168, -0.12788, 0.00000000, 0.005;
Point(1052) =  -0.14022, -0.19116, 0.00000000, 0.005;
Point(1053) =  -0.13818, -0.25365, 0.00000000, 0.005;
Point(1054) =  -0.13558, -0.31511, 0.00000000, 0.005;
Point(1055) =  -0.13242, -0.37527, 0.00000000, 0.005;
Point(1056) =  -0.12871, -0.43388, 0.00000000, 0.005;
Point(1057) =  -0.12447, -0.49072, 0.00000000, 0.005;
Point(1058) =  -0.11973, -0.54553, 0.00000000, 0.005;
Point(1059) =  -0.11449, -0.59811, 0.00000000, 0.005;
Point(1060) =  -0.10878, -0.64823, 0.00000000, 0.005;
Point(1061) =  -0.10262, -0.69568, 0.00000000, 0.005;
Point(1062) =  -0.096043, -0.74028, 0.00000000, 0.005;
Point(1063) =  -0.08907, -0.78183, 0.00000000, 0.005;
Point(1064) =  -0.081731, -0.82017, 0.00000000, 0.005;
Point(1065) =  -0.074056, -0.85514, 0.00000000, 0.005;
Point(1066) =  -0.066077, -0.8866, 0.00000000, 0.005;
Point(1067) =  -0.057826, -0.91441, 0.00000000, 0.005;
Point(1068) =  -0.049338, -0.93847, 0.00000000, 0.005;
Point(1069) =  -0.040647, -0.95867, 0.00000000, 0.005;
Point(1070) =  -0.031789, -0.97493, 0.00000000, 0.005;
Point(1071) =  -0.0228, -0.98718, 0.00000000, 0.005;
Point(1072) =  -0.013718, -0.99538, 0.00000000, 0.005;
Point(1073) =  -0.0045788, -0.99949, 0.00000000, 0.005;
Point(1074) =  0.0045788, -0.99949, 0.00000000, 0.005;
Point(1075) =  0.013718, -0.99538, 0.00000000, 0.005;
Point(1076) =  0.0228, -0.98718, 0.00000000, 0.005;
Point(1077) =  0.031789, -0.97493, 0.00000000, 0.005;
Point(1078) =  0.040647, -0.95867, 0.00000000, 0.005;
Point(1079) =  0.049338, -0.93847, 0.00000000, 0.005;
Point(1080) =  0.057826, -0.91441, 0.00000000, 0.005;
Point(1081) =  0.066077, -0.8866, 0.00000000, 0.005;
Point(1082) =  0.074056, -0.85514, 0.00000000, 0.005;
Point(1083) =  0.081731, -0.82017, 0.00000000, 0.005;
Point(1084) =  0.08907, -0.78183, 0.00000000, 0.005;
Point(1085) =  0.096043, -0.74028, 0.00000000, 0.005;
Point(1086) =  0.10262, -0.69568, 0.00000000, 0.005;
Point(1087) =  0.10878, -0.64823, 0.00000000, 0.005;
Point(1088) =  0.11449, -0.59811, 0.00000000, 0.005;
Point(1089) =  0.11973, -0.54553, 0.00000000, 0.005;
Point(1090) =  0.12447, -0.49072, 0.00000000, 0.005;
Point(1091) =  0.12871, -0.43388, 0.00000000, 0.005;
Point(1092) =  0.13242, -0.37527, 0.00000000, 0.005;
Point(1093) =  0.13558, -0.31511, 0.00000000, 0.005;
Point(1094) =  0.13818, -0.25365, 0.00000000, 0.005;
Point(1095) =  0.14022, -0.19116, 0.00000000, 0.005;
Point(1096) =  0.14168, -0.12788, 0.00000000, 0.005;
Point(1097) =  0.14256, -0.06407, 0.00000000, 0.005;
Point(1098) =  0.14286, -2.4493e-16, 0.00000000, 0.005;


Spline(1000) = 1000:1098,1000;

edge_lc = 0.2;
Point(1900) =  5, 5, 0, edge_lc;
Point(1901) =  5, -5, 0, edge_lc;
Point(1902) =  -5, -5, 0, edge_lc;
Point(1903) =  -5, 5, 0, edge_lc;

Line(1) = 1900,1901;
Line(2) = 1901,1902;
Line(3) = 1902,1903;
Line(4) = 1903,1900;

Line Loop (1) = 1,2,3,4;
Line Loop (2) = 1000;
Plane Surface(1) = 1,2;

Extrude 0, 0, 1 
  Surface1;
  Layers1;
  Recombine;

Physical Surface("back") = 1027;
Physical Surface("front") = 1;
Physical Surface("top") = 1022;
Physical Surface("exit") = 1010;
Physical Surface("bottom") = 1014;
Physical Surface("inlet") = 1018;
Physical Surface("aerofoil") = 1026;
Physical Volume("internal") = 1;

【问题讨论】:

【参考方案1】:

问题发生了,因为Spline(1000) 现在本身就是一个闭环。这不太理想。在 GMSH 中,人们更愿意将形成闭环的线定义为至少两个独立的对象,然后将它们添加到相应的Line Loop

因此,具有以下更改的文件应该可以毫无问题地创建网格:

Spline(1000) = 1000:1045;
Spline(1001) = 1045:1098,1000;
...
Line Loop (2) = 1000,1001;

其他一切都可以保持不变。 1045 是任意选择的。

【讨论】:

太棒了,感谢您的解决方案!除了网站上列出的资源之外,您还有其他学习 gmsh 的资源吗?如果没有,请不要担心。 @RobotBarry 不是真的。他们的 gmsh github 上的教程非常有用,然后是反复试验,在谷歌上搜索并查找是否有人已经在 GMSH 邮件列表中遇到了这个问题(甚至是远程相关的)。

以上是关于如何解决 gmsh Mesh 生成错误的主要内容,如果未能解决你的问题,请参考以下文章

如何理解 Service Mesh

如何理解 Service Mesh

如何解决 php artisan key 生成错误?

edk2配置错误"NMAKE : fatal error U1073: 不知道如何生成tbuild",应该如何解决?

教你如何使用GPA导出模型,另送一个 GPA CSV2MESH Tool in unity

Service mesh 原理与实践(十九)- 如何自己动手用 Go 语言实现一套 Service Mesh 架构