# Bug in my Lax-Wendroff solver?

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

 April 8, 2008, 03:05 Bug in my Lax-Wendroff solver? #1 chris Guest   Posts: n/a Hi, I am trying to implement a one step and a two-step (predictor-corrector) Lax-Wendroff solver. The one step method works perfectly, but the two-step-method produces heavy oscillations near the boundaries (dirichlet conditions) and in the vicinity of the shock when trying to solve the shock tube problem. Here some code... The timestep is chosen such that the CFL condition is satisfied. void Solver::updateLW1(double const& dt) { u0=u; for(unsigned i = 1; i < nx - 1; ++i) u[i] = 0.5*(u0[i+1] + u0[i-1]) - 0.5*dt/dx*(flux(i+1, u0)-flux(i-1, u0)) - dt*rhs(i, u0); } void Solver::updateLW2(double const& dt) { // predictor for(unsigned i = 1; i < nx - 1; ++i) u0[i] = 0.5*(u[i+1] + u[i]) - 0.5*dt/dx*(flux(i+1, u)-flux(i, u)) - 0.25*dt*(rhs(i+1, u)+rhs(i, u)); // corrector for(unsigned i = 1; i < nx - 1; ++i) u[i] = u[i] - dt/dx*(flux(i+1, u0)-flux(i-1, u0)) + dt*rhs(i, u0); } Can anyone give me a hint or a link to an implementation of the predictor corrector LW-method? Cheers, Chris

 April 8, 2008, 07:31 Re: Bug in my Lax-Wendroff solver? #2 chris Guest   Posts: n/a I just solved the problem by myself. It should be flux(i, u0) instead of flux(i+1, u0) in the corrector step.

 July 8, 2009, 13:32 #3 Member   Nishant Kumar Join Date: Jun 2009 Posts: 32 Rep Power: 10 HI Chris, Can you please send me the 1D code for shock tube problem at babuu.nishu@gmail.com? I need it for my research. Thanks alot Nishant

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post sankarv OpenFOAM Running, Solving & CFD 17 December 3, 2014 20:41 SamCanuck FLUENT 2 August 31, 2011 11:34 Luiz CFX 4 March 6, 2011 21:02 bearcat CFX 6 April 28, 2008 14:08 cfd guy CFX 4 May 8, 2001 06:04

All times are GMT -4. The time now is 13:01.