Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | HWMassFlow | |||
real(kind=r64), | intent(in), | optional | DIMENSION(:) | :: | Par |
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.
FUNCTION VAVVSHWNoFanResidual(HWMassFlow, Par) RESULT (Residuum)
! FUNCTION INFORMATION:
! AUTHOR Fred Buhl
! DATE WRITTEN July 2004
! MODIFIED
! RE-ENGINEERED
! PURPOSE OF THIS FUNCTION:
! Calculates residual function (Requested Zone Load - Unit Output) / Requested Zone Load
! Unit Output depends on the hot water flow rate which is being varied to zero the residual.
! METHODOLOGY EMPLOYED:
! Calls CalcVAVVS, and calculates
! the residual as defined above.
! REFERENCES:
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
REAL(r64), INTENT(IN) :: HWMassFlow ! hot water mass flow rate [kg/s]
REAL(r64), INTENT(IN), DIMENSION(:), OPTIONAL :: Par ! Par(1) = REAL(SysNum)
! Par(2) = FirstHVACIteration (1. or 0.)
! Par(3) = REAL(ZoneNodeNum)
! Par(4) = REAL(HCType)
! Par(5) = air mass flow flow rate [kg/s]
! Par(6) = REAL(FanType)
! Par(7) = REAL(FanOp)
! Par(8) = heating demand [W]
! Par(9) = min steam flow rate [m3/s] - steam only
! Par(10 = max steam flow rate [m3/s] - steam only
REAL(r64) :: Residuum ! residual to be minimized to zero
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER :: UnitIndex
LOGICAL :: FirstHVACSoln
INTEGER :: ZoneNodeIndex
REAL(r64) :: AirMassFlow ! supply air mass flow rate [kg/s]
INTEGER :: HCType ! heating coil type (integer)
INTEGER :: FanType ! fan type (as an integer)
INTEGER :: FanOp ! fan operation; 0=off, 1=on.
REAL(r64) :: UnitOutput ! heating output [W]
REAL(r64) :: QSteamLoad ! proportional load to calculate steam flow [W]
REAL(r64) :: MinSteamFlow
REAL(r64) :: MaxSteamFlow
REAL(r64) :: MaxSteamCoilCapacity
UnitIndex = INT(Par(1))
IF (Par(2) > 0.0D0) THEN
FirstHVACSoln = .TRUE.
ELSE
FirstHVACSoln = .FALSE.
END IF
ZoneNodeIndex = INT(Par(3))
HCType = INT(Par(4))
AirMassFlow = Par(5)
FanType = INT(Par(6))
FanOp = INT(Par(7))
QSteamLoad = 0.0D0
! vary the load to be met by the steam coil to converge on a steam flow rate to meet the load
IF(HCType == HCoilType_SteamAirHeating)THEN
! backwards way of varying steam flow rate. Steam coil calculates a flow rate to meet a load.
MinSteamFlow = Par(9)
MaxSteamFlow = Par(10)
MaxSteamCoilCapacity = Par(11)
IF( (MaxSteamFlow - MinSteamFlow) == 0.0D0)THEN
QSteamLoad = Par(8) ! Use QTotLoad, bad starting value error for RegulaFalsi will occur
ELSE
QSteamLoad = MaxSteamCoilCapacity * HWMassFlow/(MaxSteamFlow - MinSteamFlow)
END IF
END IF
CALL CalcVAVVS(UnitIndex,FirstHVACSoln,ZoneNodeIndex,HCType,HWMassFlow,QSteamLoad, &
FanType,AirMassFlow,FanOp,UnitOutput)
Residuum = (Par(8) - UnitOutput) / Par(8)
RETURN
END FUNCTION VAVVSHWNoFanResidual