actuator turbine models and trailing edge flow...

135
Actuator turbine models and trailing edge flow: implementation in an in-house code Master’s Thesis in Applied Mechanics JOHANNA MATSFELT Department of Applied Mechanics Chalmers University of Technology Gothenburg, Sweden 2015 Master’s Thesis 2015:76

Upload: lebao

Post on 10-May-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

Actuator turbine models and trailing edgeflow: implementation in an in-house code

Master’s Thesis in Applied Mechanics

JOHANNA MATSFELT

Department of Applied Mechanics

Chalmers University of Technology

Gothenburg, Sweden 2015

Master’s Thesis 2015:76

Page 2: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

Actuator turbine models and trailing edge flow: implementation in an in-house code

c© JOHANNA MATSFELT, 2015

Master’s Thesis 2015:76

Department of Applied MechanicsDivision of Fluid DynamicsChalmers University of TechnologySE-41296 GoteborgSwedenTel. +46-(0)31 772 1000

Reproservice / Department of Applied MechanicsGoteborg, Sweden 2015

Page 3: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine
Page 4: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

Abstract

To be able to simulate a trailing edge flow in CALC some modifications needs to bedone in the code. The main reason for this is that CALC only can handle a computationaldomain consisting of one block. Modifications are made both in the multigrid solver thatsolves the pressure field and the flow solver. Some of the modifications that are made inthe multigrid solver can be recognized from the implementations in the flow solver butthe multigrid solver uses 1D arrays compared to 3D arrays in the flow solver.

This implementation allows CALC to run a flat plate simulation and this was one ofthe validating cases run. One laminar flow and one turbulent flow using the ReynoldsAveraged Navier Stokes (RANS) turbulent model and the results showed good agree-ment. One more validating RANS case was used here representing an airfoil instead ofa flat plate. This simulation showed that the flow fulfilled the no slip condition at thesurface of the airfoil which was the focus of the validation.

The second part of this master thesis consisted of implementing two Actuator tur-bine models named Actuator disk model (ADM) and Actuator line model (ALM). Theimplementation of ADM which is the less accurate model of the two was validated byan axisymmetric flow using the 5-MW National Renewable Energy Laboratory (NREL)wind turbine. The ALM model was validated using the same turbine but with a 3D flowdue to its 3D behaviour. The results were acceptable when comparing to the NREL dataand results in [1]. The results from the ADM simulation obtained by restricting the εivariable in the Gaussian function showed that more consistent predictions of the rotorthrust and power between different meshes could be obtained.

Page 5: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine
Page 6: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

Acknowledgements

This master thesis started in the beginning of September 2014 and ended in the middleof August 2015. It is a 60 HE project carried out at the fluid dynamics division atChalmers University of Technology in Gothenburg.

I would like to thank my supervisor and examiner Lars Davidson for believing in meand letting me carry out this one year master thesis. I would also like to thank the staffat the fluid dynamics division for their support.

Johanna Matsfelt, Gothenburg, August 2015

Page 7: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine
Page 8: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

Contents

1 Trailing edge flow: implementation in CALC 1

1.1 Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Finite Volume Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.3 No slip condition via source terms . . . . . . . . . . . . . . . . . . . . . . 41.4 Derivatives of pressure close to the airfoil . . . . . . . . . . . . . . . . . . 51.5 Multigrid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

1.5.1 Geometry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.5.2 Finite Volume Coefficients . . . . . . . . . . . . . . . . . . . . . . . 61.5.3 Prolongation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.6 Modifications needed for some turbulence models . . . . . . . . . . . . . . 81.6.1 Distance to the airfoil . . . . . . . . . . . . . . . . . . . . . . . . . 81.6.2 Derivatives of φ close to the airfoil . . . . . . . . . . . . . . . . . . 9

2 Trailing edge flow: validation 10

2.1 Flat plate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.1.1 Laminar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.1.2 RANS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.1.3 Conclusions of flat plate cases . . . . . . . . . . . . . . . . . . . . . 16

2.2 Airfoil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.2.1 Computational domain . . . . . . . . . . . . . . . . . . . . . . . . 172.2.2 Boundary conditions . . . . . . . . . . . . . . . . . . . . . . . . . . 182.2.3 Inlet data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.2.4 RANS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.2.5 Conclusions of airfoil case . . . . . . . . . . . . . . . . . . . . . . . 23

3 Actuator turbine models 24

3.1 Actuator disk model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.1.1 Gaussian function . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.1.2 Implementation in CALC . . . . . . . . . . . . . . . . . . . . . . . 263.1.3 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

i

Page 9: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

CONTENTS

3.2 Actuator line model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.2.1 Gaussian function . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.2.2 Implementation in CALC . . . . . . . . . . . . . . . . . . . . . . . 353.2.3 Validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

3.3 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

4 Further work 39

Appendices 42

Appendix A CALC part of init.f file including modifications 42

Appendix B CALC part of conv.f file including modifications 55

Appendix C CALC dpdyf.f file including modifications 57

Appendix D CALC part of peter init.f file including modifications 59

Appendix E CALC part of peter multi.f file including modifications 74

Appendix F CALC part of mg 2d.f file including modifications 79

Appendix G CALC part of peter relax.f file including modifications 83

Appendix H CALC distance to airfoil calculation in the mod.f file 89

Appendix I CALC dphidy.f file including modifications 94

Appendix J CALC part of ADM mod.f file 96

Appendix K CALC ADM force.f file 106

Appendix L CALC part of ALM mod.f file 109

Appendix M CALC ALM force.f file 121

ii

Page 10: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

Nomenclature

Symbols

Trailing edge flow

aN Northern coefficient of each cell

aS Southern coefficient of each cell

arean Northern face area of each cell

areanjafp1 Southern face area of the cells on top of the airfoil

anjafp1 The x part of the southern face area of the cells on top of the airfoil

aljafp1 The y part of the southern face area of the cells on top of the airfoil

ahjafp1 The z part of the southern face area of the cells on top of the airfoil

countMax Maximum number of guesses preformed for the x coordinate on the airfoil

δ Changes between different multigrid levels or boundary layer thickness

δ99 Boundary layer thickness defined at 99% of u∞

ε Dissipation

fyP Weight function through the northern face of the specified cell

fyS Weight function through the northern face of the cell south of the specified cell

H Thickness of the airfoil along the y direction

iaf Last cell along the x axis that is alongside the airfoil

iafp iaf but traced through the multigrid levels

jaf Cell below next to the airfoil along the y axis

jafp jaf but traced through the multigrid levels

jb2jtt Nodes part of interpolation for the synthetic inlet fluctuations

k Turbulent kinetic energy

movedivde Distance related variable to move the x coordinate guessed on the airfoil

ν Kinematic viscosity

φ Generic variable

φN φ at the center of the cell north of the specified cell

φn φ at the northern face of the specified cell

φP φ at the center of the specified cell

φS φ at the center of the cell south of the specified cell

φs φ at the southern face of the specified cell

ReH Reynolds number based on the thickness of the flat sturt

Rex Reynolds number at position x

Page 11: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

SP Source term

SU Source term

Θ Momentum thickness

u Velocity component along the x direction, [m/s]

u∞ Velocity infinitely away from the airfoil, [m/s]

U0 Local mean free-stream velocity component along the x direction, [m/s]

v Velocity component along the y direction, [m/s]

w Velocity component along the z direction, [m/s]

Actuator turbine models

AngBlade Angle between the blades

B Number of blades on the wind turbine

Bladek Instantaneous k plane location of each of the blades

c Local chord length of the section, [m]

CD Local drag coefficient

CL Local lift coefficient

dt Time step, [s]

DADM Drag force in ADM, [N/m2]

DALM Drag force in ALM, [N/m]

∆r Local radial mesh size, [m]

∆θ Local tangential mesh size, [m]

∆x Local axial mesh size, [m]

eD Unit vector in the direction of the drag

eL Unit vector in the direction of the lift

ε1D Variable controlling the width of the Gaussian distribution in ADM

ε3D Variable controlling the width of the Gaussian distribution in ALM

εi Variable controlling the width of the Gaussian distribution on cell level

η(p1D)1Dε 1D Gaussian distribution

η(p2D)3Dε 2D Gaussian distribution

fADM Forces in ADM, [N/m2]

imiddiff Number of cells streamwise before and after the wind turbine

LADM Lift force in ADM, [N/m2]

LALM Lift force in ALM, [N/m]

Page 12: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

omega The Rotational speed to the blades, [rad/s]

p1D Axial distance from evaluated point to the wind turbine, [m]

p2D Distance from evaluated point to the node on the line with the same radii, [m]

r Local radii of the section, [m]

R Rotor radii, [m]

θ Polar angle, [rad]

Theata2k Maps angles turned by the blades to k planes

tottime The total time of the simulation at this time step, [s]

utang Tangential velocity used in ADM and ALM, [m/s]

u Cartesian x-axis velocity component in CALC, [m/s]

v Cartesian y-axis velocity component in CALC, [m/s]

Vrel Local relative velocity, [m/s]

w Cartesian z-axis velocity component in CALC, [m/s]

Glossary

ADM Actuator Disk Model

ALM Actuator Line Model

BEM Blade Element Momentum Method

CFD Computational Fluid Dynamics

CPU Central Processing Unit

LES Large Eddy Simulation

NREL National Renewable Energy Laboratory

PANS Partially Averaged Navier Stokes

RANS Reynolds Averaged Navier Stokes

TDMA Tri-Diagonal Matrix Algorithm

URANS Unsteady Reynolds Averaged Navier Stokes

Page 13: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

1

Trailing edge flow:

implementation in CALC

1.1 Geometry

The CALC code can only handle a computational domain consisting of one block. Herethe trailing edge of an airfoil will be part of the domain as seen in fig. 1.1. With thissetup the choice would have been to use multiple blocks. When a one block mesh is usedthe location of the airfoil is needed to be traced. The variables iaf and jaf are used forthis. iaf is the last cell along the x axis that is alongside the airfoil and jaf is the cellbelow the airfoil along the y axis.

The variables are inserted in their locations with respect to the airfoil in fig. 1.2. Theone block configuration will by default treat the jaf cells as within the airfoil if the x cellcounter is less or equal to iaf. The physical interpretation of this can be seen in fig. 1.3.

Figure 1.1: Case setup including the trailing edge of the airfoil, not drawn to scale.

1

Page 14: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

1.1. GEOMETRY

CHAPTER 1. TRAILING EDGE FLOW: IMPLEMENTATION IN CALC

jaf + 1

jaf

iafi

j

Figure 1.2: Variables used to track the airfoil location in the computational domain.

jaf + 1

jaf

iafi

j

Figure 1.3: Variables used to track the airfoil location in the computational domain seenin default setup.

To avoid this problem the calculation of the center locations uses the y coordinate of thecorner of the cell with the x counter iaf and the y counter jaf i.e. the last cell alongthe x axis below the airfoil. The same strategy is used when calculating the areas andvolumes of the cells below the airfoil.

Due to the presence of the airfoil and the one block configuration a problem occurswith the areas located between the cells jaf and jaf+1. This is the areas that nowshould represent the top and bottom of the airfoil. So they are no longer representingthe same areas between the cells which is the normal case when a one block configurationis used. The northern areas of the jaf cells should represent the bottom of the airfoilwhile the southern areas of the jaf+1 cells should represent the top of the airfoil. Thisproblem was solved by introducing a new variable. The northern areas of the jaf cellshave the standard variable name arean while the southern areas of the jaf+1 cells will

2

Page 15: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

1.2. FINITE VOLUME COEFFICIENTS

CHAPTER 1. TRAILING EDGE FLOW: IMPLEMENTATION IN CALC

areanjafp1 (..,jaf,..)

arean(..,jaf,..)

Figure 1.4: Varibale names of the different areas on top of and below the airfoil.

be identified by the variable areanjafp1 .The use of the different area variables can be seen in fig. 1.4. The primary reason for

implementing it like this is that the southern areas of the jaf+1 cells are used at fewerlocations in the code than the northern areas of the jaf cells. The second contributingfactor is that the bottom of the airfoil is flat which makes it straightforward to find thecorrect coordinates of these nodes. If the line in the mesh would have continued alongthe bottom instead of the top of the airfoil, the bottom corners of the top cells wouldhave been needed to be provided to the code separately and needed to be changed foreach mesh to avoid approximations. The volumes of the cells on top of the airfoil areseparately calculated using the corner coordinates specified by the mesh and using thesouth areas from the variable areanjafp1 . In the default setup the volumes on top ofthe airfoil would have been calculated correctly but due to the modifications of arean

now only representing the cells below the airfoil an error is introduced if they are notcalculated separately. The calculations described above are in CALC performed in thefile init.f seen in appendix A.

1.2 Finite Volume Coefficients

If there is a body in the flow, the flow will react differently compared to if the bodywasn’t there. In the one block configuration with the trailing edge of an airfoil in theflow and the modifications above the body has no surface for the flow to feel. The physicsof the body need to be introduced as modifications of how the flow is handled by thecode. One modification needed is if the airfoil is not in the flow all the cells shouldsend information to each other. But when the airfoil is present the cells on top of andbelow the airfoil should not have any connection to each other. One step is to put thecoefficient aN to zero for the cells below the airfoil [2]. For the cells on the top of theairfoil coefficient aS is put to zero. The cells are now isolated from each other for all theφ variables e.g. u, v, w. In CALC this is done in the file mod.f.

Another modification is that the convective fluxes from the bottom of the airfoil are

3

Page 16: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

1.3. NO SLIP CONDITION VIA SOURCE TERMS

CHAPTER 1. TRAILING EDGE FLOW: IMPLEMENTATION IN CALC

set to zero to represent that no flow is allowed to flow through the airfoil. This is madein the mod.f file in CALC. The convective fluxes in CALC consists of a velocity-pressurecoupling, for this the Rhie-Chow interpolation is used. The Rhie-Chow interpolation isused rather than linear interpolation to make sure that no unphysical oscillations willappear in the velocity and pressure fields [3]. In the interpolation values at four nodesare used. To have no connection along the y axis between the top and bottom of theairfoil the interpolation for the nodes close to the airfoil cannot use values on the otherside of the airfoil. This modification can be seen in the conv.f file, the modified sectionof conv.f can be seen in appendix B.

1.3 No slip condition via source terms

The one block configuration with no surface for the flow to feel also introduces a problembecause the no slip condition needs to be fulfilled at the surface of the airfoil. Here itis introduced as a boundary condition between the cells on top of and below the airfoil.The boundary condition is implemented by the use of source terms. The connectionbetween the cells on top of and below the airfoil is cut. This is done by putting thecoefficient aN to zero for the cells below the airfoil and aS to zero for the cells on topof the airfoil [2]. This modification is identical to what is done to cut the connectionbetween the cells above and below the airfoil. So no further modification of the code isneeded to fulfill this criterion.

The source term implementation uses the original values of the coefficients aN andaS and implement them via the source terms SU and SP . For the cells below the airfoilthe source terms will be

SP = −aN , SU = aNφairfoil

The no slip condition only applies to the turbulent kinetic energy k and the velocitycomponents thereby φ refers to k, u, v or w. Due to the no slip condition at the surfaceof the airfoil, all of the quantities represented by φ are equal to zero at the surface.This results in a cancelling of the contribution to the source term SU . The unmodifiedcoefficients aN and aS in CALC contain contributions from both convection and diffusion.This implementation is only for the cells closest to the airfoil so the contribution due toconvection is zero resulting in

SP = −aNdiffusion, SU = 0

The source terms are modified in the same way for the top of the airfoil only switchingfrom the north coefficient aN to the south coefficient aS

SP = −aSdiffusion, SU = 0

4

Page 17: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

1.4. DERIVATIVES OF PRESSURE CLOSE TO THE AIRFOIL

CHAPTER 1. TRAILING EDGE FLOW: IMPLEMENTATION IN CALC

1.4 Derivatives of pressure close to the airfoil

Next to a surface the pressure change along the normal direction is zero. In the case ofthe airfoil the pressure change along the y direction next to the airfoil should be zerodue to the boundary condition dφ/dn = 0. In CALC the pressure gradient over a cell iscalculated using the values at the faces. To interpolate φ here representing the pressurefrom the node center to the faces linear interpolation with weight functions f is used inCALC [3]. This can be seen in the files dpdxf.f, dpdyf.f, dpdzf.f and in the dpdxfo.f,dpdyfo.f, dpdzfo.f. For the northern face of a cell the interpolation is made using formula

φn = fyPφN + (1− fyP )φP (1.1)

When interpolating the values of the northern faces for the cells below the airfoil, thecells on top of the airfoil should not have any connection to it. This is obtained bychoosing the value of zero for the weight function fyP in eq. 1.1 for these cells and this isdone in the file mod.f. The northern face value are thereby set to the same values as thecenter of the cell and a zero dφ/dn between the cell center and the airfoil is the resultas required.

In the same way as for the cells below the airfoil, the value at the faces of the cellson top of the airfoil should not have any connection to the value of the cells below theairfoil. In the same way as above the airfoil a zero pressure change along the y directionnext to the surface below the airfoil should be obtained. To interpolate φ from the centerto the southern face the following formula is used

φs = fySφP + (1− fyS)φS (1.2)

No contact between the cells on top of and below the airfoil occurs if fyS is set to one forthe cells on top of the airfoil. It should be noted that the weight function fyS in eq. 1.2for the cells on top of the airfoil is the same weight function as fyP in eq. 1.1 for thecells below the airfoil. This weight function has from above already been set to zero infavour of the cells below the airfoil; but for the cells on top of the airfoil a value of one isrequired. This is solved by an if statement to override the south face value after it hasbeen calculated using the center value of the cell above the airfoil. This results in a zerodφ/dn between the cell center and the airfoil. The special area variable areanjafp1 isused in the calculation to represent the south area of the cell at the top of the airfoil.The implementation in all the files are made in the same way and as an example theimplementation in the dpdyf.f file can be seen in appendix C.

1.5 Multigrid

To obtain the pressure field in CALC a multigrid solver is used. The multigrid solver isprefered compared to the tri-diagonal matrix algorithm (TDMA) because of its speed upof the convergence rates. Further information about the theory of the multigrid solverand its default implementation in CALC can be found in [4].

5

Page 18: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

1.5. MULTIGRID

CHAPTER 1. TRAILING EDGE FLOW: IMPLEMENTATION IN CALC

jafp

iafpi

j

coarser

jafp

iafpi

j

Figure 1.5: iafp and jafp through different multigrid levels.

Many modifications in the multigrid solver for the pressure can be recognized fromearlier sections for the velocity components. The major differences are that the multigridsolver uses 1D arrays while the flow solver uses 3D arrays. Another difference is that inthe multigrid solver the variables has to be traced through the different multigrid levels.

1.5.1 Geometry

The location of the last cell along the x axis below the airfoil is named iaf from theimplementation in the flow solver. The cell that would by default be treated as insidethe airfoil along the y axis is named jaf. These variables are now needed to be tracedthrough the different multigrid levels, which is why new variable names are introduced.The variable names were changed from iaf and jaf to iafp and jafp. The original variablesare integers but the new ones are 1D arrays containing integers. The size of the arrayscorresponds to the number of multigrid levels used. For this implementation to workthe original choice of the iaf and jaf has to be in such a way so that they through eachmultigrid level still corresponds to the same positions with respect to the airfoil. Anexample when this is applied between two multigrid levels can be seen in fig. 1.5. In thesame way as before the center locations, areas and volumes of the cells below the airfoilneeds to be modified. The modifications are made in the same way as before but thecoding could at first appear as different because of the 1D arrays instead of 3D arraysand that the operations are made at each multigrid level. The southern areas of the cellson top of the airfoil have a different variable name compared to the original areanjafp1now changed to anjafp1, aljafp1 and ahjafp1 for the x, y and z part of the area. Themodifications explained above can be seen in the file peter init.f in appendix D.

1.5.2 Finite Volume Coefficients

The coefficients aN and aS are treated in the same way as for the velocity. aN is set tozero for the cells below the airfoil and for the cells on top of the airfoil the coefficients aS

6

Page 19: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

1.5. MULTIGRID

CHAPTER 1. TRAILING EDGE FLOW: IMPLEMENTATION IN CALC

are set to zero and they are traced through the different multigrid levels. This is doneat the end of the file peter init.f seen in appendix D.

1.5.3 Prolongation

When going from a multigrid level of a coarse grid to one with a finer grid prolongationinterpolation is used. The type of interpolation for the prolongation is in CALC bilinearfor the two dimensional part of the multigrid solver and trilinear for the three dimensionalpart [4]. The three dimensional prolongation used in CALC follow the formula

δ2i,j,k =1

64(27δ1I,J,K + 9δ1I+1,J,K + 9δ1I,J+1,K + 9δ1I,J,K+1

+ 3δ1I+1,J+1,K + 3δ1I+1,J,K+1 + 3δ1I,J+1,K+1

+ δ1I+1,J+1,K+1)

(1.3)

The indices written as uppercase letters together with the superscript 1 in eq. 1.3 and thefollowing equations in this section indicate locations in the coarser multigrid level. Theindices as lowercase letters together with the superscript 2 indicate locations in the finermultigrid level. These notations are consistent with what is used in [4]. The formulaused in the two dimensional part of the multigrid solver is

δ2i,j =1

16(9δ1I,J + 3δ1I+1,J + 3δ1I,J+1 + δ1I+1,J+1) (1.4)

In the one block setup the interpolation is not allowed to include nodes from both belowand on top of the airfoil. From the equations above 1.3 and 1.4 it can be seen that theyinclude δ with both index δJ and δJ+1. By default CALC performs the prolongationstep and interpolation using nodes both below and on top of the airfoil. The solutionfor the nodes below the airfoil is to choose δJ+1 equal to δJ and for the nodes on top ofthe airfoil to choose δJ equal to δJ+1. For the three dimensional eq. 1.3 the nodes belowthe airfoil will now use the following prolongation step.

δ2i,j,k =1

64(27δ1I,J,K + 9δ1I+1,J,K + 9δ1I,J,K + 9δ1I,J,K+1

+ 3δ1I+1,J,K + 3δ1I+1,J,K+1 + 3δ1I,J,K+1

+ δ1I+1,J,K+1)

=1

64(36δ1I,J,K + 12δ1I+1,J,K + 12δ1I,J,K+1 + 4δ1I+1,J,K+1)

=1

16(9δ1I,J,K + 3δ1I+1,J,K + 3δ1I,J,K+1 + δ1I+1,J,K+1)

(1.5)

The connection to eq. 1.4 can be seen because the the resulting eq. 1.5 is a two dimen-sional prolongation formula. The difference is that eq. 1.4 is in the x-y plane and eq. 1.5

7

Page 20: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

1.6. MODIFICATIONS NEEDED FOR SOME TURBULENCE MODELS

CHAPTER 1. TRAILING EDGE FLOW: IMPLEMENTATION IN CALC

is in the x-z plane. The modification implemented in the CALC code can be seen inthe peter multi.f file in appendix E. In the two dimensional case eq. 1.4 will for the cellsbelow the airfoil take the following shape

δ2i,j =1

16(9δ1I,J + 3δ1I+1,J + 3δ1I,J + δ1I+1,J)

=1

16(12δ1I,J + 4δ1I+1,J )

=1

4(3δ1I,J + δ1I+1,J)

(1.6)

Also in the two dimensional case the prolongation eq. 1.6 decreases one dimension fromthe original eq. 1.4. The two dimensional prolongation for the nodes closest to the airfoilwill be linear along the x axis instead of two dimensional in the x-y plane. This can beseen in the mg 2d.f file in appendix F.

The mg 2d.f file is coded in a way to be able to handle all possible two dimensionalcombinations i.e. the planes x-y, x-z and y-z without the knowledge where the planeis located inside the computational domain. When the one block configuration is usedcontaining the trailing edge of an airfoil the code needs to know if the plane cuts throughthe airfoil or not. For the x-y plane the variables iafp and jafp have been added to theparameter list in the file peter relax.f seen in appendix G. The x-z plane will never cutthrough the airfoil so no further information is needed for the prolongation in this plane.The location of the y-z plane may or may not cut through the airfoil. The variable taf

was introduced for this purpose. If taf is true the plane will cut through the airfoil andthe prolongation should be according to eq. 1.6 otherwise according to eq. 1.4.

1.6 Modifications needed for some turbulence models

In some of the turbulence models further modifications are needed to make the imple-mentation work properly.

1.6.1 Distance to the airfoil

The shortest distance to the airfoil for each cell center is used in some of the turbulencemodels available. One of them is the Reynolds Averaged Navier Stokes (RANS) modelimplemented in CALC. The distance is here used in a damping function for calculatingthe viscosity and can be seen in the file vist pans.f. The coordinates of the airfoil isfound from the mesh and linear interpolation is used in between the given values. As afirst guess it is assumed that the coordinate on the airfoil has the same x coordinate asthe center of the cell. The guessed x coordinate and the y coordinate of the cell is usedto orientate on the airfoil where the shortest distance to the cell center can be found.The y coordinate on the airfoil corresponding to the guessed x coordinate is found andthe distance between it and the cell center is calculated. The second guess of the xcoordinate moves the guessed x coordinate value a bit along the positive x axis. The

8

Page 21: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

1.6. MODIFICATIONS NEEDED FOR SOME TURBULENCE MODELS

CHAPTER 1. TRAILING EDGE FLOW: IMPLEMENTATION IN CALC

moving distance is dependent by the variable movedivide. This variable is dependent onthe geometry of the airfoil and a value of 1000 was chosen for this setup. Again the ycoordinate on the airfoil is found and the distance to it is calculated. The algorithmnow has enough information to on its own make guesses whether to go along the positiveor negative x axis and the distance to move. A maximum of 100 guesses of x locationsfor each cell is made specified using the variable countMax. The distance to the airfoilcalculation is done in the mod.f. file and can be seen in appendix H.

1.6.2 Derivatives of φ close to the airfoil

In all of the available turbulence models the derivative of the variable φ is used. TheLarge Eddy Simulation (LES) model is one of them. It is here part of the calculation ofviscosity and the φ variable is one of the three velocity components. This can be seenin the file vist les.f. At the airfoil due to the no slip condition the derivative should betaken with a value of zero at the airfoil surface. When using a one block mesh thereexists no values at the airfoil surface. To represent these values when the derivativesnext to the surface of the airfoil is calculated. The northern face value of the cells belowthe airfoil i.e. at jaf is set to zero. In the same way the southern face value of thecells on top of the airfoil i.e. at jaf+1 is set to zero. For the jaf+1 cells also the southareas are specified using the variable areanjafp1 . The derivatives are calculated in thefiles dphidx.f, dphidy.f and dphidz.f. The implementation in all the files are made inthe same way and as an example the implementation in the dphidy.f file can be seen inappendix I.

9

Page 22: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2

Trailing edge flow: validation

To validate the implementation in CALC a flat plate and an airfoil setup is used.

2.1 Flat plate

Two cases are used as validation cases for the flat plate. For each case two simulationsare performed, the first a one sided setup where all implementations done is commentedaway. The second a two sided case where the top and bottom results should be identical.The first test case is a laminar flat plate simulation where external results are used tovalidate the simulation results. The second case is a RANS simulation of a flat plateflow with comparison between the two simulations.

In all the simulations performed boundary conditions are applied to the planes lim-iting the x, y and z axis. These planes are assigned names according to fig. 2.1.

2.1.1 Laminar

The laminar case is a steady and incompressible two dimensional flow along a flat plate.The case setup can be found in appendix B in [5]. The given data is obtained using thesame code as the implementation is made in i.e. CALC but without the implementation.The basic setup of the case can be seen in fig. 2.2, with the flow simulated 0.19m before

TOP

FRONT

LEFTx

y

z BOTTOM

BACK

RIGH

T

x

y

z

Figure 2.1: Name declaration of the planes in the computational domain.

10

Page 23: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.1. FLAT PLATE CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

Inlet Outlet

x

y

Figure 2.2: The case setup, not drawn to scale.

Inlet Outlet

x

y

Figure 2.3: The one sided case setup, not drawn to scale.

it reaches the flat plate. The media simulated is air at 20◦C at a uniformed velocity of1m/s. The discretization scheme used is the hybrid scheme, personal communication [6].The hybrid discretization scheme is also used in all the flat plate simulations performedto validate the implementation.

One sided

When the code is run as a one sided flat plate the whole case seen in fig. 2.2 is notneeded to be simulated; only the top part of the plate is used as seen in fig. 2.3 with thecomputational domain marked in red. It has a length of 2.461m and a height of 1.289m.The mesh used has 252 nodes along the x axis and 200 nodes along the y axis.

The presence of the flat plate is simulated by applying boundary conditions to thebottom boundary named BOTTOM in fig. 2.1. For the velocity components the followingboundary conditions are applied. A wall boundary condition is used at the flat plate anda symmetry boundary condition is used before and after the plate. The inlet conditionis applied to the plane named LEFT in fig. 2.1. The inlet boundary condition is an

11

Page 24: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.1. FLAT PLATE CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

0 0.2 0.4 0.6 0.8 10

0.01

0.02

0.03

0.04

0.05

y

u(a) u velocity component

0 1 2 3 4 5

x 10−3

0

0.01

0.02

0.03

0.04

0.05

y

v

(b) v velocity component

Figure 2.4: Comparison of the velocity components profiles at x equal to 1.5645m betweenthe simulation and the given data. : Data, 2: Simulation.

uniformed u velocity with zero flow along the y axis. On the plane named RIGHTan outlet Neumann boundary condition of zero change of the u and v component ofthe velocity along the x axis is applied. The boundary named TOP has a symmetryboundary condition along the whole boundary. Cyclic boundary conditions are appliedto the planes named FRONT and BACK, these boundary conditions are also used forthe pressure on these planes. On all the other planes seen in fig. 2.1 Neumann boundaryconditions of zero gradient are applied for the pressure.

The onesided case is run using a numerous of if statements in the implementationand a value of -1 for the variables iaf and jaf. The implementation is not made to easilyhandle this case but to make sure that nothing of the original code has been damagedduring the implementation this case is run. The u and v velocity profiles from thesimulation are compared to the profiles from the given data close to the flat plate at xequal to 1.5645m seen if fig. 2.4. The u velocity profile of the simulation is spot on thegiven data. A difference between the simulation and the given data can be seen in thev component of the velocity profile. The magnitude of the v velocity should be notedwhich is 10−3 so both the results show acceptably good agreement to the given data.

Two sided

The implementation makes it possible to simulate the flat plate as infinitely thin. Thisresults in that the simulations of both the one sided and two sided flat plate should givethe same results. The computational domain used to simulate the two sided flat platecan be seen in fig. 2.5, the black line indicates the location of the flat plate.

The two sided flat plate computational domain is the one sided flat plate but mirroredalong the y equal to zero plane. This simulation should thereby give the same resultsfor the profiles of the u and v components of the velocity as the one sided simulation.

The u and v velocity profiles at x equal to 1.5645m are compared to the data givenclose to the flat plate in fig. 2.6. The mesh used both for the simulation on top and

12

Page 25: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.1. FLAT PLATE CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

Inlet Outlet

x

y

Figure 2.5: The two sided case setup, not drawn to scale.

0 0.2 0.4 0.6 0.8 10

0.01

0.02

0.03

0.04

0.05

y

u(a) u velocity component

0 1 2 3 4 5

x 10−3

0

0.01

0.02

0.03

0.04

0.05

y

v

(b) v velocity component

Figure 2.6: Comparison of the u and v velocity profiles at x equal to 1.5645m between thesimulation and the given data. : Data, 2: Simulation on top, ◦: Simulation below.

below the plate is identical. The u velocity profiles of the two sided flat plate show goodagreement to the data. For the v velocity component profile the values on top of andbelow the airfoil are spot on each other. But their values differ toward the given data. Inthe same way as for the one sided flat plate simulation the magnitude of the v velocitycomponent is 10−3, so the seen difference is accepted. Also the two sided simulationshow good agreement toward the given data.

2.1.2 RANS

In this validating case a flat plate is also used, but here it starts from the beginningof the computational domain. The RANS k − ε turbulence model is use to predict thebehavior of the flow. The inlet profiles used in this case is not uniformed as can be seenin fig. 2.7.

The length of the flat plate used in this validating case is 6m and the length between

13

Page 26: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.1. FLAT PLATE CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

Inlet Outlet

x

y

Figure 2.7: The case setup, not drawn to scale.

Inlet Outlet

x

y

Figure 2.8: The one sided case setup, not drawn to scale.

the inlet and outlet is 12m. The inlet profiles used in the simulations are the profiles thatwill be used on top of the airfoil at a momentum thickness of 4100 for the airfoil simula-tion. The simulation for the one sided plate uses the computational domain marked inred in fig. 2.8.

In the same way as for the earlier validating case the flat plate is simulated using awall boundary condition on the plane in the computational domain named BOTTOMin fig. 2.1. After the flat plate along the x axis a symmetry boundary condition is used.The height of the computational domain is 3.8486m. The mesh used has 50 nodes alongthe x axis and 70 nodes along the y axis. In the two sided simulation this validation caseuses in the same way as the laminar validating case an infinitely thin flat plate. Thecomputational domain is marked in red in fig. 2.9.

The inlet profiles used in the simulation seen in fig. 2.9 are identically the same ontop of and below the flat plate with respect to the flat plate i.e. the sign of the v velocityprofile is changed for the profile below the flat plate. The profiles for u, v, k and ε ofthe one sided and on each side of the two sided simulation are compared at x equal to4.625m.

14

Page 27: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.1. FLAT PLATE CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

Inlet Outlet

x

y

Figure 2.9: The two sided case setup, not drawn to scale.

0 0.2 0.4 0.6 0.8 10

0.1

0.2

0.3

0.4

0.5

0.6

y

u(a) Boundary layer

0 0.2 0.4 0.6 0.80

0.01

0.02

0.03

0.04

0.05

y

u(b) Zoom near the flat plate

Figure 2.10: Comparison of the u velocity profile at x equal to 4.625m between the simu-lations. : One sided, 2: Simulation on top, ◦: Simulation below.

The result of the u velocity profiles is seen in fig. 2.10 show that the predicted valuesboth on top of and below the flat plate in the two sided simulation is spot on the predictedvalues from the one sided simulation. In fig. 2.11 it can be seen that the predicted valuesof the v velocity profiles on top of and below the airfoil gives more or less the sameresults. But they both differ compared to the one sided simulation. But as could beseen by the x axis of both the figures shown in fig. 2.11 their magnitudes are small i.e.10−4 for the left figure and 10−6 for the right one. So the results given by both thesimulations are acceptably close to each other. Even when the k profiles are zoomed inclose to the flat plate as seen in the right figure in fig. 2.12 the predicted values fromall the simulations seems to give the same results. Also the predicted ε values werecompared between the simulations and can be seen in fig. 2.13. In the same way as thek profiles the ε profiles from the simulations seem to predict identically the same resultseven when zooming in close to the flat plate.

15

Page 28: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.1. FLAT PLATE CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

−5 0 5 10 15

x 10−4

0

0.1

0.2

0.3

0.4

0.5

0.6

y

v

(a) Boundary layer

−5 0 5 10 15

x 10−6

0

0.01

0.02

0.03

0.04

0.05

y

v

(b) Zoom near the flat plate

Figure 2.11: Comparison of the v velocity profile at x equal to 4.625m between the simu-lations. : One sided, 2: Simulation on top, ◦: Simulation below.

0 2 4 6 8

x 10−3

0

0.1

0.2

0.3

0.4

0.5

0.6

y

k(a) Boundary layer

0 2 4 6 8

x 10−3

0

0.01

0.02

0.03

0.04

0.05

y

k(b) Zoom near the flat plate

Figure 2.12: Comparison of the k profile at x equal to 4.625m between the simulations.: One sided, 2: Simulation on top, ◦: Simulation below.

2.1.3 Conclusions of flat plate cases

All the compared profiles show similar results within accepted difference in the marginsbetween the one and two sided simulations and the given data. This shows that nothingof the original code has been damaged during the implementation. The results obtainedfrom the top of and below the flat plate are identically the same results. So the imple-mentation makes the flow behave in the same way on top of and below the flat platewhich is an important point to show for this implementation to be correct.

16

Page 29: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.2. AIRFOIL CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

0 0.01 0.02 0.03 0.040

0.1

0.2

0.3

0.4

0.5

0.6

y

ε(a) Boundary layer

0 0.01 0.02 0.03 0.040

0.01

0.02

0.03

0.04

0.05

y

ε(b) Zoom near the flat plate

Figure 2.13: Comparison of the ε profile at x equal to 4.625m between the simulations.: One sided, 2: Simulation on top, ◦: Simulation below.

-20

0

1

21

y/H

-4 0 20x/H

x

y

Figure 2.14: Dimensions of the computational domain including the trailing end of theairfoil, not drawn to scale.

2.2 Airfoil

In the same way as the implementation can handle an infinitely thin flat plate it can alsohandle the trailing edge of an airfoil inside the computational domain. The only thingthat is different when the airfoil is run instead of the flat plate is the mesh used.

2.2.1 Computational domain

The computational domain is shaped to be able to compare the results from simulationswith the experiments by Blake in [7]. The chosen dimensions of the computationaldomain can be seen in fig. 2.14.

17

Page 30: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.2. AIRFOIL CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

The origin of the computational domain is located at the trailing edge of the airfoilas seen in fig. 2.14. Along the y axis the computational domain extents y/H = 20 unitson each side of the airfoil, i.e. it reaches from y/H = -20 to y/H = 21. The thickness ofthe airfoil in the y direction is defined as H. Along the x direction the domain extendfrom x/H = -4 to x/H = 20. The width of the computational domain is chosen to 0.5Halong the z axis.

The size of the computational domain along the y axis is consistent with the threesimulations by Wang in [8] and Wang et al. in [9, 10]. One of the simulations madeby Wang in [8] uses a computational domain of height 82H and Gritskevich et al. usesin [11] a domain reaching from y/H = -40 to y/H = 40. These computational domainsare about double the size as the one in fig. 2.14 but in the articles using the smallercomputational domain no issues regarding boundary conditions interfering with the sim-ulation seemed to be present. So the smaller computational domain was chosen to saveCentral Processing Unit (CPU) time. Along the x axis the computational domain usesthe same dimensions and positioning of the airfoil as in [11]. The only difference is thatin this implementation both the top and bottom inlets will be located at x/H = -4,while [11] has the top inlet at x/H = -4 and the bottom at x/H = -1. Wang et al. useslarger dimensions of the domain including the airfoil with x axis lengths of 20H [8] and16.5H [8, 9, 10]. In all these simulations more of the flow on the sides of the airfoil issimulated e.g. in the 16.5H simulations the inlets are positioned at about x/H = -8.The x/H = -4 inlet was chosen to save CPU time and the inlet conditions from thesimulations by Wang et al. were recalculated for the new positions, further informationof how this was done is presented later in the report. The computational domain in thesimulations by Wang et al. extends to about x/H = 8. The longer distance towards theoutflow used in [11] were preferred to make sure that the outflow boundary conditiondoes not affect the results of the simulation. The width of the computational domainused in [8, 9, 10, 11] was 0.5H which is also chosen for this simulation. The curve de-scribing the trailing edge of the airfoil used in this simulation is the same as used byBentaleb et al. in [12].

ywall =(1−R1) +√

R21 − x2 for 0 ≤ x/H < 2.3

ywall =y2 −√

R21

4− (x2 − x)2 for 2.3 ≤ x/H < 2.835

ywall =R2 −√

R22 − (2.937 − x)2 for 2.835 ≤ x/H < 2.937

(2.1)

In eq. 2.1 the constants are R1 = 4.03H, R2 = 0.334H and y2 = 1.936H. The trailingedge of the airfoil is located at x/H = 0 and y/H = 0 and the computational domain isbuilt around it.

2.2.2 Boundary conditions

The boundary conditions specified for the velocity components and the pressure are notidentical at all the planes. The planes of the computational domain where the boundary

18

Page 31: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.2. AIRFOIL CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

conditions are applied can be seen in fig. 2.1.

Velocity

At the planes TOP and BOTTOM seen in fig. 2.1 the boundary condition specified issymmetry. This simulates that the airfoil is located far away from being affected byany other body. The condition means that no flow will pass through this plane and thegradients of all the velocity components at the plane is zero, which is resonable since theflow on each side of the plane is identical to each other if no disturbances are present.This boundary condition has to be applied sufficiently far away from the airfoil so thatthe presence of the airfoil does not cause any flow through the boundaries. On theplanes named FRONT and BACK according to fig. 2.1 cyclic boundary condition areapplied. This boundary condition means that the airfoil has an infinitely length alongthe z axis. The outflow boundary condition applied at plane RIGHT in fig. 2.1 is aNeumann boundary condition with zero change of the velocity component in the normaldirection to the plane. The inlet boundary condition used at plane LEFT in fig. 2.1 istaken from a Reynolds Averaged Navier Stokes (RANS) simulation of a flow along a flatplate with data from a location of prescribed local momentum thickness.

Pressure

The boundary condition for the pressure is cyclic on the planes FRONT and BACK infig. 2.1. On the other planes a Neumann zero gradient boundary condition is applied.

2.2.3 Inlet data

Local momentum thickness

To be able to compare the results obtained from the simulations using this implemen-tation with the experiments performed by Blake in [7] the RANS data used at the inlethave to have the same Reynolds number ReΘ based on the local momentum thicknessand boundary layer edge velocity as the flow in the experiments. Wang et al. uses in [9]ReΘ equal to 2760 for the profiles below the airfoil and a ReΘ value of 3380 on topof the airfoil to duplicate the experiments performed by Blake. The dimensions of thecomputational domain used in the simulation performed by Wang et al. are different.The inlet used by Wang et al. is located at x/H = −8. The mesh used in this imple-mentation has an inlet located at x/H = −4. At these new locations the momentumthicknesses on top and below the airfoil are needed. They can be found using the datafrom the experiments performed by Blake and the formulas from Apsley in [13]. Blakesexperiments are performed using a flat strut with thickness 2 inches at a velocity of 100ft/s at the Reynolds number based on the thickness of the flat strut ReH of 1.02 · 105 [7].Using the definition of ReH the kinematic viscosity ν used in the experiments performedby Blake can be found from.

19

Page 32: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.2. AIRFOIL CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

ReH =u∞H

ν

Next the momentum thickness Θ for the ReΘ used by Wang et al. is found using thedefinition of ReΘ seen below.

ReΘ =u∞Θ

ν

The x location can be found from the obtained data using the formulas by Apsley in [13].Here the momentum integral relation for a zero pressure gradient boundary layer andthe power law approximation is used to obtain the formulas presented below for themomentum thickness and the boundary layer thickness δ.

Θ =7

72δ (2.2)

δ

x= 0.166Re−1/7

x (2.3)

In eq. 2.3 Rex is the Reynolds number at position x i.e.

Rex =u∞x

ν

By combining eq. 2.2 and 2.3 the x location for the simulation by Wang et al. can befound. Now we use the difference in x location towards our inlet and eq. 2.2 and 2.3is again used; now to find the new momentum thickness. The RANS simulation resultused as part of the inlet profiles in this implementation applied at the top of the airfoilhas a momentum thickness of 4100 and below the airfoil a momentum thickness of 3500.

Scaling

The inlet data used in the simulation need to be rescaled because the ReΘ values werethe same, but the momentum thicknesses did not have the same values as have beencalculated for the locations of the inlets in the mesh. To obtain the same momentumthickness the momentum thickness of the data is calculated and a factor is created toobtain the required momentum thickness. This factor is then applied to the center andcorner locations of the nodes in the data.

The data that should be used as inlet profiles in CALC should have a maximumvalue of u equal to one. The original maximum u value is larger than one and is used asa factor. The factor is applied to the quantities depending on their velocity dependencee.g. u and v is scaled only by the factor while the turbulent kinetic energy k is scaled bythe factor up to the power of two. The dissipation ε is needed to be scaled in a different

20

Page 33: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.2. AIRFOIL CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

way. This to fit the boundary condition at the surface of the airfoil presented in [14] andseen below

ε =2kν

y2(2.4)

In eq. 2.4 y is defined as the normal distance from the airfoil. To scale the dissipationto fit with the boundary condition the used scale factor is presented below

εfactor =( ksimkdata

)( νsimνdata

)

(δ99,simδ99,data

)2(2.5)

In eq. 2.5 ksim is the turbulent kinetic energy that will be used in the simulation in CALCand kdata is for the given data. In the same way as for the turbulent kinetic energy νsimis the kinematic viscosity that will be used in the CALC simulation and νdata is for thegiven data. The δ99,sim is the thickness of the boundary layer in the simulation wherethe limit is when u is 99% of the u velocity infinitely away from the airfoil often definedas u∞. The δ99,data is the thickness of the boundary layer for the given data.

The data are interpolated from the given nodes of the data to the nodes of the mesh.Linear interpolation is used. The given data value for the dissipation at the airfoil cannot be used in the interpolation if nodes of the mesh are located closer to the airfoilthan the data nodes, because this value is not the correct boundary value. To obtainthe values of ε the boundary condition eq. 2.4 is used for the nodes in the mesh closerto the airfoil.

The inlet profiles are written to one file for both the inlets. But the data is obtainedfrom RANS simulations that have a wall at the bottom. In the airfoil simulation thewall i.e. the airfoil is located at the bottom for the top profile but the airfoil is on thetop of the bottom profile. To represent this for the bottom profile the v velocity profilehas to be mirrored.

2.2.4 RANS

In this validating case the RANS k− ε turbulence model is used to predict the behaviorof the flow. The discretization scheme used is the same scheme as used in the simulationsof the flat plate validating cases i.e. the hybrid scheme. The u/u∞ and urms profiles areavailable from the experiments performed by Blake in [7] to validate the implementation.

The predicted u/u∞ velocity profiles are compared with measurements at locationsx/H = -3.125, -2.125, -1.625, -1.125 and -0.625 see fig. 2.15. Here it is seen that thevelocity profiles all fulfills the no slip condition at the surface of the airfoil. All theprofiles from the experiments have similar shapes as those from the simulation, but theirmagnitudes are different. The focus in this studied was the implementation to be ableto run this case setup and get converging results. No case setup that is more simplifiedthan this is available to validate the implementation without changing the physics ofthe simulation. If simulations should be run to obtain results that is in agree withthe experiments by Blake it is recommended to do a mesh study and to change the

21

Page 34: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.2. AIRFOIL CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

−3 −2.5 −2 −1.5 −1 −0.5 0 0.50

0.5

1

1.5

y/H

u/u∞ + x/H

Figure 2.15: Comparison of the u profiles obtain by the simulation and the experimentsby Blake at locations, x/H = -3.125, -2.125, -1.625, -1.125 and -0.625. : Drawn airfoil,

: Simulation, : Experiments by Blake.

−3 −2.5 −2 −1.5 −1 −0.5 0 0.50

0.5

1

1.5

y/H

urms + x/H

Figure 2.16: Comparison of the urms + x/H profiles obtain by the simulation and the ex-periments by Blake at locations, x/H = -2.125, -1.625, -1.125 and -0.625. : Drawn airfoil,

: Simulation, : Experiments by Blake.

turbulence model. Nothing of this has been done in this study and it is recommended toread [8, 9, 10, 11] where the results in agreement with the experiments is the main focus,if this is the goal of the study by the reader. In this study the simulation converged andthe profiles in fig. 2.15 show that the no slip condition is fulfilled is an acceptable result.

The profiles of urms are compared from the experiments by Blake and from thissimulation at the locations x/H = -2.125, -1.625, -1.125 and -0.625 in fig. 2.16. In thesame way as for the u/u∞ profiles these profiles also show that the no slip condition isfulfilled at the surface of the airfoil. The urms profiles obtained from the simulation andthe experiments show similar behavior but their magnitudes are different in the sameway as for the u/u∞ profiles in fig. 2.15.

22

Page 35: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

2.2. AIRFOIL CHAPTER 2. TRAILING EDGE FLOW: VALIDATION

2.2.5 Conclusions of airfoil case

Both the comparisons of u/u∞ and urms show that the no slip condition is fulfilled atthe surface of the airfoil. The simulation itself was converging which is important toshow that the implementation in CALC is made in a correct way. So the focus of thisstudy to implement this case setup in CALC is seen as completed.

23

Page 36: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3

Actuator turbine models

In wind turbine CFD simulations actuator turbine models are often used in favour ofsolving the flow field over each blade. The main advantage of this is that the boundarylayer on each blade does not need to be resolved so the mesh resolution can be reducedsignificantly. [15]

In actuator turbine models the wind turbine is simulated by drag forces. But theexact representation of the blades could vary in numerous ways e.g. a disk in ActuatorDisk Model (ADM) and lines in an Actuator Line Model (ALM). The physical repre-sentation of ADM and ALM can be seen in fig. 3.1. In this work an ADM and an ALMwere implemented that both apply thrust and tangential force.

3.1 Actuator disk model

Due to that the ADM simulates the wind turbine blades as a disk the flow will beaxisymmetric. The ADM is based on the Blade Element Momentum Method (BEM)which calculates the forces on the blades by 2D airfoil profiles. The lift and drag forcecalculations for the ADM can be seen below.

fADM =∂F

∂A= (LADM ,DADM ) =

B

2πr

1

2ρV 2

relc(CLeL, CDeD) (3.1)

In ADM the lift and drag forces, LADM and DADM are per unit area as can be seen ineq. 3.1. An example of an area section where the force from an ADM routine could beapplied on can be seen in fig. 3.2. In eq. 3.1 B represents the number of blades on thewind turbine and r represents the local radius to the center location on the area section.The rest of eq. 3.1 is an ordinary lift and drag force formula for an airfoil where Vrel isthe local relative velocity and c represents the local chord length. CL and CD are thelocal lift and drag coefficients and eL and eD are the unit vectors in the directions of thelift and drag. Further information on the steps from BEM to ADM can be found in [16].

24

Page 37: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.1. ACTUATOR DISK MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

ADM

ALM

Figure 3.1: Wind turbine to ADM and ALM.

Figure 3.2: Area sections of ADM.

3.1.1 Gaussian function

The forces obtained from the ADM are in the axial plane of the wind turbine. Applyingthese forces to the Computational Fluid Dynamics (CFD) simulation as a point forcewill lead to oscillations [1]. To avoid these oscillations the force could be smeared awayfrom the single point in numerous ways. Here the force will be smeared using a Gaussiandistribution. For the ADM a 1D Gaussian distribution smearing in the axial directionis recommended [16] and can be seen in fig. 3.3.

η(p1D)1Dε =1

ε1D√πe−

(

p1D

ε1D

)2

(3.2)

In eq. 3.2 the 1D Gaussian distribution used in this implementation can be seen. p1D isthe axial distance from the point evaluated to the wind turbine. The variable ε1D is afunction of εi and the mesh resolution along the axial direction ∆x.

25

Page 38: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.1. ACTUATOR DISK MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

Figure 3.3: 1D gaussian applied.

ε1D = εi∆x (3.3)

In this 1D smearing case ε1D is described by eq. 3.3. εi is recommended to be in therange from 1 to 4 [16] and ∆x is the local axial mesh size.

3.1.2 Implementation in CALC

The implementation of ADM in CALC is first visible in the mod.f file where the part withADM implementation code can be seen in appendix J. Variables that will be constantduring the whole simulation are first initialized e.g. the number of nodes radially on theblades. In this section the location of the wind turbine in the mesh is also found.

The velocity in ADM is represented in two dimensions by the axial and the tangentialvelocity. The CALC code uses Cartesian coordinates with the x axis being the axialdirection and the z axis pointing upwards and the y axis specified from the two others.The axial velocity in the ADM is the same as the Cartesian u component of the velocityin CALC. The tangential velocity is obtained from

utang = −vsin(θ) + wcos(θ) (3.4)

Here utang is the tangential velocity in ADM and θ is the polar angle coordinate whichneeds to be found for each cell of the mesh in the y-z plane. This is needed becauseCALC cannot handle a 2D axisymmetric mesh. When the mesh is axisymmetric it needsa y-z plane formed like a regular polygon due to the multigrid solver for the pressure.A representation of such a mesh can be seen in fig. 3.4. This is followed by readingthe dimensions of the blades from the aeroData.inp file followed by the lift, drag andmomentum coefficients from the CLCDCMTable.inp file.

26

Page 39: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.1. ACTUATOR DISK MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

xy

z

Figure 3.4: The mesh used in ADM and ALM.

In each time step the axial and tangential velocities are averaged over all the cellson the same radii from the center of the wind turbine rotor. This is followed by sendingthe variables to the force subroutine seen in appendix K. It is first checked if the cell islocated on the blade outside of the hub radius. If not only a drag force is applied andreturned to the mod.f file. If the cell is located outside of the hub radii the flow angle,the angle of attack and the Mach number of the flow are calculated and by the helpof subroutines aeroTable and foilclcdcm the lift and drag coefficients are found. Thesecoefficients are then used together with the flow angle to obtain the coefficients in thenormal direction referred to as the axial direction in the mod.f file and the tangentialdirection. Last in the force routine the normal and the tangential forces are calculated.Here eq. 3.1 is used but in the normal and the tangential directions instead of the lift anddrag directions. The reason is that the normal and the tangential velocities are suppliedto the force subroutine.

When returning to the mod.f file the normal force (from here on called the axial force)and the tangential force are converted from Newton per meter squared on a circular areato a regular polynomial area due to the mesh. The drag force in the axial and tangentialdirections will be applied to the momentum equations as source terms. To do this theunit needs to be Newton and not Newton per area section. So the forces are multipliedby the area in the y-z plane of the cell. Next the tangential force is projected to a y andz component and added as source terms in the V and W momentum equations.

The smearing of the force takes place in the mod.f file. Here the Gaussian distributioneq. 3.2 and the ε1D eq. 3.3 equations are used. In the end of mod.f the smeared forceis added to the Su source term. To smear the force axial in the computational domainthe variable imiddiff is used. It represents the number of cells in the axial directionupstream and downstream of the wind turbine where the smeared force will be added to

27

Page 40: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.1. ACTUATOR DISK MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

imiddiff 1 imiddiff 2 imiddiff 1imiddiff 2

x

Figure 3.5: Choice of imiddiff parameter. Here imiddiff 1 has a good value butimiddiff 2 has a value which is too low. The Gaussian function described by eq. 3.2 isshown by the dashed line.

the Su source term. Depending on the magnitude of the force and the parameters of theGaussian distribution the smeared force will be wider or narrower. When first startinga new setup of the simulation it is important to make sure that the contribution to thesource term in the start and end cell is close to zero. Because if it is not this could causeoscillations in the simulation. In fig. 3.5 two dummy variables are shown representingthe values of the imiddiff variable. imiddiff 1 has a larger value than imiddiff 2.This means that the imiddiff 1 value choice will start applying the smeared force at acell located further away from the wind turbine. The Gaussian function in fig. 3.5 hasa value close to zero at this location. So imiddiff 1 is a good choice of value for theimiddiff variable. However consider the imiddiff 2 value of the imiddiff variable.It is here seen that the Gaussian function is not close to zero. So a choice representingimiddiff 2 is not recommended.

Before the force is added to the momentum equations it is smeared with the Gaussianfunction. The Gaussian is integrated for each radial position along the axial axis. Thenwhen the Gaussian is used to smear the force this integrated Gaussian is used to scaleso that the final contribution of the Gaussian is equal to one. Here the force is addedto the source term of the u velocity, but the same follows for the v and w velocity bychanging the applied force to the y and z forces.

3.1.3 Validation

To validate the ADM implementation the 5-MW reference wind turbine from NationalRenewable Energy Laboratory (NREL) is used [17]. This wind turbine is used due tothe amount of available data e.g. velocity profiles at velocity specific rotational speed ofthe rotor and pitch angle of the blades. The RANS k-ε turbulence model was used.

This first setup describes a uniformed wind blowing on the rotor blades and the huband can be seen in fig. 3.6. This representation allows the simulation to be run using axissymmetry. The axisymmetric computational domain can be seen in fig. 3.7 expressed inunits of rotor radii. The flow is simulated 10 rotor radii before the wind turbine and 20after. Radially the flow is simulated 9 rotor radii outside of the wind turbine. Radiallythe mesh has 240 cells.

28

Page 41: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.1. ACTUATOR DISK MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

wind

Figure 3.6: First setup.

R

9R

10R 20Rx

r

Figure 3.7: Axisymmetric computational domain in units rotor radii. The location of thewind turbine is seen as the thick line inside the computational domain.

Velocity profiles

From the NREL documentation the velocity profiles can be found. The rotational speedseen in fig. 3.8(a) and the blade pitch angle shown in fig. 3.8(b) were taken from thistechnical report to be able to compare the behaviour of the ADM implementation fordifferent wind velocities [17]. In the velocity profile simulations the mesh had 160 cellsin the axial direction distributed uniformly, which corresponds to a ∆x value of 11.81m.

In fig. 3.9 the predicted rotor power and rotor thrust can be seen as functions ofthe wind speed. The NREL data using the BEM model is seen in red and the ADMsimulation using the RANS turbulence model is seen in blue. The shape of the ADMcurves are close to the NREL shape but have a distance in between them. At wind speedslarger than 11.4 m/s the blades start to pitch as seen in fig. 3.8(b) and the influence ofthis on the rotor power and thrust is also captured by the ADM implementation seenin fig. 3.9. The results from the ADM is not expected to give the exactly same resultsas the NREL data because different models have been used. Rather it should have themain shape equal to the NREL data which has been shown here.

ε parameter

The ε and ∆ parameters have been shown to have an impact on the results from the CFDsimulation [1, 16]. Simulations when varying the ε and ∆ parameters were performed to

29

Page 42: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.1. ACTUATOR DISK MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

6 8 10 12 14

0.7

0.8

0.9

1

1.1

1.2

1.3

1.4

Wind speed [m/s](a) Rotational speed

6 8 10 12 140

2

4

6

8

10

Wind speed [m/s](b) Pitch angle

Figure 3.8: Rotational speed [rad/s] and pitch angle on the blade [◦] as function of thewind speed from the NREL data [17].

6 8 10 12 140

1

2

3

4

5

6

Wind speed [m/s](a) Rotor power

6 8 10 12 14100

200

300

400

500

600

700

800

900

Wind speed [m/s](b) Rotor thrust

Figure 3.9: Rotor power [MW ] and thrust [kN ] as function of the wind speed.: NREL BEM, : ADM RANS.

30

Page 43: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.1. ACTUATOR DISK MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

investigate the impact on this implementation of ADM. The uniformly inflow was chosento be 8 m/s and the rotational speed was 1.003 rad/s and zero pitch angle. Here the 1Dε parameter described by eq. 3.3 and the axial mesh size named ∆x were varied.

The input used in this simulation was quite close to the input used in [1]. Thesame wind turbine was used, the inflow velocity was also 8 m/s, the rotational speedwas a bit lower 0.959 rad/s. They used a 3D Gaussian distribution which should giveslightly different results [1, 16]. The software in [1] was OpenFOAM using LES withthe Smagorinsky subgrid model which should provide more accurate results comparedto the RANS k-ε model used here but the magnitude of the difference is unknown [5].

The rotor power results from the simulations performed in this master thesis canbe seen in fig. 3.10. The span of data used for the parameters was larger in thesesimulations than in the simulations made by [1] seen in fig. 3.11. All the data fromthe present simulations are shown in fig. 3.10(a) and data from a similar span as in [1]can be seen in fig. 3.10(b). The reason that data for the lowest ε value of 2.36 is notpresented for meshes with ∆x larger than 2.36 is the large oscillations introduce thatcaused the simulations to diverge. The result from the simulations in [1] show an overalllarger amplitude of the results from minimum 1.95 MW with ε = 4.2 m and uniform∆ = 4.25 m to a maximum of 2.25 MW with ε = 10.5 m and uniform ∆ = 1.1 m [1].Comparing to approximately the same parameter values here giving 1.35 MW for ε= 3.78m and ∆x = 4.2 m to 1.59 MW for ε = 11.81 m and ∆x = 1.05 m. Giving a differencein their simulations of 0.3 MW and in this simulations 0.25 MW. So the difference ismore or less the same but it is unknown if the difference is due to the different Gaussianfunctions or turbulence models used or something else.

The main behaviour of the rotor power when the parameters are changed is the samebetween the simulations. Keeping ε constant and increasing ∆ will decrease the rotorpower predicted. Whereas keeping ∆ constant and increasing ε will increase the rotorpower. The power of the choice of ∆ and ε can be seen in fig. 3.10(a). Here the predictedrotor power varies between 0.48 MW and 1.63 MW.

Data for the rotor thrust is also presented in fig. 3.12 in the same way as for therotor power. The thrust shows the same behaviour as the power keeping ε constantand increasing ∆ decreases the predicted rotor thrust. Whereas keeping ∆ constant andincreasing ε increases the rotor thrust. Fig. 3.12(a) shows the power for different ∆ andε and the trust predictions vary from 200 kN to 360 kN. No comparing data for the rotorthrust are available in [1].

To limit these differences in predicted rotor power and thrust it is in [16] recom-mended to limit the εi parameter in eq. 3.3 between 1 and 4. This will limit the ε1D

parameter differently for different choices of ∆x i.e. meshes. Showing this in fig. 3.10 andfig. 3.12 proved difficult so the data was rearranged and shown as constant ∆x profilesin fig. 3.13 instead of constant ε1D profiles. The part of the profiles in fig. 3.13 that aresolid shows a εi value between 1 and 4 and the dashed part has values outside of thisinterval.

It is now clearly seen the ε1D value varies a lot from the mesh with the smallest∆x to the one with the largest ∆x. But the rotor power and thrust is for all the

31

Page 44: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.1. ACTUATOR DISK MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

0 2 4 6 8 10 120

0.5

1

1.5

2

∆x [m](a) All data

1 2 3 41.2

1.3

1.4

1.5

1.6

∆x [m](b) Zoomed

Figure 3.10: Rotor power [MW ] as function of ∆x [m]. : ε1D = 2.36 m,: ε1D = 3.78 m, : ε1D = 6.30 m, : ε1D = 11.81 m, : ε1D = 15.12 m,: ε1D = 25.20 m.

0 1 2 3 41.6

1.7

1.8

1.9

2

2.1

2.2

∆x [m]

Figure 3.11: Rotor power [MW ] as function of the ∆x [m], data obtained from [1].: ε = 4.2 m, : ε = 6.3 m, : ε = 8.4 m, : ε = 10.5 m.

32

Page 45: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.1. ACTUATOR DISK MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

0 2 4 6 8 10 12200

250

300

350

400

∆x [m](a) All data

1 2 3 4300

320

340

360

380

400

∆x [m](b) Zoomed

Figure 3.12: Rotor thrust [kN ] as function of the ∆x [m]. : ε1D = 2.36 m,: ε1D = 3.78 m, : ε1D = 6.30 m, : ε1D = 11.81 m, : ε1D = 15.12 m,: ε1D = 25.20 m.

0 10 20 30 40 500.4

0.6

0.8

1

1.2

1.4

1.6

ε [m](a) Rotor power

0 10 20 30 40 50200

250

300

350

400

ε [m](b) Rotor thrust

Figure 3.13: Rotor power [MW ] and thrust [kN ] as function of the ε [m].: ∆x = 1.050 m, : ∆x = 1.575 m, : ∆x = 2.36 m, : ∆x = 3.78 m,: ∆x = 6.30 m, : ∆x = 11.81. m

∆x values much more restricted for the recommended εi values. The interval of thesmallest predicted rotor power is now 1.4 MW to the largest of 1.63 MW. This shows adifference of 0.23 MW compared to 1.15 MW for the non restricted εi simulations. Inthe rotor thrust the smallest predicted value is now 330 kN and the largest 360 kN. Sothe difference is now 30 kN compared to 160 kN for the non restricted εi simulations.

So to be able to have more consistent predictions of the rotor power and thrust

33

Page 46: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.2. ACTUATOR LINE MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

Figure 3.14: 2D Gaussian smears forces both in the axial direction in the same way as the1D Gaussian seen in fig. 3.3 but now also in the rotor plane.

between different meshes i.e. different ∆ values it is more important to keep track of theεi parameter than the ε1D parameter in eq. 3.3.

3.2 Actuator line model

In ALM the blades are simulated as lines. This representation makes it not possible torun the simulation axisymmetric as in ADM now a 3D simulation is needed.

fALM =∂F

∂L= (LALM ,DALM ) =

1

2ρV 2

relc(CLeL, CDeD) (3.5)

The ALM formula for lift and drag can be seen in eq. 3.5, as LALM andDALM . Comparedto the ADM the ALM formula has the unit force per length instead of force per area.ALM can capture the tip and root vortices which ADM cannot. To have a representationof these vortices is important when studying the near wake which is a clear advantageof the ALM over the ADM. The advantage of ADM compared to ALM is the speed ofconvergence if the near wake is not to be studied. [1]

3.2.1 Gaussian function

The force obtained from the ALM is along a line. The 2D Gaussian distribution rec-ommended from [16] will not only smear the force in the axial direction but also in thetangential direction following a constant radii in the rotor plane. Hence the force willnot only be applied as in fig. 3.3 but also in the rotor plane (seen in fig. 3.14).

η(p2D)3Dε =1

(ε3D)2πe−

(

p2D

ε3D

)

2

(3.6)

34

Page 47: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.2. ACTUATOR LINE MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

The 2D Gaussian distribution can be seen in eq. 3.6. The variable p2D is the distancefrom the evaluated point to the node on the line with the same radius. The ε1D fromADM is now not only a variable depending on the axial mesh resolution but the whole3D mesh resolution and is hence denoted by ε3D.

ε3D = εi√

(R∆θ)2∆r2∆x2 (3.7)

Eq. 3.7 shows the formula for ε3D recommended and used here [16]. The variable R isthe rotor radius, ∆θ, ∆r and ∆x are the local tangential, radial and axial mesh sizerespectively.

3.2.2 Implementation in CALC

The implementation of ALM in CALC has many similarities to the implementation ofADM. This section will only present changes and further implementations needed forthe ALM compared to the ADM.

To run ALM compared to ADM the location of the blades i.e. the lines need to betraced. This is done in the mod.f file seen in appendix L after the airfoil data has beenread. The first thing that needs to be done is to trace the angle the blades has turnedwithin one lap to the current k plane. This is done by the variable Theata2k which mapsangles to k planes. Finally the angle between the blades are calculated and defined bythe AngBlade.

Each time step the location of the blades needs to be found. To do this the time stepdt, the total time of the simulation at this current time step tottime and the rotationalspeed omega are used. First the number of whole laps the blades has turned is found.The radians this corresponds to are then subtracted from the total radians turned to findthe radians turned within the lap. Then Theata2k and AngBlade variables are used tofind the k plane location of each blade and store it in the Bladek variable.

For each blade the local axial and tangential velocity are now found and used asinput in the force subroutine for ALM seen in appendix M. The only difference betweenthe force subroutine in ADM and ALM is the two formulas for calculating the normaland tangential force at the end of the routine. In ALM the formulas are given in eq. 3.5.

Like in ADM the ALM forces must have the unit Newton. This is obtained bymultiplying the forces obtained from the force subroutine by the radial mesh size of thecells seen in fig. 3.15. The ε3D will vary in the mesh because it includes ∆r. So to beable to compare the constant ε1D in ADM to the varying ε3D in ALM the ε3D valuesare averaged. Observe that this is only for comparison reasons and the mesh local valueof ε3D is used in the simulation.

The 2D Gaussian distribution is integrated for each radial position over the axialand the tangential axis. Like in the ADM the integral is scaled so that it is equal toone. This is the definition of a Gaussian, but without scaling the integrated 2D Gaussianis much larger than one. The force from each blade is then added to the source termindividually after being smeared. This is done in the mod.f file in appendix L and hereeq. 3.6 and eq. 3.7 are used.

35

Page 48: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.2. ACTUATOR LINE MODEL CHAPTER 3. ACTUATOR TURBINE MODELS

Figure 3.15: 2D gaussian in addition to 1D gaussian also apply forces in the rotor plane

3.2.3 Validation

The ALM implementation is validated in this section. Both the Unsteady ReynoldsAveraged Navier Stokes (URANS) and the Partially Averaged Navier Stokes (PANS)turbulence models are used.

Velocity profiles

To validate the ALM implementation the same wind turbine as used in the ADM val-idation, the 5-MW reference wind turbine from NREL is used [17]. This first setupdescribes a uniformed wind blowing on the rotor blades and the hub and can be seen infig. 3.6. This setup allowed the ADM simulation to be carried out using axis symmetrybut in the ALM the lines are rotating so the simulation now needs to be run in 3D. Thecomputational domain was the same as in ADM and can be seen in fig. 3.7. The windspeeds were the same as in the ADM simulations. The rotational speed and the bladepitch angle versus wind speed are shown in fig. 3.8.

When the PANS turbulence model is used the LES region is specified as the blackregion in the computational domain in fig. 3.16 and the URANS region is white. Thetransitions between the regions take place over a distance of two rotor radius.

In fig. 3.17 the predicted rotor power and rotor thrust are presented as functions ofthe wind speed. The NREL data using the BEM model is included in red and the ADMsimulation using the RANS turbulences model is seen in blue. The ALM simulationsusing URANS and PANS are also shown. When predicting the rotor thrust ALM predictssomewhat higher values than ADM but not as high as the NREL data. Comparing theALM simulations to each other the values predicted by the PANS gives slightly lowerrotor power and thrust than the URANS simulation. Here the ALM shows values incloser agreement to the NREL data than the ADM results.

36

Page 49: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.3. CONCLUSIONS CHAPTER 3. ACTUATOR TURBINE MODELS

R

9R

10R 20Rx

r

Figure 3.16: The LES region seen in black and URANS region in white. They are shownin the axisymmetric computational domain in units rotor radius.

6 8 10 12 140

1

2

3

4

5

6

Wind speed [m/s](a) Rotor power

6 8 10 12 14

200

400

600

800

Wind speed [m/s](b) Rotor thrust

Figure 3.17: Rotor power [MW ] and thrust [kN ] as function of the wind speed.: NREL BEM, : ADM RANS, : ALM URANS, : ALM PANS.

3.3 Conclusions

When comparing the ADM and ALM velocity profiles of the rotor power and the rotorthrust to the NREL data the main shape is the same. This was the focus due to NRELuses the BEM model so no actuator turbine model when predicting the quantities. Boththe 1D in ADM and 2D in ALM Gaussian distributions have been normalized so thatthe integral is equal to one.

When varying the values of the ε and the ∆x parameters in the ADM simulationand comparing the predicted rotor power to [1] the difference between the maximumand minimum were more or less the same. But it is unknown if the small difference isdue to the different Gaussian distributions or turbulence models or something else. Nocomparing data for the rotor thrust are available in [1].

37

Page 50: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

3.3. CONCLUSIONS CHAPTER 3. ACTUATOR TURBINE MODELS

To have more consistent predictions of the rotor power and the rotor thrust in ADMbetween different meshes i.e. different ∆x values it is more important to keep track ofthe εi parameter than the ε1D parameter in eq. 3.3.

38

Page 51: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

4

Further work

In the trailing edge flow in the airfoil case a mesh refinement study needs to be done.To obtain velocity profiles that agree with the experiments by Blake to a larger extentthan the ones presented here it is also recommended to change the turbulence model.

In the ALM simulation the rotor power and rotor thrust dependence on the meshresolution and the ε2D is still needed to be found.

39

Page 52: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

Bibliography

[1] L. M. Tossas, S. Leonardi, Wind turbine modeling of computational fluid dynam-ics, Tech. rep., National Renewable Energy Laboratory, University of Puerto Rico,Mayaguez, Puerto Rico (2013).

[2] H. K. Versteeg, W. Malalasekra, An introduction to computional fluid dynamicsand finite volume method, 2nd Edition, Pearson Education Limited, Harlow, GreatBritian, 2007.

[3] L. Davidson, B. Farhanieh, Calc-bfc a finte-volume code employing collocated vari-ble arrangement and cartesian velocity components for computation of fluid flowand heat transfer in complex three-dimensional geometrist, Publication no 95/11,Division of Fluid Dynamics, Dept. of Applied Mechanics, Chalmers University ofTechnology, Goteborg, Sweden (1995).

[4] P. Johansson, A three dimensional laminar multigrid method applied to the simplecalgorithm, Publication no 92/11, Division of Fluid Dynamics, Dept. of AppliedMechanics, Chalmers University of Technology, Goteborg, Sweden (1992).

[5] L. Davidson, Fluid mechanics, turbulent flow and turbulence modeling, 23 dec,Division of Fluid Dynamics, Dept. of Applied Mechanics, Chalmers University ofTechnology, Goteborg, Sweden (2014).

[6] L. Davidson, Division of Fluid Dynamics, Dept. of Applied Mechanics, ChalmersUniversity of Technology, Goteborg, Sweden (2014).

[7] W. Blake, A statistical description of pressure and velocity fields at the trailingedges of a flat strut, 4241, David W. Taylor Naval ship research and developmentcenter, Bethesda, USA (1975).

[8] M. Wang, Progress in large-eddy simulation of trailing-edge turbulence and aeroa-coustics, in: Annual Research Briefs, Center for Turbulent Research, StanfordUniv./NASA Ames Research Center, 1997, pp. 37–49.

40

Page 53: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

BIBLIOGRAPHY BIBLIOGRAPHY

[9] M. Wang, P. Moin, Dynamic wall modelling for large eddy simulation of complexturbulent flows, Physics of Fluids 14 (7) (2002) 2043–2051.

[10] M. Wang, P. Moin, Computation of trailing-edge flow and noise using large-eddysimulation, AIAA Journal 38 (12) (2000) 2201–2209.

[11] M. Gritskevich, A. Garbaruk, J. Schutze, F. Menter, Development of ddes andiddes formulations for the k-ω shear stress transport model, Flow, Turbulence andCombustion 88 (2012) 431–449.

[12] Y. Bentaleb, S. Lardeau, M. A. Leschziner, Large-eddy simulation of turbulentboundary layer separation from a rounded step, Journal of Turbulence 13 (4) (2012)1–28.

[13] D. Apsley, Turbulent boundary layers, Tech. rep., The university of Manchester,Manchester, Great Britain (2009).

[14] L. Davidson, An introduction to turbulence models, Publication no 97/2, Divisionof Fluid Dynamics, Dept. of Applied Mechanics, Chalmers University of Technology,Goteborg, Sweden (2011).

[15] N. Troldborg, Actuator line modeling of wind tubine wakes, Ph.D. thesis, Dept.of Mechanical Engineering, Technical University of Denmark, Lyngby, Denmark(2008).

[16] R. Mikkelsen, Actuator disk methods applied to wind turbines, Ph.D. thesis, Dept.of Mechanical Engineering, Technical University of Denmark, Lyngby, Denmark(2008).

[17] W. M. J. Jonkman, S. Butterfield, G. Scott, Definition of a 5-mw reference windturbine for offshore system development, Tech. rep., National Renewable EnergyLaboratory, Golden, Colorado (2009).

41

Page 54: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

A

CALC part of init.f file including

modifications

subrout ine i n i t

chapter 0 0 0 0 0 0 0 0 p r e l im i n a r i e s 0 0 0 0 0 00

in c lude ’COMMON’inc lude ’CASECOM’

dimension xcmod( i t , j t , kt ) , ycmod( i t , j t , kt ) , zcmod ( i t , j t , kt )

chapter 1 1 1 1 1 1 geometr i ca l q u an t i t i e s 1 1 1 1 11

c−−−−−−c a l c u l a t e the nodes o f the con t r o l volume .

p i =4.∗ atan ( 1 . )do 100 kk= 1 ,nkdo 100 j j= 1 , njdo 100 i i= 1 , n i

im1=max( i i −1 ,1)jm1=max( j j −1 ,1)km1=max(kk−1 ,1)

i=min ( i i , nim1 )

42

Page 55: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

j=min ( j j , njm1)k=min ( kk , nkm1)

xp ( i i , j j , kk)=& 0.125∗ ( xc ( i , j , k)+xc ( im1 , j , k)+xc ( i , jm1 , k)+xc ( im1 , jm1 , k )& +xc ( i , j , km1)+xc ( im1 , j , km1)+xc ( i , jm1 , km1)+xc ( im1 , jm1 , km1) )

yp ( i i , j j , kk)=& 0.125∗ ( yc ( i , j , k)+yc ( im1 , j , k)+yc ( i , jm1 , k)+yc ( im1 , jm1 , k )& +yc ( i , j , km1)+yc ( im1 , j , km1)+yc ( i , jm1 , km1)+yc ( im1 , jm1 , km1) )

zp ( i i , j j , kk)=& 0.125∗ ( zc ( i , j , k)+zc ( im1 , j , k)+zc ( i , jm1 , k)+zc ( im1 , jm1 , k )& +zc ( i , j , km1)+zc ( im1 , j , km1)+zc ( i , jm1 , km1)+zc ( im1 , jm1 , km1) )

c Modif ied by Mats f e l tc Modify the yp f o r nodes in the a i r f o i l

i f ( i i . l e . i a f . and . j j . eq . j a f ) then

yp( i i , j j , kk)=& 0.125∗ ( yc ( i a f , j , k)+yc ( i a f , j , k)+yc ( i , jm1 , k)+yc ( im1 , jm1 , k )& +yc ( i a f , j , km1)+yc ( i a f , j , km1)+yc ( i , jm1 , km1)+yc ( im1 , jm1 , km1) )

end i fc Modif ied by Mats f e l t

100 cont inue

c−−−−−−c a l c u l a t e the area o f the con t r o l volume f a c e sdo 110 k= 1 ,nkm1do 110 j= 1 , njm1do 110 i= 1 , nim1

im1=max(1 , i −1)jm1=max(1 , j −1)km1=max(1 , k−1)

c−−−−−−−−−ax=xc ( i , j , k)−xc ( im1 , j , k ) !ay=yc ( i , j , k)−yc ( im1 , j , k ) !az=zc ( i , j , k)−zc ( im1 , j , k ) !

c−−−−−−−−−bx=xc ( i , j , k)−xc ( i , j , km1) !by=yc ( i , j , k)−yc ( i , j , km1) !bz=zc ( i , j , k)−zc ( i , j , km1) !

c−−−−−−−−−

43

Page 56: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

cx=xc ( i , j , k)−xc ( i , jm1 , k ) !cy=yc ( i , j , k)−yc ( i , jm1 , k ) !cz=zc ( i , j , k)−zc ( i , jm1 , k ) !

c−−−−−−−−−dx=xc ( i , jm1 , km1)−xc ( i , jm1 , k ) !dy=yc ( i , jm1 , km1)−yc ( i , jm1 , k ) !dz=zc ( i , jm1 , km1)−zc ( i , jm1 , k ) !

c−−−−−−−−−ex=xc ( i , jm1 , km1)−xc ( i , j , km1) !ey=yc ( i , jm1 , km1)−yc ( i , j , km1) !ez=zc ( i , jm1 , km1)−zc ( i , j , km1) !

c−−−−−−−−−ox=xc ( im1 , j , km1)−xc ( im1 , j , k ) !oy=yc ( im1 , j , km1)−yc ( im1 , j , k ) !oz=zc ( im1 , j , km1)−zc ( im1 , j , k ) !

c−−−−−−−−−px=xc ( im1 , jm1 , k)−xc ( i , jm1 , k ) !py=yc ( im1 , jm1 , k)−yc ( i , jm1 , k ) !pz=zc ( im1 , jm1 , k)−zc ( i , jm1 , k ) !

c−−−−−−−−−qx=xc ( im1 , jm1 , k)−xc ( im1 , j , k ) !qy=yc ( im1 , jm1 , k)−yc ( im1 , j , k ) !qz=zc ( im1 , jm1 , k)−zc ( im1 , j , k ) !

c−−−−−−−−−rx=xc ( im1 , j , km1)−xc ( i , j , km1) !ry=yc ( im1 , j , km1)−yc ( i , j , km1) !r z=zc ( im1 , j , km1)−zc ( i , j , km1) !

c Modif ied by Mats f e l tc Modify the yc at j a f l e v e l f o r the l o c a t i o n s in the a i r f o i l

i f ( i . l e . i a f . and . j . eq . j a f ) then

ay=yc ( i a f , j , k)−yc ( i a f , j , k ) !by=yc ( i a f , j , k)−yc ( i a f , j , km1) !cy=yc ( i a f , j , k)−yc ( i , jm1 , k ) !

ey=yc ( i , jm1 , km1)−yc ( i a f , j , km1) !oy=yc ( i a f , j , km1)−yc ( i a f , j , k ) !

qy=yc ( im1 , jm1 , k)−yc ( i a f , j , k ) !ry=yc ( i a f , j , km1)−yc ( i a f , j , km1) !

44

Page 57: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

end i fc Modif ied by Mats f e l t

a i1x=cy∗bz−cz ∗byai1y=cz ∗bx−cx∗bza i1z=cx∗by−cy∗bx

ai2x=ey∗dz−ez ∗dyai2y=ez ∗dx−ex∗dza i2z=ex∗dy−ey∗dx

aj1x=by∗az−bz∗ayaj1y=bz∗ax−bx∗aza j 1z=bx∗ay−by∗ax

aj2x=oy∗ rz−oz∗ ryaj2y=oz∗ rx−ox∗ r za j 2z=ox∗ ry−oy∗ rx

ak1x=cy∗pz−cz ∗pyak1y=cz ∗px−cx∗pzak1z=cx∗py−cy∗px

ak2x=qy∗az−qz∗ayak2y=qz∗ax−qx∗azak2z=qx∗ay−qy∗ax

areaex ( i , j , k )=0.5∗( a i1x+ai2x )areaey ( i , j , k )=0.5∗( a i1y+ai2y )areaez ( i , j , k )=0.5∗( a i 1z+a i2z )

areanx ( i , j , k )=0.5∗( aj1x+aj2x )areany ( i , j , k )=0.5∗( aj1y+aj2y )areanz ( i , j , k )=0.5∗( a j 1z+aj2z )

areahx ( i , j , k )=0.5∗( ak1x+ak2x )areahy ( i , j , k )=0.5∗( ak1y+ak2y )areahz ( i , j , k )=0.5∗( ak1z+ak2z )

110 cont inue

c−−−−−−c a l c u l a t e the volume .

45

Page 58: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

c volume=0.333∗ area t imes coord . ( sum over a l l f a c e s )volsum=0.0do 120 k= 2 ,nkm1do 120 j= 2 , njm1do 120 i= 2 , nim1

im1=i−1jm1=j−1km1=k−1

c−−−−−−−−−eas t f a c exe=0.25∗( xc ( i , j , k)+xc ( i , jm1 , k)+xc ( i , jm1 , km1)+xc ( i , j , km1) )ye=0.25∗( yc ( i , j , k)+yc ( i , jm1 , k)+yc ( i , jm1 , km1)+yc ( i , j , km1) )ze =0.25∗( zc ( i , j , k)+zc ( i , jm1 , k)+zc ( i , jm1 , km1)+zc ( i , j , km1) )

c Modif ied by Mats f e l tc Modify ye f o r the l o c a t i o n s in the a i r f o i l

i f ( i . l e . i a f . and . j . eq . j a f ) thenye=0.25∗( yc ( i a f , j , k)+yc ( i , jm1 , k)+yc ( i , jm1 , km1)+yc ( i a f , j , km1) )

end i fc Modif ied by Mats f e l t

vo l e=xe∗ areaex ( i , j , k)+ye∗ areaey ( i , j , k)+ze ∗ areaez ( i , j , k )

c−−−−−−−−−west f a c exw=

& 0.25∗ ( xc ( im1 , j , k)+xc ( im1 , jm1 , k)+xc ( im1 , jm1 , km1)+xc ( im1 , j , km1) )yw=

& 0.25∗ ( yc ( im1 , j , k)+yc ( im1 , jm1 , k)+yc ( im1 , jm1 , km1)+yc ( im1 , j , km1) )zw=

& 0.25∗ ( zc ( im1 , j , k)+zc ( im1 , jm1 , k)+zc ( im1 , jm1 , km1)+zc ( im1 , j , km1) )

c Modif ied by Mats f e l tc Modify yw f o r the l o c a t i o n s in the a i r f o i l

i f ( i . l e . i a f . and . j . eq . j a f ) thenyw=

& 0.25∗ ( yc ( i a f , j , k)+yc ( im1 , jm1 , k)+yc ( im1 , jm1 , km1)+yc ( i a f , j , km1) )end i f

c Modif ied by Mats f e l t

volw=−xw∗ areaex ( i −1, j , k)−yw∗ areaey ( i −1, j , k)−zw∗ areaez ( i −1, j , k )

c−−−−−−−−−north f a c e

46

Page 59: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

xn=0.25∗( xc ( i , j , k)+xc ( im1 , j , k)+xc ( im1 , j , km1)+xc ( i , j , km1) )yn=0.25∗( yc ( i , j , k)+yc ( im1 , j , k)+yc ( im1 , j , km1)+yc ( i , j , km1) )zn=0.25∗( zc ( i , j , k)+zc ( im1 , j , k)+zc ( im1 , j , km1)+zc ( i , j , km1) )

c Modif ied by Mats f e l tc Modify yn f o r the l o c a t i o n s in the a i r f o i l

i f ( i . l e . i a f . and . j . eq . j a f ) thenyn=0.25∗( yc ( i a f , j , k)+yc ( i a f , j , k)+yc ( i a f , j , km1)+yc ( i a f , j , km1) )

end i fc Modif ied by Mats f e l t

voln=xn∗areanx ( i , j , k)+yn∗areany ( i , j , k)+zn∗ areanz ( i , j , k )

c−−−−−−−−−south f a c exs=

& 0.25∗ ( xc ( i , jm1 , k)+xc ( im1 , jm1 , k)+xc ( im1 , jm1 , km1)+xc ( i , jm1 , km1) )ys=

& 0.25∗ ( yc ( i , jm1 , k)+yc ( im1 , jm1 , k)+yc ( im1 , jm1 , km1)+yc ( i , jm1 , km1) )zs=

& 0.25∗ ( zc ( i , jm1 , k)+zc ( im1 , jm1 , k)+zc ( im1 , jm1 , km1)+zc ( i , jm1 , km1) )

vo l s=−xs∗areanx ( i , j −1,k)−ys∗areany ( i , j −1,k)−zs ∗ areanz ( i , j −1,k )

c−−−−−−−−−high f a c exh=0.25∗( xc ( i , j , k)+xc ( i , jm1 , k)+xc ( im1 , jm1 , k)+xc ( im1 , j , k ) )yh=0.25∗( yc ( i , j , k)+yc ( i , jm1 , k)+yc ( im1 , jm1 , k)+yc ( im1 , j , k ) )zh=0.25∗( zc ( i , j , k)+zc ( i , jm1 , k)+zc ( im1 , jm1 , k)+zc ( im1 , j , k ) )

c Modif ied by Mats f e l tc Modify yh f o r the l o c a t i o n s in the a i r f o i l

i f ( i . l e . i a f . and . j . eq . j a f ) thenyh=0.25∗( yc ( i a f , j , k)+yc ( i , jm1 , k)+yc ( im1 , jm1 , k)+yc ( i a f , j , k ) )

end i fc Modif ied by Mats f e l t

volh=xh∗areahx ( i , j , k)+yh∗areahy ( i , j , k)+zh∗ areahz ( i , j , k )

c−−−−−−−−−low f a c ex l=

& 0.25∗ ( xc ( i , j , km1)+xc ( i , jm1 , km1)+xc ( im1 , jm1 , km1)+xc ( im1 , j , km1) )y l=

& 0.25∗ ( yc ( i , j , km1)+yc ( i , jm1 , km1)+yc ( im1 , jm1 , km1)+yc ( im1 , j , km1) )z l=

47

Page 60: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

& 0.25∗ ( zc ( i , j , km1)+zc ( i , jm1 , km1)+zc ( im1 , jm1 , km1)+zc ( im1 , j , km1) )

c Modif ied by Mats f e l tc Modify y l f o r the l o c a t i o n s in the a i r f o i l

i f ( i . l e . i a f . and . j . eq . j a f ) theny l =0.25∗( yc ( i a f , j , km1)+yc ( i , jm1 , km1)

& +yc ( im1 , jm1 , km1)+yc ( i a f , j , km1) )end i f

c Modif ied by Mats f e l t

v o l l=−x l ∗areahx ( i , j , k−1)−y l ∗areahy ( i , j , k−1)− z l ∗ areahz ( i , j , k−1)

vo l ( i , j , k)=abs ( vo l e+volw+voln+vo l s+volh+v o l l ) /3 .

c Modif ied by Mats f e l tc The volumes o f j a f+1 c e l l s are mod i f i ed l a t e r in the codec and w i l l then be added to volsum

i f ( j . ne . ( j a f +1)) thenvolsum=volsum+vol ( i , j , k )

end i fc Modif ied by Mats f e l t

120 cont inue

c Modif ied by Mats f e l tc Modify the ar eas and volumes f o r the nodes at j a f+1

j=j a f

c−−−−−−c a l c u l a t e the area o f the con t r o l volume f a c e s

do k= 1 ,nkm1do i= 1 , ( i a f +1)

im1=max(1 , i −1)jm1=max(1 , j −1)km1=max(1 , k−1)

c−−−−−−−−−ax=xc ( i , j , k)−xc ( im1 , j , k ) !ay=yc ( i , j , k)−yc ( im1 , j , k ) !az=zc ( i , j , k)−zc ( im1 , j , k ) !

48

Page 61: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

c−−−−−−−−−bx=xc ( i , j , k)−xc ( i , j , km1) !by=yc ( i , j , k)−yc ( i , j , km1) !bz=zc ( i , j , k)−zc ( i , j , km1) !

c−−−−−−−−−cx=xc ( i , j , k)−xc ( i , jm1 , k ) !cy=yc ( i , j , k)−yc ( i , jm1 , k ) !cz=zc ( i , j , k)−zc ( i , jm1 , k ) !

c−−−−−−−−−dx=xc ( i , jm1 , km1)−xc ( i , jm1 , k ) !dy=yc ( i , jm1 , km1)−yc ( i , jm1 , k ) !dz=zc ( i , jm1 , km1)−zc ( i , jm1 , k ) !

c−−−−−−−−−ex=xc ( i , jm1 , km1)−xc ( i , j , km1) !ey=yc ( i , jm1 , km1)−yc ( i , j , km1) !ez=zc ( i , jm1 , km1)−zc ( i , j , km1) !

c−−−−−−−−−ox=xc ( im1 , j , km1)−xc ( im1 , j , k ) !oy=yc ( im1 , j , km1)−yc ( im1 , j , k ) !oz=zc ( im1 , j , km1)−zc ( im1 , j , k ) !

c−−−−−−−−−px=xc ( im1 , jm1 , k)−xc ( i , jm1 , k ) !py=yc ( im1 , jm1 , k)−yc ( i , jm1 , k ) !pz=zc ( im1 , jm1 , k)−zc ( i , jm1 , k ) !

c−−−−−−−−−qx=xc ( im1 , jm1 , k)−xc ( im1 , j , k ) !qy=yc ( im1 , jm1 , k)−yc ( im1 , j , k ) !qz=zc ( im1 , jm1 , k)−zc ( im1 , j , k ) !

c−−−−−−−−−rx=xc ( im1 , j , km1)−xc ( i , j , km1) !ry=yc ( im1 , j , km1)−yc ( i , j , km1) !r z=zc ( im1 , j , km1)−zc ( i , j , km1) !

a i1x=cy∗bz−cz ∗byai1y=cz ∗bx−cx∗bza i1z=cx∗by−cy∗bx

ai2x=ey∗dz−ez ∗dyai2y=ez ∗dx−ex∗dza i2z=ex∗dy−ey∗dx

aj1x=by∗az−bz∗ay

49

Page 62: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

aj1y=bz∗ax−bx∗aza j 1z=bx∗ay−by∗ax

aj2x=oy∗ rz−oz∗ ryaj2y=oz∗ rx−ox∗ r za j 2z=ox∗ ry−oy∗ rx

ak1x=cy∗pz−cz ∗pyak1y=cz ∗px−cx∗pzak1z=cx∗py−cy∗px

ak2x=qy∗az−qz∗ayak2y=qz∗ax−qx∗azak2z=qx∗ay−qy∗ax

ar eaex j a fp1 ( i , j , k )=0.5∗( a i1x+ai2x )ar eaey j a fp1 ( i , j , k )=0.5∗( a i1y+ai2y )a r ea e z j a f p 1 ( i , j , k )=0.5∗( a i 1z+a i2z )

ar eanx ja fp1 ( i , j , k )=0.5∗( aj1x+aj2x )ar eany ja fp1 ( i , j , k )=0.5∗( aj1y+aj2y )ar eanz j a fp1 ( i , j , k )=0.5∗( a j 1z+aj2z )

ar eahx ja fp1 ( i , j , k )=0.5∗( ak1x+ak2x )ar eahy ja fp1 ( i , j , k )=0.5∗( ak1y+ak2y )ar eahz j a fp1 ( i , j , k )=0.5∗( ak1z+ak2z )

end doend do

c−−−−−−c a l c u l a t e the volume .j=j a f+1

do k= 2 ,nkm1do i= 2 , ( i a f +1)

im1=i−1jm1=j−1km1=k−1

c−−−−−−−−−eas t f a c e

50

Page 63: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

xe=0.25∗( xc ( i , j , k)+xc ( i , jm1 , k)+xc ( i , jm1 , km1)+xc ( i , j , km1) )ye=0.25∗( yc ( i , j , k)+yc ( i , jm1 , k)+yc ( i , jm1 , km1)+yc ( i , j , km1) )ze =0.25∗( zc ( i , j , k)+zc ( i , jm1 , k)+zc ( i , jm1 , km1)+zc ( i , j , km1) )

vo l e=& xe∗ areaex ( i , j , k)+ye∗ areaey ( i , j , k)+ze ∗ areaez ( i , j , k )

c−−−−−−−−−west f a c exw=

& 0.25∗ ( xc ( im1 , j , k)+xc ( im1 , jm1 , k)+xc ( im1 , jm1 , km1)+xc ( im1 , j , km1) )yw=

& 0.25∗ ( yc ( im1 , j , k)+yc ( im1 , jm1 , k)+yc ( im1 , jm1 , km1)+yc ( im1 , j , km1) )zw=

& 0.25∗ ( zc ( im1 , j , k)+zc ( im1 , jm1 , k)+zc ( im1 , jm1 , km1)+zc ( im1 , j , km1) )

volw=& −xw∗ areaex ( i −1, j , k)−yw∗ areaey ( i −1, j , k )& −zw∗ areaez ( i −1, j , k )

c−−−−−−−−−north f a c exn=0.25∗( xc ( i , j , k)+xc ( im1 , j , k)+xc ( im1 , j , km1)+xc ( i , j , km1) )yn=0.25∗( yc ( i , j , k)+yc ( im1 , j , k)+yc ( im1 , j , km1)+yc ( i , j , km1) )zn=0.25∗( zc ( i , j , k)+zc ( im1 , j , k)+zc ( im1 , j , km1)+zc ( i , j , km1) )

voln=& xn∗areanx ( i , j , k)+yn∗areany ( i , j , k)+zn∗ areanz ( i , j , k )

c−−−−−−−−−south f a c exs=

& 0.25∗ ( xc ( i , jm1 , k)+xc ( im1 , jm1 , k)+xc ( im1 , jm1 , km1)+xc ( i , jm1 , km1) )ys=

& 0.25∗ ( yc ( i , jm1 , k)+yc ( im1 , jm1 , k)+yc ( im1 , jm1 , km1)+yc ( i , jm1 , km1) )zs=

& 0.25∗ ( zc ( i , jm1 , k)+zc ( im1 , jm1 , k)+zc ( im1 , jm1 , km1)+zc ( i , jm1 , km1) )

c Using the ar eany ja fp1 f o r the south ar eeasvo l s=

& −xs∗ ar eanx ja fp1 ( i , j −1,k)−ys∗ ar eany ja fp1 ( i , j −1,k )& −zs ∗ ar eanz j a fp1 ( i , j −1,k )

51

Page 64: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

c−−−−−−−−−high f a c exh=0.25∗( xc ( i , j , k)+xc ( i , jm1 , k)+xc ( im1 , jm1 , k)+xc ( im1 , j , k ) )yh=0.25∗( yc ( i , j , k)+yc ( i , jm1 , k)+yc ( im1 , jm1 , k)+yc ( im1 , j , k ) )zh=0.25∗( zc ( i , j , k)+zc ( i , jm1 , k)+zc ( im1 , jm1 , k)+zc ( im1 , j , k ) )

volh=& xh∗areahx ( i , j , k)+yh∗areahy ( i , j , k)+zh∗ areahz ( i , j , k )

c−−−−−−−−−low f a c ex l=

& 0.25∗ ( xc ( i , j , km1)+xc ( i , jm1 , km1)+xc ( im1 , jm1 , km1)+xc ( im1 , j , km1) )y l=

& 0.25∗ ( yc ( i , j , km1)+yc ( i , jm1 , km1)+yc ( im1 , jm1 , km1)+yc ( im1 , j , km1) )z l=

& 0.25∗ ( zc ( i , j , km1)+zc ( i , jm1 , km1)+zc ( im1 , jm1 , km1)+zc ( im1 , j , km1) )

v o l l=& −x l ∗areahx ( i , j , k−1)−y l ∗areahy ( i , j , k−1)& −z l ∗ areahz ( i , j , k−1)

vo l ( i , j , k)=abs ( vo l e+volw+voln+vo l s+volh+v o l l ) /3 .

volsum=volsum+vol ( i , j , k )

end doend do

c Modif ied by Mats f e l t

c−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−do 140 k= 2 ,nkm1do 140 j= 2 , njm1do 140 i= 2 , nim1

im1=i−1jm1=j−1km1=k−1

xw=& 0.25∗ ( xc ( im1 , j , k)+xc ( im1 , jm1 , k)+xc ( im1 , j , km1)+xc ( im1 , jm1 , km1) )

xe=0.25∗( xc ( i , j , k)+xc ( i , jm1 , k)+xc ( i , j , km1)+xc ( i , jm1 , km1) )

52

Page 65: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

yw=& 0.25∗ ( yc ( im1 , j , k)+yc ( im1 , jm1 , k)+yc ( im1 , j , km1)+yc ( im1 , jm1 , km1) )

ye=0.25∗( yc ( i , j , k)+yc ( i , jm1 , k)+yc ( i , j , km1)+yc ( i , jm1 , km1) )zw=

& 0.25∗ ( zc ( im1 , j , k)+zc ( im1 , jm1 , k)+zc ( im1 , j , km1)+zc ( im1 , jm1 , km1) )ze =0.25∗( zc ( i , j , k)+zc ( i , jm1 , k)+zc ( i , j , km1)+zc ( i , jm1 , km1) )

xs=& 0.25∗ ( xc ( i , jm1 , k)+xc ( im1 , jm1 , k)+xc ( i , jm1 , km1)+xc ( im1 , jm1 , km1) )

xn=0.25∗( xc ( i , j , k)+xc ( im1 , j , k)+xc ( i , j , km1)+xc ( im1 , j , km1) )ys=

& 0.25∗ ( yc ( i , jm1 , k)+yc ( im1 , jm1 , k)+yc ( i , jm1 , km1)+yc ( im1 , jm1 , km1) )yn=0.25∗( yc ( i , j , k)+yc ( im1 , j , k)+yc ( i , j , km1)+yc ( im1 , j , km1) )zs=

& 0.25∗ ( zc ( i , jm1 , k)+zc ( im1 , jm1 , k)+zc ( i , jm1 , km1)+zc ( im1 , jm1 , km1) )zn=0.25∗( zc ( i , j , k)+zc ( im1 , j , k)+zc ( i , j , km1)+zc ( im1 , j , km1) )

x l=& 0.25∗ ( xc ( i , j , km1)+xc ( im1 , j , km1)+xc ( i , jm1 , km1)+xc ( im1 , jm1 , km1) )

xh=0.25∗( xc ( i , j , k)+xc ( im1 , j , k)+xc ( i , jm1 , k)+xc ( im1 , jm1 , k ) )y l=

& 0.25∗ ( yc ( i , j , km1)+yc ( im1 , j , km1)+yc ( i , jm1 , km1)+yc ( im1 , jm1 , km1) )yh=0.25∗( yc ( i , j , k)+yc ( im1 , j , k)+yc ( i , jm1 , k)+yc ( im1 , jm1 , k ) )z l=

& 0.25∗ ( zc ( i , j , km1)+zc ( im1 , j , km1)+zc ( i , jm1 , km1)+zc ( im1 , jm1 , km1) )zh=0.25∗( zc ( i , j , k)+zc ( im1 , j , k)+zc ( i , jm1 , k)+zc ( im1 , jm1 , k ) )

c Modif ied by Mats f e l tc Modify y f o r the l o c a t i o n s in the a i r f o i l

i f ( i . l e . i a f . and . j . eq . j a f ) thenyw=

& 0.25∗ ( yc ( i a f , j , k)+yc ( im1 , jm1 , k)+yc ( i a f , j , km1)+yc ( im1 , jm1 , km1) )ye=0.25∗( yc ( i a f , j , k)+yc ( i , jm1 , k)+yc ( i a f , j , km1)+yc ( i , jm1 , km1) )

yn=0.25∗( yc ( i a f , j , k)+yc ( i a f , j , k)+yc ( i a f , j , km1)+yc ( i a f , j , km1) )

y l =0.25∗( yc ( i a f , j , km1)+yc ( i a f , j , km1)& +yc ( i , jm1 , km1)+yc ( im1 , jm1 , km1) )

yh=0.25∗( yc ( i a f , j , k)+yc ( i a f , j , k)+yc ( i , jm1 , k)+yc ( im1 , jm1 , k ) )end i f

c Modif ied by Mats f e l t

c−−−−−−−−−c a l c u l a t e the we igh t funct i on s

53

Page 66: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX A. CALC PART OF INIT.F FILE INCLUDING MODIFICATIONS

de l1=& sq r t ( ( xe−xp( i , j , k ))∗∗2+(ye−yp( i , j , k ))∗∗2+( ze−zp ( i , j , k ) )∗∗2)

de l2=sq r t ( ( xe−xp( i +1, j , k ))∗∗2+(ye−yp( i +1, j , k ))∗∗2& +(ze−zp ( i +1, j , k ) )∗∗2)

fx ( i , j , k)=del1 /( de l1+del2 )

de l1=& sq r t ( ( xn−xp( i , j , k ))∗∗2+(yn−yp( i , j , k ))∗∗2+(zn−zp ( i , j , k ) )∗∗2)

de l2=sq r t ( ( xn−xp( i , j +1,k ))∗∗2+(yn−yp( i , j +1,k ))∗∗2& +(zn−zp ( i , j +1,k ) )∗∗2)

fy ( i , j , k)=del1 /( de l1+del2 )

de l1=sq r t ( ( xh−xp( i , j , k ))∗∗2+(yh−yp( i , j , k ))∗∗2& +(zh−zp ( i , j , k ) )∗∗2)

de l2=sq r t ( ( xh−xp( i , j , k+1))∗∗2+(yh−yp( i , j , k+1))∗∗2& +(zh−zp ( i , j , k+1))∗∗2)

f z ( i , j , k)=del1 /( de l1+del2 )140 cont inue

c−− Volumes and the weight f un c t i on s f o r boundary nodes . . .

chapter 2 2 2 2 2 s e t v a r i a b l e s to smal l vzpue 2 2 2 2 . . .

r eturnend

54

Page 67: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

B

CALC part of conv.f file including

modifications

do k=2,nkm1do j =2,njm1do i =2,nim1

c eas t . . .

c northjp2=min ( j +2, nj )jp1=min ( j +1,njm1)jp1=j+1jm1=j−1

c Modif ied by Mats f e l ti f ( i . l e . i a f ) then

i f ( j . eq . ( j a f −1)) thenjp2=jp1

e l s e i f ( j . eq . j a f ) thenjp2=jjp1=j

e l s e i f ( j . eq . ( j a f +1)) thenjm1=j

end i fend i f

c Modif ied by Mats f e l t

55

Page 68: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX B. CALC PART OF CONV.F FILE INCLUDING MODIFICATIONS

voln =0.5∗( vo l ( i , jp1 , k)+vol ( i , j , k ) )

ann=(areanx ( i , j , k)∗∗2+ areany ( i , j , k)∗∗2+. areanz ( i , j , k )∗∗2)/ voln

un=fy ( i , j , k )∗ phi ( i , j +1,k , u)+(1.− fy ( i , j , k ) )∗ phi ( i , j , k , u )vn=fy ( i , j , k )∗ phi ( i , j +1,k , v)+(1.− fy ( i , j , k ) )∗ phi ( i , j , k , v )wn=fy ( i , j , k )∗ phi ( i , j +1,k ,w)+(1.− fy ( i , j , k ) )∗ phi ( i , j , k ,w)

convnc= denn ∗( areanx ( i , j , k )∗un+areany ( i , j , k )∗vn& +areanz ( i , j , k )∗wn)

dp=0.25∗( phi ( i , jp2 , k , p)−phi ( i , j , k , p)+phi ( i , jp1 , k , p). −phi ( i , jm1 , k , p ) )

convn ( i , j , k)=convnc+ann∗dp∗dtt

c high . . .

end doend doend do

56

Page 69: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

C

CALC dpdyf.f file including

modifications

f unct i on dpdyf ( i , j , k )in c lude ’COMMON’

c the d e r i v a t i v e dpdy at node i , j , k i s c a l cu l a t ed here us ingc Neumann boundary cond i t i on

jm1=max( j −1 ,2)jp1=min ( j +1,njm1)

phie=fx ( i , j , k )∗ phi ( i +1, j , k , p)+(1.− fx ( i , j , k ) )∗ phi ( i , j , k , p )phiw=fx ( i −1, j , k )∗ phi ( i , j , k , p)+(1.− fx ( i −1, j , k ) )

& ∗phi ( i −1, j , k , p )phin=fy ( i , j , k )∗ phi ( i , jp1 , k , p)+(1.− fy ( i , j , k ) )∗ phi ( i , j , k , p )ph i s=fy ( i , j −1,k )∗ phi ( i , j , k , p)+(1.− fy ( i , j −1,k ) )

& ∗phi ( i , jm1 , k , p)phih=f z ( i , j , k )∗ phi ( i , j , k+1,p)+(1.− f z ( i , j , k ) )∗ phi ( i , j , k , p )ph i l=f z ( i , j , k−1)∗phi ( i , j , k , p)+(1.− f z ( i , j , k−1))

& ∗phi ( i , j , k−1,p)

dpdyf=(phie ∗ areaey ( i , j , k)−phiw∗ areaey ( i −1, j , k )& +phin∗areany ( i , j , k)−ph is ∗areany ( i , j −1,k )& +phih∗areahy ( i , j , k)−ph i l ∗areahy ( i , j , k−1))/ vo l ( i , j , k )

57

Page 70: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX C. CALC DPDYF.F FILE INCLUDING MODIFICATIONS

c Modif ied by Mats f e l tc To break the connect ion between the c e l l j a f+1 above the a i r f o i lc and j a f below .

i f ( i . l e . i a f . and . j . eq . ( j a f +1)) then

ph is=phi ( i , j , k , p )

dpdyf=(phie ∗ areaey ( i , j , k)−phiw∗ areaey ( i −1, j , k )& +phin∗areany ( i , j , k)−ph is ∗ ar eany ja fp1 ( i , j −1,k )& +phih∗areahy ( i , j , k)−ph i l ∗areahy ( i , j , k−1))& / vol ( i , j , k )

end i fc Modif ied by Mats f e l t

r eturnend

58

Page 71: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

D

CALC part of peter init.f file

including modifications

subrout ine p e t e r i n i t ( xa , ya , za , i i n , j i n , kin , id , jd , kd ,. c y c l i , c y c l j , cyclk , i a f , j a f , i f i r s t , i l a s t )

in c lude ’PETERCOMMON’common / pete r / kst (100) , ks t 2d (100)dimension xa ( id , jd , kd ) , ya ( id , jd , kd ) , za ( id , jd , kd )l o g i c a l cy c l i , c y c l j , cyc lki n t e g e r walwidth

p i =4.∗ atan ( 1 . )

c c c c c c c c Ca l cu la t e the number o f l e v e l s in the mu l t i g r id ccccc

ipa=i i njpa=j i nkpa=kinn lev=1ipb=ipajpb=jpakpb=kpai 1 c= i f i r s ti 2 c=i l a s t

c Modif ied by Mats f e l t

59

Page 72: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

i a i r f o i l=i a fj a i r f o i l=j a f

c Modif ied by Mats f e l t

do i =1 ,100i f (mod( ipa −2 ,2) . eq . 0 ) theni f (mod( jpa −2 ,2) . eq . 0 ) theni f (mod( kpa−2 ,2) . eq . 0 ) thenipa=(ipa−2)/2+2jpa=(jpa−2)/2+2kpa=(kpa−2)/2+2walwidth=i2c−i 1 ci f ( ipa . ge . 4 . and . jpa . ge . 4 . and . kpa . ge . 4 . and . n lev . l e . 3 ) then

ipb=ipajpb=jpakpb=kpai 1 c=( i 1 c )/2+1i 2 c=( i2c −1)/2+1

c Modif ied by Mats f e l ti a i r f o i l =( i a i r f o i l −1)/2+1j a i r f o i l =( j a i r f o i l −1)/2+1

c Modif ied by Mats f e l t

n lev=nlev+1wr i t e ( 6 ,∗ ) ’ nlev , ipb , jpb , kpb ’ , nlev , ipb , jpb , kpbwr i t e ( 6 ,∗ ) ’ nlev , i1c , i2c ’ , nlev , i1c , i 2 c

end i f

end i fend i fend i f

end dowr i t e ( 6 ,∗ ) ’NUMBER OF LEVELS= ’ , n lev

cccccc Setup po in te r system and de f i n e coar s e g r i d s c c c c c c c c c c c c c c

n i (1)= ipbnj (1)= jpbnk(1)=kpbkst (1)=1do k lev =2, n lev

n i ( k lev )=2∗( n i ( klev −1)−2)+2

60

Page 73: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

nj ( k lev )=2∗( nj ( klev −1)−2)+2nk( k lev )=2∗(nk( klev −1)−2)+2kst ( k lev )=kst ( klev−1)+ni ( klev −1)∗ nj ( klev −1)∗nk( klev −1)

end do

c Modif ied by Mats f e l tc Trace the i a f and j a f through the l e v e l s

i a f p (1)= i a i r f o i lj a f p (1)= j a i r f o i l

wr i t e ( 6 ,∗ ) ’ k lev =1: i a f p ( 1 ) , j a f p ( 1 ) ’ ,. i a f p ( 1 ) , j a f p (1)

do k lev =2, n levi a f p ( k lev )=2∗( i a f p ( klev −1)−1)+1j a f p ( k lev )=2∗( j a f p ( klev −1)−1)+1

wr i t e ( 6 ,∗ ) ’ klev , i a fp , ja fp ’ ,. klev , i a f p ( k lev ) , j a f p ( k lev )end do

c Modif ied by Mats f e l t

c a l l key ( nlev , l s t , i s t , n i ( n lev ) , n j ( n lev ) , nk ( n lev ) )

c$doacross l o c a l ( k , j , i , i o )do k=1,nk( n lev )do j =1, nj ( n lev )do i =1, n i ( n lev )

i o=l s t ( k)+ i s t ( i )+ jp( i o )=xa ( i , j , k )t ( i o )=ya ( i , j , k )pm( i o )=za ( i , j , k )

end doend doend do

do k lev=nlev ,2 ,−1k l evc=klev−1

c a l l key ( klevc , l s t c , i s t c , n i ( k l evc ) , n j ( k l evc ) , nk ( k l evc ) )

61

Page 74: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

c a l l key ( klev , l s t , i s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) )

c x , y , z on coar s e meshesdo k=1,nk ( k l evc )−1

do j =1, nj ( k l evc )−1do i =1, n i ( k l evc )−1

i o=l s t c ( k)+ i s t c ( i )+ jp( i o )=p( l s t (2∗k−1)+ i s t (2∗ i −1)+2∗ j −1)t ( i o )=t ( l s t (2∗k−1)+ i s t (2∗ i −1)+2∗ j −1)pm( i o )=pm( l s t (2∗k−1)+ i s t (2∗ i −1)+2∗ j −1)

end doend do

end doend do

88 format (1x , 15 ( 1 pe13 . 6 , 2 x ) )

ccccccc Ca l cu la t e the c o e f f i c i e n t s on a l l meshes c c c c c c c c c c c c c

do k lev =1, n levc a l l key ( klev , l s t , i s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) )

c−−− Area c a l c u l a t i o n

do k=1,nk( k lev )−1do i =1, n i ( k lev )−1

do j =1, nj ( k lev )−1im1=max(1 , i −1)jm1=max(1 , j −1)km1=max(1 , k−1)

i o=l s t ( k)+ i s t ( i )+ ji l=l s t (km1)+ i s t ( i )+ jiw=l s t ( k)+ i s t ( im1)+ jiw l=l s t (km1)+ i s t ( im1)+ ji s=l s t ( k)+ i s t ( i )+jm1isw=l s t ( k)+ i s t ( im1)+jm1i s l=l s t (km1)+ i s t ( i )+jm1

ax=p( i o )−p( iw )

62

Page 75: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

ay=t ( i o )−t ( iw )az=pm( i o )−pm( iw )

bx=p( i o )−p( i l )by=t ( i o )−t ( i l )bz=pm( i o )−pm( i l )

cx=p( i o )−p( i s )cy=t ( i o )−t ( i s )cz=pm( i o )−pm( i s )

dx=p( i s l )−p( i s )dy=t ( i s l )−t ( i s )dz=pm( i s l )−pm( i s )

ex=p( i s l )−p( i l )ey=t ( i s l )−t ( i l )ez=pm( i s l )−pm( i l )

ox=p( iw l )−p( iw )oy=t ( iw l )−t ( iw )oz=pm( iw l )−pm( iw )

px=p( isw)−p( i s )py=t ( isw)−t ( i s )pz=pm( isw)−pm( i s )

qx=p( isw)−p( iw )qy=t ( isw)−t ( iw )qz=pm( isw)−pm( iw )

rx=p( iw l )−p( i l )ry=t ( iw l )−t ( i l )r z=pm( iw l )−pm( i l )

a i1x=cy∗bz−cz ∗byai1y=cz ∗bx−cx∗bza i1z=cx∗by−cy∗bx

ai2x=ey∗dz−ez ∗dyai2y=ez ∗dx−ex∗dza i2z=ex∗dy−ey∗dx

63

Page 76: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

aj1x=by∗az−bz∗ayaj1y=bz∗ax−bx∗aza j 1z=bx∗ay−by∗ax

aj2x=oy∗ rz−oz∗ ryaj2y=oz∗ rx−ox∗ r za j 2z=ox∗ ry−oy∗ rx

ak1x=cy∗pz−cz ∗pyak1y=cz ∗px−cx∗pzak1z=cx∗py−cy∗px

ak2x=qy∗az−qz∗ayak2y=qz∗ax−qx∗azak2z=qx∗ay−qy∗ax

c Modif ied by Mats f e l tc Modify the a . . y parameters f o r i f the l o c a t i o n i sc in the a i r f o i l .

i f ( i . l e . i a f p ( k lev ) . and . j . eq . j a f p ( k lev ) ) then

i o i a f=l s t ( k)+ i s t ( i a f p ( k lev ))+ ji l i a f=l s t (km1)+ i s t ( i a f p ( k lev ))+ jiw i a f=l s t ( k)+ i s t ( i a f p ( k lev ))+ ji w l i a f=l s t (km1)+ i s t ( i a f p ( k lev ))+ j

ax=p( i o )−p( iw )ay=t ( i o i a f )−t ( iw i a f )az=pm( i o )−pm( iw )

bx=p( i o )−p( i l )by=t ( i o i a f )−t ( i l i a f )bz=pm( i o )−pm( i l )

cx=p( i o )−p( i s )cy=t ( i o i a f )−t ( i s )cz=pm( i o )−pm( i s )

ex=p( i s l )−p( i l )ey=t ( i s l )−t ( i l i a f )ez=pm( i s l )−pm( i l )

64

Page 77: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

ox=p( iw l )−p( iw )oy=t ( i w l i a f )−t ( iw i a f )oz=pm( iw l )−pm( iw )

qx=p( isw)−p( iw )qy=t ( isw)−t ( iw i a f )qz=pm( isw)−pm( iw )

rx=p( iw l )−p( i l )ry=t ( i w l i a f )−t ( i l i a f )r z=pm( iw l )−pm( i l )

a i1x=cy∗bz−cz ∗byai1y=cz ∗bx−cx∗bza i1z=cx∗by−cy∗bx

ai2x=ey∗dz−ez ∗dyai2y=ez ∗dx−ex∗dza i2z=ex∗dy−ey∗dx

aj1x=by∗az−bz∗ayaj1y=bz∗ax−bx∗aza j 1z=bx∗ay−by∗ax

aj2x=oy∗ rz−oz∗ ryaj2y=oz∗ rx−ox∗ r za j 2z=ox∗ ry−oy∗ rx

ak1x=cy∗pz−cz ∗pyak1y=cz ∗px−cx∗pzak1z=cx∗py−cy∗px

ak2x=qy∗az−qz∗ayak2y=qz∗ax−qx∗azak2z=qx∗ay−qy∗ax

end i fc Modif ied by Mats f e l t

aw( i o )=0.5∗( a i1x+ai2x )ae ( i o )=0.5∗( a i1y+ai2y )as ( i o )=0.5∗( a i 1z+a i2z )

65

Page 78: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

an ( i o )=0.5∗( aj1x+aj2x )a l ( i o )=0.5∗( aj1y+aj2y )ah ( i o )=0.5∗( a j 1z+aj2z )

ap ( i o )=0.5∗( ak1x+ak2x )su ( i o )=0.5∗( ak1y+ak2y )co ( i o )=0.5∗( ak1z+ak2z )

end doend do

end do

c Modif ied by Mats f e l tc Modify the the northern area o f the j a f c e l l s because they arec used in the j a f+1 volume c a l c u l a t i o n .

c copy the northern ar eas to the j a f p 1 matr ixesdo k=1,nk( k lev )−1

do i =1, n i ( k lev )−1do j =1, nj ( k lev )−1

i o=l s t ( k)+ i s t ( i )+ j

an ja fp1 ( i o )=an ( i o )a l j a f p 1 ( i o )=a l ( i o )ah ja fp1 ( i o )=ah ( i o )

end doend do

end do

c−−− Area c a l c u l a t i o ndo k=1,nk( k lev )−1

do i =1 ,( i a f p ( k lev )+1)j=j a f p ( k lev )

im1=max(1 , i −1)jm1=max(1 , j −1)km1=max(1 , k−1)

i o=l s t ( k)+ i s t ( i )+ ji l=l s t (km1)+ i s t ( i )+ jiw=l s t ( k)+ i s t ( im1)+ j

66

Page 79: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

iw l=l s t (km1)+ i s t ( im1)+ ji s=l s t ( k)+ i s t ( i )+jm1isw=l s t ( k)+ i s t ( im1)+jm1i s l=l s t (km1)+ i s t ( i )+jm1

ax=p( i o )−p( iw )ay=t ( i o )−t ( iw )az=pm( i o )−pm( iw )

bx=p( i o )−p( i l )by=t ( i o )−t ( i l )bz=pm( i o )−pm( i l )

cx=p( i o )−p( i s )cy=t ( i o )−t ( i s )cz=pm( i o )−pm( i s )

dx=p( i s l )−p( i s )dy=t ( i s l )−t ( i s )dz=pm( i s l )−pm( i s )

ex=p( i s l )−p( i l )ey=t ( i s l )−t ( i l )ez=pm( i s l )−pm( i l )

ox=p( iw l )−p( iw )oy=t ( iw l )−t ( iw )oz=pm( iw l )−pm( iw )

px=p( isw)−p( i s )py=t ( isw)−t ( i s )pz=pm( isw)−pm( i s )

qx=p( isw)−p( iw )qy=t ( isw)−t ( iw )qz=pm( isw)−pm( iw )

rx=p( iw l )−p( i l )ry=t ( iw l )−t ( i l )r z=pm( iw l )−pm( i l )

a i1x=cy∗bz−cz ∗by

67

Page 80: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

ai1y=cz ∗bx−cx∗bza i1z=cx∗by−cy∗bx

ai2x=ey∗dz−ez ∗dyai2y=ez ∗dx−ex∗dza i2z=ex∗dy−ey∗dx

aj1x=by∗az−bz∗ayaj1y=bz∗ax−bx∗aza j 1z=bx∗ay−by∗ax

aj2x=oy∗ rz−oz∗ ryaj2y=oz∗ rx−ox∗ r za j 2z=ox∗ ry−oy∗ rx

ak1x=cy∗pz−cz ∗pyak1y=cz ∗px−cx∗pzak1z=cx∗py−cy∗px

ak2x=qy∗az−qz∗ayak2y=qz∗ax−qx∗azak2z=qx∗ay−qy∗ax

an ja fp1 ( i o )=0.5∗( aj1x+aj2x )a l j a f p 1 ( i o )=0.5∗( aj1y+aj2y )ah ja fp1 ( i o )=0.5∗( a j 1z+aj2z )

end doend do

c Modif ied by Mats f e l t

c−−−− Aspect r a t i o c a l c u l a t i o n . . .

c−−−− Choice o f smoother . . .

c−−−− Calcu la te volumes

do k=2,nk( k lev )−1do i =2, n i ( k lev )−1

68

Page 81: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

do j =2, nj ( k lev )−1i o=l s t ( k)+ i s t ( i )+ jiw=l s t ( k)+ i s t ( i−1)+ ji s=l s t ( k)+ i s t ( i )+j−1i l=l s t (k−1)+ i s t ( i )+ jiws=l s t ( k)+ i s t ( i−1)+j−1iw l=l s t (k−1)+ i s t ( i−1)+ ji s l=l s t (k−1)+ i s t ( i )+j−1iw s l=l s t (k−1)+ i s t ( i−1)+j−1

xw=0.25∗(p( iw)+p( iws)+p( iw l )+p( iw s l ) )xe=0.25∗(p( i o )+p( i s )+p( i l )+p( i s l ) )yw=0.25∗( t ( iw)+t ( iws)+t ( iw l )+t ( iw s l ) )ye=0.25∗( t ( i o )+t ( i s )+t ( i l )+t ( i s l ) )zw=0.25∗(pm( iw)+pm( iws)+pm( iw l )+pm( iw s l ) )ze =0.25∗(pm( i o )+pm( i s )+pm( i l )+pm( i s l ) )

xs =0.25∗(p( i s )+p( iws)+p( i s l )+p( iw s l ) )xn=0.25∗(p( i o )+p( iw)+p( i l )+p( iw l ) )ys =0.25∗( t ( i s )+t ( iws)+t ( i s l )+t ( iw s l ) )yn=0.25∗( t ( i o )+t ( iw)+t ( i l )+t ( iw l ) )zs =0.25∗(pm( i s )+pm( iws)+pm( i s l )+pm( iw s l ) )zn=0.25∗(pm( i o )+pm( iw)+pm( i l )+pm( iw l ) )

x l =0.25∗(p( i l )+p( iw l )+p( i s l )+p( iw s l ) )xh=0.25∗(p( i o )+p( iw)+p( i s )+p( iws ) )y l =0.25∗( t ( i l )+t ( iw l )+t ( i s l )+t ( iw s l ) )yh=0.25∗( t ( i o )+t ( iw)+t ( i s )+t ( iws ) )z l =0.25∗(pm( i l )+pm( iw l )+pm( i s l )+pm( iw s l ) )zh=0.25∗(pm( i o )+pm( iw)+pm( i s )+pm( iws ) )

c Modif ied by Mats f e l tc Modify the y dependent l o c a t i o n parameters i f the l o c a t i o n i sc in the a i r f o i l .

i f ( i . l e . i a f p ( k lev ) . and . j . eq . j a f p ( k lev ) ) then

i o i a f=l s t ( k)+ i s t ( i a f p ( k lev ))+ jiw i a f=l s t ( k)+ i s t ( i a f p ( k lev ))+ ji l i a f=l s t (k−1)+ i s t ( i a f p ( k lev ))+ ji w l i a f=l s t ( k−1)+ i s t ( i a f p ( k lev ))+ j

yw=0.25∗( t ( iw i a f )+t ( iws)+t ( i w l i a f )+t ( iw s l ) )ye=0.25∗( t ( i o i a f )+t ( i s )+t ( i l i a f )+t ( i s l ) )

69

Page 82: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

yn=0.25∗( t ( i o i a f )+t ( iw i a f )+t ( i l i a f )+t ( i w l i a f ) )

y l =0.25∗( t ( i l i a f )+t ( i w l i a f )+t ( i s l )+t ( iw s l ) )yh=0.25∗( t ( i o i a f )+t ( iw i a f )+t ( i s )+t ( iws ) )

end i fc Modif ied by Mats f e l t

ew=sq r t ( ( xe−xw)∗∗2+(ye−yw)∗∗2+( ze−zw)∗∗2)sn=sq r t ( ( xn−xs )∗∗2+(yn−ys )∗∗2+( zn−zs )∗∗2)h l=sq r t ( ( xh−x l )∗∗2+(yh−y l )∗∗2+( zh−z l )∗∗2)

vo l e=xe∗aw( i o )+ye∗ae ( i o )+ze ∗as ( i o )volw=−xw∗aw( iw)−yw∗ae ( iw)−zw∗as ( iw )voln=yn∗ a l ( i o )+zn∗ah ( i o )+xn∗an ( i o )vo l s=−ys∗ a l ( i s )−zs ∗ah ( i s )−xs∗an ( i s )volh=zh∗co ( i o )+xh∗ap ( i o )+yh∗ su ( i o )v o l l=−z l ∗ co ( i l )−x l ∗ap ( i l )−y l ∗ su ( i l )

s r ( i o )=abs ( vo l e+volw+voln+vo l s+volh+v o l l ) /3 .i f ( s r ( i o ) . l t . 1 e−20) wr i t e ( 6 ,∗ ) ’VOL=0 ’ , i , j , k , klev ,

. vole , volw , vo l s , voln , volh , v o l l

end doend do

end do

c Modif ied by Mats f e l tc Modify the j a f+1 volumes un t i l i a f+1c−−−− Calcu la te volumes

do k=2,nk( k lev )−1do i =2 ,( i a f p ( k lev )+1)

j=j a f p ( k lev )+1

i o=l s t ( k)+ i s t ( i )+ jiw=l s t ( k)+ i s t ( i−1)+ ji s=l s t ( k)+ i s t ( i )+j−1i l=l s t (k−1)+ i s t ( i )+ jiws=l s t ( k)+ i s t ( i−1)+j−1

70

Page 83: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

iw l=l s t (k−1)+ i s t ( i−1)+ ji s l=l s t (k−1)+ i s t ( i )+j−1iw s l=l s t (k−1)+ i s t ( i−1)+j−1

xw=0.25∗(p( iw)+p( iws)+p( iw l )+p( iw s l ) )xe=0.25∗(p( i o )+p( i s )+p( i l )+p( i s l ) )yw=0.25∗( t ( iw)+t ( iws)+t ( iw l )+t ( iw s l ) )ye=0.25∗( t ( i o )+t ( i s )+t ( i l )+t ( i s l ) )zw=0.25∗(pm( iw)+pm( iws)+pm( iw l )+pm( iw s l ) )ze =0.25∗(pm( i o )+pm( i s )+pm( i l )+pm( i s l ) )

xs =0.25∗(p( i s )+p( iws)+p( i s l )+p( iw s l ) )xn=0.25∗(p( i o )+p( iw)+p( i l )+p( iw l ) )ys =0.25∗( t ( i s )+t ( iws)+t ( i s l )+t ( iw s l ) )yn=0.25∗( t ( i o )+t ( iw)+t ( i l )+t ( iw l ) )zs =0.25∗(pm( i s )+pm( iws)+pm( i s l )+pm( iw s l ) )zn=0.25∗(pm( i o )+pm( iw)+pm( i l )+pm( iw l ) )

x l =0.25∗(p( i l )+p( iw l )+p( i s l )+p( iw s l ) )xh=0.25∗(p( i o )+p( iw)+p( i s )+p( iws ) )y l =0.25∗( t ( i l )+t ( iw l )+t ( i s l )+t ( iw s l ) )yh=0.25∗( t ( i o )+t ( iw)+t ( i s )+t ( iws ) )z l =0.25∗(pm( i l )+pm( iw l )+pm( i s l )+pm( iw s l ) )zh=0.25∗(pm( i o )+pm( iw)+pm( i s )+pm( iws ) )

ew=sq r t ( ( xe−xw)∗∗2+(ye−yw)∗∗2+( ze−zw)∗∗2)sn=sq r t ( ( xn−xs )∗∗2+(yn−ys )∗∗2+( zn−zs )∗∗2)h l=sq r t ( ( xh−x l )∗∗2+(yh−y l )∗∗2+( zh−z l )∗∗2)

vo l e=xe∗aw( i o )+ye∗ae ( i o )+ze ∗as ( i o )volw=−xw∗aw( iw)−yw∗ae ( iw)−zw∗as ( iw )voln=yn∗ a l ( i o )+zn∗ah ( i o )+xn∗an ( i o )

vo l s=−ys∗ a l j a f p 1 ( i s )− zs ∗ ah ja fp1 ( i s )−xs ∗ an ja fp1 ( i s )

volh=zh∗co ( i o )+xh∗ap ( i o )+yh∗ su ( i o )v o l l=−z l ∗ co ( i l )−x l ∗ap ( i l )−y l ∗ su ( i l )

s r ( i o )=abs ( vo l e+volw+voln+vo l s+volh+v o l l ) /3 .i f ( s r ( i o ) . l t . 1 e−20) wr i t e ( 6 ,∗ ) ’VOL=0 ’ , i , j , k , klev ,

. vole , volw , vo l s , voln , volh , v o l l

71

Page 84: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

end doend do

c Modif ied by Mats f e l t

c−−− Co e f f i c i e n t assembly f o r d2p/dx2+d2p/dy2=f

c$doacross l o c a l ( k , i , j , i o )do k=1,nk( k lev )

do i =1, n i ( k lev )do j =1, nj ( k lev )

i o=l s t ( k)+ i s t ( i )+ jp( i o )=aw( i o )∗∗2+ae ( i o )∗∗2+ as ( i o )∗∗2t ( i o )=a l ( i o )∗∗2+an ( i o )∗∗2+ah ( i o )∗∗2pm( i o )=co ( i o )∗∗2+ap ( i o )∗∗2+ su ( i o )∗∗2

end doend do

end do

do k=2,nk( k lev )−1do i =2, n i ( k lev )−1

do j =2, nj ( k lev )−1i o=l s t ( k)+ i s t ( i )+ jin=io+1i s=io−1i e=l s t ( k)+ i s t ( i+1)+ jiw=l s t ( k)+ i s t ( i−1)+ ji l=l s t (k−1)+ i s t ( i )+ jih=l s t ( k+1)+ i s t ( i )+ j

vo l e =0.5∗( s r ( i e )+ s r ( i o ))+1. e−30i f ( i . eq . n i ( k lev )−1) vo l e =0.5∗ s r ( i o )ae ( i o )=p( i o )/ vo l e

volw=0.5∗( s r ( i o )+s r ( iw ))+1. e−30i f ( i . eq . 2 ) volw=0.5∗ s r ( i o )aw( i o )=p( iw )/ volw

voln =0.5∗( s r ( in )+s r ( i o ))+1. e−30i f ( j . eq . n j ( k lev )−1) voln=0.5∗ s r ( i o )an ( i o )=t ( i o )/ voln

vo l s =0.5∗( s r ( i o )+s r ( i s ))+1. e−30

72

Page 85: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX D. CALC PART OF PETER INIT.F FILE INCLUDING

MODIFICATIONS

i f ( j . eq . 2 ) vo l s =0.5∗ s r ( i o )as ( i o )=t ( i s )/ vo l s

volh =0.5∗( s r ( ih )+s r ( i o ))+1. e−30i f ( k . eq . nk ( k lev )−1) volh=0.5∗ s r ( i o )ah ( i o )=pm( i o )/ volh

v o l l =0.5∗( s r ( i o )+s r ( i l ))+1. e−30i f ( k . eq . 2 ) v o l l =0.5∗ s r ( i o )a l ( i o )=pm( i l )/ v o l l

c Modif ied by Mats f e l tc Modify the y dependent l o c a t i o n parameters i f the l o c a t i o n i sc in the a i r f o i l and save in the parameter l o c a t i o n s from above .

i f ( i . l e . i a f p ( k lev ) . and . j . eq . j a f p ( k lev ) ) then

an ( i o )=0.

e l s e i f ( i . l e . i a f p ( k lev ) . and . j . eq . ( j a f p ( k lev )+1)) then

as ( i o )=0.

end i fc Modif ied by Mats f e l t

end doend do

end do

c−−− Boundary cond i t i on dp/dn=0 . . .

c−−− Diagonal c o e f f i c i e n t eva luat i on . . .

end doreturnend

73

Page 86: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

E

CALC part of peter multi.f file

including modifications

subrout ine pete r mu l t i ( r e s in , i i n , j i n , kin ,. tryck , sormax , icycmax , cy c l i , c y c l j , cyc lk )

in c lude ’PETERCOMMON’l o g i c a l cy c l i , c y c l j , cyc lkdimension r e s i n ( i i n , j i n , k in ) , t ryck ( i i n , j i n , k in )i n t e g e r ∗4 lock (0 : 1000 )

c−− I n i t i a l i z a t i o n . . .

c−− B i l i n e a r r e s t r i c t i o n . . .

c−− B i l i n e a r p ro longat i on

c go from the c o a r s e s t to the f i n e s t g r iddo 800 k lev =2, n lev

c a l l key ( klev , l s t , i s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) )k l evc=klev−1c a l l key ( klevc , l s t c , i s t c , n i ( k l evc ) , n j ( k l evc ) , nk ( k l evc ) )

c f i x Neumann boundary cond i t i on sdo k=1,nk ( k l evc )

do i =1, n i ( k l evc )

74

Page 87: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX E. CALC PART OF PETER MULTI.F FILE INCLUDING

MODIFICATIONS

in=l s t c ( k)+ i s t c ( i )+nj ( k l evc )inm1=l s t c (k)+ i s t c ( i )+nj ( k l evc )−1i s=l s t c ( k)+ i s t c ( i )+1ism1=l s t c (k)+ i s t c ( i )+2p( in )=p( inm1 )p( i s )=p( ism1 )

end doend dodo k=1,nk ( k l evc )

do j =1, nj ( k l evc )in=l s t c ( k)+ i s t c ( n i ( k l evc ))+ jinm1=l s t c (k)+ i s t c ( n i ( k l evc )−1)+ ji s=l s t c ( k)+ i s t c (1)+ jism1=l s t c (k)+ i s t c (2)+ jp( in )=p( inm1 )p( i s )=p( ism1 )

end doend dodo i =1, n i ( k l evc )

do j =1, nj ( k l evc )ih=l s t c (nk( k l evc ))+ i s t c ( i )+ ji l=l s t c (1)+ i s t c ( i )+ jihm1=l s t c (nk( k l evc )−1)+ i s t c ( i )+ ji lm1=l s t c (2)+ i s t c ( i )+ jp( ih )=p( ihm1 )p( i l )=p( ilm1 )

end doend do

c a l l p e t e r c y c l i c ( i s t c , l s t c , n i ( k l evc ) , n j ( k l evc ) , nk ( k l evc ) ,. k levc , cy c l i , c y c l j , cyc lk )

do k=2,nk ( k l evc )l s t c 0=l s t c ( k )l s t c 1=l s t c (k−1)l s t 2=l s t (2∗k−2)l s t 3=l s t (2∗k−3)do i =2, n i ( k l evc )i s t c 0=i s t c ( i )i s t c 1=i s t c ( i −1)i s t 2=i s t (2∗ i −2)i s t 3=i s t (2∗ i −3)do j =2, nj ( k l evc )

75

Page 88: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX E. CALC PART OF PETER MULTI.F FILE INCLUDING

MODIFICATIONS

c coa r s e r mesh l o c a t i o n parametersc North

ihnec=l s t c 0+i s t c 0+jihnwc=l s t c 0+i s t c 1+ji l n e c=l s t c 1+i s t c 0+ji lnwc=l s t c 1+i s t c 1+j

c Southihswc=l s t c 0+i s t c 1+j−1ih s e c=l s t c 0+i s t c 0+j−1i l swc=l s t c 1+i s t c 1+j−1i l s e c=l s t c 1+i s t c 0+j−1

c f i n e r mesh l o c a t i o n parametersc North

ihneb=l s t 2+i s t 2+2∗ j−2ihnwb=l s t 2+i s t 3+2∗ j−2i l n e b=l s t 3+i s t 2+2∗ j−2ilnwb=l s t 3+i s t 3+2∗ j−2

c Southihswb=l s t 2+i s t 3+2∗ j−3ih s eb=l s t 2+i s t 2+2∗ j−3i l swb=l s t 3+i s t 3+2∗ j−3i l s e b=l s t 3+i s t 2+2∗ j−3

c Modif ied by Mats f e l tc I f the c e l l above the a i r f o i l should not be a f f e c t e dc by the c e l l below the a i r f o i l .

i f ( i . l e . i a f p ( k l evc ) . and . j . eq . ( j a f p ( k l evc )+1)) thenc Pro longat ion to the f i n e r mesh above the a i r f o i lc c oa r s e r mesh l o c a t i o n parametersc North

ihnec=l s t c 0+i s t c 0+jihnwc=l s t c 0+i s t c 1+ji l n e c=l s t c 1+i s t c 0+ji lnwc=l s t c 1+i s t c 1+j

c Southihswc=l s t c 0+i s t c 1+ji h s e c=l s t c 0+i s t c 0+ji l swc=l s t c 1+i s t c 1+j

76

Page 89: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX E. CALC PART OF PETER MULTI.F FILE INCLUDING

MODIFICATIONS

i l s e c=l s t c 1+i s t c 0+j

end i fc Modif ied by Mats f e l t

c pro longate the p r e s su r e from a coar s e to a f i n e gr idc North

p( ihnwb)=p( ihnwb )+(27.∗p( ihnwc )+9.∗p( ihnec ). +9.∗p( ihswc )+3.∗p( i h s e c )+9.∗p( i lnwc ). +3.∗p( i l n e c )+3.∗p( i l swc )+1.∗p( i l s e c ) ) / 6 4 .

p( ihneb)=p( ihneb )+(9.∗p( ihnwc )+27.∗p( ihnec ). +3.∗p( ihswc )+9.∗p( i h s e c )+3.∗p( i lnwc ). +9.∗p( i l n e c )+1.∗p( i l swc )+3.∗p( i l s e c ) ) / 6 4 .

p( i lnwb)=p( ilnwb )+(9.∗p( ihnwc )+3.∗p( ihnec ). +3.∗p( ihswc )+1.∗p( i h s e c )+27.∗p( i lnwc ). +9.∗p( i l n e c )+9.∗p( i l swc )+3.∗p( i l s e c ) ) / 6 4 .

p( i l n e b )=p( i l n e b )+(3.∗p( ihnwc )+9.∗p( ihnec ). +1.∗p( ihswc )+3.∗p( i h s e c )+9.∗p( i lnwc ). +27.∗p( i l n e c )+3.∗p( i l swc )+9.∗p( i l s e c ) ) / 6 4 .

c Modif ied by Mats f e l tc I f the c e l l above the a i r f o i l should not be a f f e c t e dc by the c e l l below the a i r f o i l .

i f ( i . l e . i a f p ( k l evc ) . and . j . eq . ( j a f p ( k l evc )+1)) thenc Pro longat ion to the f i n e r mesh below the a i r f o i lc c oa r s e r mesh l o c a t i o n parametersc North

ihnec=l s t c 0+i s t c 0+j−1ihnwc=l s t c 0+i s t c 1+j−1i l n e c=l s t c 1+i s t c 0+j−1i lnwc=l s t c 1+i s t c 1+j−1

c Southihswc=l s t c 0+i s t c 1+j−1ih s e c=l s t c 0+i s t c 0+j−1i l swc=l s t c 1+i s t c 1+j−1i l s e c=l s t c 1+i s t c 0+j−1

end i f

77

Page 90: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX E. CALC PART OF PETER MULTI.F FILE INCLUDING

MODIFICATIONS

c Modif ied by Mats f e l t

c pro longate the p r e s su r e from a coar s e to a f i n e gr idc South

p( ihswb)=p( ihswb )+(9.∗p( ihnwc )+3.∗p( ihnec ). +27.∗p( ihswc )+9.∗p( i h s e c )+3.∗p( i lnwc ). +1.∗p( i l n e c )+9.∗p( i l swc )+3.∗p( i l s e c ) ) / 6 4 .

p( ih s eb )=p( ih s eb )+(3.∗p( ihnwc )+9.∗p( ihnec ). +9.∗p( ihswc )+27.∗p( i h s e c )+1.∗p( i lnwc ). +3.∗p( i l n e c )+3.∗p( i l swc )+9.∗p( i l s e c ) ) / 6 4 .

p( i l swb)=p( i l swb )+(3.∗p( ihnwc )+1.∗p( ihnec ). +9.∗p( ihswc )+3.∗p( i h s e c )+9.∗p( i lnwc ). +3.∗p( i l n e c )+27.∗p( i l swc )+9.∗p( i l s e c ) ) / 6 4 .

p( i l s e b )=p( i l s e b )+(1.∗p( ihnwc )+3.∗p( ihnec ). +3.∗p( ihswc )+9.∗p( i h s e c )+3.∗p( i lnwc ). +9.∗p( i l n e c )+9.∗p( i l swc )+27.∗p( i l s e c ) ) / 6 4 .

end doend doend do

c i f not on the f i n e s t g r id (=nlev ) , s o l v e the p r e s su r ei f ( k lev . ne . n lev ) then

c a l l p e t e r r e l a x (1 , cy c l i , c y c l j , cyc lk )

end i f800 cont inue

returnend

78

Page 91: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

F

CALC part of mg 2d.f file

including modifications

subrout ine mg 2d (aw , ae , as , an , ap , t , p , sr , su , nlev , ni , nj , a l ,. ah , ip lane , iwal1 , iwal2 , i a fp , ja fp ,. c y c l i , c y c l j , cyclk , wa l l j , t a f )

dimension aw(∗ ) , ae (∗ ) , as (∗ ) , an (∗ ) , ap (∗ ) , t (∗ ) , p (∗ ) , s r (∗ ) , su (∗ ). , i s t (1000) , i s t c (1000) , n i (∗ ) , n j (∗ ) , a l (∗ ) , ah (∗ ) , iwal1 (100) ,. iwal2 (100) , i a f p (100) , j a f p (100)l o g i c a l cy c l i , c y c l j , cyclk , wa l l j , t a f

c−−−− I n i t i a l i z a t i o n . . .

c−−−− I f the 3D−MG has reached the c o a r s e s t l e v e l . . .

c−−−− V(1 ,1)− cy c l e without postsmoothing on the c o a r s e s t l e v e l . . .c−−−− Only one cy c l e i s performed . . .

c−−−− B i l i n e a r r e s t r i c t i o n ( from f i n e to coar s e ) . . .

c−−−− B i l i n e a r p ro longat i on

do k lev =2, n levc a l l key2 ( klev , i s t , n i ( k lev ) , n j ( k lev ) )k l evc=klev−1c a l l key2 ( klevc , i s t c , n i ( k l evc ) , n j ( k l evc ) )

79

Page 92: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX F. CALC PART OF MG 2D.F FILE INCLUDING MODIFICATIONS

do i =1, n i ( k l evc )in=i s t c ( i )+nj ( k l evc )inm1=i s t c ( i )+nj ( k l evc )−1i s=i s t c ( i )+1ism1=i s t c ( i )+2p( in )=p( inm1 )p( i s )=p( ism1 )

end dodo j =1, nj ( k l evc )

in=i s t c ( n i ( k l evc ))+ jinm1=i s t c ( n i ( k l evc )−1)+ ji s=i s t c (1)+ jism1=i s t c (2)+ jp( in )=p( inm1 )p( i s )=p( ism1 )

end do

c . . . Per i od i c boundary cond i t i on s :

c a l l p e t e r 2d cy c l i c (p , k levc , i s t c , ni , nj ,. ip lane , iwal1 , iwal2 , cy c l i , c y c l j , cyclk , w a l l j )

do i =2, n i ( k l evc )i s t c 0=i s t c ( i )i s t c 1=i s t c ( i −1)i s t 2=i s t (2∗ i −2)i s t 3=i s t (2∗ i −3)do j =2, nj ( k l evc )

c coa r s e r mesh l o c a t i o n parametersc North

i l n e c=i s t c 0+ji lnwc=i s t c 1+j

c Southi l swc=i s t c 1+j−1i l s e c=i s t c 0+j−1

c f i n e r mesh l o c a t i o n parametersc North

80

Page 93: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX F. CALC PART OF MG 2D.F FILE INCLUDING MODIFICATIONS

i l n e b=i s t 2+2∗ j−2ilnwb=i s t 3+2∗ j−2

c Southi l swb=i s t 3+2∗ j−3i l s e b=i s t 2+2∗ j−3

c Modif ied by Mats f e l tc The p ro longat i on are not a l lowed to c r o s s the l im i t s o f the a i r f o i lc Sp e c i a l ca s e s f o r each plane :c i p l an e=1 => z−y plane , t a f t rue x value ok i . e . a i r f o i l , check yc i p l an e=2 => x−z plane , not a f f e c t e d by the a i r f o i l c on f i gu r a t i onc i p l an e=3 => x−y plane , check here i f x and y i s at the a i r f o i l

i f ( i p l an e . ne . 2 ) theni f ( ( i p l an e . eq . 1 . and . t a f . and . j . eq . ( j a f p ( k l evc )+1)) . or .

. ( i p l an e . eq . 3

. . and . i . l e . i a f p ( k l evc ) . and . j . eq . ( j a f p ( k l evc )+1))) then

c coa r s e r mesh l o c a t i o n parametersc North

i l n e c=i s t c 0+ji lnwc=i s t c 1+j

c Southi l swc=i s t c 1+ji l s e c=i s t c 0+j

end i fend i f

c Modif ied by Mats f e l t

c pro longate the p r e s su r e from a coar s e to a f i n e gr idc North

p( i lnwb)=p( ilnwb )+(9.∗p( i lnwc ). +3.∗p( i l n e c )+3.∗p( i l swc )+1.∗p( i l s e c ) ) / 1 6 .

p( i l n e b )=p( i l n e b )+(3.∗p( i lnwc ). +9.∗p( i l n e c )+1.∗p( i l swc )+3.∗p( i l s e c ) ) / 1 6 .

81

Page 94: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX F. CALC PART OF MG 2D.F FILE INCLUDING MODIFICATIONS

c Modif ied by Mats f e l tc The p ro longat i on are not a l lowed to c r o s s the l im i t s o f the a i r f o i lc Sp e c i a l ca s e s f o r each plane :c i p l an e=1 => z−y plane , t a f t rue x value ok i . e . a i r f o i l , check yc i p l an e=2 => x−z plane , not a f f e c t e d by the a i r f o i l c on f i gu r a t i onc i p l an e=3 => x−y plane , check here i f x and y i s at the a i r f o i l

i f ( i p l an e . ne . 2 ) theni f ( ( i p l an e . eq . 1 . and . t a f . and . j . eq . ( j a f p ( k l evc )+1)) . or .

. ( i p l an e . eq . 3

. . and . i . l e . i a f p ( k l evc ) . and . j . eq . ( j a f p ( k l evc )+1))) then

c coa r s e r mesh l o c a t i o n parametersc North

i l n e c=i s t c 0+j−1i lnwc=i s t c 1+j−1

c Southi l swc=i s t c 1+j−1i l s e c=i s t c 0+j−1

end i fend i f

c Modif ied by Mats f e l t

c pro longate the p r e s su r e from a coar s e to a f i n e gr idc South

p( i l swb)=p( i l swb )+(3.∗p( i lnwc ). +1.∗p( i l n e c )+9.∗p( i l swc )+3.∗p( i l s e c ) ) / 1 6 .

p( i l s e b )=p( i l s e b )+(1.∗p( i lnwc ). +3.∗p( i l n e c )+3.∗p( i l swc )+9.∗p( i l s e c ) ) / 1 6 .

end doend doi f ( k lev . ne . n lev ) c a l l p e t e r 2d r e l ax ( klev ,maxa , aw , ae

. , as , an , ap , t , p , sr , i s t , ni , nj , ip lane , iwal1 , iwal2 , cy c l i , c y c l j ,

. cyclk , w a l l j )end doend do

returnend

82

Page 95: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

G

CALC part of peter relax.f file

including modifications

subrout ine p e t e r r e l a x (mmm, cy c l i , c y c l j , cyc lk )

in c lude ’PETERCOMMON’l o g i c a l cy c l i , c y c l j , cyclk , wa l l j , t a fcommon / pete r / kst (100) , ks t 2d (100)dimension bw( io2dmax ) , be ( io2dmax ) , bs ( io2dmax ) , bn( io2dmax )dimension bp( io2dmax ) , bsu ( io2dmax ) , btry ( io2dmax )dimension b l ( io2dmax ) , bh( io2dmax )dimension s l 1 ( io2dmax ) , s l 2 ( io2dmax )dimension a (1000) , b (1000) , c (1000) , d (1000)dimension pnew( iomax )i n t e g e r ∗4 lock (0 : 1000 ) ! should be max( i t , j t , kt )

maxit2=mmmi f ( k lev . eq . 1 . and . n lev . gt . 1 ) maxit2=25

do 100 i t e r =1,maxit2

c a l l p e t e r c y c l i c ( i s t , l s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) ,. klev , cy c l i , c y c l j , cyc lk )

c−−−−− Symmeteric point−gs ( forward and backward sweep ) . . .

c−−−−− X−l i n e−gs . . .

83

Page 96: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX G. CALC PART OF PETER RELAX.F FILE INCLUDING

MODIFICATIONS

c−−−−− Y−l i n e−gs . . .

c−−−−− Z−l i n e−gs . . .

c−−−−− X−plane−gs

i f ( s o l ( 5 ) . eq . 1 ) then

c a l l key ( klev , l s t , i s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) )ks t 2d (1)=1

c a l l p e t e r c y c l i c ( i s t , l s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) ,. klev , cy c l i , c y c l j , cyc lk )

do i =2, n i ( k lev )−1icou=0do k l=1, k lev

kst 2d ( k l+1)=kst 2d ( k l )+nj ( k l )∗nk( k l )end doi s t i=i s t ( i )i s t i p=i s t ( i +1)i s t im=i s t ( i −1)do k=1,nk ( k lev )l s t k=l s t ( k )icoutmp=kst 2d ( k lev )−1 + (k−1)∗ nj ( k lev )do j =1, nj ( k lev )

icou = icoutmp + ji o=l s t k+i s t i+jiw=l s t k+i s t im+ji e=l s t k+i s t i p+jbw( icou )=a l ( i o )be ( icou )=ah ( i o )bs ( i cou )=as ( i o )bn( icou )=an ( i o )bp( icou )=ap ( i o )b l ( i cou )=aw( i o )bh( icou )=ae ( i o )bsu ( icou )=t ( i o )+ s r ( i o )+ae ( i o )∗p( i e )+aw( i o )∗p( iw )btry ( icou )=p( i o )

end doend do

84

Page 97: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX G. CALC PART OF PETER RELAX.F FILE INCLUDING

MODIFICATIONS

c Modif ied by Mats f e l tc I f the i coord inate show that the a i r f o i l w i l l be partc o f the s e t t a f to true f o r the in z−y plane .

i f ( i . l e . i a f p ( k lev ) . and . j . eq . ( j a f p ( k lev )+1)) thent a f =. true .

e l s et a f =. f a l s e .

end i fc Modif ied by Mats f e l t

c a l l mg 2d (bw, be , bs , bn , bp , bsu , btry , s l1 , s l2 , klev ,. nk , nj , bl , bh , 1 , iwal1 , iwal2 , i a fp , ja fp ,. c y c l i , c y c l j , cyclk , wa l l j , t a f )

k l=klevdo k=nk( k l ) ,1 ,−1l s t k=l s t ( k )icoutmp=kst 2d ( k lev )−1 + (k−1)∗ nj ( k lev )do j =1, nj ( k l ) , 1

i cou = icoutmp + ji o=l s t k+i s t i+jp( i o )=btry ( icou )

end doend do

end do

c a l l p e t e r c y c l i c ( i s t , l s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) ,. klev , cy c l i , c y c l j , cyc lk )

end i f

c−−−−− Y−plane−gs

i f ( s o l ( 6 ) . eq . 1 ) thenc a l l key ( klev , l s t , i s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) )ks t 2d (1)=1

do j =2, nj ( k lev )−1icou=0do k l=1, k lev

kst 2d ( k l+1)=kst 2d ( k l )+n i ( k l )∗nk( k l )

85

Page 98: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX G. CALC PART OF PETER RELAX.F FILE INCLUDING

MODIFICATIONS

end dok l=klev

do i =1, n i ( k lev )i s t i=i s t ( i )icoutmp=kst 2d ( k lev )−1 + ( i −1)∗nk( k lev )do k=1,nk ( k lev )

l s t k=l s t ( k )icou=icoutmp + kio=l s t k+i s t i+jin=io+1i s=io−1bw( icou )=aw( i o )be ( icou )=ae ( i o )bs ( i cou )=a l ( i o )bn( icou )=ah ( i o )bp( icou )=ap ( i o )b l ( i cou )=as ( i o )bh( icou )=an ( i o )bsu ( icou )=t ( i o )+ s r ( i o )+an ( i o )∗p( in )+as ( i o )∗p( i s )btry ( icou )=p( i o )

end doend do

c Modif ied by Mats f e l tc The p ro longat i on in the x−z plane in mg 2d w i l l not bec a f f e c t e d by the a i r f o i l c on f i gu r a t i on . The s p e c i f i e d t a fc va lue has no importance only s e t to have i t i n i t i a l i z e d .

t a f =. f a l s e .

c a l l mg 2d (bw, be , bs , bn , bp , bsu , btry , s l1 , s l2 , klev ,. ni , nk , bl , bh , 2 , iwal1 , iwal2 , i a fp , ja fp ,. c y c l i , c y c l j , cyclk , wa l l j , t a f )

c Modif ied by Mats f e l t

k l=klevdo i =1, n i ( k l ) , 1i s t i=i s t ( i )icoutmp=kst 2d ( k lev )−1 + ( i −1)∗nk( k lev )do k=1,nk ( k l ) , 1

l s t k=l s t ( k )i o=l s t k+i s t i+jicou=icoutmp + k

86

Page 99: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX G. CALC PART OF PETER RELAX.F FILE INCLUDING

MODIFICATIONS

p( i o )=btry ( icou )end doend do

end do

c a l l p e t e r c y c l i c ( i s t , l s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) ,. klev , cy c l i , c y c l j , cyc lk )

end i f

c−−−−− Z−plane−gs

i f ( s o l ( 7 ) . eq . 1 ) thenc a l l key ( klev , l s t , i s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) )ks t 2d (1)=1

do k=2,nk( k lev )−1icou=0do k l=1, k lev

kst 2d ( k l+1)=kst 2d ( k l )+n i ( k l )∗ nj ( k l )end do

l s t k=l s t ( k )lstkm=l s t (k−1)l s t kp=l s t ( k+1)

do i =1, n i ( k lev )i s t i=i s t ( i )icoutmp = kst 2d ( k lev )−1+( i −1)∗ nj ( k lev )do j =1, nj ( k lev )

icou=icoutmp+ji o=l s t k+i s t i+jih=l s t kp+i s t i+ji l=lstkm+i s t i+jbw( icou )=aw( i o )be ( icou )=ae ( i o )bs ( i cou )=as ( i o )bn( icou )=an ( i o )b l ( i cou )=a l ( i o )bh( icou )=ah ( i o )bp( icou )=ap ( i o )bsu ( icou )=t ( i o )+ s r ( i o )+ah ( i o )∗p( ih )+a l ( i o )∗p( i l )btry ( icou )=p( i o )

87

Page 100: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX G. CALC PART OF PETER RELAX.F FILE INCLUDING

MODIFICATIONS

end doend do

c Modif ied by Mats f e l tc The mg 2d code w i l l loop over the whole x−y plane and on i t sc own f e e l i f the a i r f o i l i s part o f the p ro longat i on orc not . The s p e c i f i e d t a f va lue has no importance only s e tc to have i t i n i t i a l i z e d .

t a f =. true .

c a l l mg 2d (bw, be , bs , bn , bp , bsu , btry , s l1 , s l2 , klev ,. ni , nj , bl , bh , 3 , iwal1 , iwal2 , i a fp , ja fp ,. c y c l i , c y c l j , cyclk , wa l l j , t a f )

c Modif ied by Mats f e l t

k l=klevdo i =1, n i ( k l ) , 1i s t i=i s t ( i )icoutmp = kst 2d ( k lev )−1+( i −1)∗ nj ( k lev )do j =1, nj ( k l ) , 1

i o=l s t k+i s t i+jicou=icoutmp + jp( i o )=btry ( icou )

end doend do

end do

c a l l p e t e r c y c l i c ( i s t , l s t , n i ( k lev ) , n j ( k lev ) , nk ( k lev ) ,. klev , cy c l i , c y c l j , cyc lk )

end i f

100 cont inuereturnend

88

Page 101: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

H

CALC distance to airfoil

calculation in the mod.f file

subrout ine modifyin c lude ’COMMON’inc lude ’CASECOM’inc lude ’MODCOM’dimension utemp ( j t , kt ) , vtemp( j t , kt ) ,wtemp( j t , kt )

common/ i n l e t 1 /umean( j t ) , rkmean in ( j t ) , epsmean in ( j t ) ,. u f l u c t ( j t , kt ) , v f l u c t ( j t , kt ) , w f lu c t ( j t , kt ) , vmean( j t ) ,. u2 prim , u v f l u c t ( j t ) , uv rans ( j t ) , uu synt2d ( j t ) , vv synt2d ( j t ) ,. ww synt2d ( j t ) , uv synt2d ( j t ) , ommean in( j t )

common/cmean/umeanv ( i t , j t ) , vmeanv( i t , j t ) , umean2v ( i t , j t ) ,. vmean2v( i t , j t ) ,wmean2v ( i t , j t ) , s s u

charac te r f i l n y ∗140 , t e s t ∗140 , name end∗110

c deltan2d r e l a t e d v a r i a b l e sdimension xTop( i t ) , yTop( i t )i n t e g e r countSize , count , i f oundl o g i c a l f l ag , f l a g 1

c− s e c t i o n 0 −−−−−− i n i t i a l i z a t i o n −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−entry modini

89

Page 102: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX H. CALC DISTANCE TO AIRFOIL CALCULATION IN THE MOD.F

FILE

c Modif ied by Mats f e l t! Ca l cu la t e s the c l o s e s t d i s t an c e from each c e l l c en te r to the! a i r f o i l i s needed in v i s t p an s . f and ca l ced pans to run RANS! the o r i g i n a l v a r i ab l e name i s d i s t but i s here named deltan2d

d i f f 2 o r g =2.937 ! D i f f in the top equat ion has to move the curve .k=nk/2

movedivide=1000. ! Factor to d i v i d e the moving d i s t an c e withcountMax=100. ! Number o f gues s e s to f i nd c l o s e s t

! l o c a t i o n on the curve

! Take the x and y va lu es o f the top o f the a i r f o i l to be used in! l i n e a r i n t e r p o l a t i o n between .

countS ize=1do i =2 ,( i a f +1)

i f ( xc ( i , j a f , k ) . gt .(− d i f f 2 o r g ) ) thenxTop( countS ize )=xc ( i −1, j a f , k )yTop( countS ize )=yc ( i −1, j a f , k )

countS ize=countS ize+1

end i fend do

countS ize=countSize−1

do i =1, n ido j =1, nj

count=1f l a g=0

! Defau l t 0 , s e t to 1 f o r l o c a t i o n s where no i t e r a t i o n! i s needed

ysource=yp( i , j , k )i f ( j . eq . j a f . and . i . l e . i a f ) then

! The r e a l y va lue o f the nodes j u s t above the! a i r f o i l i s y2d ( i a f , j a f )ysource=yp ( i a f , j a f , k )

end i f

90

Page 103: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX H. CALC DISTANCE TO AIRFOIL CALCULATION IN THE MOD.F

FILE

do whi le ( count . l e . countMax . and . f l a g . eq . 0 )

i f ( count . eq . 1 ) thenxn=xp( i , j , k ) ! F i r s t guessi f ound=2

e l s e i f ( count . eq . 2 ) then! Second guess move 1/movedivide along the! p o s i t i v e x ax i sd e l tano ld=del tanxn=xn+1/( count ∗movedivide )

e l s exn=(de l tanold−de l tan )/( count ∗movedivide)+xnde l tano ld=del tan

end i f

i f ( ysource . ge . yc ( i a f , j a f , k ) ) then ! Top equat ion :i f ( xn . l t .(− d i f f 2 o r g ) ) then

! The top su r f a c e o f the a i r f o i lyn=yc (1 , j a f , k )

e l s e i f ( xn . l e . xTop( countS ize ) ) then! The curved su r f a c e o f the a i r f o i l! Find the l o c a t i o n where xn i s l a r g e r! than the value o f xTop to the! l e f t and l a r g e r than that! to the r i gh t .f l a g 1=0

do whi le ( i f ound . l e . countS ize . and . f l a g 1 . eq . 0 )i f (xTop( i found −1). l e . xn

. . and . xTop( i found ) . ge . xn ) then! I f the xn value i s l ocated in! between the xTop va lues .yn=((yTop( i found)−yTop( i found −1))/

. (xTop( i found)−xTop( i found −1)))∗

. ( xn−xTop( i found−1))+yTop( i found−1)f l a g 1=1

end i fi f ( f l a g 1 . eq . 0 ) then

i f (xTop( i found −1). l t . xn. . and . i f ound . ne . countS ize ) then

i found=i found+1e l s e i f ( i f ound . eq . 2 ) then! The i found value i s not a l lowed

91

Page 104: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX H. CALC DISTANCE TO AIRFOIL CALCULATION IN THE MOD.F

FILE

! to be lower than 2 so! the same i found value! i s used in the next guess .e l s e i f ( i f ound . eq . countS ize ) then! To al low the the l a s t number! to be guessed againe l s e

i f ound=ifound−1end i f

end i fend do

e l s e i f ( xn . gt . xTop( countS ize ) ) then! The s e c t i o n above and behind the a i r f o i lxn=xTop( countS ize )yn=yTop( countS ize )

end i fe l s e i f ( ( ysource . gt . yc ( i a f , j a f −1,k ) )

. . and . ( xp ( i , j , k ) . gt . xc ( i a f , j a f −1,k ) ) ) then! S ide equat ionyn=ysource! The s h o r t e s t d i s t an c e to the l o c a t i o n! w i l l a l lways have the same y value .xn=xTop( countS ize )f l a g=1

e l s e ! Bottom equat ionyn=yc ( i a f , j a f , k )! The r e a l l o c a t i o n o f the bottom! o f the a i r f o i li f ( xp ( i , j , k ) . gt . xc ( i a f , j a f −1,k ) ) then

! The l o c a t i o n has a x value l a r g e r! than the a r i f o i lxn=xc ( i a f , j a f −1,k )

end i ff l a g=1

end i f

de l tan =((( abs (xp ( i , j , k)−xn ) ) ∗∗2 .. +(abs ( ysource−yn ) ) ∗∗2 . ) ) ∗∗0 . 5

! D i f f e r n c e between the p r ed i c t ed l o c a t i o n! and the i , j .

i f ( count . eq . 1 ) thendeltan2d ( i , j )=de l tan

92

Page 105: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX H. CALC DISTANCE TO AIRFOIL CALCULATION IN THE MOD.F

FILE

e l s ei f ( deltan2d ( i , j ) . l t . de l tan ) then! i f the new guessed de l tan value i s lower! than that s p e c i f i e d in deltan2d put i t in! deltan2d .

deltan2d ( i , j )=de l tanend i f

end i fcount=count+1

end doend do

end doc Modif ied by Mats f e l t

c . . .

93

Page 106: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

I

CALC dphidy.f file including

modifications

f unct i on dphidy ( i , j , k , nphi )in c lude ’COMMON’

c the d e r i v a t i v e dphidy at node i , j , k f o r va r i ab l e nphi i s c a l cu l a t ed here

phie=fx ( i , j , k )∗ phi ( i +1, j , k , nphi )+(1.− fx ( i , j , k ) )∗ phi ( i , j , k , nphi )phiw=fx ( i −1, j , k )∗ phi ( i , j , k , nphi )+(1.− fx ( i −1, j , k ) )

& ∗phi ( i −1, j , k , nphi )phin=fy ( i , j , k )∗ phi ( i , j +1,k , nphi )+(1.− fy ( i , j , k ) )∗ phi ( i , j , k , nphi )ph i s=fy ( i , j −1,k )∗ phi ( i , j , k , nphi )+(1.− fy ( i , j −1,k ) )

& ∗phi ( i , j −1,k , nphi )phih=f z ( i , j , k )∗ phi ( i , j , k+1,nphi )+(1.− f z ( i , j , k ) )∗ phi ( i , j , k , nphi )ph i l=f z ( i , j , k−1)∗phi ( i , j , k , nphi )+(1.− f z ( i , j , k−1))

& ∗phi ( i , j , k−1, nphi )

dphidy=(phie ∗ areaey ( i , j , k)−phiw∗ areaey ( i −1, j , k )& +phin∗areany ( i , j , k)−ph is ∗areany ( i , j −1,k )& +phih∗areahy ( i , j , k)−ph i l ∗areahy ( i , j , k−1))/ vo l ( i , j , k )

c Modif ied by Mats f e l tc To break the connect ion between the c e l l j a f+1 above the a i r f o i lc and j a f below .

i f ( i . l e . i a f . and . j . eq . j a f ) then

94

Page 107: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX I. CALC DPHIDY.F FILE INCLUDING MODIFICATIONS

phin=0.

dphidy=(phie ∗ areaey ( i , j , k)−phiw∗ areaey ( i −1, j , k )& +phin∗areany ( i , j , k)−ph is ∗areany ( i , j −1,k )& +phih∗areahy ( i , j , k)−ph i l ∗areahy ( i , j , k−1))/ vo l ( i , j , k )

e l s e i f ( i . l e . i a f . and . j . eq . ( j a f +1)) then

ph is =0.

dphidy=(phie ∗ areaey ( i , j , k)−phiw∗ areaey ( i −1, j , k )& +phin∗areany ( i , j , k)−ph is ∗ ar eany ja fp1 ( i , j −1,k )& +phih∗areahy ( i , j , k)−ph i l ∗areahy ( i , j , k−1))& / vol ( i , j , k )

end i fc Modif ied by Mats f e l t

r eturnend

95

Page 108: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

J

CALC part of ADM mod.f file

subrout ine modifyin c lude ’COMMON’inc lude ’CASECOM’inc lude ’MODCOM’

in tege r , parameter : : nSpanLoc = 19 , nBlade = 3 ,1 NSPANM = 30 , NANGM = 365 , NMACHM = 3double p r e c i s i on , parameter : : rHub = 1.50 d0 , rTip = 63.00 d0 ,

1 v In f = 8 .0 d0 , rho = 1.225 d0 ,1 soundSpeed = 340.0 d0 , p i t ch = 0 .0 d0double p r e c i s i on , dimension ( nSpanLoc ) : : rSpan , cSpan , tSpandouble p r e c i s i on , dimension ( j t ) : : rNode , afa , t f adouble p r e c i s i o n : : temp , um, wm, ax ia lForce , tangentForce , omegadouble p r e c i s i o n : : rcp , tw is t , chord , AngleOfAttacki n t e g e r : : NSPANB, NMACHB, counterin tege r , dimension (NSPANM) : : NANGBdouble p r e c i s i on , dimension (NMACHM) : : AMACHTBdouble p r e c i s i on , dimension (NSPANM) : : RCBdouble p r e c i s i on , dimension (NSPANM, NANGM) : : AATBdouble p r e c i s i on , dimension (NSPANM, NMACHM, NANGM) : : CLTB,CDTB,

1 CMTB

in t e g e r counte r j

c ADM var i b a l e f o r mod . fcommon/admmod/ imid , jmin , jmax , kmin , kmax , xp1 ,xpWT,. csmear , nksec , avgk , phiavgu ( j t ) , ph iavgtheta ( j t ) ,

96

Page 109: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX J. CALC PART OF ADM MOD.F FILE

. thetayz ( j t , kt ) ,Fyadm( j t , kt ) ,Fzadm( j t , kt ) ,

. t e s t th e ta , vv , vw , t e s t r , t e s t d i f f r t h e t a ,

. phiavgr ( j t ) , d i f f p h i avg rph i avg th e t a ( j t )

c Gaussian smearing r e l a t e d v a r i a b l e scommon/ gauss / im idd i f f , gaussianmag ( j t , kt ) ,. gaussianmagcheck ( j t , kt )

c− s e c t i o n 0 −−−−−− i n i t i a l i z a t i o n −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−entry modini

c Angular v e l o c i t y o f the r o t a t i on o f the b lades .omega = 1.003 d0 ! [ rad/ s ]

c Gaussian smearing nodesim i d d i f f =50

c Wind tu rb in e l o c a t i o nc f i nd imid , the i l o c a t i o n o f the wind tu rb in e

do i =1, n ii f ( xp ( i , 1 , 1 ) . l e . 0 . and . xp ( i +1 ,1 ,1) . ge . 0 ) i i=i

end doimid=i i

xpWT = 0 .5∗ ( xc ( imid ,1 ,1)+ xc ( imid −1 ,1 ,1)) ! streamwise p o s i t i o n

c Rotor dimens ionsjmin=2

c Find jmax from the de f in ed meshhub=63.do j =1, nj

i f ( yp (1 , j , 1 ) . l e . hub . and . yp (1 , j +1 ,1) . ge . hub) j j=jend dojmax=j j

kmin=2kmid=nk/2kmax=nkm1

97

Page 110: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX J. CALC PART OF ADM MOD.F FILE

c The number o f k p o s i t i o n s that are averaged over .avgk=kmax−kmin+1

c Smearing funct i on ( convo lu t i on )csmear = 2 .0

c Write the cen te r l o c a t i o n s o f the nodes o f theopen ( un i t =50, f i l e =’ controlNode . inp ’ , s t a tu s=’unknown ’ )do j=jmin , jmax

wr i t e (50 ,∗ ) yp (1 , j , 1 )end doc l o s e (50)

c Number o f nodes on the bladnBladeNodes=jmax−jmin+1

c Number o f s e c t i o n s that the f o r c e should be app l i ed onnksec=nk−2

c Approximation o f p i Machin− l i k e formulaep i =4.∗(4 .∗ atan (1 ./5 . ) − atan ( 1 . / 2 3 9 . ) )

do j=jmin , jmaxcounte r j=j−jmin+1

do k=kmin , kmaxc Tangent ia l v e l o c i t y , us ing po la r coo rd in a t e s conver s i on in y−z planec Find Theta angle [ rad ]

i f ( yp ( imid , j , k ) . gt . 0 . 0 ) thenthetayz ( j , k)=atan ( zp ( imid , j , k )/ yp ( imid , j , k ) )

e l s e i f ( yp ( imid , j , k ) . l t . 0 . 0 . and . zp ( imid , j , k ) . ge . 0 . 0 ) thenthetayz ( j , k)=atan ( zp ( imid , j , k )/ yp ( imid , j , k))+ pi

e l s e i f ( yp ( imid , j , k ) . l t . 0 . 0 . and . zp ( imid , j , k ) . l t . 0 . 0 ) thenthetayz ( j , k)=atan ( zp ( imid , j , k )/ yp ( imid , j , k))− p i

e l s e i f ( yp ( imid , j , k ) . eq . 0 . 0 . and . zp ( imid , j , k ) . gt . 0 . 0 ) thenthetayz ( j , k)=pi /2

e l s e i f ( yp ( imid , j , k ) . eq . 0 . 0 . and . zp ( imid , j , k ) . l t . 0 . 0 ) thenthetayz ( j , k)=−p i /2

e l s e i f ( yp ( imid , j , k ) . eq . 0 . 0 . and . zp ( imid , j , k ) . eq . 0 . 0 ) thenthetayz ( j , k )=0.wr i t e ( 6 ,∗ ) ’ Theta angle in mod . f i s not de f in ed at ( 0 , 0 ) ’

end i fend doend do

98

Page 111: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX J. CALC PART OF ADM MOD.F FILE

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! The aerodynamic c h a r a c t e r i s t i c s o f b lade are read .! rSpan : number o f b lade spanwise s e c t i o n i n c l ud in g a i r f p o i l p r o f i l e! cspan : l o c a l chord length [m]! tSpan : l o c a l tw i s t [ degree ]!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

open (1 , f i l e = ’ aeroData . inp ’ )do i = 1 , nSpanLoc

read (1 ,∗ ) rSpan ( i ) , cSpan ( i ) , tSpan ( i ) , tempend doc l o s e (1 )

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! The blade con t r o l po in t s are read . ( Blade spanwise d i s c r e t i z a t i o n )!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

open (2 , f i l e = ’ controlNode . inp ’ )do i = 1 , nBladeNodes

read (2 ,∗ ) rNode ( i )end doc l o s e (2 )

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! The tabu lated a i r f o i l data , CL, CD and CM are read .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

open (3 , f i l e = ’CLCDCMTable . inp ’ )read (3 ,∗ )read (3 ,∗ )read (3 ,∗ )read (3 ,∗ ) NSPANBread (3 ,∗ ) NMACHB

wr i t e ( 6 ,∗ ) ’ modini NMACHB’ ,NMACHBf l u s h (6)

do k = 1 , NMACHBread (3 ,∗ ) AMACHTB (k )

enddo

read (3 ,∗ )do j = 1 , NSPANBread (3 ,∗ ) RCB( j )read (3 ,∗ ) NANGB( j )

99

Page 112: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX J. CALC PART OF ADM MOD.F FILE

read (3 ,∗ )do i = 1 , NANGB ( j )

read (3 ,∗ ) AATB ( j , i ) , (CLTB ( j , k , i ) , CDTB ( j , k , i ) ,1 CMTB ( j , k , i ) , k=1, NMACHB)end do

read (3 ,∗ )end do

c l o s e (3 )

counter = maxval (NANGB)

return

c− s e c t i o n 1 −−−−−−p r op e r t i e s−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

c− s e c t i o n 2 −−−−−−convect ion−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

c− s e c t i o n 3 −−−−−− u−ve l o c i t y−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−entry modu

c −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−c ACTUATOR DISK MODELc −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−c Average the v e l o c i t i e s at a l l the k l e v e l s because o f the axisymmetryc conver t u , v ,w v e l o c i t y components to ax i a l and tangen t i a l components .

do j=jmin , jmaxcounte r j=j−jmin+1

phiavgu ( counte r j )=0. ! i n i t i a l i z eph iavgtheta ( counte r j )=0. ! i n i t i a l i z ephiavgr ( counte r j )=0. ! i n i t i a l i z e

do k=kmin , kmax

c Axial v e l o c i t yphiavgu ( counte r j )=phiavgu ( counte r j )+phi ( imid , j , k , u )

c Tangent ia l v e l o c i t yph iavgtheta ( counte r j )=ph iavgtheta ( counte r j )

. −phi ( imid , j , k , v )∗ s i n ( thetayz ( j , k ) )

. +phi ( imid , j , k ,w)∗ cos ( thetayz ( j , k ) )

end do

100

Page 113: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX J. CALC PART OF ADM MOD.F FILE

c The average over the k s e c t i o n sphiavgu ( counte r j )=phiavgu ( counte r j )/ avgkph iavgtheta ( counte r j )=ph iavgtheta ( counte r j )/ avgk

end do

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! This part c a l c u l a t e s the aerodynamic f o r c e s .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

do j = 1 , nBladeNodescounte r j=jmin+j−1

um = phiavgu ( j )wm = phiavgtheta ( j )rcp = rNode ( j )

! The ’ in terp ’ subrout ine c a l c u l a t e the l o c a l chord and tw i s t! by i n t e r p o l a t i o n from the aerodynamic c h a r a c t e r i s t i c t ab l e .

c a l l i n t e r p ( nSpanLoc , rcp , rSpan , cSpan , tSpan , chord , tw i s t )

AngleOfAttack=0.0! The ’ f o r ce ’ subrout ine c a l c u l a t e s the ax i a l and tangen t i a l f o r c e at! each spanwise s e c t i o n [N/m2 ] .

c a l l f o r c e (um, wm, omega , nBlade , rho , rHub , rTip , soundSpeed ,1 pitch , rcp , tw is t , chord , counter , NSPANM, NMACHM, NANGM,NSPANB,1 NMACHB, NANGB, RCB, AATB, AMACHTB, CLTB, CDTB, CMTB, ax ia lForce ,1 tangentForce , AngleOfAttack )

c Convert from c i r c u l e to a r egu l a r polynomax ia lFor ce=ax ia lFor ce ∗ p i /

. ( 8 . ∗ ( 1 . + ( ( 2 . ) ∗ ∗ ( 1 . / 2 . ) ) ) ∗ ( ( s i n ( p i / f l o a t ( nksec ) ) ) ∗ ∗ 2 . ) )

tangentForce=tangentForce ∗ p i /. ( 8 . ∗ ( 1 . + ( ( 2 . ) ∗ ∗ ( 1 . / 2 . ) ) ) ∗ ( ( s i n ( p i / f l o a t ( nksec ) ) ) ∗ ∗ 2 . ) )

a fa ( j )=ax ia lFor ce ! [N/m2]t f a ( j )=tangentForce ! [N/m2]

c Have the f o r c e s in [N] by mu l t ip l ing by the area s e c t i o n safa ( j )=afa ( j )∗ areaex ( imid , counter j , kmin ) ! [N]t f a ( j )= t f a ( j )∗ areaex ( imid , counter j , kmin ) ! [N]

101

Page 114: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX J. CALC PART OF ADM MOD.F FILE

end do

c Convert from tangen t i a l f o r c e to the v and w component .do j=jmin , jmaxcounte r j=j−jmin+1do k=kmin , kmax

c v componentFyadm( j , k)=− t f a ( coun te r j )∗ s i n ( thetayz ( j , k ) )

c w componentFzadm( j , k)= t f a ( counte r j )∗ cos ( thetayz ( j , k ) )

end doend do

c Check that the Gaussian has a t o t a l va lue o f onedo j=jmin , jmaxcounte r j=j−jmin+1do k=kmin , kmaxgaussianmag ( counter j , k )=0.do i=imid−im idd i f f , imid+im id d i f f

xp1 = 0 . 5∗ ( xc ( i ,1 ,1)+ xc ( i −1 ,1 ,1))dx = xc ( i ,1 ,1)− xc ( i −1 ,1 ,1)

c Streamwise d i s t an c e to wind tu rb in edstream = sq r t ( ( xp1−xpWT)∗∗2)

c Eps i lonep s i = csmear∗dx

c 1D Gaussian funct i oneta ep s = 1 . / ( ep s i ∗ p i ∗∗0 .5 )∗ exp(−(dstream/ ep s i )∗∗2)

c Or i g i n a l magnitude o f the l o c a l sum gauss ian funct i ongaussianmag ( counter j , k)=gaussianmag ( counter j , k)+

. e ta ep s ∗dx

end doend do

102

Page 115: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX J. CALC PART OF ADM MOD.F FILE

end do

c Apply the f o r c efmax=0.do j=jmin , jmaxcounte r j=j−jmin+1do k=kmin , kmaxgaussianmagcheck ( counter j , k )=0.fsum=0.0do i=imid−im idd i f f , imid+im id d i f f

xp1 = 0 . 5∗ ( xc ( i ,1 ,1)+ xc ( i −1 ,1 ,1))dx = xc ( i ,1 ,1)− xc ( i −1 ,1 ,1)

c Streamwise d i s t an c e to wind tu rb in edstream = sq r t ( ( xp1−xpWT)∗∗2)

c Eps i lonep s i = csmear∗dx

c 1D Gaussian funct i oneta ep s = 1 . / ( ep s i ∗ p i ∗∗0 .5 )∗ exp(−(dstream/ ep s i )∗∗2)

c Axial f o r c efp = afa ( counte r j )

c Apply the gauss ian and normal ize to have a sum of 1f d i s t = fp ∗ e ta ep s ∗dx/gaussianmag ( counter j , k )su ( i , j , k ) = su ( i , j , k ) − f d i s t

c Sum gauss ian funct i on to ensure that the sum i s onegaussianmagcheck ( counter j , k)=gaussianmagcheck ( counter j , k)+

. e ta ep s ∗dx/gaussianmag ( counter j , k )

end doend doend do

return

c− s e c t i o n 4 −−−−−−v−ve l o c i t y−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−entry modv

103

Page 116: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX J. CALC PART OF ADM MOD.F FILE

c −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−c ACTUATOR DISK MODELc −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

fmax=0.do j=jmin , jmaxcounte r j=j−jmin+1do k=kmin , kmaxgaussianmagcheck ( counter j , k )=0.fsum=0.0do i=imid−im idd i f f , imid+im id d i f f

xp1 = 0 . 5∗ ( xc ( i ,1 ,1)+ xc ( i −1 ,1 ,1))dx = xc ( i ,1 ,1)− xc ( i −1 ,1 ,1)

c Streamwise d i s t an c e to wind tu rb in edstream = sq r t ( ( xp1−xpWT)∗∗2)

c Eps i lonep s i = csmear∗dx

c 1D Gaussian funct i oneta ep s = 1 . / ( ep s i ∗ p i ∗∗0 .5 )∗ exp(−(dstream/ ep s i )∗∗2)

c v component o f the t angen t i a l f o r c efp = Fyadm( j , k )

c Apply the gauss ian and normal ize to have a sum of 1f d i s t = fp ∗ e ta ep s ∗dx/gaussianmag ( counter j , k )su ( i , j , k ) = su ( i , j , k ) − f d i s t

end doend doend do

return

c− s e c t i o n 5 −−−−−−w−ve l o c i t y−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−entry modw

c −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−c ACTUATOR DISK MODEL

104

Page 117: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX J. CALC PART OF ADM MOD.F FILE

c −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

fmax=0.do j=jmin , jmaxcounte r j=j−jmin+1do k=kmin , kmaxgaussianmagcheck ( counter j , k )=0.fsum=0.0do i=imid−im idd i f f , imid+im id d i f f

xp1 = 0 . 5∗ ( xc ( i ,1 ,1)+ xc ( i −1 ,1 ,1))dx = xc ( i ,1 ,1)− xc ( i −1 ,1 ,1)

c Streamwise d i s t an c e to wind tu rb in edstream = sq r t ( ( xp1−xpWT)∗∗2)

c Eps i lonep s i = csmear∗dx

c 1D Gaussian funct i oneta ep s = 1 . / ( ep s i ∗ p i ∗∗0 .5 )∗ exp(−(dstream/ ep s i )∗∗2)

c w component o f the t angen t i a l f o r c efp = Fzadm( j , k )

c Apply the gauss ian and normal ize to have a sum of 1f d i s t = fp ∗ e ta ep s ∗dx/gaussianmag ( counter j , k )su ( i , j , k ) = su ( i , j , k ) − f d i s t

end doend doend do

return

c . . .

105

Page 118: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

K

CALC ADM force.f file

subrout ine f o r c e (u , w, rotVel , nb , airDen , hubRad , tipRad , snVel ,. bPtc , rLoc , locTwist , locChord , maxCounter , nSpanG , nMachG,. nAngleG , nSpanTable , nMachTable , nAngleTable , rLocTable ,. aoaTable , machTable , c lTable , cdTable , cmTable , Fn , Ft , aoa )

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−im p l i c i t none

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−double p r e c i s i on , parameter : : nace l l eDragCoe f f = 0.50 d0i n t e g e r : : nb , nSpanG , nMachG, nAngleG , nSpanTable , nMachTable ,

. maxCounterin tege r , dimension (nSpanG) : : nAngleTabledouble p r e c i s i o n : : rotVel , airDen , hubRad , tipRad , snVel , bPtc ,

. rLoc , locTwist , locChord , Fn , Ft , u , w, CL, CD, CM, pi , c r i t e r i a ,

. f lowAngle , aoa , l i f t C o e f f , dragCoef f , normalCoeff , tangentCoef f ,

. sigma , fTipCorr , fHubCorr , Ftip , Fhub , Ftot , aInd , apInd , Vx, Vt ,

. VxUpdate , VtUpdate , deltaVx , deltaVt , vTotal2 , machNumber ,

. aIndUpdate , apIndUpdate , deltaaInd , deltaapInd ,

. acInd , KaInddouble p r e c i s i on , dimension (nMachG) : : machTabledouble p r e c i s i on , dimension (nSpanG) : : rLocTabledouble p r e c i s i on , dimension ( nAngleG) : : aoaInterp , c l I n t e r p ,

. cdInterp , cmInterpdouble p r e c i s i on , dimension (nSpanG , nAngleG) : : aoaTabledouble p r e c i s i on , dimension (nSpanG ,nMachG, nAngleG) : :

. c lTable , cdTable , cmTable!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

Vx = u

106

Page 119: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX K. CALC ADM FORCE.F FILE

! [m/ s ] , from Navier−Stokes so lu t i on , a x i a l v e l o c i t y perpend i cu la r to! the r o t o r p lane

Vt = w! [m/ s ] , from Navier−Stokes so lu t i on , t angen t i a l v e l o c i t y perpend i cu la r! to the r o t o r p lane

p i = 4 .0 d0 ∗ atan (1 . 0 d0 )

i f ( rLoc . l e . hubRad) thenFt = 0 .0 d0Fn = 0.50 d0 ∗ airDen ∗ (u ∗∗ 2) ∗ nace l l eDragCoe f fgoto 20

end i f! For the r a d i i sma l l e r than hub rad ius , the constant drag c o e f f i c i e n t! f o r the n a c e l l e ( Cd nace l l e =0.5) i s con s id e r ed . So , in that case ,! on ly the ax i a l f o r c e ac t s on the actuator d i sk .! The dimension o f the Ft and Fn are [N/m2 ] .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

f lowAngle = atand (Vx / abs(− rotVel ∗ rLoc − Vt ) )! [ degree ] , f low angle c a l c u l a t i o n based on the ax i a l and tangen t i a l! v e l o c i t i e s .

aoa = f lowAngle − ( locTwis t + bPtc )! aoa [ degree ] , ang le o f attack c a l c u l a t i o n by means o f f low angle ,! l o c a l tw i s t and blade p i t ch angle .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! L i f t and drag c o e f f i c i e n t s based on the l i n e a r a i r f o i l theory .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! l i f t C o e f f = 2 .0 d0 ∗ p i ∗ ( aoa ∗ p i / 180 .0 d0 )! dragCoef f = 0 .0 d0!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

machNumber = sq r t ( (Vx ∗∗ 2 .0 d0 ) + ((− rotVel ∗ rLoc − Vt). ∗∗ 2 .0 d0 ) ) / snVel

! machNumber i s the Mach number which i s used when read ing and! i n t e r p o l a t i n g a i r f o i l data .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

c a l l aeroTable ( rLoc , machNumber , rLocTable , machTable , aoaTable ,. c lTable , cdTable , cmTable , nSpanG , nMachG, nAngleG ,. nSpanTable , nMachTable , nAngleTable , c l I n t e r p , cdInterp ,. cmInterp , aoaInterp )

c a l l f o i l c l c d cm ( aoa , maxCounter , nAngleG , aoaInterp ,. c l I n t e r p , cdInterp , cmInterp , CL, CD, CM)

107

Page 120: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX K. CALC ADM FORCE.F FILE

! These two subrou t in e s c a l c u l a t e l i f t (CL) and drag (CD) c o e f f i c i e n t s! f o r each spanwise s e c t i o n .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

l i f t C o e f f = CL ! L i f t c o e f f i c i e n t f o r each spanwise s e c t i o n .dragCoef f = CD ! Drag c o e f f i c i e n t f o r each spanwise s e c t i o n .

normalCoef f = ( l i f t C o e f f ∗ cosd ( f lowAngle ) ). + ( dragCoef f ∗ s ind ( f lowAngle ) )

! normalCoef f i s the p r o j e c t i o n o f l i f t and drag c o e f f i c i e n t s in to the! normal d i r e c t i o n ( perpend i cu la r to the r o t o r plane , Axial d i r e c t i o n )

tangentCoef f = ( l i f t C o e f f ∗ s ind ( f lowAngle ) ). − ( dragCoef f ∗ cosd ( f lowAngle ) )

! tangentCoef f i s the p r o j e c t i o n o f l i f t and drag c o e f f i c i e n t s in to the! t angen t i a l d i r e c t i o n ( t angen t i a l to the r o t o r p lane )!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

vTotal2 = Vx ∗∗ 2 .0 d0 + ( abs(− rotVel ∗ rLoc − Vt ) ) ∗∗ 2 .0 d0! The magnitude o f the t o t a l v e l o c i t y i s computed .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

Fn = (1 . 0 d0 / (2 ∗ p i ∗ rLoc ) ) ∗ 0.50 d0 ∗ airDen ∗ vTotal2. ∗ locChord ∗ nb ∗ normalCoef f

! [N/m2] , The ax i a l f o r c e ( perpend i cu la r to the r o t o r p lane ) .Ft = (1 . 0 d0 / (2 ∗ p i ∗ rLoc ) ) ∗ 0.50 d0 ∗ airDen ∗ vTotal2

. ∗ locChord ∗ nb ∗ tangentCoef f! [N/m2] , The tangen t i a l f o r c e ( t angen t i a l to the r o t o r p lane ) .

20 cont inue

returnend subrout ine

108

Page 121: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

L

CALC part of ALM mod.f file

subrout ine modifyin c lude ’COMMON’inc lude ’CASECOM’inc lude ’MODCOM’

in tege r , parameter : : nSpanLoc = 19 , nBlade = 3 ,1 NSPANM = 30 , NANGM = 365 , NMACHM = 3double p r e c i s i on , parameter : : rHub = 1.50 d0 , rTip = 63.00 d0 ,

1 v In f = 8 .0 d0 , rho = 1.225 d0 ,1 soundSpeed = 340.0 d0 , p i t ch = 0 .0 d0double p r e c i s i on , dimension ( nSpanLoc ) : : rSpan , cSpan , tSpandouble p r e c i s i on , dimension ( j t ) : : rNodedouble p r e c i s i on , dimension ( j t , 3 ) : : afa , t f adouble p r e c i s i o n : : temp , um, wm, ax ia lForce , tangentForce , omegadouble p r e c i s i o n : : rcp , tw is t , chord , AngleOfAttack , magchecki n t e g e r : : NSPANB, NMACHB, counterin tege r , dimension (NSPANM) : : NANGBdouble p r e c i s i on , dimension (NMACHM) : : AMACHTBdouble p r e c i s i on , dimension (NSPANM) : : RCBdouble p r e c i s i on , dimension (NSPANM, NANGM) : : AATBdouble p r e c i s i on , dimension (NSPANM, NMACHM, NANGM) : : CLTB,CDTB,

1 CMTB

in t e g e r counte r j

c ADM var i b a l e f o r mod . fcommon/admmod/ imid , jmin , jmax , kmin , kmax , xp1 ,xpWT,

109

Page 122: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

. csmear , nksec , avgk , phiavgu ( j t ) , ph iavgtheta ( j t ) ,

. thetayz ( j t , kt ) ,Fyadm( j t , kt ) ,Fzadm( j t , kt ) ,

. t e s t th e ta , vv , vw , t e s t r , t e s t d i f f r t h e t a ,

. phiavgr ( j t ) , d i f f p h i avg rph i avg th e t a ( j t )

c ALM parameterscommon/alm/ tott ime , radturnedtot , radturnedtotB (3 ) ,. lapturnedtotB (3 ) , radturnedB (3 ) , lapturnedB (3 ) ,. thetamesh , Theta2k ( j t , j t ) , AngBlade , f l a gkp l an e

in tege r , dimension (3) : : Bladeki n t e g e r : : Bladep

c Gaussian smearing r e l a t e d v a r i a b l e scommon/ gauss / im idd i f f , gaussianmag ( i t , j t ) , gaussianmagcheck ( i t , j t )

c Epsi avgerage parameterscommon/ eps iavgpar / eps iavgcounter , epsiavgsum , eps iavg

c− s e c t i o n 0 −−−−−− i n i t i a l i z a t i o n −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−entry modini

c Angular v e l o c i t y o f the r o t a t i on o f the b lades .omega = 1.003 d0 ! [ rad/ s ]

c Gaussian smearing nodesim i d d i f f =50

c Wind tu rb in e l o c a t i o nc f i nd imid , the i l o c a t i o n o f the wind tu rb in e

do i =1, n ii f ( xp ( i , 1 , 1 ) . l e . 0 . and . xp ( i +1 ,1 ,1) . ge . 0 ) i i=i

end doimid=i i

xpWT = 0 .5∗ ( xc ( imid ,1 ,1)+ xc ( imid −1 ,1 ,1)) ! streamwise p o s i t i o n

c Rotor dimens ionsjmin=2

c Find jmax from the de f in ed meshhub=63.

110

Page 123: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

do j =1, nji f ( yp (1 , j , 1 ) . l e . hub . and . yp (1 , j +1 ,1) . ge . hub) j j=j

end dojmax=j j

kmin=2kmid=nk/2kmax=nkm1

c The number o f k p o s i t i o n s that are averaged over .avgk=kmax−kmin+1

c Smearing funct i on ( convo lu t i on )csmear = 2 .0

c Write the cen te r l o c a t i o n s o f the nodes o f theopen ( un i t =50, f i l e =’ controlNode . inp ’ , s t a tu s=’unknown ’ )do j=jmin , jmax

wr i t e (50 ,∗ ) yp (1 , j , 1 )end doc l o s e (50)

c Number o f nodes on the bladnBladeNodes=jmax−jmin+1

c Number o f s e c t i o n s that the f o r c e should be app l i ed onnksec=nk−2

c Approximation o f p i Machin− l i k e formulaep i =4.∗(4 .∗ atan (1 ./5 . ) − atan ( 1 . / 2 3 9 . ) )

do j=jmin , jmaxcounte r j=j−jmin+1

do k=kmin , kmaxc Tangent ia l v e l o c i t y , us ing po la r coo rd in a t e s conver s i on in y−z planec Find Theta angle [ rad ]

i f ( yp ( imid , j , k ) . gt . 0 . 0 ) thenthetayz ( j , k)=atan ( zp ( imid , j , k )/ yp ( imid , j , k ) )

e l s e i f ( yp ( imid , j , k ) . l t . 0 . 0 . and . zp ( imid , j , k ) . ge . 0 . 0 ) thenthetayz ( j , k)=atan ( zp ( imid , j , k )/ yp ( imid , j , k))+ pi

e l s e i f ( yp ( imid , j , k ) . l t . 0 . 0 . and . zp ( imid , j , k ) . l t . 0 . 0 ) then

111

Page 124: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

thetayz ( j , k)=atan ( zp ( imid , j , k )/ yp ( imid , j , k))− p ie l s e i f ( yp ( imid , j , k ) . eq . 0 . 0 . and . zp ( imid , j , k ) . gt . 0 . 0 ) then

thetayz ( j , k)=pi /2e l s e i f ( yp ( imid , j , k ) . eq . 0 . 0 . and . zp ( imid , j , k ) . l t . 0 . 0 ) then

thetayz ( j , k)=−p i /2e l s e i f ( yp ( imid , j , k ) . eq . 0 . 0 . and . zp ( imid , j , k ) . eq . 0 . 0 ) then

thetayz ( j , k )=0.wr i t e ( 6 ,∗ ) ’ Theta angle in mod . f i s not de f in ed at ( 0 , 0 ) ’

end i fend doend do

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! The aerodynamic c h a r a c t e r i s t i c s o f b lade are read .! rSpan : number o f b lade spanwise s e c t i o n i n c l ud in g a i r f p o i l p r o f i l e! cspan : l o c a l chord length [m]! tSpan : l o c a l tw i s t [ degree ]!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

open (1 , f i l e = ’ aeroData . inp ’ )do i = 1 , nSpanLoc

read (1 ,∗ ) rSpan ( i ) , cSpan ( i ) , tSpan ( i ) , tempend doc l o s e (1 )

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! The blade con t r o l po in t s are read . ( Blade spanwise d i s c r e t i z a t i o n )!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

open (2 , f i l e = ’ controlNode . inp ’ )do i = 1 , nBladeNodes

read (2 ,∗ ) rNode ( i )end doc l o s e (2 )

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! The tabu lated a i r f o i l data , CL, CD and CM are read .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

open (3 , f i l e = ’CLCDCMTable . inp ’ )read (3 ,∗ )read (3 ,∗ )read (3 ,∗ )read (3 ,∗ ) NSPANBread (3 ,∗ ) NMACHB

112

Page 125: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

wr i t e ( 6 ,∗ ) ’ modini NMACHB’ ,NMACHBf l u s h (6)

do k = 1 , NMACHBread (3 ,∗ ) AMACHTB (k )

enddo

read (3 ,∗ )do j = 1 , NSPANBread (3 ,∗ ) RCB( j )read (3 ,∗ ) NANGB( j )read (3 ,∗ )do i = 1 , NANGB ( j )

read (3 ,∗ ) AATB ( j , i ) , (CLTB ( j , k , i ) , CDTB ( j , k , i ) ,1 CMTB ( j , k , i ) , k=1, NMACHB)end do

read (3 ,∗ )end do

c l o s e (3 )

counter = maxval (NANGB)

c Tracing the b ladesc Mesh turn ing

thetamesh=2.0∗ p i / f l o a t ( nksec )

c Matrix mapping thetamesh to k planedo i =1, nksec

c Radians turned smal l e r than the k plane usedTheta2k ( i ,1)= i ∗ thetamesh

c k plane cor respond to rad ian s turned smal l e r thanTheta2k ( i ,2)= i+1

end do

c Angle between the blades , here 3 b ladesAngBlade=2.0∗ p i /3 .0

return

c− s e c t i o n 1 −−−−−−p r op e r t i e s−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

113

Page 126: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

c− s e c t i o n 2 −−−−−−convect ion−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

c− s e c t i o n 3 −−−−−− u−ve l o c i t y−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−entry modu

c −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−c ACTUATOR LINE MODELc −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

c Blades turn ingtott ime =0.0do l o c i t s t e p =1, i t s t e p

tott ime=tott ime+dt ( l o c i t s t e p )end do

radturnedtot=omega∗ tott ime

c Find rad ian s each blade has rotated whit in the lapdo k=1,3 ! 3 b lades

radturnedtotB (k)=radturnedtot+(k−1)∗AngBladelapturnedtotB (k)=radturnedtotB ( k )/ ( 2 . 0∗ p i )

c Floor rounds to g r e a t e s t i n t e g e r l e s s than , to obta inc the f u l l l ap s by the b lades

lapturnedB (k)=FLOOR( r e a l ( lapturnedtotB (k ) ) )radturnedB (k)=radturnedtotB (k)−(2.0∗ p i ∗ lapturnedB (k ) )

end do

c Find the k plane l o c a t i o n o f the th r ee b ladesdo k=1,3 ! Each blade

f l a gkp l an e=0i=1do whi le ( i . l e . nksec . and . f l a gkp l an e . eq . 0 )

i f ( radturnedB (k ) . l t . Theta2k ( i , 1 ) ) thenBladek (k)=Theta2k ( i , 2 )f l a gkp l an e=1

end i fi=i+1

end do

114

Page 127: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

end do

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! This part c a l c u l a t e s the aerodynamic f o r c e s f o r the 3 b lades!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

do k=1,3 ! 3 b lades

do j = 1 , nBladeNodes

counte r j=jmin+j−1

c Local a x i a l v e l o c i t yum = phi ( imid , counter j , Bladek ( k ) , u )

c Local t angen t i a l v e l o c i t ywm = −phi ( imid , counter j , Bladek (k ) , v )

. ∗ s i n ( thetayz ( counter j , Bladek (k ) ) )

. +phi ( imid , counter j , Bladek (k ) ,w)

. ∗ cos ( thetayz ( counter j , Bladek (k ) ) )

rcp = rNode ( j )

! The ’ in terp ’ subrout ine c a l c u l a t e the l o c a l chord and tw i s t! by i n t e r p o l a t i o n from the aerodynamic c h a r a c t e r i s t i c t ab l e .

c a l l i n t e r p ( nSpanLoc , rcp , rSpan , cSpan , tSpan , chord , tw i s t )

AngleOfAttack=0.0

! The ’ f o r ce ’ subrout ine c a l c u l a t e s the ax i a l and tangen t i a l f o r c e at! each spanwise s e c t i o n [N/m2 ] .

c a l l f o r c e (um, wm, omega , nBlade , rho , rHub , rTip , soundSpeed ,1 pitch , rcp , tw is t , chord , counter , NSPANM, NMACHM, NANGM,NSPANB,1 NMACHB, NANGB, RCB, AATB, AMACHTB, CLTB, CDTB, CMTB, ax ia lForce ,1 tangentForce , AngleOfAttack )

afa ( j , k)=ax ia lFor ce ! [N/m]t f a ( j , k)=tangentForce ! [N/m]

c Have the f o r c e s in [N] by mu l t ip l ing by d e l t a r o f the meshafa ( j , k)=afa ( j , k )

. ∗( yc (1 , counter j ,1)− yc (1 , counter j −1 ,1)) ! [N]t f a ( j , k)= t f a ( j , k )

. ∗( yc (1 , counter j ,1)− yc (1 , counter j −1 ,1)) ! [N]

115

Page 128: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

end doend do

c Convert from tangen t i a l f o r c e to the v and w component .do j=jmin , jmaxcounte r j=j−jmin+1

c do k=kmin , kmaxdo k=1,3

c v componentFyadm( j , k)=− t f a ( counter j , k )∗ s i n ( thetayz ( j , Bladek ( k ) ) )

c w componentFzadm( j , k)= t f a ( counter j , k )∗ cos ( thetayz ( j , Bladek (k ) ) )

end doend do

c Check that the Gaussian has a t o t a l va lue o f oneep s i avgcounte r=0.0epsiavgsum=0.0do Bladep=1,3do j=jmin , jmaxcounte r j=j−jmin+1gaussianmag (Bladep , coun te r j )=0.0do k=kmin , kmaxdo i=imid−im idd i f f , imid+im id d i f f

xp1 = 0 . 5∗ ( xc ( i ,1 ,1)+ xc ( i −1 ,1 ,1))dx = xc ( i ,1 ,1)− xc ( i −1 ,1 ,1)dr = yc ( imid , j ,1)−yc ( imid , j −1 ,1)drThetaloc = (2∗ p i / nksec )∗yp( imid , j , 1 )dRTheta = (2∗ p i / nksec )∗hub

c 3D d i s t an c e to wind tu rb in e bladedstream = sq r t ( ( xp1−xpWT)∗∗2+

. ( yp ( imid , j , Bladek ( Bladep ))−yp( imid , j , k ))∗∗2+

. ( zp ( imid , j , Bladek ( Bladep ))− zp ( imid , j , k ) )∗∗2)

c Eps i lonep s i = csmear∗ s q r t (dRTheta∗∗2+dr∗∗2+dx∗∗2)

116

Page 129: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

c 2D Gaussian funct i oneta ep s = 1 . / ( ep s i ∗∗2∗ p i )∗ exp(−(dstream/ ep s i )∗∗2)

c Or i g i n a l magnitude o f the l o c a l sum gauss ian funct i ongaussianmag (Bladep , coun te r j )=gaussianmag (Bladep , coun te r j )+

. e ta ep s ∗dx∗drThetaloc

c Average ep s i used to d e f i n e e p s i l o n o f the s imu lat i onep s i avgcounte r=eps iavgcounte r+1.0epsiavgsum=epsiavgsum+ep s i

end doend doend doend do

c Averagaged e sp i va lue in the s imu lat i oneps iavg=epsiavgsum / eps iavgcounte ri f ( i t s t e p . eq . 1 . and . i t e r . eq . 1 ) then

wr i t e ( 6 ,∗ ) ’ Average ep s i l o n value in the s imu lat i on i s ’. , eps iavgend i f

c Apply the f o r c edo Bladep=1,3fmax=0.do j=jmin , jmaxcounte r j=j−jmin+1gaussianmagcheck ( Bladep , coun te r j )=0.0do k=kmin , kmaxfsum=0.0do i=imid−im idd i f f , imid+im id d i f f

xp1 = 0 . 5∗ ( xc ( i ,1 ,1)+ xc ( i −1 ,1 ,1))dx = xc ( i ,1 ,1)− xc ( i −1 ,1 ,1)dr = yc ( imid , j ,1)−yc ( imid , j −1 ,1)drThetaloc = (2∗ p i / nksec )∗yp( imid , j , 1 )dRTheta = (2∗ p i / nksec )∗hub

c 3D d i s t an c e to wind tu rb in e bladedstream = sq r t ( ( xp1−xpWT)∗∗2+

. ( yp ( imid , j , Bladek ( Bladep ))−yp( imid , j , k ))∗∗2+

. ( zp ( imid , j , Bladek ( Bladep ))− zp ( imid , j , k ) )∗∗2)

117

Page 130: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

c Eps i lonep s i = csmear∗ s q r t (dRTheta∗∗2+dr∗∗2+dx∗∗2)

c 2D Gaussian funct i oneta ep s = 1 . / ( ep s i ∗∗2∗ p i )∗ exp(−(dstream/ ep s i )∗∗2)

c Axial f o r c efp = afa ( counter j , Bladep )

c Apply the gauss ian and normal ize to have a sum of onef d i s t = fp ∗ e ta ep s ∗dx∗drThetaloc

. /gaussianmag (Bladep , coun te r j )su ( i , j , Bladek ( Bladep ) ) = su ( i , j , Bladek ( Bladep ) ) − f d i s t

c Sum gauss ian funct i on to ensure that the sum i s onegaussianmagcheck ( Bladep , coun te r j )=

. gaussianmagcheck ( Bladep , coun te r j )+

. e ta ep s ∗dx∗drThetaloc

. /gaussianmag (Bladep , coun te r j )

end doend doend doend do

return

c− s e c t i o n 4 −−−−−−v−ve l o c i t y−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−entry modv

c −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−c ACTUATOR LINE MODELc −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

do Bladep=1,3fmax=0.do j=jmin , jmaxcounte r j=j−jmin+1gaussianmagcheck ( Bladep , coun te r j )=0.0do k=kmin , kmaxfsum=0.0

118

Page 131: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

do i=imid−im idd i f f , imid+im id d i f f

xp1 = 0 . 5∗ ( xc ( i ,1 ,1)+ xc ( i −1 ,1 ,1))dx = xc ( i ,1 ,1)− xc ( i −1 ,1 ,1)dr = yc ( imid , j ,1)−yc ( imid , j −1 ,1)drThetaloc = (2∗ p i / nksec )∗yp( imid , j , 1 )dRTheta = (2∗ p i / nksec )∗hub

c 3D d i s t an c e to wind tu rb in e bladedstream = sq r t ( ( xp1−xpWT)∗∗2+

. ( yp ( imid , j , Bladek ( Bladep ))−yp( imid , j , k ))∗∗2+

. ( zp ( imid , j , Bladek ( Bladep ))− zp ( imid , j , k ) )∗∗2)

c Eps i lonep s i = csmear∗ s q r t (dRTheta∗∗2+dr∗∗2+dx∗∗2)

c 2D Gaussian funct i oneta ep s = 1 . / ( ep s i ∗∗2∗ p i )∗ exp(−(dstream/ ep s i )∗∗2)

c v component o f the t angen t i a l f o r c efp = Fyadm( j , Bladep )

c Apply the gauss ian and normal ize to have a sum of onef d i s t = fp ∗ e ta ep s ∗dx∗drThetaloc

. /gaussianmag (Bladep , coun te r j )su ( i , j , Bladek ( Bladep ) ) = su ( i , j , Bladek ( Bladep ) ) − f d i s t

end doend doend doend do

return

c− s e c t i o n 5 −−−−−−w−ve l o c i t y−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−entry modw

c −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−c ACTUATOR LINE MODELc −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

do Bladep=1,3

119

Page 132: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX L. CALC PART OF ALM MOD.F FILE

fmax=0.do j=jmin , jmaxcounte r j=j−jmin+1gaussianmagcheck ( Bladep , coun te r j )=0.0do k=kmin , kmaxfsum=0.0do i=imid−im idd i f f , imid+im id d i f f

xp1 = 0 . 5∗ ( xc ( i ,1 ,1)+ xc ( i −1 ,1 ,1))dx = xc ( i ,1 ,1)− xc ( i −1 ,1 ,1)dr = yc ( imid , j ,1)−yc ( imid , j −1 ,1)drThetaloc = (2∗ p i / nksec )∗yp( imid , j , 1 )dRTheta = (2∗ p i / nksec )∗hub

c 3D d i s t an c e to wind tu rb in e bladedstream = sq r t ( ( xp1−xpWT)∗∗2+

. ( yp ( imid , j , Bladek ( Bladep ))−yp( imid , j , k ))∗∗2+

. ( zp ( imid , j , Bladek ( Bladep ))− zp ( imid , j , k ) )∗∗2)

c Eps i lonep s i = csmear∗ s q r t (dRTheta∗∗2+dr∗∗2+dx∗∗2)

c 2D Gaussian funct i oneta ep s = 1 . / ( ep s i ∗∗2∗ p i )∗ exp(−(dstream/ ep s i )∗∗2)

c w component o f the t angen t i a l f o r c efp = Fzadm( j , Bladep )

c Apply the gauss ian and normal ize to have a sum of onef d i s t = fp ∗ e ta ep s ∗dx∗drThetaloc

. /gaussianmag (Bladep , coun te r j )su ( i , j , Bladek ( Bladep ) ) = su ( i , j , Bladek ( Bladep ) ) − f d i s t

end doend doend doend do

return

c . . .

120

Page 133: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

M

CALC ALM force.f file

subrout ine f o r c e (u , w, rotVel , nb , airDen , hubRad , tipRad , snVel ,1 bPtc , rLoc , locTwist , locChord , maxCounter , nSpanG , nMachG,1 nAngleG , nSpanTable , nMachTable , nAngleTable , rLocTable ,1 aoaTable , machTable , c lTable , cdTable , cmTable , Fn , Ft , aoa )

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−im p l i c i t none

!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−double p r e c i s i on , parameter : : nace l l eDragCoe f f = 0.50 d0i n t e g e r : : nb , nSpanG , nMachG, nAngleG , nSpanTable , nMachTable ,

1 maxCounterin tege r , dimension (nSpanG) : : nAngleTabledouble p r e c i s i o n : : rotVel , airDen , hubRad , tipRad , snVel , bPtc ,

1 rLoc , locTwist , locChord , Fn , Ft , u , w, CL, CD, CM, pi , c r i t e r i a ,1 f lowAngle , aoa , l i f t C o e f f , dragCoef f , normalCoeff , tangentCoef f ,1 sigma , fTipCorr , fHubCorr , Ftip , Fhub , Ftot , aInd , apInd , Vx, Vt ,1 VxUpdate , VtUpdate , deltaVx , deltaVt , vTotal2 , machNumber ,1 aIndUpdate , apIndUpdate , deltaaInd , deltaapInd ,1 acInd , KaInd

double p r e c i s i on , dimension (nMachG) : : machTabledouble p r e c i s i on , dimension (nSpanG) : : rLocTabledouble p r e c i s i on , dimension ( nAngleG) : : aoaInterp , c l I n t e r p ,

1 cdInterp , cmInterpdouble p r e c i s i on , dimension (nSpanG , nAngleG) : : aoaTabledouble p r e c i s i on , dimension (nSpanG ,nMachG, nAngleG) : :

1 clTable , cdTable , cmTable!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

Vx = u

121

Page 134: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX M. CALC ALM FORCE.F FILE

! [m/ s ] , from Navier−Stokes so lu t i on , a x i a l v e l o c i t y perpend i cu la r to! the r o t o r p lane

Vt = w! [m/ s ] , from Navier−Stokes so lu t i on , t angen t i a l v e l o c i t y perpend i cu la r! to the r o t o r p lane

p i = 4 .0 d0 ∗ atan (1 . 0 d0 )

i f ( rLoc . l e . hubRad) thenFt = 0 .0 d0Fn = 0.50 d0 ∗ airDen ∗ (u ∗∗ 2) ∗ nace l l eDragCoe f fgoto 20

end i f! For the r a d i i sma l l e r than hub rad ius , the constant drag c o e f f i c i e n t! f o r the n a c e l l e ( Cd nace l l e =0.5) i s con s id e r ed . So , in that case ,! on ly the ax i a l f o r c e ac t s on the actuator d i sk .! The dimension o f the Ft and Fn are [N/m2 ] .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

f lowAngle = atand (Vx / abs(− rotVel ∗ rLoc − Vt ) )! [ degree ] , f low angle c a l c u l a t i o n based on the ax i a l and tangen t i a l! v e l o c i t i e s .

aoa = f lowAngle − ( locTwis t + bPtc )! aoa [ degree ] , ang le o f attack c a l c u l a t i o n by means o f f low angle ,! l o c a l tw i s t and blade p i t ch angle .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! L i f t and drag c o e f f i c i e n t s based on the l i n e a r a i r f o i l theory .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−! l i f t C o e f f = 2 .0 d0 ∗ p i ∗ ( aoa ∗ p i / 180 .0 d0 )! dragCoef f = 0 .0 d0!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

machNumber = sq r t ( (Vx ∗∗ 2 .0 d0 ) + ((− rotVel ∗ rLoc − Vt)1 ∗∗ 2 .0 d0 ) ) / snVel

! machNumber i s the Mach number which i s used when read ing and! i n t e r p o l a t i n g a i r f o i l data .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

c a l l aeroTable ( rLoc , machNumber , rLocTable , machTable , aoaTable ,1 clTable , cdTable , cmTable , nSpanG , nMachG, nAngleG ,1 nSpanTable , nMachTable , nAngleTable , c l I n t e r p , cdInterp ,1 cmInterp , aoaInterp )

c a l l f o i l c l c d cm ( aoa , maxCounter , nAngleG , aoaInterp ,1 c l I n t e r p , cdInterp , cmInterp , CL, CD, CM)

122

Page 135: Actuator turbine models and trailing edge flow ...publications.lib.chalmers.se/records/fulltext/234098/234098.pdf · Actuator turbine models and trailing edge ... Actuator turbine

APPENDIX M. CALC ALM FORCE.F FILE

! These two subrou t in e s c a l c u l a t e l i f t (CL) and drag (CD) c o e f f i c i e n t s! f o r each spanwise s e c t i o n .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

l i f t C o e f f = CL ! L i f t c o e f f i c i e n t f o r each spanwise s e c t i o n .dragCoef f = CD ! Drag c o e f f i c i e n t f o r each spanwise s e c t i o n .

normalCoef f = ( l i f t C o e f f ∗ cosd ( f lowAngle ) )1 + ( dragCoef f ∗ s ind ( f lowAngle ) )

! normalCoef f i s the p r o j e c t i o n o f l i f t and drag c o e f f i c i e n t s in to the! normal d i r e c t i o n ( perpend i cu la r to the r o t o r plane , Axial d i r e c t i o n )

tangentCoef f = ( l i f t C o e f f ∗ s ind ( f lowAngle ) )1 − ( dragCoef f ∗ cosd ( f lowAngle ) )

! tangentCoef f i s the p r o j e c t i o n o f l i f t and drag c o e f f i c i e n t s in to the! t angen t i a l d i r e c t i o n ( t angen t i a l to the r o t o r p lane )!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

vTotal2 = Vx ∗∗ 2 .0 d0 + ( abs(− rotVel ∗ rLoc − Vt ) ) ∗∗ 2 .0 d0! The magnitude o f the t o t a l v e l o c i t y i s computed .!−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−

Fn = 0.50 d0 ∗ airDen ∗ vTotal2 ∗ locChord ∗ normalCoef f! [N/m] , The ax i a l f o r c e ( perpend i cu la r to the r o t o r p lane ) .

Ft = 0.50 d0 ∗ airDen ∗ vTotal2 ∗ locChord ∗ tangentCoef f! [N/m] , The tangen t i a l f o r c e ( t angen t i a l to the r o t o r p lane ) .

20 cont inue

returnend subrout ine

123