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) | :: | CBNum | |||
integer, | intent(in) | :: | ZoneNode | |||
real(kind=r64), | intent(in) | :: | CWFlow | |||
real(kind=r64), | intent(out) | :: | LoadMet | |||
real(kind=r64), | intent(out) | :: | TWOut |
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 CalcCoolBeam(CBNum,ZoneNode,CWFlow,LoadMet,TWOut)
! SUBROUTINE INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN Feb 2009
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Simulate a cooled beam given the chilled water flow rate
! METHODOLOGY EMPLOYED:
! Uses the cooled beam equations; iteratively varies water outlet temperature
! until air-side and water-side cooling outputs match.
! REFERENCES:
! na
! USE STATEMENTS:
USE PlantUtilities, ONLY: SetComponentFlowRate
USE FluidProperties, ONLY: GetSpecificHeatGlycol, GetDensityGlycol
USE DataPlant, ONLY: PlantLoop
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT (IN) :: CBNum ! Unit index
INTEGER, INTENT (IN) :: ZoneNode ! zone node number
REAL(r64), INTENT (IN) :: CWFlow ! cold water flow [kg/s]
REAL(r64), INTENT (OUT) :: LoadMet ! load met by unit [W]
REAL(r64), INTENT (OUT) :: TWOut ! chilled water outlet temperature [C]
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: Iter=0 ! TWOut iteration index
REAL(r64) :: TWIn=0.0d0 ! Inlet water temperature [C]
REAL(r64) :: ZTemp=0.0d0 ! zone air temperature [C]
REAL(r64) :: WaterCoolPower=0.0d0 ! cooling power from water side [W]
REAL(r64) :: DT=0.0d0 ! approximate air - water delta T [C]
REAL(r64) :: IndFlow=0.0d0 ! induced air flow rate per beam length [m3/s-m]
REAL(r64) :: CoilFlow=0.0d0 ! mass air flow rate of air passing through "coil" [kg/m2-s]
REAL(r64) :: WaterVel=0.0d0 ! water velocity [m/s]
REAL(r64) :: K=0.0d0 ! coil heat transfer coefficient [W/m2-K]
REAL(r64) :: AirCoolPower=0.0d0 ! cooling power from the air side [W]
REAL(r64) :: Diff ! difference between water side cooling power and air side cooling power [W]
REAL(r64) :: CWFlowPerBeam=0.0d0 ! water mass flow rate per beam
REAL(r64) :: Coeff = 0.0d0 ! iteration parameter
REAL(r64) :: Delta = 0.0d0
REAL(r64) :: mdot = 0.d0
REAL(r64) :: Cp !local fluid specific heat
REAL(r64) :: rho ! local fluid density
!test CWFlow against plant
mdot = CWFlow
CALL SetComponentFlowRate(mdot, &
CoolBeam(CBNum)%CWInNode, &
CoolBeam(CBNum)%CWOutNode, &
CoolBeam(CBNum)%CWLoopNum, &
CoolBeam(CBNum)%CWLoopSideNum, &
CoolBeam(CBNum)%CWBranchNum, &
CoolBeam(CBNum)%CWCompNum)
CWFlowPerBeam = mdot / CoolBeam(CBNum)%NumBeams
TWIn = CoolBeam(CBNum)%TWin
Cp = GetSpecificHeatGlycol(PlantLoop(CoolBeam(CBNum)%CWLoopNum)%FluidName, &
TWin, &
PlantLoop(CoolBeam(CBNum)%CWLoopNum)%FluidIndex, &
'CalcCoolBeam')
rho = GetDensityGlycol(PlantLoop(CoolBeam(CBNum)%CWLoopNum)%FluidName, &
TWin, &
PlantLoop(CoolBeam(CBNum)%CWLoopNum)%FluidIndex, &
'CalcCoolBeam')
TWOut = TWIn + 2.0d0
ZTemp = Node(ZoneNode)%Temp
IF (mdot <= 0.0d0 .OR. TWIn <= 0.0d0) THEN
LoadMet = 0.0d0
TWOut = TWIn
RETURN
END IF
DO Iter=1,200
If (Iter > 50 .AND. Iter < 100) THEN
Coeff = 0.1d0 * Coeff2
ELSE IF (Iter > 100) THEN
Coeff = 0.01d0 * Coeff2
ELSE
Coeff = Coeff2
END IF
WaterCoolPower = CWFlowPerBeam * Cp *(TWout-Twin)
DT = MAX(ZTemp - 0.5d0*(TWin+TWout),0.0d0)
IndFlow = CoolBeam(CBNum)%K1 * DT**CoolBeam(CBNum)%n + CoolBeam(CBNum)%Kin * &
CoolBeam(CBNum)%BeamFlow / CoolBeam(CBNum)%BeamLength
CoilFlow = (IndFlow /CoolBeam(CBNum)%a0)*StdRhoAir
WaterVel = CWFlowPerBeam/(rho * Pi * (CoolBeam(CBNum)%InDiam)**2 / 4.0d0)
IF (WaterVel > MinWaterVel) THEN
K = CoolBeam(CBNum)%a * DT**CoolBeam(CBNum)%n1 * CoilFlow**CoolBeam(CBNum)%n2 * WaterVel**CoolBeam(CBNum)%n3
ELSE
K = CoolBeam(CBNum)%a * DT**CoolBeam(CBNum)%n1 * CoilFlow**CoolBeam(CBNum)%n2 * MinWaterVel**CoolBeam(CBNum)%n3 &
* (WaterVel/MinWaterVel)
END IF
AirCoolPower = K * CoolBeam(CBNum)%CoilArea * DT * CoolBeam(CBNum)%BeamLength
Diff = WaterCoolPower - AirCoolPower
Delta = TWout*(ABS(Diff)/Coeff)
IF (ABS(Diff) > 0.1d0) THEN
IF (Diff < 0.0d0) THEN
TWout = TWout + Delta ! increase TWout
IF (TWout > ZTemp) THEN ! check that water outlet temperature is less than zone temperature
WaterCoolPower = 0.0d0
TWout = ZTemp
EXIT
END IF
ELSE
TWout = TWout - Delta ! Decrease TWout
IF (TWout < TWin) THEN
TWout = TWin
END IF
END IF
ELSE
! water and air side outputs have converged
EXIT
END IF
END DO
LoadMet = -WaterCoolPower * CoolBeam(CBNum)%NumBeams
RETURN
END SUBROUTINE CalcCoolBeam