使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 advisor: damon shing-min...
TRANSCRIPT
![Page 1: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/1.jpg)
使用波動方程式的擬真和互動式水面模擬
496410032 吳金龍Advisor: Damon Shing-Min Liu
![Page 2: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/2.jpg)
IntroductionWhat can fluid simulation do for us?
What is the difficulty of the topic?
![Page 3: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/3.jpg)
ObjectiveReal-time and visual quality
Interact with users
![Page 4: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/4.jpg)
Height Field present water surface as a
2D function h(x,y)
2D array h[i,j]
x
y
h
h
i
j
![Page 5: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/5.jpg)
Height FieldPros: Process from 3D to 2D reduce computational time
Cons: One location (x,y) maps to exactly one height no breaking waves
![Page 6: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/6.jpg)
Hello World!
![Page 7: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/7.jpg)
AlgorithmUse 2 arrays A[N][M] , B[N][M] of the same sizeInitialize A[i][j] with arbitrary valuesInitialize B[i][j] with 0
loop
forall i,j do B[i,j] += (A[i-1,j] + A[i+1,j] + A[i,j-1]
+ A[i,j+1])/4- A[i,j];
forall i,j do B[i,j] *= 0.99;
forall i,j do A[i,j] += B[i,j];
endloop
![Page 8: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/8.jpg)
AlgorithmIt simulate the wave propagation
phenomenontravel direction
![Page 9: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/9.jpg)
Pros and Cons Pros: 1). Simple
2). Computational time is independent of wave source
Cons: 1). Unnatural shape of wave propagation 2). Slow wave propagation
demo
![Page 10: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/10.jpg)
Addition of Sine Waves
![Page 11: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/11.jpg)
Governing Equation
h : height of water surface A : amplitude ω : angular velocity t : time φ : phase λ : wave length f : frequency
)cos(0
iii
sourceNum
i
twAh
![Page 12: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/12.jpg)
Algorithmsummate all sine waves
v = λ x f is a constant , and λ increases with t
Phase increases constantly to animate wave propagation
![Page 13: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/13.jpg)
Pros and Cons Pros: Better look of shape of wave
propagation
Cons: Computational time is proportional to wave source number
demo
![Page 14: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/14.jpg)
Wave Equation
![Page 15: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/15.jpg)
Governing Equation
)yh
xh
(cth
2
2
2
22
2
2
h: height of water surfacet: timec: velocityx: position of x directiony: position of y direction
![Page 16: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/16.jpg)
DampingWith damping
Where k is damping factor
)yh
xh
(cth
kth
2
2
2
22
2
2
![Page 17: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/17.jpg)
Finite Difference
hh
)f(xh)f(xf ii
2iii
h)h)f(x)2f(xh)f(x
(2
2
h
f
Where h is a insignificant and non-zero value
![Page 18: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/18.jpg)
Discrete Wave Equation
yx
y
hhh
y
h
x
hhh
x
h
t
hhh
t
h
nyx
nyx
nyx
nyx
nyx
nyx
nyx
nyx
nyx
)(
2
)(
2
)(
2
2
1,,
1,
2
2
2
1,,
1,
2
2
2
1,,
1,
2
2
![Page 19: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/19.jpg)
Discrete Wave Equation
))4(2
1
4(
))(1(
)4(
))(1(
,1,11,11,11,1
,1,1,,1,12
22
,,,,
,1,1,,1,12
22
,,,,
tyx
tyx
tyx
tyx
tyx
tyx
tyx
tyx
tyx
tyx
ttyx
tyx
tyx
ttyx
tyx
tyx
tyx
tyx
tyx
ttyx
tyx
tyx
ttyx
hhhhh
hhhhhx
tc
hhtkhh
or
hhhhhx
tc
hhtkhh
![Page 20: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/20.jpg)
stabilityHow to choose ?
Courant-Friedrichs-Lewy stability condition holds which says that information must not travel more than one grid cell per time step, i.e. c t < x
2
22
x
tc
![Page 21: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/21.jpg)
ResultCPU : AMD Athlon™ 3500+ 2.2 GHZGraphics Card: Radeon HD 3650RAM : 1 GAbout 60 fps in grid size of 360 x 360
demo 1 demo 2
![Page 22: 使用波動方程式的擬真 和互動式水面模擬 496410032 吳金龍 Advisor: Damon Shing-Min Liu](https://reader035.vdocuments.mx/reader035/viewer/2022081504/56649ec65503460f94bd17e4/html5/thumbnails/22.jpg)
END
Thanks for listening.