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) | :: | ExchNum | |||
real(kind=r64), | intent(in) | :: | ProcessInMassFlow | |||
real(kind=r64), | intent(in) | :: | RegenInMassFlow | |||
logical, | intent(in) | :: | FirstHVACIteration |
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 CheckForBalancedFlow(ExchNum, ProcessInMassFlow, RegenInMassFlow, FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Richard Raustad, FSEC
! DATE WRITTEN June 2007
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
!
! To verify that the balanced flow desiccant heat exchanger has the same regeneration and process air flow rates.
! METHODOLOGY EMPLOYED:
! Check that the regeneration and process air mass flow rates are within 2%.
!
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: CreateSysTimeIntervalString,RoundSigDigits
USE DataGlobals, ONLY: CurrentTime
USE DataHVACGlobals, ONLY: SysTimeElapsed, TimeStepSys
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS
INTEGER, INTENT(IN) :: ExchNum ! number of the current heat exchanger being simulated
REAL(r64), INTENT(IN) :: ProcessInMassFlow ! current process inlet air mass flow rate (m3/s)
REAL(r64), INTENT(IN) :: RegenInMassFlow ! current regeneration inlet air mass flow rate (m3/s)
LOGICAL, INTENT(IN) :: FirstHVACIteration ! first HVAC iteration flag
! SUBROUTINE PARAMETER DEFINITIONS:
! CHARACTER(len=*), PARAMETER :: OutputFormat ='(F10.6)'
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
CHARACTER(len=32) :: OutputCharProc = ' ' ! character string for warning messages
CHARACTER(len=32) :: OutputCharRegen = ' ' ! character string for warning messages
REAL(r64),SAVE :: TimeStepSysLast = 0.0d0 ! last system time step (used to check for downshifting)
REAL(r64) :: CurrentEndTime = 0.0d0 ! end time of time step for current simulation time step
REAL(r64),SAVE :: CurrentEndTimeLast = 0.0d0 ! end time of time step for last simulation time step
! current end time is compared with last to see if time step changed
REAL(r64) :: ABSImbalancedFlow ! absolute value of process and regeneration air flow imbalance fraction
IF(WarmupFlag .OR. FirstHVACIteration)RETURN
! calculate end time of current time step
CurrentEndTime = CurrentTime + SysTimeElapsed
! Print warning messages only when valid and only for the first ocurrance. Let summary provide statistics.
! Wait for next time step to print warnings. If simulation iterates, print out
! the warning for the last iteration only. Must wait for next time step to accomplish this.
! If a warning occurs and the simulation down shifts, the warning is not valid.
IF(CurrentEndTime .GT. CurrentEndTimeLast .AND. TimeStepSys .GE. TimeStepSysLast)THEN
! print error when regeneration inlet relative humidity is outside model boundaries
IF(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintImbalancedMassFlowMess)THEN
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ImbalancedMassFlowErrorCount = &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ImbalancedMassFlowErrorCount + 1
IF (BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ImbalancedMassFlowErrorCount < 2) THEN
CALL ShowWarningError(TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ImbalancedMassFlowBuffer1))
CALL ShowContinueError(TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ImbalancedMassFlowBuffer2))
CALL ShowContinueError(TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ImbalancedMassFlowBuffer3))
! CALL ShowContinueError('...Using regeneration inlet air relative humidities that are outside the regeneration '&
! //'outlet humidity ratio equation model boundaries may adversely affect desiccant model performance. '&
! //'Verify correct model coefficients.')
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(cHXTypes(ExchCond(ExchNum)%ExchTypeNum))//' "'//TRIM(ExchCond(ExchNum)%Name)// &
'" - unbalanced air flow rate is limited to 2% error continues with the imbalanced fraction statistics reported...', &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ImbalancedFlowErrIndex, &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ABSImbalancedFlow, &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ABSImbalancedFlow)
END IF
END IF
END IF ! IF(CurrentEndTime .GT. CurrentEndTimeLast .AND. TimeStepSys .GE. TimeStepSysLast)THEN
! save last system time step and last end time of current time step (used to determine if warning is valid)
TimeStepSysLast = TimeStepSys
CurrentEndTimeLast = CurrentEndTime
! checking if regeneration inlet relative humidity is within model boundaries
ABSImbalancedFlow = ABS(RegenInMassFlow - ProcessInMassFlow)/RegenInMassFlow
IF(ABSImbalancedFlow .GT. 0.02d0)THEN
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ABSImbalancedFlow = ABSImbalancedFlow
OutputCharRegen=RoundSigDigits(RegenInMassFlow,6)
OutputCharProc=RoundSigDigits(ProcessInMassFlow,6)
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintImbalancedMassFlowMess = .TRUE.
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ImbalancedMassFlowBuffer1 = &
TRIM(cHXTypes(ExchCond(ExchNum)%ExchTypeNum))//' "'// &
TRIM(ExchCond(ExchNum)%Name)// '" - unbalanced air flow rate is limited to 2%.'
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ImbalancedMassFlowBuffer2 = '...Regeneration air ' &
//'mass flow rate is '//TRIM(OutputCharRegen)//' and process air mass flow rate is '//TRIM(OutputCharProc)//'.'
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%ImbalancedMassFlowBuffer3 = &
'...Occurrence info = '//TRIM(EnvironmentName)//', '//Trim(CurMnDy)//', ' //TRIM(CreateSysTimeIntervalString())
ELSE
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintImbalancedMassFlowMess = .FALSE.
END IF
END SUBROUTINE CheckForBalancedFlow