Heat Flow in Space and Time Time-Stepping Via the Leap Frog - - PowerPoint PPT Presentation

heat flow in space and time
SMART_READER_LITE
LIVE PREVIEW

Heat Flow in Space and Time Time-Stepping Via the Leap Frog - - PowerPoint PPT Presentation

Heat Flow in Space and Time Time-Stepping Via the Leap Frog Algorithm Rubin H Landau Sally Haerer, Producer-Director Based on A Survey of Computational Physics by Landau, Pez, & Bordeianu with Support from the National Science Foundation


slide-1
SLIDE 1

Heat Flow in Space and Time

Time-Stepping Via the Leap Frog Algorithm Rubin H Landau

Sally Haerer, Producer-Director

Based on A Survey of Computational Physics by Landau, Páez, & Bordeianu with Support from the National Science Foundation

Course: Computational Physics II

1 / 1

slide-2
SLIDE 2

Problem: How Does a Bar Cool?

100 K

Insulated Metallic Bar Touching Ice Aluminum bar, L = 1 m, w along x Insulated along length, ends in ice (T = 0 C) Initially T = 100 C How does temperature vary in space and time?

2 / 1

slide-3
SLIDE 3

The Parabolic Heat Equation (Theory)

1

Nature: heat flow hot → cold K = conductivity C = sp heat, ρ = density

2

Q(t) = contained heat

3

Heat Eqn: ∆T from flow

4

Parabolic PDE in x & t

5

“Analytic” Solution IC: T(x, t = 0) = 100C BC: T(x = 0) = T(x = L) = 0C

H = −K ∇T(x, t) (1) Q(t) =

  • dx Cρ(x) T(x, t)

(2) ∂T(x, t) ∂t = K Cρ∇2T(x, t) (3) ∂T(x, t) ∂t = K Cρ ∂2T(x, t) ∂x2 (4) T(x, t) =

  • n=1,3,...

400 sin knx e−αk2

n t

nπ (5) (kn = nπ L , α = K Cρ) (6)

3 / 1

slide-4
SLIDE 4

Solution Via Time Stepping

x t i-1,j i+1,j i,j+1

∂T ∂t ≃ T(x, t + ∆t) − T(x, t) ∆t ∂2T ∂x2 ≃T(x + ∆x) + T(x − ∆x) − 2T(x) (∆x)2 Differential → difference eqtn Solve at x − t lattice sites Vert blue = BC, row 0 = IC Relax: if knew Tbottom Leapfrog ↓ one t to next FD ∂t, CD for ∂2x (can) ⇒ difference heat eqtn Explicit Soltn: known values Not space-time symmetric T(x, t + ∆t) − T(x, t) ∆t = K Cρ T(x + ∆x, t) + T(x − ∆x, t) − 2T(x, t) ∆x2 (1) Ti,j+1 = Ti,j + η [Ti+1,j + Ti−1,j − 2Ti,j] (2)

4 / 1

slide-5
SLIDE 5

Solution of Heat Equation

100 K

80 80 40 10

t T x EqHeat.py EqHeat_Animate.py

5 / 1

slide-6
SLIDE 6

Von Neumann Stability Analysis

Tm,j+1 = Tm,j + η [Tm+1,j + Tm−1,j − 2Tm,j] , x = m∆x, t = j∆t (1)

Difference soltn ≃ PDE soltn?? Bad: difference diverges

Tm,j = ξ(k)j eikm∆x (2) ⇒ ξ(k) =1 + 2η[cos(k∆x) − 1] (3) |ξ(k)| < 1 (4) ⇒ η = K ∆t Cρ ∆x2 < 1 2 (5)

Assume Tm,j = eigenmodes k = 2π/λ = ? Stable if eigenmodes stable i.e. |ξ(k)| < 1 Sub (3) into diff eqtn (1) ⇒ Smaller ∆t more stable ↓ ∆x must ↑ ∆t Always try analysis

6 / 1

slide-7
SLIDE 7

Implementation

EqHeat.py Build in BC & IC Heart: 2-D array T[101][2] = T[x][present, future] Set future to present, calculate future Output t & T ever 300 t steps Surface T(x, t) plots with isotherms, must be smooth Vary ∆t & ∆x Compare analytic & numeric solutions Stability: Diverges η > 1

4?

7 / 1

slide-8
SLIDE 8

Crank–Nicolson Algorithm Next

Take a break, or quit if not proceeding to Crank Nicolson.

8 / 1