!======= Get Coil:WaterHeating:Desuperheater ====================================================================== !======= Get HEAT PUMP:WATER HEATER ===============================================================================
!======= Get WATER HEATER:MIXED =================================================================================== !======= Get WATER HEATER:STRATIFIED ============================================================================== !======= Get Chilled Water :MIXED =================================================================================== end chilled water mixed storage
!======= Get 'ThermalStorage:ChilledWater:Stratified' ======================================================= end stratified chilled water storage
!======= Check Water Heaters ======================================================================================
now do calls to TestCompSet for tanks, depending on nodes and heat pump water heater
SUBROUTINE GetWaterThermalTankInput
! SUBROUTINE INFORMATION:
! AUTHOR Dan Fisher and Brandon Anderson
! DATE WRITTEN May 2000
! MODIFIED R. Raustad, June 2005, added HPWH and desuperheater water heating coils
! B. Griffith, Oct. 2007 extensions for indirect water heaters
! B. Griffith, Feb. 2008 extensions for autosizing water heaters
! BG Mar 2009. Trap for bad heater height input for stratefied water heater CR7718
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Gets the water heater, HPWH, and/or desuperheater heating coil input from the input file.
! METHODOLOGY EMPLOYED:
! Standard EnergyPlus methodology.
! USE STATEMENTS:
USE DataGlobals, ONLY: MaxNameLength, NumOfZones, AutoCalculate, ScheduleAlwaysOn, outputfiledebug
USE DataInterfaces, ONLY: ShowSevereError, ShowWarningError, ShowFatalError, &
SetupOutputVariable, ShowContinueError
USE InputProcessor, ONLY: GetNumObjectsFound, GetObjectItem, VerifyName, FindItemInList, SameString, GetObjectDefMaxArgs
USE DataIPShortCuts
USE NodeInputManager, ONLY: GetOnlySingleNode
USE ScheduleManager, ONLY: GetScheduleIndex, CheckScheduleValueMinMax
USE BranchNodeConnections, ONLY: TestCompSet, SetUpCompSets
USE Psychrometrics, ONLY: PsyRhoAirFnPbTdbW
USE FluidProperties, ONLY: GetDensityGlycol
USE DataLoopNode, ONLY: Node, NodeType_Air, NodeType_Water, NodeConnectionType_Inlet, NodeConnectionType_Outlet, &
NodeConnectionType_ZoneExhaust, NodeConnectionType_ReliefAir, & ! ,NodeConnectionType_Internal
NodeConnectionType_OutsideAir, NodeConnectionType_OutsideAirReference, &
ObjectIsParent, ObjectIsNotParent
USE CurveManager, ONLY: GetCurveIndex, GetCurveType, CurveValue
USE DataHeatBalance, ONLY: Zone, IntGainTypeOf_WaterHeaterMixed, IntGainTypeOf_WaterHeaterStratified, &
IntGainTypeOf_ThermalStorageChilledWaterMixed, IntGainTypeOf_ThermalStorageChilledWaterStratified
USE DXCoils, ONLY: DXCoil, GetDXCoilIndex, NumDXCoils
USE General, ONLY: TrimSigDigits, RoundSigDigits
USE ReportSizingManager, ONLY: ReportSizingOutput
USE PlantUtilities, ONLY: RegisterPlantCompDesignFlow
USE Fans, ONLY: GetFanType, GetFanIndex, GetFanVolFlow
USE DataSizing, ONLY: AutoSize
USE DataZoneEquipment, ONLY: ZoneEquipConfig, ZoneEquipList, ZoneEquipInputsFilled, GetZoneEquipmentData
USE DataEnvironment, ONLY: OutBaroPress
USE DataHVACGlobals, ONLY: FanType_SimpleOnOff, BlowThru, DrawThru
USE OutAirNodeManager, ONLY: CheckOutAirNodeNumber,CheckAndAddAirNodeNumber
USE DataSizing, ONLY: PlantSizData, NumPltSizInput
USE RefrigeratedCase, ONLY: CheckRefrigerationInput
USE GlobalNames, ONLY: VerifyUniqueCoilName
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: Blank = ' '
CHARACTER(len=*), PARAMETER :: RoutineName = 'GetWaterThermalTankInput: '
! INTERFACE BLOCK SPECIFICATIONS:
! DERIVED TYPE DEFINITIONS:
TYPE WaterHeaterSaveNodes
CHARACTER(len=MaxNameLength) :: InletNodeName1 =' '
CHARACTER(len=MaxNameLength) :: OutletNodeName1 =' '
CHARACTER(len=MaxNameLength) :: InletNodeName2 =' '
CHARACTER(len=MaxNameLength) :: OutletNodeName2 =' '
END TYPE
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: WaterThermalTankNum ! Index to WATER HEATER:*
INTEGER :: WHsizingNum ! Index to Water Heater:Sizing, for the IDF objects--not data storage
INTEGER :: NodeNum ! Index to a stratified thermal node
INTEGER :: CheckWaterHeaterNum ! Used to search WATER HEATER:* to find association with HP Water Heater
INTEGER :: DesuperheaterNum ! Index to Coil:WaterHeating:Desuperheater
INTEGER :: HPWaterHeaterNum ! Index to HEAT PUMP:WATER HEATER
INTEGER :: HeatingSourceNum ! Index to DX cooling coil (heat source for desuperheater)
INTEGER :: NumAlphas ! Number of elements in the alpha array
INTEGER :: NumNums ! Number of elements in the numeric array
!unused1208 INTEGER :: NumArgs ! Number of elements in the object (alpha + numeric)
INTEGER :: RackNum ! Index to refrigrated display case rack
INTEGER :: CondNum ! Index to refrigration condenser
INTEGER :: DXCoilNum ! Index to DX coils
INTEGER :: IOStat ! IO Status when calling get input subroutine
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
LOGICAL :: IsValid ! Flag for validating PLF curve, OutsideAirNode
LOGICAL :: ErrorsFound = .FALSE. ! Flag for any error found during GetWaterThermalTankInput
CHARACTER(len=MaxNameLength):: FanInletNode = ' ' ! Used to set up comp set
CHARACTER(len=MaxNameLength):: FanOutletNode = ' ' ! Used to set up comp set
CHARACTER(len=MaxNameLength):: CoilInletNode = ' ' ! Used to set up comp set
CHARACTER(len=MaxNameLength):: CoilOutletNode = ' ' ! Used to set up comp set
INTEGER :: SupAirIn = 0 ! Used for error checking HPWHs
INTEGER :: ExhAirOut = 0 ! Used for error checking HPWHs
LOGICAL :: FoundInletNode = .FALSE. ! Used for error checking HPWHs
LOGICAL :: FoundOutletNode = .FALSE. ! Used for error checking HPWHs
INTEGER :: ZoneNum = 0 ! Used for error checking HPWHs
LOGICAL :: ValidScheduleValue = .FALSE. ! Used for error checking HPWH's inlet air mixer schedule
INTEGER :: ZoneEquipConfigNum = 0 ! Used to determine if HPWH tank is in a Zone Equipment List (ZEL)
INTEGER :: ZoneEquipListNum = 0 ! Used to determine if HPWH tank is in a Zone Equipment List
INTEGER :: EquipmentTypeNum = 0 ! Used to determine if HPWH tank is in a Zone Equipment List
LOGICAL :: FoundTankInList = .FALSE. ! Used to determine if HPWH tank is listed in a Zone Equipment List
LOGICAL :: TankNotLowestPriority = .FALSE. ! Used to determine if HPWH tank is prioritized correctly in ZEL
INTEGER :: TankCoolingPriority = 0 ! Used to determine if a HPWH tank is prioritized correctly in ZEL
INTEGER :: TankHeatingPriority = 0 ! Used to determine if a HPWH tank is prioritized correctly in ZEL
LOGICAL :: DXCoilErrFlag = .FALSE. ! Used for error checking DX coils used with HPWHs
REAL(r64) :: FanVolFlow = 0.0d0 ! Used for error checking fans used with HPWHs
LOGICAL :: ErrFlag = .FALSE. ! Used for error checking used with HPWHs
REAL(r64) :: HEffFTemp = 0.0d0 ! Used for error checking desuperheater heating coils
LOGICAL :: Okay
! Following allow for temporary storage of character strings but not saved in main structure
TYPE (WaterHeaterSaveNodes), ALLOCATABLE, DIMENSION(:) :: HPWHSaveNodeNames ! temporary for HPWH node names used in later checks
TYPE (WaterHeaterSaveNodes), ALLOCATABLE, DIMENSION(:) :: WHSaveNodeNames ! temporary for WH node names used in later checks
TYPE (WaterHeaterSaveNodes), ALLOCATABLE, DIMENSION(:) :: CoilSaveNodeNames ! temporary for coil node names used in later checks
REAL(r64) :: rho ! local fluid density
INTEGER :: DummyWaterIndex = 1
! FLOW:
! Make sure refrigeration input is gotten before this input
CALL CheckRefrigerationInput
IF (GetWaterThermalTankInputFlag) THEN
NumWaterHeaterMixed = GetNumObjectsFound(cMixedWHModuleObj)
NumWaterHeaterStratified = GetNumObjectsFound(cStratifiedWHModuleObj)
NumChilledWaterMixed = GetNumObjectsFound(cMixedCWTankModuleObj)
NumChilledWaterStratified = GetNumObjectsFound(cStratifiedCWTankModuleObj)
NumWaterThermalTank = NumWaterHeaterMixed + NumWaterHeaterStratified &
+ NumChilledWaterMixed + NumChilledWaterStratified
NumHeatPumpWaterHeater = GetNumObjectsFound('WaterHeater:HeatPump')
NumWaterHeaterDesuperheater = GetNumObjectsFound('Coil:WaterHeating:Desuperheater')
IF (NumWaterThermalTank > 0) THEN
! Write water heater header for EIO
If ((NumWaterHeaterMixed >0) .OR. (NumWaterHeaterStratified >0)) WRITE(OutputFileInits,720)
IF (NumHeatPumpWaterHeater > 0) WRITE(OutputFileInits,721)
IF (NumWaterHeaterStratified > 0) WRITE(OutputFileInits,722)
IF (NumChilledWaterMixed > 0) WRITE(OutputFileInits, 725 )
IF (NumChilledWaterStratified > 0) WRITE(OutputFileInits, 726)
END IF
720 FORMAT( '! <Water Heater Information>,Type,Name,Volume {m3},Maximum Capacity {W},Standard Rated Recovery Efficiency, ', &
'Standard Rated Energy Factor')
721 FORMAT( '! <Heat Pump Water Heater Information>,Type,Name,Volume {m3},Maximum Capacity {W},', &
'Standard Rated Recovery Efficiency,Standard Rated Energy Factor,"DX Coil Total Cooling Rate {W, HPWH Only}"')
722 FORMAT( '! <Water Heater Stratified Node Information>,Node Number,Height {m},Volume {m3},Maximum Capacity {W},', &
'Off-Cycle UA {W/K},On-Cycle UA {W/K},Number Of Inlets,Number Of Outlets')
725 FORMAT('! <Chilled Water Tank Information>,Type,Name,Volume {m3},Use Side Design Flow Rate {m3/s}, ', &
'Source Side Design Flow Rate {m3/s}')
726 FORMAT( '! <Chilled Water Tank Stratified Node Information>,Node Number,Height {m},Volume {m3},', &
'UA {W/K},Number Of Inlets,Number Of Outlets')
IF (NumWaterThermalTank > 0) THEN
ALLOCATE(WaterThermalTank(NumWaterThermalTank))
ALLOCATE(WHSaveNodeNames(NumWaterThermalTank))
ALLOCATE(CheckWTTEquipName(NumWaterThermalTank))
CheckWTTEquipName=.true.
ENDIF
IF (NumHeatPumpWaterHeater > 0)THEN
ALLOCATE(HPWaterHeater(NumHeatPumpWaterHeater))
ALLOCATE(MyHPSizeFlag(NumHeatPumpWaterHeater))
MyHPSizeFlag=.true.
ALLOCATE(CheckHPWHEquipName(NumHeatPumpWaterHeater))
CheckHPWHEquipName=.true.
ALLOCATE(HPWHSaveNodeNames(NumHeatPumpWaterHeater))
END IF
IF (NumWaterHeaterDesuperheater > 0) THEN
ALLOCATE(WaterHeaterDesuperheater(NumWaterHeaterDesuperheater))
ALLOCATE(ValidSourceType(NumWaterHeaterDesuperheater))
ValidSourceType=.false.
ALLOCATE(CoilSaveNodeNames(NumWaterHeaterDesuperheater))
ENDIF
!!!======= Get Coil:WaterHeating:Desuperheater ======================================================================
IF (NumWaterHeaterDesuperheater > 0) THEN
cCurrentModuleObject = 'Coil:WaterHeating:Desuperheater'
DO DesuperheaterNum = 1, NumWaterHeaterDesuperheater
CALL GetObjectItem(cCurrentModuleObject,DesuperheaterNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK = .FALSE.
IsBlank = .FALSE.
CALL VerifyName(cAlphaArgs(1),WaterHeaterDesuperheater%Name,DesuperheaterNum-1, &
IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
END IF
CALL VerifyUniqueCoilName(cCurrentModuleObject,cAlphaArgs(1),errflag,TRIM(cCurrentModuleObject)//' Name')
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
WaterHeaterDesuperheater(DesuperheaterNum)%Name = cAlphaArgs(1)
WaterHeaterDesuperheater(DesuperheaterNum)%Type = cCurrentModuleObject
! convert availability schedule name to pointer
IF(.NOT. lAlphaFieldBlanks(2) )THEN
WaterHeaterDesuperheater(DesuperheaterNum)%AvailSchedPtr = GetScheduleIndex(cAlphaArgs(2))
IF (WaterHeaterDesuperheater(DesuperheaterNum)%AvailSchedPtr .EQ. 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
ErrorsFound=.TRUE.
END IF
ELSE
WaterHeaterDesuperheater(DesuperheaterNum)%AvailSchedPtr = ScheduleAlwaysOn
END IF
! convert schedule name to pointer
WaterHeaterDesuperheater(DesuperheaterNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(3))
IF (WaterHeaterDesuperheater(DesuperheaterNum)%SetpointTempSchedule .EQ. 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(cAlphaArgs(3)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
ErrorsFound=.TRUE.
END IF
WaterHeaterDesuperheater(DesuperheaterNum)%DeadbandTempDiff = rNumericArgs(1)
IF(WaterHeaterDesuperheater(DesuperheaterNum)%DeadbandTempDiff .LE. 0.0d0 .OR. &
WaterHeaterDesuperheater(DesuperheaterNum)%DeadbandTempDiff .GT. 20.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
': '//TRIM(cNumericFieldNames(1))//' must be > 0 and <= 20. '//TRIM(cNumericFieldNames(1))//' = ' &
//TRIM(TrimSigDigits(rNumericArgs(1),1)))
ErrorsFound=.TRUE.
END IF
!WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff = rNumericArgs(2)
! Error limits on heat reclaim efficiency applied after source type identified
WaterHeaterDesuperheater(DesuperheaterNum)%RatedInletWaterTemp = rNumericArgs(3)
WaterHeaterDesuperheater(DesuperheaterNum)%RatedOutdoorAirTemp = rNumericArgs(4)
WaterHeaterDesuperheater(DesuperheaterNum)%MaxInletWaterTemp = rNumericArgs(5)
IF (.NOT. lAlphaFieldBlanks(4) ) THEN
WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp = GetCurveIndex(cAlphaArgs(4))
IF (WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
': '//TRIM(cAlphaFieldNames(4))//' not found = '//TRIM(cAlphaArgs(4)))
ErrorsFound = .TRUE.
ELSE
! Verify Curve Object, only legal type is Quadratic
SELECT CASE(GetCurveType(WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp))
CASE('BIQUADRATIC')
IF(WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp .GT. 0)THEN
HEffFTemp = MIN(1.0d0,MAX(0.0d0,CurveValue(WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp, &
WaterHeaterDesuperheater(DesuperheaterNum)%RatedInletWaterTemp, &
WaterHeaterDesuperheater(DesuperheaterNum)%RatedOutdoorAirTemp)))
IF(ABS(HEffFTemp - 1.0d0) .GT. 0.05d0)THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//', "'// &
TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//'":')
CALL ShowContinueError('The '//TRIM(cAlphaFieldNames(4))//' should be normalized ')
CALL ShowContinueError(' to 1.0 at the rating point. Curve output at the rating point = ' &
//TrimSigDigits(HEffFTemp,3))
CALL ShowContinueError(' The simulation continues using the user-specified curve.')
END IF
END IF
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
'" illegal '//TRIM(cAlphaFieldNames(4))//' type for this object = '// &
TRIM(GetCurveType(WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp)))
ErrorsFound=.true.
END SELECT
END IF
END IF
WaterHeaterDesuperheater(DesuperheaterNum)%WaterInletNode = &
GetOnlySingleNode(cAlphaArgs(5),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet,1,ObjectIsParent)
WaterHeaterDesuperheater(DesuperheaterNum)%WaterOutletNode = &
GetOnlySingleNode(cAlphaArgs(6),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet,1,ObjectIsParent)
CoilSaveNodeNames(DesuperheaterNum)%InletNodeName1=cAlphaArgs(5)
CoilSaveNodeNames(DesuperheaterNum)%OutletNodeName1=cAlphaArgs(6)
WaterHeaterDesuperheater(DesuperheaterNum)%TankType = cAlphaArgs(7)
IF (.NOT. SameString(WaterHeaterDesuperheater(DesuperheaterNum)%TankType,cMixedWHModuleObj) &
.AND. .NOT. SameString(WaterHeaterDesuperheater(DesuperheaterNum)%TankType,cStratifiedWHModuleObj)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(DesuperheaterNum)%Name)//':')
CALL ShowContinueError('Desuperheater can only be used with '//cMixedWHModuleObj//' or '//cStratifiedWHModuleObj//'.')
ErrorsFound = .TRUE.
END IF
WaterHeaterDesuperheater(DesuperheaterNum)%TankName = cAlphaArgs(8)
! get heat reclaim object
IF(SameString(cAlphaArgs(9),'Coil:Cooling:DX:SingleSpeed') .OR. &
SameString(cAlphaArgs(9),'Coil:Cooling:DX:TwoSpeed') .OR. &
SameString(cAlphaArgs(9),'Coil:Cooling:DX:TwoStageWithHumidityControlMode'))THEN
WaterHeaterDesuperheater(DesuperheaterNum)%HeatingSourceType = cAlphaArgs(9)
WaterHeaterDesuperheater(DesuperheaterNum)%HeatingSourceName = cAlphaArgs(10)
! load DX coil structure for connection to desuperheater heating coil (refrigerated rack have been loaded)
ErrFlag=.false.
CALL GetDXCoilIndex(WaterHeaterDesuperheater(DesuperheaterNum)%HeatingSourceName, &
HeatingSourceNum, ErrFlag, cCurrentModuleObject)
IF (ErrFlag) THEN
CALL ShowContinueError('...occurs in '//TRIM(cCurrentModuleObject)//'='// &
TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name))
ErrorsFound=.true.
ENDIF
ELSE IF((SameString(cAlphaArgs(9),'Refrigeration:CompressorRack')) .OR. &
(SameString(cAlphaArgs(9),'Refrigeration:Condenser:AirCooled')).OR.&
(SameString(cAlphaArgs(9),'Refrigeration:Condenser:EvaporativeCooled')).OR.&
(SameString(cAlphaArgs(9),'Refrigeration:Condenser:WaterCooled')))&
THEN
WaterHeaterDesuperheater(DesuperheaterNum)%HeatingSourceType = cAlphaArgs(9)
WaterHeaterDesuperheater(DesuperheaterNum)%HeatingSourceName = cAlphaArgs(10)
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//':')
CALL ShowContinueError(' desuperheater can only be used with Coil:Cooling:DX:SingleSpeed, ')
CALL ShowContinueError(' Coil:Cooling:DX:TwoSpeed, Coil:Cooling:DX:TwoStageWithHumidityControlMode, '// &
'Refrigeration:CompressorRack,')
CALL ShowContinueError(' Refrigeration:Condenser:AirCooled ,Refrigeration:Condenser:EvaporativeCooled, ')
CALL ShowContinueError(' or Refrigeration:Condenser:WaterCooled.')
ErrorsFound = .TRUE.
END IF
! Set up comp set for water side nodes (reverse inlet/outlet for water heater)
CALL SetUpCompSets(WaterHeaterDesuperheater(DesuperheaterNum)%Type, WaterHeaterDesuperheater(DesuperheaterNum)%Name, &
WaterHeaterDesuperheater(DesuperheaterNum)%TankType, &
WaterHeaterDesuperheater(DesuperheaterNum)%TankName,cAlphaArgs(6),cAlphaArgs(5))
! Find the DX equipment index associated with the desuperheater heating coil.
IF(SameString(cAlphaArgs(9),'Refrigeration:CompressorRack'))THEN
WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource = COMPRESSORRACK_REFRIGERATEDCASE
DO RackNum = 1,NumRefrigeratedRacks
IF(.NOT. SameString(HeatReclaimRefrigeratedRack(RackNum)%Name,cAlphaArgs(10)))CYCLE
WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum = RackNum
IF(ALLOCATED(HeatReclaimRefrigeratedRack))ValidSourceType(DesuperheaterNum) = .TRUE.
EXIT
END DO
IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum .EQ. 0)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
'" desuperheater heat source object not found: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
ErrorsFound = .TRUE.
END IF
ELSEIF((SameString(cAlphaArgs(9),'Refrigeration:Condenser:AirCooled')).OR.&
(SameString(cAlphaArgs(9),'Refrigeration:Condenser:EvaporativeCooled')).OR.&
(SameString(cAlphaArgs(9),'Refrigeration:Condenser:WaterCooled')))&
THEN
WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource = CONDENSER_REFRIGERATION
DO CondNum = 1,NumRefrigCondensers
IF(.NOT. SameString(HeatReclaimRefrigCondenser(CondNum)%Name,cAlphaArgs(10)))CYCLE
WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum = CondNum
IF(ALLOCATED(HeatReclaimRefrigCondenser))ValidSourceType(DesuperheaterNum) = .TRUE.
EXIT
END DO
IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum .EQ. 0)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
'" desuperheater heat source object not found: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
ErrorsFound = .TRUE.
END IF
ELSEIF(SameString(cAlphaArgs(9),'Coil:Cooling:DX:SingleSpeed'))THEN
WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource = COIL_DX_COOLING
DO DXCoilNum = 1, NumDXCoils
IF(.NOT. SameString(HeatReclaimDXCoil(DXCoilNum)%Name,cAlphaArgs(10)))CYCLE
WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum = DXCoilNum
IF(ALLOCATED(HeatReclaimDXCoil))ValidSourceType(DesuperheaterNum) = .TRUE.
EXIT
END DO
IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum .EQ. 0)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
'" desuperheater heat source object not found: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
ErrorsFound = .TRUE.
END IF
ELSEIF(SameString(cAlphaArgs(9),'Coil:Cooling:DX:TwoSpeed'))THEN
WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource = COIL_DX_MULTISPEED
DO DXCoilNum = 1, NumDXCoils
IF(.NOT. SameString(HeatReclaimDXCoil(DXCoilNum)%Name,cAlphaArgs(10)))CYCLE
WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum = DXCoilNum
IF(ALLOCATED(HeatReclaimDXCoil))ValidSourceType(DesuperheaterNum) = .TRUE.
EXIT
END DO
IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum .EQ. 0)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
'" desuperheater heat source object not found: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
ErrorsFound = .TRUE.
END IF
ELSEIF(SameString(cAlphaArgs(9),'Coil:Cooling:DX:TwoStageWithHumidityControlMode'))THEN
WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource = COIL_DX_MULTIMODE
DO DXCoilNum = 1, NumDXCoils
IF(.NOT. SameString(HeatReclaimDXCoil(DXCoilNum)%Name,cAlphaArgs(10)))CYCLE
WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum = DXCoilNum
IF(ALLOCATED(HeatReclaimDXCoil))ValidSourceType(DesuperheaterNum) = .TRUE.
EXIT
END DO
IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum .EQ. 0)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
'" desuperheater heat source object not found: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
ErrorsFound = .TRUE.
END IF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
'" invalid desuperheater heat source object: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
ErrorsFound = .TRUE.
END IF
!Now have source type, so set limits on heat recovery efficiency
IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource == CONDENSER_REFRIGERATION) THEN
IF (lNumericFieldBlanks(2)) THEN
WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff = 0.8d0
ELSE
WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff = rNumericArgs(2)
IF(WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff .LE. 0.0d0 .OR. &
WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff .GT. 0.9d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
': '//TRIM(cNumericFieldNames(2))//' must be > 0.0 and <= 0.9, Efficiency = ' &
//TRIM(TrimSigDigits(WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff,3)))
ErrorsFound=.TRUE.
END IF
END IF !Blank Num(2)
ELSE ! max is 0.3 for all other sources
IF (lNumericFieldBlanks(2)) THEN
WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff = 0.25d0
ELSE
WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff = rNumericArgs(2)
IF(WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff .LE. 0.0d0 .OR. &
WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff .GT. 0.3d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
': '//TRIM(cNumericFieldNames(2))//' must be > 0.0 and <= 0.3, '//TRIM(cNumericFieldNames(2))// &
' = '//TRIM(TrimSigDigits(WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff,3)))
ErrorsFound=.TRUE.
END IF
END IF !Blank Num(2)
END IF !setting limits on heat recovery efficiency
WaterHeaterDesuperheater(DesuperheaterNum)%OperatingWaterFlowRate = rNumericArgs(6)
IF(WaterHeaterDesuperheater(DesuperheaterNum)%OperatingWaterFlowRate .LE. 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
': '//TRIM(cNumericFieldNames(6))//' must be greater than 0. '//TRIM(cNumericFieldNames(6))//' = ' &
//TRIM(TrimSigDigits(rNumericArgs(6),6)))
ErrorsFound=.TRUE.
END IF
WaterHeaterDesuperheater(DesuperheaterNum)%PumpElecPower = rNumericArgs(7)
IF(WaterHeaterDesuperheater(DesuperheaterNum)%PumpElecPower .LT. 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
': '//TRIM(cNumericFieldNames(7))//' must be >= 0. '//TRIM(cNumericFieldNames(7))//' = ' &
//TRIM(TrimSigDigits(rNumericArgs(7),2)))
ErrorsFound=.TRUE.
END IF
IF((WaterHeaterDesuperheater(DesuperheaterNum)%PumpElecPower/ &
WaterHeaterDesuperheater(DesuperheaterNum)%OperatingWaterFlowRate) .GT. 7.9264d6)THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
': '//TRIM(cNumericFieldNames(7))//' to '//TRIM(cNumericFieldNames(6))//' ratio > 7.9264E6.' &
//' '//TRIM(cNumericFieldNames(7))//' to '//TRIM(cNumericFieldNames(6))//' = ' &
//TRIM(TrimSigDigits((WaterHeaterDesuperheater(DesuperheaterNum)%PumpElecPower/ &
WaterHeaterDesuperheater(DesuperheaterNum)%OperatingWaterFlowRate),3)))
CALL ShowContinueError(' Suggest reducing '//TRIM(cNumericFieldNames(7))//' or increasing '// &
TRIM(cNumericFieldNames(6))//'.')
CALL ShowContinueError(' The simulation will continue using the user defined values.')
END IF
WaterHeaterDesuperheater(DesuperheaterNum)%PumpFracToWater = rNumericArgs(8)
IF(WaterHeaterDesuperheater(DesuperheaterNum)%PumpFracToWater .LT. 0.0d0 .OR. &
WaterHeaterDesuperheater(DesuperheaterNum)%PumpFracToWater .GT. 1.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
': '//TRIM(cNumericFieldNames(8))//' must be >= 0 or <= 1. '//TRIM(cNumericFieldNames(8))//' = ' &
//TRIM(TrimSigDigits(rNumericArgs(8),3)))
ErrorsFound=.TRUE.
END IF
WaterHeaterDesuperheater(DesuperheaterNum)%OnCycParaLoad = rNumericArgs(9)
IF(WaterHeaterDesuperheater(DesuperheaterNum)%OnCycParaLoad .LT. 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
': '//TRIM(cNumericFieldNames(9))//' must be >= 0. '//TRIM(cNumericFieldNames(9))//' = ' &
//TRIM(TrimSigDigits(rNumericArgs(9),2)))
ErrorsFound=.TRUE.
END IF
WaterHeaterDesuperheater(DesuperheaterNum)%OffCycParaLoad = rNumericArgs(10)
IF(WaterHeaterDesuperheater(DesuperheaterNum)%OffCycParaLoad .LT. 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
': '//TRIM(cNumericFieldNames(10))//' must be >= 0. '//TRIM(cNumericFieldNames(10))//' = ' &
//TRIM(TrimSigDigits(rNumericArgs(10),2)))
ErrorsFound=.TRUE.
END IF
END DO
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)// &
' input. Preceding condition causes termination.')
END IF
END IF
!!!======= Get HEAT PUMP:WATER HEATER ===============================================================================
! get input for heat pump water heater object
IF (NumHeatPumpWaterHeater > 0) THEN
cCurrentModuleObject = 'WaterHeater:HeatPump'
DO HPWaterHeaterNum = 1, NumHeatPumpWaterHeater
CALL GetObjectItem(cCurrentModuleObject,HPWaterHeaterNum, &
cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK = .FALSE.
IsBlank = .FALSE.
CALL VerifyName(cAlphaArgs(1),HPWaterHeater%Name, &
HPWaterHeaterNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
END IF
HPWaterHeater(HPWaterHeaterNum)%Name = cAlphaArgs(1)
HPWaterHeater(HPWaterHeaterNum)%Type = cCurrentModuleObject
HPWaterHeater(HPWaterHeaterNum)%TypeNum = HeatPumpWaterHeater
! convert schedule name to pointer
IF (.not. lAlphaFieldBlanks(2)) THEN
HPWaterHeater(HPWaterHeaterNum)%AvailSchedPtr = GetScheduleIndex(cAlphaArgs(2))
IF (HPWaterHeater(HPWaterHeaterNum)%AvailSchedPtr .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
CALL ShowContinueError(trim(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))//'".')
ErrorsFound=.TRUE.
END IF
ELSE
HPWaterHeater(HPWaterHeaterNum)%AvailSchedPtr = ScheduleAlwaysOn
ENDIF
! convert schedule name to pointer
IF (.not. lAlphaFieldBlanks(3)) THEN
HPWaterHeater(HPWaterHeaterNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(3))
IF (HPWaterHeater(HPWaterHeaterNum)%SetpointTempSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
CALL ShowContinueError(trim(cAlphaFieldNames(3))//'="'//TRIM(cAlphaArgs(3))//'".')
ErrorsFound=.TRUE.
ENDIF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
CALL ShowContinueError('required '//trim(cAlphaFieldNames(3))//' is blank.')
ErrorsFound=.TRUE.
END IF
HPWaterHeater(HPWaterHeaterNum)%DeadbandTempDiff = rNumericArgs(1)
IF(HPWaterHeater(HPWaterHeaterNum)%DeadbandTempDiff .LE. 0.0d0 .OR. &
HPWaterHeater(HPWaterHeaterNum)%DeadbandTempDiff .GT. 20.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
CALL ShowContinueError(trim(cNumericFieldNames(1))//' difference must be > 0 and <= 20. Dead band = ' &
//TRIM(TrimSigDigits(rNumericArgs(1),1)))
ErrorsFound=.TRUE.
END IF
HPWaterHeater(HPWaterHeaterNum)%CondWaterInletNode = &
GetOnlySingleNode(cAlphaArgs(4),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet,2,ObjectIsParent)
HPWHSaveNodeNames(HPWaterHeaterNum)%InletNodeName1=cAlphaArgs(4)
HPWaterHeater(HPWaterHeaterNum)%CondWaterOutletNode = &
GetOnlySingleNode(cAlphaArgs(5),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet,2,ObjectIsParent)
HPWHSaveNodeNames(HPWaterHeaterNum)%OutletNodeName1=cAlphaArgs(5)
HPWaterHeater(HPWaterHeaterNum)%OperatingWaterFlowRate = rNumericArgs(2)
IF(HPWaterHeater(HPWaterHeaterNum)%OperatingWaterFlowRate .LE. 0.0d0 .AND. rNumericArgs(2) /= AutoCalculate) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
CALL ShowContinueError(trim(cNumericFieldNames(2))//' must be greater than 0. Condenser water flow rate = ' &
//TRIM(TrimSigDigits(rNumericArgs(2),6)))
ErrorsFound=.TRUE.
END IF
HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate = rNumericArgs(3)
IF(HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate .LE. 0.0d0 .AND. rNumericArgs(3) /= AutoCalculate) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
CALL ShowContinueError(trim(cNumericFieldNames(3))//' must be greater than 0. Evaporator air flow rate = ' &
//TRIM(TrimSigDigits(rNumericArgs(3),6)))
ErrorsFound=.TRUE.
END IF
SELECT CASE (cAlphaArgs(6))
CASE ('SCHEDULE')
HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration = AmbientTempSchedule
IF (.not. lAlphaFieldBlanks(11)) THEN
HPWaterHeater(HPWaterHeaterNum)%AmbientTempSchedule = GetScheduleIndex(cAlphaArgs(11))
IF (HPWaterHeater(HPWaterHeaterNum)%AmbientTempSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
CALL ShowContinueError(trim(cAlphaFieldNames(11))//'="'//TRIM(cAlphaArgs(11))//'".')
ErrorsFound = .TRUE.
ENDIF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
CALL ShowContinueError('required '//trim(cAlphaFieldNames(11))//' is blank.')
ErrorsFound=.TRUE.
END IF
IF (.not. lAlphaFieldBlanks(12)) THEN
HPWaterHeater(HPWaterHeaterNum)%AmbientRHSchedule = GetScheduleIndex(cAlphaArgs(12))
IF (HPWaterHeater(HPWaterHeaterNum)%AmbientRHSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
CALL ShowContinueError(trim(cAlphaFieldNames(12))//'="'//TRIM(cAlphaArgs(12))//'".')
ErrorsFound = .TRUE.
ELSE
IF (.NOT. CheckScheduleValueMinMax(HPWaterHeater(HPWaterHeaterNum)%AmbientRHSchedule,'>=',0.0d0,'<=',1.0d0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)// &
'", invalid values')
CALL ShowContinueError(trim(cAlphaFieldNames(12))//'="'//TRIM(cAlphaArgs(12))//'",'// &
' schedule values must be (>=0., <=1.)')
ErrorsFound=.true.
END IF
END IF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
CALL ShowContinueError('required '//trim(cAlphaFieldNames(12))//' is blank.')
ErrorsFound=.TRUE.
END IF
CASE ('ZONEAIRONLY')
HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration = AmbientTempZone
IF (.not. lAlphaFieldBlanks(13)) THEN
HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone = FindItemInList(cAlphaArgs(13),Zone%Name,NumOfZones)
IF (HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
CALL ShowContinueError(trim(cAlphaFieldNames(13))//'="'//TRIM(cAlphaArgs(13))//'".')
ErrorsFound = .TRUE.
END IF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
CALL ShowContinueError('required '//trim(cAlphaFieldNames(13))//' is blank.')
ErrorsFound=.TRUE.
ENDIF
CASE ('OUTDOORAIRONLY')
HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration = AmbientTempOutsideAir
CASE ('ZONEANDOUTDOORAIR')
HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration = AmbientTempZoneAndOA
IF (.not. lAlphaFieldBlanks(13)) THEN
HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone = FindItemInList(cAlphaArgs(13),Zone%Name,NumOfZones)
IF (HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
CALL ShowContinueError(trim(cAlphaFieldNames(13))//'="'//TRIM(cAlphaArgs(13))//'".')
ErrorsFound = .TRUE.
END IF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
CALL ShowContinueError('required '//trim(cAlphaFieldNames(13))//' is blank.')
ErrorsFound=.TRUE.
ENDIF
END SELECT
! Read air inlet nodes after mixer/splitter nodes have been read in (cAlphaArgs 7-10),
! Node_ConnectionType differs for inlet node if mixer/splitter node exists
HPWaterHeater(HPWaterHeaterNum)%TankType = cAlphaArgs(14)
IF (.NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%TankType,cMixedWHModuleObj) &
.AND. .NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%TankType,cStratifiedWHModuleObj)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
CALL ShowContinueError('Heat pump water heater can only be used with '// &
cMixedWHModuleObj//' or '//cStratifiedWHModuleObj//'.')
ErrorsFound = .TRUE.
END IF
! Verify tank name after Water Heater:Mixed objects have been read in
HPWaterHeater(HPWaterHeaterNum)%TankName = cAlphaArgs(15)
! Get the water heater tank use side inlet node names for HPWHs connected to a plant loop
! Save the name of the node for use with set up comp sets
HPWHSaveNodeNames(HPWaterHeaterNum)%InletNodeName2=cAlphaArgs(16)
HPWHSaveNodeNames(HPWaterHeaterNum)%OutletNodeName2=cAlphaArgs(17)
IF(.not. lAlphaFieldBlanks(16) .AND. .not. lAlphaFieldBlanks(17))THEN
HPWaterHeater(HPWaterHeaterNum)%WHUseInletNode = &
GetOnlySingleNode(cAlphaArgs(16),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet,1,ObjectIsParent)
HPWaterHeater(HPWaterHeaterNum)%WHUseOutletNode = &
GetOnlySingleNode(cAlphaArgs(17),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet,1,ObjectIsParent)
END IF
! get Coil:DX:HeatPumpWaterHeater object
HPWaterHeater(HPWaterHeaterNum)%DXCoilType = cAlphaArgs(18)
HPWaterHeater(HPWaterHeaterNum)%DXCoilName = cAlphaArgs(19)
! check that the DX Coil exists
IF(.NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%DXCoilType,'Coil:WaterHeating:AirToWaterHeatPump'))THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
CALL ShowContinueError('Heat pump water heater can only be used with Coil:WaterHeating:AirToWaterHeatPump.')
ErrorsFound = .TRUE.
END IF
DXCoilErrFlag=.false.
CALL GetDXCoilIndex(HPWaterHeater(HPWaterHeaterNum)%DXCoilName, &
HPWaterHeater(HPWaterHeaterNum)%DXCoilNum, DXCoilErrFlag, cCurrentModuleObject)
IF (DXCoilErrFlag) THEN
CALL ShowContinueError('...occurs in WaterHeater:HeatPump ='//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name))
CALL ShowContinueError('...entered DX CoilType='//TRIM(HPWaterHeater(HPWaterHeaterNum)%DXCoilType))
ErrorsFound = .TRUE.
END IF
! Set up comp set for condenser water side nodes (reverse inlet/outlet for water heater)
CALL SetUpCompSets(HPWaterHeater(HPWaterHeaterNum)%Type, HPWaterHeater(HPWaterHeaterNum)%Name, &
HPWaterHeater(HPWaterHeaterNum)%DXCoilType, &
HPWaterHeater(HPWaterHeaterNum)%DXCoilName,cAlphaArgs(4),cAlphaArgs(5))
CALL SetUpCompSets(HPWaterHeater(HPWaterHeaterNum)%Type, HPWaterHeater(HPWaterHeaterNum)%Name, &
HPWaterHeater(HPWaterHeaterNum)%TankType, &
HPWaterHeater(HPWaterHeaterNum)%TankName,cAlphaArgs(5),cAlphaArgs(4))
HPWaterHeater(HPWaterHeaterNum)%MinAirTempForHPOperation = rNumericArgs(4)
IF(HPWaterHeater(HPWaterHeaterNum)%MinAirTempForHPOperation .LT. 5) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//&
'": minimum inlet air temperature for heat pump compressor operation must be greater than or equal to 5 C.')
CALL ShowContinueError('...Minimum inlet air temperature = '//TRIM(TrimSigDigits(rNumericArgs(4),1)))
END IF
! Get compressor location
SELECT CASE (cAlphaArgs(20))
CASE ('SCHEDULE')
HPWaterHeater(HPWaterHeaterNum)%CrankcaseTempIndicator = CrankcaseTempSchedule
IF (.not. lAlphaFieldBlanks(21)) THEN
HPWaterHeater(HPWaterHeaterNum)%CrankcaseTempSchedule = GetScheduleIndex(cAlphaArgs(21))
IF (HPWaterHeater(HPWaterHeaterNum)%CrankcaseTempSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
CALL ShowContinueError(trim(cAlphaFieldNames(21))//'="'//TRIM(cAlphaArgs(21))//'".')
ErrorsFound = .TRUE.
END IF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
CALL ShowContinueError('required '//trim(cAlphaFieldNames(21))//' is blank.')
ErrorsFound=.TRUE.
ENDIF
CASE ('ZONE')
HPWaterHeater(HPWaterHeaterNum)%CrankcaseTempIndicator = CrankcaseTempZone
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempOutsideAir .OR. &
HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempSchedule)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
'": Inlet Air Configuration must be Zone Air Only or Zone And')
CALL ShowContinueError(' Outdoor Air when compressor location equals ZONE.')
ErrorsFound = .TRUE.
END IF
IF(.not. lAlphaFieldBlanks(21))THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
'" '//trim(cAlphaFieldNames(21))//' was provided but will not be used based'// &
' on compressor location input="'//TRIM(cAlphaArgs(20))//'".')
END IF
CASE ('OUTDOORS')
HPWaterHeater(HPWaterHeaterNum)%CrankcaseTempIndicator = CrankcaseTempExterior
IF(.not. lAlphaFieldBlanks(21))THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
'" '//trim(cAlphaFieldNames(21))//' was provided but will not be used based'// &
' on '//trim(cAlphaFieldNames(21))//'="'//TRIM(cAlphaArgs(20))//'".')
END IF
END SELECT
HPWaterHeater(HPWaterHeaterNum)%FanType = cAlphaArgs(22)
HPWaterHeater(HPWaterHeaterNum)%FanName = cAlphaArgs(23)
! check that the fan exists
ErrFlag=.false.
CALL GetFanIndex(HPWaterHeater(HPWaterHeaterNum)%FanName, &
HPWaterHeater(HPWaterHeaterNum)%FanNum, ErrFlag,cCurrentModuleObject)
IF (ErrFlag) THEN
CALL ShowContinueError('...occurs in unit="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'".')
ErrorsFound=.TRUE.
ENDIF
ErrFlag=.false.
CALL GetFanType(HPWaterHeater(HPWaterHeaterNum)%FanName,HPWaterHeater(HPWaterHeaterNum)%FanType_Num,ErrFlag, &
cCurrentModuleObject,HPWaterHeater(HPWaterHeaterNum)%Name)
IF(ErrFlag)THEN
ErrorsFound=.TRUE.
ELSE
IF(HPWaterHeater(HPWaterHeaterNum)%FanType_Num .NE. FanType_SimpleOnOff)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' illegal fan type specified.')
CALL ShowContinueError('Occurs in unit="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'".')
CALL ShowContinueError(' The fan object ('//TRIM(HPWaterHeater(HPWaterHeaterNum)%FanName)// &
') type must be Fan:OnOff when used with a heat pump water heater')
ErrorsFound = .TRUE.
ELSE
IF(.NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%FanType,'Fan:OnOff'))THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//' illegal fan type = '// &
TRIM(HPWaterHeater(HPWaterHeaterNum)%FanType))
CALL ShowContinueError('Occurs in unit = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name))
CALL ShowContinueError(' The fan object ('//TRIM(HPWaterHeater(HPWaterHeaterNum)%FanName)// &
') is actually the correct fan type and the simulation continues.')
CALL ShowContinueError(' Node connection errors will result due to the inconsistent fan type.')
END IF
END IF
END IF
CALL GetFanVolFlow(HPWaterHeater(HPWaterHeaterNum)%FanNum,FanVolFlow)
IF(FanVolFlow .NE. AutoSize .AND. .NOT. ErrFlag)THEN
IF(FanVolFlow .LT. HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' - air flow rate = '//TRIM(TrimSigDigits(FanVolFlow,7))// &
' in fan object '//TRIM(HPWaterHeater(HPWaterHeaterNum)%FanName)// &
' is less than the HPWHs evaporator air flow rate.')
CALL ShowContinueError(' The fan flow rate must be >= to the HPWHs evaporator volumetric air flow rate.')
CALL ShowContinueError(' Occurs in unit = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name))
ErrorsFound = .TRUE.
END IF
END IF
IF(SameString(cAlphaArgs(24),'BlowThrough')) THEN
HPWaterHeater(HPWaterHeaterNum)%FanPlacement = BlowThru
ELSEIF(SameString(cAlphaArgs(24),'DrawThrough')) THEN
HPWaterHeater(HPWaterHeaterNum)%FanPlacement = DrawThru
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", invalid ')
CALL ShowContinueError(trim(cAlphaFieldNames(24))//'="'//TRIM(cAlphaArgs(24))//'".')
ErrorsFound = .TRUE.
END IF
IF(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum .GT. 0)THEN
! get HPWH capacity, air inlet node, and PLF curve info from DX coil object
HPWaterHeater(HPWaterHeaterNum)%Capacity = DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%RatedTotCap2
HPWaterHeater(HPWaterHeaterNum)%DXCoilAirInletNode = DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%AirInNode
HPWaterHeater(HPWaterHeaterNum)%DXCoilPLFFPLR = DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%PLFFPLR(1)
! check the range of condenser pump power to be <= 5 gpm/ton
IF(DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%HPWHCondPumpElecNomPower/ &
DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%RatedTotCap2 .GT. 0.1422d0)THEN
CALL ShowWarningError(TRIM(DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%DXCoilType)// &
'= '//TRIM(DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%Name)//&
': Rated condenser pump power per watt of rated heating capacity has exceeded the recommended'// &
' maximum of 0.1422 W/W (41.67 watt/MBH). Condenser pump power per watt = ' &
//TRIM(TrimSigDigits((DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%HPWHCondPumpElecNomPower/ &
DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%RatedTotCap2),4)))
END IF
END IF
IF (HPWaterHeater(HPWaterHeaterNum)%OperatingWaterFlowRate == AutoCalculate) THEN
HPWaterHeater(HPWaterHeaterNum)%OperatingWaterFlowRate = 0.00000004487d0 * HPWaterHeater(HPWaterHeaterNum)%Capacity
HPWaterHeater(HPWaterHeaterNum)%WaterFlowRateAutosized = .TRUE.
END IF
IF (HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate == AutoCalculate) THEN
HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate = 0.00005035d0 * HPWaterHeater(HPWaterHeaterNum)%Capacity
HPWaterHeater(HPWaterHeaterNum)%AirFlowRateAutosized = .TRUE.
END IF
HPWaterHeater(HPWaterHeaterNum)%OnCycParaLoad = rNumericArgs(5)
IF(HPWaterHeater(HPWaterHeaterNum)%OnCycParaLoad .LT. 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'",')
CALL ShowContinueError(trim(cNumericFieldNames(5))//' must be >= 0. '//trim(cNumericFieldNames(5))//' = ' &
//TRIM(TrimSigDigits(rNumericArgs(5),2)))
ErrorsFound=.TRUE.
END IF
HPWaterHeater(HPWaterHeaterNum)%OffCycParaLoad = rNumericArgs(6)
IF(HPWaterHeater(HPWaterHeaterNum)%OffCycParaLoad .LT. 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'",')
CALL ShowContinueError(trim(cNumericFieldNames(6))//' must be >= 0. '//trim(cNumericFieldNames(6))//' = ' &
//TRIM(TrimSigDigits(rNumericArgs(6),2)))
ErrorsFound=.TRUE.
END IF
IF(SameString(cAlphaArgs(25),'Zone'))THEN
HPWaterHeater(HPWaterHeaterNum)%ParasiticTempIndicator = AmbientTempZone
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempOutsideAir .OR. &
HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempSchedule)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'",')
CALL ShowContinueError(trim(cAlphaFieldNames(25))//' must be ZoneAirOnly or ZoneAndOutdoorAir')
CALL ShowContinueError(' when parasitic heat rejection location equals Zone.')
ErrorsFound = .TRUE.
END IF
ELSEIF(SameString(cAlphaArgs(25),'Outdoors'))THEN
HPWaterHeater(HPWaterHeaterNum)%ParasiticTempIndicator = AmbientTempOutsideAir
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
CALL ShowContinueError(' parasitic heat rejection location must be either Zone or Outdoors.')
ErrorsFound = .TRUE.
END IF
! get mixer/splitter nodes only when Inlet Air Configuration is ZoneAndOutdoorAir
IF (.not. lAlphaFieldBlanks(26)) THEN
! For the inlet air mixer node, NodeConnectionType is outlet from the HPWH inlet air node
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA)THEN
HPWaterHeater(HPWaterHeaterNum)%InletAirMixerNode = &
GetOnlySingleNode(cAlphaArgs(26),ErrorsFound,'WaterHeater:HeatPump inlet air mixer',cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent)
ELSE
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
CALL ShowContinueError('Inlet air mixer node name specified but only required '// &
'when Inlet Air Configuration is selected'// &
' as Zone and OutdoorAir. Node name disregarded and simulation continues.')
END IF
ELSEIF(lAlphaFieldBlanks(26).AND. HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
CALL ShowContinueError('Inlet air mixer node name required '// &
'when Inlet Air Configuration is selected as ZoneAndOutdoorAir.')
ErrorsFound = .TRUE.
END IF
IF (.not. lAlphaFieldBlanks(27)) THEN
! For the outlet air splitter node, NodeConnectionType is inlet to the HPWH outlet air node
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA)THEN
HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterNode = &
GetOnlySingleNode(cAlphaArgs(27),ErrorsFound,TRIM(cCurrentModuleObject)//'-OUTLET AIR SPLITTER',cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)
ELSE
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
CALL ShowContinueError('Outlet air splitter node name specified but only required when '// &
'Inlet Air Configuration is selected'// &
' as ZoneAndOutdoorAir. Node name disregarded and simulation continues.')
END IF
ELSEIF(lAlphaFieldBlanks(27) .AND. HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
CALL ShowContinueError('Outlet air splitter node name required when '// &
'Inlet Air Configuration is selected as ZoneAndOutdoorAir.')
ErrorsFound = .TRUE.
END IF
! get node data for HPWH
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirMixerNode /= 0) THEN
! when mixer/splitter nodes are used the HPWH's inlet/outlet node are set up as ObjectIsNotParent
HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirInletNode = &
GetOnlySingleNode(cAlphaArgs(7),ErrorsFound,TRIM(cCurrentModuleObject)//'-INLET AIR MIXER',cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)
HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirOutletNode = &
GetOnlySingleNode(cAlphaArgs(8),ErrorsFound,TRIM(cCurrentModuleObject)//'-OUTLET AIR SPLITTER',cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent)
HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode = &
GetOnlySingleNode(cAlphaArgs(9),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_OutsideAirReference,1,ObjectIsParent)
IF (cAlphaArgs(9) /= ' ') THEN
Call CheckAndAddAirNodeNumber(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode,Okay)
IF (.not. Okay) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
'": Adding outdoor air node='//TRIM(cAlphaArgs(9)))
ENDIF
ENDIF
HPWaterHeater(HPWaterHeaterNum)%ExhaustAirNode = &
GetOnlySingleNode(cAlphaArgs(10),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_ReliefAir,1,ObjectIsParent)
ELSE
! when mixer/splitter nodes are NOT used the HPWH's inlet/outlet nodes are set up as ObjectIsParent
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempSchedule)THEN
! for scheduled HPWH's the inlet node is not on any branch or parent object, make it an outlet node
! to avoid node connection errors
HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirInletNode = &
GetOnlySingleNode(cAlphaArgs(7),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsParent)
HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirOutletNode = &
GetOnlySingleNode(cAlphaArgs(8),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsParent)
ELSE ! HPWH is connected to a zone with no mixer/splitter nodes
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZone)THEN
HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirInletNode = &
GetOnlySingleNode(cAlphaArgs(7),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsParent)
HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirOutletNode = &
GetOnlySingleNode(cAlphaArgs(8),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsParent)
ELSE ! HPWH is located outdoors
HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode = &
GetOnlySingleNode(cAlphaArgs(9),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_OutsideAirReference,1,ObjectIsParent)
IF (.not. lAlphaFieldBlanks(9)) THEN
CALL CheckAndAddAirNodeNumber(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode,Okay)
IF (.not. Okay) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
'": Adding outdoor air node ='//TRIM(cAlphaArgs(9)))
ENDIF
ENDIF
HPWaterHeater(HPWaterHeaterNum)%ExhaustAirNode = &
GetOnlySingleNode(cAlphaArgs(10),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Air,NodeConnectionType_ReliefAir,1,ObjectIsParent)
END IF
END IF
END IF
! check that the HPWH inlet and outlet nodes are in the same zone (ZoneHVAC:EquipmentConnections) when
! Inlet Air Configuration is Zone Air Only or Zone and Outdoor Air
IF((HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZone .OR. &
HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA) .AND. &
HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone .GT. 0)THEN
IF (.not. ZoneEquipInputsFilled) THEN
CALL GetZoneEquipmentData
ZoneEquipInputsFilled=.true.
ENDIF
IF(ALLOCATED(ZoneEquipConfig))THEN
FoundInletNode = .FALSE.
FoundOutletNode = .FALSE.
DO ZoneNum = 1, NumOfZones
IF(HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone .EQ. ZoneEquipConfig(ZoneNum)%ActualZoneNum)EXIT
END DO
IF(ZoneNum .LE. NumOfZones)THEN
DO SupAirIn = 1,ZoneEquipConfig(ZoneNum)%NumInletNodes
IF(HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirOutletNode .NE. ZoneEquipConfig(ZoneNum)%InletNode(SupAirIn))CYCLE
FoundOutletNode = .TRUE.
END DO
DO ExhAirOut = 1,ZoneEquipConfig(ZoneNum)%NumExhaustNodes
IF(HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirInletNode .NE. ZoneEquipConfig(ZoneNum)%ExhaustNode(ExhAirOut))CYCLE
FoundInletNode = .TRUE.
END DO
IF(.NOT. FoundInletNode)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
CALL ShowContinueError('The HPWH''s air inlet node name = '//TRIM(cAlphaArgs(7))//' was not properly specified ')
CALL ShowContinueError('as an exhaust air node for zone = '//TRIM(cAlphaArgs(13))//' in a '// &
'ZoneHVAC:EquipmentConnections object.')
ErrorsFound = .TRUE.
END IF
IF(.NOT. FoundOutletNode)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
CALL ShowContinueError('The HPWH''s air outlet node name = '//TRIM(cAlphaArgs(8))//' was not properly specified ')
CALL ShowContinueError('as an inlet air node for zone = '//TRIM(cAlphaArgs(13))//' in a '// &
'ZoneHVAC:EquipmentConnections object.')
ErrorsFound = .TRUE.
END IF
END IF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
CALL ShowContinueError('Heat pump water heater air inlet node name and air outlet node name must be'// &
' listed in a ZoneHVAC:EquipmentConnections object when Inlet Air Configuration'// &
' is equal to ZoneAirOnly or ZoneAndOutdoorAir.')
ErrorsFound = .TRUE.
END IF
END IF
! only get the inlet air mixer schedule if the inlet air configuration is zone and outdoor air
IF (.not. lAlphaFieldBlanks(28) .AND. HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA) THEN
HPWaterHeater(HPWaterHeaterNum)%InletAirMixerSchPtr = GetScheduleIndex(cAlphaArgs(28))
IF (HPWaterHeater(HPWaterHeaterNum)%InletAirMixerSchPtr .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
CALL ShowContinueError(trim(cAlphaFieldNames(28))//'="'//TRIM(cAlphaArgs(28))//'",')
ErrorsFound = .TRUE.
ELSE
! check schedule values to be between 0 and 1
ValidScheduleValue=CheckScheduleValueMinMax(HPWaterHeater(HPWaterHeaterNum)%InletAirMixerSchPtr,'>=',0.0d0, '<=',1.0d0)
IF (.not. ValidScheduleValue) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
CALL ShowContinueError(trim(cAlphaFieldNames(28))//' values out of range of 0 to 1, Schedule="'// &
TRIM(cAlphaArgs(28))//'".')
ErrorsFound=.TRUE.
ENDIF
! set outlet air splitter schedule index equal to inlet air mixer schedule index
! (place holder for when zone pressurization/depressurization is allowed and different schedules can be used)
HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterSchPtr = GetScheduleIndex(cAlphaArgs(28))
END IF
END IF
! set fan outlet node variable for use in setting Node(FanOutletNode)%MassFlowRateMax for fan object
IF(HPWaterHeater(HPWaterHeaterNum)%FanPlacement .EQ. DrawThru)THEN
IF(HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterNode .NE. 0) THEN
HPWaterHeater(HPWaterHeaterNum)%FanOutletNode = HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterNode
ELSE
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempOutsideAir)THEN
HPWaterHeater(HPWaterHeaterNum)%FanOutletNode = HPWaterHeater(HPWaterHeaterNum)%ExhaustAirNode
ELSE
HPWaterHeater(HPWaterHeaterNum)%FanOutletNode = HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirOutletNode
END IF
END IF
ELSEIF(HPWaterHeater(HPWaterHeaterNum)%FanPlacement .EQ. BlowThru) THEN
! set fan outlet node variable for use in setting Node(FanOutletNode)%MassFlowRateMax for fan object
HPWaterHeater(HPWaterHeaterNum)%FanOutletNode = DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%AirInNode
END IF
! set the max mass flow rate for outdoor fans
Node(HPWaterHeater(HPWaterHeaterNum)%FanOutletNode)%MassFlowRateMax = &
HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate * &
PsyRhoAirFnPbTdbW(OutBaroPress,20.0d0, 0.0d0)
IF(HPWaterHeater(HPWaterHeaterNum)%FanPlacement .EQ. BlowThru)THEN
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirMixerNode .GT. 0)THEN
! cAlphaArgs(26) = Inlet Air Mixer Node
FanInletNode = cAlphaArgs(26)
FanOutletNode = 'UNDEFINED'
ELSE
IF(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode .EQ. 0)THEN
! cAlphaArgs(7) = Heat Pump Air Inlet Node
FanInletNode = cAlphaArgs(7)
FanOutletNode = 'UNDEFINED'
ELSE
! cAlphaArgs(9) = Outside Air Node
FanInletNode = cAlphaArgs(9)
FanOutletNode = 'UNDEFINED'
END IF
END IF
IF(HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterNode .GT. 0)THEN
! cAlphaArgs(27) = Outlet Air Splitter Node
CoilInletNode = 'UNDEFINED'
CoilOutletNode = cAlphaArgs(27)
ELSE
IF(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode .EQ. 0)THEN
! cAlphaArgs(8) = Heat Pump Air Outlet Node
CoilInletNode = 'UNDEFINED'
CoilOutletNode = cAlphaArgs(8)
ELSE
CoilInletNode = 'UNDEFINED'
! cAlphaArgs(10) = Exhaust Air Node
CoilOutletNode = cAlphaArgs(10)
END IF
END IF
ELSE
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirMixerNode .GT. 0)THEN
CoilInletNode = cAlphaArgs(26)
CoilOutletNode = 'UNDEFINED'
ELSE
IF(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode .EQ. 0)THEN
CoilInletNode = cAlphaArgs(7)
CoilOutletNode = 'UNDEFINED'
ELSE
CoilInletNode = cAlphaArgs(9)
CoilOutletNode = 'UNDEFINED'
END IF
END IF
IF(HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterNode .GT. 0)THEN
FanInletNode = 'UNDEFINED'
FanOutletNode = cAlphaArgs(27)
ELSE
IF(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode .EQ. 0)THEN
FanInletNode = 'UNDEFINED'
FanOutletNode = cAlphaArgs(8)
ELSE
FanInletNode = 'UNDEFINED'
FanOutletNode = cAlphaArgs(10)
END IF
END IF
END IF
! set up comp set for air side nodes (can be blow thru or draw thru, may or may not have damper nodes)
CALL SetUpCompSets(HPWaterHeater(HPWaterHeaterNum)%Type, &
HPWaterHeater(HPWaterHeaterNum)%Name, &
HPWaterHeater(HPWaterHeaterNum)%DXCoilType, &
HPWaterHeater(HPWaterHeaterNum)%DXCoilName, &
CoilInletNode,CoilOutletNode)
CALL SetUpCompSets(HPWaterHeater(HPWaterHeaterNum)%Type, &
HPWaterHeater(HPWaterHeaterNum)%Name, &
HPWaterHeater(HPWaterHeaterNum)%FanType, &
HPWaterHeater(HPWaterHeaterNum)%FanName, &
FanInletNode,FanOutletNode)
IF (.not. lAlphaFieldBlanks(29)) THEN
SELECT CASE (cAlphaArgs(29))
CASE ('HEATER1')
HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = Heater1HPWHControl
CASE ('HEATER2')
HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = Heater2HPWHControl
CASE ('SOURCEINLET')
HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = SourceInletHPWHControl
CASE ('SOURCEOUTLET')
HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = SourceOutletHPWHControl
CASE ('USEINLET')
HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = UseInletHPWHControl
CASE ('USEOUTLET')
HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = UseOutletHPWHControl
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", invalid ')
CALL ShowContinueError(trim(cAlphaFieldNames(29))//'="'//TRIM(cAlphaArgs(29))//'".')
ErrorsFound=.TRUE.
END SELECT
ENDIF
END DO ! DO HPWaterHeaterNum = 1, NumHeatPumpWaterHeater
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)// &
' input. Preceding condition causes termination.')
END IF
END IF !IF (NumHeatPumpWaterHeater > 0) THEN
!!!======= Get WATER HEATER:MIXED ===================================================================================
IF (NumWaterHeaterMixed > 0) THEN
cCurrentModuleObject = cMixedWHModuleObj
DO WaterThermalTankNum = 1, NumWaterHeaterMixed
CALL GetObjectItem(cCurrentModuleObject,WaterThermalTankNum, &
cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK = .FALSE.
IsBlank = .FALSE.
CALL VerifyName(cAlphaArgs(1),WaterThermalTank%Name,WaterThermalTankNum-1,IsNotOK,IsBlank, &
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
END IF
WaterThermalTank(WaterThermalTankNum)%Name = cAlphaArgs(1)
WaterThermalTank(WaterThermalTankNum)%Type = cCurrentModuleObject
WaterThermalTank(WaterThermalTankNum)%TypeNum = MixedWaterHeater
! default to always on
WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn
! A user field will be added in a later release
WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName = 'Water Heater'
WaterThermalTank(WaterThermalTankNum)%Volume = rNumericArgs(1)
IF (rNumericArgs(1) == 0.0d0) THEN
! Set volume to a really small number to simulate a tankless/instantaneous water heater
WaterThermalTank(WaterThermalTankNum)%Volume = 0.000001d0 ! = 1 cm3
END IF
WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(2))
IF (lAlphaFieldBlanks(2)) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", missing data.')
CALL ShowContinueError('blank field, missing '//TRIM(cAlphaFieldNames(2))//' is required')
ErrorsFound = .TRUE.
ELSEIF (WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': '//trim(cAlphaFieldNames(2))//' not found = '//TRIM(cAlphaArgs(2)))
ErrorsFound = .TRUE.
END IF
IF (rNumericArgs(2) > 0.0001d0) THEN
WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = rNumericArgs(2)
ELSE
! Default to very small number (however it can't be TINY or it will break the algorithm)
WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = 0.5d0
END IF
IF (rNumericArgs(3) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%TankTempLimit = rNumericArgs(3)
ELSE
! Default to very large number
! BG comment why a large number here why not boilng point of water?
WaterThermalTank(WaterThermalTankNum)%TankTempLimit = 100.0d0 !1.0E9
END IF
WaterThermalTank(WaterThermalTankNum)%MaxCapacity = rNumericArgs(4)
IF ((rNumericArgs(5) > WaterThermalTank(WaterThermalTankNum)%MaxCapacity) &
.AND. (WaterThermalTank(WaterThermalTankNum)%MaxCapacity /= autosize)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Heater Minimum Capacity cannot be greater than Heater Maximum Capacity')
ErrorsFound = .TRUE.
ELSE
WaterThermalTank(WaterThermalTankNum)%MinCapacity = rNumericArgs(5)
END IF
! Validate Heater Control Type
SELECT CASE (cAlphaArgs(3))
CASE ('CYCLE')
WaterThermalTank(WaterThermalTankNum)%ControlType = ControlTypeCycle
WaterThermalTank(WaterThermalTankNum)%MinCapacity = WaterThermalTank(WaterThermalTankNum)%MaxCapacity
CASE ('MODULATE')
WaterThermalTank(WaterThermalTankNum)%ControlType = ControlTypeModulate
!CASE ('MODULATE WITH OVERHEAT') ! Not yet implemented
!CASE ('MODULATE WITH UNDERHEAT') ! Not yet implemented
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Control Type entered='//TRIM(cAlphaArgs(3)))
ErrorsFound = .TRUE.
END SELECT
WaterThermalTank(WaterThermalTankNum)%VolFlowRateMin = rNumericArgs(6)
WaterThermalTank(WaterThermalTankNum)%VolFlowRateMin = MAX(0.d0, WaterThermalTank(WaterThermalTankNum)%VolFlowRateMin)
! rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'GetWaterThermalTankInput')
! WaterThermalTank(WaterThermalTankNum)%MassFlowRateMin = rNumericArgs(6) * rho ! Not yet implemented
WaterThermalTank(WaterThermalTankNum)%IgnitionDelay = rNumericArgs(7) ! Not yet implemented
! Validate Heater Fuel Type
SELECT CASE (cAlphaArgs(4))
CASE ('ELECTRICITY','ELECTRIC','ELEC')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'
CASE ('GAS','NATURALGAS','NATURAL GAS')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Gas'
CASE ('DIESEL')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Diesel'
CASE ('GASOLINE')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Gasoline'
CASE ('COAL')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Coal'
CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'FuelOil#1'
CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'FuelOil#2'
CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Propane'
CASE ('OTHERFUEL1')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'OtherFuel1'
CASE ('OTHERFUEL2')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'OtherFuel2'
CASE ('STEAM')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Steam'
CASE ('DISTRICTHEATING')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'DistrictHeating'
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Heater Fuel Type entered='//TRIM(cAlphaArgs(4)))
! Set to Electric to avoid errors when setting up output variables
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'
ErrorsFound = .TRUE.
END SELECT
IF (rNumericArgs(8) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%Efficiency = rNumericArgs(8)
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Heater Thermal Efficiency must be greater than zero')
ErrorsFound = .TRUE.
END IF
IF (cAlphaArgs(5) /= Blank) THEN
WaterThermalTank(WaterThermalTankNum)%PLFCurve = GetCurveIndex(cAlphaArgs(5))
IF (WaterThermalTank(WaterThermalTankNum)%PLFCurve .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Part Load Factor curve not found = '//TRIM(cAlphaArgs(5)))
ErrorsFound = .TRUE.
ELSE
CALL ValidatePLFCurve(WaterThermalTank(WaterThermalTankNum)%PLFCurve, IsValid)
IF (.NOT. IsValid) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Part Load Factor curve failed to evaluate to greater than zero for all numbers in the domain of 0 to 1')
ErrorsFound = .TRUE.
END IF
END IF
END IF
WaterThermalTank(WaterThermalTankNum)%OffCycParaLoad = rNumericArgs(9)
! Validate Off-Cycle Parasitic Fuel Type
SELECT CASE (cAlphaArgs(6))
CASE ('') ! If blank, default to Fuel Type for heater
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = WaterThermalTank(WaterThermalTankNum)%FuelType
CASE ('ELECTRICITY','ELECTRIC','ELEC')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'
CASE ('GAS','NATURALGAS','NATURAL GAS')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Gas'
CASE ('DIESEL')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Diesel'
CASE ('GASOLINE')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Gasoline'
CASE ('COAL')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Coal'
CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'FuelOil#1'
CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'FuelOil#2'
CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Propane'
CASE ('OTHERFUEL1')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'OtherFuel1'
CASE ('OTHERFUEL2')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'OtherFuel2'
CASE ('STEAM')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Steam'
CASE ('DISTRICTHEATING')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'DistrictHeating'
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Off-Cycle Parasitic Fuel Type entered='//TRIM(cAlphaArgs(6)))
! Set to Electric to avoid errors when setting up output variables
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'
ErrorsFound = .TRUE.
END SELECT
WaterThermalTank(WaterThermalTankNum)%OffCycParaFracToTank = rNumericArgs(10)
WaterThermalTank(WaterThermalTankNum)%OnCycParaLoad = rNumericArgs(11)
! Validate On-Cycle Parasitic Fuel Type
SELECT CASE (cAlphaArgs(7))
CASE ('') ! If blank, default to Fuel Type for heater
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = WaterThermalTank(WaterThermalTankNum)%FuelType
CASE ('ELECTRICITY','ELECTRIC','ELEC')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'
CASE ('GAS','NATURALGAS','NATURAL GAS')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Gas'
CASE ('DIESEL')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Diesel'
CASE ('GASOLINE')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Gasoline'
CASE ('COAL')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Coal'
CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'FuelOil#1'
CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'FuelOil#2'
CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Propane'
CASE ('OTHERFUEL1')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'OtherFuel1'
CASE ('OTHERFUEL2')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'OtherFuel2'
CASE ('STEAM')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Steam'
CASE ('DISTRICTHEATING')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'DistrictHeating'
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid On-Cycle Parasitic Fuel Type entered='//TRIM(cAlphaArgs(7)))
! Set to Electric to avoid errors when setting up output variables
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'
ErrorsFound = .TRUE.
END SELECT
WaterThermalTank(WaterThermalTankNum)%OnCycParaFracToTank = rNumericArgs(12)
SELECT CASE (cAlphaArgs(8))
CASE ('SCHEDULE')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempSchedule
WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule = GetScheduleIndex(cAlphaArgs(9))
IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Ambient Temperature Schedule not found = '//TRIM(cAlphaArgs(9)))
ErrorsFound = .TRUE.
END IF
CASE ('ZONE')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempZone
WaterThermalTank(WaterThermalTankNum)%AmbientTempZone = FindItemInList(cAlphaArgs(10),Zone%Name,NumOfZones)
IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Ambient Temperature Zone not found = '//TRIM(cAlphaArgs(10)))
ErrorsFound = .TRUE.
END IF
CASE ('OUTDOORS')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempOutsideAir
WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode = GetOnlySingleNode(cAlphaArgs(11), ErrorsFound, &
TRIM(cCurrentModuleObject), cAlphaArgs(1), NodeType_Air, NodeConnectionType_OutsideAirReference, 1, ObjectIsNotParent)
IF (cAlphaArgs(11) /= ' ') THEN
IF (.not. CheckOutAirNodeNumber(WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Outdoor Air Node not on OutdoorAir:NodeList or OutdoorAir:Node')
CALL ShowContinueError('...Referenced Node Name='//TRIM(cAlphaArgs(11)))
ErrorsFound=.true.
ENDIF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('An Ambient Outdoor Air Node name must be used when' // &
' the Ambient Temperature Indicator is Outdoors.')
ErrorsFound = .TRUE.
ENDIF
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Ambient Temperature Indicator entered='//TRIM(cAlphaArgs(8)))
CALL ShowContinueError(' Valid entries are SCHEDULE, ZONE, and OUTDOORS.')
ErrorsFound = .TRUE.
END SELECT
WaterThermalTank(WaterThermalTankNum)%OffCycLossCoeff = rNumericArgs(13)
WaterThermalTank(WaterThermalTankNum)%OffCycLossFracToZone = rNumericArgs(14)
WaterThermalTank(WaterThermalTankNum)%OnCycLossCoeff = rNumericArgs(15)
WaterThermalTank(WaterThermalTankNum)%OnCycLossFracToZone = rNumericArgs(16)
rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'GetWaterThermalTankInput')
WaterThermalTank(WaterThermalTankNum)%MassFlowRateMax = rNumericArgs(17) * rho
IF ((cAlphaArgs(14) == Blank) .AND. (cAlphaArgs(15) == Blank)) THEN
IF (cAlphaArgs(12) /= Blank) THEN
WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule = GetScheduleIndex(cAlphaArgs(12))
IF (WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Flow Rate Schedule not found = '//TRIM(cAlphaArgs(12)))
ErrorsFound = .TRUE.
END IF
END IF
END IF
IF (cAlphaArgs(13) /= Blank) THEN
WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule = GetScheduleIndex(cAlphaArgs(13))
IF (WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Cold Water Supply Temperature Schedule not found = '//TRIM(cAlphaArgs(13)))
ErrorsFound = .TRUE.
END IF
END IF
IF (NumNums > 17) THEN
IF ((rNumericArgs(18) > 1) .OR. (rNumericArgs(18) < 0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use Side Effectiveness is out of bounds (0 to 1)')
ErrorsFound = .TRUE.
END IF
WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = rNumericArgs(18)
ELSE
WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = 1.0d0 ! Default for stand-alone mode
END IF
IF ((rNumericArgs(19) > 1) .OR. (rNumericArgs(19) < 0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Source Side Effectiveness is out of bounds (0 to 1)')
ErrorsFound = .TRUE.
END IF
WaterThermalTank(WaterThermalTankNum)%SourceEffectiveness = rNumericArgs(19)
! If no plant nodes are connected, simulate in stand-alone mode.
IF (cAlphaArgs(14) == Blank .AND. cAlphaArgs(15) == Blank .AND. cAlphaArgs(16) == Blank .AND. cAlphaArgs(17) == Blank) THEN
WaterThermalTank(WaterThermalTankNum)%StandAlone = .TRUE.
ENDIF
IF (.NOT. lNumericFieldBlanks(20)) THEN
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate = rNumericArgs(20)
ELSE
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate = 0.d0
ENDIF
WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide = DemandSupply_No
IF (.NOT. lNumericFieldBlanks(21)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = rNumericArgs(21)
ELSE
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = 0.d0
END IF
WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide = DemandSupply_No
If (.NOT. lNumericFieldBlanks(22)) then
WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime = rNumericArgs(22)
ELSE
WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime = 1.5d0
END IF
IF ((cAlphaArgs(14) /= Blank) .OR. (cAlphaArgs(15) /= Blank)) THEN
WaterThermalTank(WaterThermalTankNum)%UseInletNode = &
GetOnlySingleNode(cAlphaArgs(14),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%InletNodeName1 = cAlphaArgs(14)
WaterThermalTank(WaterThermalTankNum)%UseOutletNode = &
GetOnlySingleNode(cAlphaArgs(15),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName1 = cAlphaArgs(15)
IF (rNumericArgs(17) > 0) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use side nodes are specified; Peak Volumetric Use Flow Rate will not be used')
END IF
IF (WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule > 0) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use side nodes are specified; Use Flow Rate Fraction Schedule will not be used')
END IF
IF (WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule > 0) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use side nodes are specified; Cold Water Supply Temperature Schedule will not be used')
END IF
END IF
IF ((cAlphaArgs(16) /= Blank) .OR. (cAlphaArgs(17) /= Blank)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceInletNode = &
GetOnlySingleNode(cAlphaArgs(16),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 2, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%InletNodeName2 = cAlphaArgs(16)
WaterThermalTank(WaterThermalTankNum)%SourceOutletNode = &
GetOnlySingleNode(cAlphaArgs(17),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 2, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName2 = cAlphaArgs(17)
END IF
IF (.NOT. lAlphaFieldBlanks(18)) THEN
SELECT CASE (cAlphaArgs(18))
CASE ('STORAGETANK' )
WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideStorageTank
CASE ('INDIRECTHEATPRIMARYSETPOINT')
WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatPrimarySetpoint
CASE ('INDIRECTHEATALTERNATESETPOINT' )
WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatAltSetpoint
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Control Mode entered='//TRIM(cAlphaArgs(18)))
ErrorsFound = .TRUE.
END SELECT
ELSE
WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatPrimarySetpoint
ENDIF
IF (.NOT. lAlphaFieldBlanks(19)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceSideAltSetpointSchedNum = GetScheduleIndex(cAlphaArgs(19))
IF (WaterThermalTank(WaterThermalTankNum)%SourceSideAltSetpointSchedNum == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': '//trim(cAlphaFieldNames(19))//' not found = '//TRIM(cAlphaArgs(19)))
ErrorsFound = .TRUE.
ENDIF
ENDIF
END DO ! WaterThermalTankNum
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)// &
' input. Preceding condition causes termination.')
END IF
END IF
!!!======= Get WATER HEATER:STRATIFIED ==============================================================================
IF (NumWaterHeaterStratified > 0) THEN
cCurrentModuleObject = cStratifiedWHModuleObj !'WaterHeater:Stratified'
DO WaterThermalTankNum = NumWaterHeaterMixed + 1, NumWaterHeaterMixed + NumWaterHeaterStratified
CALL GetObjectItem(cCurrentModuleObject,WaterThermalTankNum-NumWaterHeaterMixed, &
cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK = .FALSE.
IsBlank = .FALSE.
CALL VerifyName(cAlphaArgs(1),WaterThermalTank%Name,WaterThermalTankNum-NumWaterHeaterMixed-1,IsNotOK,IsBlank, &
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
END IF
WaterThermalTank(WaterThermalTankNum)%Name = cAlphaArgs(1)
WaterThermalTank(WaterThermalTankNum)%Type = cCurrentModuleObject
WaterThermalTank(WaterThermalTankNum)%TypeNum = StratifiedWaterHeater
! default to always on
WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn
WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName = cAlphaArgs(2)
WaterThermalTank(WaterThermalTankNum)%Volume = rNumericArgs(1)
rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'GetWaterThermalTankInput')
WaterThermalTank(WaterThermalTankNum)%Mass = WaterThermalTank(WaterThermalTankNum)%Volume * rho
WaterThermalTank(WaterThermalTankNum)%Height = rNumericArgs(2)
SELECT CASE (cAlphaArgs(3))
CASE ('VERTICALCYLINDER')
WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeVertCylinder
CASE ('HORIZONTALCYLINDER')
WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeHorizCylinder
CASE ('OTHER')
WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeOther
IF (rNumericArgs(3) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%Perimeter = rNumericArgs(3)
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Tank Perimeter must be greater than zero for Tank Shape=OTHER')
ErrorsFound = .TRUE.
END IF
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Tank Shape entered='//TRIM(cAlphaArgs(3)))
WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeVertCylinder
ErrorsFound = .TRUE.
END SELECT
IF (rNumericArgs(4) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%TankTempLimit = rNumericArgs(4)
ELSE
! Default to very large number
WaterThermalTank(WaterThermalTankNum)%TankTempLimit = 1.0d9
END IF
! Validate Heater Priority Control
SELECT CASE (cAlphaArgs(4))
CASE ('MASTERSLAVE')
WaterThermalTank(WaterThermalTankNum)%ControlType = PriorityMasterSlave
CASE ('SIMULTANEOUS')
WaterThermalTank(WaterThermalTankNum)%ControlType = PrioritySimultaneous
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Heater Priority Control entered='//TRIM(cAlphaArgs(4)))
ErrorsFound = .TRUE.
END SELECT
WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(5))
IF (lAlphaFieldBlanks(5)) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", missing data.')
CALL ShowContinueError('blank field, missing '//TRIM(cAlphaFieldNames(5))//' is required')
ErrorsFound = .TRUE.
ELSEIF (WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': '//trim(cAlphaFieldNames(5))//' not found = '//TRIM(cAlphaArgs(5)))
ErrorsFound = .TRUE.
END IF
IF (rNumericArgs(5) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = rNumericArgs(5)
ELSE
! Default to very small number (however it can't be TINY or it will break the algorithm)
WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = 0.0001d0
END IF
WaterThermalTank(WaterThermalTankNum)%MaxCapacity = rNumericArgs(6)
WaterThermalTank(WaterThermalTankNum)%HeaterHeight1 = rNumericArgs(7)
!Test if Heater height is within range
IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%HeaterHeight1 &
> WaterThermalTank(WaterThermalTankNum)%Height)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Heater 1 is located higher than overall tank height.' )
CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
CALL ShowContinueError( TRIM(cNumericFieldNames(7))//' = '//TRIM(RoundSigDigits(rNumericArgs(7), 4)) )
ErrorsFound = .TRUE.
ENDIF
WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule2 = GetScheduleIndex(cAlphaArgs(6))
IF (lAlphaFieldBlanks(6)) THEN
CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", missing data.')
CALL ShowContinueError('blank field, missing '//TRIM(cAlphaFieldNames(6))//' is required')
ErrorsFound = .TRUE.
ELSEIF (WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule2 .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': '//trim(cAlphaFieldNames(6))//' not found = '//TRIM(cAlphaArgs(6)))
ErrorsFound = .TRUE.
END IF
IF (rNumericArgs(5) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp2 = rNumericArgs(8)
ELSE
! Default to very small number (however it can't be TINY or it will break the algorithm)
WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp2 = 0.0001d0
END IF
WaterThermalTank(WaterThermalTankNum)%MaxCapacity2 = rNumericArgs(9)
WaterThermalTank(WaterThermalTankNum)%HeaterHeight2 = rNumericArgs(10)
!Test if Heater height is within range
IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%HeaterHeight2 &
> WaterThermalTank(WaterThermalTankNum)%Height)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Heater 2 is located higher than overall tank height.' )
CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
CALL ShowContinueError( TRIM(cNumericFieldNames(10))//' = '//TRIM(RoundSigDigits(rNumericArgs(10), 4)) )
ErrorsFound = .TRUE.
ENDIF
! Validate Heater Fuel Type
SELECT CASE (cAlphaArgs(7))
CASE ('ELECTRICITY','ELECTRIC','ELEC')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'
CASE ('GAS','NATURALGAS','NATURAL GAS')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Gas'
CASE ('DIESEL')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Diesel'
CASE ('GASOLINE')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Gasoline'
CASE ('COAL')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Coal'
CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'FuelOil#1'
CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'FuelOil#2'
CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Propane'
CASE ('OTHERFUEL1')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'OtherFuel1'
CASE ('OTHERFUEL2')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'OtherFuel2'
CASE ('STEAM')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Steam'
CASE ('DISTRICTHEATING')
WaterThermalTank(WaterThermalTankNum)%FuelType = 'DistrictHeating'
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Heater Fuel Type entered='//TRIM(cAlphaArgs(7)))
! Set to Electric to avoid errors when setting up output variables
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'
ErrorsFound = .TRUE.
END SELECT
IF (rNumericArgs(11) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%Efficiency = rNumericArgs(11)
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Heater Thermal Efficiency must be greater than zero')
ErrorsFound = .TRUE.
END IF
WaterThermalTank(WaterThermalTankNum)%OffCycParaLoad = rNumericArgs(12)
! Validate Off-Cycle Parasitic Fuel Type
SELECT CASE (cAlphaArgs(8))
CASE ('') ! If blank, default to Fuel Type for heater
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = WaterThermalTank(WaterThermalTankNum)%FuelType
CASE ('ELECTRICITY','ELECTRIC','ELEC')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'
CASE ('GAS','NATURALGAS','NATURAL GAS')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Gas'
CASE ('DIESEL')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Diesel'
CASE ('GASOLINE')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Gasoline'
CASE ('COAL')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Coal'
CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'FuelOil#1'
CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'FuelOil#2'
CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Propane'
CASE ('OTHERFUEL1')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'OtherFuel1'
CASE ('OTHERFUEL2')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'OtherFuel2'
CASE ('STEAM')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Steam'
CASE ('DISTRICTHEATING')
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'DistrictHeating'
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Off-Cycle Parasitic Fuel Type entered='//TRIM(cAlphaArgs(8)))
! Set to Electric to avoid errors when setting up output variables
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'
ErrorsFound = .TRUE.
END SELECT
WaterThermalTank(WaterThermalTankNum)%OffCycParaFracToTank = rNumericArgs(13)
WaterThermalTank(WaterThermalTankNum)%OffCycParaHeight = rNumericArgs(14)
WaterThermalTank(WaterThermalTankNum)%OnCycParaLoad = rNumericArgs(15)
! Validate On-Cycle Parasitic Fuel Type
SELECT CASE (cAlphaArgs(9))
CASE ('') ! If blank, default to Fuel Type for heater
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = WaterThermalTank(WaterThermalTankNum)%FuelType
CASE ('ELECTRICITY','ELECTRIC','ELEC')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'
CASE ('GAS','NATURALGAS','NATURAL GAS')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Gas'
CASE ('DIESEL')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Diesel'
CASE ('GASOLINE')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Gasoline'
CASE ('COAL')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Coal'
CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'FuelOil#1'
CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'FuelOil#2'
CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Propane'
CASE ('OTHERFUEL1')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'OtherFuel1'
CASE ('OTHERFUEL2')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'OtherFuel2'
CASE ('STEAM')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Steam'
CASE ('DISTRICTHEATING')
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'DistrictHeating'
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid On-Cycle Parasitic Fuel Type entered='//TRIM(cAlphaArgs(9)))
! Set to Electric to avoid errors when setting up output variables
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'
ErrorsFound = .TRUE.
END SELECT
WaterThermalTank(WaterThermalTankNum)%OnCycParaFracToTank = rNumericArgs(16)
WaterThermalTank(WaterThermalTankNum)%OnCycParaHeight = rNumericArgs(17)
SELECT CASE (cAlphaArgs(10))
CASE ('SCHEDULE')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempSchedule
WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule = GetScheduleIndex(cAlphaArgs(11))
IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Ambient Temperature Schedule not found = '//TRIM(cAlphaArgs(11)))
ErrorsFound = .TRUE.
END IF
CASE ('ZONE')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempZone
WaterThermalTank(WaterThermalTankNum)%AmbientTempZone = FindItemInList(cAlphaArgs(12),Zone%Name,NumOfZones)
IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Ambient Temperature Zone not found = '//TRIM(cAlphaArgs(12)))
ErrorsFound = .TRUE.
END IF
CASE ('OUTDOORS')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempOutsideAir
WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode = GetOnlySingleNode(cAlphaArgs(13), ErrorsFound, &
TRIM(cCurrentModuleObject), cAlphaArgs(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent)
IF (cAlphaArgs(13) /= ' ') THEN
IF (.not. CheckOutAirNodeNumber(WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Outdoor Air Node not on OutdoorAir:NodeList or OutdoorAir:Node')
CALL ShowContinueError('...Referenced Node Name='//TRIM(cAlphaArgs(13)))
ErrorsFound=.true.
ENDIF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('An Ambient Outdoor Air Node name must be used when' // &
' the Ambient Temperature Indicator is Outdoors.')
ErrorsFound = .TRUE.
ENDIF
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Ambient Temperature Indicator entered='//TRIM(cAlphaArgs(10)))
CALL ShowContinueError(' Valid entries are Schedule, Zone, and Outdoors.')
ErrorsFound = .TRUE.
END SELECT
WaterThermalTank(WaterThermalTankNum)%SkinLossCoeff = rNumericArgs(18)
WaterThermalTank(WaterThermalTankNum)%SkinLossFracToZone = rNumericArgs(19)
WaterThermalTank(WaterThermalTankNum)%OffCycFlueLossCoeff = rNumericArgs(20)
WaterThermalTank(WaterThermalTankNum)%OffCycFlueLossFracToZone = rNumericArgs(21)
!this is temporary until we know fluid type
rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'GetWaterThermalTankInput')
WaterThermalTank(WaterThermalTankNum)%MassFlowRateMax = rNumericArgs(22) * rho
IF ((cAlphaArgs(16) == Blank) .AND. (cAlphaArgs(17) == Blank)) THEN
IF (cAlphaArgs(14) /= Blank) THEN
WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule = GetScheduleIndex(cAlphaArgs(14))
IF (WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Flow Rate Schedule not found = '//TRIM(cAlphaArgs(14)))
ErrorsFound = .TRUE.
END IF
END IF
END IF
IF (cAlphaArgs(15) /= Blank) THEN
WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule = GetScheduleIndex(cAlphaArgs(15))
IF (WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule .EQ. 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Cold Water Supply Temperature Schedule not found = '//TRIM(cAlphaArgs(15)))
ErrorsFound = .TRUE.
END IF
END IF
IF (NumNums > 22) THEN
WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = rNumericArgs(23)
ELSE
WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = 1.0d0 ! Default for stand-alone mode
END IF
IF (NumNums > 23) THEN
WaterThermalTank(WaterThermalTankNum)%UseInletHeight = rNumericArgs(24)
ELSE
! Defaults to bottom of tank
WaterThermalTank(WaterThermalTankNum)%UseInletHeight = 0.0d0
END IF
IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%UseInletHeight &
> WaterThermalTank(WaterThermalTankNum)%Height)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use inlet is located higher than overall tank height.' )
CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
CALL ShowContinueError( TRIM(cNumericFieldNames(24))//' = '//TRIM(RoundSigDigits(rNumericArgs(24), 4)) )
ErrorsFound = .TRUE.
ENDIF
IF ((NumNums > 24) .AND. (rNumericArgs(25) /= Autocalculate)) THEN
WaterThermalTank(WaterThermalTankNum)%UseOutletHeight = rNumericArgs(25)
ELSE
! Defaults to top of tank
WaterThermalTank(WaterThermalTankNum)%UseOutletHeight = WaterThermalTank(WaterThermalTankNum)%Height
END IF
IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%UseOutletHeight &
> WaterThermalTank(WaterThermalTankNum)%Height)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use outlet is located higher than overall tank height.' )
CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
CALL ShowContinueError( TRIM(cNumericFieldNames(25))//' = '//TRIM(RoundSigDigits(rNumericArgs(25), 4)) )
ErrorsFound = .TRUE.
ENDIF
IF (NumNums > 25) THEN
WaterThermalTank(WaterThermalTankNum)%SourceEffectiveness = rNumericArgs(26)
ELSE
WaterThermalTank(WaterThermalTankNum)%SourceEffectiveness = 1.0D0
END IF
IF ((NumNums > 26) .AND. (rNumericArgs(27) /= Autocalculate)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceInletHeight = rNumericArgs(27)
ELSE
! Defaults to top of tank
WaterThermalTank(WaterThermalTankNum)%SourceInletHeight = WaterThermalTank(WaterThermalTankNum)%Height
END IF
IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%SourceInletHeight &
> WaterThermalTank(WaterThermalTankNum)%Height)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Source inlet is located higher than overall tank height.' )
CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
CALL ShowContinueError( TRIM(cNumericFieldNames(27))//' = '//TRIM(RoundSigDigits(rNumericArgs(27), 4)) )
ErrorsFound = .TRUE.
ENDIF
IF ((NumNums > 27) .AND. (rNumericArgs(28) /= Autocalculate)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight = rNumericArgs(28)
ELSE
! Defaults to bottom of tank
WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight = 0.0D0
END IF
IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight &
> WaterThermalTank(WaterThermalTankNum)%Height)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Source outlet is located higher than overall tank height.' )
CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
CALL ShowContinueError( TRIM(cNumericFieldNames(28))//' = '//TRIM(RoundSigDigits(rNumericArgs(28), 4)) )
ErrorsFound = .TRUE.
ENDIF
! If no plant nodes are connected, simulate in stand-alone mode.
IF (cAlphaArgs(16) == Blank .AND. cAlphaArgs(17) == Blank .AND. cAlphaArgs(18) == Blank .AND. cAlphaArgs(19) == Blank) &
WaterThermalTank(WaterThermalTankNum)%StandAlone = .TRUE.
IF (.NOT. lNumericFieldBlanks(29)) THEN
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate = rNumericArgs(29)
ELSE
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate = 0.d0
END IF
WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide = DemandSupply_No
IF (.NOT. lNumericFieldBlanks(30) ) THEN
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = rNumericArgs(30)
ELSE
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = 0.d0
END IF
If (NumNums > 30) then
WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime = rNumericArgs(31)
ELSE
WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime = 1.5d0
END IF
WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide = DemandSupply_No
IF ((cAlphaArgs(16) /= Blank) .OR. (cAlphaArgs(17) /= Blank)) THEN
WaterThermalTank(WaterThermalTankNum)%UseInletNode = &
GetOnlySingleNode(cAlphaArgs(16),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%InletNodeName1 = cAlphaArgs(16)
WaterThermalTank(WaterThermalTankNum)%UseOutletNode = &
GetOnlySingleNode(cAlphaArgs(17),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName1 = cAlphaArgs(17)
IF (rNumericArgs(22) > 0) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use side nodes are specified; Peak Volumetric Use Flow Rate will not be used')
END IF
IF (WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule > 0) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use side nodes are specified; Use Flow Rate Fraction Schedule will not be used')
END IF
IF (WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule > 0) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use side nodes are specified; Cold Water Supply Temperature Schedule will not be used')
END IF
END IF
IF ((cAlphaArgs(18) /= Blank) .OR. (cAlphaArgs(19) /= Blank)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceInletNode = &
GetOnlySingleNode(cAlphaArgs(18),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 2, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%InletNodeName2 = cAlphaArgs(18)
WaterThermalTank(WaterThermalTankNum)%SourceOutletNode = &
GetOnlySingleNode(cAlphaArgs(19),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 2, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName2 = cAlphaArgs(19)
END IF
! Validate inlet mode
SELECT CASE (cAlphaArgs(20))
CASE ('FIXED')
WaterThermalTank(WaterThermalTankNum)%InletMode = InletModeFixed
CASE ('SEEKING')
WaterThermalTank(WaterThermalTankNum)%InletMode = InletModeSeeking
END SELECT
WaterThermalTank(WaterThermalTankNum)%Nodes = rNumericArgs(32)
WaterThermalTank(WaterThermalTankNum)%AdditionalCond = rNumericArgs(33)
ALLOCATE(WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff(WaterThermalTank(WaterThermalTankNum)%Nodes))
WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff = 0.0d0
DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
IF (NumNums > 32 + NodeNum) THEN
WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff(NodeNum) = rNumericArgs(33 + NodeNum)
ELSE
EXIT
END IF
END DO
IF (NumNums > 33 + WaterThermalTank(WaterThermalTankNum)%Nodes) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': More Additional Loss Coefficients were entered than the number of nodes; extra coefficients will not be used')
END IF
CALL SetupStratifiedNodes(WaterThermalTankNum)
IF (.NOT. lAlphaFieldBlanks(21)) THEN
SELECT CASE (cAlphaArgs(21))
CASE ('STORAGETANK' )
WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideStorageTank
CASE ('INDIRECTHEATPRIMARYSETPOINT')
WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatPrimarySetpoint
CASE ('INDIRECTHEATALTERNATESETPOINT' )
WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatAltSetpoint
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Control Mode entered='//TRIM(cAlphaArgs(21)))
ErrorsFound = .TRUE.
END SELECT
ELSE
WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatPrimarySetpoint
ENDIF
IF (.NOT. lAlphaFieldBlanks(22)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceSideAltSetpointSchedNum = GetScheduleIndex(cAlphaArgs(22))
IF (WaterThermalTank(WaterThermalTankNum)%SourceSideAltSetpointSchedNum == 0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': '//trim(cAlphaFieldNames(22))//' not found = '//TRIM(cAlphaArgs(22)))
ErrorsFound = .TRUE.
ENDIF
ENDIF
END DO ! WaterThermalTankNum
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)// &
' input. Preceding condition causes termination.')
END IF
END IF
!!!======= Get Chilled Water :MIXED ===================================================================================
IF (NumChilledWaterMixed > 0) THEN
cCurrentModuleObject = cMixedCWTankModuleObj ! 'ThermalStorage:ChilledWater:Mixed'
DO WaterThermalTankNum = NumWaterHeaterMixed + NumWaterHeaterStratified + 1, &
NumWaterHeaterMixed + NumWaterHeaterStratified + NumChilledWaterMixed
CALL GetObjectItem(cCurrentModuleObject,WaterThermalTankNum - (NumWaterHeaterMixed + NumWaterHeaterStratified), &
cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK = .FALSE.
IsBlank = .FALSE.
CALL VerifyName(cAlphaArgs(1),WaterThermalTank%Name,WaterThermalTankNum-1,&
IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
END IF
WaterThermalTank(WaterThermalTankNum)%Name = cAlphaArgs(1)
WaterThermalTank(WaterThermalTankNum)%Type = cCurrentModuleObject
WaterThermalTank(WaterThermalTankNum)%TypeNum = MixedChilledWaterStorage
WaterThermalTank(WaterThermalTankNum)%IsChilledWaterTank = .TRUE.
WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName = 'Chilled Water Storage'
WaterThermalTank(WaterThermalTankNum)%Volume = rNumericArgs(1)
IF (rNumericArgs(1) == 0.0d0) THEN
! Set volume to a really small number to continue simulation
WaterThermalTank(WaterThermalTankNum)%Volume = 0.000001d0 ! = 1 cm3
END IF
WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(2))
IF (WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule .EQ. 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
ErrorsFound = .TRUE.
END IF
IF (rNumericArgs(2) > 0.0001d0) THEN
WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = rNumericArgs(2)
ELSE
! Default to very small number (however it can't be TINY or it will break the algorithm)
WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = 0.5d0
END IF
IF (rNumericArgs(3) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%TankTempLimit = rNumericArgs(3)
ELSE
! default to just above freezing
WaterThermalTank(WaterThermalTankNum)%TankTempLimit = 1.0D0
END IF
WaterThermalTank(WaterThermalTankNum)%MaxCapacity = rNumericArgs(4)
WaterThermalTank(WaterThermalTankNum)%MinCapacity = 0.0D0
WaterThermalTank(WaterThermalTankNum)%ControlType = ControlTypeCycle
WaterThermalTank(WaterThermalTankNum)%MassFlowRateMin = 0.0D0
WaterThermalTank(WaterThermalTankNum)%IgnitionDelay = 0.0D0
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'
WaterThermalTank(WaterThermalTankNum)%Efficiency = 1.0D0
WaterThermalTank(WaterThermalTankNum)%PLFCurve = 0
WaterThermalTank(WaterThermalTankNum)%OffCycParaLoad = 0.0D0
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'
WaterThermalTank(WaterThermalTankNum)%OffCycParaFracToTank = 0.0D0
WaterThermalTank(WaterThermalTankNum)%OnCycParaLoad = 0.0D0
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'
WaterThermalTank(WaterThermalTankNum)%OnCycParaFracToTank = 0.0D0
SELECT CASE (cAlphaArgs(3))
CASE ('SCHEDULE')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempSchedule
WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule = GetScheduleIndex(cAlphaArgs(4))
IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule .EQ. 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(4))//' = '//TRIM(cAlphaArgs(4)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Schedule was not found.')
ErrorsFound = .TRUE.
END IF
CASE ('ZONE')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempZone
WaterThermalTank(WaterThermalTankNum)%AmbientTempZone = FindItemInList(cAlphaArgs(5),Zone%Name,NumOfZones)
IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone .EQ. 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(5))//' = '//TRIM(cAlphaArgs(5)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Zone was not found.')
ErrorsFound = .TRUE.
END IF
CASE ('OUTDOORS')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempOutsideAir
WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode = GetOnlySingleNode(cAlphaArgs(6), ErrorsFound, &
TRIM(cCurrentModuleObject), cAlphaArgs(1), NodeType_Air, NodeConnectionType_OutsideAirReference, 1, ObjectIsNotParent)
IF (.NOT. lAlphaFieldBlanks(6) ) THEN
IF (.not. CheckOutAirNodeNumber(WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode)) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(6))//' = '//TRIM(cAlphaArgs(6)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Outdoor Air Node not on OutdoorAir:NodeList or OutdoorAir:Node')
ErrorsFound=.true.
ENDIF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('An Ambient Outdoor Air Node name must be used when' // &
' the Ambient Temperature Indicator is Outdoors.')
ErrorsFound = .TRUE.
ENDIF
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Ambient Temperature Indicator entered='//TRIM(cAlphaArgs(3)))
CALL ShowContinueError(' Valid entries are Schedule, Zone, and Outdoors.')
ErrorsFound = .TRUE.
END SELECT
WaterThermalTank(WaterThermalTankNum)%OffCycLossCoeff = rNumericArgs(5)
WaterThermalTank(WaterThermalTankNum)%OffCycLossFracToZone = 1.0D0
WaterThermalTank(WaterThermalTankNum)%OnCycLossCoeff = rNumericArgs(5)
WaterThermalTank(WaterThermalTankNum)%OnCycLossFracToZone =1.0D0
WaterThermalTank(WaterThermalTankNum)%MassFlowRateMax = 0.0D0
WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule = 0
WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule = 0
! default to always on
WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn
IF ((rNumericArgs(6) > 1) .OR. (rNumericArgs(6) < 0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use Side Effectiveness is out of bounds (0 to 1)')
ErrorsFound = .TRUE.
END IF
WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = rNumericArgs(6)
IF ((rNumericArgs(8) > 1) .OR. (rNumericArgs(8) < 0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Source Side Effectiveness is out of bounds (0 to 1)')
ErrorsFound = .TRUE.
END IF
WaterThermalTank(WaterThermalTankNum)%SourceEffectiveness = rNumericArgs(8)
IF (lNumericFieldBlanks(7)) THEN
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate = 0.d0
ELSE
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate = rNumericArgs(7)
ENDIF
WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide = DemandSupply_No
IF (lAlphaFieldBlanks(9)) THEN
WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn
ELSE
WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = GetScheduleIndex(cAlphaArgs(9))
IF (WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum == 0) Then
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(9))//' = '//TRIM(cAlphaArgs(9)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Schedule was not found.')
ErrorsFound = .TRUE.
ENDIF
ENDIF
WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide = DemandSupply_No
IF (lNumericFieldBlanks(9)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = 0.d0
ELSE
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = rNumericArgs(9)
ENDIF
IF (lAlphaFieldBlanks(12)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
ELSE
WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = GetScheduleIndex(cAlphaArgs(12))
IF (WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum == 0) Then
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(12))//' = '//TRIM(cAlphaArgs(12)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Schedule was not found.')
ErrorsFound = .TRUE.
ENDIF
ENDIF
IF (lNumericFieldBlanks(10)) THEN
WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime = 4.0D0
ELSE
WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime = rNumericArgs(10)
ENDIF
IF ((.NOT. lAlphaFieldBlanks(7) ) .OR. (.NOT. lAlphaFieldBlanks(8) )) THEN
WaterThermalTank(WaterThermalTankNum)%UseInletNode = &
GetOnlySingleNode(cAlphaArgs(7),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%InletNodeName1 = cAlphaArgs(7)
WaterThermalTank(WaterThermalTankNum)%UseOutletNode = &
GetOnlySingleNode(cAlphaArgs(8),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName1 = cAlphaArgs(8)
END IF
IF ((.NOT. lAlphaFieldBlanks(10) ) .OR. (.NOT. lAlphaFieldBlanks(11))) THEN
WaterThermalTank(WaterThermalTankNum)%SourceInletNode = &
GetOnlySingleNode(cAlphaArgs(10),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 2, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%InletNodeName2 = cAlphaArgs(10)
WaterThermalTank(WaterThermalTankNum)%SourceOutletNode = &
GetOnlySingleNode(cAlphaArgs(11),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 2, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName2 = cAlphaArgs(11)
END IF
IF (WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide == DemandSide &
.and. WaterThermalTank(WaterThermalTankNum)%SourceInletNode /= 0) THEN
CALL RegisterPlantCompDesignFlow(WaterThermalTank(WaterThermalTankNum)%SourceInletNode, &
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate)
ENDIF
END DO ! WaterThermalTankNum
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)// &
' input. Preceding condition causes termination.')
END IF
END IF
!! end chilled water mixed storage
!!!======= Get 'ThermalStorage:ChilledWater:Stratified' =======================================================
IF (NumChilledWaterStratified > 0) THEN
cCurrentModuleObject = cStratifiedCWTankModuleObj ! 'ThermalStorage:ChilledWater:Stratified'
DO WaterThermalTankNum = NumWaterHeaterMixed + NumWaterHeaterStratified + NumChilledWaterMixed + 1 &
, NumWaterHeaterMixed + NumWaterHeaterStratified + NumChilledWaterMixed + NumChilledWaterStratified
CALL GetObjectItem(cCurrentModuleObject,WaterThermalTankNum &
- (NumWaterHeaterMixed + NumWaterHeaterStratified + NumChilledWaterMixed), &
cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
IsNotOK = .FALSE.
IsBlank = .FALSE.
CALL VerifyName(cAlphaArgs(1),WaterThermalTank%Name,WaterThermalTankNum-1,IsNotOK,IsBlank, &
TRIM(cCurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound = .TRUE.
IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
END IF
WaterThermalTank(WaterThermalTankNum)%Name = cAlphaArgs(1)
WaterThermalTank(WaterThermalTankNum)%Type = cCurrentModuleObject
WaterThermalTank(WaterThermalTankNum)%TypeNum = StratifiedChilledWaterStorage
WaterThermalTank(WaterThermalTankNum)%IsChilledWaterTank = .TRUE.
WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName = 'Chilled Water Storage'
WaterThermalTank(WaterThermalTankNum)%Volume = rNumericArgs(1)
rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'GetWaterThermalTankInput')
WaterThermalTank(WaterThermalTankNum)%Mass = WaterThermalTank(WaterThermalTankNum)%Volume * rho
WaterThermalTank(WaterThermalTankNum)%Height = rNumericArgs(2)
SELECT CASE (cAlphaArgs(2))
CASE ('VERTICALCYLINDER')
WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeVertCylinder
CASE ('HORIZONTALCYLINDER')
WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeHorizCylinder
CASE ('OTHER')
WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeOther
IF (rNumericArgs(3) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%Perimeter = rNumericArgs(3)
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Tank Perimeter must be greater than zero for Tank Shape=OTHER')
ErrorsFound = .TRUE.
END IF
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Tank Shape entered='//TRIM(cAlphaArgs(2)))
WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeVertCylinder
ErrorsFound = .TRUE.
END SELECT
IF (rNumericArgs(6) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%TankTempLimit = rNumericArgs(6)
ELSE
! default to just above freezing
WaterThermalTank(WaterThermalTankNum)%TankTempLimit = 1.0D0
END IF
WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(3))
IF (WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule .EQ. 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(cAlphaArgs(3)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Schedule was not found.')
ErrorsFound = .TRUE.
END IF
IF (rNumericArgs(4) > 0.0d0) THEN
WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = rNumericArgs(4)
ELSE
! Default to very small number (however it can't be TINY or it will break the algorithm)
WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = 0.0001d0
END IF
WaterThermalTank(WaterThermalTankNum)%HeaterHeight1 = rNumericArgs(5)
WaterThermalTank(WaterThermalTankNum)%MaxCapacity = rNumericArgs(7)
WaterThermalTank(WaterThermalTankNum)%Efficiency = 1.0D0
WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule2 = 0
WaterThermalTank(WaterThermalTankNum)%MaxCapacity2 = 0.0D0
WaterThermalTank(WaterThermalTankNum)%HeaterHeight2 = 0.0D0
WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'
WaterThermalTank(WaterThermalTankNum)%OffCycParaLoad = 0.0D0
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'
WaterThermalTank(WaterThermalTankNum)%OffCycParaFracToTank = 0.0D0
WaterThermalTank(WaterThermalTankNum)%OffCycParaHeight =0.0D0
WaterThermalTank(WaterThermalTankNum)%OnCycParaLoad = 0.0D0
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'
WaterThermalTank(WaterThermalTankNum)%OnCycParaFracToTank = 0.0D0
WaterThermalTank(WaterThermalTankNum)%OnCycParaHeight = 0.0D0
SELECT CASE (cAlphaArgs(4))
CASE ('SCHEDULE')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempSchedule
WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule = GetScheduleIndex(cAlphaArgs(5))
IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule .EQ. 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(5))//' = '//TRIM(cAlphaArgs(5)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Schedule was not found.')
ErrorsFound = .TRUE.
END IF
CASE ('ZONE')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempZone
WaterThermalTank(WaterThermalTankNum)%AmbientTempZone = FindItemInList(cAlphaArgs(6),Zone%Name,NumOfZones)
IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone .EQ. 0) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(6))//' = '//TRIM(cAlphaArgs(6)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Zone was not found.')
ErrorsFound = .TRUE.
END IF
WaterThermalTank(WaterThermalTankNum)%OffCycLossFracToZone = 1.0D0
CASE ('OUTDOORS')
WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempOutsideAir
WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode = GetOnlySingleNode(cAlphaArgs(7), ErrorsFound, &
TRIM(cCurrentModuleObject), cAlphaArgs(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent)
IF (.NOT. lAlphaFieldBlanks(7) ) THEN
IF (.not. CheckOutAirNodeNumber(WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode)) THEN
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(7))//' = '//TRIM(cAlphaArgs(7)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Outdoor Air Node not on OutdoorAir:NodeList or OutdoorAir:Node')
ErrorsFound=.true.
ENDIF
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('An Ambient Outdoor Air Node name must be used when' // &
' the Ambient Temperature Indicator is Outdoors.')
ErrorsFound = .TRUE.
ENDIF
CASE DEFAULT
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Invalid Ambient Temperature Indicator entered='//TRIM(cAlphaArgs(4)))
CALL ShowContinueError(' Valid entries are Schedule, Zone, and Outdoors.')
ErrorsFound = .TRUE.
END SELECT
WaterThermalTank(WaterThermalTankNum)%SkinLossCoeff = rNumericArgs(8)
WaterThermalTank(WaterThermalTankNum)%SkinLossFracToZone = 1.0D0
WaterThermalTank(WaterThermalTankNum)%OffCycFlueLossCoeff = 0.0D0
WaterThermalTank(WaterThermalTankNum)%OffCycFlueLossFracToZone = 0.0D0
WaterThermalTank(WaterThermalTankNum)%MassFlowRateMax = 0.0D0
WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule = 0
WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule = 0
WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = rNumericArgs(9)
WaterThermalTank(WaterThermalTankNum)%UseInletHeight = rNumericArgs(10)
! default to always on
WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn
IF (rNumericArgs(10) == Autocalculate) THEN
WaterThermalTank(WaterThermalTankNum)%UseInletHeight = WaterThermalTank(WaterThermalTankNum)%Height ! top of tank
ENDIF
IF (WaterThermalTank(WaterThermalTankNum)%UseInletHeight &
> WaterThermalTank(WaterThermalTankNum)%Height) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use inlet is located higher than overall tank height.' )
CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
CALL ShowContinueError( TRIM(cNumericFieldNames(10))//' = '//TRIM(RoundSigDigits(rNumericArgs(10), 4)) )
ErrorsFound = .TRUE.
ENDIF
WaterThermalTank(WaterThermalTankNum)%UseOutletHeight = rNumericArgs(11)
IF (WaterThermalTank(WaterThermalTankNum)%UseOutletHeight &
> WaterThermalTank(WaterThermalTankNum)%Height) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Use outlet is located higher than overall tank height.' )
CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
CALL ShowContinueError( TRIM(cNumericFieldNames(11))//' = '//TRIM(RoundSigDigits(rNumericArgs(11), 4)) )
ErrorsFound = .TRUE.
ENDIF
WaterThermalTank(WaterThermalTankNum)%SourceEffectiveness = rNumericArgs(13)
WaterThermalTank(WaterThermalTankNum)%SourceInletHeight = rNumericArgs(14)
IF (WaterThermalTank(WaterThermalTankNum)%SourceInletHeight &
> WaterThermalTank(WaterThermalTankNum)%Height) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Source inlet is located higher than overall tank height.' )
CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
CALL ShowContinueError( TRIM(cNumericFieldNames(14))//' = '//TRIM(RoundSigDigits(rNumericArgs(14), 4)) )
ErrorsFound = .TRUE.
ENDIF
WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight = rNumericArgs(15)
IF (rNumericArgs(15) == Autocalculate) THEN
WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight = WaterThermalTank(WaterThermalTankNum)%Height ! top of tank
ENDIF
IF (WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight &
> WaterThermalTank(WaterThermalTankNum)%Height) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': Source outlet is located higher than overall tank height.' )
CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
CALL ShowContinueError( TRIM(cNumericFieldNames(15))//' = '//TRIM(RoundSigDigits(rNumericArgs(15), 4)) )
ErrorsFound = .TRUE.
ENDIF
WaterThermalTank(WaterThermalTankNum)%StandAlone = .FALSE.
IF (lNumericFieldBlanks(12)) THEN
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate = 0.d0
ELSE
WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate = rNumericArgs(12)
ENDIF
WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide = DemandSupply_No
IF (lNumericFieldBlanks(16)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = 0.d0
ELSE
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = rNumericArgs(16)
ENDIF
WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime = rNumericArgs(17)
WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide = DemandSupply_No
IF ((.NOT. lAlphaFieldBlanks(8) ) .OR. (.NOT. lAlphaFieldBlanks(9) )) THEN
WaterThermalTank(WaterThermalTankNum)%UseInletNode = &
GetOnlySingleNode(cAlphaArgs(8),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%InletNodeName1 = cAlphaArgs(8)
WaterThermalTank(WaterThermalTankNum)%UseOutletNode = &
GetOnlySingleNode(cAlphaArgs(9),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName1 = cAlphaArgs(9)
ENDIF
IF ((.NOT. lAlphaFieldBlanks(11) ) .OR. (.NOT. lAlphaFieldBlanks(12))) THEN
WaterThermalTank(WaterThermalTankNum)%SourceInletNode = &
GetOnlySingleNode(cAlphaArgs(11),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 2, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%InletNodeName2 = cAlphaArgs(11)
WaterThermalTank(WaterThermalTankNum)%SourceOutletNode = &
GetOnlySingleNode(cAlphaArgs(12),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 2, ObjectIsNotParent)
WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName2 = cAlphaArgs(12)
END IF
IF (lAlphaFieldBlanks(10)) THEN
WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn
ELSE
WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = GetScheduleIndex(cAlphaArgs(10))
IF (WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum == 0) Then
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(10))//' = '//TRIM(cAlphaArgs(10)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Schedule was not found.')
ErrorsFound = .TRUE.
ENDIF
ENDIF
IF (WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide == DemandSide &
.and. WaterThermalTank(WaterThermalTankNum)%SourceInletNode /= 0) THEN
CALL RegisterPlantCompDesignFlow(WaterThermalTank(WaterThermalTankNum)%SourceInletNode, &
WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate)
ENDIF
IF (lAlphaFieldBlanks(13)) THEN
WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
ELSE
WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = GetScheduleIndex(cAlphaArgs(13))
IF (WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum == 0) Then
CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(13))//' = '//TRIM(cAlphaArgs(13)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Schedule was not found.')
ErrorsFound = .TRUE.
ENDIF
ENDIF
! Validate inlet mode
SELECT CASE (cAlphaArgs(14))
CASE ('FIXED')
WaterThermalTank(WaterThermalTankNum)%InletMode = InletModeFixed
CASE ('SEEKING')
WaterThermalTank(WaterThermalTankNum)%InletMode = InletModeSeeking
END SELECT
WaterThermalTank(WaterThermalTankNum)%Nodes = rNumericArgs(18)
WaterThermalTank(WaterThermalTankNum)%AdditionalCond = rNumericArgs(19)
ALLOCATE(WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff(WaterThermalTank(WaterThermalTankNum)%Nodes))
WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff = 0.0d0
DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
IF (NumNums > 19 + NodeNum) THEN
WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff(NodeNum) = rNumericArgs(19 + NodeNum)
ELSE
EXIT
END IF
END DO
IF (NumNums > 19 + WaterThermalTank(WaterThermalTankNum)%Nodes) THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
': More Additional Loss Coefficients were entered than the number of nodes; extra coefficients will not be used')
END IF
CALL SetupStratifiedNodes(WaterThermalTankNum)
END DO ! WaterThermalTankNum
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)// &
' input. Preceding condition causes termination.')
END IF
END IF
!! end stratified chilled water storage
!!!======= Check Water Heaters ======================================================================================
! Loop through all desuperheating coils and then search all water heaters for the tank connected to the desuperheating coil
IF (NumWaterHeaterDesuperheater > 0) THEN
cCurrentModuleObject = 'Coil:WaterHeating:Desuperheater'
DO DesuperheaterNum = 1, NumWaterHeaterDesuperheater
DO CheckWaterHeaterNum = 1, NumWaterThermalTank
IF(.NOT. SameString(WaterHeaterDesuperheater(DesuperheaterNum)%TankName, WaterThermalTank(CheckWaterHeaterNum)%Name) &
.OR. &
.NOT. SameString(WaterHeaterDesuperheater(DesuperheaterNum)%TankType, WaterThermalTank(CheckWaterHeaterNum)%Type)) &
CYCLE
WaterThermalTank(CheckWaterHeaterNum)%DesuperheaterNum = DesuperheaterNum
WaterHeaterDesuperheater(DesuperheaterNum)%WaterHeaterTankNum = CheckWaterHeaterNum
WaterHeaterDesuperheater(DesuperheaterNum)%TankTypeNum = WaterThermalTank(CheckWaterHeaterNum)%TypeNum
WaterHeaterDesuperheater(DesuperheaterNum)%BackupElementCapacity = WaterThermalTank(CheckWaterHeaterNum)%MaxCapacity
IF (WaterThermalTank(CheckWaterHeaterNum)%UseInletNode .EQ. 0 &
.AND. WaterThermalTank(CheckWaterHeaterNum)%UseOutletNode .EQ. 0) &
WaterHeaterDesuperheater(DesuperheaterNum)%StandAlone = .TRUE.
! verify Desuperheater/tank source node connections
IF(WaterHeaterDesuperheater(DesuperheaterNum)%WaterInletNode .NE. &
WaterThermalTank(CheckWaterHeaterNum)%SourceOutletNode) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//':')
CALL ShowContinueError('Desuperheater inlet node name does not match '// &
' thermal tank source outlet node name.')
CALL ShowContinueError('Desuperheater water inlet and outlet node names = '// &
TRIM(CoilSaveNodeNames(DesuperheaterNum)%InletNodeName1)//' and '// &
TRIM(CoilSaveNodeNames(DesuperheaterNum)%OutletNodeName1))
CALL ShowContinueError('Thermal tank source side inlet and outlet node names = '// &
TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName2)//' and '// &
TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName2))
ErrorsFound = .TRUE.
END IF
IF(WaterHeaterDesuperheater(DesuperheaterNum)%WaterOutletNode .NE. &
WaterThermalTank(CheckWaterHeaterNum)%SourceInletNode) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//':')
CALL ShowContinueError('Desuperheater water outlet node name does not match thermal'// &
' tank source inlet node name.')
CALL ShowContinueError('Desuperheater water inlet and outlet node names = '// &
TRIM(CoilSaveNodeNames(DesuperheaterNum)%InletNodeName1)//' and '// &
TRIM(CoilSaveNodeNames(DesuperheaterNum)%OutletNodeName1))
CALL ShowContinueError('Thermal tank source side inlet and outlet node names = '// &
TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName2)//' and '// &
TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName2))
ErrorsFound = .TRUE.
END IF
END DO ! DO CheckWaterHeaterNum = 1, NumWaterHeater
IF(WaterHeaterDesuperheater(DesuperheaterNum)%WaterHeaterTankNum .EQ. 0)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//':')
CALL ShowContinueError(' Water heater tank = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%TankName)//' not found.')
ErrorsFound = .TRUE.
END IF
END DO ! DO DesuperheaterNum = 1, NumWaterHeaterDesuperheater
END IF
! Loop through HPWH's and then search all water heaters for the tank connected to the HPWH
IF (NumHeatPumpWaterHeater > 0) THEN
cCurrentModuleObject = 'WaterHeater:HeatPump'
DO HPWaterHeaterNum = 1, NumHeatPumpWaterHeater
! find the tank associated with the heat pump water heater and change its %TYPE to HEAT PUMP:WATER HEATER
DO CheckWaterHeaterNum = 1, NumWaterThermalTank
IF(.NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%TankName, WaterThermalTank(CheckWaterHeaterNum)%Name) .OR. &
.NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%TankType, WaterThermalTank(CheckWaterHeaterNum)%Type)) CYCLE
! save backup element and on/off-cycle parasitic properties for use during standard rating procedure
HPWaterHeater(HPWaterHeaterNum)%BackupElementCapacity = WaterThermalTank(CheckWaterHeaterNum)%MaxCapacity
HPWaterHeater(HPWaterHeaterNum)%BackupElementEfficiency = WaterThermalTank(CheckWaterHeaterNum)%Efficiency
HPWaterHeater(HPWaterHeaterNum)%WHOnCycParaLoad = WaterThermalTank(CheckWaterHeaterNum)%OnCycParaLoad
HPWaterHeater(HPWaterHeaterNum)%WHOffCycParaLoad = WaterThermalTank(CheckWaterHeaterNum)%OffCycParaLoad
HPWaterHeater(HPWaterHeaterNum)%WHOnCycParaFracToTank = WaterThermalTank(CheckWaterHeaterNum)%OnCycParaFracToTank
HPWaterHeater(HPWaterHeaterNum)%WHOffCycParaFracToTank = WaterThermalTank(CheckWaterHeaterNum)%OffCycParaFracToTank
HPWaterHeater(HPWaterHeaterNum)%WHPLFCurve = WaterThermalTank(CheckWaterHeaterNum)%PLFCurve
IF(WaterThermalTank(CheckWaterHeaterNum)%Type .EQ. 'WATER HEATER:SIMPLE')THEN ! name change issue here.
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
CALL ShowContinueError('WaterHeater:HeatPump cannot be used with WATER HEATER:SIMPLE.')
ErrorsFound = .TRUE.
ELSEIF ((WaterThermalTank(CheckWaterHeaterNum)%Type .EQ. cMixedWHModuleObj) &
.OR. (WaterThermalTank(CheckWaterHeaterNum)%Type .EQ. cStratifiedWHModuleObj)) THEN
HPWaterHeater(HPWaterHeaterNum)%TankTypeNum = WaterThermalTank(CheckWaterHeaterNum)%TypeNum
! use typenum parameter to simulate heatpumpwaterheater in standard ratings procedure
! WaterThermalTank%TypeNum = HeatPumpWaterHeater for a HPWH
! WaterThermalTank(CheckWaterHeaterNum)%TypeNum = HPWaterHeater(HPWaterHeaterNum)%TypeNum
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
CALL ShowContinueError('Invalid water heater tank type ='//TRIM(WaterThermalTank(CheckWaterHeaterNum)%Type))
ErrorsFound = .TRUE.
END IF
! do not allow modulating control for HPWH's (i.e. modulating control usually used for tankless WH's)
IF(WaterThermalTank(CheckWaterHeaterNum)%ControlType .EQ. ControlTypeModulate)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
CALL ShowContinueError('Heater Control Type for '//TRIM(WaterThermalTank(CheckWaterHeaterNum)%Type)//' = '// &
TRIM(WaterThermalTank(CheckWaterHeaterNum)%Name)//' must be CYCLE.')
ErrorsFound = .TRUE.
END IF
WaterThermalTank(CheckWaterHeaterNum)%HeatPumpNum = HPWaterHeaterNum
HPWaterHeater(HPWaterHeaterNum)%WaterHeaterTankNum = CheckWaterHeaterNum
IF(WaterThermalTank(CheckWaterHeaterNum)%DesuperheaterNum .GT. 0)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)// &
'and Coil:WaterHeating:Desuperheater = '//TRIM(WaterHeaterDesuperheater(CheckWaterHeaterNum)%Name)// &
': cannot be connected to the same water heater tank = '//TRIM(WaterThermalTank(CheckWaterHeaterNum)%Name))
END IF
! check that water heater source side effectiveness is greater than 0
IF(WaterThermalTank(CheckWaterHeaterNum)%SourceEffectiveness .LE. 0.0d0) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)// &
': Invalid source side effectiveness for heat pump water heater = ' &
//TrimSigDigits(WaterThermalTank(CheckWaterHeaterNum)%SourceEffectiveness,3))
CALL ShowContinueError(' water heater source effectiveness will default to 1.0 and simulation continues.')
WaterThermalTank(CheckWaterHeaterNum)%SourceEffectiveness = 1.0d0
END IF
! Set HPWH structure variable StandAlone to TRUE if use nodes are not connected
IF (WaterThermalTank(CheckWaterHeaterNum)%UseInletNode .EQ. 0 .AND. &
WaterThermalTank(CheckWaterHeaterNum)%UseOutletNode .EQ. 0) &
HPWaterHeater(HPWaterHeaterNum)%StandAlone = .TRUE.
IF(HPWaterHeater(HPWaterHeaterNum)%WHUseInletNode /= WaterThermalTank(CheckWaterHeaterNum)%UseInletNode .OR. &
HPWaterHeater(HPWaterHeaterNum)%WHUseOutletNode /= WaterThermalTank(CheckWaterHeaterNum)%UseOutletNode)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
CALL ShowContinueError('Heat pump water heater tank use side inlet and outlet node names must match'// &
' the use side inlet and outlet node names for water heater tank = '// &
TRIM(HPWaterHeater(HPWaterHeaterNum)%TankType)//': ' &
//TRIM(HPWaterHeater(HPWaterHeaterNum)%TankName))
CALL ShowContinueError('Heat pump water heater use side inlet and outlet node names = '// &
TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%InletNodeName2)//' and '// &
TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%OutletNodeName2))
CALL ShowContinueError('Water heater tank use side inlet and outlet node names = '// &
TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName1)//' and '// &
TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName1))
ErrorsFound = .TRUE.
ELSE
IF(.NOT. HPWaterHeater(HPWaterHeaterNum)%StandAlone)THEN
! removed next to avoid duplicate comp set issue, (should change so that Branch has tank object)
! CALL SetUpCompSets(HPWaterHeater(HPWaterHeaterNum)%Type, HPWaterHeater(HPWaterHeaterNum)%Name, &
! HPWaterHeater(HPWaterHeaterNum)%TankType, &
! HPWaterHeater(HPWaterHeaterNum)%TankName, &
! WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName1,WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName1)
CALL TestCompSet(HPWaterHeater(HPWaterHeaterNum)%Type,HPWaterHeater(HPWaterHeaterNum)%Name, &
WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName1,WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName1, &
'Water Nodes')
END IF
END IF
! verify HP/tank source node connections
IF(HPWaterHeater(HPWaterHeaterNum)%CondWaterInletNode .NE. WaterThermalTank(CheckWaterHeaterNum)%SourceOutletNode) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
CALL ShowContinueError('Heat Pump condenser water inlet node name does not match water'// &
' heater tank source outlet node name.')
CALL ShowContinueError('Heat pump condenser water inlet and outlet node names = '// &
TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%InletNodeName1)//' and '// &
TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%OutletNodeName1))
CALL ShowContinueError('Water heater tank source side inlet and outlet node names = '// &
TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName2)//' and '// &
TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName2))
ErrorsFound = .TRUE.
END IF
IF(HPWaterHeater(HPWaterHeaterNum)%CondWaterOutletNode .NE. WaterThermalTank(CheckWaterHeaterNum)%SourceInletNode) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
CALL ShowContinueError('Heat Pump condenser water outlet node name does not match water heater'// &
' tank source inlet node name.')
CALL ShowContinueError('Heat pump condenser water inlet and outlet node names = '// &
TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%InletNodeName1)//' and '// &
TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%OutletNodeName1))
CALL ShowContinueError('Water heater tank source side inlet and outlet node names = '// &
TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName2)//' and '// &
TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName2))
ErrorsFound = .TRUE.
END IF
HPWaterHeater(HPWaterHeaterNum)%FoundTank = .TRUE.
! Verify tank name is in a zone equipment list if HPWH Inlet Air Configuration is Zone Air Only or Zone and Outdoor Air
IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZone .OR. &
HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA)THEN
IF(ALLOCATED(ZoneEquipConfig) .AND. ALLOCATED(ZoneEquipList))THEN
FoundTankInList = .FALSE.
TankNotLowestPriority = .FALSE.
DO ZoneEquipConfigNum = 1, NumOfZones
IF(ZoneEquipConfig(ZoneEquipConfigNum)%ActualZoneNum .NE. HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone)CYCLE
IF(ZoneEquipConfigNum .LE. NumOfZones)THEN
DO ZoneEquipListNum = 1, NumOfZones
IF(ZoneEquipConfig(ZoneEquipConfigNum)%EquipListName .NE. ZoneEquipList(ZoneEquipListNum)%Name)CYCLE
IF(ZoneEquipConfigNum .LE. NumOfZones)THEN
DO EquipmentTypeNum = 1, ZoneEquipList(ZoneEquipListNum)%NumOfEquipTypes
IF(ZoneEquipList(ZoneEquipListNum)%EquipName(EquipmentTypeNum) .NE. &
HPWaterHeater(HPWaterHeaterNum)%Name)CYCLE
FoundTankInList = .TRUE.
TankCoolingPriority = ZoneEquipList(ZoneEquipListNum)%CoolingPriority(EquipmentTypeNum)
TankHeatingPriority = ZoneEquipList(ZoneEquipListNum)%HeatingPriority(EquipmentTypeNum)
EXIT
END DO ! EquipmentTypeNum
IF(.NOT. FoundTankInList)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
CALL ShowContinueError('Heat pump water heater type and name must be listed in the correct'// &
' ZoneHVAC:EquipmentList object when Inlet Air Configuration is equal'// &
' to ZoneAirOnly or ZoneAndOutdoorAir.')
ErrorsFound = .TRUE.
END IF
! check that tank has lower priority than all other non-HPWH objects in Zone Equipment List
DO EquipmentTypeNum = 1, ZoneEquipList(ZoneEquipListNum)%NumOfEquipTypes
IF(SameString(ZoneEquipList(ZoneEquipListNum)%EquipType(EquipmentTypeNum),cCurrentModuleObject))CYCLE
IF(TankCoolingPriority .GT. ZoneEquipList(ZoneEquipListNum)%CoolingPriority(EquipmentTypeNum) .OR. &
TankHeatingPriority .GT. ZoneEquipList(ZoneEquipListNum)%HeatingPriority(EquipmentTypeNum))THEN
TankNotLowestPriority = .TRUE.
END IF
END DO ! EquipmentTypeNum
IF(TankNotLowestPriority .AND. FoundTankInList)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
CALL ShowContinueError('Heat pump water heaters must have lower priorities than'// &
' all other equipment types in a ZoneHVAC:EquipmentList.')
ErrorsFound = .TRUE.
END IF
EXIT
END IF ! ZoneEquipConfigNum .LE. NumOfZoneEquipLists
END DO ! ZoneEquipListNum
EXIT
END IF ! ZoneEquipConfigNum .LE. NumOfZones
END DO ! ZoneEquipConfigNum
ELSE
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
CALL ShowContinueError('ZoneHVAC:EquipmentList and ZoneHVAC:EquipmentConnections objects are '// &
' required when Inlet Air Configuration is either ZoneAirOnly or ZoneAndOutdoorAir.')
ErrorsFound = .TRUE.
END IF ! ALLOCATED
END IF !InletAirConfiguration
END DO ! DO CheckWaterHeaterNum = 1, NumWaterHeater
IF(.NOT. HPWaterHeater(HPWaterHeaterNum)%FoundTank)THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
CALL ShowContinueError('Water heater tank object not found = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%TankType)&
//', '//TRIM(HPWaterHeater(HPWaterHeaterNum)%TankName))
ErrorsFound = .TRUE.
END IF
END DO ! DO HPWaterHeaterNum = 1, NumHeatPumpWaterHeater
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)// &
' input. Preceding condition causes termination.')
END IF
END IF
!Get water heater sizing input.
cCurrentModuleObject='WaterHeater:Sizing'
NumWaterHeaterSizing = GetNumObjectsFound(cCurrentModuleObject)
If (NumWaterHeaterSizing > 0) then
DO WHsizingNum = 1, NumWaterHeaterSizing
CALL GetObjectItem(cCurrentModuleObject, WHsizingNum, cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT)
! find which water heater this object is for
WaterThermalTankNum = FindItemInList(cAlphaArgs(1),WaterThermalTank%Name, NumWaterThermalTank)
IF (WaterThermalTankNum == 0) then
! did not match name throw warning.
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' object name: '//TRIM(cAlphaArgs(1))// ' does not match ' &
//'any of the water heaters defined in the file')
ErrorsFound = .TRUE.
cycle
ELSE ! we have a match
! store the sizing data in "sizing" nested derived type for the correct water heater
IF (SameString(cAlphaArgs(2), 'PeakDraw')) THEN
WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizePeakDraw
ELSEIF (SameString(cAlphaArgs(2), 'ResidentialHUD-FHAMinimum')) THEN
WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizeResidentialMin
ELSEIF (SameString(cAlphaArgs(2), 'PerPerson')) THEN
WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizePerPerson
ELSEIF (SameString(cAlphaArgs(2), 'PerFloorArea')) THEN
WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizePerFloorArea
ELSEIF (SameString(cAlphaArgs(2), 'PerUnit')) THEN
WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizePerUnit
ELSEIF (SameString(cAlphaArgs(2), 'PerSolarCollectorArea')) THEN
WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizePerSolarColArea
ELSE
! wrong design mode entered, throw error
CALL ShowSevereError(TRIM(cCurrentModuleObject)//' object named: '//TRIM(cAlphaArgs(1)) &
// ' contains an incorrect Design Mode of: ' //Trim(cAlphaArgs(2) ) )
ErrorsFound = .TRUE.
ENDIF
WaterThermalTank(WaterThermalTankNum)%Sizing%TankDrawTime = rNumericArgs(1)
WaterThermalTank(WaterThermalTankNum)%Sizing%RecoveryTime = rNumericArgs(2)
WaterThermalTank(WaterThermalTankNum)%Sizing%NominalVolForSizingDemandSideFlow = rNumericArgs(3)
WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms = INT(rNumericArgs(4))
WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms = INT(rNumericArgs(5))
WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerPerson = rNumericArgs(6)
WaterThermalTank(WaterThermalTankNum)%Sizing%RecoveryCapacityPerPerson = rNumericArgs(7)
WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerArea = rNumericArgs(8)
WaterThermalTank(WaterThermalTankNum)%Sizing%RecoveryCapacityPerArea = rNumericArgs(9)
WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfUnits = rNumericArgs(10)
WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerUnit = rNumericArgs(11)
WaterThermalTank(WaterThermalTankNum)%Sizing%RecoveryCapacityPerUnit = rNumericArgs(12)
WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerCollectorArea = rNumericArgs(13)
WaterThermalTank(WaterThermalTankNum)%Sizing%HeightAspectRatio = rNumericArgs(14)
Select Case (WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode)
CASE (SizeNotSet)
! do nothing, error thrown if design mode not found
CASE (SizePeakDraw) ! need to have entered a reasonable value for TankDrawTime
IF (WaterThermalTank(WaterThermalTankNum)%Sizing%TankDrawTime <= 0.0D0 ) then
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', design mode set to Peak Draw but needs a positive value for tank draw time' )
ErrorsFound = .true.
ENDIF
!constrain crazy sizes by limiting to 10 years or 8760*10
IF (WaterThermalTank(WaterThermalTankNum)%Sizing%TankDrawTime > 87600.0D0 )THEN
CALL ShowWarningError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', has input with an unreasonably large Tank Draw Time, more than 10 years')
ErrorsFound = .true.
ENDIF
! if both volume and demand side flow connections are autosized, must be a good NominalVolForSizingDemandSideFlow
If ((WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide == DemandSide) .AND. &
(WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate == AutoSize)) Then
IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NominalVolForSizingDemandSideFlow <= 0.0D0) then
Call ShowWarningError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
' needs a value for Nominal Tank Volume for Autosizing Plant Connections')
ErrorsFound = .true.
ENDIF
ENDIF
If ((WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide == DemandSide) .AND. &
(WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate == AutoSize)) Then
IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NominalVolForSizingDemandSideFlow <= 0.0D0) then
Call ShowWarningError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
' needs a value for Nominal Tank Volume for Autosizing Plant Connections')
ErrorsFound = .true.
ENDIF
ENDIF
CASE (SizeResidentialMin)
! it would have to have at least on bedroom and any more than 10 is crazy for this mode
IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms < 1 ) then
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', mode needs at least one bedroom')
ErrorsFound = .true.
ENDIF
IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms > 10 ) then
CALL ShowWarningError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', probably has too many bedrooms for the selected design mode')
ENDIF
CASE (SizePerPerson)
IF ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerPerson <= 0.d0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', PerPerson mode needs positive value input for storage capacity per person')
ErrorsFound = .true.
ENDIF
IF ((WaterThermalTank(WaterThermalTankNum)%MaxCapacity == Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%sizing%RecoveryCapacityPerPerson <= 0.d0) ) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', PerPerson mode needs positive value input for recovery capacity per person')
ErrorsFound = .true.
ENDIF
CASE (SizePerFloorArea)
IF ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerArea <= 0.d0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', PerArea mode needs positive value input for storage capacity per floor area')
ErrorsFound = .true.
ENDIF
IF ((WaterThermalTank(WaterThermalTankNum)%MaxCapacity == Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%sizing%RecoveryCapacityPerArea <= 0.d0) ) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', PerArea mode needs positive value input for recovery capacity per floor area')
ErrorsFound = .true.
ENDIF
CASE (SizePerUnit)
IF ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerUnit <= 0.d0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', PerUnit mode needs positive value input for storage capacity per unit')
ErrorsFound = .true.
ENDIF
IF ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfUnits <= 0.d0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', PerUnit mode needs positive value input for number of units')
ErrorsFound = .true.
ENDIF
IF ((WaterThermalTank(WaterThermalTankNum)%MaxCapacity == Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%sizing%RecoveryCapacityPerUnit <= 0.d0) ) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', PerUnit mode needs positive value input for recovery capacity per unit')
ErrorsFound = .true.
ENDIF
IF ((WaterThermalTank(WaterThermalTankNum)%MaxCapacity == Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%sizing%NumberOfUnits <= 0.d0) ) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', PerUnit mode needs positive value input for number of units')
ErrorsFound = .true.
ENDIF
CASE (SizePerSolarColArea)
IF ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) .AND. &
(WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerCollectorArea <= 0.d0)) THEN
CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
', PerSolarCollectorArea mode needs positive value input for storage capacity per collector area')
ErrorsFound = .true.
ENDIF
END SELECT
ENDIF !found water heater num okay
ENDDO ! loop over sizing objects
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)// &
' input. Preceding condition causes termination.')
END IF
ENDIF ! any water heater sizing objects
!now check that if water heater fields were autosized, that there was also a sizing object for that water heater
IF (NumWaterThermalTank > 0) THEN
DO WaterThermalTankNum = 1, NumWaterThermalTank
If ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) &
.AND. (WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode == SizeNotSet)) then
CALL ShowWarningError('Water heater named '//TRIM(WaterThermalTank(WaterThermalTankNum)%Name) // &
'has tank volume set to AUTOSIZE but it is missing associated WaterHeater:Sizing object')
ErrorsFound = .TRUE.
ENDIF
If ((WaterThermalTank(WaterThermalTankNum)%MaxCapacity == Autosize) &
.AND. (WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode == SizeNotSet)) then
CALL ShowWarningError('Water heater named '//TRIM(WaterThermalTank(WaterThermalTankNum)%Name) // &
'has heater capacity set to AUTOSIZE but it is missing associated WaterHeater:Sizing object')
ErrorsFound = .TRUE.
ENDIF
If ((WaterThermalTank(WaterThermalTankNum)%Height == Autosize) &
.AND. (WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode == SizeNotSet)) then
CALL ShowWarningError('Water heater named '//TRIM(WaterThermalTank(WaterThermalTankNum)%Name) // &
'has tank height set to AUTOSIZE but it is missing associated WaterHeater:Sizing object')
ErrorsFound = .TRUE.
ENDIF
ENDDO
If (ErrorsFound) then
CALL ShowFatalError('Errors found in water heater input. Preceding condition causes termination.')
ENDIF
ENDIF
!! now do calls to TestCompSet for tanks, depending on nodes and heat pump water heater
IF (NumWaterThermalTank > 0) THEN
DO WaterThermalTankNum = 1, NumWaterThermalTank
IF ( WaterThermalTank(WaterThermalTankNum)%UseInletNode > 0 &
.AND. WaterThermalTank(WaterThermalTankNum)%UseOutletNode > 0) THEN
IF (WaterThermalTank(WaterThermalTankNum)%HeatPumpNum > 0) THEN
! do nothing, Use nodes are tested for HeatPump:WaterHeater not tank
ELSE
CALL TestCompSet(WaterThermalTank(WaterThermalTankNum)%Type, &
WaterThermalTank(WaterThermalTankNum)%Name, &
WHSaveNodeNames(WaterThermalTankNum)%InletNodeName1 , &
WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName1, &
'Use Side Water Nodes')
ENDIF
ENDIF
IF ( WaterThermalTank(WaterThermalTankNum)%SourceInletNode > 0 &
.AND. WaterThermalTank(WaterThermalTankNum)%SourceOutletNode > 0) THEN
CALL TestCompSet(WaterThermalTank(WaterThermalTankNum)%Type, &
WaterThermalTank(WaterThermalTankNum)%Name, &
WHSaveNodeNames(WaterThermalTankNum)%InletNodeName2 , &
WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName2, &
'Source Side Water Nodes')
ENDIF
ENDDO
ENDIF
IF (NumWaterThermalTank > 0) THEN
DO WaterThermalTankNum = 1, NumWaterThermalTank
IF ((WaterThermalTank(WaterThermalTankNum)%TypeNum /= MixedChilledWaterStorage) &
.AND. (WaterThermalTank(WaterThermalTankNum)%TypeNum /= StratifiedChilledWaterStorage) ) THEN
! Setup report variables for WaterHeater:Mixed
! CurrentModuleObject='WaterHeater:Mixed'
CALL SetupOutputVariable('Water Heater Tank Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%TankTempAvg,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Final Tank Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%TankTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heat Loss Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%LossRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heat Loss Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%LossEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Use Side Mass Flow Rate [kg/s]', &
WaterThermalTank(WaterThermalTankNum)%UseMassFlowRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Use Side Inlet Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%UseInletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Use Side Outlet Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%UseOutletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Use Side Heat Transfer Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%UseRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Use Side Heat Transfer Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%UseEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Source Side Mass Flow Rate [kg/s]', &
WaterThermalTank(WaterThermalTankNum)%SourceMassFlowRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Source Side Inlet Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%SourceInletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Source Side Outlet Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%SourceOutletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Source Side Heat Transfer Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%SourceRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Source Side Heat Transfer Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%SourceEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name, &
ResourceTypeKey='PLANTLOOPHEATINGDEMAND',GroupKey='Plant', &
EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)
CALL SetupOutputVariable('Water Heater Off Cycle Parasitic Tank Heat Transfer Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%OffCycParaRateToTank,'System','Average', &
WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Off Cycle Parasitic Tank Heat Transfer Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%OffCycParaEnergyToTank,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater On Cycle Parasitic Tank Heat Transfer Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%OnCycParaRateToTank,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater On Cycle Parasitic Tank Heat Transfer Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%OnCycParaEnergyToTank,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Total Demand Heat Transfer Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%TotalDemandRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Total Demand Heat Transfer Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%TotalDemandEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heating Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%HeaterRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heating Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%HeaterEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Unmet Demand Heat Transfer Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%UnmetRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Unmet Demand Heat Transfer Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%UnmetEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Venting Heat Transfer Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%VentRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Venting Heat Transfer Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%VentEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Net Heat Transfer Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%NetHeatTransferRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Net Heat Transfer Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%NetHeatTransferEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Cycle On Count []', &
WaterThermalTank(WaterThermalTankNum)%CycleOnCount,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Runtime Fraction []', &
WaterThermalTank(WaterThermalTankNum)%RuntimeFraction,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Part Load Ratio []', &
WaterThermalTank(WaterThermalTankNum)%PartLoadRatio,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType, 'Electric') ) THEN
CALL SetupOutputVariable('Water Heater Electric Power [W]', &
WaterThermalTank(WaterThermalTankNum)%FuelRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
ELSE
CALL SetupOutputVariable('Water Heater '//TRIM(WaterThermalTank(WaterThermalTankNum)%FuelType)//' Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%FuelRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
ENDIF
CALL SetupOutputVariable('Water Heater '//TRIM(WaterThermalTank(WaterThermalTankNum)%FuelType)//' Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%FuelEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name, &
ResourceTypeKey=WaterThermalTank(WaterThermalTankNum)%FuelType,GroupKey='Plant', &
EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)
IF (SameString(WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType, 'Electric') ) THEN
CALL SetupOutputVariable( &
'Water Heater Off Cycle Parasitic Electric Power [W]', &
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelRate, &
'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
ELSE
CALL SetupOutputVariable( &
'Water Heater Off Cycle Parasitic '// &
TRIM(WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType)//' Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelRate,&
'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
ENDIF
CALL SetupOutputVariable( &
'Water Heater Off Cycle Parasitic '// &
TRIM(WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType)//' Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelEnergy,'System','Sum', &
WaterThermalTank(WaterThermalTankNum)%Name, &
ResourceTypeKey=WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType,GroupKey='Plant', &
EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)
IF (SameString(WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType, 'Electric') ) THEN
CALL SetupOutputVariable( &
'Water Heater On Cycle Parasitic Electric Power [W]', &
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
ELSE
CALL SetupOutputVariable( &
'Water Heater On Cycle Parasitic '//TRIM(WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType)// &
' Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
ENDIF
CALL SetupOutputVariable( &
'Water Heater On Cycle Parasitic '//TRIM(WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType)// &
' Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name, &
ResourceTypeKey=WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType,GroupKey='Plant', &
EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)
CALL SetupOutputVariable('Water Heater Water Volume Flow Rate [m3/s]', &
WaterThermalTank(WaterThermalTankNum)%VolFlowRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Water Volume [m3]',WaterThermalTank(WaterThermalTankNum)%VolumeConsumed, &
'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name,ResourceTypeKey='Water',GroupKey='Plant', &
EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)
CALL SetupOutputVariable('Water Heater Mains Water Volume [m3]', &
WaterThermalTank(WaterThermalTankNum)%VolumeConsumed, &
'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name,ResourceTypeKey='MainsWater',GroupKey='Plant', &
EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)
IF(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum .GT. 0) THEN
!CurrentModuleObject='WaterHeater:HeatPump'
CALL SetupOutputVariable('Water Heater Compressor Part Load Ratio []', &
HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%HeatingPLR,'System','Average', &
HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%Name)
CALL SetupOutputVariable('Water Heater Off Cycle Ancillary Electric Power [W]', &
HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%OffCycParaFuelRate,'System','Average', &
HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%Name)
CALL SetupOutputVariable('Water Heater Off Cycle Ancillary Electric Energy [J]', &
HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%OffCycParaFuelEnergy,'System','Sum', &
HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%Name, &
ResourceTypeKey='Electric',EndUseKey='DHW',EndUseSubKey='Water Heater Parasitic', GroupKey='Plant')
CALL SetupOutputVariable('Water Heater On Cycle Ancillary Electric Power [W]', &
HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%OnCycParaFuelRate,'System','Average', &
HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%Name)
CALL SetupOutputVariable('Water Heater On Cycle Ancillary Electric Energy [J]', &
HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%OnCycParaFuelEnergy,'System','Sum', &
HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%Name, &
ResourceTypeKey='Electric',EndUseKey='DHW',EndUseSubKey='Water Heater Parasitic',GroupKey='Plant')
END IF
IF(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum .GT. 0) THEN
!CurrentModuleObject='Coil:WaterHeating:Desuperheater'
CALL SetupOutputVariable('Water Heater Part Load Ratio []', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%DesuperheaterPLR, &
'System','Average', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
CALL SetupOutputVariable('Water Heater On Cycle Parasitic Electric Power [W]', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%OnCycParaFuelRate, &
'System','Average', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
CALL SetupOutputVariable('Water Heater On Cycle Parasitic Electric Energy [J]', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%OnCycParaFuelEnergy, &
'System','Sum', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name, &
ResourceTypeKey='Electric',EndUseKey='DHW',EndUseSubKey='Water Heater Parasitic',GroupKey='Plant')
CALL SetupOutputVariable('Water Heater Off Cycle Parasitic Electric Power [W]', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%OffCycParaFuelRate, &
'System','Average', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
CALL SetupOutputVariable('Water Heater Off Cycle Parasitic Electric Energy [J]', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%OffCycParaFuelEnergy, &
'System','Sum', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name, &
ResourceTypeKey='Electric',EndUseKey='DHW',EndUseSubKey='Water Heater Parasitic', GroupKey='Plant')
CALL SetupOutputVariable('Water Heater Heat Reclaim Efficiency Modifier Multiplier []', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%HEffFTempOutput, &
'System','Average', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
CALL SetupOutputVariable('Water Heater Pump Electric Power [W]', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%PumpPower,'System','Average', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
CALL SetupOutputVariable('Water Heater Pump Electric Energy [J]', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%PumpEnergy,'System','Sum', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name, &
ResourceTypeKey='Electric',EndUseKey='DHW',EndUseSubKey='Desuperheater Pump', GroupKey='Plant')
CALL SetupOutputVariable('Water Heater Heating Rate [W]', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%HeaterRate,'System','Average', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
CALL SetupOutputVariable('Water Heater Heating Energy [J]', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%HeaterEnergy,'System','Sum', &
WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name, &
ResourceTypeKey='EnergyTransfer',EndUseKey='DHW',EndUseSubKey='Water Heater', GroupKey='Plant')
END IF
! Setup report variables for WaterHeater:Stratified
! CurrentModuleObject='WaterHeater:Stratified'
IF (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedWaterHeater) THEN
CALL SetupOutputVariable('Water Heater Heater 1 Heating Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%HeaterRate1,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heater 2 Heating Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%HeaterRate2,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heater 1 Heating Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%HeaterEnergy1,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heater 2 Heating Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%HeaterEnergy2,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heater 1 Cycle On Count []', &
WaterThermalTank(WaterThermalTankNum)%CycleOnCount1,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heater 2 Cycle On Count []', &
WaterThermalTank(WaterThermalTankNum)%CycleOnCount2,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heater 1 Runtime Fraction []', &
WaterThermalTank(WaterThermalTankNum)%RuntimeFraction1,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Water Heater Heater 2 Runtime Fraction []', &
WaterThermalTank(WaterThermalTankNum)%RuntimeFraction2,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
CALL SetupOutputVariable('Water Heater Temperature Node '//TRIM(TrimSigDigits(NodeNum))//' [C]', &
WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%TempAvg,'System','Average', &
WaterThermalTank(WaterThermalTankNum)%Name)
END DO
DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
CALL SetupOutputVariable('Water Heater Final Temperature Node '//TRIM(TrimSigDigits(NodeNum))//' [C]', &
WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Temp,'System','Average', &
WaterThermalTank(WaterThermalTankNum)%Name)
END DO
END IF
IF (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedWaterHeater) THEN
723 FORMAT('Water Heater Stratified Node Information',8(',',A))
DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
WRITE(OutputFileInits,723) TRIM(TrimSigDigits(NodeNum)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Height,4)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Volume,4)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%MaxCapacity,3)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%OffCycLossCoeff,4)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%OnCycLossCoeff,4)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Inlets)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Outlets))
END DO
END IF
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting water heater input. Preceding condition causes termination.')
END IF
ELSEIF ((WaterThermalTank(WaterThermalTankNum)%TypeNum == MixedChilledWaterStorage) &
.OR. (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedChilledWaterStorage) ) THEN
! CurrentModuleObject='ThermalStorage:ChilledWater:Mixed/ThermalStorage:ChilledWater:Stratified'
CALL SetupOutputVariable('Chilled Water Thermal Storage Tank Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%TankTempAvg,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Final Tank Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%TankTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Tank Heat Gain Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%LossRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Tank Heat Gain Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%LossEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Use Side Mass Flow Rate [kg/s]', &
WaterThermalTank(WaterThermalTankNum)%UseMassFlowRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Use Side Inlet Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%UseInletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Use Side Outlet Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%UseOutletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Use Side Heat Transfer Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%UseRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Use Side Heat Transfer Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%UseEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Source Side Mass Flow Rate [kg/s]', &
WaterThermalTank(WaterThermalTankNum)%SourceMassFlowRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Source Side Inlet Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%SourceInletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Source Side Outlet Temperature [C]', &
WaterThermalTank(WaterThermalTankNum)%SourceOutletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Source Side Heat Transfer Rate [W]', &
WaterThermalTank(WaterThermalTankNum)%SourceRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
CALL SetupOutputVariable('Chilled Water Thermal Storage Source Side Heat Transfer Energy [J]', &
WaterThermalTank(WaterThermalTankNum)%SourceEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
IF (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedChilledWaterStorage) THEN
DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
CALL SetupOutputVariable('Chilled Water Thermal Storage Temperature Node '//TRIM(TrimSigDigits(NodeNum))//' [C]', &
WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%TempAvg,'System','Average', &
WaterThermalTank(WaterThermalTankNum)%Name)
END DO
DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
CALL SetupOutputVariable('Chilled Water Thermal Storage Final Temperature Node ' &
//TRIM(TrimSigDigits(NodeNum))//' [C]', &
WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Temp,'System','Average', &
WaterThermalTank(WaterThermalTankNum)%Name)
END DO
END IF
IF (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedChilledWaterStorage) THEN
724 FORMAT('Chilled Water Tank Stratified Node Information',6(',',A))
DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
WRITE(OutputFileInits,724) TRIM(TrimSigDigits(NodeNum)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Height,4)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Volume,4)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%OffCycLossCoeff,4)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Inlets)), &
TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Outlets))
END DO
END IF
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in getting chilled water tank input. Preceding condition causes termination.')
END IF
ENDIF
! set up internal gains if tank is in a thermal zone
IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone > 0) THEN
SELECT CASE (WaterThermalTank(WaterThermalTankNum)%TypeNum)
CASE (MixedWaterHeater)
CALL SetupZoneInternalGain(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone, &
'WaterHeater:Mixed', &
WaterThermalTank(WaterThermalTankNum)%Name, &
IntGainTypeOf_WaterHeaterMixed, &
ConvectionGainRate = WaterThermalTank(WaterThermalTankNum)%AmbientZoneGain )
CASE (StratifiedWaterHeater)
CALL SetupZoneInternalGain(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone, &
'WaterHeater:Stratified', &
WaterThermalTank(WaterThermalTankNum)%Name, &
IntGainTypeOf_WaterHeaterStratified, &
ConvectionGainRate = WaterThermalTank(WaterThermalTankNum)%AmbientZoneGain )
CASE (MixedChilledWaterStorage)
CALL SetupZoneInternalGain(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone, &
'ThermalStorage:ChilledWater:Mixed', &
WaterThermalTank(WaterThermalTankNum)%Name, &
IntGainTypeOf_ThermalStorageChilledWaterMixed, &
ConvectionGainRate = WaterThermalTank(WaterThermalTankNum)%AmbientZoneGain )
CASE (StratifiedChilledWaterStorage)
CALL SetupZoneInternalGain(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone, &
'ThermalStorage:ChilledWater:Stratified', &
WaterThermalTank(WaterThermalTankNum)%Name, &
IntGainTypeOf_ThermalStorageChilledWaterStratified, &
ConvectionGainRate = WaterThermalTank(WaterThermalTankNum)%AmbientZoneGain )
END SELECT
ENDIF
END DO ! WaterThermalTankNum
END IF
END IF ! get input flag
IF (ALLOCATED(HPWHSaveNodeNames)) DEALLOCATE(HPWHSaveNodeNames)
IF (ALLOCATED(WHSaveNodeNames)) DEALLOCATE(WHSaveNodeNames)
IF (ALLOCATED(CoilSaveNodeNames)) DEALLOCATE(CoilSaveNodeNames)
RETURN
END SUBROUTINE GetWaterThermalTankInput