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) | :: | LoopNum | |||
integer, | intent(in) | :: | LoopSideNum | |||
integer, | intent(in) | :: | BranchNum |
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.
REAL(r64) FUNCTION DetermineBranchFlowRequest(LoopNum, LoopSideNum, BranchNum) RESULT(OverallFlowRequest)
! SUBROUTINE INFORMATION:
! AUTHOR Edwin Lee
! DATE WRITTEN September 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine will analyze the given branch and determine the representative
! flow request.
! METHODOLOGY EMPLOYED:
! Several possibilities are available. In any case, the request is constrained to within
! branch outlet min/max avail. This assumes that the component flow routines will properly
! propogate the min/max avail down the branch.
! Some possibilities for flow request are:
! 1) take the outlet flow rate -- assumes that the last component wins
! 2) take the inlet flow rate request -- assumes that the request is propogated up and is good
! 3) take the maximum request
! 4) move down the loop and take the maximum "non-load-range-based" request within min/max avail bounds
! This assumes that load range based should not request flow for load-rejection purposes, and we
! should only "respond" to other component types.
! USE STATEMENTS:
USE DataPlant, ONLY: PlantLoop, LoadRangeBasedMin, LoadRangeBasedMax
USE DataLoopNode, ONLY: Node
USE PlantUtilities, ONLY: BoundValueToNodeMinMaxAvail
USE DataBranchAirLoopPlant, ONLY : ControlType_SeriesActive
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: LoopNum
INTEGER, INTENT(IN) :: LoopSideNum
INTEGER, INTENT(IN) :: BranchNum
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: OutletFlowRate = 1
INTEGER, PARAMETER :: InletFlowRequest = 2
INTEGER, PARAMETER :: MaximumRequest = 3
INTEGER, PARAMETER :: MaxNonLRBRequest = 4
INTEGER, PARAMETER :: WhichRequestCalculation = InletFlowRequest
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: CompCounter
INTEGER :: CompInletNode
INTEGER :: BranchOutletNodeNUm
INTEGER :: BranchInletNodeNum
!~ Initialize
BranchInletNodeNum = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%NodeNumIn
BranchOutletNodeNum = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%NodeNumOut
OverallFlowRequest = 0.0d0
SELECT CASE (WhichRequestCalculation)
CASE(OutletFlowRate)
OverallFlowRequest = Node(BranchOutletNodeNum)%MassFlowRate
CASE(InletFlowRequest)
IF (PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%ControlType /= ControlType_SeriesActive) THEN
OverallFlowRequest = Node(BranchInletNodeNum)%MassFlowRateRequest
ELSE ! is series active, so take largest request of all the component inlet nodes
DO CompCounter = 1, PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%TotalComponents
CompInletNode = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompCounter)%NodeNumIn
OverallFlowRequest = MAX(OverallFlowRequest, Node(CompInletNode)%MassFlowRateRequest)
END DO
ENDIF
CASE(MaximumRequest)
! Assumes component inlet node is where request is held...could bandaid to include outlet node, but trying not to...
DO CompCounter = 1, PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%TotalComponents
CompInletNode = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompCounter)%NodeNumIn
OverallFlowRequest = MAX(OverallFlowRequest, Node(CompInletNode)%MassFLowRateRequest)
END DO
CASE(MaxNonLRBRequest)
! Assumes component inlet node is where request is held...could bandaid to include outlet node, but trying not to...
DO CompCounter = 1, PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%TotalComponents
SELECT CASE(PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompCounter)%CurOpSchemeType)
CASE (LoadRangeBasedMin:LoadRangeBasedMax)
! don't include this request
CASE DEFAULT
! include this
CompInletNode = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompCounter)%NodeNumIn
OverallFlowRequest = MAX(OverallFlowRequest, Node(CompInletNode)%MassFLowRateRequest)
END SELECT
END DO
END SELECT
!~ Now use a worker to bound the value to outlet min/max avail
OverallFlowRequest = BoundValueToNodeMinMaxAvail(OverallFlowRequest, BranchOutletNodeNum)
RETURN
END FUNCTION DetermineBranchFlowRequest