Professional Documents
Culture Documents
Clment Nguyen
Supervisor : Dr. John Cater, Senior Lecturer
Internship report
Abstract
In order to complete my Master in Aeronautics at the Ecole Centrale de
Nantes, I was required to undertake a 4-month internship, which my supervisor John Cater from the University of Auckland agreed to host.
I have been charged to investigate the influence of the atmospheric boundary
layer and wake turbulence over wind turbine performance, using a SnS code
acting as a Large Eddy Simulation solver. The code was first developed at
the University of Sydney by Steve Armfield, then extended by Stuart Norris
at the University of Auckland. It was finally coupled to a FAST aero-elastic
model code by Rupert Storey as part of his PhD at the University of Auckland.
Given that I am majoring in Aeronautic Engineering, I was glad to be offered
the opportunity to extend my knowledge in other fields such as that of wind
turbines. However, at the start of my internship, I had to devote a significant
amount of time to reading relevant research papers in order to ensure that I
had a sound grasp of basic theory in this area, as it is not an area that I have
worked in extensively before. The purpose of this report is both to present
the completed investigations and the results obtained during this internship,
and also to provide the essentials a potential future intern would need to
resume and develop the project.
In the opening chapter of this report, I shall introduce the concept of the
atmospheric boundary layer. In the second chapter, I shall then explain the
numerical setup used for the simulations. The results of the simulations will
then be presented in the final chapter.
Many thanks to John for his warm hospitality, and for guiding me through
my internship, Stuart for his precious and invaluable help with the problems
I experienced with the code, and Rupert for introducing me to the relevant
theory and answering any questions I had. I am also grateful for the assistance with all the issues I had with the cluster, provided by Gene from Nesi.
Special thanks to Abi for proofreading this report.
Contents
1 Theoretical background
1.1 The atmospheric boundary layer . . . . . . . . . . . .
1.1.1 Introduction . . . . . . . . . . . . . . . . . . .
1.1.2 Classification . . . . . . . . . . . . . . . . . .
The convective state . . . . . . . . . .
The neutral state . . . . . . . . . . . .
The stable state . . . . . . . . . . . . .
1.1.3 Law of the wall . . . . . . . . . . . . . . . . .
1.2 Wind turbine performance . . . . . . . . . . . . . . .
1.2.1 Lift and Drag . . . . . . . . . . . . . . . . . .
1.2.2 Aerodynamic forces acting on a wind turbines
1.2.3 Wake turbulence and velocity deficit . . . . .
2 Numerical setup
2.1 Spatial setup . . . . . . . . . . . . . .
2.1.1 Domain and meshing . . . . . .
2.1.2 Boundary conditions . . . . . .
ABL simulations . . . . .
Wind turbine simulations
2.1.3 Methodology . . . . . . . . . .
2.2 Large Eddy Simulation . . . . . . . . .
2.3 The SnS code . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
rotor .
. . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
3
3
3
4
4
5
5
5
6
6
8
9
.
.
.
.
.
.
.
.
11
11
11
12
12
13
14
14
14
3 Results
16
3.1 ABL simulations . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2 Wind turbine simulations . . . . . . . . . . . . . . . . . . . . . 19
4 Conclusion
25
A.2
A.3
A.4
A.5
A.6
A.7
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
inflows for
. . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
. . . . . . . . . .
the turbine simu. . . . . . . . . .
.
.
.
.
.
27
28
28
29
29
. 30
31
37
Chapter 1
Theoretical background
The following section will provide the reader with a basic overview of the
theories explored in this report. Those who are already familiar with the
concepts involved with wind turbine modeling might want to choose to skip
this part. For further explanation of these theories, the reader should refer
to the works listed in the bibliography.
1.1
1.1.1
Wind turbines operate in the lowest layer of the atmosphere, the atmospheric
boundary layer (ABL). The ABL is defined as the part of the atmosphere
which is most directly influenced by the Earths surface. In reality, the totality of atmosphere is influenced by the grounds surface, but observations
show that we can isolate a layer (the ABL) where this influence is "fast".
This means that the ABL reacts with short time constants (approximately
twenty-four hours). The rest of the atmosphere (free troposphere, stratosphere and above) reacts with much longer times constants. Its height varies
with the time of day, from a couple of hundred meters at night, to a couple
of kilometers during the day.
The ABLs flow properties (such as wind speed, wind shear or turbulence levels) depend on the stability state in which the ABL is found. The purpose of
this study is to compare the effects of each state on wind turbine performance.
1.1.2
Classification
The ABL can be classified into three types (convective, neutral and stable)
and in order to distinguish them we introduce the concept of potential temperature , function of the height y, defined as :
R
P (y) Cp
(y) = T (y)
P0
(1.1)
where
T (y) is the absolute temperature
P (y) is the atmospheric pressure
P0 is the atmospheric pressure on the ground
R is the perfect gas constant
Cp is the air heat capacity
The potential temperature is the temperature of an air parcel if you move
it adiabatically to the surface. By adiabatically we understand that no heat
ex-change with the surroundings take place, in other words, the movement
is very fast. This concept is very well explained by Jacob Berg et al. [1].
Figure 1.1: The diurnal structure of the planetary boundary layer cycle
1.1.3
y
u
ln
y0
where
u is the velocity
u is the friction velocity
is the Von Krmn constant. = 0.41
y represents the height
(1.2)
1.2
1.2.1
a three-dimensional wing, the chord length varies with the spanwise position
z.
The profil is set within a flow (e.g. a wind tunnel). The air has a certain
speed, V (in our precursors simulations, we will try to aim at a wind speed
of 10 m/s at a reference height of 90 meters), measured far upstream of the
leading edge. Unlike certain cases in Aeronautics, the wind speed in a wind
turbine environment is always subsonic (i.e. below the speed of sound). In
that case, information can travel upstream since it spreads faster than the
fluid (information travels in the form of pressure waves spreading at the speed
of sound). In practice, this means that the air is already perturbed by the
presence of a plane or a wind turbine before even reaching it. This leads to
the streamlines following curved paths around the airfoil as we can see on
Figure 1.2. As a consequence, to get a hint of the wind speed the airfoil is
subject, it is mandatory to measure (or set it for our simulations) far enough
upstream of the leading edge so the velocity profile is not perturbed by the
presence of the wind turbine. Well see later in Section 2.1.1 that we choose
to place the turbine at a distance of 4D from the inlet, D being the turbines
diameter.
In general, the chord and the velocity vector from un certain angle called
the angle of attack. The higher angle of attack, the more deviated streamlines. In other words, the presence of the wing locally reorganizes the air
flow. The upper side of the wing is called the extrados whereas the lower
side of the wing is called the intrados. Close to the extrados, the flow is accelerated. The inverse effect occurs by the intrados. Basics in fluid dynamics
tell us that this leads to a pressure decrease on the extrados and a pressure
increase on the intrados. From the pressure difference between the extrados
and intrados results a global pressure force exerting upwards. Its the same
force that allows birds or plane to fly. This force can be decomposed into two
components (see Figure 1.3) : the drag force D (the streamwise direction
component) and the lift force L (perpendicular to the flow direction).
1.2.2
For a wind turbine, the problem gets more complex as the blades rotating
speed has to be taken into account which in practice, is significantly higher
than the wind speed.
Lets consider a blade profile obtained by cutting the blade at a certain
height between the hub and the blade tip. Such a section is illustrated by
Figure 1.4. The tangential velocity U (r) induced by the blades rotation is :
Figure 1.4: [2] Left : Illustration of the turbines section where Va represents
the relative veocity, the angle of attack and the pitch angle. Right :
Illustration of the resulting force generated by the air wind speed and the
blades rotation
.
U (r) = .r
(1.3)
where is the rotation speed and r is the distance from the turbines hub.
In addition to the tangential speed, the upstream wind speed V has to
be taken into account. As seen in the previous section, the flow is already
influenced by the turbines presence so that its velocity is decreased before
reaching the hub. In ideal cases, the speed would have lost a third of its
initial magnitude in the direction perpendicular to the rotation plane. The
Va . The latter (which includes the relative velocity magnitude Va but also
the angle of attack )has to be known to estimate the blades loads. An other
important parameter is the blades pitch angle . Unlike the angle of attack,
the pitch angle doesnt depend on the flow conditions. Its a geometric
parameter that can be controlled or adapted. Modifying the pitch angle
will modify the global angle of attack and thus the resulting force exerting
on the turbines rotor.
We can see on the right part of Figure 1.4 that the relative speed vector
F = FT + FN where FT is the tangential component and which contributes
to the useful effect desired (for lift based wind turbines). FN is the axial
component perpendicular to the rotation plane and has no desired effect.
On the contrary, it exerts a significant mechanic load on the turbine. By
decomposing the resulting aerodynamic force in its components, it can be
the other hand, the drag, D , contributes negatively to the rotors rotation. It
induces a strength in the wrong rotating direction and reduces the turbines
efficiency. Thats why wind turbines blades are designed to minimize the
drag.
In our case, the code uses the Actuator line method to calculate the
forces acting on the blades at each time step. A coupled SnS/FAST system
implemented by Rupert Storey during his PhD allows for the calculation of
the aerodynamic loads on the turbine (through the AeroDyn module) while
an over structural analysis module calculates the resultant response. For
more in depth explanations of the system coupling, please refer to Ruperts
PhD thesis [3].
1.2.3
The main purpose of this study is to analyze how the ABL stability state
affects the characteristics of the wake downstream. The wake is due to the
9
Figure 1.5: Evolution of the velocity profile through a wind turbine. The
ABLs velocity profile seen on the left part of the figure is recorded during
each precursor simulation and is injected in the inlet for the coupled simulations. The velocity profile shape varies with the stability and the roughness
surface as seen in Figure 3.1 of the results section.
loss of momentum through the thrust force exerted by the flow on the turbine.
As B.Sanderse explains in its lecture [4], the wake can be divided into a near
and a far wake (see Figure 1.5). The axial pressure gradient allows for the
development of the wake velocity deficit. Significant differences in velocity
magnitudes can be observed between the air inside and outside the wake
delimited by the streamlines at the edge. This results in a shear layer where
turbulent eddies are formed. The surrounding air then mixes with the air
inside the turbulent wake as the wake propagates downstream, thus adding
momentum to it. This phenomenon leads to a decrease of the velocity deficit
as the velocity magnitude increases to recover its initial value. Part of oue
study will be to point out where the maximum velocity deficit is reached as
well as highlighting which of the simulation allows for the fastest recover for
instance. This is an important parameter when designing wind farms where
wind turbines are often placed behind others and are therefore affected by
their wakes.
10
Chapter 2
Numerical setup
2.1
2.1.1
Spatial setup
Domain and meshing
The simulations are carried out within a parallelepiped rectangle domain (see
Figure 2.1) consisting of the dimensions: Lx , Ly and Lz . The axis x, y and
z respectively represent the streamwise, the vertical and the spanwise directions. Both ABL and wind turbine simulations are conducted within this
domain, but use different mesh grids since we need to refine the resolution
around the wind turbines operating area. In order to use the recorded inlet
velocity and temperature fields from the precursor simulations as inflows for
the coupled simulations, we need to interpolate these records into the new
wind-turbine simulations mesh (see Appendix A.7) .To perform it, the use
of a Cartesian mesh is the most appropriate since it allows for a much easier
interpolation.
For the precursor simulations, the domain is uniformly divided along the x
and z axis. Along the y axis, the first cells height from the ground is set first.
The vertical direction is then logarithmically divided above the first cell, in
order to scale with the vertical velocity gradient inducted by the LOTW approximation (see Figure 2.2).
For the wind turbine simulations, the domains mesh is progressively refined
in all directions as we get closer to the wind turbines operating zone.
The computational domain dimensions are set to Lx = 1512 m and Ly =
Lz = 1008 m. We chose the modeled wind turbines diameter to be D = 126
m. The turbines hub is placed at a distance of 4D = 504 m along the
streamwise direction from the inlet which allows for a long enough distance
of 8D to investigate the turbines wake. The turbine is set halfway along the
11
Figure 2.1: The computational domain - The axis x represents the flow
direction, the axis y represents the vertical direction and the axis z represents
the spanwise direction
Figure 2.2: Left: Precursor simulation x-y plane mesh. The resolution is
higher near the bottom wall to scale with the high vertical velocity gradient
in this area . Right: Coupled simulation x-y plane mesh showing the turbine
position (blue blades). The grid starts being refined 2D upstream from the
turbine and stops 4D downstream. The vertical resolution increases as we
get closer to the bottom wall.
2.1.2
Boundary conditions
12
coming out the domain through the outlet comes into the domain through the
inlet. This allows us to simulate an "infinite" flow along this axis. Velocity
turbulence is introduced by superimposing fluctuations on the inlet velocity
profile using Manns method. P is an input value which depends on the
wind speed aimed uref at the reference height yref . It has to be calculated
prior to the simulation, but how ?
The LOTW seen in Section 1.1.3 and evaluated at the reference height
gives us :
uref =
u yref
ln
y0
(2.1)
In our simulations the wind velocity aimed at the reference height is uref = 10
m/s and the roughness height of the surface for the offshore simulations is
set to y0 = 0.001 m. We can now deduce from 2.1 that u = 0.36 m/s. We
can also express the friction velocity as :
s
u =
(2.2)
2.1.3
Methodology
To investigate each of the three states seen in Section 1.1.2 , we adopted the
following process :
Simulation of the ABL within the domain (a parallelepiped rectangle)
and recording of velocities and temperature on the inlet, using the SnS
code developed by S.W. Armfield and S.E. Norris.
Use of the velocity and temperature fields as inflows to the wind turbine
wake simulation.
Post-process of each simulation and comparison with literature.
Modeling adjustment and new simulations.
2.2
2.3
The SnS code has been written using Fortran 95 and designed to simulate
incompressible transient flow on structured Cartesian meshes. It and uses a
second order Adams-Bashforth time stepping scheme. It solves the filtered
continuity equation, the filtered incompressible Navier-Stokes equations , and
the filtered transport equation for potential temperature for the stable and
convective states :
1 p ij
2 ui
ui
ui
+ uj
=
+
+ 2 + fi
t
xj
xi
xi
xj
(2.3)
ui
=0
xi
(2.4)
14
qj
+ uj
=
t
xj
xj
(2.5)
where
ui uj
+
)
(
2 xj
xi
(2.6)
For a more in depth explanation on how SnS works, please refer to works [5]
and [6] listed in the Bibliography.
15
Chapter 3
Results
3.1
ABL simulations
In this section the influence of the stability and the roughness over the windturbine performance is investigated in a similar way to Churchfield et al.
(2012) [7]. For each stability case, we performed two simulations with different surface roughness (y0onshore = 0.1 m and y0of f shore = 0.001 m). We
will stick with Churchfield et al.s notations and refer to each stability state
(neutral, unstable and stable) by its first letter ("N","U" or "S"). The letter
"L" (respectively "H") refers to the low roughness height y0 = 0.001 m case
(respectively to the high roughness height y0 = 0.1 m case). For each of the
six simulations, the total physical time simulated is 13600s and the simulations fields are averaged over the final 3600s of simulation time. Special
attention has been given to the neutral simulations so that the averaged velocity profile scales with the LOTW seen in Section 1.1.3. Figure 3.1 shows
the non-dimensional averaged horizontal velocity profiles for the low roughness precursor simulations plotted against the non-dimensional height. The
first observation that can be made is that the pressure jump P (see Section 2.1.2) calculated for each case, as well as the velocity control algorithm
developed by Rupert Storey [3] seems to be correct, as every velocity profile intersects into the reference point (yref = 90 m , uref = 10 m/s ) as
wanted. We can observe that increasing the ABLs stability state also increases the velocity shear. In the same way, increasing the surface roughness
while holding stability, increases the velocity shear. It can be clearly seen
that the averaged horizontal velocity profile of both unstable simulations are
flatter than the other cases. It may be due to the increased vertical mixing
caused by thermal buoyancy turbulence generated by the positive heat flux
for the unstable cases. We exhibited the contour of the instantaneous ver-
16
A
1
B
1.4
N-L
U-L
S-L
N-H
U-H
S-H
0.8
1.3
1.2
1.1
y/Ly
Ux/Uref
0.6
0.4
1
0.9
0.8
0.7
0.2
0.6
N-L
LOTW-L
0.5
0
0
0.2
0.4
0.6
0.8
1.2
1.4
0.4
0.1
1.6
10
<Ux>/Uref
100
1000
10000
y (m)
U-L
S-L
U-H
S-H
0.8
N-L
U-L
S-L
N-H
U-H
S-H
0.9
0.8
0.7
0.6
y/Ly
y/Ly
0.6
0.5
0.4
0.4
0.3
0.2
0.2
0.1
0
6
0
4
T (C)
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
17
y0 = 0.1 m
9.26 %
16.37 %
0.024 %
1
=
Uref
1
(< uu0 > + < vv 0 > + < ww0 >)
3
(3.1)
for each simulation and summarized the results into Figure 3.3.
The complete turbulence intensity profile for each simulation can be seen in
Figure 3.1. It can be observed that either increasing the surface roughness
while holding stability or decreasing the the ABLs stability while holding the
surface roughness increases the turbulence intensity at the reference height.
18
3.2
The coupled simulations are carried out using the NREL 5 MW wind
turbine whose rotor diameter is 126 m and hub height is 90 m [9]. The
simulations are run for 3600 s using the recorded ABL simulations field
from 10000 s to 13600 s. For each of the six ABL simulations, the transient
precursor simulation field dumped at 10000 s is interpolated into the new
mesh and used as the initial field for the wind turbines simulations. The
fields are averaged from 600 s to 3600 s for the neutral simulations. The
statistics calculation module would not work for the unstable and stable
cases. We circumvented this obstacle by dumping the transient field every
10 s from 600 s to 3600 s and averaging the data then. Figure 3.4 shows
the time-averaged streamwise velocity in the z = L2z vertical x y plan for
the N-L case. While post-processing the wind-turbine simulations with the
initial meshing, it has been found that the initial axial domain length Lx was
not high enough to appreciate the velocity recover for each case. Therefore
Lx was changed from 1512 m to 2520 m and the mesh grid adjusted, leaving
us with a length of 16D instead of 8D to investigate the wake.
Looking closer at the inlet, we can observe the velocity fluctuations inferred by the turbulence generated at the inlet using Manns method during
the precursor simulations. It doesnt pose an issue as the flow recovers before reaching the turbine. In accordance with the wake theory developed
Section 1.2.3, it can be seen in Figure 3.5 that the fluids velocity decreases
19
downstream of the turbines hub to a certain minimum (reached after a downstream distance of the turbine of approximatively 1D for the neutral cases
and 2D for the unstable cases) then starts to increase again to recover its initial value. Moreover, we can observe that the recovery wakes length increases
with stability while holding a constant roughness height and decreases when
the roughness height increases while holding stability. This is in agreement
with the turbulence intensity levels found for the ABL precursor simulations
Table 3.3. Indeed, higher turbulence intensity levels at the hub height are
Figure 3.6: Time averaged axial streamwise velocity for each simulation
20
1200
1000
800
800
600
600
400
400
200
200
0
0.1 0.05
0.05
0.1
0.15
0.2
0.25
2D
4D
6D
8D
10D
14D
1000
1200
2D
4D
6D
8D
10D
14D
0.3
0
0.05
0.35
0.05
0.1
U-L
1200
0.35
600
400
400
200
200
0.2
0.3
0.3
0.4
2D
4D
6D
8D
10D
14D
800
600
0.1
0.25
1000
800
0.2
1200
2D
4D
6D
8D
10D
14D
1000
0
0.1
0.15
U-H
0
0.05
0.5
N-L
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
N-H
1200
1000
800
800
600
600
400
400
200
200
0
0.1 0.05
0.05
0.1
0.15
0.2
0.25
2D
4D
6D
8D
10D
14D
1000
1200
2D
4D
6D
8D
10D
14D
0.3
0
0.3
0.35
0.2
0.1
U-L
1200
800
600
400
200
200
0.2
0.4
0.4
0.5
600
400
0.1
0.3
0.3
0.4
2D
4D
6D
8D
10D
14D
1000
800
0.2
1200
2D
4D
6D
8D
10D
14D
1000
0
0.1
0.1
U-H
0.5
0
0.2
0.6
N-L
0.1
0.1
0.2
0.3
N-H
2D
4D
6D
8D
10D
14D
1.5
1
1
0.5
z/D
0.5
z/D
2D
4D
6D
8D
10D
14D
1.5
0
0.5
0
0.5
1.5
1.5
2
0.1
0.15
0.2
0.25
0.3
0.35
0.4
2
0.14
0.45
0.16
0.18
0.2
0.22
U-L
2
0.3
0.32
1
0.5
z/D
z/D
0.28
2D
4D
6D
8D
10D
14D
1.5
0.5
0
0.5
0
0.5
1.5
1.5
2
0
0.05
0.1
0.15
0.2
2
0.05
0.25
0.1
0.15
N-L
0.2
0.25
0.3
N-H
2D
4D
6D
8D
10D
14D
2.5
2
2D
4D
6D
8D
10D
14D
2.5
2
1.5
y/D
1.5
y/D
0.26
2D
4D
6D
8D
10D
14D
1.5
1
0.5
1
0.5
0.5
0.5
0
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.05
0.1
0.15
U-L
0.2
0.25
0.3
0.35
0.4
0.45
U-H
2D
4D
6D
8D
10D
14D
2.5
2
2D
4D
6D
8D
10D
14D
2.5
2
1.5
y/D
1.5
y/D
0.24
U-H
1
0.5
1
0.5
0.5
0.5
0
0.05
0.1
0.15
0.2
0.25
N-L
0.05
0.1
0.15
0.2
0.25
0.3
N-H
Figure 3.9 shows the the turbine intensity profiles for different wake locations in the horizontal x z and vertical x y hub centered plane. As
expected, two turbulence peaks can be observed at the blades tip where sig23
nificant shear leads to high levels of TKE. Finally, the peaks magnitude are
higher for the unstable simulations which is in agreement with the faster
wake recovery for the unstable case as observed previously.
24
Chapter 4
Conclusion
In this study we first attempted to simulate six different ABL in an empty
parallelepiped rectangle domain, each with an aimed wind speed velocity
of 10 m.s1 at the reference height of 90 m. We were able to highlight
the atmospheric boundary layer behavior pattern specific to each case using time-averaged data. We observed through the time-averaged velocity
profiles that velocity shear increases when stability decreases or when the
surface roughness increases. Increased time-averaged turbulence levels and
mixing at the reference height have been observed for the least stable cases.
Once satisfied of the precursors simulations, we used their velocity and temperature fields as inflows data for the wind turbine simulations. The stable
coupled simulations were put aside after realizing that the results obtained
were not reliable, which may possibly come from an unadapted Sub-Grid
Scale model. We observed that the recovery wakes length increases with
stability while holding a constant roughness height and decreases when the
roughness height increases while holding stability. We exhibited that the velocity deficit minimum is reached after a downstream distance of the turbine
of approximatively 1D for the neutral cases and 2D for the unstable cases.
Finally, we showed that the velocity deficit magnitude increases with stability which was expected.
The investigations carried on in this study can serve as a starting point
for a potential intern who would like to resume the project. One might want
to carry out a mesh study and analyze the results dependency in regards
to the grid generated, as none has been performed yet. It would also be
interesting to determine the paralleling configuration allowing for the fastest
calculations (domains division, number of nodes, number of CPUs per node,
..). One might want to carry out a detailed analysis of the turbine loads.
Other boundary conditions can also be tested such as imposing a Neumann
25
To conclude this report, I would like to bring forward what this internship
brought me. It first allowed me to extend my knowledge in other fields than
aircrafts such as that of wind turbines. I was also interested to discover
non-commercial CFD code as it is clearly different than commercials one
such as STAR-CCM+, which is the main CFD software used at Centrale
Nantes. I believe that working with the latter does not really emphasize
the complexity of CFD codes as commercial CFD softwares are somewhat
robust and have a convenient user interface. I already find the use of a
non-commercial CFD code sometimes frustrating (as of the amount of errors
you get when running simulations) and I have just been using it. I cannot
yet empathize the complexity nor the frustration of writing such a code,
although I believe obtaining relevant results out of simulations is rewarding.
Moreover, I am also glad to have been introduced to Linux and LATEX. While
simulations were running, I also had time to discover Fortran 95, which is
the programming language graduate students are asked to use at Purdue
University. I will begin a MSc. in Aeronautical Engineering there two weeks
from now and I intend to follow courses related to Aerodynamics and CFD
modeling of turbulent flows. Needless to say that this internship will be of
great value for the rest of my studies.
26
Appendix A
Using the NeSI computing
Cluster
An intern who has never used a high performance computing facility before
should consider attending the Centre for eResearch introductory workshop
taking place on Wednesdays. More information can be found here.
A.1
What is a Cluster ?
A.2
The first step is to apply for an account on NeSIs website. Once your account
is created, and you have access to a Linux distribution (ask Dr. Stuart Norris
to obtain a user session on Newmarkets campus), open the Terminal. Then
type :
ssh user_upi@login.uoa.nesi.org.nz
27
You are now connected to the clusters login node. You will be able to
queue jobs from this node. The other node, called the building node, is where
the codes have to be compiled.
A.3
load
load
load
load
ifort/2011.13.367
icc/2011.13.367
iccifort/2011.13.367
OpenMPI/1.6.5-iccifort-2011.13.367
Once this is done, you should be able to compile the code. Change the
current directory to be the sns source folder. Now write :
make OPT=true MPI=true REALSIZE=8
to compile the optimized code with the option of parallelizing the jobs submitted. An executable has now been generated in the same directory and we
will copy it into the bin repertory :
cp sns ~/modeling/bin/sns_c-mpi
A.4
28
A.5
Submitting a job
You should now be able to submit a job to the cluster. To run a basic
precursor ABL simulation, you will need two files : the input file (.inp)
and the slurm file (.sl). As its name suggests, the input file contains all the
simulations inputs or settings (number of cells, boundaries conditions, etc..).
The slurm file is the file that will be directly submitted to the cluster as a
job. It contains all the information the cluster needs to know in order to
perform the job ( maximum simulation time allowed, number of nodes used,
memory per node, etc..). Examples of input and slurm files for different cases
are provided in Annex B and Annex C. Once you have edited these two
files as wanted, you can now submit the job by typing :
sbatch test.sl
if your slurm file name is test.sl. You can monitor your simulations with the
command :
squ
Two output files test.out and test.err are created when the job starts. Check
them to see if the simulation is running without any errors.
A.6
Post-processing
Once your simulation is done, you now have a significant amount of data
to post-process. You should be able to see in the simulation directory the
monXX.dat files. Those contain the fields data at the monitor points (their
location is specified in the input file , see Annex B ). In order to read them,
you first have to convert them into a readable .txt file using the following
command line :
monread monXX.dat > monXX.txt
Among the output files, you will find the stats.cfd file. This contains the
averaged computational domains data between the two times specified in
the input file (see Annex B ). You will have to convert it into a ANSYS
CFD-Post readable .dmp file by using the following command line :
cfdfilt -t dmp stats.cfd stats.dmp
29
A.7
As you can see in the example of a wind turbine simulation input file in
Annex B, you will need two files to feed the inlet with the data from the
velocity and temperature fields, recorded in the precursor simulations : initial.cfd and history.rec. To generate them, you will have to login to the
build node. Read the test.out and work out the transient dump file when
the code starts recording the inlet. It will be used to generate the initial field
file initial.cfd. You will also have to start a basic wind turbine simulation
to generate the mesh file (use the initial dump file and rename it mesh.cfd).
Then type :
cfdinterp -mesh mesh.cfd -data periodic_transXXXXX.cfd
initial.cfd
rectocfd -const -reset -interp mesh.cfd -resample t0,tn,dt -r4
periodic_rec.rec history.rec
where t0, tn and dt are respectively the starting time of recording, the final
time of recording and the recording frequency.
30
Appendix B
Examples of input files
For further explanations of the options available, please refer to [6].
Below is a typical precursor neutral ABL simulation file.
********************************************************
# 3D Turbine Flow
#********************************************************
title {
"Turbulent Full-scale Flow at 10ms - Stable Boundary layer"
}
mesh {
grid x {
regular 2520 140
}
grid y {
log
lower bound 0
upper bound 1008
lower cell size 0.5
number of cells 68
}
grid z {
regular 1008 56
}
}
model {
options {
three dimensions
solve velocity
turbulent
calc usr
test switch
}
properties {
fluid air
gravity vector
reference temperature
}
initial fields {
profile
31
initial p 0
initial t 0
}
profile {
type log law
roughness height 0.001
wind speed 10.0
target velocity
direction 0.0
reference height 90.0
}
perturb {
perturb profile
perturb tugen
grid
256 128 128
spacing 7.875 7.875 7.875
mann parameters
mann gamma 3.9
mann l 29.4
mann ae 0.01
}
transient data {
variable time step
total time 13600
record boundary west
record start time 10000
record stop time 13600
record frequency 0.05
initial time step 0.2
minimum courant number 0.25
maximum courant number 0.35
minimum time step 0.01
write frequency 1000
calculate statistics
statistics start time 10000
statistics end time 13600
profile statistics y
finish on time
}
}
solver {
diff scheme central
time scheme sadams bashforth
velocity solver {
solver jacobi
maxit 10
minit 1
tol
1.0e-6
rresid 1.0e-1
}
pressure solver {
solver bicgstab
precon sip
maxit 50
minit 1
nres
20
tol
1.0e-6
rresid 1.0e-2
}
scalar solver {
32
solver
precon
maxit
minit
nres
rresid
tol
bicgstab
sip
100
1
1000
1.0e-2
1.0e-6
}
}
bounds {
periodic z-axis
boundary north {
type symmetry plane
}
boundary south {
type wall
wall function rough 0.001
velocity 0.0 0.0 0.0
}
periodic x-axis
periodic pressure jump x 0.4121
# boundary west {
#
type inlet
#
velocity profile
# }
# boundary east {
#
type outlet
#
average pressure 0.0
# }
}
output {
output file
"res"
transient file
"periodic_trans"
record file
"periodic_rec"
record precision real*4
statistics file
"stats"
monitor stats full
monitor file
statistics profile file
"mon"
"p_stats"
# Coordinate monitors
monitor coord 01 0.0,90.0,504.0
monitor coord 02 126.0,90.0,504.0
monitor coord 03 252.0,90.0,504.0
monitor coord 04 378.0,90.0,504.0
monitor coord 05 504.0,90.0,504.0
monitor coord 06 630.0,90.0,504.0
monitor coord 07 756.0,90.0,504.0
monitor coord 08 882.0,90.0,504.0
monitor coord 09 1008.0,90.0,504.0
monitor coord 10 1134.0,90.0,504.0
monitor coord 11 1260.0,90.0,504.0
monitor coord 12 1386.0,90.0,504.0
monitor coord 13 1512.0,90.0,504.0
33
Below is a typical wind turbine coupled simulation input file, using a neutral
ABL precursor simulation velocity field as inflow.
#********************************************************
# 3D Turbine Flow
#********************************************************
title {
"Turbulent Full-scale Flow at 10ms - 1 5MW Turbine in an perturbed ABL, Sector model"
}
mesh {
grid x {
user
number of cells 252
user data 6.3
lower bound 0.0
upper bound 2520.0
}
grid y {
user
number of cells 70
user data 6.3
lower bound 0.0
upper bound 1008.0
user switch
}
grid z {
user
number of cells 70
user data 6
lower bound 0.0
upper bound 1008.0
}
}
model {
options {
three dimensions
solve velocity
turbulent
calc usr
test switch
test ivalue 10
}
properties {
fluid air
}
initial fields {
#
profile
#
initial p 0
# To start using the prescribed profile
# To restart use the below
restart "initial.cfd"
no reset time
no set divergence free
}
profile {
34
#
#
#
type uniform
wind speed 10.0
direction 0.0
type history
history file "history.rec"
interp cubic
constant flux
}
transient data {
variable time step
total time 3200
initial time step 0.1
minimum courant number 0.2
maximum courant number 0.35
minimum time step 0.01
write frequency 1000
calculate statistics
statistics start time 600
statistics end time 3200
finish on time
}
}
solver {
diff scheme user
time scheme sadams bashford
velocity solver {
solver jacobi
maxit 10
minit 1
tol
1.0e-6
rresid 1.0e-1
}
pressure solver {
solver bicgstab
precon sip
maxit 50
minit 1
nres
20
tol
1.0e-6
rresid 1.0e-2
}
}
turbines {
model type line
fast exe "/home/cngu036/bin/fast_dll_c"
file "5Mdllcont_none.fst"
fast init mpi
fast ascii
log wind
log anim
auto filter
eps chord ratio 1.0
chord scaling
turbine {
radius 63.0
35
periodic x-axis
periodic pressure jump x 4.121
boundary north {
type symmetry plane
}
boundary south {
type wall
wall function rough 0.001
velocity 0.0 0.0 0.0
}
boundary west {
type inlet
velocity profile
}
boundary east {
type outlet
average pressure 0.0
}
}
output {
output file
transient file
"single_res"
"single_trn"
# Coordinate monitors
monitor coord 01 0.0,90.0,504.0
monitor coord 02 126.0,90.0,504.0
monitor coord 03 252.0,90.0,504.0
monitor coord 04 378.0,90.0,504.0
monitor coord 05 504.0,90.0,504.0
monitor coord 06 630.0,90.0,504.0
monitor coord 07 756.0,90.0,504.0
monitor coord 08 882.0,90.0,504.0
monitor coord 09 1008.0,90.0,504.0
monitor coord 10 1134.0,90.0,504.0
monitor coord 11 1260.0,90.0,504.0
monitor coord 12 1386.0,90.0,504.0
monitor coord 13 1512.0,90.0,504.0
}
36
Appendix C
Example of slurm files
Provided that the input file name is test.inp, below is an example of slurm
file.
#!/bin/bash
## JOBNAME
#SBATCH -J test
## CHECK WALTIME AND MEM
#SBATCH -A uoa00003
#SBATCH --time=24:00:00
#SBATCH --mem-per-cpu=1024
## TOTAL TASKS
#SBATCH --ntasks 8
## BLOCKS OF 4 CPUS
#SBATCH -m plane=4
## SPECIFY NUMBER OF NODES, EITHER A RANGE OR SPECIFIC NUMBER
##10 WILL GIVE 16 CPUS EACH - FAST BUT MIGHT HAVE TO WAIT IN QUEUE
##SBATCH --nodes=10-20
#SBATCH --nodes=2
## UPDATE DIRECTORY
##SBATCH -D /gpfs1m/projects/uoa00003/cngu036/test
#SBATCH -C sb
#SBATCH -o test.out
#SBATCH -e test.err
##modules to load
module load OpenMPI/1.6.5-iccifort-2011.13.367
mpirun sns_c-mpi test.inp
% add -geom 10,4,4 before test.inp if you want to uniformly divide the computational domain by 10x4x4 blocs
% in the Cartesian coordinates system (x,y,z)
37
Bibliography
[1] Jacob Berg, Jakob Mann, and Morten Nielsen. Notes for DTU course
46100 : Introduction to micro meteorology for wind energy, February
2013.
[2] Larodynamique des oliennes - energie, architecture et climat, facult
darchitecture, dingnierie architecturale, durbanisme (loci), universit
catholique de louvain (belgique).
[3] Rupert C. Storey. Large Eddy Simulation of Dynamically Controlled
Wind Turbine Arrays. PhD thesis, University of Auckland, August 2014.
[4] B. Sanderse. Aerodynamics of wind turbine wakes. Technical report,
Energy research Centre of the Netherlands, 2009.
[5] Mahdi Abkar and Fernando Port-Agel. Influence of atmospheric stability on wind-turbine wakes: A large-eddy simulation study. Physics of
Fluids, March 2015.
[6] S.E. Norris and S.W. Armfield. The SnS CFD Solver, version 2.7.7 /
version 2.7.12 cube / version 2.8.5 dns edition, November 2014.
[7] Matthew J. Churchfield, Sang Lee, John Michalakes, and Patrick J.
Moriarty. A numerical study of the effects of atmospheric and wake
turbulence on wind turbine dynamics. Journal of Turbulence, 13(N14),
May 2012.
[8] James G. Brasseur and Tie Wei. Designing large-eddy simulation of the
turbulent boundary layer to capture law-of-the-wall scaling. Physics of
Fluids, February 2010.
[9] J. Jonkman, S. Butterfield, W. Musial, and G. Scott. Definition of a
5-mw reference wind turbine for offshore system development. Technical
report, National Renewable Energy Laboratory, February 2009.
38
39