-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsection.f90
101 lines (85 loc) · 3.83 KB
/
section.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
module section_m
use airfoil_m
implicit none
type section_t
integer :: iSec
real :: P1(3)
real :: P2(3)
real :: PC(3)
real :: dl(3) !vector from P1 to P2
real :: temp_P1(3),temp_P2(3) !temporary values used for testing
real :: chord_c,chord_1,chord_2
real :: percent_c,percent_1,percent_2
real :: ds
real :: ua(3)
real :: un(3)
real :: us(3)
real :: uf(3) !flap deflection unit vector. For viewing purposes only
real :: Rroot(3)
real :: zeta(3)
real :: cf_c !flap percentage of chord
real :: ef !epsilon_f (See Phillips Eq. 1.7.12)
real :: Cmdelta !Cm,delta (See Phillips Eq. 1.7.14)
real :: control_deflection !set in plane.f90
real :: alpha
real :: v(3) !local velocity
real :: viom !dynamic pressure scaling value used by Phillips. Don't fully trust. Fix this someday.
type(airfoil_t),pointer :: af1
type(airfoil_t),pointer :: af2
real :: Gamma
real :: F(3),M(3) !force and moment about the local quarter-chord divided by dynamic pressure
real :: Load_F(3),Load_M(3) !aerodynamic force and moment distributed loads
!For Geometry Purposes
real :: twist,twist1,twist2
real :: dihedral,dihedral1,dihedral2
real :: sweep
! For propeller purposes
real :: r1,r2,rc !radius from hub center
real :: aL0
real :: beta
real :: einf,ei
end type section_t
contains
!-----------------------------------------------------------------------------------------------------------
real function sec_CLa(t)
type(section_t),pointer :: t
sec_CLa = sec_weight(t, af_CLa(t%af1,t%alpha), af_CLa(t%af2,t%alpha))
end function sec_CLa
!-----------------------------------------------------------------------------------------------------------
real function sec_CL(t)
type(section_t),pointer :: t
real :: etad
if(abs(t%control_deflection)*180.0/pi.lt.11.0) then
etad = 1.0
else
!etad = m*x + b
etad = -8.71794871794872E-03*abs(t%control_deflection)*180.0/pi + 1.09589743589744
end if
sec_CL = sec_weight(t, af_CL(t%af1,t%alpha), af_CL(t%af2,t%alpha)) + sec_CLa(t)*t%ef*etad*t%control_deflection !includes flaps
end function sec_CL
!-----------------------------------------------------------------------------------------------------------
real function sec_CD(t)
type(section_t),pointer :: t
sec_CD = sec_weight(t, af_CD(t%af1,t%alpha), af_CD(t%af2,t%alpha)) + 0.002*180.0/pi*abs(t%control_deflection) !rough estimate for flaps
end function sec_CD
!-----------------------------------------------------------------------------------------------------------
real function sec_Cm(t)
type(section_t),pointer :: t
sec_Cm = sec_weight(t, af_Cm(t%af1,t%alpha), af_Cm(t%af2,t%alpha)) + t%Cmdelta*t%control_deflection !includes flaps
end function sec_Cm
!-----------------------------------------------------------------------------------------------------------
real function sec_stalled(t)
type(section_t),pointer :: t
real :: sCLmax
sec_stalled = 0
sCLmax = sec_weight(t, t%af1%CLmax, t%af2%CLmax)
if(sec_CL(t) > sCLmax) sec_stalled = sec_CL(t) - sCLmax
end function sec_stalled
!-----------------------------------------------------------------------------------------------------------
real function sec_weight(t,root,tip)
type(section_t),pointer :: t
real :: root,tip
sec_weight = root*(1.0 - t%percent_c) + tip*t%percent_c
end function sec_weight
!-----------------------------------------------------------------------------------------------------------
end module section_m