Dear all
in simulation of separation of two phase in fully periodic domain for two immiscible fluid using Shan and Chen model based on Sukop’s book we should apply another loop for components and we have in each point two density distribution function, is this logical?

you can take a look at a matlab ShanChen MPMC example code at this page:
http://www.lbmethod.org/numerics:matlab_samples

In the MCMP ShanChen method, each different distribution function represents a fluid phase. Different fluid phases interact between them because of interparticle forces that mimic the effect of repulsive or attractive forces between the distribution functions.
If you think in term of the molecular description that is often given to the LB method, you can think of the of the MCMP as representative of molecules of different chemical species that interact between them. For miscible fluid the interparticle forces are not strong enough to allow for phases separation, where, for immiscible fluids (or species), the particle forces (in the most used case repulsive forces between particle of different chemical species) can trigger phase separation with the formation of a fluid-fluid interface .

You wrote
we have in each point two density distribution function, is this logical?

I’m not 100% sure about you question … but I would answer…

well yes … the particle distribution function tells you in some way the probability of having a particle of a chemical species at a given lattice node. Let’s have two immiscible chemical species … A and B . If the particle distribution function(s) of the chemical species A (better to look in terms of macroscopic density of the chemical species A maybe) at a given lattice node x approaches zero, it basically means that at A, at the lattice node x, is absent. If you look at B now, you would probably find a finite concentration (density, particle distribution function not close to zero) of fluid B.

You see what I mean ??

Good Luck
Andrea

Dear Andrea
Tnx alot. it was very helpfull. some quaetion remain with multiphase that i ask you after i complete my Code.

Regards

Dear Andrea
i just want to apply wall in my code for simulation of oil-water droplet on solid surface (I think low density ratio) there some difficulty here choosing Gads for solid in such a way that one of phase is completely wetting(completely G’s are ambiguous for me). when I apply body force everything ruin and i have a constant density every where? i think the problem is in choosing Gs. if I’m wrong please correct me

Dear Andrea
i just want to apply wall in my code for simulation of oil-water droplet on solid surface (I think low density ratio) there some difficulty here choosing Gads for solid in such a way that one of phase is completely wetting(completely G’s are ambiguous for me). when I apply body force everything ruin and i have a constant density every where? i think the problem is in choosing Gs. if I’m wrong please correct me

take a look at this paper:

Phys. Rev. E 76, 066701 (2007) [6 pages]
Proposed approximation for contact angles in Shan-and-Chen-type multicomponent multiphase lattice Boltzmann models.
Haibo Huang,1 Daniel T. Thorne, Jr.,2 Marcel G. Schaap,3 and Michael C. Sukop1

I’m sure that this is the right paper for you … (If you haven’t seen it yet) …

Try without body force first and see if, by changing the adhesion constants, you can get different contact angles as Huang does in this paper.
If you get results that make sense then add the body force too (look at eq. 3 of this paper. F_\sigma can be equal to:
F_{\sigma}= F_{cohesion} + F_{adhesion}+ F_{body force}.

I hope it helps.
Good luck

Andrea

Dear Andrea
Thank you very much
it’s clear everything for me. this is the first time i see this paper.

Kind Regards

Dear Andrea

the link which you have pasted in your message (lbmmethod.org)is not working.

My problem is that i have written a LBM code to model MCMP.
But after some 200 odd iterations , it is giving some garbage values of both the densities at all the points.
Actually the garbage values start at corners aft some 20 iterations and by the time 300 iterations is reached, there is garbage value everywhere…
I am using the Periodic Boundary Conditions with singularity at the nodes.
the code for the Boundary Conditions are as follows:

int subs,i,j;
for(subs=0;subs<2;subs++)
{
for(i=1;i<nx-1;i++)
{
df[subs][4][i][ny-1]=df[subs][4][i][0];
df[subs][7][i][ny-1]=df[subs][7][i][0]; /* Periodic BC at the top*/
df[subs][8][i][ny-1]=df[subs][8][i][0];
}
for(i=1;i<nx-1;i++)
{
df[subs][2][i][0]=df[subs][2][i][ny-1];
df[subs][5][i][0]=df[subs][5][i][ny-1]; /* Periodic BC at the bottom*/
df[subs][6][i][0]=df[subs][6][i][ny-1];
}
for(j=1;j<ny-1;j++)
{
df[subs][1][0][j]=df[subs][1][nx-1][j];
df[subs][5][0][j]=df[subs][5][nx-1][j]; /* Periodic BC at the east boundary*/
df[subs][8][0][j]=df[subs][8][nx-1][j];
}
for(j=1;j<ny-1;j++)
{
df[subs][3][nx-1][j]=df[subs][3][0][j];
df[subs][6][nx-1][j]=df[subs][6][0][j]; /* Periodic BC at the west Boundary*/
df[subs][7][nx-1][j]=df[subs][7][0][j];
}
// At Bottom Left Corner
df[subs][1][0][0]=df[subs][1][nx-1][0];
df[subs][2][0][0]=df[subs][2][0][ny-1];
df[subs][6][0][0]=df[subs][6][0][ny-1];
df[subs][8][0][0]=df[subs][8][nx-1][0];
df[subs][5][0][0]=df[subs][7][0][0];
// At bottom Right Corner
df[subs][2][nx-1][0]=df[subs][2][nx-1][ny-1];
df[subs][3][nx-1][0]=df[subs][3][0][0];
df[subs][7][nx-1][0]=df[subs][7][0][0];
df[subs][5][nx-1][0]=df[subs][5][nx-1][ny-1];
df[subs][6][nx-1][0]=df[subs][8][nx-1][0];
//At Top Left Corner
df[subs][4][0][ny-1]=df[subs][4][0][0];
df[subs][5][0][ny-1]=df[subs][5][nx-1][ny-1];
df[subs][7][0][ny-1]=df[subs][7][0][0];
df[subs][1][0][ny-1]=df[subs][1][nx-1][ny-1];
df[subs][8][0][ny-1]=df[subs][6][0][ny-1];
//At Top Right Corner
df[subs][8][nx-1][ny-1]=df[subs][8][nx-1][0];
df[subs][6][nx-1][ny-1]=df[subs][6][0][ny-1];
df[subs][3][nx-1][ny-1]=df[subs][3][0][ny-1];
df[subs][4][nx-1][ny-1]=df[subs][4][nx-1][0];
df[subs][7][nx-1][ny-1]=df[subs][5][nx-1][ny-1];
}

Am I correct in implementing the Periodic BCs.