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 SimHWBaseboard(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 Baseboard Radiators.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE DataLoopNode, ONLY: Node
USE InputProcessor, ONLY: FindItemInList,MakeUPPERCase
USE General, ONLY: TrimSigDigits
USE ScheduleManager, ONLY: GetCurrentScheduleValue
USE DataZoneEnergyDemands, ONLY: ZoneSysEnergyDemand
USE DataInterfaces, ONLY: ControlCompOutput
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) :: MaxWaterFlow
REAL(r64) :: MinWaterFlow
IF (GetInputFlag) THEN
CALL GetHWBaseboardInput
GetInputFlag=.false.
END IF
! Find the correct Baseboard Equipment
IF (CompIndex == 0) THEN
BaseboardNum = FindItemInList(EquipName, HWBaseboard%EquipID, NumHWBaseboards)
IF (BaseboardNum == 0) THEN
CALL ShowFatalError('SimHWBaseboard: Unit not found='//TRIM(EquipName))
ENDIF
CompIndex = BaseboardNum
ELSE
BaseboardNum = CompIndex
IF (BaseboardNum > NumHWBaseboards .or. BaseboardNum < 1) THEN
CALL ShowFatalError('SimHWBaseboard: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(BaseboardNum))// &
', Number of Units='//TRIM(TrimSigDigits(NumHWBaseboards))// &
', Entered Unit name='//TRIM(EquipName))
ENDIF
IF (CheckEquipName(BaseboardNum)) THEN
IF (EquipName /= HWBaseboard(BaseboardNum)%EquipID) THEN
CALL ShowFatalError('SimHWBaseboard: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(BaseboardNum))// &
', Unit name='//TRIM(EquipName)//', stored Unit Name for that index='// &
TRIM(HWBaseboard(BaseboardNum)%EquipID))
ENDIF
CheckEquipName(BaseboardNum)=.false.
ENDIF
ENDIF
IF (CompIndex > 0) THEN
CALL InitHWBaseboard (BaseboardNum, ControlledZoneNum, FirstHVACIteration)
QZnReq = ZoneSysEnergyDemand(ActualZoneNum)%RemainingOutputReqToHeatSP
! 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
MaxWaterFlow = HWBaseboard(BaseboardNum)%WaterMassFlowRateMax
MinWaterFlow = 0.0d0
Else
MaxWaterFlow = Node(HWBaseboard(BaseboardNum)%WaterInletNode)%MassFlowRateMaxAvail
MinWaterFlow = Node(HWBaseboard(BaseboardNum)%WaterInletNode)%MassFlowRateMinAvail
ENDIF
SELECT CASE (HWBaseboard(BaseboardNum)%EquipType)
CASE (TypeOf_Baseboard_Rad_Conv_Water) ! 'ZoneHVAC:Baseboard:RadiantConvective:Water'
CALL ControlCompOutput(CompName=HWBaseBoard(BaseboardNum)%EquipID,CompType=cCMO_BBRadiator_Water, &
CompNum=BaseboardNum, &
FirstHVACIteration=FirstHVACIteration,QZnReq=QZnReq, &
ActuatedNode=HWBaseboard(BaseboardNum)%WaterInletNode, &
MaxFlow=MaxWaterFlow,MinFlow=MinWaterFlow, &
ControlOffset=HWBaseboard(BaseboardNum)%Offset, &
ControlCompTypeNum=HWBaseboard(BaseboardNum)%ControlCompTypeNum, &
CompErrIndex=HWBaseboard(BaseboardNum)%CompErrIndex, &
LoopNum = HWBaseboard(BaseboardNum)%LoopNum, &
LoopSide = HWBaseboard(BaseboardNum)%LoopSideNum, &
BranchIndex = HWBaseboard(BaseboardNum)%BranchNum)
CASE DEFAULT
CALL ShowSevereError('SimBaseboard: Errors in Baseboard='//TRIM(HWBaseboard(BaseboardNum)%EquipID))
CALL ShowContinueError('Invalid or unimplemented equipment type='// &
TRIM(TrimSigDigits(HWBaseboard(BaseboardNum)%EquipType)))
CALL ShowFatalError('Preceding condition causes termination.')
END SELECT
PowerMet = HWBaseboard(BaseboardNum)%TotPower
CALL UpdateHWBaseboard(BaseboardNum)
CALL ReportHWBaseboard(BaseboardNum)
ELSE
CALL ShowFatalError('SimHWBaseboard: Unit not found='//TRIM(EquipName))
ENDIF
END SUBROUTINE SimHWBaseboard