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) | :: | RegenInTemp | |||
real(kind=r64), | intent(inout) | :: | RegenOutTemp | |||
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 CheckModelBoundOutput_Temp(ExchNum, RegenInTemp, RegenOutTemp, FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Mangesh Basarkar, FSEC
! DATE WRITTEN January 2007
! MODIFIED June 2007, R. Raustad, changed requirement that regen outlet temp be less than inlet temp
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
!
! To verify that the empirical model's independent variables are within the limits used during the
! developement of the empirical model.
! METHODOLOGY EMPLOYED:
! The empirical models used for simulating a desiccant enhanced cooling coil are based on a limited data set.
! Extrapolation of empirical models can cause instability and the independent variables may need to be limited.
! The range of each independent variable is provided by the user and are based on the limits of the
! empirical model. These limits are tested in this subroutine each time step and returned for use by the calling
! routine.
!
! 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) :: RegenInTemp ! current regen inlet temp passed to eqn
REAL(r64), INTENT(INOUT) :: RegenOutTemp ! current regen outlet temp from eqn
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) :: OutputChar = ' ' ! character string for warning messages
CHARACTER(len=32) :: OutputCharLo = ' ' ! character string for warning messages
CHARACTER(len=32) :: OutputCharHi = ' ' ! character string for warning messages
CHARACTER(len=32) :: CharValue = ' ' ! 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
! 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 outlet temperature is greater than regen inlet temperature
IF(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintRegenOutTempFailedMessage)THEN
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedErrorCount = &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedErrorCount + 1
IF (BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedErrorCount < 2) THEN
CALL ShowWarningError(TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedBuffer1))
CALL ShowContinueError(TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedBuffer2))
CALL ShowContinueError('...Regeneration outlet air temperature should always be less than or equal ' &
//'to regen inlet air temperature. Verify correct model coefficients.')
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PerfType)//' "'// &
TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%Name)// &
'" - Regeneration outlet air temperature above regen inlet air temperature error continues...', &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedErrIndex, &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedLast, &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedLast)
END IF
END IF
! print error for variables of regeneration outlet temperature
IF(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintRegenOutTempMessage)THEN
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempErrorCount = &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempErrorCount + 1
IF (BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempErrorCount < 2) THEN
CALL ShowWarningError(TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempBuffer1))
CALL ShowContinueError(TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempBuffer2))
CALL ShowContinueError(TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempBuffer3))
CALL ShowContinueError('...Regeneration outlet air temperature should always be less than or equal ' &
//'to regen inlet air temperature. Verify correct model coefficients.')
ELSE
CALL ShowRecurringWarningErrorAtEnd(TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PerfType)//' "'// &
TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%Name)// &
'" - Regeneration outlet air temperature should be less than regen inlet air temperature error continues...', &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempErrIndex, &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempLast, &
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempLast)
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 model regeneration outlet temperature to always be less than or equal to regeneration inlet temperature
IF(RegenOutTemp .GT. RegenInTemp)THEN
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedLast = RegenOutTemp
OutputChar=RoundSigDigits(RegenOutTemp,2)
OutputCharHi=RoundSigDigits(RegenInTemp,2)
! IF(RegenOutTemp .GT. RegenInTemp)THEN
! RegenOutTemp = RegenInTemp
! END IF
IF(.NOT. WarmupFlag .AND. .NOT. FirstHVACIteration)THEN
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintRegenOutTempFailedMessage = .TRUE.
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedBuffer1 = &
TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PerfType)//' "'// &
TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%Name)// '" - Regeneration outlet air ' &
// 'temperature is greater than inlet temperature at ' //TRIM(OutputChar)//'.'
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedBuffer2 = &
'...Regen inlet air temperature = '//TRIM(OutputCharHi)// &
'. Occurrence info = '//TRIM(EnvironmentName)//', ' &
//Trim(CurMnDy)//', ' //TRIM(CreateSysTimeIntervalString())
CharValue=RoundSigDigits(RegenOutTemp,6)
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempFailedBuffer3 = '...Regen outlet air temperature ' &
//'equation: regeneration outlet air temperature allowed from the model = ' //TRIM(CharValue)
ELSE
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintRegenOutTempMessage = .FALSE.
END IF
ELSE
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintRegenOutTempMessage = .FALSE.
END IF
! check boundaries of regen outlet temperature and post warnings to individual buffers to print at end of time step
! checking model bounds for regeneration outlet temperature
IF(RegenOutTemp .LT. BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%MinRegenAirOutTemp .OR. &
RegenOutTemp .GT. BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%MaxRegenAirOutTemp)THEN
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempLast = RegenOutTemp
OutputChar=RoundSigDigits(RegenOutTemp,2)
OutputCharLo=RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%MinRegenAirOutTemp,2)
OutputCharHi=RoundSigDigits(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%MaxRegenAirOutTemp,2)
IF(RegenOutTemp .LT. BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%MinRegenAirOutTemp)THEN
RegenOutTemp = BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%MinRegenAirOutTemp
END IF
IF(RegenOutTemp .GT. BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%MaxRegenAirOutTemp)THEN
RegenOutTemp = BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%MaxRegenAirOutTemp
END IF
IF(.NOT. WarmupFlag .AND. .NOT. FirstHVACIteration)THEN
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintRegenOutTempMessage = .TRUE.
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempBuffer1 = &
TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PerfType)//' "'// &
TRIM(BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%Name)// '" - Regeneration outlet air ' &
// 'temperature equation is outside model boundaries at ' //TRIM(OutputChar)//'.'
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempBuffer2 = '...Valid range = ' &
//TRIM(OutputCharLo)//' to ' //TRIM(OutputCharHi)//'. Occurrence info = '//TRIM(EnvironmentName)//', ' &
//Trim(CurMnDy)//', ' //TRIM(CreateSysTimeIntervalString())
CharValue=RoundSigDigits(RegenOutTemp,6)
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%RegenOutTempBuffer3 = '...Regen outlet air temperature equation: ' &
//'regeneration outlet air temperature allowed from the model = '//TRIM(CharValue)
ELSE
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintRegenOutTempMessage = .FALSE.
END IF
ELSE
BalDesDehumPerfData(ExchCond(ExchNum)%PerfDataIndex)%PrintRegenOutTempMessage = .FALSE.
END IF
END SUBROUTINE CheckModelBoundOutput_Temp