Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | SysNum |
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 CalcDetailedSystem(SysNum)
! SUBROUTINE INFORMATION:
! AUTHOR Therese Stovall, ORNL, Assisted by Hugh Henderson
! DATE WRITTEN Spring 2008
! Using condenser solution algorithms written by Richard Raustad, FSEC
! Oct/Nov 2004, and MODIFIED by Shirey, FSEC Dec 2004, and Hudson, ORNL in 2007
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Find the power and energy needed to meet the refrigeration loads for a particular detailed
! refrigeration system comprised of multiple cases, one condenser, and multiple compressors.
! METHODOLOGY EMPLOYED:
! Sum the refrigeration loads on the system and determine the required evaporating temperature.
! Using the initial estimate for condensing temperature, dispatch the compressors to
! determine the needed power, energy consumption, and refrigerant mass flow.
! Calculate the condenser fan/pump power and consumption.
! Calculate the condensing temperature as a function of environment and load.
! Resolve the impact of subcooler heat transfer between and among systems
! Iterate until the calculated refrigerant mass flow through the compressors converges, which
! typically requires less than 5 iterations. This was found to be more sensitive than converging
! upon the calculated condensing temperature.
! REFERENCES:
! "Impact of ASHRAE Standard 62-1989 on Florida Supermarkets",
! Florida Solar Energy Center, FSEC-CR-910-96, Final Report, Oct. 1996
! Kyle A. Manske, Performance Optimization of Industrial Refrigeration Systems,
! A thesis submitted in partial fulfillment of the requirements for the degree of
! Master of Science, University of Wisconsin-Madison, 1999
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: SysNum
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER ::ErrorTol = 0.001d0 !Iterative solution tolerance
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: NumIter
LOGICAL :: NotBalanced
REAL(r64) :: TCondStart
REAL(r64) :: MassFlowCompsStart = 0.0d0 ! Mass flow through (low-stage) compressors (single- or two-stage systems)
REAL(r64) :: MassFlowHiStageCompsStart = 0.0d0 ! Mass flow through high-stage comrpessors (two-stage systems only)
REAL(r64) :: ErrorMassFlowComps =0.0d0 ! Error in calculated (low stage) compressor mass flow (single- or two-stage systems)
REAL(r64) :: ErrorMassFlowHiStageComps =0.0d0 ! Error in calculated high-stage compressor mass flow (two-stage systems only)
!Balance This Refrigeration System using calculated refrigerant flow
NotBalanced=.TRUE.
NumIter = 0
DO WHILE (NotBalanced)
!Set values for iteration convergence tolerance check
NumIter=NumIter+1
TCondStart=System(SysNum)%TCondense
MassFlowCompsStart=System(SysNum)%RefMassFlowComps
IF(System(SysNum)%NumStages == 2) THEN ! Two-stage systems
MassFlowHiStageCompsStart = System(SysNum)%RefMassFlowHiStageComps
END IF
IF (System(SysNum)%NumSubcoolers > 0)CALL CalculateSubcoolers(Sysnum)
CALL CalculateCompressors(Sysnum)
CALL CalculateCondensers(Sysnum)
System(SysNum)%RefMassFlowtoLoads=System(SysNum)%TotalSystemLoad/(System(SysNum)%HCaseOut-System(SysNum)%HCaseIn)
IF(NumIter < 2)CYCLE
!Previously did error check on calculated Tcondense, but not sensitive enough
IF((System(SysNum)%RefMassFlowtoLoads ==0.0d0) .OR. & !.OR. (MassFlowCasesStart == 0.0)
(MassFlowCompsStart == 0.0d0)) THEN
CALL ShowWarningError('Refrigeration:System: '//TRIM(System(SysNum)%Name)//&
' showing zero refrigeration flow.')
ELSE
ErrorMassFlowComps=ABS(MassFlowCompsStart-System(SysNum)%RefMassFlowComps)/MassFlowCompsStart
IF(System(SysNum)%NumStages == 2) THEN ! Two-stage systems
ErrorMassFlowHiStageComps=ABS(MassFlowHiStageCompsStart-System(SysNum)%RefMassFlowHiStageComps)/ &
MassFlowCompsStart
END IF
END IF !denominator zero check
IF(NumIter > 20)EXIT
IF(ErrorMassFlowComps < ErrorTol) THEN
IF(System(SysNum)%NumStages == 1) THEN
NotBalanced=.FALSE.
ELSE IF(System(SysNum)%NumStages == 2 .AND. ErrorMassFlowHiStageComps < ErrorTol) THEN
NotBalanced=.FALSE.
END IF
END IF
END DO !error check
RETURN
END SUBROUTINE CalcDetailedSystem