16 real(dp) :: unin=1.57_dp
17 real(dp),
dimension(:),
allocatable :: &
20 kappafwall,sigmafwall,betafwall,omegafwall,betatrfwall,&
22 kappafstrut,sigmafstrut,betafstrut,omegafstrut,betatrfstrut,&
26 kappaf,sigmaf,betaf,omegaf,betatrf
30 subroutine effrad(spectra)
32 character(len=*),
intent(in) :: spectra
33 integer :: i,j,fi,nwawel=100
42 real(dp) :: dwmin,dwmax,lambdamin,lambdamax
47 real(dp),
parameter :: epsabs = 0.0e0_dp
48 real(dp) :: epsrel = 1e-3_dp
53 write(*,*)
'Radiative properties of the foam:' 54 write(mfi,*)
'Radiative properties of the foam:' 95 allocate(lambdaf(nwawel),kappafwall(nwawel),sigmafwall(nwawel),&
96 betafwall(nwawel),omegafwall(nwawel),betatrfwall(nwawel),&
97 kappafstrut(nwawel),sigmafstrut(nwawel),betafstrut(nwawel),&
98 omegafstrut(nwawel),betatrfstrut(nwawel),kappafgas(nwawel),&
99 kappaf(nwawel),sigmaf(nwawel),betaf(nwawel),omegaf(nwawel),&
102 lambdamax=lambdan(
size(lambdan))
104 lambda=lambdamin+(i-1)*(lambdamax-lambdamin)/nwawel
107 kappafgas(i)=abscoeffgas(
lambda)
108 if (fs<1-struttol)
then 115 call qag ( scattwall, dwmin, dwmax, epsabs, epsrel, 1, res, &
118 write(*,*)
'qag returned',ier
119 write(*,*)
'wavelength',
lambda 120 write(*,*)
'scattering coefficient of walls not calculated' 121 write(mfi,*)
'qag returned',ier
122 write(mfi,*)
'wavelength',
lambda 123 write(mfi,*)
'scattering coefficient of walls not calculated' 127 call qag ( trextwall, dwmin, dwmax, epsabs, epsrel, 1, res, &
130 write(*,*)
'qag returned',ier
131 write(*,*)
'wavelength',
lambda 132 write(*,*)
'transport extinction coefficient of walls & 134 write(mfi,*)
'qag returned',ier
135 write(mfi,*)
'wavelength',
lambda 136 write(mfi,*)
'transport extinction coefficient of walls & 141 call qag ( absorwall, dwmin, dwmax, epsabs, epsrel, 1, res, &
144 write(*,*)
'qag returned',ier
145 write(*,*)
'wavelength',
lambda 146 write(*,*)
'absorption coefficient of walls not calculated' 147 write(mfi,*)
'qag returned',ier
148 write(mfi,*)
'wavelength',
lambda 149 write(mfi,*)
'absorption coefficient of walls not calculated' 156 call qags ( scattcoeffintwall, a, b, epsabs, epsrel, res, &
159 write(*,*)
'qags returned',ier
160 write(*,*)
'wavelength',
lambda 161 write(*,*)
'scattering coefficient of walls not calculated' 162 write(mfi,*)
'qags returned',ier
163 write(mfi,*)
'wavelength',
lambda 164 write(mfi,*)
'scattering coefficient of walls not calculated' 167 sigmafwall(i)=res*(1-por)/dwall
168 call qags ( trextcoeffintwall, a, b, epsabs, epsrel, res, &
171 write(*,*)
'qags returned',ier
172 write(*,*)
'wavelength',
lambda 173 write(*,*)
'transport extinction coefficient of walls & 175 write(mfi,*)
'qags returned',ier
176 write(mfi,*)
'wavelength',
lambda 177 write(mfi,*)
'transport extinction coefficient of walls & 181 betatrfwall(i)=res*(1-por)/dwall
182 call qags ( abscoeffintwall, a, b, epsabs, epsrel, res, &
185 write(*,*)
'qags returned',ier
186 write(*,*)
'wavelength',
lambda 187 write(*,*)
'absorption coefficient of walls not calculated' 188 write(mfi,*)
'qags returned',ier
189 write(mfi,*)
'wavelength',
lambda 190 write(mfi,*)
'absorption coefficient of walls not calculated' 193 kappafwall(i)=res*(1-por)/dwall
195 betafwall(i)=kappafwall(i)+sigmafwall(i)
196 omegafwall(i)=sigmafwall(i)/betafwall(i)
204 if (fs>struttol)
then 207 if (pi*dstrut/
lambda>10)
then 209 elseif(pi*dstrut/
lambda>1)
then 214 call qags ( trextcoeffintstrut, a, b, epsabs, epsrel, res, abserr, &
217 write(*,*)
'qags returned',ier,neval
218 write(*,*)
'qags returned',res,abserr
219 write(*,*)
'wavelength',
lambda 220 write(*,*)
'transport extinction coefficient of struts & 224 betatrfstrut(i)=res*4/pi/dstrut*(1-por)
225 call qags ( extcoeffintstrut, a, b, epsabs, epsrel, res, abserr, &
228 write(*,*)
'qags returned',ier
229 write(*,*)
'wavelength',
lambda 230 write(*,*)
'extinction coefficient of struts not calculated' 233 betafstrut(i)=res*4/pi/dstrut*(1-por)
234 call qags ( scattcoeffintstrut, a, b, epsabs, epsrel, res, abserr, &
237 write(*,*)
'qags returned',ier
238 write(*,*)
'wavelength',
lambda 239 write(*,*)
'scattering coefficient of struts not calculated' 242 sigmafstrut(i)=res*4/pi/dstrut*(1-por)
243 kappafstrut(i)=betafstrut(i)-sigmafstrut(i)
244 omegafstrut(i)=sigmafstrut(i)/betafstrut(i)
253 kappafwall=(1-fs)*kappafwall
254 sigmafwall=(1-fs)*sigmafwall
255 betafwall=(1-fs)*betafwall
256 betatrfwall=(1-fs)*betatrfwall
257 kappafstrut=fs*kappafstrut
258 sigmafstrut=fs*sigmafstrut
259 betafstrut=fs*betafstrut
260 betatrfstrut=fs*betatrfstrut
261 kappaf=kappafwall+kappafstrut
262 sigmaf=sigmafwall+sigmafstrut
263 betaf=betafwall+betafstrut
264 betatrf=betatrfwall+betatrfstrut
270 open(newunit(fi),file=trim(adjustl(spectra)))
271 write(fi,
'(1000A23)')
'#wavelength',
'abs.coeff.wall',
'scatt.coeff.wall',&
272 'ext.coeff.wall',
'albedo wall',
'tr.ext.coeff.wall',
'abs.coeff.strut',&
273 'scatt.coeff.strut',
'ext.coeff.strut',
'albedo strut',&
274 'tr.ext.coeff.strut',
'abs.coeff',
'scatt.coeff',
'ext.coeff',
'albedo ',&
277 write(fi,
'(1000es23.15)') lambdaf(i),kappafwall(i),sigmafwall(i),&
278 betafwall(i),omegafwall(i),betatrfwall(i),kappafstrut(i),&
279 sigmafstrut(i),betafstrut(i),omegafstrut(i),betatrfstrut(i),&
280 kappaf(i),sigmaf(i),betaf(i),omegaf(i),betatrf(i)
285 b=lambdaf(
size(lambdaf))
288 effn=por*n1+(1-por)*unin
290 call qags ( rosextc, a, b, epsabs, epsrel, res, abserr, neval, ier )
292 write(*,*)
'qags returned',ier
293 write(*,*)
'rosseland extinction coefficient not calculated' 296 rossextcoeff=(4*effn**2*sigmab*tmean**3)/res
297 call qags ( planckextc, a, b, epsabs, epsrel, res, abserr, neval, ier )
299 write(*,*)
'qags returned',ier
300 write(*,*)
'planck extinction coefficient not calculated' 303 planckextcoeff=res/(effn**2*sigmab*tmean**4)
304 call qags ( planckalbedo, a, b, epsabs, epsrel, res, abserr, neval, ier )
306 write(*,*)
'qags returned',ier
307 write(*,*)
'scattering albedo not calculated' 310 albedo=res/(effn**2*sigmab*tmean**4)
311 krad=16*sigmab*tmean**3/(3*rossextcoeff)
314 stop
'choose number of gray boxes 1 for gray approximation, greater & 315 than 1 for non-gray simulation' 317 allocate(lambdabox(nbox+1),trextcoeffbox(nbox),albedobox(nbox),&
318 abscoeffbox(nbox),scattcoeffbox(nbox))
319 if (.not.
allocated(fbepbox))
allocate(fbepbox(nbox))
322 lambdabox(nbox+1)=100e-6_dp
323 lambdabox(nbox)=lambdamax
324 lambdabox(1)=lambdamin
327 lambdabox(i)=lambdamin+(i-1)*(lambdamax-lambdamin)/(nbox-1._dp)
330 fbepbox(i)=fbep(effn,lambdabox(i+1),tmean)-fbep(effn,lambdabox(i)&
332 call qags(planckextc,lambdabox(i),lambdabox(i+1), epsabs, epsrel, &
333 res, abserr, neval, ier)
335 write(*,*)
'qags returned',ier
336 write(*,*)
'gray box',i
337 write(*,*)
'planck extinction coefficient not calculated' 340 trextcoeffbox(i)=res/(effn**2*sigmab*tmean**4*fbepbox(i))
341 call qags(planckalbedo,lambdabox(i),lambdabox(i+1), epsabs, &
342 epsrel, res, abserr, neval, ier)
344 write(*,*)
'qags returned',ier
345 write(*,*)
'gray box',i
346 write(*,*)
'scattering albedo not calculated' 349 albedobox(i)=res/(effn**2*sigmab*tmean**4*fbepbox(i))
351 scattcoeffbox=albedobox*trextcoeffbox
352 abscoeffbox=trextcoeffbox-scattcoeffbox
354 write(*,
'(2x,A,1x,es9.3)')
'effective index of refraction:',effn
355 write(*,
'(2x,A,1x,es9.3,1x,A)')
'Planck mean extinction coefficient:',&
356 planckextcoeff,
'm^-1' 357 write(*,
'(2x,A,1x,es9.3,1x,A)')
'Rosseland extinction coefficient:',&
359 write(*,
'(2x,A,1x,es9.3,1x,A)')
'Rosseland extinction coefficient:',&
360 rossextcoeff/(1-por)/rhos,
'kg/m^2' 361 write(*,
'(2x,A,1x,es9.3,1x,A)')
'radiative conductivity:',&
363 write(mfi,
'(2x,A,1x,es9.3)')
'effective index of refraction:',effn
364 write(mfi,
'(2x,A,1x,es9.3,1x,A)')
'Planck mean extinction coefficient:',&
365 planckextcoeff,
'm^-1' 366 write(mfi,
'(2x,A,1x,es9.3,1x,A)')
'Rosseland extinction coefficient:',&
368 write(mfi,
'(2x,A,1x,es9.3,1x,A)')
'Rosseland extinction coefficient:',&
369 rossextcoeff/(1-por)/rhos,
'kg/m^2' 370 write(mfi,
'(2x,A,1x,es9.3,1x,A)')
'radiative conductivity:',&
373 deallocate(kappafwall,sigmafwall,betafwall,omegafwall,betatrfwall,&
374 kappafstrut,sigmafstrut,betafstrut,omegafstrut,betatrfstrut,&
375 kappaf,sigmaf,betaf,omegaf,betatrf,kappafgas,lambdabox,trextcoeffbox,&
377 end subroutine effrad
384 real(dp) function rosextc(lambda)
386 real(dp),
intent(in) :: lambda
394 if (lambda<lambdaf(1))
then 395 write(*,*)
'No data for such low wavelength.' 396 write(*,*)
'Minimum wavelength is',lambdaf(1)
398 elseif (lambda>lambdaf(
size(lambdaf)))
then 402 beta=betatrf(
size(betatrf))
405 call pwl_interp_1d (
size(lambdaf), lambdaf, betatrf, ni, xi, yi )
408 rosextc=2*c0**3*exp(hpc*c0/(kb*n*tmean*lambda))*hpc**2*pi/&
409 ((exp(hpc*c0/(kb*n*tmean*lambda))-1)**2*kb*n**3*tmean**2*lambda**6)/beta
416 real(dp) function planckextc(lambda)
418 real(dp),
intent(in) :: lambda
426 if (lambda<lambdaf(1))
then 427 write(*,*)
'No data for such low wavelength.' 428 write(*,*)
'Minimum wavelength is',lambdaf(1)
430 elseif (lambda>lambdaf(
size(lambdaf)))
then 434 beta=betatrf(
size(betatrf))
437 call pwl_interp_1d (
size(lambdaf), lambdaf, betatrf, ni, xi, yi )
438 beta=yi(1)+abscoeffgas(lambda)
440 planckextc=2*pi*hpc*c0**2/&
441 (n**2*lambda**5*(exp(hpc*c0/(n*lambda*kb*tmean))-1))*beta
442 end function planckextc
448 real(dp) function planckalbedo(lambda)
450 real(dp),
intent(in) :: lambda
458 if (lambda<lambdaf(1))
then 459 write(*,*)
'No data for such low wavelength.' 460 write(*,*)
'Minimum wavelength is',lambdaf(1)
462 elseif (lambda>lambdaf(
size(lambdaf)))
then 466 omega=omegaf(
size(omegaf))
469 call pwl_interp_1d (
size(lambdaf), lambdaf, omegaf, ni, xi, yi )
472 planckalbedo=2*pi*hpc*c0**2/&
473 (n**2*lambda**5*(exp(hpc*c0/(n*lambda*kb*tmean))-1))*omega
474 end function planckalbedo
483 real(dp) function fbep(n,lambda,T)
484 real(dp),
intent(in) :: n
485 real(dp),
intent(in) :: lambda
486 real(dp),
intent(in) :: T
487 integer :: i,maxit=100
488 real(dp) :: dzeta,old,res,tol=1e-12_dp
489 dzeta=c2/(n*lambda*t)
492 fbep=old+15/pi**4*(exp(-i*dzeta)/i*&
493 (dzeta**3+3*dzeta**2/i+6*dzeta/i**2+6e0_dp/i**3))
497 if (i==maxit) stop
'fraction of blackbody radiation was & 498 not calculated (did not converge)' double lambda
Latent heat of blowing agent, J/kg.