Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | WaterHeaterNum | |||
logical, | intent(in) | :: | FirstHVACIteration |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE SimulateWaterHeaterStandAlone(WaterHeaterNum, FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN January 2004
! MODIFIED July 2005, FSEC - added HPWHs and desuperheater water heating coils
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine acts an interface to SimWaterHeater for stand-alone water heaters with no plant connections,
! HPWHs not defined as zone equipment with no plant connections, and stand-alone water heaters with
! desuperheater heating coils with no plant connections.
! METHODOLOGY EMPLOYED:
! The necessary control flags and dummy variables are set and passed into SimWaterHeater. This subroutine is
! called from NonZoneEquipmentManager.
! USE STATEMENTS:
USE DataHVACGlobals, ONLY: NumPlantLoops
USE DataLoopNode , ONLY: node
USE DataPlant
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: WaterHeaterNum
LOGICAL, INTENT(IN) :: FirstHVACIteration
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL :: LocalRunFlag,LocalInitLoopEquip ! local variables of similar name as others used in Sim modules
REAL(r64) :: MyLoad, MinCap, MaxCap, OptCap
INTEGER :: TestNum
! FLOW:
IF (GetWaterThermalTankInputFlag) THEN
CALL GetWaterThermalTankInput
GetWaterThermalTankInputFlag = .FALSE.
END IF
! Only simulate stand-alone water heaters here. Plant connected water heaters are called by the PlantLoopEquipments.
IF (WaterThermalTank(WaterHeaterNum)%StandAlone) THEN
LocalRunFlag = .TRUE.
LocalInitLoopEquip = .FALSE.
TestNum=WaterHeaterNum
CALL SimWaterThermalTank(WaterThermalTank(WaterHeaterNum)%TypeNum,WaterThermalTank(WaterHeaterNum)%Name,TestNum, &
LocalRunFlag,LocalInitLoopEquip,MyLoad,MinCap,MaxCap,OptCap,FirstHVACIteration)
IF (TestNum /= WaterHeaterNum) THEN
CALL ShowFatalError('SimulateWaterHeaterStandAlone: Input WaterHeater Num ['//trim(TrimSigDigits(WaterHeaterNum))// &
'] does not match returned WaterHeater Num['//trim(TrimSigDigits(TestNum))//'] Name="'// &
trim(WaterThermalTank(WaterHeaterNum)%Name)//'".')
ENDIF
! HPWHs with inlet air from a zone and not connected to a plant loop are simulated through a CALL from ZoneEquipmentManager.
! HPWHs that are plant connected are always simulated through a CALL from PlantLoopEquipments directly to SimWaterThermalTank.
! NOTE: HPWHs with inlet air from a zone AND plant connected are not stand alone and are simulated in PlantLoopEquipments
ELSE IF(WaterThermalTank(WaterHeaterNum)%HeatPumpNum .GT. 0) THEN
! Only HPWHs with inlet air from outdoors or scheduled HPWHs (not connected to a plant loop) are simulated here.
IF(HPWaterHeater(WaterThermalTank(WaterHeaterNum)%HeatPumpNum)%StandAlone .AND. &
(HPWaterHeater(WaterThermalTank(WaterHeaterNum)%HeatPumpNum)%InletAirConfiguration .EQ. AmbientTempOutsideAir .OR. &
HPWaterHeater(WaterThermalTank(WaterHeaterNum)%HeatPumpNum)%InletAirConfiguration .EQ. AmbientTempSchedule))THEN
LocalRunFlag = .TRUE.
LocalInitLoopEquip = .FALSE.
CALL SimWaterThermalTank(HPWaterHeater(WaterThermalTank(WaterHeaterNum)%HeatPumpNum)%TypeNum, &
HPWaterHeater(WaterThermalTank(WaterHeaterNum)%HeatPumpNum)%Name, &
WaterThermalTank(WaterHeaterNum)%HeatPumpNum,LocalRunFlag, &
LocalInitLoopEquip,MyLoad,MinCap,MaxCap,OptCap,FirstHVACIteration)
END IF
! Only simulate stand-alone water heaters with desuperheater water heating coils here. Plant connected water heaters
! with desuperheater water heating coils are called by PlantLoopEquipments.
ELSEIF(WaterThermalTank(WaterHeaterNum)%DesuperheaterNum .GT. 0)THEN
IF(WaterHeaterDesuperheater(WaterThermalTank(WaterHeaterNum)%DesuperheaterNum)%StandAlone)THEN
LocalRunFlag = .TRUE.
LocalInitLoopEquip = .FALSE.
TestNum=WaterHeaterNum
CALL SimWaterThermalTank(WaterThermalTank(WaterHeaterNum)%TypeNum,WaterThermalTank(WaterHeaterNum)%Name,TestNum, &
LocalRunFlag,LocalInitLoopEquip,MyLoad,MinCap,MaxCap,OptCap,FirstHVACIteration)
IF (TestNum /= WaterHeaterNum) THEN
CALL ShowFatalError('SimulateWaterHeaterStandAlone: Input WaterHeater Num ['//trim(TrimSigDigits(WaterHeaterNum))// &
'] does not match returned WaterHeater Num['//trim(TrimSigDigits(TestNum))//'] Name="'// &
trim(WaterThermalTank(WaterHeaterNum)%Name)//'".')
ENDIF
END IF
END IF
RETURN
END SUBROUTINE SimulateWaterHeaterStandAlone