在CFD-POST中,有很多指令是可以通过一些简单程序来完成的,比如批量构造截面。
本文以一根方管为例,沿z轴构建xy截面若干个:
1、打开软件后,Tools>command editor
2、贴入如下代码:
!$numsteps =52;#建立截面数
!$delta_z=3;#截面间距
!$start_z=-28;#截面z轴起点
!for ($i=1; $i <= $numsteps; $i++) {
! $dis=$start_z+$delta_z*$i;
PLANE:Plane $i
Apply Instancing Transform = On
Apply Texture = Off
Blend Texture = On
Bound Radius = 0.5 [m]
Colour = 0.75, 0.75, 0.75
Colour Map = Default Colour Map
Colour Mode = Constant
Colour Scale = Linear
Colour Variable = Pressure
Colour Variable Boundary Values = Conservative
Culling Mode = No Culling
Direction 1 Bound = 1.0 [m]
Direction 1 Orientation = 0 [degree]
Direction 1 Points = 10
Direction 2 Bound = 1.0 [m]
Direction 2 Points = 10
Domain List = /DOMAIN GROUP:All Domains
Draw Faces = On
Draw Lines = Off
Instancing Transform = /DEFAULT INSTANCE TRANSFORM:Default Transform
Invert Plane Bound = Off
Lighting = On
Line Colour = 0, 0, 0
Line Colour Mode = Default
Line Width = 1
Max = 0.0
Min = 0.0
Normal = 1 , 0 , 0
Option = XY Plane
Plane Bound = None
Plane Type = Slice
Point = 0 [mm], 0 [mm], 0 [mm]
Point 1 = 0 [mm], 0 [mm], 0 [mm]
Point 2 = 1 [mm], 0 [mm], 0 [mm]
Point 3 = 0 [mm], 1 [mm], 0 [mm]
Range = Global
Render Edge Angle = 0 [degree]
Specular Lighting = On
Surface Drawing = Smooth Shading
Texture Angle = 0
Texture Direction = 0 , 1 , 0
Texture File =
Texture Material = Metal
Texture Position = 0 , 0
Texture Scale = 1
Texture Type = Predefined
Tile Texture = Off
Transform Texture = Off
Transparency = 0.0
X = 0.0 [mm]
Y = 0.0 [mm]
Z = $dis [mm]
OBJECT VIEW TRANSFORM:
Apply Reflection = Off
Apply Rotation = Off
Apply Scale = Off
Apply Translation = Off
Principal Axis = Z
Reflection Plane Option = XY Plane
Rotation Angle = 0.0 [degree]
Rotation Axis From = 0 [mm], 0 [mm], 0 [mm]
Rotation Axis To = 0 [mm], 0 [mm], 0 [mm]
Rotation Axis Type = Principal Axis
Scale Vector = 1 , 1 , 1
Translation Vector = 0 [mm], 0 [mm], 0 [mm]
X = 0.0 [mm]
Y = 0.0 [mm]
Z = 0.0 [mm]
END
END
!}
3、点击process,就能看到建立的截面。
类似的操作还可以有很多,这里仅提供一点小思路,欢迎各位评论!
————————————————
版权声明:本文为CSDN博主「ZZ_sss」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ZZ_sss/article/details/105411618