0% found this document useful (0 votes)
171 views

Sowfa Tutorial

The document provides an overview of SOWFA (Simulator fOr Wind Farm Application), which is an open-source wind farm simulator composed of CFD tools coupled with a wind turbine dynamics model. SOWFA can be used to simulate wind farm flows at different fidelity levels from CFD to dynamic wake models. It is meant to be modular so users can add their own components. The overall vision is for SOWFA to have high and low fidelity options and be able to initialize wind farm simulations with precursor atmospheric simulations.

Uploaded by

Golarch
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)
171 views

Sowfa Tutorial

The document provides an overview of SOWFA (Simulator fOr Wind Farm Application), which is an open-source wind farm simulator composed of CFD tools coupled with a wind turbine dynamics model. SOWFA can be used to simulate wind farm flows at different fidelity levels from CFD to dynamic wake models. It is meant to be modular so users can add their own components. The overall vision is for SOWFA to have high and low fidelity options and be able to initialize wind farm simulations with precursor atmospheric simulations.

Uploaded by

Golarch
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/ 96

Overview of the Simulator

fOr Wind Farm Application


(SOWFA)

Matthew Churchfield
Sang Lee
Patrick Moriarty

May 21, 2012


NREL is a national laboratory of the U.S. Department of Energy, Office of Energy Efficiency and Renewable Energy, operated by the Alliance for Sustainable Energy, LLC.
Overview of SOWFA

• Simulator fOr Wind Farm Applications


• Currently, it is composed of CFD tools based on OpenFOAM
coupled with a NREL’s FAST wind turbine structural/system
dynamics model
• It is meant to be modular and open-source so that others
can put in their own “modules”
• Open-source and freely available
• It can be downloaded at:
http://wind.nrel.gov/designcodes/simulators/sowfa/

2
Overview of SOWFA

• Simulator fOr Wind Farm Applications


• The overall vision is:

SOWFA

• It will have a range of fidelity levels


o Wakes computed from CFD or dynamic wake meandering model
o Inflow turbulence computed from CFD or stochastic turbulence model

3
Overview of SOWFA
Actuator line turbine
aerodynamics models
(coupled with NREL’s FAST
turbine dynamics model)

“Precursor” atmospheric
simulation (OpenFOAM)

1 km Initialize wind
farm domain
with precursor
3 km 3 km volume field

Wind farm simulation (OpenFOAM)

Use saved precursor


data as inflow
boundary conditions

Save planes of data


every N time steps

4
Atmospheric Boundary Layer Solver
ABLSolver and ABLTerrainSolver

5
Overview
ABLSolver is an atmospheric solver developed out of the
buoyantBoussinesqPimpleFoam. It can be run in PISO or SIMPLE mode for either
LES or RANS (or a blend). It can simulate a variety of atmospheric stabilities. We
use it in LES mode to compute turbulent atmospheric precursor wind fields

capping inversion
simulation time: 10000 –20000 s
controls boundary
layer height
geostrophic
wind

1 km
periodic periodic

3 km 3 km

Boussinesq
approximation for rough lower surface
buoyancy effects Coriolis forces included with temperature flux
6
Transport Equations
Momentum transport
ui  ~
 u j ui   2 i3k 3uk  p  1  p0 ( x, y)    ijD  gz  b  1 fiT
 
t x j xi  0 xi x j  0 xi 0

I II III IV IV V VI VI VII VIII


I. time rate of change
II. convection
III. Coriolis force due to planetary rotation
IV. density-normalized pressure gradient (deviation from hydrostatic and
horizontal-mean gradient)
V. horizontal-mean driving pressure gradient
VI. stresses (viscous + SGS/Reynolds)
VII. buoyancy
VIII. other density-normalized forces (from turbine actuator line model)

7
Transport Equations
Momentum transport

fvVectorMatrix UEqn
(
fvm::ddt(U) // time derivative
+ fvm::div(phi, U) // convection
+ turbulence->divDevReff(U) // stresses (interior faces)
+ fvc::div(Rwall) // stresses at boundary (wall model)
- fCoriolis // Coriolis force
+ gradPd // driving pressure gradient
);

UEqn.relax();

if (pimple.momentumPredictor())
{
solve
(
UEqn
==
fvc::reconstruct
(
(
- fvc::snGrad(p_rgh) // modified pressure gradient
- ghf*fvc::snGrad(rhok) // buoyancy force
) * mesh.magSf()
)
);
}

8
Transport Equations
Potential temperature transport




t x j
u j    

x j
qj 

I II III

I. time rate of change


II. convection
III. SFS temperature fluxes

1 provides a good explanation of atmospheric boundary layer physics.


2 is a good outline of atmospheric boundary layer LES.

1R. B. Stull. An Introduction to Boundary Layer Meteorology. Springer Science + Business Media B. V., 2009.
2C.-H. Moeng. A Large-Eddy Simulation Model for the Study of Planetary Boundary Layer Turbulence. Journal of the Atmospheric Sciences,
Vol. 41, No. 13, 1984, pp. 2052–2062.

9
Transport Equations
Potential temperature transport

kappat = turbulence->nut()/Prt;
kappat.correctBoundaryConditions();

volScalarField kappaEff("kappaEff", turbulence->nu()/Pr + kappat);

fvScalarMatrix TEqn
(
fvm::ddt(T) // time derivative
+ fvm::div(phi, T) // convection
- fvm::laplacian(kappaEff, T) // diffusion (molecular + turbulent)
- fvc::div(qwall) // temperature flux at boundary
);

TEqn.relax();
TEqn.solve();

rhok = 1.0 - ( (T - TRef)/TRef ); // Boussinesq buoyancy density

10
Potential Temperature

• Temperature that a parcel of dry air would have if


adiabatically brought from some pressure level to a
reference pressure, usually 100kPA
• Simplifies the study of atmospheric stability

z z z

  
stable neutral unstable

11
Buoyancy Force

• This is an incompressible formulation, with constant density,


so we need a way to account for buoyancy effects caused by
variable density
• Use the Boussinesq approximation
• Ratio of “buoyant density” to constant density is
k    0 
 1    0  300K
0  0 
 299K  300K  locally stable (cool air pushed up
1    1.0033
 300 K  into warm air): negative force
 300K  300K  locally neutral (air pushed into air
1   1
 300 K  of equal temperature): zero force
 301K  300K  locally unstable (warm air pushed up
1    0.9967
 300 K  into cool air): positive force

12
Coriolis Force

• Due to planetary rotation, there is an apparent force called


Coriolis force
• If +x is east, +y is north, and +z is up, then
 2 ijk  j uk

 0 
 j   cos 
 
 sin  

•  j is the rotation rate vector at a location on the planetary


surface,  is the planetary rotation rate (rad/s), and  is the
lattitude

13
Subgrid-Scale Model
Gradient-diffusion hypothesis

 ui u j 
  
D SFS   
ij
 x j xi 
 

q j   SFS

x j

Smagorinsky model1
1/ 2
  ui u j  ui u j 
  Cs   2    
SFS 2
 
  x j xi  x j xi 

 SFS
 SFS

Prt
1 J. Smagorinsky. General Circulation Experiments with the Primitive Equations, Monthly Weather Review, Vol. 91, 1963, pp. 99–164.

14
Subgrid-Scale Model
Cs  0.13  0.17 (we use closer to 0.13) Smagorinsky constant

SFS filter width


 V 1/ 3
(V is grid cell volume)

1 Need to reimplement this


Prt  Turbulent Prandtl
1  2 l  number
 
 
   SFS  1 
min 7.6  ,   if s0 Length-scale for Prt
l    s 
   

  if s0

gi 
s Measure of stability
 0 z
If locally unstable or neutral (s ≤ 0): Prt = 1/3  SFS  3 SFS
If locally stable (s > 0): Prt approaches 1  SFS   SFS

15
Subgrid-Scale Model

• Older solver (ABLPisoSolver) had SGS model variable


evaluated at cell faces, meaning only a custom-coded
SGS model could be used

• New solver (ABLSolver) has gone back to OpenFOAM


standard cell-centered approach, so any OpenFOAM
standard SGS or RANS model can be used

• Since new solver is based on PIMPLE, can be run either


as RANS in SIMPLE or LES in PISO all in one code

16
Wall Shear Stress and Temp. Flux Models

• The cost of high-Re fully-resolved LES of wall-bounded


flow scales strongly with Re.
“The only economical way to perform LES of high Reynolds-number attached flow,
therefore, is by computing the outer layer only.” “Because the grid is too coarse to
resolve the inner-layer structures, the effect of the wall layer must be modeled. In
particular, the momentum flux at the wall (i.e., the wall stress) cannot be evaluated
by discrete differentiation because the grid cannot resolve either the sharp velocity
gradients in the inner layer or the quasi-streamwise and hairpin vortices that transfer
momentum in this region of the flow. Therefore, some phenomelogical relation
must be found to relate the wall stress to the outer-layer flow.”1
• The planetary surface is covered with roughness
elements (dirt, rocks, vegetation) that would be
extremely expensive to resolved with the grid.
• It is inappropriate to apply no-slip at the surface
• Instead apply a model for surface stress
1U. Piomelli and E. Balaras, “Wall-Layer Models for Large-Eddy Simulations,” Annual Review of Fluid Mechanics, Vol. 34, pp. 349–374,
2002.

17
Wall Shear Stress Model

• Surface stress model predicts total (viscous + SGS)


stress at surface
• Assumes that first cell centers away from surface lie
within surface layer of the atmospheric boundary
layer
• So at the surface
 0 0  13tot 
 tot 
 ijD  0 0  23 
 13tot  23
tot
0 
 

• The wall model models  13tot and  23tot

18
Wall Shear Stress Model

• SOWFA contains the wall models of


o Schumann1
o Moeng2 (Not yet reimplemented)
• Schumann’s model
 tot
 u 2 u 1/ 2  u1/ 2 
13 *
u 1/ 2
2
 v1/ 2 
2 1/ 2

 tot
 u 2 v 1/ 2  v1/ 2 
23 *
u 1/ 2
2
 v1/ 2 
2 1/ 2

1 U. Schumann. Subgrid-Scale Model for Finite-Difference Simulations of Turbulent Flow in Plane Channels and Annuli. Journal of
Computational Physics, Vol. 18, 1975, pp. 76–404.
2 C.-H. Moeng. A Large-Eddy Simulation Model for the Study of Planetary Boundary Layer Turbulence. Journal of the Atmospheric Sciences,

Vol. 41, No. 13, 1984, pp. 2052–2062.

19
Wall Stress Model
 tot
 u 2 u 1/ 2  u1/ 2 
13 *
u 1/ 2
2
 v1/ 2 
2 1/ 2

 tot
 u
2 v 1/ 2  v1/ 2 
23 *
u
1/ 2
2
 v1/ 2 
2 1/ 2

• 1/2 denotes values at first cell centers away from surface

1/2

surface

• Angle brackets denote a horizontal average at a certain height

20
Wall Shear Stress Model
  u
u  tot 2 1/ 2 u1/ 2 
13 *
u 1/ 2
2
 v1/ 2 
2 1/ 2

 tot
 u 2 v 1/ 2  v1/ 2 
23 *
u1/ 2
2
 v1/ 2 
2 1/ 2

• Friction velocity is defined as


1/ 2
u*2    13tot 
2 2
  23
tot

 

• It needs to be approximated. Use rough wall log law


 u1/ 2  v1/ 2 1/ 2 z
1 
 ln  f ( L) 
u*   z0 

21
Wall Shear Stress Model
 u1/ 2  v1/ 2 1/ 2 1 z 
 ln  f ( L) 
u*   z0 
• f (L) is an atmospheric stability-related function that is zero for neutral
stability. See Etling1 for more information
• L is the Obuhkov length
• z0 is the aerodynamic roughness height. It depends on height,
distribution, and shape of roughness elements on planetary surface. See
Stull2 for more information
z0 (m) Terrain
1×10-1 – 5×10-1 Many trees, hedges, few buildings
3×10-3 – 2×10-2 Level grass plains
1×10-4 – 1×10-3 Large expanses of water

1 D. Etling. Modelling the Vertical ABL Structure, in Modelling of Atmospheric Flow Fields, D. P. Lalas and C. F. Ratto, editors, World
Scientific, 1996, pp. 56–57.
2 R. B. Stull. An Introduction to Boundary Layer Meteorology. Springer Science + Business Media B. V., 2009., p. 380.

22
Wall Temperature Flux Model

• A similar approach is taken to model the total temperature


flux at the surface1
 0 
q j   0 
q3tot 

• Total average temperature flux, Qs, is specified, and the wall


tot
model creates the fluctuating temperature flux q3
• Or surface heating/cooling rate is specified and q3tot is
calculated2

1 C.-H. Moeng. A Large-Eddy Simulation Model for the Study of Planetary Boundary Layer Turbulence. Journal of the Atmospheric Sciences,
Vol. 41, No. 13, 1984, pp. 2052–2062.
2 S. Basu, A. A. M. Holtslag, B. J. H. Van de Wiel, A. F. Moene, G.-J. Steeneveld, “An inconvenient “truth” about using sensible heat flux as a

surface boundary condition in models under stably stratified regimes,” Acta Geophysica, Vol. 56, No. 1, 2008, pp. 88-99.

23
How to Incorporate Wall Model

• OpenFOAM has standard wall shear stress


models that look at the surface velocity gradient
and assign a surface eddy-viscosity such that
their product gives the correct stress

• This does not allow for the use of a non-linear


surface shear stress model, like that of Moeng

• SOWFA includes wall model BCs for Rwall and


qwall

24
How to Incorporate Wall Model
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U) sums contribution from interior faces
+ fvc::div(Rwall) sums contribution from wall face
- fCoriolis
+ gradPd
);

Rwall is a volSymmTensorField that is zero on the


interior and only takes on a value on patches in
which the wall shear stress BC is applied

If nuEff is zero on the patch, then there is no


contribution from divDevReff on that patch, only on
the interior

Temperature flux model works similarly

I credit David Lapointe-Thériault from ETS in


Montreal for this method of splitting up the stresses
at faces between interior and wall and treating them
separately while still usind divDevReff()
25
Numerical Scheme
• ABLSolver uses the PISO1 (Pressure Implicit Splitting Operation) –
SIMPLE (Semi-Implicit Method for Pressure Linked Equations) to
“implicitly” solve the momentum and pressure equation
o Predictor-Corrector approach with Rhie-Chow interpolation
o I started with buoyantBoussinesqPimpleFoam, which only includes a
temperature predictor
o Having a temperature predictor only does not closely enough couple
equations, so I also call the temperature equation in the corrector loop
o Fixed the velocity overshoot problem seen at the top of the boundary
layer in older ABLPisoSolver

• I credit David Lapointe-Thériault from ETS in Montreal for figuring out the
better temperature coupling through inclusion of T equation in corrector
loop

1R. I. Issa. Solution of the Implicitly Discretized Fluid Flow Equations by Operator-Splitting. Journal of Computational Physics, Vol. 62, 1985,
pp. 40–65.
26
Numerical Scheme

• Finite-volume formulation
o Linear interpolate of cell-center values to cell faces when needed
o Equivalent to second-order central differencing
o Rhie-Chow1-like flux interpolation is used to avoid pressure-velocity
decoupling

1C. M. Rhie and W. L. Chow. Numerical Study of the Turbulent Flow Past an Airfoil with Trailing Edge Separation. AIAA Journal, Vol. 21,
No. 11, 1983, pp. 1552–1532.
27
Linear System Solvers

• Velocity and Temperature


o Biconjugate Gradient
o Diagonal incomplete LU matrix preconditioner
• Pressure
o Preconditioned Conjugate Gradient
o Diagonal incomplete Cholesky or multigrid matrix preconditioner
OR
o Geometric agglomerated algebraic multigrid solver
o Diagonal incomplete Cholesky smoother

28
Initial Conditions for Precursor Flow
Initial conditions
• Velocity
o Given a logarithmic base profile
o Non-random, divergence-free perturbations added near surface to
cause turbulence to quickly happen (similar to method used by
DeVillier’s in channel flow1).
• Temperature
o Constant temperature (300K) up to some height, then temperature
increases
o This creates a capping inversion that caps the boundary layer and
slows boundary layer vertical growth
• Pressure variable
o Initialized to zero
• Initial conditions set using “setABLFields” utility, but could use
something like “funkySetFields”

1De Villiers, E., “The Potential of Large Eddy Simulation for the Modeling of Wall Bounded Flows”, PhD Thesis, Imperial College, London,
2006.

29
Initial Conditions for Precursor Flow

z (m)

 (K)
30
Solver Outputs
• “averaging” file structure
o Within averaging directory are time directories
corresponding to run start times. If you start a run at 0,
there will be a “0” directory. If you restart a run at 1000,
there will also be a “1000” directory.
o Most files are structured as follows where each line
represents a different time step, and starting at the third
column, each column represents a horizontally-averaged
value at a progressively greater height on the grid
time0 dt0 value0 value1 value2 … valueJ
time1 dt1 value0 value1 value2 … valueJ

timeN dtN value0 value1 value2 … valueJ

o Heights corresponding the value0 through valueJ are in the


hLevelsCell file
– hLevelsCell are cell-centered heights

31
Solver Outputs

• “averaging” file structure


Cell-center quantities Description
T_mean 
U_mean, V_mean, W_mean u v w

uu_mean, vv_mean, ww_mean u 'u ' v'v' w'w'


uv_mean, uw_mean, vw_mean u 'v' u 'w' v'w'

wuu_mean, wvv_mean, www_mean w' u ' u ' w' v' v' w' w' w'

wuv_mean, wuw_mean, wvw_mean w' u ' v' w' u ' w' w' v' w'
Tu_mean, Tv_mean, Tw_mean  'u '  'v'  'w'

32
Solver Outputs

• “averaging” file structure


Cell-face quantities Description
R11_mean, R22_mean, R33_mean  11D  22D  33D
R12_mean, R13_mean, R23_mean  12D  13D  23D
q1_mean, q2_mean, q3_mean q1 q2 q3

phiM m Non-dimensional velocity shear

Global quantities Description


ReLES Re LES LES Reynolds number1
scriptR Near surface ratio of resolved to

subgrid scale stress1
uStar u* Friction velocity

zi zi Boundary layer depth

1J. Brasseur and T. Wei. Designing Large-Eddy Simulation of the Turbulent Boundary Layer to Capture Law-of-the-Wall Scaling, Physics of
Fluids, Vol. 22, No. 2, 2010.

33
Guidelines for Use
• ABLSolver meant for flat terrain with “structured” mesh
o Only because it has built in planar averaging to give vertical mean profiles

• Use ABLTerrainSolver if the bottom is not flat (exactly same solver, but takes time averages)
o At some point I want to make the averaging type function objects so that there is one ABL solver, and you choose either
horizontal or time averaging function objects depending on the situation

• Flat-bottom precursors should be run with periodic lateral boundaries

• The more stable the case, in general the longer the time to quasi-equilibrium (up to 50,000 s).

• Unstable cases should have at least 5 km x 5 km x 2 km domain, neutral should have at least 3 km x 3 km x 1 km domain,
and stable can be smaller, but I do not have a rule of thumb

• If the domain is the smallest recommended, drive hub-height wind at some angle no aligned with x-y; otherwise low-
speed structures become “stuck” by periodicity and cycle through over and over.

• We have some preliminary inflow BC conditions for U and T for ABLTerrainSolver since it probably won’t be run periodic.
In our experience, using these BC’s to apply fluctuations to T helps initiate turbulence, but still a long fetch is needed.

• +x must be east, +y must be north, +z must be up

• Must use adequate vertical grid resolution, small enough cell aspect ratio, and proper Smagorinsky constant to recover
law-of-the-wall scaling

34
Guidelines for Use

• +x must be east, +y must be north, +z must


be up
• Must use adequate vertical grid resolution,
small enough cell aspect ratio, and proper
Smagorinsky constant to recover law-of-the-
wall scaling

35
Guidelines for Use

• Law-of-the-wall scaling
o This follows the work of Brasseur and Wei1
o The problem:

Log-law mismatch Improved log-law agreement

1J. Brasseur and T. Wei. Designing Large-Eddy Simulation of the Turbulent Boundary Layer to Capture Law-of-the-Wall Scaling, Physics of
Fluids, Vol. 22, No. 2, 2010.

36
Guidelines for Use

• Law-of-the-wall scaling
z  U
o This follows the work of Brasseur and Wei1 m 
u* z
o The problem:

overshoot Improved log-law agreement

1J. Brasseur and T. Wei. Designing Large-Eddy Simulation of the Turbulent Boundary Layer to Capture Law-of-the-Wall Scaling, Physics of
Fluids, Vol. 22, No. 2, 2010.

37
Actuator Line Turbine Model
horizontalAxisALM class

38
Overview

• Resolving turbine blade


geometry with high-Re LES is
infeasible
• An actuator approach does
not require a very fine grid
around turbine blades
• Creates wake, tip, root, and
bound vortices
• Does not create blade
boundary layer turbulence
• Depends upon airfoil look-up
tables

39
Theory
We follow the methodology of Sørensen and Shen1

• Method of Sørensen and Shen1


• Blades discretized into spanwise
sections of constant airfoil, chord,
twist, oncoming wind
• Airfoil lookup tables used to
calculate lift and drag at each
actuator section
• Force on flow is equal and opposite
to blade force
• Force is normalized and projected
back to flow

ui  ~
 u jui   2 i3k 3uk  p  1  p0 ( x, y)    ijD  gz  b  1 fiT  
t x j xi 0 xi x j 0 xi 0
1 Sørensen, J. N. and Shen, W. Z., “Numerical Modeling of Wind Turbine Wakes”, Journal of Fluids Engineering 124, 2002, pp. 393-399.

40
Theory

• Force Projection
o How do you take force calculated at actuator line points and project it
onto the CFD grid as a body force?
o How do you smooth the force to avoid numerical oscillation?
o Sørensen and Shen use a Gaussian projection

Fi A    
r
2

fi r   3 3 / 2 exp    
T

     
o Fi A is the actuator element force
o f i T is the force field projected as a body force onto CFD grid
o r is distance between CFD cell center and actuator point
o  controls Gaussian width.

41
Theory

• Projection Width
o Troldborg1 recommends  / x  2 where x is the grid cell length
near actuator line
o We found this to be the minimum in order to maintain an oscillation-
free solution using central differences
o We think should be tied to some physical blade length, like chord,
 come up with a definitive guideline.
but have not
o See the AIAA paper by Martínez et al.2
o A good way to choose epsilon is to choose a wind speed/TSR and run a
case and see how power compares to what it should be. If power is
low, make epsilon bigger and vice versa, and try again. Repeat. Now
you have 3 data points that should bracket the power you want. Fit a
cubic spline to epsilon vs. power and find the epsilon that corresponds
to the desired power. In our experience, this epsilon then holds for all
other wind speeds and TSR.
1Troldborg, N., “Actuator Line Modeling of Wind Turbine Wakes”, PhD Thesis, Technical University of Denmark, Lyngby, Denmark, 2008.
2Martinez, L. A., Leonardi, S., Churchfield, M. J., Moriarty, P. J., “A Comparison of Actuator Disk and Actuator Line Wind Turbine Models and
Best Practices for Their Use”, AIAA Paper 2012-900, Jan. 2012.
42
Actuator Line Model Features

• Generator Torque Control


o 5 region control like NREL 5MW (see 5MW Reference Turbine Report)
o Generator speed vs. generator torque lookup table

• Pitch Control
o PID, based on NREL 5MW Reference Turbine Report
o Can provide P, I, and D gains, but must compute those gains following NREL
5MW Reference Turbine Report

• Yaw Control
o Not yet implemented, but coming soon

• Can be run in a FAST-coupled mode (we will discuss this later in the
tutorial)
1J.
Jonkman, S. Butterfield, W. Musial, and G. Scott, “Definition of a 5-MW Reference Wind Turbine for Offshore System Development,”
NREL Report TP-500-38060, Feb. 2009

43
Actuator Line Model Outputs

• Solution files (inside time directories)


o bodyForce: body force projected onto flow field

• “turbineOutput” directory
o Outputs various turbine information such as power,
torque, rotor speed, etc.
o Outputs information at each blade point such as angle of
attack, velocity magnitude, lift, drag, etc.

44
Actuator Line Model Outputs

• “turbineOutput” file structure


o Within turbineOutput directory are time directories
corresponding to run start times. If you start a run at 0,
there will be a “0” directory. If you restart a run at 1000,
there will also be a “1000” directory.
– Within the specific time directories are a files for global turbine
data files for quantities like power, torque, rotor speed, etc.
– Also there are files for blade local quantities like lift, drag, angle of
attack, etc. vs. span.

45
Actuator Line Model Outputs

• Global quantity file structure


turbine0 time0 dt0 value
turbine1 time0 dt0 value

turbineM time1 dt0 value

turbine0 time1 dt1 value


turbine1 time1 dt1 value

turbineM time1 dt1 value

turbine0 timeN dtN value


turbine1 timeN dtN value

turbineM timeN dtN value

46
Actuator Line Model Outputs

• Blade radius dependent file structure


turbine0 blade0 time0 dt0 value0 value1 value2 … valueJ
turbine0 blade1 time0 dt0 value0 value1 value2 … valueJ
turbine0 blade2 time0 dt0 value0 value1 value2 … valueJ
turbine1 blade0 time0 dt0 value0 value1 value2 … valueJ
turbine1 blade1 time0 dt0 value0 value1 value2 … valueJ
turbine1 blade2 time0 dt0 value0 value1 value2 … valueJ

turbineM blade0 time0 dt0 value0 value1 value2 … valueJ
turbineM blade1 time0 dt0 value0 value1 value2 … valueJ
turbineM blade2 time0 dt0 value0 value1 value2 … valueJ

turbine0 blade0 timeN dtN value0 value1 value2 … valueJ


turbine0 blade1 timeN dtN value0 value1 value2 … valueJ
turbine0 blade2 timeN dtN value0 value1 value2 … valueJ
turbine1 blade0 timeN dtN value0 value1 value2 … valueJ
turbine1 blade1 timeN dtN value0 value1 value2 … valueJ
turbine1 blade2 timeN dtN value0 value1 value2 … valueJ

turbineM blade0 timeN dtN value0 value1 value2 … valueJ
turbineM blade1 timeN dtN value0 value1 value2 … valueJ
turbineM blade2 timeN dtN value0 value1 value2 … valueJ

47
Actuator Line Model Outputs

Global turbine quantities Description


powerRotor Rotor power/density (W)

rotSpeed Rotor speed (rpm)

thrust Thrust (N)

torqueRotor Rotor torque (N-m)

torqueGen Generator torque (N-m)

azimuth Rotor azimuth angle (degrees)

nacYaw Nacelle yaw angle (degrees)

pitch Blade collective pitch (degrees)

48
Actuator Line Model Outputs
Blade Local quantities Description
alpha Angle of attack (degrees)

axialForce Force along rotor shaft axis (N)

Cd Coefficient of drag

Cl Coefficient of lift

drag Drag force (N)

lift Lift force (N)

tangentialForce Force in rotor rotation tangential direction (N)

Vaxial Component of velocity along rotor shaft axis (m/s)

Vradial Component of velocity along blade radius (m/s)

Vtangential Component of velocity in rotation tangential direction (m/s)

x, y, z Actuator point position in space (m)

49
Guidelines for Use

• +x must be east, +y must be north, +z must


be up
• Use at least 20 CFD grid cells across the rotor
diameter
• Use at least 50 CFD grid cells across the rotor
if you want to well resolve tip/root vortices
• Set epsilon based on cubic fit approach in
slide 42

50
Implementation

• Turbine model implemented as a class


o “horizontalAxisWindTurbinesALM”
o See src/turbineModels/horizontalAxisWindTuribinesALM
• Any solver can be modified to contain an object of
the class
• That object is the entire turbine array

51
Implementation

• Modifying pisoFoam to include turbine class


o Add this to createFields.H to declare object of turbine class
// Create an object of the horizontalWindTurbineArray class if there
// is to be a turbine array
//
turbineModels::horizontalAxisWindTurbinesALM turbines(U);

o Add this to the includes part of the solver code


#include “horizontalAxisWindTurbinesALM.H”

o Add this line to solver code momentum equation to apply forces


fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
- turbines.force()
);

o Add this line at the beginning or end of the time loop to advance the
turbine one time step
turbines.update();

52
Implementation

• Make/options file needs to be modified

EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(WM_PROJECT_USER_DIR)/src/turbineModels/lnInclude

EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lincompressibleTurbulenceModel \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools \
-llduSolvers \
-luserTurbineModels

53
FAST Coupling to OpenFOAM

54
Coupling FAST to OpenFOAM

• NREL’s FAST1 (Fatigue, Aerodynamics, Stress, and


Turbulence) tool is a model for wind turbine structural,
aero, and system dynamics
• Its aerodynamics part is through blade element
momentum theory (BEM)
• Here, we coupled FAST to the actuator line model
• The “momentum” part of BEM is replaced by CFD
o CFD feeds FAST inflow information at blade elements
o Aerodynamic forces computed by look-up table (“blade
element” theory--just like normal actuator line)
o Turbine structural and system response computed
o Aerodynamic forces fed back to CFD

1Jonkman, J. and Buhl, M., FAST User’s Guide, NREL/EL-500-38230, NREL technical report, 2005. Accessible at:
http://wind.nrel.gov/designcodes/simulators/fast/FAST.pdf

55
Coupling FAST to OpenFOAM
Multiple-Turbine
capability
OpenFOAM FAST
(NREL aero-elastic code)
Do while (t < tmax) velocity
call FLOW_Solver Compute structural
response and blade
call openFOAM2FAST rotation
call FAST
aeroforces w/ blade coord.
call Fast2OpenFOAM in actuator line representation

End do

Turbulence is different
than a TurbSim result!

56
Implementation

• Similar to standard actuator line


• Turbine model implemented as a class
o “horizontalAxisWindTurbinesFAST”
o See src/fastturb/horizontalAxisWindTuribinesFAST
• Any solver can be modified to contain an object of
the class
• That object is the entire turbine array

57
Implementation - fastPisoSolver

label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);

singlePhaseTransportModel laminarTransport(U, phi);


createFields.H
autoPtr<incompressible::turbulenceModel> turbulence
(
incompressible::turbulenceModel::New(U, phi, laminarTransport)
);

turbineModels::horizontalAxisWindTurbinesFAST turbfast(U);

-Create an object of the horizontalWindTurbinesFAST class if there is to be a


turbine array

•Add “createFields.H” file to the includes part of the solver code (pisoFoam.C)
int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H”

58
Implementation - fastPisoSolver

#include "horizontalAxisWindTurbinesFAST.H“
… pisoFoam.C
extern "C" Declare wrapper functions written Fortran90
{
void fastinit_( float& , int& ); -Initialize FAST
void fastread_( float*, float*, float*); -Read wind information from OpenFOAM
void fastrun_( ); -Run FAST
void fastgetbldpos_( float*, float*, float*);
-transfer updated blade element positions to OpenFOAM
-transfer updated aerodynamic forces from blade elements to OpenFOAM
void fastgetbldforce_(float*, float*, float*);
-Terminate FAST
void fastend_( );
}

int main(int argc, char *argv[])


{
… #include "createFields.H“ …

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// initialize FAST
FAST initialization
-Get number of blades
Info << "Number of Turbs: " << turbfast.turbNum << endl;
-Get time-step from OpenFOAM => FAST time step
float tstep = runTime.deltaT().value(); -Loop through each turbines
for(int turbNo=0; turbNo<turbfast.turbNum; turbNo++) -Turbine ID = MPI_RANK (CPU #)
{
if(Pstream::myProcNo() == turbNo) -For given CPU #, initialize FAST
{
fastinit_(tstep, turbNo);
fastgetbldpos_(turbfast.bldptx[turbNo], turbfast.bldpty[turbNo], turbfast.bldptz[turbNo]); -Get current blade elem. pos.
}
turbfast.getBldPos(turbNo); -Transfer blade elem. Pos. to OpenFOAM
}

… 59
Implementation - fastPisoSolver.C
Continued from last slide…
pisoFoam.C
// Pressure-velocity PISO corrector
{

for(int turbNo=0; turbNo<turbfast.turbNum; turbNo++)


-Loop through turbines
{
-get wind data for specified turbine
turbfast.getWndVec(turbNo);
if(Pstream::myProcNo() == turbNo)
{
fastread_(turbfast.uin[turbNo], turbfast.vin[turbNo], turbfast.win[turbNo]); -transfer OpenFOAM wind data to FAST
fastrun_(); -run FAST
fastgetbldpos_(turbfast.bldptx[turbNo], turbfast.bldpty[turbNo], turbfast.bldptz[turbNo]); -pass updated blade elem. pos. to OpenFOAM
fastgetbldforce_(turbfast.bldfx[turbNo], turbfast.bldfy[turbNo], turbfast.bldfz[turbNo]); -pass updated aerodynmic force to OpenFOAM
}
turbfast.computeBodyForce(turbNo); -project the aerodynamic force into the OpenFOAM
computational domain
}

// Momentum predictor
fvVectorMatrix UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U) - turbfast.force() -added the aerodynamic force from FAST as a bodyforce
); term in momentum eq.


-terminate FAST (loops through all the turbines)
fastend_();

60
Implementation – Make file

• Make/options file needs to be modified


EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(WM_PROJECT_USER_DIR)/src/fastturb/lnInclude

EXE_LIBS
-Lfast/bin \ ../fastPisoSolver/
-L$(FOAM_USER_LIBBIN) \
-lincompressibleRASModels \ /fast/bin/
-lincompressibleLESModels \ libfast.a FAST compiled
-lincompressibleTransportModels \ into static library
-lfiniteVolume \ /Make/
-lmeshTools \ files
-luserfastturb \
-lgfortran \ options
-lfast createFields.H
pisoFoam.C

61
FAST Input files: NREL 5MW Turbine
/caseStudyDir/

Required files are:

Primary.fst
specifies configurations for initial conditions, controls, turbine geometry
and mass, drive train, output file formats, etc…

USERWIND.wnd
file used to invoke reading in external flow data

NRELOffshrBsline5MW_AeroDyn.ipt
AeroDyn input for air specification, blade geometry, airfoil data
(coefficients for lift/drag table are included in /caseStudyDir/AeroData/)

NRELOffshrBsline5MW_Blade.ipt
Specifies blade properties: stiffness, mode shapes etc..

NRELOffshrBsline5MW_Tower_Onshore.ipt
ditto for Tower properties

62
FAST Actuator Line Model Inputs
constant/turbineArrayPropertiesFAST
turbine0
{
refx 200.0; - x location of tower base
refy 0.0; - y location of tower base
refz 0.0; - z location of tower base
hubz 100.0; - hub height
}

turbine1
{
refx 400.0;

general
{
yawAngle 0.0; - turbine yaw angle
numberofBld 3 - # of blades
numberofBldPts 62; - # of actuator elements per blade
rotorDiameter 126.3992; - rotor diameter
epsilon 5.0; - Gaussian width parameter
smearRadius 13.15; - radius beyond which Gaussian has no effect
effectiveRadiusFactor 1.21; - scale factor for rotor diameter
pointInterpType 1; - option for linear interpolation of velocities
}

63
FAST Actuator Line Model Outputs
• Load files : primary0.out, primary1.out, …
• These include time histories of load parameters
specified in primary.fst
e.g. out-of-plane blade root bending moments, torque, yaw bearing
moments, power, rotor speed …
• Can be imported into Excel / MatLab for figures

64
Guidelines for Use

• See actuator line guidelines

65
Sample Output

Two NREL 5-MW turbines subjected to neutrally stable low-roughness


atmospheric conditions showing the instantaneous streamwise velocity
contours with iso-surface of Q invariant fixed at 0.0275 1/s

66
Sample Output

NREL 5MW turbine in unstable high-roughness


atmospheric flow with mean speed at 8 m/s @
hub height
67
Wind Plant Simulation
windPlantSolver

68
Wind Plant Simulation
• Combination of the elements Actuator line turbine
aerodynamics models
discussed above (coupled with NREL’s FAST
turbine dynamics model)

“Precursor” atmospheric
simulation (OpenFOAM)

1 km Initialize wind
farm domain
with precursor
3 km 3 km volume field

Wind farm simulation (OpenFOAM)

Use saved precursor


data as inflow
boundary conditions

Save planes of data


every N time steps

69
windPlantSolver

• It is simply ABLTerrainSolver with the


horizontalAxisALM class included (but can
still be used on flat terrain—it just does time
averages)

70
Output

• All the turbine information


• Instantaneous Fields
o U, T, p, u ̕, T ̕
• Mean Fields
o Umean, Tmean
• Correlation Fields
o ̕ ̕j›
‹u̕iu̕j›, ‹Tu

71
Guidelines for Use
• Make sure domain boundaries have either predominant
inflow or outflow
o Remember that with Coriolis, wind changes directions with altitude
o Possible to have wind flowing in near ground and flowing out above
o We do not have a good boundary condition for that case

• Use local mesh refinement around the turbines


o but do it gently (i.e. give the turbulence time to cascade down before
going to the next local refinement region)
o We use toposet (with rotatedBox option) and refineMesh

2.5 m

1.75 m
5m
3.5 m

7m
10 m

72
Guidelines for Use
• We generally use a time step such that the actuator line tip
does not travel through more than one cell per time step
• Can use larger time steps with actuator disk and swept
actuator line (which will be part of SOWFA soon).

73
Compiling The Codes

74
Compiling the codes
• Make sure you have OpenFOAM 2.0 or higher installed

• Download the SOWFA codes from our git repository


o https://github.com/NREL/SOWFA
– git clone https://github.com/NREL/SOWFA
– cd SOWFA
– git pull

• I keep a clean SOWFA directory, but do a copy of directory structure with soft linked files
to my user-2.0.x directory
o cp –rs /home/mchurchf/OpenFOAM/SOWFA /home/mchurchf/OpenFOAM/mchurchf-2.0.x
o cd mchurchf-2.0.x

• Then in mchurchf-2.0.x, I run


o ./Allwclean
o ./Allwmake

• In this way, you can have once central SOWFA directory that you periodically git pull to,
and have multiple different compiled versions of it (i.e, you may have user-2.0.x, user
2.2.x, and user-2.3.x directories that all link back SOWFA, but each run with the different
versions of OpenFOAM, and which also contain your own non-SOWFA custom files)

• See the README files

75
Example Cases:
Precursor Atmospheric Boundary Layer
Simulation

76
Atmospheric Boundary Layer

• See “tutorials/precursorABL”
• Uses the solver ABLPisoSolver
• 2 cases: Neutral and unstable (-zi/L ≈ 4)
• Wind: 9 m/s from 225 deg at 90 m
• Domain size: 3km × 3km × 1 km (x × y × z)
o Periodic in the horizontal
• Grid size: 150 × 150 × 50
o 20 m resolution throughout
o Coarser than we would normally run a simulation
• Run on 32 processors
o Took about 27 min of wall clock time per 1000 s of simulation
o Ran to 14,000 s of simulation time

77
The Process (see the “Allrun” script)

• Build a coarse mesh with blockMesh (serial)


o Builds a hexahedral mesh
• Decompose the domain with decomposePar (serial)
• Use refineHexMesh (parallel) to globally refine mesh to desired
resolution
o Splits hexahedral cells in half in each direction

• Initialize the solution with setFieldsABL (parallel)


• Run the solver from time 0 to quasi-equilibrium
• Run the solver from quasi-equilibrium to +2000 s
o Run with sampling of contour planes and boundary data (boundary data to be used later in
wind plant simulation as turbulent inflow)

78
Results

neutral unstable

79
Results

neutral unstable

80
Results

neutral unstable

81
Results

U (m/s)

82
Example Cases:
FAST-Couple Actuator Lines in Duct Flow

83
Case Study: fastDuct
../tutorials/fastDuct/

Computational Domain
200m
200m
200m
200m
200m
FLOW
100m

200m

outflow
NREL 5 MW Turbines 200m

Uniform inflow condition at U∞ = 8 m/s


Periodic BCs laterally (y and z directions)
84
Sample Run
Blade loadings are computed using FAST
• In ../fastDuct/ execute “Allrun” script
- currently set to run on a single node with 8 CPU cores
- generates uniform mesh
- decomposes the domain into nodes x cores
- runs fastPisoSolver in parallel

• Once finished running:


- execute “reconstructPar –time 140 (any desired saved time)
- execute “foamToVTK –time 140
- use ParaView for visualization
- examine loads data from primary*.out using Excel/MatLab

• Run “AllClean” to remove saved flow data, loads, and the grid

2 wind turbines

t = 140 sec

85
Sample Run
Blade
Streamwise Velocity loadings
Contours andare computed using FAST
iso-surface

t = 140 sec
2 wind turbines

Downstream turbine is being approached with wake structures

86
Out-of-plane Blade Loadings and Power Output from FAST

Example: primary0.out
- loads data primary*out can
be opened using Excel with
“tab delimited” options

- columns of data can be


Blade-tip acceleration
selected to generate figures

Blade root shear force


87
Out-of-plane Blade Loadings and Power Output from FAST

Blade-tip acceleration

Blade root out-of-plane bending moment Power generation

Blade root shear force


88
Example Cases:
Wind Farm Simulation

89
Wind Farm Simulation

• See “tutorials/windPlant”
• Uses the solver windPlantPisoSolver
• 2 cases: Neutral and unstable (-zi/L ≈ 4)
• Wind: 9 m/s from 225 deg at 90 m
• Domain size: 3km × 3km × 1 km (x × y × z)
• Grid size:
o Background grid is same as ABL precursor
o Locally refined down to 2.5 m around single 5MW turbine in horizontal
center of domain with 90 m hub height
• Run on 64 processors
o Took 21 hrs for 750 s of simulation time
o Much smaller time step than precursor (dt = 0.015s)

90
The Process (see the “Allrun” script)

• Build a coarse mesh with blockMesh (serial)


o Builds a hexahedral mesh
• Locally refine with topoSet (serial) and refineMesh (serial)
• Use refineMesh (serial) to globally refine mesh to desired resolution
o Splits hexahedral cells in half in each direction
• Use initial field files from precursor simulation, but change the
periodic boundaries to inflow/outflow (timeVaryingFixedMapped) to
use saved boundary data from precursor using changeDictionary
(serial)
• Renumber the cells to get better matrix banding with renumberMesh
(serial)
• Decompose the domain with decomposePar (serial)
• Initialize solution with precursor field using mapFields (serial)
• Run the solver

91
Results

The effect of too rapid a transition in Increasing the filter width helped,
grid resolution but not the best fix

92
Results

Results from a 48 turbine simulation1 of the Lillgrund offshore wind farm

1Churchfield, M. J., Lee, S., Michalakes, J., and Moriarty, P. J., “A Numerical Study of the Effects of Atmospheric and Wake Turbulence on Wind Turbine
Dynamics,” Journal of Turbulence, Vol. 13, No. 14, pp. 1-32, 2012.

93
Some References

Churchfield, M. J., Lee, S., Michalakes, J., and Moriarty, P. J., “A Numerical Study of the Effects
of Atmospheric and Wake Turbulence on Wind Turbine Dynamics,” Journal of Turbulence, Vol.
13, No. 14, pp. 1-32, 2012.

Churchfield, M. J., Lee, S., Moriarty, P. J., Martinez, L. A., Leonardi, S., Vijayakumar, G., and
Brasseur, J. G., “A Large-Eddy Simulation of Wind-Plant Aerodynamics,” AIAA Paper AIAA-2012-
537, 2012.

Lee, S., Churchfield, M. J., Moriarty, P. J., Jonkman, J., “Atmospheric and Wake Turbulence
Impacts on Wind Turbine Fatigue Loading,” AIAA Paper AIAA-2012-540, 2012.

Martinez, L. A, Leonardi, S., Churchfield, M. J., Moriarty, P. J., “A Comparison of Actuator Disk
and Actuator Line Wind Turbine Models and Best Practices for Their Use,” AIAA Paper AIAA-
2012-900, 2012.

94
Acknowledgements

• Atmospheric Boundary Layer and OpenFOAM-


related
o Jim Brasseur, Eric Patterson, Ganesh Vijayakumar,
Adam Lavely, Mike Kinzel
• Actuator Line Model
o Tony Martínez, Stefano Leonardi
• NREL collaborators
o Pat Moriarty, Mike Sprague, Julie Lundquist, John
Michalakes, Avi Purkayastha

95
Help

• First check the NWTC Codes forum at:


https://wind.nrel.gov/forum/wind/

• Then contact
o Matt Churchfield ([email protected])
o Sang Lee ([email protected])

96

You might also like