13 public equcond,cond,alpha,sigma
15 character :: trans=
'n' 16 character(len=30) :: fmt=
'(2x,A,1x,es9.3,1x,A)' 17 integer,
parameter :: kl=1,ku=1,ldab=2*kl+ku+1,nrhs=1
19 integer,
dimension(:),
allocatable :: tipiv,gipiv
20 real(dp),
dimension(:),
allocatable :: trhs,grhs
21 real(dp),
dimension(:,:),
allocatable :: tmatrix,gmatrix
24 real(dp),
dimension(:),
allocatable :: tvec,qcon,qrad,qtot,gqrad
25 real(dp),
dimension(:),
allocatable :: cond
26 real(dp),
dimension(:,:),
allocatable :: alpha
27 real(dp),
dimension(:,:),
allocatable :: sigma
34 integer :: i,maxiter=20,fi
35 real(dp) :: tol=1e-5_dp,res
36 write(*,*)
'Conduction-Radiation:' 37 write(mfi,*)
'Conduction-Radiation:' 39 allocate(tmatrix(ldab,nz),gmatrix(ldab,nbox*nz),tipiv(nz),gipiv(nbox*nz),&
40 trhs(nz),grhs(nbox*nz),tvec(nz),qcon(nz),qrad(nz),qtot(nz),gqrad(nz))
42 tvec(i)=temp1+(i-1)*(temp2-temp1)/(nz-1)
45 call dgbtrf(nz,nz,kl,ku,tmatrix,ldab,tipiv,info)
47 call dgbtrf(nbox*nz,nbox*nz,kl,ku,gmatrix,ldab,gipiv,info)
50 call dgbtrs(trans,nz,kl,ku,nrhs,tmatrix,ldab,tipiv,trhs,nz,info)
51 res=abs(maxval(trhs-tvec))
52 write(*,
'(5x,A,1x,I2,A,1x,es9.3)')
'iteration:',i,
', residual:',res
53 write(mfi,
'(5x,A,1x,I2,A,1x,es9.3)')
'iteration:',i,
', residual:',res
58 eqc=sum(qtot)/nz*dfoam/(temp1-temp2)
59 rcontr=sum(qrad)/sum(qtot)
60 gcontr=(1-rcontr)*kgas/(kgas+ksol)
61 scontr=(1-rcontr)*ksol/(kgas+ksol)
65 write(*,fmt)
'equivalent conductivity:',eqc*1e3_dp,
'mW/m/K' 66 write(*,fmt)
'contribution of gas:',gcontr*1e2_dp,
'%' 67 write(*,fmt)
'contribution of solid:',scontr*1e2_dp,
'%' 68 write(*,fmt)
'contribution of radiation:',rcontr*1e2_dp,
'%' 69 write(mfi,fmt)
'equivalent conductivity:',eqc*1e3_dp,
'mW/m/K' 70 write(mfi,fmt)
'contribution of gas:',gcontr*1e2_dp,
'%' 71 write(mfi,fmt)
'contribution of solid:',scontr*1e2_dp,
'%' 72 write(mfi,fmt)
'contribution of radiation:',rcontr*1e2_dp,
'%' 73 open(newunit(fi),file=
'foamConductivity.out')
76 deallocate(tmatrix,gmatrix,tipiv,gipiv,trhs,grhs,tvec,qcon,qrad,qtot,gqrad)
77 end subroutine equcond
83 subroutine make_gmatrix
93 gmatrix(kl+ku+1+l-j,j)=2/((alpha(i,k)+sigma(i,k))*dz) + &
96 gmatrix(kl+ku+1+l-j,j)=-1/((alpha(i,k)+sigma(i,k))*dz)
98 gmatrix(kl+ku+1+l-j,j)=-1/((alpha(i,k)+sigma(i,k))*dz)
103 gmatrix(kl+ku+1+i-j,j)=1/((alpha(1,k)+sigma(1,k))*dz) + &
105 9*emi1/(2-emi1)*alpha(1,k)/4/(alpha(1,k)+sigma(1,k))
107 gmatrix(kl+ku+1+i-j,j)=-1/((alpha(1,k)+sigma(1,k))*dz) - &
108 3*emi1/(2-emi1)*alpha(1,k)/4/(alpha(1,k)+sigma(1,k))
111 gmatrix(kl+ku+1+i-j,j)=-1/((alpha(nz,k)+sigma(nz,k))*dz) - &
112 3*emi2/(2-emi2)*alpha(nz,k)/4/(alpha(nz,k)+sigma(nz,k))
114 gmatrix(kl+ku+1+i-j,j)=1/((alpha(nz,k)+sigma(nz,k))*dz) + &
116 9*emi2/(2-emi2)*alpha(nz,k)/4/(alpha(nz,k)+sigma(nz,k))
118 end subroutine make_gmatrix
130 grhs(k)=12*effn**2*sigmab*alpha(j,i)*tvec(j)**4*dz*fbepbox(i)
133 grhs(j)=grhs(j) + 6*emi1/(2-emi1)*alpha(1,i)*effn**2*sigmab*temp1**4/&
134 (alpha(1,i)+sigma(1,i))*fbepbox(i)
136 grhs(j)=grhs(j) + 6*emi2/(2-emi2)*alpha(nz,i)*effn**2*sigmab*temp2**4/&
137 (alpha(nz,i)+sigma(nz,i))*fbepbox(i)
139 end subroutine make_grhs
145 subroutine make_tmatrix
151 tmatrix(kl+ku+1+i-j,j)=(cond(i) + &
152 cond(i)*cond(i+1)/(cond(i)+cond(i+1)))*2/dz
154 tmatrix(kl+ku+1+i-j,j)=-cond(i)*cond(i+1)/(cond(i)+cond(i+1))*2/dz
157 tmatrix(kl+ku+1+i-j,j)=-cond(i-1)*cond(i)/(cond(i-1)+cond(i))*2/dz
159 tmatrix(kl+ku+1+i-j,j)=(cond(i-1)*cond(i)/(cond(i-1)+cond(i)) + &
160 cond(i)*cond(i+1)/(cond(i)+cond(i+1)))*2/dz
162 tmatrix(kl+ku+1+i-j,j)=-cond(i)*cond(i+1)/(cond(i)+cond(i+1))*2/dz
166 tmatrix(kl+ku+1+i-j,j)=-cond(i-1)*cond(i)/(cond(i-1)+cond(i))*2/dz
168 tmatrix(kl+ku+1+i-j,j)=(cond(i-1)*cond(i)/(cond(i-1)+cond(i)) + &
170 end subroutine make_tmatrix
179 trhs(1)=trhs(1)+2*cond(1)*temp1/dz
180 trhs(nz)=trhs(nz)+2*cond(nz)*temp2/dz
181 end subroutine make_trhs
187 subroutine make_gqrad
190 call dgbtrs(trans,nbox*nz,kl,ku,nrhs,gmatrix,ldab,gipiv,grhs,nbox*nz,info)
196 gqrad(j)=gqrad(j) + alpha(j,i)*grhs(k)*dz - &
197 4*effn**2*sigmab*alpha(j,i)*tvec(j)**4*dz*fbepbox(i)
200 end subroutine make_gqrad
208 qcon(1)=-2*cond(1)*cond(2)/(cond(1)+cond(2))*(tvec(2)-tvec(1))/dz
210 qcon(i)=-2*cond(i-1)*cond(i)/(cond(i-1)+cond(i))*(tvec(i)-tvec(i-1))/dz
216 qrad(1)=qrad(1)-(grhs(j+1)-grhs(j))/(3*(alpha(1,i)+sigma(1,i))*dz)
220 qrad(j)=qrad(j)-(grhs(k)-grhs(k-1))/(3*(alpha(j,i)+sigma(j,i))*dz)
224 end subroutine heatflux