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) | :: | CompName | |||
integer, | intent(in) | :: | ZoneNum | |||
real(kind=r64), | intent(out) | :: | SensibleOutputProvided | |||
real(kind=r64), | intent(out) | :: | LatentOutputProvided | |||
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 SimZoneAirUserDefined(CompName,ZoneNum,SensibleOutputProvided,LatentOutputProvided,CompIndex)
! SUBROUTINE INFORMATION:
! AUTHOR B. Griffith
! DATE WRITTEN February, 2012
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! <description>
! METHODOLOGY EMPLOYED:
! <description>
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList
USE General, ONLY: TrimSigDigits
USE EMSManager, ONLY: ManageEMS
USE PlantUtilities, ONLY: SetComponentFlowRate, InitComponentNodes, RegisterPlantCompDesignFlow
USE Psychrometrics, ONLY: PsyHFnTdbW
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT (IN) :: CompName ! name of the packaged terminal heat pump
INTEGER, INTENT (IN) :: ZoneNum ! number of zone being served
REAL(r64), INTENT (OUT) :: SensibleOutputProvided ! sensible capacity delivered to zone
REAL(r64), INTENT (OUT) :: LatentOutputProvided ! Latent add/removal (kg/s), dehumid = negative
INTEGER, INTENT (INOUT) :: CompIndex ! index to zone hvac unit
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: CompNum
INTEGER :: Loop
REAL(r64) :: AirMassFlow
REAL(r64) :: MinHumRat
REAL(r64) :: SpecHumOut
REAL(r64) :: SpecHumIn
IF (GetInput) THEN
CALL GetUserDefinedComponents
GetInput=.FALSE.
END IF
! Find the correct Equipment
IF (CompIndex == 0) THEN
CompNum = FindItemInList(CompName, UserZoneAirHVAC%Name, NumUserZoneAir)
IF (CompNum == 0) THEN
CALL ShowFatalError('SimUserDefinedPlantComponent: User Defined Coil not found')
ENDIF
CompIndex = CompNum
ELSE
CompNum = CompIndex
IF (CompNum < 1 .OR. CompNum > NumUserZoneAir) THEN
CALL ShowFatalError('SimUserDefinedPlantComponent: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(CompNum))// &
', Number of units ='//TRIM(TrimSigDigits(NumUserZoneAir))// &
', Entered Unit name = '//TRIM(CompName) )
ENDIF
IF(CheckUserZoneAirName(CompNum)) THEN
IF (CompName /= UserZoneAirHVAC(CompNum)%Name) THEN
CALL ShowFatalError('SimUserDefinedPlantComponent: Invalid CompIndex passed='// &
TRIM(TrimSigDigits(CompNum))// &
', Unit name='//TRIM(CompName)//', stored unit name for that index='// &
TRIM(UserZoneAirHVAC(CompNum)%Name) )
ENDIF
CheckUserZoneAirName(CompNum) = .FALSE.
ENDIF
ENDIF
IF (BeginEnvrnFlag) THEN
CALL InitZoneAirUserDefined(CompNum, ZoneNum)
IF (UserZoneAirHVAC(CompNum)%ErlInitProgramMngr > 0) THEN
CALL ManageEMS(emsCallFromUserDefinedComponentModel, &
ProgramManagerToRun = UserZoneAirHVAC(CompNum)%ErlInitProgramMngr )
ENDIF
IF (UserZoneAirHVAC(CompNum)%NumPlantConnections > 0) THEN
DO Loop = 1, UserZoneAirHVAC(CompNum)%NumPlantConnections
CALL InitComponentNodes(UserZoneAirHVAC(CompNum)%Loop(Loop)%MassFlowRateMin, &
UserZoneAirHVAC(CompNum)%Loop(Loop)%MassFlowRateMax, &
UserZoneAirHVAC(CompNum)%Loop(Loop)%InletNodeNum, &
UserZoneAirHVAC(CompNum)%Loop(Loop)%OutletNodeNum, &
UserZoneAirHVAC(CompNum)%Loop(Loop)%LoopNum, &
UserZoneAirHVAC(CompNum)%Loop(Loop)%LoopSideNum, &
UserZoneAirHVAC(CompNum)%Loop(Loop)%BranchNum, &
UserZoneAirHVAC(CompNum)%Loop(Loop)%CompNum )
CALL RegisterPlantCompDesignFlow(UserZoneAirHVAC(CompNum)%Loop(Loop)%InletNodeNum, &
UserZoneAirHVAC(CompNum)%Loop(Loop)%DesignVolumeFlowRate)
ENDDO
ENDIF
ENDIF ! BeginEnvrnFlag
CALL InitZoneAirUserDefined(CompNum, ZoneNum)
IF (UserZoneAirHVAC(CompNum)%ErlSimProgramMngr > 0) THEN
CALL ManageEMS(emsCallFromUserDefinedComponentModel, &
ProgramManagerToRun = UserZoneAirHVAC(CompNum)%ErlSimProgramMngr)
ENDIF
CALL ReportZoneAirUserDefined(CompNum)
! calculate delivered capacity
AirMassFlow = MIN (Node(UserZoneAirHVAC(CompNum)%ZoneAir%InletNodeNum)%MassFlowRate, &
Node(UserZoneAirHVAC(CompNum)%ZoneAir%OutletNodeNum)%MassFlowRate)
! calculate sensible load met using delta enthalpy at a constant (minimum) humidity ratio)
MinHumRat = MIN(Node(UserZoneAirHVAC(CompNum)%ZoneAir%InletNodeNum)%HumRat, &
Node(UserZoneAirHVAC(CompNum)%ZoneAir%OutletNodeNum)%HumRat)
SensibleOutputProvided = AirMassFlow * &
( PsyHFnTdbW(Node(UserZoneAirHVAC(CompNum)%ZoneAir%OutletNodeNum)%Temp,MinHumRat, 'SimZoneAirUserDefined') &
- PsyHFnTdbW(Node(UserZoneAirHVAC(CompNum)%ZoneAir%InletNodeNum)%Temp,MinHumRat, 'SimZoneAirUserDefined'))
! CR9155 Remove specific humidity calculations
SpecHumOut = Node(UserZoneAirHVAC(CompNum)%ZoneAir%OutletNodeNum)%HumRat
SpecHumIn = Node(UserZoneAirHVAC(CompNum)%ZoneAir%InletNodeNum)%HumRat
LatentOutputProvided = AirMassFlow * (SpecHumOut - SpecHumIn) ! Latent rate, kg/s (dehumid = negative)
RETURN
END SUBROUTINE SimZoneAirUserDefined