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 SimBaseboard(EquipName, ActualZoneNum, ControlledZoneNum, FirstHVACIteration, &
PowerMet, CompIndex)
! SUBROUTINE INFORMATION:
! AUTHOR Russ Taylor
! DATE WRITTEN Nov 1997
! MODIFIED na
! 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
USE DataZoneEnergyDemands, ONLY: ZoneSysEnergyDemand
USE General, ONLY: TrimSigDigits
USE DataInterfaces, ONLY: ControlCompOutput
USE PlantUtilities, ONLY: SetActuatedBranchFlowRate
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
LOGICAL, INTENT(IN) :: FirstHVACIteration
REAL(r64), INTENT(OUT) :: PowerMet
INTEGER, INTENT(INOUT) :: CompIndex
! 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
REAL(r64) :: DummyMdot
IF (GetInputFlag) THEN
CALL GetBaseboardInput
GetInputFlag=.false.
END IF
! Find the correct Baseboard Equipment
IF (CompIndex == 0) THEN
BaseboardNum = FindItemInList(EquipName, Baseboard%EquipID, NumBaseboards)
IF (BaseboardNum == 0) THEN
CALL ShowFatalError('SimBaseboard: Unit not found='//TRIM(EquipName))
ENDIF
CompIndex=BaseboardNum
ELSE
BaseboardNum=CompIndex
IF (BaseboardNum > NumBaseboards .or. BaseboardNum < 1) THEN
CALL ShowFatalError('SimBaseboard: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(BaseboardNum))// &
', Number of Units='//TRIM(TrimSigDigits(NumBaseboards))// &
', Entered Unit name='//TRIM(EquipName))
ENDIF
IF (CheckEquipName(BaseboardNum)) THEN
IF (EquipName /= Baseboard(BaseboardNum)%EquipID) THEN
CALL ShowFatalError('SimBaseboard: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(BaseboardNum))// &
', Unit name='//TRIM(EquipName)//', stored Unit Name for that index='// &
TRIM(Baseboard(BaseboardNum)%EquipID))
ENDIF
CheckEquipName(BaseboardNum)=.false.
ENDIF
ENDIF
CALL InitBaseboard(BaseboardNum, ControlledZoneNum)
QZnReq = ZoneSysEnergyDemand(ActualZoneNum)%RemainingOutputReqToHeatSP
IF ((QZnReq < SmallLoad) .OR. (Baseboard(BaseboardNum)%WaterInletTemp <= Baseboard(BaseboardNum)%AirInletTemp)) THEN
! IF (Baseboard(BaseboardNum)%WaterInletTemp <= Baseboard(BaseboardNum)%AirInletTemp) THEN
! The baseboard cannot provide cooling. Thus, if the zone required load is negative or the water inlet
! temperature is lower than the zone air temperature, then we need to shut down the baseboard unit
Baseboard(BaseboardNum)%WaterOutletTemp = Baseboard(BaseboardNum)%WaterInletTemp
Baseboard(BaseboardNum)%AirOutletTemp = Baseboard(BaseboardNum)%AirInletTemp
Baseboard(BaseboardNum)%Power = 0.0d0
Baseboard(BaseboardNum)%WaterMassFlowRate = 0.0d0
! init hot water flow rate to zero
DummyMdot = 0.d0
CALL SetActuatedBranchFlowRate(DummyMdot,Baseboard(BaseboardNum)%WaterInletNode, &
Baseboard(BaseboardNum)%LoopNum,Baseboard(BaseboardNum)%LoopSideNum, &
Baseboard(BaseboardNum)%BranchNum, .FALSE. )
ELSE
! init hot water flow rate to zero
DummyMdot = 0.d0
CALL SetActuatedBranchFlowRate(DummyMdot,Baseboard(BaseboardNum)%WaterInletNode, &
Baseboard(BaseboardNum)%LoopNum,Baseboard(BaseboardNum)%LoopSideNum, &
Baseboard(BaseboardNum)%BranchNum, .TRUE. )
!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 = Baseboard(BaseboardNum)%WaterMassFlowRateMax
MinWaterFlow = 0.0d0
Else
MaxWaterFlow = Node(Baseboard(BaseboardNum)%WaterInletNode)%MassFlowRateMaxAvail
MinWaterFlow = Node(Baseboard(BaseboardNum)%WaterInletNode)%MassFlowRateMinAvail
EndIf
CALL ControlCompOutput(CompName=Baseboard(BaseboardNum)%EquipID,CompType=cCMO_BBRadiator_Water, &
CompNum=BaseboardNum, &
FirstHVACIteration=FirstHVACIteration,QZnReq=QZnReq, &
ActuatedNode=Baseboard(BaseboardNum)%WaterInletNode, &
MaxFlow=MaxWaterFlow,MinFlow=MinWaterFlow, &
ControlOffset=Baseboard(BaseboardNum)%Offset, &
ControlCompTypeNum=Baseboard(BaseboardNum)%ControlCompTypeNum, &
CompErrIndex=Baseboard(BaseboardNum)%CompErrIndex, &
LoopNum = Baseboard(BaseboardNum)%LoopNum, &
LoopSide = Baseboard(BaseboardNum)%LoopSideNum, &
BranchIndex = Baseboard(BaseboardNum)%BranchNum)
PowerMet = Baseboard(BaseboardNum)%Power
END IF
CALL UpdateBaseboard(BaseboardNum)
CALL ReportBaseboard(BaseboardNum)
END SUBROUTINE SimBaseboard