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:
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…).
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 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.