# 1D Burgers DGP0 TVD code: Dispersing a lot!

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 10, 2017, 05:13 1D Burgers DGP0 TVD code: Dispersing a lot! #1 New Member   Ayush Agrawal Join Date: Jun 2014 Posts: 16 Rep Power: 10 Hey Guys! I have made a code to solve a very simple Burger's equation problem, using TVD 3 stage, upwind scheme. Wave velocity a=1. Since upwind is a perfect shift for this equation, I should be retaining the flow structure as it changes. Instead, it is dispersing, eventually becomes a sine wave. I have tried the single stage, and it works perfectly, so I am pretty sure there are some problems with my equation for TVD. I have referred quite a few books and have not been able to figure out the cause of the dispersion yet. I would really, really appreciate any help in this matter. BTW ntime is the time in seconds and I am trying to solve the flow for 100 mesh size. Increasing the mesh size does retain the structure, but a change in temporal scheme should not significantly affect the structure of the wave according to me. What do you think? Last edited by ayushmorx; March 11, 2017 at 18:53.

 March 10, 2017, 07:15 #2 Senior Member   Filippo Maria Denaro Join Date: Jul 2010 Posts: 6,290 Rep Power: 67 First, post your solution with the details and then explain your doubts. Second, the exact solution you get for the upwind is or the linear case at cfl=1. The Burgers euqation is non linear and you cannot fulfill the exact shift requirement on all nodes.

March 10, 2017, 14:40
#3
New Member

Ayush Agrawal
Join Date: Jun 2014
Posts: 16
Rep Power: 10
Here is the solution. My Burger's equation is Ut+Ux=0 Ut is time derivative and flux is just U, with wave speed 1. So it is linear here. The exact solution is pretty much the same as that shown in the one stage. I have used RK3 tvd here.

I have used cfl=1 globally everywhere, and computed the time step using this. All the values are for time=1s, and the domain is 1m in size. Thing is, I am thinking the perfect shift should take place regardless of 3 stage or 1 stage since essentially my discretization remains the same. This is not reflected here. But when I increase the space and time discretization the shift accuracy improves quite a lot, which doesn't really make sense to me since the cfl is the same.

@FMDenaro
Attached Images
 1 stage.jpeg (44.1 KB, 12 views) tvd 3stage.jpeg (46.4 KB, 9 views) tvd 3stage higher mesh size.jpeg (47.8 KB, 8 views)

Last edited by ayushmorx; March 10, 2017 at 14:52. Reason: Extra Details

 March 10, 2017, 16:32 #4 Senior Member   Filippo Maria Denaro Join Date: Jul 2010 Posts: 6,290 Rep Power: 67 However, this is not called Burgers equation but it is simply a first order linear PDE. Check first the first order upwind scheme at cfl=1, it must work otherwise you have a bug for sure. Then, when using a second order TVD scheme the flux is modified also for the linear case so that the exact shift could be not result.

 March 10, 2017, 16:43 #5 New Member   Ayush Agrawal Join Date: Jun 2014 Posts: 16 Rep Power: 10 The first order is working fine for CFL=1, so there isn't a bug there I guess. I am using the SSP TVD scheme described here http://www.ams.org/journals/mcom/199...98-00913-2.pdf for my code. It has optimal co-effcients for cfl=1, see eqn 3.3, and I am trying to reproduce that condition, so I should get the exact shift no?

 March 13, 2017, 06:21 #6 Member   Anh Join Date: Sep 2014 Posts: 69 Rep Power: 10 He, ayushmorx I also using TVD for my code. In TVD, there is the minmod function compute at grig point i-1/2,i+1/2 and i+3/2. At the boundary (inlet, outlet, wall), How do you compute the minmod function (There is no grid point out of domain at inlet, outlet or wall)?

 March 13, 2017, 07:10 #7 New Member   Ayush Agrawal Join Date: Jun 2014 Posts: 16 Rep Power: 10 Hey Anh, I am not aware of the approach you have taken, and do not know about minmod. Can you explain it further? Regardless, i gather that you are looking for an extra grid point out of the domain. you can simply generate a ghost cell for such cases. Not sure of the question though.

 Tags 1 dimensional, burgers equation, fluid dynamics, temporal scheme