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) | :: | DesicDehumNum | |||
real(kind=r64), | intent(in) | :: | HumRatNeeded | |||
logical, | intent(in) | :: | FirstHVACIteration |
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 CalcSolidDesiccantDehumidifier(DesicDehumNum,HumRatNeeded,FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Michael J. Witte, GARD Analytics, Inc.
! for Gas Research Institute
! DATE WRITTEN March 2001
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculate the electricity consumption, regen heat requirements and the outlet
! conditions for a solid desiccant dehumidifier, given the inlet conditions and
! and the needed process leaving humidity ratio.
! METHODOLOGY EMPLOYED:
! Given the entering conditions, the full-load outlet conditions are calculated.
! Adjust for part-load if required.
! Caclulate required regen energy and call regen coil and regen fan.
! Desiccant wheel leaving conditions and regen energy requirements are calculated
! from empirical curve fits. The user can select either default built-in
! performance curves, or use custom user-defined curves.
! REFERENCES:
! The default performance curves represent a commerical-grade solid desiccant
! wheel typical of HVAC applications in the early 1990's. These curves were
! developed for Gas Research Institute by William W. Worek, University of Illinois
! at Chicago.
! USE STATEMENTS:
USE Psychrometrics, ONLY:PsyHFnTdbW, PsyRhoAirFnPbTdbW
!unused USE DataEnvironment, ONLY: StdBaroPress
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: DesicDehumNum ! number of the current dehumidifier being simulated
REAL(r64), INTENT(IN) :: HumRatNeeded ! process air leaving humidity ratio set by controller [kgWater/kgDryAir]
LOGICAL, INTENT (IN) :: FirstHVACIteration ! TRUE if 1st HVAC simulation of system timestep
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: ProcAirInHumRat ! process inlet air humidity ratio [kgWater/kgDryAir]
REAL(r64) :: ProcAirInTemp ! process inlet air temperature [C]
REAL(r64) :: ProcAirOutHumRat ! process outlet air humidity ratio [kgWater/kgDryAir]
REAL(r64) :: MinProcAirOutHumRat ! minimum available process outlet air humidity ratio [kgWater/kgDryAir]
REAL(r64) :: ProcAirOutTemp ! process outlet air temperature [C]
REAL(r64) :: ProcAirVel ! process air velocity [m/s]
REAL(r64) :: QRegen ! regen heat input rate requested from regen coil [W]
REAL(r64) :: QDelivered ! regen heat actually delivered by regen coil [W]
!REAL(r64) :: RegenAirInHumRat ! regen inlet air humidity ratio [kgWater/kgDryAir]
REAL(r64) :: RegenAirInTemp ! regen inlet air temperature [C]
REAL(r64) :: RegenAirVel ! regen air velocity [m/s]
REAL(r64) :: ProcAirMassFlowRate ! process air mass flow rate [kg/s]
REAL(r64) :: RegenAirMassFlowRate ! regen air mass flow rate [kg/s]
REAL(r64) :: SpecRegenEnergy ! specific regen energy [J/kg of water removed]
REAL(r64) :: NomRegenTemp ! nominal regen temperature for regen energy curve
REAL(r64) :: ElecUseRate ! electricity consumption rate [W]
REAL(r64) :: PartLoad ! fraction of dehumidification capacity required to meet setpoint
LOGICAL :: UnitOn ! unit on flag
LOGICAL, SAVE :: MyOneTimeFlag = .TRUE. ! one time flag
REAL(r64), SAVE :: RhoAirStdInit
! Variables for hardwired coefficients for default performance model
REAL(r64) :: TC0
REAL(r64) :: TC1
REAL(r64) :: TC2
REAL(r64) :: TC3
REAL(r64) :: TC4
REAL(r64) :: TC5
REAL(r64) :: TC6
REAL(r64) :: TC7
REAL(r64) :: TC8
REAL(r64) :: TC9
REAL(r64) :: TC10
REAL(r64) :: TC11
REAL(r64) :: TC12
REAL(r64) :: TC13
REAL(r64) :: TC14
REAL(r64) :: TC15
REAL(r64) :: WC0
REAL(r64) :: WC1
REAL(r64) :: WC2
REAL(r64) :: WC3
REAL(r64) :: WC4
REAL(r64) :: WC5
REAL(r64) :: WC6
REAL(r64) :: WC7
REAL(r64) :: WC8
REAL(r64) :: WC9
REAL(r64) :: WC10
REAL(r64) :: WC11
REAL(r64) :: WC12
REAL(r64) :: WC13
REAL(r64) :: WC14
REAL(r64) :: WC15
REAL(r64) :: QC0
REAL(r64) :: QC1
REAL(r64) :: QC2
REAL(r64) :: QC3
REAL(r64) :: QC4
REAL(r64) :: QC5
REAL(r64) :: QC6
REAL(r64) :: QC7
REAL(r64) :: QC8
REAL(r64) :: QC9
REAL(r64) :: QC10
REAL(r64) :: QC11
REAL(r64) :: QC12
REAL(r64) :: QC13
REAL(r64) :: QC14
REAL(r64) :: QC15
REAL(r64) :: RC0
REAL(r64) :: RC1
REAL(r64) :: RC2
REAL(r64) :: RC3
REAL(r64) :: RC4
REAL(r64) :: RC5
REAL(r64) :: RC6
REAL(r64) :: RC7
REAL(r64) :: RC8
REAL(r64) :: RC9
REAL(r64) :: RC10
REAL(r64) :: RC11
REAL(r64) :: RC12
REAL(r64) :: RC13
REAL(r64) :: RC14
REAL(r64) :: RC15
! Setup internal variables for calculations
ProcAirInTemp = DesicDehum(DesicDehumNum)%ProcAirInTemp
ProcAirInHumRat = DesicDehum(DesicDehumNum)%ProcAirInHumRat
ProcAirMassFlowRate = DesicDehum(DesicDehumNum)%ProcAirInMassFlowRate
ProcAirVel = DesicDehum(DesicDehumNum)%NomProcAirVel
PartLoad = 0.0d0
RegenAirInTemp = DesicDehum(DesicDehumNum)%RegenAirInTemp
NomRegenTemp = DesicDehum(DesicDehumNum)%NomRegenTemp
! Calculate min available process out humrat
UnitOn = .FALSE.
MinProcAirOutHumRat = 0.0d0 ! max(MinProcAirOutHumRat,0.000857)
IF (HumRatNeeded .lt. ProcAirInHumRat) THEN
UnitOn = .TRUE.
SELECT CASE(DesicDehum(DesicDehumNum)%PerformanceModel_Num) ! Performance Model Part A
CASE (PM_Default)
WC0 = 0.0148880824323806d0
WC1 = -0.000283393198398211d0
WC2 = -0.87802168940547d0
WC3 = -0.000713615831236411d0
WC4 = 0.0311261188874622d0
WC5 = 1.51738892142485d-06
WC6 = 0.0287250198281021d0
WC7 = 4.94796903231558d-06
WC8 = 24.0771139652826d0
WC9 = 0.000122270283927978d0
WC10 = -0.0151657189566474d0
WC11 = 3.91641393230322d-08
WC12 = 0.126032651553348d0
WC13 = 0.000391653854431574d0
WC14 = 0.002160537360507d0
WC15 = 0.00132732844211593d0
MinProcAirOutHumRat = WC0 &
+ WC1*ProcAirInTemp + WC2*ProcAirInHumRat + WC3*ProcAirVel &
+ WC4*ProcAirInTemp*ProcAirInHumRat + WC5*ProcAirInTemp*ProcAirVel &
+ WC6*ProcAirInHumRat*ProcAirVel + WC7*ProcAirInTemp*ProcAirInTemp &
+ WC8*ProcAirInHumRat*ProcAirInHumRat + WC9*ProcAirVel*ProcAirVel &
+ WC10*ProcAirInTemp*ProcAirInTemp*ProcAirInHumRat*ProcAirInHumRat &
+ WC11*ProcAirInTemp*ProcAirInTemp*ProcAirVel*ProcAirVel &
+ WC12*ProcAirInHumRat*ProcAirInHumRat*ProcAirVel*ProcAirVel &
+ WC13*LOG(ProcAirInTemp) + WC14*LOG(ProcAirInHumRat) &
+ WC15*LOG(ProcAirVel)
! limit to 6 grains/lb (0.000857 kg/kg)
CASE (PM_UserCurves)
MinProcAirOutHumRat = CurveValue(DesicDehum(DesicDehumNum)%ProcHumRatCurvefTW,ProcAirInTemp,ProcAirInHumRat)&
* CurveValue(DesicDehum(DesicDehumNum)%ProcHumRatCurvefV,ProcAirVel)
CASE DEFAULT
CALL ShowFatalError('Invalid performance model in desiccant dehumidifier = '&
//TRIM(TrimSigDigits(DesicDehum(DesicDehumNum)%PerformanceModel_Num)))
END SELECT ! Performance Model Part A
MinProcAirOutHumRat = max(MinProcAirOutHumRat,0.000857d0)
ENDIF
IF (MinProcAirOutHumRat .GE. ProcAirInHumRat) UnitOn=.FALSE.
IF (UnitOn) THEN
! Calculate partload fraction of dehumidification capacity required to meet setpoint
PartLoad = 1.0d0
IF (MinProcAirOutHumRat .LT. HumRatNeeded) &
PartLoad = (ProcAirInHumRat - HumRatNeeded) / (ProcAirInHumRat - MinProcAirOutHumRat)
PartLoad = MAX(0.0d0,PartLoad)
PartLoad = MIN(1.0d0,PartLoad)
SELECT CASE(DesicDehum(DesicDehumNum)%PerformanceModel_Num) ! Performance Model Part B
CASE (PM_Default)
! Calculate leaving conditions
TC0 = -38.7782841989449d0
TC1 = 2.0127655837628d0
TC2 = 5212.49360216097d0
TC3 = 15.2362536782665d0
TC4 = -80.4910419759181d0
TC5 = -0.105014122001509d0
TC6 = -229.668673645144d0
TC7 = -0.015424703743461d0
TC8 = -69440.0689831847d0
TC9 = -1.6686064694322d0
TC10 = 38.5855718977592d0
TC11 = 0.000196395381206009d0
TC12 = 386.179386548324d0
TC13 = -0.801959614172614d0
TC14 = -3.33080986818745d0
TC15 = -15.2034386065714d0
ProcAirOutTemp = TC0 &
+ TC1*ProcAirInTemp + TC2*ProcAirInHumRat + TC3*ProcAirVel &
+ TC4*ProcAirInTemp*ProcAirInHumRat + TC5*ProcAirInTemp*ProcAirVel &
+ TC6*ProcAirInHumRat*ProcAirVel + TC7*ProcAirInTemp*ProcAirInTemp &
+ TC8*ProcAirInHumRat*ProcAirInHumRat + TC9*ProcAirVel*ProcAirVel &
+ TC10*ProcAirInTemp*ProcAirInTemp*ProcAirInHumRat*ProcAirInHumRat &
+ TC11*ProcAirInTemp*ProcAirInTemp*ProcAirVel*ProcAirVel &
+ TC12*ProcAirInHumRat*ProcAirInHumRat*ProcAirVel*ProcAirVel &
+ TC13*LOG(ProcAirInTemp) + TC14*LOG(ProcAirInHumRat) &
+ TC15*LOG(ProcAirVel)
! Regen energy
QC0 = -27794046.6291107d0
QC1 = -235725.171759615d0
QC2 = 975461343.331328d0
QC3 = -686069.373946731d0
QC4 = -17717307.3766266d0
QC5 = 31482.2539662489d0
QC6 = 55296552.8260743d0
QC7 = 6195.36070023868d0
QC8 = -8304781359.40435d0
QC9 = -188987.543809419d0
QC10 = 3933449.40965846d0
QC11 = -6.66122876558634d0
QC12 = -349102295.417547d0
QC13 = 83672.179730172d0
QC14 = -6059524.33170538d0
QC15 = 1220523.39525162d0
SpecRegenEnergy = QC0 &
+ QC1*ProcAirInTemp + QC2*ProcAirInHumRat + QC3*ProcAirVel &
+ QC4*ProcAirInTemp*ProcAirInHumRat + QC5*ProcAirInTemp*ProcAirVel &
+ QC6*ProcAirInHumRat*ProcAirVel + QC7*ProcAirInTemp*ProcAirInTemp &
+ QC8*ProcAirInHumRat*ProcAirInHumRat + QC9*ProcAirVel*ProcAirVel &
+ QC10*ProcAirInTemp*ProcAirInTemp*ProcAirInHumRat*ProcAirInHumRat &
+ QC11*ProcAirInTemp*ProcAirInTemp*ProcAirVel*ProcAirVel &
+ QC12*ProcAirInHumRat*ProcAirInHumRat*ProcAirVel*ProcAirVel &
+ QC13*LOG(ProcAirInTemp) + QC14*LOG(ProcAirInHumRat) &
+ QC15*LOG(ProcAirVel)
! Regen face velocity
RC0 = -4.67358908091488d0
RC1 = 0.0654323095468338d0
RC2 = 396.950518702316d0
RC3 = 1.52610165426736d0
RC4 = -11.3955868430328d0
RC5 = 0.00520693906104437d0
RC6 = 57.783645385621d0
RC7 = -0.000464800668311693d0
RC8 = -5958.78613212602d0
RC9 = -0.205375818291012d0
RC10 = 5.26762675442845d0
RC11 = -8.88452553055039d-05
RC12 = -182.382479369311d0
RC13 = -0.100289774002047d0
RC14 = -0.486980507964251d0
RC15 = -0.972715425435447d0
RegenAirVel = RC0 &
+ RC1*ProcAirInTemp + RC2*ProcAirInHumRat + RC3*ProcAirVel &
+ RC4*ProcAirInTemp*ProcAirInHumRat + RC5*ProcAirInTemp*ProcAirVel &
+ RC6*ProcAirInHumRat*ProcAirVel + RC7*ProcAirInTemp*ProcAirInTemp &
+ RC8*ProcAirInHumRat*ProcAirInHumRat + RC9*ProcAirVel*ProcAirVel &
+ RC10*ProcAirInTemp*ProcAirInTemp*ProcAirInHumRat*ProcAirInHumRat &
+ RC11*ProcAirInTemp*ProcAirInTemp*ProcAirVel*ProcAirVel &
+ RC12*ProcAirInHumRat*ProcAirInHumRat*ProcAirVel*ProcAirVel &
+ RC13*LOG(ProcAirInTemp) + RC14*LOG(ProcAirInHumRat) &
+ RC15*LOG(ProcAirVel)
CASE (PM_UserCurves)
ProcAirOutTemp = CurveValue(DesicDehum(DesicDehumNum)%ProcDryBulbCurvefTW,ProcAirInTemp,ProcAirInHumRat)&
* CurveValue(DesicDehum(DesicDehumNum)%ProcDryBulbCurvefV,ProcAirVel)
SpecRegenEnergy = CurveValue(DesicDehum(DesicDehumNum)%RegenEnergyCurvefTW,ProcAirInTemp,ProcAirInHumRat)&
* CurveValue(DesicDehum(DesicDehumNum)%RegenEnergyCurvefV,ProcAirVel)
RegenAirVel = CurveValue(DesicDehum(DesicDehumNum)%RegenVelCurvefTW,ProcAirInTemp,ProcAirInHumRat)&
* CurveValue(DesicDehum(DesicDehumNum)%RegenVelCurvefV,ProcAirVel)
CASE DEFAULT
CALL ShowFatalError('Invalid performance model in desiccant dehumidifier = '&
//TRIM(TrimSigDigits(DesicDehum(DesicDehumNum)%PerformanceModel_Num)))
END SELECT ! Performance Model Part B
ProcAirOutTemp = (1-PartLoad)*ProcAirInTemp + (PartLoad)*ProcAirOutTemp
ProcAirOutHumRat = (1-PartLoad)*ProcAirInHumRat + (PartLoad)*MinProcAirOutHumRat
! Calculate water removal
DesicDehum(DesicDehumNum)%WaterRemoveRate = ProcAirMassFlowRate * (ProcAirInHumRat - ProcAirOutHumRat)
! Adjust for regen inlet temperature
SpecRegenEnergy = SpecRegenEnergy * (NomRegenTemp - RegenAirInTemp) / (NomRegenTemp - ProcAirInTemp)
SpecRegenEnergy = MAX(SpecRegenEnergy, 0.0d0)
QRegen = SpecRegenEnergy*DesicDehum(DesicDehumNum)%WaterRemoveRate
! Above curves are based on a 90deg regen angle and 245deg process air angle
RegenAirMassFlowRate = ProcAirMassFlowRate * 90.d0/245.d0 * RegenAirVel/ProcAirVel
ElecUseRate = DesicDehum(DesicDehumNum)%NomRotorPower
ELSE ! Unit is off
ProcAirOutTemp = ProcAirInTemp
ProcAirOutHumRat = ProcAirInHumRat
SpecRegenEnergy = 0.0d0
QRegen = 0.0d0
ElecUseRate = 0.0d0
RegenAirVel = 0.0d0
RegenAirMassFlowRate = 0.0d0
DesicDehum(DesicDehumNum)%WaterRemoveRate = 0.0d0
PartLoad = 0.0d0
ENDIF ! UnitOn/Off
! Set regen mass flow
Node(DesicDehum(DesicDehumNum)%RegenFanInNode)%MassFlowRate = RegenAirMassFlowRate
Node(DesicDehum(DesicDehumNum)%RegenFanInNode)%MassFlowRateMaxAvail = RegenAirMassFlowRate
! Call regen fan
CALL SimulateFanComponents(DesicDehum(DesicDehumNum)%RegenFanName,FirstHVACIteration, &
DesicDehum(DesicDehumNum)%RegenFanIndex)
! Call regen heating coil
CALL CalcNonDXHeatingCoils(DesicDehumNum,FirstHVACIteration,QRegen,QDelivered)
! Verify is requestd flow was delivered (must do after heating coil has executed to pass flow to RegenAirInNode)
IF (Node(DesicDehum(DesicDehumNum)%RegenAirInNode)%MassFlowRate .NE. RegenAirMassFlowRate) THEN
! Initialize standard air density
IF (MyOneTimeFlag) THEN
RhoAirStdInit = StdRhoAir
ENDIF
CALL ShowRecurringSevereErrorAtEnd( &
'Improper flow delivered by desiccant regen fan - RESULTS INVALID! Check regen fan capacity and schedule.', &
DesicDehum(DesicDehumNum)%RegenFanErrorIndex1)
CALL ShowRecurringContinueErrorAtEnd( &
TRIM(DesicDehum(DesicDehumNum)%DehumType)//'='//TRIM(DesicDehum(DesicDehumNum)%Name), &
DesicDehum(DesicDehumNum)%RegenFanErrorIndex2)
RhoAirStdInit = StdRhoAir
CALL ShowRecurringContinueErrorAtEnd( &
TRIM('Flow requested [m3/s] from '//DesicDehum(DesicDehumNum)%RegenFanType)//'='// &
TRIM(DesicDehum(DesicDehumNum)%RegenFanName), &
DesicDehum(DesicDehumNum)%RegenFanErrorIndex3, &
ReportMaxOf=(RegenAirMassFlowRate / RhoAirStdInit))
CALL ShowRecurringContinueErrorAtEnd( &
'Flow request varied from delivered by [m3/s]', &
DesicDehum(DesicDehumNum)%RegenFanErrorIndex4, &
ReportMaxOf=((RegenAirMassFlowRate - Node(DesicDehum(DesicDehumNum)%RegenAirInNode)%MassFlowRate)/ RhoAirStdInit), &
ReportMinOf=((RegenAirMassFlowRate - Node(DesicDehum(DesicDehumNum)%RegenAirInNode)%MassFlowRate)/ RhoAirStdInit))
ENDIF
! Verify is requestd heating was delivered
IF (QDelivered .LT. QRegen) THEN
CALL ShowRecurringSevereErrorAtEnd( &
'Inadequate heat delivered by desiccant regen coil - RESULTS INVALID! Check regen coil capacity and schedule.', &
DesicDehum(DesicDehumNum)%RegenCapErrorIndex1)
CALL ShowRecurringContinueErrorAtEnd( &
TRIM(DesicDehum(DesicDehumNum)%DehumType)//'='//TRIM(DesicDehum(DesicDehumNum)%Name), &
DesicDehum(DesicDehumNum)%RegenCapErrorIndex2)
CALL ShowRecurringContinueErrorAtEnd( &
TRIM('Load requested [W] from '//DesicDehum(DesicDehumNum)%RegenCoilType)//'='// &
TRIM(DesicDehum(DesicDehumNum)%RegenCoilName), &
DesicDehum(DesicDehumNum)%RegenCapErrorIndex3,ReportMaxOf=QRegen)
CALL ShowRecurringContinueErrorAtEnd( &
'Load request exceeded delivered by [W]', &
DesicDehum(DesicDehumNum)%RegenCapErrorIndex4,ReportMaxOf=(QRegen-QDelivered))
ENDIF
DesicDehum(DesicDehumNum)%SpecRegenEnergy = SpecRegenEnergy
DesicDehum(DesicDehumNum)%QRegen = QRegen
DesicDehum(DesicDehumNum)%ElecUseRate = ElecUseRate
DesicDehum(DesicDehumNum)%PartLoad = PartLoad
DesicDehum(DesicDehumNum)%ProcAirOutMassFlowRate = ProcAirMassFlowRate
DesicDehum(DesicDehumNum)%ProcAirOutTemp = ProcAirOutTemp
DesicDehum(DesicDehumNum)%ProcAirOutHumRat = ProcAirOutHumRat
DesicDehum(DesicDehumNum)%ProcAirOutEnthalpy = PsyHFnTdbW(ProcAirOutTemp,ProcAirOutHumRat)
DesicDehum(DesicDehumNum)%RegenAirInMassFlowRate = RegenAirMassFlowRate
DesicDehum(DesicDehumNum)%RegenAirVel = RegenAirVel
! DesicDehum(DesicDehumNum)%RegenAirOutTemp = -999.
! DesicDehum(DesicDehumNum)%RegenAirOutHumRat = -999.
! DesicDehum(DesicDehumNum)%RegenAirOutEnthalpy = -999.
RETURN
!
END SUBROUTINE CalcSolidDesiccantDehumidifier