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 | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | EquipName | |||
integer, | intent(in) | :: | ActualZoneNum | |||
integer, | intent(in) | :: | ControlledZoneNum | |||
logical, | intent(in) | :: | FirstHVACIteration | |||
real(kind=r64), | intent(out) | :: | PowerMet | |||
integer, | intent(inout) | :: | CompIndex |
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 SimSteamBaseboard(EquipName, ActualZoneNum, ControlledZoneNum, FirstHVACIteration, &
PowerMet, CompIndex)
! SUBROUTINE INFORMATION:
! AUTHOR Russ Taylor
! DATE WRITTEN Nov 1997
! MODIFIED
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine simulates the steam baseboards or radiators.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList,MakeUPPERCase
USE General, ONLY: TrimSigDigits
USE ScheduleManager, ONLY: GetCurrentScheduleValue
USE DataZoneEnergyDemands, ONLY: ZoneSysEnergyDemand, CurDeadbandOrSetback
USE DataInterfaces, ONLY: ControlCompOutput
USE PlantUtilities, ONLY: SetComponentFlowRate
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: EquipName
INTEGER, INTENT(IN) :: ActualZoneNum
INTEGER, INTENT(IN) :: ControlledZoneNum
INTEGER, INTENT(INOUT) :: CompIndex
LOGICAL, INTENT(IN) :: FirstHVACIteration
REAL(r64), INTENT(OUT) :: PowerMet
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER :: MaxIter = 30
! INTERFACE BLOCK SPECIFICATIONS
! see use DataInterfaces
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: BaseboardNum ! index of unit in baseboard array
LOGICAL,SAVE :: GetInputFlag = .TRUE. ! one time get input flag
REAL(r64) :: QZnReq ! zone load not yet satisfied
REAL(r64) :: MaxSteamFlow
REAL(r64) :: MinSteamFlow
REAL(r64) :: mdot = 0.d0
IF (GetInputFlag) THEN
CALL GetSteamBaseboardInput
GetInputFlag=.false.
END IF
! Find the correct Baseboard Equipment
IF (CompIndex == 0) THEN
BaseboardNum = FindItemInList(EquipName, SteamBaseboard%EquipID, NumSteamBaseboards)
IF (BaseboardNum == 0) THEN
CALL ShowFatalError('SimSteamBaseboard: Unit not found='//TRIM(EquipName))
ENDIF
CompIndex = BaseboardNum
ELSE
BaseboardNum = CompIndex
IF (BaseboardNum > NumSteamBaseboards .or. BaseboardNum < 1) THEN
CALL ShowFatalError('SimSteamBaseboard: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(BaseboardNum))// &
', Number of Units='//TRIM(TrimSigDigits(NumSteamBaseboards))// &
', Entered Unit name='//TRIM(EquipName))
ENDIF
IF (CheckEquipName(BaseboardNum)) THEN
IF (EquipName /= SteamBaseboard(BaseboardNum)%EquipID) THEN
CALL ShowFatalError('SimSteamBaseboard: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(BaseboardNum))// &
', Unit name='//TRIM(EquipName)//', stored Unit Name for that index='// &
TRIM(SteamBaseboard(BaseboardNum)%EquipID))
ENDIF
CheckEquipName(BaseboardNum)=.false.
ENDIF
ENDIF
IF (CompIndex > 0) THEN
CALL InitSteamBaseboard (BaseboardNum, ControlledZoneNum, FirstHVACIteration)
QZnReq = ZoneSysEnergyDemand(ActualZoneNum)%RemainingOutputReqToHeatSP
IF (QZnReq > SmallLoad &
.AND. .NOT. CurDeadbandOrSetback(ActualZoneNum) &
.AND. (GetCurrentScheduleValue(SteamBaseboard(BaseboardNum)%SchedPtr) > 0.0d0) ) THEN
! On the first HVAC iteration the system values are given to the controller, but after that
! the demand limits are in place and there needs to be feedback to the Zone Equipment
If(FirstHVACIteration)Then
MaxSteamFlow = SteamBaseboard(BaseboardNum)%SteamMassFlowRateMax
MinSteamFlow = 0.0d0
Else
MaxSteamFlow = Node(SteamBaseboard(BaseboardNum)%SteamInletNode)%MassFlowRateMaxAvail
MinSteamFlow = Node(SteamBaseboard(BaseboardNum)%SteamInletNode)%MassFlowRateMinAvail
ENDIF
SELECT CASE (SteamBaseboard(BaseboardNum)%EquipType)
CASE (TypeOf_Baseboard_Rad_Conv_Steam) ! 'ZoneHVAC:Baseboard:RadiantConvective:Steam'
CALL ControlCompOutput(CompName=SteamBaseBoard(BaseboardNum)%EquipID,CompType=cCMO_BBRadiator_Steam, &
CompNum=BaseboardNum, &
FirstHVACIteration=FirstHVACIteration,QZnReq=QZnReq, &
ActuatedNode=SteamBaseboard(BaseboardNum)%SteamInletNode, &
MaxFlow=MaxSteamFlow,MinFlow=MinSteamFlow, &
ControlOffset=SteamBaseboard(BaseboardNum)%Offset, &
ControlCompTypeNum=SteamBaseboard(BaseboardNum)%ControlCompTypeNum, &
CompErrIndex=SteamBaseboard(BaseboardNum)%CompErrIndex, &
LoopNum = SteamBaseboard(BaseboardNum)%LoopNum, &
LoopSide = SteamBaseboard(BaseboardNum)%LoopSideNum, &
BranchIndex = SteamBaseboard(BaseboardNum)%BranchNum)
CASE DEFAULT
CALL ShowSevereError('SimSteamBaseboard: Errors in Baseboard='//TRIM(SteamBaseboard(BaseboardNum)%EquipID))
CALL ShowContinueError('Invalid or unimplemented equipment type='// &
TRIM(TrimSigDigits(SteamBaseboard(BaseboardNum)%EquipType)))
CALL ShowFatalError('Preceding condition causes termination.')
END SELECT
PowerMet = SteamBaseboard(BaseboardNum)%TotPower
ELSE
! baseboard is off, don't bother going into ControlCompOutput
mdot = 0.d0
CALL SetComponentFlowRate(mdot, &
SteamBaseboard(BaseboardNum)%SteamInletNode, &
SteamBaseboard(BaseboardNum)%SteamOutletNode, &
SteamBaseboard(BaseboardNum)%LoopNum, &
SteamBaseboard(BaseboardNum)%LoopSideNum, &
SteamBaseboard(BaseboardNum)%BranchNum, &
SteamBaseboard(BaseboardNum)%CompNum )
CALL CalcSteamBaseboard(BaseboardNum, PowerMet)
ENDIF
CALL UpdateSteamBaseboard(BaseboardNum)
CALL ReportSteamBaseboard(BaseboardNum)
ELSE
CALL ShowFatalError('SimSteamBaseboard: Unit not found='//TRIM(EquipName))
ENDIF
END SUBROUTINE SimSteamBaseboard