computational fluid dynamics - university of notre...

13
Computational Fluid Dynamics Computational Fluid Dynamics http://www.nd.edu/~gtryggva/CFD-Course/ Grétar Tryggvason Lecture 21 April 5, 2017 Computational Fluid Dynamics We can expect that the development of numerical methods for computing fluid flow will continue and we will see methods that are More accurate More robust More versatile than current methods. We are also seeing new trends and a shift in emphasize to topics that in the past were on the sidelines. Computational Fluid Dynamics New Directions for Computational Physics: Computational predictivity Multiscale/multiphysics Integrated simulations of complex systems Computational Fluid Dynamics Section 605 of the America COMPETES Reauthorization Act of 2010 [2] is titled Promoting use of high-end computing simulation and modeling by small and medium sized manufactures, and states that Congress finds that: (1) the utilization of high-end computing simulation and modeling by large-scale government contractors and Federal research entities has resulted in substantial improvements in the development of advanced manufacturing technologies; and (2) such simulation and modeling would also benefit small- and medium-sized manufacturers in the United States if such manufacturers were to deploy such simulation and modeling throughout their manufacturing chains. Ensuring American Leadership in Advanced Manufacturing” by the President’s Council of Advisors on Science and Technology (PCAST) and the President’s Innovation and Technology Advisory Committee (PITAC) states that “powerful computational tools and resources for modeling and simulation could allow many U.S. manufacturing firms to improve their processes, design, and fabrication.” H. R. 5116 One Hundred Eleventh Congress of the United States of America AT THE SECOND SESSION Begun and held at the City of Washington on Tuesday, the fifth day of January, two thousand and ten An Act (a) ST.—this Act may be cited as the ‘‘America COM- PETES Reauthorization Act of 2010’’ or the ‘‘America Creating Opportunities to Meaningfully Promote Excellence in Technology, Education, and Science Reauthorization Act of 2010’’. (b) TC.—The table of contents for this Act is as follows: Computational Fluid Dynamics February 2012 Cyberinfrastructure for 21st Century Science and Engineering Advanced Computing Infrastructure Vision and Strategic Plan 1 iii h h y y u u z z m m i i y y w w z z T Ti i l l z z y y ¡ ¡ l l z z z z t YWW] Reports on the future of simulations Computational Fluid Dynamics https://www.youtube.com/watch?v=TGSRvV9u32M HPC Video

Upload: buithien

Post on 10-Apr-2018

223 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

Computational Fluid Dynamics

http://www.nd.edu/~gtryggva/CFD-Course/

Grétar Tryggvason

Lecture 21April 5, 2017

Computational Fluid Dynamics

We can expect that the development of numerical methods for computing fluid flow will continue and we will see methods that are

•  More accurate•  More robust•  More versatile

than current methods.

We are also seeing new trends and a shift in emphasize to topics that in the past were on the sidelines.

Computational Fluid Dynamics

New Directions for Computational Physics:

Computational predictivity 

Multiscale/multiphysics Integrated simulations of complex systems

Computational Fluid Dynamics

Section 605 of the America COMPETES Reauthorization Act of 2010 [2] is titled Promoting use of high-end computing simulation and modeling by small and medium sized manufactures, and states that Congress finds that:

(1) the utilization of high-end computing simulation and modeling by large-scale government contractors and Federal research entities has resulted in substantial improvements in the development of advanced manufacturing technologies; and

(2) such simulation and modeling would also benefit small- and medium-sized manufacturers in the United States if such manufacturers were to deploy such simulation and modeling throughout their manufacturing chains.

Ensuring American Leadership in Advanced Manufacturing” by the President’s Council of Advisors on Science and Technology (PCAST) and the President’s Innovation and Technology Advisory Committee (PITAC) states that “powerful computational tools and resources for modeling and simulation could allow many U.S. manufacturing firms to improve their processes, design, and fabrication.”

H. R. 5116

One Hundred Eleventh Congress of the

United States of America AT THE SECOND SESSION

Begun and held at the City of Washington on Tuesday, the fifth day of January, two thousand and ten

An Act To invest in innovation through research and development, to improve the competi-

tiveness of the United States, and for other purposes.

SECTION 1. SHORT TITLE; TABLE OF CONTENTS.

(a) SHORT TITLE.—this Act may be cited as the ‘‘America COM-PETES Reauthorization Act of 2010’’ or the ‘‘America Creating Opportunities to Meaningfully Promote Excellence in Technology, Education, and Science Reauthorization Act of 2010’’.

(b) TABLE OF CONTENTS.—The table of contents for this Act is as follows:

Sec. 1. Short title; table of contents. Sec. 2. Definitions. Sec. 3. Budgetary impact statement.

TITLE I—OFFICE OF SCIENCE AND TECHNOLOGY POLICY

Sec. 101. Coordination of Federal STEM education. Sec. 102. Coordination of advanced manufacturing research and development. Sec. 103. Interagency public access committee. Sec. 104. Federal scientific collections. Sec. 105. Prize competitions.

TITLE II—NATIONAL AERONAUTICS AND SPACE ADMINISTRATION

Sec. 201. NASA’s contribution to innovation and competitiveness. Sec. 202. NASA’s contribution to education. Sec. 203. Assessment of impediments to space science and engineering workforce

development for minority and under-represented groups at NASA. Sec. 204. International Space Station’s contribution to national competitiveness en-

hancement. Sec. 205. Study of potential commercial orbital platform program impact on

Science, Technology, Engineering, and Mathematics. Sec. 206. Definitions.

TITLE III—NATIONAL OCEANIC AND ATMOSPHERIC ADMINISTRATION

Sec. 301. Oceanic and atmospheric research and development program. Sec. 302. Oceanic and atmospheric science education programs. Sec. 303. Workforce study.

TITLE IV—NATIONAL INSTITUTE OF STANDARDS AND TECHNOLOGY

Sec. 401. Short title. Sec. 402. Authorization of appropriations. Sec. 403. Under Secretary of Commerce for Standards and Technology. Sec. 404. Manufacturing Extension Partnership. Sec. 405. Emergency communication and tracking technologies research initiative. Sec. 406. Broadening participation. Sec. 407. NIST Fellowships. Sec. 408. Green manufacturing and construction. Sec. 409. Definitions.

Computational Fluid Dynamics

February 2012

Cyberinfrastructure for 21st Century Science and Engineering

Advanced Computing Infrastructure Vision and Strategic Plan

1 iii

hhGGyy����������GG����GG������GGuu��������������GGzz������������GGmm������������������GG

ii������GGyy����������GGww��������GG����GG

zz������������������TTii��������GGll��������������������GGzz������������GG

yy��������������������¡¡������GGll��������������������GGzz������������GG

��������������GGzz������������������GG

t� GYWW]G

Reports on the future of simulations

Computational Fluid Dynamics

https://www.youtube.com/watch?v=TGSRvV9u32M

HPC Video

Page 2: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

Validation & Verification

Uncertainty Quantification

Computational Fluid Dynamics

Demonstrating that a numerical solution is correct is a standard expectation of ALL numerical predictions. At the most elementary level this is done by grid refinement

The general expectation is that the grid is changed by a factor of 2 and the solution shown for three grids. If this is impractical, a grid refinement can be done on a smaller problem with comparable physical parameters

A new code is generally expected to go through more extensive studies, ideally converging to an exact solution at the expected rate

Computational Fluid Dynamics

In early work, a comparison of numerical results with experimental results was used to demonstrate the correctness of a code (this is still done by inexperienced investigators)

It has, however, been understood for some time that the issue is more involved and we need to distinguish between the mathematical model of a physical process and the numerical solution of the mathematical model.

More precisely………

Computational Fluid Dynamics

To accurately predict the behavior of a system computationally, we need:

A correct and accurate code. The code correctness is demonstrated by Verification

An model that accurately describes the process under study: The accuracy of the model is established by Validation

A set of input parameters whose accuracy and reliability is known. Assessing the accuracy of the results is done by Uncertainty Quantification

Computational Fluid Dynamics

From: Schlesinger, S. Terminology for Model Credibility, Simulation, Vol. 32, No. 3, 1979; 103-104. Cited in W. L. Oberkampf and T.G. Trucano. Verification and Validation in Computational Fluid Dynamics. SANDIA REPORT SAND2002-0529 (2002)

Computational Fluid Dynamics

Verification

Page 3: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

Verification: Show that the code solves the equations that it is intended to solve with the expected accuracy. Verification consists of Code Verification (which can be done once and for all) and Solution Verification which must be done for all new problems.

The key tool to verify a code and solution correctness is grid refinement.

Computational Fluid Dynamics

Code Verification is independent of any physical reality. The goal is simply to show that the code correctly solves the equations that it is intended to solve. If an exact solution is available, then it can be used. If not, the Method of Manufactured Solutions (MMS) can be used.

Computational Fluid Dynamics

From:AIAA.GuidefortheVerificationandValidationofComputationalFluidDynamics Simulations, American Institute of Aeronautics and Astronautics, AIAA-G-077-1998, Reston, VA, 1998. Cited in W. L. Oberkampf and T.G. Trucano. Verification and Validation in Computational Fluid Dynamics. SANDIA REPORT SAND2002-0529 (2002)

Computational Fluid Dynamics

Method of Manufactured Solutions

Computational Fluid Dynamics

The basic idea is to add a source term to the equations that force the solution to take a given value. Suppose we have:

L(u) = 0Taking

u = qobviously does not satisfy this equation. However if we add a source to the RHS, given by

g = L(q)

L(u) = gThen is a solution to u = q

Computational Fluid Dynamics

Or, said a little differently, we write

L(q)− L(q) = 0Which obviously is true for any q. The solution to

u = qis obviously

g = L(q) L(u) = g

Or, is the exact solution to

L(u) = L(q)

u = q

where

Page 4: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

Thus, the Method of Manufactured Solutions consists of

1.  Picking a function q2.  Computing the source term3.  Solving the original equation with the new source

term

Notice that there is no requirement that the function q satisfies the equations or that it has any physical meaning.

Computational Fluid Dynamics

Trivial Example:

d 2udx2 = 0; 0 < x < 1; u(0) = 1; u(1) = 0;

q = 1− x2;

dqdx

= −2x;d 2qdx2 = −2; ⇒ g = −2

The solution is given by: u = 1− x

Take:

Solve:

d 2udx2 = −2;

dudx

= −2x + C1; u = −x2 + C1x + C2

C1 = 0; C2 = 1; ⇒ u = 1− x2 As we intended!

Computational Fluid Dynamics

For a more “real” example consider

∂f∂t+ f

∂f∂x

= D∂2 f∂x2

q = A+ sin(x + Ct)

With the manufactured solution:

First we rewrite our equation as:

L( f ) =

∂f∂t+ f

∂f∂x

− D∂2 f∂x2 = 0

So our source is

g =

∂q∂t+ q

∂q∂x

− D∂2q∂x2

Computational Fluid Dynamics

q = A+ sin(x + Ct)

∂q∂t

= C cos(x + Ct);∂q∂x

= cos(x + Ct);∂2q∂x2

= − sin(x + Ct);

Our manufactured solution is

We have

So the source term is

g = C cos(x + Ct) + A+ sin(x + Ct)( )cos(x + Ct) + sin(x + Ct);

From: P. J. Roache. Fundamental of Verification and Validation. Hermosa, 2009

Computational Fluid Dynamics

f = A+ sin(x + Ct)Therefore,

Is an EXACT solution to

∂f∂t+ f

∂f∂x

= D∂2 f∂x2

+ g

g = C cos(x + Ct) + A+ sin(x + Ct)( )cos(x + Ct) + Dsin(x + Ct);

Computational Fluid Dynamics

% Method of Manufactured Solution for the 1D Burgers equation%------------------------------------------------------------n=61; nstep=2000; length=2*pi;h=length/(n-1);diff=0.05;dt=1.0/nstep

f=zeros(n,1); y=zeros(n,1); ex=zeros(n,1); time=0.0; for i=1:n; x(i)=h*(i-1);endA=1.0; C=1.0; for i=1:n, f(i)=A+sin(x(i)); end; %initial conditions

for m=1:nstep+1,m for i=1:n, ex(i)=A+sin(x(i)+C*time); end; %exact solution hold off;plot(f,'linewidt',6); axis([1 n -1.0, 3.0]); % plot solution hold on;plot(ex,'r','linewidt',2); %pause; % plot exact solution err=0.0;for i=1:n, err=err+h*(ex(i)-f(i))^2; end;err=sqrt(err) y=f; % store the solution for i=2:n-1, g=C*cos(x(i)+C*time)+(A+sin(x(i)+C*time))*cos(x(i)+C*time)+diff*sin(x(i)+C*time); f(i)=y(i)-0.5*(dt/h)*y(i)*(y(i+1)-y(i-1))+...

diff*(dt/h^2)*(y(i+1)-2*y(i)+y(i-1))+dt*g; % advect by centered differences end; g=C*cos(x(n)+C*time)+(A+sin(x(n)+C*time))*cos(x(n)+C*time)+diff*sin(x(n)+C*time); f(n)=y(n)-0.5*(dt/h)*y(n)*(y(2)-y(n-1))+diff*(dt/h^2)*(y(2)-2*y(n)+y(n-1))+dt*g; % do endpoints f(1)=f(n); % for periodic time=time+dt % boundariesend;

Page 5: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

2

1Solution at time 1

The error versus grid spacing

Computational Fluid Dynamics

Error in boundary conditions destroys second order convergence!

The manufactured solution is used in code verification exactly as we would use an exact solution to the original equations. If we do not, for example, get the expected convergence rate, then there must be an error somewhere

Correct second order convergence 2

1

h

Computational Fluid Dynamics

∂f∂t+ f

∂f∂x

= D∂2 f∂x2

q = ex sin t( )

g = ex cos t( ) + ex sin t( )( )2

− Dex sin t( )

The manufactured solution can be selected in many different ways. We could, for example, pick:

From: P. J. Roache. Fundamental of Verification and Validation. Hermosa, 2009

Which gives us the source

For the Burger’s equation

Computational Fluid Dynamics

1. Manufactured solutions should be smooth analytic functions like polynomials, trigonometric, or exponential functions so that the solution is conveniently computed.

2. The solution should exercise every term in the equations3. The solution should have sufficient number of derivatives4. The derivatives should be bounded by small constants5. The solution should not prevent the code from running to

completion6. The solution should be defined on a connected subset of two-

or three-dimensional space7. The solution should be constructed in a manner such that the

differential operators in the PDE’s make sense.

Adopted from: K. Salari and P. Knupp. Code Verification by the Method of Manufactured Solutions. SAND2000 – 1444 (2000)

Guidelines for the MMS

Computational Fluid Dynamics

Generating the source terms can be complicated for complex operators. This can, however, easily be done using symbolic manipulation software such as MAPLE or Mathematics

Computational Fluid Dynamics

Verification involves two different steps:

Code verification Generally done once to ensure that the code is correct, using for example the method of manufactured solutions

Solution verificationDone every time the code is used to produce a solution to ensure that the solution errors are acceptable (that the solution is converged)

Page 6: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

Egrid1 = Chp

Egrid 2 = C hr

!

"#$

%&

p

Egrid1

Egrid 2

=Chp

Chp

!

"#$

%&r p = r p

p = log

Egrid1

Egrid 2

!

"#

$

%& / log r( )

Suppose we have a supposedly pth-order solution on two grids where h2=h1/r. The error is then

The ratio of the errors is

Which allows us to compute the actual order:

Computational Fluid Dynamics

Theoretical convergence rate

h

The actual order p, for the Burger’s equation example, computed as on the previous slide

Computational Fluid Dynamics

From: C.J. Roy, C.C. Nelson, T.M. Smith, C.C. Ober, Verification of Euler/Navier–Stokes codes using the method of manufacturedsolutions, Int. J. Numer. Meth. Fluids 44 (6) (2004) 599–620. Cited in: C.J. Roy. Review of code and solution verification procedures for computational simulation. Journal of Computational Physics 205 (2005) 131–156

Euler Equations for 2D FlowRoy, Nelson, and Smith tested two codes using:

Computational Fluid Dynamics

The method of manufactured solutions does not address all issues of code verification, such as domain size and boundary conditions. Nevertheless, it is emerging as one of the major tool in ensuring that a given set of equations is correctly solved.

Computational Fluid Dynamics

Solution Verification (Correct code, wrong solution)

While code verification is usually done once, solution verification needs in principle to be done every time the code is used to generate a solution. In practice an experienced user will have a good idea about the necessary resolution.

A correct code but insufficient resolution or other numerical parameters (iteration errors, for example) can lead to inaccurate and even wrong solutions. For new problems the accuracy must be verified.

Computational Fluid Dynamics

Richardson Extrapolation

Page 7: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

Here, f(0) is the (unknown) exact solution and C is a constant determining the magnitude of the error. Given f(h) and f(2h), estimate C. Once C is known, we can use the above formula to find a better estimate for the solution. This procedure is called Richardson Extrapolation and is widely used in practice.

f h( ) = f 0( ) + Ch2 + HOT

The approximate solution can be written as a Taylor series around the exact solution f(0):

Richardson ExtrapolationComputational Fluid Dynamics

We have:similarly, the solution on twice as coarse grid is:

subtracting to eliminate the h2 term:

Solving for the exact solution:

Since the Higher Order Terms (HOT) are at least O(h3), f(0) is a better estimate than either f(h) or f(h2). Similar formulas can be derived for schemes of different orders.

f h( ) = f 0( ) + Ch2 + HOT

f 2h( ) = f 0( ) + C4h2 + HOT

4 f h( ) − f 2h( ) = 4 f 0( ) − f 0( ) + HOT

f 0( ) =4 f h( ) − f 2h( )

3+ HOT

Richardson Extrapolation

Computational Fluid Dynamics

For an p-th order scheme we have:

similarly, the solution on a finer grid is:

subtracting to eliminate the hn term:

Solving for the exact solution:

f h( ) = f 0( ) + Chp + HOT

f h / r( ) = f 0( ) + C h / r( )p

+ HOT

f h( ) − f h / r( )r p = f 0( ) 1− r p( ) + HOT

f 0( ) =

f h( ) − f 2h( )r p

1− r p + HOT

Richardson ExtrapolationComputational Fluid Dynamics

Validation

Computational Fluid Dynamics

Validating a theory consists of comparing its predictions with experimental results. It is thus at the core of science and as such not a computational issue.

However, scientific computing has greatly increased our abilities to solve complex models and this is leading to more and more complex models, with new issues and challenges for validation.

Computational Fluid Dynamics

From:AIAA.GuidefortheVerificationandValidationofComputationalFluidDynamics Simulations, American Institute of Aeronautics and Astronautics, AIAA-G-077-1998, Reston, VA, 1998. Cited in W. L. Oberkampf and T.G. Trucano. Verification and Validation in Computational Fluid Dynamics. SANDIA REPORT SAND2002-0529 (2002)

Page 8: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

From:Oberkampf, W. L., and Trucano, T. G. Validation Methodology in Computational Fluid Dynamics, AIAA 2000-2549, Fluids 2000 Conference, Denver, CO, 2000. Cited in W. L. Oberkampf and T.G. Trucano. Verification and Validation in Computational Fluid Dynamics. SANDIA REPORT SAND2002-0529 (2002)

Validation Hierarchy for a Hypersonic Cruise Missile

Computational Fluid Dynamics

At the present time there is no real theory covering how to validate a computational model, except compare the predictions with experiments or observations for selected cases. For complex models, build by assembling sub-models, the sub-models are usually validated independently.

C.J. Roy. Review of code and solution verification procedures for computational simulation. Journal of Computational Physics 205 (2005) 131–156

AIAA. 1998. AIAA Guide for the Verification and Validation of Computational Fluid Dynamics Simulations. American Institute of Aeronautics and Astronautics.

Standard for Verification and Validation in Computational Fluid Dynamics and Heat TransferV V 20 – 2009

Computational Fluid Dynamics

Volume 217, Issue 1, Pages 1-276 (1 September 2006) Special Issue: Uncertainty Quantification in Simulation ScienceEdited by George Em Karniadakis and James Glimm

Computational Fluid Dynamics

Uncertainty Quantification

Computational Fluid Dynamics

In most cases uncertainties do not only come from the numerical solution but also from the problem specification. Those uncertainties include:

•  Material properties (density, viscosity, etc)•  Domain geometry•  Boundary conditions•  Model assumption

In principle these uncertainties can be treated in the same way as experimental uncertainties.

Computational Fluid Dynamics

In practice, the quantification of uncertainties requires us to assume that the error follows a particular distribution and it is easiest to deal with uncorrelated errors.

The identification of the uncertainty in all model and input parameters is challenging and there are considerable questions whether standard uncertainty quantification will ever be able to deal with “one-off events” or “Black Swans.” The role of incorrect use of uncertainty models (Black-Scholes, etc.) in the recent financial crisis suggests caution!

Page 9: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

Definitions

Epistemic Uncertainty: Imperfect knowledge and models (turbulence modeling)

Aleatoric Uncertainty: Physical variability. Generally cannot be reduced. Described using probabilistic models.

For the most part, uncertainty quantification assumes that we can use probabilistic approaches.

Computational Fluid Dynamics

Uncertainty Quantification

Data Assimilation: Determine the uncertainty in the input data (material properties, geometry, etc.)

Propagation of Uncertainty: Map the uncertainty in the inputs into uncertainty in the predicted values

Certification: develop reliability or confidence metrics

Computational Fluid Dynamics

Propagating uncertainty: Uncertainty in input parameters is mapped into a distribution of possible outcomes

Uncertainty in input

Unc

erta

inty

in p

redi

ctio

n

Mapping by the computer code

Computational Fluid Dynamics

What are we looking for? Statistical description of the prediction

Probability distribution for the predicted variable f

E f⎡⎣ ⎤⎦= zp z( )−∞

∫ dz

p z( )

z

Var f⎡⎣ ⎤⎦= z − E f⎡⎣ ⎤⎦( )2p z( )−∞

∫ dz = E f 2⎡⎣

⎤⎦− E f⎡⎣ ⎤⎦

2

Expected value

Variance

Computational Fluid Dynamics

Two main approaches

Non-Intrusive Methods: Usually based on sampling. We run our model for several values of the input parameters and construct a distribution of possible outputs from the samples. Choosing the sample points is the main task

Intrusive Methods: Derive expressions for the evolution of the probability distribution and evolve those along with the solutions. This requires us to change the code or write a new one

Computational Fluid Dynamics

Sampling Methods

Page 10: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

Monte Carlo: Pick points at random. Can lead to “holes” and “clusters” and usually converges slowly

Latin Hypercube: divide the domain into regions with equal probability and pick at random within each interval

Collocations: select the sampling points based on assumptions about the distribution

Computational Fluid Dynamics

Selecting the “best” sampling procedure is extremely important, particularly for high dimensional problems.

Monte Carlo methods will give the right answer but generally converge very slowly. Thus, significant effort has gone into finding methods that minimize the number of sampling points needed. In addition to sampling methods, significant effort has gone into efforts to evaluate the integrals using properly selected quadrature points

Computational Fluid Dynamics

Monte Carlo SamplingWoodward and Colella forward facing step problem. Top: Velocity divergence field. Nominal (deterministic) solution corresponding to Mach = 2.75. Bottom: Mean velocity divergence field, corresponding to an uncertain input Mach number [2.5 : 3.0]. Monte Carlo sampling based on 1000 realizations.

From: G. Iaccarino, P. Pettersson, J. Nordstrom and J. Witteveen. NUMERICAL METHODS FOR UNCERTAINTY PROPAGATION IN HIGH SPEED FLOWS. V European Conference on Computational Fluid Dynamics ECCOMAS CFD 2010 J. C. F. Pereira and A. Sequeira (Eds) Lisbon, Portugal,14-17 June 2010

G. Iaccarino, P. Pettersson, J. Nordstrom, J. Witteveen

2 UNCERTAINTY IN SHOCK-DOMINATED FLOW

Consider the supersonic flow over a forward step in a channel, the classical Woodward-Colella test [8]. The objective is to characterize the position of the shock waves at aparticular instant of time after the impulsive start of the channel. In Fig. 1 the nominalsolution obtained for an inflow Mach number of 2.75, at time t = 2 on a grid consisting of≈ 16, 000 elements is reported. The numerical solution is obtained using a second-orderspatial discretization and an explicit Runge-Kutta integration [9]. The velocity divergenceis used as a scalar field indicator to expose the shock location.

We assume that the inflow Mach number is uncertain, specified as a uniform randomvariable defined over the interval [2.5, 3.0]. In the UQ analysis, we will consider the outputof interest to be the statistical average (mean) of the velocity divergence.

A straightforward application of Monte Carlo (MC) method leads to the results shownin Fig.2, an ensemble averaging of 1000 solutions obtained for randomly chosen Machnumbers in the above mentioned interval.

Figure 2: Woodward and Colella [8] forward facing step problem. Mean velocity divergence field. corre-sponding to an uncertain input Mach number [2.5 : 3.0]. Monte Carlo sampling based on 1000 realizations.

It is obvious from the comparison of Fig. 1 and 2 that the mean effect of the uncertaintyin the inflow conditions is to smear the shock wave, an observation reported previouslyin the literature [7].

In order to simplify the description of the spectral expansion methods, we will discussnow a simplified shock dynamics problem governed by the Burgers equations.

3 A MODEL PROBLEM

We consider the one-dimensional viscous Burgers equation:

∂u

∂t+ u

∂u

∂x= ν

∂2u

∂x2(1)

The viscosity is assumed to be small (ν = 0.02) and we are interested in the time-dependent behavior that includes the formation of shocks (or, more precisely, very sharpgradients). The initial conditions are uncertain and assumed to be:

3

G. Iaccarino, P. Pettersson, J. Nordstrom, J. Witteveen

random variables, and the objective of the UQ analysis is to determine the probability dis-tributions (or some statistical moments) of the output. From a mathematical perspectivethe original (deterministic) mathematical problem is cast in a stochastic framework.

Sampling methods such as Monte Carlo have been traditionally applied to solve suchstochastic problems; realizations are drawn from input probabilistic distributions and theensemble of the corresponding solutions is interpreted as an empirical distribution of therandom solution allowing to generate statistical outputs [1]. The flexibility and simplicityof this approach has led to its wide use, but its slow convergence limits its applicabilityfor large-scale problems, motivating research in other methodologies.

Figure 1: Woodward and Colella [8] forward facing step problem. Velocity divergence field. Nominal(deterministic) solution corresponding to Mach = 2.75.

Recently several approaches based on stochastic expansions of the solution in the spacespanned by the uncertain variables have been introduced [6]. Polynomial chaos methodsare particularly attractive because they allow for a reformulation of the stochastic prob-lem as a set of (coupled) deterministic problems that are amenable to analysis [10, 11].On the other hand, this approach requires modification of the existing computationaltool: is an intrusive approach. An alternative class of methods, namely stochastic collo-cation approaches, share a similar mathematical structure but allow for reuse of existingdeterministic codes [5]

Stochastic expansion methods exhibit exponential convergence and, therefore, can beextremely effective when compared to Monte-Carlo-type approaches. This advantage isa direct consequence of the expected smoothness of the system response with respect tovariability of the input quantities [10, 5]. As mentioned before it is clear that in problemscharacterized by highly non-linear responses and sharp transitions, stochastic expansionsmethods can experience difficulties. In this paper, we explore the application of suchmethods to unsteady high-speed compressible flow problems governed by the Burgers andEuler equations. We illustrate how the presence of shock waves hinders the convergence ofthe approach, and discuss why both intrusive and non-intrusive formulations suffer fromthis problem.

2

Computational Fluid Dynamics

Stochastic Galerkin Methods

orPolynomial Chaos

Computational Fluid Dynamics

The alternative to sampling methods is to derive equations for the mapping of the probability distribution.

To propagate the uncertainty, we expand the probability distribution function as a series of orthonormal basis functions.

The basis functions depend on the error distribution. For Gaussian distribution we use Hermite polynomials. For a uniform distribution Legendre polynomials are used.

f x,t,ξ( ) = fk x,t( )k=0

∑ Hk ξ( )

Computational Fluid Dynamics

Gaussian distribution of the initial uncertainty is very common.The Hermite polynomials are defined by:

http://www.efunda.com/math/Hermite/Hermite.cfm

H0 =1H1 = x

H2 = x2 −1

H3 = x2 − 3x

H4 = x4 − 6x2 + 3

HiH j = Hi ξ( )H j ξ( ) p ξ( )dξ = i!δ ij−∞

∫ p ξ( ) = 12πe−ξ

2 /2

Inner product

where

Page 11: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

In practice, we truncate the expansion and follow only a few moments

f x,t,ξ( ) = fk x,t( )k=0

∑ Hk ξ( ) ≈ fk x,t( )k=0

M

∑ Hk ξ( )

E f⎡⎣ ⎤⎦ = E fkk=0

M

∑ Hk

⎣⎢

⎦⎥ = f0E H0⎡⎣ ⎤⎦ + fk

k=1

M

∑ Hk = f0

Var f⎡⎣ ⎤⎦ = E f − E f⎡⎣ ⎤⎦( )2⎡⎣⎢

⎤⎦⎥= E fk

k=0

M

∑ Hk

⎛⎝⎜

⎞⎠⎟− f

⎝⎜⎞

⎠⎟

2⎡

⎢⎢

⎥⎥=

E fkk=0

M

∑ Hk

⎛⎝⎜

⎞⎠⎟

2⎡

⎣⎢⎢

⎦⎥⎥= fk

2

k=1

M

∑ E Hk2⎡⎣ ⎤⎦ = fk

2

k=1

M

∑ k!( )2

The expected value is given by

And the variance is:

Computational Fluid Dynamics

ExampleFollowing:www.dtic.mil/get-tr-doc/pdf?AD=ADA568130

See alsoPer Pettersson, Gianluca Iaccarino, Jan Nordström, Numerical analysis of the Burgers’ equation in the presence of uncertainty, Journal of Computational Physics, Volume 228, Issue 22, 1 December 2009, Pages 8394-8412, ISSN 0021-9991, http://dx.doi.org/10.1016/j.jcp.2009.08.012.http://www.sciencedirect.com/science/article/pii/S0021999109004471

Computational Fluid Dynamics

Apply to inviscid Burgers Equation

∂fi∂ti=0

M

∑ Hi ξ( )+ f jH j ξ( )j=0

M

∑⎛

⎝⎜⎞

⎠⎟∂f j∂xi=0

M

∑ Hi ξ( )⎛

⎝⎜

⎠⎟ = 0

∂f∂t

+ f ∂f∂x

= 0

f x,t,ξ( ) = fi x,t( )i=0

M

∑ Hi ξ( )Substitute a finite series:

giving

This is still a partial differential equation and to convert it into a set of discrete approximations we can use several methods

Computational Fluid Dynamics

Gives:

HiH j = δ iji!

HiH jHk =0 if i + j + k is odd ormax(i, j,k) > s

i! j!k!s − i( )! s − j( )! s − k( )!

⎨⎪⎪

⎩⎪⎪

where s = (i + j + k) / 2

∂fi∂ti=0

M

∑ HiHk + fi∂f j∂xj=0

M

∑ HiH jHki=0

M

∑ = 0 k = 0,1,…,M

To generate a discrete set of equations we use the Galerkin method where we multiply by the weight functions and integrate. Using that for Hermite polynomials:

Computational Fluid Dynamics

In practice, the quantification of uncertainties requires us to assume that the error is Gaussian

∂f∂t

+ f ∂f∂x

= 0

∂f0∂t

+ f0∂f0∂x

+ f1∂f1∂x

= 0

∂f1∂t

+ f1∂f0∂x

+ f0∂f1∂x

= 0

M =1; f x,t,ξ( ) = f0 +ξ f1

M = 2; f x,t,ξ( ) = f0 +ξ f1 + 2 ξ 2 −1( ) f2Resulting in three coupled equations

Computational Fluid Dynamics

From: Per Pettersson, Gianluca Iaccarino, Jan Nordström, Numerical analysis of the Burgers’ equation in the presence of uncertainty, Journal of Computational Physics, Volume 228, Issue 22, 1 December 2009, Pages 8394-8412,

Page 12: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

Even the linear advection equation

can have uncertainty in

Initial conditions

Transport velocity

∂f∂t+U ∂f

∂x= 0

Computational Fluid DynamicsANRV365-FL41-03 ARI 12 November 2008 14:36

y, v

x, uFigure 3Horizontal and vertical velocity profiles at select stations in the differentially heated cavity, with superposed6σ uncertainty error bars. Figure reproduced with permission from the Journal of Computational Physics.

Le Maıtre et al. (2004a) also studied Rayleigh-Benard flow in the Boussinesq limit using PC UQ.In this context, they considered a cavity with a heated bottom wall. Above a critical Rayleigh num-ber, the system transitions from a conductive to a convective heat-transfer mode, as the instabilityof the flow leads to convective motion. Uncertainty is prescribed in the bottom wall temperature.This study explored the performance of a global Wiener-Legendre GPC construction versus alocal Wiener-Haar scheme employing a Haar wavelet basis. The results demonstrated the supe-rior performance of the local construction when the parametric uncertainty spans the bifurcationcorresponding to the critical Rayleigh number. The failure of the global spectral expansion torepresent a bifurcation in stochastic space is not surprising. The local construction dealt with thebifurcation effectively. Asokan & Zabaras (2005) reached similar conclusions in this system usingGPC UQ in a stabilized, variational multiscale FEM.

Wan & Karniadakis (2006b) used ME-GPC for UQ in incompressible flow and heat transfer ina 2D channel over an open cavity with a spectral element solver. At high Reynolds number, largestochastic perturbations were evident, and the local ME-GPC construction was more efficientthan the global GPC.

5.4. Reacting FlowReacting flow presents serious challenges to PC UQ, through the high dimensionality associ-ated with many uncertain parameters and the strong nonlinearity of chemical reactions. Phenixet al. (1998) first used PC UQ in isothermal chemical ignition in their deterministic equivalentmodeling–method approach, focusing on supercritical water oxidation. With this chemical model,Reagan et al. (2003) employed nonintrusive WH PC with LHS in ignition and 1D flames in isother-mal supercritical water oxidation. They also later computed uncertain sensitivity coefficients fromthe PC results (Reagan et al. 2005).

46 Najm

Ann

u. R

ev. F

luid

Mec

h. 2

009.

41:3

5-52

. Dow

nloa

ded

from

ww

w.a

nnua

lrevi

ews.o

rgby

Uni

vers

ity o

f Not

re D

ame

on 0

2/05

/13.

For

per

sona

l use

onl

y.

ANRV365-FL41-03 ARI 12 November 2008 14:36

00

1

1

−0.497

−0.355

−0.213

−0.071

0.0708

0.213

0.355

0.496

Nondimensionaltemperature

Figure 2Mean temperature field in a differentially heated cavity. The scale on the right indicates the range of low- tohigh-nondimensional temperature. The right wall temperature is cold, with prescribed uncertainty, whereasthe left wall is hot and deterministic. The top and bottom walls are adiabatic. Figure reproduced withpermission from the Journal of Computational Physics.

5.3. Thermofluid FlowLe Maıtre et al. (2001) studied uncertain thermofluid flows using intrusive WH PC, in the con-text of incompressible channel flow with temperature-dependent viscosity. They later applied thisconstruction in modeling natural convection in a differentially heated cavity with adiabatic topand bottom walls and cold/hot sidewalls in the Boussinesq limit (Le Maıtre et al. 2002). Nom-inal conditions corresponded to a steady laminar recirculating flow regime. They presumed anuncertain cold wall temperature and modeled it as a random process with a specified correlationlength, which they represented using a KL approach. The mean temperature field exhibits twolayers parallel to the vertical walls and horizontal stratification in the vertical direction (Figure 2).The temperature standard-deviation field has a similar topology, with a maximum on the (right)cold wall, at which the uncertain temperature is imposed, and a zero minimum at the (left) hotwall, at which a deterministic high temperature is imposed. Figure 3 shows the mean horizontaland vertical velocity profiles at a number of stations in the cavity, with superimposed 6σ uncer-tainty error bars. The mean velocity field highlights the bulk average circulation of the flow inthe clockwise direction. Uncertainty grows in both the temperature and the velocity fields as fluidmoves downward along the right wall. This growth is driven by the uncertainty in the temper-ature on that wall, and uncertainty is convected along with the circulating mean velocity field.Le Maıtre et al. (2004c) extended this study to the non-Boussinesq limit, implementing the fullvariable-density low-Mach-number equations, again using intrusive KL-PC. Numerical stabilityrequired discrete global mass conservation in the stochastic equations to ensure the solvability ofthe elliptic equations for the pressure modes.

www.annualreviews.org • Uncertainty Quantification 45

Ann

u. R

ev. F

luid

Mec

h. 2

009.

41:3

5-52

. Dow

nloa

ded

from

ww

w.a

nnua

lrevi

ews.o

rgby

Uni

vers

ity o

f Not

re D

ame

on 0

2/05

/13.

For

per

sona

l use

onl

y.

From: Le Maˆıtre O, Reagan M, Najm H, Ghanem R, Knio O. 2002. A stochastic projection method for fluid flow II. Random process. J. Comput. Phys. 181:9–44

Natural convection in a differentially heated cavity with adiabatic top and bottom walls and cold/hot sidewalls in the Boussinesq limit. Uncertain cold wall temperature modeled as a random process with a specified correlation length

Another Example

Computational Fluid Dynamics

While stochastic Galerkin methods can produce accurate results, they require either very extensive rewrite of existing codes or possibly new codes

In higher dimensions and for a large number of uncertainties the Galerkin method becomes very complex

Computational Fluid Dynamics

In addition to the Galerkin Polynomial Chaos method, a number of other approaches are under development such as the Probabilistic Collocation method, Non-Intrusive Polynomial Chaos method and the Stochastic Collocation method.

Some of them, such as the Stochastic Collocation seem to share the simplicity of MC methods but produce results like PC

Computational Fluid Dynamics

Packages

Computational Fluid Dynamics

The Dakota Project

A Multilevel Parallel Object-Oriented Framework for Design Optimization, Parameter Estimation, Uncertainty Quantification, and Sensitivity Analysis

The DAKOTA (Design Analysis Kit for Optimization and Terascale Applications) toolkit provides a flexible, extensible interface between analysis codes and iterative systems analysis methods.

From: http://dakota.sandia.gov/about.html

Page 13: Computational Fluid Dynamics - University of Notre Damegtryggva/CFD-Course2017/Lecture-21-2017.pdf · Computational Fluid Dynamics Verification: Show that the code solves the equations

Computational Fluid Dynamics

Overview Slidehttp://dakota.sandia.gov/papers/DAKOTA_oneslide.pdf

More extensive overviewhttp://dakota.sandia.gov/papers/DAKOTA_Overview_Jan2010.pdf

Computational Fluid DynamicsToolkit for Large-Scale

Optimization & UQ

DAKOTA analysis “strategies” rely on iterative analysis with a computational model for the phenomenon of interest

Strategies can be combined for more advanced capabilities, e.g.,

– Model calibration under uncertainty– Uncertainty of optima

Multi-level parallelism supports large-scale applications and architectures

DAKOTA

Parameters

Computational Model• Black box • Semi-intrusive

ResponseMetrics

Output Values

0

1

2

3

4

5

30 36 42 48 54 60 66 72 78 84

Response Variable

% in

Bin

Example: Assessing probability of failure from distribution (uncertainty) of output values

DAKOTA allows analysis of fundamental science and engineering questions with computational models:

• Sensitivities: What are the crucial parameters?• Uncertainties: How safe, reliable, robust, variable is my

system?• Optimization: What is the best performing design?• Calibration: What parameter values or models best

match experimental data?

Broad deployment via open source model: Over 4,000 download registrations spanning government, industry, academia

Computational Fluid Dynamics

Uncertainty quantification is a challenging problem due to several aspects:

It is usually difficult to estimate the uncertainty in the input parameters

Sampling and propagating a large number of input uncertainties in higher dimensions is usually very expensive

Systems often fail not because of quantifiable variations in properties or parameters but due to unforeseen events. Current methods are designed for “known unknowns,” not “unknown unknowns.”