/
1D shallow water model 1D shallow water model

1D shallow water model - PowerPoint Presentation

carla
carla . @carla
Follow
1 views
Uploaded On 2024-02-16

1D shallow water model - PPT Presentation

II Keywords staggered grid flux form Shallow water model Again we consider spatially 1demensional linear equations 2 Staggered grid We use the grid as follows We do not use the information at ID: 1046389

grid xsz tsz boundary xsz grid boundary tsz condition staggered water shallow nonlinear program cyclic zeros speed form hfor

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "1D shallow water model" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

1. 1D shallow water model IIKeywords:staggered gridflux form

2. Shallow water modelAgain, we consider spatially 1-demensional linear equations2

3. Staggered gridWe use the grid as follows:We do not use the information at h(x) to estimate temporal evolution of u(x)3xdxoldh, uh, uh, uh, uh, u

4. Staggered gridWe use the grid as follows:However, there is another choice:4xdxoldh, uh, uh, uh, uh, ux2dxold=dxnewuhuhustaggered grid

5. Staggered gridAdvantageThe staggered grid can reduce computational cost without changing the consistency (i.e. 2nd order)DisadvantageThe shortest wavelength is not 2dx, but 4dx, although the propagation speed of the shortest wave ( = 2dx) is zero in the standard grid5

6. Example of the Matlab program 1/2cleardx=2*5*1000; % 10 kmdt=30; % 30 second g=9.8; % gravitational constantH=1000; % depth in metera=dt./dx;tsz=100; xsz=96/2;h=zeros(xsz,tsz); u=zeros(xsz,tsz);x=dx:dx:dx*xsz; % grid for hx2=x-dx/2; % grid for u% initial conditionh(1:xsz,1)=0.01*sin(2*pi*x*2./16./dx)+H;6

7. Example of the Matlab program 2/27% u h u h u hfor tt=2:tsz if(tt==2) u(2:xsz,tt)=u(2:xsz,tt-1)-g*a*(h(2:xsz,tt-1)-h(1:xsz-1,tt-1)); h(1:xsz-1,tt)=h(1:xsz-1,tt-1)-a*H*(u(2:xsz,tt-1)-u(1:xsz-1,tt-1)); u(1,tt)=u(1,tt-1)-g*a*(h(1,tt-1)-h(xsz,tt-1)); % cyclic BC h(xsz,tt)=h(xsz,tt-1)-a*H*(u(1,tt-1)-u(xsz,tt-1)); else u(2:xsz,tt)=u(2:xsz,tt-2)-2*g*a*(h(2:xsz,tt-1)-h(1:xsz-1,tt-1)); h(1:xsz-1,tt)=h(1:xsz-1,tt-2)-2*a*H*(u(2:xsz,tt-1)-u(1:xsz-1,tt-1)); u(1,tt)=u(1,tt-2)-2*g*a*(h(1,tt-1)-h(xsz,tt-1)); h(xsz,tt)=h(xsz,tt-2)-2*a*H*(u(1,tt-1)-u(xsz,tt-1)); endend

8. Example of the Python program 1/2import numpy as npdx=10000.0 # mdt=30.0 # second g=9.8H=1000.0a=dt/dxxsz, tsz=48, 100h = np.zeros((xsz,tsz))u = np.zeros((xsz,tsz))x = np.arange(0, dx*xsz, dx)x2 = x - dx/2 # grid for u# initial conditionh[0:xsz, 0]=0.01*np.sin(2.0*np.pi*2.0*x/16/dx)+H8

9. Example of the Python program 2/2# u h u h u hfor tt in range(1,tsz): if tt == 1: u[1:xsz,tt]=u[1:xsz,tt-1]-g*a*(h[1:xsz,tt-1]-h[0:xsz-1,tt-1]) h[0:xsz-1,tt]=h[0:xsz-1,tt-1]-a*H*(u[1:xsz,tt-1]-u[0:xsz-1,tt-1]) u[0,tt]=u[0,tt-1]-g*a*(h[0,tt-1]-h[xsz-1,tt-1]) # cyclic BC h[xsz-1,tt]=h[xsz-1,tt-1]-a*H*(u[0,tt-1]-u[xsz-1,tt-1]) else: u[1:xsz,tt]=u[1:xsz,tt-2]-2.0*g*a*(h[1:xsz,tt-1]-h[0:xsz-1,tt-1]) h[0:xsz-1,tt]=h[0:xsz-1,tt-2]-2.0*a*H*(u[1:xsz,tt-1]-u[0:xsz-1,tt-1]) u[0,tt]=u[0,tt-2]-2.0*g*a*(h[0,tt-1]-h[xsz-1,tt-1]) h[xsz-1,tt]=h[xsz-1,tt-2]-2.0*a*H*(u[0,tt-1]-u[xsz-1,tt-1])9

10. Comparison10xxtstandardstaggeredthickness perturbation

11. Boundary conditionIn this example, the boundary condition is cyclic and the grid setting is as followsIn the case of the standard grid, we need the boundary condition both for u and hIf the boundary is not cyclic, but the wall, we only need the boundary condition for either u or h in the staggered grid11xu(x=1)h(x=1)u(x=2)…h(x=xsz)u(x=xsz)

12. Boundary conditionWe try to simulate wave reflection at the boundaryA natural choice of the boundary condition is that u = 0 This boundary condition is equivalent to the free end12Landu(x=1)

13. The boundary condition of u=013xt

14. CFL condition of staggered gridThe grid space (i.e. horizontal resolution) is dx (i.e. 10 km) in this exampleHowever, the CFL condition is not , but14xdx/2uhuhu

15. More realistic problemSo far, we only discuss the linear and flat bottom problemNext, we discuss these two pointsBottom topography effectNonlinear problem15

16. Propagation speed changeIn a deeper area, the propagation speed is faster16xtHh’

17. Nonlinear shallow water modelIt is recalled that the original equations are as follows:Next, we solve these equations without linearization17

18. Nonlinear shallow water model18xu(xdx)h(xdx)u(x)h(x)u(x+dx)dx

19. Example of a part of the program19% u h u h u hfor tt=3:tsz u(2:xsz-1,tt)=u(2:xsz-1,tt-2) ... -2*g*a*(h(2:xsz-1,tt-1)-h(1:xsz-2,tt-1)) ... -a*u(2:xsz-1,tt-1).*(u(3:xsz,tt-1)-u(1:xsz-2,tt-1)); h(2:xsz-1,tt)=h(2:xsz-1,tt-2) ... -2*a*h(2:xsz-1,tt-1).*(u(3:xsz,tt-1)-u(2:xsz-1,tt-1)) ... -0.5*a*(u(3:xsz,tt-1)+u(2:xsz-1,tt-1)).*(h(3:xsz,tt-1) ... -h(1:xsz-2,tt-1));endThe program becomes much more complex ...

20. Comparison20xhlinear, nonlinear

21. Flux formThe nonlinear shallow water equation can be also written as follows:This form is called the flux formIn general, the flux form is better to conserve a property such as energy or water volume 21

22. ExampleNonconservative property often induces an unstable conditionIn general, nonlinear equations are relatively unstable22kinetic energytime stepbottom topographyxinitial h