forked from GTSL-UC/T-Blade3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spanwise_output.f90
160 lines (139 loc) · 5.17 KB
/
spanwise_output.f90
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
subroutine span_output ()
!Description(Syed Moez 03/02/2014):---------------------------------
!This subroutine arranges the values of the control points
!obtained by creating a cubic B-spline into the specific
!format for curv_cp, thk_cp and LE variables
!These variables are being used for calculation by bladegen in creating airfoil sections.
use globvar
implicit none
if (allocated(curv_cp)) deallocate(curv_cp)
Allocate(curv_cp(20,2*na))
k=1
do i=1,na
if (k<=na)then
!Defining Control points for curvature chord values
!Defining fixed control points (not varied in new input file)
curv_cp(2,2*k-1)=0.0
curv_cp(ncp_chord+1,2*k-1)=1.0
!defining Cubic B-splined control points from the new input file
do j=3,ncp_chord
curv_cp(j,2*k-1)=bspline_chord_curv(i,j-1)
end do
!Adding two phantom points required for cubic Bspline
curv_cp(1,2*k-1)=2*curv_cp(2,2*k-1)-curv_cp(3,2*k-1)
curv_cp(ncp_chord+2,2*k-1)=2*curv_cp(ncp_chord+1,2*k-1)-curv_cp(ncp_chord,2*k-1)
!Defining control points for curvature
!Defining fixed control points (not varied in new input file)
curv_cp(2,2*k)=0.0
!defining Cubic B-splined control points from the new input file
do j=3,ncp_curvature+1
curv_cp(j,2*k)=bspline_chord_curv(i,ncp_chord+j-3)
end do
!Adding two phantom points required for cubic Bspline
curv_cp(1,2*k)=2*curv_cp(2,2*k)-curv_cp(3,2*k)
curv_cp(ncp_curvature+2,2*k)=2*curv_cp(ncp_curvature+1,2*k)-curv_cp(ncp_curvature,2*k)
k=k+1
end if
end do
if(thick .ne. 0) then
!-------------------------------------------------------------------------------
!writing Thickness control points
if (allocated(thk_cp)) deallocate(thk_cp)
Allocate(thk_cp(20,2*na))
k=1
do i=1,na
if (k<=na)then
!Defining Control points for thickness chord values
!Defining fixed control points (not varied in new input file)
thk_cp(3,2*k-1)=0.0
thk_cp(ncp_chord_thickness+2,2*k-1)=1.0
!Defining Cubic B-splined control points from the new input file
do j=4,ncp_chord_thickness+1
thk_cp(j,2*k-1)=bspline_thk(i,j-2)
end do
!Adding phantom points
thk_cp(1,2*k-1)=2*thk_cp(3,2*k-1)-thk_cp(5,2*k-1)
thk_cp(2,2*k-1)=2*thk_cp(3,2*k-1)-thk_cp(4,2*k-1)
thk_cp(ncp_chord_thickness+4,2*k-1)=2*thk_cp(ncp_chord_thickness+2,2*k-1)-thk_cp(ncp_chord_thickness,2*k-1)
thk_cp(ncp_chord_thickness+3,2*k-1)=2*thk_cp(ncp_chord_thickness+2,2*k-1)-thk_cp(ncp_chord_thickness+1,2*k-1)
!Defining control points for Thickness
!Defining fixed control points (not varied in new input file)
thk_cp(3,2*k)=0.0
thk_cp(ncp_thickness+2,2*k)=0.0
!Defining Cubic B-splined control points from the new input file
do j=4,ncp_thickness+1
thk_cp(j,2*k)=bspline_thk(i,ncp_chord_thickness+j-4)
end do
!Adding four phantom points required for creating a quartic spline
thk_cp(1,2*k)=2*thk_cp(3,2*k)-thk_cp(5,2*k)
thk_cp(2,2*k)=2*thk_cp(3,2*k)-thk_cp(4,2*k)
thk_cp(ncp_thickness+4,2*k)=2*thk_cp(ncp_thickness+2,2*k)-thk_cp(ncp_thickness,2*k)
thk_cp(ncp_thickness+3,2*k)=2*thk_cp(ncp_thickness+2,2*k)-thk_cp(ncp_thickness+1,2*k)
k=k+1
end if
end do
endif
if(LE .ne. 0) then
!-----------------------------------------------------------------------------
!Defining LE ontrol points
if (allocated(sting_l_all)) deallocate(sting_l_all)
Allocate(sting_l_all(na))
if(LE .ne.0) then
if (allocated(lethk_all )) deallocate(lethk_all )
if (allocated(tethk_all )) deallocate(tethk_all )
if (allocated(s_all )) deallocate(s_all )
if (allocated(ee_all )) deallocate(ee_all )
if (allocated(C_le_x_top_all )) deallocate(C_le_x_top_all )
if (allocated(C_le_x_bot_all )) deallocate(C_le_x_bot_all )
if (allocated(C_le_y_top_all )) deallocate(C_le_y_top_all )
if (allocated(C_le_y_bot_all )) deallocate(C_le_y_bot_all )
if (allocated(LE_vertex_ang_all)) deallocate(LE_vertex_ang_all)
if (allocated(LE_vertex_dis_all)) deallocate(LE_vertex_dis_all)
if (allocated(sting_h_all )) deallocate(sting_h_all )
Allocate(lethk_all(na))
Allocate(tethk_all(na))
Allocate(s_all(na))
Allocate(ee_all(na))
Allocate(C_le_x_top_all(na))
Allocate(C_le_x_bot_all(na))
Allocate(C_le_y_top_all(na))
Allocate(C_le_y_bot_all(na))
Allocate(LE_vertex_ang_all(na))
Allocate(LE_vertex_dis_all(na))
!Allocate(sting_l_all(na))
Allocate(sting_h_all(na,2))
k=1
do i=1,na
if (k<=na)then
lethk_all(k)=bspline_LE(i,2)
tethk_all(k)=bspline_LE(i,3)
s_all(k)=bspline_LE(i,4)
ee_all(k)=bspline_LE(i,5)
C_le_x_top_all(k)=bspline_LE(i,6)
C_le_x_bot_all(k)=bspline_LE(i,7)
C_le_y_top_all(k)=bspline_LE(i,8)
C_le_y_bot_all(k)=bspline_LE(i,9)
LE_vertex_ang_all(k)=bspline_LE(i,10)
LE_vertex_dis_all(k)=bspline_LE(i,11)
sting_l_all(k)=bspline_LE(i,12)
sting_h_all(k,1)=bspline_LE(i,13)
sting_h_all(k,2)=bspline_LE(i,14)
k=k+1
end if
end do
end if
endif
!############################################
!This part of the program writes down the data points for the Bspline created using
!the control points
!open(150,file='curv_cp.dat')
! do i=1,20
! write(150,200)curv_cp(i,1:na*2)
! end do
!
!open(160,file='thk_cp.dat')
! do i=1,20
! write(160,200)thk_cp(i,1:na*2)
! end do
!200 format(22f15.2)
end subroutine span_output