SUBROUTINE fddisc(nLay,nSubLayR,nCells,l,lambda,rho,cp,C,R) C Last change: AB 26 Jan 2000 6:59 pm C Purpose: The subroutine calculates the thermal resistances and C the heat capacities of a multilayer building component C on basis that the layers are manually subdivided. C Called by: fdwall.nmf C Calls: None C Limits: No automatical discretization. C Date: 991001 C Made by: Jan Akander C Axel Bring C C Input: C nLay = number of material layers in the building component C nSubLay = vector with number of subdivisions (cells) of material layer C nCells = number of nodes (cells) in the RC-chain C l = vector with material layer thickness C lambda = vector with material layer heat conductivity C rho = vector with material layer density C cp = vector with material layer specific heat capacity C C C Output: C C = vector with discretized heat capacities (elements =sum(nSubLay)) C R = vector with discretized thermal resistances (elements =sum(nSubLay)+1) C integers in INTEGER nLay,nCells C pseudo integers in REAL*8 nSubLayR(nLay) C local integers INTEGER i,j,k INTEGER nSubLay(nLay) C parameters in DOUBLE PRECISION l(nLay),rho(nLay),cp(nLay),lambda(nLay), & C(nCells),R(nCells+1) C local work vectors DOUBLE PRECISION Rprel(:),Cprel(:) ALLOCATABLE Rprel, Cprel ALLOCATE(Rprel(nLay)) ALLOCATE(Cprel(nLay)) c WRITE(7,99) 'nlay,ncells,nofrs',nlay,ncells c WRITE(7,98) (nsublayR(i),i=1,nlay) c WRITE(7,98) (l(i),i=1,nlay) c WRITE(7,98) (lambda(i),i=1,nlay) c WRITE(7,98) (rho(i),i=1,nlay) c WRITE(7,98) (cp(i),i=1,nlay) c 99 FORMAT(1x,a,3i5) c 98 FORMAT(1x,5f8.2) DO 100 i=1,nLay nSubLay(i) = NINT(nSubLayR(i)) Rprel(i)=(l(i)/nSubLayR(i))/(2*lambda(i)) Cprel(i)=(l(i)/nSubLayR(i))*rho(i)*cp(i) 100 CONTINUE k=0 DO 200 i=1,nLay DO 300 j=1,nSubLay(i) k=k+1 C(k)=Cprel(i) IF(k.EQ.1) THEN R(k) = Rprel(i) ELSEIF (j.EQ.1) THEN R(k) = Rprel(i-1) + Rprel(i) ELSE R(k) = 2*Rprel(i) ENDIF 300 CONTINUE 200 CONTINUE R(k+1)=Rprel(nLay) DEALLOCATE (Rprel) DEALLOCATE (Cprel) RETURN END