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 | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | CompName | |||
integer, | intent(inout) | :: | CompIndex | |||
integer, | intent(in) | :: | CyclingScheme | |||
real(kind=r64), | intent(inout) | :: | MaxONOFFCyclesperHour | |||
real(kind=r64), | intent(inout) | :: | HPTimeConstant | |||
real(kind=r64), | intent(inout) | :: | FanDelayTime | |||
integer, | intent(in) | :: | CompOp | |||
real(kind=r64), | intent(in) | :: | PartLoadFrac | |||
real(kind=r64), | intent(in), | optional | :: | OnOffAirFlowRat | ||
integer, | intent(in) | :: | SpeedNum | |||
real(kind=r64), | intent(in) | :: | SpeedRatio | |||
real(kind=r64), | intent(in) | :: | SensLoad | |||
real(kind=r64), | intent(in) | :: | LatentLoad |
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 SimVariableSpeedCoils(CompName,CompIndex,&
CyclingScheme,MaxONOFFCyclesperHour, &
HPTimeConstant,FanDelayTime,CompOp, PartLoadFrac, OnOffAirFlowRat,SpeedNum, SpeedRatio, &
SensLoad, LatentLoad)
! AUTHOR Bo Shen, ORNL
! DATE WRITTEN March 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine manages variable-speed Water to Air Heat Pump component simulation.
! METHODOLOGY EMPLOYED:
! REFERENCES:
! N/A
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE DataHVACGlobals, ONLY: TimestepSys
USE FluidProperties, ONLY: FindGlycol
USE General, ONLY: TrimSigDigits, SolveRegulaFalsi
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: CompName ! Coil Name
INTEGER, INTENT(INOUT) :: CompIndex ! Index for Component name
INTEGER, INTENT(IN) :: CyclingScheme ! Continuous fan OR cycling compressor
REAL(r64), INTENT (INOUT) :: MaxONOFFCyclesperHour ! Maximum cycling rate of heat pump [cycles/hr]
REAL(r64), INTENT (INOUT) :: HPTimeConstant ! Heat pump time constant [s]
REAL(r64), INTENT (INOUT) :: FanDelayTime ! Fan delay time, time delay for the HP's fan to
! shut off after compressor cycle off [s]
INTEGER, INTENT(IN) :: CompOp ! compressor on/off. 0 = off; 1= on
REAL(r64), INTENT(IN) :: PartLoadFrac
! part-load ratio = load/total capacity, passed in by the parent object
REAL(r64), OPTIONAL, INTENT(IN) :: OnOffAirFlowRat ! ratio of comp on to comp off air flow rate
REAL(r64), INTENT(IN) :: SensLoad ! Sensible demand load [W]
REAL(r64), INTENT(IN) :: LatentLoad ! Latent demand load [W]
REAL(r64), INTENT(IN) :: SpeedRatio ! compressor speed ratio
INTEGER, INTENT(IN) :: SpeedNum ! compressor speed number
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: Blank = ' '
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: DXCoilNum ! The WatertoAirHP that you are currently loading input into
REAL(r64) :: OnOffAirFlowRatio ! ratio of comp on to comp off air flow rate
REAL(r64) :: RuntimeFrac ! run time fraction
INTEGER :: SpeedCal ! variable for error proof speed input
! Obtains and Allocates WatertoAirHP related parameters from input file
IF (GetCoilsInputFlag) THEN !First time subroutine has been entered
CALL GetVarSpeedCoilInput
! WaterIndex=FindGlycol('WATER') !Initialize the WaterIndex once
GetCoilsInputFlag=.FALSE.
End If
IF (CompIndex == 0) THEN
DXCoilNum = FindItemInList(CompName,VarSpeedCoil%Name,NumWatertoAirHPs )
IF (DXCoilNum == 0) THEN
CALL ShowFatalError('WaterToAirHPVSWEquationFit not found='//TRIM(CompName))
ENDIF
CompIndex=DXCoilNum
ELSE
DXCoilNum=CompIndex
IF (DXCoilNum > NumWatertoAirHPs .or. DXCoilNum < 1) THEN
CALL ShowFatalError('SimVariableSpeedCoils: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(DXCoilNum))// &
', Number of Water to Air HPs='//TRIM(TrimSigDigits(NumWatertoAirHPs))// &
', WaterToAir HP name='//TRIM(CompName))
ENDIF
IF (CompName /= Blank .AND. CompName /= VarSpeedCoil(DXCoilNum)%Name) THEN
CALL ShowFatalError('SimVariableSpeedCoils: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(DXCoilNum))// &
', WaterToAir HP name='//TRIM(CompName)//', stored WaterToAir HP Name for that index='// &
TRIM(VarSpeedCoil(DXCoilNum)%Name))
ENDIF
ENDIF
IF(PRESENT(OnOffAirFlowRat))THEN
OnOffAirFlowRatio = OnOffAirFlowRat
ELSE
OnOffAirFlowRatio = 1.0d0
END IF
!ERROR PROOF
IF(SpeedNum < 1) THEN
SpeedCal = 1
ELSE
SpeedCal = SpeedNum
END IF
IF((VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==TypeOf_CoilVSWAHPCoolingEquationFit) &
.OR. (VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==Coil_CoolingAirToAirVariableSpeed) )THEN
! Cooling mode
CALL InitVarSpeedCoil(DXCoilNum,MaxONOFFCyclesperHour,HPTimeConstant,FanDelayTime,SensLoad,LatentLoad,CyclingScheme, &
OnOffAirFlowRatio, SpeedRatio, SpeedCal)
CALL CalcVarSpeedCoilCooling(DXCoilNum,CyclingScheme,RuntimeFrac,&
SensLoad,LatentLoad,CompOp,PartLoadFrac,OnOffAirFlowRatio, SpeedRatio, SpeedCal)
CALL UpdateVarSpeedCoil(DXCoilNum)
ELSEIF((VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==TypeOf_CoilVSWAHPHeatingEquationFit) &
.OR. (VarSpeedCoil(DXCoilNum)%VSCoilTypeOfNum==Coil_HeatingAirToAirVariableSpeed) ) THEN
! Heating mode
CALL InitVarSpeedCoil(DXCoilNum,MaxONOFFCyclesperHour,HPTimeConstant,FanDelayTime,SensLoad,LatentLoad,CyclingScheme, &
OnOffAirFlowRatio, SpeedRatio, SpeedCal)
CALL CalcVarSpeedCoilHeating(DXCoilNum,CyclingScheme,RuntimeFrac,&
SensLoad,CompOp,PartLoadFrac,OnOffAirFlowRatio, SpeedRatio, SpeedCal)
CALL UpdateVarSpeedCoil(DXCoilNum)
ELSE
CALL ShowFatalError ('SimVariableSpeedCoils: WatertoAir heatpump not in either HEATING or COOLING mode')
ENDIF
! two additional output variables
VarSpeedCoil(DXCoilNum)%SpeedNumReport = SpeedCal
VarSpeedCoil(DXCoilNum)%SpeedRatioReport = SpeedRatio
RETURN
END SUBROUTINE SimVariableSpeedCoils