Is it possible to use LBunits object to the cylinder2d example instead define nx,ny, omega, nu directly?

I understand that the viscosity and other parameters are computed from the resolution, lattice u and Re number, but as in example the viscosity is computed not from the “lattice resolution”, but from the size of the round obstacle. Should I write my own class with similar interface to the lbunits but computing parameters “differently” or is it possible to use it but with some different calculation concerning lx,ly?


Yes, you can use the converter LBunits for this problem. It is really the same to use the LBunits class or to do the computations manually. LBunits is just computing simple rules of three to convert between either system of units while keeping the Reynolds number Re constant:

Re = u*L/nu

In lattice units, L corresponds to the resolution of the reference length. I don’t remember the details of cylinder2d.cpp, but from your question, I conclude that the reference length in the cylinder2d example is chosen to be the diameter of the obstacle. In that case, “lattice resolution” and “diameter of the obstacle counted in terms of number of cells” are synonymous terms.