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) | :: | TESCoilNum |
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 CalcTESCoilChargeOnlyMode(TESCoilNum)
! SUBROUTINE INFORMATION:
! AUTHOR Brent Griffith
! DATE WRITTEN May 2013
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! <description>
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE CurveManager, ONLY: CurveValue
USE DataHVACGlobals, ONLY: TimeStepSys
USE FluidProperties, ONLY: GetSpecificHeatGlycol, GetDensityGlycol
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: TESCoilNum
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: sTES ! local state of Thermal Energy Storage (C or ice fraction)
REAL(r64) :: CondInletTemp ! Condenser inlet temperature (C). Outdoor dry-bulb temp for air-cooled condenser.
! Outdoor Wetbulb +(1 - effectiveness)*(outdoor drybulb - outdoor wetbulb) for evap condenser.
REAL(r64) :: CondInletHumrat ! Condenser inlet humidity ratio (kg/kg). Zero for air-cooled condenser.
! For evap condenser, its the humidity ratio of the air leaving the evap cooling pads.
REAL(r64) :: CondAirMassFlow ! Condenser air mass flow rate [kg/s]
REAL(r64) :: CondInletEnthalpy ! condenser inlet enthalpy [J/kg]
REAL(r64) :: CondAirSidePressure ! Outdoor barometric pressure at condenser (Pa)
REAL(r64) :: QdotCond ! condenser total heat rejection rate [W]
REAL(r64) :: CondOutletEnthalpy !condesner outlet enthalpy [J/kg]
REAL(r64) :: OutdoorDryBulb ! outdoor air dry bulb local variable [C]
REAL(r64) :: OutdoorHumRat ! outdoor air humidity ratio local [kg/kg]
REAL(r64) :: OutdoorWetBulb ! outdoor air wetbulb local [C]
REAL(r64) :: CapModFac ! local capacity modifying factor
REAL(r64) :: TotCap ! total cooling (charging) capacity
REAL(r64) :: EIRModFac ! local energy input ratio modifying factor
REAL(r64) :: EIR ! energy input ratio
REAL(r64) :: ElecCoolingPower ! compressor electric power
LOGICAL :: TESCanBeCharged ! true if room for tank to be charged.
REAL(r64) :: QdotChargeLimit ! limit for charge cooling power to hit limit of storage.
REAL(r64) :: rho ! density of fluid in tank (kg/m3)
REAL(r64) :: TankMass ! Mass of fluid in tank (kg)
REAL(r64) :: CpTank ! Specific heat of water in tank (J/kg K)
! nothing happens at Evaporator
Node(TESCoil(TESCoilNum)%EvapAirOutletNodeNum )%Temp = Node(TESCoil(TESCoilNum)%EvapAirInletNodeNum)%Temp
Node(TESCoil(TESCoilNum)%EvapAirOutletNodeNum )%HumRat = Node(TESCoil(TESCoilNum)%EvapAirInletNodeNum)%HumRat
Node(TESCoil(TESCoilNum)%EvapAirOutletNodeNum )%MassFlowRate = Node(TESCoil(TESCoilNum)%EvapAirInletNodeNum)%MassFlowRate
Node(TESCoil(TESCoilNum)%EvapAirOutletNodeNum)%Enthalpy = &
PsyHFnTdbW(Node(TESCoil(TESCoilNum)%EvapAirOutletNodeNum )%Temp, &
Node(TESCoil(TESCoilNum)%EvapAirOutletNodeNum )%HumRat, &
'CalcTESCoilChargeOnlyMode')
! first deal with condenser
IF (TESCoil(TESCoilNum)%CondenserType == AirCooled) THEN
CondAirSidePressure = Node(TESCoil(TESCoilNum)%CondAirInletNodeNum)%Press
IF(CondAirSidePressure == DefaultNodeValues%Press)THEN
CondInletTemp = OutDryBulbTemp
CondInletHumrat = OutHumRat
CondAirSidePressure = OutBaroPress
ELSE
CondInletTemp = Node(TESCoil(TESCoilNum)%CondAirInletNodeNum)%Temp
CondInletHumrat = Node(TESCoil(TESCoilNum)%CondAirInletNodeNum)%HumRat
ENDIF
CondAirMassFlow = TESCoil(TESCoilNum)%CondenserAirMassFlow
ELSEIF (TESCoil(TESCoilNum)%CondenserType == EvapCooled) THEN
CondAirSidePressure = Node(TESCoil(TESCoilNum)%CondAirInletNodeNum)%Press
IF(CondAirSidePressure == DefaultNodeValues%Press)THEN
OutdoorDryBulb = OutDryBulbTemp
OutdoorHumRat = OutHumRat
CondAirSidePressure = OutBaroPress
OutdoorWetBulb = OutWetBulbTemp
ELSE
OutdoorDryBulb = Node(TESCoil(TESCoilNum)%CondAirInletNodeNum)%Temp
OutdoorHumRat = Node(TESCoil(TESCoilNum)%CondAirInletNodeNum)%HumRat
OutdoorWetBulb = PsyTwbFnTdbWPb(OutdoorDryBulb, OutdoorHumRat, CondAirSidePressure, 'CalcTESCoilChargeOnlyMode')
ENDIF
CondAirMassFlow = TESCoil(TESCoilNum)%CondenserAirMassFlow
! direct evap cool model
CondInletTemp = OutdoorWetBulb + (OutdoorDryBulb-OutdoorWetBulb)*(1.0d0 - TESCoil(TESCoilNum)%EvapCondEffect)
CondInletHumrat = PsyWFnTdbTwbPb(CondInletTemp,OutdoorWetBulb,CondAirSidePressure, 'CalcTESCoilChargeOnlyMode')
ENDIF
IF (TESCoil(TESCoilNum)%StorageMedia == FluidBased) THEN
sTES = TESCoil(TESCoilNum)%FluidTankTempFinalLastTimestep
IF ((sTES > TESCoil(TESCoilNum)%MinimumFluidTankTempLimit) .AND. (sTES < TESCoil(TESCoilNum)%MaximumFluidTankTempLimit)) THEN
TESCanBeCharged = .TRUE.
!find charge limit to reach limits
rho = GetDensityGlycol(TESCoil(TESCoilNum)%StorageFluidName, sTES, &
TESCoil(TESCoilNum)%StorageFluidIndex, 'CalcTESCoilChargeOnlyMode')
TankMass = rho * TESCoil(TESCoilNum)%FluidStorageVolume
CpTank = GetSpecificHeatGlycol(TESCoil(TESCoilNum)%StorageFluidName, sTES, &
TESCoil(TESCoilNum)%StorageFluidIndex, 'CalcTESCoilChargeOnlyMode')
!simple linear approximation of DT/Dt term in McpDT/Dt
QdotChargeLimit = TankMass * CpTank * (sTES - TESCoil(TESCoilNum)%MinimumFluidTankTempLimit) &
/ (TimeStepSys * SecInHour)
ELSE
TESCanBeCharged = .FALSE.
ENDIF
ELSEIF (TESCoil(TESCoilNum)%StorageMedia == IceBased) THEN
sTES = TESCoil(TESCoilNum)%IceFracRemainLastTimestep
If (sTES < 1.d0 ) THEN
TESCanBeCharged = .TRUE.
!find charge limit to reach limit
QdotChargeLimit = (1.d0 - sTES) * TESCoil(TESCoilNum)%IceStorageCapacity / (TimeStepSys * SecInHour)
ELSE
TESCanBeCharged = .FALSE.
ENDIF
ENDIF
IF (TESCanBeCharged) THEN ! coil is running
CapModFac = CurveValue(TESCoil(TESCoilNum)%ChargeOnlyChargingCapFTempCurve,CondInletTemp , sTES)
CapModFac = MAX(0.d0, CapModFac)
TotCap = TESCoil(TESCoilNum)%ChargeOnlyRatedCapacity * CapModFac
IF (TotCap > QdotChargeLimit) THEN
TESCoil(TESCoilNum)%RuntimeFraction = QdotChargeLimit / TotCap
TotCap = MIN(TotCap, QdotChargeLimit)
ELSE
TESCoil(TESCoilNum)%RuntimeFraction = 1.d0
ENDIF
EIRModFac = CurveValue( TESCoil(TESCoilNum)%ChargeOnlyChargingEIRFTempCurve,CondInletTemp , sTES)
EIRModFac = MAX(0.d0, EIRModFac )
EIR = EIRModFac / TESCoil(TESCoilNum)%ChargeOnlyRatedCOP
ElecCoolingPower = TotCap * EIR
QdotCond = TotCap + ElecCoolingPower
Node(TESCoil(TESCoilNum)%CondAirInletNodeNum )%MassFlowRate = TESCoil(TESCoilNum)%CondenserAirMassFlow
Node(TESCoil(TESCoilNum)%CondAirOutletNodeNum )%MassFlowRate = TESCoil(TESCoilNum)%CondenserAirMassFlow
CondInletEnthalpy = PsyHFnTdbW(CondInletTemp, CondInletHumRat , 'CalcTESCoilChargeOnlyMode')
CondOutletEnthalpy = CondInletEnthalpy + QdotCond / TESCoil(TESCoilNum)%CondenserAirMassFlow
Node(TESCoil(TESCoilNum)%CondAirOutletNodeNum )%Temp = PsyTdbFnHW( CondOutletEnthalpy, CondInletHumrat, &
'CalcTESCoilChargeOnlyMode')
Node(TESCoil(TESCoilNum)%CondAirOutletNodeNum )%HumRat = CondInletHumrat
Node(TESCoil(TESCoilNum)%CondAirOutletNodeNum )%Enthalpy = CondOutletEnthalpy
TESCoil(TESCoilNum)%ElecCoolingPower = ElecCoolingPower + TESCoil(TESCoilNum)%AncillaryControlsPower
TESCoil(TESCoilNum)%ElecCoolingEnergy = TESCoil(TESCoilNum)%ElecCoolingPower * TimeStepSys *SecInHour
TESCoil(TESCoilNum)%QdotTES = - TotCap ! negative for cooling
ELSE !not running
TESCoil(TESCoilNum)%ElecCoolingPower = TESCoil(TESCoilNum)%AncillaryControlsPower
TESCoil(TESCoilNum)%ElecCoolingEnergy = TESCoil(TESCoilNum)%ElecCoolingPower * TimeStepSys *SecInHour
TESCoil(TESCoilNum)%RuntimeFraction = 0.d0
TESCoil(TESCoilNum)%QdotTES = 0.d0
Node(TESCoil(TESCoilNum)%CondAirOutletNodeNum )%Temp = Node(TESCoil(TESCoilNum)%CondAirInletNodeNum)%Temp
Node(TESCoil(TESCoilNum)%CondAirOutletNodeNum )%HumRat = Node(TESCoil(TESCoilNum)%CondAirInletNodeNum)%HumRat
Node(TESCoil(TESCoilNum)%CondAirInletNodeNum )%MassFlowRate = 0.d0
Node(TESCoil(TESCoilNum)%CondAirOutletNodeNum )%MassFlowRate = Node(TESCoil(TESCoilNum)%CondAirInletNodeNum)%MassFlowRate
Node(TESCoil(TESCoilNum)%CondAirOutletNodeNum )%Enthalpy = &
PsyHFnTdbW(Node(TESCoil(TESCoilNum)%CondAirOutletNodeNum )%Temp, &
Node(TESCoil(TESCoilNum)%CondAirOutletNodeNum )%HumRat, &
'CalcTESCoilChargeOnlyMode')
ENDIF
TESCoil(TESCoilNum)%Q_TES = TESCoil(TESCoilNum)%QdotTES * TimeStepSys * SecInHour
TESCoil(TESCoilNum)%EvapTotCoolingRate = 0.d0
TESCoil(TESCoilNum)%EvapTotCoolingEnergy = 0.d0
TESCoil(TESCoilNum)%EvapSensCoolingRate = 0.d0
TESCoil(TESCoilNum)%EvapSensCoolingEnergy = 0.d0
TESCoil(TESCoilNum)%EvapLatCoolingRate = 0.d0
TESCoil(TESCoilNum)%EvapLatCoolingEnergy = 0.d0
CALL UpdateTEStorage(TESCoilNum)
CALL UpdateColdWeatherProtection(TESCoilNum)
IF (TESCoil(TESCoilNum)%CondenserType == EvapCooled) THEN
CALL UpdateEvaporativeCondenserBasinHeater(TESCoilNum)
CALL UpdateEvaporativeCondenserWaterUse(TESCoilNum, CondInletHumrat, TESCoil(TESCoilNum)%CondAirInletNodeNum)
ENDIF
RETURN
END SUBROUTINE CalcTESCoilChargeOnlyMode