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) | :: | StandAloneERVNum | |||
integer, | intent(in) | :: | ZoneNum | |||
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 InitStandAloneERV(StandAloneERVNum,ZoneNum, FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN June 2003
! MODIFIED July 2012, Chandan Sharma - FSEC: Added zone sys avail managers
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initializations of the Stand Alone ERV unit information.
! METHODOLOGY EMPLOYED:
! Uses the status flags to trigger initializations.
! REFERENCES:
! na
! USE STATEMENTS:
! USE Psychrometrics, ONLY: PsyRhoAirFnPbTdbW
USE DataZoneEquipment, ONLY: ZoneEquipInputsFilled,CheckZoneEquipmentList,ERVStandAlone_Num
USE MixedAir, ONLY: SimOAController
USE DataAirLoop, ONLY: OAControllerInfo
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: StandAloneERVNum ! number of the current Stand Alone ERV unit being simulated
INTEGER, INTENT (IN) :: ZoneNum ! number of zone being served unused1208
LOGICAL, INTENT (IN) :: FirstHVACIteration ! TRUE if first HVAC iteration
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: SupInNode ! supply air inlet node number
INTEGER :: ExhInNode ! exhaust air inlet node number
INTEGER :: SupInletNode ! supply air inlet node number for Stand Alone ERV 'StandAloneERVNum'
REAL(r64) :: RhoAir ! air density at SupInNode, standard conditions (dry air @ 20C,actual elevation pressure)
LOGICAL,SAVE :: MyOneTimeFlag = .TRUE.
LOGICAL, ALLOCATABLE,SAVE, DIMENSION(:) :: MyEnvrnFlag
LOGICAL, ALLOCATABLE,SAVE, DIMENSION(:) :: MySizeFlag
LOGICAL,SAVE :: ZoneEquipmentListChecked = .FALSE. ! True after the Zone Equipment List has been checked for items
INTEGER :: Loop ! loop counter
! Do the one time initializations
IF (MyOneTimeFlag) THEN
ALLOCATE(MyEnvrnFlag(NumStandAloneERVs))
ALLOCATE(MySizeFlag(NumStandAloneERVs))
MyEnvrnFlag = .TRUE.
MySizeFlag = .TRUE.
MyOneTimeFlag = .FALSE.
ENDIF
IF (ALLOCATED(ZoneComp)) THEN
ZoneComp(ERVStandAlone_Num)%ZoneCompAvailMgrs(StandAloneERVNum)%ZoneNum = ZoneNum
StandAloneERV(StandAloneERVNum)%AvailStatus = ZoneComp(ERVStandAlone_Num)%ZoneCompAvailMgrs(StandAloneERVNum)%AvailStatus
ENDIF
! need to check all units to see if they are on Zone Equipment List or issue warning
IF (.not. ZoneEquipmentListChecked .and. ZoneEquipInputsFilled) THEN
ZoneEquipmentListChecked=.TRUE.
DO Loop=1,NumStandAloneERVs
IF (CheckZoneEquipmentList(StandAloneERV(Loop)%UnitType,StandAloneERV(Loop)%Name)) CYCLE
CALL ShowSevereError('InitStandAloneERV: Unit=['//TRIM(StandAloneERV(Loop)%UnitType)//','// &
TRIM(StandAloneERV(Loop)%Name)// &
'] is not on any ZoneHVAC:EquipmentList. It will not be simulated.')
ENDDO
ENDIF
IF ( .NOT. SysSizingCalc .AND. MySizeFlag(StandAloneERVNum)) THEN
CALL SizeStandAloneERV(StandAloneERVNum)
MySizeFlag(StandAloneERVNum) = .FALSE.
END IF
! Do the Begin Environment initializations
IF (BeginEnvrnFlag .and. MyEnvrnFlag(StandAloneERVNum)) THEN
SupInNode = StandAloneERV(StandAloneERVNum)%SupplyAirInletNode
ExhInNode = StandAloneERV(StandAloneERVNum)%ExhaustAirInletNode
RhoAir = StdRhoAir
! set the mass flow rates from the input volume flow rates
StandAloneERV(StandAloneERVNum)%MaxSupAirMassFlow = StdRhoAir*StandAloneERV(StandAloneERVNum)%SupplyAirVolFlow
StandAloneERV(StandAloneERVNum)%MaxExhAirMassFlow = StdRhoAir*StandAloneERV(StandAloneERVNum)%ExhaustAirVolFlow
StandAloneERV(StandAloneERVNum)%DesignSAFanMassFlowRate = StdRhoAir*StandAloneERV(StandAloneERVNum)%DesignSAFanVolFlowRate
StandAloneERV(StandAloneERVNum)%DesignEAFanMassFlowRate = StdRhoAir*StandAloneERV(StandAloneERVNum)%DesignEAFanVolFlowRate
! set the node max and min mass flow rates
Node(SupInNode)%MassFlowRateMax = StandAloneERV(StandAloneERVNum)%MaxSupAirMassFlow
Node(SupInNode)%MassFlowRateMin = 0.0d0
Node(ExhInNode)%MassFlowRateMax = StandAloneERV(StandAloneERVNum)%MaxExhAirMassFlow
Node(ExhInNode)%MassFlowRateMin = 0.0d0
MyEnvrnFlag(StandAloneERVNum) = .FALSE.
! Initialize OA Controller on BeginEnvrnFlag
IF(StandAloneERV(StandAloneERVNum)%ControllerNameDefined)THEN
CALL SimOAController(StandAloneERV(StandAloneERVNum)%ControllerName,StandAloneERV(StandAloneERVNum)%ControllerIndex, &
FirstHVACIteration,0)
END IF
ENDIF ! end one time inits
IF (.not. BeginEnvrnFlag) THEN
MyEnvrnFlag(StandAloneERVNum) = .TRUE.
ENDIF
! These initializations are done every iteration
StandAloneERV(StandAloneERVNum)%ElecUseRate = 0.0d0
StandAloneERV(StandAloneERVNum)%SensCoolingRate = 0.0d0
StandAloneERV(StandAloneERVNum)%LatCoolingRate = 0.0d0
StandAloneERV(StandAloneERVNum)%TotCoolingRate = 0.0d0
StandAloneERV(StandAloneERVNum)%SensHeatingRate = 0.0d0
StandAloneERV(StandAloneERVNum)%LatHeatingRate = 0.0d0
StandAloneERV(StandAloneERVNum)%TotHeatingRate = 0.0d0
SupInletNode = StandAloneERV(StandAloneERVNum)%SupplyAirInletNode
ExhInNode = StandAloneERV(StandAloneERVNum)%ExhaustAirInletNode
! Set the inlet node mass flow rate
IF (GetCurrentScheduleValue(StandAloneERV(StandAloneERVNum)%SchedPtr) .GT. 0.0d0) THEN
! IF optional ControllerName is defined SimOAController ONLY to set economizer and Modifyairflow flags
IF(StandAloneERV(StandAloneERVNum)%ControllerNameDefined)THEN
! Initialize a flow rate for controller
Node(SupInletNode)%MassFlowRate = StandAloneERV(StandAloneERVNum)%MaxSupAirMassFlow
CALL SimOAController(StandAloneERV(StandAloneERVNum)%ControllerName,StandAloneERV(StandAloneERVNum)%ControllerIndex, &
FirstHVACIteration,0)
END IF
IF(GetCurrentScheduleValue(StandAloneERV(StandAloneERVNum)%SupplyAirFanSchPtr) .GT. 0 .OR. &
ZoneCompTurnFansOn .AND. .NOT. ZoneCompTurnFansOff)THEN
IF(StandAloneERV(StandAloneERVNum)%ControllerNameDefined)THEN
IF(OAControllerInfo(StandAloneERV(StandAloneERVNum)%ControllerIndex)%HighHumCtrlActive)THEN
Node(SupInletNode)%MassFlowRate = MIN(StandAloneERV(StandAloneERVNum)%DesignSAFanMassFlowRate, &
StandAloneERV(StandAloneERVNum)%MaxSupAirMassFlow * &
StandAloneERV(StandAloneERVNum)%HighRHOAFlowRatio)
ELSE
Node(SupInletNode)%MassFlowRate = MIN(StandAloneERV(StandAloneERVNum)%DesignSAFanMassFlowRate, &
StandAloneERV(StandAloneERVNum)%MaxSupAirMassFlow)
END IF
ELSE
Node(SupInletNode)%MassFlowRate = MIN(StandAloneERV(StandAloneERVNum)%DesignSAFanMassFlowRate, &
StandAloneERV(StandAloneERVNum)%MaxSupAirMassFlow)
END IF
ELSE
Node(SupInletNode)%MassFlowRate = 0.0d0
END IF
Node(SupInletNode)%MassFlowRateMaxAvail = Node(SupInletNode)%MassFlowRate
Node(SupInletNode)%MassFlowRateMinAvail = Node(SupInletNode)%MassFlowRate
IF(GetCurrentScheduleValue(StandAloneERV(StandAloneERVNum)%ExhaustAirFanSchPtr) .GT. 0)THEN
IF(StandAloneERV(StandAloneERVNum)%ControllerNameDefined)THEN
IF(OAControllerInfo(StandAloneERV(StandAloneERVNum)%ControllerIndex)%HighHumCtrlActive)THEN
Node(ExhInNode)%MassFlowRate = MIN(StandAloneERV(StandAloneERVNum)%DesignEAFanMassFlowRate, &
StandAloneERV(StandAloneERVNum)%MaxExhAirMassFlow * &
StandAloneERV(StandAloneERVNum)%HighRHOAFlowRatio)
ELSE
Node(ExhInNode)%MassFlowRate = MIN(StandAloneERV(StandAloneERVNum)%DesignEAFanMassFlowRate, &
StandAloneERV(StandAloneERVNum)%MaxExhAirMassFlow)
END IF
ELSE
Node(ExhInNode)%MassFlowRate = MIN(StandAloneERV(StandAloneERVNum)%DesignEAFanMassFlowRate, &
StandAloneERV(StandAloneERVNum)%MaxExhAirMassFlow)
END IF
ELSE
Node(ExhInNode)%MassFlowRate = 0.0d0
END IF
Node(ExhInNode)%MassFlowRateMaxAvail = Node(ExhInNode)%MassFlowRate
Node(ExhInNode)%MassFlowRateMinAvail = Node(ExhInNode)%MassFlowRate
ELSE
Node(SupInletNode)%MassFlowRate = 0.0d0
Node(SupInletNode)%MassFlowRateMaxAvail = 0.0d0
Node(SupInletNode)%MassFlowRateMinAvail = 0.0d0
Node(ExhInNode)%MassFlowRate = 0.0d0
Node(ExhInNode)%MassFlowRateMaxAvail = 0.0d0
Node(ExhInNode)%MassFlowRateMinAvail = 0.0d0
ENDIF
RETURN
END SUBROUTINE InitStandAloneERV