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

Red_and_Blue_Fluids.m
% FLUID PROPERTIES (2 IMISCIBLE FLUIDS) physical properties
%dPdL= Pressure / dL;% External pressure gradient [atm/cm]
cP_visco_B=1; % [cP] 1 CP water viscosity 20 C
cP_visco_R=1;
density=1; % fluid density
%lattice prop.s
cs2=1/3; % omega: relaxation frequency
tauB=1.2; % set relaxation time 
omegaB=1./tauB; 
nuK_lb_B=(1./6)*(2*tauB-1) ; % Kinem visco in lb units 
nuK_lb_R= nuK_lb_B.*(cP_visco_R./cP_visco_B); % m
tau_R=0.5*(6.*nuK_lb_R+1);
omegaR=(tau_R).^-1; 

mu_w2mu_o=cP_visco_B./cP_visco_R;
%mu_w2mu_o1=nuK_lb_B./nuK_lb_R;
%omegaR=0.8; % Red
%omegaB=0.8; % Blue
% colour composition i.e. amount of Red and Blue colors at start
%fct_Red=0.30; % volumetric fraction of Red fluid
fct_Blue=1-fct_Red; % fraction Blue fluid
%Sigma=0.0002; % surface tension parameter
%min_M_Grad =1.e-3; % min gradient for re-colouring
%Ades_R_B=-1; 
%Ades_RNB=0.5 % if red is on the surface of the dry area

%
N_c=9;

% declarative statemets related to the 2 fluids 
f= zeros(Nr,Mc,N_c); % array of fluid density distribution
Red=zeros(Nr,Mc,N_c); % e.g. oil 
Blue=zeros(Nr,Mc,N_c); % e.g. water 
rho=zeros(Nr,Mc); % macro-scopic density
rhoR=zeros(Nr,Mc,'double');  rhoB=zeros(Nr,Mc,'double'); % also for the 2 fluids
rhoR_B=zeros(Nr,Mc,'double'); %
Conc_fct=zeros(Nr,Mc); %
temp1=zeros(Nr,Mc,9);
temp1x=zeros(Nr,Mc);

Contact us