-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwedge.glf
111 lines (89 loc) · 3.15 KB
/
wedge.glf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#------------------
# Initial settings
#------------------
package require PWI_Glyph 2.17.0
pw::Application setUndoMaximumLevels 5
pw::Application reset
pw::Application markUndoLevel {Journal Reset}
pw::Application clearModified
#--------------------
# Set solver to CGNS
#--------------------
pw::Application setCAESolver {CGNS} 3
#----------------------------------------
# Constants (parameters) for this script
#----------------------------------------
set PI 3.14159265359
set SQRT2 [expr sqrt(2.0)]
set SQRT3 [expr sqrt(3.0)]
set W 1.0
# Concerning resolution
set N 11
# Coordinates origin
set X_0 0.0 ; # [expr -$W * 0.5]
set Y_0 $X_0
set Z_0 0.0
source "delnov.glf"
#---------------
# Define points
#---------------
Delnov_Create_Point $X_0 $Y_0 $Z_0
Delnov_Create_Point [expr $X_0 + $W] $Y_0 $Z_0
Delnov_Create_Point [expr $X_0 + $W * 0.5] \
[expr $Y_0 + $W * $SQRT3 * 0.5] \
$Z_0
puts "Defined all the points"
#-----------------
# Define segments
#-----------------
Delnov_Create_Line_From_Points "point-1" "point-2"
Delnov_Create_Line_From_Points "point-2" "point-3"
Delnov_Create_Line_From_Points "point-3" "point-1"
#--------------------------------------
# Define resolution on all connections
#--------------------------------------
Delnov_Modify_Dimension_By_Name_Pattern "con" $N
#------------------
# Creating domains
#------------------
Delnov_Create_Unstructured_Domain "con-1" "con-2" "con-3"
puts "Defined domains"
#------------------
# Create the block
#------------------
Delnov_Extrude_Unstructured_Block_By_Name_Pattern "dom" "z" $W [expr $N - 1]
#-----------------------------
# Specify boundary conditions
#-----------------------------
Delnov_Introduce_Bnd_Conds [list "bottom" "south" "north-east" "north-west" "top"]
set bc [pw::BoundaryCondition getByName "bottom"]
$bc apply [list [pw::GridEntity getByName "blk-1"] \
[pw::GridEntity getByName "dom-1"] ]
set bc [pw::BoundaryCondition getByName "south"]
$bc apply [list [pw::GridEntity getByName "blk-1"] \
[pw::GridEntity getByName "dom-2"] ]
set bc [pw::BoundaryCondition getByName "north-east"]
$bc apply [list [pw::GridEntity getByName "blk-1"] \
[pw::GridEntity getByName "dom-3"] ]
set bc [pw::BoundaryCondition getByName "north-west"]
$bc apply [list [pw::GridEntity getByName "blk-1"] \
[pw::GridEntity getByName "dom-4"] ]
set bc [pw::BoundaryCondition getByName "top"]
$bc apply [list [pw::GridEntity getByName "blk-1"] \
[pw::GridEntity getByName "dom-5"] ]
#------------------------
# Save data for analysis
#------------------------
# Select all the blocks ...
set blocks_only [Delnov_Get_Entities_By_Name_Pattern "blk"]
# ... and export them
set export [pw::Application begin CaeExport [pw::Entity sort $blocks_only]]
$export initialize -type CAE {wedge.cgns}
$export setAttribute FilePrecision Double
$export setAttribute ExportParentElements true
if {![$export verify]} {
error "Data verification failed."
}
$export write
$export end
unset export