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 | |||
real(kind=r64), | intent(in) | :: | ValueToPush | |||
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 PushBranchFlowCharacteristics(LoopNum, LoopSideNum, BranchNum, ValueToPush, FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Edwin Lee
! DATE WRITTEN September 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This routine takes the flow resolved flow rate and pushes it
! down a branch. In the process, if an externally connected
! component (air-water coil for example) is found to have a
! differing flow rate, the air sim flag is tripped to true, but
! the flow resolved flow rate is pushed down the loop to allow
! the plant to finish successfully.
! METHODOLOGY EMPLOYED:
! Push mass flow rate and max avail down each branch. If the component
! is connected (or could be, for now) to an external loop such as
! an air loop, the current component outlet mass flow is checked
! vs the current resolved mass flow. If the mass flow doesn't match,
! the air sim flag is tripped to true.
! Currently this routine is only performed for starved branches, when
! the coil is requesting too much flow, more than the plant can provide.
! If this were moved to every call type, including a minimum plant flow,
! you would need to provide a mass flow and min/max avail to push
! down the branch as well.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataPlant ! Use the entire module to allow all TypeOf's, would be a huge ONLY list
USE DataBranchAirLoopPlant, ONLY: MassFlowTolerance
USE DataLoopNode, ONLY: Node
USE PlantUtilities, ONLY: CheckPlantConvergence
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
REAL(r64), INTENT(IN) :: ValueToPush
LOGICAL, INTENT(IN) :: FirstHVACIteration ! TRUE if First HVAC iteration of Time step
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: CompCounter
INTEGER :: BranchInletNode
INTEGER :: BranchOutletNode
INTEGER :: ComponentInletNode
INTEGER :: ComponentOutletNode
INTEGER :: ComponentTypeOfNum
REAL(r64) :: MassFlowRateFound
REAL(r64) :: MassFlow
LOGICAL :: PlantIsRigid
!REAL(r64) :: MinAvail
! REAL(r64) :: MaxAvail
BranchInletNode = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%NodeNumIn
BranchOutletNode = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%NodeNumOut
!~ Possible error handling if needed
IF (ValueToPush .NE. Node(BranchInletNode)%MassFlowRate) THEN
! Diagnostic problem, flow resolver isn't calling this routine properly
END IF
!~ This section would really be useful more later on if this routine has more logic regarding what to push down the branch
MassFlow = ValueToPush
!MinAvail = ValueToPush
! MaxAvail = ValueToPush
PlantIsRigid = CheckPlantConvergence(LoopNum, LoopSideNum, FirstHVACIteration)
!~ Loop across all component outlet nodes and update their mass flow and max avail
DO CompCounter = 1, PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%TotalComponents
!~ Pick up some values for convenience
ComponentInletNode = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompCounter)%NodeNumIn
ComponentOutletNode = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompCounter)%NodeNumOut
MassFlowRateFound = Node(ComponentOutletNode)%MassFlowRate
ComponentTypeOfNum = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompCounter)%TypeOf_Num
!~ Push the values through
Node(ComponentOutletNode)%MassFlowRate = MassFlow
IF (PlantIsRigid) THEN
Node(ComponentInletNode)%MassFlowRateMinAvail = MassFlow
Node(ComponentInletNode)%MassFlowRateMaxAvail = MassFlow
Node(ComponentOutletNode)%MassFlowRateMinAvail = MassFlow
Node(ComponentOutletNode)%MassFlowRateMaxAvail = MassFlow
END IF
!Node(ComponentOutletNode)%MassFlowRateMinAvail = MinAvail
! no this is 2-way valve which messes up flow options
! for demand components Node(ComponentOutletNode)%MassFlowRateMaxAvail = MaxAvail
!~ If this value matches then we are good to move to the next component
IF (ABS(MassFlow - MassFlowRateFound) < CriteriaDelta_MassFlowRate) CYCLE
!~ Since there is a difference, we have to decide what to do based on the component type:
!~ For plant connections, don't do anything, it SHOULD work itself out
!~ For air connections, trip the loopside air flag
!~ Similar for zone, none zone, and electric load center
SELECT CASE (ComponentTypeOfNum)
! possibly air-connected components
CASE ( TypeOf_CoilWaterCooling, &
TypeOf_CoilWaterDetailedFlatCooling, &
TypeOf_CoilWaterSimpleHeating, &
TypeOf_CoilSteamAirHeating, &
TypeOf_CoilWAHPHeatingEquationFit, &
TypeOf_CoilWAHPCoolingEquationFit, &
TypeOf_CoilWAHPHeatingParamEst, &
TypeOf_CoilWAHPCoolingParamEst, &
TypeOf_CoilUserDefined , &
TypeOf_CoilVSWAHPCoolingEquationFit, &
TypeOf_CoilVSWAHPHeatingEquationFit, &
TypeOf_PackagedTESCoolingCoil)
PlantLoop(LoopNum)%LoopSide(LoopSideNum)%SimAirLoopsNeeded = .TRUE.
!sometimes these coils are children in ZoneHVAC equipment
! PlantLoop(LoopNum)%LoopSide(LoopSideNum)%SimZoneEquipNeeded= .TRUE.
CASE( TypeOf_BASEBOARD_CONV_WATER, & !zone connected components
TypeOf_BASEBOARD_RAD_CONV_STEAM, &
TypeOf_BASEBOARD_RAD_CONV_WATER, &
TypeOf_LowTempRadiant_VarFlow, &
TypeOf_LowTempRadiant_ConstFlow, &
TypeOf_CooledBeamAirTerminal, &
TypeOf_ZoneHVACAirUserDefined, &
TypeOf_AirTerminalUserDefined)
PlantLoop(LoopNum)%LoopSide(LoopSideNum)%SimZoneEquipNeeded= .TRUE.
CASE( TypeOf_Generator_FCExhaust, & !electric center connected components
TypeOf_Generator_FCStackCooler, &
TypeOf_Generator_MicroCHP, &
TypeOf_Generator_MicroTurbine, &
TypeOf_Generator_ICEngine, &
TypeOf_Generator_CTurbine)
PlantLoop(LoopNum)%LoopSide(LoopSideNum)%SimElectLoadCentrNeeded = .TRUE.
END SELECT
END DO
RETURN
END SUBROUTINE PushBranchFlowCharacteristics