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) | :: | ThisSide | |||
type(Location), | intent(in), | optional | :: | SpecificPumpLocation | ||
real(kind=r64), | intent(in), | optional | :: | SpecificPumpFlowRate |
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 SimulateAllLoopSidePumps(LoopNum, ThisSide, SpecificPumpLocation, SpecificPumpFlowRate)
! SUBROUTINE INFORMATION:
! AUTHOR Edwin Lee
! DATE WRITTEN July 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! <description>
! METHODOLOGY EMPLOYED:
! <description>
! USE STATEMENTS:
USE DataPlant, ONLY: PlantLoop, TotNumLoops
USE DataLoopNode, ONLY: Node
USE Pumps, ONLY: SimPumps
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: LoopNum
INTEGER, INTENT(IN) :: ThisSide
TYPE(Location), OPTIONAL, INTENT(IN) :: SpecificPumpLocation
REAL(r64), OPTIONAL, INTENT(IN) :: SpecificPumpFlowRate
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: LoopCounter
INTEGER :: LoopSideCounter
INTEGER :: PumpCounter
INTEGER :: PumpIndexStart
INTEGER :: PumpIndexEnd
REAL(r64) :: FlowToRequest
LOGICAL :: ThisPumpRunning
REAL(r64) :: ThisPumpFlowRate
REAL(r64) :: ThisPumpMinAvail
REAL(r64) :: ThisPumpMaxAvail
INTEGER :: PumpLoopNum
INTEGER :: PumpLoopSideNum
INTEGER :: PumpBranchNum
INTEGER :: PumpCompNum
INTEGER :: PumpOutletNode
LOGICAL, SAVE :: EstablishedCompPumpIndeces = .FALSE.
!~ One time sweep through all loops/loopsides/pumps, assigning indeces to the pl%ls%br%comp%indexinloopsidepumps variable
IF (.NOT. EstablishedCompPumpIndeces) THEN
DO LoopCounter = 1, TotNumLoops
DO LoopSideCounter = 1, 2
DO PumpCounter = 1, PlantLoop(LoopCounter)%LoopSide(LoopSideCounter)%TotalPumps
PumpBranchNum = PlantLoop(LoopCounter)%LoopSide(LoopSideCounter)%Pumps(PumpCounter)%BranchNum
PumpCompNum = PlantLoop(LoopCounter)%LoopSide(LoopSideCounter)%Pumps(PumpCounter)%CompNum
PlantLoop(LoopCounter)%LoopSide(LoopSideCounter)%Branch(PumpBranchNum)%Comp(PumpCompNum)%IndexInLoopSidePumps &
= PumpCounter
END DO
END DO
END DO
EstablishedCompPumpIndeces = .TRUE.
END IF
! If we have a specific loop/side/br/comp, then find the index and only do that one, otherwise do all pumps on the loop side
IF (PRESENT(SpecificPumpLocation)) THEN
PumpLoopNum = SpecificPumpLocation%LoopNum
PumpLoopSideNum = SpecificPumpLocation%LoopSideNum
PumpBranchNum = SpecificPumpLocation%BranchNum
PumpCompNum = SpecificPumpLocation%CompNum
PumpIndexStart = &
PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%Branch(PumpBranchNum)%Comp(PumpCompNum)%IndexInLoopSidePumps
PumpIndexEnd = PumpIndexStart
ELSE
PumpLoopNum = LoopNum
PumpLoopSideNum = ThisSide
PumpIndexStart = 1
PumpIndexEnd = PlantLoop(LoopNum)%LoopSide(ThisSide)%TotalPumps
END IF
! If we have a flow rate to hit, then go for it, otherwise, just operate in request mode with zero flow
IF (PRESENT(SpecificPumpFlowRate)) THEN
FlowToRequest = SpecificPumpFlowRate
ELSE
FlowToRequest = 0.0d0
END IF
!~ Now loop through all the pumps and simulate them, keeping track of their status
DO PumpCounter = PumpIndexStart, PumpIndexEnd
!~ Set some variables
PumpBranchNum = PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%Pumps(PumpCounter)%BranchNum
PumpCompNum = PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%Pumps(PumpCounter)%CompNum
PumpOutletNode = PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%Pumps(PumpCounter)%PumpOutletNode
CALL AdjustPumpFlowRequestByEMSControls(PumpLoopNum, PumpLoopSideNum, PumpBranchNum, PumpCompNum, FlowToRequest)
! Call SimPumps, routine takes a flow request, and returns some info about the status of the pump
CALL SimPumps(PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%Pumps(PumpCounter)%PumpName, &
PumpLoopNum, &
FlowToRequest, &
ThisPumpRunning, &
PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%Branch(PumpBranchNum)%PumpIndex, &
PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%Pumps(PumpCounter)%PumpHeatToFluid)
!~ Pull some state information from the pump outlet node
ThisPumpFlowRate = Node(PumpOutletNode)%MassFlowRate
ThisPumpMinAvail = Node(PumpOutletNode)%MassFlowRateMinAvail
ThisPumpMaxAvail = Node(PumpOutletNode)%MassFlowRateMaxAvail
!~ Now update the data structure
PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%Pumps(PumpCounter)%CurrentMinAvail = ThisPumpMinAvail
PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%Pumps(PumpCounter)%CurrentMaxAvail = ThisPumpMaxAvail
END DO
!~ Update the loopside pump heat totality here
IF(PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%TotalPumps > 0) THEN
PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%TotalPumpHeat = &
SUM(PlantLoop(PumpLoopNum)%LoopSide(PumpLoopSideNum)%Pumps%PumpHeatToFluid)
END IF
RETURN
END SUBROUTINE SimulateAllLoopSidePumps