1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti...

17
1 Computational Methods Computational Methods Dr. Farzad Ismail Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week 3 (Lecture 2)

Transcript of 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti...

Page 1: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

11

Computational MethodsComputational Methods

Dr. Farzad IsmailDr. Farzad Ismail

School of Aerospace and Mechanical EngineeringUniversiti Sains Malaysia

Nibong Tebal 14300 Pulau Pinang

Week 3 (Lecture 2)

Page 2: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

22

OverviewOverview

We already know the nature of PDE’s, now we will We already know the nature of PDE’s, now we will attempt to discretize and compute the PDE’s.attempt to discretize and compute the PDE’s.

We will focus on We will focus on model problems.model problems.

These model problems have difficulties that are shared These model problems have difficulties that are shared with more realistic models, but much simpler to handle.with more realistic models, but much simpler to handle.

Page 3: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

33

Overview (cont’d)Overview (cont’d)

The model problems that will be discussed areThe model problems that will be discussed are

- hyperbolic- hyperbolic

- parabolic- parabolic

- elliptic- elliptic

Page 4: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

44

Overview (cont’d)Overview (cont’d)

We will discretize the models using FD method.We will discretize the models using FD method.

Only simple uniform grids are used.Only simple uniform grids are used.

Stick to the notations introduced before.Stick to the notations introduced before.

Page 5: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

55

Overview (cont’d)Overview (cont’d)

Evolution Equilibrium

Page 6: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

66

Computation of Parabolic EquationComputation of Parabolic Equation

Apply FTCS scheme Apply FTCS scheme

Page 7: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

77

von Neumann (VN) Analysisvon Neumann (VN) Analysis

A method to determine stability of numerical schemesA method to determine stability of numerical schemes

Decompose solution in terms of Fourier modesDecompose solution in terms of Fourier modes

Variation in space in terms of sine wave from Variation in space in terms of sine wave from θθ=[0,=[0,ππ]]

g is amplification factor, indication for stabilityg is amplification factor, indication for stability

Even though it only applies for linear problems, it provides a Even though it only applies for linear problems, it provides a reasonably accurate guide to more general cases.reasonably accurate guide to more general cases.

Page 8: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

88

Von Neumann Analysis on FTCSVon Neumann Analysis on FTCS

Rewrite FTCS scheme solving 1D heat equation Rewrite FTCS scheme solving 1D heat equation

Using von Neumann analysisUsing von Neumann analysis

Page 9: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

99

VN on FTCS (cont’d)VN on FTCS (cont’d)

This means that if input is pure sine wave (Fourier This means that if input is pure sine wave (Fourier mode), after 1 time step the sine wave will be mode), after 1 time step the sine wave will be amplified by g which depends on amplified by g which depends on θθ and and μμ..

Restriction must be done on Restriction must be done on μμ, not on , not on θθ=[0, =[0, ππ].].

For stability requiresFor stability requires ,, hencehence

Page 10: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

1010

Comments using FTCS on 1D Heat EqnComments using FTCS on 1D Heat Eqn

The scheme is The scheme is conditionally stableconditionally stable

If we use small If we use small ΔΔx, we need extremely small x, we need extremely small ΔΔt since it t since it is scaled in is scaled in

It can be shown that the restrictionIt can be shown that the restriction

applies to all numerical schemes solving the 1D heat applies to all numerical schemes solving the 1D heat eqneqn

Page 11: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

1111

FTCS Solution on 1D Heat Eqn FTCS Solution on 1D Heat Eqn

The electric blanket problem-heat added in the center of blanketThe electric blanket problem-heat added in the center of blanket

Use 1D model where at t=0, add heat such thatUse 1D model where at t=0, add heat such that

And switch off power And switch off power

Page 12: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

1212

FTCS Solution on 1D Heat Eqn (cont’d) FTCS Solution on 1D Heat Eqn (cont’d)

Results are very accurate but oscillations will grow wild Results are very accurate but oscillations will grow wild if restriction is violated.if restriction is violated.

Page 13: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

1313

Computation of Hyperbolic EquationComputation of Hyperbolic Equation

Apply FTCS scheme Apply FTCS scheme

Page 14: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

1414

FTCS Solution on 1D Advection EqnFTCS Solution on 1D Advection Eqn

FTCS is unstableFTCS is unstable

Just because it works for 1 type of PDE, does not mean it will work for other typesJust because it works for 1 type of PDE, does not mean it will work for other types

Page 15: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

1515

VN Analysis on FTCS (advection)VN Analysis on FTCS (advection)

Rewrite FTCS scheme solving 1D heat equation Rewrite FTCS scheme solving 1D heat equation

Using von Neumann analysisUsing von Neumann analysis

FTCS unconditionally unstable!

Page 16: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

1616

Computation of Hyperbolic EquationComputation of Hyperbolic Equation

Apply 1Apply 1stst order upwind scheme order upwind scheme

a > 0

Page 17: 1 Computational Methods Dr. Farzad Ismail School of Aerospace and Mechanical Engineering Universiti Sains Malaysia Nibong Tebal 14300 Pulau Pinang Week.

1717

11stst order Upwind Solution on 1D Advection Eqn order Upwind Solution on 1D Advection Eqn