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), | DIMENSION(:) | :: | SurfPtrARR | ||
real(kind=r64), | intent(in) | :: | VentArea | |||
real(kind=r64), | intent(in) | :: | Cv | |||
real(kind=r64), | intent(in) | :: | Cd | |||
real(kind=r64), | intent(in) | :: | HdeltaNPL | |||
real(kind=r64), | intent(in) | :: | SolAbs | |||
real(kind=r64), | intent(in) | :: | AbsExt | |||
real(kind=r64), | intent(in) | :: | Tilt | |||
real(kind=r64), | intent(in) | :: | AspRat | |||
real(kind=r64), | intent(in) | :: | GapThick | |||
integer, | intent(in) | :: | Roughness | |||
real(kind=r64), | intent(in) | :: | QdotSource | |||
real(kind=r64), | intent(inout) | :: | TsBaffle | |||
real(kind=r64), | intent(inout) | :: | TaGap | |||
real(kind=r64), | intent(out), | optional | :: | HcGapRpt | ||
real(kind=r64), | intent(out), | optional | :: | HrGapRpt | ||
real(kind=r64), | intent(out), | optional | :: | IscRpt | ||
real(kind=r64), | intent(out), | optional | :: | MdotVentRpt | ||
real(kind=r64), | intent(out), | optional | :: | VdotWindRpt | ||
real(kind=r64), | intent(out), | optional | :: | VdotBouyRpt |
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 CalcPassiveExteriorBaffleGap(SurfPtrARR, VentArea, Cv, Cd, HdeltaNPL, SolAbs, AbsExt, Tilt, AspRat, GapThick, &
Roughness,QdotSource, TsBaffle, TaGap, HcGapRpt, HrGapRpt,IscRpt , MdotVentRpt, &
VdotWindRpt, VdotBouyRpt)
! SUBROUTINE INFORMATION:
! AUTHOR B.T. Griffith
! DATE WRITTEN November 2004
! MODIFIED BG March 2007 outdoor conditions from surface for height-dependent conditions
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! model the effect of the a ventilated baffle covering the outside of a heat transfer surface.
! return calculated temperatures and certain intermediate values for reporting
! METHODOLOGY EMPLOYED:
! Heat balances on baffle and air space.
! Natural ventilation calculations use bouyancy and wind.
! REFERENCES:
! Nat. Vent. equations from ASHRAE HoF 2001 Chapt. 26
! USE STATEMENTS:
USE DataPrecisionGlobals
USE DataEnvironment , ONLY: SkyTemp, WindSpeedAt, SunIsUp, OutBaroPress, IsRain
! USE DataLoopNode , ONLY: Node
USE Psychrometrics , ONLY: PsyRhoAirFnPbTdbW, PsyCpAirFnWTdb, PsyWFnTdbTwbPb
USE DataSurfaces , ONLY: Surface
USE DataHeatBalSurface, ONLY: TH
USE DataHeatBalance , ONLY: Material, Construct, QRadSWOutIncident
USE ConvectionCoefficients, ONLY: InitExteriorConvectionCoeff
USE SolarCollectors, ONLY: Collector
USE DataGlobals, ONLY: BeginEnvrnFlag
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN), DIMENSION(:) :: SurfPtrARR ! Array of indexes pointing to Surface structure in DataSurfaces
REAL(r64), INTENT(IN) :: VentArea ! Area available for venting the gap [m2]
REAL(r64), INTENT(IN) :: Cv ! Oriface coefficient for volume-based discharge, wind-driven [--]
REAL(r64), INTENT(IN) :: Cd ! oriface coefficient for discharge, bouyancy-driven [--]
REAL(r64), INTENT(IN) :: HdeltaNPL ! Height difference from neutral pressure level [m]
REAL(r64), INTENT(IN) :: SolAbs ! solar absorptivity of baffle [--]
REAL(r64), INTENT(IN) :: AbsExt ! thermal absorptance/emittance of baffle material [--]
REAL(r64), INTENT(IN) :: Tilt ! Tilt of gap [Degrees]
REAL(r64), INTENT(IN) :: AspRat ! aspect ratio of gap Height/gap [--]
REAL(r64), INTENT(IN) :: GapThick ! Thickness of air space between baffle and underlying heat transfer surface
INTEGER, INTENT(IN) :: Roughness ! Roughness index (1-6), see DataHeatBalance parameters
REAL(r64), INTENT(IN) :: QdotSource ! Source/sink term, e.g. electricity exported from solar cell [W]
REAL(r64), INTENT(INOUT) :: TsBaffle ! Temperature of baffle (both sides) use lagged value on input [C]
REAL(r64), INTENT(INOUT) :: TaGap ! Temperature of air gap (assumed mixed) use lagged value on input [C]
REAL(r64), INTENT(OUT), OPTIONAL :: HcGapRpt !
REAL(r64), INTENT(OUT), OPTIONAL :: HrGapRpt !
REAL(r64), INTENT(OUT), OPTIONAL :: IscRpt
REAL(r64), INTENT(OUT), OPTIONAL :: MdotVentRpt
REAL(r64), INTENT(OUT), OPTIONAL :: VdotWindRpt
REAL(r64), INTENT(OUT), OPTIONAL :: VdotBouyRpt
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: g = 9.807d0 ! gravitational constant (m/s**2)
REAL(r64), PARAMETER :: nu = 15.66d-6 ! kinematic viscosity (m**2/s) for air at 300 K (Mills 1999 Heat Transfer)
REAL(r64), PARAMETER :: k = 0.0267d0 ! thermal conductivity (W/m K) for air at 300 K (Mills 1999 Heat Transfer)
REAL(r64), PARAMETER :: Pr = 0.71d0 ! Prandtl number for air
REAL(r64), PARAMETER :: Sigma = 5.6697d-08 ! Stefan-Boltzmann constant
REAL(r64), PARAMETER :: KelvinConv = 273.15d0 ! Conversion from Celsius to Kelvin
! INTERFACE BLOCK SPECIFICATIONS:
! DERIVED TYPE DEFINITIONS:
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
! following arrays are used to temporarily hold results from multiple underlying surfaces
REAL(r64), ALLOCATABLE, DIMENSION(:) :: HSkyARR !
REAL(r64), ALLOCATABLE, DIMENSION(:) :: HGroundARR
REAL(r64), ALLOCATABLE, DIMENSION(:) :: HAirARR !
REAL(r64), ALLOCATABLE, DIMENSION(:) :: HPlenARR
REAL(r64), ALLOCATABLE, DIMENSION(:) :: HExtARR !
REAL(r64), ALLOCATABLE, DIMENSION(:) :: LocalWindArr
! local working variables
REAL(r64) :: RhoAir ! density of air
REAL(r64) :: CpAir ! specific heat of air
REAL(r64) :: Tamb ! outdoor drybulb
REAL(r64) :: A ! projected area of baffle from sum of underlying surfaces
REAL(r64) :: HcPlen ! surface convection heat transfer coefficient for plenum surfaces
INTEGER :: thisSurf ! do loop counter
INTEGER :: numSurfs ! number of underlying HT surfaces associated with UTSC
REAL(r64) :: TmpTsBaf ! baffle temperature
INTEGER :: SurfPtr ! index of surface in main surface structure
REAL(r64) :: HMovInsul ! dummy for call to InitExteriorConvectionCoeff
REAL(r64) :: HExt ! dummy for call to InitExteriorConvectionCoeff
INTEGER :: ConstrNum ! index of construction in main construction structure
REAL(r64) :: AbsThermSurf ! thermal emmittance of underlying wall.
REAL(r64) :: TsoK ! underlying surface temperature in Kelvin
REAL(r64) :: TsBaffK ! baffle temperature in Kelvin (lagged)
REAL(r64) :: Vwind ! localized, and area-weighted average for wind speed
REAL(r64) :: HrSky ! radiation coeff for sky, area-weighted average
REAL(r64) :: HrGround ! radiation coeff for ground, area-weighted average
REAL(r64) :: HrAtm ! radiation coeff for air (bulk atmosphere), area-weighted average
REAL(r64) :: Isc ! Incoming combined solar radiation, area-weighted average
REAL(r64) :: HrPlen ! radiation coeff for plenum surfaces, area-weighted average
REAL(r64) :: Tso ! temperature of underlying surface, area-weighted average
REAL(r64) :: TmeanK ! average of surface temps , for Beta in Grashoff no.
REAL(r64) :: Gr ! Grasshof number for natural convection calc
REAL(r64) :: VdotWind ! volume flow rate of nat. vent due to wind
REAL(r64) :: VdotThermal ! Volume flow rate of nat. vent due to bouyancy
REAL(r64) :: VdotVent ! total volume flow rate of nat vent
REAL(r64) :: MdotVent ! total mass flow rate of nat vent
REAL(r64) :: NuPlen ! Nusselt No. for plenum Gap
REAL(r64) :: LocalOutDryBulbTemp ! OutDryBulbTemp for here
REAL(r64) :: LocalWetBulbTemp ! OutWetBulbTemp for here
REAL(r64) :: LocalOutHumRat ! OutHumRat for here
LOGICAL :: ICSCollectorIsOn =.FALSE. ! ICS collector has OSCM on
INTEGER :: CollectorNum ! current solar collector index
REAL(r64) :: ICSWaterTemp ! ICS solar collector water temp
REAL(r64) :: ICSULossbottom ! ICS solar collector bottom loss Conductance
LOGICAL, SAVE :: MyICSEnvrnFlag = .TRUE. ! Local environment flag for ICS
LocalOutDryBulbTemp = Sum(Surface(SurfPtrARR)%Area * Surface(SurfPtrARR)%OutDryBulbTemp) &
/ Sum(Surface(SurfPtrARR)%Area)
LocalWetBulbTemp = Sum(Surface(SurfPtrARR)%Area * Surface(SurfPtrARR)%OutWetBulbTemp) &
/ Sum(Surface(SurfPtrARR)%Area)
LocalOutHumRat = PsyWFnTdbTwbPb(LocalOutDryBulbTemp,localWetBulbTemp,OutBaroPress,calledfrom='CalcPassiveExteriorBaffleGap')
RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress,LocalOutDryBulbTemp,LocalOutHumRat,calledfrom='CalcPassiveExteriorBaffleGap')
CpAir = PsyCpAirFnWTdb(LocalOutHumRat,LocalOutDryBulbTemp,calledfrom='CalcPassiveExteriorBaffleGap')
If (.NOT. IsRain) Then
Tamb = LocalOutDryBulbTemp
ELSE ! when raining we use wetbulb not drybulb
Tamb = LocalWetBulbTemp
ENDIF
A = Sum(Surface(SurfPtrARR)%Area)
TmpTsBaf = TsBaffle
!loop through underlying surfaces and collect needed data
NumSurfs = size(SurfPtrARR)
ALLOCATE(HSkyARR(NumSurfs))
HSkyARR = 0.0d0
ALLOCATE(HGroundARR(NumSurfs))
HGroundARR = 0.0d0
ALLOCATE(HAirARR(NumSurfs))
HAirARR = 0.0d0
ALLOCATE(LocalWindArr(NumSurfs))
LocalWindArr = 0.0d0
Allocate(HPlenARR(NumSurfs))
HPlenARR = 0.0d0
ALLOCATE(HExtARR(NumSurfs))
HExtARR = 0.0d0
Do thisSurf =1, NumSurfs
SurfPtr = SurfPtrARR(thisSurf)
! Initializations for this surface
HMovInsul = 0.0d0
LocalWindArr(thisSurf) = Surface(SurfPtr)%WindSpeed
CALL InitExteriorConvectionCoeff(SurfPtr,HMovInsul,Roughness,AbsExt,TmpTsBaf, &
HExtARR(thisSurf),HSkyARR(thisSurf),HGroundARR(thisSurf),HAirARR(thisSurf))
ConstrNum = Surface(SurfPtr)%Construction
AbsThermSurf = Material(Construct(ConstrNum)%LayerPoint(1))%AbsorpThermal
TsoK = TH(SurfPtr,1,1) + KelvinConv
TsBaffK = TmpTsBaf + KelvinConv
If (TsBaffK == TsoK) Then ! avoid divide by zero
HPlenARR(thisSurf) = 0.0d0 ! no net heat transfer if same temperature
ELSE
HPlenARR(thisSurf) = Sigma*AbsExt*AbsThermSurf*(TsBaffK**4 - TsoK**4)/(TsBaffK - TsoK)
ENDIF
! Added for ICS collector OSCM
IF ( Surface(SurfPtr)%IsICS ) THEN
ICSCollectorIsOn = .TRUE.
CollectorNum = Surface(SurfPtr)%ICSPtr
ENDIF
ENDDO
IF (ICSCollectorIsOn) THEN
IF(BeginEnvrnFlag .AND. MyICSEnvrnFlag) THEN
ICSULossbottom = 0.40d0
ICSWaterTemp = 20.0d0
ELSE
ICSULossbottom = Collector(CollectorNum)%UbLoss
ICSWaterTemp = Collector(CollectorNum)%TempOfWater
MyICSEnvrnFlag = .FALSE.
ENDIF
ENDIF
IF ( .NOT. BeginEnvrnFlag )THEN
MyICSEnvrnFlag = .TRUE.
ENDIF
If (A == 0.0d0) then ! should have been caught earlier
ENDIF
! now figure area-weighted averages from underlying surfaces.
Vwind = Sum(LocalWindArr*Surface(SurfPtrARR)%Area) /A
DEALLOCATE(LocalWindArr)
HrSky = Sum(HSkyARR*Surface(SurfPtrARR)%Area) /A
DEALLOCATE(HSkyARR)
HrGround = Sum(HGroundARR*Surface(SurfPtrARR)%Area) /A
DEALLOCATE(HGroundARR)
HrAtm = Sum(HAirARR*Surface(SurfPtrARR)%Area) /A
DEALLOCATE(HAirARR)
HrPlen = Sum(HPlenARR*Surface(SurfPtrARR)%Area) /A
DEALLOCATE(HPlenARR)
HExt = Sum(HExtARR*Surface(SurfPtrARR)%Area) /A
DEALLOCATE(HExtARR)
If (IsRain) HExt = 1000.0d0
Tso = SUM(TH((SurfPtrARR),1,1)*Surface(SurfPtrARR)%Area) /A
Isc = SUm(QRadSWOutIncident(SurfPtrARR)*Surface(SurfPtrARR)%Area) /A
TmeanK = 0.5d0*(TmpTsBaf + Tso)+ KelvinConv
gr = g * GapThick**3 * ABS(Tso - TmpTsBaf) * RhoAir**2 / (TmeanK * nu**2)
CALL PassiveGapNusseltNumber(AspRat,Tilt ,TmpTsBaf,Tso, Gr, NuPlen) !intentionally switch Tso to Tsi
HcPlen = NuPlen *(k / GapThick)
! now model natural ventilation of plenum gap.
VdotWind = Cv * (VentArea / 2.0d0) * Vwind
IF (TaGap > Tamb) Then
VdotThermal = Cd * (VentArea / 2.d0)*(2.d0*g*HdeltaNPL*(TaGap - Tamb)/(TaGap + KelvinConv) )**0.5d0
ELSEIF ( TaGap == Tamb) then
VdotThermal = 0.0d0
ELSE
IF ((ABS(tilt) < 5.0d0) .OR. (ABS(Tilt - 180) < 5.0d0)) Then
VdotThermal = 0.0d0 ! stable bouyancy situation
ELSE
VdotThermal = Cd * (VentArea / 2.d0)*(2.d0*g*HdeltaNPL*(Tamb - TaGap )/(Tamb+ KelvinConv))**0.5d0
ENDIF
ENDIF
VdotVent = VdotWind + VdotThermal
MdotVent = VdotVent * RhoAir
!now calculate baffle temperature
IF ( .NOT. ICSCollectorIsOn ) THEN
TsBaffle = (Isc*SolAbs + HExt*Tamb + HrAtm*Tamb + HrSky*SkyTemp + HrGround*Tamb + HrPlen*Tso + &
Hcplen*TaGap + QdotSource) &
/(HExt + HrAtm + HrSky + HrGround + Hrplen + Hcplen)
ELSE
TsBaffle = (ICSULossbottom*ICSWaterTemp + HrPlen*Tso + Hcplen*TaGap + QdotSource) &
/ (ICSULossbottom + Hrplen + Hcplen)
ENDIF
!now calculate gap air temperature
TaGap = (HcPlen*A*Tso + MdotVent*CpAir*Tamb + HcPlen*A*TsBaffle) / (HcPlen*A + MdotVent*CpAir + HcPlen*A)
IF (PRESENT(HcGapRpt)) HcGapRpt = Hcplen
IF (PRESENT(HrGapRpt)) HrGapRpt = Hrplen
IF (PRESENT(IscRpt)) IscRpt = Isc
IF (PRESENT(MdotVentRpt)) MdotVentRpt = MdotVent
IF (PRESENT(VdotWindRpt)) VdotWindRpt = VdotWind
IF (PRESENT(VdotBouyRpt)) VdotBouyRpt = VdotThermal
RETURN
END SUBROUTINE CalcPassiveExteriorBaffleGap