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) | :: | MSHeatPumpNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=r64), | intent(in) | :: | HeatingLoad | |||
integer, | intent(in) | :: | FanMode | |||
real(kind=r64), | intent(out) | :: | HeatCoilLoadmet | |||
real(kind=r64), | intent(in), | optional | :: | PartLoadFrac |
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 CalcNonDXHeatingCoils(MSHeatPumpNum,FirstHVACIteration,HeatingLoad,FanMode,HeatCoilLoadmet,PartLoadFrac)
! SUBROUTINE INFORMATION:
! AUTHOR Bereket Nigusse, FSEC/UCF
! DATE WRITTEN January 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine simulates the four non dx heating coil types: Gas, Electric, hot water and steam.
! METHODOLOGY EMPLOYED:
! Simply calls the different heating coil component. The hot water flow rate matching the coil load
! is calculated iteratively.
! REFERENCES:
! na
! USE STATEMENTS:
USE HeatingCoils, ONLY: SimulateHeatingCoilComponents
USE WaterCoils, ONLY: SimulateWaterCoilComponents
USE SteamCoils, ONLY: SimulateSteamCoilComponents
USE PlantUtilities, ONLY: SetComponentFlowRate
USE General, ONLY: SolveRegulaFalsi,RoundSigDigits
USE DataHVACGlobals, ONLY: SmallLoad
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: MSHeatPumpNum ! multispeed heatpump index
LOGICAL, INTENT(IN) :: FirstHVACIteration ! flag for first HVAC iteration in the time step
REAL(r64), INTENT(IN) :: HeatingLoad ! supplemental coil load to be met by unit (watts)
REAL(r64), INTENT(OUT) :: HeatCoilLoadmet ! Heating Load Met
INTEGER, INTENT(IN) :: FanMode ! fan operation mode
REAL(r64), INTENT(IN), OPTIONAL :: PartLoadFrac
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: ErrTolerance = 0.001d0 ! convergence limit for hotwater coil
INTEGER, PARAMETER :: SolveMaxIter=50
CHARACTER(len=*), PARAMETER :: CurrentModuleObject = 'AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed'
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: QCoilRequired ! heat addition required from an electric, gas, steam, or hot water coil
REAL(r64) :: QCoilActual ! actual heating load met
REAL(r64) :: mdot ! heating coil steam or hot water mass flow rate
REAL(r64) :: MinWaterFlow ! coil minimum hot water mass flow rate, kg/s
REAL(r64) :: MaxHotWaterFlow ! coil maximum hot water mass flow rate, kg/s
REAL(r64) :: HotWaterMdot ! actual hot water mass flow rate
REAL(r64), DIMENSION(3) :: Par !
INTEGER :: SolFlag
CHARACTER(len=MaxNameLength) :: HeatCoilName =' '
INTEGER :: HeatCoilType
INTEGER :: HeatCoilNum
REAL(r64) :: MaxCoilFluidFlow
REAL(r64) :: SteamCoilHeatingLoad
INTEGER :: CoilControlNode
INTEGER :: CoilOutletNode
INTEGER :: LoopNum
INTEGER :: LoopSide
INTEGER :: BranchNum
INTEGER :: CompNum
QCoilActual=0.0d0
IF (PRESENT(PartLoadFrac)) THEN
HeatCoilType = MSHeatPump(MSHeatPumpNum)%HeatCoilType
HeatCoilName = MSHeatPump(MSHeatPumpNum)%HeatCoilName
HeatCoilNum = MSHeatPump(MSHeatPumpNum)%HeatCoilNum
MaxCoilFluidFlow = MSHeatPump(MSHeatPumpNum)%MaxCoilFluidFlow
CoilControlNode = MSHeatPump(MSHeatPumpNum)%CoilControlNode
CoilOutletNode = MSHeatPump(MSHeatPumpNum)%CoilOutletNode
LoopNum = MSHeatPump(MSHeatPumpNum)%LoopNum
LoopSide = MSHeatPump(MSHeatPumpNum)%LoopSide
BranchNum = MSHeatPump(MSHeatPumpNum)%BranchNum
CompNum = MSHeatPump(MSHeatPumpNum)%CompNum
ELSE
HeatCoilType = MSHeatPump(MSHeatPumpNum)%SuppHeatCoilType
HeatCoilName = MSHeatPump(MSHeatPumpNum)%SuppHeatCoilName
HeatCoilNum = MSHeatPump(MSHeatPumpNum)%SuppHeatCoilNum
MaxCoilFluidFlow = MSHeatPump(MSHeatPumpNum)%MaxSuppCoilFluidFlow
CoilControlNode = MSHeatPump(MSHeatPumpNum)%SuppCoilControlNode
CoilOutletNode = MSHeatPump(MSHeatPumpNum)%SuppCoilOutletNode
LoopNum = MSHeatPump(MSHeatPumpNum)%SuppLoopNum
LoopSide = MSHeatPump(MSHeatPumpNum)%SuppLoopSide
BranchNum = MSHeatPump(MSHeatPumpNum)%SuppBranchNum
CompNum = MSHeatPump(MSHeatPumpNum)%SuppCompNum
ENDIF
MSHeatPump(MSHeatPumpNum)%HotWaterLoopNum = LoopNum
MSHeatPump(MSHeatPumpNum)%HotWaterLoopSide = LoopSide
MSHeatPump(MSHeatPumpNum)%HotWaterBranchNum = BranchNum
MSHeatPump(MSHeatPumpNum)%HotWaterCompNum = CompNum
MSHeatPump(MSHeatPumpNum)%HotWaterCoilControlNode = CoilControlNode
MSHeatPump(MSHeatPumpNum)%HotWaterCoilOutletNode = CoilOutletNode
MSHeatPump(MSHeatPumpNum)%HotWaterCoilName = HeatCoilName
MSHeatPump(MSHeatPumpNum)%HotWaterCoilNum = HeatCoilNum
IF (HeatingLoad > SmallLoad) THEN
Select Case (HeatCoilType)
Case (SuppHeatingCoilGas, SuppHeatingCoilElec)
CALL SimulateHeatingCoilComponents(HeatCoilName,FirstHVACIteration, &
HeatingLoad, HeatCoilNum, &
QCoilActual, .TRUE., FanMode)
Case (Coil_HeatingWater)
If (PRESENT(PartLoadFrac)) THEN
MaxHotWaterFlow = MaxCoilFluidFlow * PartLoadFrac
Call SetComponentFlowRate( MaxHotWaterFlow , &
CoilControlNode, &
CoilOutletNode, &
LoopNum, &
LoopSide, &
BranchNum, &
CompNum)
CALL SimulateWaterCoilComponents(HeatCoilName,FirstHVACIteration, &
HeatCoilNum, QCoilActual, FanMode)
Else
MaxHotWaterFlow = MaxCoilFluidFlow
Call SetComponentFlowRate( MaxHotWaterFlow , &
CoilControlNode, &
CoilOutletNode, &
LoopNum, &
LoopSide, &
BranchNum, &
CompNum)
CALL SimulateWaterCoilComponents(HeatCoilName,FirstHVACIteration, &
HeatCoilNum, QCoilActual, FanMode)
IF (QCoilActual > (HeatingLoad + SmallLoad)) THEN
! control water flow to obtain output matching HeatingLoad
SolFlag = 0
MinWaterFlow = 0.0d0
Par(1) = REAL(MSHeatPumpNum,r64)
IF (FirstHVACIteration) THEN
Par(2) = 1.d0
ELSE
Par(2) = 0.0d0
END IF
Par(3) = HeatingLoad
CALL SolveRegulaFalsi(ErrTolerance, SolveMaxIter, SolFlag, HotWaterMdot, HotWaterCoilResidual, &
MinWaterFlow, MaxHotWaterFlow, Par)
IF (SolFlag == -1) THEN
IF (MSHeatPump(MSHeatPumpNum)%HotWaterCoilMaxIterIndex == 0) THEN
CALL ShowWarningMessage('CalcNonDXHeatingCoils: Hot water coil control failed for '// &
trim(CurrentModuleObject)//'="'// &
TRIM(MSHeatPump(MSHeatPumpNum)%Name)//'"')
CALL ShowContinueErrorTimeStamp(' ')
CALL ShowContinueError(' Iteration limit ['//trim(RoundSigDigits(SolveMaxIter))// &
'] exceeded in calculating hot water mass flow rate')
ENDIF
CALL ShowRecurringWarningErrorAtEnd('CalcNonDXHeatingCoils: Hot water coil control failed (iteration limit ['// &
trim(RoundSigDigits(SolveMaxIter))//']) for '//trim(CurrentModuleObject)//'="'// &
TRIM(MSHeatPump(MSHeatPumpNum)%Name),MSHeatPump(MSHeatPumpNum)%HotWaterCoilMaxIterIndex)
ELSE IF (SolFlag == -2) THEN
IF (MSHeatPump(MSHeatPumpNum)%HotWaterCoilMaxIterIndex2 == 0) THEN
CALL ShowWarningMessage('CalcNonDXHeatingCoils: Hot water coil control failed (maximum flow limits) for '// &
trim(CurrentModuleObject)//'="'// &
TRIM(MSHeatPump(MSHeatPumpNum)%Name)//'"')
CALL ShowContinueErrorTimeStamp(' ')
CALL ShowContinueError('...Bad hot water maximum flow rate limits')
CALL ShowContinueError('...Given minimum water flow rate='//trim(RoundSigDigits(MinWaterFlow,3))//' kg/s')
CALL ShowContinueError('...Given maximum water flow rate='//trim(RoundSigDigits(MaxHotWaterFlow,3))//' kg/s')
ENDIF
CALL ShowRecurringWarningErrorAtEnd('CalcNonDXHeatingCoils: Hot water coil control failed (flow limits) for '// &
trim(CurrentModuleObject)//'="'// &
TRIM(MSHeatPump(MSHeatPumpNum)%Name)//'"', &
MSHeatPump(MSHeatPumpNum)%HotWaterCoilMaxIterIndex2, &
ReportMinOf=MinWaterFlow,ReportMaxOf=MaxHotWaterFlow,ReportMinUnits='[kg/s]',ReportMaxUnits='[kg/s]')
END IF
! simulate hot water supplemental heating coil
CALL SimulateWaterCoilComponents(HeatCoilName,FirstHVACIteration, &
HeatCoilNum, QCoilActual, FanMode)
ENDIF
Endif
Case (Coil_HeatingSteam)
If (PRESENT(PartLoadFrac)) THEN
mdot = MSHeatPump(MSHeatPumpNum)%MaxCoilFluidFlow * PartLoadFrac
SteamCoilHeatingLoad = HeatingLoad * PartLoadFrac
Else
mdot = MSHeatPump(MSHeatPumpNum)%MaxCoilFluidFlow
SteamCoilHeatingLoad = HeatingLoad
Endif
Call SetComponentFlowRate( mdot , &
CoilControlNode, &
CoilOutletNode, &
LoopNum, &
LoopSide, &
BranchNum, &
CompNum)
! simulate steam supplemental heating coil
CALL SimulateSteamCoilComponents(HeatCoilName, &
FirstHVACIteration, SteamCoilHeatingLoad, &
HeatCoilNum, &
QCoilActual, FanMode)
END Select
ELSE ! end of IF (HeatingLoad > SmallLoad) THEN
Select Case (HeatCoilType)
Case (SuppHeatingCoilGas, SuppHeatingCoilElec)
CALL SimulateHeatingCoilComponents(HeatCoilName,FirstHVACIteration, &
HeatingLoad, HeatCoilNum, &
QCoilActual, .TRUE., FanMode)
Case (Coil_HeatingWater)
mdot = 0.0d0
Call SetComponentFlowRate( mdot , &
CoilControlNode, &
CoilOutletNode, &
LoopNum, &
LoopSide, &
BranchNum, &
CompNum)
CALL SimulateWaterCoilComponents(HeatCoilName,FirstHVACIteration, &
HeatCoilNum, QCoilActual, FanMode)
Case (Coil_HeatingSteam)
mdot = 0.0d0
Call SetComponentFlowRate( mdot , &
CoilControlNode, &
CoilOutletNode, &
LoopNum, &
LoopSide, &
BranchNum, &
CompNum)
! simulate the steam supplemental heating coil
CALL SimulateSteamCoilComponents(HeatCoilName, &
FirstHVACIteration, HeatingLoad, &
HeatCoilNum, &
QCoilActual, FanMode)
END Select
ENDIF
HeatCoilLoadmet = QCoilActual
RETURN
END SUBROUTINE CalcNonDXHeatingCoils