forked from ImperialCollegeLondon/WInc3D
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathacl_out.f90
76 lines (58 loc) · 3.58 KB
/
acl_out.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
module actuator_line_write_output
use actuator_line_turbine
use actuator_line_element
use actuator_line_controller
contains
subroutine actuator_line_element_write_output(act_line,dir)
implicit none
type(ActuatorLineType),intent(in) :: act_line
character(len=100),intent(in) :: dir
character(LEN=22) :: Format
integer :: ielem
open(2017,File=trim(dir)//'_'//trim(act_line%name)//'.load')
write(2017,*) 'ielem,X,Y,Z,rdist/R,AOA,adot,RE,ur,CL,CD,CM25,Cn,Ct,Fn,Ft,F1'
write(2017,*) '[-], [m],[m],[m],[-],[deg],[deg/s],[-],[m/s],[-],[-],[-],[-],[-],[N],[N],[-]'
Format="(I5,A,19(E14.7,A))"
do ielem=1,act_line%NElem
write(2017,Format) ielem,',',act_line%PEx(ielem),',',act_line%PEy(ielem),',',act_line%PEz(ielem),',',act_line%ERdist(ielem)/act_line%L,',',act_line%EAOA(ielem)*180/pi,',',act_line%EAOAdot(ielem)*pi/180,',',act_line%ERE(ielem),',',act_line%EUr(ielem),',',act_line%ECL(ielem),',',act_line%ECD(ielem),',',act_line%ECM(ielem),',',act_line%ECN(ielem),',',act_line%ECT(ielem),',',act_line%EFn(ielem),',',act_line%EFt(ielem),',',act_line%EEndeffects_factor(ielem)
end do
close(2017)
end subroutine actuator_line_element_write_output
subroutine dynamic_stall_write_output(act_line,dir)
implicit none
type(ActuatorLineType),intent(in) :: act_line
character(len=100),intent(in) :: dir
character(LEN=22) :: Format
integer :: ielem
open(2018,File=trim(dir)//'_'//trim(act_line%name)//'.dynstall')
write(2018,*) 'ielem,rdist/R,pitch,AOA,f'
Format="(I5,A,15(E14.7,A))"
do ielem=1,act_line%NElem
write(2018,Format)ielem,',',act_line%ERdist(ielem)/act_line%L,',',act_line%Epitch(ielem)*180/pi,',',act_line%EAOA(ielem)*180/pi,',',act_line%EDynstall(ielem)%fprime
end do
close(2018)
end subroutine dynamic_stall_write_output
subroutine actuator_line_turbine_write_output(turbine,dir)
implicit none
type(TurbineType),intent(in) :: turbine
character(len=100),intent(in) :: dir
character(LEN=22) :: Format
open(2016,File=trim(dir)//'_'//trim(turbine%name)//'.perf')
write(2016,*) 'Number of Revs, GeneratorSpeed, GeneratorTorque, BladePitch1, BladePitch2, BladePitch3, Omega, DOmega, Ux, Uy, Uz, Thrust, Torque, Power'
write(2016,*) '[-], [rad/s], [N m], [deg], [deg], [deg], [rad/s], [rad/s], [m/s], [m/s], [m/s], [N], [N m], [W]'
Format="(14(E14.7,A))"
write(2016,Format) turbine%AzimAngle/(2*pi),',',turbine%controller%GenSpeed,',',turbine%controller%GenTrq,',',turbine%controller%PitCom(1)*180.0_mytype/pi,',',turbine%controller%PitCom(2)*180.0_mytype/pi,',',turbine%controller%PitCom(3)*180.0_mytype/pi,',',turbine%angularVel,',',turbine%deltaOmega,',',turbine%Ux_upstream,',',turbine%Uy_upstream,',',turbine%Uz_upstream,',',turbine%Thrust,',',turbine%Torque,',',turbine%Power
close(2016)
end subroutine actuator_line_turbine_write_output
subroutine actuator_line_turbine_write_statistics(turbine,dir)
implicit none
type(TurbineType),intent(in) :: turbine
character(len=100),intent(in) :: dir
character(LEN=22) :: Format
open(2019,File=trim(dir)//'_'//trim(turbine%name)//'.stat')
write(2019,*) 'Cd_ave , Cp_ave , Torque_ave'
Format="(3(E14.7,A))"
write(2019,Format) turbine%CT_ave,',',turbine%CP_ave,',',turbine%Torque_ave
close(2019)
end subroutine actuator_line_turbine_write_statistics
end module actuator_line_write_output