GetOnOffFan Function

public pure function GetOnOffFan(Mode, MotEff, FanPower, MotInAirFrac, InletAirEnthalpy, AirMassFlowRate) result(OutletAirEnthalpy)

Simplified version of SimOnOffFan subroutine in EnergyPlus Given the mode of operation (on or off), fan motor efficiency, power of the fan, fraction of motor heat entering air stream moist air enthaply of the air entering the fan, and mass flow rate, it returns the moist air enthaply of the air after it has passed through the fan. It assumes sensible heating process only - i.e. it does not change the moisture in the air - and the mass flow rate across the component remains the same. Original Credits: NREL Energy Plus, Shirey, R. Raustad - FSEC, Brent Griffith, Chandan Sharma, Rongpeng Zhang Reference: ASHRAE HVAC 2 Toolkit, page 2-3 (FANSIM) https://github.com/NREL/EnergyPlus/blob/d37252156cb0eef0cb9b1af5ce7dcd7423011649/src/EnergyPlus/Fans.cc#L1967-L1989 This fan does not change the moisture or Mass Flow across the component

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: Mode
real(kind=dp), intent(in) :: MotEff
real(kind=dp), intent(in) :: FanPower
real(kind=dp), intent(in) :: MotInAirFrac
real(kind=dp), intent(in) :: InletAirEnthalpy
real(kind=dp), intent(in) :: AirMassFlowRate

Return Value real(kind=dp)


Called by

proc~~getonofffan~~CalledByGraph proc~getonofffan GetOnOffFan proc~calcminimaldxcooling CalcMinimalDXCooling proc~calcminimaldxcooling->proc~getonofffan proc~calcminimaldxheating CalcMinimalDXHeating proc~calcminimaldxheating->proc~getonofffan proc~simminimaldxheating SimMinimalDXHeating proc~simminimaldxheating->proc~calcminimaldxheating proc~simminimaldxcooling SimMinimalDXCooling proc~simminimaldxcooling->proc~calcminimaldxcooling

Contents

Source Code


Source Code

  pure function GetOnOffFan(Mode, MotEff, FanPower, MotInAirFrac, InletAirEnthalpy, AirMassFlowRate) result(OutletAirEnthalpy)
    !+ Simplified version of SimOnOffFan subroutine in EnergyPlus
    !+ Given the mode of operation (on or off), fan motor efficiency, power of the fan, fraction of motor heat entering air stream
    !+ moist air enthaply of the air entering the fan, and mass flow rate, it returns the moist air enthaply of the air
    !+ after it has passed through the fan. It assumes sensible heating process only - i.e. it does not change the moisture
    !+ in the air - and the mass flow rate across the component remains the same.
    !+ Original Credits: NREL Energy Plus, Shirey, R. Raustad - FSEC, Brent Griffith,  Chandan Sharma, Rongpeng Zhang
    !+ Reference: ASHRAE HVAC 2 Toolkit, page 2-3 (FANSIM)
    !+ https://github.com/NREL/EnergyPlus/blob/d37252156cb0eef0cb9b1af5ce7dcd7423011649/src/EnergyPlus/Fans.cc#L1967-L1989
    !+ This fan does not change the moisture or Mass Flow across the component

    ! Using fortran 2008 standard to represent double-precision floating-point format
    integer, parameter :: dp = REAL64

    ! Function arguments:
    integer,    intent(in)  ::  Mode                ! Mode of operation: 1 for on, 0 for off                [1]
    real(dp),   intent(in)  ::  MotEff              ! Fan motor efficiency                                  [1]
    real(dp),   intent(in)  ::  FanPower            ! Power of the fan to be simulated                      [W]
    real(dp),   intent(in)  ::  MotInAirFrac        ! Fraction of motor heat entering air stream            [1]
    real(dp),   intent(in)  ::  InletAirEnthalpy    ! Moist air enthaply of the air before entering the fan [J/kg]
    real(dp),   intent(in)  ::  AirMassFlowRate     ! Mass flow rate through the Fan being simulated        [kg/Sec]
    real(dp)                ::  OutletAirEnthalpy   ! Moist air enthaply of the air after entering the fan  [J/kg]

    ! Local variables
    real(dp)    ::  FanShaftPower
    real(dp)    ::  PowerLossToAir

    if (Mode == 1 ) then
      ! Power delivered to shaft
      FanShaftPower = MotEff * FanPower
      PowerLossToAir = FanShaftPower + (FanPower - FanShaftPower) * MotInAirFrac
      OutletAirEnthalpy = InletAirEnthalpy + PowerLossToAir / AirMassFlowRate

    else if (Mode == 0 ) then
      ! Fan is off and not operating no power consumed and mass flow rate.
      OutletAirEnthalpy = InletAirEnthalpy

    else
      error stop 'Fan Mode must either be 1 for on or 0 for off'
    end if
  end function GetOnOffFan