jviquerat / lbm Goto Github PK
View Code? Open in Web Editor NEWA simple full-python 2D lattice-boltzmann code
License: MIT License
A simple full-python 2D lattice-boltzmann code
License: MIT License
@jviquerat Regarding the boundary conditions. What I did differently as compared to your code is:
Hi,
Thank you for this great LBM file.
I wish to ask is there anyway to couple LBM with DEM based software like PFC based on Python?
Thank you in advance
Hi @2b-t,
Just to let you know that I spent a bit more time on adding Numba to the code this morning. Eventually managed to cut execution time by 50%, however the code is ugly (see branch numba).
Thanks again for all the help you provided ;) I think I will use the code as is for now (started using it for optimization purposes actually), and at some point I will rewrite it in cpp to get proper performance.
hi,I‘m a beginner of LBM,i want to ask u a basic question, if i want to change the type of the obstacle how can i define my program, after trying several times,it is still something wrong in shape_type.
Hi Jonathan,
I tried to repeat the benchmark calculations with your code and got different values for the drag and lift coefficients.
E.g. for Re = 100 and L_lbm=ny=100 I tried 3 different velocities (original value 0.05; 0.02 and 0.007), i.e. different relaxation rates. The values for the average drag coefficient differ only by around 1% from the 3.5409 that you provide in the README file. However, the average lift coefficient is always around 0.11, falling below the specified value by a factor of 10.
Did you perform these calculations with other parameters than in the uploaded code ('magic parameter' etc.)?
I would also appreciate a comment on the calculation of the drag and lift coefficients. According to your code, they are calculated based on first-order moments of the sum of collision and total distribution functions. According to several sources, it should be second-order moments of the non-equilibrium part of the distribution function (https://journals.aps.org/pre/abstract/10.1103/PhysRevE.79.046704).
Thank you in advance for your reply!
Best,
Yevgeniy
Hi @2b-t,
A small update on IBB, using the "best" interpolation proposed by Bouzidi et. al.
For now I am considering a square in a channel at Re=20. The channel is larger than my previous case, as I was wondering wether the large gradients above and below the obstacle could be a problem for the LB to resolve. I computed a reference value for drag and lift using a very refined Fenics computation.
Things seem a bit better with IBB, although it makes no wonder, at least in this case. It could be due to this specific case, as the measured lift is very low.
On the drag, IBB is barely better than BB (it's a zoom on the end of the graph):
On the lift, we can see a difference, as BB lift does not improve when refining. Still, it seems hard to explain the differences between BB and IBB for ny=100.
The domain is voluntarily short to limit computational time, but I did the same for the Fenics computation.
Hi again @2b-t,
Something I noticed regarding the drag-lift computation, is that my problem seems to be (partially) related to the discretization. Let's consider the same configuration for a cylinder and a square of same lateral size :
Disregarding the normalization/scaling, which is probably wrong :
For the cylinder, final drag and lift = 12.692730642588893 -133.4031935237444
For the square, final drag and lift = 15.570420109494938 -0.06360486760453934
So the absence of symmetry in the application of the MEM yields large errors here, especially in the lift. If I refine the cylinder, I get significant differences in the final drag and lift. There must be a blatant coding mistake somewhere, but I can't locate it.
In line 209
rho[:,0] = (g[0,:,0] + g[1,:,0] + g[2,:,0] +
This seems to be
rho[:,ly] = (g[0,:,0] + g[1,:,0] + g[2,:,0] +
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.