Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | WindACNum | |||
integer, | intent(in) | :: | ZoneNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=r64), | intent(out) | :: | PowerMet | |||
real(kind=r64), | intent(in) | :: | QZnReq | |||
real(kind=r64), | intent(out) | :: | LatOutputProvided |
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 SimCyclingWindowAC(WindACNum,ZoneNum,FirstHVACIteration,PowerMet,QZnReq,LatOutputProvided)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN May 2000
! MODIFIED Buhl/Shirey Mar 2001, Shirey Aug 2009 (LatOutputProvided)
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Simulate a cycling window air conditioner unit; adjust its output to match the
! remaining zone load.
! METHODOLOGY EMPLOYED:
! If unit is on, calls ControlWindACOutput to obtain the desired unit output
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT (IN) :: FirstHVACIteration ! TRUE if 1st HVAC simulation of system timestep
INTEGER, INTENT (IN) :: WindACNum ! number of the current window AC unit being simulated
INTEGER, INTENT (IN) :: ZoneNum ! number of zone being served !unused1208
REAL(r64), INTENT (OUT) :: PowerMet ! Sensible power supplied (W)
REAL(r64), INTENT (IN) :: QZnReq ! Sensible load to be met (W)
REAL(r64), INTENT (OUT) :: LatOutputProvided ! Latent power supplied (kg/s), negative = dehumidification
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: PartLoadFrac ! unit part load fraction
REAL(r64) :: QUnitOut ! Dry air sens. cooling provided by AC unit [watts]
REAL(r64) :: SensCoolOut ! Moist air sensible cooling rate [W]
REAL(r64) :: LatentOutput ! Latent (moisture) add/removal rate, negative is dehumidification [kg/s]
LOGICAL :: UnitOn ! TRUE if unit is on
LOGICAL :: CoilOn ! TRUE if coil is on
INTEGER :: OutletNode ! unit air outlet node
INTEGER :: InletNode ! unit air inlet node
REAL(r64) :: QTotUnitOut ! total unit output [watts]
REAL(r64) :: AirMassFlow ! air mass flow rate [kg/sec]
REAL(r64) :: CpAir ! inlet air specific heat [J/kg-C]
REAL(r64) :: Test
INTEGER :: OpMode ! operating mode (fan cycling or continious; DX coil always cycles)
REAL(r64) :: MinHumRat ! minimum of inlet & outlet humidity ratio
LOGICAL :: HXUnitOn ! Used to control HX heat recovery as needed
REAL(r64) :: SpecHumOut ! Specific humidity ratio of outlet air (kg moisture / kg moist air)
REAL(r64) :: SpecHumIn ! Specific humidity ratio of inlet air (kg moisture / kg moist air)
! zero the fan and DX coil electricity consumption
FanElecPower = 0.0d0
DXElecCoolingPower = 0.0d0
! initialize local variables
UnitOn = .TRUE.
CoilOn = .TRUE.
QUnitOut = 0.0d0
LatentOutput = 0.0d0
OutletNode = WindAC(WindACNum)%AirOutNode
InletNode = WindAC(WindACNum)%AirInNode
AirMassFlow = Node(InletNode)%MassFlowRate
test = airmassflow
CpAir = PsyCpAirFnWTdb(Node(InletNode)%HumRat,Node(InletNode)%Temp)
OpMode = WindAC(WindACNum)%OpMode
! set the on/off flags
IF (WindAC(WindACNum)%OPMode == CycFanCycCoil) THEN
! cycling unit: only runs if there is a load.
IF ( .NOT. CoolingLoad .OR. AirMassFlow < SmallMassFlow ) THEN
UnitOn = .FALSE.
CoilOn = .FALSE.
END IF
ELSE IF (WindAC(WindACNum)%OPMode == ContFanCycCoil) THEN
! continuous unit: fan runs if scheduled on; coil runs only if cooling load
IF (AirMassFlow.LT.SmallMassFlow) THEN
UnitOn = .FALSE.
CoilON = .FALSE.
ELSE IF ( .NOT. CoolingLoad) THEN
CoilOn = .FALSE.
END IF
END IF
OnOffFanPartLoadFraction = 1.0d0
IF (UnitOn .AND. CoilOn) THEN
HXUnitOn = .FALSE.
CALL ControlCycWindACOutput(WindACNum,FirstHVACIteration,OpMode,QZnReq,PartLoadFrac,HXUnitOn)
ELSE
PartLoadFrac = 0.0d0
HXUnitOn = .FALSE.
END IF
WindAC(WindACNum)%PartLoadFrac = PartLoadFrac
CALL CalcWindowACOutput(WindACNum,FirstHVACIteration,OpMode,PartLoadFrac,HXUnitOn,QUnitOut)
! Reseting AirMassFlow to inlet node mass flow rate since inlet mass flow rate may be getting
! manipulated in subroutine CalcWindowACOutput
AirMassFlow = Node(InletNode)%MassFlowRate
MinHumRat = MIN(Node(InletNode)%HumRat,Node(OutletNode)%HumRat)
QUnitOut = AirMassFlow * (PsyHFnTdbW(Node(OutletNode)%Temp,MinHumRat) &
- PsyHFnTdbW(Node(InletNode)%Temp,MinHumRat))
SensCoolOut = AirMassFlow * (PsyHFnTdbW(Node(OutletNode)%Temp,MinHumRat) - &
PsyHFnTdbW(Node(InletNode)%Temp,MinHumRat))
! CR9155 Remove specific humidity calculations
SpecHumOut = Node(OutletNode)%HumRat
SpecHumIn = Node(InletNode)%HumRat
LatentOutput = AirMassFlow * (SpecHumOut - SpecHumIn) ! Latent rate, kg/s
QTotUnitOut = AirMassFlow * (Node(OutletNode)%Enthalpy - Node(InletNode)%Enthalpy)
! report variables
WindAC(WindACNum)%CompPartLoadRatio = WindAC(WindACNum)%PartLoadFrac
IF (WindAC(WindACNum)%OpMode .EQ. CycFanCycCoil) THEN
WindAC(WindACNum)%FanPartLoadRatio = WindAC(WindACNum)%PartLoadFrac
ELSE
IF (UnitOn) THEN
WindAC(WindACNum)%FanPartLoadRatio = 1.0d0
ELSE
WindAC(WindACNum)%FanPartLoadRatio = 0.0d0
END IF
END IF
WindAC(WindACNum)%SensCoolEnergyRate = ABS(MIN(0.0d0,SensCoolOut))
WindAC(WindACNum)%TotCoolEnergyRate = ABS(MIN(0.0d0,QTotUnitOut))
WindAC(WindACNum)%SensCoolEnergyRate = MIN(WindAC(WindACNum)%SensCoolEnergyRate,WindAC(WindACNum)%TotCoolEnergyRate)
WindAC(WindACNum)%LatCoolEnergyRate = WindAC(WindACNum)%TotCoolEnergyRate - WindAC(WindACNum)%SensCoolEnergyRate
WindAC(WindACNum)%ElecPower = FanElecPower + DXElecCoolingPower
PowerMet = QUnitOut
LatOutputProvided = LatentOutput
RETURN
END SUBROUTINE SimCyclingWindowAC