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) | :: | HXAssistedCoilNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
integer, | intent(in) | :: | CompOp | |||
real(kind=r64), | intent(in) | :: | PartLoadRatio | |||
logical, | intent(in) | :: | HXUnitOn | |||
integer, | intent(in) | :: | FanOpMode | |||
real(kind=r64), | intent(in), | optional | :: | OnOffAirFlow | ||
logical, | intent(in), | optional | :: | EconomizerFlag |
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 CalcHXAssistedCoolingCoil(HXAssistedCoilNum,FirstHVACIteration,CompOp,PartLoadRatio, &
HXUnitOn, FanOpMode, OnOffAirFlow, EconomizerFlag)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN Sept 2003
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine models the cooling coil/air-to-air heat exchanger
! combination. The cooling coil exiting air temperature is used as
! an indicator of convergence.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE HeatRecovery, ONLY: SimHeatRecovery
USE DXCoils, ONLY: SimDXCoil
USE WaterCoils, ONLY: SimulateWaterCoilComponents
USE Psychrometrics, ONlY: PsyHFnTdbW
USE General, ONLY: TrimSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: HXAssistedCoilNum ! Index number for HXAssistedCoolingCoil
LOGICAL, INTENT(IN) :: FirstHVACIteration ! FirstHVACIteration flag
INTEGER, INTENT(IN) :: CompOp ! compressor operation; 1=on, 0=off
REAL(r64), INTENT(IN) :: PartLoadRatio ! Cooling coil part load ratio
! (used only for Coil:DX:CoolingBypassFactorEmpirical)
LOGICAL, INTENT(IN) :: HXUnitOn ! Flag to enable heat exchanger
INTEGER, INTENT(IN) :: FanOpMode ! Allows parent object to control fan operation
REAL(r64), OPTIONAL, INTENT(IN) :: OnOffAirFlow ! Ratio of compressor ON air mass flow to AVERAGE over time step
LOGICAL, OPTIONAL, INTENT(IN) :: EconomizerFlag ! OA (or airloop) econommizer status
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxIter = 50 ! Maximum number of iterations
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64), SAVE :: CoilOutputTempLast ! Exiting cooling coil temperature from last iteration
REAL(r64) :: AirMassFlow ! Inlet air mass flow rate
REAL(r64) :: Error ! Error (exiting coil temp from last iteration minus current coil exiting temp)
INTEGER :: Iter ! Number of iterations
INTEGER :: CompanionCoilIndexNum ! Index to DX coil
AirMassFlow = HXAssistedCoil(HXAssistedCoilNum)%MassFlowRate
Error = 1.0d0 ! Initialize error (CoilOutputTemp last iteration minus current CoilOutputTemp)
Iter = 0 ! Initialize iteration counter to zero
IF(FirstHVACIteration) CoilOutputTempLast = -99.0d0 ! Initialize coil output temp
! Set mass flow rate at inlet of exhaust side of heat exchanger to supply side air mass flow rate entering this compound object
Node(HXAssistedCoil(HXAssistedCoilNum)%HXExhaustAirInletNodeNum)%MassFlowRate = AirMassFlow
IF(HXAssistedCoil(HXAssistedCoilNum)%CoolingCoilType_Num == CoilDX_CoolingSingleSpeed)THEN
CompanionCoilIndexNum = HXAssistedCoil(HXAssistedCoilNum)%CoolingCoilIndex
ELSE
CompanionCoilIndexNum = 0
END IF
! First call to RegulaFalsi uses PLR=0. Nodes are typically setup at full output on this call.
! A large number of iterations are required to get to result (~36 iterations to get to PLR=0 node conditions).
! Reset node data to minimize iteration. This initialization reduces the number of iterations by 50%.
! CAUTION: Do not use Node(x) = Node(y) here, this can overwrite the coil outlet node setpoint.
IF(PartLoadRatio .EQ. 0.0d0) THEN
Node(HXAssistedCoil(HXAssistedCoilNum)%HXExhaustAirInletNodeNum)%Temp = &
Node(HXAssistedCoil(HXAssistedCoilNum)%HXAssistedCoilInletNodeNum)%Temp
Node(HXAssistedCoil(HXAssistedCoilNum)%HXExhaustAirInletNodeNum)%HumRat = &
Node(HXAssistedCoil(HXAssistedCoilNum)%HXAssistedCoilInletNodeNum)%HumRat
Node(HXAssistedCoil(HXAssistedCoilNum)%HXExhaustAirInletNodeNum)%Enthalpy = &
Node(HXAssistedCoil(HXAssistedCoilNum)%HXAssistedCoilInletNodeNum)%Enthalpy
Node(HXAssistedCoil(HXAssistedCoilNum)%HXExhaustAirInletNodeNum)%MassFlowRate = &
Node(HXAssistedCoil(HXAssistedCoilNum)%HXAssistedCoilInletNodeNum)%MassFlowRate
END IF
! Force at least 2 iterations to pass outlet node information
DO WHILE ((ABS(Error) .GT. 0.0005d0 .AND. Iter .LE. MaxIter) .OR. Iter .LT. 2)
Call SimHeatRecovery(HXAssistedCoil(HXAssistedCoilNum)%HeatExchangerName,FirstHVACIteration, &
HXAssistedCoil(HXAssistedCoilNum)%HeatExchangerIndex, FanOpMode, &
HXPartLoadRatio = PartLoadRatio, HXUnitEnable=HXUnitOn, &
CompanionCoilIndex=CompanionCoilIndexNum,EconomizerFlag=EconomizerFlag)
IF(HXAssistedCoil(HXAssistedCoilNum)%CoolingCoilType_Num == CoilDX_CoolingSingleSpeed) THEN
CALL SimDXCoil(HXAssistedCoil(HXAssistedCoilNum)%CoolingCoilName,CompOp,FirstHVACIteration,PartLoadRatio, &
HXAssistedCoil(HXAssistedCoilNum)%CoolingCoilIndex, FanOpMode, &
OnOffAFR = OnOffAirFlow)
ELSE
CALL SimulateWaterCoilComponents(HXAssistedCoil(HXAssistedCoilNum)%CoolingCoilName,FirstHVACIteration, &
HXAssistedCoil(HXAssistedCoilNum)%CoolingCoilIndex)
END IF
Error = CoilOutputTempLast - Node(HXAssistedCoil(HXAssistedCoilNum)%HXExhaustAirInletNodeNum)%Temp
CoilOutputTempLast = Node(HXAssistedCoil(HXAssistedCoilNum)%HXExhaustAirInletNodeNum)%Temp
Iter = Iter + 1
END DO
! Write excessive iteration warning messages
IF (Iter .GT. MaxIter) THEN
IF(HXAssistedCoil(HXAssistedCoilNum)%MaxIterCounter .LT. 1)THEN
HXAssistedCoil(HXAssistedCoilNum)%MaxIterCounter = HXAssistedCoil(HXAssistedCoilNum)%MaxIterCounter + 1
CALL ShowWarningError(TRIM(HXAssistedCoil(HXAssistedCoilNum)%HXAssistedCoilType)//' "'&
//TRIM(HXAssistedCoil(HXAssistedCoilNum)%Name)//'" -- Exceeded max iterations ('//TRIM(TrimSigDigits(MaxIter,0))// &
') while calculating operating conditions.')
CALL ShowContinueErrorTimeStamp(' ')
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(HXAssistedCoil(HXAssistedCoilNum)%HXAssistedCoilType)//' "'// &
TRIM(HXAssistedCoil(HXAssistedCoilNum)%Name)//&
'" -- Exceeded max iterations error continues...',HXAssistedCoil(HXAssistedCoilNum)%MaxIterIndex)
ENDIF
END IF
HXAssistedCoilOutletTemp(HXAssistedCoilNum) = Node(HXAssistedCoil(HXAssistedCoilNum)%HXAssistedCoilOutletNodeNum)%Temp
HXAssistedCoilOutletHumRat(HXAssistedCoilNum) = Node(HXAssistedCoil(HXAssistedCoilNum)%HXAssistedCoilOutletNodeNum)%HumRat
RETURN
END SUBROUTINE CalcHXAssistedCoolingCoil