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) | :: | FurnaceNum | |||
logical, | intent(in) | :: | SuppHeatingCoilFlag | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=r64), | intent(in) | :: | QCoilLoad | |||
integer, | intent(in) | :: | FanMode | |||
real(kind=r64), | intent(out) | :: | HeatCoilLoadmet |
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(FurnaceNum,SuppHeatingCoilFlag,FirstHVACIteration,QCoilLoad,FanMode,HeatCoilLoadmet)
! 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) :: FurnaceNum ! Furnace Index
LOGICAL, INTENT(IN) :: FirstHVACIteration ! flag for first HVAC iteration in the time step
REAL(r64), INTENT(IN) :: QCoilLoad ! load met by unit (watts)
REAL(r64), INTENT(OUT) :: HeatCoilLoadmet ! Heating Load Met
LOGICAL, INTENT(IN) :: SuppHeatingCoilFlag ! .true. if supplemental heating coil
INTEGER, INTENT(IN) :: FanMode ! fan operation mode
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: ErrTolerance = 0.001d0 ! convergence limit for hotwater coil
INTEGER, PARAMETER :: SolveMaxIter=50
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: QCoilReq ! Heat addition required from an electric, gas, steam , or hot water heating coil
REAL(r64) :: QActual ! actual heating load
INTEGER :: FanOpMode ! cycling fan or constant fan
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(4) :: Par
INTEGER :: SolFlag
CHARACTER(len=MaxNameLength) :: HeatingCoilName =' ' ! name of heating coil
CHARACTER(len=MaxNameLength) :: HeatingCoilType =' ' ! type of heating coil
INTEGER :: CoilTypeNum =0 ! heating coil type number
INTEGER :: HeatingCoilIndex =0 ! heating coil index
INTEGER :: CoilControlNode =0 ! control node for hot water and steam heating coils
INTEGER :: CoilOutletNode =0 ! air outlet node of the heatiing coils
INTEGER :: LoopNum =0 ! plant loop number
INTEGER :: LoopSideNum =0 ! plant loop side number
INTEGER :: BranchNum =0 ! plant branch number
INTEGER :: CompNum =0 ! Numeric Equivalent for Supplemental Heat Coil Type
QActual=0.0d0
IF ( SuppHeatingCoilFlag ) Then
HeatingCoilName = Furnace(FurnaceNum)%SuppHeatCoilName
HeatingCoilIndex = Furnace(FurnaceNum)%SuppHeatCoilIndex
CoilControlNode = Furnace(FurnaceNum)%SuppCoilControlNode
CoilOutletNode = Furnace(FurnaceNum)%SuppCoilOutletNode
CoilTypeNum = Furnace(FurnaceNum)%SuppHeatCoilType_Num
LoopNum = Furnace(FurnaceNum)%LoopNumSupp
LoopSideNum = Furnace(FurnaceNum)%LoopSideSupp
BranchNum = Furnace(FurnaceNum)%BranchNumSupp
CompNum = Furnace(FurnaceNum)%CompNumSupp
MaxHotWaterFlow = Furnace(FurnaceNum)%MaxSuppCoilFluidFlow
ELSE
HeatingCoilName = Furnace(FurnaceNum)%HeatingCoilName
HeatingCoilIndex = Furnace(FurnaceNum)%HeatingCoilIndex
CoilControlNode = Furnace(FurnaceNum)%CoilControlNode
CoilOutletNode = Furnace(FurnaceNum)%CoilOutletNode
CoilTypeNum = Furnace(FurnaceNum)%HeatingCoilType_Num
LoopNum = Furnace(FurnaceNum)%LoopNum
LoopSideNum = Furnace(FurnaceNum)%LoopSide
BranchNum = Furnace(FurnaceNum)%BranchNum
CompNum = Furnace(FurnaceNum)%CompNum
MaxHotWaterFlow = Furnace(FurnaceNum)%MaxHeatCoilFluidFlow
END IF
Select Case (CoilTypeNum)
Case (Coil_HeatingGas,Coil_HeatingElectric,Coil_HeatingDesuperheater )
CALL SimulateHeatingCoilComponents(HeatingCoilName,FirstHVACIteration, &
QCoilReq=QCoilLoad, CompIndex=HeatingCoilIndex, &
SuppHeat=SuppHeatingCoilFlag,FanOpMode=FanMode)
Case (Coil_HeatingWater)
IF ( QCoilLoad > SmallLoad) Then
Call SetComponentFlowRate( MaxHotWaterFlow, CoilControlNode,CoilOutletNode,LoopNum, &
LoopSideNum, BranchNum, CompNum)
CALL SimulateWaterCoilComponents(HeatingCoilName,FirstHVACIteration,HeatingCoilIndex, QActual,FanMode)
IF ( QActual > (QCoilLoad + SmallLoad)) THEN
! control water flow to obtain output matching QCoilLoad
MinWaterFlow = 0.0d0
Par(1) = REAL(FurnaceNum,r64)
IF (FirstHVACIteration) THEN
Par(2) = 1.d0
ELSE
Par(2) = 0.0d0
END IF
Par(3) = QCoilLoad
IF (SuppHeatingCoilFlag) THEN
Par(4) = 1.d0
ELSE
Par(4) = 0.0d0
END IF
CALL SolveRegulaFalsi(ErrTolerance, SolveMaxIter, SolFlag, HotWaterMdot, HotWaterCoilResidual, &
MinWaterFlow, MaxHotWaterFlow, Par)
IF (SolFlag == -1) THEN
IF (Furnace(FurnaceNum)%HotWaterCoilMaxIterIndex == 0) THEN
CALL ShowWarningMessage('CalcNonDXHeatingCoils: Hot water coil control failed for '// &
trim(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//'="'// &
TRIM(Furnace(FurnaceNum)%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(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//'="'// &
TRIM(Furnace(FurnaceNum)%Name),Furnace(FurnaceNum)%HotWaterCoilMaxIterIndex)
ELSE IF (SolFlag == -2) THEN
IF (Furnace(FurnaceNum)%HotWaterCoilMaxIterIndex2 == 0) THEN
CALL ShowWarningMessage('CalcNonDXHeatingCoils: Hot water coil control failed (maximum flow limits) for '// &
trim(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//'="'// &
TRIM(Furnace(FurnaceNum)%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(cFurnaceTypes(Furnace(FurnaceNum)%FurnaceType_Num))//'="'// &
TRIM(Furnace(FurnaceNum)%Name)//'"', &
Furnace(FurnaceNum)%HotWaterCoilMaxIterIndex2, &
ReportMinOf=MinWaterFlow,ReportMaxOf=MaxHotWaterFlow,ReportMinUnits='[kg/s]',ReportMaxUnits='[kg/s]')
END IF
ENDIF
ELSE
mdot = 0.0d0
Call SetComponentFlowRate( mdot, CoilControlNode,CoilOutletNode,LoopNum, &
LoopSideNum, BranchNum, CompNum)
ENDIF
! simulate the hot water heating coil
CALL SimulateWaterCoilComponents(HeatingCoilName,FirstHVACIteration,HeatingCoilIndex, QActual,FanMode)
Case (Coil_HeatingSteam)
IF ( QCoilLoad > SmallLoad) Then
Call SetComponentFlowRate( MaxHotWaterFlow, CoilControlNode,CoilOutletNode,LoopNum, &
LoopSideNum, BranchNum, CompNum)
! simulate the steam heating coil
CALL SimulateSteamCoilComponents(HeatingCoilName, FirstHVACIteration, QCoilLoad, HeatingCoilIndex, &
QActual, FanMode)
ELSE
mdot = 0.0d0
Call SetComponentFlowRate( mdot, CoilControlNode,CoilOutletNode,LoopNum, &
LoopSideNum, BranchNum, CompNum)
! simulate the steam heating coil
CALL SimulateSteamCoilComponents(HeatingCoilName, FirstHVACIteration, QCoilLoad, HeatingCoilIndex, &
QActual, FanMode)
ENDIF
END Select
HeatCoilLoadmet = QActual
RETURN
END SUBROUTINE CalcNonDXHeatingCoils