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) | :: | 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 CalcDetailedTransSystem(SysNum)
! SUBROUTINE INFORMATION:
! AUTHOR Brian A. Fricke, ORNL
! DATE WRITTEN Fall 2011
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Find the power and energy needed to meet the refrigeration loads for a detailed transcritical
! CO2 refrigeration system comprised of multiple cases and walk-ins, one gas cooler, and
! multiple compressors.
! METHODOLOGY EMPLOYED:
! Sum the refrigeration loads on the system and determine the required evaporating temperature.
! Dispatch the compressors to determine the needed power, energy consumption, and refrigerant
! mass flow. Calculate the gas cooler fan power and consumption. Calculate the gas cooler
! outlet temperature and pressure as a function of ambient temperature. Iterate until the
! calculated refrigerant mass flow through the receiver bypass converges, which typically
! requires less than 5 iterations.
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: RoundSigDigits
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 ! Iteration counter
LOGICAL :: NotBalanced ! Flag to indicate convergence, based on system balance
REAL(r64) :: MassFlowStart ! Initial refrigerant mass flow through receiver bypass
REAL(r64) :: ErrorMassFlow ! Error in calculated refrigerant mass flow trhough receiver bypass
!Balance this refrigeration system using calculated refrigerant flow
NotBalanced=.TRUE.
NumIter = 0
! Set initial guess for receiver bypass refrigerant flow rate
MassFlowStart = 0.5d0
DO WHILE (NotBalanced)
NumIter=NumIter+1
IF (TransSystem(SysNum)%NumGasCoolers >= 1) CALL CalcGasCooler(Sysnum)
CALL CalculateTransCompressors(Sysnum)
IF(NumIter < 2)CYCLE
IF ((TransSystem(SysNum)%RefMassFlowReceiverBypass == 0.0d0) .OR. &
(MassFlowStart == 0.0d0)) THEN
CALL ShowSevereError('Refrigeration:TranscriticalSystem: '//TRIM(TransSystem(SysNum)%Name)//&
' showing zero refrigerant flow through receiver bypass.')
CALL ShowContinueError('Receiver Bypass Flow = '//TRIM(RoundSigDigits(TransSystem(SysNum)%RefMassFlowReceiverBypass,6)))
CALL ShowContinueError('Check input file to ensure that refrigeration loads on this system are not zero.')
ELSE
ErrorMassFlow = ABS(MassFlowStart-TransSystem(SysNum)%RefMassFlowReceiverBypass)/MassFlowStart
MassFlowStart = TransSystem(SysNum)%RefMassFlowReceiverBypass
END IF !denominator zero check
IF(NumIter > 20)EXIT
IF(ErrorMassFlow < ErrorTol) NotBalanced=.FALSE.
END DO !error check
RETURN
END SUBROUTINE CalcDetailedTransSystem