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.
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 CalcWaterThermalTankZoneGains
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN March 2005
! MODIFIED B. Griffith November 2011, new internal gains structure
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculates the zone internal gains due to water heater skin losses during sizing.
! initilizes gains to zone at begin environment.
! METHODOLOGY EMPLOYED:
! Sums the tank losses from all of the water heaters in the zone to add as a gain to the zone.
! Now used to determine tank losses during sizing. Internal gains are summed in a centralized way now
!
! USE STATEMENTS:
USE DataGlobals, ONLY: BeginEnvrnFlag, DoingSizing
USE DataHeatBalFanSys, ONLY: MAT
USE ScheduleManager, ONLY: GetCurrentScheduleValue
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: WaterThermalTankNum
INTEGER :: ZoneNum
LOGICAL, SAVE :: MyEnvrnFlag=.true.
REAL(r64) :: TankTemp
REAL(r64) :: QLossToZone
INTEGER :: SchIndex
! FLOW:
IF (NumWaterThermalTank == 0) THEN
IF(.NOT. DoingSizing) THEN
RETURN
ELSE
IF (GetWaterThermalTankInputFlag) THEN
CALL GetWaterThermalTankInput
GetWaterThermalTankInputFlag = .FALSE.
END IF
IF (NumWaterThermalTank == 0) Return
ENDIF
ENDIF
IF (BeginEnvrnFlag .and. MyEnvrnFlag) THEN
WaterThermalTank%AmbientZoneGain = 0.d0
WaterThermalTank%FuelEnergy = 0.d0
WaterThermalTank%OffCycParaFuelEnergy = 0.d0
WaterThermalTank%OnCycParaFuelEnergy = 0.d0
MyEnvrnFlag=.false.
ENDIF
IF (.not. BeginEnvrnFlag) MyEnvrnFlag=.true.
DO WaterThermalTankNum = 1, NumWaterThermalTank
IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone == 0) CYCLE
ZoneNum = WaterThermalTank(WaterThermalTankNum)%AmbientTempZone
IF(DoingSizing)THEN
! Initialize tank temperature to setpoint
! (use HPWH or Desuperheater heating coil set point if applicable)
IF(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum .GT. 0)THEN
SchIndex = HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%SetpointTempSchedule
ELSE IF(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum .GT. 0)THEN
SchIndex = WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%SetpointTempSchedule
ELSE
SchIndex = WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule
END IF
IF (SchIndex > 0) THEN
TankTemp = GetCurrentScheduleValue(SchIndex)
ELSE
TankTemp = 20.0d0
END IF
SELECT CASE(WaterThermalTank(WaterThermalTankNum)%TypeNum)
CASE (MixedWaterHeater)
QLossToZone = MAX(WaterThermalTank(WaterThermalTankNum)%OnCycLossCoeff * &
WaterThermalTank(WaterThermalTankNum)%OnCycLossFracToZone, &
WaterThermalTank(WaterThermalTankNum)%OffCycLossCoeff * &
WaterThermalTank(WaterThermalTankNum)%OffCycLossFracToZone) * &
(TankTemp-MAT(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone))
CASE(StratifiedWaterHeater)
QLossToZone = MAX(WaterThermalTank(WaterThermalTankNum)%Node(1)%OnCycLossCoeff * &
WaterThermalTank(WaterThermalTankNum)%SkinLossFracToZone, &
WaterThermalTank(WaterThermalTankNum)%Node(1)%OffCycLossCoeff * &
WaterThermalTank(WaterThermalTankNum)%SkinLossFracToZone) * &
(TankTemp-MAT(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone))
CASE(MixedChilledWaterStorage)
QLossToZone = WaterThermalTank(WaterThermalTankNum)%OffCycLossCoeff * &
WaterThermalTank(WaterThermalTankNum)%OffCycLossFracToZone * &
(TankTemp-MAT(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone) )
CASE(StratifiedChilledWaterStorage)
QLossToZone = WaterThermalTank(WaterThermalTankNum)%Node(1)%OffCycLossCoeff * &
WaterThermalTank(WaterThermalTankNum)%SkinLossFracToZone * &
(TankTemp-MAT(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone) )
END SELECT
WaterThermalTank(WaterThermalTankNum)%AmbientZoneGain = QLossToZone
END IF
END DO
RETURN
END SUBROUTINE CalcWaterThermalTankZoneGains