|
[Sponsors] |
April 8, 2008, 04:05 |
Bug in my Lax-Wendroff solver?
|
#1 |
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, 08:31 |
Re: Bug in my Lax-Wendroff solver?
|
#2 |
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, 14:32 |
|
#3 |
Member
Nishant Kumar
Join Date: Jun 2009
Posts: 32
Rep Power: 16 |
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 | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Creating New Solver: For particle-laden compressible jets | sankarv | OpenFOAM Running, Solving & CFD | 17 | December 3, 2014 20:41 |
Quarter Burner mesh with periosic condition | SamCanuck | FLUENT | 2 | August 31, 2011 12:34 |
Working directory via command line | Luiz | CFX | 4 | March 6, 2011 21:02 |
why the solver reject it? Anyone with experience? | bearcat | CFX | 6 | April 28, 2008 15:08 |
Error during Solver | cfd guy | CFX | 4 | May 8, 2001 07:04 |