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) | :: | CoilNum | |||
real(kind=r64) | :: | QCoilReq | ||||
real(kind=r64), | intent(out) | :: | QCoilActual | |||
integer, | intent(in) | :: | FanOpMode | |||
real(kind=r64), | intent(in) | :: | PartLoadRatio |
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 CalcElectricHeatingCoil(CoilNum,QCoilReq,QCoilActual,FanOpMode,PartLoadRatio)
! SUBROUTINE INFORMATION:
! AUTHOR Rich Liesen
! DATE WRITTEN May 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Simulates a simple Electric heating coil with an efficiency
! METHODOLOGY EMPLOYED:
! REFERENCES:
! USE STATEMENTS:
USE DataHVACGlobals, ONLY: TempControlTol, ElecHeatingCoilPower
USE DataAirLoop, ONLY: LoopHeatingCoilMaxRTF
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: CoilNum ! index to heating coil
REAL(r64), INTENT(OUT) :: QCoilActual ! coil load actually delivered (W)
INTEGER, INTENT(IN) :: FanOpMode ! fan operating mode
REAL(r64), INTENT(IN) :: PartLoadRatio ! part-load ratio of heating coil
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) AirMassFlow ! [kg/sec]
REAL(r64) TempAirIn ! [C]
REAL(r64) TempAirOut ! [C]
REAL(r64) Win
REAL(r64) Effic
REAL(r64) CapacitanceAir
REAL(r64) HeatingCoilLoad
REAL(r64) QCoilReq
REAL(r64) QCoilCap
REAL(r64) TempSetPoint
Integer Control
Effic = HeatingCoil(CoilNum)%Efficiency
TempAirIn = HeatingCoil(CoilNum)%InletAirTemp
Win = HeatingCoil(CoilNum)%InletAirHumRat
Control = HeatingCoil(CoilNum)%Control
TempSetPoint = HeatingCoil(CoilNum)%DesiredOutletTemp
! adjust mass flow rates for cycling fan cycling coil operation
IF(FanOpMode .EQ. CycFanCycCoil)THEN
IF(PartLoadRatio .GT. 0.0d0)THEN
AirMassFlow = HeatingCoil(CoilNum)%InletAirMassFlowRate / PartLoadRatio
QCoilReq = QCoilReq / PartLoadRatio
ELSE
AirMassFlow = 0.0d0
END IF
ELSE
AirMassFlow = HeatingCoil(CoilNum)%InletAirMassFlowRate
END IF
CapacitanceAir=PsyCpAirFnWTdb(Win,TempAirIn)*AirMassFlow
! If the coil is operating there should be some heating capacitance
! across the coil, so do the simulation. If not set outlet to inlet and no load.
! Also the coil has to be scheduled to be available.
! Control output to meet load QCoilReq (QCoilReq is passed in if load controlled, otherwise QCoilReq=-999)
IF((AirMassFlow .GT. 0.0d0 .AND. HeatingCoil(CoilNum)%NominalCapacity > 0.0d0) .and. &
(GetCurrentScheduleValue(HeatingCoil(CoilNum)%SchedPtr) .gt. 0.0d0) .and. &
(QCoilReq .gt. 0.0d0)) THEN
!check to see if the Required heating capacity is greater than the user specified capacity.
IF(QCoilReq > HeatingCoil(CoilNum)%NominalCapacity) Then
QCoilCap = HeatingCoil(CoilNum)%NominalCapacity
Else
QCoilCap = QCoilReq
End IF
TempAirOut=TempAirIn + QCoilCap/CapacitanceAir
HeatingCoilLoad = QCoilCap
!The HeatingCoilLoad is the change in the enthalpy of the Heating
HeatingCoil(CoilNum)%ElecUseLoad = HeatingCoilLoad/Effic
! Control coil output to meet a setpoint temperature.
Else IF((AirMassFlow .GT. 0.0d0 .AND. HeatingCoil(CoilNum)%NominalCapacity > 0.0d0) .and. &
(GetCurrentScheduleValue(HeatingCoil(CoilNum)%SchedPtr) .gt. 0.0d0) .and. &
(QCoilReq == SensedLoadFlagValue) .and. &
(ABS(TempSetPoint-TempAirIn) .gt. TempControlTol) ) THEN
QCoilCap = CapacitanceAir*(TempSetPoint - TempAirIn)
! check to see if setpoint above enetering temperature. If not, set
! output to zero.
IF(QCoilCap .LE. 0.0d0) THEN
QCoilCap = 0.0d0
TempAirOut = TempAirIn
!check to see if the Required heating capacity is greater than the user
! specified capacity.
Else IF(QCoilCap > HeatingCoil(CoilNum)%NominalCapacity) Then
QCoilCap = HeatingCoil(CoilNum)%NominalCapacity
TempAirOut=TempAirIn + QCoilCap/CapacitanceAir
Else
TempAirOut = TempSetPoint
End IF
HeatingCoilLoad = QCoilCap
!The HeatingCoilLoad is the change in the enthalpy of the Heating
HeatingCoil(CoilNum)%ElecUseLoad = HeatingCoilLoad/Effic
Else ! If not running Conditions do not change across coil from inlet to outlet
TempAirOut=TempAirIn
HeatingCoilLoad=0.0d0
HeatingCoil(CoilNum)%ElecUseLoad = 0.0d0
END IF
IF(FanOpMode .EQ. CycFanCycCoil)THEN
HeatingCoil(CoilNum)%ElecUseLoad = HeatingCoil(CoilNum)%ElecUseLoad * PartLoadRatio
HeatingCoilLoad = HeatingCoilLoad * PartLoadRatio
END IF
HeatingCoil(CoilNum)%HeatingCoilLoad = HeatingCoilLoad
ElecHeatingCoilPower = HeatingCoil(CoilNum)%ElecUseLoad
! Set the outlet conditions
HeatingCoil(CoilNum)%OutletAirTemp = TempAirOut
! This HeatingCoil does not change the moisture or Mass Flow across the component
HeatingCoil(CoilNum)%OutletAirHumRat = HeatingCoil(CoilNum)%InletAirHumRat
HeatingCoil(CoilNum)%OutletAirMassFlowRate = HeatingCoil(CoilNum)%InletAirMassFlowRate
!Set the outlet enthalpys for air and Heating
HeatingCoil(CoilNum)%OutletAirEnthalpy = PsyHFnTdbW(HeatingCoil(CoilNum)%OutletAirTemp, &
HeatingCoil(CoilNum)%OutletAirHumRat)
QCoilActual = HeatingCoilLoad
IF (ABS(HeatingCoil(CoilNum)%NominalCapacity) < 1.d-8) THEN
LoopHeatingCoilMaxRTF = MAX(LoopHeatingCoilMaxRTF,0.0d0)
ELSE
LoopHeatingCoilMaxRTF = MAX(LoopHeatingCoilMaxRTF,HeatingCoilLoad/HeatingCoil(CoilNum)%NominalCapacity)
ENDIF
RETURN
END Subroutine CalcElectricHeatingCoil