SUBROUTINE InitWaterCoil(CoilNum,FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Richard J. Liesen
! DATE WRITTEN February 1998
! MODIFIED April 2004: Rahul Chillar
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initializations of the WaterCoil Components.
! METHODOLOGY EMPLOYED:
! Uses the status flags to trigger initializations.
! REFERENCES:
! USE STATEMENTS:
USE General, ONLY: RoundSigDigits, SolveRegulaFalsi, Iterate, &
SafeDivide
USE DataSizing, ONLY: AutoSize
USE OutputReportPredefined
USE DataPlant, ONLY : ScanPlantLoopsForObject
USE PlantUtilities, ONLY : InitComponentNodes, RegisterPlantCompDesignFlow
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: CoilNum
LOGICAL, INTENT (IN):: FirstHVACIteration !unused1208
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: SmallNo = 1.d-9 ! SmallNo number in place of zero
REAL(r64), PARAMETER :: LargeNo =1.d20 ! Large number in place of infinity
INTEGER, PARAMETER :: itmax =10
INTEGER, PARAMETER :: MaxIte = 500 ! Maximum number of iterations
REAL(r64), PARAMETER :: Acc = 0.0001d0 ! Accuracy of result
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) DesInletAirEnth ! Entering air enthalpy at rating (J/kg)
REAL(r64) DesOutletAirEnth ! Leaving air enthalpy at rating(J/kg)
REAL(r64) DesAirApparatusDewPtEnth ! Air enthalpy at apparatus dew point at rating(J/kg)
REAL(r64) DesSatEnthAtWaterInTemp ! Saturated enthalpy at entering liquid temp(J/kg)
REAL(r64) DesHumRatAtWaterInTemp ! Enthalpy at water inlet temp and entering air HumRat (J/kg)
REAL(r64) CapacitanceAir ! Air-side capacity rate(W/C)
REAL(r64) DesAirTempApparatusDewPt ! Temperature apparatus dew point at design capacity
REAL(r64) DesAirHumRatApparatusDewPt ! Humdity Ratio at apparatus dew point at design capacity
REAL(r64) DesByPassFactor ! ByPass Factor at design condition
REAL(r64) SlopeTempVsHumRatio ! Ratio temperature difference to humidity difference
! between entering and leaving air states
REAL(r64) TempApparatusDewPtEstimate ! Estimate of TAdp from SlopeTempVsHumRatio
REAL(r64) Y1 ! Previous values of dependent variable in ITERATE
REAL(r64) X1 ! Previous values of independent variable in ITERATE
REAL(r64) error ! Deviation of dependent variable in iteration
INTEGER iter ! Iteration counter
INTEGER icvg ! Iteration convergence flag
REAL(r64) ResultX ! Output variable from ITERATE function.
INTEGER :: Ipass ! loop index for App_Dewpoint_Loop
REAL(r64) :: TOutNew = 0.0d0 ! reset outlet air temperature for Coil:Cooling:Water
REAL(r64) :: WOutNew = 0.0d0 ! reset outlet air humidity ratio for Coil:Cooling:Water
INTEGER :: AirInletNode
INTEGER :: WaterInletNode
INTEGER :: WaterOutletNode
REAL(r64), SAVE, ALLOCATABLE, DIMENSION(:) :: DesCpAir ! CPAir at Design Inlet Air Temp
REAL(r64), SAVE, ALLOCATABLE, DIMENSION(:) :: DesUARangeCheck ! Value for range check based on Design Inlet Air Humidity Ratio
LOGICAL,SAVE :: MyOneTimeFlag = .true.
LOGICAL, ALLOCATABLE,Save, DIMENSION(:) :: MyEnvrnFlag
LOGICAL, ALLOCATABLE,Save, DIMENSION(:) :: MyCoilReportFlag
LOGICAL, ALLOCATABLE,Save, DIMENSION(:) :: PlantLoopScanFlag
REAL(r64), DIMENSION(5) :: CoefSeries
REAL(r64) :: FinDiamVar
REAL(r64) :: TubeToFinDiamRatio
REAL(r64) :: RhoAirStd ! density of air at standard conditions
REAL(r64) :: CpAirStd ! specific heat of air at std conditions
INTEGER :: SolFla ! Flag of solver
REAL(r64) :: UA0 ! lower bound for UA
REAL(r64) :: UA1 ! upper bound for UA
REAL(r64) :: UA
REAL(r64), DIMENSION(4) :: Par
LOGICAL :: NoSatCurveIntersect = .FALSE. ! TRUE if failed to find appatatus dew-point
LOGICAL :: BelowInletWaterTemp = .FALSE. ! TRUE if apparatus dew-point below design inlet water temperature
LOGICAL :: CBFTooLarge = .FALSE. ! TRUE if the coil bypass factor is unrealistically large
LOGICAL :: NoExitCondReset = .FALSE. ! TRUE if exit condition reset is not to be done
REAL(r64) :: RatedLatentCapacity = 0.0d0 ! latent cooling capacity at the rating point [W]
REAL(r64) :: RatedSHR = 0.0d0 ! sensible heat ratio at the rating point
REAL(r64) :: CapacitanceWater = 0.0d0 ! capacitance of the water stream [W/K]
REAL(r64) :: CMin = 0.0d0 ! minimum capacitance of 2 streams [W/K]
REAL(r64) :: CoilEffectiveness = 0.0d0 ! effectiveness of the coil (rated)
REAL(r64) :: SurfaceArea = 0.0d0 ! heat exchanger surface area, [m2]
REAL(r64) :: UATotal = 0.0d0 ! heat exchanger UA total, [W/C]
LOGICAL,SAVE,DIMENSION(2) :: RptCoilHeaderFlag=.true.
REAL(r64) :: x_a ! result of Eq.70 in Wetter 1999
REAL(r64) :: x_w ! result of Eq.72 in Wetter 1999
REAL(r64) :: AirConvectTerm ! result of Eq.71 in Wetter 1999
REAL(r64) :: WaterConvectTerm ! result of Eq.73 in Wetter 1999
REAL(r64) :: WaterConvSensitivity ! "s" in Wetter 1999, temperature sensitivity in water side convection
REAL(r64) :: DesUACoilExternalEnth ! enthalpy based UAExternal for wet coil surface {kg/s}
REAL(r64) :: LogMeanEnthDiff ! long mean enthalpy difference {J/kg}
REAL(r64) :: LogMeanTempDiff ! long mean temperature difference {C}
REAL(r64) :: DesOutletWaterTemp
REAL(r64) :: DesSatEnthAtWaterOutTemp
REAL(r64) :: DesEnthAtWaterOutTempAirInHumRat
REAL(r64) :: DesEnthWaterOut
REAL(r64) :: Cp ! local fluid specific heat
REAL(r64) :: rho ! local fluid density
LOGICAL :: errFlag
REAL(r64) :: EnthCorrFrac = 0.0d0 ! enthalpy correction factor
REAL(r64) :: TempCorrFrac = 0.0d0 ! temperature correction factor
! FLOW:
IF (MyOneTimeFlag) THEN
! initialize the environment and sizing flags
ALLOCATE(MyEnvrnFlag(NumWaterCoils))
ALLOCATE(MySizeFlag(NumWaterCoils))
ALLOCATE(CoilWarningOnceFlag(NumWaterCoils))
ALLOCATE(DesCpAir(NumWaterCoils))
ALLOCATE(MyUAAndFlowCalcFlag(NumWaterCoils))
ALLOCATE(MyCoilDesignFlag(NumWaterCoils))
ALLOCATE(MyCoilReportFlag(NumWaterCoils))
ALLOCATE(DesUARangeCheck(NumWaterCoils))
ALLOCATE(PlantLoopScanFlag(NumWaterCoils))
DesCpAir=0.0d0
DesUARangeCheck=0.0d0
MyEnvrnFlag = .TRUE.
MySizeFlag = .TRUE.
CoilWarningOnceFlag = .TRUE.
MyUAAndFlowCalcFlag = .TRUE.
MyCoilDesignFlag = .TRUE.
MyCoilReportFlag =.true.
MyOneTimeFlag = .false.
PlantLoopScanFlag = .TRUE.
END IF
IF (PlantLoopScanFlag(CoilNum) .AND. ALLOCATED(PlantLoop)) THEN
errFlag=.false.
CALL ScanPlantLoopsForObject(WaterCoil(CoilNum)%Name, &
WaterCoil(CoilNum)%WaterCoilType_Num, &
WaterCoil(CoilNum)%WaterLoopNum, &
WaterCoil(CoilNum)%WaterLoopSide, &
WaterCoil(CoilNum)%WaterLoopBranchNum, &
WaterCoil(CoilNum)%WaterLoopCompNum, &
errFlag=errFlag)
IF (errFlag) THEN
CALL ShowFatalError('InitWaterCoil: Program terminated for previous conditions.')
ENDIF
PlantLoopScanFlag(CoilNum) = .FALSE.
ENDIF
IF ( .NOT. SysSizingCalc .AND. MySizeFlag(CoilNum)) THEN
! for each coil, do the sizing once.
CALL SizeWaterCoil(CoilNum)
MySizeFlag(CoilNum) = .FALSE.
END IF
rho = GetDensityGlycol(PlantLoop(WaterCoil(CoilNum)%WaterLoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(WaterCoil(CoilNum)%WaterLoopNum)%FluidIndex, &
'InitWaterCoil')
! Do the Begin Environment initializations
IF (BeginEnvrnFlag .and. MyEnvrnFlag(CoilNum)) THEN
!Initialize all report variables to a known state at beginning of simulation
WaterCoil(CoilNum)%TotWaterHeatingCoilEnergy = 0.0d0
WaterCoil(CoilNum)%TotWaterCoolingCoilEnergy = 0.0d0
WaterCoil(CoilNum)%SenWaterCoolingCoilEnergy = 0.0d0
WaterCoil(CoilNum)%TotWaterHeatingCoilRate = 0.0d0
WaterCoil(CoilNum)%TotWaterCoolingCoilRate = 0.0d0
WaterCoil(CoilNum)%SenWaterCoolingCoilRate = 0.0d0
! The rest of the one time initializations
AirInletNode = WaterCoil(CoilNum)%AirInletNodeNum
WaterInletNode = WaterCoil(CoilNum)%WaterInletNodeNum
WaterOutletNode = WaterCoil(CoilNum)%WaterOutletNodeNum
DesCpAir(CoilNum) = PsyCpAirFnWTdb(0.0d0,WaterCoil(CoilNum)%DesInletAirTemp)
DesUARangeCheck(CoilNum) = (-1568.6d0*WaterCoil(CoilNum)%DesInletAirHumRat + 20.157d0)
IF (WaterCoil(CoilNum)%WaterCoilType == CoilType_Cooling) THEN ! 'Cooling'
Node(WaterInletNode)%Temp = 5.0d0
Cp = GetSpecificHeatGlycol(PlantLoop(WaterCoil(CoilNum)%WaterLoopNum)%FluidName, &
Node(WaterInletNode)%Temp, &
PlantLoop(WaterCoil(CoilNum)%WaterLoopNum)%FluidIndex, &
'InitWaterCoil')
Node(WaterInletNode)%Enthalpy = Cp * Node(WaterInletNode)%Temp
Node(WaterInletNode)%Quality = 0.0d0
Node(WaterInletNode)%Press = 0.0d0
Node(WaterInletNode)%HumRat = 0.0d0
END IF
IF (WaterCoil(CoilNum)%WaterCoilType == CoilType_Heating) THEN ! 'Heating'
Node(WaterInletNode)%Temp = 60.0d0
Cp = GetSpecificHeatGlycol(PlantLoop(WaterCoil(CoilNum)%WaterLoopNum)%FluidName, &
Node(WaterInletNode)%Temp, &
PlantLoop(WaterCoil(CoilNum)%WaterLoopNum)%FluidIndex, &
'InitWaterCoil')
Node(WaterInletNode)%Enthalpy = Cp* Node(WaterInletNode)%Temp
Node(WaterInletNode)%Quality = 0.0d0
Node(WaterInletNode)%Press = 0.0d0
Node(WaterInletNode)%HumRat = 0.0d0
IF ( (WaterCoil(CoilNum)%DesTotWaterCoilLoad .NE. AutoSize) .AND. MyUAAndFlowCalcFlag(CoilNum) ) THEN
! calculate design water flow rate
IF ( (WaterCoil(CoilNum)%CoilPerfInpMeth == NomCap) .OR. (WaterCoil(CoilNum)%CoilPerfInpMeth == UAandFlow .AND. &
WaterCoil(CoilNum)%MaxWaterVolFlowRate .EQ. AutoSize) ) THEN
! check for very small heating capacity
IF (WaterCoil(CoilNum)%DesTotWaterCoilLoad > SmallLoad) THEN
WaterCoil(CoilNum)%MaxWaterVolFlowRate = WaterCoil(CoilNum)%DesTotWaterCoilLoad / (Cp * &
rho * (WaterCoil(CoilNum)%DesInletWaterTemp - WaterCoil(CoilNum)%DesOutletWaterTemp))
! save the design water volumetric flow rate for use by the water loop sizing algorithms
CALL RegisterPlantCompDesignFlow(WaterCoil(CoilNum)%WaterInletNodeNum,WaterCoil(CoilNum)%MaxWaterVolFlowRate)
ELSE
WaterCoil(CoilNum)%MaxWaterVolFlowRate = 0.0d0
END IF
END IF
! calculate the coil UA
IF ( (WaterCoil(CoilNum)%CoilPerfInpMeth == NomCap) .OR. (WaterCoil(CoilNum)%CoilPerfInpMeth == UAandFlow .AND. &
WaterCoil(CoilNum)%UACoil .EQ. AutoSize) ) THEN
! check for very small heating capacity
IF (WaterCoil(CoilNum)%DesTotWaterCoilLoad > SmallLoad) THEN
RhoAirStd = StdRhoAir
CpAirStd = PsyCpAirFnWTdb(0.0d0,20.0d0)
Par(1) = WaterCoil(CoilNum)%DesTotWaterCoilLoad
Par(2) = REAL(CoilNum,r64)
Par(3) = REAL(ContFanCycCoil,r64) !fan operating mode
Par(4) = 1.0d0 ! part-load ratio
WaterCoil(CoilNum)%InletAirTemp = WaterCoil(CoilNum)%DesInletAirTemp
WaterCoil(CoilNum)%InletAirHumRat = 0.008d0
WaterCoil(CoilNum)%InletWaterTemp = WaterCoil(CoilNum)%DesInletWaterTemp
WaterCoil(CoilNum)%InletWaterMassFlowRate = rho * WaterCoil(CoilNum)%MaxWaterVolFlowRate
WaterCoil(CoilNum)%InletAirMassFlowRate = WaterCoil(CoilNum)%DesTotWaterCoilLoad / (CpAirStd * &
(WaterCoil(CoilNum)%DesOutletAirTemp - WaterCoil(CoilNum)%DesInletAirTemp))
WaterCoil(CoilNum)%DesAirVolFlowRate = WaterCoil(CoilNum)%InletAirMassFlowRate / RhoAirStd
! set the lower and upper limits on the UA
UA0 = .001d0 * WaterCoil(CoilNum)%DesTotWaterCoilLoad
UA1 = WaterCoil(CoilNum)%DesTotWaterCoilLoad
! Invert the simple heating coil model: given the design inlet conditions and the design load, fins the design UA
CALL SolveRegulaFalsi(Acc, MaxIte, SolFla, UA, SimpleHeatingCoilUAResidual, UA0, UA1, Par)
! if the numerical inversion failed, issue error messages.
IF (SolFla == -1) THEN
CALL ShowSevereError('Calculation of heating coil UA failed for coil '//TRIM(WaterCoil(CoilNum)%Name))
CALL ShowContinueError(' Iteration limit exceeded in calculating coil UA')
CALL ShowFatalError('Preceding error causes program termination')
ELSE IF (SolFla == -2) THEN
CALL ShowSevereError('Calculation of heating coil UA failed for coil '//TRIM(WaterCoil(CoilNum)%Name))
CALL ShowContinueError(' Bad starting values for UA')
CALL ShowFatalError('Preceding error causes program termination')
END IF
WaterCoil(CoilNum)%UACoil = UA
ELSE
WaterCoil(CoilNum)%UACoil = 1.0d0
END IF
END IF
END IF
MyUAAndFlowCalcFlag(CoilNum) = .FALSE.
!fill values for variable UA
CpAirStd = PsyCpAirFnWTdb(0.0d0,20.0d0)
WaterCoil(CoilNum)%DesAirMassFlowRate = StdRhoAir * WaterCoil(CoilNum)%DesAirVolFlowRate
WaterCoil(CoilNum)%LiquidSideNominalConvect = WaterCoil(CoilNum)%UACoil &
* (WaterCoil(CoilNum)%RatioAirSideToWaterSideConvect + 1)&
/WaterCoil(CoilNum)%RatioAirSideToWaterSideConvect
WaterCoil(CoilNum)%AirSideNominalConvect = WaterCoil(CoilNum)%RatioAirSideToWaterSideConvect &
* WaterCoil(CoilNum)%LiquidSideNominalConvect
ELSE
MyUAAndFlowCalcFlag(CoilNum) = .FALSE.
END IF
WaterCoil(CoilNum)%MaxWaterMassFlowRate = rho * WaterCoil(CoilNum)%MaxWaterVolFlowRate
Call InitComponentNodes(0.d0,WaterCoil(CoilNum)%MaxWaterMassFlowRate, &
WaterCoil(CoilNum)%WaterInletNodeNum, &
WaterCoil(CoilNum)%WaterOutletNodeNum, &
WaterCoil(CoilNum)%WaterLoopNum, &
WaterCoil(CoilNum)%WaterLoopSide, &
WaterCoil(CoilNum)%WaterLoopBranchNum, &
WaterCoil(CoilNum)%WaterLoopCompNum )
! effective fin diameter for detailed flat fin coil
IF (WaterCoil(CoilNum)%WaterCoilModel == CoilModel_Detailed) THEN ! 'DETAILED FLAT FIN'
WaterCoil(CoilNum)%EffectiveFinDiam = SQRT(4.d0 * WaterCoil(CoilNum)%FinDiam * &
WaterCoil(CoilNum)%CoilDepth &
/ (Pi * WaterCoil(CoilNum)%NumOfTubeRows * &
WaterCoil(CoilNum)%NumOfTubesPerRow))
! calculate fixed geometric parameters of the coil:
! Total Area
WaterCoil(CoilNum)%TotCoilOutsideSurfArea = WaterCoil(CoilNum)%TubeOutsideSurfArea + &
WaterCoil(CoilNum)%FinSurfArea
! Effective Tube Inside Diameter - the model assumes that the coil
! can be simulated as a tube with an equivalent hydraulic diameter.
WaterCoil(CoilNum)%CoilEffectiveInsideDiam = 4.d0 * WaterCoil(CoilNum)%MinAirFlowArea * &
WaterCoil(CoilNum)%CoilDepth / &
WaterCoil(CoilNum)%TotCoilOutsideSurfArea
! Ratio of tube outside diameter to effective fin diameter should always
! be less than 1
TubeToFinDiamRatio = WaterCoil(CoilNum)%TubeOutsideDiam / WaterCoil(CoilNum)%EffectiveFinDiam
IF (TubeToFinDiamRatio > 1.0d0) THEN
CALL ShowWarningError('InitWaterCoil: Detailed Flat Fin Coil, TubetoFinDiamRatio > 1.0, ['// &
TRIM(RoundSigDigits(TubeToFinDiamRatio,4))//']')
! reset tube depth spacing and recalc dependent parameters
WaterCoil(CoilNum)%TubeDepthSpacing = WaterCoil(CoilNum)%TubeDepthSpacing * (TubeToFinDiamRatio**2 + 0.1d0)
WaterCoil(CoilNum)%CoilDepth = WaterCoil(CoilNum)%TubeDepthSpacing * WaterCoil(CoilNum)%NumofTubeRows
WaterCoil(CoilNum)%EffectiveFinDiam = SQRT(4.d0 * WaterCoil(CoilNum)%FinDiam * &
WaterCoil(CoilNum)%CoilDepth &
/ (Pi * WaterCoil(CoilNum)%NumOfTubeRows * &
WaterCoil(CoilNum)%NumOfTubesPerRow))
WaterCoil(CoilNum)%CoilEffectiveInsideDiam = 4.d0 * WaterCoil(CoilNum)%MinAirFlowArea * &
WaterCoil(CoilNum)%CoilDepth / &
WaterCoil(CoilNum)%TotCoilOutsideSurfArea
TubeToFinDiamRatio = WaterCoil(CoilNum)%TubeOutsideDiam / WaterCoil(CoilNum)%EffectiveFinDiam
CALL ShowContinueError(' Resetting tube depth spacing to ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%TubeDepthSpacing,4)) // &
' meters')
CALL ShowContinueError(' Resetting coil depth to ' // TRIM(RoundSigDigits(WaterCoil(CoilNum)%CoilDepth,4)) // &
' meters')
ENDIF
CALL CalcDryFinEffCoef(TubeToFinDiamRatio, CoefSeries)
WaterCoil(CoilNum)%DryFinEfficncyCoef = CoefSeries
FinDiamVar = 0.5d0 * (WaterCoil(CoilNum)%EffectiveFinDiam - WaterCoil(CoilNum)%TubeOutsideDiam)
WaterCoil(CoilNum)%GeometryCoef1 = 0.159d0 * (WaterCoil(CoilNum)%FinThickness / &
WaterCoil(CoilNum)%CoilEffectiveInsideDiam)**(-0.065d0) &
* (WaterCoil(CoilNum)%FinThickness/FinDiamVar)**0.141d0
WaterCoil(CoilNum)%GeometryCoef2 = -0.323d0 * (WaterCoil(CoilNum)%FinSpacing/FinDiamVar)**0.049d0 * &
(WaterCoil(CoilNum)%EffectiveFinDiam/WaterCoil(CoilNum)%TubeDepthSpacing)**0.549d0 * &
(WaterCoil(CoilNum)%FinThickness/WaterCoil(CoilNum)%FinSpacing)**(-.028d0)
! Set some initial values for simulation
WaterCoil(CoilNum)%SatEnthlCurveConstCoef = -10.57d0
WaterCoil(CoilNum)%SatEnthlCurveSlope = 3.3867d0
WaterCoil(CoilNum)%EnthVsTempCurveAppxSlope = 3.3867d0
WaterCoil(CoilNum)%EnthVsTempCurveConst = -10.57d0
! Set Saved Values to Zero
WaterCoil(CoilNum)%SurfAreaWetSaved = 0.0d0
WaterCoil(CoilNum)%MeanWaterTempSaved = 0.0d0
WaterCoil(CoilNum)%InWaterTempSaved = 0.0d0
WaterCoil(CoilNum)%OutWaterTempSaved = 0.0d0
END IF ! End the Detailed Flat Fin Coil Initialization
! Calculation for Cooling Coil, The part between the '@@@' are design condition
! and are calculated only once to calculate standard values for UAs and other physical parameters of
! the cooling coil.
! Basic Idea for UA: Heat Transfer= UAenthalpybased*(Delta enthalpy), this is a necessity since the
! coil may be Wet or Dry or Partially Wet-Dry, so latent effects are accounted for in this model while
! calculating the UA. A fictitious specific heat is also defined to caculate the conventional UA.
! On the air side, enthalpy capacity rate is the air mass flow rate,while on water side it is
! enthalpy of saturated air at water temperature.
!@@@ DESIGN CONDITION BEGIN HERE @@@
! Check for zero design cooling capacity as specified by coil design inputs
IF (MyCoilDesignFlag(CoilNum) .and. (WaterCoil(CoilNum)%WaterCoilModel == CoilModel_Cooling).and. &
(WaterCoil(CoilNum)%DesAirVolFlowRate .gt. 0.0d0).and. &
(WaterCoil(CoilNum)%MaxWaterMassFlowRate .gt. 0.0d0))THEN
DesInletAirEnth=PsyHFnTdbW(WaterCoil(CoilNum)%DesInletAirTemp,WaterCoil(CoilNum)%DesInletAirHumRat)
DesOutletAirEnth=PsyHFnTdbW(WaterCoil(CoilNum)%DesOutletAirTemp,WaterCoil(CoilNum)%DesOutletAirHumRat)
DesSatEnthAtWaterInTemp =PsyHFnTdbW(WaterCoil(CoilNum)%DesInletWaterTemp, &
PsyWFnTdpPb(WaterCoil(CoilNum)%DesInletWaterTemp,StdBaroPress))
! check for dry coil
DesHumRatAtWaterInTemp = PsyWFnTdbH(WaterCoil(CoilNum)%DesInletWaterTemp,DesSatEnthAtWaterInTemp,'InitWaterCoil')
IF(DesHumRatAtWaterInTemp > WaterCoil(CoilNum)%DesOutletAirHumRat .AND. &
WaterCoil(CoilNum)%DesOutletAirTemp > WaterCoil(CoilNum)%DesInletWaterTemp)THEN
! if the design outlet air humrat is lower than the saturated air humrat at the design inlet water temp
! and the design outlet air temperature is higher than the design inlet water temp (i.e, cooling possible),
! move the design outlet air saturated enthalpy down (i.e., to Twaterin, Wair,out) to allow the coil to size.
DesSatEnthAtWaterInTemp =PsyHFnTdbW(WaterCoil(CoilNum)%DesInletWaterTemp, WaterCoil(CoilNum)%DesOutletAirHumRat)-0.0001d0
END IF
IF ( DesOutletAirEnth >= DesInletAirEnth .OR. WaterCoil(CoilNum)%DesInletWaterTemp >= WaterCoil(CoilNum)%DesInletAirTemp) THEN
CALL ShowWarningError('The design cooling capacity is zero for Coil:Cooling:Water '// &
TRIM(WaterCoil(CoilNum)%Name))
CALL ShowContinueError(' The maximum water flow rate for this coil will be set to zero and the coil will do no cooling.')
CALL ShowContinueError(' Check the following coil design inputs for problems: Tair,in = ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%DesInletAirTemp,4)))
CALL ShowContinueError(' Wair,in = ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%DesInletAirHumRat,6)))
CALL ShowContinueError(' Twater,in = ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%DesInletWaterTemp,4)))
CALL ShowContinueError(' Tair,out = ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%DesOutletAirTemp,4)))
CALL ShowContinueError(' Wair,out = ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%DesOutletAirHumRat,6)))
WaterCoil(CoilNum)%MaxWaterVolFlowRate = 0.0d0
WaterCoil(CoilNum)%MaxWaterMassFlowRate = 0.0d0
END IF
END IF
IF (MyCoilDesignFlag(CoilNum) .and. (WaterCoil(CoilNum)%WaterCoilModel == CoilModel_Cooling).and. &
(WaterCoil(CoilNum)%DesAirVolFlowRate .gt. 0.0d0).and. &
(WaterCoil(CoilNum)%MaxWaterMassFlowRate .gt. 0.0d0))THEN ! 'Cooling'
MyCoilDesignFlag(CoilNum) = .FALSE.
NoSatCurveIntersect = .FALSE.
BelowInletWaterTemp = .FALSE.
CBFTooLarge = .FALSE.
NoExitCondReset = .FALSE.
Inlet_Conditions_Loop: DO Ipass=1,2
IF (Ipass == 2) THEN
IF ( .NOT. NoSatCurveIntersect .AND. .NOT. BelowInletWaterTemp .AND. .NOT. CBFTooLarge ) THEN
EXIT Inlet_Conditions_Loop ! coil UA calcs OK
ELSE
CALL ShowWarningError('In calculating the design coil UA for Coil:Cooling:Water '// &
TRIM(WaterCoil(CoilNum)%Name))
IF (NoSatCurveIntersect) THEN
CALL ShowContinueError('no apparatus dew-point can be found for the initial entering and leaving conditions;')
END IF
IF (BelowInletWaterTemp) THEN
CALL ShowContinueError('the apparatus dew-point is below the coil design inlet water temperature;')
END IF
IF (CBFTooLarge) THEN
CALL ShowContinueError('the coil bypass factor is unrealistically large;')
END IF
IF ( .not. NoExitCondReset) THEN
CALL ShowContinueError('the coil outlet design conditions will be changed to correct the problem.')
END IF
CALL ShowContinueError('The initial design conditions are: Tair,in = ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%DesInletAirTemp,4)))
CALL ShowContinueError(' Wair,in = ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%DesInletAirHumRat,6)))
CALL ShowContinueError(' Twater,in = ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%DesInletWaterTemp,4)))
CALL ShowContinueError(' Tair,out = ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%DesOutletAirTemp,4)))
CALL ShowContinueError(' Wair,out = ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%DesOutletAirHumRat,6)))
IF ( .not. NoExitCondReset) THEN
CALL ShowContinueError('The revised design conditions are: Tair,out = ' // &
TRIM(RoundSigDigits(TOutNew,4)))
CALL ShowContinueError(' Wair,out = ' // &
TRIM(RoundSigDigits(WOutNew,6)))
WaterCoil(CoilNum)%DesOutletAirHumRat = WOutNew
WaterCoil(CoilNum)%DesOutletAirTemp = TOutNew
END IF
END IF
END IF
! Volume flow rate being converted to mass flow rate for water
WaterCoil(CoilNum)%DesAirMassFlowRate = StdRhoAir * WaterCoil(CoilNum)%DesAirVolFlowRate
! Enthalpy of Air at Inlet design conditions
DesInletAirEnth=PsyHFnTdbW(WaterCoil(CoilNum)%DesInletAirTemp,WaterCoil(CoilNum)%DesInletAirHumRat)
! Enthalpy of Air at outlet at design conditions
DesOutletAirEnth=PsyHFnTdbW(WaterCoil(CoilNum)%DesOutletAirTemp,WaterCoil(CoilNum)%DesOutletAirHumRat)
! already calculated above and possibly reset if dry coil
! ! Enthalpy of Water at Inlet design conditions
! DesSatEnthAtWaterInTemp =PsyHFnTdbW(WaterCoil(CoilNum)%DesInletWaterTemp, &
! PsyWFnTdpPb(WaterCoil(CoilNum)%DesInletWaterTemp,StdBaroPress))
! Total Coil Load from Inlet and Outlet Air States.
WaterCoil(CoilNum)%DesTotWaterCoilLoad=WaterCoil(CoilNum)%DesAirMassFlowRate*(DesInletAirEnth-DesOutletAirEnth)
! Enthalpy of Water at Intlet design conditions
Cp = GetSpecificHeatGlycol(PlantLoop(WaterCoil(CoilNum)%WaterLoopNum)%FluidName, &
WaterCoil(CoilNum)%DesInletWaterTemp, &
PlantLoop(WaterCoil(CoilNum)%WaterLoopNum)%FluidIndex, &
'InitWaterCoil')
DesOutletWaterTemp = WaterCoil(CoilNum)%DesInletWaterTemp &
+ WaterCoil(CoilNum)%DesTotWaterCoilLoad / &
(WaterCoil(CoilNum)%MaxWaterMassFlowRate * CP)
DesSatEnthAtWaterOutTemp = PsyHFnTdbW(DesOutletWaterTemp, &
PsyWFnTdpPb(DesOutletWaterTemp,StdBaroPress))
DesEnthAtWaterOutTempAirInHumRat = PsyHFnTdbW(DesOutletWaterTemp,WaterCoil(CoilNum)%DesInletAirHumRat)
DesEnthWaterOut = MIN(DesSatEnthAtWaterOutTemp,DesEnthAtWaterOutTempAirInHumRat)
! dry coil test
IF (WaterCoil(CoilNum)%DesOutletAirHumRat < WaterCoil(CoilNum)%DesInletAirHumRat .AND. &
DesHumRatAtWaterInTemp < WaterCoil(CoilNum)%DesInletAirHumRat) THEN ! wet coil
! Calculations for BYPASS FACTOR at design conditions
! Calculate "slope" of temperature vs. humidity ratio between entering and leaving states
SlopeTempVsHumRatio=(WaterCoil(CoilNum)%DesInletAirTemp-WaterCoil(CoilNum)%DesOutletAirTemp)/ &
MAX((WaterCoil(CoilNum)%DesInletAirHumRat-WaterCoil(CoilNum)%DesOutletAirHumRat),SmallNo)
! Initialize iteration parameters
DesAirTempApparatusDewPt = PsyTdpFnWPb(WaterCoil(CoilNum)%DesOutletAirHumRat,OutBaroPress)
! Iterating to calculate Apparatus Dew Point Temperature at Design Conditions
App_Dewpoint_Loop1: DO iter=1,itmax
! Calculate apparatus dewpoint and compare with predicted value
! using entering conditions and SlopeTempVsHumRatio
DesAirHumRatApparatusDewPt= PsyWFnTdpPb(DesAirTempApparatusDewPt,OutBaroPress)
! Initial Estimate for apparatus Dew Point Temperature
TempApparatusDewPtEstimate = WaterCoil(CoilNum)%DesInletAirTemp - SlopeTempVsHumRatio* &
(WaterCoil(CoilNum)%DesInletAirHumRat-DesAirHumRatApparatusDewPt)
! Iterating to calculate Apparatus Dew Point Temperature at Design Condition
error = DesAirTempApparatusDewPt-TempApparatusDewPtEstimate
Call ITERATE (ResultX,0.01d0, DesAirTempApparatusDewPt,error,X1,Y1,iter,icvg)
DesAirTempApparatusDewPt = ResultX
! If converged, exit loop
IF (icvg .EQ. 1) THEN
Exit App_Dewpoint_Loop1
END IF
! If not converged due to low Humidity Ratio approximate value at outlet conditions
IF((Iter.EQ.itmax))Then
NoSatCurveIntersect = .TRUE.
DesAirTempApparatusDewPt = PsyTdpFnWPb(WaterCoil(CoilNum)%DesOutletAirHumRat,OutBaroPress)
DesAirHumRatApparatusDewPt = PsyWFnTdpPb(DesAirTempApparatusDewPt,OutBaroPress)
Exit App_Dewpoint_Loop1
End IF
! End of Do Loop for Iteration
End Do App_Dewpoint_Loop1
! Air enthalpy at apparatus dew point at design conditions
DesAirApparatusDewPtEnth = PsyHFnTdbW(DesAirTempApparatusDewPt,DesAirHumRatApparatusDewPt)
! Calculate bypass factor from enthalpies calculated above.
DesByPassFactor = (DesOutletAirEnth-DesAirApparatusDewPtEnth)/(DesInletAirEnth-DesAirApparatusDewPtEnth)
! Check for bypass factor for unsuitable value. Note that bypass factor is never used in the coil calculation
If((DesByPassFactor .GT. 0.5d0) .or. (DesByPassFactor .LT. 0.0d0))Then
CBFTooLarge = .TRUE.
DesByPassFactor=0.37d0
End if
IF (DesEnthWaterOut > DesInletAirEnth) THEN
CALL ShowWarningError('In calculating the design coil UA for Coil:Cooling:Water '// &
TRIM(WaterCoil(CoilNum)%Name))
CALL ShowContinueError('the outlet chilled water design enthalpy is greater than the inlet air design enthalpy.')
CALL ShowContinueError('To correct this condition the design chilled water flow rate will be increased from ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%MaxWaterVolFlowRate,5)))
EnthCorrFrac = (DesEnthWaterOut - DesInletAirEnth) / (DesEnthWaterOut - DesSatEnthAtWaterInTemp)
WaterCoil(CoilNum)%MaxWaterVolFlowRate = (1.0d0 + 2.0d0 * EnthCorrFrac) * WaterCoil(CoilNum)%MaxWaterVolFlowRate
CALL ShowContinueError('to ' // TRIM(RoundSigDigits(WaterCoil(CoilNum)%MaxWaterVolFlowRate,5)) // ' m3/s')
WaterCoil(CoilNum)%MaxWaterMassFlowRate = rho * WaterCoil(CoilNum)%MaxWaterVolFlowRate
DesOutletWaterTemp = WaterCoil(CoilNum)%DesInletWaterTemp &
+ WaterCoil(CoilNum)%DesTotWaterCoilLoad / &
(WaterCoil(CoilNum)%MaxWaterMassFlowRate * CP)
DesSatEnthAtWaterOutTemp = PsyHFnTdbW(DesOutletWaterTemp, &
PsyWFnTdpPb(DesOutletWaterTemp,StdBaroPress))
DesEnthAtWaterOutTempAirInHumRat = PsyHFnTdbW(DesOutletWaterTemp,WaterCoil(CoilNum)%DesInletAirHumRat)
DesEnthWaterOut = MIN(DesSatEnthAtWaterOutTemp,DesEnthAtWaterOutTempAirInHumRat)
END IF
! Determine air-side coefficient, UACoilExternal, assuming that the
! surface temperature is at the apparatus dewpoint temperature
IF (DesAirApparatusDewPtEnth .LE. DesSatEnthAtWaterInTemp ) BelowInletWaterTemp = .TRUE.
IF ((DesInletAirEnth - DesEnthWaterOut) > SmallNo .AND. &
(DesOutletAirEnth - DesSatEnthAtWaterInTemp) > SmallNo) THEN
LogMeanEnthDiff = ((DesInletAirEnth - DesEnthWaterOut) - (DesOutletAirEnth - DesSatEnthAtWaterInTemp)) / &
LOG((DesInletAirEnth - DesEnthWaterOut)/(DesOutletAirEnth - DesSatEnthAtWaterInTemp))
ELSE
LogMeanEnthDiff = 2000.0d0 ! UA will be 1/2 the design coil load
END IF
DesUACoilExternalEnth = WaterCoil(CoilNum)%DesTotWaterCoilLoad/LogMeanEnthDiff
WaterCoil(CoilNum)%UACoilExternal = DesUACoilExternalEnth * &
PsyCpAirFnWTdb(WaterCoil(CoilNum)%DesInletAirHumRat,WaterCoil(CoilNum)%DesInletAirTemp)
IF (Ipass == 1 .AND. (NoSatCurveIntersect .OR. CBFTooLarge .OR. BelowInletWaterTemp) ) THEN
! reset outlet conditions to 90% relative humidity at the same outlet enthalpy
TOutNew = TdbFnHRhPb(DesOutletAirEnth,0.9d0,StdBaroPress)
WOutNew = PsyWFnTdbH(TOutNew,DesOutletAirEnth)
IF (WOutNew >= WaterCoil(CoilNum)%DesInletAirHumRat .or. TOutNew > WaterCoil(CoilNum)%DesOutletAirTemp) THEN
NoExitCondReset = .TRUE.
END IF
CYCLE Inlet_Conditions_Loop
END IF
WaterCoil(CoilNum)%UACoilInternal = WaterCoil(CoilNum)%UACoilExternal*3.30d0
! Overall heat transfer coefficient
WaterCoil(CoilNum)%UACoilTotal = 1.0d0/(1.d0/WaterCoil(CoilNum)%UACoilExternal+1.d0/WaterCoil(CoilNum)%UACoilInternal)
ELSE ! dry coil
IF (DesOutletWaterTemp > WaterCoil(CoilNum)%DesInletAirTemp) THEN
CALL ShowWarningError('In calculating the design coil UA for Coil:Cooling:Water '// &
TRIM(WaterCoil(CoilNum)%Name))
CALL ShowContinueError('the outlet chilled water design temperature is greater than the inlet air design temperature.')
CALL ShowContinueError('To correct this condition the design chilled water flow rate will be increased from ' // &
TRIM(RoundSigDigits(WaterCoil(CoilNum)%MaxWaterVolFlowRate,5)))
TempCorrFrac = (DesOutletWaterTemp - WaterCoil(CoilNum)%DesInletAirTemp) / &
(DesOutletWaterTemp - WaterCoil(CoilNum)%DesInletWaterTemp)
WaterCoil(CoilNum)%MaxWaterVolFlowRate = (1.0d0 + 2.0d0 * TempCorrFrac) * WaterCoil(CoilNum)%MaxWaterVolFlowRate
CALL ShowContinueError('to ' // TRIM(RoundSigDigits(WaterCoil(CoilNum)%MaxWaterVolFlowRate,5)) // ' m3/s')
WaterCoil(CoilNum)%MaxWaterMassFlowRate = rho * WaterCoil(CoilNum)%MaxWaterVolFlowRate
DesOutletWaterTemp = WaterCoil(CoilNum)%DesInletWaterTemp &
+ WaterCoil(CoilNum)%DesTotWaterCoilLoad / &
(WaterCoil(CoilNum)%MaxWaterMassFlowRate * CP)
END IF
IF ((WaterCoil(CoilNum)%DesInletAirTemp - DesOutletWaterTemp) > SmallNo .AND. &
(WaterCoil(CoilNum)%DesOutletAirTemp - WaterCoil(CoilNum)%DesInletWaterTemp) > SmallNo) THEN
LogMeanTempDiff = ((WaterCoil(CoilNum)%DesInletAirTemp - DesOutletWaterTemp) - &
(WaterCoil(CoilNum)%DesOutletAirTemp - WaterCoil(CoilNum)%DesInletWaterTemp)) / &
LOG((WaterCoil(CoilNum)%DesInletAirTemp - DesOutletWaterTemp) / &
(WaterCoil(CoilNum)%DesOutletAirTemp - WaterCoil(CoilNum)%DesInletWaterTemp))
WaterCoil(CoilNum)%UACoilExternal = WaterCoil(CoilNum)%DesTotWaterCoilLoad / LogMeanTempDiff
ELSE
WaterCoil(CoilNum)%UACoilExternal = WaterCoil(CoilNum)%DesTotWaterCoilLoad / 2.0d0 ! make the UA large
END IF
WaterCoil(CoilNum)%UACoilInternal = WaterCoil(CoilNum)%UACoilExternal*3.30d0
! Overall heat transfer coefficient
WaterCoil(CoilNum)%UACoilTotal = 1.0d0/(1.d0/WaterCoil(CoilNum)%UACoilExternal+1.d0/WaterCoil(CoilNum)%UACoilInternal)
EXIT Inlet_Conditions_Loop
END IF
END DO Inlet_Conditions_Loop
! estimate the heat external transfer surface area using typical design over all U value
WaterCoil(CoilNum)%TotCoilOutsideSurfArea=EstimateHEXSurfaceArea(CoilNum)
! calculate internal and external "UA per external surface area"
WaterCoil(CoilNum)%UACoilInternalPerUnitArea=WaterCoil(CoilNum)%UACoilInternal/ &
WaterCoil(CoilNum)%TotCoilOutsideSurfArea
WaterCoil(CoilNum)%UAWetExtPerUnitArea=WaterCoil(CoilNum)%UACoilExternal/WaterCoil(CoilNum)%TotCoilOutsideSurfArea
! approximate the dry UA as 1.0 times wet UA
WaterCoil(CoilNum)%UADryExtPerUnitArea=WaterCoil(CoilNum)%UAWetExtPerUnitArea
! Now use SolveRegulaFalsi to "invert" the cooling coil model to obtain the UA given the specified design inlet and outlet conditions
! Note that the UAs we have obtained so far are rough estimates that are the starting points for the the following iterative
! calulation of the actual UAs.
Par(1) = WaterCoil(CoilNum)%DesTotWaterCoilLoad
Par(2) = REAL(CoilNum,r64)
Par(3) = REAL(ContFanCycCoil,r64) !fan operating mode
Par(4) = 1.0d0 ! part-load ratio
WaterCoil(CoilNum)%InletAirTemp = WaterCoil(CoilNum)%DesInletAirTemp
WaterCoil(CoilNum)%InletAirHumRat = WaterCoil(CoilNum)%DesInletAirHumRat
WaterCoil(CoilNum)%InletWaterTemp = WaterCoil(CoilNum)%DesInletWaterTemp
WaterCoil(CoilNum)%InletWaterMassFlowRate = rho * WaterCoil(CoilNum)%MaxWaterVolFlowRate
WaterCoil(CoilNum)%InletAirMassFlowRate = WaterCoil(CoilNum)%DesAirMassFlowRate
! set the lower and upper limits on the UA
UA0 = 0.1d0 * WaterCoil(CoilNum)%UACoilExternal
UA1 = 10.0d0 * WaterCoil(CoilNum)%UACoilExternal
! Invert the simple cooling coil model: given the design inlet conditions and the design load, find the design UA
CALL SolveRegulaFalsi(0.001d0, MaxIte, SolFla, UA, SimpleCoolingCoilUAResidual, UA0, UA1, Par)
! if the numerical inversion failed, issue error messages.
IF (SolFla == -1) THEN
CALL ShowSevereError('Calculation of cooling coil design UA failed for coil '//TRIM(WaterCoil(CoilNum)%Name))
CALL ShowContinueError(' Iteration limit exceeded in calculating coil UA')
! CALL ShowFatalError('Preceeding error causes program termination')
WaterCoil(CoilNum)%UACoilExternal = UA0*10.0d0
WaterCoil(CoilNum)%UACoilInternal = WaterCoil(CoilNum)%UACoilExternal*3.3d0
WaterCoil(CoilNum)%UACoilTotal = 1.0d0/(1.d0/WaterCoil(CoilNum)%UACoilExternal+1.d0/WaterCoil(CoilNum)%UACoilInternal)
WaterCoil(CoilNum)%TotCoilOutsideSurfArea=EstimateHEXSurfaceArea(CoilNum)
WaterCoil(CoilNum)%UACoilInternalPerUnitArea=WaterCoil(CoilNum)%UACoilInternal/ &
WaterCoil(CoilNum)%TotCoilOutsideSurfArea
WaterCoil(CoilNum)%UAWetExtPerUnitArea=WaterCoil(CoilNum)%UACoilExternal/WaterCoil(CoilNum)%TotCoilOutsideSurfArea
WaterCoil(CoilNum)%UADryExtPerUnitArea=WaterCoil(CoilNum)%UAWetExtPerUnitArea
CALL ShowContinueError(' Coil design UA set to ' // TRIM(RoundSigDigits(WaterCoil(CoilNum)%UACoilTotal,6)) // ' [W/C]')
ELSE IF (SolFla == -2) THEN
CALL ShowSevereError('Calculation of cooling coil design UA failed for coil '//TRIM(WaterCoil(CoilNum)%Name))
CALL ShowContinueError(' Bad starting values for UA')
! CALL ShowFatalError('Preceeding error causes program termination')
WaterCoil(CoilNum)%UACoilExternal = UA0*10.0d0
WaterCoil(CoilNum)%UACoilInternal = WaterCoil(CoilNum)%UACoilExternal*3.3d0
WaterCoil(CoilNum)%UACoilTotal = 1.0d0/(1.d0/WaterCoil(CoilNum)%UACoilExternal+1.d0/WaterCoil(CoilNum)%UACoilInternal)
WaterCoil(CoilNum)%TotCoilOutsideSurfArea=EstimateHEXSurfaceArea(CoilNum)
WaterCoil(CoilNum)%UACoilInternalPerUnitArea=WaterCoil(CoilNum)%UACoilInternal/ &
WaterCoil(CoilNum)%TotCoilOutsideSurfArea
WaterCoil(CoilNum)%UAWetExtPerUnitArea=WaterCoil(CoilNum)%UACoilExternal/WaterCoil(CoilNum)%TotCoilOutsideSurfArea
WaterCoil(CoilNum)%UADryExtPerUnitArea=WaterCoil(CoilNum)%UAWetExtPerUnitArea
CALL ShowContinueError(' Coil design UA set to ' // TRIM(RoundSigDigits(WaterCoil(CoilNum)%UACoilTotal,6)) // ' [W/C]')
END IF
! cooling coil surface area
SurfaceArea = WaterCoil(CoilNum)%TotCoilOutsideSurfArea
! cooling coil overall UA value
UATotal = WaterCoil(CoilNum)%UACoilTotal
! save the design internal and external UAs
WaterCoil(CoilNum)%UACoilExternalDes = WaterCoil(CoilNum)%UACoilExternal
WaterCoil(CoilNum)%UACoilInternalDes = WaterCoil(CoilNum)%UACoilInternal
End If
!@@@@ DESIGN CONDITION END HERE @@@@
! Calculate rated Total, latent, sensible capacity, SHR, effectiveness
IF (WaterCoil(CoilNum)%WaterCoilType_Num == WaterCoil_SimpleHeating) THEN
WaterCoil(CoilNum)%InletAirTemp = 16.6d0
WaterCoil(CoilNum)%InletAirHumRat = PsyWFnTdbRhPb(16.6d0,0.5d0,StdBaroPress,calledfrom='InitWaterCoil')
WaterCoil(CoilNum)%InletWaterTemp =82.2d0
ELSE
WaterCoil(CoilNum)%InletAirTemp = 26.67d0
WaterCoil(CoilNum)%InletAirHumRat = PsyWFnTdbTwbPb(26.67d0,19.44d0,StdBaroPress,calledfrom='InitWaterCoil')
WaterCoil(CoilNum)%InletWaterTemp = 6.67d0
END IF
WaterCoil(CoilNum)%InletAirEnthalpy = PsyHFnTdbW(WaterCoil(CoilNum)%InletAirTemp,WaterCoil(CoilNum)%InletAirHumRat, &
calledfrom='InitWaterCoil')
WaterCoil(CoilNum)%InletWaterMassFlowRate = WaterCoil(CoilNum)%MaxWaterMassFlowRate
WaterCoil(CoilNum)%InletAirMassFlowRate = StdRhoAir*WaterCoil(CoilNum)%DesAirVolFlowRate
CapacitanceAir = WaterCoil(CoilNum)%InletAirMassFlowRate * &
PsyCpAirFnWTdb(WaterCoil(CoilNum)%InletAirHumRat,WaterCoil(CoilNum)%InletAirTemp,calledfrom='InitWaterCoil')
Cp = GetSpecificHeatGlycol(PlantLoop(WaterCoil(CoilNum)%WaterLoopNum)%FluidName, &
WaterCoil(CoilNum)%InletWaterTemp, &
PlantLoop(WaterCoil(CoilNum)%WaterLoopNum)%FluidIndex, &
'InitWaterCoil')
CapacitanceWater = WaterCoil(CoilNum)%InletWaterMassFlowRate* Cp
CMin = MIN(CapacitanceAir,CapacitanceWater)
IF (CMin > 0.0d0) THEN
IF (WaterCoil(CoilNum)%WaterCoilType_Num == WaterCoil_Cooling) THEN
CALL CoolingCoil(CoilNum, FirstHVACIteration, DesignCalc,ContFanCycCoil,1.0d0)
CoilEffectiveness = (WaterCoil(CoilNum)%InletAirTemp - WaterCoil(CoilNum)%OutletAirTemp) / &
(WaterCoil(CoilNum)%InletAirTemp - WaterCoil(CoilNum)%InletWaterTemp) * &
(CapacitanceAir / CMin)
RatedLatentCapacity = WaterCoil(CoilNum)%TotWaterCoolingCoilRate - WaterCoil(CoilNum)%SenWaterCoolingCoilRate
RatedSHR = WaterCoil(CoilNum)%SenWaterCoolingCoilRate / WaterCoil(CoilNum)%TotWaterCoolingCoilRate
ELSE IF (WaterCoil(CoilNum)%WaterCoilType_Num == WaterCoil_DetFlatFinCooling) THEN
CALL CalcDetailFlatFinCoolingCoil(CoilNum, DesignCalc,ContFanCycCoil,1.0d0)
CoilEffectiveness = (WaterCoil(CoilNum)%InletAirTemp - WaterCoil(CoilNum)%OutletAirTemp) / &
(WaterCoil(CoilNum)%InletAirTemp - WaterCoil(CoilNum)%InletWaterTemp) * &
(CapacitanceAir / CMin)
RatedLatentCapacity = WaterCoil(CoilNum)%TotWaterCoolingCoilRate - WaterCoil(CoilNum)%SenWaterCoolingCoilRate
RatedSHR = WaterCoil(CoilNum)%SenWaterCoolingCoilRate / WaterCoil(CoilNum)%TotWaterCoolingCoilRate
ELSE IF (WaterCoil(CoilNum)%WaterCoilType_Num == WaterCoil_SimpleHeating) THEN
CALL CalcSimpleHeatingCoil(CoilNum, ContFanCycCoil, 1.0d0, DesignCalc)
CoilEffectiveness = (WaterCoil(CoilNum)%OutletAirTemp - WaterCoil(CoilNum)%InletAirTemp) / &
(WaterCoil(CoilNum)%InletWaterTemp - WaterCoil(CoilNum)%InletAirTemp) * &
(CapacitanceAir / CMin)
END IF
ELSE
CoilEffectiveness = 0.0d0
WaterCoil(CoilNum)%TotWaterHeatingCoilRate = 0.0d0
WaterCoil(CoilNum)%TotWaterCoolingCoilRate = 0.0d0
WaterCoil(CoilNum)%SenWaterCoolingCoilRate = 0.0d0
RatedLatentCapacity = 0.0d0
RatedSHR = 0.0d0
END IF
MyEnvrnFlag(CoilNum) = .FALSE.
END IF ! End If for the Begin Environment initializations
IF (.not. BeginEnvrnFlag) THEN
MyEnvrnFlag(CoilNum)=.true.
ENDIF
IF (.not. DoingSizing) THEN
IF (MyCoilReportFlag(CoilNum)) THEN
!create predefined report entries
MyCoilReportFlag(CoilNum)=.false.
SELECT CASE (WaterCoil(CoilNum)%WaterCoilType_Num)
CASE (WaterCoil_SimpleHeating)
IF (RptCoilHeaderFlag(1)) THEN
WRITE(OutputFileInits,'(A)') '! <Water Heating Coil Capacity Information>,Component Type,Name,'// &
'Nominal Total Capacity {W}'
RptCoilHeaderFlag(1)=.false.
ENDIF
CALL PreDefTableEntry(pdchHeatCoilType,WaterCoil(CoilNum)%Name,'Coil:Heating:Water')
CALL PreDefTableEntry(pdchHeatCoilDesCap,WaterCoil(CoilNum)%Name,WaterCoil(CoilNum)%DesWaterHeatingCoilRate)
CALL PreDefTableEntry(pdchHeatCoilNomCap,WaterCoil(CoilNum)%Name,WaterCoil(CoilNum)%TotWaterHeatingCoilRate)
CALL PreDefTableEntry(pdchHeatCoilNomEff,WaterCoil(CoilNum)%Name,'-')
CALL addFootNoteSubTable(pdstHeatCoil, 'Nominal values are gross at rated conditions, i.e., the supply air fan' &
//' heat and electric power NOT accounted for.')
WRITE(OutputFileInits,'(A)') 'Water Heating Coil Capacity Information,Coil:Heating:Water,'// &
trim(WaterCoil(CoilNum)%Name)//','// &
trim(RoundSigDigits(WaterCoil(CoilNum)%TotWaterHeatingCoilRate,2))
CASE (WaterCoil_DetFlatFinCooling)
IF (RptCoilHeaderFlag(2)) THEN
WRITE(OutputFileInits,'(A)') '! <Water Cooling Coil Capacity Information>,Component Type,Name,'// &
'Nominal Total Capacity {W},Nominal Sensible Capacity {W},Nominal Latent Capacity {W},'// &
'Nominal Sensible Heat Ratio'
RptCoilHeaderFlag(2)=.false.
ENDIF
RatedLatentCapacity = WaterCoil(CoilNum)%TotWaterCoolingCoilRate - WaterCoil(CoilNum)%SenWaterCoolingCoilRate
RatedSHR = SafeDivide(WaterCoil(CoilNum)%SenWaterCoolingCoilRate , WaterCoil(CoilNum)%TotWaterCoolingCoilRate)
CALL PreDefTableEntry(pdchCoolCoilType,WaterCoil(CoilNum)%Name,'Coil:Cooling:Water:DetailedGeometry')
CALL PreDefTableEntry(pdchCoolCoilDesCap,WaterCoil(CoilNum)%Name,WaterCoil(CoilNum)%DesWaterCoolingCoilRate)
CALL PreDefTableEntry(pdchCoolCoilTotCap,WaterCoil(CoilNum)%Name,WaterCoil(CoilNum)%TotWaterCoolingCoilRate)
CALL PreDefTableEntry(pdchCoolCoilSensCap,WaterCoil(CoilNum)%Name,WaterCoil(CoilNum)%SenWaterCoolingCoilRate)
CALL PreDefTableEntry(pdchCoolCoilLatCap,WaterCoil(CoilNum)%Name,RatedLatentCapacity)
CALL PreDefTableEntry(pdchCoolCoilSHR,WaterCoil(CoilNum)%Name,RatedSHR)
CALL PreDefTableEntry(pdchCoolCoilNomEff,WaterCoil(CoilNum)%Name,'-')
CALL addFootNoteSubTable(pdstCoolCoil, 'Nominal values are gross at rated conditions, i.e., the supply air fan' &
//' heat and electric power NOT accounted for.')
WRITE(OutputFileInits,'(A)') 'Water Cooling Coil Capacity Information,Coil:Cooling:Water:DetailedGeometry,'// &
trim(WaterCoil(CoilNum)%Name)//','// &
trim(RoundSigDigits(WaterCoil(CoilNum)%TotWaterCoolingCoilRate,2))//','// &
trim(RoundSigDigits(WaterCoil(CoilNum)%SenWaterCoolingCoilRate,2))//','// &
trim(RoundSigDigits(RatedLatentCapacity,2))//','//trim(RoundSigDigits(RatedSHR,2))
CASE (WaterCoil_Cooling)
IF (RptCoilHeaderFlag(2)) THEN
WRITE(OutputFileInits,'(A)') '! <Water Cooling Coil Capacity Information>,Component Type,Name,'// &
'Nominal Total Capacity {W},Nominal Sensible Capacity {W},Nominal Latent Capacity {W},'// &
'Nominal Sensible Heat Ratio, Nominal Coil UA Value {W/C}, Nominal Coil Surface Area {m2}'
RptCoilHeaderFlag(2)=.false.
ENDIF
RatedLatentCapacity = WaterCoil(CoilNum)%TotWaterCoolingCoilRate - WaterCoil(CoilNum)%SenWaterCoolingCoilRate
RatedSHR = SafeDivide(WaterCoil(CoilNum)%SenWaterCoolingCoilRate , WaterCoil(CoilNum)%TotWaterCoolingCoilRate)
CALL PreDefTableEntry(pdchCoolCoilType,WaterCoil(CoilNum)%Name,'Coil:Cooling:Water')
CALL PreDefTableEntry(pdchCoolCoilDesCap,WaterCoil(CoilNum)%Name,WaterCoil(CoilNum)%DesWaterCoolingCoilRate)
CALL PreDefTableEntry(pdchCoolCoilTotCap,WaterCoil(CoilNum)%Name,WaterCoil(CoilNum)%TotWaterCoolingCoilRate)
CALL PreDefTableEntry(pdchCoolCoilSensCap,WaterCoil(CoilNum)%Name,WaterCoil(CoilNum)%SenWaterCoolingCoilRate)
CALL PreDefTableEntry(pdchCoolCoilLatCap,WaterCoil(CoilNum)%Name,RatedLatentCapacity)
CALL PreDefTableEntry(pdchCoolCoilSHR,WaterCoil(CoilNum)%Name,RatedSHR)
CALL PreDefTableEntry(pdchCoolCoilNomEff,WaterCoil(CoilNum)%Name,'-')
CALL PreDefTableEntry(pdchCoolCoilUATotal,WaterCoil(CoilNum)%Name,WaterCoil(CoilNum)%UACoilTotal)
CALL PreDefTableEntry(pdchCoolCoilArea,WaterCoil(CoilNum)%Name,WaterCoil(CoilNum)%TotCoilOutsideSurfArea)
CALL addFootNoteSubTable(pdstCoolCoil, 'Nominal values are gross at rated conditions, i.e., the supply air fan' &
//' heat and electric power NOT accounted for.')
WRITE(OutputFileInits,'(A)') 'Water Cooling Coil Capacity Information,Coil:Cooling:Water,'// &
trim(WaterCoil(CoilNum)%Name)//','// &
trim(RoundSigDigits(WaterCoil(CoilNum)%TotWaterCoolingCoilRate,2))//','// &
trim(RoundSigDigits(WaterCoil(CoilNum)%SenWaterCoolingCoilRate,2))//','// &
trim(RoundSigDigits(RatedLatentCapacity,2))//','//trim(RoundSigDigits(RatedSHR,2))//','// &
trim(RoundSigDigits(UATotal,2))//','//trim(RoundSigDigits(SurfaceArea,2))
END SELECT
IF(WaterCoil(CoilNum)%DesWaterCoolingCoilRate <= 0.0d0) &
WaterCoil(CoilNum)%DesWaterCoolingCoilRate = WaterCoil(CoilNum)%TotWaterCoolingCoilRate
IF(WaterCoil(CoilNum)%DesWaterHeatingCoilRate <= 0.0d0) &
WaterCoil(CoilNum)%DesWaterHeatingCoilRate = WaterCoil(CoilNum)%TotWaterHeatingCoilRate
ENDIF
ENDIF
! Do the Begin Day initializations
! NONE
! Do the begin HVAC time step initializations
! NONE
! Do the following initializations (every time step): This should be the info from
! the previous components outlets or the node data in this section.
!First set the conditions for the air into the coil model
AirInletNode = WaterCoil(CoilNum)%AirInletNodeNum
WaterInletNode = WaterCoil(CoilNum)%WaterInletNodeNum
WaterCoil(CoilNum)%InletAirMassFlowRate = Node(AirInletNode)%MassFlowRate
WaterCoil(CoilNum)%InletAirTemp = Node(AirInletNode)%Temp
WaterCoil(CoilNum)%InletAirHumRat = Node(AirInletNode)%HumRat
WaterCoil(CoilNum)%InletAirEnthalpy = Node(AirInletNode)%Enthalpy
WaterCoil(CoilNum)%InletWaterMassFlowRate = Node(WaterInletNode)%MassFlowRate
WaterCoil(CoilNum)%InletWaterTemp = Node(WaterInletNode)%Temp
WaterCoil(CoilNum)%InletWaterEnthalpy = Node(WaterInletNode)%Enthalpy
WaterCoil(CoilNum)%UACoilVariable = WaterCoil(CoilNum)%UACoil
IF ((WaterCoil(CoilNum)%WaterCoilType_Num == WaterCoil_SimpleHeating) .AND. &
.NOT. ( MyUAAndFlowCalcFlag(CoilNum)) ) THEN !update Coil UA based on inlet mass flows and temps
x_a = 1.d0 + 4.769D-3*(WaterCoil(CoilNum)%InletAirTemp - WaterCoil(CoilNum)%DesInletAirTemp)
IF (WaterCoil(CoilNum)%DesAirMassFlowRate > 0.d0) THEN
AirConvectTerm = x_a * ((WaterCoil(CoilNum)%InletAirMassFlowRate/WaterCoil(CoilNum)%DesAirMassFlowRate)**0.8d0) &
* WaterCoil(CoilNum)%AirSideNominalConvect
ELSE
AirConvectTerm = 0.d0
ENDIF
WaterConvSensitivity = 0.014d0 / (1.d0 + 0.014d0*WaterCoil(CoilNum)%DesInletWaterTemp)
x_w = 1.d0 + WaterConvSensitivity *(WaterCoil(CoilNum)%InletWaterTemp - WaterCoil(CoilNum)%DesInletWaterTemp)
IF (WaterCoil(CoilNum)%MaxWaterMassFlowRate > 0.0d0) THEN
WaterConvectTerm = x_w * ((WaterCoil(CoilNum)%InletWaterMassFlowRate/WaterCoil(CoilNum)%MaxWaterMassFlowRate)**0.85d0) &
* WaterCoil(CoilNum)%LiquidSideNominalConvect
ELSE
WaterConvectTerm = 0.d0
ENDIF
IF ((AirConvectTerm > 0.d0) .AND. (WaterConvectTerm > 0.d0 )) Then
WaterCoil(CoilNum)%UACoilVariable =1.d0 / ( (1.d0/WaterConvectTerm) + (1.d0 / AirConvectTerm) )
ELSE
! use nominal UA since variable UA cannot be calculated
WaterCoil(CoilNum)%UACoilVariable = WaterCoil(CoilNum)%UACoil
ENDIF
ENDIF
!update Coil UA based on inlet mass flows and temps
IF ( WaterCoil(CoilNum)%WaterCoilType_Num == WaterCoil_Cooling .and. .not. MyCoilDesignFlag(CoilNum) ) THEN
x_a = 1.d0 + 4.769D-3*(WaterCoil(CoilNum)%InletAirTemp - WaterCoil(CoilNum)%DesInletAirTemp)
IF (WaterCoil(CoilNum)%DesAirMassFlowRate > 0.d0) THEN
WaterCoil(CoilNum)%UACoilExternal = x_a * &
((WaterCoil(CoilNum)%InletAirMassFlowRate/WaterCoil(CoilNum)%DesAirMassFlowRate)**0.8d0) &
* WaterCoil(CoilNum)%UACoilExternalDes
ELSE
WaterCoil(CoilNum)%UACoilExternal = WaterCoil(CoilNum)%UACoilExternalDes
ENDIF
WaterConvSensitivity = 0.014d0 / (1.d0 + 0.014d0*WaterCoil(CoilNum)%DesInletWaterTemp)
x_w = 1.d0 + WaterConvSensitivity *(WaterCoil(CoilNum)%InletWaterTemp - WaterCoil(CoilNum)%DesInletWaterTemp)
IF (WaterCoil(CoilNum)%MaxWaterMassFlowRate > 0.0d0) THEN
WaterCoil(CoilNum)%UACoilInternal = x_w * &
((WaterCoil(CoilNum)%InletWaterMassFlowRate/WaterCoil(CoilNum)%MaxWaterMassFlowRate)**0.85d0) &
* WaterCoil(CoilNum)%UACoilInternalDes
ELSE
WaterCoil(CoilNum)%UACoilInternal = WaterCoil(CoilNum)%UACoilInternalDes
ENDIF
IF (WaterCoil(CoilNum)%UACoilInternal > 0.0d0 .and. WaterCoil(CoilNum)%UACoilExternal > 0.0d0) THEN
WaterCoil(CoilNum)%UACoilTotal = 1.0d0/(1.d0/WaterCoil(CoilNum)%UACoilExternal+1.d0/WaterCoil(CoilNum)%UACoilInternal)
ELSE
WaterCoil(CoilNum)%UACoilInternal = WaterCoil(CoilNum)%UACoilInternalDes
WaterCoil(CoilNum)%UACoilExternal = WaterCoil(CoilNum)%UACoilExternalDes
WaterCoil(CoilNum)%UACoilTotal = 1.0d0/(1.d0/WaterCoil(CoilNum)%UACoilExternal+1.d0/WaterCoil(CoilNum)%UACoilInternal)
END IF
WaterCoil(CoilNum)%UACoilInternalPerUnitArea = WaterCoil(CoilNum)%UACoilInternal/ &
WaterCoil(CoilNum)%TotCoilOutsideSurfArea
WaterCoil(CoilNum)%UAWetExtPerUnitArea = WaterCoil(CoilNum)%UACoilExternal/WaterCoil(CoilNum)%TotCoilOutsideSurfArea
WaterCoil(CoilNum)%UADryExtPerUnitArea = WaterCoil(CoilNum)%UAWetExtPerUnitArea
ENDIF
WaterCoil(CoilNum)%TotWaterHeatingCoilRate = 0.0d0
WaterCoil(CoilNum)%TotWaterCoolingCoilRate = 0.0d0
WaterCoil(CoilNum)%SenWaterCoolingCoilRate = 0.0d0
RETURN
END SUBROUTINE InitWaterCoil