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

Add_Body_Force.m
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
            if(0)
            if any (abs(Bforce) > 0), 
                %add external Body force, example due to the pressure gradient dPdL
                for ic=1:N_c;%
                    for ia=1:lena
                        i=iawet(ia);  j=jawet(ia);
                        % if Obstacles(i,j)==0 % the i,j is not aderent to the boundaries
                        % if ( f(i,j,ic) + Bforce(ic) ) >0; %! avoid negative distributions
                        %i=1 ;% Bforce only on the first row !
                        %f(i,j,ic) = f(i,j,ic)  + Bforce(ic);
                        Red(i,j,ic) = Red(i,j,ic)  + Bforce(ic);
                        Blue(i,j,ic)= Blue(i,j,ic) + Bforce(ic); 
                        % end
                        % end
                    end
                end
            end % in any Bforce >0
            end% if(0/1)
            
            if(1)
                
             if any (abs(Bforce) > 0), 
                %add external Body force, example due to the pressure gradient dPdL
                for ic=1:N_c-1;
                    if(abs(Bforce(ic)>0))
                    ijc=ija + NxM*(ic-1); % corrente 
                       % f(ijc) = f(ijc)  + Bforce(ic);
                        Red(ijc) = Red(ijc)  + Bforce(ic);
                        Blue(ijc)= Blue(ijc) + Bforce(ic); 
                    end
                end
            end % in any Bforce >0   
                
                
            end
            

Contact us