Direct Numerical Simulations of Multiphase Flows - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

Direct Numerical Simulations of Multiphase Flows

Description:

Analyze the error in evaluating the integral using a Taylor series. Expand g. substitute ... Approximate the integral. Computational Fluid Dynamics I. P. I. W ... – PowerPoint PPT presentation

Number of Views:93
Avg rating:3.0/5.0
Slides: 31
Provided by: grtartry
Category:

less

Transcript and Presenter's Notes

Title: Direct Numerical Simulations of Multiphase Flows


1
Elementary Numerical Analysis Finite Difference
Approximations-I
Instructor Hong G. Im University of Michigan
Fall 2005
Lecture notes were prepared jointly with Prof.
Gretar Tryggvason, Department of Mechanical
Engineering, Worcester Polytechnic Institute.
2
Objectives
Introduce the basic concepts needed to solve a
partial differential equation using finite
difference methods. Discuss basic time
integration methods, ordinary and partial
differential equations, finite difference
approximations, accuracy. Show the
implementation of numerical algorithms into
actual computer codes.
3
Outline
  • Time integration of an ordinary differential
    equation
  • Integration methods
  • Algorithm example
  • Error analysis
  • The linear advection-diffusion equation
  • Finite difference approximations
  • Finite Difference Approximation of the linear
  • advection-diffusion equation
  • Algorithm example
  • Accuracy and error quantification

4
Integration of Ordinary Differential Equations
in Time
5
Integrating a first-order ordinary differential
equation in time
The initial condition must also be specified
6
Time Integration
A numerical solution of
consists of discrete values of f at discrete times
7
Time Integration
Start with
8
Time Integration
To advance
Need to approximate this area to evaluate the
integral
9
Time Integration
Approximate
Forward Euler
10
Time Integration
Approximate
Backward Euler
11
Time Integration
Approximate
Trapezoidal rule
12
Time Integration
Summary
Forward Euler
Backward Euler
Trapezoidal Rule
13
Example
14
Accuracy
Take
15
Accuracy
16
A short code, using matlab
a simple code for several integration
methods nstep5dt0.5 f1zeros(nstep,1)f2zeros
(nstep,1) f3zeros(nstep,1) fexzeros(nstep,1)
tzeros(nstep,1) t(1)0f1(1)1f2(1)1f3(1)1
fex(1)1 for i2nstep f1(i)f1(i-1)-dtf1(i-
1) Forward Euler
f2(i)f2(i-1)/(1.0dt)
Backward Euler f3(i)f3(i-1)(1.0-0.5dt)/(1
.00.5dt) Trapezoidal Rule
t(i)t(i-1)dt fex(i)exp(-t(i)) end plot(t
,f1)hold onplot(t,f2,'r')plot(t,f3,'k') plot(t
,fex, 'r', 'linewidt',3) set(gca,'fontsize',24,'l
inewidt',2)
17
Forward Euler
?t0.5
Backward Euler
Exact
Trapezoidal rule
Time
18
Clearly the numerical solutions have the same
behavior as the exact solution but only the
trapezoidal rule results in numerical values that
are approximately the same. The obvious question
is
Can we improve the accuracy of the forward and
backward Euler method?
Re-run the forward Euler method with smaller time
steps
19
Forward Euler
Accuracy, effect of ?t
?t0.5
?t0.25
Exact
?t0.125
Notice that the results are plotted versus time,
not time step n!
Time
20
The error at t2.5, for the forward Euler Method,
defined by E fnum(2.5)-exp(-2.5)
21
E fnum(2.5)-exp(-2.5)
? Forward Euler Backward Euler ? Trapezoidal
rule
As the time step becomes smaller, it is clear
that the error goes to zero
E
? t
22
Error Analysis
23
Analyze the error in evaluating the integral
using a Taylor series
24
(No Transcript)
25
The error at each time step is important, but it
is the total error, when integrating over a given
time period T that is most important. If the
number of time steps is N, the total error is
Since the number of time steps is NT/? t
First Order Method
26
If the error is of n-th. order
On a log-log plot, the E versus 1/?t curve should
therefore have a slope of -n
27
Error at t2.5 for different ?t
Plot the log of the Error versus log of (1/?t)
E
? Forward Euler Backward Euler Trapezoidal
rule
1/? t
28
A finite difference approach
29
Derive an approximation for the time derivative
using a Taylor series
30
The original equation at time level n is
Write a Comment
User Comments (0)
About PowerShow.com