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 | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | CoilNum | |||
logical, | intent(in) | :: | FirstHVACIteration |
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 InitSteamCoil(CoilNum,FirstHVACIteration)
! SUBROUTINE INFORMATION:
! AUTHOR Rahul Chillar
! DATE WRITTEN Jan 2005
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine is for initializations of the SteamCoil Components.
! METHODOLOGY EMPLOYED:
! Uses the status flags to trigger initializations.
! REFERENCES:
! na
! USE STATEMENTS:
USE FluidProperties, ONLY:GetSatDensityRefrig,GetSatEnthalpyRefrig
USE PlantUtilities, ONLY:InitComponentNodes
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: CoilNum
LOGICAL, INTENT(IN) :: FirstHVACIteration
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: AirInletNode
INTEGER :: SteamInletNode
INTEGER :: ControlNode
INTEGER :: AirOutletNode
REAL(r64) :: SteamDensity
REAL(r64) :: StartEnthSteam
LOGICAL,SAVE :: MyOneTimeFlag = .true.
LOGICAL, ALLOCATABLE,Save, DIMENSION(:) :: MyEnvrnFlag
LOGICAL, ALLOCATABLE,Save, DIMENSION(:) :: MyPlantScanFlag
LOGICAL :: errFlag
IF (MyOneTimeFlag) THEN
! initialize the environment and sizing flags
ALLOCATE(MyEnvrnFlag(NumSteamCoils))
ALLOCATE(MySizeFlag(NumSteamCoils))
ALLOCATE(CoilWarningOnceFlag(NumSteamCoils))
ALLOCATE(MyPlantScanFlag(NumSteamCoils))
MyEnvrnFlag = .TRUE.
MySizeFlag = .TRUE.
CoilWarningOnceFlag = .TRUE.
MyPlantScanFlag = .TRUE.
MyOneTimeFlag = .FALSE.
END IF
IF (MyPlantScanFlag(CoilNum) .AND. ALLOCATED(PlantLoop)) THEN
errFlag=.false.
CALL ScanPlantLoopsForObject( SteamCoil(CoilNum)%Name, &
SteamCoil(CoilNum)%Coil_PlantTypeNum, &
SteamCoil(CoilNum)%LoopNum, &
SteamCoil(CoilNum)%LoopSide, &
SteamCoil(CoilNum)%BranchNum, &
SteamCoil(CoilNum)%CompNum, &
errFlag=errFlag)
IF (errFlag) THEN
CALL ShowFatalError('InitSteamCoil: Program terminated for previous conditions.')
ENDIF
MyPlantScanFlag(CoilNum) = .FALSE.
ENDIF
IF ( .NOT. SysSizingCalc .AND. MySizeFlag(CoilNum)) THEN
! for each coil, do the sizing once.
CALL SizeSteamCoil(CoilNum)
MySizeFlag(CoilNum) = .FALSE.
END IF
! Do the Begin Environment initializations
IF (BeginEnvrnFlag .and. MyEnvrnFlag(CoilNum)) THEN
!Initialize all report variables to a known state at beginning of simulation
SteamCoil(CoilNum)%TotSteamHeatingCoilEnergy = 0.0d0
SteamCoil(CoilNum)%TotSteamCoolingCoilEnergy = 0.0d0
SteamCoil(CoilNum)%SenSteamCoolingCoilEnergy = 0.0d0
SteamCoil(CoilNum)%TotSteamHeatingCoilRate = 0.0d0
SteamCoil(CoilNum)%TotSteamCoolingCoilRate = 0.0d0
SteamCoil(CoilNum)%SenSteamCoolingCoilRate = 0.0d0
! Initialize other module level variables
SteamCoil(CoilNum)%InletAirMassFlowRate = 0.0d0
SteamCoil(CoilNum)%OutletAirMassFlowRate = 0.0d0
SteamCoil(CoilNum)%InletAirTemp = 0.0d0
SteamCoil(CoilNum)%OutletAirTemp = 0.0d0
SteamCoil(CoilNum)%InletAirHumRat = 0.0d0
SteamCoil(CoilNum)%OutletAirHumRat = 0.0d0
SteamCoil(CoilNum)%InletAirEnthalpy = 0.0d0
SteamCoil(CoilNum)%OutletAirEnthalpy = 0.0d0
SteamCoil(CoilNum)%TotSteamCoilLoad = 0.0d0
SteamCoil(CoilNum)%SenSteamCoilLoad = 0.0d0
SteamCoil(CoilNum)%LoopLoss = 0.0d0
SteamCoil(CoilNum)%LeavingRelHum = 0.0d0
SteamCoil(CoilNum)%DesiredOutletTemp = 0.0d0
SteamCoil(CoilNum)%DesiredOutletHumRat = 0.0d0
SteamCoil(CoilNum)%InletSteamTemp = 0.0d0
SteamCoil(CoilNum)%OutletSteamTemp = 0.0d0
SteamCoil(CoilNum)%InletSteamMassFlowRate = 0.0d0
SteamCoil(CoilNum)%OutletSteamMassFlowRate = 0.0d0
SteamCoil(CoilNum)%InletSteamEnthalpy = 0.0d0
SteamCoil(CoilNum)%OutletWaterEnthalpy = 0.0d0
SteamCoil(CoilNum)%InletSteamPress = 0.0d0
SteamCoil(CoilNum)%InletSteamQuality = 0.0d0
SteamCoil(CoilNum)%OutletSteamQuality = 0.0d0
! More Environment initializations
AirInletNode = SteamCoil(CoilNum)%AirInletNodeNum
SteamInletNode = SteamCoil(CoilNum)%SteamInletNodeNum
ControlNode = SteamCoil(CoilNum)%TempSetPointNodeNum
AirOutletNode = SteamCoil(CoilNum)%AirOutletNodeNum
Node(SteamInletNode)%Temp = 100.0d0
Node(SteamInletNode)%Press = 101325.d0
SteamDensity =GetSatDensityRefrig ('STEAM',Node(SteamInletNode)%Temp,1.0d0,Node(SteamInletNode)%FluidIndex,'InitSteamCoil')
StartEnthSteam =GetSatEnthalpyRefrig('STEAM',Node(SteamInletNode)%Temp,1.0d0,Node(SteamInletNode)%FluidIndex,'InitSteamCoil')
Node(SteamInletNode)%Enthalpy = StartEnthSteam
Node(SteamInletNode)%Quality = 1.0d0
Node(SteamInletNode)%HumRat = 0.0d0
SteamCoil(CoilNum)%MaxSteamMassFlowRate = SteamDensity*SteamCoil(CoilNum)%MaxSteamVolFlowRate
! Node(SteamInletNode)%MassFlowRate = SteamCoil(CoilNum)%MaxSteamMassFlowRate
! Node(SteamInletNode)%MassFlowRateMinAvail = 0.0
! Node(SteamInletNode)%MassFlowRateMaxAvail = SteamCoil(CoilNum)%MaxSteamMassFlowRate
CALL InitComponentNodes(0.d0,SteamCoil(CoilNum)%MaxSteamMassFlowRate, &
SteamCoil(CoilNum)%SteamInletNodeNum, &
SteamCoil(CoilNum)%SteamOutletNodeNum, &
SteamCoil(CoilNum)%LoopNum, &
SteamCoil(CoilNum)%LoopSide, &
SteamCoil(CoilNum)%BranchNum, &
SteamCoil(CoilNum)%CompNum )
MyEnvrnFlag(CoilNum) = .FALSE.
END IF ! End If for the Begin Environment initializations
IF (.not. BeginEnvrnFlag) THEN
MyEnvrnFlag(CoilNum)=.true.
ENDIF
! Do the Begin Day initializations
! NONE
! Do the begin HVAC time step initializations
! NONE
! Do the following initializations (every time step): This should be the info from
! the previous components outlets or the node data in this section.
AirInletNode = SteamCoil(CoilNum)%AirInletNodeNum
SteamInletNode = SteamCoil(CoilNum)%SteamInletNodeNum
ControlNode = SteamCoil(CoilNum)%TempSetPointNodeNum
AirOutletNode = SteamCoil(CoilNum)%AirOutletNodeNum
! First set the conditions for the air into the coil model
! If a temperature setpoint controlled coil must set the desired outlet temp everytime
IF (ControlNode.EQ.0) THEN
SteamCoil(CoilNum)%DesiredOutletTemp = 0.0d0
ELSE IF (ControlNode.EQ.AirOutletNode) THEN
SteamCoil(CoilNum)%DesiredOutletTemp = Node(ControlNode)%TempSetPoint
ELSE
SteamCoil(CoilNum)%DesiredOutletTemp = Node(ControlNode)%TempSetPoint - &
(Node(ControlNode)%Temp - Node(AirOutletNode)%Temp)
END IF
SteamCoil(CoilNum)%InletAirMassFlowRate = Node(AirInletNode)%MassFlowRate
SteamCoil(CoilNum)%InletAirTemp = Node(AirInletNode)%Temp
SteamCoil(CoilNum)%InletAirHumRat = Node(AirInletNode)%HumRat
SteamCoil(CoilNum)%InletAirEnthalpy = Node(AirInletNode)%Enthalpy
If(FirstHVACIteration) Then
SteamCoil(CoilNum)%InletSteamMassFlowRate = SteamCoil(CoilNum)%MaxSteamMassFlowRate
Else
SteamCoil(CoilNum)%InletSteamMassFlowRate = Node(SteamInletNode)%MassFlowRate
End If
SteamCoil(CoilNum)%InletSteamTemp = Node(SteamInletNode)%Temp
SteamCoil(CoilNum)%InletSteamEnthalpy = Node(SteamInletNode)%Enthalpy
SteamCoil(CoilNum)%InletSteamPress = Node(SteamInletNode)%Press
SteamCoil(CoilNum)%InletSteamQuality = Node(SteamInletNode)%Quality
SteamCoil(CoilNum)%TotSteamHeatingCoilRate = 0.0d0
SteamCoil(CoilNum)%TotSteamCoolingCoilRate = 0.0d0
SteamCoil(CoilNum)%SenSteamCoolingCoilRate = 0.0d0
! Node(SteamInletNode)%MassFlowRateMaxAvail = MIN(Node(SteamInletNode)%MassFlowRateMaxAvail,&
! SteamCoil(CoilNum)%MaxSteamMassFlowRate)
RETURN
END SUBROUTINE InitSteamCoil