Triple components simulation

Hi guys,

I want to simulate triple-component flow, and now i’m using the showcases/multiComponent2d(c++). I have some questions hope anyone can help me make it clear. THANKS.

  1. should i add another lattice like “middleLattice” besides the “heavyLattice” and “lightLattice” to represent triple components? or should I just add another rho in the class TwoLayerInitializer. like this:

    T rho1 = (T)1;
    T rho2 = (T)2;
    T rho   = (T)0;
    if ( (topLayer && (iY>0.2*ny) ) || (!topLayer && (iY <= 0.1*ny) ) ) {
        rho = rho2;
    else if ( (topLayer && (iY <= 0.1*ny) ) || (!topLayer && (iY > 0.2*ny) ) )  {
        rho = almostNoFluid;
    else {
        rho = rho1;
  2. Does the variable “omega” means the viscosity of fluid? 'cause I found the two components have the same omega(omega=1) in the case given.

  3. How do you differ several different kinds of fluid? using rho and omega?

  4. Another question about the gravity. Is the gravity given to every cell? In my opionion, each cell has a external force—gravity. But why there is a comment “// The setup is: The upper half is initially filled with fluid 1 + random noise, and the lower half with fluid 2. Only fluid 1 experiences a forces, directed downwards.” ----only the upper half experiences the force?

I have been confused by these problems for weeks… THANKS FOR YOU HELP IN ADVANCED!


  1. To simulate a three-component fluids, you need three lattices. Then, the remainder of the code must be adjusted to take into account the presence of the three components.

  2. Omega is related to the viscosity of the fluid. I strongly suggest that you get familiar with the theory of lattice Boltzmann; I have the feeling that you are going to solve a rather tough problem and will need to have some deeper insights in what is going on. Check for books[/url] and for [url=]online documents.

  3. The density and viscosity indeed distinguishes the two components. You can make a further distinction by having a different interaction constant G for each fluid, or by applying the external force (“gravity”) to one of them only.

  4. In physics, gravity certainly acts everywhere. In the simulation we are doing a numerical trick; as the action of gravity on the lower fluid is considered negligible (because it is lighter than the upper fluid), we simply switch off gravity for this fluid. An alternative would have been to implement this fluid with smaller density, but the simulation tends to be numerically unstable when we do this.

Thank you very much, jlatt.