[TRNSYS-users] TRNSYS-users Digest, Vol 57, Issue 9

ghetu mariana ghetu_mariana at yahoo.co.uk
Sun Sep 6 11:13:00 PDT 2009


Leen,

Take a look at the "subroutine calchtc" of the type56 code, I think this is what you need to change or understand. 

P.S: hope you know German

good luck,

Mariana


--- On Sun, 6/9/09, trnsys-users-request at cae.wisc.edu <trnsys-users-request at cae.wisc.edu> wrote:

From: trnsys-users-request at cae.wisc.edu <trnsys-users-request at cae.wisc.edu>
Subject: TRNSYS-users Digest, Vol 57, Issue 9
To: trnsys-users at cae.wisc.edu
Date: Sunday, 6 September, 2009, 8:06 PM

Send TRNSYS-users mailing list submissions to
    trnsys-users at cae.wisc.edu

To subscribe or unsubscribe via the World Wide Web, visit
    https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users
or, via email, send a message with subject or body 'help' to
    trnsys-users-request at cae.wisc.edu

You can reach the person managing the list at
    trnsys-users-owner at cae.wisc.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of TRNSYS-users digest..."
Today's Topics:

   1. changing convection coefficients in a simulation (leen peeters)
_______________________________________________
TRNSYS-users mailing list
TRNSYS-users at cae.wisc.edu
https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20090906/052295e7/attachment-0005.htm>
-------------- next part --------------

      SUBROUTINE CALHTC(TIME,XIN,INP,INFO)
C*******************************************************************************
C  THIS SUBROUTINE CALCULATES FOR ALL SURFACES WITHIN A ZONE 
C  HEAT TRANSFER COEFFICIENTS FOR THE INSIDE SURFACE AND 
C  THE CORRESPONDING OUTSIDE SURFACE OF THAT WALL OR WINDOW
C
C  THIS ROUTINE IS CALLED BY: TYPE56
C  THIS ROUTINE CALLS: VALUE
C
C  ADAPTED FROM TYPE80 IN 2004 BY S.HOLST.
C*******************************************************************************
Cak V16
      USE TrnsysData, ONLY:LUR,LUW,IFORM,LUK 
      use set_unitNo

Cak V16
      USE BPROPS
      USE VAR
      USE BGEN
      USE BREG
      USE BSURFACE
      USE BTYPES
      USE BTRANS
	USE BMATRIX

* SH:15.2.2004 variable declaration -- begin --
      implicit none
*  dummy arguments
Cak V16
c      real TIME
Cak V16
*  local variables
      integer I
      integer N1
      integer N2
      integer NS
      integer N
      integer NTYPE
	integer iHTC
	real HTC
	real VALUE
	real dTSA
	real KFLOORUP
	real EFLOORUP
	real KFLOORDOWN 
	real EFLOORDOWN
	real KCEILUP
	real ECEILUP 
	real KCEILDOWN 
	real ECEILDOWN 
	real KVERTICAL 
	real EVERTICAL
	

*  common block variables
*  /LUNITS/
Cak V16
c      integer LUK
c      integer IFORM
c      integer LUW
c      integer LUR
* SH:15.2.2004 variable declaration -- end --
c      DOUBLE PRECISION XIN
c ak      INTEGER*4 INP,INFO
      INTEGER*4 INP
c ak      DIMENSION XIN(*),INFO(15)
      real(8), intent(in)    :: XIN(*)
      integer, intent(inout) :: info(15)
      real(8)                :: time


!TW      integer                :: unitNo, typeNo
      CHARACTER(len=500) Message


c ak      COMMON /LUNITS/ LUR,LUW,IFORM,LUK
Cak V16

CSH 03/04 set parameters
CSH	KFLOORUP=2.0; EFLOORUP=0.31; KFLOORDOWN=1.08; EFLOORDOWN=0.31
CSH	KCEILUP=1.08; ECEILUP=0.31;  KCEILDOWN=2.0;   ECEILDOWN=0.31 
CSH	KVERTICAL=1.6; EVERTICAL=0.3

	KFLOORUP=HTC_COEF(1)/3.6;   EFLOORUP=HTC_COEF(2) 
	KFLOORDOWN=HTC_COEF(3)/3.6; EFLOORDOWN=HTC_COEF(4)
	KCEILUP=HTC_COEF(5)/3.6;    ECEILUP=HTC_COEF(6)  
	KCEILDOWN=HTC_COEF(7)/3.6;  ECEILDOWN=HTC_COEF(8) 
	KVERTICAL=HTC_COEF(9)/3.6;  EVERTICAL=HTC_COEF(10)

Cak V16
!TW      unitNo = info(1)
!TW      typeNo = info(2)
Cak V16


      DO I=1,NTZONE !loop all (regular+fictive) zones
C *** Walls ***
       IF(NZWALL(I).GT.0) THEN ! if walls
        N1=IPWALL(I)
        N2=N1+NZWALL(I)-1
        DO N=N1,N2 ! all walls
          NS=NSWALL(N)
          NTYPE=NSTYPE(NS)
	    IF (NFACE(NS).EQ.-1) THEN ! back side of adj/int wall
		   HTC=HCO(NTYPE) 		  
		  ELSE ! front side of adj/int or other wall
		   HTC=HCI(NTYPE)
		ENDIF ! back or front side of wall   
          IF (HTC.GT.-5500) THEN ! standard HTC calc for inside surface
		   HTCI(NS)=VALUE(TIME,HTC,INP,XIN)
CSH 08/04 KD
             IF (HTC.EQ.-4000) THEN ! gap calculation of active layer kuehldecke
	         HTCI(NS)=UC1(NS) ! use stored 1/R1 value from kuehldecken calc for gap calculation
		   ENDIF ! gap calculation of active layer kuehldecke		   
CSH 08/04 KD
            ELSE ! automatic HTC calc for inside surface
	       iHTC=INT(HTC-0.1)
	       dTSA=TSI(NS)-TBAR(I)
		   
		   IF (iHTC.EQ.-6000) THEN ! floor surface
	         IF (dTSA.GT.0.) THEN ! floor heat flow up
                 HTCI(NS)=MAX(1.,KHTC(NS)*KFLOORUP*(ABS(dTSA))
     .                           **EFLOORUP)*3.6           
                ELSE ! floor heat flow down
                 HTCI(NS)=MAX(1.,KHTC(NS)*KFLOORDOWN*(ABS(dTSA))
     .                           **EFLOORDOWN)*3.6           
               ENDIF ! heat flow direction
	  	   ENDIF ! floor surface   
         	   
		   IF (iHTC.EQ.-7000) THEN ! ceiling surface
	         IF (dTSA.GT.0.) THEN ! floor heat flow down
                 HTCI(NS)=MAX(1.,KHTC(NS)*KCEILDOWN*(ABS(dTSA))
     .                           **ECEILDOWN)*3.6           
                ELSE ! floor heat flow up
                 HTCI(NS)=MAX(1.,KHTC(NS)*KCEILUP*(ABS(dTSA))
     .                           **ECEILUP)*3.6           
               ENDIF ! heat flow direction
		   ENDIF ! ceiling surface   

		   IF (iHTC.EQ.-8000) THEN ! vertical surface
               HTCI(NS)=MAX(1.,KHTC(NS)*KVERTICAL*(ABS(dTSA))
     .                           **EVERTICAL)*3.6           
		   ENDIF ! vertical surface
         	   
		   IF (iHTC.LT.-8000) THEN ! error 
cak V16
      write(Message,'("Error in automatic heat transfer calculation 
     & for surface",i4," or its adjacent surface!")') NS
          CALL MESSAGES(-1,Message,'FATAL',unitNo,typeNo)
          RETURN
c              WRITE(LUW,1600) INFO(1),INFO(2),NS  ! error in HTC calc for surface NS
c              CALL MYSTOP (1001)
c              RETURN  
cak V16

             ENDIF ! error in HTC calc 
          ENDIF ! standard or automatic HTC calcs for inside surface
	    IF (NFACE(NS).EQ.-1) THEN ! back side of adj/int wall
		   HTC=HCI(NTYPE) 		  
		  ELSE ! front side of adj/int or other wall
		   HTC=HCO(NTYPE)
		ENDIF ! back or front side of wall   
		IF (HTC.GT.-5500) THEN ! standard HTC calc for outside surface
		   HTCO(NS)=VALUE(TIME,HTC,INP,XIN)
            ELSE ! automatic HTC calc for outside surface (if adj or int surface)
		   iHTC=INT(HTC-0.1)
             SELECT CASE (CONTYPE(NS)) ! which wall type
              CASE (1,4) ! external or boundary
cak V16
      write(Message,'("Error in automatic heat transfer calculation 
     & for surface",i4," or its adjacent surface!:
     & Automatic heat transfer calculation
     & is only allowed on surfaces within a zone. 
     & Please check building input file (.bui)!")') NS
          CALL MESSAGES(-1,Message,'FATAL',unitNo,typeNo)
          RETURN
c               WRITE(LUW,1600) INFO(1),INFO(2),NS  ! no automatic HTC calc on outside surf of ext or bound wall 
c               CALL MYSTOP (1001)
c               RETURN  
cak V16
              CASE (2)  ! adjacent
	         dTSA=TSO(NS)-TBAR(INT(BOUCON(NS)/1000.))
              CASE (3)  ! internal 
	         dTSA=TSO(NS)-TBAR(I)
              CASE (5)  ! identical boundaries
	         dTSA=TSO(NS)-TBAR(I)
             END SELECT ! which wall type
		   
		   IF (iHTC.EQ.-6000) THEN ! floor surface
	         IF (dTSA.GT.0.) THEN ! floor heat flow up
                 HTCO(NS)=MAX(1.,KHTC(NS)*KFLOORUP*(ABS(dTSA))
     .                           **EFLOORUP)*3.6           
                ELSE ! floor heat flow down
                 HTCO(NS)=MAX(1.,KFLOORDOWN*(ABS(dTSA))**EFLOORDOWN)*3.6           
               ENDIF ! heat flow direction
	  	   ENDIF ! floor surface   
         	   
		   IF (iHTC.EQ.-7000) THEN ! ceiling surface
	         IF (dTSA.GT.0.) THEN ! floor heat flow down
                 HTCO(NS)=MAX(1.,KHTC(NS)*KCEILDOWN*(ABS(dTSA))
     .                           **ECEILDOWN)*3.6           
                ELSE ! floor heat flow up
                 HTCO(NS)=MAX(1.,KHTC(NS)*KCEILUP*(ABS(dTSA))
     .                           **ECEILUP)*3.6           
               ENDIF ! heat flow direction
		   ENDIF ! ceiling surface   

		   IF (iHTC.EQ.-8000) THEN ! vertical surface
               HTCO(NS)=MAX(1.,KHTC(NS)*KVERTICAL*(ABS(dTSA))
     .                           **EVERTICAL)*3.6           
		   ENDIF ! vertical surface
         	   
		   IF (iHTC.LT.-8000) THEN ! error 
cak V16
      write(Message,'("Error in automatic heat transfer calculation 
     & for surface",i4," or its adjacent surface!:
     & Automatic heat transfer calculation
     & is only allowed on surfaces within a zone. 
     & Please check building input file (.bui)!")') NS
          CALL MESSAGES(-1,Message,'FATAL',unitNo,typeNo)
          RETURN
c              WRITE(LUW,1600) INFO(1),INFO(2),NS  ! error in HTC calc for surface NS
c              CALL MYSTOP (1001)
c              RETURN  
cak V16
             ENDIF ! error in HTC calc 
         ENDIF ! standard or automatic HTC calcs for outside surface

       ENDDO ! all walls
      ENDIF ! if walls

C *** Windows ***
       IF(NZWIN(I).GT.0) THEN ! if windows
        N1=IPWIN(I)
        N2=N1+NZWIN(I)-1
        DO N=N1,N2 ! all windows
         NS=NSWIN(N)
         NTYPE=NSTYPE(NS)
	   IF (NFACE(NS).EQ.-1) THEN ! back side of int window
	     HTC=DWIN(3,NTYPE) 		  
	    ELSE ! front side of int or external window
	     HTC=DWIN(2,NTYPE)
	   ENDIF ! back or front side of window   
         IF (HTC.GT.-5500) THEN ! standard HTC calc inside glass surface
		  HTCI(NS)=VALUE(TIME,DWIN(2,NTYPE),INP,XIN)
           ELSE ! automatic HTC calc
	      iHTC=INT(HTC-0.1)
	      dTSA=TSI(NS)-TBAR(I)
		  IF (iHTC.EQ.-6000) THEN ! floor surface
	         IF (dTSA.GT.0.) THEN ! floor heat flow up
                 HTCI(NS)=MAX(1.,KHTC(NS)*KFLOORUP*(ABS(dTSA))
     .                           **EFLOORUP)*3.6           
                ELSE ! floor heat flow down
                 HTCI(NS)=MAX(1.,KHTC(NS)*KFLOORDOWN*(ABS(dTSA))
     .                           **EFLOORDOWN)*3.6           
               ENDIF ! heat flow direction
	  	   ENDIF ! floor surface   
         	   
		   IF (iHTC.EQ.-7000) THEN ! ceiling surface
	         IF (dTSA.GT.0.) THEN ! floor heat flow down
                 HTCI(NS)=MAX(1.,KHTC(NS)*KCEILDOWN*(ABS(dTSA))
     .                           **ECEILDOWN)*3.6           
                ELSE ! floor heat flow up
                 HTCI(NS)=MAX(1.,KHTC(NS)*KCEILUP*(ABS(dTSA))
     .                           **ECEILUP)*3.6           
               ENDIF ! heat flow direction
		   ENDIF ! ceiling surface   
		   
		   IF (iHTC.EQ.-8000) THEN ! vertical surface
               HTCI(NS)=MAX(1.,KHTC(NS)*KVERTICAL*(ABS(dTSA))
     .                           **EVERTICAL)*3.6           
		  ENDIF ! vertical surface
         	   
		   IF (iHTC.LT.-8000) THEN ! error 
cak V16
      write(Message,'("Error in automatic heat transfer calculation 
     & for surface",i4," or its adjacent surface!:
     & Automatic heat transfer calculation
     & is only allowed on surfaces within a zone. 
     & Please check building input file (.bui)!")') NS
          CALL MESSAGES(-1,Message,'FATAL',unitNo,typeNo)
          RETURN
c              WRITE(LUW,1600) INFO(1),INFO(2),NS  ! error in HTC calc for surface NS
c              CALL MYSTOP (1001)
c              RETURN  
cak V16
             ENDIF ! error in HTC calc 
          ENDIF ! standard or automatic HTC calcs for inside glass surface

	   IF (NFACE(NS).EQ.-1) THEN ! back side of int window
	     HTC=DWIN(2,NTYPE) 		  
	    ELSE ! front side of int or external window
	     HTC=DWIN(3,NTYPE)
	   ENDIF ! back or front side of window   
         IF (HTC.GT.-5500) THEN ! standard HTC calc outside glass surface
		  HTCO(NS)=VALUE(TIME,HTC,INP,XIN)
           ELSE ! automatic HTC calc
            SELECT CASE (CONTYPE(NS)) ! which window type
              CASE (1) ! external 
cak V16
      write(Message,'("Error in automatic heat transfer calculation 
     & for surface",i4," or its adjacent surface!:
     & Automatic heat transfer calculation
     & is only allowed on surfaces within a zone. 
     & Please check building input file (.bui)!")') NS
          CALL MESSAGES(-1,Message,'FATAL',unitNo,typeNo)
          RETURN

c               WRITE(LUW,1600) INFO(1),INFO(2),NS  ! no automatic HTC calc on outside surf of ext window
c               CALL MYSTOP (1001)
c               RETURN  
              CASE (2)  ! adjacent
	         iHTC=INT(HTC-0.1)
	         dTSA=TSI(NADJ(NS))-TBAR(INT(BOUCON(NS)/1000.))
            END SELECT ! which window type
		   
		   IF (iHTC.EQ.-6000) THEN ! floor surface
	         IF (dTSA.GT.0.) THEN ! floor heat flow up
                 HTCO(NS)=MAX(1.,KHTC(NS)*KFLOORUP*(ABS(dTSA))
     .                           **EFLOORUP)*3.6           
                ELSE ! floor heat flow down
                 HTCO(NS)=MAX(1.,KHTC(NS)*KFLOORDOWN*(ABS(dTSA))
     .                           **EFLOORDOWN)*3.6           
               ENDIF ! heat flow direction
	  	   ENDIF ! floor surface   
         	   
		   IF (iHTC.EQ.-7000) THEN ! ceiling surface
	         IF (dTSA.GT.0.) THEN ! floor heat flow down
                 HTCO(NS)=MAX(1.,KHTC(NS)*KCEILDOWN*(ABS(dTSA))
     .                           **ECEILDOWN)*3.6           
                ELSE ! floor heat flow up
                 HTCO(NS)=MAX(1.,KHTC(NS)*KCEILUP*(ABS(dTSA))
     .                           **ECEILUP)*3.6           
               ENDIF ! heat flow direction
		   ENDIF ! ceiling surface   

		   IF (iHTC.EQ.-8000) THEN ! vertical surface
               HTCO(NS)=MAX(1.,KHTC(NS)*KVERTICAL*(ABS(dTSA))
     .                         **EVERTICAL)*3.6           
		   ENDIF ! vertical surface
         	   
		   IF (iHTC.LT.-8000) THEN ! error 
cak V16
      write(Message,'("Error in automatic heat transfer calculation 
     & for surface",i4," or its adjacent surface!:
     & Automatic heat transfer calculation
     & is only allowed on surfaces within a zone. 
     & Please check building input file (.bui)!")') NS
          CALL MESSAGES(-1,Message,'FATAL',unitNo,typeNo)
          RETURN
c              WRITE(LUW,1600) INFO(1),INFO(2),NS  ! error in HTC calc for surface NS
c              CALL MYSTOP (1001)
c              RETURN  
             ENDIF ! error in HTC calc 
         ENDIF ! standard or automatic HTC calcs for outside glass surface

        ENDDO ! all windows
       ENDIF ! if windows

      ENDDO !loop all regular+fictive zones
      RETURN
C1600  FORMAT(//,1X,'***** ERROR *****',8X,/1X,
C     .'UNIT ',I3,' TYPE ',I3,' MULTIZONE BUILDING',/1X,
C     .'ERROR IN AUTOMATIC HEAT TRANSFER CALCULATION FOR SURFACE ',I4,
C     .' OR ITS ADJACENT SURFACE')

      END ! CALHTC


More information about the TRNSYS-users mailing list