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 | |||
integer, | intent(in) | :: | CompNum |
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 UpdateAnyLoopDemandAlterations(LoopNum, LoopSideNum, BranchNum, CompNum)
! SUBROUTINE INFORMATION:
! AUTHOR Edwin Lee
! DATE WRITTEN August 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine will analyze the given component and determine if any
! alterations need to be made to the current loop demand value. If so,
! it will make the changes to the module level loop demand variables.
! METHODOLOGY EMPLOYED:
! Components will always supply a useful delta T, even if it happens to be zero
! For flow rate, make decisions based on the component's current operating scheme type:
! - Demand based: these components will have a flow request on their inlet node
! - Pump: these components will not be included, as they no longer include heat at the pump
! - component setpoint: these components will have a flow request
! on their outlet node corresponding to their calculated delta T
! - load range based: these components do not 'alter' the load, they reject the load
! Therefore they are not included
! USE STATEMENTS:
USE DataPlant, ONLY: PlantLoop, DemandOpSchemeType, PumpOpSchemeType, LoadRangeBasedMin, LoadRangeBasedMax, &
NoControlOpSchemeType, CompSetPtBasedSchemeType, FreeRejectionOpSchemeType, WSEconOpSchemeType, &
UnknownStatusOpSchemeType, FlowUnlocked, FlowLocked
USE DataBranchAirLoopPlant, ONLY: MassFlowTolerance
USE DataLoopNode, ONLY: Node
USE FluidProperties, ONLY: GetSpecificHeatGlycol
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
INTEGER, INTENT(IN) :: CompNum
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: ComponentCp
REAL(r64) :: ComponentMassFlowRate
INTEGER :: InletNode
REAL(r64) :: InletTemp
INTEGER :: OutletNode
REAL(r64) :: OutletTemp
REAL(r64) :: AverageTemp
REAL(r64) :: LoadAlteration
! Init to zero, so that if we don't find anything, we exit early
ComponentMassFlowRate = 0.0d0
! Get information
InletNode = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompNum)%NodeNumIn
OutletNode = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompNum)%NodeNumOut
IF (PlantLoop(LoopNum)%LoopSide(LoopSideNum)%FlowLock == FlowUnLocked) THEN
! For unlocked flow, use the inlet request -- !DSU? for now
SELECT CASE (PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompNum)%CurOpSchemeType)
CASE (LoadRangeBasedMin:LoadRangeBasedMax)
! Don't do anything for load based components
CASE DEFAULT
! pumps pipes, etc. will be lumped in here with other component types, but they will have no delta T anyway
ComponentMassFlowRate = Node(InletNode)%MassFlowRateRequest
!DSU? make sure components like economizers use the mass flow request
END SELECT
ELSEIF (PlantLoop(LoopNum)%LoopSide(LoopSideNum)%FlowLock == FlowLocked) THEN
! For locked flow just use the mass flow rate
SELECT CASE (PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompNum)%CurOpSchemeType)
CASE (LoadRangeBasedMin:LoadRangeBasedMax)
! Don't do anything for load based components
CASE DEFAULT
! pumps pipes, etc. will be lumped in here with other component types, but they will have no delta T anyway
ComponentMassFlowRate = Node(OutletNode)%MassFlowRate
END SELECT
ELSE ! flow pump query? problem?
END IF
! Leave early if there wasn't a mass flow rate or request
IF (ComponentMassFlowRate .LT. MassFlowTolerance) RETURN
! Get an average temperatre for the property call
InletTemp = Node(InletNode)%Temp
OutletTemp = Node(OutletNode)%Temp
AverageTemp = (InletTemp + OutletTemp) / 2
ComponentCp = GetSpecificHeatGlycol(PlantLoop(LoopNum)%FluidName, AverageTemp, &
PlantLoop(LoopNum)%FluidIndex, 'PlantLoopSolver::UpdateAnyLoopDemandAlterations')
! Calculate the load altered by this component
LoadAlteration = ComponentMassFlowRate * ComponentCp * (OutletTemp - InletTemp)
! Now alter the module level variables
CurrentAlterationsToDemand = CurrentAlterationsToDemand + LoadAlteration
UpdatedDemandToLoopSetPoint = InitialDemandToLoopSetPoint - CurrentAlterationsToDemand
RETURN
END SUBROUTINE UpdateAnyLoopDemandAlterations