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) | :: | SetPtMgrNum |
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 CalcOAPretreatSetPoint(SetPtMgrNum)
! SUBROUTINE INFORMATION:
! AUTHOR M. J. Witte based on CalcMixedAirSetPoint by Fred Buhl,
! Work supported by ASHRAE research project 1254-RP
! DATE WRITTEN January 2005
! MODIFIED Witte (GARD), Sep 2006
! Griffith( NREL), May 2009, added EMS setpoint checks
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Starting with the setpoint at the reference node, determine the required
! outside air inlet conditions which when mixed with return air result in
! the reference setpoint at the mixed air node.
! (based on CalcMixedAirSetPoint)
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY: SysSizingCalc, AnyEnergyManagementSystemInModel
USE EMSManager, ONLY: iTemperatureSetpoint, CheckIfNodeSetpointManagedByEMS, &
iHumidityRatioSetpoint, iHumidityRatioMinSetpoint, iHumidityRatioMaxSetpoint
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: SetPtMgrNum ! number of the current setpoint manager being simulated
! SUBROUTINE PARAMETER DEFINITIONS:
! INTERFACE BLOCK SPECIFICATIONS
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: RefNode ! setpoint reference node number
INTEGER :: MixedOutNode ! mixed air outlet node number
INTEGER :: OAInNode ! outside air inlet node number
INTEGER :: ReturnInNode ! return air inlet node number
REAL(r64) :: OAFraction ! outside air fraction of mixed flow rate
REAL(r64) :: ReturnInValue ! return air inlet node mass flow rate
REAL(r64) :: RefNodeSetPoint ! setpoint at reference node
REAL(r64) :: MinSetPoint ! minimum allowed setpoint
REAL(r64) :: MaxSetPoint ! maximum allowed setpoint
LOGICAL :: HumiditySetPoint ! logical to indicate if this is a humidity setpoint
LOGICAL :: LocalSetpointCheckFailed = .FALSE.
RefNode = OAPretreatSetPtMgr(SetPtMgrNum)%RefNode
MixedOutNode = OAPretreatSetPtMgr(SetPtMgrNum)%MixedOutNode
OAInNode = OAPretreatSetPtMgr(SetPtMgrNum)%OAInNode
ReturnInNode = OAPretreatSetPtMgr(SetPtMgrNum)%ReturnInNode
HumiditySetPoint = .FALSE.
SELECT CASE(OAPretreatSetPtMgr(SetPtMgrNum)%CtrlTypeMode)
CASE(iCtrlVarType_Temp) ! 'Temperature'
RefNodeSetPoint = Node(RefNode)%TempSetPoint
ReturnInValue = Node(ReturnInNode)%Temp
MinSetPoint = OAPretreatSetPtMgr(SetPtMgrNum)%MinSetTemp
MaxSetPoint = OAPretreatSetPtMgr(SetPtMgrNum)%MaxSetTemp
CASE(iCtrlVarType_MaxHumRat) ! 'HUMRATMAX'
RefNodeSetPoint = Node(RefNode)%HumRatMax
ReturnInValue = Node(ReturnInNode)%HumRat
MinSetPoint = OAPretreatSetPtMgr(SetPtMgrNum)%MinSetHumRat
MaxSetPoint = OAPretreatSetPtMgr(SetPtMgrNum)%MaxSetHumRat
HumiditySetPoint = .TRUE.
CASE(iCtrlVarType_MinHumRat) ! 'HUMRATMIN'
RefNodeSetPoint = Node(RefNode)%HumRatMin
ReturnInValue = Node(ReturnInNode)%HumRat
MinSetPoint = OAPretreatSetPtMgr(SetPtMgrNum)%MinSetHumRat
MaxSetPoint = OAPretreatSetPtMgr(SetPtMgrNum)%MaxSetHumRat
HumiditySetPoint = .TRUE.
CASE(iCtrlVarType_HumRat) ! 'HumidityRatio'
RefNodeSetPoint = Node(RefNode)%HumRatSetPoint
ReturnInValue = Node(ReturnInNode)%HumRat
MinSetPoint = OAPretreatSetPtMgr(SetPtMgrNum)%MinSetHumRat
MaxSetPoint = OAPretreatSetPtMgr(SetPtMgrNum)%MaxSetHumRat
HumiditySetPoint = .TRUE.
END SELECT
IF ( .NOT. SysSizingCalc .AND. OAPretreatSetPtMgr(SetPtMgrNum)%MySetPointCheckFlag) THEN
OAPretreatSetPtMgr(SetPtMgrNum)%MySetPointCheckFlag = .FALSE.
IF (RefNodeSetPoint == SensedNodeFlagValue) THEN
IF (.NOT. AnyEnergyManagementSystemInModel) THEN
CALL ShowSevereError('CalcOAPretreatSetPoint: Missing reference setpoint for Outdoor Air Pretreat Setpoint Manager '// &
TRIM(OAPretreatSetPtMgr(SetPtMgrNum)%Name))
CALL ShowContinueError('Node Referenced ='//TRIM(NodeID(RefNode)))
CALL ShowContinueError('use a Setpoint Manager to establish a setpoint at this node.')
CALL ShowFatalError('Missing reference setpoint.')
ELSE
LocalSetpointCheckFailed = .FALSE.
SELECT CASE(OAPretreatSetPtMgr(SetPtMgrNum)%CtrlTypeMode)
CASE(iCtrlVarType_Temp) ! 'Temperature'
CALL CheckIfNodeSetpointManagedByEMS(RefNode,iTemperatureSetpoint, LocalSetpointCheckFailed)
CASE(iCtrlVarType_MaxHumRat) ! 'HUMRATMAX'
CALL CheckIfNodeSetpointManagedByEMS(RefNode,iHumidityRatioMaxSetpoint, LocalSetpointCheckFailed)
CASE(iCtrlVarType_MinHumRat) ! 'HUMRATMIN'
CALL CheckIfNodeSetpointManagedByEMS(RefNode,iHumidityRatioMinSetpoint, LocalSetpointCheckFailed)
CASE(iCtrlVarType_HumRat) ! 'HumidityRatio'
CALL CheckIfNodeSetpointManagedByEMS(RefNode,iHumidityRatioSetpoint, LocalSetpointCheckFailed)
END SELECT
IF (LocalSetpointCheckFailed) THEN
CALL ShowSevereError('CalcOAPretreatSetPoint: Missing reference setpoint for Outdoor Air Pretreat Setpoint Manager '// &
TRIM(OAPretreatSetPtMgr(SetPtMgrNum)%Name))
CALL ShowContinueError('Node Referenced ='//TRIM(NodeID(RefNode)))
CALL ShowContinueError('use a Setpoint Manager to establish a setpoint at this node.')
CALL ShowContinueError('Or use an EMS actuator to control a setpoint at this node.')
CALL ShowFatalError('Missing reference setpoint.')
ENDIF
ENDIF
END IF
END IF
IF ((Node(MixedOutNode)%MassFlowRate .LE. 0.0d0) .OR. (Node(OAInNode)%MassFlowRate .LE. 0.0d0)) THEN
OAPretreatSetPtMgr(SetPtMgrNum)%SetPt = RefNodeSetPoint
ELSEIF (HumiditySetPoint .AND. (RefNodeSetPoint == 0.0d0)) THEN
! For humidity setpoints, zero is special meaning "off" or "no load"
! so pass through zero setpoints without enforcing the max/min setpoint limits
OAPretreatSetPtMgr(SetPtMgrNum)%SetPt = 0.0d0
ELSE
OAFraction = Node(OAInNode)%MassFlowRate / Node(MixedOutNode)%MassFlowRate
OAPretreatSetPtMgr(SetPtMgrNum)%SetPt = ReturnInValue + (RefNodeSetPoint - ReturnInValue)/OAFraction
! Apply maximum and minimum values
OAPretreatSetPtMgr(SetPtMgrNum)%SetPt = MAX(OAPretreatSetPtMgr(SetPtMgrNum)%SetPt, MinSetPoint)
OAPretreatSetPtMgr(SetPtMgrNum)%SetPt = MIN(OAPretreatSetPtMgr(SetPtMgrNum)%SetPt, MaxSetPoint)
END IF
RETURN
END SUBROUTINE CalcOAPretreatSetPoint