[Fortran] 纯文本查看 复制代码
Program Main
Implicit None
!气化器结构参数
Real D1 !内径
Real D2 !外径
Real Deltat !翅片壁厚
Real Deltaw !翅片管壁厚
Real dL !管长步长
Real Lamal !铝合金导热系数113.0 W/(m*K)
Real Ltotal !总管长
Real Nf !翅片个数
Real Yf !翅片高度
!气化器运行参数
Real Z1 !甲烷摩尔分数
Real Z2 !乙烷摩尔分数
Real Z3 !丙烷摩尔分数
Real Mc1
Real Mc2
Real Mc3
Real Mc
Real Tin !输入温度
Real Tout !输出温度
Real Psys !管内压力
Real Qm !kg/s 2000Nm3/h
Real Ttotal !总时间单位s
Real dt !时间步长s
Real t !当下时间长度
!环境参数(环境空气温度、相对湿度)
Real Tair
Real Hur
Real g
Real Pai
Real Dv
Real Psata
Real Dena
Real Rv
Real Pair
!霜层物性求解=====================================
Real Tm
Real Denice
Real Denair
!霜层效率,能效相关===============================
Real A0
Real A21
Real A22
Real A2
Real Ain
Real Beta0
Real Rw
Real Epslion
Real Cpa
Real Coe1
Real Beta
Real x
Real Le1
!=================================================
Integer,Parameter::Numt=7.0 !时间迭代总次数/min
Integer,Parameter::NumL=6.0 !管长迭代总次数/节
Integer,Parameter::Numx=5.0 !翅片宽度方向迭代总次数/节
!Real Defr(NumL,Numt)
!Data((Defr(NumL,Numt),NumL=1.0,10000.0),Numt=0.0),/10000.0*0.0/
Real::Defr(numx,numl,numt)=0
Real::Ddefr(numx,numl,numt)=0
Real::Hf(numx,numl,numt)=-2.9686*(10.0**3.0)
Real::Two(0:numx,0:NumL,0:Numt)=200.0 !第一时间段假设值200K
Real Lamfr(numx,NumL,Numt)
Real Denfr(numx,NumL,Numt) !霜层密度
Real Q(numx,NumL,Numt)
Real Rf(numx,NumL,Numt)
Real Etaf(numx,NumL,Numt)
Real Psatwo(numx,NumL,Numt)
Real Denw(numx,NumL,Numt)
Real Tm1(numx,NumL,Numt)
Real Xi(numx,NumL,Numt)
Real Psatfro(numx,NumL,Numt)
Real Q1(numx,NumL,Numt)
Real Q2(numx,NumL,Numt)
Real H0(numx,NumL,Numt)
Real Eta(numx,NumL,Numt)
Real S(numx,NumL,Numt)
Real Lamair(numx,NumL,Numt)
Real Lamice(numx,NumL,Numt)
Real Denfro(numx,NumL,Numt)
Real M1(numx,NumL,Numt)
Real Lammin(numx,NumL,Numt)
Real Lammax(numx,NumL,Numt)
Real Ka(numx,NumL,Numt)
Real Kx(numx,NumL,Numt)
Real Mv(numx,NumL,Numt)
Real Ts(numx,NumL,Numt)
Real Psi(numx,NumL,Numt)
Real Lv(numx,NumL,Numt)
Real Hm(numx,NumL,Numt)
Real A(numx,NumL,Numt)
Real B(numx,NumL,Numt)
Real L(numx,NumL,Numt)
Real Htair(numx,NumL,Numt)
Real Twox(numx,NumL,Numt)
Real Htairx(numx,NumL,Numt)
!Real,Dimension(:,:)::t
!Real,Dimension(:,:)::L
!Real t(NumL,Numt)
!Integer Nt !用来赋值时间
!Integer NL !用来赋值管长次数
Integer i !用来赋值时间
Integer j !用来赋值管长次数
Integer k !用来赋值翅高次数
Integer n !测试本次循环次数
!调用函数声明=============================================
Real Tb
Real Td
Real IL
Real DenL
Real CpL
Real LamL
Real MuL
Real Cpng
Real Munh
Real Lammix
Real TL
Real Trlng
Real Htin
Real Htin1
Real Trg
Real Htc
integer kk,jj,ii
!Interface
!Subroutine Get_Htair(Tair,Twox,Htairx,k,j,i)
!Real Twox(k,j,i)
!Real Htairx(k,j,i)
!Real Tair
!End Subroutine Get_Htair
!End Interface
Open(Unit=15,File="aav-2.csv",Form="Formatted",Status="Unknown")
!气化器结构参数(安装高度、纵横管数、管径、壁厚、安装翅片数量、翅片的厚度和高度)
Ltotal=48.0 !安装高度
D1=28.0*10.**(-3.0) !内径
D2=32.0*10.**(-3.0) !外径
Deltaw=2.0*10.0**(-3.0) !翅片管壁厚
Yf=80.0*10.0**(-3.0) !翅片高度
Nf=12.0 !翅片个数
Deltat=4.0*10.0**(-3.0) !翅片壁厚
Lamal=113.0 !壁面(铝合金)材料的导热系数,W/(m*K)
!运行参数(天然气成分、气化器入口 LNG 温度、工作压力、气化量、运行时间)
!甲烷乙烷丙烷
Z1=0.947 !甲烷摩尔分数
Z2=0.0055 !乙烷摩尔分数
Z3=0.0008 !丙烷摩尔分数
Mc1=16.0*10.0**(-3.0)
Mc2=30.0*10.0**(-3.0)
Mc3=44.0*10.0**(-3.0)
Mc=Z1*Mc1+Z2*Mc2+Z3*Mc3
Tin=-162.0+273.15
Tout=-10.0+273.15
Psys=0.6*10.0**6.0
Qm=0.0334 !kg/s
Ttotal=1.0*60.0*60.0 !单位s
!环境参数(环境空气温度、相对湿度)
Tair=30.0+273.15
Hur=0.5
g=9.8
Pai=3.1415926
Rv=461.0 !J/(kg*K)
Denice=910.0 !kg/m3
!======================================================
dt=1.0!时间步长/min
dL=0.01!管长步长
t=0
Do i=1,Numt
n=0.0
t=t+1.0
Do j=1,NumL
n=n+1
Print*,"n=",n
Print*
Print*,"t=",t
Print*
Do k=1,Numx
Print*
if(i.eq.1..and.j.eq.1..and.k.eq.1.)then
Two(k,j,i)=200.
elseif(i.eq.1..and.j.eq.1..and.k.gt.1.)then
Two(k,j,i)=Two(k-1,j,i)+k
elseif(i.eq.1..and.j.gt.1..and.k.eq.1.)then
Two(k,j,i)=Two(k,j-1,i)+1
elseif(i.eq.1..and.j.gt.1..and.k.gt.1.)then
Two(k,j,i)=Two(k-1,j-1,i)+2*k
else
Two(k,j,i)=Two(k,j,i-1)+k
endif
print*,"计算前为",i,j,k,two(k,j,i),Htair(k,j,i)
pause
kk=k
jj=j
ii=i
call Get_Htair(Tair,Two,Htair,kk,jj,ii)
two(k,j,i)=Two(k,j,i)
Htair(k,j,i)=Htair(k,j,i)
print*,"计算后为",i,j,k,two(k,j,i),Htair(k,j,i)
Write(15,*)i,j,k,Two(k,j,i),Htair(k,j,i)
pause
End do
End Do
End Do
close(15)
End Program Main
!空气到霜层表面的对流换热系数===========================================
Subroutine Get_Htair(Tair,Two,Htair,k,j,i)
Implicit None
!Integer i !用来赋值时间
!Integer j !用来赋值管长次数
!Integer k !用来赋值翅高次数
integer k,j,i
Real Two(k,j,i)
Real Twox(k,j,i)
Real Htair(k,j,i)
Real Htairx(k,j,i)
Real Aair(k,j,i)
Real Prair(k,j,i)
Real Dtwa(k,j,i)
Real Disair(k,j,i)
Real Grair(k,j,i)
Real Raair(k,j,i)
Real Nuair(k,j,i)
Real Tm1(k,j,i)
Real Lamair(k,j,i)
Real Htair1(k,j,i)
Real Vair(k,j,i)
Real Ts2(k,j,i)
Real Tm(k,j,i)
Real Hr(k,j,i)
Real Denair
Real L
Real g
Real Lamair1
Real Muair
Real Er
Real Sigma
Real Tair
print*,'计算中前=',Two(k,j,i)
Twox(k,j,i)=Two(k,j,i)
!Two(k,j,i)
print*,'计算中前=',Htair(k,j,i)
pause
!Htair(k,j,i)
Sigma=5.67*10.**(-8.)
L=13.316
Denair=1.293
Vair=0.7
g=9.8
Er=0.9
Lamair1=0.0244
Muair=1.81*10.0**(-5.0)
Tm(k,j,i)=(Tair+Twox(k,j,i))/2.0
Aair(k,j,i)=1.0/Tm(k,j,i)
Prair(k,j,i)=0.707-(Tm(k,j,i)-273.)*3.67*10.0**(-4.0) !直接自己拟合公式
Dtwa(k,j,i)=Twox(k,j,i)-Tair
Disair(k,j,i)=(0.101286*(Tm(k,j,i)-273.15)+20.1)*10.**(-6.0) !直接自己拟合公式
Grair(k,j,i)=(g*Aair(k,j,i)*Abs(Dtwa(k,j,i))*(L**3.0))/((17.2*(10.**-6.0))**2.0)
Raair(k,j,i)=Grair(k,j,i)*Prair(k,j,i)
Nuair(k,j,i)=(0.825+(0.387*Raair(k,j,i)**(1./6.))/(1.+(0.492/Prair(k,j,i))**(9./16.))**(8./27.))**2.0
Lamair(k,j,i)=-3.381*(10.0**(-8.))*Tm(k,j,i)**(2.)+9.814*Tm(k,j,i)*(10.0**(-5.))-1.308*(10.0**(-4.))
Htair1(k,j,i)=Nuair(k,j,i)*Lamair(k,j,i)/L
!Htair=Htair1
!Print*,'Htair=',Htair, '空气与翅片管表面的对流换热系数'
!Reair=Denair*Vair*L/Muair
!Print*,"Reair=",Reair
!Nuair=0.034*Reair**(0.8)
!Nuair=0.664*(Reair**(0.5))*Prair**(1./3.)
!Print*,"Nuair=",Nuair
!Write(*,*)'Htair=',Htair, '空气与翅片管表面的对流换热系数(强制对流)'
Hr(k,j,i)=Er*Sigma*(Twox(k,j,i)+Tair)*(Twox(k,j,i)**2.0+Tair**2.0)
Htairx(k,j,i)=Htair1(k,j,i)+Hr(k,j,i)
Two(k,j,i)=Twox(k,j,i)
Htair(k,j,i)=Htairx(k,j,i)
Write(*,*)'Htair(k,j,i)计算中后=',Htair(k,j,i), '空气与翅片管表面的对流换热系数(自由对流)'
Write(*,*)'Two(k,j,i)计算中后=',Two(k,j,i), '冷壁面温度'
Return
End Subroutine Get_Htair
[Fortran] 纯文本查看 复制代码
Program Main
Implicit None
!气化器结构参数
Real D1 !内径
Real D2 !外径
Real Deltat !翅片壁厚
Real Deltaw !翅片管壁厚
Real dL !管长步长
Real Lamal !铝合金导热系数113.0 W/(m*K)
Real Ltotal !总管长
Real Nf !翅片个数
Real Yf !翅片高度
!气化器运行参数
Real Z1 !甲烷摩尔分数
Real Z2 !乙烷摩尔分数
Real Z3 !丙烷摩尔分数
Real Mc1
Real Mc2
Real Mc3
Real Mc
Real Tin !输入温度
Real Tout !输出温度
Real Psys !管内压力
Real Qm !kg/s 2000Nm3/h
Real Ttotal !总时间单位s
Real dt !时间步长s
Real t !当下时间长度
!环境参数(环境空气温度、相对湿度)
Real Tair
Real Hur
Real g
Real Pai
Real Dv
Real Psata
Real Dena
Real Rv
Real Pair
!霜层物性求解=====================================
Real Tm
Real Denice
Real Denair
!霜层效率,能效相关===============================
Real A0
Real A21
Real A22
Real A2
Real Ain
Real Beta0
Real Rw
Real Epslion
Real Cpa
Real Coe1
Real Beta
Real x
Real Le1
real dxi,dy
!=================================================
Integer,Parameter::Numt=7.0 !时间迭代总次数/min
Integer,Parameter::NumL=6.0 !管长迭代总次数/节
Integer,Parameter::Numx=5.0 !翅片宽度方向迭代总次数/节
!Real Defr(NumL,Numt)
!Data((Defr(NumL,Numt),NumL=1.0,10000.0),Numt=0.0),/10000.0*0.0/
Real::Defr(numx,numl,numt)=0
Real::Ddefr(numx,numl,numt)=0
Real::Hf(numx,numl,numt)=-2.9686*(10.0**3.0)
Real::Two(numx,NumL,Numt)=200.0 !第一时间段假设值200K
Real Lamfr(numx,NumL,Numt)
Real Denfr(numx,NumL,Numt) !霜层密度
Real Q(numx,NumL,Numt)
Real Rf(numx,NumL,Numt)
Real Etaf(numx,NumL,Numt)
Real Psatwo(numx,NumL,Numt)
Real Denw(numx,NumL,Numt)
Real Tm1(numx,NumL,Numt)
Real Xi(numx,NumL,Numt)
Real Psatfro(numx,NumL,Numt)
Real Q1(numx,NumL,Numt)
Real Q2(numx,NumL,Numt)
Real H0(numx,NumL,Numt)
Real Eta(numx,NumL,Numt)
Real S(numx,NumL,Numt)
Real Lamair(numx,NumL,Numt)
Real Lamice(numx,NumL,Numt)
Real Denfro(numx,NumL,Numt)
Real M1(numx,NumL,Numt)
Real Lammin(numx,NumL,Numt)
Real Lammax(numx,NumL,Numt)
Real Ka(numx,NumL,Numt)
Real Kx(numx,NumL,Numt)
Real Mv(numx,NumL,Numt)
Real Ts(numx,NumL,Numt)
Real Psi(numx,NumL,Numt)
Real Lv(numx,NumL,Numt)
Real Hm(numx,NumL,Numt)
Real A(numx,NumL,Numt)
Real B(numx,NumL,Numt)
Real L(numx,NumL,Numt)
Real Htair(numx,NumL,Numt)
Real Twox(numx,NumL,Numt)
Real Htairx(numx,NumL,Numt)
!Real,Dimension(:,:)::t
!Real,Dimension(:,:)::L
!Real t(NumL,Numt)
!Integer Nt !用来赋值时间
!Integer NL !用来赋值管长次数
Integer i !用来赋值时间
Integer j !用来赋值管长次数
Integer k !用来赋值翅高次数
Integer n !测试本次循环次数
!调用函数声明=============================================
Real Tb
Real Td
Real IL
Real DenL
Real CpL
Real LamL
Real MuL
Real Cpng
Real Munh
Real Lammix
Real TL
Real Trlng
Real Htin
Real Htin1
Real Trg
Real Htc
Interface
Subroutine Get_Htair(Tair,Two,Htairx)
Integer,Parameter::Numt=7.0 !时间迭代总次数/min
Integer,Parameter::NumL=6.0 !管长迭代总次数/节
Integer,Parameter::Numx=5.0 !翅片宽度方向迭代总次数/节
Real Two(numx,NumL,Numt)
Real Htairx(numx,NumL,Numt)
End Subroutine
End Interface
Open(Unit=15,File="aav-2.csv",Form="Formatted",Status="Unknown")
!气化器结构参数(安装高度、纵横管数、管径、壁厚、安装翅片数量、翅片的厚度和高度)
Ltotal=48.0 !安装高度
D1=28.0*10.**(-3.0) !内径
D2=32.0*10.**(-3.0) !外径
Deltaw=2.0*10.0**(-3.0) !翅片管壁厚
Yf=80.0*10.0**(-3.0) !翅片高度
Nf=12.0 !翅片个数
Deltat=4.0*10.0**(-3.0) !翅片壁厚
Lamal=113.0 !壁面(铝合金)材料的导热系数,W/(m*K)
!运行参数(天然气成分、气化器入口 LNG 温度、工作压力、气化量、运行时间)
!甲烷乙烷丙烷
Z1=0.947 !甲烷摩尔分数
Z2=0.0055 !乙烷摩尔分数
Z3=0.0008 !丙烷摩尔分数
Mc1=16.0*10.0**(-3.0)
Mc2=30.0*10.0**(-3.0)
Mc3=44.0*10.0**(-3.0)
Mc=Z1*Mc1+Z2*Mc2+Z3*Mc3
Tin=-162.0+273.15
Tout=-10.0+273.15
Psys=0.6*10.0**6.0
Qm=0.0334 !kg/s
Ttotal=1.0*60.0*60.0 !单位s
!环境参数(环境空气温度、相对湿度)
Tair=30.0+273.15
Hur=0.5
g=9.8
Pai=3.1415926
Rv=461.0 !J/(kg*K)
Denice=910.0 !kg/m3
!======================================================
dt=1.0!时间步长/min
dy=0.01!管长步长
t=0
Do i=1,Numt
n=0.0
t=t+1.0
Print*,"t=",t
Do j=1,NumL
n=n+1
Print*,"n=",n
Print*
Do k=1,Numx !翅高增长
Print*
Two(k,j,i)=200.*(0.1+K)/K
print*,i,j,K
print*,Two(k,j,i),K
pause
call Get_Htair(Tair,Two,Htairx)
Htair=Htairx
Write(15,*)i,j,k,Two(k,j,i),Htair(k,j,i)
End do
End Do
End Do
close(15)
End Program Main
!空气到霜层表面的对流换热系数===========================================
Subroutine Get_Htair(Tair,Two,Htairx)
Implicit None
integer k,j,i
Integer,Parameter::Numt=7.0 !时间迭代总次数/min
Integer,Parameter::NumL=6.0 !管长迭代总次数/节
Integer,Parameter::Numx=5.0 !翅片宽度方向迭代总次数/节
Real Two(numx,numl,numt)
Real Htair(numx,numl,numt)
Real Htairx(numx,numl,numt)
Real Aair(numx,numl,numt)
Real Prair(numx,numl,numt)
Real Dtwa(numx,numl,numt)
Real Disair(numx,numl,numt)
Real Grair(numx,numl,numt)
Real Raair(numx,numl,numt)
Real Nuair(numx,numl,numt)
Real Tm1(numx,numl,numt)
Real Lamair(numx,numl,numt)
Real Htairc(numx,numl,numt)
Real Vair(numx,numl,numt)
Real Ts2(numx,numl,numt)
Real Tm(numx,numl,numt)
Real Hr(numx,numl,numt)
Real Denair
Real L
Real g
Real Lamair1
Real Muair
Real Er
Real Sigma
Real Tair
print*,'Two=',Two(k,j,i)
print*,'tair=',tair
pause
Sigma=5.67*10.**(-8.)
L=13.316
Denair=1.293
Vair=0.7
g=9.8
Er=0.9
Lamair1=0.0244
Muair=1.81*10.0**(-5.0)
Tm(k,j,i)=(Tair+Two(k,j,i))/2.0
Aair(k,j,i)=1.0/Tm(k,j,i)
Prair(k,j,i)=0.707-(Tm(k,j,i)-273.)*3.67*10.0**(-4.0)
Dtwa(k,j,i)=Two(k,j,i)-Tair
Disair(k,j,i)=(0.101286*(Tm(k,j,i)-273.15)+20.1)*10.**(-6.0)
Grair(k,j,i)=(g*Aair(k,j,i)*Abs(Dtwa(k,j,i))*(L**3.0))/((17.2*(10.**-6.0))**2.0)
Raair(k,j,i)=Grair(k,j,i)*Prair(k,j,i)
Nuair(k,j,i)=(0.825+(0.387*Raair(k,j,i)**(1./6.))/(1.+(0.492/Prair(k,j,i))**(9./16.))**(8./27.))**2.0
Lamair(k,j,i)=-3.381*(10.0**(-8.))*Tm(k,j,i)**(2.)+9.814*Tm(k,j,i)*(10.0**(-5.))-1.308*(10.0**(-4.))
Htairc(k,j,i)=Nuair(k,j,i)*Lamair(k,j,i)/L
!Htair=Htair1
!Print*,'Htair=',Htair, '空气与翅片管表面的对流换热系数'
!Reair=Denair*Vair*L/Muair
!Print*,"Reair=",Reair
!Nuair=0.034*Reair**(0.8)
!Nuair=0.664*(Reair**(0.5))*Prair**(1./3.)
!Print*,"Nuair=",Nuair
!Write(*,*)'Htair=',Htair, '空气与翅片管表面的对流换热系数(强制对流)'
Hr(k,j,i)=Er*Sigma*(Two(k,j,i)+Tair)*(Two(k,j,i)**2.0+Tair**2.0)
Htairx(k,j,i)=Htairc(k,j,i)+Hr(numx,numl,numt)
!Htair=Htairx
!Write(*,*)'Htairx计算中后=',Htairx, '空气与翅片管表面的对流换热系数(自由对流)'
!Write(*,*)'Twoxx计算中后=',Twoxx, '冷壁面温度'
Return
End Subroutine Get_Htair