Has there been any work done about implementing dynamics for a binary fluid, for example the Shan-Chen model? To be clear, this model would require 2 sets of distribution functions that each undergo collision and streaming. Also, there is an interaction force between the fluids that depends on neighboring densities of the two fluids.

Some specific questions:

Is the code in its current state able to incorporate 2 sets of distribution functions?

I assume that a new dynamics module would need to be written, but this shouldn’t be hard, right?

Will there be any complicating issues for parallel usage? (will multiBlock____ files work with this model?

Oooops. I answered in the wrong place maybe also. If you have any further questions post them here instead (otherwise I will do the mistake also again…).

thanks for the response on the other forum. I am interested to know some details about the implementation. Could you provide some details about what you are changing, i.e. new methods, objects, etc? Thanks!

The big picture with multi-component fluids is as follows. You have essentially the choice between implementing all components on the same lattice or using a different lattice for each of them. The first case could be slightly more efficient, but the second case is more general and prevents you from redefining a new lattice structure and so on. We have had several discussions on which approach to adopt in OpenLB, and we’ve decided to go for the second one for various reasons. To summarize, this is probably the only way to keep the code user-friendly and extensible.

In the Shan-Chen model, there are two ingredients to coupling the components together. One is the velocity, which is computed as a moment of all particle populations and of all components taken together. The second is a forcing term that accounts for intermolecular repulsion. An efficient way of doing is to compute these during a post-processing step, store them in an external scalar, and then access them during collision. The only thing you need to make sure is to add the post-processing via addLatticeCoupling, and not addPostProcessor, to guarantee a proper treatment in the parallel case. Orestis has implemented the model, and I think it works in sequential program execution, but not in parallel. That’s the bad news, because it’s my job to fix this sigh. I hope we’re over this soon and can add Shan-Chen to the release.

Hehe… I wish it would be ready in two weeks but think it will be ready in three. Now, I’ve read about a study which has shown that predictions on code development are almost always off by a factor two, so my guess is six weeks…