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) | :: | CompTypeNum | |||
| 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 CalcPlantValves(CompTypeNum,CompNum)
          ! SUBROUTINE INFORMATION:
          !       AUTHOR         B. Griffith, NREL
          !       DATE WRITTEN   Jan. 2006
          !       MODIFIED       na
          !       RE-ENGINEERED  na
          ! PURPOSE OF THIS SUBROUTINE:
          !  This routine does the calculations for Valves.
          !  Currently only one type of valve, for Tempering.
          ! METHODOLOGY EMPLOYED:
          !   Tempering valve calculations involve computing a flow fraction
          !     that should be diverted.  See update routine for setting flow rates.
          ! REFERENCES:
          ! na
          ! USE STATEMENTS:
  USE DataPlant, ONLY : PlantLoop, TypeOf_ValveTempering
  USE DataGlobals, ONLY : KickOffSimulation
  IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
          ! SUBROUTINE ARGUMENT DEFINITIONS:
  INTEGER,  INTENT(IN)    :: CompTypeNum
  INTEGER , INTENT(IN)    :: CompNum
          ! SUBROUTINE PARAMETER DEFINITIONS:
          ! na
          ! INTERFACE BLOCK SPECIFICATIONS:
          ! na
          ! DERIVED TYPE DEFINITIONS:
          ! na
          ! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
  REAL(r64) :: Tin  ! local working variable for Inlet Temperature (C)
  REAL(r64) :: Tset ! local working variable for Setpoint Temperature (C)
  REAL(r64) :: Ts2  ! local Working Variable for Stream 2 outlet Temperature (C)
  INTEGER :: LoopNum
  INTEGER :: LoopSideNum
  LoopNum = TemperValve(CompNum)%LoopNum
  LoopSideNum = TemperValve(CompNum)%LoopSideNum
  IF (KickOffSimulation) RETURN
  SELECT CASE (CompTypeNum)
  CASE (TypeOf_ValveTempering)
    IF (PlantLoop(LoopNum)%Loopside(LoopSideNum)%FlowLock == 0) THEN
      Tin = TemperValve(CompNum)%InletTemp
      Tset = TemperValve(CompNum)%SetpointTemp
      Ts2 = TemperValve(CompNum)%Stream2SourceTemp
      IF (Ts2 <= Tset) THEN
        TemperValve(CompNum)%FlowDivFract = 0.0d0
      ELSE  ! Divert some or all flow
        IF (Tin < Ts2) THEN
          TemperValve(CompNum)%FlowDivFract = (Ts2 - Tset) / (Ts2 - Tin)
        ELSE
          TemperValve(CompNum)%FlowDivFract = 1.0d0
        END IF
      END IF
    ELSEIF (PlantLoop(LoopNum)%Loopside(LoopSideNum)%FlowLock == 1) THEN ! don't recalc diversion, just reuse current flows
      IF (TemperValve(CompNum)%MixedMassFlowRate > 0.0d0) Then
        TemperValve(CompNum)%FlowDivFract = Node(TemperValve(CompNum)%PltOutletNodeNum)%MassFlowRate &
                                           / TemperValve(CompNum)%MixedMassFlowRate
      ELSE
        TemperValve(CompNum)%FlowDivFract = 0.0d0
      ENDIF
    END IF
    IF (TemperValve(CompNum)%FlowDivFract < 0.0d0) TemperValve(CompNum)%FlowDivFract = 0.0d0
    IF (TemperValve(CompNum)%FlowDivFract > 1.0d0) TemperValve(CompNum)%FlowDivFract = 1.0d0
  CASE DEFAULT
    ! should not come here. would have been caught in init routine
  END SELECT
  RETURN
END SUBROUTINE CalcPlantValves