Fuel Gas Diffusion
clc
clear
KB=1.380658*10^(-23);
M=100;
dx=1;
dy=1;
dz=1;
VV=dx*dy*dz;
AVGADO=6.022*10^23;
P=1.01*10^(5);
RA=0.7;
RB=0.3;
PA=RA*P;
PB=RB*P;
% B=CH4(3.758) + A=AIR(3.711) OR CO2 + AIR
% pV = nRT ;
% T=31+273=304K
% p=1.4*1.01*10^5
% V= 1m^3
% n= 1.4*1.01*10^5*1/8.314*304=55.95moles
% 1 mole contains 6.022*10^23 molecules
% So result 3.369*10^25molecules
% 2) in 1.8m^3 there are in moles 55.95*1.8=100.8moles
% and so 25.2 moles of O2 and 75.6 moles of N2
% mass of O2 25.2*32=806g
% mass of N2 75.6*28=2117g
a=29;
b=44;
for i=1:M
MAAAA(i)=a;
MBBBB(i)=b;
MAA(i)=806;
MBB(i)=2117;
MAAA(i)=MAA(i)/MAAAA(i);
MBBB(i)=MBB(i)/MBBBB(i);
NA(i)=MAAA(i)/RA;
NB(i)=MBBB(i)/RB;
end
for i=1:M
PP(i)=PA;
TT(i)=273+20;
V(i)=VV;
R(i)=8.314;
NMOLES(i)=(PP(i)*V(i))/(R(i)*TT(i));
TOT_NMOLES(i)=NMOLES(i)*AVGADO;
end
SEKMAA=3.711;
SEKMAB=3.758;
SKMA=0.5*(SEKMAA+SEKMAB);
for i=1:M;
T(i)=273+0.00001*randn(1,1);
P(i)=1.01*10^5;
MA(i)=28.97;
NA(i)=1;
VAVG(i)=(8*KB*T(i)/(pi*MA(i)))^(0.5);
ZA(i)=0.25*(TOT_NMOLES(i)/V(i))*VAVG(i);
LAMDA(i)=(((2)^(0.5))*pi*(TOT_NMOLES(i)/V(i))*(SKMA)^2)^(-1);
DAB(i)=(2/3)*((((KB)^3)*T(i)/((pi^3)*MA(i)))^0.5)*(T(i)/(((SKMA)^2)*P(i)));
end
scrsz = get(0,'ScreenSize');
figure('Position',[20 20 1500 700])
subplot 231
plot(DAB,'r')
Xlabel('Number of Samples')
ylabel('DAB (m/s)')
grid on
subplot 232
plot(TOT_NMOLES)
Xlabel('Number of Samples')
ylabel('TOTAL NUMBER OF MOLECULES (Moles)')
grid on
subplot 233
plot(NMOLES)
Xlabel('Number of Samples')
ylabel('NUMBER OF MOLECULES (Moles)')
grid on
subplot 234
plot(T)
Xlabel('Number of Samples')
ylabel('T (k)')
grid on
subplot 235
plot(VAVG)
Xlabel('Number of Samples')
ylabel('VAVG (m/s)')
grid on
pause(10)
close all
clear
KB=1.380658*10^(-23);
M=100;
dx=1;
dy=1;
dz=1;
VV=dx*dy*dz;
AVGADO=6.022*10^23;
P=1.01*10^(5);
RA=0.7;
RB=0.3;
PA=RA*P;
PB=RB*P;
% B=CH4(3.758) + A=AIR(3.711) OR CO2 + AIR
% pV = nRT ;
% T=31+273=304K
% p=1.4*1.01*10^5
% V= 1m^3
% n= 1.4*1.01*10^5*1/8.314*304=55.95moles
% 1 mole contains 6.022*10^23 molecules
% So result 3.369*10^25molecules
% 2) in 1.8m^3 there are in moles 55.95*1.8=100.8moles
% and so 25.2 moles of O2 and 75.6 moles of N2
% mass of O2 25.2*32=806g
% mass of N2 75.6*28=2117g
a=29;
b=44;
for i=1:M
MAAAA(i)=a;
MBBBB(i)=b;
MAA(i)=806;
MBB(i)=2117;
MAAA(i)=MAA(i)/MAAAA(i);
MBBB(i)=MBB(i)/MBBBB(i);
NA(i)=MAAA(i)/RA;
NB(i)=MBBB(i)/RB;
end
for i=1:M
PP(i)=PA;
TT(i)=273+20;
V(i)=VV;
R(i)=8.314;
NMOLES(i)=(PP(i)*V(i))/(R(i)*TT(i));
TOT_NMOLES(i)=NMOLES(i)*AVGADO;
end
SEKMAA=3.711;
SEKMAB=3.758;
SKMA=0.5*(SEKMAA+SEKMAB);
for i=1:M;
T(i)=273+0.00001*randn(1,1);
P(i)=1.01*10^5;
MA(i)=28.97;
NA(i)=1;
VAVG(i)=(8*KB*T(i)/(pi*MA(i)))^(0.5);
ZA(i)=0.25*(TOT_NMOLES(i)/V(i))*VAVG(i);
LAMDA(i)=(((2)^(0.5))*pi*(TOT_NMOLES(i)/V(i))*(SKMA)^2)^(-1);
DAB(i)=(2/3)*((((KB)^3)*T(i)/((pi^3)*MA(i)))^0.5)*(T(i)/(((SKMA)^2)*P(i)));
end
scrsz = get(0,'ScreenSize');
figure('Position',[20 20 1500 700])
subplot 231
plot(DAB,'r')
Xlabel('Number of Samples')
ylabel('DAB (m/s)')
grid on
subplot 232
plot(TOT_NMOLES)
Xlabel('Number of Samples')
ylabel('TOTAL NUMBER OF MOLECULES (Moles)')
grid on
subplot 233
plot(NMOLES)
Xlabel('Number of Samples')
ylabel('NUMBER OF MOLECULES (Moles)')
grid on
subplot 234
plot(T)
Xlabel('Number of Samples')
ylabel('T (k)')
grid on
subplot 235
plot(VAVG)
Xlabel('Number of Samples')
ylabel('VAVG (m/s)')
grid on
pause(10)
close all
Unless otherwise noted, all content on this site is @Copyright by Ahmed Al Makky 2012-2013 - http://cfd2012.com