• Non ci sono risultati.

Devolepement and Validation of a Direct and Adjoint Solver for a Tridimensional Boundary Layer

N/A
N/A
Protected

Academic year: 2021

Condividi "Devolepement and Validation of a Direct and Adjoint Solver for a Tridimensional Boundary Layer"

Copied!
86
0
0

Testo completo

(1)

FACOLT `A DI INGEGNERIA

Corso di Laurea Magistrale in Ingegneria Aerospaziale

Tesi di laurea

Development and Validation of a Direct and Adjoint Solver for

a Tridimensional Boundary Layer

Candidato:

Ennio Barbaro

Relatore:

(2)

This thesis work consist in the development and the validation of a mixed Finite Elements - Finite Differences solver for the tridimensional boundary layer equations of the flow over a flat plate. This code has been written in C++ using a F.E.M. library called Fenics. The use of the most modern parallel solvers allows for a very efficient computation, and the code runs extremely fast even on non-specialized hardware.

The second part of the work consists in the implementation, in the same framework, of an adjoint solver. The adjoint method is the most used technique when dealing with PDE-constrained optimization. It allows the user to estimate the gradient of any scalar function defined on the whole flow field with respect to the only initial conditions. This requires the knowledge of the solution of the direct problem (which is nonlinear), but, since the adjoint equations are linear, estimating the gradient is a much cheaper operation than solving the direct problem.

We use the combination of direct and adjoint solver to efficiently reconstruct the flow in the whole domain given only one component of the velocity field in two dif-ferent cross-flow sections. The validation of the code is presented and several results which demonstrate the effectiveness of this solver in reproducing the experimental data available from the ERC project AFRODITE.

(3)

Questo lavoro di tesi consiste nello sviluppo e nalla validazione di un risolutore misto Elementi Finiti - Differenze Finite per il problema dello strato limite tridimensionale su una lastra piana. Il codice `e stato scritto in C++ utilizzando una libreria di supporto per gli Elementi Finiti chiamata Fenics. Il tool sviluppato `e particolarmente efficiente dato l’utilizzo dei pi`u moderni risolutori paralleli, e performa ottimamente anche sull’hardware non specializzato.

La seconda parte del lavoro consiste nell’impementazione, nel medesimo ambiente, di un risolutore aggiunto. Il metodo degli aggiunti `e la tecnica pi`u usata nell’ambito dei problemi di ottimizzazione di funzioni vincolate da equazioni alle derivate parziali. Lo scopo `e di stimare il gradiente di una qualuque funzione scalare definita sull’intero dominio computazionale, rispetto alle sole condizioni iniziali. Per fare ci`o `e necessaria la soluzione del problema diretto (che `e non lineare), ma, poich´e le equazioni aggiunte sono lineari, la stima del gradiente `e un’operazione molto pi`u computazionalmente economica rispetto alla soluzione del problema diretto.

Utilizziamo i risolutori diretto e aggiunto in combinazione con lo scopo di ricostru-ire il campo di velocit`a nell’intero dominio a partricostru-ire dalla conoscenza di una sola componente della velocit`a in due differenti piani perpendicolari alla direzione prin-cipale del flusso. Viene presentata la validazione del codice e numerosi risultati che dimostrano l’efficacia del risolutore nel confermare i dati sperimentali disponibili dal progetto ERC AFRODITE.

(4)

1. Introduction 1

2. Problem description 4

2.1. Boundary layers . . . 4

2.1.1. The Blasius Solution . . . 5

2.1.2. Turbulence and Control . . . 8

2.1.3. Classical Stability Analysis . . . 9

2.1.4. Algebraic Instability . . . 11

2.2. Description of the experimental scenario . . . 13

2.3. Boundary layer equations in 3D . . . 15

2.3.1. Boundary Conditions . . . 17

2.3.2. Normalization of the flow variables . . . 18

3. Numerical solver 20 3.1. Numerical formulation . . . 20

3.1.1. Discretization in the flow direction . . . 20

3.1.2. Discretization in (y-z) planes . . . 22

3.2. Implementation . . . 26

3.2.1. Description of the Fenics toolkit . . . 26

3.2.2. Structure and algorithms . . . 27

4. Validation 29 4.1. Validation against Blasius solution . . . 29

4.2. Validation against DNS . . . 31

4.2.1. Direct error comparison . . . 31

4.2.2. Comparison of integral parameters . . . 34

(5)

5. Adjoint solver 39

5.1. The task of the Adjoint Solver . . . 39

5.2. Brief introduction to Calculus of Variations . . . 41

5.2.1. First and second variation . . . 41

5.2.2. Fundamental Lemma . . . 42

5.2.3. A practical example . . . 42

5.2.4. Notes on classic applications of CoV . . . 43

5.3. Continuous and Discrete Adjoint Methods . . . 44

5.3.1. The constrained optimization problem . . . 44

5.3.2. A practical example . . . 45

5.3.3. The computation of the Gradient . . . 46

5.3.4. Continuous vs Discrete approach . . . 48

5.4. Continuous Adjoint Equations for the Boundary Layer . . . 49

5.5. Solver Description . . . 53

5.6. Solver Validation . . . 54

5.7. The problem of the initial conditions constraints . . . 56

5.8. Reconstruction of a 3D field from given constraints . . . 59

6. Conclusions 62

A. Source code 64

(6)

2.1. Local stability curve for the parallel boundary layer . . . 11 2.2. Representation of the flat plate with MVGs as used in the experiments 13 2.3. Sketch (not to scale) of the plate with MVGs . . . 14 3.1. A rectangular mesh with 16 × 16 cells . . . 23 3.2. Evolution of the solution (u component) on various sections . . . 25 4.1. R.m.s. error with respect to Blasius solution vs the spatial

discretiza-tion step . . . 30 4.2. R.m.s. error of the validation tests in the DNS normalization vs the

total number of DOFs (see 4.2) . . . 33 4.3. R.m.s. error of the validation tests in the BL solver normalization

(that is, the spanwise velocities are of the same order of the stream-flow velocity) vs the total number of DOFs (see 4.2) . . . 33 4.4. Sint from the DNS (blue) and from BL equations (red) . . . 34

4.5. Smax from the DNS (blue) and from BL equations (red) . . . 35

4.6. Enstrophy for DNS solution (blue) and from BL equations (red) . . . 35 4.7. Surface streamlines from the DNS (a), and from the BL solver (b), at

x= 0.571L . . . 36 4.8. U contour plot from the DNS (a), and from the BL solver (b), at

x= 0.571L . . . 37 4.9. Error with respect to DNS for x1 = 0.27L (a), x1 = 0.4L (b) and

x1 = 0.5L (c) . . . 38

5.1. R.m.s. error of the approximated gradient (see (5.22)) with respect to the gradient computed with the adjoint method, each color represent a different δu. The legend reports the seed used to generate each δu; in sec.A the code used to generate the δus is reported. . . 55

(7)

5.2. A conceptual sketch of the problem of the gradient descent method with constrained variables, represented in the phase space. . . 56 5.3. Comparison of the streamlines of the reconstructed velocity field (a)

against the exact solution from the DNS (b) , at a section x = 0.565. 61 5.4. Residual of the gradient solver after each step . . . 61

(8)

2.1. Common quantities of the Blasius solution expressed in term of stream

function . . . 6

2.2. Boundary conditions in the Blasius solution . . . 6

3.1. Parameters of the newton solver . . . 28

4.1. Parameters of the DNS from [2] . . . 31

4.2. Parameters of the validation tests. . . 32

5.1. Solver parameters used for the adjoint validation . . . 55

5.2. Parameters used to test the gradient solver on the complete problem of the reconstruction of the velocity field . . . 60

(9)

The problem of drag reduction on aerodynamics bodies is, for obvious reasons, one of major scientific interest in aerodynamics. In an aerodynamic body in a typical configuration, such as an airplane’s wing, the friction drag has an important contri-bution to the overall drag. Since the viscous stress loads that the air applies on the body are determined by the velocity profile very close to the surface, the boundary layer plays a fundamental role in the intensity of the friction drag. Therefore, any attempt to reduce the friction drag of a body shall start from the control of the behavior of the boundary layer.

In particular, since in typical engineering applications the Reynolds number is sufficiently high to induce a stable laminar boundary layer to transition to a turbulent state - with a much higher drag coefficient with respect to the laminar one - most attempts of friction drag reduction in engineering applications are in fact attempts to delay the turbulent transition.

A lot of strategies in this sense ware based on methods of active flow control; that is they introduce energy in the flow in order to improve its stability. Such de-vices are often too complex, hence their potential economical advantages are reduced significantly.

In the last decade it has been show in literature that longitudinal high-speed streaks in a boundary layer, if properly shaped and not too intense, can have a damping effect on the main form of instability of the laminar boundary layer, that is the Tollmien Schlichting waves. Such streaks can be used to delay the turbulent transition of the BL, provided that they are not too strong to excite the algebraic instability and that the upcoming perturbances are moderate ([9]). Such streaks have been successfully generated with geometrical elements of small dimension located in the upstream section of the boundary layer. Experimental results (ref. [11], [12], [13]) conducted at the KTH MTL wind tunnel - considered to be one of the best wind tunnels in the world of its kind - proved these numerical findings.

(10)

project AFRODITE, directed by Prof. J. Fransson (KTH Mechanics, Stockholm), focused on the study of this strategy of transition delay. In particular, this project uses small winglet-shaped elements called Miniature Vortex Generators (MVGs), which are found to be quite efficient in the task of generating the velocity streaks. The MVGs are mounted in symmetrical pairs, forming a span-wise row on the flat plate. Obviously a lot of efforts have been taken in order to optimize the shape of the MVGs, aiming for the configuration which produces the best possible damping.

The present thesis work is introduced within the numerical activity coordinated by Dr. Camarri at the Department of Civil and Industrial Engineering (DICI) at University of Pisa, with the purpose of provide full numerical support to the ex-perimental activities of the AFRODITE project. In this context, the exex-perimental results obtained at KTH have already been confirmed by a DNS (Direct Numerical Simulation) analysis conducted by Camarri ([2]), which agreed with the experiments in the transition delay and, more importantly, confirmed the overall drag reduction. In this work, the TS waves were artificially introduced in the flow, and hence their damping has been observed. This work aim to provide an efficient tool to verify the stability of a given laminar flow in a computationally cheap way; the code we developed is designed to run on an every-day PC, while the DNS - although more accurate - required a super computer. The final objective (which goes well beyond the scope of this thesis), is to have a set of numerical tools which can possibly be commercialized to be used directly in engineering applications.

Most of the stability analysis on boundary layers before 2005 use a linearized approach. While this is suitable for the investigation of the T.S. waves, it does not take into account for the nonlinear effects, which may lead to the saturation of the amplification of the wave. Zuccher, Bottaro and Luchini ([5]) performed the first nonlinear analysis of the algebraic growth on the Blasius boundary layer, by studing the nonlinear optimal disturbances; their success is mainly due to the simplification of the problem obtained by the use of the Prandtl boundary layer equations instead of the full Navier Stokes equations. Using an adjoint based method, they found the worst possible cross-flow periodic input perturbation of fixed energy - that is the one which produces the highest perturbation energy in the whole field domain.

The motivation for this work arises from the availability of partial data of the velocity field from the experiments conducted at KTH. Our task is to be able to estimate the velocity field in the whole domain of interest from the solely knowledge of these data. Indeed, this is an opportunity to develop a tool which has a much

(11)

broader use; indeed the code developed in this work allows for a fast computation of the gradient of any (at least differentiable) function defined over the whole flow field with respect to the only initial conditions. This is only a small generalization of the algorithm developed in [5], [6]. Being able to efficiently compute the gradient obviously allows one to minimize any function of the flow field. This code helps answer the questions “Given a tridimensional base flow, what is the perturbation with an assigned energy - say 10% of the energy of the base flow - which produces the highest perturbation energy on the whole field?”, or “Given the x-component of velocity at two different section, what is the whole flow field?”, among other problems related to the stability analysis.

This work mainly consists of two parts: the development of a numerical solver for the steady tridimensional boundary layer equations and the development of the ad-joint solver (the component which permits a fast computation of the gradient) based on the former. In chapter 2 we briefly introduce some notions about the boundary layers and their stability, and we shortly describe the experimental framework con-ducted at KTH and the related thesis work from Spagnolo ([17]), whose results have been used to validate this code. Chapter 3 describes the numerical formulation of the solver and its implementation in C++. Chapter 4 shows the results of the validation campaign of the numerical solver. In chapter 5 we describe the theory behind the adjoint solver and its implementation, and we prove again the correctness of the code. Chapter 6 draws the conclusions and lists some of the possible future developments.

(12)

2.1. Boundary layers

At large Reynolds numbers, most of the flow past a solid surface is approximately ir-rotational, and consequentially the viscosity plays no role in the momentum equation (see for example [1] for a detailed explanation of this fact).

Unfortunately, a thin zone where the viscosity effects are not negligible and the fluid is rotational is located near the walls. In this area, the flow field is characterized by high gradients, because the velocity must approach rapidly zero in the neighborhood of the wall in order to satisfy the no-slip condition.

The concept of boundary layer is not limited to the Navier-Stokes equations, in fact it is an important concept in any diffusion-transport-reaction system, since in most practical applications the diffusion term of the equation is some order of magnitude smaller than the advection term.

In aerodynamics the BL is even more important than in other cases, because the behavior of the flow near the walls affect directly the viscous stress experienced by the body, and can indirectly affect the whole flow due to the phenomenon of the boundary layer separation.

Historically, the first tentative to use a simplified version of the NS equations to study the boundary layers is due to Prandtl (1905), which introduced the boundary layer equations1 lead by the analysis of the order of magnitude of the various terms

of the full NS equations under the fundamental hypothesis of thin boundary layer which does not undergo separation.

This approach allows the use of the simple potential flow model outside the bound-ary layer, provided that the shape of the body is corrected in a suitable manner depending on the solution of the boundary layer equation’s (which itself depend on the potential flow).

1The derivation of these equations is shown in sec. 2.3 for the tridimensional case; it should not

(13)

Despite the initial lack of a rigorous mathematical proof of their validity, the Prandtl’ boundary layers equations historically proved to be a very effective model. In the seventies, this approach found its place in a more rigorous mathematical theory called method of the matched asymptotic expansion, that deals with any differential equation whose highest-order derivative term is controlled by a vanishing small pa-rameter. However one must stress that the Prandtl’ boundary layer equations are applicable only with the hypothesis of high-Re, laminar flow, and attached boundary layer.

2.1.1. The Blasius Solution

We now briefly introduce the only known semi-analytical solution of interest to the bidimensional boundary layer equations. This solution was found by Blasius and it will be used as reference in the validation chapter of this thesis.

We recall the bidimensional steady boundary layer equations for a flat plate:

∂u ∂x + ∂v ∂y = 0 u∂u ∂x + v ∂u ∂y = ν ∂2u ∂y2

The equation of conservation of momentum in the stream-flow direction produces this scaling argument:

U2

L ≈ ν

U

δ2 (2.1)

Which is obviously valid also in the tridimensional case. Hence we can now define δ as:

δ(x) =νx U

1/2

Which differs from any other common definition of boundary layer thickness (on a laminar flow) solely by a multiplicative constant.

This fact suggest that a similarity solution exists, and the system of equations may be reduced to an ODE by adopting the variable:

η = y

(14)

∂η ∂y = η y u= ∂ψ ∂y = U f 0 (η) v = −∂ψ ∂x = 1 2 (νU x)1/2 2x [f (η) − ηf 0 (η)] ∂u ∂x = U h f00(η)− η 2x i ∂u ∂y = U  f00(η)η y 

Table 2.1.: Common quantities of the Blasius solution expressed in term of stream function

u(y = 0) = 0 ⇒ f0(0) = 0

v(y = 0) = 0 ⇒ f(0) = 0

u(y = ∞) = U ⇒ f0(∞) = 1

Table 2.2.: Boundary conditions in the Blasius solution And by using the stream function:

ψ = (νU x)1/2f(η)

From this definition follows the results expressed in table 2.1.

The continuity equation is automatically satisfied due to the stream-function for-mulation. After some manipulations, the x-momentum equation reduces to:

f000+1 2f f

00

= 0 (2.2)

And the boundary conditions are:

It is interesting to compute the pressure of this flow field as a function of η. In order to do so we recall the y-momentum equation:

u∂v ∂x + v ∂v ∂y = 1 ρ ∂p ∂y + ν ∂2v ∂y

As we showed in sec. 2.3, by using the usual scaling argument the pressure is of order δ2. Nonetheless we can still compute its exact value by assuming2 (forcefully,

(15)

because this is true only at the first order) that p = p∞ for y → ∞. p(y) = ρ Z y ∞  −u∂v ∂x − v ∂v ∂y0 + ν ∂2v ∂y02  dy0+ p∞

Using the relations from tab. 2.1 we obtain: p(y) = ρU ν

8x 4f

00

η+ 2ηf f0− 2f2 + p

∞ (2.3)

Which as we expected is a O δ. This equation has little practical utility, but it will be useful to perform extra checks in order to validate our solver with the Blasius solution.

(16)

2.1.2. Turbulence and Control

Until now we assumed that a boundary layer flow can be described with some regular steady (assuming that the boundary conditions are time-independent) flow. Unfor-tunately, this is not the case, as the experience can show that, in the general case, a boundary layer flow gradually changes its behavior moving downstream, and at a certain section it becomes fully turbulent.

A complete description of turbulent flows is out of the scope of this thesis. Gen-erally speaking, we can describe the phenomenon of turbulence by enumerating the features of such flow, that is non-steadiness, rotationality, chaotic. Turbulence is often described as a pseudo-random phenomenon, because even if the equations that describe the evolution of the flow field are deterministic, every small perturbation of the flow field has a huge impact on the evolution of the flow itself, thus making a probabilistic approach to the problem more suitable than the classic NS equations. Turbulence is an every-day experience, since most real-life flows are turbulent. The typical example is the smoke of a cigarette in calm air, which is usually laminar in the first 1-2 centimeters, and then undergoes a “regular” unsteady perturbation (transition region) and becomes fully turbulent further downstream.

In engineering applications, turbulent flows are sometimes desirable, due to the highly mixing of the quantities advected in the flow (momentum, temperature, con-centration of some substance, etc). Thus a turbulent flow is often desirable in com-bustion, heat-exchange (cooling of an object via convection), etc. On the other hand, a turbulent boundary layer imply a much higher viscous drag with respect to the lam-inar counterpart, thus making it undesirable in aerodynamics (with the remarkable exception of the positive effect on the boundary layer separation).

Therefore, the study of the stability of the boundary layer is of great importance in aerodynamics, and every mean to delay the turbulent transition of the boundary layer is highly welcome. Such strategies of BL control can be passive or active (and the latter can be with or without feedback); the former is basically some kind of geometrical modifications (like the MVG presented in this thesis, or change of the surface roughness), while the latter can be a controlled suction of air through the surface. The case of active control is obviously more complex, and one must take care to have a favorable balance in the power expended to control the boundary layer versus the reduction of drag.

(17)

2.1.3. Classical Stability Analysis

The aim of the fluid dynamics stability theory is to answer the questions “when”, “why” and “how” an initially laminar flow undergoes transition.

The classical approach is to introduce small velocity perturbation into the base flow, and linearize the Navier Stokes equations obtaining the evolutive equations of the disturbance. If we consider a two dimensional parallel3 flow, i.e. a flow where

the only non zero component of the velocity is the U , one can obtain the following equations describing the evolution of a velocity perturbation (u, v) in a base flow U(y):                ∂u ∂x + ∂v ∂y = 0 ∂u ∂t + U ∂u ∂x + v ∂U ∂y = − ∂p ∂x + Re −12 u ∂v ∂t + U ∂v ∂x = − ∂p ∂y + Re −12v (2.4)

The perturbation is usually expressed as a traveling wave4:

(u, v, p) = (u(y), v(y), p(y))eiαx−ωt

And thus we can introduce the stream function: ψ(x, y) = eψ(y)eiαx−ωt

Which automatically satisfies the mass balance. Plugging ψ in eq. 2.4 one can obtain:  U − ω iα  (·)00− α2 e ψ − U00ψe= 1 Re (·) 00− α22 ψe iα

Where the derivative (·)0is intended in the y-direction. This equation is the starting

point of linear stability theory of parallel laminar flows. It is called Orr-Sommerfeld equation since it has been obtained independently by Orr (1907) and Sommerfeld (1908).

The boundary conditions of eq. 2.1.3 are:

3The Blasius flow is not parallel, but for simplicity the v component of the velocity has historically

been considered negligible

(18)

y = 0 : u = v = 0 ⇒ eψ = eψ0 = 0 y= ∞ : u = v = 0 ⇒ eψ = eψ0 = 0

Here α is real and λ = 2π/α is the wavelength of the perturbation mode. The quantity ω = ωr + iωi is complex; ωi represents the frequency of the mode and ωr

determines whether the wave is damped (ωr >0) or if there are instabilities (ωr <0).

One can further define the derived quantity: c= cr+ ici =

ω iα

Where cr is the phase velocity of the wave in the x direction and the sign of ci is

decides between amplification or damping.

The ansatz (2.1.3) has been proved by Squire (1933); in particular he was able to show that plane flow only becomes unstable with respect to three-dimensional perturbations at higher Reynolds number, so that it is always sufficient to study the two-dimensional perturbations ([4]).

For a given basic flow U (y), eq. 2.1.3 contains four parameters, namely Re,α,cr

and ci. Of these, the Reynolds number of the basic flow and the wavelength λ =

2π/α can be taken as given. Therefore for every pair (α,Re) one may compute the eigenfunctions eψ and the complex eigenvalues c of the linear equation 2.1.3, and plot the neutral stability curve which satisfies ci = 0. This curve partition the plane

(α,Re) in a region where the flow is stable (for small Reynolds) and one where the flow is instead unstable.

In the case of a parallel boundary layer, the eigenfunctions of the eq. 2.1.3 are the Tollmien Schlichting waves, or T.S. waves. The minimal critical Reynolds number Rex = U xν is 91000 (Reδ = 520); the smallest wavelength λmin ≈ 6δ, thus the

T.S. waves are long compared to the boundary layer thickness; the maximum phase velocity cr is approximately 0.4U∞, hence the T.S. waves travel quite slowly. We

stress the fact that the critical Reynolds number predicted by this theory is not the point at which the turbulence arises. The transition Reynolds number Retr is

approximately 3 · 106, about 30 times further downstream.

An interesting result can be obtained if one considers the inviscid case, i.e. if one drops the terms which multiply Re−1. In this case, a theorem obtained by

(19)

Figure 2.1.: Local stability curve for the parallel boundary layer

has an inflection point. Since a laminar boundary layer has an inflection point only in the presence of an adverse pressure gradient, one may (wrongly) conclude that a boundary layer on a flat plate is always stable. Indeed, in this case the viscosity may (counter-intuitively) lead to the instability of the flow.

2.1.4. Algebraic Instability

The linear theory for the stability analysis introduced in the last section sometimes fails predicting a stable behavior for flows, which experiments show to be unstable. This is because the linear theory is valid only in the limit of infinitesimal pertur-bations, while finite perturbations often play a role in the transition phenomenon, especially due to a mechanism called receptivity which amplify the acoustic and tur-bulent perturbations. For instance, the theory applied to a pipe flow reveals that all the eigenvalues are stable and thus the only possible state is the stable one. Despite this consideration, Reynolds found that if the Reynolds number is greater than a certain threshold, transition is observed. Moreover, the exact value of the transi-tion Reynolds strongly depends on the external disturbances. For all these reason

(20)

experiments failed to show the T.S. waves until 1940.

From what we said it’s evident that there must be another instability growing mechanism which cannot be seen with the classical Orr–Sommerfeld formulation.

In fact, Ellingsen and Palm [10] and Landahl [14] identified such mechanism for the growth of perturbations. According to these studies, a longitudinal vortex su-perimposed to a two-dimensional boundary layer can lift up low-velocity fluid from the wall and push down high-velocity fluid towards the wall (liftup).

Since the boundary layer is elongated in the streamwise direction, with a typical length Re1/2 times greater than the boundary layer thickness, the disturbance

accu-mulated over the streamwise length can be Re1/2 times greater than the original one

([5]).

Several numerical analysis have been performed in order to understand the phe-nomenon of algebraic instability. The study conducted by Zuccher, Bottaro and Luchini ([5]) is the reference of this thesis’ work. They performed an optimal-perturbation nonlinear analysis of the boundary layer over a flat plate in order to find the “worst” possible spanwise periodic initial perturbation, superposed to a Blasius’ profile. That is they found the shape of the cross-flow vortices which generate the maximum gain, defined as the ratio between the perturbation kinetic energies at the final and initial time. While every previous published work is limited to a linearized analysis, this one works on the complete nonlinear boundary layer 3D equations.

(21)

2.2. Description of the experimental scenario

We now briefly describe the design of the experiments conducted at KTH (ref.[11]) for the study of the flow induced by the MVGs. In this experiment, the MVGs are miniature winglet-shaped elements with an height h = 1.3mm. They are disposed at a distance of 222mm from the leading edge, along the span-wise direction. The distance between each pair of MVGs is 10h, hence the semi-period is zp = 6.5mm.

This scenario is schematized in fig. 2.2.

Figure 2.2.: Representation of the flat plate with MVGs as used in the experiments The flow domain may be subdivided in several areas, as depicted in fig. 2.3.

• Upstream the MVGs and in the region around them the flow is substantially laminar. Nevertheless, the hypothesis behind the boundary layer equations are not verified, since the geometrical features in the vertical direction are of the same order of the boundary layer thickness, and the viscous stress in the stream-flow direction can not be neglected. Here the flow can only be simulated using a DNS.

• Sufficiently downstream post the MVGs the flow is still laminar, and in this area the BL equations are applicable.

(22)

• More downstream, transition begins. Here the steady BL equations are not applicable.

• Even more downstream there is the complete transition to turbulence.

h

x0 Laminar BL Transition to turb.

Figure 2.3.: Sketch (not to scale) of the plate with MVGs

At least 3 characteristic Reynolds numbers could be defined for this problem, and they will be used in this thesis:

ReL= U L/ν

Reδ= U δ/ν =

p ReL

Rex= U x/ν

Where δ is the following reference length.

δ= r νL U = r 1 ReL L (2.5)

We remind that in the Blasius BL we have δ∗

δ = 1.7209 and δ∗

θ = 1.328

2 , δ∗ and θ

being respectively the displacement and the momentum thickness.

Which is a multiple of the boundary layer thickness for the laminar flow (being δ99, δ∗ or θ).

(23)

2.3. Boundary layer equations in 3D

Conceptually, the idea behind the boundary-layer equations is to compute the order of magnitude of each term of the NS equations with respect to the formal parameter  = δ

L), which represents the nondimensional thickness of the boundary layer; then

the higher order terms in  are dropped. A compatibility boundary condition at the interface between the boundary layer and the external flow (y → ∞) is necessary. Since we are dealing with a flat plate, the outer (inviscid) solution at the first order is simply u = U , and p = cost. = 0.

In the case of a flat plate, at least two different sets of equations can be obtained, i.e. one may consider the features of the flow in the spanwise dimension as ≈ δ or as ≈ L. The second case is easier to deal with, and analog to the bidimensional case, since the y-momentum equations simply states ∂p∂y ≈ 0. In our case, since the MVGs are immersed in the BL, with spacing comparable to δ in the spanwise direction, the former formulation is the appropriate one.

The full incompressible stationary Navier-Stokes equations write as follows:    ∇ · u = 0 (u · ∇)u = −∇p ρ+ ν∇ 2u (2.6)

In order to obtain the 3-dimensional boundary layer equations, we identify the order (with respect to ) of every term in the eq. 2.6. We recall that the characteristic lengths in the cross-flow plane are of order , while the velocity components in this plane are of order U .

∂ ∂x = O 1  ∂y = O  −1 ∂z = O  −1 u= O 1 v = O  w= O  ν = O 2

(24)

∂u ∂x |{z} 1 + ∂v ∂y |{z} 1 + ∂w ∂z |{z} 1 = 0 u∂u ∂x |{z} 1 + v∂u ∂y |{z} 1 + w∂u ∂z | {z } 1 = −1 ρ ∂p ∂x + ν ∂2u ∂x2 | {z } 2 + ν∂ 2u ∂y2 | {z } 1 + ν∂ 2u ∂z2 | {z } 1 u∂v ∂x |{z}  + v∂v ∂y |{z}  + w∂v ∂z | {z }  = −1 ρ ∂p ∂y + ν ∂2v ∂x2 | {z } 3 + ν∂ 2v ∂y2 | {z }  + ν∂ 2v ∂z2 | {z }  u∂w ∂x | {z }  + v∂w ∂y | {z }  + w∂w ∂z | {z }  = −1 ρ ∂p ∂z + ν ∂2w ∂x2 | {z } 3 + ν∂ 2w ∂y2 | {z }  + ν∂ 2w ∂z2 | {z } 

Consider now the decomposition of p with respect to : p = p0+ p1+ p22+ O 3.

Hence: ∂p ∂y = ∂p0 ∂y |{z} −1 +∂p1 ∂y  | {z } 1 +∂p2 ∂y  2 | {z }  (2.7)

and similarly for the z-derivative. Since the terms which do not contain the pressure in the y and z momentum equations are O , we can conclude:

p0 = p0(x)

p1 = p1(x)

p2 = p2(x, y, z)

And since we are dealing with a flat-plate we can set both p0 and p1 to zero.

Neglecting high order terms in the 2.3 we obtain:                          ∂u ∂x + ∂v ∂y + ∂w ∂z = 0 u∂u ∂x + v ∂u ∂y + w ∂u ∂z = ν  ∂2u ∂y2 + ∂2u ∂z2  u∂v ∂x + v ∂v ∂y + w ∂v ∂z = − 1 ρ ∂p2 ∂y + ν  ∂2v ∂y2 + ∂2v ∂z2  u∂w ∂x + v ∂w ∂y + w ∂w ∂z = − 1 ρ ∂p2 ∂z + ν  ∂2w ∂y2 + ∂2w ∂z2  (2.8)

(25)

It is important to notice that the pressure here is the second-order term in the inner expansion of the pressure, i.e. p2 from eq. (2.7). Notice that:

1. The y and z momentum equations are coupled by the pressure terms.

2. The y and z momentum equations are important; unlike the bidimensional case, we can not simply replace them with ∂p∂y ≈ 0.

3. The viscosity term only acts on the plane perpendicular to the principal flow. 4. There are no second derivatives with respect to the x. Thus we can conclude

that - as in the bidimensional case - these equations are parabolic in the x-direction.

The main difference between these 3D equations and the well-known 2D equation is that the y-momentum balance does not collapse into:

∂p ∂y ≈ 0

2.3.1. Boundary Conditions

We now discuss the boundary conditions which shall be posed on the flat wall (y = 0), on the upstream section (x = x0) and on the inner-outer interface (y → ∞). As stated

before, we seek periodic solutions in the z-direction, we restrict our domain on the z-axis to a semi-period, z ∈ (0, zp).

• On the wall the usual no-slip condition is used, i.e. u = v = w = 0.

• On the upstream section (x = x0) one shall assign the u and one of (v, w), since

these are coupled (see eq.(2.9)). In general only two components of the velocity (u, v, w) can be freely assigned.

• On the outer interface(y → ∞) we set u = U , w = 0, and p = cost. = 0, as suggested in [5]5.

5Since the pressure appears only as a gradient, the exact value of the boundary condition for p in

(26)

2.3.2. Normalization of the flow variables

A convenient [5] adimensionalization of the 3-dimensional boundary layer equation is possible. The idea is to normalize the flow variables in the stream-flow direction using the plate length, and on the cross-flow plane via the boundary layer thickness δ6.                                e x= xL−1 e y= yδ−1 e z = zδ−1 e u= uU−1 e v = vL(U δ)−1 e w= wL(U δ)−1 e p= pρ−1U2δ2L−2

We will refer to this nondimensional quantities in the rest of this thesis, omitting the tilde.

This change of variables is very convenient for the following reasons: 1. u, v, w and p are all of the same order.

2. As one could expect considering the similarity properties of the original equa-tions7, the resulting equations are independent of the Reynolds number.

                         ∂u ∂x + ∂v ∂y + ∂w ∂z = 0 u∂u ∂x + v ∂u ∂y + w ∂u ∂z = ∂2u ∂y2 + ∂2u ∂z2 u∂v ∂x + v ∂v ∂y + w ∂v ∂z = − ∂p ∂y + ∂2v ∂y2 + ∂2v ∂z2 u∂w ∂x + v ∂w ∂y + w ∂w ∂z = − ∂p ∂z + ∂2w ∂y2 + ∂2w ∂z2

One may further notice that v and w are not independent, especially when con-sidered at the inlet boundary. Indeed, by replacing ∂u

∂x in the x-momentum equation

6δ= Re−1/2 L L

7Compare this adimensionalization with the one carried out in the study of the Blasius boundary

(27)

using the continuity equation on may obtain an equation without any derivative in the x direction: − u∂v ∂y − u ∂w ∂z + v ∂u ∂y + w ∂u ∂z = ∂2u ∂y2 + ∂2u ∂z2 (2.9)

For fixed u, this equation is linear in v and w, and represents a compatibility con-dition between these two variables. The initial concon-ditions must satisfy this equation, so a procedure to convert a generic input velocity field (v, w) - which may in principle not exactly satisfy the (2.9) - must be developed; this is further discussed in sec. 5.7.

(28)

3.1. Numerical formulation

In section 2.3 we observed that the most important feature of the boundary layer equations, in contrast with the full NS equations, is the parabolicity in the flow direction.

Roughly speaking, this means that what happens downstream does not influence the flow upstream, and the equations can be solved by space-marching methods.

This feature is very convenient for a numerical method, provided that we choose a numerical scheme that conserves this property; thus a full finite element discretization is not convenient, because the derived scheme will couple the nodes n + 1 and n − 1 in order to evaluate the first x-derivative, unless one chooses a particular set of base functions.

On the other hand we observed in sec. 2.3 that the diffusive term of the equations only acts on the plane orthogonal to the flow, and thus the equations are elliptic on this plane. An elliptic set of equations fits better in a finite element framework.

For these reasons, we need to treat separately the problem on the plane perpen-dicular to the flow from the problem in the flow direction. This kind of approach is often used in literature with time-dependent parabolic problems, and it is referred as method of lines 1.

In the follow sections we discuss both the discretization of the problem in a generic (y-z) plane and in the flow direction; in order to simplify the notation, we assume

∇ = ∂

∂yj+ ∂ ∂zk.

3.1.1. Discretization in the flow direction

Our objective is to obtain a numerical scheme which is both numerically stable and consistent with the equations2, and which can be solved cheaply.

1For a brief summary see [3], p. 241

(29)

Thanks to the method of lines, the problem in the stream-flow direction can be treated as a standard ODE problem, so in principle every possible ODE solver can be used (i.e. Runge Kutta, Adam-Bashforth, etc.). Moreover, every term in the equation can be treated using a different scheme, provided that the resulting full scheme is consistent.

We begin by noticing that, due to the presence of the nonlinear term, an explicit discretization is unlikely to be satisfying. This can be intuitively seen considering the following simplified problem:

u∂u

∂x = f (u, ∇u, ∇

2

u) (3.1)

Approaching the wall, u → 0 due to the no-slip condition. This means that f must approach zero too. An explicit scheme is equivalent to compute the derivative as ∂u

∂x = f

u, which is an indeterminate form when u approaches zero.

A wide broad of successful implicit schemes for parabolic problems exists in liter-ature (see [3] for a comprehensive list). We decide to avoid three-level schemes, i.e. those which link the solution on the node n + 1 with the nodes n and n − 1, due to the difficulties which arise in posing the initial conditions, and due to the difficulties related to the adjoint solver (see 5).

We firstly tested a semi-implicit discretization of the diffusive term: ∇2u(x + h 2) ≈ 1 2∇ 2 u(x + h) + 1 2∇ 2 u(x) (3.2)

which would be 4th order accurate if we collocate the rest of the equation on the midpoint between the node n and the node n − 1.

Unfortunately this scheme, if coupled with a full-implicit scheme for the convective (non linear) term, is not stable. It is then clear that, in order to get an higher order stable scheme, we need to use a Runge-Kutta or Adam-Bashforth scheme for the nonlinear part of the equations.

In our case we do not expect such schemes to compensate the increased computa-tional cost and complexity with the better accuracy, hence we opted for a straight-forward full implicit scheme which is first-order accurate in dx.

(30)

un∆u n dx = F1(u n , vn, wn) un∆v n dx = F2(u n, vn, wn, pn) un∆w n dx = F3(u n, vn, wn, pn) ∆un+ G(vn, wn) = 0 Where ∆(·)n = (·)n− (·)n−1 and F

i and G represents the remaining part of the

boundary layer equations.

Obviously, u0 is assigned. This initial condition must be compatible with the

boundary conditions defined in sec.2.3.1.

3.1.2. Discretization in (y-z) planes

We chose to use a finite-element method for the discretization of the equation in the planes orthogonal to the free-stream direction of the flow. In order to leave the possibility to do localized refinements of the spatial resolution, standard triangular Lagrangian elements will be used.

Meshing

In principle, the boundary conditions relative to the side of the rectangle open to the free-stream should be posed on y → ∞. Since this is not practically possible, we impose these conditions on an y = y+ sufficiently big. We can verify later that the

obtained solution is almost constant approaching y+. Notice that the appropriate

value of y+ is an increasing function of the maximum x for which we want to solve

the problem. We found that y+≈ 8 is satisfying in most of our test cases.

Let zp be the half period of the solution in the z direction, and Ω = [0, y+] ×

[0 × zp] be the 2-dimensional space where we seek our solution (i.e. the rectangle

perpendicular to the main flow direction at a given section).

Our mesh is a structured triangular grid, with nodes evenly spaced in the z-axis and distributed in an half-Chebyshev grid in the y-axis.

Let N be the number of nodes along the y-axis, then the y-coordinate of the i-th node (i = 0 . . . N − 1) is computed as:

(31)

yi =  1 − cos π 2 i N −1  y+

As seen in fig. 3.1, this distribution is such that the nodes are more concentrated near the wall, where we expect the solution to vary quickly.

Figure 3.1.: A rectangular mesh with 16 × 16 cells

Weak form of the problem

We need to define now the semi-linear form which represents the problem on the orthogonal-flow plane. Let now Ωh be a triangularization of Ω controlled by the

continuous parameter h (i.e. the grid spacing).

We now need to define the function spaces in which we seek the solution; we pick the velocity components in the set of the (piecewise) polynomials of order 2 defined over Ωh: unh ∈ P2, vhn ∈ P2, whn ∈ P2. In order to avoid spurious pressure modes,

which can produce an indeterminate system of equations, we pick pn ∈ P

1. From now

on we will always refer to the discretized solution, and thus we omit the subscript h. For compactness of notation, we introduce the quadri-vector Un = (un, pn), and

we denote with W the function space over which Un is defined, i.e. W = P

2× P2×

P2× P1.

Symmetrically, we pick the trial functions v and q respectively in the same function space as un

h and pnh, and we define the quadri-vector V = (v, q).

Now we have to define the semi-linear form F[un−1](Un; V ), (linear in V ). We

(32)

• The convective term (u · ∇)u is represented in the non-conservative form. Z Ωh (un· i)un− un−1 dx · v + (u n· ∇)un· v dydz

• As usually, we integrate by parts the diffusive term of the equations: − Z Ωh ∇2un· v dydz = Z ∇un: ∇v dydz

• The pressure term is straightforward: Z

Ωh

∇p · v dydz

• The divergence-free constraint: Z

Ωh

∇ · u q dydz

These integrals, when summed together and equated to zero, define the nonlinear weak problem:

F [un−1](Un, V) = 0, ∀V ∈ W, n = 1 . . . N (3.3) At each section n, we need to solve a nonlinear problem in un, pn, which depends on

the constant coefficients un−1; those coefficients are known either from the solution

at the previous step or from the initial conditions.

When plugging in the base representation of Un and V , the problem becomes a

classical (nonlinear) system where the unknowns are the DOFs of Un.

In order to describe the boundary conditions, which - for the present problem - are all Dirichlet’s conditions, we need to restrict the allowable Un in a proper subspace

of W. Formally this is done by choosing the appropriate subspaces of the test and trial spaces, but in practice we can replace the equation relative to a given border node with the boundary condition on that node. This is possible since the elements are Lagrangian (that is the DOFs of a function coincide with its nodal values).

Since the problem is nonlinear in multiple dimensions, the only possible way to solve it is to use the Newton’s method, which requires the Jacobian matrix of F,

(33)

that is 3 J = DF

DU This can be easily done since we have the analytic representation

of F.

The whole solution process can be summarized with the following algorithm: Algorithm 3.1 Forward solver algorithm

U0 ← initial condition for i = 1 . . . N do Ui ← Ui−1 Newton solver: repeat J ← DF [Ui−1] DU (Ui) Ui ← Ui− J · Ui

R = F[Ui−1](Ui)

until |R| < toll or |R||R|

prev <reltoll

end for

Figure 3.2.: Evolution of the solution (u component) on various sections

3 D

(34)

3.2. Implementation

3.2.1. Description of the Fenics toolkit

The solver is written using the Fenics4 toolkit. Fenics is an open source collection

of software for automated solution of PDEs. Its development started in 2003; a number of developers from research institutes from around the world contributed to the project since then.

It provides a collection of routines to define a finite element for a problem formu-lated in weak form, assemble system matrices, and a transparent interface to several well known high-performance parallel solvers for linear and eigenvalues problems, such as PETSc5, SLEPC6, Trilinos7, etc.

Fenics is made of several sub-packages. We will directly use only 2 of them (Dolfin and FFC), while the others (such as the optimizer Ferari and the form-assembler UFC) are used under the hood by the implementation.

The Fenics team defined a language called UFL, which stands for Unified Form Language, which is designed to express in convenient way the type of the finite element and the linear and nonlinear forms defined over it. Its semantic allows to construct even complex weak problems (which may involve even high-order tensors) in few expressive lines.

UFL is equipped with a comprehensive library of finite elements, like standard Lagrange elements or more special types (Discontinuous Galerkin and more).

Once our forms are written in the UFL language, the FFC compiler evaluates the forms, checks them for correctness, and generates a series of C++ classes which represent the element type, the function space and the form itself.

Those classes are needed by Dolfin, the core of the Fenics toolkit. It is a dynamic library written in C++ which exposes a large set of features to the user.

The most important classes provided by Dolfin are dolfin::FunctionSpace and dolfin::Form. The output of the FFC compiler is actually the definition of a number of classes derived from the these two.

A dolfin::FunctionSpace object is initialized with a dolfin::Mesh object in order to define the DOFs of a function in the function space and map each of these

4www.fenicsproject.org, see [15]

5Portable, Extensible Toolkit for Scientific Computation - http://www.mcs.anl.gov/petsc 6Scalable Library for Eigenvalue Problem Computations - http://www.grycap.upv.es/slepc 7http://trilinos.sandia.gov

(35)

DOFs to the relative mesh node. Notice that the base functions are Lagrange poly-nomials, and thus the DOF always coincide with the nodal value of the function.

This dolfin::FunctionSpace object can be used to instantiate a dolfin::Form object, which can assemble the form’s matrix or vector.

Once we construct a linear problem, Dolfin provides a clean interface to an under-lying solver (which can be PETSc, Epetra, etc.). One can choose the best solver for the given case from a large collection of sparse solvers. Dolfin also deals with parallel computations, automatically splitting the workload on several threads using the MPI interface.

The power of an high-level language like C++ (over, for example, Fortran) is its abstraction: we can work with function spaces instead of a bunch of adjacency matri-ces and location vectors; with functions instead of DOFs vectors, etc. This allows the user to work with generic functions defined directly in C++, and seamlessly use them as dolfin::Functions defined over a specific function space (this operation involves a projection-method via quadrature integrals under the hood). We used extensively this functionality in this project, in order to convert the Matlab representation, (in which the function is represented by its values on an evenly spaced cartesian grid), to the FEM representation.

3.2.2. Structure and algorithms

The C++ implementation of the solver consists of the following classes:

• Context defines the computational domain, the mesh, and the function space. Using the routines provided by Dolfin we can match different section of the boundary with the relative nodes on the mesh, in order to properly impose the boundary conditions.

• DirectProblem solve the nonlinear problem using a newton solver and taking the initial condition as input; outputting the computed solution ui i= 1 . . . N

• TargetGradient is an interface class which exposes one method to compute the value of the objective function given a solution ui i = 1 . . . N , and one

method which computes the gradient of this function with respect to the whole domain field.

• AdjointProblem takes as input the solution computed from the DirectProblem and an object of type TargetGradient, solve the adjoint problem and outputs

(36)

the gradient of the target function with respect to the initial conditions. In order to test the solver we also wrote two small classes which allows us to read the initial conditions from an input Matlab (.mat) file, and to write the computed solution back to Matlab in order to post-process it.

The whole process can be resumed in a number of steps:

1. Read the input (.mat) file, convert the input values in the working normaliza-tion (based on the input Reynolds number).

2. Compute the initial condition function by projecting the field defined by linearly interpolating the input grid values on the function space W.

3. Given an user-selected dx, solve the nonlinear problems (3.3) up to the last section of the computational domain.

4. Convert back the solution ui to the original normalization, and output a .mat

file.

The factorization of the Jacobian (that is, the solution of a linear problem for each Newton’s iteration) is computed by using the parallel LU solver provided by PETSc. We tested also the PETSc GMRES solver, coupled with an Algebraic Multigrid preconditioner, but since the Jacobian matrix is - in the general case - not well conditioned, LU performs definitely better even with large matrices8

In tab. 3.1 we report the parameters used for the linear solver. In typical problems (≈ 3000 DOF), in average the Newton solver converges to the desired tolerance in 5 steps.

Absolute tolerance 1e-10

Maximum iterations 10

Relative tolerance 1e-6

Table 3.1.: Parameters of the newton solver

8A typical Jacobian matrix for a problem with 64 × 64 elements ha the size 3000x3000 and it is

(37)

In order to validate the developed BL code, we performed some tests comparing the obtained results with both the Blasius’ boundary layer solution and the results of the Direct Numeric Simulation from [2] as a reference.

4.1. Validation against Blasius solution

The Blasius’ semi-analytical solution for the boundary layer has been obtained in sec. 2.1.1; it applies to the boundary layer over a flat plate with uniform (U = 1) initial condition. The solution is singular at the leading edge, due to the conflict between the initial condition and the no-slip condition at the wall. In order to work around this singularity, we start the simulation slightly on the after the leading edge (say x= 0.05), even if our code seems to perform quite well even in the singular case.

We run the solver with a Blasius profile as the input on the initial section, and we compute the r.m.s. error over the whole field with respect to the analytical solution (see 2.1.1).

Fig. 4.1 shows that we achieved the desired O(dx) convergence rate in this case. Notice that in this case we measure the error in the normalization introduced in sec. 2.3.2, so u and v are of the same order. This ensures that we achieved a good accuracy with both the components of the velocity. These simulations have been performed with ny = 64 and nz = 4 (but since the flow is two-dimensional the

(38)

101 102 10−3 10−2 10−1 dx−1 k e k

Figure 4.1.: R.m.s. error with respect to Blasius solution vs the spatial discretization step

(39)

4.2. Validation against DNS

Since the Blasius’ solution is two-dimensional, a further validation for a 3D case is necessary. Unfortunately there are no known analytical tridimensional solutions of the boundary layer equations, hence we used the results of the DNS simulation conducted by Camarri ([2]); the principal parameters of this DNS are reported in tab.4.1.

Since the boundary-layer equations are not valid near the vortex-generators, we can not expect our solution to approach the DNS simulation near the MVGs; hence we start the simulation sufficiently downstream past the MVGs, simulate the flow between x1 = 0.3L and x2 = 0.6L, (xh = 0.24L being the location of the streak

generators), using the DNS itself for the initial conditions at x = x1. Moreover,

caution must be taken when comparing the DNS and the boundary-layer equation when x approaches x2 , due to the effect of the boundary conditions at x = x2

imposed in the DNS which are not required by the boundary layer equations. The validation is achieved through the following steps:

1. Direct comparison of the r.m.s. error between the two simulations, although this is not supposed to converge to zero, due to the different equations being solved.

2. Comparison of the streak intensity function and other cross-flow integral pa-rameters.

3. Qualitative comparison of the two resulting flows. Uref 7.7m/s

L 897mm

xh 222mm

h1 1.3mm

ReL 473075

Table 4.1.: Parameters of the DNS from [2]

4.2.1. Direct error comparison

We use 4 runs to validate the solver. The error is the r.m.s. norm between the differences of the two velocity fields in the DNS normalization (i.e., all lengths are

(40)

scaled with h).

Figure 4.2 shows that, as one could expect, the r.m.s. error approach a non-zero (but very small) value in the limit dx → 0, specifically e ∼ 0.3210−3.

Nx× Ny dx N x1

0 192 × 192 0.00064 11621688 0.4

1 128 × 128 0.001 3311559 0.4

2 64 × 64 0.004 207025 0.4

3 32 × 32 0.008 26136 0.4

Table 4.2.: Parameters of the validation tests.

Although the numeric value of the error is quite small (10−3 while the order of the

(41)

104 105 106 107 108

10−3.4

10−3.3

N

E

Figure 4.2.: R.m.s. error of the validation tests in the DNS normalization vs the total number of DOFs (see 4.2)

104 105 106 107 108

10−1.5

10−1.4

N

En

Figure 4.3.: R.m.s. error of the validation tests in the BL solver normalization (that is, the spanwise velocities are of the same order of the stream-flow veloc-ity) vs the total number of DOFs (see 4.2)

(42)

4.2.2. Comparison of integral parameters

In order to retrieve further confirmation of the correctness of this implementation, we compare some integral parameters of the flow with the results from DNS.

Two parameters have been proposed in literature to quantify the streak intensity, with obvious meanings:

the maximum streak intensity Smax(x) = 1 2maxy h max z U(x, y, z) − minz U(x, y, z) i (4.1) and the streak intensity integral

Sint(x) = 1 Lzδ(x) Z 9δ(x) 0 Z Lz 0 |U (x, y, z) − U (x, y)| dzdy (4.2) It is quite evident that the former is highly dependent on the refinement of the grid, or on the granularity of the experimental data, hence the second one is a better choice for our validation.

Figures 4.4 and 4.5 show a very good agreement with the DNS on these parameters.

300 350 400 0.22 0.23 0.24 0.25 x S DNS BL

Figure 4.4.: Sint from the DNS (blue) and from BL equations (red)

Another good integral parameter, which involves derivatives, is the enstrophy at a given x-section.

(43)

300 350 400 0.14 0.16 0.18 0.2 x S DNS BL

Figure 4.5.: Smax from the DNS (blue) and from BL equations (red)

ψ(x) = Z Ω |ω(x)|2dS ≈ Z Ω  ∂u ∂y 2 + ∂u ∂z 2 dS (4.3)

Fig. 4.6 shows perfect agreement between the DNS solution and the BL solution.

0.3 0.4 0.5 0.6 0 1,000 2,000 3,000 4,000 5,000 x omega2 DNS BL

(44)

4.2.3. Qualitative comparison

We computed the surface streamlines at x = 0.571L in order to understand qualita-tively the differences between the DNS solution and the BL one. These streamlines have been computed using a Runge-Kutta 4 integrator, using the software Paraview. It must be noticed that the process of computing the streamlines is particularly sen-sitive to the exact method and starting point used, and that the displacement error on the streamline is one order of magnitude greater than the error on the velocity fields. In fig. 4.7 it is evident the presence of the axial vortex generated by the MVGs. Even if the shape and the center of the vortex are not perfectly matched, we are satisfied of this results for the reasons stated before. Also recall that the two results have been obtained with two different sets of governing equations (namely the NS and the BL equations), which are not exactly equivalent.

(a) (b)

Figure 4.7.: Surface streamlines from the DNS (a), and from the BL solver (b), at x= 0.571L

(45)

In fig. 4.8 we show the contour plots of the U at x = 0.571L, which allow a clear visualization of the velocity streaks.

(a) (b)

Figure 4.8.: U contour plot from the DNS (a), and from the BL solver (b), at x = 0.571L

(46)

Furthermore, we computed the error between our solver and the DNS starting our solver at different x1, keeping the same final section x2. Fig. 4.9 shows these results;

we can notice that, except for the case where we start the simulation very close to the MVGs, there are no substantial differences.

101 102 103 10−1.5 10−1 dx−1 k e k (a) 101 102 103 10−1.5 10−1 dx−1 k e k (b) 101 102 103 10−1.5 10−1 dx−1 k e k (c)

Figure 4.9.: Error with respect to DNS for x1 = 0.27L (a), x1 = 0.4L (b) and x1 =

(47)

5.1. The task of the Adjoint Solver

The task we are faced is to compute the gradient - or, more properly, the first variation - of any differentiable functional defined on the whole flow domain with respect to the initial conditions. The PDE system of sec. 2.3.2 can be seen as a function which, given an initial field u(x0, y, z), v(x0, y, z), w(x0, y, z) defined on a given cross-flow

plane, produces a field u(x, y, z), v(x, y, z), w(x, y, z) which satisfies both the initial conditions and the PDE. Let J be our target function, that is a scalar function which depends on the whole flow domain; obviously one can construct a function eJ which depends only on the initial conditions by solving the PDE problem for u, v, w and then use this solution to compute the value of J.

J = J[u(x, y, z), v(x, y, z), w(x, y, z)] = eJ[u(x0, y, z), v(x0, y, z), w(x0, y, z)]

The Jacobian of eJ is a linear application of the perturbation field δu = (δu, δv, δw) defined as:

δ eJ[δu, δv, δw] = lim

→0

e

J[u(x0, y, z) + δu(x0, y, z)] − eJ[u(x0, y, z)]

 (5.1)

Which obviously depend on the specific velocity field u(x0, y, z). The former

equa-tion is usually more compactly written as:

δ eJ = δ eJ δuδu= δ eJ δuδu+ δ eJ δvδv+ δ eJ δwδw

A first attempt to numerically compute δ eJ can be schematized as follow: 1. Compute eJ[u(x0, y, z)] by solving the PDE problem and evaluating J.

(48)

3. Pick a small  and compute eJ[u + δu] by solving again the PDE problem and evaluating J.

4. Apply the definition (5.1).

5. Repeat for every possible linearly independent perturbation functions δu. This approach has two major flaws:

1. It is very expensive, since one has to solve many PDE problems.

2. Approximating the limit with a small  is numerically unpractical, since the floating-point division between two small numbers usually produce a large error. Fortunately, the scope of PDE-constrained optimization is very broad, and hence mathematical tools way better than the one just described have been developed. The idea here is to apply the very same approach used in the minimization of function of multiple variables with constraints, that is to compute the gradient of a modified functional which contains the Lagrange multipliers. In this chapter we will briefly describe the theory behind the adjoint solver and its numerical implementation.

(49)

5.2. Brief introduction to Calculus of Variations

In order to fully understand the adjoint solver we briefly introduce the topic of calculus of variations. The reader familiar with the topic may want to skip this section.

It is beyond the scope of this thesis to go into the details of this topic, hence we avoid the proper mathematical formalism. The reader should get the “idea” of CoV from this section, but is advised to refer to any Calculus book for a more detailed description; most of this section is inspired by ref.[16].

Let U be a metrical function space, and J : U → R a functional defined over such function space. CoV deals with the problem of finding the minimum (or the maximum) of J, that is:

J[eu] ≤ J[u] ∀u ∈ U

Notice that the u might be defined over any arbitrary space, but we often deal with functions of real vector values:

u: Ω → Rm, Ω ⊆ Rn

In typical problems J is expressed as the integral over the whole space Ω of a given scalar function f :

J[u] = Z

f(x, u, u0,u00, . . . ,u(n))dΩ (5.2)

However the approach described in this section can be applied to any definition of J. The main idea is to extend the common tools used when dealing with multi-variable functions (gradient, Hessian, etc.) to functionals, that is to function of a (continuous) infinite number of variables.

5.2.1. First and second variation

For a fixed u, the first variation of J is defined as linear functional: δJ[δu] = lim

t→0

J[u + tδu] − J[u]

t (5.3)

The analogy with the gradient of a scalar function is obvious. It is also trivial to prove that, as in multi-variable calculus, the functions u that satisfy

(50)

δJ(u)[δu] = 0 , ∀δu ∈ U

are the extremum functions, that is the possible candidates for a minimum or a maximum of the functional. Again, in order to determine the nature of the extremum function, one should look at the second variation:

δ2J[δu, δv] = lim

t→0

δJ(u)[δu + tδv] − J(u)[δu]

t (5.4)

Which is the analogous of the Hessian. For example a function u is a local minimum for J iff δ2J[δv, δv] > 0 , ∀δv 6= 0. It’s convenient to notice that one can work with

the operator δ as if it is a standard-derivative. That means that the usual rules for derivative of composite functions, product of functions, etc. apply to the variation operator δ.

In most problems, we seek for an u which satisfies some assigned boundary condi-tions. We can implicitly consider such boundary conditions by restricting the search-ing space U to the space Ub of the functions which satisfies such boundary conditions.

It is easy to see that, since u + δu must lay into Ub, δu is inside the subspace of U of

the functions which satisfy the same but homogeneous boundary conditions.

5.2.2. Fundamental Lemma

A well-known lemma is extremely useful when dealing with functionals of the form (5.2). Let f (x) and h(x) be two continuous functions defined over a space Ω, and let h be null on ∂Ω, then:

Z

f(x)h(x)dΩ = 0 ∀h ∈ U ⇔ f (x) = 0 ∀x ∈ Ω (5.5)

The left arrow is obvious. For the right arrow one may consider only those h(x) such that f h ≥ 0, hence from the theorem of the monotonicity of the integral follows the (5.5). The extension of this lemma to the functions f which are not continuous, but just locally integrable, is called Du-Bois Reymond lemma.

The importance of this result will be clear in the following practical example

5.2.3. A practical example

(51)

J[u] = 1 2

Z

| ~∇u|2dΩ

Subject to the boundary conditions u = f on ∂Ω Integrating by parts, one can obtain:

δJ = Z Ω ~ ∇u · ~∇δu dΩ = − Z Ω ∇2uδu dΩ + Z ∂Ω ~ ∇u · ~nδu dS

From what we said in the last section δu = 0 on ∂Ω, hence we can apply the lemma (5.5) to the first integral, by assuming f = ∇2u and h = δu:

∇2u= 0

Since the functional (5.2.3) is obviously convex, the u which satisfies the condition δJ = 0 is obviously a minimum for J. The u which minimize the functional J is the unique solution of the Laplace’s problem (5.2.3) with the given Dirichlet’s boundary conditions.

5.2.4. Notes on classic applications of CoV

From the example of the previous section it should be obvious that any well-posed problem regarding the minimization of a functional of the form (5.2) leads to an ODE or a PDE (or a system of ODE/PDE). One can also think the other way around: some famous ODE or PDE systems can be derived from the problem of minimization of a functional. The Hamilton’s principle for example is a convenient way to obtain the Lagrange equation for the motion of a mechanical system. The principle of the minimum of the potential energy in a mechanical structure can be used to derive the stress-equilibrium equations. Often it’s easier to find an approximate solution to the minimum problem than solving the PDE which derives from such problem. This approach is often used in the softwares for the calculation of the stress field inside a loaded elastic body (Rayleigh-Ritz method). Unfortunately, it is not always possible to reduce a given PDE weak problem to the problem of minimization of a functional J. A well-known theorem ensures that this is always possible if the operator which represent the weak problem is symmetrical, which is not the case of the BL or NS equations.

(52)

5.3. Continuous and Discrete Adjoint Methods

5.3.1. The constrained optimization problem

In the last section we briefly described the procedure to solve an optimum problem defined over a functional. This is the continuum equivalent of the multi-variable problem of optimization of a given target function.

Nonetheless, in many practical applications one is concerned with optimum con-strained problem. In a finite number of variable framework this means that the variables are constrained by a system of, potentially nonlinear, equations. This is a well studied problem in every calculus class, and the solution make use of the La-grange multipliers, and the resulting method is commonly referred as Adjoint Method (see [7]).

Formally, one can write:

(min J[u, φ]

subject to Li[u, φ] = 0, i = 1 . . . N

Where J is the cost function, Liare the governing equations, u is the state variable

and φ is the design variable.

As in the finite-dimensional case, one can write an extended functional defined as: Π[u, φ, λi] = J +

X

i

< λi, Li >

Where < ·, · > is a suitable scalar product defined over the functional space, for example the integral of the product over the whole domain. We can now find the stationary points of this functional:

δΠ = δJ δuδu+ δJ δφδφ+ +X i < λi, δLi δu δu >+ X i < λi, δLi δφδφ >+ X i < δλi, Li >= 0

(53)

               δJ δu + X i λi δLi δu = 0 δJ δφ + X i λi δLi δφ = 0 Li = 0 (5.6)

Which, when solved, determines the φ and the corresponding u which are minimum (or maximum) for the functional J. We stress that the eqn. (5.6) are a set of PDE (or ODE) which are valid in every point of the working domain. The equations in the system (5.6) are the adjoint equations, and are alwayslinear no matter what the Li or the J are.

5.3.2. A practical example

We now introduce a simple linear example of ODE-constrained optimization; suppose that we want to control a second order system with a certain input f

d2u

dt2 = −ω

2u+ f (t)

With initial conditions

   u(0) = 0 du dt(0) = 0 (5.7) In such a way that:

   u(π) = 1 du dt(π) = 0 (5.8) And we wish to as little input as possible:

min J = Z π

0

f2dt Then we can write the extended functional:

Π = Z π 0 f2dt+ Z π 0 λ(t) d 2u dt2 + ω 2 u − f(t)  dt

And we consider that the domain of Π contains only the functions u which satisfy the conditions (5.7) and (5.8). We compute the first variation:

Figura

Table 2.1.: Common quantities of the Blasius solution expressed in term of stream function
Figure 2.1.: Local stability curve for the parallel boundary layer
Figure 2.2.: Representation of the flat plate with MVGs as used in the experiments
Figure 2.3.: Sketch (not to scale) of the plate with MVGs
+7

Riferimenti

Documenti correlati

In fact the beamformer and RAP-MUSIC perform the analysis within a computational time which is in- dependent of the length of the time series (while it depends on the number of

It is clear that a point e of the set X is an equilibrium of the dynamical system if and only if it is a strongly maximal point of X with respect to the preorder induced by the

It follows from this that the contact structure θ H of the thermodynamical phase space is the typical representative of the Aut(H n )-conjugacy class of right invariant contact

We allow for discontinuous coefficients and random initial condition and, under suitable assumptions, we prove that in the limit as the number of particles grows to infinity

Heteropolymer, Semiflexible Chain, Disorder, Persistence Length, Large Scale Limit, Tensor Analysis, Non-Commutative Fourier

(2002) - Large-scale gravity-driven structures: control on margin architecture and related deposits of a Cretaceous Carbonate Platform (Montagna della Maiella, Central

We will relate the transmission matrix introduced earlier for conductance and shot noise to a new concept: the Green’s function of the system.. The Green’s functions represent the

(1) Laboratoire des Sciences du Climat et de l’Environnement, UMR8212, CEA-CNRS-UVSQ/IPSL, Gif-sur-Yvette, France (hanschr@gfy.ku.dk), (2) Cooperative Institute for Research