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 | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | InletDryBulb | |||
real(kind=r64), | intent(in) | :: | InletHumRat | |||
real(kind=r64), | intent(in) | :: | InletEnthalpy | |||
real(kind=r64), | intent(in) | :: | InletWetBulb | |||
real(kind=r64), | intent(in) | :: | AirMassFlowRatio | |||
real(kind=r64), | intent(in) | :: | WaterMassFlowRatio | |||
real(kind=r64), | intent(in) | :: | AirMassFlow | |||
real(kind=r64), | intent(in) | :: | CBF | |||
real(kind=r64), | intent(in) | :: | TotCapNom1 | |||
integer, | intent(in) | :: | CCapFTemp1 | |||
integer, | intent(in) | :: | CCapAirFFlow1 | |||
integer, | intent(in) | :: | CCapWaterFFlow1 | |||
real(kind=r64), | intent(in) | :: | TotCapNom2 | |||
integer, | intent(in) | :: | CCapFTemp2 | |||
integer, | intent(in) | :: | CCapAirFFlow2 | |||
integer, | intent(in) | :: | CCapWaterFFlow2 | |||
real(kind=r64), | intent(out) | :: | TotCap1 | |||
real(kind=r64), | intent(out) | :: | TotCap2 | |||
real(kind=r64), | intent(out) | :: | TotCapSpeed | |||
real(kind=r64), | intent(out) | :: | SHR | |||
real(kind=r64), | intent(in) | :: | CondInletTemp | |||
real(kind=r64), | intent(in) | :: | Pressure | |||
real(kind=r64), | intent(in) | :: | SpeedRatio | |||
integer, | intent(in) | :: | NumSpeeds |
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 CalcTotCapSHR_VSWSHP(InletDryBulb,InletHumRat,InletEnthalpy,InletWetBulb,AirMassFlowRatio, WaterMassFlowRatio, &
AirMassFlow,CBF, TotCapNom1,CCapFTemp1,CCapAirFFlow1, CCapWaterFFlow1,&
TotCapNom2,CCapFTemp2,CCapAirFFlow2, CCapWaterFFlow2,&
TotCap1, TotCap2, TotCapSpeed,SHR,CondInletTemp, Pressure, SpeedRatio, NumSpeeds)
! SUBROUTINE INFORMATION:
! AUTHOR Bo Shen, , based on DX:CalcTotCapSHR, introducing two speed levels
! DATE WRITTEN March 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculates total capacity and sensible heat ratio of a DX coil at the specified conditions
! METHODOLOGY EMPLOYED:
! With the rated performance data entered by the user, the model employs some of the
! DOE-2.1E curve fits to adjust the capacity and SHR of the unit as a function
! of entering air temperatures and supply air flow rate (actual vs rated flow). The model
! does NOT employ the exact same methodology to calculate performance as DOE-2, although
! some of the DOE-2 curve fits are employed by this model.
! The model checks for coil dryout conditions, and adjusts the calculated performance
! appropriately.
! REFERENCES:
! ASHRAE HVAC 2 Toolkit page 4-81.
!
! Henderson, H.I. Jr., K. Rengarajan and D.B. Shirey, III. 1992.The impact of comfort
! control on air conditioner energy use in humid climates. ASHRAE Transactions 98(2):
! 104-113.
!
! Henderson, H.I. Jr., Danny Parker and Y.J. Huang. 2000.Improving DOE-2's RESYS routine:
! User Defined Functions to Provide More Accurate Part Load Energy Use and Humidity
! Predictions. Proceedings of ACEEE Conference.
! USE STATEMENTS:
USE CurveManager, ONLY: CurveValue
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
REAL(r64), INTENT (IN) :: InletDryBulb ! inlet air dry bulb temperature [C]
REAL(r64), INTENT (IN) :: InletHumRat ! inlet air humidity ratio [kg water / kg dry air]
REAL(r64), INTENT (IN) :: InletEnthalpy ! inlet air specific enthalpy [J/kg]
REAL(r64), INTENT (IN) :: InletWetBulb ! inlet air wet bulb temperature [C]
REAL(r64), INTENT (IN) :: AirMassFlowRatio ! Ratio of actual air mass flow to nominal air mass flow
REAL(r64), INTENT (IN) :: WaterMassFlowRatio ! Ratio of actual water mass flow to nominal water mass flow
REAL(r64), INTENT (IN) :: AirMassFlow ! actual mass flow for capacity and SHR calculation
REAL(r64), INTENT (IN) :: CBF ! coil bypass factor
INTEGER, INTENT (IN) :: NumSpeeds ! number of speeds for input
REAL(r64), INTENT (IN) :: TotCapNom1 ! nominal total capacity at low speed [W]
INTEGER, INTENT (IN) :: CCapFTemp1 ! capacity modifier curve index, function of entering wetbulb at low speed
INTEGER, INTENT (IN) :: CCapAirFFlow1 ! capacity modifier curve, function of actual air flow vs rated flow at low speed
INTEGER, INTENT (IN) :: CCapWaterFFlow1 ! capacity modifier curve, function of actual water flow vs rated flow at low speed
REAL(r64), INTENT (IN) :: TotCapNom2 ! nominal total capacity at high speed [W]
INTEGER, INTENT (IN) :: CCapFTemp2 ! capacity modifier curve index, function of entering wetbulb at high speed
INTEGER, INTENT (IN) :: CCapAirFFlow2 ! capacity modifier curve, function of actual air flow vs rated flow at high speed
INTEGER, INTENT (IN) :: CCapWaterFFlow2 ! capacity modifier curve, function of actual water flow vs rated flow at high speed
REAL(r64), INTENT (OUT) :: TotCap1 ! total capacity at the given conditions [W] at low speed
REAL(r64), INTENT (OUT) :: TotCap2 ! total capacity at the given conditions [W] at high speed
REAL(r64), INTENT (OUT) :: TotCapSpeed ! integrated total capacity corresponding to the speed ratio
REAL(r64), INTENT (OUT) :: SHR ! sensible heat ratio at the given conditions
REAL(r64), INTENT (IN) :: CondInletTemp ! Condenser inlet temperature [C]
REAL(r64), INTENT (IN) :: Pressure ! air pressure [Pa]
REAL(r64), INTENT (IN) :: SpeedRatio ! from 0.0 to 1.0
! SUBROUTINE PARAMETER DEFINITIONS:
CHARACTER(len=*), PARAMETER :: RoutineName='CalcTotCapSHR_VSWSHP'
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: InletWetBulbCalc ! calculated inlet wetbulb temperature used for finding dry coil point [C]
REAL(r64) :: InletHumRatCalc ! calculated inlet humidity ratio used for finding dry coil point [kg water / kg dry air]
REAL(r64) :: TotCapTempModFac1
! Total capacity modifier (function of entering wetbulb, outside water inlet temp) at low speed
REAL(r64) :: TotCapAirFlowModFac1
! Total capacity modifier (function of actual supply air flow vs nominal flow) at low speed
REAL(r64) :: TotCapWaterFlowModFac1
! Total capacity modifier (function of actual supply water flow vs nominal flow) at low speed
REAL(r64) :: TotCapTempModFac2
! Total capacity modifier (function of entering wetbulb, outside water inlet temp) at high speed
REAL(r64) :: TotCapAirFlowModFac2
! Total capacity modifier (function of actual supply air flow vs nominal flow) at high speed
REAL(r64) :: TotCapWaterFlowModFac2
! Total capacity modifier (function of actual supply water flow vs nominal flow) at high speed
REAL(r64) :: hDelta ! Change in air enthalpy across the cooling coil [J/kg]
REAL(r64) :: hADP ! Apparatus dew point enthalpy [J/kg]
REAL(r64) :: tADP ! Apparatus dew point temperature [C]
REAL(r64) :: wADP ! Apparatus dew point humidity ratio [kg/kg]
REAL(r64) :: hTinwADP ! Enthalpy at inlet dry-bulb and wADP [J/kg]
REAL(r64) :: SHRCalc ! temporary calculated value of SHR
REAL(r64) :: TotCapCalc ! temporary calculated value of total capacity [W]
REAL(r64) :: TotCapCalc1 ! temporary calculated value of total capacity [W] at low speed
REAL(r64) :: TotCapCalc2 ! temporary calculated value of total capacity [W] at high speed
INTEGER :: Counter ! Counter for dry evaporator iterations
INTEGER :: MaxIter ! Maximum number of iterations for dry evaporator calculations
REAL(r64) :: RF ! Relaxation factor for dry evaporator iterations
REAL(r64) :: Tolerance ! Error tolerance for dry evaporator iterations
REAL(r64) :: werror ! Deviation of humidity ratio in dry evaporator iteration loop
LOGICAL :: LoopOn = .TRUE. ! flag to control the loop iteration
MaxIter = 30
RF = 0.4d0
Counter = 0
Tolerance = 0.01d0
werror = 0.0d0
InletWetBulbCalc = InletWetBulb
InletHumRatCalc = InletHumRat
LoopOn = .TRUE.
! DO WHILE (ABS(werror) .gt. Tolerance .OR. Counter == 0)
! Get capacity modifying factor (function of inlet wetbulb & outside drybulb) for off-rated conditions
DO WHILE(LoopOn)
TotCapTempModFac1 = CurveValue(CCapFTemp1,InletWetBulbCalc,CondInletTemp)
! Get capacity modifying factor (function of mass flow) for off-rated conditions
TotCapAirFlowModFac1 = CurveValue(CCapAirFFlow1,AirMassFlowRatio)
!Get capacity modifying factor (function of mass flow) for off-rated conditions
IF(CCapWaterFFlow1 .EQ. 0 ) THEN
TotCapWaterFlowModFac1 = 1.0d0
ELSE
TotCapWaterFlowModFac1 = CurveValue(CCapWaterFFlow1,WaterMassFlowRatio)
END IF
! Get total capacity
IF( NumSpeeds < 2 ) THEN !ONLY ONE SPEED
TotCapCalc = TotCapNom1 * TotCapAirFlowModFac1 * TotCapWaterFlowModFac1 * TotCapTempModFac1
TotCapCalc1 = TotCapCalc
TotCapCalc2 = 0.0d0
ELSE
TotCapTempModFac2 = CurveValue(CCapFTemp2,InletWetBulbCalc,CondInletTemp)
TotCapAirFlowModFac2 = CurveValue(CCapAirFFlow2,AirMassFlowRatio)
IF(CCapWaterFFlow2 .EQ. 0) THEN
TotCapWaterFlowModFac2 = 1.0d0
ELSE
TotCapWaterFlowModFac2 = CurveValue(CCapWaterFFlow2,WaterMassFlowRatio)
END IF
TotCapCalc1 = TotCapNom1 * TotCapAirFlowModFac1 * TotCapWaterFlowModFac1 * TotCapTempModFac1
TotCapCalc2 = TotCapNom2 * TotCapAirFlowModFac2 * TotCapWaterFlowModFac2 * TotCapTempModFac2
TotCapCalc = TotCapCalc2*SpeedRatio + (1.0d0 - SpeedRatio ) * TotCapCalc1
END IF
! Calculate apparatus dew point conditions using TotCap and CBF
hDelta = TotCapCalc/AirMassFlow
hADP = InletEnthalpy - hDelta/(1.d0-CBF)
tADP = PsyTsatFnHPb(hADP,Pressure)
wADP = PsyWFnTdbH(tADP,hADP)
hTinwADP = PsyHFnTdbW(InletDryBulb,wADP)
SHRCalc = MIN((hTinwADP-hADP)/(InletEnthalpy-hADP),1.d0)
!
! Check for dry evaporator conditions (win < wadp)
!
IF (wADP .gt. InletHumRatCalc .or. (Counter .ge. 1 .and. Counter .lt. MaxIter)) THEN
If(InletHumRatCalc == 0.0d0)InletHumRatCalc=0.00001d0
werror = (InletHumRatCalc - wADP)/InletHumRatCalc
!
! Increase InletHumRatCalc at constant inlet air temp to find coil dry-out point. Then use the
! capacity at the dry-out point to determine exiting conditions from coil. This is required
! since the TotCapTempModFac doesn't work properly with dry-coil conditions.
!
InletHumRatCalc = RF*wADP + (1.d0-RF)*InletHumRatCalc
InletWetBulbCalc = PsyTwbFnTdbWPb(InletDryBulb,InletHumRatCalc,Pressure)
Counter = Counter + 1
IF (ABS(werror) .gt. Tolerance) THEN
LoopOn = .TRUE. !go to 50 ! Recalculate with modified inlet conditions
ELSE
LoopOn = .FALSE.
END IF
ELSE
LoopOn = .FALSE.
END IF
END DO
! END DO
! Calculate full load output conditions
IF (SHRCalc .gt. 1.d0 .OR. Counter .gt. 0) SHRCalc = 1.d0
SHR = SHRCalc
TotCap1 = TotCapCalc1
TotCap2 = TotCapCalc2
TotCapSpeed = TotCapCalc
! IF(SHR < 0.3d0) SHR = 0.3d0
RETURN
END SUBROUTINE CalcTotCapSHR_VSWSHP