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) | :: | UnitarySysNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=R64), | intent(in) | :: | PartLoadRatio | |||
real(kind=r64), | intent(in), | optional | :: | SuppCoilLoad |
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 CalcUnitarySuppHeatingSystem(UnitarySysNum, FirstHVACIteration, PartLoadRatio, SuppCoilLoad)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN February 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine manages supplemental heater simulation.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE HeatingCoils, ONLY: SimulateHeatingCoilComponents
USE WaterCoils, ONLY: SimulateWaterCoilComponents
USE SteamCoils, ONLY: SimulateSteamCoilComponents
USE General, ONLY: SolveRegulaFalsi
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: UnitarySysNum ! Index of AirloopHVAC:UnitarySystem object
LOGICAL, INTENT(IN) :: FirstHVACIteration ! True when first HVAC iteration
REAL(R64), INTENT(IN) :: PartLoadRatio ! coil operating part-load ratio
REAL(r64), OPTIONAL, INTENT(IN) :: SuppCoilLoad ! adjusted supp coil load when outlet temp exceeds max (W)
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxIte = 500 ! Maximum number of iterations for solver
REAL(r64), PARAMETER :: Acc = 1.d-3 ! Accuracy of solver result
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=MaxNameLength) :: CompName ! Name of Unitary System object
REAL(r64) :: SuppHeatCoilLoad ! load passed to supplemental heating coil (W)
REAL(r64) :: QActual ! actual coil output (W)
REAL(r64) :: mdot ! water coil water mass flow rate (kg/s)
REAL(r64), DIMENSION(5) :: Par ! Parameter array passed to solver
INTEGER :: SolFla ! Flag of solver, num iterations if >0, else error index
REAL(r64) :: PartLoadFrac ! temporary PLR variable
! work is needed to figure out how to adjust other coil types if outlet temp exceeds maximum
! this works for gas and electric heating coils
CompName = UnitarySystem(UnitarySysNum)%SuppHeatCoilName
IF(OutDryBulbTemp .LE. UnitarySystem(UnitarySysNum)%MaxOATSuppHeat .OR. &
(MoistureLoad < 0.0d0 .AND. UnitarySystem(UnitarySysNum)%CoolingPartLoadFrac > 0.0d0))THEN
IF(PRESENT(SuppCoilLoad))THEN
SuppHeatCoilLoad = SuppCoilLoad
ELSE
SuppHeatCoilLoad = UnitarySystem(UnitarySysNum)%DesignSuppHeatingCapacity*PartLoadRatio
END IF
ELSE
SuppHeatCoilLoad = 0.0d0
END IF
SELECT CASE(UnitarySystem(UnitarySysNum)%SuppHeatCoilType_Num)
CASE (Coil_HeatingGas,Coil_HeatingElectric)
SELECT CASE(UnitarySystem(UnitarySysNum)%ControlType)
CASE(SetPointBased)
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex=UnitarySystem(UnitarySysNum)%SuppHeatCoilIndex, &
SuppHeat=.TRUE., &
FanOpMode=UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio=PartLoadRatio)
CASE DEFAULT
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex=UnitarySystem(UnitarySysNum)%SuppHeatCoilIndex, &
SuppHeat=.TRUE., &
QCoilReq=SuppHeatCoilLoad, &
FanOpMode=UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio=PartLoadRatio)
END SELECT
CASE (Coil_HeatingDesuperheater)
CALL SimulateHeatingCoilComponents(CompName,FirstHVACIteration, &
CompIndex=UnitarySystem(UnitarySysNum)%SuppHeatCoilIndex, &
SuppHeat=.TRUE., &
QCoilReq=SuppHeatCoilLoad, &
FanOpMode=UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio=PartLoadRatio)
CASE (Coil_HeatingWater)
IF(PRESENT(SuppCoilLoad))THEN
IF(SuppHeatCoilLoad > 0.0d0)THEN
! see if HW coil has enough capacity to meet the load
mdot = MIN(Node(UnitarySystem(UnitarySysNum)%SuppCoilFluidOutletNodeNum)%MassFlowRateMaxAvail, &
UnitarySystem(UnitarySysNum)%MaxSuppCoilFluidFlow)
Node(UnitarySystem(UnitarySysNum)%SuppCoilFluidInletNode)%MassFlowRate = mdot
! simulate water coil to find operating capacity
CALL SimulateWaterCoilComponents(UnitarySystem(UnitarySysNum)%SuppHeatCoilName,FirstHVACIteration, &
UnitarySystem(UnitarySysNum)%SuppHeatCoilIndex, QActual, &
FanOpMode=UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio=PartLoadRatio)
IF(QActual > SuppHeatCoilLoad)THEN
Par(1) = REAL(UnitarySysNum,r64)
IF (FirstHVACIteration) THEN
Par(2) = 1.0d0
ELSE
Par(2) = 0.0d0
END IF
Par(3) = SuppHeatCoilLoad
Par(4) = 1.0d0 ! SuppHeatingCoilFlag
Par(5) = 1.0d0 ! Load based control
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, PartLoadFrac, HotWaterHeatingCoilResidual, 0.0d0, &
1.0d0, Par)
UnitarySystem(UnitarySysNum)%SuppHeatPartLoadFrac = PartLoadFrac
ELSE
UnitarySystem(UnitarySysNum)%SuppHeatPartLoadFrac = 1.0d0
END IF
END IF
ELSE
mdot = MIN(Node(UnitarySystem(UnitarySysNum)%SuppCoilFluidOutletNodeNum)%MassFlowRateMaxAvail, &
UnitarySystem(UnitarySysNum)%MaxSuppCoilFluidFlow * PartLoadRatio)
Node(UnitarySystem(UnitarySysNum)%SuppCoilFluidInletNode)%MassFlowRate = mdot
CALL SimulateWaterCoilComponents(CompName,FirstHVACIteration, &
UnitarySystem(UnitarySysNum)%SuppHeatCoilIndex, &
QActual, UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio)
END IF
CASE (Coil_HeatingSteam)
mdot = MIN(Node(UnitarySystem(UnitarySysNum)%SuppCoilFluidOutletNodeNum)%MassFlowRateMaxAvail, &
UnitarySystem(UnitarySysNum)%MaxSuppCoilFluidFlow * PartLoadRatio)
Node(UnitarySystem(UnitarySysNum)%SuppCoilFluidInletNode)%MassFlowRate = mdot
CALL SimulateSteamCoilComponents(CompName, FirstHVACIteration, &
SuppHeatCoilLoad, &
UnitarySystem(UnitarySysNum)%SuppHeatCoilIndex, &
FanOpMode = UnitarySystem(UnitarySysNum)%FanOpMode, &
PartLoadRatio = PartLoadRatio)
CASE DEFAULT
END SELECT
! UnitarySystem(UnitarySysNum)%SuppHeatPartLoadFrac = PartLoadRatio
RETURN
END SUBROUTINE CalcUnitarySuppHeatingSystem