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) | :: | SurfNum | |||
integer, | intent(in) | :: | UserCurveNum | |||
real(kind=r64), | intent(out) | :: | Hc |
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 CalcUserDefinedInsideHcModel(SurfNum, UserCurveNum, Hc)
! SUBROUTINE INFORMATION:
! AUTHOR Brent Griffith
! DATE WRITTEN Aug 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! calculate user-defined convection correlations for inside face
! METHODOLOGY EMPLOYED:
! call curve objects to evaluate user's model equation
! prepare independent parameters for x values
! REFERENCES:
! na
! USE STATEMENTS:
USE DataZoneEquipment
USE DataHeatBalSurface, ONLY: TH
USE DataHeatBalFanSys, ONLY: MAT
USE DataEnvironment, ONLY: OutBaroPress
USE Psychrometrics, ONLY: PsyRhoAirFnPbTdbW, PsyWFnTdpPb
USE CurveManager, ONLY: CurveValue
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER , INTENT(IN) :: SurfNum
INTEGER , INTENT(IN) :: UserCurveNum
REAL(r64), INTENT(OUT):: Hc
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: tmpHc
REAL(r64) :: tmpAirTemp
REAL(r64) :: SupplyAirTemp
REAL(r64) :: AirChangeRate
INTEGER :: ZoneNum
INTEGER :: ZoneNode
INTEGER :: EquipNum
REAL(r64) :: SumMdotTemp
REAL(r64) :: SumMdot
REAL(r64) :: AirDensity
INTEGER :: thisZoneInletNode
ZoneNum = Surface(SurfNum)%Zone
SumMdotTemp = 0.d0
SumMdot = 0.d0
SupplyAirTemp = MAT(ZoneNum)
IF (Zone(ZoneNum)%IsControlled) THEN
ZoneNode = Zone(ZoneNum)%SystemZoneNodeNumber
AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress,Node(ZoneNode)%Temp,PsyWFnTdpPb(Node(ZoneNode)%Temp,OutBaroPress))
AirChangeRate = (Node(ZoneNode)%MassFlowRate * SecInHour)/ (AirDensity * Zone(ZoneNum)%Volume)
IF (ZoneEquipConfig(ZoneNum)%EquipListIndex > 0) THEN
DO EquipNum = 1, ZoneEquipList(ZoneEquipConfig(ZoneNum)%EquipListIndex)%NumOfEquipTypes
IF (ALLOCATED(ZoneEquipList(ZoneEquipConfig(ZoneNum)%EquipListIndex)%EquipData(EquipNum)%OutletNodeNums)) THEN
thisZoneInletNode = ZoneEquipList(ZoneEquipConfig(ZoneNum)%EquipListIndex)%EquipData(EquipNum)%OutletNodeNums(1)
IF ((thisZoneInletNode > 0) .AND. (Node(thisZoneInletNode)%MassFlowRate > 0.d0)) THEN
SumMdotTemp = SumMdotTemp + Node(thisZoneInletNode)%MassFlowRate * Node(thisZoneInletNode)%Temp
ENDIF
ENDIF
ENDDO
ENDIF
If (SumMdot > 0.d0) THEN
SupplyAirTemp = SumMdotTemp / SumMdot ! mass flow weighted inlet temperature
ENDIF
ENDIF
SELECT CASE (HcInsideUserCurve(UserCurveNum)%ReferenceTempType)
CASE (RefTempMeanAirTemp)
tmpAirTemp = MAT(ZoneNum)
Surface(SurfNum)%TAirRef = ZoneMeanAirTemp
CASE (RefTempAdjacentAirTemp)
tmpAirTemp = TempEffBulkAir(SurfNum)
Surface(SurfNum)%TAirRef = AdjacentAirTemp
CASE (RefTempSupplyAirTemp)
tmpAirTemp = SupplyAirTemp
Surface(SurfNum)%TAirRef = ZoneSupplyAirTemp
END SELECT
tmpHc = 0.d0
IF (HcInsideUserCurve(UserCurveNum)%HcFnTempDiffCurveNum > 0) THEN
tmpHc = CurveValue(HcInsideUserCurve(UserCurveNum)%HcFnTempDiffCurveNum, &
ABS(TH(SurfNum,1, 2) - tmpAirTemp) )
ENDIF
IF (HcInsideUserCurve(UserCurveNum)%HcFnTempDiffDivHeightCurveNum > 0) THEN
tmpHc = tmpHc + CurveValue(HcInsideUserCurve(UserCurveNum)%HcFnTempDiffDivHeightCurveNum, &
(ABS(TH(SurfNum,1, 2) - tmpAirTemp)/Surface(SurfNum)%IntConvZoneWallHeight) )
ENDIF
IF (HcInsideUserCurve(UserCurveNum)%HcFnACHCurveNum > 0) THEN
tmpHc = tmpHc + CurveValue(HcInsideUserCurve(UserCurveNum)%HcFnACHCurveNum, AirChangeRate)
ENDIF
IF (HcInsideUserCurve(UserCurveNum)%HcFnACHDivPerimLengthCurveNum > 0) THEN
tmpHc = tmpHc + CurveValue(HcInsideUserCurve(UserCurveNum)%HcFnACHDivPerimLengthCurveNum, &
(AirChangeRate / Surface(SurfNum)%IntConvZonePerimLength) )
ENDIF
Hc = tmpHc
RETURN
END SUBROUTINE CalcUserDefinedInsideHcModel