Code covered by the BSD License  

Highlights from
immiscible LB

immiscible LB

by

 

23 Jul 2009 (Updated )

Implements Immiscible Lattice Boltzmann (ILB, D2Q9) method for two phase flows

F_BGK_EQUI_D2Q9_mat2d.m
%  BGK equilibrium D2Q9
            % feq=zeros(lena,9);
            rhoij=rho(ija); uxija=ux(:)./rhoij; uyija=uy(:)./rhoij;
            
            %uxsq=uxija.^2; uysq=uyija.^2; usq=uxsq+uysq; %
            uxsq=uxija.*uxija; uysq=uyija.*uyija; usq=uxsq+uysq; %


           % weighted densities : rest particle, principal axis, diagonals
           % BKG Equilibrium distribution
          
             feq(:,1)= w1*rhoij.*(1 +f1.*uxija +f2.*uxsq -f3.*usq);  %f(i,j,1) 
             feq(:,2)= w1*rhoij.*(1 +f1*uyija +f2*uysq -f3*usq); %2
             feq(:,3)= w1*rhoij.*(1 -f1*uxija +f2*uxsq -f3*usq); % 3
             feq(:,4)= w1*rhoij.*(1 -f1*uyija +f2*uysq -f3*usq); %4
             feq(:,5)= w2*rhoij.*(1 +f1*(+uxija+uyija) +f2*(+uxija+uyija).^2 -f3.*usq); %5 
             feq(:,6)= w2*rhoij.*(1 +f1*(-uxija+uyija) +f2*(-uxija+uyija).^2 -f3.*usq);
             feq(:,7)= w2*rhoij.*(1 +f1*(-uxija-uyija) +f2*(-uxija-uyija).^2 -f3.*usq);
             feq(:,8)= w2*rhoij.*(1 +f1*(+uxija-uyija) +f2*(+uxija-uyija).^2 -f3.*usq); % 8
             feq(:,9)= w0*rhoij.*(1 - f3*usq); %f(i,j,9) 9

          %%%%

            

Contact us