Skip to content

Commit b3ee605

Browse files
committed
Added option in wake data output module to calculate streamwise wake deficit on a plane, averaged over the last revolution simulated. The description of this
plane is currently hardcoded in the wakedata module, but the calculation of the output is fairly general. Could eventually generalize the wake data output geometry, along with the turbine geometry, with a geometry preprocessor. JCM
1 parent 8d75a85 commit b3ee605

File tree

5 files changed

+91
-7
lines changed

5 files changed

+91
-7
lines changed

Doc/Input_Description

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ hAG (real): Height above ground at base of blades (ft)
7272
CTExcrM (real): Additional machine level excrescence torque based on tip speed and Rmax, CTExcrM = TorqueExcr / (1/2*rho*Utip^2*Rmax^3) (default: 0)
7373

7474
Optional outputs:
75-
WakeOutFlag (int): 1 to write wakeline outputs for the element indicies noted below, 0 otherwise (default).
75+
WakeOutFlag (int): 1 to write wakeline outputs for the element indicies noted below, 2 to include average wake velocity deficit (on a plane with
76+
definition that's currently hardcoded in wakedata module), 0 otherwise (default).
7677
WLI (int): Array (comma separated) of element end indicies for which to write wake line data.
7778

7879

Doc/Output_Description

+7
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ te (-): Torque coefficient from the element, Torque / (1/2*rho*Uinf^2*Af*R), w
5757
in the input file).
5858
LogicFlags: Twelve logic flags related to the dynamic stall models for model testing... (see BVLogicOutputs and LBLogicOutputs in the code)
5959

60+
6061
Wake Data Output (_WakeData.csv):
6162

6263
Timestep: Timestep counter.
@@ -70,3 +71,9 @@ Z/R: Z location of the wake node normalized by turbine radius, R, which is the
7071
U/Uinf: X velocity of the wake node normalized by freestream speed, Uinf.
7172
V/Uinf: Y velocity of the wake node normalized by freestream speed, Uinf.
7273
W/Uinf: Z velocity of the wake node normalized by freestream speed, Uinf.
74+
75+
76+
Streamwise Wake Deficit Data Output (_WakeDefData.csv):
77+
78+
2D array of streamwise wake deficit normalized by freestream speed. X (streamwise direction) varies down a column, Z varies across a row.
79+

mod/wakedata.f95

+22-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,25 @@ MODULE wakedata
33
! Wake visualization data for WriteWakeData
44

55
integer :: WakeOutFlag
6-
real, allocatable :: WakeDefAve(:,:)
76
integer, allocatable :: WakeLineInd(:)
87
integer :: NWakeInd
98
character(1000) :: WakeOutHead = 'Timestep,Element,X/R,Y/R,Z/R,U/Uinf,V/Uinf,W/Uinf'
9+
10+
! Wake deficit calculation performed if WakeOutFlag=2
11+
! JCM test: wake deficit output plane is currently hardcoded...
12+
integer :: nxgrid = 141
13+
integer :: nzgrid = 81
14+
real :: ygrid = 1.2325
15+
real :: xgridL = -2
16+
real :: xgridU = 5
17+
real :: zgridL = -2
18+
real :: zgridU = 2
19+
integer :: xcount, zcount, ntcount
20+
real :: dxgrid, dzgrid
21+
real :: PointGrid(3), IndVelGrid(3)
22+
real, allocatable :: XGrid(:,:)
23+
real, allocatable :: ZGrid(:,:)
24+
real, allocatable :: SVDef(:,:)
1025

1126

1227
CONTAINS
@@ -15,7 +30,12 @@ SUBROUTINE wakedata_cns()
1530

1631
! Constructor for the arrays in this module
1732

18-
allocate(WakeLineInd(NWakeInd))
33+
allocate(WakeLineInd(NWakeInd))
34+
35+
! JCM test: wake deficit output
36+
allocate(XGrid(nxgrid,nzgrid))
37+
allocate(ZGrid(nxgrid,nzgrid))
38+
allocate(SVDef(nxgrid,nzgrid))
1939

2040
End SUBROUTINE
2141

src/CACTUS.f95

+9-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ PROGRAM CACTUS
5555
real :: cpave, cpave_last
5656
real :: delt, delty, deltb, deltr
5757

58-
character(80) :: InputFN, SFOutputFN, RevOutputFN, TSOutputFN, ELOutputFN, RegOutputFN, WakeOutputFN, FNBase
58+
character(80) :: InputFN, SFOutputFN, RevOutputFN, TSOutputFN, ELOutputFN, RegOutputFN, WakeOutputFN, WakeDefOutputFN, FNBase
5959

6060
! Pi definition
6161
pi = 4.0*atan(1.0)
@@ -124,9 +124,15 @@ PROGRAM CACTUS
124124
end if
125125

126126
! Optional wake line data output
127-
if (WakeOutFlag == 1) then
127+
if (WakeOutFlag > 0) then
128128
WakeOutputFN=trim(FNBase)//'_WakeData.csv'
129129
OPEN(12, FILE=WakeOutputFN)
130+
131+
if (WakeOutFlag > 1) then
132+
! wake deficit surface output
133+
WakeDefOutputFN=trim(FNBase)//'_WakeDefData.csv'
134+
OPEN(13, FILE=WakeDefOutputFN)
135+
end if
130136
end if
131137

132138
! If wake update interval set to a negative number, set next wake update iteration to -1 (no wake velocity updates will be performed)
@@ -333,7 +339,7 @@ PROGRAM CACTUS
333339
end if
334340

335341
! Write current wake data for viewing in Matlab
336-
if (WakeOutFlag == 1) then
342+
if (WakeOutFlag > 0) then
337343
Call WriteWakeData()
338344
end if
339345

src/WriteWakeData.f95

+51-1
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,26 @@ SUBROUTINE WriteWakeData()
77
use wallsoln
88
use configr
99

10+
implicit none
11+
1012
integer :: tCount, tCountMax, wcount
1113

1214
! Write header
1315
if (NT==1) then
1416
write(12,*) trim(WakeOutHead)
17+
18+
! JCM test: wake deficit setup
19+
ntcount=0
20+
21+
dxgrid=(xgridU-xgridL)/(nxgrid-1)
22+
dzgrid=(zgridU-zgridL)/(nzgrid-1)
23+
do xcount=1,nxgrid
24+
do zcount=1,nzgrid
25+
XGrid(xcount,zcount)=xgridL+(xcount-1)*dxgrid
26+
ZGrid(xcount,zcount)=zgridL+(zcount-1)*dzgrid
27+
SVDef(xcount,zcount)=0.0
28+
end do
29+
end do
1530
end if
1631

1732
! Write wake positions and velocity for each wake line on last rev
@@ -29,7 +44,42 @@ SUBROUTINE WriteWakeData()
2944
! Dont suppress carriage return on last column
3045
write(12,'(E13.7)') W(tCount,WakeLineInd(wcount))
3146
end do
32-
end do
47+
end do
48+
49+
50+
if (WakeOutFlag > 1) then
51+
52+
! Output blade, wake, and wall induced streamwise velocity deficit on a plane.
53+
54+
! Averaged over last revolution
55+
do xcount=1,nxgrid
56+
do zcount=1,nzgrid
57+
58+
! Calculate wall and wake induced velocities at grid
59+
PointGrid=[XGrid(xcount,zcount),ygrid,ZGrid(xcount,zcount)]
60+
Call CalcIndVel(NT,ntTerm,NBE,NB,NE,PointGrid,IndVelGrid)
61+
SVDef(xcount,zcount)=SVDef(xcount,zcount)+IndVelGrid(1)/nti
62+
63+
end do
64+
end do
65+
ntcount=ntcount+1
66+
67+
! Write on last iter
68+
if (ntcount == nti) then
69+
do xcount=1,nxgrid
70+
do zcount=1,nzgrid
71+
if (zcount < nzgrid) then
72+
write(13,'(E13.7,",",$)') SVDef(xcount,zcount)
73+
else
74+
! Dont suppress carriage return on last column
75+
write(13,'(E13.7)') SVDef(xcount,zcount)
76+
end if
77+
end do
78+
end do
79+
end if
80+
81+
end if
82+
3383
end if
3484

3585
Return

0 commit comments

Comments
 (0)