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) | :: | PVTnum |
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 CalcPVTcollectors(PVTnum)
! SUBROUTINE INFORMATION:
! AUTHOR Brent Griffith
! DATE WRITTEN August 2008
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculate PVT collector thermal
! METHODOLOGY EMPLOYED:
! Current model is "simple" fixed efficiency and simple night sky balance for cooling
! REFERENCES:
! na
! USE STATEMENTS:
USE DataHeatBalance, ONLY: VerySmooth, QRadSWOutIncident
USE Psychrometrics , ONLY: CPHW, PsyCpAirFnWTdb, PsyTwbFnTdbWPb, PsyTdpFnTdbTwbPb
USE DataGlobals, ONLY: SecInHour
USE DataHVACGlobals, ONLY: TimeStepSys
USE DataLoopNode , ONLY: Node
USE ScheduleManager, ONLY: GetCurrentScheduleValue
USE DataEnvironment, ONLY: OutDryBulbTemp, SkyTemp, OutBaroPress
USE ConvectionCoefficients, ONLY: InitExteriorConvectionCoeff
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: PVTnum
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: InletNode = 0
INTEGER :: OutletNode = 0
REAL(r64) :: Eff = 0.0D0
INTEGER :: SurfNum = 0
INTEGER :: RoughSurf = 0
REAL(r64) :: HcExt = 0.0D0
REAL(r64) :: HrSky = 0.0D0
REAL(r64) :: HrGround = 0.0D0
REAL(r64) :: HrAir = 0.0D0
REAL(r64) :: Tcollector = 0.0D0
REAL(r64) :: mdot = 0.0D0
REAL(r64) :: Tinlet = 0.0D0
REAL(r64) :: Winlet = 0.0D0
REAL(r64) :: CpInlet = 0.0D0
REAL(r64) :: PotentialOutletTemp = 0.0D0
REAL(r64) :: BypassFraction = 0.0D0
REAL(r64) :: PotentialHeatGain = 0.0D0
REAL(r64) :: WetBulbInlet = 0.0D0
REAL(r64) :: DewPointInlet = 0.0D0
! flow
SurfNum = PVT(PVTnum)%SurfNum
RoughSurf = VerySmooth
SELECT CASE (PVT(PVTnum)% WorkingFluidType)
CASE (LiquidWorkingFluid)
InletNode = PVT(PVTnum)%PlantInletNodeNum
OutletNode = PVT(PVTnum)%PlantOutletNodeNum
CASE (AirWorkingFluid)
InletNode = PVT(PVTnum)%HVACInletNodeNum
OutletNode = PVT(PVTnum)%HVACOutletNodeNum
END SELECT
mdot = PVT(PVTnum)%MassFlowRate
Tinlet = Node(InletNode)%Temp
IF (PVT(PVTnum)%PVTModelType == SimplePVTmodel) THEN
IF (PVT(PVTnum)%HeatingUseful .AND. PVT(PVTnum)%BypassDamperOff .AND. (mdot > 0.0D0)) THEN
SELECT CASE (PVT(PVTnum)%Simple%ThermEfficMode)
CASE (FixedThermEffic)
Eff = PVT(PVTnum)%Simple%ThermEffic
CASE (ScheduledThermEffic)
Eff = GetCurrentScheduleValue(PVT(PVTnum)%Simple%ThermEffSchedNum)
PVT(PVTnum)%Simple%ThermEffic = Eff
END SELECT
PotentialHeatGain = QRadSWOutIncident(SurfNum) * Eff * PVT(PVTnum)%AreaCol
IF ( PVT(PVTnum)%WorkingFluidType == AirWorkingFluid ) THEN
Winlet = Node(InletNode)%HumRat
CpInlet = PsyCpAirFnWTdb(Winlet,Tinlet, 'CalcPVTcollectors')
IF (mdot*CpInlet > 0.0D0) THEN
PotentialOutletTemp = Tinlet + PotentialHeatGain /(mdot * CpInlet)
ELSE
PotentialOutletTemp = Tinlet
ENDIF
!now compare heating potential to setpoint and figure bypass fraction
If (PotentialOutletTemp > Node(PVT(PVTnum)%HVACOutletNodeNum)%TempSetPoint) Then ! need to modulate
If (Tinlet /= PotentialOutletTemp) Then
BypassFraction = (Node(PVT(PVTnum)%HVACOutletNodeNum)%TempSetPoint - PotentialOutletTemp) &
/(Tinlet - PotentialOutletTemp)
ELSE
BypassFraction = 0.0D0
ENDIF
BypassFraction = MAX(0.0D0, BypassFraction)
PotentialOutletTemp = Node(PVT(PVTnum)%HVACOutletNodeNum)%TempSetPoint
PotentialHeatGain = mdot * PsyCpAirFnWTdb(Winlet,Tinlet, 'CalcPVTcollectors') &
*(PotentialOutletTemp - Tinlet)
ELSE
BypassFraction = 0.0D0
ENDIF
ELSEIf ( PVT(PVTnum)%WorkingFluidType == LiquidWorkingFluid ) THEN
CpInlet = CPHW(Tinlet)
IF (mdot * CpInlet /= 0.0D0) THEN ! protect divide by zero
PotentialOutletTemp = Tinlet + PotentialHeatGain/(mdot * CpInlet)
ELSE
PotentialOutletTemp = Tinlet
ENDIF
BypassFraction = 0.0D0
ENDIF
PVT(PVTnum)%Report%ThermEfficiency = Eff
PVT(PVTnum)%Report%ThermHeatGain = PotentialHeatGain
PVT(PVTnum)%Report%ThermPower = PVT(PVTnum)%Report%ThermHeatGain
PVT(PVTnum)%Report%ThermEnergy = PVT(PVTnum)%Report%ThermPower * TimeStepSys * SecInHour
PVT(PVTnum)%Report%ThermHeatLoss = 0.0D0
PVT(PVTnum)%Report%TinletWorkFluid = Tinlet
PVT(PVTnum)%Report%MdotWorkFluid = mdot
PVT(PVTnum)%Report%ToutletWorkFluid = PotentialOutletTemp
PVT(PVTnum)%Report%BypassStatus = BypassFraction
ELSEIF (PVT(PVTnum)%CoolingUseful .AND. PVT(PVTnum)%BypassDamperOff .AND. (mdot > 0.0D0 ) ) THEN
!calculate cooling using energy balance
CALL InitExteriorConvectionCoeff(SurfNum,0.0D0,RoughSurf,PVT(PVTnum)%Simple%SurfEmissivity, &
PVT(PVTnum)%Simple%LastCollectorTemp, &
HcExt,HrSky,HrGround,HrAir)
IF ( PVT(PVTnum)%WorkingFluidType == AirWorkingFluid ) THEN
Winlet = Node(InletNode)%HumRat
CpInlet = PsyCpAirFnWTdb(Winlet,Tinlet, 'CalcPVTcollectors')
WetBulbInlet = PsyTwbFnTdbWPb(Tinlet, Winlet, OutBaroPress, 'CalcPVTcollectors')
DewPointInlet = PsyTdpFnTdbTwbPb(Tinlet, WetBulbInlet, OutBaroPress, 'CalcPVTcollectors')
ELSEIf ( PVT(PVTnum)%WorkingFluidType == LiquidWorkingFluid ) THEN
CpInlet = CPHW(Tinlet)
ENDIF
Tcollector = ( 2.0D0 * mdot * CpInlet * Tinlet &
+ PVT(PVTnum)%AreaCol *( &
HrGround * OutDryBulbTemp &
+ HrSky * SkyTemp &
+ HrAir * Surface(SurfNum)%OutDryBulbTemp &
+ HcExt * Surface(SurfNum)%OutDryBulbTemp) ) &
/ (2.0D0 * mdot * CpInlet + PVT(PVTnum)%AreaCol *(HrGround + HrSky + HrAir + HcExt) )
PotentialOutletTemp = 2.0D0 * Tcollector - Tinlet
PVT(PVTnum)%Report%ToutletWorkFluid =PotentialOutletTemp
! trap for air not being cooled below its wetbulb.
IF ( PVT(PVTnum)%WorkingFluidType == AirWorkingFluid ) THEN
IF (PotentialOutletTemp < DewPointInlet) THEN
! water removal would be needed.. not going to allow that for now. limit cooling to dew point and model bypass
IF (Tinlet /= PotentialOutletTemp) THEN
BypassFraction = (DewPointInlet - PotentialOutletTemp) &
/(Tinlet - PotentialOutletTemp)
ELSE
BypassFraction = 0.0D0
ENDIF
BypassFraction = MAX(0.0D0, BypassFraction)
PotentialOutletTemp = DewPointInlet
ENDIF
ENDIF
PVT(PVTnum)%Report%MdotWorkFluid = mdot
PVT(PVTnum)%Report%TinletWorkFluid = Tinlet
PVT(PVTnum)%Report%ToutletWorkFluid = PotentialOutletTemp
PVT(PVTnum)%Report%ThermHeatLoss = mdot * CpInlet *(Tinlet - PVT(PVTnum)%Report%ToutletWorkFluid)
PVT(PVTnum)%Report%ThermHeatGain = 0.0D0
PVT(PVTnum)%Report%ThermPower = -1.0D0 * PVT(PVTnum)%Report%ThermHeatLoss
PVT(PVTnum)%Report%ThermEnergy = PVT(PVTnum)%Report%ThermPower * TimeStepSys * SecInHour
PVT(PVTnum)%Report%ThermEfficiency = 0.0D0
PVT(PVTnum)%Simple%LastCollectorTemp = Tcollector
PVT(PVTnum)%Report%BypassStatus = 0.0D0
ELSEIF (.NOT. PVT(PVTnum)%BypassDamperOff) THEN ! bypassed, zero things out
PVT(PVTnum)%Report%TinletWorkFluid = Tinlet
PVT(PVTnum)%Report%ToutletWorkFluid = Tinlet
PVT(PVTnum)%Report%ThermHeatLoss = 0.0D0
PVT(PVTnum)%Report%ThermHeatGain = 0.0D0
PVT(PVTnum)%Report%ThermPower = 0.0D0
PVT(PVTnum)%Report%ThermEfficiency = 0.0D0
PVT(PVTnum)%Report%ThermEnergy = 0.0D0
PVT(PVTnum)%Report%BypassStatus = 1.0D0
PVT(PVTnum)%Report%MdotWorkFluid = mdot
ELSE
PVT(PVTnum)%Report%TinletWorkFluid = Tinlet
PVT(PVTnum)%Report%ToutletWorkFluid = Tinlet
PVT(PVTnum)%Report%ThermHeatLoss = 0.0D0
PVT(PVTnum)%Report%ThermHeatGain = 0.0D0
PVT(PVTnum)%Report%ThermPower = 0.0D0
PVT(PVTnum)%Report%ThermEfficiency = 0.0D0
PVT(PVTnum)%Report%ThermEnergy = 0.0D0
PVT(PVTnum)%Report%BypassStatus = 1.0D0
PVT(PVTnum)%Report%MdotWorkFluid = mdot
ENDIF
ENDIF
RETURN
END SUBROUTINE CalcPVTcollectors