3 NumericalSolution ODEs
3 NumericalSolution ODEs
Erlangen
Erlangen
Schedule
No. Week(s) Practical Lecture Exercise
Monday: 10:00-11:30 Monday: 14:15-15:45 Wednesday: 10:15-11:45
Room: online Room: online Room: online
1. 02.11.20-06.11.20 Matlab Tutorial I Introduction and Navier-Stokes Eq. No Exercise
2. 09.11.20-13.11.20 Matlab Tutorial II; Computer Exercise 1 Simplification of NSE up to Boundary Layer Eq. Hand out Exercise 1
3. 16.11.20-20.11.20 Work on Computer Ex. 1 Initial Value Problems: Time Stepping (ODEs) Work on Exercise 1
4. 23.11.20-27.11.20 Work on Computer Ex. 1 Finite Difference Method 1 Presentation Ex. 1 &
Hand out Ex. 2
5. 30.11.20-04.12.20 Work on Computer Ex. 1 Finite Difference Method 2 Work on Ex. 2
6. 07.12.20-11.12.20 Work on Computer Ex. 1 Consistency, Stability and Convergence Presentation Ex. 2 &
Hand out Ex. 3 + 4
7. 14.12.20-18.12.20 Submit & Present Computer Ex. 1 Finite Volume Method 1 Work on Ex. 3 + 4
Computer Ex. 2
8. 21.12.20-23.12.20 Work on Computer Ex. 2 Finite Volume Method 2 Work on Ex. 3 + 4
24.12.20-06.01.21 Holiday Holiday Holiday
07.01.21-08.01.21 Presentation Ex. 3 + 4 &
Hand out Ex. 5
9. 11.01.21-15.01.21 Submit & Present Computer Ex. 2 Numerical solution of the Navier-Stokes-Equations 1 Work on Ex. 5
Computer Ex. 3
10. 18.01.21-22.01.21 Work on Computer Ex. 3 Numerical solution of the Navier-Stokes-Equations 2 Work on Ex. 5
11. 25.01.21-29.01.21 Work on Computer Ex. 3 Numerical solution of the Navier-Stokes-Equations 3 Presentation Ex. 5 &
Hand out Ex. 6
12. 01.02.21-05.02.21 Work on Computer Ex. 3 Numerical solution of the Navier-Stokes-Equations 4 Work on Ex. 6
Hand out Ex.6
13. 08.02.21-12.02.21 Submit & Present Computer Ex. 3 Boundary Conditions Presentation Ex. 6
Outline
• PART 1: Repetition
• Boundary Layer: Blasius Equation
Erlangen
Erlangen
Flow velocities:
∂ψ ∂ψ ∂η
u= = = u∞f 0(η) (9)
∂y ∂η r
∂y
∂ψ 1 ν u∞ 0
v =− = (η f (η) − f (η)) (10)
∂x 2 x
Erlangen
Erlangen
0.015 U/U∞
1.5
0.01 1.4
1.3
1.2
0.005 1.1
1
Y [m]
0.9
0 0.8
0.7
0.6
-0.005 0.5
0.4
-0.01 0.3
0.2
0.1
-0.015
-0.02
0 0.02 0.04
X [m]
• vortical structures are shedding from the surface of the cylinder leading to
the formation of a vortex street
Dr.-Ing. Manuel Münsch | FAU | 9
Erlangen
Introduction
Navier-Stokes Equations
For discretization purposes the conservation equations for mass and
momentum are casted into a single transport equation:
∂(ρφ) ∂(ρuj φ) ∂ ∂φ
+ = (Γ ) + Sφ (11)
∂t ∂ xj ∂ xj ∂ xj
with the following variables:
Conserv. Eq. φ Γ Sφ
Mass 1 0 0
∂ uj
Momentum ui µ − ∂∂xpi + ∂
∂ xj (µ ∂ xi ) + ρgi
∂ uj
with ∂ xj = 0:
Introduction
Incompressible Navier-Stokes Equations are:
• elliptic in space (x , y , z ):
• a disturbance of the flow field at one particular point has an impact on the entire
flow field
• every location inside the flow field is influenced by all other locations inside the
flow field
• are parabolic in time (t ):
• a disturbance of the flow field has just an impact on the future development of
the flow field
• these characteristic properties are considered via Time Marching
Approaches
-> the solution is advanced in time step by step
• Time Marching Approaches are very similar to general solution strategies of
initial values problems (like Blasius equation)
Introduction
Time Marching
• Time Marching Approaches are very similar to general solution strategies
of initial values problems (like Blasius equation) which becomes more
obvious by a reformulation of the equation:
∂(ρφ) ∂(ρuj φ) ∂ ∂φ
=− + (Γ ) + Sφ = Res(φ(t ), t ) (12)
∂t ∂ xj ∂ xj ∂ xj
with residual Res(φ(t ), t ) containing all convective and diffusive fluxes
d φ(t )
= f (φ(t ), t ) with φ(t0) = φ0 (13)
dt
Introduction
Time Marching
Time Marching Schemes are divided into Single-Step (or two-level) methods
and Multi-Step (or multipoint) methods and furthermore into explicit and
implicit approaches:
• Single-Step (or two-level) methods:
• just an old and a new time domain are used to predict φ(tn+1 )
Introduction
Time Marching
Time Marching Schemes are divided into Single-Step (or two-level) methods
and Multi-Step (or multipoint) methods and furthermore into explicit and
implicit approaches:
• explicit approach:
• only old time domains are used to predict the function f
• implicit approach:
• old and new time domains are used to predict f
• the procedure is repeated until a solution for the desired physical time is
obtained
Dr.-Ing. Manuel Münsch | FAU | 15
Erlangen
• here the variable f (fluxes & source terms) is evaluated basing on the
known value φn
• the only remaining unknown is φn+1 which can be computed directly
-> explicit approach
• formally this is a forward difference in time with truncation error of first
order (Taylor Series)
• here the variable f (fluxes & source terms) is evaluated basing on the
unknown value φn+1 at tn+1
• the only known variable is φn
• φn+1 cannot be computed directly, instead an equation system has to be
solved
-> implicit approach
• formally this is a backward difference in time with truncation error of first
order (Taylor Series)
• αt = 0:
-> explicit Euler Scheme
• αt = 1:
-> implicit Euler Scheme
• αt = 0.5:
-> Crank-Nicolson Scheme
1
φ(1) = φ(n) + α1∆t f (φn , tn ) with α1 =
3
1
φ(2) (n) 1
= φ + α2∆t f (φ , t1) with α2 = (32)
2
φ(3) = φ(n) + α3∆t f (φ2, t2) with α3 = 1
φn+1 = φ(3)
1
αk = with k = 1, 2, ..., N (34)
N −k +1
dt=0.1
u(1)=1.0
l=-1.0
do i=1,N
u(i+1) = u(i) + dt*l*u(i)
end do
Exact Solution
Explicit Euler dt = 2.1429
6 Explitcit Euler dt = 1.875
Explitcit Euler dt = 1.5
Explitcit Euler dt = 0.1
2
Solution u
-2
-4
-6
0 5 10 15 20 25 30
Time
0.6
Solution u
0.4
0.2
0 5 10 15 20 25 30
Time
0.6
Solution u
0.4
0.2
0 5 10 15 20 25 30
Time
0.6
Solution u
0.4
0.2
0 5 10 15 20 25 30
Time
n+1 n ∆t n n−1
φ =φ + 3f (φ , tn ) − f (φ , tn−1) (46)
2
n+1 n ∆t n+1 n
φ =φ + f (φ , tn+1) + f (φ , tn ) (50)
2
• 1. order approach
φn+1 − φn
= f (φn+1, tn+1) (53)
∆t
-> corresponds to Implicit Euler of first order, thus still a Single-Step procedure
• 4. order approach:
Time Marching
Conclusion
• the choice of an optimal time stepping algorithm is strongly problem
dependent
• the selection depends on
• the required accuracy of the solution for a particular problem
• the stability of the algorithm
• the numerical effort regarding CPU-time and storage requirements
• for unsteady problems with strong variations of the flow field 2nd order
approaches should be chosen
• for problems requiring small time-step sizes to resolve the physics explicit
approaches may be an option
• for stiff problems implicit methods (Crank-Nicolson, BDF, Adams-Moulton)
are in general the best choice