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) | :: | DXCoilNum | |||
real(kind=r64), | intent(in) | :: | MaxONOFFCyclesperHour | |||
real(kind=r64), | intent(in) | :: | HPTimeConstant | |||
real(kind=r64), | intent(in) | :: | FanDelayTime | |||
real(kind=r64), | intent(in) | :: | SensLoad | |||
real(kind=r64), | intent(in) | :: | LatentLoad | |||
integer, | intent(in) | :: | CyclingScheme | |||
real(kind=r64), | intent(in) | :: | OnOffAirFlowRatio | |||
real(kind=r64), | intent(in) | :: | SpeedRatio | |||
integer, | intent(in) | :: | SpeedNum |
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 InitVarSpeedCoil(DXCoilNum,MaxONOFFCyclesperHour,HPTimeConstant,FanDelayTime,SensLoad,LatentLoad,CyclingScheme, &
OnOffAirFlowRatio, SpeedRatio, SpeedNum)
! SUBROUTINE INFORMATION:
! AUTHOR Bo Shen, based on MODULE WatertoAirHeatPumpSimple:InitSimpleWatertoAirHP
! DATE WRITTEN March, 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initializations of the variable speed Water to Air HP Components.
! METHODOLOGY EMPLOYED:
! Uses the status flags to trigger initializations.
! REFERENCES: na
! USE STATEMENTS:
USE Psychrometrics, ONLY: PsyRhoAirFnPbTdbW
USE DataGlobals, ONLY: SysSizingCalc
USE FluidProperties, ONLY : GetDensityGlycol, GetSpecificHeatGlycol
USE DataPlant, ONLY : ScanPlantLoopsForObject, PlantLoop
USE PlantUtilities, ONLY : InitComponentNodes, SetComponentFlowRate
USE General, ONLY: TrimSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: DXCoilNum ! Current DXCoilNum under simulation
REAL(r64), INTENT(IN) :: MaxONOFFCyclesperHour ! Maximum cycling rate of heat pump [cycles/hr]
REAL(r64), INTENT(IN) :: HPTimeConstant ! Heat pump time constant [s]
REAL(r64), INTENT(IN) :: FanDelayTime ! Fan delay time, time delay for the HP's fan to
! shut off after compressor cycle off [s]
REAL(r64), INTENT(IN) :: SensLoad ! Control zone sensible load[W]
REAL(r64), INTENT(IN) :: LatentLoad ! Control zone latent load[W]
INTEGER, INTENT(IN) :: CyclingScheme ! fan operating mode
REAL(r64), INTENT(IN) :: OnOffAirFlowRatio ! ratio of compressor on flow to average flow over time step
REAL(r64), INTENT(IN) :: SpeedRatio ! compressor speed ratio
INTEGER, INTENT(IN) :: SpeedNum ! compressor speed number
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: AirInletNode ! Node Number of the air inlet
INTEGER :: WaterInletNode ! Node Number of the Water inlet
LOGICAL, SAVE :: MyOneTimeFlag = .TRUE. ! one time allocation flag
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyEnvrnFlag ! used for initializations each begin environment flag
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MySizeFlag ! used for sizing PTHP inputs one time
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyPlantScanFlag
REAL(r64) :: rho ! local fluid density
REAL(r64) :: Cp ! local fluid specific heat
INTEGER :: SpeedCal ! calculated speed level
LOGICAL :: errFlag
LOGICAL :: ErrorsFound=.FALSE. ! TRUE when errors found, air loop initialization error
REAL(r64) :: RatedVolFlowPerRatedTotCap ! Rated Air Volume Flow Rate divided by Rated Total Capacity [m3/s-W)
INTEGER :: Mode ! Performance mode for MultiMode DX coil; Always 1 for other coil types
REAL(r64) :: RatedHeatPumpIndoorAirTemp
! Indoor dry-bulb temperature to heat pump evaporator at rated conditions [C]
REAL(r64) :: RatedHeatPumpIndoorHumRat ! Inlet humidity ratio to heat pump evaporator at rated conditions [kg/kg]
REAL(r64) :: WaterFlowScale ! water flow scaling factor match rated flow rate
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64) :: SmallDifferenceTest=0.00000001d0
CHARACTER(len=*), PARAMETER :: RoutineName='InitVarSpeedCoil'
IF (MyOneTimeFlag) THEN
! initialize the environment and sizing flags
ALLOCATE(MySizeFlag(NumWatertoAirHPs))
ALLOCATE(MyEnvrnFlag(NumWatertoAirHPs))
ALLOCATE(MyPlantScanFlag(NumWatertoAirHPs))
MySizeFlag = .TRUE.
MyEnvrnFlag = .TRUE.
MyPlantScanFlag = .TRUE.
MyOneTimeFlag = .FALSE.
END IF
! water source
IF( (VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==TypeOf_CoilVSWAHPCoolingEquationFit).OR. &
(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==TypeOf_CoilVSWAHPHeatingEquationFit)) THEN
IF (MyPlantScanFlag(DXCoilNum) .AND. ALLOCATED(PlantLoop)) THEN
errFlag=.false.
CALL ScanPlantLoopsForObject(VarSpeedCoil(DXCoilNum)%Name, &
VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum, &
VarSpeedCoil(DXCoilNum)%LoopNum, &
VarSpeedCoil(DXCoilNum)%LoopSide, &
VarSpeedCoil(DXCoilNum)%BranchNum, &
VarSpeedCoil(DXCoilNum)%CompNum, &
errFlag=errFlag)
IF (errFlag) THEN
CALL ShowFatalError('InitVarSpeedCoil: Program terminated for previous conditions.')
ENDIF
MyPlantScanFlag(DXCoilNum) = .FALSE.
ENDIF
ELSE
MyPlantScanFlag(DXCoilNum) = .FALSE.
END IF
IF ( .NOT. SysSizingCalc .AND. MySizeFlag(DXCoilNum) .AND. .NOT. MyPlantScanFlag(DXCoilNum) ) THEN
! for each furnace, do the sizing once.
CALL SizeVarSpeedCoil(DXCoilNum)
MySizeFlag(DXCoilNum) = .FALSE.
! Multispeed Cooling
IF ((VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==TypeOf_CoilVSWAHPCoolingEquationFit ) .OR. &
(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==Coil_CoolingAirToAirVariableSpeed))THEN
Do Mode = 1, VarSpeedCoil(DXCoilNum)%NumOfSpeeds
! Check for zero capacity or zero max flow rate
IF (VarSpeedCoil(DXCoilNum)%MSRatedTotCap(Mode) <= 0.0d0) THEN
CALL ShowSevereError('Sizing: '//TRIM(VarSpeedCoil(DXCoilNum)%VarSpeedCoilType)//' '// &
TRIM(VarSpeedCoil(DXCoilNum)%Name)// &
' has zero rated total capacity at speed '//Trim(TrimSigDigits(Mode)))
ErrorsFound=.TRUE.
END IF
IF (VarSpeedCoil(DXCoilNum)%MSRatedAirVolFlowRate(Mode) <= 0.0d0) THEN
CALL ShowSevereError('Sizing: '//TRIM(VarSpeedCoil(DXCoilNum)%VarSpeedCoilType)//' '// &
TRIM(VarSpeedCoil(DXCoilNum)%Name)// &
' has zero rated air flow rate at speed '//Trim(TrimSigDigits(Mode)))
ErrorsFound=.TRUE.
END IF
IF (ErrorsFound) THEN
CALL ShowFatalError('Preceding condition causes termination.')
ENDIF
!
! Check for valid range of (Rated Air Volume Flow Rate / Rated Total Capacity)
!
RatedVolFlowPerRatedTotCap = VarSpeedCoil(DXCoilNum)%MSRatedAirVolFlowRate(Mode)/ &
VarSpeedCoil(DXCoilNum)%MSRatedTotCap(Mode)
!note: variable-speed HP can exceed the flow rate restrictions at low speed levels
! IF (((MinRatedAirVolFlowPerRatedTotCap - RatedVolFlowPerRatedTotCap) > SmallDifferenceTest).OR. &
! ((RatedVolFlowPerRatedTotCap - MaxRatedAirVolFlowPerRatedTotCap) > SmallDifferenceTest)) THEN
! CALL ShowSevereError ('Sizing: '//TRIM(VarSpeedCoil(DXCoilNum)%VarSpeedCoilType) &
! // ' "'//TRIM(VarSpeedCoil(DXCoilNum)%Name)// &
! '": Rated air volume flow rate per watt of rated total '// &
! 'cooling capacity is out of range at speed '//TRIM(TrimSigDigits(Mode)))
! CALL ShowContinueError &
! ('Min Rated Vol Flow Per Watt=['//TRIM(TrimSigDigits(MinRatedAirVolFlowPerRatedTotCap,3))//'], '// &
! 'Rated Vol Flow Per Watt=['//TRIM(TrimSigDigits(RatedVolFlowPerRatedTotCap,3))//'], &
! Max Rated Vol Flow Per Watt=['// &
! TRIM(TrimSigDigits(MaxRatedAirVolFlowPerRatedTotCap,3))//']. See Input-Output Reference Manual for valid range.')
! END IF
! VarSpeedCoil(DXCoilNum)%MSRatedAirMassFlowRate(Mode) = VarSpeedCoil(DXCoilNum)%MSRatedAirVolFlowRate(Mode)* &
! PsyRhoAirFnPbTdbW(OutBaroPress,RatedInletAirTemp,RatedInletAirHumRat,RoutineName)
! ! get high speed rated coil bypass factor
! VarSpeedCoil(DXCoilNum)%MSRatedCBF(Mode) = CalcCBF(VarSpeedCoil(DXCoilNum)%VarSpeedCoilType, &
! VarSpeedCoil(DXCoilNum)%Name,&
! RatedInletAirTemp,RatedInletAirHumRat,VarSpeedCoil(DXCoilNum)%MSRatedTotCap(Mode),&
! VarSpeedCoil(DXCoilNum)%MSRatedAirMassFlowRate(Mode), &
! VarSpeedCoil(DXCoilNum)%MSRatedSHR(Mode))
END DO
END IF
! Multispeed Heating
IF ((VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==TypeOf_CoilVSWAHPHeatingEquationFit) .OR. &
(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==Coil_HeatingAirToAirVariableSpeed))THEN
RatedHeatPumpIndoorAirTemp = 21.11d0 ! 21.11C or 70F
RatedHeatPumpIndoorHumRat = 0.00881d0 ! Humidity ratio corresponding to 70F dry bulb/60F wet bulb
Do Mode = 1, VarSpeedCoil(DXCoilNum)%NumOfSpeeds
VarSpeedCoil(DXCoilNum)%MSRatedAirMassFlowRate(Mode) = VarSpeedCoil(DXCoilNum)%MSRatedAirVolFlowRate(Mode)* &
PsyRhoAirFnPbTdbW(OutBaroPress,RatedHeatPumpIndoorAirTemp,RatedHeatPumpIndoorHumRat,RoutineName)
! Check for valid range of (Rated Air Volume Flow Rate / Rated Total Capacity)
!
RatedVolFlowPerRatedTotCap = VarSpeedCoil(DXCoilNum)%MSRatedAirVolFlowRate(Mode)/ &
VarSpeedCoil(DXCoilNum)%MSRatedTotCap(Mode)
!note: variable-speed HP can exceed the flow rate restrictions at low speed levels
! IF (((MinRatedAirVolFlowPerRatedTotCap - RatedVolFlowPerRatedTotCap) > SmallDifferenceTest).OR. &
! ((RatedVolFlowperRatedTotCap - MaxRatedAirVolFlowPerRatedTotCap) > SmallDifferenceTest)) THEN
! CALL ShowSevereError ('Coil:Heating:DX:MultiSpeed '//TRIM(VarSpeedCoil(DXCoilNum)%Name)// &
! ': Rated air volume flow rate per watt of rated total '// &
! 'heating capacity is out of range at speed '//TRIM(TrimSigDigits(Mode)))
! CALL ShowContinueError('Min Rated Vol Flow Per Watt=['//TRIM(TrimSigDigits &
! (MinRatedAirVolFlowPerRatedTotCap,3))//'], '// &
! 'Rated Vol Flow Per Watt=['//TRIM(TrimSigDigits(RatedVolFlowPerRatedTotCap,3))//'], &
! Max Rated Vol Flow Per Watt=['// &
! TRIM(TrimSigDigits(MaxRatedAirVolFlowPerRatedTotCap,3))//']. See Input-Output Reference &
! Manual for valid range.')
! END IF
End Do
END IF
END IF
IF(SpeedNum > VarSpeedCoil(DXCoilNum)%NumOfSpeeds) THEN
SpeedCal = VarSpeedCoil(DXCoilNum)%NumOfSpeeds
ELSE IF(SpeedNum < 1) THEN
SpeedCal = 1
ELSE
SpeedCal = SpeedNum
END IF
IF((SpeedNum <= 1) .OR.(SpeedNum > VarSpeedCoil(DXCoilNum)%NumOfSpeeds) ) THEN
VarSpeedCoil(DXCoilNum)%DesignAirMassFlowRate = VarSpeedCoil(DXCoilNum)%MSRatedAirMassFlowRate(SpeedCal)
VarSpeedCoil(DXCoilNum)%DesignAirVolFlowRate = VarSpeedCoil(DXCoilNum)%MSRatedAirVolFlowRate(SpeedCal)
VarSpeedCoil(DXCoilNum)%DesignWaterMassFlowRate = VarSpeedCoil(DXCoilNum)%MSRatedWaterMassFlowRate(SpeedCal)
VarSpeedCoil(DXCoilNum)%DesignWaterVolFlowRate = VarSpeedCoil(DXCoilNum)%MSRatedWaterVolFlowRate(SpeedCal)
ELSE
VarSpeedCoil(DXCoilNum)%DesignAirMassFlowRate = VarSpeedCoil(DXCoilNum)%MSRatedAirMassFlowRate(SpeedCal)*SpeedRatio &
+ (1.0d0 - SpeedRatio ) * VarSpeedCoil(DXCoilNum)%MSRatedAirMassFlowRate(SpeedCal - 1)
VarSpeedCoil(DXCoilNum)%DesignAirVolFlowRate = VarSpeedCoil(DXCoilNum)%MSRatedAirVolFlowRate(SpeedCal)*SpeedRatio &
+ (1.0d0 - SpeedRatio ) * VarSpeedCoil(DXCoilNum)%MSRatedAirVolFlowRate(SpeedCal - 1)
VarSpeedCoil(DXCoilNum)%DesignWaterMassFlowRate = VarSpeedCoil(DXCoilNum)%MSRatedWaterMassFlowRate(SpeedCal)*SpeedRatio &
+ (1.0d0 - SpeedRatio ) * VarSpeedCoil(DXCoilNum)%MSRatedWaterMassFlowRate(SpeedCal - 1)
VarSpeedCoil(DXCoilNum)%DesignWaterVolFlowRate = VarSpeedCoil(DXCoilNum)%MSRatedWaterVolFlowRate(SpeedCal)*SpeedRatio &
+ (1.0d0 - SpeedRatio ) * VarSpeedCoil(DXCoilNum)%MSRatedWaterVolFlowRate(SpeedCal - 1)
END IF
! Do the Begin Environment initializations
IF (BeginEnvrnFlag .and. MyEnvrnFlag(DXCoilNum) .AND. .NOT. MyPlantScanFlag(DXCoilNum)) THEN
! Do the initializations to start simulation
AirInletNode = VarSpeedCoil(DXCoilNum)%AirInletNodeNum
!Initialize all report variables to a known state at beginning of simulation
VarSpeedCoil(DXCoilNum)%AirVolFlowRate=0.0d0
VarSpeedCoil(DXCoilNum)%InletAirDBTemp=0.0d0
VarSpeedCoil(DXCoilNum)%InletAirHumRat=0.0d0
VarSpeedCoil(DXCoilNum)%OutletAirDBTemp=0.0d0
VarSpeedCoil(DXCoilNum)%OutletAirHumRat=0.0d0
VarSpeedCoil(DXCoilNum)%WaterVolFlowRate=0.0d0
VarSpeedCoil(DXCoilNum)%WaterMassFlowRate=0.0d0
VarSpeedCoil(DXCoilNum)%InletWaterTemp=0.0d0
VarSpeedCoil(DXCoilNum)%InletWaterEnthalpy = 0.0d0
VarSpeedCoil(DXCoilNum)%OutletWaterEnthalpy = 0.0d0
VarSpeedCoil(DXCoilNum)%OutletWaterTemp=0.0d0
VarSpeedCoil(DXCoilNum)%Power=0.0d0
VarSpeedCoil(DXCoilNum)%QLoadTotal=0.0d0
VarSpeedCoil(DXCoilNum)%QSensible=0.0d0
VarSpeedCoil(DXCoilNum)%QLatent=0.0d0
VarSpeedCoil(DXCoilNum)%QSource=0.0d0
VarSpeedCoil(DXCoilNum)%Energy=0.0d0
VarSpeedCoil(DXCoilNum)%EnergyLoadTotal=0.0d0
VarSpeedCoil(DXCoilNum)%EnergySensible=0.0d0
VarSpeedCoil(DXCoilNum)%EnergyLatent=0.0d0
VarSpeedCoil(DXCoilNum)%EnergySource=0.0d0
VarSpeedCoil(DXCoilNum)%COP=0.0d0
VarSpeedCoil(DXCoilNum)%RunFrac=0.0d0
VarSpeedCoil(DXCoilNum)%PartLoadRatio=0.0d0
VarSpeedCoil(DXCoilNum)%MaxONOFFCyclesperHour=MaxONOFFCyclesperHour
VarSpeedCoil(DXCoilNum)%HPTimeConstant=HPTimeConstant
VarSpeedCoil(DXCoilNum)%FanDelayTime=FanDelayTime
IF ((VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==TypeOf_CoilVSWAHPHeatingEquationFit) .OR. &
(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==TypeOf_CoilVSWAHPCoolingEquationFit))THEN
WaterInletNode = VarSpeedCoil(DXCoilNum)%WaterInletNodeNum
rho = GetDensityGlycol(PlantLoop(VarSpeedCoil(DXCoilNum)%LoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(VarSpeedCoil(DXCoilNum)%LoopNum)%FluidIndex, &
'InitSimpleWatertoAirHP')
Cp = GetSpecificHeatGlycol(PlantLoop(VarSpeedCoil(DXCoilNum)%LoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(VarSpeedCoil(DXCoilNum)%LoopNum)%FluidIndex, &
'InitSimpleWatertoAirHP')
! VarSpeedCoil(DXCoilNum)%DesignWaterMassFlowRate= &
! rho * VarSpeedCoil(DXCoilNum)%RatedWaterVolFlowRate
CALL InitComponentNodes(0.d0, VarSpeedCoil(DXCoilNum)%DesignWaterMassFlowRate, &
VarSpeedCoil(DXCoilNum)%WaterInletNodeNum, &
VarSpeedCoil(DXCoilNum)%WaterOutletNodeNum , &
VarSpeedCoil(DXCoilNum)%LoopNum, &
VarSpeedCoil(DXCoilNum)%LoopSide, &
VarSpeedCoil(DXCoilNum)%BranchNum, &
VarSpeedCoil(DXCoilNum)%CompNum )
Node(WaterInletNode)%Temp = 5.0d0
Node(WaterInletNode)%Enthalpy = Cp* Node(WaterInletNode)%Temp
Node(WaterInletNode)%Quality = 0.0d0
Node(WaterInletNode)%Press = 0.0d0
Node(WaterInletNode)%HumRat = 0.0d0
Node(VarSpeedCoil(DXCoilNum)%WaterOutletNodeNum)%Temp = 5.0d0
Node(VarSpeedCoil(DXCoilNum)%WaterOutletNodeNum)%Enthalpy = Cp* Node(WaterInletNode)%Temp
Node(VarSpeedCoil(DXCoilNum)%WaterOutletNodeNum)%Quality = 0.0d0
Node(VarSpeedCoil(DXCoilNum)%WaterOutletNodeNum)%Press = 0.0d0
Node(VarSpeedCoil(DXCoilNum)%WaterOutletNodeNum)%HumRat = 0.0d0
END IF
VarSpeedCoil(DXCoilNum)%SimFlag = .TRUE.
MyEnvrnFlag(DXCoilNum) = .FALSE.
END IF ! End If for the Begin Environment initializations
IF (.not. BeginEnvrnFlag) THEN
MyEnvrnFlag(DXCoilNum)=.TRUE.
ENDIF
! Do the following initializations (every time step): This should be the info from
! the previous components outlets or the node data in this section.
! First set the conditions for the air into the heat pump model
! Set water and air inlet nodes
AirInletNode = VarSpeedCoil(DXCoilNum)%AirInletNodeNum
WaterInletNode = VarSpeedCoil(DXCoilNum)%WaterInletNodeNum
IF ((SensLoad .NE. 0.0d0 .OR. LatentLoad .NE. 0.0d0).AND.(Node(AirInletNode)%MassFlowRate > 0.0d0)) THEN
IF(VarSpeedCoil(DXCoilNum)%MSRatedWaterMassFlowRate(VarSpeedCoil(DXCoilNum)%NormSpedLevel) > 0.0d0) THEN
WaterFlowScale = VarSpeedCoil(DXCoilNum)%RatedWaterMassFlowRate/ &
VarSpeedCoil(DXCoilNum)%MSRatedWaterMassFlowRate(VarSpeedCoil(DXCoilNum)%NormSpedLevel)
VarSpeedCoil(DXCoilNum)%WaterMassFlowRate = VarSpeedCoil(DXCoilNum)%DesignWaterMassFlowRate*WaterFlowScale
ELSE
VarSpeedCoil(DXCoilNum)%WaterMassFlowRate = 0.0d0
END IF
IF (CyclingScheme .EQ. ContFanCycCoil) THEN
! continuous fan, cycling compressor
VarSpeedCoil(DXCoilNum)%AirMassFlowRate = Node(AirInletNode)%MassFlowRate
! VarSpeedCoil(DXCoilNum)%AirMassFlowRate = VarSpeedCoil(DXCoilNum)%DesignAirVolFlowRate* &
! PsyRhoAirFnPbTdbW(OutBaroPress,Node(AirInletNode)%Temp,Node(AirInletNode)%HumRat)
!If air flow is less than 25% rated flow. Then set air flow to the 25% of rated conditions
IF(VarSpeedCoil(DXCoilNum)%AirMassFlowRate.LT. &
0.25d0*VarSpeedCoil(DXCoilNum)%DesignAirVolFlowRate* &
PsyRhoAirFnPbTdbW(OutBaroPress,Node(AirInletNode)%Temp,Node(AirInletNode)%HumRat)) THEN
VarSpeedCoil(DXCoilNum)%AirMassFlowRate = &
0.25d0*VarSpeedCoil(DXCoilNum)%DesignAirVolFlowRate* &
PsyRhoAirFnPbTdbW(OutBaroPress,Node(AirInletNode)%Temp,Node(AirInletNode)%HumRat)
END IF
ELSE !CYCLIC FAN, NOT CORRECTION, WILL BE PROCESSED IN THE FOLLOWING SUBROUTINES
VarSpeedCoil(DXCoilNum)%AirMassFlowRate = Node(AirInletNode)%MassFlowRate
END IF
ELSE !heat pump is off
VarSpeedCoil(DXCoilNum)%WaterMassFlowRate = 0.d0
VarSpeedCoil(DXCoilNum)%AirMassFlowRate = 0.d0
ENDIF
IF ((VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==TypeOf_CoilVSWAHPHeatingEquationFit) .OR. &
(VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==TypeOf_CoilVSWAHPCoolingEquationFit))THEN
CALL SetComponentFlowRate(VarSpeedCoil(DXCoilNum)%WaterMassFlowRate, &
VarSpeedCoil(DXCoilNum)%WaterInletNodeNum , &
VarSpeedCoil(DXCoilNum)%WaterOutletNodeNum, &
VarSpeedCoil(DXCoilNum)%LoopNum, &
VarSpeedCoil(DXCoilNum)%LoopSide, &
VarSpeedCoil(DXCoilNum)%BranchNum, &
VarSpeedCoil(DXCoilNum)%CompNum )
VarSpeedCoil(DXCoilNum)%InletWaterTemp = Node(WaterInletNode)%Temp
VarSpeedCoil(DXCoilNum)%InletWaterEnthalpy = Node(WaterInletNode)%Enthalpy
ELSE
VarSpeedCoil(DXCoilNum)%InletWaterTemp = 0.0d0
VarSpeedCoil(DXCoilNum)%InletWaterEnthalpy = 0.0d0
END IF
VarSpeedCoil(DXCoilNum)%InletAirDBTemp = Node(AirInletNode)%Temp
VarSpeedCoil(DXCoilNum)%InletAirHumRat = Node(AirInletNode)%HumRat
VarSpeedCoil(DXCoilNum)%InletAirEnthalpy = Node(AirInletNode)%Enthalpy
VarSpeedCoil(DXCoilNum)%MaxONOFFCyclesperHour= MaxONOFFCyclesperHour
VarSpeedCoil(DXCoilNum)%HPTimeConstant = HPTimeConstant
VarSpeedCoil(DXCoilNum)%FanDelayTime = FanDelayTime
VarSpeedCoil(DXCoilNum)%InletAirPressure = OutBaroPress !temporary
! Outlet variables
VarSpeedCoil(DXCoilNum)%Power=0.0d0
VarSpeedCoil(DXCoilNum)%QLoadTotal=0.0d0
VarSpeedCoil(DXCoilNum)%QSensible=0.0d0
VarSpeedCoil(DXCoilNum)%QLatent=0.0d0
VarSpeedCoil(DXCoilNum)%QSource=0.0d0
VarSpeedCoil(DXCoilNum)%QWasteHeat = 0.0d0
VarSpeedCoil(DXCoilNum)%Energy=0.0d0
VarSpeedCoil(DXCoilNum)%EnergyLoadTotal=0.0d0
VarSpeedCoil(DXCoilNum)%EnergySensible=0.0d0
VarSpeedCoil(DXCoilNum)%EnergyLatent=0.0d0
VarSpeedCoil(DXCoilNum)%EnergySource=0.0d0
VarSpeedCoil(DXCoilNum)%COP=0.0d0
VarSpeedCoil(DXCoilNum)%OutletAirDBTemp=0.0d0
VarSpeedCoil(DXCoilNum)%OutletWaterTemp=0.0d0
VarSpeedCoil(DXCoilNum)%OutletAirHumRat=0.0d0
VarSpeedCoil(DXCoilNum)%OutletAirEnthalpy = 0.0d0
VarSpeedCoil(DXCoilNum)%OutletWaterEnthalpy = 0.0d0
! bug fix, must set zeros to the variables below, otherwise can't pass switch DD test
VarSpeedCoil(DXCoilNum)%CrankcaseHeaterConsumption = 0.0d0
VarSpeedCoil(DXCoilNum)%EvapWaterConsump = 0.0d0
VarSpeedCoil(DXCoilNum)%BasinHeaterConsumption = 0.0d0
VarSpeedCoil(DXCoilNum)%EvapCondPumpElecConsumption = 0.0d0
VarSpeedCoil(DXCoilNum)%CrankcaseHeaterPower = 0.0d0
VarSpeedCoil(DXCoilNum)%DefrostConsumption = 0.0d0
VarSpeedCoil(DXCoilNum)%CondensateVdot = 0.0d0
VarSpeedCoil(DXCoilNum)%CondensateVol = 0.0d0
VarSpeedCoil(DXCoilNum)%QWasteHeat = 0.0d0
RETURN
END SUBROUTINE InitVarSpeedCoil