0% found this document useful (0 votes)
18 views17 pages

Wind Rotor Blade CAD Code Guide

Uploaded by

skt22022000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views17 pages

Wind Rotor Blade CAD Code Guide

Uploaded by

skt22022000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

108

APPENDIX A

COMPUTER CODES TO PREPARE


WIND ROTOR BLADE CAD MODEL

To analysis of the blade structure in this study, a computer aided engineering


(CAE) tool, ANSYS, which based on the finite element method (FEM) is used. In
this case, it is necessary to construct the 3 dimensional (3D) blade model by using a
computer aided design (CAD) tool such as AutoCAD. For this aim, a computer
program was developed to construct the 3D CAD model automatically by using
AutoLISP which is the own computer language of AutoCAD.

The program uses two data file which contains dimensionless blade and airfoil
geometry. While program is running, the radius of the blade is entered. By the way,
real coordinates are calculated for specified radius by using the dimensionless blade
and airfoil data. Airfoil data file includes the coordinates of points on the airfoil
boundary which has unit chord length. Blade geometry data file includes three
different data for each blade section : twisting angle, dimensionless chord and
dimensionless radius.

At the first step, the program constructs the 3D wire frame model of the blade.
The wire frame model includes 3D airfoil shaped lines for each blade section. There
are four surface area for each blade segment because of to put aside the problems
about FEM mesh generation. Therefore, each airfoil shaped line is formed by to come
together four single line. End point of each single line is connected with end point of
another single line which is at the next section. 3D spiral shaped line connects the
end points of two single line which are located at consecutive blade sections. So, the
109

boundary lines of each area are constructed. At the second step, the program
constructs surface model of the blade by using the wire frame model.
Scaling
Airfoil data file contains the geometry of an airfoil which has unit length. Scaling
is used because of different chord length of the blade section.
X=xc (A.1a)
Y=yc (A.1b)
c = R (c/R) (A.2)
where x and y are the coordinates of the point on unit length airfoil, c is the chord
length of the blade section, and c/R is the dimensionless chord length and R is the
radius of the blade.
Center of Twist
To avoid the stall, it is necessary to restrain the angle of attack. The flow angle
increases from tip to root (see Fig. 2.4 and 2.5). So, wind turbine rotor blades usually
twists around an axis because of to restrain the angle of attack. Center of twist is
defined as a point where the twisting axis intersects the blade section; and it effects
the center of gravity of the blade.

Figure A.1 Top view of the blade.


Center of twist is %28c far from the leading edge.
110

Figure A.2 Top view of the blade. Center of twist is at the leading edge (%0c).

Because of the center of twist, it is necessary to add a coordinate transformation


term to the equation of scaling for to determine the point coordinates of non-twist
airfoil. This coordinate transformation is applied before the twist. Therefore, the
coordinate axis is displaced through the X axis -or the chord line- only; and there is
not any displacement through the Y axis.

Figure A.3 Coordinate transformation for center of twist


111

So, the Equation (A.1) becomes


X0 = x c + c Percent (A.3a)
Y0 = y c (A.3b)
where Percent is the distance between leading edge and center of twist as percentage
of the chord c.
Coordinate Transformation
The airfoil data file contains the geometry of an airfoil which has zero setting
angle. Coordinate transformation is used because of non-zero setting (or twisting)
angle of the blade section. If it is assumed that the point P is on the airfoil boundary
and a is the twisting angle of the blade section, the twisting coordinates X1 and Y1
are expressed as follows,
X1 = OA + AX1
Y1 = OB - BY1
X1 = X0cos a + Y0sin a
Y1 = Y0cos a - X0sin a
X1 = (x c + c Percent)cos a + y c sin a (A.4a)
Y1 = y c cos a - (x c + c Percent)sin a (A.4b)
112

Figure A.1 Coordinate transformation for twist angle


This program does not construct the blade tip. Because of some problems during
the FEM analysis, the blade tip is neglected.

Important Program Parameter List

radius Radius of the blade tip


prcent Distance between the center of twist and leading edge as percentage of
the chord
spr Number of 3D spiral division (spiral is constructed by connecting 3D
straight lines)
origin Coordinates of the center of twist
ist Number of blade section
blm Number of panel which describes the shape of airfoil
pt Dimensionless airfoil data list
rad Radius of the blade section
chord Chord length of the blade section
setang Setting or twisting angle of the blade section, (deg)
oa Setting or twisting angle of the blade section, (rad)
px, py Transformed coordinates X0 and Y0 respectively, (Eq. A.3)
x, y Transformed coordinates X1 and Y1 respectively, (Eq. A.4)
ang1, ang2 Angels between X axis and end-point lines which connects the center
of twist and end-points of a 3D spiral
dist1, dist2 Distance between end-points of a 3D spiral and the center of twist
113

;;;;**************************************************************************** ;;;;
;;;; THE CODES BELOW ARE AN AUTOLISP FILE. THIS PROGRAM CONSTRUCTS ;;;;
;;;; THE SINGLE BLADE CAD MODEL OF A WIND TURBIN ROTOR . ;;;;
;;;;**************************************************************************** ;;;;

(princ "\nCommand PALSFM draws wind turbine blade surface model.")

(defun c:palsfm (/ ang ang1 ang2 dist1 dist2 angincr distincr dstincr zincr
fname1 fname2 f1 f2 radius prcent spr origin sf
dlm blm blm1 blm2 rail dt data len ist height dst
ent1 ent2 ent3 ent4 ent5 ent6 ent7 ent8 sset1
ctp ctr ct1 ct2 ct3 ct3x xo yo x y z xx
aa a a0 a1 a2 a3 bb b b0 b1 b2 b3
cc c c0 c1 c2 c3 dd d d0 d1 d2 d3
p p1 p2 pt pt2 pt4 pnt pnt1 pnt2
rpa rpb rpc rpd
)
;;;;;DATA INPUT
(setq fname1 (getfiled "Select Blade Geometry Data File" "c:/" "dat" 8)
fname2 (getfiled "Select Airfoil Geometry Data File" "c:/" "dat" 8))
radius (getreal "Radius of the blade:")
prcent (getreal "Center of twist -percent of the chord from leading edge- <0>:")
)
(if (= prcent nil) (setq prcent 0.0))
(setq spr (getint "Number of 3D spiral division <20>:"))
(if (= spr nil) (setq spr 20))
(setq origin (list 0.0 0.0 0.0)) ;center of 3D-spirals
;;;;;CALCULATIONS AND DRAWING WIREFRAME MODEL OF THE BLADE
(setq f1 (open fname1 "r"))
(setq f2 (open fname2 "r"))
(setvar "CMDECHO" 0)
114

(xload "geomcal")
(command "OSNAP" "off" "LAYER" "N" "SURFACE" "N" "FRAME1" "N")
(command "FRAME2" "N" "FRAME" "S" "FRAME" "")
(setq dt (read-line f1))
(setq ist (read (read-line f1))) ;number of station
(setq dt (read-line f1))
(setq dt (read-line f2))
(setq blm (read (read-line f2))) ;number of panel
(setq dt (read-line f2))
(setq ct1 2 ct2 1
dlm (- ist 1)
blm1 (+ blm 1)
blm2 (+ (/ blm 2) 1)
pt (list '())
pnt1 (list '())
rail (list '())
sset1 (ssadd)
)
;;;;;Degree To Radian -angle conversion function-
(defun dtr (x) (* pi (/ x 180.0)))
;;;;;Reading airfoil geometry data from a file
(repeat blm1
(setq dt (read-line f2)
len (strlen dt)
xo (atof (substr dt 1 10))
yo (atof (substr dt 11 (- len 10)))
data (list xo yo)
pt (append pt (list data))
)
)
(close f2)
115

(setq ctr 1 xx 1)
;;;;;Drawing the airfoil shaped section of first blade station
(setq dt (read-line f1)
len (strlen dt)
rad (* (atof (substr dt 1 10)) radius)
chord (* (atof (substr dt 11 10)) radius)
setang (atof (substr dt 21 10))
r (/ chord 4)
oa (dtr setang)
)
(repeat 4
(command "PLINE")
(while (<= ctr (+ 1 (* (/ blm 4) xx)))
(setq p (nth ctr pt)
px (* (- (car p) prcent) chord)
py (* (cadr p) chord)
x (- (* px (cos oa)) (* py (sin oa)))
y (+ (* py (cos oa)) (* px (sin oa)))
p (list x y rad)
pnt1 (append pnt1 (list p))
)
(command p)
(setq ctr (+ ctr 1))
)
(command "")
(setq ent1 (entlast))
(ssadd ent1 sset1)
(setq ctr (- ctr 1)
xx (+ xx 1)
)
)
116

;;;;;Reading data and drawing airfoil sections of other stations


;--->Beginning of LOOP1 : main loop for each station
(while (<= ct1 ist)
(setq ct2 1)
;;;Reading other airfoil sections data
(setq dt (read-line f1)
len (strlen dt)
rad (* (atof (substr dt 1 10)) radius)
chord (* (atof (substr dt 11 10)) radius)
setang (atof (substr dt 21 (- len 20)))
)
(setq ctr 1 xx 1
pnt2 (list '())
)
(setvar "CLAYER" "FRAME")
;;;Draws airfoil section at 4 steps so an airfoil section contains 4 pline:
(repeat 4
(command "PLINE")
(while (<= ctr (+ 1 (* (/ blm 4) xx)))
(setq p (nth ctr pt)
px (* (- (car p) prcent) chord)
py (* (cadr p) chord)
oa (dtr setang)
x (- (* px (cos oa)) (* py (sin oa)))
y (+ (* py (cos oa)) (* px (sin oa)))
p (list x y rad)
pnt2 (append pnt2 (list p))
)
(command p)
(setq ctr (+ ctr 1))
117

)
(command "")
(setq ent1 (entlast))
(ssadd ent1 sset1)
(setq ctr (- ctr 1)
xx (+ xx 1)
)
)
;;;;;DRAWING 3D SPIRALS
;---->Beginning of LOOP2 : loop for drawing 3D spirals
(setq ctx -1 ct3x (list 0 (/ blm 4) (/ blm 2) (/ (* blm 3) 4)))
(repeat 4
(setq ctx (+ ctx 1)
ct3 (nth ctx ct3x)
pt2 (nth (+ ct3 1) pnt1)
pt4 (nth (+ ct3 1) pnt2)
zincr (/ (- (caddr pt4) (caddr pt2)) spr)
p1 (list (car pt2) (cadr pt2) 0.0)
p2 (list (car pt4) (cadr pt4) 0.0)
ang1 (angle origin p1)
ang2 (angle origin p2)
dist1 (distance origin p1)
dist2 (distance origin p2)
)
(if (= ct3 (/ blm 4)) (setvar "CLAYER" "FRAME1"))
(if (= ct3 (/ blm 2)) (setvar "CLAYER" "FRAME"))
(if (= ct3 (/ (* blm 3) 4)) (setvar "CLAYER" "FRAME2"))
(if (and (/= (car pt2) (car pt4))
(/= (cadr pt2) (cadr pt4))
)
118

(progn
(setq ang12 (dtr (cal "ang(origin,p2,p1)")))
(if (> ang12 pi) (setq ang12 (- (* 2 pi) ang12) incr 1.0))
(setq angincr (/ (* ang12 -1) spr)
distincr (/ (- dist2 dist1) spr)
z (caddr pt2)
)
(command "3DPOLY" pt2)
(setq ctp 1)
(repeat spr
(setq ang1 (+ ang1 angincr)
dist1 (+ dist1 distincr)
x (car (polar origin ang1 dist1))
y (cadr (polar origin ang1 dist1))
z (+ z zincr)
pnt (list x y z)
ctp (+ ctp 1)
)
(command pnt)
(if (= ctp (/ spr 2)) (setq spt pnt))
)
(command "")
)
)
(if (and (= (car pt2) (car pt4))
(= (cadr pt2) (cadr pt4))
)
(progn
(command "LINE" pt2 pt4 "")
(setq spt (mapcar '(lambda (x) (/ x 2.0))
119

(mapcar '+ pt2 pt4)


)
)
)
)
(setq rail (append rail spt)) ;spt is the list of 3D spirals
) ;midpoint's list
;<----End of LOOP2
(setq ct1 (+ ct1 1)
pnt1 pnt2 ;=>upper section airfoil data of the curent step
) ; becomes lower section airfoil data
) ; for the next step
(close f1)
;<---End of LOOP1
; ---- ! THE CODES BELOW ARE JUST USABLE IN AMD ! ----
;;;;;GENERATE THE BLADE SURFACE MODEL FROM THE WIRE FRAME MODEL
(command "LAYER" "S" "SURFACE" "OFF" "SURFACE" "Y" "")
(setq vp (list 0 -1 0))
(command "VPOINT" vp)
(setq sf 0)
(setvar "CMDDIA" 0)
(while (<= sf (- ist 2))
(setq a (* sf 4) aa (+ a 4) a0 (* a 3)
a1 (+ a0 1) a2 (+ a0 2) a3 (+ a0 3)
b (+ a 1) bb (+ b 4) b0 (* b 3)
b1 (+ b0 1) b2 (+ b0 2) b3 (+ b0 3)
c (+ a 2) cc (+ c 4) c0 (* c 3)
c1 (+ c0 1) c2 (+ c0 2) c3 (+ c0 3)
d (+ a 3) dd (+ d 4) d0 (* d 3)
d1 (+ d0 1) d2 (+ d0 2) d3 (+ d0 3)
sf (+ sf 1)
ent1 (ssname sset1 a)
120

ent2 (ssname sset1 b)


ent3 (ssname sset1 c)
ent4 (ssname sset1 d)
ent5 (ssname sset1 aa)
ent6 (ssname sset1 bb)
ent7 (ssname sset1 cc)
ent8 (ssname sset1 dd)
rpa (list (nth a1 rail) (nth a2 rail) (nth a3 rail))
rpb (list (nth b1 rail) (nth b2 rail) (nth b3 rail))
rpc (list (nth c1 rail) (nth c2 rail) (nth c3 rail))
rpd (list (nth d1 rail) (nth d2 rail) (nth d3 rail))
)
(command "LAYER" "OFF" "FRAME2" "ON" "FRAME1" "")
(command "AMSWEEPSF" ent1 ent5 "" rpa rpb "")
(command "AMSWEEPSF" ent2 ent6 "" rpb rpc "")
(command "LAYER" "OFF" "FRAME1" "ON" "FRAME2" "")
(command "AMSWEEPSF" ent3 ent7 "" rpc rpd "")
(command "AMSWEEPSF" ent4 ent8 "" rpd rpa "")
)
;-----------------------------------------------------------------
(command "LAYER" "ON" "*" "")
(command "REDRAW")
(setq checklayer 1)
(setvar "CMDECHO" 1)
(setvar "CMDDIA" 1)
(princ)
)
121

Blade Geometry Data File

It is important that each data must contain 10 characters, include space; and
number of data rows must be indicated on the second row.

STATION NUMBER
30
R C/R SET. ANG.
.190 .149 16.348
.217 .145 15.580
.244 .141 14.812
.271 .137 14.045
.298 .133 13.277
.325 .129 12.509
.352 .124 11.741
.379 .120 10.973
.406 .116 10.205
.433 .112 9.437
.460 .108 8.669
.487 .104 7.901
.514 .100 7.134
.541 .095 6.366
.568 .091 5.598
.595 .087 4.830
.622 .083 4.062
.649 .079 3.294
.676 .075 2.526
.703 .071 1.758
.730 .066 .991
.757 .062 .223
.784 .058 .223
.811 .054 .223
.838 .050 .223
.865 .046 .223
.892 .041 .223
.919 .037 .223
.946 .033 .223
.973 .029 .223
122

Airfoil Geometry Data File

It is important that each data must contain 10 characters, include space; and
number of data rows must be indicated on the second row.

NUMBER OF PANELS
120
---X--- ---Y---
1.000000 0.000000
0.999313 -0.000083
0.997252 -0.000330
0.993825 -0.000740
0.989040 -0.001308
0.982910 -0.002031
0.975452 -0.002902
0.966688 -0.003914
0.956640 -0.005058
0.945337 -0.006326
0.932810 -0.007708
0.919093 -0.009193
0.904224 -0.010772
0.888244 -0.012431
0.871197 -0.014162
0.853130 -0.015951
0.834092 -0.017787
0.814136 -0.019658
0.793316 -0.021553
0.771690 -0.023460
0.749318 -0.025366
0.726260 -0.027259
0.702580 -0.029128
0.678344 -0.030958
0.653617 -0.032738
0.628468 -0.034453
0.602966 -0.036091
0.577180 -0.037636
0.551183 -0.039074
0.525045 -0.040390
0.498838 -0.041570
0.472635 -0.042599
0.446507 -0.043460
0.420526 -0.044141
0.394764 -0.044626
0.369292 -0.044901
123

0.344180 -0.044956
0.319496 -0.044777
0.295309 -0.044356
0.271685 -0.043685
0.248690 -0.042756
0.226386 -0.041567
0.204834 -0.040114
0.186771 -0.038408
0.168116 -0.036507
0.149914 -0.034561
0.132285 -0.032662
0.115352 -0.030859
0.099232 -0.029169
0.084042 -0.027577
0.069887 -0.026048
0.056864 -0.024528
0.045058 -0.022952
0.034542 -0.021248
0.025371 -0.019340
0.017589 -0.017154
0.011223 -0.014623
0.006286 -0.011685
0.002779 -0.008291
0.000690 -0.004403
0.000000 0.000000
0.000680 0.004820
0.002699 0.009938
0.006026 0.015320
0.010629 0.020911
0.016485 0.026638
0.023572 0.032414
0.031878 0.038142
0.041396 0.043720
0.052129 0.049045
0.064088 0.054021
0.077288 0.058563
0.091751 0.062601
0.107502 0.066088
0.124570 0.068996
0.142979 0.071324
0.162754 0.073097
0.183909 0.074363
0.207380 0.075179
0.228975 0.075678
0.251310 0.075882
0.274324 0.075795
0.297954 0.075423
124

0.322136 0.074775
0.346804 0.073864
0.371889 0.072701
0.397324 0.071301
0.423040 0.069679
0.448965 0.067853
0.475029 0.065838
0.501162 0.063654
0.527291 0.061319
0.553345 0.058849
0.579254 0.056265
0.604946 0.053583
0.630351 0.050822
0.655400 0.047998
0.680024 0.045128
0.704156 0.042229
0.727730 0.039317
0.750682 0.036408
0.772949 0.033516
0.794469 0.030656
0.815185 0.027844
0.835039 0.025093
0.853977 0.022419
0.871948 0.019834
0.888902 0.017353
0.904793 0.014989
0.919578 0.012756
0.933216 0.010667
0.945670 0.008733
0.956906 0.006967
0.966893 0.005381
0.975604 0.003983
0.983016 0.002784
0.989108 0.001791
0.993864 0.001012
0.997270 0.000451
0.999317 0.000113
1.000000 0.000000

You might also like