Tải bản đầy đủ (.pdf) (14 trang)

bài toán CODE ANSYS - MATLAB

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (111.4 KB, 14 trang )




GVHD: PGS.TS Trương Tích Thiện SVTH: Võ Kiên Truân


62

PHỤ LỤC
***

% __________________________Bài toán 1a______________________
% Problem 1D, Gaussian equation
% Emission concentration (x,y=0,z=0)
% connect to Function "Library2(j,x)"
global sy sz p
% Input______________________________________________
h=68.58; D=3.81; M=47.25; u_ref=2.5; u_kt=12.2;
T_kt=394.3; T_mt=291.48; P=1000;
% Solve_____________________________________________
count=100;
x=linspace(0.1,5000,count);
y=0;
% + dispersion parameter sma_y, sma_z
for i1=1:6
for i2=1:count
j=i1;
xx=x(i2);
Library2(j,xx);
u(i1)=u_ref* (h/10)^p; % the stack height wind speed
% plume rise


dta_h=u_kt* D/u(i1)* (1.5+ 2.68*10^(-3)*P*D*(T_kt-T_mt)/T_kt);
%
H(i1)=h+dta_h;
%---------
sma_y(i1,i2)=sy;
sma_z(i1,i2)=sz;
end
end
clear i1;
clear i2;
% + emission concentration (x,y=0,z=0)
for i1=1:6
for i2=1:count
C_x(i1,i2)=M/(2*pi* sma_y(i1,i2)* sma_z(i1,i2))*...
exp(-(H(i1)^2/(2* (sma_z(i1,i2)^2))));
end
end
clear i1; clear i2;
% + Plot____________
for i1=1:6
plot(x,C_x(i1,:),'LineWidth',i1/2);
hold on;
grid on;
end



GVHD: PGS.TS Trương Tích Thiện SVTH: Võ Kiên Truân



63

%_________________________Bài toán 1b_______________________
% Problem 2D, Gauss
% connect to function "Library2(j,x)"
global sy sz p
% Input_____________________________________________________
h=68.58; D=3.81; M=47.25;
u_ref=2.5; u_kt=12.2;
T_kt=394.3; T_mt=291.48; P=1000;
% Solve____________________________________________________
% + distance x,y
count=100;
x=linspace(0.1,5000,count); y=linspace(-1000,1000,count);
% + dispersion parameter sma_y, sma_z
j=1;
for i=1:count
xx=x(i);
Library2(j,xx);
u=u_ref* (h/10)^p;
%--------- effective stack height
% plume rise
dta_h=u_kt* D/u* (1.5+ 2.68*10^(-3)*P*D*(T_kt-T_mt)/T_kt);
%
H=h+dta_h;
%--------------------------------------
sma_y(i)=sy; sma_z(i)=sz;
end
clear i;
% + emission concentration (x,y, z=0)

for i1=1:count % loop x
for i2=1:count % loop y
C_xy(i1,i2)= M/(2*pi* sma_y(i1)* sma_z(i1))*...
exp(-(H^2/(2* (sma_z(i1)^2)))) *...
exp(-(y(i2)^2/(2* (sma_y(i1)^2))));
end
end
clear i1; clear i2;
% + Plot___________________________________________
i=1;
if i==1
meshz (y,x,C_xy)
axis([min(y) max(y) 0 max(x) 0 6*10^(-4)])
view(96,8)
else
meshc (y,x,C_xy)
hold on
daspect([1 1 1])
view(-270,90)
end
function Library2a(j,x)



GVHD: PGS.TS Tröông Tích Thieän SVTH: Voõ Kieân Truaân


64

%________________________Library2a_______________________

% Ap dung de tinh sma_y, sma_z tai khu vuc do thi
global sy sz p
Y=[0.32*x*(1+0.0004*x)^(-1/2)
0.32*x*(1+0.004*x)^(-1/2)
0.22*x*(1+0.004*x)^(-1/2)
0.16*x*(1+0.004*x)^(-1/2)
0.11*x*(1+0.004*x)^(-1/2)
0.11*x*(1+0.004*x)^(-1/2)];
sy=Y(j);

Z=[0.24*x*(1+0.001*x)^(-1/2)
0.24*x*(1+0.001*x)^(-1/2)
0.20*x
0.14*x*(1+0.003*x)^(-1/2)
0.08*x*(1+0.015*x)^(-1/2)
0.08*x*(1+0.015*x)^(-1/2)];
sz=Z(j);

hs_p= [0.15; 0.15; 0.2; 0.25; 0.3; 0.3];
p=hs_p(j);

%________________________Library2b_______________________
% Ap dung de tinh sma_y, sma_z tai khu vuc nong thon
global sy sz p
Y=[0.22*x*(1+0.0001*x)^(-1/2)
0.16*x*(1+0.001*x)^(-1/2)
0.11*x*(1+0.001*x)^(-1/2)
0.08*x*(1+0.001*x)^(-1/2)
0.06*x*(1+0.001*x)^(-1/2)
0.04*x*(1+0.001*x)^(-1/2)];

sy=Y(j);

Z=[0.2*x
0.12*x
0.08*x*(1+0.0002*x)^(-1/2)
0.06*x*(1+0.0015*x)^(-1/2)
0.03*x*(1+0.0003*x)^(-1)
0.016*x*(1+0.0003*x)^(-1)];
sz=Z(j);

hs_p= [0.15; 0.15; 0.2; 0.25; 0.3; 0.3];
p=hs_p(j);









GVHD: PGS.TS Trương Tích Thiện SVTH: Võ Kiên Truân


65

%_________________________Bài toán 2_____________________

! MÔ HÌNH 2a
/units,si

/prep7
!
rect,0,2000,0,500
rect,500,900,0,100 ! building 1
rect,1400,2000,0,150 ! building 2
ASBA,1,2
ASBA,4,3
!+
lsel,s,,,1
lsel,a,,,11
lesize,all,,,20
lsel,s,,,4
lsel,a,,,13
lesize,all,,,25
lsel,s,,,3
lesize,all,,,100
lsel,s,,,5
lesize,all,,,35
lsel,s,,,6,8,2
lesize,all,,,5
lsel,s,,,7
lesize,all,,,20
lsel,s,,,12
lesize,all,,,5
!+
et,1,FLUID141

!+ Meshing
asel,s,,,1
mshkey,0

amesh,1

!+ Boundary Conditions
! Veclocity
lsel,s,,,5,8
lsel,a,,,11,12
lsel,a,,,13
nsll,,1
d,all,VX,0
d,all,VY,0
! Pressure
lsel,s,,,1,3
nsll,,1
d,all,pres,0
! Velocity fluctuation
!$ Value $
u_ref=9 ! velocity reference
p=0.15 ! coefficent p
!
lsel,s,,,4
nsll,,1
d,all,VY,0
*GET,ND_MAX,NODE,,COUNT
*GET,NN,NODE,,NUM,MIN
*DO,I,1,ND_MAX
y=ny(nn)
d,nn,VX,u_ref*(y/10)**p
nn=ndnext(nn)
*ENDDO
alls

/solu
! FLOTRAN Analysis Parameters
fldata14,temp,nomi,23
fldata7,prot,dens,air-si
fldata7,prot,visc,air-si
fldata7,prot,cond,air-si
fldata7,prot,spht,air-si
fldata13,vary,dens,true
fldata13,vary,visc,true
fldata13,vary,cond,true
save
solve




GVHD: PGS.TS Trửụng Tớch Thieọn SVTH: Voừ Kieõn Truaõn


66


! MO HèNH 2b
/units,si
/prep7
! + Problem Domain
rect,0,2000,0,500
rect,500,600,0,100 ! building 1
rect,1400,2000,0,15 !bulding 2
ASBA,1,2

ASBA,4,3
!+
lsel,s,,,1
lsel,a,,,11
lesize,all,,,20
lsel,s,,,4
lsel,a,,,13
lesize,all,,,25
lsel,s,,,3
lesize,all,,,100
lsel,s,,,5
lesize,all,,,45
lsel,s,,,6,8,2
lesize,all,,,5
lsel,s,,,7
lesize,all,,,20
lsel,s,,,12
lesize,all,,,5
!+
et,1,FLUID141

!+ Meshing
asel,s,,,1
mshkey,0
amesh,1

!+ Boundary Conditions
! Veclocity
lsel,s,,,5,8
lsel,a,,,11,12

lsel,a,,,1
lsel,a,,,13
nsll,,1
d,all,VX,0
d,all,VY,0
! Pressure
lsel,s,,,1,3
nsll,,1
d,all,pres,0
! Velocity fluctuation
!$ Value $
u_ref=9
p=0.15
!!!!
lsel,s,,,4
nsll,,1
d,all,VY,0

*GET,ND_MAX,NODE,,COUNT
*GET,NN,NODE,,NUM,MIN
*DO,I,1,ND_MAX
y=ny(nn)
d,nn,VX,u_ref*(y/10)**p
nn=ndnext(nn)
*ENDDO

alls

/solu
! Tham so dong

!FLOTRAN INPUT
fldata14,temp,nomi,23

fldata7,prot,dens,air-si
fldata7,prot,visc,air-si
fldata7,prot,cond,air-si
fldata7,prot,spht,air-si

fldata13,vary,dens,true
fldata13,vary,visc,true
fldata13,vary,cond,true

save
solve

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×