5
$\begingroup$

I'm struggling to get a working LBM reaction-diffusion implementation. I have a pretty weak mathematics and physics background, and thus I'm having a hard time understanding the notations around the BGK operator. I would like to know if I understood the basics correctly.

Right now, what I'm doing is the following (v is the diffusive species I'm interested in), on a D2Q5 grid, in pseudo-code:

v[0, :] = initial_condition
t = 0
while t < t_max:
    for each node x:
        compute a pseudo (pre-collision?) dv[x]/dt using the forward Euler method
    for each node x:
        real dv[x]/dt = 1/3 * dv[x]/dt
                        + 1/6 * dv[left of x]/dt
                        + 1/6 * dv[right of x]/dt
                        + 1/6 * dv[above x]/dt
                        + 1/6 * dv[below x]/dt
        (if x is on a domain boudary, use bounce-back condition)
        v[t, x] += dv[x]/dt
    t += dt

Is this correct, theory-wise, or am I missing something?

Thanks for any help. I'm happy to share my code if anyone wants to go this far to help me. Once I'll have it working (probably in python), I will distribute it without conditions.

$\endgroup$
  • $\begingroup$ It might help to look at this document which contains all the theory as well as a simple implementation at the very end I believe. I'm not very familiar with the method, so I don't know how helpful that really is. $\endgroup$ – jheindel Apr 10 '17 at 18:20
  • $\begingroup$ Thanks for the link, I'm reading it right now but I believe what I need is much simpler than the real lattice-boltzmann method for CFD. I guess I need to take some physics MOOC... $\endgroup$ – nicoco Apr 11 '17 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.