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) | :: | WaterEquipNum |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE CalcEquipmentDrainTemp(WaterEquipNum)
! SUBROUTINE INFORMATION:
! AUTHOR Peter Graham Ellis
! DATE WRITTEN August 2006
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculate drainwater temperature and heat and moisture gains to zone.
! METHODOLOGY EMPLOYED:
!
! USE STATEMENTS:
USE ScheduleManager, ONLY: GetCurrentScheduleValue
USE Psychrometrics, ONLY: CPHW, PsyWFnTdbRhPb, PsyRhoAirFnPbTdbW, PsyHfgAirFnWTdb
USE DataHeatBalFanSys, ONLY: MAT, ZoneAirHumRat
USE DataHeatBalance, ONLY: ZONE
USE DataEnvironment, ONLY: OutBaroPress
USE DataGlobals, ONLY: SecInHour
Use DataHVACGlobals, ONLY: TimeStepSys
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: WaterEquipNum
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: ZoneNum
REAL(r64) :: ZoneMAT
REAL(r64) :: ZoneHumRat
REAL(r64) :: ZoneHumRatSat
REAL(r64) :: RhoAirDry
REAL(r64) :: ZoneMassMax
REAL(r64) :: FlowMassMax
REAL(r64) :: MoistureMassMax
! FLOW:
WaterEquipment(WaterEquipNum)%SensibleRate = 0.0d0
WaterEquipment(WaterEquipNum)%SensibleEnergy = 0.0d0
WaterEquipment(WaterEquipNum)%LatentRate = 0.0d0
WaterEquipment(WaterEquipNum)%LatentEnergy = 0.0d0
IF ((WaterEquipment(WaterEquipNum)%Zone == 0) .OR. (WaterEquipment(WaterEquipNum)%TotalMassFlowRate == 0.0d0)) THEN
WaterEquipment(WaterEquipNum)%DrainTemp = WaterEquipment(WaterEquipNum)%MixedTemp
WaterEquipment(WaterEquipNum)%DrainMassFlowRate = WaterEquipment(WaterEquipNum)%TotalMassFlowRate
ELSE
ZoneNum = WaterEquipment(WaterEquipNum)%Zone
ZoneMAT = MAT(ZoneNum)
IF (WaterEquipment(WaterEquipNum)%SensibleFracSchedule == 0) THEN
WaterEquipment(WaterEquipNum)%SensibleRate = 0.0d0
WaterEquipment(WaterEquipNum)%SensibleEnergy = 0.0d0
ELSE
WaterEquipment(WaterEquipNum)%SensibleRate = GetCurrentScheduleValue(WaterEquipment(WaterEquipNum)%SensibleFracSchedule) &
* WaterEquipment(WaterEquipNum)%TotalMassFlowRate * CPHW(InitConvTemp) * (WaterEquipment(WaterEquipNum)%MixedTemp &
- ZoneMAT)
WaterEquipment(WaterEquipNum)%SensibleEnergy = WaterEquipment(WaterEquipNum)%SensibleRate * TimeStepSys * SecInHour
END IF
IF (WaterEquipment(WaterEquipNum)%LatentFracSchedule == 0) THEN
WaterEquipment(WaterEquipNum)%LatentRate = 0.0d0
WaterEquipment(WaterEquipNum)%LatentEnergy = 0.0d0
ELSE
ZoneHumRat = ZoneAirHumRat(ZoneNum)
ZoneHumRatSat = PsyWFnTdbRhPb(ZoneMAT, 1.0d0, OutBaroPress, 'CalcEquipmentDrainTemp') ! Humidratio at 100% relative humidity
RhoAirDry = PsyRhoAirFnPbTdbW(OutBaroPress, ZoneMAT, 0.0d0)
ZoneMassMax = (ZoneHumRatSat - ZoneHumRat) * RhoAirDry * Zone(ZoneNum)%Volume ! Max water that can be evaporated to zone
FlowMassMax = WaterEquipment(WaterEquipNum)%TotalMassFlowRate * TimeStepSys * SecInHour ! Max water in flow
MoistureMassMax = MIN(ZoneMassMax, FlowMassMax)
WaterEquipment(WaterEquipNum)%MoistureMass = GetCurrentScheduleValue(WaterEquipment(WaterEquipNum)%LatentFracSchedule) &
* MoistureMassMax
WaterEquipment(WaterEquipNum)%MoistureRate = WaterEquipment(WaterEquipNum)%MoistureMass / (TimeStepSys * SecInHour)
WaterEquipment(WaterEquipNum)%LatentRate = WaterEquipment(WaterEquipNum)%MoistureRate * PsyHfgAirFnWTdb(ZoneHumRat, ZoneMAT)
WaterEquipment(WaterEquipNum)%LatentEnergy = WaterEquipment(WaterEquipNum)%LatentRate * TimeStepSys * SecInHour
END IF
WaterEquipment(WaterEquipNum)%DrainMassFlowRate = WaterEquipment(WaterEquipNum)%TotalMassFlowRate &
- WaterEquipment(WaterEquipNum)%MoistureRate
IF (WaterEquipment(WaterEquipNum)%DrainMassFlowRate == 0.0d0) THEN
WaterEquipment(WaterEquipNum)%DrainTemp = WaterEquipment(WaterEquipNum)%MixedTemp
ELSE
WaterEquipment(WaterEquipNum)%DrainTemp = (WaterEquipment(WaterEquipNum)%TotalMassFlowRate * CPHW(InitConvTemp) &
* WaterEquipment(WaterEquipNum)%MixedTemp - WaterEquipment(WaterEquipNum)%SensibleRate &
- WaterEquipment(WaterEquipNum)%LatentRate) / (WaterEquipment(WaterEquipNum)%DrainMassFlowRate * CPHW(InitConvTemp))
END IF
END IF
RETURN
END SUBROUTINE CalcEquipmentDrainTemp