- 热能工程与先进能源技术仿真与设计
- 苏石川 孔为 陈代芬
- 1519字
- 2025-02-24 08:53:53
第3章 网格划分
3.1 建立自由三角形网格
3.1.1 根据系统默认尺寸直接生成自由网格
第一步 首先利用COMSOL软件,打开模型3-0.mph。右击Model Builder窗口中的Mesh1,在弹出的菜单中选择Free Triangular选项,如图3-1所示。

图3-1 选择Free Triangular命令
第二步 单击Build Selected,完成网格划分,如图3-2所示。

图3-2 生成Free Triangular网格
3.1.2 利用Size控制不同边的网格尺寸
(1)预定义网格尺寸
第一步 打开模型3-0.mph,右击Model Builder窗口中的Mesh 1,在弹出的菜单中选择Free Triangular选项。
第二步 在Model Builder窗口,右击Free Triangular 1在弹出的菜单中选择Size选项。
第三步 在Settings窗口中的Geometric Entity Selection部分,从Geometric entity level列表中选择Boundary。
第四步 在Graphics窗口选择需要划分的边界,并添加到Settings窗口中的Selection下面的方框中。
第五步 在Settings窗口中的Element Size部分,选择Predefined(预定义)并从其列表中选择Finer,确定网格尺寸,如图3-3所示。

图3-3 设置网格尺寸
第六步 单击Build Selected,完成网格划分,如图3-4所示。

图3-4 生成预定义网格
注:没有选择的边界,网格尺寸由Mesh 1下面的Size来确定,可以从预定义中选择,也可以自定义。
(2)自定义网格尺寸
第一步 打开模型3-0.mph,右击Model Builder窗口中的Mesh 1,在弹出的菜单中选择Free Triangular选项。
第二步 在Model Builder窗口,右击Free Triangular 1在弹出的菜单中选择Size选项,如图3-5所示。

图3-5 选择Size命令
第三步 在Settings窗口中的Geometric Entity Selection部分,从Geometric entity level列表中选择Boundary。
第四步 在Graphics窗口选择需要确定网格大小的边,并添加到Settings窗口中的Selection下面的方框中。
第五步 在Settings窗口中的Element Size部分,选择Custom,自定义网格尺寸。
第六步 在Settings窗口中的Element Size Parameters部分选择Maximum element size,并在相应的对话框中输入0.01,确定最大网格尺寸,如图3-6所示。

图3-6 自定义网格尺寸
第七步 单击Build Selected,完成网格划分,如图3-7所示。

图3-7 生成自定义网格
注:可以使用Size控制边上网格的大小。
3.1.3 利用Size控制不同区域的网格尺寸
第一步 打开模型3-1.mph,右击Model Builder窗口中的Mesh 1,在弹出的菜单中选择Free Triangular选项。
第二步 在Model Builder窗口,右击Free Triangular 1在弹出的菜单中选择Size选项。
第三步 在Settings窗口中的Geometric Entity Selection部分,从Geometric entity level列表中选择Domain。
第四步 在Graphics窗口选择需要划分的区域,并添加到Settings窗口中的Selection下面的方框中。
第五步 在Settings窗口中的Element Size部分,选择Predefined(预定义)并从其列表中选择Finer,确定网格尺寸,如图3-8所示。

图3-8 设置区域2网格
第六步 重复第二、三、四步。
第七步 在Settings窗口中的Element Size部分,选择Predefined(预定义)并从其列表中选择Normal,确定网格尺寸,如图3-9所示。

图3-9 设置区域1网格
第八步 单击Build Selected,完成网格划分,如图3-10所示。

图3-10 生成不同区域网格
注:不同的区域可以采用不同的网格尺寸。
3.1.4 利用Distribution控制不同边的网格数量
第一步 打开模型3-2.mph,右击Model Builder窗口中的Mesh 1,在弹出的菜单中选择Free Triangular选项。
第二步 在Model Builder窗口,右击Free Triangular 1在弹出的菜单中选择Distribution选项,如图3-11所示。

图3-11 选择Distribution命令
第三步 在Graphics窗口选择需要划分的边界,并添加到Settings窗口中的Boundary Selection部分的方框中。
第四步 在Settings窗口中的Distribution部分,在Distribution properties列表中,对边界的划分有三种方式,分别介绍如下。
方式一:确定网格点位置
在Distribution properties列表中选择Explicit distribution(明确划分),并在Explicit element distribution所对应的方框中输入0,2,5,10,指定该边界上网格点位置,如图3-12所示。

图3-12 设置边界7网格点位置
方式二:确定边界网格数量
在Distribution properties列表中选择Fixed number of elements,并在Number of elements所对应的方框中输入20,指定该边界上网格数量,如图3-13所示。

图3-13 设置边界6网格数量
方式三:预定义分布类型
在Distribution properties列表中选择Predefined distribution type,并在Number of elements所对应的方框中输入10,指定该边界上网格数量,在Element ratio所对应的方框中输入3,确定网格尺寸增长比率,如图3-14所示。

图3-14 设置边界4网格数量及网格尺寸增长比率
第五步 单击Mesh 1下面的Size,在Settings窗口中设置网格大小,可以从预定义中选择,也可以自定义,这里我们选择预定义里的Normal。
第六步 单击Build All,完成网格划分,如图3-15所示。

图3-15 生成所有网格
在方式三(预定义分布类型)中,我们可以选择Distribution部分下面的Symmetric distribution(对称分布)和Reverse distribution(反向分布),如图3-16所示。

图3-16 正反网格对比