SUBROUTINE InitLowTempRadiantSystem(FirstHVACIteration,RadSysNum,SystemType)
! SUBROUTINE INFORMATION:
! AUTHOR Rick Strand
! DATE WRITTEN November 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine initializes variables relating to low temperature radiant
! systems.
! METHODOLOGY EMPLOYED:
! Simply initializes whatever needs initializing.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataGlobals, ONLY : NumOfZones, BeginEnvrnFlag, AnyPlantInModel
USE DataLoopNode, ONLY : Node
USE ScheduleManager, ONLY : GetCurrentScheduleValue
USE DataZoneEquipment, ONLY : ZoneEquipInputsFilled,CheckZoneEquipmentList
USE DataPlant, ONLY : ScanPlantLoopsForObject, PlantLoop, TypeOf_LowTempRadiant_VarFlow, &
TypeOf_LowTempRadiant_ConstFlow
USE PlantUtilities, ONLY : SetComponentFlowRate, InitComponentNodes
USE FluidProperties, ONLY : GetDensityGlycol
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
LOGICAL, INTENT(IN) :: FirstHVACIteration ! TRUE if 1st HVAC simulation of system timestep
INTEGER, INTENT(IN) :: RadSysNum ! Index for the low temperature radiant system under consideration within the derived types
INTEGER, INTENT(IN) :: SystemType ! Type of radiant system: hydronic, constant flow, or electric
! SUBROUTINE PARAMETER DEFINITIONS:
REAL(r64), PARAMETER :: ZeroTol = 0.0000001d0 ! Smallest non-zero value allowed
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: CurrentFlowSchedule ! Schedule value for flow fraction in a constant flow radiant system
LOGICAL, SAVE :: ErrorsFound = .FALSE. ! In one-time initializations
CHARACTER(len=10) Errout ! Message for errors
LOGICAL, SAVE :: FirstTime = .TRUE. ! For one-time initializations
INTEGER :: RadNum ! Number of the radiant system (DO loop counter)
INTEGER :: RadSurfNum ! Number of the radiant system surface (DO loop counter)
INTEGER :: SurfNum ! Intermediate variable for keeping track of the surface number
REAL(r64) :: TotalEffic ! Intermediate calculation variable for total pump efficiency
INTEGER :: WaterNodeIn ! Node number for water inlet node
INTEGER :: ZoneNum ! Intermediate variable for keeping track of the zone number
LOGICAL, SAVE, ALLOCATABLE, DIMENSION(:) :: MyEnvrnFlagHydr
LOGICAL, SAVE, ALLOCATABLE, DIMENSION(:) :: MyEnvrnFlagCFlo
LOGICAL, SAVE, ALLOCATABLE, DIMENSION(:) :: MyEnvrnFlagElec
LOGICAL, SAVE :: MyEnvrnFlagGeneral = .TRUE.
LOGICAL,SAVE :: ZoneEquipmentListChecked = .false. ! True after the Zone Equipment List has been checked for items
Integer :: Loop
LOGICAL,SAVE :: MyOneTimeFlag = .TRUE. ! Initialization flag
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyPlantScanFlagHydr
LOGICAL, ALLOCATABLE, SAVE, DIMENSION(:) :: MyPlantScanFlagCFlo
REAL(r64) :: mdot ! local fluid mass flow rate
REAL(r64) :: rho ! local fluid density
LOGICAL :: errFlag
! FLOW:
IF (MyOneTimeFlag) THEN
ALLOCATE(MyEnvrnFlagHydr(NumOfHydrLowTempRadSys))
ALLOCATE(MyEnvrnFlagCFlo(NumOfCFloLowTempRadSys))
ALLOCATE(MyEnvrnFlagElec(NumOfElecLowTempRadSys))
ALLOCATE(MyPlantScanFlagHydr(NumOfHydrLowTempRadSys))
ALLOCATE(MyPlantScanFlagCFlo(NumOfCFloLowTempRadSys))
MyPlantScanFlagHydr = .TRUE.
MyPlantScanFlagCFlo = .TRUE.
MyEnvrnFlagHydr = .TRUE.
MyEnvrnFlagCFlo = .TRUE.
MyEnvrnFlagElec = .TRUE.
MyOneTimeFlag = .FALSE.
END IF
IF (FirstTime) THEN
ALLOCATE(ZeroSourceSumHATsurf(NumOfZones))
ZeroSourceSumHATsurf = 0.0D0
ALLOCATE(QRadSysSrcAvg(TotSurfaces))
QRadSysSrcAvg = 0.0D0
ALLOCATE(LastQRadSysSrc(TotSurfaces))
LastQRadSysSrc = 0.0D0
ALLOCATE(LastSysTimeElapsed(TotSurfaces))
LastSysTimeElapsed = 0.0D0
ALLOCATE(LastTimeStepSys(TotSurfaces))
LastTimeStepSys = 0.0D0
ALLOCATE(MySizeFlagHydr(NumOfHydrLowTempRadSys))
ALLOCATE(MySizeFlagCFlo(NumOfCFloLowTempRadSys))
ALLOCATE(MySizeFlagElec(NumOfElecLowTempRadSys))
MySizeFlagHydr = .TRUE.
MySizeFlagCFlo = .TRUE.
MySizeFlagElec = .TRUE.
! Initialize total areas for all radiant systems
DO RadNum = 1, NumOfHydrLowTempRadSys
HydrRadSys(RadNum)%TotalSurfaceArea = 0.0d0
DO SurfNum = 1, HydrRadSys(RadNum)%NumOfSurfaces
HydrRadSys(RadNum)%TotalSurfaceArea = HydrRadSys(RadNum)%TotalSurfaceArea &
+Surface(HydrRadSys(RadNum)%SurfacePtr(SurfNum))%Area
END DO
END DO
DO RadNum = 1, NumOfCFloLowTempRadSys
CFloRadSys(RadNum)%TotalSurfaceArea = 0.0d0
DO SurfNum = 1, CFloRadSys(RadNum)%NumOfSurfaces
CFloRadSys(RadNum)%TotalSurfaceArea = CFloRadSys(RadNum)%TotalSurfaceArea &
+Surface(CFloRadSys(RadNum)%SurfacePtr(SurfNum))%Area
END DO
END DO
DO RadNum = 1, NumOfElecLowTempRadSys
ElecRadSys(RadNum)%TotalSurfaceArea = 0.0d0
DO SurfNum = 1, ElecRadSys(RadNum)%NumOfSurfaces
ElecRadSys(RadNum)%TotalSurfaceArea = ElecRadSys(RadNum)%TotalSurfaceArea &
+Surface(ElecRadSys(RadNum)%SurfacePtr(SurfNum))%Area
END DO
END DO
! Check pump parameters for constant flow hydronic radiant systems
DO RadNum = 1, NumOfCFloLowTempRadSys
! Calculate the efficiency for each pump: The calculation
! is based on the PMPSIM code in the ASHRAE Secondary Toolkit
IF ( (CFloRadSys(RadNum)%NomPowerUse > ZeroTol) .AND. (CFloRadSys(RadNum)%MotorEffic > ZeroTol) ) THEN
TotalEffic = CFloRadSys(RadNum)%WaterVolFlowMax * CFloRadSys(RadNum)%NomPumpHead &
/CFloRadSys(RadNum)%NomPowerUse
CFloRadSys(RadNum)%PumpEffic = TotalEffic / CFloRadSys(RadNum)%MotorEffic
IF (CFloRadSys(RadNum)%PumpEffic < .50d0) THEN
WRITE(Errout,'(F10.2)') CFloRadSys(RadNum)%PumpEffic*100.d0
CALL ShowWarningError('Check input. Calc Pump Efficiency='//TRIM(ADJUSTL(Errout))// &
'% which is less than 50%, for pump in radiant system '//TRIM(CFloRadSys(RadNum)%Name))
ELSE IF ( (CFloRadSys(RadNum)%PumpEffic > 0.95d0) .and. (CFloRadSys(RadNum)%PumpEffic <= 1.0d0) ) THEN
WRITE(Errout,'(F10.2)') CFloRadSys(RadNum)%PumpEffic*100.d0
CALL ShowWarningError('Check input. Calc Pump Efficiency='//TRIM(ADJUSTL(Errout))// &
'% is approaching 100%, for pump in radiant system '//TRIM(CFloRadSys(RadNum)%Name))
ELSE IF (CFloRadSys(RadNum)%PumpEffic > 1.0d0) THEN
WRITE(Errout,'(F10.2)') CFloRadSys(RadNum)%PumpEffic*100.d0
CALL ShowSevereError('Check input. Calc Pump Efficiency='//TRIM(ADJUSTL(Errout))// &
'% which is bigger than 100%, for pump in radiant system '//TRIM(CFloRadSys(RadNum)%Name))
ErrorsFound=.true.
END IF
ELSE
CALL ShowSevereError('Check input. Pump nominal power and motor efficiency cannot be 0, for pump='// &
TRIM(CFloRadSys(RadNum)%Name))
ErrorsFound=.true.
END IF
END DO
FirstTime = .FALSE.
END IF
IF (SystemType == HydronicSystem) THEN
IF ( MyPlantScanFlagHydr(RadSysNum) .and. ALLOCATED(PlantLoop) ) THEN
errFlag=.false.
IF (HydrRadSys(RadSysNum)%HotWaterInNode > 0) THEN
CALL ScanPlantLoopsForObject( HydrRadSys(RadSysNum)%Name , &
TypeOf_LowTempRadiant_VarFlow, &
HydrRadSys(RadSysNum)%HWLoopNum, &
HydrRadSys(RadSysNum)%HWLoopSide, &
HydrRadSys(RadSysNum)%HWBranchNum, &
HydrRadSys(RadSysNum)%HWCompNum, &
InletNodeNumber = HydrRadSys(RadSysNum)%HotWaterInNode, &
errFlag=errFlag)
IF (errFlag) THEN
CALL ShowFatalError('InitLowTempRadiantSystem: Program terminated due to previous condition(s).')
ENDIF
ENDIF
IF (HydrRadSys(RadSysNum)%ColdWaterInNode > 0) THEN
CALL ScanPlantLoopsForObject( HydrRadSys(RadSysNum)%Name , &
TypeOf_LowTempRadiant_VarFlow, &
HydrRadSys(RadSysNum)%CWLoopNum, &
HydrRadSys(RadSysNum)%CWLoopSide, &
HydrRadSys(RadSysNum)%CWBranchNum, &
HydrRadSys(RadSysNum)%CWCompNum, &
InletNodeNumber = HydrRadSys(RadSysNum)%ColdWaterInNode, &
errFlag=errFlag)
IF (errFlag) THEN
CALL ShowFatalError('InitLowTempRadiantSystem: Program terminated due to previous condition(s).')
ENDIF
ENDIF
MyPlantScanFlagHydr(RadSysNum) = .FALSE.
ELSEIF (MyPlantScanFlagHydr(RadSysNum) .AND. .NOT. AnyPlantInModel) THEN
MyPlantScanFlagHydr(RadSysNum) = .FALSE.
ENDIF
ENDIF
IF (SystemType == ConstantFlowSystem) THEN
IF ( MyPlantScanFlagCFlo(RadSysNum) .and. ALLOCATED(PlantLoop) ) THEN
errFlag=.false.
IF (CFloRadSys(RadSysNum)%HotWaterInNode > 0) THEN
CALL ScanPlantLoopsForObject( CFloRadSys(RadSysNum)%Name , &
TypeOf_LowTempRadiant_ConstFlow, &
CFloRadSys(RadSysNum)%HWLoopNum, &
CFloRadSys(RadSysNum)%HWLoopSide, &
CFloRadSys(RadSysNum)%HWBranchNum, &
CFloRadSys(RadSysNum)%HWCompNum, &
InletNodeNumber = CFloRadSys(RadSysNum)%HotWaterInNode, &
errFlag=errFlag)
IF (errFlag) THEN
CALL ShowFatalError('InitLowTempRadiantSystem: Program terminated due to previous condition(s).')
ENDIF
ENDIF
IF (CFloRadSys(RadSysNum)%ColdWaterInNode > 0) THEN
CALL ScanPlantLoopsForObject( CFloRadSys(RadSysNum)%Name , &
TypeOf_LowTempRadiant_ConstFlow, &
CFloRadSys(RadSysNum)%CWLoopNum, &
CFloRadSys(RadSysNum)%CWLoopSide, &
CFloRadSys(RadSysNum)%CWBranchNum, &
CFloRadSys(RadSysNum)%CWCompNum, &
InletNodeNumber = CFloRadSys(RadSysNum)%ColdWaterInNode, &
errFlag=errFlag)
IF (errFlag) THEN
CALL ShowFatalError('InitLowTempRadiantSystem: Program terminated due to previous condition(s).')
ENDIF
ENDIF
MyPlantScanFlagCFlo(RadSysNum) = .FALSE.
ELSEIF ( MyPlantScanFlagCFlo(RadSysNum) .AND. .NOT. AnyPlantInModel) THEN
MyPlantScanFlagCFlo(RadSysNum) = .FALSE.
ENDIF
ENDIF
! need to check all units to see if they are on Zone Equipment List or issue warning
IF (.not. ZoneEquipmentListChecked .and. ZoneEquipInputsFilled) THEN
ZoneEquipmentListChecked=.true.
DO Loop=1,TotalNumOfRadSystems
SELECT CASE(RadSysTypes(Loop)%SystemType)
CASE(HydronicSystem)
IF (CheckZoneEquipmentList('ZoneHVAC:LowTemperatureRadiant:VariableFlow',RadSysTypes(Loop)%Name)) CYCLE
CALL ShowSevereError('InitLowTempRadiantSystem: Unit=[ZoneHVAC:LowTemperatureRadiant:VariableFlow,'// &
TRIM(RadSysTypes(Loop)%Name)// &
'] is not on any ZoneHVAC:EquipmentList. It will not be simulated.')
CASE(ConstantFlowSystem)
IF (CheckZoneEquipmentList('ZoneHVAC:LowTemperatureRadiant:ConstantFlow',RadSysTypes(Loop)%Name)) CYCLE
CALL ShowSevereError('InitLowTempRadiantSystem: Unit=[ZoneHVAC:LowTemperatureRadiant:ConstantFlow,'// &
TRIM(RadSysTypes(Loop)%Name)// &
'] is not on any ZoneHVAC:EquipmentList. It will not be simulated.')
CASE(ElectricSystem)
IF (CheckZoneEquipmentList('ZoneHVAC:LowTemperatureRadiant:Electric',RadSysTypes(Loop)%Name)) CYCLE
CALL ShowSevereError('InitLowTempRadiantSystem: Unit=[ZoneHVAC:LowTemperatureRadiant:Electric,'// &
TRIM(RadSysTypes(Loop)%Name)// &
'] is not on any ZoneHVAC:EquipmentList. It will not be simulated.')
CASE DEFAULT ! Illegal system, but checked earlier
END SELECT
ENDDO
ENDIF
IF ( .NOT. SysSizingCalc .AND. (SystemType==HydronicSystem) ) THEN
IF (MySizeFlagHydr(RadSysNum) .AND. .NOT. MyPlantScanFlagHydr(RadSysNum)) THEN
! for each radiant system do the sizing once.
CALL SizeLowTempRadiantSystem(RadSysNum,SystemType)
MySizeFlagHydr(RadSysNum) = .FALSE.
! Can this system actually do cooling?
IF ((HydrRadSys(RadSysNum)%WaterVolFlowMaxCool > 0.0d0) .AND. &
(HydrRadSys(RadSysNum)%ColdWaterInNode > 0) .AND. &
(HydrRadSys(RadSysNum)%ColdWaterOutNode > 0) .AND. &
(HydrRadSys(RadSysNum)%ColdSetptSchedPtr > 0) ) THEN
HydrRadSys(RadSysNum)%CoolingSystem = .TRUE.
END IF
! Can this system actually do heating?
IF ((HydrRadSys(RadSysNum)%WaterVolFlowMaxHeat > 0.0d0) .AND. &
(HydrRadSys(RadSysNum)%HotWaterInNode > 0) .AND. &
(HydrRadSys(RadSysNum)%HotWaterOutNode > 0) .AND. &
(HydrRadSys(RadSysNum)%HotSetptSchedPtr > 0) ) THEN
HydrRadSys(RadSysNum)%HeatingSystem = .TRUE.
END IF
!set design mass flow rates
IF (HydrRadSys(RadSysNum)%HotWaterInNode > 0) THEN
rho = GetDensityGlycol(PlantLoop(HydrRadSys(RadSysNum)%HWLoopNum)%FluidName, &
60.d0, &
PlantLoop(HydrRadSys(RadSysNum)%HWLoopNum)%FluidIndex, &
'InitLowTempRadiantSystem')
HydrRadSys(RadSysNum)%WaterFlowMaxHeat = rho*HydrRadSys(RadSysNum)%WaterVolFlowMaxHeat
CALL InitComponentNodes(0.0d0, HydrRadSys(RadSysNum)%WaterFlowMaxHeat, &
HydrRadSys(RadSysNum)%HotWaterInNode, &
HydrRadSys(RadSysNum)%HotWaterOutNode, &
HydrRadSys(RadSysNum)%HWLoopNum, &
HydrRadSys(RadSysNum)%HWLoopSide, &
HydrRadSys(RadSysNum)%HWBranchNum, &
HydrRadSys(RadSysNum)%HWCompNum )
ENDIF
IF (HydrRadSys(RadSysNum)%ColdWaterInNode > 0) THEN
rho = GetDensityGlycol(PlantLoop(HydrRadSys(RadSysNum)%CWLoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(HydrRadSys(RadSysNum)%CWLoopNum)%FluidIndex, &
'InitLowTempRadiantSystem')
HydrRadSys(RadSysNum)%WaterFlowMaxCool = rho*HydrRadSys(RadSysNum)%WaterVolFlowMaxCool
CALL InitComponentNodes(0.0d0, HydrRadSys(RadSysNum)%WaterFlowMaxCool, &
HydrRadSys(RadSysNum)%ColdWaterInNode, &
HydrRadSys(RadSysNum)%ColdWaterOutNode, &
HydrRadSys(RadSysNum)%CWLoopNum, &
HydrRadSys(RadSysNum)%CWLoopSide, &
HydrRadSys(RadSysNum)%CWBranchNum, &
HydrRadSys(RadSysNum)%CWCompNum )
ENDIF
END IF
END IF
IF ( .NOT. SysSizingCalc .AND. (SystemType==ConstantFlowSystem) ) THEN
IF (MySizeFlagCFlo(RadSysNum) .AND. .NOT. MyPlantScanFlagCFlo(RadSysNum)) THEN
! for each radiant system do the sizing once.
CALL SizeLowTempRadiantSystem(RadSysNum,SystemType)
!set design mass flow rates
IF (CFloRadSys(RadSysNum)%HotWaterInNode > 0) THEN
rho = GetDensityGlycol(PlantLoop(CFloRadSys(RadSysNum)%HWLoopNum)%FluidName, &
60.d0, &
PlantLoop(CFloRadSys(RadSysNum)%HWLoopNum)%FluidIndex, &
'InitLowTempRadiantSystem')
CFloRadSys(RadSysNum)%HotDesignWaterMassFlowRate = rho*CFloRadSys(RadSysNum)%WaterVolFlowMax
CALL InitComponentNodes(0.0d0, CFloRadSys(RadSysNum)%HotDesignWaterMassFlowRate, &
CFloRadSys(RadSysNum)%HotWaterInNode, &
CFloRadSys(RadSysNum)%HotWaterOutNode, &
CFloRadSys(RadSysNum)%HWLoopNum, &
CFloRadSys(RadSysNum)%HWLoopSide, &
CFloRadSys(RadSysNum)%HWBranchNum, &
CFloRadSys(RadSysNum)%HWCompNum )
ENDIF
IF (CFloRadSys(RadSysNum)%ColdWaterInNode > 0) THEN
rho = GetDensityGlycol(PlantLoop(CFloRadSys(RadSysNum)%CWLoopNum)%FluidName, &
InitConvTemp, &
PlantLoop(CFloRadSys(RadSysNum)%CWLoopNum)%FluidIndex, &
'InitLowTempRadiantSystem')
CFloRadSys(RadSysNum)%ColdDesignWaterMassFlowRate = rho*CFloRadSys(RadSysNum)%WaterVolFlowMax
CALL InitComponentNodes(0.0d0, CFloRadSys(RadSysNum)%ColdDesignWaterMassFlowRate, &
CFloRadSys(RadSysNum)%ColdWaterInNode, &
CFloRadSys(RadSysNum)%ColdWaterOutNode, &
CFloRadSys(RadSysNum)%CWLoopNum, &
CFloRadSys(RadSysNum)%CWLoopSide, &
CFloRadSys(RadSysNum)%CWBranchNum, &
CFloRadSys(RadSysNum)%CWCompNum )
ENDIF
MySizeFlagCFlo(RadSysNum) = .FALSE.
END IF
END IF
IF ( .NOT. SysSizingCalc .AND. (SystemType==ElectricSystem) ) THEN
IF (MySizeFlagElec(RadSysNum)) THEN
! for each radiant system do the sizing once.
CALL SizeLowTempRadiantSystem(RadSysNum,SystemType)
MySizeFlagElec(RadSysNum) = .FALSE.
END IF
END IF
IF (BeginEnvrnFlag .and. MyEnvrnFlagGeneral) THEN
ZeroSourceSumHATsurf = 0.D0
QRadSysSrcAvg = 0.D0
LastQRadSysSrc = 0.D0
LastSysTimeElapsed = 0.D0
LastTimeStepSys = 0.D0
MyEnvrnFlagGeneral = .FALSE.
ENDIF
IF (.NOT. BeginEnvrnFlag) MyEnvrnFlagGeneral = .TRUE.
IF (SystemType == HydronicSystem) THEN
IF (BeginEnvrnFlag .and. MyEnvrnFlagHydr(RadSysNum)) THEN
HydrRadSys(RadSysNum)%HeatPower = 0.d0
HydrRadSys(RadSysNum)%HeatEnergy = 0.d0
HydrRadSys(RadSysNum)%CoolPower = 0.d0
HydrRadSys(RadSysNum)%CoolEnergy = 0.d0
HydrRadSys(RadSysNum)%WaterInletTemp = 0.d0
HydrRadSys(RadSysNum)%WaterOutletTemp = 0.d0
HydrRadSys(RadSysNum)%WaterMassFlowRate = 0.d0
IF (.NOT. MyPlantScanFlagHydr(RadSysNum)) THEN
IF (HydrRadSys(RadSysNum)%HotWaterInNode > 0) THEN
CALL InitComponentNodes(0.0d0, HydrRadSys(RadSysNum)%WaterFlowMaxHeat, &
HydrRadSys(RadSysNum)%HotWaterInNode, &
HydrRadSys(RadSysNum)%HotWaterOutNode, &
HydrRadSys(RadSysNum)%HWLoopNum, &
HydrRadSys(RadSysNum)%HWLoopSide, &
HydrRadSys(RadSysNum)%HWBranchNum, &
HydrRadSys(RadSysNum)%HWCompNum )
ENDIF
IF (HydrRadSys(RadSysNum)%ColdWaterInNode > 0) THEN
CALL InitComponentNodes(0.0d0, HydrRadSys(RadSysNum)%WaterFlowMaxCool, &
HydrRadSys(RadSysNum)%ColdWaterInNode, &
HydrRadSys(RadSysNum)%ColdWaterOutNode, &
HydrRadSys(RadSysNum)%CWLoopNum, &
HydrRadSys(RadSysNum)%CWLoopSide, &
HydrRadSys(RadSysNum)%CWBranchNum, &
HydrRadSys(RadSysNum)%CWCompNum )
ENDIF
ENDIF
MyEnvrnFlagHydr(RadSysNum)=.false.
ENDIF
ENDIF !NumOfHydrLowTempRadSys > 0
IF (.NOT. BeginEnvrnFlag .AND. SystemType == HydronicSystem) MyEnvrnFlagHydr(RadSysNum)= .TRUE.
IF (SystemType == ConstantFlowSystem) THEN
IF (BeginEnvrnFlag .and. MyEnvrnFlagCFlo(RadSysNum)) THEN
CFloRadSys(RadSysNum)%WaterInletTemp = 0.0d0
CFloRadSys(RadSysNum)%WaterOutletTemp = 0.0d0
CFloRadSys(RadSysNum)%PumpInletTemp = 0.0d0
CFloRadSys(RadSysNum)%WaterMassFlowRate = 0.0d0
CFloRadSys(RadSysNum)%WaterInjectionRate = 0.0d0
CFloRadSys(RadSysNum)%WaterRecircRate = 0.0d0
CFloRadSys(RadSysNum)%HeatPower = 0.0d0
CFloRadSys(RadSysNum)%HeatEnergy = 0.0d0
CFloRadSys(RadSysNum)%CoolPower = 0.0d0
CFloRadSys(RadSysNum)%CoolEnergy = 0.0d0
CFloRadSys(RadSysNum)%PumpPower = 0.0d0
CFloRadSys(RadSysNum)%PumpMassFlowRate = 0.0d0
CFloRadSys(RadSysNum)%PumpHeattoFluid = 0.0d0
IF (.NOT. MyPlantScanFlagCFlo(RadSysNum)) THEN
IF (CFloRadSys(RadSysNum)%HotWaterInNode > 0) THEN
CALL InitComponentNodes(0.0d0, CFloRadSys(RadSysNum)%HotDesignWaterMassFlowRate, &
CFloRadSys(RadSysNum)%HotWaterInNode, &
CFloRadSys(RadSysNum)%HotWaterOutNode, &
CFloRadSys(RadSysNum)%HWLoopNum, &
CFloRadSys(RadSysNum)%HWLoopSide, &
CFloRadSys(RadSysNum)%HWBranchNum, &
CFloRadSys(RadSysNum)%HWCompNum )
ENDIF
IF (CFloRadSys(RadSysNum)%ColdWaterInNode > 0) THEN
CALL InitComponentNodes(0.0d0, CFloRadSys(RadSysNum)%ColdDesignWaterMassFlowRate, &
CFloRadSys(RadSysNum)%ColdWaterInNode, &
CFloRadSys(RadSysNum)%ColdWaterOutNode, &
CFloRadSys(RadSysNum)%CWLoopNum, &
CFloRadSys(RadSysNum)%CWLoopSide, &
CFloRadSys(RadSysNum)%CWBranchNum, &
CFloRadSys(RadSysNum)%CWCompNum )
ENDIF
ENDIF
MyEnvrnFlagCFlo(RadSysNum) = .FALSE.
ENDIF
ENDIF ! NumOfCFloLowTempRadSys > 0
IF (.NOT. BeginEnvrnFlag .AND. SystemType == ConstantFlowSystem) MyEnvrnFlagCFlo(RadSysNum) = .TRUE.
IF (SystemType == ElectricSystem) THEN
IF (BeginEnvrnFlag .and. MyEnvrnFlagElec(RadSysNum)) THEN
ElecRadSys(RadSysNum)%HeatPower = 0.0d0
ElecRadSys(RadSysNum)%HeatEnergy = 0.0d0
ElecRadSys(RadSysNum)%ElecPower = 0.0d0
ElecRadSys(RadSysNum)%ElecEnergy = 0.0d0
ENDIF
MyEnvrnFlagElec(RadSysNum)=.false.
ENDIF
IF (.not. BeginEnvrnFlag .AND. SystemType == ElectricSystem) MyEnvrnFlagElec(RadSysNum) = .TRUE.
IF (SystemType==ConstantFlowSystem) THEN
! Can this system actually do heating?
IF ( (CFloRadSys(RadSysNum)%WaterVolFlowMax > 0.0d0) .AND. &
(CFloRadSys(RadSysNum)%HotWaterInNode > 0) .AND. &
(CFloRadSys(RadSysNum)%HotWaterOutNode > 0) .AND. &
(CFloRadSys(RadSysNum)%HotWaterHiTempSchedPtr > 0) .AND. &
(CFloRadSys(RadSysNum)%HotWaterLoTempSchedPtr > 0) .AND. &
(CFloRadSys(RadSysNum)%HotCtrlHiTempSchedPtr > 0) .AND. &
(CFloRadSys(RadSysNum)%HotCtrlLoTempSchedPtr > 0) ) THEN
CFloRadSys(RadSysNum)%HeatingSystem = .TRUE.
END IF
! Can this system actually do cooling?
IF ( (CFloRadSys(RadSysNum)%WaterVolFlowMax > 0.0d0) .AND. &
(CFloRadSys(RadSysNum)%ColdWaterInNode > 0) .AND. &
(CFloRadSys(RadSysNum)%ColdWaterOutNode > 0) .AND. &
(CFloRadSys(RadSysNum)%ColdWaterHiTempSchedPtr > 0) .AND. &
(CFloRadSys(RadSysNum)%ColdWaterLoTempSchedPtr > 0) .AND. &
(CFloRadSys(RadSysNum)%ColdCtrlHiTempSchedPtr > 0) .AND. &
(CFloRadSys(RadSysNum)%ColdCtrlLoTempSchedPtr > 0) ) THEN
CFloRadSys(RadSysNum)%CoolingSystem = .TRUE.
END IF
END IF
IF (BeginTimeStepFlag.AND.FirstHVACIteration) THEN ! This is the first pass through in a particular time step
SELECT CASE (SystemType)
CASE (HydronicSystem)
ZoneNum = HydrRadSys(RadSysNum)%ZonePtr
ZeroSourceSumHATsurf(ZoneNum) = SumHATsurf(ZoneNum) ! Set this to figure what part of the load the radiant system meets
DO RadSurfNum = 1, HydrRadSys(RadSysNum)%NumOfSurfaces
SurfNum = HydrRadSys(RadSysNum)%SurfacePtr(RadSurfNum)
QRadSysSrcAvg(SurfNum) = 0.0D0 ! Initialize this variable to zero (radiant system defaults to off)
LastQRadSysSrc(SurfNum) = 0.0D0 ! At the start of a time step, reset to zero so average calculation can begin again
LastSysTimeElapsed(SurfNum) = 0.0D0 ! At the start of a time step, reset to zero so average calculation can begin again
LastTimeStepSys(SurfNum) = 0.0D0 ! At the start of a time step, reset to zero so average calculation can begin again
END DO
CASE (ConstantFlowSystem)
ZoneNum = CFloRadSys(RadSysNum)%ZonePtr
ZeroSourceSumHATsurf(ZoneNum) = SumHATsurf(ZoneNum) ! Set this to figure what part of the load the radiant system meets
DO RadSurfNum = 1, CFloRadSys(RadSysNum)%NumOfSurfaces
SurfNum = CFloRadSys(RadSysNum)%SurfacePtr(RadSurfNum)
QRadSysSrcAvg(SurfNum) = 0.0D0 ! Initialize this variable to zero (radiant system defaults to off)
LastQRadSysSrc(SurfNum) = 0.0D0 ! At the start of a time step, reset to zero so average calculation can begin again
LastSysTimeElapsed(SurfNum) = 0.0D0 ! At the start of a time step, reset to zero so average calculation can begin again
LastTimeStepSys(SurfNum) = 0.0D0 ! At the start of a time step, reset to zero so average calculation can begin again
END DO
CASE (ElectricSystem)
ZoneNum = ElecRadSys(RadSysNum)%ZonePtr
ZeroSourceSumHATsurf(ZoneNum) = SumHATsurf(ZoneNum) ! Set this to figure what part of the load the radiant system meets
DO RadSurfNum = 1, ElecRadSys(RadSysNum)%NumOfSurfaces
SurfNum = ElecRadSys(RadSysNum)%SurfacePtr(RadSurfNum)
QRadSysSrcAvg(SurfNum) = 0.0D0 ! Initialize this variable to zero (radiant system defaults to off)
LastQRadSysSrc(SurfNum) = 0.0D0 ! At the start of a time step, reset to zero so average calculation can begin again
LastSysTimeElapsed(SurfNum) = 0.0D0 ! At the start of a time step, reset to zero so average calculation can begin again
LastTimeStepSys(SurfNum) = 0.0D0 ! At the start of a time step, reset to zero so average calculation can begin again
END DO
CASE DEFAULT
CALL ShowSevereError('Radiant system entered without specification of type: electric, constant flow, or hydronic?')
CALL ShowContinueError('Occurs in Radiant System='//TRIM(HydrRadSys(RadSysNum)%Name))
CALL ShowFatalError('Preceding condition causes termination.')
END SELECT
END IF ! ...for first pass through in a particular time step.
SELECT CASE (SystemType)
CASE (HydronicSystem)
! Initialize the appropriate node data
IF (HydrRadSys(RadSysNum)%HeatingSystem) THEN
mdot = 0.d0
CALL SetComponentFlowRate ( mdot , &
HydrRadSys(RadSysNum)%HotWaterInNode, &
HydrRadSys(RadSysNum)%HotWaterOutNode, &
HydrRadSys(RadSysNum)%HWLoopNum, &
HydrRadSys(RadSysNum)%HWLoopSide, &
HydrRadSys(RadSysNum)%HWBranchNum, &
HydrRadSys(RadSysNum)%HWCompNum )
END IF
IF (HydrRadSys(RadSysNum)%CoolingSystem) THEN
mdot = 0.d0
CALL SetComponentFlowRate ( mdot , &
HydrRadSys(RadSysNum)%ColdWaterInNode, &
HydrRadSys(RadSysNum)%ColdWaterOutNode, &
HydrRadSys(RadSysNum)%CWLoopNum, &
HydrRadSys(RadSysNum)%CWLoopSide, &
HydrRadSys(RadSysNum)%CWBranchNum, &
HydrRadSys(RadSysNum)%CWCompNum )
END IF
CASE (ConstantFlowSystem)
! Initialize the appropriate node data
IF (CFloRadSys(RadSysNum)%HeatingSystem) THEN
IF (CFloRadSys(RadSysNum)%VolFlowSchedPtr > 0) THEN
CurrentFlowSchedule = GetCurrentScheduleValue(CFloRadSys(RadSysNum)%VolFlowSchedPtr)
ELSE
CurrentFlowSchedule = 1.0d0 ! Allow user to avoid putting in a schedule (defaults to constant flow at all times)
END IF
IF (CurrentFlowSchedule > 1.0d0) CurrentFlowSchedule = 1.0d0 ! Do not allow more flow than design maximum
IF (CurrentFlowSchedule < 0.0d0) CurrentFlowSchedule = 0.0d0 ! Do not allow negative flow
CFloRadSys(RadSysNum)%WaterMassFlowRate = CFloRadSys(RadSysNum)%HotDesignWaterMassFlowRate * CurrentFlowSchedule
IF (CFloRadSys(RadSysNum)%EMSOverrideOnWaterMdot) &
CFloRadSys(RadSysNum)%WaterMassFlowRate = CFloRadSys(RadSysNum)%EMSWaterMdotOverrideValue
CALL SetComponentFlowRate(CFloRadSys(RadSysNum)%WaterMassFlowRate, &
CFloRadSys(RadSysNum)%HotWaterInNode, &
CFloRadSys(RadSysNum)%HotWaterOutNode, &
CFloRadSys(RadSysNum)%HWLoopNum, &
CFloRadSys(RadSysNum)%HWLoopSide, &
CFloRadSys(RadSysNum)%HWBranchNum, &
CFloRadSys(RadSysNum)%HWCompNum )
END IF
IF (CFloRadSys(RadSysNum)%CoolingSystem) THEN
IF (CFloRadSys(RadSysNum)%VolFlowSchedPtr > 0) THEN
CurrentFlowSchedule = GetCurrentScheduleValue(CFloRadSys(RadSysNum)%VolFlowSchedPtr)
ELSE
CurrentFlowSchedule = 1.0d0 ! Allow user to avoid putting in a schedule (defaults to constant flow at all times)
END IF
IF (CurrentFlowSchedule > 1.0d0) CurrentFlowSchedule = 1.0d0 ! Do not allow more flow than design maximum
IF (CurrentFlowSchedule < 0.0d0) CurrentFlowSchedule = 0.0d0 ! Do not allow negative flow
CFloRadSys(RadSysNum)%WaterMassFlowRate = CFloRadSys(RadSysNum)%ColdDesignWaterMassFlowRate &
*CurrentFlowSchedule
IF (CFloRadSys(RadSysNum)%EMSOverrideOnWaterMdot) &
CFloRadSys(RadSysNum)%WaterMassFlowRate = CFloRadSys(RadSysNum)%EMSWaterMdotOverrideValue
CALL SetComponentFlowRate(CFloRadSys(RadSysNum)%WaterMassFlowRate, &
CFloRadSys(RadSysNum)%ColdWaterInNode, &
CFloRadSys(RadSysNum)%ColdWaterOutNode, &
CFloRadSys(RadSysNum)%CWLoopNum, &
CFloRadSys(RadSysNum)%CWLoopSide, &
CFloRadSys(RadSysNum)%CWBranchNum, &
CFloRadSys(RadSysNum)%CWCompNum)
END IF
CASE (ElectricSystem)
CASE DEFAULT
END SELECT
OperatingMode = NotOperating ! System is not operating or can't operate; will be reset elsewhere, if necessary
RETURN
END SUBROUTINE InitLowTempRadiantSystem