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 InitEMSControlledConstructions
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN Jan 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! change construction on surface if overriden by EMS
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE General, ONLY: TrimSigDigits
USE DataRuntimeLanguage, ONLY: EMSConstructActuatorChecked, EMSConstructActuatorIsOkay
USE HeatBalFiniteDiffManager, ONLY: ConstructFD
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, SAVE :: SurfConstructOverridesPresent = .FALSE. ! detect if EMS ever used for this and inits need to execute
INTEGER :: SurfNum
IF (ANY(Surface%EMSConstructionOverrideON)) SurfConstructOverridesPresent = .TRUE.
IF (.NOT. SurfConstructOverridesPresent) RETURN
DO SurfNum = 1, TotSurfaces
IF (Surface(SurfNum)%EMSConstructionOverrideON .AND. (Surface(SurfNum)%EMSConstructionOverrideValue > 0) ) THEN
IF( (EMSConstructActuatorChecked(SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue)) .AND. &
(EMSConstructActuatorIsOkay( SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue)) ) THEN
Surface(SurfNum)%Construction = Surface(SurfNum)%EMSConstructionOverrideValue
Construct(Surface(SurfNum)%Construction)%IsUsed = .TRUE.
ELSE ! have not checked yet or is not okay, so see if we need to warn about incompatible
IF (.NOT. EMSConstructActuatorChecked(SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue)) THEN
! check if constructions appear compatible
IF (Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%TypeIsWindow) THEN ! okay, allways allow windows
EMSConstructActuatorChecked(SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .TRUE.
EMSConstructActuatorIsOkay( SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .TRUE.
ELSEIF (Surface(SurfNum)%HeatTransferAlgorithm == HeatTransferModel_CTF .OR. &
Surface(SurfNum)%HeatTransferAlgorithm == HeatTransferModel_EMPD ) THEN
! compare old construction to new construction and see if terms match
! set as okay and turn false if find a big problem
EMSConstructActuatorIsOkay( SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .TRUE.
EMSConstructActuatorChecked(SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .TRUE.
IF (Construct(Surface(SurfNum)%Construction)%NumHistories /= &
Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%NumHistories) THEN
!thow warning, but allow
CALL ShowWarningError('InitEMSControlledConstructions: EMS Construction State Actuator may be unrealistic, ' // &
'incompatible CTF timescales are being used.')
CALL ShowContinueError('Construction named = '//TRIM(Construct(Surface(SurfNum)%Construction)%Name)// &
' has CTF timesteps = '//TRIM(TrimSigDigits(Construct(Surface(SurfNum)%Construction)%NumHistories)) )
CALL ShowContinueError('While construction named = '// &
TRIM(Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%Name)// &
' has CTF timesteps = ' &
//TRIM(TrimSigDigits(Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%NumHistories)) )
CALL ShowContinueError('Transient heat transfer modeling may not be valid for surface name = ' &
//TRIM(Surface(SurfNum)%Name)//', and the simulation continues' )
ENDIF
IF (Construct(Surface(SurfNum)%Construction)%NumCTFTerms /= &
Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%NumCTFTerms) THEN
!thow warning, but allow
CALL ShowWarningError('InitEMSControlledConstructions: EMS Construction State Actuator may be unrealistic, ' // &
'incompatible CTF terms are being used.')
CALL ShowContinueError('Construction named = '//TRIM(Construct(Surface(SurfNum)%Construction)%Name)// &
' has number of CTF terms = '//TRIM(TrimSigDigits(Construct(Surface(SurfNum)%Construction)%NumCTFTerms)) )
CALL ShowContinueError('While construction named = '// &
TRIM(Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%Name)// &
' has number of CTF terms = ' &
//TRIM(TrimSigDigits(Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%NumCTFTerms)) )
CALL ShowContinueError('The actuator is allowed but the transient heat transfer modeling may not be valid for' &
//' surface name = ' //TRIM(Surface(SurfNum)%Name)//', and the simulation continues')
ENDIF
IF (Construct(Surface(SurfNum)%Construction)%SourceSinkPresent) THEN
IF (.NOT. Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%SourceSinkPresent) THEN
!thow warning, and do not allow
CALL ShowSevereError('InitEMSControlledConstructions: EMS Construction State Actuator not valid.')
CALL ShowContinueError('Construction named = '//TRIM(Construct(Surface(SurfNum)%Construction)%Name)// &
' has internal source/sink' )
CALL ShowContinueError('While construction named = '// &
TRIM(Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%Name)// &
' is not an internal source/sink construction' )
CALL ShowContinueError('This actuator is not allowed for surface name = ' &
//TRIM(Surface(SurfNum)%Name)// ', and the simulation continues without the override' )
EMSConstructActuatorIsOkay( SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .FALSE.
ENDIF
ENDIF
IF (EMSConstructActuatorIsOkay( SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue)) THEN
Surface(SurfNum)%Construction = Surface(SurfNum)%EMSConstructionOverrideValue
ENDIF
ELSEIF (Surface(SurfNum)%HeatTransferAlgorithm == HeatTransferModel_CondFD) THEN
EMSConstructActuatorIsOkay( SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .TRUE.
EMSConstructActuatorChecked(SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .TRUE.
IF (ConstructFD(Surface(SurfNum)%Construction)%TotNodes /= &
ConstructFD(Surface(SurfNum)%EMSConstructionOverrideValue)%TotNodes) THEN
!thow warning, and do not allow
CALL ShowSevereError('InitEMSControlledConstructions: EMS Construction State Actuator not valid.')
CALL ShowContinueError('Construction named = '//TRIM(Construct(Surface(SurfNum)%Construction)%Name)// &
' has number of finite difference nodes =' &
//TRIM(TrimSigDigits(ConstructFD(Surface(SurfNum)%Construction)%TotNodes)) )
CALL ShowContinueError('While construction named = '// &
TRIM(Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%Name)// &
'has number of finite difference nodes =' &
//TRIM(TrimSigDigits(ConstructFD(Surface(SurfNum)%EMSConstructionOverrideValue)%TotNodes)) )
CALL ShowContinueError('This actuator is not allowed for surface name = ' &
//TRIM(Surface(SurfNum)%Name)// ', and the simulation continues without the override' )
EMSConstructActuatorIsOkay( SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .FALSE.
ENDIF
IF (Construct(Surface(SurfNum)%Construction)%SourceSinkPresent) THEN
IF (.NOT. Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%SourceSinkPresent) THEN
!thow warning, and do not allow
CALL ShowSevereError('InitEMSControlledConstructions: EMS Construction State Actuator not valid.')
CALL ShowContinueError('Construction named = '//TRIM(Construct(Surface(SurfNum)%Construction)%Name)// &
' has internal source/sink' )
CALL ShowContinueError('While construction named = '// &
TRIM(Construct(Surface(SurfNum)%EMSConstructionOverrideValue)%Name)// &
' is not an internal source/sink construction' )
CALL ShowContinueError('This actuator is not allowed for surface name = ' &
//TRIM(Surface(SurfNum)%Name)// ', and the simulation continues without the override' )
EMSConstructActuatorIsOkay( SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .FALSE.
ENDIF
ENDIF
IF (EMSConstructActuatorIsOkay( SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue)) THEN
Surface(SurfNum)%Construction = Surface(SurfNum)%EMSConstructionOverrideValue
ENDIF
ELSEIF(Surface(SurfNum)%HeatTransferAlgorithm == HeatTransferModel_HAMT) THEN ! don't allow
CALL ShowSevereError('InitEMSControlledConstructions: EMS Construction State Actuator not available with ' &
//'Heat transfer algorithm CombinedHeatAndMoistureFiniteElement.')
CALL ShowContinueError('This actuator is not allowed for surface name = ' &
//TRIM(Surface(SurfNum)%Name)// ', and the simulation continues without the override' )
EMSConstructActuatorChecked(SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .TRUE.
EMSConstructActuatorIsOkay( SurfNum, Surface(SurfNum)%EMSConstructionOverrideValue) = .FALSE.
ENDIF
ELSE
! do nothing, has been checked and is not okay with single warning already issued.
ENDIF
ENDIF
ELSE
Surface(SurfNum)%Construction = Surface(SurfNum)%ConstructionStoredInputValue
ENDIF
ENDDO
RETURN
END SUBROUTINE InitEMSControlledConstructions