%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% constant.m: consant setting
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Shan Chen Lattice Boltzmann sample in Matlab
% Copyright Wei Gong
% Address: Nottingham NG7 2RD, UK
% E-mail: wei.gong@nottingham.ac.uk
% D2Q9 lattice constants
lx = single(512); % x length of computational domain
ly = single(512); % y length of computational domain
lxy = lx*ly;
tau = single(1); % dimensionless relaxation time
cc = single(1); % speeds
c_squ = cc*cc/3; % square of sound speed
visc = c_squ*(tau - 0.5); % viscosity
t_k = single([4/9 1/9 1/9 1/9 1/9 1/36 1/36 1/36 1/36]); % weighting factors
ps = single([0 4/63 4/63 4/63 4/63 4/135 4/135 4/135 4/135]);
pm = single([1/180 2/945 1/15120 2/945 1/180 2/945 1/15120 2/945 ...
1/180 2/945 1/15120 2/945 1/180 2/945 1/15120 2/945]);
ee = single([0 1 0 -1 0 1 -1 -1 1; % velocity model
0 0 1 0 -1 1 1 -1 -1]);
em = single([2 2 2 1 0 -1 -2 -2 -2 -2 -2 -1 0 1 2 2;
0 1 2 2 2 2 2 1 0 -1 -2 -2 -2 -2 -2 -1]);
% General flow constants
rho = 0.3 + rand(lx, ly);
p = single(zeros(lx, ly)); % pressure
psx = single(zeros(lx, ly)); % mean field potential
u = single(zeros(2, lx, ly)); % velocity
ue = single(zeros(2, lx, ly)); % equilibrium velocity
up = single(zeros(2, lx, ly)); % real fluid velocity
F = single(zeros(2, lx, ly)); % for the interaction between fluid nodes
S = single(zeros(2, lx, ly)); % interaction components between the dluid nodes and solid nodes
ff = single(zeros(9, lx, ly)); % distribution function
psx_re = single(zeros(9, lx, ly)); % psx(x+ei*dt,t)
% parameters in C-S EOS
% G1 = single(-4.9); % original Shan-Chen
% G2 = single(0);
% G1 = single(-20);
% G2 = single(15.1);
G1 = single(-15);
G2 = single(10.1);
rho0 = single(1);