Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | ShelfNum |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE CalcViewFactorToShelf(ShelfNum)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN August 2003
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Attempts to calculate exact analytical view factor from window to outside shelf.
! METHODOLOGY EMPLOYED:
! Uses a standard analytical solution. It is required that window and shelf have the same width, i.e.
! one edge (or two vertices) shared in common. An error or warning is issued if not true.
!
! A more general routine should be implemented at some point to solve for more complicated geometries.
! Until then, the user has the option to specify their own solution for the view factor in the input object.
! REFERENCES:
! Mills, A. F. Heat and Mass Transfer, 1995, p. 499. (Shape factor for adjacent rectangles.)
! USE STATEMENTS:
USE Vectors, ONLY: Distance
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ShelfNum ! Daylighting shelf object number
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: W, H, L ! Width, height, and length of window/shelf geometry
REAL(r64) :: M, N ! Intermediate variables
REAL(r64) :: E1, E2, E3, E4 ! Intermediate equations
INTEGER :: VWin, VShelf ! Vertex indices
INTEGER :: NumMatch ! Number of vertices matched
! FLOW:
W = Surface(Shelf(ShelfNum)%Window)%Width
H = Surface(Shelf(ShelfNum)%Window)%Height
! Find length, i.e. projection, of outside shelf
IF (Surface(Shelf(ShelfNum)%OutSurf)%Width == W) THEN
L = Surface(Shelf(ShelfNum)%OutSurf)%Height
ELSE IF (Surface(Shelf(ShelfNum)%OutSurf)%Height == W) THEN
L = Surface(Shelf(ShelfNum)%OutSurf)%Width
ELSE
CALL ShowFatalError('DaylightingDevice:Shelf = '//TRIM(Shelf(ShelfNum)%Name)// &
': Width of window and outside shelf do not match.')
END IF
! Error if more or less than two vertices match
NumMatch = 0
DO VWin = 1, 4
DO VShelf = 1, 4
IF (Distance(Surface(Shelf(ShelfNum)%Window)%Vertex(VWin), Surface(Shelf(ShelfNum)%OutSurf)%Vertex(VShelf)) == 0.0d0) &
NumMatch = NumMatch + 1
END DO
END DO
IF (NumMatch < 2) THEN
CALL ShowWarningError('DaylightingDevice:Shelf = '//TRIM(Shelf(ShelfNum)%Name)// &
': Window and outside shelf must share two vertices. View factor calculation may be inaccurate.')
ELSE IF (NumMatch > 2) THEN
CALL ShowFatalError('DaylightingDevice:Shelf = '//TRIM(Shelf(ShelfNum)%Name)// &
': Window and outside shelf share too many vertices.')
END IF
! Calculate exact analytical view factor from window to outside shelf
M = H / W
N = L / W
E1 = M * ATAN((1.0d0 / M)) + N * ATAN((1.0d0 / N)) - (SQRT(N**2 + M**2)) * ATAN(((N**2 + M**2))**(-0.5d0))
E2 = ((1.0d0 + M**2) * (1.0d0 + N**2)) / (1.0d0 + M**2 + N**2)
E3 = ((M**2) * (1.0d0 + M**2 + N**2) / ((1.0d0 + M**2) * (M**2 + N**2)))**(M**2)
E4 = ((N**2) * (1.0d0 + M**2 + N**2) / ((1.0d0 + N**2) * (M**2 + N**2)))**(N**2)
Shelf(ShelfNum)%ViewFactor = (1.0d0 / (Pi * M)) * (E1 + 0.25d0 * LOG(E2 * E3 * E4))
RETURN
END SUBROUTINE CalcViewFactorToShelf