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.
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 CalcMoreNodeInfo
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN January 2004
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Calculate additional node information for reporting
! METHODOLOGY EMPLOYED:
! Input is the existing node data plus environment variables. Output is
! stored in MoreNodeInfo.
! REFERENCES:
! na
! USE STATEMENTS:
USE DataEnvironment, ONLY: StdBaroPress,OutBaroPress,StdRhoAir
USE Psychrometrics, ONLY: PsyRhoAirFnPbTdbW,RhoH2O,PsyHFnTdbW,CpCw,PsyTwbFnTdbWPb,PsyRhFnTdbWPb, &
PsyTdpFnWPb
USE DataGlobals , ONLY: InitConvTemp
USE DataInterfaces, ONLY: ShowWarningError,ShowContinueErrorTimeStamp
USE OutputProcessor, ONLY: ReqReportVariables,ReqRepVars,NumOfReqVariables
USE ScheduleManager, ONLY: GetCurrentScheduleValue
USE FluidProperties, ONLY: GetSatDensityRefrig, GetSatEnthalpyRefrig, GetSpecificHeatGlycol, &
GetDensityGlycol, GetGlycolNameByIndex, NumOfGlycols
USE General, ONLY: RoundSigDigits
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: iNode ! node loop index
INTEGER :: iReq ! requested report variables loop index
LOGICAL, SAVE :: MyOneTimeFlag = .TRUE. ! one time flag
REAL(r64), SAVE :: RhoAirStdInit
REAL(r64), SAVE :: RhoWaterStdInit
INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: NodeWetbulbSchedPtr
LOGICAL, SAVE, ALLOCATABLE, DIMENSION(:) :: NodeRelHumidityRepReq
INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: NodeRelHumiditySchedPtr
LOGICAL, SAVE, ALLOCATABLE, DIMENSION(:) :: NodeDewpointRepReq
INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: NodeDewpointSchedPtr
LOGICAL :: ReportWetbulb
LOGICAL :: ReportRelHumidity
LOGICAL :: ReportDewpoint
REAL(r64) :: SteamDensity
REAL(r64) :: EnthSteamInDry
REAL(r64) :: RhoAirCurrent ! temporary value for current air density f(baro, db , W)
! REAL(r64) :: rRhoVapor
! INTEGER,save :: Count=0
CHARACTER(len=MaxNameLength+18) :: NodeReportingString
CHARACTER(len=MaxNameLength+18) :: FluidName
REAL(r64) :: rho
REAL(r64) :: Cp
REAL(r64) :: rhoStd
IF (MyOneTimeFlag) THEN
RhoAirStdInit = StdRhoAir
RhoWaterStdInit = RhoH2O(InitConvTemp)
ALLOCATE(NodeWetbulbRepReq(NumOfNodes))
ALLOCATE(NodeWetbulbSchedPtr(NumOfNodes))
ALLOCATE(NodeRelHumidityRepReq(NumOfNodes))
ALLOCATE(NodeRelHumiditySchedPtr(NumOfNodes))
ALLOCATE(NodeDewpointRepReq(NumOfNodes))
ALLOCATE(NodeDewpointSchedPtr(NumOfNodes))
NodeWetbulbRepReq = .FALSE.
NodeWetbulbSchedPtr = 0
NodeRelHumidityRepReq = .FALSE.
NodeRelHumiditySchedPtr = 0
NodeDewpointRepReq = .FALSE.
NodeDewpointSchedPtr = 0
DO iNode=1,NumOfNodes
DO iReq=1,NumOfReqVariables
IF ( SameString(ReqRepVars(iReq)%VarName,'System Node Wetbulb Temperature') .AND. &
( SameString(ReqRepVars(iReq)%Key,NodeID(iNode)) .OR. SameString(ReqRepVars(iReq)%Key,Blank) ) ) THEN
NodeWetbulbRepReq(iNode) = .TRUE.
NodeWetbulbSchedPtr(iNode) = ReqRepVars(iReq)%SchedPtr
EXIT
END IF
END DO
END DO
DO iNode=1,NumOfNodes
DO iReq=1,NumOfReqVariables
IF ( SameString(ReqRepVars(iReq)%VarName,'System Node Relative Humidity') .AND. &
( SameString(ReqRepVars(iReq)%Key,NodeID(iNode)) .OR. SameString(ReqRepVars(iReq)%Key,Blank) ) ) THEN
NodeRelHumidityRepReq(iNode) = .TRUE.
NodeRelHumiditySchedPtr(iNode) = ReqRepVars(iReq)%SchedPtr
EXIT
END IF
END DO
END DO
DO iNode=1,NumOfNodes
DO iReq=1,NumOfReqVariables
IF ( SameString(ReqRepVars(iReq)%VarName,'System Node Dewpoint Temperature') .AND. &
( SameString(ReqRepVars(iReq)%Key,NodeID(iNode)) .OR. SameString(ReqRepVars(iReq)%Key,Blank) ) ) THEN
NodeDewpointRepReq(iNode) = .TRUE.
NodeDewpointSchedPtr(iNode) = ReqRepVars(iReq)%SchedPtr
EXIT
END IF
END DO
END DO
MyOneTimeFlag = .FALSE.
END IF
DO iNode=1,NumOfNodes
NodeReportingString = 'NodeReportingCalc:'//NodeID(iNode)
ReportWetbulb = .FALSE.
ReportRelHumidity = .FALSE.
ReportDewpoint = .false.
IF ( NodeWetbulbRepReq(iNode) .AND. NodeWetbulbSchedPtr(iNode) > 0) THEN
ReportWetbulb = (GetCurrentScheduleValue(NodeWetbulbSchedPtr(iNode)) > 0.0d0)
ELSE IF ( NodeWetbulbRepReq(iNode) .AND. NodeWetbulbSchedPtr(iNode) == 0) THEN
ReportWetbulb = .TRUE.
ELSE IF ( Node(iNode)%SPMNodeWetbulbRepReq) THEN
ReportWetbulb = .TRUE.
END IF
IF ( NodeRelHumidityRepReq(iNode) .AND. NodeRelHumiditySchedPtr(iNode) > 0) THEN
ReportRelHumidity = (GetCurrentScheduleValue(NodeRelHumiditySchedPtr(iNode)) > 0.0d0)
ELSE IF ( NodeRelHumidityRepReq(iNode) .AND. NodeRelHumiditySchedPtr(iNode) == 0) THEN
ReportRelHumidity = .TRUE.
END IF
IF ( NodeDewpointRepReq(iNode) .AND. NodeDewpointSchedPtr(iNode) > 0) THEN
ReportDewpoint = (GetCurrentScheduleValue(NodeDewpointSchedPtr(iNode)) > 0.0d0)
ELSE IF ( NodeDewpointRepReq(iNode) .AND. NodeDewpointSchedPtr(iNode) == 0) THEN
ReportDewpoint = .TRUE.
END IF
! calculate the volume flow rate
IF (Node(iNode)%FluidType == NodeType_Air) THEN
MoreNodeInfo(iNode)%VolFlowRateStdRho = Node(iNode)%MassFlowRate / RhoAirStdInit
! if Node%Press was reliable could be used here.
RhoAirCurrent = PsyRhoAirFnPbTdbW(OutBaroPress, Node(iNode)%Temp, Node(iNode)%HumRat)
MoreNodeInfo(iNode)%Density=RhoAirCurrent
IF (RhoAirCurrent /= 0.0D0) MoreNodeInfo(iNode)%VolFlowRateCrntRho = Node(iNode)%MassFlowRate / RhoAirCurrent
MoreNodeInfo(iNode)%ReportEnthalpy = PsyHFnTdbW(Node(iNode)%Temp,Node(iNode)%HumRat)
IF (ReportWetBulb) THEN
! if Node%Press was reliable could be used here.
MoreNodeInfo(iNode)%WetbulbTemp = PsyTwbFnTdbWPb(Node(iNode)%Temp,Node(iNode)%HumRat,OutBaroPress, &
NodeReportingString)
ELSE
MoreNodeInfo(iNode)%WetbulbTemp = 0.0d0
END IF
IF (ReportDewpoint) THEN
MoreNodeInfo(iNode)%AirDewpointTemp=PsyTdpFnWPb(Node(iNode)%HumRat,OutBaroPress)
ELSE
MoreNodeInfo(iNode)%AirDewpointTemp=0.0d0
ENDIF
IF (ReportRelHumidity) THEN
! if Node%Press was reliable could be used here.
! following routines don't issue psych errors and may be more reliable.
MoreNodeInfo(iNode)%RelHumidity = 100.0d0 * &
PsyRhFnTdbWPb(Node(iNode)%Temp,Node(iNode)%HumRat,OutBaroPress,NodeReportingString)
! rRhoVapor=PsyRhovFnTdbWPb(Node(iNode)%Temp,Node(iNode)%HumRat,OutBaroPress,'NodeReportingCalc:'//TRIM(NodeID(iNode)))
! MoreNodeInfo(iNode)%RelHumidity = 100.0 * PsyRhFnTdbRhov(Node(iNode)%Temp,rRhoVapor, &
! 'NodeReportingCalc:'//TRIM(NodeID(iNode)))
ELSE
MoreNodeInfo(iNode)%RelHumidity = 0.0d0
ENDIF
ELSE IF (Node(iNode)%FluidType == NodeType_Water) THEN
IF (.NOT. ((Node(iNode)%FluidIndex > 0) .AND. (Node(iNode)%FluidIndex <= NumOfGlycols))) THEN
rho = RhoWaterStdInit
rhoStd = RhoWaterStdInit
Cp = CpCw(Node(iNode)%Temp)
ELSE
FluidName = GetGlycolNameByIndex(Node(iNode)%FluidIndex)
Cp = GetSpecificHeatGlycol(FluidName, &
Node(iNode)%Temp, &
Node(iNode)%FluidIndex, &
NodeReportingString)
rhoStd = GetDensityGlycol( FluidName, &
InitConvTemp, &
Node(iNode)%FluidIndex, &
NodeReportingString)
rho = GetDensityGlycol( FluidName, &
Node(iNode)%Temp, &
Node(iNode)%FluidIndex, &
NodeReportingString)
ENDIF
MoreNodeInfo(iNode)%VolFlowRateStdRho = Node(iNode)%MassFlowRate / rhoStd
MoreNodeInfo(iNode)%VolFlowRateCrntRho = Node(iNode)%MassFlowRate / rho
MoreNodeInfo(iNode)%Density = rho
MoreNodeInfo(iNode)%ReportEnthalpy = Cp*Node(iNode)%Temp
MoreNodeInfo(iNode)%WetbulbTemp = 0.0d0
MoreNodeInfo(iNode)%RelHumidity = 100.0d0
ELSE IF (Node(iNode)%FluidType == NodeType_Steam) THEN
IF(Node(iNode)%Quality==1.0d0)Then
SteamDensity=GetSatDensityRefrig("STEAM",Node(iNode)%Temp,Node(iNode)%Quality, &
Node(iNode)%FluidIndex,'CalcMoreNodeInfo')
EnthSteamInDry=GetSatEnthalpyRefrig("STEAM",Node(iNode)%Temp,Node(iNode)%Quality, &
Node(iNode)%FluidIndex,'CalcMoreNodeInfo')
MoreNodeInfo(iNode)%VolFlowRateStdRho = Node(iNode)%MassFlowRate / SteamDensity
MoreNodeInfo(iNode)%ReportEnthalpy = EnthSteamInDry
MoreNodeInfo(iNode)%WetbulbTemp = 0.0d0
MoreNodeInfo(iNode)%RelHumidity = 0.0d0
ElseIf(Node(iNode)%Quality==0.0d0)Then !The node has condensate water through it
MoreNodeInfo(iNode)%VolFlowRateStdRho = Node(iNode)%MassFlowRate / RhoWaterStdInit
MoreNodeInfo(iNode)%ReportEnthalpy = CpCw(Node(iNode)%Temp)*Node(iNode)%Temp
MoreNodeInfo(iNode)%WetbulbTemp = 0.0d0
MoreNodeInfo(iNode)%RelHumidity = 0.0d0
EndIf
ELSE IF (Node(iNode)%FluidType == NodeType_Electric) THEN
MoreNodeInfo(iNode)%VolFlowRateStdRho = 0.0d0
MoreNodeInfo(iNode)%ReportEnthalpy = 0.0d0
MoreNodeInfo(iNode)%WetbulbTemp = 0.0d0
MoreNodeInfo(iNode)%RelHumidity = 0.0d0
ELSE
MoreNodeInfo(iNode)%VolFlowRateStdRho = Node(iNode)%MassFlowRate / RhoAirStdInit
IF (Node(iNode)%HumRat > 0.0d0) THEN
MoreNodeInfo(iNode)%ReportEnthalpy = PsyHFnTdbW(Node(iNode)%Temp,Node(iNode)%HumRat)
IF (ReportWetBulb) THEN
MoreNodeInfo(iNode)%WetbulbTemp = PsyTwbFnTdbWPb(Node(iNode)%Temp,Node(iNode)%HumRat,StdBaroPress)
ELSE
MoreNodeInfo(iNode)%WetbulbTemp = 0.0d0
END IF
ELSE
MoreNodeInfo(iNode)%ReportEnthalpy = CpCw(Node(iNode)%Temp)*Node(iNode)%Temp
MoreNodeInfo(iNode)%WetbulbTemp = 0.0d0
END IF
END IF
END DO
RETURN
END SUBROUTINE CalcMoreNodeInfo