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.
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 GetSurfaceGroundHeatExchanger
! SUBROUTINE INFORMATION:
! AUTHOR Simon Rees
! DATE WRITTEN August 2002
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine reads the input for hydronic Surface Ground Heat Exchangers
! from the user input file. This will contain all of the information
! needed to define and simulate the surface.
! METHODOLOGY EMPLOYED:
! Standard EnergyPlus methodology.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataHeatBalance, ONLY : Construct, TotConstructs
USE InputProcessor, ONLY : GetNumObjectsFound, GetObjectItem, FindItemInList, &
SameString
USE DataIPShortCuts ! Data for field names, blank numerics
USE NodeInputManager, ONLY : GetOnlySingleNode
USE BranchNodeConnections, ONLY : TestCompSet
USE FluidProperties, ONLY : CheckFluidPropertyName, FindGlycol
USE DataEnvironment, ONLY : GroundTemp_Surface,GroundTemp_SurfaceObjInput
USE General, ONLY : RoundSigDigits
USE DataLoopNode
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
LOGICAL :: ErrorsFound=.false. ! Set to true if errors in input,
! fatal at end of routine
INTEGER :: IOStatus ! Used in GetObjectItem
INTEGER :: Item ! Item to be "gotten"
INTEGER :: NumAlphas ! Number of Alphas for each GetObjectItem call
INTEGER :: NumNumbers ! Number of Numbers for each GetObjectItem call
! INTEGER :: NumFluids ! number of fluids in sim.
! Initializations and allocations
cCurrentModuleObject = 'GroundHeatExchanger:Surface'
NumOfSurfaceGHEs = GetNumObjectsFound(cCurrentModuleObject)
! allocate data structures
IF(ALLOCATED(SurfaceGHE)) DEALLOCATE(SurfaceGHE)
IF(ALLOCATED(SurfaceGHEQTF)) DEALLOCATE(SurfaceGHEQTF)
IF(ALLOCATED(SurfaceGHEReport)) DEALLOCATE(SurfaceGHEReport)
ALLOCATE(SurfaceGHE(NumOfSurfaceGHEs))
ALLOCATE(SurfaceGHEQTF(NumOfSurfaceGHEs))
ALLOCATE(SurfaceGHEReport(NumOfSurfaceGHEs))
ALLOCATE(CheckEquipName(NumOfSurfaceGHEs))
CheckEquipName=.true.
! initialize data structures
! surface data
! Obtain all of the user data related to the surfaces...
DO Item = 1, NumOfSurfaceGHEs
! get the input data
CALL GetObjectItem(cCurrentModuleObject,Item,cAlphaArgs,NumAlphas,rNumericArgs,NumNumbers,IOStatus, &
AlphaFieldnames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)
! General user input data
SurfaceGHE(Item)%Name = cAlphaArgs(1)
SurfaceGHE(Item)%ConstructionName = cAlphaArgs(2)
SurfaceGHE(Item)%ConstructionNum = FindIteminList(cAlphaArgs(2),Construct%Name,TotConstructs)
IF (SurfaceGHE(Item)%ConstructionNum == 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(2))//'='//TRIM(cAlphaArgs(2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
ErrorsFound=.true.
END IF
! Error checking for surfaces, zones, and construction information
IF (.NOT. Construct(SurfaceGHE(Item)%ConstructionNum)%SourceSinkPresent) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(2))//'='//TRIM(cAlphaArgs(2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Construction must have internal source/sink and use Construction:InternalSource object' )
ErrorsFound=.true.
END IF
!get inlet node data
SurfaceGHE(Item)%InletNode = cAlphaArgs(3)
SurfaceGHE(Item)%InletNodeNum = GetOnlySingleNode(cAlphaArgs(3),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
IF (SurfaceGHE(Item)%InletNodeNum == 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(3))//'='//TRIM(cAlphaArgs(3)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
ErrorsFound=.true.
END IF
! get outlet node data
SurfaceGHE(Item)%OutletNode = cAlphaArgs(4)
SurfaceGHE(Item)%OutletNodeNum = GetOnlySingleNode(cAlphaArgs(4),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
IF (SurfaceGHE(Item)%OutletNodeNum == 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(4))//'='//TRIM(cAlphaArgs(4)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
ErrorsFound=.true.
END IF
CALL TestCompSet(TRIM(cCurrentModuleObject),cAlphaArgs(1),cAlphaArgs(3),cAlphaArgs(4),'Condenser Water Nodes')
! tube data
SurfaceGHE(Item)%TubeDiameter = rNumericArgs(1)
SurfaceGHE(Item)%TubeCircuits = rNumericArgs(2)
SurfaceGHE(Item)%TubeSpacing = rNumericArgs(3)
IF (rNumericArgs(2) == 0) THEN
CALL ShowSevereError('Invalid '//TRIM(cNumericFieldNames(2))//'='//TRIM(RoundSigDigits(rNumericArgs(2),2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Value must be greater than 0.0')
ErrorsFound=.true.
END IF
IF (rNumericArgs(3) == 0.0d0) THEN
CALL ShowSevereError('Invalid '//TRIM(cNumericFieldNames(3))//'='//TRIM(RoundSigDigits(rNumericArgs(3),2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Value must be greater than 0.0')
ErrorsFound=.true.
END IF
! surface geometry data
SurfaceGHE(Item)%SurfaceLength = rNumericArgs(4)
SurfaceGHE(Item)%SurfaceWidth = rNumericArgs(5)
IF (rNumericArgs(4) <= 0.0d0) THEN
CALL ShowSevereError('Invalid '//TRIM(cNumericFieldNames(4))//'='//TRIM(RoundSigDigits(rNumericArgs(4),2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Value must be greater than 0.0')
ErrorsFound=.true.
END IF
IF (rNumericArgs(5) <= 0.0d0) THEN
CALL ShowSevereError('Invalid '//TRIM(cNumericFieldNames(5))//'='//TRIM(RoundSigDigits(rNumericArgs(5),2)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Value must be greater than 0.0')
ErrorsFound=.true.
END IF
! get lower b.c. type
IF (SameString(cAlphaArgs(5),'GROUND') ) THEN
SurfaceGHE(Item)%LowerSurfCond = SurfCond_Ground
ELSEIF (SameString(cAlphaArgs(5),'EXPOSED') ) THEN
SurfaceGHE(Item)%LowerSurfCond = SurfCond_Exposed
ELSE
CALL ShowSevereError('Invalid '//TRIM(cAlphaFieldNames(5))//'='//TRIM(cAlphaArgs(5)))
CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
CALL ShowContinueError('Only "Ground" or "Exposed" is allowed.')
ErrorsFound=.true.
END IF
END DO ! end of input loop
! final error check
IF (ErrorsFound) THEN
CALL ShowFatalError('Errors found in processing input for '//TRIM(cCurrentModuleObject))
END IF
! Set up the output variables
DO Item = 1, NumOfSurfaceGHEs
CALL SetupOutputVariable('Ground Heat Exchanger Heat Transfer Rate [W]', &
SurfaceGHEReport(Item)%HeatTransferRate,'Plant','Average', &
SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Surface Heat Transfer Rate [W]', &
SurfaceGHEReport(Item)%SurfHeatTransferRate,'Plant','Average', &
SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Heat Transfer Energy [J]', &
SurfaceGHEReport(Item)%Energy,'Plant','Sum',SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Mass Flow Rate [kg/s]', &
SurfaceGHEReport(Item)%MassFlowRate,'Plant','Average', &
SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Inlet Temperature [C]', &
SurfaceGHEReport(Item)%InletTemp,'Plant','Average', &
SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Outlet Temperature [C]', &
SurfaceGHEReport(Item)%OutletTemp,'Plant','Average', &
SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Top Surface Temperature [C]', &
SurfaceGHEReport(Item)%TopSurfaceTemp,'Plant','Average', &
SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Bottom Surface Temperature [C]', &
SurfaceGHEReport(Item)%BtmSurfaceTemp,'Plant','Average', &
SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Top Surface Heat Transfer Energy per Area [J/m2]', &
SurfaceGHEReport(Item)%TopSurfaceFlux,'Plant','Average', &
SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Bottom Surface Heat Transfer Energy per Area [J/m2]', &
SurfaceGHEReport(Item)%BtmSurfaceFlux,'Plant','Average', &
SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Surface Heat Transfer Energy [J]', &
SurfaceGHEReport(Item)%SurfEnergy,'Plant','Sum',SurfaceGHE(Item)%Name)
CALL SetupOutputVariable('Ground Heat Exchanger Source Temperature [C]', &
SurfaceGHEReport(Item)%SourceTemp,'Plant','Average', &
SurfaceGHE(Item)%Name)
END DO
IF (NoSurfaceGroundTempObjWarning) THEN
IF (.not. GroundTemp_SurfaceObjInput) THEN
CALL ShowWarningError('GetSurfaceGroundHeatExchanger: No "Site:GroundTemperature:Shallow" were input.')
CALL ShowContinueError('Defaults, constant throughout the year of ('//TRIM(RoundSigDigits(GroundTemp_Surface,1))// &
') will be used.')
ENDIF
NoSurfaceGroundTempObjWarning=.false.
ENDIF
RETURN
END SUBROUTINE GetSurfaceGroundHeatExchanger