+ All Categories
Home > Documents > Laplace equation - Numerical example

Laplace equation - Numerical example

Date post: 24-Dec-2021
Category:
Upload: others
View: 4 times
Download: 0 times
Share this document with a friend
17
1 Laplace equation - Numerical example The Laplace equation is given as 2 2 + 2 2 =0 The scalar function can be f.ex. velocity potential or temperature. We will look at both.
Transcript
Page 1: Laplace equation - Numerical example

1

Laplace equation - Numerical example

The Laplace equation is given as

πœ•2πœ™

πœ•π‘₯2+πœ•2πœ™

πœ•π‘¦2= 0

The scalar function πœ™ can be f.ex. velocity potential or

temperature. We will look at both.

Page 2: Laplace equation - Numerical example

2

Laplace equation - Numerical example

With temperature as input, the equation describes two-dimensional, steady heat conduction.

The velocity and its potential is related as 𝑒 =πœ•πœ™

πœ•π‘₯and 𝑣 =

πœ•πœ™

πœ•π‘¦,

where u and v are velocity components in x- and y-direction respectively. For flow, it requires incompressible, irrotational, non-viscous and steady conditions

As will be seen, it is easiest to start with temperature.

Page 3: Laplace equation - Numerical example

3

Laplace equation - Numerical example

The interior domain can be split up as shown in the figure below:

Numerical molecule:

Discretization:

πœ•πœ™

πœ•π‘₯β‰ˆ

1

Ξ”π‘₯πœ™π‘–+1,𝑗 βˆ’ πœ™π‘–,𝑗

πœ•2πœ™

πœ•π‘₯2β‰ˆ

1

Ξ”π‘₯2πœ™π‘–+1,𝑗 βˆ’ 2πœ™π‘–,𝑗 + πœ™π‘–βˆ’1,𝑗 (same for y-dir.)

πœ™π‘–,𝑗

πœ™π‘–,𝑗+1

πœ™π‘–+1,𝑗

πœ™π‘–,π‘—βˆ’1

πœ™π‘–βˆ’1,𝑗

Page 4: Laplace equation - Numerical example

4

Laplace equation - Numerical example

Adding the discretized differentials together gives us:

2 β‹… 1 +Ξ”π‘₯

Δ𝑦

2

πœ™π‘–,𝑗 = πœ™π‘–βˆ’1,𝑗 + πœ™π‘–,π‘—βˆ’1 +Ξ”π‘₯

Δ𝑦

2

πœ™π‘–+1,𝑗 + πœ™π‘–,𝑗+1

Show this yourself !

So we have an explicit expression for point i,j that contains its neighbors.

For simplicity we continue with uniform grid -> Ξ”π‘₯ = Δ𝑦

Page 5: Laplace equation - Numerical example

5

Laplace equation - Numerical example

The algebraic equation system we must solve gets:

βˆ’4 β‹… πœ™π‘–,𝑗 + πœ™π‘–βˆ’1,𝑗 + πœ™π‘–,π‘—βˆ’1 + πœ™π‘–+1,𝑗 + πœ™π‘–,𝑗+1 = 0

Consider temperature first !

Page 6: Laplace equation - Numerical example

6

Laplace equation - Physical domain

πœ•π‘‡

πœ•π‘¦= 0 β†’ 𝑇𝑗=𝑁 = 𝑇𝑗=π‘βˆ’1

πœ•π‘‡

πœ•π‘¦= 0 β†’ 𝑇𝑗=1 = 𝑇𝑗=2

𝑇 = 200𝐾 𝑇 = 300𝐾

Page 7: Laplace equation - Numerical example

7

Laplace equation - Boundary conditions

Easiest to start with is temperature, because the directly

solved variable from the scalar equation is what we are

interested in. Two different BCs:

Dirichlet: 𝑇𝑏𝑐 is given. Constant temperature at any boundary.

Neumann: πœ•π‘‡

πœ•π‘₯𝑖 𝑛The normal gradient is given. Heat flux.

Page 8: Laplace equation - Numerical example

8

Laplace equation - Numerical example

𝑇1,1 = 200

𝑇2,5 = 𝑇2,4

…

𝑇2,2 =1

4𝑇1,2 + 𝑇2,1 + 𝑇3,2 + 𝑇2,3

…

𝑇4,5 = 𝑇4,4

…

𝑇5,1 = 300

𝑦

π‘₯𝑇1,1

𝑇2,1 𝑇3,1

𝑇1,2

𝑇1,3

𝑇2,2

𝑇1,4

𝑇1,5

𝑇4,1 𝑇5,1

𝑇2,5 𝑇5,5𝑇3,5 𝑇4,5

Page 9: Laplace equation - Numerical example

9

Laplace equation - Solution (Gauss-Seidel SOR)

𝑇𝑖,𝑗 =1

4π‘‡π‘–βˆ’1,𝑗 + 𝑇𝑖,π‘—βˆ’1 + 𝑇𝑖+1,𝑗 + 𝑇𝑖,𝑗+1

𝑇𝑖,𝑗𝑛𝑒𝑀 = 𝑇𝑖,𝑗

π‘œπ‘™π‘‘ + 𝛼 β‹…1

4π‘‡π‘–βˆ’1,𝑗 + 𝑇𝑖,π‘—βˆ’1 + 𝑇𝑖+1,𝑗 + 𝑇𝑖,𝑗+1 βˆ’ 𝑇𝑖,𝑗

π‘œπ‘™π‘‘

𝛿𝑇

We added and subtracted the old value of 𝑇𝑖,𝑗 on the right hand side. Inside brackets is the change in 𝑇𝑖,𝑗 for the current iteration. 𝛼 is the over-relaxation parameter.

Page 10: Laplace equation - Numerical example

10

Laplace equation - Numerical example

π‘₯

Remember to either exclude the indexes for boundary values, or

overwrite/enforce them inside the iteration loop.

Check the difference between old and new values (residual). Several ways to

calculate this !

Page 11: Laplace equation - Numerical example

11

Laplace equation - Numerical domain

10 20 30 40 50 60

5

10

15

20

25

200

220

240

260

280

300

π‘†π‘‘π‘Žπ‘Ÿπ‘‘ π‘£π‘Žπ‘™π‘’π‘’π‘ : π‘‡π‘ π‘‘π‘Žπ‘Ÿπ‘‘ = 260 𝐾

Page 12: Laplace equation - Numerical example

12

Laplace equation - Numerical domain

10 20 30 40 50 60

5

10

15

20

25

200

210

220

230

240

250

260

270

280

290

300

Box inside, T=200K

Page 13: Laplace equation - Numerical example

13

Laplace equation - Solution procedure

1. Initialize the domain

2. Iteration

3. Enforce BC’s

4. Solve 𝝓𝑷 = 𝒇(π“π’π’ƒβˆ— )

5. Check tolerance𝝓𝑷 βˆ’ 𝝓𝑷

βˆ—If tolerance > small

number

Convergence:

max 𝛿𝑇𝑖,𝑗

max 𝑇𝑖,𝑗< πœ–

Where πœ– is a small number

Page 14: Laplace equation - Numerical example

14

Laplace equation - Results

10 20 30 40 50 60

5

10

15

20

25

200

220

240

260

280

300

10 20 30 40 50 60

5

10

15

20

25

200

210

220

230

240

250

260

270

280

290

300

500 iterations

1000 iterations

Page 15: Laplace equation - Numerical example

15

Laplace equation - Velocity potential

We wish to study external flow. That is flow around an object.

The easiest is a rectangular box. The domain will be like

below:𝑣 =

πœ•πœ™

πœ•π‘¦= 0

𝑣 =πœ•πœ™

πœ•π‘¦= 0

𝑒 = π‘ˆπ‘–π‘› β†’πœ•πœ™

πœ•π‘₯= π‘ˆπ‘–π‘›

πœ•π‘’

πœ•π‘₯=πœ•2πœ™

πœ•π‘₯2= 0

𝑒 =πœ•πœ™

πœ•π‘₯= 0

𝑣 =πœ•πœ™

πœ•π‘¦= 0

𝑒 =πœ•πœ™

πœ•π‘₯= 0

𝑣 =πœ•πœ™

πœ•π‘¦= 0

Page 16: Laplace equation - Numerical example

16

Laplace equation - Velocity potential

It is solved exactly the same way as with temperature, but the boundary conditions are different. Also, Dirichlet conditions for uand v gives Neumann conditions for the velocity potential.

Inlet: πœ™1,𝑗 = πœ™2,𝑗 βˆ’ π‘ˆπ‘–π‘› β‹… Ξ”π‘₯

Outlet: πœ™π‘,𝑗 = 2 β‹… πœ™π‘βˆ’1,𝑗 βˆ’ πœ™π‘βˆ’2,𝑗

Top: πœ™π‘€ = πœ™π‘€βˆ’1 Bottom: πœ™π‘€ = πœ™π‘€+1

At the top and bottom use v=0

Correct initialization is important here (π‘ˆπ‘–π‘› all over the domain)

Page 17: Laplace equation - Numerical example

17

Laplace equation - Results

Streamlines

u-velocity

50 100 150 200 250

10

20

30

40

50

0

2

4

6

8

10

1.5 2 2.5 3 3.5

0.2

0.3

0.4

0.5

0.6

0.7

0.8


Recommended