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) | :: | DesicDehumNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=r64), | intent(in) | :: | RegenCoilLoad | |||
real(kind=r64), | intent(out), | optional | :: | RegenCoilLoadmet |
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(DesicDehumNum,FirstHVACIteration,RegenCoilLoad,RegenCoilLoadmet)
! 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) :: DesicDehumNum ! Desiccant dehumidifier unit index
LOGICAL, INTENT(IN) :: FirstHVACIteration ! flag for first HVAC iteration in the time step
REAL(r64), INTENT(IN) :: RegenCoilLoad ! heating coil load to be met (Watts)
REAL(r64), INTENT(OUT), OPTIONAL :: RegenCoilLoadmet ! heating load met
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: ErrTolerance = 0.001d0 ! convergence limit for hotwater coil
INTEGER, PARAMETER :: SolveMaxIter=50 ! Max iteration for SolveRegulaFalsi
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: RegenCoilActual ! actual heating load met
REAL(r64) :: mdot ! heating coil steam or hot water mass flow rate
REAL(r64) :: MinWaterFlow ! minimum hot water mass flow rate
!unused REAL(r64) :: PartLoadFraction ! heating or cooling part load fraction
REAL(r64) :: MaxHotWaterFlow ! maximum hot water mass flow rate, kg/s
REAL(r64) :: HotWaterMdot ! actual hot water mass flow rate
REAL(r64), DIMENSION(3) :: Par
INTEGER :: SolFlag
RegenCoilActual=0.0d0
IF (RegenCoilLoad > SmallLoad) THEN
Select Case (DesicDehum(DesicDehumNum)%RegenCoilType_Num)
Case (Coil_HeatingGas, Coil_HeatingElectric)
CALL SimulateHeatingCoilComponents(DesicDehum(DesicDehumNum)%RegenCoilName,FirstHVACIteration, &
RegenCoilLoad, DesicDehum(DesicDehumNum)%RegenCoilIndex, &
RegenCoilActual)
Case (Coil_HeatingWater)
MaxHotWaterFlow = DesicDehum(DesicDehumNum)%MaxCoilFluidFlow
Call SetComponentFlowRate(MaxHotWaterFlow, &
DesicDehum(DesicDehumNum)%CoilControlNode, &
DesicDehum(DesicDehumNum)%CoilOutletNode, &
DesicDehum(DesicDehumNum)%LoopNum, &
DesicDehum(DesicDehumNum)%LoopSide, &
DesicDehum(DesicDehumNum)%BranchNum, &
DesicDehum(DesicDehumNum)%CompNum)
RegenCoilActual = RegenCoilLoad
! simulate the regenerator hot water heating coil
CALL SimulateWaterCoilComponents(DesicDehum(DesicDehumNum)%RegenCoilName,FirstHVACIteration, &
DesicDehum(DesicDehumNum)%RegenCoilIndex, RegenCoilActual)
IF ( RegenCoilActual > (RegenCoilLoad + SmallLoad) ) THEN
! control water flow to obtain output matching RegenCoilLoad
SolFlag = 0
MinWaterFlow = 0.0d0
Par(1) = REAL(DesicDehumNum,r64)
IF (FirstHVACIteration) THEN
Par(2) = 1.0d0
ELSE
Par(2) = 0.0d0
END IF
Par(3) = RegenCoilLoad
CALL SolveRegulaFalsi(ErrTolerance, SolveMaxIter, SolFlag, HotWaterMdot, HotWaterCoilResidual, &
MinWaterFlow, MaxHotWaterFlow, Par)
IF (SolFlag == -1) THEN
IF (DesicDehum(DesicDehumNum)%HotWaterCoilMaxIterIndex == 0) THEN
CALL ShowWarningMessage('CalcNonDXHeatingCoils: Hot water coil control failed for '// &
trim(DesicDehum(DesicDehumNum)%DehumType)//'="'// &
TRIM(DesicDehum(DesicDehumNum)%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(DesicDehum(DesicDehumNum)%DehumType)//'="' &
//TRIM(DesicDehum(DesicDehumNum)%Name)//'"',DesicDehum(DesicDehumNum)%HotWaterCoilMaxIterIndex)
ELSE IF (SolFlag == -2) THEN
IF (DesicDehum(DesicDehumNum)%HotWaterCoilMaxIterIndex2 == 0) THEN
CALL ShowWarningMessage('CalcNonDXHeatingCoils: Hot water coil control failed (maximum flow limits) for '// &
trim(DesicDehum(DesicDehumNum)%DehumType)//'="'// &
TRIM(DesicDehum(DesicDehumNum)%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(DesicDehum(DesicDehumNum)%DehumType)//'="'// &
TRIM(DesicDehum(DesicDehumNum)%Name)//'"', &
DesicDehum(DesicDehumNum)%HotWaterCoilMaxIterIndex2, &
ReportMinOf=MinWaterFlow,ReportMaxOf=MaxHotWaterFlow,ReportMinUnits='[kg/s]',ReportMaxUnits='[kg/s]')
END IF
RegenCoilActual = RegenCoilLoad
! simulate the regenerator hot water heating coil
CALL SimulateWaterCoilComponents(DesicDehum(DesicDehumNum)%RegenCoilName,FirstHVACIteration, &
DesicDehum(DesicDehumNum)%RegenCoilIndex, RegenCoilActual)
ENDIF
Case (Coil_HeatingSteam)
mdot = DesicDehum(DesicDehumNum)%MaxCoilFluidFlow
Call SetComponentFlowRate(mdot, &
DesicDehum(DesicDehumNum)%CoilControlNode, &
DesicDehum(DesicDehumNum)%CoilOutletNode, &
DesicDehum(DesicDehumNum)%LoopNum, &
DesicDehum(DesicDehumNum)%LoopSide, &
DesicDehum(DesicDehumNum)%BranchNum, &
DesicDehum(DesicDehumNum)%CompNum)
! simulate the regenerator steam heating coil
CALL SimulateSteamCoilComponents(DesicDehum(DesicDehumNum)%RegenCoilName, FirstHVACIteration, &
RegenCoilLoad, DesicDehum(DesicDehumNum)%RegenCoilIndex, &
RegenCoilActual)
END Select
ELSE
Select Case (DesicDehum(DesicDehumNum)%RegenCoilType_Num)
Case (Coil_HeatingGas, Coil_HeatingElectric)
CALL SimulateHeatingCoilComponents(DesicDehum(DesicDehumNum)%RegenCoilName,FirstHVACIteration, &
RegenCoilLoad, DesicDehum(DesicDehumNum)%RegenCoilIndex, &
RegenCoilActual)
Case (Coil_HeatingWater)
mdot = 0.0d0
Call SetComponentFlowRate(mdot, &
DesicDehum(DesicDehumNum)%CoilControlNode, &
DesicDehum(DesicDehumNum)%CoilOutletNode, &
DesicDehum(DesicDehumNum)%LoopNum, &
DesicDehum(DesicDehumNum)%LoopSide, &
DesicDehum(DesicDehumNum)%BranchNum, &
DesicDehum(DesicDehumNum)%CompNum)
RegenCoilActual = RegenCoilLoad
! simulate the regenerator hot water heating coil
CALL SimulateWaterCoilComponents(DesicDehum(DesicDehumNum)%RegenCoilName,FirstHVACIteration, &
DesicDehum(DesicDehumNum)%RegenCoilIndex, RegenCoilActual)
Case (Coil_HeatingSteam)
mdot = 0.0d0
Call SetComponentFlowRate(mdot, &
DesicDehum(DesicDehumNum)%CoilControlNode, &
DesicDehum(DesicDehumNum)%CoilOutletNode, &
DesicDehum(DesicDehumNum)%LoopNum, &
DesicDehum(DesicDehumNum)%LoopSide, &
DesicDehum(DesicDehumNum)%BranchNum, &
DesicDehum(DesicDehumNum)%CompNum)
! simulate the regenerator steam heating coil
CALL SimulateSteamCoilComponents(DesicDehum(DesicDehumNum)%RegenCoilName, FirstHVACIteration, &
RegenCoilLoad, DesicDehum(DesicDehumNum)%RegenCoilIndex, &
RegenCoilActual)
END Select
ENDIF
IF (PRESENT(RegenCoilLoadmet)) RegenCoilLoadmet = RegenCoilActual
RETURN
END SUBROUTINE CalcNonDXHeatingCoils