Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | s | |||
real(kind=r64), | intent(in) | :: | h | |||
real(kind=r64), | intent(in) | :: | phib | |||
real(kind=r64), | intent(in) | :: | phis | |||
real(kind=r64), | intent(out) | :: | F(6,6) |
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 ViewFac(s,h,phib,phis,F)
! SUBROUTINE INFORMATION:
! AUTHOR Hans Simmler
! DATE WRITTEN July-Aug 1995
! MODIFIED Aug 2001 (FCW): adapt to EnergyPlus
! Apr 2002 (FCW): prevent sqrt of small negative argument
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculates the view factors between sections of adjacent slats,
! where each slat is divided longitudinally into two equal sections whose
! dimensions depend on source profile angle and slat geometry. The view
! factors are used in BlindOpticsBeam and BlindOpticsDiffuse to determine blind
! transmittance and reflectance for short-wave and long-wave radiation.
! METHODOLOGY EMPLOYED:
! Uses expressions for view factor between flat strips with a common edge
! and flat strips displaced from one another. See engineering documentation.
! REFERENCES:
! "Solar-Thermal Window Blind Model for DOE-2," H. Simmler, U. Fischer and
! F. Winkelmann, Lawrence Berkeley National Laboratory, Jan. 1996.
! USE STATEMENTS:na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
REAL(r64), INTENT(IN) :: s ! Slat width (m)
REAL(r64), INTENT(IN) :: h ! Distance between faces of adjacent slats (m)
REAL(r64), INTENT(IN) :: phib ! Elevation angle of normal to slat (radians)
REAL(r64), INTENT(IN) :: phis ! Profile angle of radiation source (radians)
REAL(r64), INTENT(OUT) :: F(6,6) ! View factor array
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: L(6),L3,L5 ! Length of slat sections: L1 = L2 = h; L3, L5 = length
! of upper slat sections; L4, L6 = length of lower slat
! slat sections (m)
REAL(r64) :: d1,d2,d3,d4,d5,d6 ! Slat geometry variables (m)
REAL(r64) :: h2 ! h**2
REAL(r64) :: ht ! 2*h
REAL(r64) :: w ! Slat geometry variable (m)
REAL(r64) :: a ! Intermediate variable (m)
REAL(r64) :: co ! Cosine of source profile angle
INTEGER :: i,j ! View factor array indices
h2=h**2
ht=2.0d0*h
co=cos(phis)
if (abs(co) < 0.001d0) co=0.0d0
w=ht
if (co.ne.0.0d0) w=s*cos(phib-phis)/co
L3=s*h/abs(w)
if (L3 > s) L3=s
L5=s-L3
a=ht*cos(phib)
! MAX(0.,...) in the following prevents small negative argument for sqrt
d1=sqrt(MAX(0.d0,s*s+h2+a*s))
d2=sqrt(MAX(0.d0,s*s+h2-a*s))
d3=sqrt(MAX(0.d0,L3*L3+h2+a*L3))
d4=sqrt(MAX(0.d0,L3*L3+h2-a*L3))
d5=sqrt(MAX(0.d0,L5*L5+h2-a*L5))
d6=sqrt(MAX(0.d0,L5*L5+h2+a*L5))
do i=1,6
F(i,i)=0.0d0
end do
F(1,1)=0.0d0
F(1,2)=(d1+d2-2.0d0*s)/ht
F(1,3)=(h+L3-d3)/ht
F(1,4)=(h+L3-d4)/ht
F(1,5)=(L5+d3-d1)/ht
F(1,6)=(L5+d4-d2)/ht
F(2,3)=(L3+d5-d2)/ht
F(2,4)=(L3+d6-d1)/ht
F(2,5)=(h+L5-d5)/ht
F(2,6)=(h+L5-d6)/ht
F(3,4)=(d3+d4-ht)/(2.0d0*L3)
F(3,5)=0.0d0
F(3,6)=(d2+h-d4-d5)/(2.0d0*L3)
F(4,5)=(d1+h-d3-d6)/(2.0d0*L3)
F(4,6)=0.0d0
F(5,6)=0.0d0
if (L5 > 0.0d0) F(5,6)=(d5+d6-ht)/(2.0d0*L5)
L(1)=h
L(2)=h
L(3)=L3
L(4)=L3
L(5)=L5
L(6)=L5
do i=2,6
do j=1,i-1
F(i,j)=0.0d0
if (L(i) > 0.0d0) F(i,j)=F(j,i)*L(j)/L(i)
end do
end do
RETURN
END SUBROUTINE VIEWFAC