Numerics Blowing Up


I’ve tried yesterday to set up openLB to run my usual model system (super-low reynolds number flow through 2D-channel with some rather complicated obstacles). I calculated this before by modifying the C sample code a lot and it - so far - worked fine.

For openLB, i started out by using the poiseuille2d example. I made the following modifications to the code:

const BoundaryType boundaryType = pressure; //for pressure driven flows

lattice.defineDynamics(nx/2,nx/2+10,ny/2,ny/2+10, &instances::getBounceBack<T,DESCRIPTOR>() );// in iniGeometry, inserting a 10 node obstacle

I’ve set the velocity everywhere to zero, pressure on the left wall to 1.02 and on the right wall to 0.98. So far, it works fine, what I get looks like what I would expect. However, the code is super sensitive if I change the parameters. If I set N>180 the system blows up for t>4000 (on the figures, it looks like some giant velocities are forming on the walls??). If I reduce the Reynolds number below 10, it blows up pretty much instantly. Is there any area of values which you cannot use? I’m a bit flabbergasted since the same simulation works fine in C (slow though, would like to use openlbm to use a quadcore…).

Thanks a lot,


Among the ingredients which affect numerical stability you can play with the initial and the boundary condition. For the boundary condition, you might want to switch between the local and the non-local choice. For the initial condition, you could initialize to a Poiseuille profile. The simulation could also be sensitive to what happens on corners. Depending on whether the top and bottom walls are periodic or no-slip, you may or may not need to add corner boundary nodes. I’d suggest that you browse through the examples and play around with the available parameters.

I had similar problem, I think you are using interpolation BC and BGK with pressure driven flow, if you change it to local/inamuro/zouhe simulation stops generating NAN.

I have experienced something similar using my own code. The reason was a large value of the relaxation parameter. I do not know whether this is the reason in your case. But some boundary conditions produce nans, if tau is too large.

There is also problem with NAN’s if you use forcedBGK instead of pressure driven flow, than with big tau (big \nu) all of the BC fail.

johndoe, what is “big tau” in your case? 1.5, 2, 10? I have encountered problems with Skordos’ BC at tau > 1.8.

Tau a little bit more then 2. for the forcedBGK with inamuroBC.

I see. Just reduce tau then. Or do you have a reason for such a value?

I needed to compare my work with my colleague work, but I’m not sure if he really used that high tau.