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) | :: | SurfaceGHENum |
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 UpdateSurfaceGroundHeatExchngr(SurfaceGHENum) !DSU
! SUBROUTINE INFORMATION:
! AUTHOR Simon Rees
! DATE WRITTEN August 2002
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine does any updating that needs to be done for surface
! ground heat exchangers. One of the most important functions of
! this routine is to update the average heat source/sink for a
! particular system over the various system time steps that make up
! the zone time step. This routine must also set the outlet water conditions.
! METHODOLOGY EMPLOYED:
! For the source/sink average update, if the system time step elapsed
! is still what it used to be, then either we are still iterating or
! we had to go back and shorten the time step. As a result, we have
! to subtract out the previous value that we added. If the system
! time step elapsed is different, then we just need to add the new
! values to the running average.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY : TimeStepZone
USE DataHVACGlobals, ONLY : TimeStepSys, SysTimeElapsed
USE DataLoopNode, ONLY : Node
USE FluidProperties, ONLY : GetSpecificHeatGlycol
USE DataPlant, ONLY : PlantLoop
USE PlantUtilities, ONLY : SafeCopyPlantNode
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: SurfaceGHENum ! Index for the surface
! INTEGER, INTENT(IN) :: FlowLock ! flow initialization/condition flag !DSU
! SUBROUTINE PARAMETER DEFINITIONS:
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: CpFluid ! Specific heat of working fluid
! INTEGER,SAVE :: ErrCount
INTEGER :: LoopNum
INTEGER :: LoopSideNum
! update flux
SurfaceGHEQTF(SurfaceGHENum)%QSrc = SourceFlux
LoopNum = SurfaceGHE(SurfaceGHENum)%LoopNum
LoopSideNum = SurfaceGHE(SurfaceGHENum)%LoopSideNum
IF(PlantLoop(LoopNum)%Loopside(LoopSideNum)%FlowLock > 0)THEN ! only update in normal mode !DSU
IF (SurfaceGHEQTF(SurfaceGHENum)%LastSysTimeElapsed == SysTimeElapsed) THEN
! Still iterating or reducing system time step, so subtract old values which were
! not valid
SurfaceGHEQTF(SurfaceGHENum)%QsrcAvg = SurfaceGHEQTF(SurfaceGHENum)%QsrcAvg - &
SurfaceGHEQTF(SurfaceGHENum)%LastQSrc * &
SurfaceGHEQTF(SurfaceGHENum)%LastTimeStepSys/TimeStepZone
END IF
! Update the running average and the "last" values with the current values of the appropriate variables
SurfaceGHEQTF(SurfaceGHENum)%QsrcAvg = SurfaceGHEQTF(SurfaceGHENum)%QsrcAvg + &
SurfaceGHEQTF(SurfaceGHENum)%Qsrc *TimeStepSys/TimeStepZone
SurfaceGHEQTF(SurfaceGHENum)%LastQSrc = SourceFlux
SurfaceGHEQTF(SurfaceGHENum)%LastSysTimeElapsed = SysTimeElapsed
SurfaceGHEQTF(SurfaceGHENum)%LastTimeStepSys = TimeStepSys
END IF
! Calculate the water side outlet conditions and set the
! appropriate conditions on the correct HVAC node.
IF(PlantLoop(SurfaceGHE(SurfaceGHENum)%LoopNum)%FluidName =='WATER')THEN
IF (InletTemp .LT. 0.0d0) THEN
CALL ShowRecurringWarningErrorAtEnd('UpdateSurfaceGroundHeatExchngr: Water is frozen in Surf HX='// &
TRIM(SurfaceGHE(SurfaceGHENum)%Name),SurfaceGHE(SurfaceGHENum)%FrozenErrIndex2,InletTemp,InletTemp)
END IF
InletTemp = MAX(InletTemp, 0.0d0)
ENDIF
CpFluid = GetSpecificHeatGlycol(PlantLoop(SurfaceGHE(SurfaceGHENum)%LoopNum)%FluidName,InletTemp, &
PlantLoop(SurfaceGHE(SurfaceGHENum)%LoopNum)%FluidIndex,'SurfaceGroundHeatExchanger:Update')
Call SafeCopyPlantNode(SurfaceGHE(SurfaceGHENum)%InletNodeNum, SurfaceGHE(SurfaceGHENum)%OutletNodeNum)
! check for flow
IF ( (CpFluid > 0.0d0) .AND. (FlowRate > 0.0d0) ) THEN
Node(SurfaceGHE(SurfaceGHENum)%OutletNodeNum)%Temp = InletTemp - SurfaceArea*SourceFlux / (FlowRate*CpFluid)
Node(SurfaceGHE(SurfaceGHENum)%OutletNodeNum)%Enthalpy = Node(SurfaceGHE(SurfaceGHENum)%OutletNodeNum)%Temp *CpFluid
END IF
RETURN
END SUBROUTINE UpdateSurfaceGroundHeatExchngr