From 3f7ca0d9ed8ac182459caba6857a8fca3f2f71b5 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 25 Oct 2019 15:26:59 +0200 Subject: [PATCH 01/41] FIx #7560 --- src/Transition/CreateNewIDFUsingRulesV9_2_0.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Transition/CreateNewIDFUsingRulesV9_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV9_2_0.f90 index cbb7743e609..9f2bc9bbd38 100644 --- a/src/Transition/CreateNewIDFUsingRulesV9_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV9_2_0.f90 @@ -772,7 +772,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile POutArgs(2) = TRIM(InArgs(1))//'_IndependentVariableList' ! Normalization Value - IF (InArgs(13) == Blank) THEN + IF (InArgs(9) == Blank) THEN POutArgs(3) = Blank POutArgs(4) = Blank ELSE From 56e77cb2910db82321b7accda8903fa1ececf5ec Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 15 Jan 2020 13:14:55 -0700 Subject: [PATCH 02/41] step 0 - cleanup comments --- src/EnergyPlus/ChillerReformulatedEIR.cc | 166 +---------------------- src/EnergyPlus/ChillerReformulatedEIR.hh | 25 +--- 2 files changed, 2 insertions(+), 189 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index d844e0e42b2..c0a1c5a5f9f 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -115,7 +115,6 @@ namespace ChillerReformulatedEIR { // 1. Hydeman, M., P. Sreedharan, N. Webb, and S. Blanc. 2002. "Development and Testing of a Reformulated // Regression-Based Electric Chiller Model". ASHRAE Transactions, HI-02-18-2, Vol 108, Part 2, pp. 1118-1127. - // Using/Aliasing using namespace DataGlobals; using namespace DataPrecisionGlobals; using namespace DataLoopNode; @@ -157,7 +156,6 @@ namespace ChillerReformulatedEIR { Real64 QCondenser(0.0); // Rate of heat transfer to the condenser coil [W] Real64 QHeatRecovered(0.0); // Rate of heat transfer to the heat recovery coil [W] Real64 HeatRecOutletTemp(0.0); // Heat recovery outlet temperature [C] - // REAL(r64) :: CondenserFanPower =0.0d0 ! Condenser Fan Power (fan cycles with compressor) [W] Real64 ChillerCapFT(0.0); // Chiller capacity fraction (evaluated as a function of temperature) Real64 ChillerEIRFT(0.0); // Chiller electric input ratio (EIR = 1 / COP) as a function of temperature Real64 ChillerEIRFPLR(0.0); // Chiller EIR as a function of part-load ratio (PLR) @@ -168,19 +166,10 @@ namespace ChillerReformulatedEIR { bool GetInputREIR(true); // When TRUE, calls subroutine to read input file - // SUBROUTINE SPECIFICATIONS FOR MODULE ChillerReformulatedEIR - // Object Data Array1D ElecReformEIRChiller; // dimension to number of machines Array1D ElecReformEIRChillerReport; - // MODULE SUBROUTINES: - - // Beginning of Reformulated EIR Chiller Module Driver Subroutine - //************************************************************************* - - // Functions - void SimReformulatedEIRChiller(std::string const &EP_UNUSED(EIRChillerType), // Type of chiller !unused1208 std::string const &EIRChillerName, // User specified name of chiller int const EquipFlowCtrl, // Flow control mode for the equipment @@ -209,12 +198,10 @@ namespace ChillerReformulatedEIR { // models, initializes simulation variables, calls the appropriate model and sets // up reporting variables. - // Using/Aliasing using DataPlant::TypeOf_Chiller_ElectricReformEIR; using PlantUtilities::UpdateChillerComponentCondenserSide; using PlantUtilities::UpdateComponentHeatRecoverySide; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int EIRChillNum; int LoopSide; @@ -293,9 +280,6 @@ namespace ChillerReformulatedEIR { } } - // End Reformulated EIR Chiller Module Driver Subroutine - //****************************************************************************** - void GetElecReformEIRChillerInput() { // SUBROUTINE INFORMATION: @@ -322,11 +306,8 @@ namespace ChillerReformulatedEIR { using PlantUtilities::RegisterPlantCompDesignFlow; using ScheduleManager::GetScheduleIndex; - // Locals - // PARAMETERS static std::string const RoutineName("GetElecReformEIRChillerInput: "); // include trailing blank space - // LOCAL VARIABLES int EIRChillerNum; // Chiller counter int NumAlphas; // Number of elements in the alpha array int NumNums; // Number of elements in the numeric array @@ -335,8 +316,6 @@ namespace ChillerReformulatedEIR { static bool AllocatedFlag(false); // True when arrays are allocated std::string PartLoadCurveType; // Part load curve type - // FLOW - if (AllocatedFlag) return; cCurrentModuleObject = "Chiller:Electric:ReformulatedEIR"; @@ -870,7 +849,6 @@ namespace ChillerReformulatedEIR { // METHODOLOGY EMPLOYED: // Uses the status flags to trigger initializations. - // Using/Aliasing using DataEnvironment::StdBaroPress; using DataGlobals::AnyEnergyManagementSystemInModel; using DataGlobals::BeginEnvrnFlag; @@ -886,7 +864,6 @@ namespace ChillerReformulatedEIR { using PlantUtilities::SetComponentFlowRate; using ScheduleManager::GetCurrentScheduleValue; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static std::string const RoutineName("InitElecReformEIRChiller"); static bool MyOneTimeFlag(true); // One time logic flag for allocating MyEnvrnFlag array static Array1D_bool MyFlag; @@ -1054,10 +1031,6 @@ namespace ChillerReformulatedEIR { MyFlag(EIRChillNum) = false; } - // Initialize Demand Side Variables - // IF((MyEnvrnFlag(EIRChillNum) .and. BeginEnvrnFlag) & - // .OR. (Node(CondInletNode)%MassFlowrate <= 0.0 .AND. RunFlag)) THEN - if (MyEnvrnFlag(EIRChillNum) && BeginEnvrnFlag && (PlantFirstSizesOkayToFinalize)) { rho = GetDensityGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, @@ -1215,7 +1188,6 @@ namespace ChillerReformulatedEIR { // the evaporator flow rate and the chilled water loop design delta T. The condenser flow rate // is calculated from the reference capacity, the COP, and the condenser loop design delta T. - // Using/Aliasing using namespace DataSizing; using CurveManager::CurveValue; using CurveManager::GetCurveMinMaxValues; @@ -1229,10 +1201,8 @@ namespace ChillerReformulatedEIR { using namespace OutputReportPredefined; using StandardRatings::CalcChillerIPLV; - // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("SizeElecReformEIRChiller"); - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int PltSizNum(0); // Plant Sizing index corresponding to CurLoopNum int PltSizCondNum(0); // Plant Sizing index for condenser loop bool ErrorsFound(false); // If errors detected in input @@ -1790,26 +1760,13 @@ namespace ChillerReformulatedEIR { // 1. Hydeman, M., P. Sreedharan, N. Webb, and S. Blanc. 2002. "Development and Testing of a Reformulated // Regression-Based Electric Chiller Model". ASHRAE Transactions, HI-02-18-2, Vol 108, Part 2, pp. 1118-1127. - // USE STATEMENTS: - - // Using/Aliasing using CurveManager::GetCurveMinMaxValues; using DataGlobals::WarmupFlag; using General::SolveRoot; - // SUBROUTINE PARAMETER DEFINITIONS: - Real64 const Acc(0.0001); // Accuracy control for SolveRoot int const MaxIter(500); // Iteration control for SolveRoot - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 CAPFTYTmin; // Minimum condenser leaving temperature allowed by CAPFT curve [C] Real64 CAPFTYTmax; // Maximum condenser leaving temperature allowed by CAPFT curve [C] Real64 EIRFTYTmin; // Minimum condenser leaving temperature allowed by EIRFT curve [C] @@ -1935,34 +1892,18 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // Calculate the heat recovered from the chiller condenser - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // Using/Aliasing using DataPlant::DualSetPointDeadBand; using DataPlant::PlantLoop; using DataPlant::SingleSetPoint; using ScheduleManager::GetCurrentScheduleValue; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("EIRChillerHeatRecovery"); - // DERIVED TYPE DEFINITIONS: - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CondInletNode; // Condenser inlet node number int CondOutletNode; // Condenser outlet node number int HeatRecInNode; // Node number for heat recovery water inlet node int HeatRecOutNode; // Node number for heat recovery water outlet node Real64 QTotal; // Total condenser heat [W] - // REAL(r64) :: QCondTmp ! Total condenser heat based on average temperatures [W] Real64 HeatRecInletTemp; // Heat reclaim inlet temp [C] Real64 HeatRecMassFlowRate; // Heat reclaim mass flow rate [m3/s] Real64 TAvgIn; // Average inlet temperature of heat reclaim inlet and condenser inlet [C] @@ -2055,12 +1996,10 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // Reporting - // Using/Aliasing using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; using PlantUtilities::SafeCopyPlantNode; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int EvapInletNode; // Evaporator inlet node number int EvapOutletNode; // Evaporator outlet node number int CondInletNode; // Condenser inlet node number @@ -2175,30 +2114,8 @@ namespace ChillerReformulatedEIR { // METHODOLOGY EMPLOYED: // Regula Falsi solver is used to calculate condenser outlet temperature. - // REFERENCES: - // na - - // USE STATEMENTS: - // na - - // Return value Real64 CondOutTempResidual; - // Argument array dimensioning - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // FUNCTION PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // FUNCTION LOCAL VARIABLE DECLARATIONS: int EIRChillNum; // Chiller number Real64 MyLoad; // Operating load [W] bool FirstIteration; // TRUE when first iteration of timestep @@ -2213,7 +2130,6 @@ namespace ChillerReformulatedEIR { MyLoad = Par(2); RunFlag = (int(Par(3)) == 1); FirstIteration = (int(Par(4)) == 1); - // FlowLock = INT(Par(5)) !DSU EquipFlowCtrl = int(Par(6)); CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, FalsiCondOutTemp); @@ -2252,7 +2168,6 @@ namespace ChillerReformulatedEIR { // 1. Hydeman, M., P. Sreedharan, N. Webb, and S. Blanc. 2002. "Development and Testing of a Reformulated // Regression-Based Electric Chiller Model". ASHRAE Transactions, HI-02-18-2, Vol 108, Part 2, pp. 1118-1127. - // Using/Aliasing using CurveManager::CurveValue; using DataBranchAirLoopPlant::ControlType_SeriesActive; using DataBranchAirLoopPlant::MassFlowTolerance; @@ -2278,21 +2193,9 @@ namespace ChillerReformulatedEIR { using PlantUtilities::PullCompInterconnectTrigger; using PlantUtilities::SetComponentFlowRate; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - static ObjexxFCL::gio::Fmt OutputFormat("(F6.2)"); static std::string const RoutineName("CalcElecReformEIRChillerModel"); - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 FRAC; // Chiller cycling ratio Real64 MinPartLoadRat; // Minimum allowed operating fraction of full load Real64 MinUnloadRat; // Minimum allowed unloading fraction of full load @@ -2319,7 +2222,6 @@ namespace ChillerReformulatedEIR { int EvapOutletNode; // evaporator outlet node number int CondInletNode; // condenser inlet node number int CondOutletNode; // condenser outlet node number - // LOGICAL, SAVE :: PossibleSubcooling Real64 TempLoad; // actual load to be met by chiller. This value is compared to MyLoad // and reset when necessary since this chiller can cycle, the load passed // should be the actual load. Instead the minimum PLR * RefCap is @@ -2330,12 +2232,6 @@ namespace ChillerReformulatedEIR { int CompNum; Real64 Cp; // Local fluid specific heat - // REAL(r64),SAVE :: TimeStepSysLast=0.0 ! last system time step (used to check for downshifting) - // REAL(r64) :: CurrentEndTime ! end time of time step for current simulation time step - // REAL(r64),SAVE :: CurrentEndTimeLast=0.0 ! end time of time step for last simulation time step - // CHARACTER(len=6) :: OutputChar = ' ' ! character string for warning messages - - // Set module level inlet and outlet nodes and initialize other local variables ChillerPartLoadRatio = 0.0; ChillerCyclingRatio = 0.0; ChillerFalseLoadRate = 0.0; @@ -2345,7 +2241,6 @@ namespace ChillerReformulatedEIR { QCondenser = 0.0; QEvaporator = 0.0; QHeatRecovered = 0.0; - // CondenserFanPower = 0.0 EvapInletNode = ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum; EvapOutletNode = ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum; CondInletNode = ElecReformEIRChiller(EIRChillNum).CondInletNodeNum; @@ -2364,32 +2259,6 @@ namespace ChillerReformulatedEIR { EvapInletTemp = Node(EvapInletNode).Temp; CondInletTemp = Node(CondInletNode).Temp; - // This chiller is currenlty has only a water-cooled condenser - //! calculate end time of current time step - // CurrentEndTime = CurrentTime + SysTimeElapsed - //! Print warning messages only when valid and only for the first occurrence. Let summary provide statistics. - //! Wait for next time step to print warnings. If simulation iterates, print out - //! the warning for the last iteration only. Must wait for next time step to accomplish this. - //! If a warning occurs and the simulation down shifts, the warning is not valid. - // IF(CurrentEndTime .GT. CurrentEndTimeLast .AND. TimeStepSys .GE. TimeStepSysLast)THEN - // IF(ElecReformEIRChiller(EIRChillNum)%PrintMessage)THEN - // ElecReformEIRChiller(EIRChillNum)%MsgErrorCount = & - // ElecReformEIRChiller(EIRChillNum)%MsgErrorCount + 1 - //! Show single warning and pass additional info to ShowRecurringWarningErrorAtEnd - // IF (ElecReformEIRChiller(EIRChillNum)%MsgErrorCount < 2) THEN - // CALL ShowWarningError(TRIM(ElecReformEIRChiller(EIRChillNum)%MsgBuffer1)//'.') - // CALL ShowContinueError(TRIM(ElecReformEIRChiller(EIRChillNum)%MsgBuffer2)) - // ELSE - // CALL ShowRecurringWarningErrorAtEnd(TRIM(ElecReformEIRChiller(EIRChillNum)%MsgBuffer1)//' error continues.', & - // ElecReformEIRChiller(EIRChillNum)%ErrCount1,ReportMaxOf=ElecReformEIRChiller(EIRChillNum)%MsgDataLast, & - // ReportMinOf=ElecReformEIRChiller(EIRChillNum)%MsgDataLast,ReportMaxUnits='[C]',ReportMinUnits='[C]') - // END IF - // END IF - // END IF - //! save last system time step and last end time of current time step (used to determine if warning is valid) - // TimeStepSysLast = TimeStepSys - // CurrentEndTimeLast = CurrentEndTime - // If no loop demand or chiller OFF, return // If chiller load is 0 or chiller is not running then leave the subroutine. Before leaving // if the component control is SERIESACTIVE we set the component flow to inlet flow so that @@ -2521,34 +2390,20 @@ namespace ChillerReformulatedEIR { // Available chiller capacity as a function of temperature AvailChillerCap = ChillerRefCap * ChillerCapFT; - // IF (PlantLoop(PlantLoopNum)%LoopSide(LoopSideNum)%FlowLock .EQ. 0) THEN - // EvapMassFlowRate = MIN(EvapMassFlowRateMax,Node(EvapInletNode)%MassFlowRateMaxAvail) !CRBranchPump - // EvapMassFlowRate = MAX(EvapMassFlowRate,Node(EvapInletNode)%MassFlowRateMinAvail) !CRBranchPump - //! Some other component set the flow to 0. No reason to continue with calculations. - // IF(EvapMassFlowRate == 0.0d0)THEN - // MyLoad = 0.0d0 - //! ElecReformEIRChiller(EIRChillNum)%PrintMessage = .FALSE. - // RETURN - // END IF - // ELSE EvapMassFlowRate = Node(EvapInletNode).MassFlowRate; // Some other component set the flow to 0. No reason to continue with calculations. if (EvapMassFlowRate == 0.0) { MyLoad = 0.0; - // ElecReformEIRChiller(EIRChillNum)%PrintMessage = .FALSE. return; } - // END IF - // This chiller is currenlty has only a water-cooled condenser + // This chiller is currently has only a water-cooled condenser // Calculate water side load Cp = GetSpecificHeatGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, Node(EvapInletNode).Temp, PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); - // problem here if no setpoint on outlet - // CR 9132 changed from actual node flow rate to maximum available to avoid issue of limiting capacity TempLoad = Node(EvapInletNode).MassFlowRateMaxAvail * Cp * (Node(EvapInletNode).Temp - EvapOutletTempSetPoint); @@ -2697,7 +2552,6 @@ namespace ChillerReformulatedEIR { // Some other component set the flow to 0. No reason to continue with calculations. if (EvapMassFlowRate == 0.0) { MyLoad = 0.0; - // ElecReformEIRChiller(EIRChillNum)%PrintMessage = .FALSE. return; } if (ElecReformEIRChiller(EIRChillNum).PossibleSubcooling) { @@ -2771,7 +2625,6 @@ namespace ChillerReformulatedEIR { } else { QEvaporator = 0.0; EvapOutletTemp = Node(EvapInletNode).Temp; - // ElecReformEIRChiller(EIRChillNum)%PrintMessage = .FALSE. } } @@ -2854,13 +2707,6 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // To compare the evaporator/condenser outlet temperatures to curve object min/max values - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // Using/Aliasing using CurveManager::CurveValue; using DataGlobals::WarmupFlag; using DataPlant::CompSetPtBasedSchemeType; @@ -2870,16 +2716,6 @@ namespace ChillerReformulatedEIR { using General::RoundSigDigits; using General::TrimSigDigits; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int EvapOutletNode; // Chiller evaporator outlet node number Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] Real64 CAPFTXTmin; // Minimum evaporator leaving temperature allowed by CAPFT curve [C] diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index 22f6a36bdda..07b11854b56 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -59,14 +59,11 @@ namespace EnergyPlus { namespace ChillerReformulatedEIR { - // Using/Aliasing - - // Data - // MODULE PARAMETER DEFINITIONS: // Chiller type parameters extern int const AirCooled; // Air-cooled condenser currently not allowed extern int const WaterCooled; // Only water-cooled condensers are currently allowed extern int const EvapCooled; // Evap-cooled condenser currently not allowed + // Performance curve variable parameters extern int const LeavingCondenser; @@ -76,7 +73,6 @@ namespace ChillerReformulatedEIR { extern int const NotModulated; extern int const LeavingSetPointModulated; - // MODULE VARIABLE DECLARATIONS: extern int NumElecReformEIRChillers; // Number of electric reformulated EIR chillers specified in input extern Real64 CondMassFlowRate; // Condenser mass flow rate [kg/s] extern Real64 EvapMassFlowRate; // Evaporator mass flow rate [kg/s] @@ -87,7 +83,6 @@ namespace ChillerReformulatedEIR { extern Real64 QCondenser; // Rate of heat transfer to the condenser coil [W] extern Real64 QHeatRecovered; // Rate of heat transfer to the heat recovery coil [W] extern Real64 HeatRecOutletTemp; // Heat recovery outlet temperature [C] - // REAL(r64) :: CondenserFanPower =0.0d0 ! Condenser Fan Power (fan cycles with compressor) [W] extern Real64 ChillerCapFT; // Chiller capacity fraction (evaluated as a function of temperature) extern Real64 ChillerEIRFT; // Chiller electric input ratio (EIR = 1 / COP) as a function of temperature extern Real64 ChillerEIRFPLR; // Chiller EIR as a function of part-load ratio (PLR) @@ -98,10 +93,6 @@ namespace ChillerReformulatedEIR { extern bool GetInputREIR; // When TRUE, calls subroutine to read input file - // SUBROUTINE SPECIFICATIONS FOR MODULE ChillerReformulatedEIR - - // Types - struct ReformulatedEIRChillerSpecs { // Members @@ -157,7 +148,6 @@ namespace ChillerReformulatedEIR { // (function of leaving evaporator and condenser water temperatures) int ChillerEIRFPLR; // Index for the energy input ratio vs part-load ratio curve // (function of leaving condenser water temperature and part-load ratio) - // INTEGER :: CondFanPowerFCap = 0 ! Condenser fan capacity as a function of chiller capacity int ChillerCapFTError; // Used for negative capacity as a function of temp warnings int ChillerCapFTErrorIndex; // Used for negative capacity as a function of temp warnings int ChillerEIRFTError; // Used for negative EIR as a function of temp warnings @@ -214,12 +204,6 @@ namespace ChillerReformulatedEIR { int HRBranchNum; // heat recovery water plant loop branch index int HRCompNum; // heat recovery water plant loop component index int CondMassFlowIndex; - // CHARACTER(len=220):: MsgBuffer1 = ' ' !- buffer to print warning messages on following time step - // CHARACTER(len=300):: MsgBuffer2 = ' ' !- buffer to print warning messages on following time step - // REAL(r64) :: MsgDataLast = 0.0d0 ! value of data when warning occurred (passed to Recurring Warn) - // LOGICAL :: PrintMessage = .FALSE. ! logical to determine if message is valid - // INTEGER :: MsgErrorCount = 0 ! number of occurrences of warning - // INTEGER :: ErrCount1 = 0 ! for recurring error messages bool PossibleSubcooling; // flag to indicate chiller is doing less cooling that requested // Operational fault parameters bool FaultyChillerFoulingFlag; // True if the chiller has fouling fault @@ -281,8 +265,6 @@ namespace ChillerReformulatedEIR { Real64 ChillerCapFT; // reporting: Chiller capacity curve output value Real64 ChillerEIRFT; // reporting: Chiller EIRFT curve output value Real64 ChillerEIRFPLR; // reporting: Chiller EIRFPLR curve output value - // REAL(r64) :: CondenserFanPowerUse = 0.0d0 ! reporting: Air-cooled condenser fan power [W] - // REAL(r64) :: CondenserFanEnergyConsumption = 0.0d0 ! reporting: Air-cooled condenser fan energy [J] Real64 ChillerCondAvgTemp; // reporting: average condenser temp for curves with Heat recovery [C] // Default Constructor @@ -299,8 +281,6 @@ namespace ChillerReformulatedEIR { extern Array1D ElecReformEIRChiller; // dimension to number of machines extern Array1D ElecReformEIRChillerReport; - // Functions - void SimReformulatedEIRChiller(std::string const &EIRChillerType, // Type of chiller !unused1208 std::string const &EIRChillerName, // User specified name of chiller int const EquipFlowCtrl, // Flow control mode for the equipment @@ -318,9 +298,6 @@ namespace ChillerReformulatedEIR { Real64 &TempCondInDesign, Real64 &TempEvapOutDesign); - // End Reformulated EIR Chiller Module Driver Subroutine - //****************************************************************************** - void GetElecReformEIRChillerInput(); void InitElecReformEIRChiller(int const EIRChillNum, // Number of the current electric EIR chiller being simulated From 0eed1cbe14cd2defc117e0ca8f6c906ae428b422 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 15 Jan 2020 14:09:25 -0700 Subject: [PATCH 03/41] step 1 - partial cleanup usings --- src/EnergyPlus/ChillerReformulatedEIR.cc | 501 +++++++++++------------ src/EnergyPlus/ChillerReformulatedEIR.hh | 2 +- 2 files changed, 231 insertions(+), 272 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index c0a1c5a5f9f..bbdfce612fa 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -64,7 +64,6 @@ #include #include #include -#include #include #include #include @@ -115,12 +114,7 @@ namespace ChillerReformulatedEIR { // 1. Hydeman, M., P. Sreedharan, N. Webb, and S. Blanc. 2002. "Development and Testing of a Reformulated // Regression-Based Electric Chiller Model". ASHRAE Transactions, HI-02-18-2, Vol 108, Part 2, pp. 1118-1127. - using namespace DataGlobals; - using namespace DataPrecisionGlobals; - using namespace DataLoopNode; - using DataGlobals::DisplayExtraWarnings; using DataHVACGlobals::SmallWaterVolFlow; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using General::RoundSigDigits; @@ -132,6 +126,7 @@ namespace ChillerReformulatedEIR { int const AirCooled(1); // Air-cooled condenser currently not allowed int const WaterCooled(2); // Only water-cooled condensers are currently allowed int const EvapCooled(3); // Evap-cooled condenser currently not allowed + // Performance curve variable parameters int const LeavingCondenser(5); @@ -198,7 +193,6 @@ namespace ChillerReformulatedEIR { // models, initializes simulation variables, calls the appropriate model and sets // up reporting variables. - using DataPlant::TypeOf_Chiller_ElectricReformEIR; using PlantUtilities::UpdateChillerComponentCondenserSide; using PlantUtilities::UpdateComponentHeatRecoverySide; @@ -258,7 +252,7 @@ namespace ChillerReformulatedEIR { LoopSide = ElecReformEIRChiller(EIRChillNum).CDLoopSideNum; UpdateChillerComponentCondenserSide(LoopNum, LoopSide, - TypeOf_Chiller_ElectricReformEIR, + DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, ElecReformEIRChillerReport(EIRChillNum).QCond, @@ -269,7 +263,7 @@ namespace ChillerReformulatedEIR { } else if (LoopNum == ElecReformEIRChiller(EIRChillNum).HRLoopNum) { UpdateComponentHeatRecoverySide(ElecReformEIRChiller(EIRChillNum).HRLoopNum, ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, - TypeOf_Chiller_ElectricReformEIR, + DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, ElecReformEIRChiller(EIRChillNum).HeatRecOutletNodeNum, ElecReformEIRChillerReport(EIRChillNum).QHeatRecovery, @@ -296,7 +290,6 @@ namespace ChillerReformulatedEIR { using namespace DataIPShortCuts; // Data for field names, blank numerics using BranchNodeConnections::TestCompSet; using CurveManager::GetCurveIndex; - using DataGlobals::AnyEnergyManagementSystemInModel; using DataSizing::AutoSize; using FluidProperties::FindGlycol; using General::RoundSigDigits; @@ -408,9 +401,9 @@ namespace ChillerReformulatedEIR { } ElecReformEIRChiller(EIRChillerNum).EvapInletNodeNum = GetOnlySingleNode( - cAlphaArgs(6), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); + cAlphaArgs(6), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); ElecReformEIRChiller(EIRChillerNum).EvapOutletNodeNum = GetOnlySingleNode( - cAlphaArgs(7), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); + cAlphaArgs(7), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 1, DataLoopNode::ObjectIsNotParent); TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(6), cAlphaArgs(7), "Chilled Water Nodes"); ElecReformEIRChiller(EIRChillerNum).CondenserType = WaterCooled; @@ -428,9 +421,9 @@ namespace ChillerReformulatedEIR { } ElecReformEIRChiller(EIRChillerNum).CondInletNodeNum = GetOnlySingleNode( - cAlphaArgs(8), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Inlet, 2, ObjectIsNotParent); + cAlphaArgs(8), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 2, DataLoopNode::ObjectIsNotParent); ElecReformEIRChiller(EIRChillerNum).CondOutletNodeNum = GetOnlySingleNode( - cAlphaArgs(9), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Outlet, 2, ObjectIsNotParent); + cAlphaArgs(9), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 2, DataLoopNode::ObjectIsNotParent); TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(8), cAlphaArgs(9), "Condenser Water Nodes"); @@ -542,7 +535,7 @@ namespace ChillerReformulatedEIR { (ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate == AutoSize)) { ElecReformEIRChiller(EIRChillerNum).HeatRecActive = true; ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum = GetOnlySingleNode( - cAlphaArgs(11), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Inlet, 3, ObjectIsNotParent); + cAlphaArgs(11), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 3, DataLoopNode::ObjectIsNotParent); if (ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum == 0) { ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError("Invalid " + cAlphaFieldNames(11) + '=' + cAlphaArgs(11)); @@ -552,10 +545,10 @@ namespace ChillerReformulatedEIR { ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), - NodeType_Water, - NodeConnectionType_Outlet, + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Outlet, 3, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); if (ElecReformEIRChiller(EIRChillerNum).HeatRecOutletNodeNum == 0) { ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); ShowContinueError("Invalid " + cAlphaFieldNames(12) + '=' + cAlphaArgs(12)); @@ -604,10 +597,10 @@ namespace ChillerReformulatedEIR { ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), - NodeType_Water, - NodeConnectionType_Sensor, + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Sensor, 1, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); } else { ElecReformEIRChiller(EIRChillerNum).HeatRecSetPointNodeNum = 0; } @@ -824,7 +817,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); } - if (AnyEnergyManagementSystemInModel) { + if (DataGlobals::AnyEnergyManagementSystemInModel) { SetupEMSInternalVariable( "Chiller Nominal Capacity", ElecReformEIRChiller(EIRChillerNum).Name, "[W]", ElecReformEIRChiller(EIRChillerNum).RefCap); } @@ -850,12 +843,6 @@ namespace ChillerReformulatedEIR { // Uses the status flags to trigger initializations. using DataEnvironment::StdBaroPress; - using DataGlobals::AnyEnergyManagementSystemInModel; - using DataGlobals::BeginEnvrnFlag; - using DataPlant::LoopFlowStatus_NeedyIfLoopOn; - using DataPlant::PlantFirstSizesOkayToFinalize; - using DataPlant::PlantLoop; - using DataPlant::TypeOf_Chiller_ElectricReformEIR; using EMSManager::CheckIfNodeSetPointManagedByEMS; using EMSManager::iTemperatureSetPoint; using PlantUtilities::InitComponentNodes; @@ -872,8 +859,8 @@ namespace ChillerReformulatedEIR { int EvapOutletNode; // Node number for evaporator water outlet node int CondInletNode; // Node number for condenser water inlet node int CondOutletNode; // Node number for condenser water outlet node - int HeatRecInNode; // Node number for heat recovery water inlet node - int HeatRecOutNode; // Node number for heat recovery water outlet node + int HeatRecInNode(0); // Node number for heat recovery water inlet node + int HeatRecOutNode(0); // Node number for heat recovery water outlet node Real64 rho; // local fluid density Real64 mdot; // local fluid mass flow rate Real64 mdotCond; // local fluid mass flow rate for condenser @@ -911,7 +898,7 @@ namespace ChillerReformulatedEIR { // Locate the chillers on the plant loops for later usage errFlag = false; ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, - TypeOf_Chiller_ElectricReformEIR, + DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CWBranchNum, @@ -924,7 +911,7 @@ namespace ChillerReformulatedEIR { _); if (ElecReformEIRChiller(EIRChillNum).CondenserType != AirCooled) { ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, - TypeOf_Chiller_ElectricReformEIR, + DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, ElecReformEIRChiller(EIRChillNum).CDBranchNum, @@ -939,12 +926,12 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, - TypeOf_Chiller_ElectricReformEIR, + DataPlant::TypeOf_Chiller_ElectricReformEIR, true); } if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, - TypeOf_Chiller_ElectricReformEIR, + DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).HRLoopNum, ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, ElecReformEIRChiller(EIRChillNum).HRBranchNum, @@ -959,7 +946,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).HRLoopNum, ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, - TypeOf_Chiller_ElectricReformEIR, + DataPlant::TypeOf_Chiller_ElectricReformEIR, true); } @@ -968,7 +955,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, ElecReformEIRChiller(EIRChillNum).HRLoopNum, ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, - TypeOf_Chiller_ElectricReformEIR, + DataPlant::TypeOf_Chiller_ElectricReformEIR, false); } @@ -978,24 +965,24 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).FlowMode == ConstantFlow) { // reset flow priority - PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum) + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum) .LoopSide(ElecReformEIRChiller(EIRChillNum).CWLoopSideNum) .Branch(ElecReformEIRChiller(EIRChillNum).CWBranchNum) .Comp(ElecReformEIRChiller(EIRChillNum).CWCompNum) - .FlowPriority = LoopFlowStatus_NeedyIfLoopOn; + .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } if (ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) { // reset flow priority - PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum) + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum) .LoopSide(ElecReformEIRChiller(EIRChillNum).CWLoopSideNum) .Branch(ElecReformEIRChiller(EIRChillNum).CWBranchNum) .Comp(ElecReformEIRChiller(EIRChillNum).CWCompNum) - .FlowPriority = LoopFlowStatus_NeedyIfLoopOn; + .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; // check if setpoint on outlet node - if ((Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint == SensedNodeFlagValue) && - (Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi == SensedNodeFlagValue)) { - if (!AnyEnergyManagementSystemInModel) { + if ((DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { + if (!DataGlobals::AnyEnergyManagementSystemInModel) { if (!ElecReformEIRChiller(EIRChillNum).ModulatedFlowErrDone) { ShowWarningError("Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + ElecReformEIRChiller(EIRChillNum).Name); @@ -1022,20 +1009,20 @@ namespace ChillerReformulatedEIR { } } ElecReformEIRChiller(EIRChillNum).ModulatedFlowSetToLoop = true; - Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint = - Node(PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; - Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi = - Node(PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi = + DataLoopNode::Node(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } MyFlag(EIRChillNum) = false; } - if (MyEnvrnFlag(EIRChillNum) && BeginEnvrnFlag && (PlantFirstSizesOkayToFinalize)) { + if (MyEnvrnFlag(EIRChillNum) && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { - rho = GetDensityGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + rho = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate * rho; @@ -1051,9 +1038,9 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { - rho = GetDensityGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + rho = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondIn, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax = rho * ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; InitComponentNodes(0.0, @@ -1064,26 +1051,26 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, ElecReformEIRChiller(EIRChillNum).CDBranchNum, ElecReformEIRChiller(EIRChillNum).CDCompNum); - Node(CondInletNode).Temp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; + DataLoopNode::Node(CondInletNode).Temp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; } else { // air or evap air condenser // Initialize maximum available condenser flow rate - Node(CondInletNode).MassFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate * + DataLoopNode::Node(CondInletNode).MassFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate * PsyRhoAirFnPbTdbW(StdBaroPress, ElecReformEIRChiller(EIRChillNum).TempRefCondIn, 0.0, RoutineName); - Node(CondOutletNode).MassFlowRate = Node(CondInletNode).MassFlowRate; - Node(CondInletNode).MassFlowRateMaxAvail = Node(CondInletNode).MassFlowRate; - Node(CondInletNode).MassFlowRateMax = Node(CondInletNode).MassFlowRate; - Node(CondOutletNode).MassFlowRateMax = Node(CondInletNode).MassFlowRate; - Node(CondInletNode).MassFlowRateMinAvail = 0.0; - Node(CondInletNode).MassFlowRateMin = 0.0; - Node(CondOutletNode).MassFlowRateMinAvail = 0.0; - Node(CondOutletNode).MassFlowRateMin = 0.0; - Node(CondInletNode).Temp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; + DataLoopNode::Node(CondOutletNode).MassFlowRate = DataLoopNode::Node(CondInletNode).MassFlowRate; + DataLoopNode::Node(CondInletNode).MassFlowRateMaxAvail = DataLoopNode::Node(CondInletNode).MassFlowRate; + DataLoopNode::Node(CondInletNode).MassFlowRateMax = DataLoopNode::Node(CondInletNode).MassFlowRate; + DataLoopNode::Node(CondOutletNode).MassFlowRateMax = DataLoopNode::Node(CondInletNode).MassFlowRate; + DataLoopNode::Node(CondInletNode).MassFlowRateMinAvail = 0.0; + DataLoopNode::Node(CondInletNode).MassFlowRateMin = 0.0; + DataLoopNode::Node(CondOutletNode).MassFlowRateMinAvail = 0.0; + DataLoopNode::Node(CondOutletNode).MassFlowRateMin = 0.0; + DataLoopNode::Node(CondInletNode).Temp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; } if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - rho = GetDensityGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, + rho = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, DataGlobals::HWInitConvTemp, - PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidIndex, RoutineName); ElecReformEIRChiller(EIRChillNum).DesignHeatRecMassFlowRate = rho * ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; InitComponentNodes(0.0, @@ -1102,17 +1089,17 @@ namespace ChillerReformulatedEIR { MyEnvrnFlag(EIRChillNum) = false; } - if (!BeginEnvrnFlag) { + if (!DataGlobals::BeginEnvrnFlag) { MyEnvrnFlag(EIRChillNum) = true; } if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) && ElecReformEIRChiller(EIRChillNum).ModulatedFlowSetToLoop) { // fix for clumsy old input that worked because loop setpoint was spread. // could be removed with transition, testing , model change, period of being obsolete. - Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint = - Node(PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; - Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi = - Node(PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi = + DataLoopNode::Node(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } if ((std::abs(MyLoad) > 0.0) && RunFlag) { @@ -1150,7 +1137,7 @@ namespace ChillerReformulatedEIR { // check if inlet limit active and if exceeded. if (ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum > 0) { HeatRecHighInletLimit = GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); - if (Node(HeatRecInNode).Temp > HeatRecHighInletLimit) { // shut down heat recovery + if (DataLoopNode::Node(HeatRecInNode).Temp > HeatRecHighInletLimit) { // shut down heat recovery HeatRecRunFlag = false; } else { HeatRecRunFlag = RunFlag; @@ -1191,11 +1178,6 @@ namespace ChillerReformulatedEIR { using namespace DataSizing; using CurveManager::CurveValue; using CurveManager::GetCurveMinMaxValues; - using DataPlant::PlantFinalSizesOkayToReport; - using DataPlant::PlantFirstSizesOkayToFinalize; - using DataPlant::PlantFirstSizesOkayToReport; - using DataPlant::PlantLoop; - using DataPlant::TypeOf_Chiller_ElectricReformEIR; using PlantUtilities::RegisterPlantCompDesignFlow; using ReportSizingManager::ReportSizingOutput; using namespace OutputReportPredefined; @@ -1251,11 +1233,11 @@ namespace ChillerReformulatedEIR { tmpCondVolFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { - PltSizCondNum = PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).PlantSizNum; + PltSizCondNum = DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).PlantSizNum; } // find the appropriate Plant Sizing object - PltSizNum = PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).PlantSizNum; + PltSizNum = DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).PlantSizNum; if (PltSizNum > 0) { if (PlantSizData(PltSizNum).DesVolFlowRate >= SmallWaterVolFlow) { @@ -1263,16 +1245,16 @@ namespace ChillerReformulatedEIR { } else { if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized) { ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate = tmpEvapVolFlowRate; - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (PlantFirstSizesOkayToReport) { + if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Initial Design Size Reference Chilled Water Flow Rate [m3/s]", @@ -1281,14 +1263,14 @@ namespace ChillerReformulatedEIR { } else { // Hard-size with sizing data if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { EvapVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate; - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate, "User-Specified Reference Chilled Water Flow Rate [m3/s]", EvapVolFlowRateUser); - if (DisplayExtraWarnings) { + if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > AutoVsHardSizingThreshold) { ShowMessage("SizeChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + ElecReformEIRChiller(EIRChillNum).Name); @@ -1306,12 +1288,12 @@ namespace ChillerReformulatedEIR { } } } else { - if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized && PlantFirstSizesOkayToFinalize) { + if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("Autosizing of Reformulated Electric Chiller evap flow rate requires a loop Sizing:Plant object"); ShowContinueError("Occurs in Reformulated Electric Chiller object=" + ElecReformEIRChiller(EIRChillNum).Name); ErrorsFound = true; } - if (!ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized && PlantFinalSizesOkayToReport && + if (!ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate > 0.0)) { // Hard-size with sizing data ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, @@ -1331,29 +1313,29 @@ namespace ChillerReformulatedEIR { SizingEvapOutletTemp = ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; SizingCondOutletTemp = ElecReformEIRChiller(EIRChillNum).TempRefCondOut; } - Cp = GetSpecificHeatGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); - rho = GetDensityGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + rho = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); RefCapFT = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, SizingEvapOutletTemp, SizingCondOutletTemp); tmpNomCap = (Cp * rho * PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate) / RefCapFT; } else { if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized) tmpNomCap = 0.0; } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized) { ElecReformEIRChiller(EIRChillNum).RefCap = tmpNomCap; - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Capacity [W]", tmpNomCap); } - if (PlantFirstSizesOkayToReport) { + if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Initial Design Size Reference Capacity [W]", @@ -1362,14 +1344,14 @@ namespace ChillerReformulatedEIR { } else { if (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0 && tmpNomCap > 0.0) { RefCapUser = ElecReformEIRChiller(EIRChillNum).RefCap; - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Capacity [W]", tmpNomCap, "User-Specified Reference Capacity [W]", RefCapUser); - if (DisplayExtraWarnings) { + if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpNomCap - RefCapUser) / RefCapUser) > AutoVsHardSizingThreshold) { ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + ElecReformEIRChiller(EIRChillNum).Name); @@ -1385,12 +1367,12 @@ namespace ChillerReformulatedEIR { } } } else { - if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized && PlantFirstSizesOkayToFinalize) { + if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("Autosizing of Reformulated Electric Chiller reference capacity requires a loop Sizing:Plant object"); ShowContinueError("Occurs in Reformulated Electric Chiller object=" + ElecReformEIRChiller(EIRChillNum).Name); ErrorsFound = true; } - if (!ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized && PlantFinalSizesOkayToReport && + if (!ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0)) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, @@ -1401,33 +1383,33 @@ namespace ChillerReformulatedEIR { if (PltSizCondNum > 0 && PltSizNum > 0) { if (PlantSizData(PltSizNum).DesVolFlowRate >= SmallWaterVolFlow && tmpNomCap > 0.0) { - rho = GetDensityGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + rho = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, DataGlobals::CWInitConvTemp, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondIn, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + (1.0 / ElecReformEIRChiller(EIRChillNum).RefCOP) * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac) / (PlantSizData(PltSizCondNum).DeltaT * Cp * rho); - // IF (PlantFirstSizesOkayToFinalize) ElecReformEIRChiller(EIRChillNum)%CondVolFlowRate = tmpCondVolFlowRate + // IF (DataPlant::PlantFirstSizesOkayToFinalize) ElecReformEIRChiller(EIRChillNum)%CondVolFlowRate = tmpCondVolFlowRate } else { if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; - // IF (PlantFirstSizesOkayToFinalize) ElecReformEIRChiller(EIRChillNum)%CondVolFlowRate = tmpCondVolFlowRate + // IF (DataPlant::PlantFirstSizesOkayToFinalize) ElecReformEIRChiller(EIRChillNum)%CondVolFlowRate = tmpCondVolFlowRate } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized) { ElecReformEIRChiller(EIRChillNum).CondVolFlowRate = tmpCondVolFlowRate; - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (PlantFirstSizesOkayToReport) { + if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Initial Design Size Reference Condenser Water Flow Rate [m3/s]", @@ -1436,14 +1418,14 @@ namespace ChillerReformulatedEIR { } else { if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { CondVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate, "User-Specified Reference Condenser Water Flow Rate [m3/s]", CondVolFlowRateUser); - if (DisplayExtraWarnings) { + if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > AutoVsHardSizingThreshold) { ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + ElecReformEIRChiller(EIRChillNum).Name); @@ -1461,13 +1443,13 @@ namespace ChillerReformulatedEIR { } } } else { - if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized && PlantFirstSizesOkayToFinalize) { + if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("Autosizing of Reformulated Electric EIR Chiller condenser flow rate requires a condenser"); ShowContinueError("loop Sizing:Plant object"); ShowContinueError("Occurs in Reformulated Electric EIR Chiller object=" + ElecReformEIRChiller(EIRChillNum).Name); ErrorsFound = true; } - if (!ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized && PlantFinalSizesOkayToReport && + if (!ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0)) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, @@ -1483,16 +1465,16 @@ namespace ChillerReformulatedEIR { tmpHeatRecVolFlowRate = tmpCondVolFlowRate * ElecReformEIRChiller(EIRChillNum).HeatRecCapacityFraction; if (!ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRateWasAutoSized) { ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate = tmpHeatRecVolFlowRate; - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } - if (PlantFirstSizesOkayToReport) { + if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Initial Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", @@ -1501,14 +1483,14 @@ namespace ChillerReformulatedEIR { } else { if (ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { DesignHeatRecVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate, "User-Specified Design Heat Recovery Fluid Flow Rate [m3/s]", DesignHeatRecVolFlowRateUser); - if (DisplayExtraWarnings) { + if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpHeatRecVolFlowRate - DesignHeatRecVolFlowRateUser) / DesignHeatRecVolFlowRateUser) > AutoVsHardSizingThreshold) { ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + @@ -1530,11 +1512,11 @@ namespace ChillerReformulatedEIR { RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, tmpHeatRecVolFlowRate); } - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { if (MyFlag(EIRChillNum)) { Real64 IPLV; CalcChillerIPLV(ElecReformEIRChiller(EIRChillNum).Name, - TypeOf_Chiller_ElectricReformEIR, + DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).RefCap, ElecReformEIRChiller(EIRChillNum).RefCOP, ElecReformEIRChiller(EIRChillNum).CondenserType, @@ -1640,14 +1622,14 @@ namespace ChillerReformulatedEIR { } // Initialize condenser reference inlet temperature (not a user input) - Density = GetDensityGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Density = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); - SpecificHeat = GetSpecificHeatGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + SpecificHeat = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); CondenserCapacity = ElecReformEIRChiller(EIRChillNum).RefCap * (1.0 + (1.0 / ElecReformEIRChiller(EIRChillNum).RefCOP) * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac); @@ -1761,7 +1743,6 @@ namespace ChillerReformulatedEIR { // Regression-Based Electric Chiller Model". ASHRAE Transactions, HI-02-18-2, Vol 108, Part 2, pp. 1118-1127. using CurveManager::GetCurveMinMaxValues; - using DataGlobals::WarmupFlag; using General::SolveRoot; Real64 const Acc(0.0001); // Accuracy control for SolveRoot @@ -1783,7 +1764,7 @@ namespace ChillerReformulatedEIR { if (MyLoad >= 0.0 || !RunFlag) { CalcReformEIRChillerModel( - EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp); + EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp); } else { // Find min/max condenser outlet temperature used by curve objects @@ -1832,7 +1813,7 @@ namespace ChillerReformulatedEIR { SolveRoot(Acc, MaxIter, SolFla, FalsiCondOutTemp, CondOutTempResidual, Tmin, Tmax, Par); if (SolFla == -1) { - if (!WarmupFlag) { + if (!DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).IterLimitExceededNum; if (ElecReformEIRChiller(EIRChillNum).IterLimitExceededNum == 1) { ShowWarningError( @@ -1847,7 +1828,7 @@ namespace ChillerReformulatedEIR { } } } else if (SolFla == -2) { - if (!WarmupFlag) { + if (!DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).IterFailed; if (ElecReformEIRChiller(EIRChillNum).IterFailed == 1) { ShowWarningError(ElecReformEIRChiller(EIRChillNum).Name + ": Solution found when calculating condenser outlet " @@ -1864,7 +1845,7 @@ namespace ChillerReformulatedEIR { } } CalcReformEIRChillerModel( - EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp); + EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp); } } else { // If iteration is not possible, average the min/max condenser outlet temperature and manually determine solution @@ -1892,9 +1873,6 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // Calculate the heat recovered from the chiller condenser - using DataPlant::DualSetPointDeadBand; - using DataPlant::PlantLoop; - using DataPlant::SingleSetPoint; using ScheduleManager::GetCurrentScheduleValue; static std::string const RoutineName("EIRChillerHeatRecovery"); @@ -1921,16 +1899,16 @@ namespace ChillerReformulatedEIR { CondOutletNode = ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum; // inlet node to the heat recovery heat exchanger - HeatRecInletTemp = Node(HeatRecInNode).Temp; - HeatRecMassFlowRate = Node(HeatRecInNode).MassFlowRate; + HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; + HeatRecMassFlowRate = DataLoopNode::Node(HeatRecInNode).MassFlowRate; - CpHeatRec = GetSpecificHeatGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, + CpHeatRec = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, HeatRecInletTemp, - PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidIndex, RoutineName); - CpCond = GetSpecificHeatGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + CpCond = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, CondInletTemp, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); // Before we modify the QCondenser, the total or original value is transferred to QTot @@ -1948,12 +1926,12 @@ namespace ChillerReformulatedEIR { QHeatRec = min(QHeatRec, ElecReformEIRChiller(EIRChillNum).HeatRecMaxCapacityLimit); } else { // use new algorithm to meet setpoint { - auto const SELECT_CASE_var(PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { - THeatRecSetPoint = Node(ElecReformEIRChiller(EIRChillNum).HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DualSetPointDeadBand) { - THeatRecSetPoint = Node(ElecReformEIRChiller(EIRChillNum).HeatRecSetPointNodeNum).TempSetPointHi; + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + THeatRecSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecSetPointNodeNum).TempSetPoint; + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + THeatRecSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecSetPointNodeNum).TempSetPointHi; } else { assert(false); } @@ -1996,7 +1974,6 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // Reporting - using DataGlobals::SecInHour; using DataHVACGlobals::TimeStepSys; using PlantUtilities::SafeCopyPlantNode; @@ -2016,8 +1993,8 @@ namespace ChillerReformulatedEIR { if (MyLoad >= 0.0 || !RunFlag) { // Chiller not running so pass inlet states to outlet states // Set node temperatures - Node(EvapOutletNode).Temp = Node(EvapInletNode).Temp; - Node(CondOutletNode).Temp = Node(CondInletNode).Temp; + DataLoopNode::Node(EvapOutletNode).Temp = DataLoopNode::Node(EvapInletNode).Temp; + DataLoopNode::Node(CondOutletNode).Temp = DataLoopNode::Node(CondInletNode).Temp; ElecReformEIRChillerReport(Num).ChillerPartLoadRatio = 0.0; ElecReformEIRChillerReport(Num).ChillerCyclingRatio = 0.0; @@ -2029,10 +2006,10 @@ namespace ChillerReformulatedEIR { ElecReformEIRChillerReport(Num).Energy = 0.0; ElecReformEIRChillerReport(Num).EvapEnergy = 0.0; ElecReformEIRChillerReport(Num).CondEnergy = 0.0; - ElecReformEIRChillerReport(Num).EvapInletTemp = Node(EvapInletNode).Temp; - ElecReformEIRChillerReport(Num).CondInletTemp = Node(CondInletNode).Temp; - ElecReformEIRChillerReport(Num).CondOutletTemp = Node(CondOutletNode).Temp; - ElecReformEIRChillerReport(Num).EvapOutletTemp = Node(EvapOutletNode).Temp; + ElecReformEIRChillerReport(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; + ElecReformEIRChillerReport(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; + ElecReformEIRChillerReport(Num).CondOutletTemp = DataLoopNode::Node(CondOutletNode).Temp; + ElecReformEIRChillerReport(Num).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).Temp; ElecReformEIRChillerReport(Num).Evapmdot = EvapMassFlowRate; // could still be flow if in series ElecReformEIRChillerReport(Num).Condmdot = CondMassFlowRate; // could still be flow if in series ElecReformEIRChillerReport(Num).ActualCOP = 0.0; @@ -2042,33 +2019,33 @@ namespace ChillerReformulatedEIR { SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); ElecReformEIRChillerReport(Num).QHeatRecovery = 0.0; ElecReformEIRChillerReport(Num).EnergyHeatRecovery = 0.0; - ElecReformEIRChillerReport(Num).HeatRecInletTemp = Node(HeatRecInNode).Temp; - ElecReformEIRChillerReport(Num).HeatRecOutletTemp = Node(HeatRecOutNode).Temp; - ElecReformEIRChillerReport(Num).HeatRecMassFlow = Node(HeatRecInNode).MassFlowRate; + ElecReformEIRChillerReport(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; + ElecReformEIRChillerReport(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; + ElecReformEIRChillerReport(Num).HeatRecMassFlow = DataLoopNode::Node(HeatRecInNode).MassFlowRate; ElecReformEIRChillerReport(Num).ChillerCondAvgTemp = AvgCondSinkTemp; } } else { // Chiller is running, so pass calculated values // Set node temperatures - Node(EvapOutletNode).Temp = EvapOutletTemp; - Node(CondOutletNode).Temp = CondOutletTemp; + DataLoopNode::Node(EvapOutletNode).Temp = EvapOutletTemp; + DataLoopNode::Node(CondOutletNode).Temp = CondOutletTemp; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available ElecReformEIRChillerReport(Num).ChillerPartLoadRatio = ChillerPartLoadRatio; ElecReformEIRChillerReport(Num).ChillerCyclingRatio = ChillerCyclingRatio; ElecReformEIRChillerReport(Num).ChillerFalseLoadRate = ChillerFalseLoadRate; - ElecReformEIRChillerReport(Num).ChillerFalseLoad = ChillerFalseLoadRate * TimeStepSys * SecInHour; + ElecReformEIRChillerReport(Num).ChillerFalseLoad = ChillerFalseLoadRate * TimeStepSys * DataGlobals::SecInHour; ElecReformEIRChillerReport(Num).Power = Power; ElecReformEIRChillerReport(Num).QEvap = QEvaporator; ElecReformEIRChillerReport(Num).QCond = QCondenser; - ElecReformEIRChillerReport(Num).Energy = Power * TimeStepSys * SecInHour; - ElecReformEIRChillerReport(Num).EvapEnergy = QEvaporator * TimeStepSys * SecInHour; - ElecReformEIRChillerReport(Num).CondEnergy = QCondenser * TimeStepSys * SecInHour; - ElecReformEIRChillerReport(Num).EvapInletTemp = Node(EvapInletNode).Temp; - ElecReformEIRChillerReport(Num).CondInletTemp = Node(CondInletNode).Temp; - ElecReformEIRChillerReport(Num).CondOutletTemp = Node(CondOutletNode).Temp; - ElecReformEIRChillerReport(Num).EvapOutletTemp = Node(EvapOutletNode).Temp; + ElecReformEIRChillerReport(Num).Energy = Power * TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).EvapEnergy = QEvaporator * TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).CondEnergy = QCondenser * TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; + ElecReformEIRChillerReport(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; + ElecReformEIRChillerReport(Num).CondOutletTemp = DataLoopNode::Node(CondOutletNode).Temp; + ElecReformEIRChillerReport(Num).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).Temp; ElecReformEIRChillerReport(Num).Evapmdot = EvapMassFlowRate; ElecReformEIRChillerReport(Num).Condmdot = CondMassFlowRate; if (Power != 0.0) { @@ -2081,11 +2058,11 @@ namespace ChillerReformulatedEIR { SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); ElecReformEIRChillerReport(Num).QHeatRecovery = QHeatRecovered; - ElecReformEIRChillerReport(Num).EnergyHeatRecovery = QHeatRecovered * TimeStepSys * SecInHour; - Node(HeatRecOutNode).Temp = HeatRecOutletTemp; - ElecReformEIRChillerReport(Num).HeatRecInletTemp = Node(HeatRecInNode).Temp; - ElecReformEIRChillerReport(Num).HeatRecOutletTemp = Node(HeatRecOutNode).Temp; - ElecReformEIRChillerReport(Num).HeatRecMassFlow = Node(HeatRecInNode).MassFlowRate; + ElecReformEIRChillerReport(Num).EnergyHeatRecovery = QHeatRecovered * TimeStepSys * DataGlobals::SecInHour; + DataLoopNode::Node(HeatRecOutNode).Temp = HeatRecOutletTemp; + ElecReformEIRChillerReport(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; + ElecReformEIRChillerReport(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; + ElecReformEIRChillerReport(Num).HeatRecMassFlow = DataLoopNode::Node(HeatRecInNode).MassFlowRate; ElecReformEIRChillerReport(Num).ChillerCondAvgTemp = AvgCondSinkTemp; } @@ -2173,19 +2150,8 @@ namespace ChillerReformulatedEIR { using DataBranchAirLoopPlant::MassFlowTolerance; using DataEnvironment::CurMnDy; using DataEnvironment::EnvironmentName; - using DataGlobals::DoingSizing; - using DataGlobals::KickOffSimulation; - using DataGlobals::WarmupFlag; using DataHVACGlobals::SmallLoad; using DataHVACGlobals::TimeStepSys; - using DataPlant::CompSetPtBasedSchemeType; - using DataPlant::CriteriaType_MassFlowRate; - using DataPlant::DeltaTempTol; - using DataPlant::DualSetPointDeadBand; - using DataPlant::PlantLoop; - using DataPlant::SimPlantEquipTypes; - using DataPlant::SingleSetPoint; - using DataPlant::TypeOf_Chiller_ElectricReformEIR; using FaultsManager::FaultsChillerFouling; using FaultsManager::FaultsChillerSWTSensor; using General::CreateSysTimeIntervalString; @@ -2200,7 +2166,6 @@ namespace ChillerReformulatedEIR { Real64 MinPartLoadRat; // Minimum allowed operating fraction of full load Real64 MinUnloadRat; // Minimum allowed unloading fraction of full load Real64 MaxPartLoadRat; // Maximum allowed operating fraction of full load - Real64 EvapInletTemp; // Evaporator inlet temperature [C] Real64 CondInletTemp; // Condenser inlet temperature [C] Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] Real64 AvailChillerCap; // Chiller available capacity [W] @@ -2256,24 +2221,23 @@ namespace ChillerReformulatedEIR { ChillerEIRFPLR = 0.0; // Set module-level chiller evap and condenser inlet temperature variables - EvapInletTemp = Node(EvapInletNode).Temp; - CondInletTemp = Node(CondInletNode).Temp; + CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; // If no loop demand or chiller OFF, return // If chiller load is 0 or chiller is not running then leave the subroutine. Before leaving // if the component control is SERIESACTIVE we set the component flow to inlet flow so that // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { - if (EquipFlowCtrl == ControlType_SeriesActive || PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { - EvapMassFlowRate = Node(EvapInletNode).MassFlowRate; + if (EquipFlowCtrl == ControlType_SeriesActive || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { + EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; } if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { - if (PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum) + if (DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum) .LoopSide(ElecReformEIRChiller(EIRChillNum).CDLoopSideNum) .Branch(ElecReformEIRChiller(EIRChillNum).CDBranchNum) .Comp(ElecReformEIRChiller(EIRChillNum).CDCompNum) .FlowCtrl == ControlType_SeriesActive) { - CondMassFlowRate = Node(CondInletNode).MassFlowRate; + CondMassFlowRate = DataLoopNode::Node(CondInletNode).MassFlowRate; } } @@ -2286,13 +2250,13 @@ namespace ChillerReformulatedEIR { MinUnloadRat = ElecReformEIRChiller(EIRChillNum).MinUnloadRat; ChillerRefCap = ElecReformEIRChiller(EIRChillNum).RefCap; ReferenceCOP = ElecReformEIRChiller(EIRChillNum).RefCOP; - EvapOutletTemp = Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).Temp; + EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).Temp; TempLowLimitEout = ElecReformEIRChiller(EIRChillNum).TempLowLimitEvapOut; EvapMassFlowRateMax = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax; PartLoadCurveType = ElecReformEIRChiller(EIRChillNum).PartLoadCurveType; // zrp_Aug2014 // If there is a fault of chiller fouling (zrp_Nov2016) - if (ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { + if (ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingIndex; Real64 NomCap_ff = ChillerRefCap; Real64 ReferenceCOP_ff = ReferenceCOP; @@ -2323,7 +2287,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CondMassFlowIndex, ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, - CriteriaType_MassFlowRate, + DataPlant::CriteriaType_MassFlowRate, CondMassFlowRate); if (CondMassFlowRate < MassFlowTolerance) return; @@ -2331,24 +2295,24 @@ namespace ChillerReformulatedEIR { FRAC = 1.0; { - auto const SELECT_CASE_var(PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) || - (PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == CompSetPtBasedSchemeType) || - (Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint != SensedNodeFlagValue)) { + (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = Node(EvapOutletNode).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(EvapOutletNode).TempSetPoint; } else { // use plant loop overall setpoint - EvapOutletTempSetPoint = Node(PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) || - (PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == CompSetPtBasedSchemeType) || - (Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi != SensedNodeFlagValue)) { + (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = Node(EvapOutletNode).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(EvapOutletNode).TempSetPointHi; } else { // use plant loop overall setpoint - EvapOutletTempSetPoint = Node(PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; } } else { assert(false); @@ -2356,7 +2320,7 @@ namespace ChillerReformulatedEIR { } // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) - if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { + if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTIndex; Real64 EvapOutletTempSetPoint_ff = EvapOutletTempSetPoint; @@ -2365,7 +2329,7 @@ namespace ChillerReformulatedEIR { // update the EvapOutletTempSetPoint EvapOutletTempSetPoint = max(ElecReformEIRChiller(EIRChillNum).TempLowLimitEvapOut, - min(Node(EvapInletNode).Temp, EvapOutletTempSetPoint_ff - ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset)); + min(DataLoopNode::Node(EvapInletNode).Temp, EvapOutletTempSetPoint_ff - ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset)); ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset = EvapOutletTempSetPoint_ff - EvapOutletTempSetPoint; } @@ -2390,7 +2354,7 @@ namespace ChillerReformulatedEIR { // Available chiller capacity as a function of temperature AvailChillerCap = ChillerRefCap * ChillerCapFT; - EvapMassFlowRate = Node(EvapInletNode).MassFlowRate; + EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; // Some other component set the flow to 0. No reason to continue with calculations. if (EvapMassFlowRate == 0.0) { MyLoad = 0.0; @@ -2400,12 +2364,12 @@ namespace ChillerReformulatedEIR { // This chiller is currently has only a water-cooled condenser // Calculate water side load - Cp = GetSpecificHeatGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, - Node(EvapInletNode).Temp, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, + Cp = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + DataLoopNode::Node(EvapInletNode).Temp, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); - TempLoad = Node(EvapInletNode).MassFlowRateMaxAvail * Cp * (Node(EvapInletNode).Temp - EvapOutletTempSetPoint); + TempLoad = DataLoopNode::Node(EvapInletNode).MassFlowRateMaxAvail * Cp * (DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTempSetPoint); TempLoad = max(0.0, TempLoad); @@ -2426,8 +2390,8 @@ namespace ChillerReformulatedEIR { ChillerPartLoadRatio = PartLoadRat; // If FlowLock is False (0), the chiller sets the plant loop mdot // If FlowLock is True (1), the new resolved plant loop mdot is used - if (PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) { - if (PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == CompSetPtBasedSchemeType) { + if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) { + if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) { ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = false; } else { ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = true; @@ -2450,15 +2414,15 @@ namespace ChillerReformulatedEIR { } else { EvapDeltaTemp = 0.0; } - EvapOutletTemp = Node(EvapInletNode).Temp - EvapDeltaTemp; + EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else if (ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) { { - auto const SELECT_CASE_var(PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint - EvapDeltaTemp = Node(EvapInletNode).Temp - Node(EvapOutletNode).TempSetPoint; - } else if (SELECT_CASE_var == DualSetPointDeadBand) { - EvapDeltaTemp = Node(EvapInletNode).Temp - Node(EvapOutletNode).TempSetPointHi; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - DataLoopNode::Node(EvapOutletNode).TempSetPoint; + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - DataLoopNode::Node(EvapOutletNode).TempSetPointHi; } else { assert(false); } @@ -2479,11 +2443,11 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CWCompNum); // Should we recalculate this with the corrected setpoint? { - auto const SELECT_CASE_var(PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { - EvapOutletTemp = Node(EvapOutletNode).TempSetPoint; - } else if (SELECT_CASE_var == DualSetPointDeadBand) { - EvapOutletTemp = Node(EvapOutletNode).TempSetPointHi; + auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempSetPoint; + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempSetPointHi; } } QEvaporator = max(0.0, (EvapMassFlowRate * Cp * EvapDeltaTemp)); @@ -2499,16 +2463,16 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CWBranchNum, ElecReformEIRChiller(EIRChillNum).CWCompNum); // No deltaT since component is not running - EvapOutletTemp = Node(EvapInletNode).Temp; + EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; QEvaporator = 0.0; PartLoadRat = 0.0; ChillerPartLoadRatio = PartLoadRat; - if (ElecReformEIRChiller(EIRChillNum).DeltaTErrCount < 1 && !WarmupFlag) { + if (ElecReformEIRChiller(EIRChillNum).DeltaTErrCount < 1 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).DeltaTErrCount; ShowWarningError("Evaporator DeltaTemp = 0 in mass flow calculation (Tevapin = Tevapout setpoint temp)."); ShowContinueErrorTimeStamp(""); - } else if (!WarmupFlag) { + } else if (!DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerCapFTError; ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": Evaporator DeltaTemp = 0 in mass flow calculation warning continues...", @@ -2520,7 +2484,7 @@ namespace ChillerReformulatedEIR { } // End of Constant Variable Flow If Block // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) - if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation) && + if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation) && (EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTIndex; @@ -2529,7 +2493,7 @@ namespace ChillerReformulatedEIR { .CalFaultChillerSWT(VarFlowFlag, ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset, Cp, - Node(EvapInletNode).Temp, + DataLoopNode::Node(EvapInletNode).Temp, EvapOutletTemp, EvapMassFlowRate, QEvaporator); @@ -2537,11 +2501,11 @@ namespace ChillerReformulatedEIR { PartLoadRat = (AvailChillerCap > 0.0) ? (QEvaporator / AvailChillerCap) : 0.0; PartLoadRat = max(0.0, min(PartLoadRat, MaxPartLoadRat)); ChillerPartLoadRatio = PartLoadRat; - EvapDeltaTemp = Node(EvapInletNode).Temp - EvapOutletTemp; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; } } else { // If FlowLock is True - EvapMassFlowRate = Node(EvapInletNode).MassFlowRate; + EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; SetComponentFlowRate(EvapMassFlowRate, EvapInletNode, EvapOutletNode, @@ -2557,31 +2521,31 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).PossibleSubcooling) { QEvaporator = std::abs(MyLoad); EvapDeltaTemp = QEvaporator / EvapMassFlowRate / Cp; - EvapOutletTemp = Node(EvapInletNode).Temp - EvapDeltaTemp; + EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else { - EvapDeltaTemp = Node(EvapInletNode).Temp - EvapOutletTempSetPoint; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTempSetPoint; QEvaporator = max(0.0, (EvapMassFlowRate * Cp * EvapDeltaTemp)); EvapOutletTemp = EvapOutletTempSetPoint; } if (EvapOutletTemp < TempLowLimitEout) { - if ((Node(EvapInletNode).Temp - TempLowLimitEout) > DeltaTempTol) { + if ((DataLoopNode::Node(EvapInletNode).Temp - TempLowLimitEout) > DataPlant::DeltaTempTol) { EvapOutletTemp = TempLowLimitEout; - EvapDeltaTemp = Node(EvapInletNode).Temp - EvapOutletTemp; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; } else { - EvapOutletTemp = Node(EvapInletNode).Temp; - EvapDeltaTemp = Node(EvapInletNode).Temp - EvapOutletTemp; + EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; } } - if (EvapOutletTemp < Node(EvapOutletNode).TempMin) { - if ((Node(EvapInletNode).Temp - Node(EvapOutletNode).TempMin) > DeltaTempTol) { - EvapOutletTemp = Node(EvapOutletNode).TempMin; - EvapDeltaTemp = Node(EvapInletNode).Temp - EvapOutletTemp; + if (EvapOutletTemp < DataLoopNode::Node(EvapOutletNode).TempMin) { + if ((DataLoopNode::Node(EvapInletNode).Temp - DataLoopNode::Node(EvapOutletNode).TempMin) > DataPlant::DeltaTempTol) { + EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempMin; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; } else { - EvapOutletTemp = Node(EvapInletNode).Temp; - EvapDeltaTemp = Node(EvapInletNode).Temp - EvapOutletTemp; + EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; } } @@ -2590,15 +2554,15 @@ namespace ChillerReformulatedEIR { if (EvapMassFlowRate > MassFlowTolerance) { QEvaporator = std::abs(MyLoad); EvapDeltaTemp = QEvaporator / EvapMassFlowRate / Cp; - EvapOutletTemp = Node(EvapInletNode).Temp - EvapDeltaTemp; + EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else { QEvaporator = 0.0; - EvapOutletTemp = Node(EvapInletNode).Temp; + EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; } } // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) - if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation) && + if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation) && (EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTIndex; @@ -2607,12 +2571,12 @@ namespace ChillerReformulatedEIR { .CalFaultChillerSWT(VarFlowFlag, ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset, Cp, - Node(EvapInletNode).Temp, + DataLoopNode::Node(EvapInletNode).Temp, EvapOutletTemp, EvapMassFlowRate, QEvaporator); // update corresponding variables at faulty case - EvapDeltaTemp = Node(EvapInletNode).Temp - EvapOutletTemp; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; } // Checks QEvaporator on the basis of the machine limits. @@ -2621,10 +2585,10 @@ namespace ChillerReformulatedEIR { QEvaporator = AvailChillerCap * MaxPartLoadRat; EvapDeltaTemp = QEvaporator / EvapMassFlowRate / Cp; // evaporator outlet temperature is allowed to float upwards (recalculate AvailChillerCap? iterate?) - EvapOutletTemp = Node(EvapInletNode).Temp - EvapDeltaTemp; + EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else { QEvaporator = 0.0; - EvapOutletTemp = Node(EvapInletNode).Temp; + EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; } } @@ -2685,9 +2649,9 @@ namespace ChillerReformulatedEIR { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) ReformEIRChillerHeatRecovery(EIRChillNum, QCondenser, CondMassFlowRate, CondInletTemp, QHeatRecovered); - Cp = GetSpecificHeatGlycol(PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, CondInletTemp, - PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); CondOutletTemp = QCondenser / CondMassFlowRate / Cp + CondInletTemp; } else { @@ -2708,11 +2672,6 @@ namespace ChillerReformulatedEIR { // To compare the evaporator/condenser outlet temperatures to curve object min/max values using CurveManager::CurveValue; - using DataGlobals::WarmupFlag; - using DataPlant::CompSetPtBasedSchemeType; - using DataPlant::DualSetPointDeadBand; - using DataPlant::PlantLoop; - using DataPlant::SingleSetPoint; using General::RoundSigDigits; using General::TrimSigDigits; @@ -2740,13 +2699,13 @@ namespace ChillerReformulatedEIR { int BranchNum; int CompNum; - // Do not print out warnings if chiller not operating or FirstIteration/WarmupFlag/FlowLock + // Do not print out warnings if chiller not operating or FirstIteration/DataGlobals::WarmupFlag/FlowLock PlantLoopNum = ElecReformEIRChiller(EIRChillNum).CWLoopNum; LoopSideNum = ElecReformEIRChiller(EIRChillNum).CWLoopSideNum; BranchNum = ElecReformEIRChiller(EIRChillNum).CWBranchNum; CompNum = ElecReformEIRChiller(EIRChillNum).CWCompNum; - if (FirstIteration || WarmupFlag || PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; + if (FirstIteration || DataGlobals::WarmupFlag || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; EvapOutletNode = ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum; @@ -2926,24 +2885,24 @@ namespace ChillerReformulatedEIR { } { - auto const SELECT_CASE_var(PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) || - (PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == CompSetPtBasedSchemeType) || - (Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint != SensedNodeFlagValue)) { + (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = Node(EvapOutletNode).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(EvapOutletNode).TempSetPoint; } else { // use plant loop overall setpoint - EvapOutletTempSetPoint = Node(PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) || - (PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == CompSetPtBasedSchemeType) || - (Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi != SensedNodeFlagValue)) { + (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = Node(EvapOutletNode).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(EvapOutletNode).TempSetPointHi; } else { // use plant loop overall setpoint - EvapOutletTempSetPoint = Node(PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; } } else { assert(false); @@ -2953,8 +2912,8 @@ namespace ChillerReformulatedEIR { ChillerCapFT = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, EvapOutletTempSetPoint, CondOutletTemp); if (ChillerCapFT < 0) { - if (ElecReformEIRChiller(EIRChillNum).ChillerCapFTError < 1 && PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && - !WarmupFlag) { + if (ElecReformEIRChiller(EIRChillNum).ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && + !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerCapFTError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + RoundSigDigits(ChillerCapFT, 3) + @@ -2962,7 +2921,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + RoundSigDigits(EvapOutletTempSetPoint, 1) + " and a Condenser Leaving Temp of " + RoundSigDigits(CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); - } else if (PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !WarmupFlag) { + } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerCapFTError; ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": Chiller Capacity as a Function of Temperature curve output is negative warning continues...", @@ -2975,8 +2934,8 @@ namespace ChillerReformulatedEIR { ChillerEIRFT = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, EvapOutletTemp, CondOutletTemp); if (ChillerEIRFT < 0.0) { - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError < 1 && PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && - !WarmupFlag) { + if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && + !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); ShowContinueError(" Reformulated Chiller EIR as a Function of Temperature curve output is negative (" + @@ -2984,7 +2943,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + RoundSigDigits(EvapOutletTemp, 1) + " and a Condenser Leaving Temp of " + RoundSigDigits(CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); - } else if (PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !WarmupFlag) { + } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError; ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": Chiller EIR as a Function of Temperature curve output is negative warning continues...", @@ -3009,8 +2968,8 @@ namespace ChillerReformulatedEIR { } if (ChillerEIRFPLR < 0.0) { - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError < 1 && PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && - !WarmupFlag) { + if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && + !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); ShowContinueError(" Chiller EIR as a function of PLR and condenser water temperature curve output is negative (" + @@ -3018,7 +2977,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Negative value occurs using a part-load ratio of " + RoundSigDigits(ChillerPartLoadRatio, 3) + " and a Condenser Leaving Temp of " + RoundSigDigits(CondOutletTemp, 1) + " C."); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); - } else if (PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !WarmupFlag) { + } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError; ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": Chiller EIR as a function of PLR curve output is negative warning continues...", diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index 07b11854b56..c4740bb0f58 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -106,7 +106,7 @@ namespace ChillerReformulatedEIR { Real64 RefCap; // Reference capacity of the chiller [W] bool RefCapWasAutoSized; // reference capacity was autosized on input Real64 RefCOP; // Reference coefficient of performance [W/W] - int FlowMode; // one of 3 modes for componet flow during operation + int FlowMode; // one of 3 modes for component flow during operation bool ModulatedFlowSetToLoop; // True if the setpoint is missing at the outlet node bool ModulatedFlowErrDone; // true if setpoint warning issued Real64 EvapVolFlowRate; // Reference water volumetric flow rate through the evaporator [m3/s] From e1e7f2e1bf67a3b9d49042dbaaa4b0c6f45cd99d Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 15 Jan 2020 15:05:45 -0700 Subject: [PATCH 04/41] step 1 - cleanup usings --- src/EnergyPlus/ChillerReformulatedEIR.cc | 639 ++++++++++------------- 1 file changed, 283 insertions(+), 356 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index bbdfce612fa..99bb75cbacd 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -114,14 +114,6 @@ namespace ChillerReformulatedEIR { // 1. Hydeman, M., P. Sreedharan, N. Webb, and S. Blanc. 2002. "Development and Testing of a Reformulated // Regression-Based Electric Chiller Model". ASHRAE Transactions, HI-02-18-2, Vol 108, Part 2, pp. 1118-1127. - using DataHVACGlobals::SmallWaterVolFlow; - using FluidProperties::GetDensityGlycol; - using FluidProperties::GetSpecificHeatGlycol; - using General::RoundSigDigits; - using General::TrimSigDigits; - using Psychrometrics::PsyCpAirFnWTdb; - using Psychrometrics::PsyRhoAirFnPbTdbW; - // Chiller type parameters int const AirCooled(1); // Air-cooled condenser currently not allowed int const WaterCooled(2); // Only water-cooled condensers are currently allowed @@ -193,9 +185,6 @@ namespace ChillerReformulatedEIR { // models, initializes simulation variables, calls the appropriate model and sets // up reporting variables. - using PlantUtilities::UpdateChillerComponentCondenserSide; - using PlantUtilities::UpdateComponentHeatRecoverySide; - int EIRChillNum; int LoopSide; @@ -214,11 +203,11 @@ namespace ChillerReformulatedEIR { } else { EIRChillNum = CompIndex; if (EIRChillNum > NumElecReformEIRChillers || EIRChillNum < 1) { - ShowFatalError("SimReformulatedEIRChiller: Invalid CompIndex passed=" + TrimSigDigits(EIRChillNum) + - ", Number of Units=" + TrimSigDigits(NumElecReformEIRChillers) + ", Entered Unit name=" + EIRChillerName); + ShowFatalError("SimReformulatedEIRChiller: Invalid CompIndex passed=" + General::TrimSigDigits(EIRChillNum) + + ", Number of Units=" + General::TrimSigDigits(NumElecReformEIRChillers) + ", Entered Unit name=" + EIRChillerName); } if (EIRChillerName != ElecReformEIRChiller(EIRChillNum).Name) { - ShowFatalError("SimReformulatedEIRChiller: Invalid CompIndex passed=" + TrimSigDigits(EIRChillNum) + ", Unit name=" + EIRChillerName + + ShowFatalError("SimReformulatedEIRChiller: Invalid CompIndex passed=" + General::TrimSigDigits(EIRChillNum) + ", Unit name=" + EIRChillerName + ", stored Unit Name for that index=" + ElecReformEIRChiller(EIRChillNum).Name); } } @@ -250,7 +239,7 @@ namespace ChillerReformulatedEIR { UpdateReformEIRChillerRecords(MyLoad, RunFlag, EIRChillNum); } else if (LoopNum == ElecReformEIRChiller(EIRChillNum).CDLoopNum) { LoopSide = ElecReformEIRChiller(EIRChillNum).CDLoopSideNum; - UpdateChillerComponentCondenserSide(LoopNum, + PlantUtilities::UpdateChillerComponentCondenserSide(LoopNum, LoopSide, DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, @@ -261,7 +250,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChillerReport(EIRChillNum).Condmdot, FirstIteration); } else if (LoopNum == ElecReformEIRChiller(EIRChillNum).HRLoopNum) { - UpdateComponentHeatRecoverySide(ElecReformEIRChiller(EIRChillNum).HRLoopNum, + PlantUtilities::UpdateComponentHeatRecoverySide(ElecReformEIRChiller(EIRChillNum).HRLoopNum, ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, @@ -286,19 +275,6 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // This routine will get the input required by the Reformulated Electric EIR Chiller model - // Using/Aliasing - using namespace DataIPShortCuts; // Data for field names, blank numerics - using BranchNodeConnections::TestCompSet; - using CurveManager::GetCurveIndex; - using DataSizing::AutoSize; - using FluidProperties::FindGlycol; - using General::RoundSigDigits; - using General::TrimSigDigits; - using GlobalNames::VerifyUniqueChillerName; - using NodeInputManager::GetOnlySingleNode; - using PlantUtilities::RegisterPlantCompDesignFlow; - using ScheduleManager::GetScheduleIndex; - static std::string const RoutineName("GetElecReformEIRChillerInput: "); // include trailing blank space int EIRChillerNum; // Chiller counter @@ -311,11 +287,11 @@ namespace ChillerReformulatedEIR { if (AllocatedFlag) return; - cCurrentModuleObject = "Chiller:Electric:ReformulatedEIR"; - NumElecReformEIRChillers = inputProcessor->getNumObjectsFound(cCurrentModuleObject); + DataIPShortCuts::cCurrentModuleObject = "Chiller:Electric:ReformulatedEIR"; + NumElecReformEIRChillers = inputProcessor->getNumObjectsFound(DataIPShortCuts::cCurrentModuleObject); if (NumElecReformEIRChillers <= 0) { - ShowSevereError("No " + cCurrentModuleObject + " equipment specified in input file"); + ShowSevereError("No " + DataIPShortCuts::cCurrentModuleObject + " equipment specified in input file"); ErrorsFound = true; } @@ -326,52 +302,52 @@ namespace ChillerReformulatedEIR { // Load arrays with reformulated electric EIR chiller data for (EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { - inputProcessor->getObjectItem(cCurrentModuleObject, + inputProcessor->getObjectItem(DataIPShortCuts::cCurrentModuleObject, EIRChillerNum, - cAlphaArgs, + DataIPShortCuts::cAlphaArgs, NumAlphas, - rNumericArgs, + DataIPShortCuts::rNumericArgs, NumNums, IOStat, - lNumericFieldBlanks, - lAlphaFieldBlanks, - cAlphaFieldNames, - cNumericFieldNames); - UtilityRoutines::IsNameEmpty(cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + DataIPShortCuts::lNumericFieldBlanks, + DataIPShortCuts::lAlphaFieldBlanks, + DataIPShortCuts::cAlphaFieldNames, + DataIPShortCuts::cNumericFieldNames); + UtilityRoutines::IsNameEmpty(DataIPShortCuts::cAlphaArgs(1), DataIPShortCuts::cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise - VerifyUniqueChillerName(cCurrentModuleObject, cAlphaArgs(1), ErrorsFound, cCurrentModuleObject + " Name"); + GlobalNames::VerifyUniqueChillerName(DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), ErrorsFound, DataIPShortCuts::cCurrentModuleObject + " Name"); - ElecReformEIRChiller(EIRChillerNum).Name = cAlphaArgs(1); + ElecReformEIRChiller(EIRChillerNum).Name = DataIPShortCuts::cAlphaArgs(1); // Performance curves - ElecReformEIRChiller(EIRChillerNum).ChillerCapFT = GetCurveIndex(cAlphaArgs(2)); - ElecReformEIRChiller(EIRChillerNum).CAPFTName = cAlphaArgs(2); + ElecReformEIRChiller(EIRChillerNum).ChillerCapFT = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(2)); + ElecReformEIRChiller(EIRChillerNum).CAPFTName = DataIPShortCuts::cAlphaArgs(2); if (ElecReformEIRChiller(EIRChillerNum).ChillerCapFT == 0) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + cAlphaFieldNames(2) + '=' + cAlphaArgs(2)); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(2) + '=' + DataIPShortCuts::cAlphaArgs(2)); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).ChillerEIRFT = GetCurveIndex(cAlphaArgs(3)); - ElecReformEIRChiller(EIRChillerNum).EIRFTName = cAlphaArgs(3); + ElecReformEIRChiller(EIRChillerNum).ChillerEIRFT = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(3)); + ElecReformEIRChiller(EIRChillerNum).EIRFTName = DataIPShortCuts::cAlphaArgs(3); if (ElecReformEIRChiller(EIRChillerNum).ChillerEIRFT == 0) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + cAlphaFieldNames(3) + '=' + cAlphaArgs(3)); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(3) + '=' + DataIPShortCuts::cAlphaArgs(3)); ErrorsFound = true; } // The default type of part-load curve is: LeavingCondenserWaterTemperature - if (lAlphaFieldBlanks(4)) { + if (DataIPShortCuts::lAlphaFieldBlanks(4)) { PartLoadCurveType = "LeavingCondenserWaterTemperature"; } else { - PartLoadCurveType = cAlphaArgs(4); + PartLoadCurveType = DataIPShortCuts::cAlphaArgs(4); } - ElecReformEIRChiller(EIRChillerNum).EIRFPLRName = cAlphaArgs(5); - ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR = GetCurveIndex(cAlphaArgs(5)); + ElecReformEIRChiller(EIRChillerNum).EIRFPLRName = DataIPShortCuts::cAlphaArgs(5); + ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(5)); if (ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR == 0) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + cAlphaFieldNames(5) + '=' + cAlphaArgs(5)); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(5) + '=' + DataIPShortCuts::cAlphaArgs(5)); ErrorsFound = true; } @@ -383,52 +359,52 @@ namespace ChillerReformulatedEIR { CurveManager::PerfCurve(ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR).NumDims == 3) { ElecReformEIRChiller(EIRChillerNum).PartLoadCurveType = PLR_Lift; } else { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + cAlphaFieldNames(5) + '=' + cAlphaArgs(5) + " for " + cAlphaFieldNames(4) + '=' + cAlphaArgs(4)); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(5) + '=' + DataIPShortCuts::cAlphaArgs(5) + " for " + DataIPShortCuts::cAlphaFieldNames(4) + '=' + DataIPShortCuts::cAlphaArgs(4)); ErrorsFound = true; } // Chilled water inlet/outlet node names are necessary - if (lAlphaFieldBlanks(6)) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError(cAlphaFieldNames(6) + " is blank."); + if (DataIPShortCuts::lAlphaFieldBlanks(6)) { + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError(DataIPShortCuts::cAlphaFieldNames(6) + " is blank."); ErrorsFound = true; } - if (lAlphaFieldBlanks(7)) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError(cAlphaFieldNames(7) + " is blank."); + if (DataIPShortCuts::lAlphaFieldBlanks(7)) { + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError(DataIPShortCuts::cAlphaFieldNames(7) + " is blank."); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).EvapInletNodeNum = GetOnlySingleNode( - cAlphaArgs(6), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); - ElecReformEIRChiller(EIRChillerNum).EvapOutletNodeNum = GetOnlySingleNode( - cAlphaArgs(7), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 1, DataLoopNode::ObjectIsNotParent); - TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(6), cAlphaArgs(7), "Chilled Water Nodes"); + ElecReformEIRChiller(EIRChillerNum).EvapInletNodeNum = NodeInputManager::GetOnlySingleNode( + DataIPShortCuts::cAlphaArgs(6), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); + ElecReformEIRChiller(EIRChillerNum).EvapOutletNodeNum = NodeInputManager::GetOnlySingleNode( + DataIPShortCuts::cAlphaArgs(7), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 1, DataLoopNode::ObjectIsNotParent); + BranchNodeConnections::TestCompSet(DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataIPShortCuts::cAlphaArgs(6), DataIPShortCuts::cAlphaArgs(7), "Chilled Water Nodes"); ElecReformEIRChiller(EIRChillerNum).CondenserType = WaterCooled; // Condenser inlet/outlet node names are necessary - if (lAlphaFieldBlanks(8)) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError(cAlphaFieldNames(8) + " is blank."); + if (DataIPShortCuts::lAlphaFieldBlanks(8)) { + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError(DataIPShortCuts::cAlphaFieldNames(8) + " is blank."); ErrorsFound = true; } - if (lAlphaFieldBlanks(9)) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError(cAlphaFieldNames(9) + " is blank."); + if (DataIPShortCuts::lAlphaFieldBlanks(9)) { + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError(DataIPShortCuts::cAlphaFieldNames(9) + " is blank."); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).CondInletNodeNum = GetOnlySingleNode( - cAlphaArgs(8), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 2, DataLoopNode::ObjectIsNotParent); - ElecReformEIRChiller(EIRChillerNum).CondOutletNodeNum = GetOnlySingleNode( - cAlphaArgs(9), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 2, DataLoopNode::ObjectIsNotParent); + ElecReformEIRChiller(EIRChillerNum).CondInletNodeNum = NodeInputManager::GetOnlySingleNode( + DataIPShortCuts::cAlphaArgs(8), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 2, DataLoopNode::ObjectIsNotParent); + ElecReformEIRChiller(EIRChillerNum).CondOutletNodeNum = NodeInputManager::GetOnlySingleNode( + DataIPShortCuts::cAlphaArgs(9), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 2, DataLoopNode::ObjectIsNotParent); - TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(8), cAlphaArgs(9), "Condenser Water Nodes"); + BranchNodeConnections::TestCompSet(DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataIPShortCuts::cAlphaArgs(8), DataIPShortCuts::cAlphaArgs(9), "Condenser Water Nodes"); { - auto const SELECT_CASE_var(cAlphaArgs(10)); + auto const SELECT_CASE_var(DataIPShortCuts::cAlphaArgs(10)); if (SELECT_CASE_var == "CONSTANTFLOW") { ElecReformEIRChiller(EIRChillerNum).FlowMode = ConstantFlow; } else if (SELECT_CASE_var == "LEAVINGSETPOINTMODULATED") { @@ -436,8 +412,8 @@ namespace ChillerReformulatedEIR { } else if (SELECT_CASE_var == "NOTMODULATED") { ElecReformEIRChiller(EIRChillerNum).FlowMode = NotModulated; } else { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\","); - ShowContinueError("Invalid " + cAlphaFieldNames(10) + '=' + cAlphaArgs(10)); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); + ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(10) + '=' + DataIPShortCuts::cAlphaArgs(10)); ShowContinueError("Available choices are ConstantFlow, NotModulated, or LeavingSetpointModulated"); ShowContinueError("Flow mode NotModulated is assumed and the simulation continues."); ElecReformEIRChiller(EIRChillerNum).FlowMode = NotModulated; @@ -445,130 +421,130 @@ namespace ChillerReformulatedEIR { } // Chiller rated performance data - ElecReformEIRChiller(EIRChillerNum).RefCap = rNumericArgs(1); - if (ElecReformEIRChiller(EIRChillerNum).RefCap == AutoSize) { + ElecReformEIRChiller(EIRChillerNum).RefCap = DataIPShortCuts::rNumericArgs(1); + if (ElecReformEIRChiller(EIRChillerNum).RefCap == DataSizing::AutoSize) { ElecReformEIRChiller(EIRChillerNum).RefCapWasAutoSized = true; } - if (rNumericArgs(1) == 0.0) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + cNumericFieldNames(1) + '=' + RoundSigDigits(rNumericArgs(1), 2)); + if (DataIPShortCuts::rNumericArgs(1) == 0.0) { + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError("Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).RefCOP = rNumericArgs(2); - if (rNumericArgs(2) == 0.0) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + cNumericFieldNames(2) + '=' + RoundSigDigits(rNumericArgs(2), 2)); + ElecReformEIRChiller(EIRChillerNum).RefCOP = DataIPShortCuts::rNumericArgs(2); + if (DataIPShortCuts::rNumericArgs(2) == 0.0) { + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError("Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).TempRefEvapOut = rNumericArgs(3); - ElecReformEIRChiller(EIRChillerNum).TempRefCondOut = rNumericArgs(4); + ElecReformEIRChiller(EIRChillerNum).TempRefEvapOut = DataIPShortCuts::rNumericArgs(3); + ElecReformEIRChiller(EIRChillerNum).TempRefCondOut = DataIPShortCuts::rNumericArgs(4); if (ElecReformEIRChiller(EIRChillerNum).TempRefEvapOut >= ElecReformEIRChiller(EIRChillerNum).TempRefCondOut) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError(cNumericFieldNames(3) + " [" + RoundSigDigits(rNumericArgs(3), 2) + "] >= " + cNumericFieldNames(4) + " [" + - RoundSigDigits(rNumericArgs(4), 2) + ']'); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(3) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(3), 2) + "] >= " + DataIPShortCuts::cNumericFieldNames(4) + " [" + + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(4), 2) + ']'); ShowContinueError("Reference Leaving Chilled Water Temperature must be less than Reference Leaving Condenser Water Temperature "); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).EvapVolFlowRate = rNumericArgs(5); - if (ElecReformEIRChiller(EIRChillerNum).EvapVolFlowRate == AutoSize) { + ElecReformEIRChiller(EIRChillerNum).EvapVolFlowRate = DataIPShortCuts::rNumericArgs(5); + if (ElecReformEIRChiller(EIRChillerNum).EvapVolFlowRate == DataSizing::AutoSize) { ElecReformEIRChiller(EIRChillerNum).EvapVolFlowRateWasAutoSized = true; } - ElecReformEIRChiller(EIRChillerNum).CondVolFlowRate = rNumericArgs(6); - if (ElecReformEIRChiller(EIRChillerNum).CondVolFlowRate == AutoSize) { + ElecReformEIRChiller(EIRChillerNum).CondVolFlowRate = DataIPShortCuts::rNumericArgs(6); + if (ElecReformEIRChiller(EIRChillerNum).CondVolFlowRate == DataSizing::AutoSize) { ElecReformEIRChiller(EIRChillerNum).CondVolFlowRateWasAutoSized = true; } - ElecReformEIRChiller(EIRChillerNum).MinPartLoadRat = rNumericArgs(7); - ElecReformEIRChiller(EIRChillerNum).MaxPartLoadRat = rNumericArgs(8); - ElecReformEIRChiller(EIRChillerNum).OptPartLoadRat = rNumericArgs(9); - ElecReformEIRChiller(EIRChillerNum).MinUnloadRat = rNumericArgs(10); - ElecReformEIRChiller(EIRChillerNum).SizFac = rNumericArgs(14); + ElecReformEIRChiller(EIRChillerNum).MinPartLoadRat = DataIPShortCuts::rNumericArgs(7); + ElecReformEIRChiller(EIRChillerNum).MaxPartLoadRat = DataIPShortCuts::rNumericArgs(8); + ElecReformEIRChiller(EIRChillerNum).OptPartLoadRat = DataIPShortCuts::rNumericArgs(9); + ElecReformEIRChiller(EIRChillerNum).MinUnloadRat = DataIPShortCuts::rNumericArgs(10); + ElecReformEIRChiller(EIRChillerNum).SizFac = DataIPShortCuts::rNumericArgs(14); if (ElecReformEIRChiller(EIRChillerNum).SizFac <= 0.0) ElecReformEIRChiller(EIRChillerNum).SizFac = 1.0; if (ElecReformEIRChiller(EIRChillerNum).MinPartLoadRat > ElecReformEIRChiller(EIRChillerNum).MaxPartLoadRat) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError(cNumericFieldNames(7) + " [" + RoundSigDigits(rNumericArgs(7), 3) + "] > " + cNumericFieldNames(8) + " [" + - RoundSigDigits(rNumericArgs(8), 3) + ']'); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(7) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(7), 3) + "] > " + DataIPShortCuts::cNumericFieldNames(8) + " [" + + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(8), 3) + ']'); ShowContinueError("Minimum part load ratio must be less than or equal to the maximum part load ratio "); ErrorsFound = true; } if (ElecReformEIRChiller(EIRChillerNum).MinUnloadRat < ElecReformEIRChiller(EIRChillerNum).MinPartLoadRat || ElecReformEIRChiller(EIRChillerNum).MinUnloadRat > ElecReformEIRChiller(EIRChillerNum).MaxPartLoadRat) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError(cNumericFieldNames(10) + " = " + RoundSigDigits(rNumericArgs(10), 3)); - ShowContinueError(cNumericFieldNames(10) + " must be greater than or equal to the " + cNumericFieldNames(7)); - ShowContinueError(cNumericFieldNames(10) + " must be less than or equal to the " + cNumericFieldNames(8)); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(10) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(10), 3)); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(10) + " must be greater than or equal to the " + DataIPShortCuts::cNumericFieldNames(7)); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(10) + " must be less than or equal to the " + DataIPShortCuts::cNumericFieldNames(8)); ErrorsFound = true; } if (ElecReformEIRChiller(EIRChillerNum).OptPartLoadRat < ElecReformEIRChiller(EIRChillerNum).MinPartLoadRat || ElecReformEIRChiller(EIRChillerNum).OptPartLoadRat > ElecReformEIRChiller(EIRChillerNum).MaxPartLoadRat) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError(cNumericFieldNames(9) + " = " + RoundSigDigits(rNumericArgs(9), 3)); - ShowContinueError(cNumericFieldNames(9) + " must be greater than or equal to the " + cNumericFieldNames(7)); - ShowContinueError(cNumericFieldNames(9) + " must be less than or equal to the " + cNumericFieldNames(8)); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(9) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(9), 3)); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(9) + " must be greater than or equal to the " + DataIPShortCuts::cNumericFieldNames(7)); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(9) + " must be less than or equal to the " + DataIPShortCuts::cNumericFieldNames(8)); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).CompPowerToCondenserFrac = rNumericArgs(11); + ElecReformEIRChiller(EIRChillerNum).CompPowerToCondenserFrac = DataIPShortCuts::rNumericArgs(11); if (ElecReformEIRChiller(EIRChillerNum).CompPowerToCondenserFrac < 0.0 || ElecReformEIRChiller(EIRChillerNum).CompPowerToCondenserFrac > 1.0) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError(cNumericFieldNames(11) + " = " + RoundSigDigits(rNumericArgs(11), 3)); - ShowContinueError(cNumericFieldNames(11) + " must be greater than or equal to zero"); - ShowContinueError(cNumericFieldNames(11) + " must be less than or equal to one"); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(11) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(11), 3)); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(11) + " must be greater than or equal to zero"); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(11) + " must be less than or equal to one"); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).TempLowLimitEvapOut = rNumericArgs(12); + ElecReformEIRChiller(EIRChillerNum).TempLowLimitEvapOut = DataIPShortCuts::rNumericArgs(12); // These are the optional heat recovery inputs - ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate = rNumericArgs(13); - if (ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate == AutoSize) { + ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate = DataIPShortCuts::rNumericArgs(13); + if (ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate == DataSizing::AutoSize) { ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRateWasAutoSized = true; } if ((ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate > 0.0) || - (ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate == AutoSize)) { + (ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate == DataSizing::AutoSize)) { ElecReformEIRChiller(EIRChillerNum).HeatRecActive = true; - ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum = GetOnlySingleNode( - cAlphaArgs(11), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 3, DataLoopNode::ObjectIsNotParent); + ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum = NodeInputManager::GetOnlySingleNode( + DataIPShortCuts::cAlphaArgs(11), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 3, DataLoopNode::ObjectIsNotParent); if (ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum == 0) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + cAlphaFieldNames(11) + '=' + cAlphaArgs(11)); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(11) + '=' + DataIPShortCuts::cAlphaArgs(11)); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).HeatRecOutletNodeNum = GetOnlySingleNode(cAlphaArgs(12), + ElecReformEIRChiller(EIRChillerNum).HeatRecOutletNodeNum = NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(12), ErrorsFound, - cCurrentModuleObject, - cAlphaArgs(1), + DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 3, DataLoopNode::ObjectIsNotParent); if (ElecReformEIRChiller(EIRChillerNum).HeatRecOutletNodeNum == 0) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + cAlphaFieldNames(12) + '=' + cAlphaArgs(12)); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(12) + '=' + DataIPShortCuts::cAlphaArgs(12)); ErrorsFound = true; } if (ElecReformEIRChiller(EIRChillerNum).CondenserType != WaterCooled) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError("Heat Recovery requires a Water Cooled Condenser."); ErrorsFound = true; } - TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(11), cAlphaArgs(12), "Heat Recovery Nodes"); + BranchNodeConnections::TestCompSet(DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataIPShortCuts::cAlphaArgs(11), DataIPShortCuts::cAlphaArgs(12), "Heat Recovery Nodes"); if (ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate > 0.0) { - RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum, + PlantUtilities::RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum, ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate); } if (NumNums > 14) { - if (!lNumericFieldBlanks(15)) { - ElecReformEIRChiller(EIRChillerNum).HeatRecCapacityFraction = rNumericArgs(15); + if (!DataIPShortCuts::lNumericFieldBlanks(15)) { + ElecReformEIRChiller(EIRChillerNum).HeatRecCapacityFraction = DataIPShortCuts::rNumericArgs(15); } else { ElecReformEIRChiller(EIRChillerNum).HeatRecCapacityFraction = 1.0; } @@ -577,11 +553,11 @@ namespace ChillerReformulatedEIR { } if (NumAlphas > 12) { - if (!lAlphaFieldBlanks(13)) { - ElecReformEIRChiller(EIRChillerNum).HeatRecInletLimitSchedNum = GetScheduleIndex(cAlphaArgs(13)); + if (!DataIPShortCuts::lAlphaFieldBlanks(13)) { + ElecReformEIRChiller(EIRChillerNum).HeatRecInletLimitSchedNum = ScheduleManager::GetScheduleIndex(DataIPShortCuts::cAlphaArgs(13)); if (ElecReformEIRChiller(EIRChillerNum).HeatRecInletLimitSchedNum == 0) { - ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + cAlphaFieldNames(13) + '=' + cAlphaArgs(13)); + ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); + ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(13) + '=' + DataIPShortCuts::cAlphaArgs(13)); ErrorsFound = true; } } else { @@ -592,11 +568,11 @@ namespace ChillerReformulatedEIR { } if (NumAlphas > 13) { - if (!lAlphaFieldBlanks(14)) { - ElecReformEIRChiller(EIRChillerNum).HeatRecSetPointNodeNum = GetOnlySingleNode(cAlphaArgs(14), + if (!DataIPShortCuts::lAlphaFieldBlanks(14)) { + ElecReformEIRChiller(EIRChillerNum).HeatRecSetPointNodeNum = NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(14), ErrorsFound, - cCurrentModuleObject, - cAlphaArgs(1), + DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Sensor, 1, @@ -613,22 +589,22 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).DesignHeatRecMassFlowRate = 0.0; ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum = 0; ElecReformEIRChiller(EIRChillerNum).HeatRecOutletNodeNum = 0; - if ((!lAlphaFieldBlanks(11)) || (!lAlphaFieldBlanks(12))) { - ShowWarningError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); + if ((!DataIPShortCuts::lAlphaFieldBlanks(11)) || (!DataIPShortCuts::lAlphaFieldBlanks(12))) { + ShowWarningError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowWarningError("Since Reference Heat Reclaim Volume Flow Rate = 0.0, heat recovery is inactive."); ShowContinueError("However, node names were specified for heat recovery inlet or outlet nodes."); } } if (NumAlphas > 14) { - ElecReformEIRChiller(EIRChillerNum).EndUseSubcategory = cAlphaArgs(15); + ElecReformEIRChiller(EIRChillerNum).EndUseSubcategory = DataIPShortCuts::cAlphaArgs(15); } else { ElecReformEIRChiller(EIRChillerNum).EndUseSubcategory = "General"; } } if (ErrorsFound) { - ShowFatalError("Errors found in processing input for " + cCurrentModuleObject); + ShowFatalError("Errors found in processing input for " + DataIPShortCuts::cCurrentModuleObject); } for (EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { @@ -842,15 +818,6 @@ namespace ChillerReformulatedEIR { // METHODOLOGY EMPLOYED: // Uses the status flags to trigger initializations. - using DataEnvironment::StdBaroPress; - using EMSManager::CheckIfNodeSetPointManagedByEMS; - using EMSManager::iTemperatureSetPoint; - using PlantUtilities::InitComponentNodes; - using PlantUtilities::InterConnectTwoPlantLoopSides; - using PlantUtilities::ScanPlantLoopsForObject; - using PlantUtilities::SetComponentFlowRate; - using ScheduleManager::GetCurrentScheduleValue; - static std::string const RoutineName("InitElecReformEIRChiller"); static bool MyOneTimeFlag(true); // One time logic flag for allocating MyEnvrnFlag array static Array1D_bool MyFlag; @@ -897,7 +864,7 @@ namespace ChillerReformulatedEIR { if (MyFlag(EIRChillNum)) { // Locate the chillers on the plant loops for later usage errFlag = false; - ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, + PlantUtilities::ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, @@ -910,7 +877,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, _); if (ElecReformEIRChiller(EIRChillNum).CondenserType != AirCooled) { - ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, + PlantUtilities::ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, @@ -922,7 +889,7 @@ namespace ChillerReformulatedEIR { _, ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, _); - InterConnectTwoPlantLoopSides(ElecReformEIRChiller(EIRChillNum).CWLoopNum, + PlantUtilities::InterConnectTwoPlantLoopSides(ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, @@ -930,7 +897,7 @@ namespace ChillerReformulatedEIR { true); } if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, + PlantUtilities::ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).HRLoopNum, ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, @@ -942,7 +909,7 @@ namespace ChillerReformulatedEIR { _, ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, _); - InterConnectTwoPlantLoopSides(ElecReformEIRChiller(EIRChillNum).CWLoopNum, + PlantUtilities::InterConnectTwoPlantLoopSides(ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).HRLoopNum, ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, @@ -951,7 +918,7 @@ namespace ChillerReformulatedEIR { } if ((ElecReformEIRChiller(EIRChillNum).CondenserType != AirCooled) && (ElecReformEIRChiller(EIRChillNum).HeatRecActive)) { - InterConnectTwoPlantLoopSides(ElecReformEIRChiller(EIRChillNum).CDLoopNum, + PlantUtilities::InterConnectTwoPlantLoopSides(ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, ElecReformEIRChiller(EIRChillNum).HRLoopNum, ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, @@ -994,7 +961,7 @@ namespace ChillerReformulatedEIR { } else { // need call to EMS to check node FatalError = false; // but not really fatal yet, but should be. - CheckIfNodeSetPointManagedByEMS(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, iTemperatureSetPoint, FatalError); + EMSManager::CheckIfNodeSetPointManagedByEMS(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, EMSManager::iTemperatureSetPoint, FatalError); if (FatalError) { if (!ElecReformEIRChiller(EIRChillNum).ModulatedFlowErrDone) { ShowWarningError("Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + @@ -1020,14 +987,14 @@ namespace ChillerReformulatedEIR { if (MyEnvrnFlag(EIRChillNum) && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { - rho = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate * rho; - InitComponentNodes(0.0, + PlantUtilities::InitComponentNodes(0.0, ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax, EvapInletNode, EvapOutletNode, @@ -1038,12 +1005,12 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { - rho = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondIn, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax = rho * ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; - InitComponentNodes(0.0, + PlantUtilities::InitComponentNodes(0.0, ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax, CondInletNode, CondOutletNode, @@ -1055,7 +1022,7 @@ namespace ChillerReformulatedEIR { } else { // air or evap air condenser // Initialize maximum available condenser flow rate DataLoopNode::Node(CondInletNode).MassFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate * - PsyRhoAirFnPbTdbW(StdBaroPress, ElecReformEIRChiller(EIRChillNum).TempRefCondIn, 0.0, RoutineName); + Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::StdBaroPress, ElecReformEIRChiller(EIRChillNum).TempRefCondIn, 0.0, RoutineName); DataLoopNode::Node(CondOutletNode).MassFlowRate = DataLoopNode::Node(CondInletNode).MassFlowRate; DataLoopNode::Node(CondInletNode).MassFlowRateMaxAvail = DataLoopNode::Node(CondInletNode).MassFlowRate; DataLoopNode::Node(CondInletNode).MassFlowRateMax = DataLoopNode::Node(CondInletNode).MassFlowRate; @@ -1068,12 +1035,12 @@ namespace ChillerReformulatedEIR { } if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - rho = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, DataGlobals::HWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidIndex, RoutineName); ElecReformEIRChiller(EIRChillNum).DesignHeatRecMassFlowRate = rho * ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; - InitComponentNodes(0.0, + PlantUtilities::InitComponentNodes(0.0, ElecReformEIRChiller(EIRChillNum).DesignHeatRecMassFlowRate, ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, ElecReformEIRChiller(EIRChillNum).HeatRecOutletNodeNum, @@ -1110,7 +1077,7 @@ namespace ChillerReformulatedEIR { mdotCond = 0.0; } - SetComponentFlowRate(mdot, + PlantUtilities::SetComponentFlowRate(mdot, EvapInletNode, EvapOutletNode, ElecReformEIRChiller(EIRChillNum).CWLoopNum, @@ -1119,7 +1086,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CWCompNum); if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { - SetComponentFlowRate(mdotCond, + PlantUtilities::SetComponentFlowRate(mdotCond, CondInletNode, CondOutletNode, ElecReformEIRChiller(EIRChillNum).CDLoopNum, @@ -1136,7 +1103,7 @@ namespace ChillerReformulatedEIR { // check if inlet limit active and if exceeded. if (ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum > 0) { - HeatRecHighInletLimit = GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); + HeatRecHighInletLimit = ScheduleManager::GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); if (DataLoopNode::Node(HeatRecInNode).Temp > HeatRecHighInletLimit) { // shut down heat recovery HeatRecRunFlag = false; } else { @@ -1152,7 +1119,7 @@ namespace ChillerReformulatedEIR { mdot = 0.0; } - SetComponentFlowRate(mdot, HeatRecInNode, HeatRecOutNode, LoopNum, LoopSideNum, BranchIndex, CompIndex); + PlantUtilities::SetComponentFlowRate(mdot, HeatRecInNode, HeatRecOutNode, LoopNum, LoopSideNum, BranchIndex, CompIndex); } } @@ -1175,14 +1142,6 @@ namespace ChillerReformulatedEIR { // the evaporator flow rate and the chilled water loop design delta T. The condenser flow rate // is calculated from the reference capacity, the COP, and the condenser loop design delta T. - using namespace DataSizing; - using CurveManager::CurveValue; - using CurveManager::GetCurveMinMaxValues; - using PlantUtilities::RegisterPlantCompDesignFlow; - using ReportSizingManager::ReportSizingOutput; - using namespace OutputReportPredefined; - using StandardRatings::CalcChillerIPLV; - static std::string const RoutineName("SizeElecReformEIRChiller"); int PltSizNum(0); // Plant Sizing index corresponding to CurLoopNum @@ -1240,8 +1199,8 @@ namespace ChillerReformulatedEIR { PltSizNum = DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).PlantSizNum; if (PltSizNum > 0) { - if (PlantSizData(PltSizNum).DesVolFlowRate >= SmallWaterVolFlow) { - tmpEvapVolFlowRate = PlantSizData(PltSizNum).DesVolFlowRate * ElecReformEIRChiller(EIRChillNum).SizFac; + if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + tmpEvapVolFlowRate = DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * ElecReformEIRChiller(EIRChillNum).SizFac; } else { if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } @@ -1249,13 +1208,13 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized) { ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate = tmpEvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Initial Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); @@ -1264,20 +1223,20 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { EvapVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate, "User-Specified Reference Chilled Water Flow Rate [m3/s]", EvapVolFlowRateUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > AutoVsHardSizingThreshold) { + if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + ElecReformEIRChiller(EIRChillNum).Name); ShowContinueError("User-Specified Reference Chilled Water Flow Rate of " + - RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); + General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Reference Chilled Water Flow Rate of " + - RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1295,34 +1254,34 @@ namespace ChillerReformulatedEIR { } if (!ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate > 0.0)) { // Hard-size with sizing data - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "User-Specified Reference Chilled Water Flow Rate [m3/s]", ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate); } } - RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, tmpEvapVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, tmpEvapVolFlowRate); if (PltSizNum > 0) { - if (PlantSizData(PltSizNum).DesVolFlowRate >= SmallWaterVolFlow) { + if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { if (PltSizCondNum > 0 && PltSizNum > 0) { - SizingEvapOutletTemp = PlantSizData(PltSizNum).ExitTemp; - SizingCondOutletTemp = PlantSizData(PltSizCondNum).ExitTemp + PlantSizData(PltSizCondNum).DeltaT; + SizingEvapOutletTemp = DataSizing::PlantSizData(PltSizNum).ExitTemp; + SizingCondOutletTemp = DataSizing::PlantSizData(PltSizCondNum).ExitTemp + DataSizing::PlantSizData(PltSizCondNum).DeltaT; } else { SizingEvapOutletTemp = ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; SizingCondOutletTemp = ElecReformEIRChiller(EIRChillNum).TempRefCondOut; } - Cp = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); - rho = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); - RefCapFT = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, SizingEvapOutletTemp, SizingCondOutletTemp); - tmpNomCap = (Cp * rho * PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate) / RefCapFT; + RefCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, SizingEvapOutletTemp, SizingCondOutletTemp); + tmpNomCap = (Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate) / RefCapFT; } else { if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized) tmpNomCap = 0.0; } @@ -1330,13 +1289,13 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized) { ElecReformEIRChiller(EIRChillNum).RefCap = tmpNomCap; if (DataPlant::PlantFinalSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Capacity [W]", tmpNomCap); } if (DataPlant::PlantFirstSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Initial Design Size Reference Capacity [W]", tmpNomCap); @@ -1345,18 +1304,18 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0 && tmpNomCap > 0.0) { RefCapUser = ElecReformEIRChiller(EIRChillNum).RefCap; if (DataPlant::PlantFinalSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Capacity [W]", tmpNomCap, "User-Specified Reference Capacity [W]", RefCapUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpNomCap - RefCapUser) / RefCapUser) > AutoVsHardSizingThreshold) { + if ((std::abs(tmpNomCap - RefCapUser) / RefCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + ElecReformEIRChiller(EIRChillNum).Name); - ShowContinueError("User-Specified Reference Capacity of " + RoundSigDigits(RefCapUser, 2) + " [W]"); - ShowContinueError("differs from Design Size Reference Capacity of " + RoundSigDigits(tmpNomCap, 2) + " [W]"); + ShowContinueError("User-Specified Reference Capacity of " + General::RoundSigDigits(RefCapUser, 2) + " [W]"); + ShowContinueError("differs from Design Size Reference Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + " [W]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1374,7 +1333,7 @@ namespace ChillerReformulatedEIR { } if (!ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0)) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "User-Specified Reference Capacity [W]", ElecReformEIRChiller(EIRChillNum).RefCap); @@ -1382,19 +1341,19 @@ namespace ChillerReformulatedEIR { } if (PltSizCondNum > 0 && PltSizNum > 0) { - if (PlantSizData(PltSizNum).DesVolFlowRate >= SmallWaterVolFlow && tmpNomCap > 0.0) { - rho = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, DataGlobals::CWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondIn, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + (1.0 / ElecReformEIRChiller(EIRChillNum).RefCOP) * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac) / - (PlantSizData(PltSizCondNum).DeltaT * Cp * rho); + (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); // IF (DataPlant::PlantFirstSizesOkayToFinalize) ElecReformEIRChiller(EIRChillNum)%CondVolFlowRate = tmpCondVolFlowRate } else { if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; @@ -1404,13 +1363,13 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized) { ElecReformEIRChiller(EIRChillNum).CondVolFlowRate = tmpCondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Initial Design Size Reference Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); @@ -1419,20 +1378,20 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { CondVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Reference Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate, "User-Specified Reference Condenser Water Flow Rate [m3/s]", CondVolFlowRateUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > AutoVsHardSizingThreshold) { + if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + ElecReformEIRChiller(EIRChillNum).Name); ShowContinueError("User-Specified Reference Condenser Water Flow Rate of " + - RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); + General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Reference Condenser Water Flow Rate of " + - RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1451,7 +1410,7 @@ namespace ChillerReformulatedEIR { } if (!ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0)) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "User-Specified Reference Condenser Water Flow Rate [m3/s]", ElecReformEIRChiller(EIRChillNum).CondVolFlowRate); @@ -1459,7 +1418,7 @@ namespace ChillerReformulatedEIR { } // save the reference condenser water volumetric flow rate for use by the condenser water loop sizing algorithms - RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, tmpCondVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, tmpCondVolFlowRate); if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { tmpHeatRecVolFlowRate = tmpCondVolFlowRate * ElecReformEIRChiller(EIRChillNum).HeatRecCapacityFraction; @@ -1469,13 +1428,13 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRateWasAutoSized) { ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate = tmpHeatRecVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Initial Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate); @@ -1484,7 +1443,7 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { DesignHeatRecVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { - ReportSizingOutput("Chiller:Electric:ReformulatedEIR", + ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate, @@ -1492,13 +1451,13 @@ namespace ChillerReformulatedEIR { DesignHeatRecVolFlowRateUser); if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpHeatRecVolFlowRate - DesignHeatRecVolFlowRateUser) / DesignHeatRecVolFlowRateUser) > - AutoVsHardSizingThreshold) { + DataSizing::AutoVsHardSizingThreshold) { ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + ElecReformEIRChiller(EIRChillNum).Name); ShowContinueError("User-Specified Design Heat Recovery Fluid Flow Rate of " + - RoundSigDigits(DesignHeatRecVolFlowRateUser, 5) + " [m3/s]"); + General::RoundSigDigits(DesignHeatRecVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Heat Recovery Fluid Flow Rate of " + - RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); + General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1509,13 +1468,13 @@ namespace ChillerReformulatedEIR { } } // save the reference heat recovery fluid volumetric flow rate - RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, tmpHeatRecVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, tmpHeatRecVolFlowRate); } if (DataPlant::PlantFinalSizesOkayToReport) { if (MyFlag(EIRChillNum)) { Real64 IPLV; - CalcChillerIPLV(ElecReformEIRChiller(EIRChillNum).Name, + StandardRatings::CalcChillerIPLV(ElecReformEIRChiller(EIRChillNum).Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).RefCap, ElecReformEIRChiller(EIRChillNum).RefCOP, @@ -1532,24 +1491,24 @@ namespace ChillerReformulatedEIR { } // create predefined report equipName = ElecReformEIRChiller(EIRChillNum).Name; - PreDefTableEntry(pdchMechType, equipName, "Chiller:Electric:ReformulatedEIR"); - PreDefTableEntry(pdchMechNomEff, equipName, ElecReformEIRChiller(EIRChillNum).RefCOP); - PreDefTableEntry(pdchMechNomCap, equipName, ElecReformEIRChiller(EIRChillNum).RefCap); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechType, equipName, "Chiller:Electric:ReformulatedEIR"); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomEff, equipName, ElecReformEIRChiller(EIRChillNum).RefCOP); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomCap, equipName, ElecReformEIRChiller(EIRChillNum).RefCap); } // Only check performance curves if Capacity and volumetric flow rate are greater than 0 if (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0 && ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0) { // Check the CAP-FT, EIR-FT, and PLR curves at reference conditions and warn user if different from 1.0 by more than +-10% if (ElecReformEIRChiller(EIRChillNum).ChillerCapFT > 0) { - CurveVal = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, + CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, ElecReformEIRChiller(EIRChillNum).TempRefEvapOut, ElecReformEIRChiller(EIRChillNum).TempRefCondOut); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError("Capacity ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError("(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); - ShowContinueError("Curve output at reference conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError("Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); } - GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMax, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin, @@ -1557,15 +1516,15 @@ namespace ChillerReformulatedEIR { } if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFT > 0) { - CurveVal = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, + CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, ElecReformEIRChiller(EIRChillNum).TempRefEvapOut, ElecReformEIRChiller(EIRChillNum).TempRefCondOut); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError("Energy input ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError("(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); - ShowContinueError("Curve output at reference conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError("Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); } - GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin, @@ -1574,24 +1533,24 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR > 0) { if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - CurveVal = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, 1.0); + CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, 1.0); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { - CurveVal = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, 1.0, 1.0, 0.0); // zrp_Aug2014 + CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, 1.0, 1.0, 0.0); // zrp_Aug2014 } if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError("Energy input ratio as a function of part-load ratio curve output is not equal to 1.0"); ShowContinueError("(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); - ShowContinueError("Curve output at reference conditions = " + TrimSigDigits(CurveVal, 3)); + ShowContinueError("Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); } if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 - GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMin, ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, @@ -1603,7 +1562,7 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin < 0 || ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin >= ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax || ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin > 1) { - ShowSevereError("Invalid minimum value of PLR = " + TrimSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, 3) + + ShowSevereError("Invalid minimum value of PLR = " + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, 3) + " in bicubic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFPLRName + " which is used"); ShowContinueError("by Chiller:Electric:ReformulatedEIR = " + equipName + '.'); ShowContinueError("The minimum value of PLR [y] must be from zero to 1, and less than the maximum value of PLR."); @@ -1612,7 +1571,7 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax > 1.1 || ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax <= ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin || ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax < 0) { - ShowSevereError("Invalid maximum value of PLR = " + TrimSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax, 3) + + ShowSevereError("Invalid maximum value of PLR = " + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax, 3) + " in bicubic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFPLRName + " which is used"); ShowContinueError("by Chiller:Electric:ReformulatedEIR = " + equipName + '.'); ShowContinueError("The maximum value of PLR [y] must be from zero to 1.1, and greater than the minimum value of PLR."); @@ -1622,12 +1581,12 @@ namespace ChillerReformulatedEIR { } // Initialize condenser reference inlet temperature (not a user input) - Density = GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Density = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); - SpecificHeat = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + SpecificHeat = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); @@ -1650,10 +1609,10 @@ namespace ChillerReformulatedEIR { CondTemp = min(CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax); CondTemp = max(CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin); if (PLRTemp < ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin) { - CurveValTmp = CurveValue( + CurveValTmp = CurveManager::CurveValue( ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin); } else { - CurveValTmp = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, CondTemp, PLRTemp); + CurveValTmp = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, CondTemp, PLRTemp); } if (CurveValTmp < 0.0) FoundNegValue = true; CurveValArray(CurveCheck + 1) = int(CurveValTmp * 100.0) / 100.0; @@ -1684,24 +1643,24 @@ namespace ChillerReformulatedEIR { } } } else { // just get curve min/max values if capacity or cond volume flow rate = 0 - GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMax, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax); - GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax); if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 - GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMin, ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, @@ -1735,18 +1694,15 @@ namespace ChillerReformulatedEIR { // METHODOLOGY EMPLOYED: // Use empirical curve fits to model performance at off-design conditions. This subroutine - // calls Subroutines CalcReformEIRChillerModel and SolveRoot to obtain solution. + // calls Subroutines CalcReformEIRChillerModel and General::SolveRoot to obtain solution. // The actual chiller performance calculations are in Subroutine CalcReformEIRChillerModel. // REFERENCES: // 1. Hydeman, M., P. Sreedharan, N. Webb, and S. Blanc. 2002. "Development and Testing of a Reformulated // Regression-Based Electric Chiller Model". ASHRAE Transactions, HI-02-18-2, Vol 108, Part 2, pp. 1118-1127. - using CurveManager::GetCurveMinMaxValues; - using General::SolveRoot; - - Real64 const Acc(0.0001); // Accuracy control for SolveRoot - int const MaxIter(500); // Iteration control for SolveRoot + Real64 const Acc(0.0001); // Accuracy control for General::SolveRoot + int const MaxIter(500); // Iteration control for General::SolveRoot Real64 CAPFTYTmin; // Minimum condenser leaving temperature allowed by CAPFT curve [C] Real64 CAPFTYTmax; // Maximum condenser leaving temperature allowed by CAPFT curve [C] @@ -1758,7 +1714,7 @@ namespace ChillerReformulatedEIR { Real64 Tmax(-99); // Maximum condenser leaving temperature allowed by curve objects [C] Array1D Par(6); // Pass parameters for RegulaFalsi solver Real64 FalsiCondOutTemp; // RegulaFalsi condenser outlet temperature result [C] - int SolFla; // Feedback flag from SolveRoot + int SolFla; // Feedback flag from General::SolveRoot Real64 CondTempMin; // Condenser outlet temperature when using Tmin as input to CalcReformEIRChillerModel [C] Real64 CondTempMax; // Condenser outlet temperature when using Tmax as input to CalcReformEIRChillerModel [C] @@ -1810,7 +1766,7 @@ namespace ChillerReformulatedEIR { // Par(5) = FlowLock !DSU Par(6) = EquipFlowCtrl; - SolveRoot(Acc, MaxIter, SolFla, FalsiCondOutTemp, CondOutTempResidual, Tmin, Tmax, Par); + General::SolveRoot(Acc, MaxIter, SolFla, FalsiCondOutTemp, CondOutTempResidual, Tmin, Tmax, Par); if (SolFla == -1) { if (!DataGlobals::WarmupFlag) { @@ -1872,15 +1828,10 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // Calculate the heat recovered from the chiller condenser - - using ScheduleManager::GetCurrentScheduleValue; - + static std::string const RoutineName("EIRChillerHeatRecovery"); - int CondInletNode; // Condenser inlet node number - int CondOutletNode; // Condenser outlet node number int HeatRecInNode; // Node number for heat recovery water inlet node - int HeatRecOutNode; // Node number for heat recovery water outlet node Real64 QTotal; // Total condenser heat [W] Real64 HeatRecInletTemp; // Heat reclaim inlet temp [C] Real64 HeatRecMassFlowRate; // Heat reclaim mass flow rate [m3/s] @@ -1894,19 +1845,16 @@ namespace ChillerReformulatedEIR { // Begin routine HeatRecInNode = ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum; - HeatRecOutNode = ElecReformEIRChiller(EIRChillNum).HeatRecOutletNodeNum; - CondInletNode = ElecReformEIRChiller(EIRChillNum).CondInletNodeNum; - CondOutletNode = ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum; // inlet node to the heat recovery heat exchanger HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; HeatRecMassFlowRate = DataLoopNode::Node(HeatRecInNode).MassFlowRate; - CpHeatRec = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, + CpHeatRec = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, HeatRecInletTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidIndex, RoutineName); - CpCond = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + CpCond = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); @@ -1946,7 +1894,7 @@ namespace ChillerReformulatedEIR { // check if limit on inlet is present and exceeded. if (ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum > 0) { - HeatRecHighInletLimit = GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); + HeatRecHighInletLimit = ScheduleManager::GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); if (HeatRecInletTemp > HeatRecHighInletLimit) { // shut down heat recovery QHeatRec = 0.0; } @@ -1974,9 +1922,6 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // Reporting - using DataHVACGlobals::TimeStepSys; - using PlantUtilities::SafeCopyPlantNode; - int EvapInletNode; // Evaporator inlet node number int EvapOutletNode; // Evaporator outlet node number int CondInletNode; // Condenser inlet node number @@ -2016,7 +1961,7 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(Num).HeatRecActive) { - SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); + PlantUtilities::SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); ElecReformEIRChillerReport(Num).QHeatRecovery = 0.0; ElecReformEIRChillerReport(Num).EnergyHeatRecovery = 0.0; ElecReformEIRChillerReport(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; @@ -2035,13 +1980,13 @@ namespace ChillerReformulatedEIR { ElecReformEIRChillerReport(Num).ChillerPartLoadRatio = ChillerPartLoadRatio; ElecReformEIRChillerReport(Num).ChillerCyclingRatio = ChillerCyclingRatio; ElecReformEIRChillerReport(Num).ChillerFalseLoadRate = ChillerFalseLoadRate; - ElecReformEIRChillerReport(Num).ChillerFalseLoad = ChillerFalseLoadRate * TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).ChillerFalseLoad = ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; ElecReformEIRChillerReport(Num).Power = Power; ElecReformEIRChillerReport(Num).QEvap = QEvaporator; ElecReformEIRChillerReport(Num).QCond = QCondenser; - ElecReformEIRChillerReport(Num).Energy = Power * TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChillerReport(Num).EvapEnergy = QEvaporator * TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChillerReport(Num).CondEnergy = QCondenser * TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).Energy = Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).EvapEnergy = QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).CondEnergy = QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; ElecReformEIRChillerReport(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; ElecReformEIRChillerReport(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; ElecReformEIRChillerReport(Num).CondOutletTemp = DataLoopNode::Node(CondOutletNode).Temp; @@ -2056,9 +2001,9 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(Num).HeatRecActive) { - SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); + PlantUtilities::SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); ElecReformEIRChillerReport(Num).QHeatRecovery = QHeatRecovered; - ElecReformEIRChillerReport(Num).EnergyHeatRecovery = QHeatRecovered * TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).EnergyHeatRecovery = QHeatRecovered * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; DataLoopNode::Node(HeatRecOutNode).Temp = HeatRecOutletTemp; ElecReformEIRChillerReport(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; ElecReformEIRChillerReport(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; @@ -2145,20 +2090,6 @@ namespace ChillerReformulatedEIR { // 1. Hydeman, M., P. Sreedharan, N. Webb, and S. Blanc. 2002. "Development and Testing of a Reformulated // Regression-Based Electric Chiller Model". ASHRAE Transactions, HI-02-18-2, Vol 108, Part 2, pp. 1118-1127. - using CurveManager::CurveValue; - using DataBranchAirLoopPlant::ControlType_SeriesActive; - using DataBranchAirLoopPlant::MassFlowTolerance; - using DataEnvironment::CurMnDy; - using DataEnvironment::EnvironmentName; - using DataHVACGlobals::SmallLoad; - using DataHVACGlobals::TimeStepSys; - using FaultsManager::FaultsChillerFouling; - using FaultsManager::FaultsChillerSWTSensor; - using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; - using PlantUtilities::PullCompInterconnectTrigger; - using PlantUtilities::SetComponentFlowRate; - static ObjexxFCL::gio::Fmt OutputFormat("(F6.2)"); static std::string const RoutineName("CalcElecReformEIRChillerModel"); @@ -2228,7 +2159,7 @@ namespace ChillerReformulatedEIR { // if the component control is SERIESACTIVE we set the component flow to inlet flow so that // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { - if (EquipFlowCtrl == ControlType_SeriesActive || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { + if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; } if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { @@ -2236,7 +2167,7 @@ namespace ChillerReformulatedEIR { .LoopSide(ElecReformEIRChiller(EIRChillNum).CDLoopSideNum) .Branch(ElecReformEIRChiller(EIRChillNum).CDBranchNum) .Comp(ElecReformEIRChiller(EIRChillNum).CDCompNum) - .FlowCtrl == ControlType_SeriesActive) { + .FlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive) { CondMassFlowRate = DataLoopNode::Node(CondInletNode).MassFlowRate; } } @@ -2255,14 +2186,14 @@ namespace ChillerReformulatedEIR { EvapMassFlowRateMax = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax; PartLoadCurveType = ElecReformEIRChiller(EIRChillNum).PartLoadCurveType; // zrp_Aug2014 - // If there is a fault of chiller fouling (zrp_Nov2016) + // If there is a fault of chiller fouling if (ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingIndex; Real64 NomCap_ff = ChillerRefCap; Real64 ReferenceCOP_ff = ReferenceCOP; // calculate the Faulty Chiller Fouling Factor using fault information - ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFactor = FaultsChillerFouling(FaultIndex).CalFoulingFactor(); + ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFactor = FaultsManager::FaultsChillerFouling(FaultIndex).CalFoulingFactor(); // update the Chiller nominal capacity and COP at faulty cases ChillerRefCap = NomCap_ff * ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFactor; @@ -2273,14 +2204,14 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { CondMassFlowRate = ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax; - SetComponentFlowRate(CondMassFlowRate, + PlantUtilities::SetComponentFlowRate(CondMassFlowRate, CondInletNode, CondOutletNode, ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, ElecReformEIRChiller(EIRChillNum).CDBranchNum, ElecReformEIRChiller(EIRChillNum).CDCompNum); - PullCompInterconnectTrigger(ElecReformEIRChiller(EIRChillNum).CWLoopNum, + PlantUtilities::PullCompInterconnectTrigger(ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CWBranchNum, ElecReformEIRChiller(EIRChillNum).CWCompNum, @@ -2290,7 +2221,7 @@ namespace ChillerReformulatedEIR { DataPlant::CriteriaType_MassFlowRate, CondMassFlowRate); - if (CondMassFlowRate < MassFlowTolerance) return; + if (CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; } FRAC = 1.0; @@ -2325,7 +2256,7 @@ namespace ChillerReformulatedEIR { Real64 EvapOutletTempSetPoint_ff = EvapOutletTempSetPoint; // calculate the sensor offset using fault information - ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset = FaultsChillerSWTSensor(FaultIndex).CalFaultOffsetAct(); + ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset = FaultsManager::FaultsChillerSWTSensor(FaultIndex).CalFaultOffsetAct(); // update the EvapOutletTempSetPoint EvapOutletTempSetPoint = max(ElecReformEIRChiller(EIRChillNum).TempLowLimitEvapOut, @@ -2349,7 +2280,7 @@ namespace ChillerReformulatedEIR { } // Get capacity curve info with respect to CW setpoint and leaving condenser water temps - ChillerCapFT = max(0.0, CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, EvapOutletTempSetPoint, AvgCondSinkTemp)); + ChillerCapFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, EvapOutletTempSetPoint, AvgCondSinkTemp)); // Available chiller capacity as a function of temperature AvailChillerCap = ChillerRefCap * ChillerCapFT; @@ -2364,7 +2295,7 @@ namespace ChillerReformulatedEIR { // This chiller is currently has only a water-cooled condenser // Calculate water side load - Cp = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataLoopNode::Node(EvapInletNode).Temp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); @@ -2401,8 +2332,8 @@ namespace ChillerReformulatedEIR { // Set the evaporator mass flow rate to design // Start by assuming max (design) flow EvapMassFlowRate = EvapMassFlowRateMax; - // Use SetComponentFlowRate to decide actual flow - SetComponentFlowRate(EvapMassFlowRate, + // Use PlantUtilities::SetComponentFlowRate to decide actual flow + PlantUtilities::SetComponentFlowRate(EvapMassFlowRate, EvapInletNode, EvapOutletNode, ElecReformEIRChiller(EIRChillNum).CWLoopNum, @@ -2430,11 +2361,11 @@ namespace ChillerReformulatedEIR { if (EvapDeltaTemp != 0) { EvapMassFlowRate = max(0.0, (QEvaporator / Cp / EvapDeltaTemp)); - if ((EvapMassFlowRate - EvapMassFlowRateMax) > MassFlowTolerance) ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = true; + if ((EvapMassFlowRate - EvapMassFlowRateMax) > DataBranchAirLoopPlant::MassFlowTolerance) ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = true; // Check to see if the Maximum is exceeded, if so set to maximum EvapMassFlowRate = min(EvapMassFlowRateMax, EvapMassFlowRate); - // Use SetComponentFlowRate to decide actual flow - SetComponentFlowRate(EvapMassFlowRate, + // Use PlantUtilities::SetComponentFlowRate to decide actual flow + PlantUtilities::SetComponentFlowRate(EvapMassFlowRate, EvapInletNode, EvapOutletNode, ElecReformEIRChiller(EIRChillNum).CWLoopNum, @@ -2454,8 +2385,8 @@ namespace ChillerReformulatedEIR { } else { // Try to request zero flow EvapMassFlowRate = 0.0; - // Use SetComponentFlowRate to decide actual flow - SetComponentFlowRate(EvapMassFlowRate, + // Use PlantUtilities::SetComponentFlowRate to decide actual flow + PlantUtilities::SetComponentFlowRate(EvapMassFlowRate, EvapInletNode, EvapOutletNode, ElecReformEIRChiller(EIRChillNum).CWLoopNum, @@ -2489,7 +2420,7 @@ namespace ChillerReformulatedEIR { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTIndex; bool VarFlowFlag = (ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated); - FaultsChillerSWTSensor(FaultIndex) + FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset, Cp, @@ -2506,7 +2437,7 @@ namespace ChillerReformulatedEIR { } else { // If FlowLock is True EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; - SetComponentFlowRate(EvapMassFlowRate, + PlantUtilities::SetComponentFlowRate(EvapMassFlowRate, EvapInletNode, EvapOutletNode, ElecReformEIRChiller(EIRChillNum).CWLoopNum, @@ -2551,7 +2482,7 @@ namespace ChillerReformulatedEIR { } // If load exceeds the distributed load set to the distributed load if (QEvaporator > std::abs(MyLoad)) { - if (EvapMassFlowRate > MassFlowTolerance) { + if (EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { QEvaporator = std::abs(MyLoad); EvapDeltaTemp = QEvaporator / EvapMassFlowRate / Cp; EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; @@ -2567,7 +2498,7 @@ namespace ChillerReformulatedEIR { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTIndex; bool VarFlowFlag = false; - FaultsChillerSWTSensor(FaultIndex) + FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset, Cp, @@ -2581,7 +2512,7 @@ namespace ChillerReformulatedEIR { // Checks QEvaporator on the basis of the machine limits. if (QEvaporator > (AvailChillerCap * MaxPartLoadRat)) { - if (EvapMassFlowRate > MassFlowTolerance) { + if (EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { QEvaporator = AvailChillerCap * MaxPartLoadRat; EvapDeltaTemp = QEvaporator / EvapMassFlowRate / Cp; // evaporator outlet temperature is allowed to float upwards (recalculate AvailChillerCap? iterate?) @@ -2616,17 +2547,17 @@ namespace ChillerReformulatedEIR { // calculate the load due to false loading on chiller over and above water side load ChillerFalseLoadRate = (AvailChillerCap * PartLoadRat * FRAC) - QEvaporator; - if (ChillerFalseLoadRate < SmallLoad) { + if (ChillerFalseLoadRate < DataHVACGlobals::SmallLoad) { ChillerFalseLoadRate = 0.0; } } // This is the end of the FlowLock Block - ChillerEIRFT = max(0.0, CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, EvapOutletTemp, AvgCondSinkTemp)); + ChillerEIRFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, EvapOutletTemp, AvgCondSinkTemp)); // Part Load Ratio Curve Type: 1_LeavingCondenserWaterTemperature; 2_Lift zrp_Aug2014 if (PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - ChillerEIRFPLR = max(0.0, CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, AvgCondSinkTemp, PartLoadRat)); + ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, AvgCondSinkTemp, PartLoadRat)); } else if (PartLoadCurveType == PLR_Lift) { ChillerLift = AvgCondSinkTemp - EvapOutletTemp; ChillerTdev = std::abs(EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); @@ -2636,7 +2567,7 @@ namespace ChillerReformulatedEIR { ChillerLiftNom = ChillerLift / ChillerLiftRef; ChillerTdevNom = ChillerTdev / ChillerLiftRef; - ChillerEIRFPLR = max(0.0, CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ChillerLiftNom, PartLoadRat, ChillerTdevNom)); + ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ChillerLiftNom, PartLoadRat, ChillerTdevNom)); } if (ReferenceCOP <= 0) ReferenceCOP = 5.5; @@ -2645,11 +2576,11 @@ namespace ChillerReformulatedEIR { QCondenser = Power * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac + QEvaporator + ChillerFalseLoadRate; // Currently only water cooled chillers are allowed for the reformulated EIR chiller model - if (CondMassFlowRate > MassFlowTolerance) { + if (CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) ReformEIRChillerHeatRecovery(EIRChillNum, QCondenser, CondMassFlowRate, CondInletTemp, QHeatRecovered); - Cp = GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); @@ -2671,10 +2602,6 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // To compare the evaporator/condenser outlet temperatures to curve object min/max values - using CurveManager::CurveValue; - using General::RoundSigDigits; - using General::TrimSigDigits; - int EvapOutletNode; // Chiller evaporator outlet node number Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] Real64 CAPFTXTmin; // Minimum evaporator leaving temperature allowed by CAPFT curve [C] @@ -2721,11 +2648,11 @@ namespace ChillerReformulatedEIR { ++ElecReformEIRChiller(EIRChillNum).CAPFTXIter; if (ElecReformEIRChiller(EIRChillNum).CAPFTXIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The evaporator outlet temperature (" + TrimSigDigits(EvapOutletTemp, 2) + + "\": The evaporator outlet temperature (" + General::TrimSigDigits(EvapOutletTemp, 2) + " C) is outside the range of evaporator outlet temperatures (X var) given in Cooling Capacity Function of " "Temperature biquadratic curve = " + ElecReformEIRChiller(EIRChillNum).CAPFTName); - ShowContinueErrorTimeStamp("The range specified = " + TrimSigDigits(CAPFTXTmin, 2) + " C to " + TrimSigDigits(CAPFTXTmax, 2) + " C."); + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(CAPFTXTmin, 2) + " C to " + General::TrimSigDigits(CAPFTXTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The evap outlet temp range in Cooling Capacity Function of Temp curve error continues.", ElecReformEIRChiller(EIRChillNum).CAPFTXIterIndex, @@ -2744,11 +2671,11 @@ namespace ChillerReformulatedEIR { ++ElecReformEIRChiller(EIRChillNum).EIRFTXIter; if (ElecReformEIRChiller(EIRChillNum).EIRFTXIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The evaporator outlet temperature (" + TrimSigDigits(EvapOutletTemp, 2) + + "\": The evaporator outlet temperature (" + General::TrimSigDigits(EvapOutletTemp, 2) + " C) is outside the range of evaporator outlet temperatures (X var) given in Electric Input to Cooling Output Ratio " "Function of Temperature biquadratic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFTName); - ShowContinueErrorTimeStamp("The range specified = " + TrimSigDigits(EIRFTXTmin, 2) + " C to " + TrimSigDigits(EIRFTXTmax, 2) + " C."); + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFTXTmin, 2) + " C to " + General::TrimSigDigits(EIRFTXTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The evap outlet temp range in Electric Input to Cooling Output Ratio Function of Temp curve error continues.", @@ -2786,11 +2713,11 @@ namespace ChillerReformulatedEIR { ++ElecReformEIRChiller(EIRChillNum).CAPFTYIter; if (ElecReformEIRChiller(EIRChillNum).CAPFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The condenser outlet temperature (" + TrimSigDigits(CondOutletTemp, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Cooling Capacity Function of " "Temperature biquadratic curve = " + ElecReformEIRChiller(EIRChillNum).CAPFTName); - ShowContinueErrorTimeStamp("The range specified = " + TrimSigDigits(CAPFTYTmin, 2) + " C to " + TrimSigDigits(CAPFTYTmax, 2) + " C."); + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(CAPFTYTmin, 2) + " C to " + General::TrimSigDigits(CAPFTYTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", ElecReformEIRChiller(EIRChillNum).CAPFTYIterIndex, @@ -2809,11 +2736,11 @@ namespace ChillerReformulatedEIR { ++ElecReformEIRChiller(EIRChillNum).EIRFTYIter; if (ElecReformEIRChiller(EIRChillNum).EIRFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The condenser outlet temperature (" + TrimSigDigits(CondOutletTemp, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Electric Input to Cooling Output Ratio " "Function of Temperature biquadratic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFTName); - ShowContinueErrorTimeStamp("The range specified = " + TrimSigDigits(EIRFTYTmin, 2) + " C to " + TrimSigDigits(EIRFTYTmax, 2) + " C."); + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFTYTmin, 2) + " C to " + General::TrimSigDigits(EIRFTYTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", @@ -2835,11 +2762,11 @@ namespace ChillerReformulatedEIR { ++ElecReformEIRChiller(EIRChillNum).EIRFPLRTIter; if (ElecReformEIRChiller(EIRChillNum).EIRFPLRTIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The condenser outlet temperature (" + TrimSigDigits(CondOutletTemp, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (X var) given in Electric Input to Cooling Output " "Ratio Function of Part-load Ratio bicubic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFPLRName); - ShowContinueErrorTimeStamp("The range specified = " + TrimSigDigits(EIRFPLRTmin, 2) + " C to " + TrimSigDigits(EIRFPLRTmax, 2) + + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFPLRTmin, 2) + " C to " + General::TrimSigDigits(EIRFPLRTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + @@ -2862,11 +2789,11 @@ namespace ChillerReformulatedEIR { ++ElecReformEIRChiller(EIRChillNum).EIRFPLRPLRIter; if (ElecReformEIRChiller(EIRChillNum).EIRFPLRPLRIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The part-load ratio (" + - TrimSigDigits(ChillerPartLoadRatio, 3) + + General::TrimSigDigits(ChillerPartLoadRatio, 3) + ") is outside the range of part-load ratios (Y var) given in Electric Input to Cooling Output Ratio Function of " "Part-load Ratio bicubic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFPLRName); - ShowContinueErrorTimeStamp("The range specified = " + TrimSigDigits(EIRFPLRPLRmin, 3) + " to " + TrimSigDigits(EIRFPLRPLRmax, 3) + + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFPLRPLRmin, 3) + " to " + General::TrimSigDigits(EIRFPLRPLRmax, 3) + '.'); ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + @@ -2909,17 +2836,17 @@ namespace ChillerReformulatedEIR { } } - ChillerCapFT = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, EvapOutletTempSetPoint, CondOutletTemp); + ChillerCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, EvapOutletTempSetPoint, CondOutletTemp); if (ChillerCapFT < 0) { if (ElecReformEIRChiller(EIRChillNum).ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerCapFTError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); - ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + RoundSigDigits(ChillerCapFT, 3) + + ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + General::RoundSigDigits(ChillerCapFT, 3) + ")."); - ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + RoundSigDigits(EvapOutletTempSetPoint, 1) + - " and a Condenser Leaving Temp of " + RoundSigDigits(CondOutletTemp, 1) + '.'); + ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTempSetPoint, 1) + + " and a Condenser Leaving Temp of " + General::RoundSigDigits(CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerCapFTError; @@ -2931,7 +2858,7 @@ namespace ChillerReformulatedEIR { } } - ChillerEIRFT = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, EvapOutletTemp, CondOutletTemp); + ChillerEIRFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, EvapOutletTemp, CondOutletTemp); if (ChillerEIRFT < 0.0) { if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && @@ -2939,9 +2866,9 @@ namespace ChillerReformulatedEIR { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); ShowContinueError(" Reformulated Chiller EIR as a Function of Temperature curve output is negative (" + - RoundSigDigits(ChillerEIRFT, 3) + ")."); - ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + RoundSigDigits(EvapOutletTemp, 1) + - " and a Condenser Leaving Temp of " + RoundSigDigits(CondOutletTemp, 1) + '.'); + General::RoundSigDigits(ChillerEIRFT, 3) + ")."); + ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTemp, 1) + + " and a Condenser Leaving Temp of " + General::RoundSigDigits(CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError; @@ -2954,7 +2881,7 @@ namespace ChillerReformulatedEIR { } if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - ChillerEIRFPLR = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, CondOutletTemp, ChillerPartLoadRatio); + ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, CondOutletTemp, ChillerPartLoadRatio); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { ChillerLift = CondOutletTemp - EvapOutletTemp; ChillerTdev = std::abs(EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); @@ -2964,7 +2891,7 @@ namespace ChillerReformulatedEIR { ChillerLiftNom = ChillerLift / ChillerLiftRef; ChillerTdevNom = ChillerTdev / ChillerLiftRef; - ChillerEIRFPLR = CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ChillerLiftNom, ChillerPartLoadRatio, ChillerTdevNom); + ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ChillerLiftNom, ChillerPartLoadRatio, ChillerTdevNom); } if (ChillerEIRFPLR < 0.0) { @@ -2973,9 +2900,9 @@ namespace ChillerReformulatedEIR { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); ShowContinueError(" Chiller EIR as a function of PLR and condenser water temperature curve output is negative (" + - RoundSigDigits(ChillerEIRFPLR, 3) + ")."); - ShowContinueError(" Negative value occurs using a part-load ratio of " + RoundSigDigits(ChillerPartLoadRatio, 3) + - " and a Condenser Leaving Temp of " + RoundSigDigits(CondOutletTemp, 1) + " C."); + General::RoundSigDigits(ChillerEIRFPLR, 3) + ")."); + ShowContinueError(" Negative value occurs using a part-load ratio of " + General::RoundSigDigits(ChillerPartLoadRatio, 3) + + " and a Condenser Leaving Temp of " + General::RoundSigDigits(CondOutletTemp, 1) + " C."); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError; From 19afb2a1b7249bb4b310670a84b57595d75c6873 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 15 Jan 2020 15:13:09 -0700 Subject: [PATCH 05/41] step 2 - cleanup warnings --- src/EnergyPlus/ChillerReformulatedEIR.cc | 8 ++-- src/EnergyPlus/ChillerReformulatedEIR.hh | 52 ++++++++++++------------ 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 99bb75cbacd..963cc0a09fd 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -1151,7 +1151,7 @@ namespace ChillerReformulatedEIR { Real64 SizingCondOutletTemp; // Plant Sizing outlet temperature for condenser loop [C] Real64 RefCapFT; // Capacity as a function of temperature curve output used for sizing std::string equipName; // Name of chiller - Real64 CurveVal; // Used to verify EIR-FT/CAP-FT curves = 1 at reference conditions + Real64 CurveVal(0.0); // Used to verify EIR-FT/CAP-FT curves = 1 at reference conditions Real64 CondTemp; // Used to verify EIRFPLR curve is > than 0 at reference conditions static bool FoundNegValue(false); // Used to evaluate EIRFPLR curve objects static int CurveCheck(0); // Used to evaluate EIRFPLR curve objects @@ -2432,7 +2432,6 @@ namespace ChillerReformulatedEIR { PartLoadRat = (AvailChillerCap > 0.0) ? (QEvaporator / AvailChillerCap) : 0.0; PartLoadRat = max(0.0, min(PartLoadRat, MaxPartLoadRat)); ChillerPartLoadRatio = PartLoadRat; - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; } } else { // If FlowLock is True @@ -2507,7 +2506,6 @@ namespace ChillerReformulatedEIR { EvapMassFlowRate, QEvaporator); // update corresponding variables at faulty case - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; } // Checks QEvaporator on the basis of the machine limits. @@ -2612,8 +2610,8 @@ namespace ChillerReformulatedEIR { Real64 EIRFTXTmax; // Maximum evaporator leaving temperature allowed by EIRFT curve [C] Real64 EIRFTYTmin; // Minimum condenser leaving temperature allowed by EIRFT curve [C] Real64 EIRFTYTmax; // Maximum condenser leaving temperature allowed by EIRFT curve [C] - Real64 EIRFPLRTmin; // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] - Real64 EIRFPLRTmax; // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] + Real64 EIRFPLRTmin(0.0); // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] + Real64 EIRFPLRTmax(0.0); // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] Real64 EIRFPLRPLRmin; // Minimum PLR allowed by EIRFPLR curve Real64 EIRFPLRPLRmax; // Maximum PLR allowed by EIRFPLR curve Real64 ChillerLift; // Chiller lift [C] diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index c4740bb0f58..a76f5f90d8f 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -283,63 +283,63 @@ namespace ChillerReformulatedEIR { void SimReformulatedEIRChiller(std::string const &EIRChillerType, // Type of chiller !unused1208 std::string const &EIRChillerName, // User specified name of chiller - int const EquipFlowCtrl, // Flow control mode for the equipment + int EquipFlowCtrl, // Flow control mode for the equipment int &CompIndex, // Chiller number pointer - int const LoopNum, // plant loop index pointer - bool const RunFlag, // Simulate chiller when TRUE - bool const FirstIteration, // Initialize variables when TRUE + int LoopNum, // plant loop index pointer + bool RunFlag, // Simulate chiller when TRUE + bool FirstIteration, // Initialize variables when TRUE bool &InitLoopEquip, // If not zero, calculate the max load for operating conditions Real64 &MyLoad, // Loop demand component will meet [W] Real64 &MaxCap, // Maximum operating capacity of chiller [W] Real64 &MinCap, // Minimum operating capacity of chiller [W] Real64 &OptCap, // Optimal operating capacity of chiller [W] - bool const GetSizingFactor, // TRUE when just the sizing factor is requested + bool GetSizingFactor, // TRUE when just the sizing factor is requested Real64 &SizingFactor, // sizing factor Real64 &TempCondInDesign, Real64 &TempEvapOutDesign); void GetElecReformEIRChillerInput(); - void InitElecReformEIRChiller(int const EIRChillNum, // Number of the current electric EIR chiller being simulated - bool const RunFlag, // TRUE when chiller operating - Real64 const MyLoad // Current load put on chiller + void InitElecReformEIRChiller(int EIRChillNum, // Number of the current electric EIR chiller being simulated + bool RunFlag, // TRUE when chiller operating + Real64 MyLoad // Current load put on chiller ); - void SizeElecReformEIRChiller(int const EIRChillNum); + void SizeElecReformEIRChiller(int EIRChillNum); void ControlReformEIRChillerModel(int &EIRChillNum, // Chiller number Real64 &MyLoad, // Operating load [W] - bool const RunFlag, // TRUE when chiller operating - bool const FirstIteration, // TRUE when first iteration of timestep - int const EquipFlowCtrl // Flow control mode for the equipment + bool RunFlag, // TRUE when chiller operating + bool FirstIteration, // TRUE when first iteration of timestep + int EquipFlowCtrl // Flow control mode for the equipment ); - void ReformEIRChillerHeatRecovery(int const EIRChillNum, // Number of the current electric EIR chiller being simulated + void ReformEIRChillerHeatRecovery(int EIRChillNum, // Number of the current electric EIR chiller being simulated Real64 &QCond, // Current condenser load [W] - Real64 const CondMassFlow, // Current condenser mass flow [kg/s] - Real64 const CondInletTemp, // Current condenser inlet temp [C] + Real64 CondMassFlow, // Current condenser mass flow [kg/s] + Real64 CondInletTemp, // Current condenser inlet temp [C] Real64 &QHeatRec // Amount of heat recovered [W] ); - void UpdateReformEIRChillerRecords(Real64 const MyLoad, // Current load [W] - bool const RunFlag, // TRUE if chiller operating - int const Num // Chiller number + void UpdateReformEIRChillerRecords(Real64 MyLoad, // Current load [W] + bool RunFlag, // TRUE if chiller operating + int Num // Chiller number ); - Real64 CondOutTempResidual(Real64 const FalsiCondOutTemp, // RegulaFalsi condenser outlet temperature result [C] + Real64 CondOutTempResidual(Real64 FalsiCondOutTemp, // RegulaFalsi condenser outlet temperature result [C] Array1 const &Par // Parameter array used to interface with RegulaFalsi solver ); - void CalcReformEIRChillerModel(int const EIRChillNum, // Chiller number + void CalcReformEIRChillerModel(int EIRChillNum, // Chiller number Real64 &MyLoad, // Operating load [W] - bool const RunFlag, // TRUE when chiller operating - bool const FirstIteration, // TRUE when first iteration of timestep !unused1208 - int const EquipFlowCtrl, // Flow control mode for the equipment - Real64 const FalsiCondOutTemp // RegulaFalsi condenser outlet temperature result [C] + bool RunFlag, // TRUE when chiller operating + bool FirstIteration, // TRUE when first iteration of timestep !unused1208 + int EquipFlowCtrl, // Flow control mode for the equipment + Real64 FalsiCondOutTemp // RegulaFalsi condenser outlet temperature result [C] ); - void CheckMinMaxCurveBoundaries(int const EIRChillNum, // Number of the current electric EIR chiller being simulated - bool const FirstIteration // TRUE when first iteration of timestep + void CheckMinMaxCurveBoundaries(int EIRChillNum, // Number of the current electric EIR chiller being simulated + bool FirstIteration // TRUE when first iteration of timestep ); } // namespace ChillerReformulatedEIR From 2b314003ddc78c6bf333ed5202d60e573f0f34de Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 15 Jan 2020 15:33:39 -0700 Subject: [PATCH 06/41] step 3 - cleanup statics --- src/EnergyPlus/ChillerReformulatedEIR.cc | 43 ++++++------------------ src/EnergyPlus/ChillerReformulatedEIR.hh | 6 +++- 2 files changed, 16 insertions(+), 33 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 963cc0a09fd..6274d838dbc 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -150,6 +150,7 @@ namespace ChillerReformulatedEIR { Real64 ChillerCyclingRatio(0.0); // Chiller cycling ratio Real64 ChillerFalseLoadRate(0.0); // Chiller false load over and above the water-side load [W] Real64 AvgCondSinkTemp(0.0); // condenser temperature value for use in curves [C] + bool AllocatedFlag(false); // True when arrays are allocated bool GetInputREIR(true); // When TRUE, calls subroutine to read input file @@ -281,8 +282,7 @@ namespace ChillerReformulatedEIR { int NumAlphas; // Number of elements in the alpha array int NumNums; // Number of elements in the numeric array int IOStat; // IO Status when calling get input subroutine - static bool ErrorsFound(false); // True when input errors found - static bool AllocatedFlag(false); // True when arrays are allocated + bool ErrorsFound(false); // True when input errors found std::string PartLoadCurveType; // Part load curve type if (AllocatedFlag) return; @@ -819,9 +819,6 @@ namespace ChillerReformulatedEIR { // Uses the status flags to trigger initializations. static std::string const RoutineName("InitElecReformEIRChiller"); - static bool MyOneTimeFlag(true); // One time logic flag for allocating MyEnvrnFlag array - static Array1D_bool MyFlag; - static Array1D_bool MyEnvrnFlag; // Logical array to initialize when appropriate int EvapInletNode; // Node number for evaporator water inlet node int EvapOutletNode; // Node number for evaporator water outlet node int CondInletNode; // Node number for condenser water inlet node @@ -840,15 +837,6 @@ namespace ChillerReformulatedEIR { bool HeatRecRunFlag; Real64 HeatRecHighInletLimit; - // Do the one time initializations - if (MyOneTimeFlag) { - MyEnvrnFlag.allocate(NumElecReformEIRChillers); - MyFlag.allocate(NumElecReformEIRChillers); - MyEnvrnFlag = true; - MyFlag = true; - MyOneTimeFlag = false; - } - // Initialize condenser nodes EvapInletNode = ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum; EvapOutletNode = ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum; @@ -861,7 +849,7 @@ namespace ChillerReformulatedEIR { } // Init more variables - if (MyFlag(EIRChillNum)) { + if (ElecReformEIRChiller(EIRChillNum).MyInitFlag) { // Locate the chillers on the plant loops for later usage errFlag = false; PlantUtilities::ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, @@ -982,10 +970,10 @@ namespace ChillerReformulatedEIR { DataLoopNode::Node(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } - MyFlag(EIRChillNum) = false; + ElecReformEIRChiller(EIRChillNum).MyInitFlag = false; } - if (MyEnvrnFlag(EIRChillNum) && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (ElecReformEIRChiller(EIRChillNum).MyEnvrnFlag && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, @@ -1054,10 +1042,10 @@ namespace ChillerReformulatedEIR { (ElecReformEIRChiller(EIRChillNum).RefCap + ElecReformEIRChiller(EIRChillNum).RefCap / ElecReformEIRChiller(EIRChillNum).RefCOP); } - MyEnvrnFlag(EIRChillNum) = false; + ElecReformEIRChiller(EIRChillNum).MyEnvrnFlag = false; } if (!DataGlobals::BeginEnvrnFlag) { - MyEnvrnFlag(EIRChillNum) = true; + ElecReformEIRChiller(EIRChillNum).MyEnvrnFlag = true; } if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) && ElecReformEIRChiller(EIRChillNum).ModulatedFlowSetToLoop) { @@ -1153,8 +1141,6 @@ namespace ChillerReformulatedEIR { std::string equipName; // Name of chiller Real64 CurveVal(0.0); // Used to verify EIR-FT/CAP-FT curves = 1 at reference conditions Real64 CondTemp; // Used to verify EIRFPLR curve is > than 0 at reference conditions - static bool FoundNegValue(false); // Used to evaluate EIRFPLR curve objects - static int CurveCheck(0); // Used to evaluate EIRFPLR curve objects Array1D CurveValArray(11); // Used to evaluate EIRFPLR curve objects Array1D CondTempArray(11); // Used to evaluate EIRFPLR curve objects Real64 CurveValTmp; // Used to evaluate EIRFPLR curve objects @@ -1171,8 +1157,6 @@ namespace ChillerReformulatedEIR { Real64 tmpEvapVolFlowRate; // local evaporator design volume flow rate Real64 tmpCondVolFlowRate; // local condenser design volume flow rate Real64 tmpHeatRecVolFlowRate; // local heat recovery design volume flow rate - static bool MyOneTimeFlag(true); - static Array1D_bool MyFlag; // TRUE in order to calculate IPLV Real64 EvapVolFlowRateUser(0.0); // Hardsized evaporator flow for reporting Real64 RefCapUser(0.0); // Hardsized reference capacity for reporting Real64 CondVolFlowRateUser(0.0); // Hardsized condenser flow for reporting @@ -1182,11 +1166,6 @@ namespace ChillerReformulatedEIR { static ObjexxFCL::gio::Fmt Format_530("('Cond Temp (C) = ',11(F7.2))"); static ObjexxFCL::gio::Fmt Format_531("('Curve Output = ',11(F7.2))"); - if (MyOneTimeFlag) { - MyFlag.dimension(NumElecReformEIRChillers, true); - MyOneTimeFlag = false; - } - tmpNomCap = ElecReformEIRChiller(EIRChillNum).RefCap; tmpEvapVolFlowRate = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate; tmpCondVolFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; @@ -1472,7 +1451,7 @@ namespace ChillerReformulatedEIR { } if (DataPlant::PlantFinalSizesOkayToReport) { - if (MyFlag(EIRChillNum)) { + if (ElecReformEIRChiller(EIRChillNum).MySizeFlag) { Real64 IPLV; StandardRatings::CalcChillerIPLV(ElecReformEIRChiller(EIRChillNum).Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, @@ -1487,7 +1466,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate, ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac); - MyFlag(EIRChillNum) = false; + ElecReformEIRChiller(EIRChillNum).MySizeFlag = false; } // create predefined report equipName = ElecReformEIRChiller(EIRChillNum).Name; @@ -1599,11 +1578,11 @@ namespace ChillerReformulatedEIR { // Check EIRFPLR curve output. Calculate condenser inlet temp based on reference condenser outlet temp, // chiller capacity, and mass flow rate. Starting with the calculated condenser inlet temp and PLR = 0, // calculate the condenser outlet temp proportional to PLR and test the EIRFPLR curve output for negative numbers. - FoundNegValue = false; + bool FoundNegValue = false; if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR > 0) { CurveValArray = 0.0; CondTempArray = 0.0; - for (CurveCheck = 0; CurveCheck <= 10; ++CurveCheck) { + for (int CurveCheck = 0; CurveCheck <= 10; ++CurveCheck) { PLRTemp = CurveCheck / 10.0; CondTemp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn + (DeltaTCond * PLRTemp); CondTemp = min(CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax); diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index a76f5f90d8f..f45742ae68c 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -210,6 +210,9 @@ namespace ChillerReformulatedEIR { int FaultyChillerFoulingIndex; // Index of the fault object corresponding to the chiller Real64 FaultyChillerFoulingFactor; // Chiller fouling factor std::string EndUseSubcategory; // identifier use for the end use subcategory + bool MyEnvrnFlag; + bool MyInitFlag; + bool MySizeFlag; // Default Constructor ReformulatedEIRChillerSpecs() @@ -232,7 +235,8 @@ namespace ChillerReformulatedEIR { IterLimitExceededNum(0), IterLimitErrIndex(0), IterFailed(0), IterFailedIndex(0), DeltaTErrCount(0), DeltaTErrCountIndex(0), CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), HRLoopNum(0), HRLoopSideNum(0), HRBranchNum(0), HRCompNum(0), CondMassFlowIndex(0), PossibleSubcooling(false), - FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0), FaultyChillerFoulingFactor(1.0) + FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0), FaultyChillerFoulingFactor(1.0), MyEnvrnFlag(true), + MyInitFlag(true), MySizeFlag(true) { } }; From 59931ea262197eed7b75e350b5ecd9a742dcfbc0 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 05:40:44 -0700 Subject: [PATCH 07/41] cleaning up mod vars --- src/EnergyPlus/ChillerReformulatedEIR.cc | 230 ++++++++++------------- src/EnergyPlus/ChillerReformulatedEIR.hh | 63 +++---- 2 files changed, 122 insertions(+), 171 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 6274d838dbc..6cba56a7424 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -119,9 +119,6 @@ namespace ChillerReformulatedEIR { int const WaterCooled(2); // Only water-cooled condensers are currently allowed int const EvapCooled(3); // Evap-cooled condenser currently not allowed - // Performance curve variable parameters - int const LeavingCondenser(5); - // chiller flow modes int const FlowModeNotSet(200); int const ConstantFlow(201); @@ -141,16 +138,6 @@ namespace ChillerReformulatedEIR { Real64 Power(0.0); // Rate of chiller electric energy use [W] Real64 QEvaporator(0.0); // Rate of heat transfer to the evaporator coil [W] Real64 QCondenser(0.0); // Rate of heat transfer to the condenser coil [W] - Real64 QHeatRecovered(0.0); // Rate of heat transfer to the heat recovery coil [W] - Real64 HeatRecOutletTemp(0.0); // Heat recovery outlet temperature [C] - Real64 ChillerCapFT(0.0); // Chiller capacity fraction (evaluated as a function of temperature) - Real64 ChillerEIRFT(0.0); // Chiller electric input ratio (EIR = 1 / COP) as a function of temperature - Real64 ChillerEIRFPLR(0.0); // Chiller EIR as a function of part-load ratio (PLR) - Real64 ChillerPartLoadRatio(0.0); // Chiller part-load ratio (PLR) - Real64 ChillerCyclingRatio(0.0); // Chiller cycling ratio - Real64 ChillerFalseLoadRate(0.0); // Chiller false load over and above the water-side load [W] - Real64 AvgCondSinkTemp(0.0); // condenser temperature value for use in curves [C] - bool AllocatedFlag(false); // True when arrays are allocated bool GetInputREIR(true); // When TRUE, calls subroutine to read input file @@ -256,7 +243,7 @@ namespace ChillerReformulatedEIR { DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, ElecReformEIRChiller(EIRChillNum).HeatRecOutletNodeNum, - ElecReformEIRChillerReport(EIRChillNum).QHeatRecovery, + ElecReformEIRChiller(EIRChillNum).QHeatRecovery, ElecReformEIRChillerReport(EIRChillNum).HeatRecInletTemp, ElecReformEIRChillerReport(EIRChillNum).HeatRecOutletTemp, ElecReformEIRChillerReport(EIRChillNum).HeatRecMassFlow, @@ -285,8 +272,6 @@ namespace ChillerReformulatedEIR { bool ErrorsFound(false); // True when input errors found std::string PartLoadCurveType; // Part load curve type - if (AllocatedFlag) return; - DataIPShortCuts::cCurrentModuleObject = "Chiller:Electric:ReformulatedEIR"; NumElecReformEIRChillers = inputProcessor->getNumObjectsFound(DataIPShortCuts::cCurrentModuleObject); @@ -298,7 +283,6 @@ namespace ChillerReformulatedEIR { // ALLOCATE ARRAYS ElecReformEIRChiller.allocate(NumElecReformEIRChillers); ElecReformEIRChillerReport.allocate(NumElecReformEIRChillers); - AllocatedFlag = true; // Load arrays with reformulated electric EIR chiller data for (EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { @@ -320,17 +304,17 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name = DataIPShortCuts::cAlphaArgs(1); // Performance curves - ElecReformEIRChiller(EIRChillerNum).ChillerCapFT = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(2)); + ElecReformEIRChiller(EIRChillerNum).ChillerCapFTIndex = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(2)); ElecReformEIRChiller(EIRChillerNum).CAPFTName = DataIPShortCuts::cAlphaArgs(2); - if (ElecReformEIRChiller(EIRChillerNum).ChillerCapFT == 0) { + if (ElecReformEIRChiller(EIRChillerNum).ChillerCapFTIndex == 0) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(2) + '=' + DataIPShortCuts::cAlphaArgs(2)); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).ChillerEIRFT = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(3)); + ElecReformEIRChiller(EIRChillerNum).ChillerEIRFTIndex = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(3)); ElecReformEIRChiller(EIRChillerNum).EIRFTName = DataIPShortCuts::cAlphaArgs(3); - if (ElecReformEIRChiller(EIRChillerNum).ChillerEIRFT == 0) { + if (ElecReformEIRChiller(EIRChillerNum).ChillerEIRFTIndex == 0) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(3) + '=' + DataIPShortCuts::cAlphaArgs(3)); ErrorsFound = true; @@ -344,8 +328,8 @@ namespace ChillerReformulatedEIR { } ElecReformEIRChiller(EIRChillerNum).EIRFPLRName = DataIPShortCuts::cAlphaArgs(5); - ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(5)); - if (ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR == 0) { + ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLRIndex = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(5)); + if (ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLRIndex == 0) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(5) + '=' + DataIPShortCuts::cAlphaArgs(5)); ErrorsFound = true; @@ -353,10 +337,10 @@ namespace ChillerReformulatedEIR { // Check the type of part-load curves implemented: 1_LeavingCondenserWaterTemperature, 2_Lift zrp_Aug2014 if (UtilityRoutines::SameString(PartLoadCurveType, "LeavingCondenserWaterTemperature") && - CurveManager::PerfCurve(ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR).NumDims == 2) { + CurveManager::PerfCurve(ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLRIndex).NumDims == 2) { ElecReformEIRChiller(EIRChillerNum).PartLoadCurveType = PLR_LeavingCondenserWaterTemperature; } else if (UtilityRoutines::SameString(PartLoadCurveType, "Lift") && - CurveManager::PerfCurve(ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR).NumDims == 3) { + CurveManager::PerfCurve(ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLRIndex).NumDims == 3) { ElecReformEIRChiller(EIRChillerNum).PartLoadCurveType = PLR_Lift; } else { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); @@ -610,13 +594,13 @@ namespace ChillerReformulatedEIR { for (EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { SetupOutputVariable("Chiller Part Load Ratio", OutputProcessor::Unit::None, - ElecReformEIRChillerReport(EIRChillerNum).ChillerPartLoadRatio, + ElecReformEIRChiller(EIRChillerNum).ChillerPartLoadRatio, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Cycling Ratio", OutputProcessor::Unit::None, - ElecReformEIRChillerReport(EIRChillerNum).ChillerCyclingRatio, + ElecReformEIRChiller(EIRChillerNum).ChillerCyclingRatio, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -657,7 +641,7 @@ namespace ChillerReformulatedEIR { "Plant"); SetupOutputVariable("Chiller False Load Heat Transfer Rate", OutputProcessor::Unit::W, - ElecReformEIRChillerReport(EIRChillerNum).ChillerFalseLoadRate, + ElecReformEIRChiller(EIRChillerNum).ChillerFalseLoadRate, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -712,19 +696,19 @@ namespace ChillerReformulatedEIR { SetupOutputVariable("Chiller Capacity Temperature Modifier Multiplier", OutputProcessor::Unit::None, - ElecReformEIRChillerReport(EIRChillerNum).ChillerCapFT, + ElecReformEIRChiller(EIRChillerNum).ChillerCapFT, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller EIR Temperature Modifier Multiplier", OutputProcessor::Unit::None, - ElecReformEIRChillerReport(EIRChillerNum).ChillerEIRFT, + ElecReformEIRChiller(EIRChillerNum).ChillerEIRFT, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller EIR Part Load Modifier Multiplier", OutputProcessor::Unit::None, - ElecReformEIRChillerReport(EIRChillerNum).ChillerEIRFPLR, + ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -752,7 +736,7 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillerNum).HeatRecActive) { SetupOutputVariable("Chiller Total Recovered Heat Rate", OutputProcessor::Unit::W, - ElecReformEIRChillerReport(EIRChillerNum).QHeatRecovery, + ElecReformEIRChiller(EIRChillerNum).QHeatRecovery, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -787,7 +771,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Effective Heat Rejection Temperature", OutputProcessor::Unit::C, - ElecReformEIRChillerReport(EIRChillerNum).ChillerCondAvgTemp, + ElecReformEIRChiller(EIRChillerNum).ChillerCondAvgTemp, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -1259,7 +1243,7 @@ namespace ChillerReformulatedEIR { DataGlobals::CWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); - RefCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, SizingEvapOutletTemp, SizingCondOutletTemp); + RefCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, SizingEvapOutletTemp, SizingCondOutletTemp); tmpNomCap = (Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate) / RefCapFT; } else { if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized) tmpNomCap = 0.0; @@ -1458,9 +1442,9 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).RefCap, ElecReformEIRChiller(EIRChillNum).RefCOP, ElecReformEIRChiller(EIRChillNum).CondenserType, - ElecReformEIRChiller(EIRChillNum).ChillerCapFT, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, + ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, + ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, + ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).MinUnloadRat, IPLV, ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate, @@ -1478,8 +1462,8 @@ namespace ChillerReformulatedEIR { // Only check performance curves if Capacity and volumetric flow rate are greater than 0 if (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0 && ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0) { // Check the CAP-FT, EIR-FT, and PLR curves at reference conditions and warn user if different from 1.0 by more than +-10% - if (ElecReformEIRChiller(EIRChillNum).ChillerCapFT > 0) { - CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, + if (ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex > 0) { + CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, ElecReformEIRChiller(EIRChillNum).TempRefEvapOut, ElecReformEIRChiller(EIRChillNum).TempRefCondOut); if (CurveVal > 1.10 || CurveVal < 0.90) { @@ -1487,15 +1471,15 @@ namespace ChillerReformulatedEIR { ShowContinueError("(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); ShowContinueError("Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); } - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMax, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax); } - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFT > 0) { - CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, + if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex > 0) { + CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, ElecReformEIRChiller(EIRChillNum).TempRefEvapOut, ElecReformEIRChiller(EIRChillNum).TempRefCondOut); if (CurveVal > 1.10 || CurveVal < 0.90) { @@ -1503,18 +1487,18 @@ namespace ChillerReformulatedEIR { ShowContinueError("(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); ShowContinueError("Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); } - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax); } - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR > 0) { + if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex > 0) { if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, 1.0); + CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, 1.0); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { - CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, 1.0, 1.0, 0.0); // zrp_Aug2014 + CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, 1.0, 1.0, 0.0); // zrp_Aug2014 } if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError("Energy input ratio as a function of part-load ratio curve output is not equal to 1.0"); @@ -1523,13 +1507,13 @@ namespace ChillerReformulatedEIR { } if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMin, ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, @@ -1579,7 +1563,7 @@ namespace ChillerReformulatedEIR { // chiller capacity, and mass flow rate. Starting with the calculated condenser inlet temp and PLR = 0, // calculate the condenser outlet temp proportional to PLR and test the EIRFPLR curve output for negative numbers. bool FoundNegValue = false; - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR > 0) { + if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex > 0) { CurveValArray = 0.0; CondTempArray = 0.0; for (int CurveCheck = 0; CurveCheck <= 10; ++CurveCheck) { @@ -1589,9 +1573,9 @@ namespace ChillerReformulatedEIR { CondTemp = max(CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin); if (PLRTemp < ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin) { CurveValTmp = CurveManager::CurveValue( - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin); } else { - CurveValTmp = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, CondTemp, PLRTemp); + CurveValTmp = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, CondTemp, PLRTemp); } if (CurveValTmp < 0.0) FoundNegValue = true; CurveValArray(CurveCheck + 1) = int(CurveValTmp * 100.0) / 100.0; @@ -1622,24 +1606,24 @@ namespace ChillerReformulatedEIR { } } } else { // just get curve min/max values if capacity or cond volume flow rate = 0 - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMax, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin, ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax); - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax); if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, + CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMin, ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMax, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, @@ -1883,9 +1867,9 @@ namespace ChillerReformulatedEIR { // Calculate a new Heat Recovery Coil Outlet Temp if (HeatRecMassFlowRate > 0.0) { - HeatRecOutletTemp = QHeatRec / (HeatRecMassFlowRate * CpHeatRec) + HeatRecInletTemp; + ElecReformEIRChiller(EIRChillNum).HeatRecOutletTemp = QHeatRec / (HeatRecMassFlowRate * CpHeatRec) + HeatRecInletTemp; } else { - HeatRecOutletTemp = HeatRecInletTemp; + ElecReformEIRChiller(EIRChillNum).HeatRecOutletTemp = HeatRecInletTemp; } } @@ -1920,9 +1904,9 @@ namespace ChillerReformulatedEIR { DataLoopNode::Node(EvapOutletNode).Temp = DataLoopNode::Node(EvapInletNode).Temp; DataLoopNode::Node(CondOutletNode).Temp = DataLoopNode::Node(CondInletNode).Temp; - ElecReformEIRChillerReport(Num).ChillerPartLoadRatio = 0.0; - ElecReformEIRChillerReport(Num).ChillerCyclingRatio = 0.0; - ElecReformEIRChillerReport(Num).ChillerFalseLoadRate = 0.0; + ElecReformEIRChiller(Num).ChillerPartLoadRatio = 0.0; + ElecReformEIRChiller(Num).ChillerCyclingRatio = 0.0; + ElecReformEIRChiller(Num).ChillerFalseLoadRate = 0.0; ElecReformEIRChillerReport(Num).ChillerFalseLoad = 0.0; ElecReformEIRChillerReport(Num).Power = 0.0; ElecReformEIRChillerReport(Num).QEvap = 0.0; @@ -1941,13 +1925,11 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(Num).HeatRecActive) { PlantUtilities::SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); - ElecReformEIRChillerReport(Num).QHeatRecovery = 0.0; + ElecReformEIRChiller(Num).QHeatRecovery = 0.0; ElecReformEIRChillerReport(Num).EnergyHeatRecovery = 0.0; ElecReformEIRChillerReport(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; ElecReformEIRChillerReport(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; ElecReformEIRChillerReport(Num).HeatRecMassFlow = DataLoopNode::Node(HeatRecInNode).MassFlowRate; - - ElecReformEIRChillerReport(Num).ChillerCondAvgTemp = AvgCondSinkTemp; } } else { // Chiller is running, so pass calculated values @@ -1956,10 +1938,7 @@ namespace ChillerReformulatedEIR { DataLoopNode::Node(CondOutletNode).Temp = CondOutletTemp; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available - ElecReformEIRChillerReport(Num).ChillerPartLoadRatio = ChillerPartLoadRatio; - ElecReformEIRChillerReport(Num).ChillerCyclingRatio = ChillerCyclingRatio; - ElecReformEIRChillerReport(Num).ChillerFalseLoadRate = ChillerFalseLoadRate; - ElecReformEIRChillerReport(Num).ChillerFalseLoad = ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).ChillerFalseLoad = ElecReformEIRChiller(Num).ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; ElecReformEIRChillerReport(Num).Power = Power; ElecReformEIRChillerReport(Num).QEvap = QEvaporator; ElecReformEIRChillerReport(Num).QCond = QCondenser; @@ -1973,7 +1952,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChillerReport(Num).Evapmdot = EvapMassFlowRate; ElecReformEIRChillerReport(Num).Condmdot = CondMassFlowRate; if (Power != 0.0) { - ElecReformEIRChillerReport(Num).ActualCOP = (QEvaporator + ChillerFalseLoadRate) / Power; + ElecReformEIRChillerReport(Num).ActualCOP = (QEvaporator + ElecReformEIRChiller(Num).ChillerFalseLoadRate) / Power; } else { ElecReformEIRChillerReport(Num).ActualCOP = 0.0; } @@ -1981,20 +1960,13 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(Num).HeatRecActive) { PlantUtilities::SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); - ElecReformEIRChillerReport(Num).QHeatRecovery = QHeatRecovered; - ElecReformEIRChillerReport(Num).EnergyHeatRecovery = QHeatRecovered * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - DataLoopNode::Node(HeatRecOutNode).Temp = HeatRecOutletTemp; + ElecReformEIRChillerReport(Num).EnergyHeatRecovery = ElecReformEIRChiller(Num).QHeatRecovery * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + DataLoopNode::Node(HeatRecOutNode).Temp = ElecReformEIRChiller(Num).HeatRecOutletTemp; ElecReformEIRChillerReport(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; ElecReformEIRChillerReport(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; ElecReformEIRChillerReport(Num).HeatRecMassFlow = DataLoopNode::Node(HeatRecInNode).MassFlowRate; - - ElecReformEIRChillerReport(Num).ChillerCondAvgTemp = AvgCondSinkTemp; } } - - ElecReformEIRChillerReport(Num).ChillerCapFT = ChillerCapFT; - ElecReformEIRChillerReport(Num).ChillerEIRFT = ChillerEIRFT; - ElecReformEIRChillerReport(Num).ChillerEIRFPLR = ChillerEIRFPLR; } Real64 CondOutTempResidual(Real64 const FalsiCondOutTemp, // RegulaFalsi condenser outlet temperature result [C] @@ -2107,15 +2079,15 @@ namespace ChillerReformulatedEIR { int CompNum; Real64 Cp; // Local fluid specific heat - ChillerPartLoadRatio = 0.0; - ChillerCyclingRatio = 0.0; - ChillerFalseLoadRate = 0.0; + ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = 0.0; + ElecReformEIRChiller(EIRChillNum).ChillerCyclingRatio = 0.0; + ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = 0.0; EvapMassFlowRate = 0.0; CondMassFlowRate = 0.0; Power = 0.0; QCondenser = 0.0; QEvaporator = 0.0; - QHeatRecovered = 0.0; + ElecReformEIRChiller(EIRChillNum).QHeatRecovery = 0.0; EvapInletNode = ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum; EvapOutletNode = ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum; CondInletNode = ElecReformEIRChiller(EIRChillNum).CondInletNodeNum; @@ -2126,9 +2098,9 @@ namespace ChillerReformulatedEIR { CompNum = ElecReformEIRChiller(EIRChillNum).CWCompNum; // Set performance curve outputs to 0.0 when chiller is off - ChillerCapFT = 0.0; - ChillerEIRFT = 0.0; - ChillerEIRFPLR = 0.0; + ElecReformEIRChiller(EIRChillNum).ChillerCapFT = 0.0; + ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = 0.0; + ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = 0.0; // Set module-level chiller evap and condenser inlet temperature variables CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; @@ -2246,23 +2218,23 @@ namespace ChillerReformulatedEIR { // correct temperature if using heat recovery // use report values for latest valid calculation, lagged somewhat if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - if ((ElecReformEIRChillerReport(EIRChillNum).QHeatRecovery + ElecReformEIRChillerReport(EIRChillNum).QCond) > + if ((ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChillerReport(EIRChillNum).QCond) > 0.0) { // protect div by zero - AvgCondSinkTemp = (ElecReformEIRChillerReport(EIRChillNum).QHeatRecovery * ElecReformEIRChillerReport(EIRChillNum).HeatRecOutletTemp + + ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = (ElecReformEIRChiller(EIRChillNum).QHeatRecovery * ElecReformEIRChillerReport(EIRChillNum).HeatRecOutletTemp + ElecReformEIRChillerReport(EIRChillNum).QCond * ElecReformEIRChillerReport(EIRChillNum).CondOutletTemp) / - (ElecReformEIRChillerReport(EIRChillNum).QHeatRecovery + ElecReformEIRChillerReport(EIRChillNum).QCond); + (ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChillerReport(EIRChillNum).QCond); } else { - AvgCondSinkTemp = FalsiCondOutTemp; + ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = FalsiCondOutTemp; } } else { - AvgCondSinkTemp = FalsiCondOutTemp; + ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = FalsiCondOutTemp; } // Get capacity curve info with respect to CW setpoint and leaving condenser water temps - ChillerCapFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, EvapOutletTempSetPoint, AvgCondSinkTemp)); + ElecReformEIRChiller(EIRChillNum).ChillerCapFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, EvapOutletTempSetPoint, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp)); // Available chiller capacity as a function of temperature - AvailChillerCap = ChillerRefCap * ChillerCapFT; + AvailChillerCap = ChillerRefCap * ElecReformEIRChiller(EIRChillNum).ChillerCapFT; EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; // Some other component set the flow to 0. No reason to continue with calculations. @@ -2297,7 +2269,7 @@ namespace ChillerReformulatedEIR { // Set evaporator heat transfer rate QEvaporator = AvailChillerCap * PartLoadRat; - ChillerPartLoadRatio = PartLoadRat; + ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; // If FlowLock is False (0), the chiller sets the plant loop mdot // If FlowLock is True (1), the new resolved plant loop mdot is used if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) { @@ -2376,7 +2348,7 @@ namespace ChillerReformulatedEIR { EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; QEvaporator = 0.0; PartLoadRat = 0.0; - ChillerPartLoadRatio = PartLoadRat; + ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; if (ElecReformEIRChiller(EIRChillNum).DeltaTErrCount < 1 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).DeltaTErrCount; @@ -2410,7 +2382,7 @@ namespace ChillerReformulatedEIR { // update corresponding variables at faulty case PartLoadRat = (AvailChillerCap > 0.0) ? (QEvaporator / AvailChillerCap) : 0.0; PartLoadRat = max(0.0, min(PartLoadRat, MaxPartLoadRat)); - ChillerPartLoadRatio = PartLoadRat; + ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; } } else { // If FlowLock is True @@ -2510,7 +2482,7 @@ namespace ChillerReformulatedEIR { if (PartLoadRat < MinPartLoadRat) FRAC = min(1.0, (PartLoadRat / MinPartLoadRat)); // set the module level variable used for reporting FRAC - ChillerCyclingRatio = FRAC; + ElecReformEIRChiller(EIRChillNum).ChillerCyclingRatio = FRAC; // Chiller is false loading below PLR = minimum unloading ratio, find PLR used for energy calculation if (AvailChillerCap > 0.0) { @@ -2520,23 +2492,23 @@ namespace ChillerReformulatedEIR { } // set the module level variable used for reporting PLR - ChillerPartLoadRatio = PartLoadRat; + ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; // calculate the load due to false loading on chiller over and above water side load - ChillerFalseLoadRate = (AvailChillerCap * PartLoadRat * FRAC) - QEvaporator; - if (ChillerFalseLoadRate < DataHVACGlobals::SmallLoad) { - ChillerFalseLoadRate = 0.0; + ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = (AvailChillerCap * PartLoadRat * FRAC) - QEvaporator; + if (ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate < DataHVACGlobals::SmallLoad) { + ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = 0.0; } } // This is the end of the FlowLock Block - ChillerEIRFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, EvapOutletTemp, AvgCondSinkTemp)); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, EvapOutletTemp, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp)); // Part Load Ratio Curve Type: 1_LeavingCondenserWaterTemperature; 2_Lift zrp_Aug2014 if (PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, AvgCondSinkTemp, PartLoadRat)); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp, PartLoadRat)); } else if (PartLoadCurveType == PLR_Lift) { - ChillerLift = AvgCondSinkTemp - EvapOutletTemp; + ChillerLift = ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp - EvapOutletTemp; ChillerTdev = std::abs(EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); ChillerLiftRef = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; @@ -2544,19 +2516,19 @@ namespace ChillerReformulatedEIR { ChillerLiftNom = ChillerLift / ChillerLiftRef; ChillerTdevNom = ChillerTdev / ChillerLiftRef; - ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ChillerLiftNom, PartLoadRat, ChillerTdevNom)); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ChillerLiftNom, PartLoadRat, ChillerTdevNom)); } if (ReferenceCOP <= 0) ReferenceCOP = 5.5; - Power = (AvailChillerCap / ReferenceCOP) * ChillerEIRFPLR * ChillerEIRFT * FRAC; + Power = (AvailChillerCap / ReferenceCOP) * ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR * ElecReformEIRChiller(EIRChillNum).ChillerEIRFT * FRAC; - QCondenser = Power * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac + QEvaporator + ChillerFalseLoadRate; + QCondenser = Power * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac + QEvaporator + ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate; // Currently only water cooled chillers are allowed for the reformulated EIR chiller model if (CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) - ReformEIRChillerHeatRecovery(EIRChillNum, QCondenser, CondMassFlowRate, CondInletTemp, QHeatRecovered); + ReformEIRChillerHeatRecovery(EIRChillNum, QCondenser, CondMassFlowRate, CondInletTemp, ElecReformEIRChiller(EIRChillNum).QHeatRecovery); Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, @@ -2762,11 +2734,11 @@ namespace ChillerReformulatedEIR { } } - if (ChillerPartLoadRatio < EIRFPLRPLRmin || ChillerPartLoadRatio > EIRFPLRPLRmax) { + if (ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio < EIRFPLRPLRmin || ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio > EIRFPLRPLRmax) { ++ElecReformEIRChiller(EIRChillNum).EIRFPLRPLRIter; if (ElecReformEIRChiller(EIRChillNum).EIRFPLRPLRIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The part-load ratio (" + - General::TrimSigDigits(ChillerPartLoadRatio, 3) + + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, 3) + ") is outside the range of part-load ratios (Y var) given in Electric Input to Cooling Output Ratio Function of " "Part-load Ratio bicubic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFPLRName); @@ -2776,15 +2748,15 @@ namespace ChillerReformulatedEIR { "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The part-load ratio range in Electric Input to Cooling Output Ratio Function of PLRatio curve error continues.", ElecReformEIRChiller(EIRChillNum).EIRFPLRPLRIterIndex, - ChillerPartLoadRatio, - ChillerPartLoadRatio); + ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, + ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio); } else { ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The part-load ratio range in Electric Input to Cooling Output Ratio Function of PLRatio curve error continues.", ElecReformEIRChiller(EIRChillNum).EIRFPLRPLRIterIndex, - ChillerPartLoadRatio, - ChillerPartLoadRatio); + ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, + ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio); } } @@ -2813,14 +2785,14 @@ namespace ChillerReformulatedEIR { } } - ChillerCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, EvapOutletTempSetPoint, CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).ChillerCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, EvapOutletTempSetPoint, CondOutletTemp); - if (ChillerCapFT < 0) { + if (ElecReformEIRChiller(EIRChillNum).ChillerCapFT < 0) { if (ElecReformEIRChiller(EIRChillNum).ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerCapFTError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); - ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + General::RoundSigDigits(ChillerCapFT, 3) + + ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, 3) + ")."); ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTempSetPoint, 1) + " and a Condenser Leaving Temp of " + General::RoundSigDigits(CondOutletTemp, 1) + '.'); @@ -2830,20 +2802,20 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": Chiller Capacity as a Function of Temperature curve output is negative warning continues...", ElecReformEIRChiller(EIRChillNum).ChillerCapFTErrorIndex, - ChillerCapFT, - ChillerCapFT); + ElecReformEIRChiller(EIRChillNum).ChillerCapFT, + ElecReformEIRChiller(EIRChillNum).ChillerCapFT); } } - ChillerEIRFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, EvapOutletTemp, CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, EvapOutletTemp, CondOutletTemp); - if (ChillerEIRFT < 0.0) { + if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFT < 0.0) { if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); ShowContinueError(" Reformulated Chiller EIR as a Function of Temperature curve output is negative (" + - General::RoundSigDigits(ChillerEIRFT, 3) + ")."); + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, 3) + ")."); ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTemp, 1) + " and a Condenser Leaving Temp of " + General::RoundSigDigits(CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); @@ -2852,13 +2824,13 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": Chiller EIR as a Function of Temperature curve output is negative warning continues...", ElecReformEIRChiller(EIRChillNum).ChillerEIRFTErrorIndex, - ChillerEIRFT, - ChillerEIRFT); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, + ElecReformEIRChiller(EIRChillNum).ChillerEIRFT); } } if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, CondOutletTemp, ChillerPartLoadRatio); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, CondOutletTemp, ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { ChillerLift = CondOutletTemp - EvapOutletTemp; ChillerTdev = std::abs(EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); @@ -2868,17 +2840,17 @@ namespace ChillerReformulatedEIR { ChillerLiftNom = ChillerLift / ChillerLiftRef; ChillerTdevNom = ChillerTdev / ChillerLiftRef; - ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, ChillerLiftNom, ChillerPartLoadRatio, ChillerTdevNom); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ChillerLiftNom, ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, ChillerTdevNom); } - if (ChillerEIRFPLR < 0.0) { + if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR < 0.0) { if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); ShowContinueError(" Chiller EIR as a function of PLR and condenser water temperature curve output is negative (" + - General::RoundSigDigits(ChillerEIRFPLR, 3) + ")."); - ShowContinueError(" Negative value occurs using a part-load ratio of " + General::RoundSigDigits(ChillerPartLoadRatio, 3) + + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, 3) + ")."); + ShowContinueError(" Negative value occurs using a part-load ratio of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, 3) + " and a Condenser Leaving Temp of " + General::RoundSigDigits(CondOutletTemp, 1) + " C."); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { @@ -2886,8 +2858,8 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": Chiller EIR as a function of PLR curve output is negative warning continues...", ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRErrorIndex, - ChillerEIRFPLR, - ChillerEIRFPLR); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, + ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR); } } } diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index f45742ae68c..a3c72eaa03c 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -60,36 +60,12 @@ namespace EnergyPlus { namespace ChillerReformulatedEIR { // Chiller type parameters - extern int const AirCooled; // Air-cooled condenser currently not allowed extern int const WaterCooled; // Only water-cooled condensers are currently allowed extern int const EvapCooled; // Evap-cooled condenser currently not allowed - // Performance curve variable parameters - extern int const LeavingCondenser; - // chiller flow modes extern int const FlowModeNotSet; - extern int const ConstantFlow; - extern int const NotModulated; - extern int const LeavingSetPointModulated; - extern int NumElecReformEIRChillers; // Number of electric reformulated EIR chillers specified in input - extern Real64 CondMassFlowRate; // Condenser mass flow rate [kg/s] - extern Real64 EvapMassFlowRate; // Evaporator mass flow rate [kg/s] - extern Real64 CondOutletTemp; // Condenser outlet temperature [C] - extern Real64 EvapOutletTemp; // Evaporator outlet temperature [C] - extern Real64 Power; // Rate of chiller electric energy use [W] - extern Real64 QEvaporator; // Rate of heat transfer to the evaporator coil [W] - extern Real64 QCondenser; // Rate of heat transfer to the condenser coil [W] - extern Real64 QHeatRecovered; // Rate of heat transfer to the heat recovery coil [W] - extern Real64 HeatRecOutletTemp; // Heat recovery outlet temperature [C] - extern Real64 ChillerCapFT; // Chiller capacity fraction (evaluated as a function of temperature) - extern Real64 ChillerEIRFT; // Chiller electric input ratio (EIR = 1 / COP) as a function of temperature - extern Real64 ChillerEIRFPLR; // Chiller EIR as a function of part-load ratio (PLR) - extern Real64 ChillerPartLoadRatio; // Chiller part-load ratio (PLR) - extern Real64 ChillerCyclingRatio; // Chiller cycling ratio - extern Real64 ChillerFalseLoadRate; // Chiller false load over and above the water-side load [W] - extern Real64 AvgCondSinkTemp; // condenser temperature value for use in curves [C] extern bool GetInputREIR; // When TRUE, calls subroutine to read input file @@ -142,11 +118,11 @@ namespace ChillerReformulatedEIR { Real64 HeatRecMaxCapacityLimit; // Capacity limit for Heat recovery, one time calc [W] int HeatRecSetPointNodeNum; // index for system node with the heat recover leaving setpoint int HeatRecInletLimitSchedNum; // index for schedule for the inlet high limit for heat recovery operation - int ChillerCapFT; // Index for the total cooling capacity modifier curve + int ChillerCapFTIndex; // Index for the total cooling capacity modifier curve // (function of leaving evaporator and condenser water temperatures) - int ChillerEIRFT; // Index for the energy input ratio modifier curve + int ChillerEIRFTIndex; // Index for the energy input ratio modifier curve // (function of leaving evaporator and condenser water temperatures) - int ChillerEIRFPLR; // Index for the energy input ratio vs part-load ratio curve + int ChillerEIRFPLRIndex; // Index for the energy input ratio vs part-load ratio curve // (function of leaving condenser water temperature and part-load ratio) int ChillerCapFTError; // Used for negative capacity as a function of temp warnings int ChillerCapFTErrorIndex; // Used for negative capacity as a function of temp warnings @@ -213,6 +189,15 @@ namespace ChillerReformulatedEIR { bool MyEnvrnFlag; bool MyInitFlag; bool MySizeFlag; + Real64 ChillerCondAvgTemp; // reporting: average condenser temp for curves with Heat recovery [C] + Real64 ChillerFalseLoadRate; // reporting: Chiller false load over and above water side load [J] + Real64 ChillerCyclingRatio; // reporting: Chiller cycling ratio (time on/time step) + Real64 ChillerPartLoadRatio; // reporting: Chiller PLR (Load/Capacity) + Real64 ChillerEIRFPLR; // reporting: Chiller EIRFPLR curve output value + Real64 ChillerEIRFT; // reporting: Chiller EIRFT curve output value + Real64 ChillerCapFT; // reporting: Chiller capacity curve output value + Real64 HeatRecOutletTemp; + Real64 QHeatRecovery; // reporting: Heat recovered from water-cooled condenser [W] // Default Constructor ReformulatedEIRChillerSpecs() @@ -223,12 +208,12 @@ namespace ChillerReformulatedEIR { MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), MinUnloadRat(0.0), TempRefCondIn(0.0), TempRefCondOut(0.0), TempRefEvapOut(0.0), TempLowLimitEvapOut(0.0), DesignHeatRecVolFlowRate(0.0), DesignHeatRecVolFlowRateWasAutoSized(false), DesignHeatRecMassFlowRate(0.0), SizFac(0.0), HeatRecActive(false), HeatRecInletNodeNum(0), HeatRecOutletNodeNum(0), - HeatRecCapacityFraction(0.0), HeatRecMaxCapacityLimit(0.0), HeatRecSetPointNodeNum(0), HeatRecInletLimitSchedNum(0), ChillerCapFT(0), - ChillerEIRFT(0), ChillerEIRFPLR(0), ChillerCapFTError(0), ChillerCapFTErrorIndex(0), ChillerEIRFTError(0), ChillerEIRFTErrorIndex(0), + HeatRecCapacityFraction(0.0), HeatRecMaxCapacityLimit(0.0), HeatRecSetPointNodeNum(0), HeatRecInletLimitSchedNum(0), ChillerCapFTIndex(0), + ChillerEIRFTIndex(0), ChillerEIRFPLRIndex(0), ChillerCapFTError(0), ChillerCapFTErrorIndex(0), ChillerEIRFTError(0), ChillerEIRFTErrorIndex(0), ChillerEIRFPLRError(0), ChillerEIRFPLRErrorIndex(0), ChillerCAPFTXTempMin(0.0), ChillerCAPFTXTempMax(0.0), ChillerCAPFTYTempMin(0.0), ChillerCAPFTYTempMax(0.0), ChillerEIRFTXTempMin(0.0), ChillerEIRFTXTempMax(0.0), ChillerEIRFTYTempMin(0.0), ChillerEIRFTYTempMax(0.0), ChillerEIRFPLRTempMin(0.0), ChillerEIRFPLRTempMax(0.0), ChillerEIRFPLRPLRMin(0.0), ChillerEIRFPLRPLRMax(0.0), - ChillerLiftNomMin(0.0), // zrp_Aug2014 + ChillerLiftNomMin(0.0), ChillerLiftNomMax(10.0), ChillerTdevNomMin(0.0), ChillerTdevNomMax(10.0), CAPFTXIter(0), CAPFTXIterIndex(0), CAPFTYIter(0), CAPFTYIterIndex(0), EIRFTXIter(0), EIRFTXIterIndex(0), EIRFTYIter(0), EIRFTYIterIndex(0), EIRFPLRTIter(0), EIRFPLRTIterIndex(0), EIRFPLRPLRIter(0), EIRFPLRPLRIterIndex(0), FaultyChillerSWTFlag(false), FaultyChillerSWTIndex(0), FaultyChillerSWTOffset(0.0), @@ -236,7 +221,9 @@ namespace ChillerReformulatedEIR { CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), HRLoopNum(0), HRLoopSideNum(0), HRBranchNum(0), HRCompNum(0), CondMassFlowIndex(0), PossibleSubcooling(false), FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0), FaultyChillerFoulingFactor(1.0), MyEnvrnFlag(true), - MyInitFlag(true), MySizeFlag(true) + MyInitFlag(true), MySizeFlag(true), ChillerCondAvgTemp(0.0), ChillerFalseLoadRate(0.0), ChillerCyclingRatio(0.0), + ChillerPartLoadRatio(0.0), ChillerEIRFPLR(0.0), ChillerEIRFT(0.0), ChillerCapFT(0.0), HeatRecOutletTemp(0.0), + QHeatRecovery(0.0) { } }; @@ -244,9 +231,6 @@ namespace ChillerReformulatedEIR { struct ReportVars { // Members - Real64 ChillerPartLoadRatio; // reporting: Chiller PLR (Load/Capacity) - Real64 ChillerCyclingRatio; // reporting: Chiller cycling ratio (time on/time step) - Real64 ChillerFalseLoadRate; // reporting: Chiller false load over and above water side load [J] Real64 ChillerFalseLoad; // reporting: Chiller false load over and above water side load [W] Real64 Power; // reporting: Chiller power [W] Real64 QEvap; // reporting: Evaporator heat transfer rate [W] @@ -261,22 +245,17 @@ namespace ChillerReformulatedEIR { Real64 Evapmdot; // reporting: Evaporator mass flow rate [kg/s] Real64 Condmdot; // reporting: Condenser mass flow rate [kg/s] Real64 ActualCOP; // reporting: Coefficient of performance - Real64 QHeatRecovery; // reporting: Heat recovered from water-cooled condenser [W] Real64 EnergyHeatRecovery; // reporting: Energy recovered from water-cooled condenser [J] Real64 HeatRecInletTemp; // reporting: Heat reclaim inlet temperature [C] Real64 HeatRecOutletTemp; // reporting: Heat reclaim outlet temperature [C] Real64 HeatRecMassFlow; // reporting: Heat reclaim mass flow rate [kg/s] - Real64 ChillerCapFT; // reporting: Chiller capacity curve output value - Real64 ChillerEIRFT; // reporting: Chiller EIRFT curve output value - Real64 ChillerEIRFPLR; // reporting: Chiller EIRFPLR curve output value - Real64 ChillerCondAvgTemp; // reporting: average condenser temp for curves with Heat recovery [C] // Default Constructor ReportVars() - : ChillerPartLoadRatio(0.0), ChillerCyclingRatio(0.0), ChillerFalseLoadRate(0.0), ChillerFalseLoad(0.0), Power(0.0), QEvap(0.0), + : ChillerFalseLoad(0.0), Power(0.0), QEvap(0.0), QCond(0.0), Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), CondOutletTemp(0.0), - EvapOutletTemp(0.0), Evapmdot(0.0), Condmdot(0.0), ActualCOP(0.0), QHeatRecovery(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), - HeatRecOutletTemp(0.0), HeatRecMassFlow(0.0), ChillerCapFT(0.0), ChillerEIRFT(0.0), ChillerEIRFPLR(0.0), ChillerCondAvgTemp(0.0) + EvapOutletTemp(0.0), Evapmdot(0.0), Condmdot(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), + HeatRecOutletTemp(0.0), HeatRecMassFlow(0.0) { } }; From a7579b565400fb40b0769261d98f35c819c4d27b Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 08:56:12 -0700 Subject: [PATCH 08/41] cleaning up mod vars --- src/EnergyPlus/ChillerReformulatedEIR.cc | 192 +++++++++++------------ src/EnergyPlus/ChillerReformulatedEIR.hh | 16 +- 2 files changed, 100 insertions(+), 108 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 6cba56a7424..9396cbaa047 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -134,10 +134,6 @@ namespace ChillerReformulatedEIR { Real64 CondMassFlowRate(0.0); // Condenser mass flow rate [kg/s] Real64 EvapMassFlowRate(0.0); // Evaporator mass flow rate [kg/s] Real64 CondOutletTemp(0.0); // Condenser outlet temperature [C] - Real64 EvapOutletTemp(0.0); // Evaporator outlet temperature [C] - Real64 Power(0.0); // Rate of chiller electric energy use [W] - Real64 QEvaporator(0.0); // Rate of heat transfer to the evaporator coil [W] - Real64 QCondenser(0.0); // Rate of heat transfer to the condenser coil [W] bool GetInputREIR(true); // When TRUE, calls subroutine to read input file @@ -232,7 +228,7 @@ namespace ChillerReformulatedEIR { DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, - ElecReformEIRChillerReport(EIRChillNum).QCond, + ElecReformEIRChiller(EIRChillNum).QCondenser, ElecReformEIRChillerReport(EIRChillNum).CondInletTemp, ElecReformEIRChillerReport(EIRChillNum).CondOutletTemp, ElecReformEIRChillerReport(EIRChillNum).Condmdot, @@ -606,7 +602,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Electric Power", OutputProcessor::Unit::W, - ElecReformEIRChillerReport(EIRChillerNum).Power, + ElecReformEIRChiller(EIRChillerNum).Power, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -624,7 +620,7 @@ namespace ChillerReformulatedEIR { SetupOutputVariable("Chiller Evaporator Cooling Rate", OutputProcessor::Unit::W, - ElecReformEIRChillerReport(EIRChillerNum).QEvap, + ElecReformEIRChiller(EIRChillerNum).QEvaporator, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -659,7 +655,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Evaporator Outlet Temperature", OutputProcessor::Unit::C, - ElecReformEIRChillerReport(EIRChillerNum).EvapOutletTemp, + ElecReformEIRChiller(EIRChillerNum).EvapOutletTemp, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -672,7 +668,7 @@ namespace ChillerReformulatedEIR { SetupOutputVariable("Chiller Condenser Heat Transfer Rate", OutputProcessor::Unit::W, - ElecReformEIRChillerReport(EIRChillerNum).QCond, + ElecReformEIRChiller(EIRChillerNum).QCondenser, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -1908,16 +1904,16 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(Num).ChillerCyclingRatio = 0.0; ElecReformEIRChiller(Num).ChillerFalseLoadRate = 0.0; ElecReformEIRChillerReport(Num).ChillerFalseLoad = 0.0; - ElecReformEIRChillerReport(Num).Power = 0.0; - ElecReformEIRChillerReport(Num).QEvap = 0.0; - ElecReformEIRChillerReport(Num).QCond = 0.0; + ElecReformEIRChiller(Num).Power = 0.0; + ElecReformEIRChiller(Num).QEvaporator = 0.0; + ElecReformEIRChiller(Num).QCondenser = 0.0; ElecReformEIRChillerReport(Num).Energy = 0.0; ElecReformEIRChillerReport(Num).EvapEnergy = 0.0; ElecReformEIRChillerReport(Num).CondEnergy = 0.0; ElecReformEIRChillerReport(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; ElecReformEIRChillerReport(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; ElecReformEIRChillerReport(Num).CondOutletTemp = DataLoopNode::Node(CondOutletNode).Temp; - ElecReformEIRChillerReport(Num).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).Temp; + ElecReformEIRChiller(Num).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).Temp; ElecReformEIRChillerReport(Num).Evapmdot = EvapMassFlowRate; // could still be flow if in series ElecReformEIRChillerReport(Num).Condmdot = CondMassFlowRate; // could still be flow if in series ElecReformEIRChillerReport(Num).ActualCOP = 0.0; @@ -1934,25 +1930,21 @@ namespace ChillerReformulatedEIR { } else { // Chiller is running, so pass calculated values // Set node temperatures - DataLoopNode::Node(EvapOutletNode).Temp = EvapOutletTemp; + DataLoopNode::Node(EvapOutletNode).Temp = ElecReformEIRChiller(Num).EvapOutletTemp; DataLoopNode::Node(CondOutletNode).Temp = CondOutletTemp; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available ElecReformEIRChillerReport(Num).ChillerFalseLoad = ElecReformEIRChiller(Num).ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChillerReport(Num).Power = Power; - ElecReformEIRChillerReport(Num).QEvap = QEvaporator; - ElecReformEIRChillerReport(Num).QCond = QCondenser; - ElecReformEIRChillerReport(Num).Energy = Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChillerReport(Num).EvapEnergy = QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChillerReport(Num).CondEnergy = QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).Energy = ElecReformEIRChiller(Num).Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).EvapEnergy = ElecReformEIRChiller(Num).QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChillerReport(Num).CondEnergy = ElecReformEIRChiller(Num).QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; ElecReformEIRChillerReport(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; ElecReformEIRChillerReport(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; ElecReformEIRChillerReport(Num).CondOutletTemp = DataLoopNode::Node(CondOutletNode).Temp; - ElecReformEIRChillerReport(Num).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).Temp; ElecReformEIRChillerReport(Num).Evapmdot = EvapMassFlowRate; ElecReformEIRChillerReport(Num).Condmdot = CondMassFlowRate; - if (Power != 0.0) { - ElecReformEIRChillerReport(Num).ActualCOP = (QEvaporator + ElecReformEIRChiller(Num).ChillerFalseLoadRate) / Power; + if (ElecReformEIRChiller(Num).Power != 0.0) { + ElecReformEIRChillerReport(Num).ActualCOP = (ElecReformEIRChiller(Num).QEvaporator + ElecReformEIRChiller(Num).ChillerFalseLoadRate) / ElecReformEIRChiller(Num).Power; } else { ElecReformEIRChillerReport(Num).ActualCOP = 0.0; } @@ -2084,9 +2076,9 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = 0.0; EvapMassFlowRate = 0.0; CondMassFlowRate = 0.0; - Power = 0.0; - QCondenser = 0.0; - QEvaporator = 0.0; + ElecReformEIRChiller(EIRChillNum).Power = 0.0; + ElecReformEIRChiller(EIRChillNum).QCondenser = 0.0; + ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; ElecReformEIRChiller(EIRChillNum).QHeatRecovery = 0.0; EvapInletNode = ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum; EvapOutletNode = ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum; @@ -2132,7 +2124,7 @@ namespace ChillerReformulatedEIR { MinUnloadRat = ElecReformEIRChiller(EIRChillNum).MinUnloadRat; ChillerRefCap = ElecReformEIRChiller(EIRChillNum).RefCap; ReferenceCOP = ElecReformEIRChiller(EIRChillNum).RefCOP; - EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).Temp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).Temp; TempLowLimitEout = ElecReformEIRChiller(EIRChillNum).TempLowLimitEvapOut; EvapMassFlowRateMax = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax; PartLoadCurveType = ElecReformEIRChiller(EIRChillNum).PartLoadCurveType; // zrp_Aug2014 @@ -2218,11 +2210,11 @@ namespace ChillerReformulatedEIR { // correct temperature if using heat recovery // use report values for latest valid calculation, lagged somewhat if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - if ((ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChillerReport(EIRChillNum).QCond) > + if ((ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChiller(EIRChillNum).QCondenser) > 0.0) { // protect div by zero ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = (ElecReformEIRChiller(EIRChillNum).QHeatRecovery * ElecReformEIRChillerReport(EIRChillNum).HeatRecOutletTemp + - ElecReformEIRChillerReport(EIRChillNum).QCond * ElecReformEIRChillerReport(EIRChillNum).CondOutletTemp) / - (ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChillerReport(EIRChillNum).QCond); + ElecReformEIRChiller(EIRChillNum).QCondenser * ElecReformEIRChillerReport(EIRChillNum).CondOutletTemp) / + (ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChiller(EIRChillNum).QCondenser); } else { ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = FalsiCondOutTemp; } @@ -2268,7 +2260,7 @@ namespace ChillerReformulatedEIR { } // Set evaporator heat transfer rate - QEvaporator = AvailChillerCap * PartLoadRat; + ElecReformEIRChiller(EIRChillNum).QEvaporator = AvailChillerCap * PartLoadRat; ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; // If FlowLock is False (0), the chiller sets the plant loop mdot // If FlowLock is True (1), the new resolved plant loop mdot is used @@ -2292,11 +2284,11 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CWBranchNum, ElecReformEIRChiller(EIRChillNum).CWCompNum); if (EvapMassFlowRate != 0.0) { - EvapDeltaTemp = QEvaporator / EvapMassFlowRate / Cp; + EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / EvapMassFlowRate / Cp; } else { EvapDeltaTemp = 0.0; } - EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else if (ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); @@ -2311,7 +2303,7 @@ namespace ChillerReformulatedEIR { } if (EvapDeltaTemp != 0) { - EvapMassFlowRate = max(0.0, (QEvaporator / Cp / EvapDeltaTemp)); + EvapMassFlowRate = max(0.0, (ElecReformEIRChiller(EIRChillNum).QEvaporator / Cp / EvapDeltaTemp)); if ((EvapMassFlowRate - EvapMassFlowRateMax) > DataBranchAirLoopPlant::MassFlowTolerance) ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = true; // Check to see if the Maximum is exceeded, if so set to maximum EvapMassFlowRate = min(EvapMassFlowRateMax, EvapMassFlowRate); @@ -2327,12 +2319,12 @@ namespace ChillerReformulatedEIR { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempSetPoint; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempSetPointHi; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempSetPointHi; } } - QEvaporator = max(0.0, (EvapMassFlowRate * Cp * EvapDeltaTemp)); + ElecReformEIRChiller(EIRChillNum).QEvaporator = max(0.0, (EvapMassFlowRate * Cp * EvapDeltaTemp)); } else { // Try to request zero flow EvapMassFlowRate = 0.0; @@ -2345,8 +2337,8 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CWBranchNum, ElecReformEIRChiller(EIRChillNum).CWCompNum); // No deltaT since component is not running - EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; - QEvaporator = 0.0; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; PartLoadRat = 0.0; ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; @@ -2376,11 +2368,11 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset, Cp, DataLoopNode::Node(EvapInletNode).Temp, - EvapOutletTemp, + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, EvapMassFlowRate, - QEvaporator); + ElecReformEIRChiller(EIRChillNum).QEvaporator); // update corresponding variables at faulty case - PartLoadRat = (AvailChillerCap > 0.0) ? (QEvaporator / AvailChillerCap) : 0.0; + PartLoadRat = (AvailChillerCap > 0.0) ? (ElecReformEIRChiller(EIRChillNum).QEvaporator / AvailChillerCap) : 0.0; PartLoadRat = max(0.0, min(PartLoadRat, MaxPartLoadRat)); ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; } @@ -2400,45 +2392,45 @@ namespace ChillerReformulatedEIR { return; } if (ElecReformEIRChiller(EIRChillNum).PossibleSubcooling) { - QEvaporator = std::abs(MyLoad); - EvapDeltaTemp = QEvaporator / EvapMassFlowRate / Cp; - EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = std::abs(MyLoad); + EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / EvapMassFlowRate / Cp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else { EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTempSetPoint; - QEvaporator = max(0.0, (EvapMassFlowRate * Cp * EvapDeltaTemp)); - EvapOutletTemp = EvapOutletTempSetPoint; + ElecReformEIRChiller(EIRChillNum).QEvaporator = max(0.0, (EvapMassFlowRate * Cp * EvapDeltaTemp)); + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = EvapOutletTempSetPoint; } - if (EvapOutletTemp < TempLowLimitEout) { + if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < TempLowLimitEout) { if ((DataLoopNode::Node(EvapInletNode).Temp - TempLowLimitEout) > DataPlant::DeltaTempTol) { - EvapOutletTemp = TempLowLimitEout; - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; - QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = TempLowLimitEout; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; } else { - EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; - QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; } } - if (EvapOutletTemp < DataLoopNode::Node(EvapOutletNode).TempMin) { + if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < DataLoopNode::Node(EvapOutletNode).TempMin) { if ((DataLoopNode::Node(EvapInletNode).Temp - DataLoopNode::Node(EvapOutletNode).TempMin) > DataPlant::DeltaTempTol) { - EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempMin; - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; - QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempMin; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; } else { - EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTemp; - QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; + EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; } } // If load exceeds the distributed load set to the distributed load - if (QEvaporator > std::abs(MyLoad)) { + if (ElecReformEIRChiller(EIRChillNum).QEvaporator > std::abs(MyLoad)) { if (EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { - QEvaporator = std::abs(MyLoad); - EvapDeltaTemp = QEvaporator / EvapMassFlowRate / Cp; - EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = std::abs(MyLoad); + EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / EvapMassFlowRate / Cp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else { - QEvaporator = 0.0; - EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; } } @@ -2453,27 +2445,27 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset, Cp, DataLoopNode::Node(EvapInletNode).Temp, - EvapOutletTemp, + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, EvapMassFlowRate, - QEvaporator); + ElecReformEIRChiller(EIRChillNum).QEvaporator); // update corresponding variables at faulty case } // Checks QEvaporator on the basis of the machine limits. - if (QEvaporator > (AvailChillerCap * MaxPartLoadRat)) { + if (ElecReformEIRChiller(EIRChillNum).QEvaporator > (AvailChillerCap * MaxPartLoadRat)) { if (EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { - QEvaporator = AvailChillerCap * MaxPartLoadRat; - EvapDeltaTemp = QEvaporator / EvapMassFlowRate / Cp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = AvailChillerCap * MaxPartLoadRat; + EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / EvapMassFlowRate / Cp; // evaporator outlet temperature is allowed to float upwards (recalculate AvailChillerCap? iterate?) - EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else { - QEvaporator = 0.0; - EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; } } if (AvailChillerCap > 0.0) { - PartLoadRat = max(0.0, min((QEvaporator / AvailChillerCap), MaxPartLoadRat)); + PartLoadRat = max(0.0, min((ElecReformEIRChiller(EIRChillNum).QEvaporator / AvailChillerCap), MaxPartLoadRat)); } else { PartLoadRat = 0.0; } @@ -2495,21 +2487,21 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; // calculate the load due to false loading on chiller over and above water side load - ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = (AvailChillerCap * PartLoadRat * FRAC) - QEvaporator; + ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = (AvailChillerCap * PartLoadRat * FRAC) - ElecReformEIRChiller(EIRChillNum).QEvaporator; if (ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate < DataHVACGlobals::SmallLoad) { ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = 0.0; } } // This is the end of the FlowLock Block - ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, EvapOutletTemp, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp)); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp)); // Part Load Ratio Curve Type: 1_LeavingCondenserWaterTemperature; 2_Lift zrp_Aug2014 if (PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp, PartLoadRat)); } else if (PartLoadCurveType == PLR_Lift) { - ChillerLift = ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp - EvapOutletTemp; - ChillerTdev = std::abs(EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); + ChillerLift = ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + ChillerTdev = std::abs(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); ChillerLiftRef = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; if (ChillerLiftRef <= 0) ChillerLiftRef = 35 - 6.67; @@ -2520,20 +2512,20 @@ namespace ChillerReformulatedEIR { } if (ReferenceCOP <= 0) ReferenceCOP = 5.5; - Power = (AvailChillerCap / ReferenceCOP) * ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR * ElecReformEIRChiller(EIRChillNum).ChillerEIRFT * FRAC; + ElecReformEIRChiller(EIRChillNum).Power = (AvailChillerCap / ReferenceCOP) * ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR * ElecReformEIRChiller(EIRChillNum).ChillerEIRFT * FRAC; - QCondenser = Power * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac + QEvaporator + ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate; + ElecReformEIRChiller(EIRChillNum).QCondenser = ElecReformEIRChiller(EIRChillNum).Power * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac + ElecReformEIRChiller(EIRChillNum).QEvaporator + ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate; // Currently only water cooled chillers are allowed for the reformulated EIR chiller model if (CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) - ReformEIRChillerHeatRecovery(EIRChillNum, QCondenser, CondMassFlowRate, CondInletTemp, ElecReformEIRChiller(EIRChillNum).QHeatRecovery); + ReformEIRChillerHeatRecovery(EIRChillNum, ElecReformEIRChiller(EIRChillNum).QCondenser, CondMassFlowRate, CondInletTemp, ElecReformEIRChiller(EIRChillNum).QHeatRecovery); Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); - CondOutletTemp = QCondenser / CondMassFlowRate / Cp + CondInletTemp; + CondOutletTemp = ElecReformEIRChiller(EIRChillNum).QCondenser / CondMassFlowRate / Cp + CondInletTemp; } else { ShowSevereError("ControlReformEIRChillerModel: Condenser flow = 0, for ElecReformEIRChiller=" + ElecReformEIRChiller(EIRChillNum).Name); ShowContinueErrorTimeStamp(""); @@ -2593,11 +2585,11 @@ namespace ChillerReformulatedEIR { EIRFTXTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMax; // Check bounds for curves, lump min/max into same check since min/max values are reported in recurring warning messages - if (EvapOutletTemp < CAPFTXTmin || EvapOutletTemp > CAPFTXTmax) { + if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < CAPFTXTmin || ElecReformEIRChiller(EIRChillNum).EvapOutletTemp > CAPFTXTmax) { ++ElecReformEIRChiller(EIRChillNum).CAPFTXIter; if (ElecReformEIRChiller(EIRChillNum).CAPFTXIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The evaporator outlet temperature (" + General::TrimSigDigits(EvapOutletTemp, 2) + + "\": The evaporator outlet temperature (" + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, 2) + " C) is outside the range of evaporator outlet temperatures (X var) given in Cooling Capacity Function of " "Temperature biquadratic curve = " + ElecReformEIRChiller(EIRChillNum).CAPFTName); @@ -2605,22 +2597,22 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The evap outlet temp range in Cooling Capacity Function of Temp curve error continues.", ElecReformEIRChiller(EIRChillNum).CAPFTXIterIndex, - EvapOutletTemp, - EvapOutletTemp); + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp); } else { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The evap outlet temp range in Cooling Capacity Function of Temp curve error continues.", ElecReformEIRChiller(EIRChillNum).CAPFTXIterIndex, - EvapOutletTemp, - EvapOutletTemp); + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp); } } - if (EvapOutletTemp < EIRFTXTmin || EvapOutletTemp > EIRFTXTmax) { + if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < EIRFTXTmin || ElecReformEIRChiller(EIRChillNum).EvapOutletTemp > EIRFTXTmax) { ++ElecReformEIRChiller(EIRChillNum).EIRFTXIter; if (ElecReformEIRChiller(EIRChillNum).EIRFTXIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The evaporator outlet temperature (" + General::TrimSigDigits(EvapOutletTemp, 2) + + "\": The evaporator outlet temperature (" + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, 2) + " C) is outside the range of evaporator outlet temperatures (X var) given in Electric Input to Cooling Output Ratio " "Function of Temperature biquadratic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFTName); @@ -2629,15 +2621,15 @@ namespace ChillerReformulatedEIR { "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The evap outlet temp range in Electric Input to Cooling Output Ratio Function of Temp curve error continues.", ElecReformEIRChiller(EIRChillNum).EIRFTXIterIndex, - EvapOutletTemp, - EvapOutletTemp); + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp); } else { ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The evap outlet temp range in Electric Input to Cooling Output Ratio Function of Temp curve error continues.", ElecReformEIRChiller(EIRChillNum).EIRFTXIterIndex, - EvapOutletTemp, - EvapOutletTemp); + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp); } } @@ -2807,7 +2799,7 @@ namespace ChillerReformulatedEIR { } } - ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, EvapOutletTemp, CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, CondOutletTemp); if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFT < 0.0) { if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && @@ -2816,7 +2808,7 @@ namespace ChillerReformulatedEIR { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); ShowContinueError(" Reformulated Chiller EIR as a Function of Temperature curve output is negative (" + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, 3) + ")."); - ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTemp, 1) + + ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, 1) + " and a Condenser Leaving Temp of " + General::RoundSigDigits(CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { @@ -2832,8 +2824,8 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, CondOutletTemp, ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { - ChillerLift = CondOutletTemp - EvapOutletTemp; - ChillerTdev = std::abs(EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); + ChillerLift = CondOutletTemp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + ChillerTdev = std::abs(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); ChillerLiftRef = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; if (ChillerLiftRef <= 0) ChillerLiftRef = 35 - 6.67; diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index a3c72eaa03c..b8b892dde87 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -198,6 +198,10 @@ namespace ChillerReformulatedEIR { Real64 ChillerCapFT; // reporting: Chiller capacity curve output value Real64 HeatRecOutletTemp; Real64 QHeatRecovery; // reporting: Heat recovered from water-cooled condenser [W] + Real64 QCondenser; + Real64 QEvaporator; // reporting: Evaporator heat transfer rate [W] + Real64 Power; // reporting: Chiller power [W] + Real64 EvapOutletTemp; // reporting: Evaporator outlet temperature [C] // Default Constructor ReformulatedEIRChillerSpecs() @@ -223,7 +227,7 @@ namespace ChillerReformulatedEIR { FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0), FaultyChillerFoulingFactor(1.0), MyEnvrnFlag(true), MyInitFlag(true), MySizeFlag(true), ChillerCondAvgTemp(0.0), ChillerFalseLoadRate(0.0), ChillerCyclingRatio(0.0), ChillerPartLoadRatio(0.0), ChillerEIRFPLR(0.0), ChillerEIRFT(0.0), ChillerCapFT(0.0), HeatRecOutletTemp(0.0), - QHeatRecovery(0.0) + QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0) { } }; @@ -232,16 +236,12 @@ namespace ChillerReformulatedEIR { { // Members Real64 ChillerFalseLoad; // reporting: Chiller false load over and above water side load [W] - Real64 Power; // reporting: Chiller power [W] - Real64 QEvap; // reporting: Evaporator heat transfer rate [W] - Real64 QCond; // reporting: Condenser heat transfer rate [W] Real64 Energy; // reporting: Chiller electric consumption [J] Real64 EvapEnergy; // reporting: Evaporator heat transfer energy [J] Real64 CondEnergy; // reporting: Condenser heat transfer energy [J] Real64 CondInletTemp; // reporting: Condenser inlet temperature [C] Real64 EvapInletTemp; // reporting: Evaporator inlet temperature [C] Real64 CondOutletTemp; // reporting: Condenser outlet temperature [C] - Real64 EvapOutletTemp; // reporting: Evaporator outlet temperature [C] Real64 Evapmdot; // reporting: Evaporator mass flow rate [kg/s] Real64 Condmdot; // reporting: Condenser mass flow rate [kg/s] Real64 ActualCOP; // reporting: Coefficient of performance @@ -252,9 +252,9 @@ namespace ChillerReformulatedEIR { // Default Constructor ReportVars() - : ChillerFalseLoad(0.0), Power(0.0), QEvap(0.0), - QCond(0.0), Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), CondOutletTemp(0.0), - EvapOutletTemp(0.0), Evapmdot(0.0), Condmdot(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), + : ChillerFalseLoad(0.0), + Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), CondOutletTemp(0.0), + Evapmdot(0.0), Condmdot(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), HeatRecOutletTemp(0.0), HeatRecMassFlow(0.0) { } From bdf8526bb3d240175f6a071a1ab1604d6dd0864e Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 09:53:35 -0700 Subject: [PATCH 09/41] cleaning up mod vars --- src/EnergyPlus/ChillerReformulatedEIR.cc | 176 +++++++++++------------ src/EnergyPlus/ChillerReformulatedEIR.hh | 13 +- 2 files changed, 89 insertions(+), 100 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 9396cbaa047..2f78328c9c3 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -131,9 +131,6 @@ namespace ChillerReformulatedEIR { // MODULE VARIABLE DECLARATIONS: int NumElecReformEIRChillers(0); // Number of electric reformulated EIR chillers specified in input - Real64 CondMassFlowRate(0.0); // Condenser mass flow rate [kg/s] - Real64 EvapMassFlowRate(0.0); // Evaporator mass flow rate [kg/s] - Real64 CondOutletTemp(0.0); // Condenser outlet temperature [C] bool GetInputREIR(true); // When TRUE, calls subroutine to read input file @@ -230,8 +227,8 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, ElecReformEIRChiller(EIRChillNum).QCondenser, ElecReformEIRChillerReport(EIRChillNum).CondInletTemp, - ElecReformEIRChillerReport(EIRChillNum).CondOutletTemp, - ElecReformEIRChillerReport(EIRChillNum).Condmdot, + ElecReformEIRChiller(EIRChillNum).CondOutletTemp, + ElecReformEIRChiller(EIRChillNum).CondMassFlowRate, FirstIteration); } else if (LoopNum == ElecReformEIRChiller(EIRChillNum).HRLoopNum) { PlantUtilities::UpdateComponentHeatRecoverySide(ElecReformEIRChiller(EIRChillNum).HRLoopNum, @@ -661,7 +658,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Evaporator Mass Flow Rate", OutputProcessor::Unit::kg_s, - ElecReformEIRChillerReport(EIRChillerNum).Evapmdot, + ElecReformEIRChiller(EIRChillerNum).EvapMassFlowRate, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -717,13 +714,13 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Condenser Outlet Temperature", OutputProcessor::Unit::C, - ElecReformEIRChillerReport(EIRChillerNum).CondOutletTemp, + ElecReformEIRChiller(EIRChillerNum).CondOutletTemp, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, - ElecReformEIRChillerReport(EIRChillerNum).Condmdot, + ElecReformEIRChiller(EIRChillerNum).CondMassFlowRate, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -1703,9 +1700,9 @@ namespace ChillerReformulatedEIR { // Check that condenser outlet temperature is within curve object limits prior to calling RegulaFalsi CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Tmin); - CondTempMin = CondOutletTemp; + CondTempMin = ElecReformEIRChiller(EIRChillNum).CondOutletTemp; CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Tmax); - CondTempMax = CondOutletTemp; + CondTempMax = ElecReformEIRChiller(EIRChillNum).CondOutletTemp; if (CondTempMin > Tmin && CondTempMax < Tmax) { @@ -1738,8 +1735,8 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd(ElecReformEIRChiller(EIRChillNum).Name + ": Iteration limit exceeded calculating condenser outlet temperature.", ElecReformEIRChiller(EIRChillNum).IterLimitErrIndex, - CondOutletTemp, - CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).CondOutletTemp, + ElecReformEIRChiller(EIRChillNum).CondOutletTemp); } } } else if (SolFla == -2) { @@ -1755,8 +1752,8 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd(ElecReformEIRChiller(EIRChillNum).Name + ": Solution is not found in calculating condenser outlet temperature.", ElecReformEIRChiller(EIRChillNum).IterFailedIndex, - CondOutletTemp, - CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).CondOutletTemp, + ElecReformEIRChiller(EIRChillNum).CondOutletTemp); } } CalcReformEIRChillerModel( @@ -1765,7 +1762,7 @@ namespace ChillerReformulatedEIR { } else { // If iteration is not possible, average the min/max condenser outlet temperature and manually determine solution CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, (CondTempMin + CondTempMax) / 2.0); - CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, CondOutletTemp); + CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, ElecReformEIRChiller(EIRChillNum).CondOutletTemp); } // Call subroutine to evaluate all performance curve min/max values against evaporator/condenser outlet temps and PLR @@ -1912,10 +1909,8 @@ namespace ChillerReformulatedEIR { ElecReformEIRChillerReport(Num).CondEnergy = 0.0; ElecReformEIRChillerReport(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; ElecReformEIRChillerReport(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; - ElecReformEIRChillerReport(Num).CondOutletTemp = DataLoopNode::Node(CondOutletNode).Temp; + ElecReformEIRChiller(Num).CondOutletTemp = DataLoopNode::Node(CondOutletNode).Temp; ElecReformEIRChiller(Num).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).Temp; - ElecReformEIRChillerReport(Num).Evapmdot = EvapMassFlowRate; // could still be flow if in series - ElecReformEIRChillerReport(Num).Condmdot = CondMassFlowRate; // could still be flow if in series ElecReformEIRChillerReport(Num).ActualCOP = 0.0; if (ElecReformEIRChiller(Num).HeatRecActive) { @@ -1931,7 +1926,7 @@ namespace ChillerReformulatedEIR { } else { // Chiller is running, so pass calculated values // Set node temperatures DataLoopNode::Node(EvapOutletNode).Temp = ElecReformEIRChiller(Num).EvapOutletTemp; - DataLoopNode::Node(CondOutletNode).Temp = CondOutletTemp; + DataLoopNode::Node(CondOutletNode).Temp = ElecReformEIRChiller(Num).CondOutletTemp; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available ElecReformEIRChillerReport(Num).ChillerFalseLoad = ElecReformEIRChiller(Num).ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; @@ -1940,9 +1935,6 @@ namespace ChillerReformulatedEIR { ElecReformEIRChillerReport(Num).CondEnergy = ElecReformEIRChiller(Num).QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; ElecReformEIRChillerReport(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; ElecReformEIRChillerReport(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; - ElecReformEIRChillerReport(Num).CondOutletTemp = DataLoopNode::Node(CondOutletNode).Temp; - ElecReformEIRChillerReport(Num).Evapmdot = EvapMassFlowRate; - ElecReformEIRChillerReport(Num).Condmdot = CondMassFlowRate; if (ElecReformEIRChiller(Num).Power != 0.0) { ElecReformEIRChillerReport(Num).ActualCOP = (ElecReformEIRChiller(Num).QEvaporator + ElecReformEIRChiller(Num).ChillerFalseLoadRate) / ElecReformEIRChiller(Num).Power; } else { @@ -1987,10 +1979,6 @@ namespace ChillerReformulatedEIR { bool RunFlag; // TRUE when chiller operating int EquipFlowCtrl; // Flow control mode for the equipment - // FalsiCondOutTemp = Value used by RegulaFalsi during iteration (used to evaluate CAPFT, EIRFT, and EIRFPLR curves) - // CondOutletTemp = Value calculated by CalcReformEIRChillerModel subroutine as shown below - // CondOutletTemp = QCondenser/CondMassFlowRate/CPCW(CondInletTemp) + CondInletTemp - EIRChillNum = int(Par(1)); MyLoad = Par(2); RunFlag = (int(Par(3)) == 1); @@ -1998,7 +1986,7 @@ namespace ChillerReformulatedEIR { EquipFlowCtrl = int(Par(6)); CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, FalsiCondOutTemp); - CondOutTempResidual = FalsiCondOutTemp - CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting + CondOutTempResidual = FalsiCondOutTemp - ElecReformEIRChiller(EIRChillNum).CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting return CondOutTempResidual; } @@ -2074,8 +2062,8 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = 0.0; ElecReformEIRChiller(EIRChillNum).ChillerCyclingRatio = 0.0; ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = 0.0; - EvapMassFlowRate = 0.0; - CondMassFlowRate = 0.0; + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = 0.0; + ElecReformEIRChiller(EIRChillNum).CondMassFlowRate = 0.0; ElecReformEIRChiller(EIRChillNum).Power = 0.0; ElecReformEIRChiller(EIRChillNum).QCondenser = 0.0; ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; @@ -2103,7 +2091,7 @@ namespace ChillerReformulatedEIR { // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { - EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; } if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { if (DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum) @@ -2111,7 +2099,7 @@ namespace ChillerReformulatedEIR { .Branch(ElecReformEIRChiller(EIRChillNum).CDBranchNum) .Comp(ElecReformEIRChiller(EIRChillNum).CDCompNum) .FlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive) { - CondMassFlowRate = DataLoopNode::Node(CondInletNode).MassFlowRate; + ElecReformEIRChiller(EIRChillNum).CondMassFlowRate = DataLoopNode::Node(CondInletNode).MassFlowRate; } } @@ -2146,8 +2134,8 @@ namespace ChillerReformulatedEIR { // Set mass flow rates if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { - CondMassFlowRate = ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax; - PlantUtilities::SetComponentFlowRate(CondMassFlowRate, + ElecReformEIRChiller(EIRChillNum).CondMassFlowRate = ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax; + PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).CondMassFlowRate, CondInletNode, CondOutletNode, ElecReformEIRChiller(EIRChillNum).CDLoopNum, @@ -2162,9 +2150,9 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, DataPlant::CriteriaType_MassFlowRate, - CondMassFlowRate); + ElecReformEIRChiller(EIRChillNum).CondMassFlowRate); - if (CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; + if (ElecReformEIRChiller(EIRChillNum).CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; } FRAC = 1.0; @@ -2213,7 +2201,7 @@ namespace ChillerReformulatedEIR { if ((ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChiller(EIRChillNum).QCondenser) > 0.0) { // protect div by zero ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = (ElecReformEIRChiller(EIRChillNum).QHeatRecovery * ElecReformEIRChillerReport(EIRChillNum).HeatRecOutletTemp + - ElecReformEIRChiller(EIRChillNum).QCondenser * ElecReformEIRChillerReport(EIRChillNum).CondOutletTemp) / + ElecReformEIRChiller(EIRChillNum).QCondenser * ElecReformEIRChiller(EIRChillNum).CondOutletTemp) / (ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChiller(EIRChillNum).QCondenser); } else { ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = FalsiCondOutTemp; @@ -2228,9 +2216,9 @@ namespace ChillerReformulatedEIR { // Available chiller capacity as a function of temperature AvailChillerCap = ChillerRefCap * ElecReformEIRChiller(EIRChillNum).ChillerCapFT; - EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; // Some other component set the flow to 0. No reason to continue with calculations. - if (EvapMassFlowRate == 0.0) { + if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate == 0.0) { MyLoad = 0.0; return; } @@ -2274,17 +2262,17 @@ namespace ChillerReformulatedEIR { if ((ElecReformEIRChiller(EIRChillNum).FlowMode == ConstantFlow) || (ElecReformEIRChiller(EIRChillNum).FlowMode == NotModulated)) { // Set the evaporator mass flow rate to design // Start by assuming max (design) flow - EvapMassFlowRate = EvapMassFlowRateMax; + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = EvapMassFlowRateMax; // Use PlantUtilities::SetComponentFlowRate to decide actual flow - PlantUtilities::SetComponentFlowRate(EvapMassFlowRate, + PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, EvapInletNode, EvapOutletNode, ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CWBranchNum, ElecReformEIRChiller(EIRChillNum).CWCompNum); - if (EvapMassFlowRate != 0.0) { - EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / EvapMassFlowRate / Cp; + if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate != 0.0) { + EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; } else { EvapDeltaTemp = 0.0; } @@ -2303,12 +2291,12 @@ namespace ChillerReformulatedEIR { } if (EvapDeltaTemp != 0) { - EvapMassFlowRate = max(0.0, (ElecReformEIRChiller(EIRChillNum).QEvaporator / Cp / EvapDeltaTemp)); - if ((EvapMassFlowRate - EvapMassFlowRateMax) > DataBranchAirLoopPlant::MassFlowTolerance) ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = true; + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = max(0.0, (ElecReformEIRChiller(EIRChillNum).QEvaporator / Cp / EvapDeltaTemp)); + if ((ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate - EvapMassFlowRateMax) > DataBranchAirLoopPlant::MassFlowTolerance) ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = true; // Check to see if the Maximum is exceeded, if so set to maximum - EvapMassFlowRate = min(EvapMassFlowRateMax, EvapMassFlowRate); + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = min(EvapMassFlowRateMax, ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate); // Use PlantUtilities::SetComponentFlowRate to decide actual flow - PlantUtilities::SetComponentFlowRate(EvapMassFlowRate, + PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, EvapInletNode, EvapOutletNode, ElecReformEIRChiller(EIRChillNum).CWLoopNum, @@ -2324,12 +2312,12 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempSetPointHi; } } - ElecReformEIRChiller(EIRChillNum).QEvaporator = max(0.0, (EvapMassFlowRate * Cp * EvapDeltaTemp)); + ElecReformEIRChiller(EIRChillNum).QEvaporator = max(0.0, (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp)); } else { // Try to request zero flow - EvapMassFlowRate = 0.0; + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = 0.0; // Use PlantUtilities::SetComponentFlowRate to decide actual flow - PlantUtilities::SetComponentFlowRate(EvapMassFlowRate, + PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, EvapInletNode, EvapOutletNode, ElecReformEIRChiller(EIRChillNum).CWLoopNum, @@ -2359,7 +2347,7 @@ namespace ChillerReformulatedEIR { // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation) && - (EvapMassFlowRate > 0)) { + (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTIndex; bool VarFlowFlag = (ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated); @@ -2369,7 +2357,7 @@ namespace ChillerReformulatedEIR { Cp, DataLoopNode::Node(EvapInletNode).Temp, ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, - EvapMassFlowRate, + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, ElecReformEIRChiller(EIRChillNum).QEvaporator); // update corresponding variables at faulty case PartLoadRat = (AvailChillerCap > 0.0) ? (ElecReformEIRChiller(EIRChillNum).QEvaporator / AvailChillerCap) : 0.0; @@ -2378,8 +2366,8 @@ namespace ChillerReformulatedEIR { } } else { // If FlowLock is True - EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; - PlantUtilities::SetComponentFlowRate(EvapMassFlowRate, + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; + PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, EvapInletNode, EvapOutletNode, ElecReformEIRChiller(EIRChillNum).CWLoopNum, @@ -2387,46 +2375,46 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CWBranchNum, ElecReformEIRChiller(EIRChillNum).CWCompNum); // Some other component set the flow to 0. No reason to continue with calculations. - if (EvapMassFlowRate == 0.0) { + if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate == 0.0) { MyLoad = 0.0; return; } if (ElecReformEIRChiller(EIRChillNum).PossibleSubcooling) { ElecReformEIRChiller(EIRChillNum).QEvaporator = std::abs(MyLoad); - EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / EvapMassFlowRate / Cp; + EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else { EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTempSetPoint; - ElecReformEIRChiller(EIRChillNum).QEvaporator = max(0.0, (EvapMassFlowRate * Cp * EvapDeltaTemp)); + ElecReformEIRChiller(EIRChillNum).QEvaporator = max(0.0, (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp)); ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = EvapOutletTempSetPoint; } if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < TempLowLimitEout) { if ((DataLoopNode::Node(EvapInletNode).Temp - TempLowLimitEout) > DataPlant::DeltaTempTol) { ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = TempLowLimitEout; EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; - ElecReformEIRChiller(EIRChillNum).QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; } else { ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; - ElecReformEIRChiller(EIRChillNum).QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; } } if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < DataLoopNode::Node(EvapOutletNode).TempMin) { if ((DataLoopNode::Node(EvapInletNode).Temp - DataLoopNode::Node(EvapOutletNode).TempMin) > DataPlant::DeltaTempTol) { ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempMin; EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; - ElecReformEIRChiller(EIRChillNum).QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; } else { ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; - ElecReformEIRChiller(EIRChillNum).QEvaporator = EvapMassFlowRate * Cp * EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; } } // If load exceeds the distributed load set to the distributed load if (ElecReformEIRChiller(EIRChillNum).QEvaporator > std::abs(MyLoad)) { - if (EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { + if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { ElecReformEIRChiller(EIRChillNum).QEvaporator = std::abs(MyLoad); - EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / EvapMassFlowRate / Cp; + EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else { ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; @@ -2436,7 +2424,7 @@ namespace ChillerReformulatedEIR { // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation) && - (EvapMassFlowRate > 0)) { + (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTIndex; bool VarFlowFlag = false; @@ -2446,16 +2434,16 @@ namespace ChillerReformulatedEIR { Cp, DataLoopNode::Node(EvapInletNode).Temp, ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, - EvapMassFlowRate, + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, ElecReformEIRChiller(EIRChillNum).QEvaporator); // update corresponding variables at faulty case } // Checks QEvaporator on the basis of the machine limits. if (ElecReformEIRChiller(EIRChillNum).QEvaporator > (AvailChillerCap * MaxPartLoadRat)) { - if (EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { + if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { ElecReformEIRChiller(EIRChillNum).QEvaporator = AvailChillerCap * MaxPartLoadRat; - EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / EvapMassFlowRate / Cp; + EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; // evaporator outlet temperature is allowed to float upwards (recalculate AvailChillerCap? iterate?) ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; } else { @@ -2517,15 +2505,15 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).QCondenser = ElecReformEIRChiller(EIRChillNum).Power * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac + ElecReformEIRChiller(EIRChillNum).QEvaporator + ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate; // Currently only water cooled chillers are allowed for the reformulated EIR chiller model - if (CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { + if (ElecReformEIRChiller(EIRChillNum).CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) - ReformEIRChillerHeatRecovery(EIRChillNum, ElecReformEIRChiller(EIRChillNum).QCondenser, CondMassFlowRate, CondInletTemp, ElecReformEIRChiller(EIRChillNum).QHeatRecovery); + ReformEIRChillerHeatRecovery(EIRChillNum, ElecReformEIRChiller(EIRChillNum).QCondenser, ElecReformEIRChiller(EIRChillNum).CondMassFlowRate, CondInletTemp, ElecReformEIRChiller(EIRChillNum).QHeatRecovery); Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); - CondOutletTemp = ElecReformEIRChiller(EIRChillNum).QCondenser / CondMassFlowRate / Cp + CondInletTemp; + ElecReformEIRChiller(EIRChillNum).CondOutletTemp = ElecReformEIRChiller(EIRChillNum).QCondenser / ElecReformEIRChiller(EIRChillNum).CondMassFlowRate / Cp + CondInletTemp; } else { ShowSevereError("ControlReformEIRChillerModel: Condenser flow = 0, for ElecReformEIRChiller=" + ElecReformEIRChiller(EIRChillNum).Name); ShowContinueErrorTimeStamp(""); @@ -2650,11 +2638,11 @@ namespace ChillerReformulatedEIR { EIRFPLRPLRmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax; // Check bounds for curves, lump min/max into same check since min/max values are reported in recurring warning messages - if (CondOutletTemp < CAPFTYTmin || CondOutletTemp > CAPFTYTmax) { + if (ElecReformEIRChiller(EIRChillNum).CondOutletTemp < CAPFTYTmin || ElecReformEIRChiller(EIRChillNum).CondOutletTemp > CAPFTYTmax) { ++ElecReformEIRChiller(EIRChillNum).CAPFTYIter; if (ElecReformEIRChiller(EIRChillNum).CAPFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(CondOutletTemp, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Cooling Capacity Function of " "Temperature biquadratic curve = " + ElecReformEIRChiller(EIRChillNum).CAPFTName); @@ -2662,22 +2650,22 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", ElecReformEIRChiller(EIRChillNum).CAPFTYIterIndex, - CondOutletTemp, - CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).CondOutletTemp, + ElecReformEIRChiller(EIRChillNum).CondOutletTemp); } else { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", ElecReformEIRChiller(EIRChillNum).CAPFTYIterIndex, - CondOutletTemp, - CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).CondOutletTemp, + ElecReformEIRChiller(EIRChillNum).CondOutletTemp); } } - if (CondOutletTemp < EIRFTYTmin || CondOutletTemp > EIRFTYTmax) { + if (ElecReformEIRChiller(EIRChillNum).CondOutletTemp < EIRFTYTmin || ElecReformEIRChiller(EIRChillNum).CondOutletTemp > EIRFTYTmax) { ++ElecReformEIRChiller(EIRChillNum).EIRFTYIter; if (ElecReformEIRChiller(EIRChillNum).EIRFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(CondOutletTemp, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Electric Input to Cooling Output Ratio " "Function of Temperature biquadratic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFTName); @@ -2686,24 +2674,24 @@ namespace ChillerReformulatedEIR { "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", ElecReformEIRChiller(EIRChillNum).EIRFTYIterIndex, - CondOutletTemp, - CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).CondOutletTemp, + ElecReformEIRChiller(EIRChillNum).CondOutletTemp); } else { ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", ElecReformEIRChiller(EIRChillNum).EIRFTYIterIndex, - CondOutletTemp, - CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).CondOutletTemp, + ElecReformEIRChiller(EIRChillNum).CondOutletTemp); } } if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - if (CondOutletTemp < EIRFPLRTmin || CondOutletTemp > EIRFPLRTmax) { + if (ElecReformEIRChiller(EIRChillNum).CondOutletTemp < EIRFPLRTmin || ElecReformEIRChiller(EIRChillNum).CondOutletTemp > EIRFPLRTmax) { ++ElecReformEIRChiller(EIRChillNum).EIRFPLRTIter; if (ElecReformEIRChiller(EIRChillNum).EIRFPLRTIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(CondOutletTemp, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (X var) given in Electric Input to Cooling Output " "Ratio Function of Part-load Ratio bicubic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFPLRName); @@ -2713,15 +2701,15 @@ namespace ChillerReformulatedEIR { "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", ElecReformEIRChiller(EIRChillNum).EIRFPLRTIterIndex, - CondOutletTemp, - CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).CondOutletTemp, + ElecReformEIRChiller(EIRChillNum).CondOutletTemp); } else { ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", ElecReformEIRChiller(EIRChillNum).EIRFPLRTIterIndex, - CondOutletTemp, - CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).CondOutletTemp, + ElecReformEIRChiller(EIRChillNum).CondOutletTemp); } } } @@ -2777,7 +2765,7 @@ namespace ChillerReformulatedEIR { } } - ElecReformEIRChiller(EIRChillNum).ChillerCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, EvapOutletTempSetPoint, CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).ChillerCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, EvapOutletTempSetPoint, ElecReformEIRChiller(EIRChillNum).CondOutletTemp); if (ElecReformEIRChiller(EIRChillNum).ChillerCapFT < 0) { if (ElecReformEIRChiller(EIRChillNum).ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && @@ -2787,7 +2775,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, 3) + ")."); ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTempSetPoint, 1) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(CondOutletTemp, 1) + '.'); + " and a Condenser Leaving Temp of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerCapFTError; @@ -2799,7 +2787,7 @@ namespace ChillerReformulatedEIR { } } - ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, CondOutletTemp); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, ElecReformEIRChiller(EIRChillNum).CondOutletTemp); if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFT < 0.0) { if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && @@ -2809,7 +2797,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Reformulated Chiller EIR as a Function of Temperature curve output is negative (" + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, 3) + ")."); ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, 1) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(CondOutletTemp, 1) + '.'); + " and a Condenser Leaving Temp of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError; @@ -2822,9 +2810,9 @@ namespace ChillerReformulatedEIR { } if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, CondOutletTemp, ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio); + ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).CondOutletTemp, ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { - ChillerLift = CondOutletTemp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + ChillerLift = ElecReformEIRChiller(EIRChillNum).CondOutletTemp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; ChillerTdev = std::abs(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); ChillerLiftRef = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; @@ -2843,7 +2831,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Chiller EIR as a function of PLR and condenser water temperature curve output is negative (" + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, 3) + ")."); ShowContinueError(" Negative value occurs using a part-load ratio of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, 3) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(CondOutletTemp, 1) + " C."); + " and a Condenser Leaving Temp of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 1) + " C."); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError; diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index b8b892dde87..c6f1f2a2f6f 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -202,6 +202,9 @@ namespace ChillerReformulatedEIR { Real64 QEvaporator; // reporting: Evaporator heat transfer rate [W] Real64 Power; // reporting: Chiller power [W] Real64 EvapOutletTemp; // reporting: Evaporator outlet temperature [C] + Real64 CondOutletTemp; // reporting: Condenser outlet temperature [C] + Real64 EvapMassFlowRate; // reporting: Evaporator mass flow rate [kg/s] + Real64 CondMassFlowRate; // Condenser mass flow rate [kg/s] // Default Constructor ReformulatedEIRChillerSpecs() @@ -227,7 +230,8 @@ namespace ChillerReformulatedEIR { FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0), FaultyChillerFoulingFactor(1.0), MyEnvrnFlag(true), MyInitFlag(true), MySizeFlag(true), ChillerCondAvgTemp(0.0), ChillerFalseLoadRate(0.0), ChillerCyclingRatio(0.0), ChillerPartLoadRatio(0.0), ChillerEIRFPLR(0.0), ChillerEIRFT(0.0), ChillerCapFT(0.0), HeatRecOutletTemp(0.0), - QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0) + QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0), CondOutletTemp(0.0), + EvapMassFlowRate(0.0), CondMassFlowRate(0.0) { } }; @@ -241,9 +245,6 @@ namespace ChillerReformulatedEIR { Real64 CondEnergy; // reporting: Condenser heat transfer energy [J] Real64 CondInletTemp; // reporting: Condenser inlet temperature [C] Real64 EvapInletTemp; // reporting: Evaporator inlet temperature [C] - Real64 CondOutletTemp; // reporting: Condenser outlet temperature [C] - Real64 Evapmdot; // reporting: Evaporator mass flow rate [kg/s] - Real64 Condmdot; // reporting: Condenser mass flow rate [kg/s] Real64 ActualCOP; // reporting: Coefficient of performance Real64 EnergyHeatRecovery; // reporting: Energy recovered from water-cooled condenser [J] Real64 HeatRecInletTemp; // reporting: Heat reclaim inlet temperature [C] @@ -253,8 +254,8 @@ namespace ChillerReformulatedEIR { // Default Constructor ReportVars() : ChillerFalseLoad(0.0), - Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), CondOutletTemp(0.0), - Evapmdot(0.0), Condmdot(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), + Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), + ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), HeatRecOutletTemp(0.0), HeatRecMassFlow(0.0) { } From cca45d4d0513cba7099c262d910fc27570eae7f7 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 09:59:52 -0700 Subject: [PATCH 10/41] remove extra struct --- src/EnergyPlus/ChillerReformulatedEIR.cc | 80 ++++++++++++------------ src/EnergyPlus/ChillerReformulatedEIR.hh | 40 ++++-------- src/EnergyPlus/OutputReportTabular.cc | 3 +- 3 files changed, 53 insertions(+), 70 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 2f78328c9c3..23f7f37ed5d 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -136,7 +136,6 @@ namespace ChillerReformulatedEIR { // Object Data Array1D ElecReformEIRChiller; // dimension to number of machines - Array1D ElecReformEIRChillerReport; void SimReformulatedEIRChiller(std::string const &EP_UNUSED(EIRChillerType), // Type of chiller !unused1208 std::string const &EIRChillerName, // User specified name of chiller @@ -226,7 +225,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, ElecReformEIRChiller(EIRChillNum).QCondenser, - ElecReformEIRChillerReport(EIRChillNum).CondInletTemp, + ElecReformEIRChiller(EIRChillNum).CondInletTemp, ElecReformEIRChiller(EIRChillNum).CondOutletTemp, ElecReformEIRChiller(EIRChillNum).CondMassFlowRate, FirstIteration); @@ -237,9 +236,9 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, ElecReformEIRChiller(EIRChillNum).HeatRecOutletNodeNum, ElecReformEIRChiller(EIRChillNum).QHeatRecovery, - ElecReformEIRChillerReport(EIRChillNum).HeatRecInletTemp, - ElecReformEIRChillerReport(EIRChillNum).HeatRecOutletTemp, - ElecReformEIRChillerReport(EIRChillNum).HeatRecMassFlow, + ElecReformEIRChiller(EIRChillNum).HeatRecInletTemp, + ElecReformEIRChiller(EIRChillNum).HeatRecOutletTemp, + ElecReformEIRChiller(EIRChillNum).HeatRecMassFlow, FirstIteration); } } @@ -275,7 +274,6 @@ namespace ChillerReformulatedEIR { // ALLOCATE ARRAYS ElecReformEIRChiller.allocate(NumElecReformEIRChillers); - ElecReformEIRChillerReport.allocate(NumElecReformEIRChillers); // Load arrays with reformulated electric EIR chiller data for (EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { @@ -605,7 +603,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Electric Energy", OutputProcessor::Unit::J, - ElecReformEIRChillerReport(EIRChillerNum).Energy, + ElecReformEIRChiller(EIRChillerNum).Energy, "System", "Sum", ElecReformEIRChiller(EIRChillerNum).Name, @@ -623,7 +621,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Evaporator Cooling Energy", OutputProcessor::Unit::J, - ElecReformEIRChillerReport(EIRChillerNum).EvapEnergy, + ElecReformEIRChiller(EIRChillerNum).EvapEnergy, "System", "Sum", ElecReformEIRChiller(EIRChillerNum).Name, @@ -640,13 +638,13 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller False Load Heat Transfer Energy", OutputProcessor::Unit::J, - ElecReformEIRChillerReport(EIRChillerNum).ChillerFalseLoad, + ElecReformEIRChiller(EIRChillerNum).ChillerFalseLoad, "System", "Sum", ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Evaporator Inlet Temperature", OutputProcessor::Unit::C, - ElecReformEIRChillerReport(EIRChillerNum).EvapInletTemp, + ElecReformEIRChiller(EIRChillerNum).EvapInletTemp, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -671,7 +669,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Condenser Heat Transfer Energy", OutputProcessor::Unit::J, - ElecReformEIRChillerReport(EIRChillerNum).CondEnergy, + ElecReformEIRChiller(EIRChillerNum).CondEnergy, "System", "Sum", ElecReformEIRChiller(EIRChillerNum).Name, @@ -682,7 +680,7 @@ namespace ChillerReformulatedEIR { "Plant"); SetupOutputVariable("Chiller COP", OutputProcessor::Unit::W_W, - ElecReformEIRChillerReport(EIRChillerNum).ActualCOP, + ElecReformEIRChiller(EIRChillerNum).ActualCOP, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -708,7 +706,7 @@ namespace ChillerReformulatedEIR { SetupOutputVariable("Chiller Condenser Inlet Temperature", OutputProcessor::Unit::C, - ElecReformEIRChillerReport(EIRChillerNum).CondInletTemp, + ElecReformEIRChiller(EIRChillerNum).CondInletTemp, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -735,7 +733,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Total Recovered Heat Energy", OutputProcessor::Unit::J, - ElecReformEIRChillerReport(EIRChillerNum).EnergyHeatRecovery, + ElecReformEIRChiller(EIRChillerNum).EnergyHeatRecovery, "System", "Sum", ElecReformEIRChiller(EIRChillerNum).Name, @@ -746,19 +744,19 @@ namespace ChillerReformulatedEIR { "Plant"); SetupOutputVariable("Chiller Heat Recovery Inlet Temperature", OutputProcessor::Unit::C, - ElecReformEIRChillerReport(EIRChillerNum).HeatRecInletTemp, + ElecReformEIRChiller(EIRChillerNum).HeatRecInletTemp, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Heat Recovery Outlet Temperature", OutputProcessor::Unit::C, - ElecReformEIRChillerReport(EIRChillerNum).HeatRecOutletTemp, + ElecReformEIRChiller(EIRChillerNum).HeatRecOutletTemp, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); SetupOutputVariable("Chiller Heat Recovery Mass Flow Rate", OutputProcessor::Unit::kg_s, - ElecReformEIRChillerReport(EIRChillerNum).HeatRecMassFlow, + ElecReformEIRChiller(EIRChillerNum).HeatRecMassFlow, "System", "Average", ElecReformEIRChiller(EIRChillerNum).Name); @@ -1900,27 +1898,27 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(Num).ChillerPartLoadRatio = 0.0; ElecReformEIRChiller(Num).ChillerCyclingRatio = 0.0; ElecReformEIRChiller(Num).ChillerFalseLoadRate = 0.0; - ElecReformEIRChillerReport(Num).ChillerFalseLoad = 0.0; + ElecReformEIRChiller(Num).ChillerFalseLoad = 0.0; ElecReformEIRChiller(Num).Power = 0.0; ElecReformEIRChiller(Num).QEvaporator = 0.0; ElecReformEIRChiller(Num).QCondenser = 0.0; - ElecReformEIRChillerReport(Num).Energy = 0.0; - ElecReformEIRChillerReport(Num).EvapEnergy = 0.0; - ElecReformEIRChillerReport(Num).CondEnergy = 0.0; - ElecReformEIRChillerReport(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; - ElecReformEIRChillerReport(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; + ElecReformEIRChiller(Num).Energy = 0.0; + ElecReformEIRChiller(Num).EvapEnergy = 0.0; + ElecReformEIRChiller(Num).CondEnergy = 0.0; + ElecReformEIRChiller(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; + ElecReformEIRChiller(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; ElecReformEIRChiller(Num).CondOutletTemp = DataLoopNode::Node(CondOutletNode).Temp; ElecReformEIRChiller(Num).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).Temp; - ElecReformEIRChillerReport(Num).ActualCOP = 0.0; + ElecReformEIRChiller(Num).ActualCOP = 0.0; if (ElecReformEIRChiller(Num).HeatRecActive) { PlantUtilities::SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); ElecReformEIRChiller(Num).QHeatRecovery = 0.0; - ElecReformEIRChillerReport(Num).EnergyHeatRecovery = 0.0; - ElecReformEIRChillerReport(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; - ElecReformEIRChillerReport(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; - ElecReformEIRChillerReport(Num).HeatRecMassFlow = DataLoopNode::Node(HeatRecInNode).MassFlowRate; + ElecReformEIRChiller(Num).EnergyHeatRecovery = 0.0; + ElecReformEIRChiller(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; + ElecReformEIRChiller(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; + ElecReformEIRChiller(Num).HeatRecMassFlow = DataLoopNode::Node(HeatRecInNode).MassFlowRate; } } else { // Chiller is running, so pass calculated values @@ -1929,26 +1927,26 @@ namespace ChillerReformulatedEIR { DataLoopNode::Node(CondOutletNode).Temp = ElecReformEIRChiller(Num).CondOutletTemp; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available - ElecReformEIRChillerReport(Num).ChillerFalseLoad = ElecReformEIRChiller(Num).ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChillerReport(Num).Energy = ElecReformEIRChiller(Num).Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChillerReport(Num).EvapEnergy = ElecReformEIRChiller(Num).QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChillerReport(Num).CondEnergy = ElecReformEIRChiller(Num).QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChillerReport(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; - ElecReformEIRChillerReport(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; + ElecReformEIRChiller(Num).ChillerFalseLoad = ElecReformEIRChiller(Num).ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChiller(Num).Energy = ElecReformEIRChiller(Num).Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChiller(Num).EvapEnergy = ElecReformEIRChiller(Num).QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChiller(Num).CondEnergy = ElecReformEIRChiller(Num).QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChiller(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; + ElecReformEIRChiller(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; if (ElecReformEIRChiller(Num).Power != 0.0) { - ElecReformEIRChillerReport(Num).ActualCOP = (ElecReformEIRChiller(Num).QEvaporator + ElecReformEIRChiller(Num).ChillerFalseLoadRate) / ElecReformEIRChiller(Num).Power; + ElecReformEIRChiller(Num).ActualCOP = (ElecReformEIRChiller(Num).QEvaporator + ElecReformEIRChiller(Num).ChillerFalseLoadRate) / ElecReformEIRChiller(Num).Power; } else { - ElecReformEIRChillerReport(Num).ActualCOP = 0.0; + ElecReformEIRChiller(Num).ActualCOP = 0.0; } if (ElecReformEIRChiller(Num).HeatRecActive) { PlantUtilities::SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); - ElecReformEIRChillerReport(Num).EnergyHeatRecovery = ElecReformEIRChiller(Num).QHeatRecovery * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + ElecReformEIRChiller(Num).EnergyHeatRecovery = ElecReformEIRChiller(Num).QHeatRecovery * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; DataLoopNode::Node(HeatRecOutNode).Temp = ElecReformEIRChiller(Num).HeatRecOutletTemp; - ElecReformEIRChillerReport(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; - ElecReformEIRChillerReport(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; - ElecReformEIRChillerReport(Num).HeatRecMassFlow = DataLoopNode::Node(HeatRecInNode).MassFlowRate; + ElecReformEIRChiller(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; + ElecReformEIRChiller(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; + ElecReformEIRChiller(Num).HeatRecMassFlow = DataLoopNode::Node(HeatRecInNode).MassFlowRate; } } } @@ -2200,7 +2198,7 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { if ((ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChiller(EIRChillNum).QCondenser) > 0.0) { // protect div by zero - ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = (ElecReformEIRChiller(EIRChillNum).QHeatRecovery * ElecReformEIRChillerReport(EIRChillNum).HeatRecOutletTemp + + ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = (ElecReformEIRChiller(EIRChillNum).QHeatRecovery * ElecReformEIRChiller(EIRChillNum).HeatRecOutletTemp + ElecReformEIRChiller(EIRChillNum).QCondenser * ElecReformEIRChiller(EIRChillNum).CondOutletTemp) / (ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChiller(EIRChillNum).QCondenser); } else { diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index c6f1f2a2f6f..6451fe312db 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -205,6 +205,16 @@ namespace ChillerReformulatedEIR { Real64 CondOutletTemp; // reporting: Condenser outlet temperature [C] Real64 EvapMassFlowRate; // reporting: Evaporator mass flow rate [kg/s] Real64 CondMassFlowRate; // Condenser mass flow rate [kg/s] + Real64 ChillerFalseLoad; // reporting: Chiller false load over and above water side load [W] + Real64 Energy; // reporting: Chiller electric consumption [J] + Real64 EvapEnergy; // reporting: Evaporator heat transfer energy [J] + Real64 CondEnergy; // reporting: Condenser heat transfer energy [J] + Real64 CondInletTemp; // reporting: Condenser inlet temperature [C] + Real64 EvapInletTemp; // reporting: Evaporator inlet temperature [C] + Real64 ActualCOP; // reporting: Coefficient of performance + Real64 EnergyHeatRecovery; // reporting: Energy recovered from water-cooled condenser [J] + Real64 HeatRecInletTemp; // reporting: Heat reclaim inlet temperature [C] + Real64 HeatRecMassFlow; // reporting: Heat reclaim mass flow rate [kg/s] // Default Constructor ReformulatedEIRChillerSpecs() @@ -231,39 +241,15 @@ namespace ChillerReformulatedEIR { MyInitFlag(true), MySizeFlag(true), ChillerCondAvgTemp(0.0), ChillerFalseLoadRate(0.0), ChillerCyclingRatio(0.0), ChillerPartLoadRatio(0.0), ChillerEIRFPLR(0.0), ChillerEIRFT(0.0), ChillerCapFT(0.0), HeatRecOutletTemp(0.0), QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0), CondOutletTemp(0.0), - EvapMassFlowRate(0.0), CondMassFlowRate(0.0) - { - } - }; - - struct ReportVars - { - // Members - Real64 ChillerFalseLoad; // reporting: Chiller false load over and above water side load [W] - Real64 Energy; // reporting: Chiller electric consumption [J] - Real64 EvapEnergy; // reporting: Evaporator heat transfer energy [J] - Real64 CondEnergy; // reporting: Condenser heat transfer energy [J] - Real64 CondInletTemp; // reporting: Condenser inlet temperature [C] - Real64 EvapInletTemp; // reporting: Evaporator inlet temperature [C] - Real64 ActualCOP; // reporting: Coefficient of performance - Real64 EnergyHeatRecovery; // reporting: Energy recovered from water-cooled condenser [J] - Real64 HeatRecInletTemp; // reporting: Heat reclaim inlet temperature [C] - Real64 HeatRecOutletTemp; // reporting: Heat reclaim outlet temperature [C] - Real64 HeatRecMassFlow; // reporting: Heat reclaim mass flow rate [kg/s] - - // Default Constructor - ReportVars() - : ChillerFalseLoad(0.0), - Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), - ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), - HeatRecOutletTemp(0.0), HeatRecMassFlow(0.0) + EvapMassFlowRate(0.0), CondMassFlowRate(0.0), ChillerFalseLoad(0.0), Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), + CondInletTemp(0.0), EvapInletTemp(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), + HeatRecMassFlow(0.0) { } }; // Object Data extern Array1D ElecReformEIRChiller; // dimension to number of machines - extern Array1D ElecReformEIRChillerReport; void SimReformulatedEIRChiller(std::string const &EIRChillerType, // Type of chiller !unused1208 std::string const &EIRChillerName, // User specified name of chiller diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 3a2669ec660..b3c8ef7837e 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -4793,7 +4793,6 @@ namespace OutputReportTabular { using ChillerElectricEIR::ElectricEIRChillerReport; using ChillerElectricEIR::NumElectricEIRChillers; using ChillerReformulatedEIR::ElecReformEIRChiller; - using ChillerReformulatedEIR::ElecReformEIRChillerReport; using ChillerReformulatedEIR::NumElecReformEIRChillers; using CondenserLoopTowers::NumSimpleTowers; using CondenserLoopTowers::towers; @@ -4913,7 +4912,7 @@ namespace OutputReportTabular { } for (iChiller = 1; iChiller <= NumElecReformEIRChillers; ++iChiller) { if (ElecReformEIRChiller(iChiller).CondenserType != WaterCooled) { - SysTotalHVACRejectHeatLoss += ElecReformEIRChillerReport(iChiller).CondEnergy; + SysTotalHVACRejectHeatLoss += ElecReformEIRChiller(iChiller).CondEnergy; } } From 45515c277057029605aadda18c7f1046936f1422 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 10:20:22 -0700 Subject: [PATCH 11/41] cleaning up local vars --- src/EnergyPlus/ChillerReformulatedEIR.cc | 301 +++++++++-------------- 1 file changed, 121 insertions(+), 180 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 23f7f37ed5d..5353db8df47 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -166,7 +166,6 @@ namespace ChillerReformulatedEIR { // up reporting variables. int EIRChillNum; - int LoopSide; if (GetInputREIR) { GetElecReformEIRChillerInput(); @@ -218,7 +217,7 @@ namespace ChillerReformulatedEIR { ControlReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl); UpdateReformEIRChillerRecords(MyLoad, RunFlag, EIRChillNum); } else if (LoopNum == ElecReformEIRChiller(EIRChillNum).CDLoopNum) { - LoopSide = ElecReformEIRChiller(EIRChillNum).CDLoopSideNum; + int LoopSide = ElecReformEIRChiller(EIRChillNum).CDLoopSideNum; PlantUtilities::UpdateChillerComponentCondenserSide(LoopNum, LoopSide, DataPlant::TypeOf_Chiller_ElectricReformEIR, @@ -257,12 +256,7 @@ namespace ChillerReformulatedEIR { static std::string const RoutineName("GetElecReformEIRChillerInput: "); // include trailing blank space - int EIRChillerNum; // Chiller counter - int NumAlphas; // Number of elements in the alpha array - int NumNums; // Number of elements in the numeric array - int IOStat; // IO Status when calling get input subroutine bool ErrorsFound(false); // True when input errors found - std::string PartLoadCurveType; // Part load curve type DataIPShortCuts::cCurrentModuleObject = "Chiller:Electric:ReformulatedEIR"; NumElecReformEIRChillers = inputProcessor->getNumObjectsFound(DataIPShortCuts::cCurrentModuleObject); @@ -276,7 +270,10 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller.allocate(NumElecReformEIRChillers); // Load arrays with reformulated electric EIR chiller data - for (EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { + for (int EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { + int NumAlphas; // Number of elements in the alpha array + int NumNums; // Number of elements in the numeric array + int IOStat; // IO Status when calling get input subroutine inputProcessor->getObjectItem(DataIPShortCuts::cCurrentModuleObject, EIRChillerNum, DataIPShortCuts::cAlphaArgs, @@ -312,6 +309,7 @@ namespace ChillerReformulatedEIR { } // The default type of part-load curve is: LeavingCondenserWaterTemperature + std::string PartLoadCurveType; // Part load curve type if (DataIPShortCuts::lAlphaFieldBlanks(4)) { PartLoadCurveType = "LeavingCondenserWaterTemperature"; } else { @@ -582,7 +580,7 @@ namespace ChillerReformulatedEIR { ShowFatalError("Errors found in processing input for " + DataIPShortCuts::cCurrentModuleObject); } - for (EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { + for (int EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { SetupOutputVariable("Chiller Part Load Ratio", OutputProcessor::Unit::None, ElecReformEIRChiller(EIRChillerNum).ChillerPartLoadRatio, @@ -794,39 +792,11 @@ namespace ChillerReformulatedEIR { // Uses the status flags to trigger initializations. static std::string const RoutineName("InitElecReformEIRChiller"); - int EvapInletNode; // Node number for evaporator water inlet node - int EvapOutletNode; // Node number for evaporator water outlet node - int CondInletNode; // Node number for condenser water inlet node - int CondOutletNode; // Node number for condenser water outlet node - int HeatRecInNode(0); // Node number for heat recovery water inlet node - int HeatRecOutNode(0); // Node number for heat recovery water outlet node - Real64 rho; // local fluid density - Real64 mdot; // local fluid mass flow rate - Real64 mdotCond; // local fluid mass flow rate for condenser - int LoopNum; - int LoopSideNum; - int BranchIndex; - int CompIndex; - bool FatalError; - bool errFlag; - bool HeatRecRunFlag; - Real64 HeatRecHighInletLimit; - - // Initialize condenser nodes - EvapInletNode = ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum; - EvapOutletNode = ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum; - CondInletNode = ElecReformEIRChiller(EIRChillNum).CondInletNodeNum; - CondOutletNode = ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum; - - if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - HeatRecInNode = ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum; - HeatRecOutNode = ElecReformEIRChiller(EIRChillNum).HeatRecOutletNodeNum; - } // Init more variables if (ElecReformEIRChiller(EIRChillNum).MyInitFlag) { // Locate the chillers on the plant loops for later usage - errFlag = false; + bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, ElecReformEIRChiller(EIRChillNum).CWLoopNum, @@ -923,9 +893,9 @@ namespace ChillerReformulatedEIR { } } else { // need call to EMS to check node - FatalError = false; // but not really fatal yet, but should be. - EMSManager::CheckIfNodeSetPointManagedByEMS(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, EMSManager::iTemperatureSetPoint, FatalError); - if (FatalError) { + bool fatalError = false; // but not really fatal yet, but should be. + EMSManager::CheckIfNodeSetPointManagedByEMS(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, EMSManager::iTemperatureSetPoint, fatalError); + if (fatalError) { if (!ElecReformEIRChiller(EIRChillNum).ModulatedFlowErrDone) { ShowWarningError("Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + ElecReformEIRChiller(EIRChillNum).Name); @@ -950,7 +920,7 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).MyEnvrnFlag && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { - rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); @@ -959,8 +929,8 @@ namespace ChillerReformulatedEIR { PlantUtilities::InitComponentNodes(0.0, ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax, - EvapInletNode, - EvapOutletNode, + ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, + ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CWBranchNum, @@ -975,26 +945,26 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax = rho * ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; PlantUtilities::InitComponentNodes(0.0, ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax, - CondInletNode, - CondOutletNode, + ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, + ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, ElecReformEIRChiller(EIRChillNum).CDBranchNum, ElecReformEIRChiller(EIRChillNum).CDCompNum); - DataLoopNode::Node(CondInletNode).Temp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; } else { // air or evap air condenser // Initialize maximum available condenser flow rate - DataLoopNode::Node(CondInletNode).MassFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate * + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate * Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::StdBaroPress, ElecReformEIRChiller(EIRChillNum).TempRefCondIn, 0.0, RoutineName); - DataLoopNode::Node(CondOutletNode).MassFlowRate = DataLoopNode::Node(CondInletNode).MassFlowRate; - DataLoopNode::Node(CondInletNode).MassFlowRateMaxAvail = DataLoopNode::Node(CondInletNode).MassFlowRate; - DataLoopNode::Node(CondInletNode).MassFlowRateMax = DataLoopNode::Node(CondInletNode).MassFlowRate; - DataLoopNode::Node(CondOutletNode).MassFlowRateMax = DataLoopNode::Node(CondInletNode).MassFlowRate; - DataLoopNode::Node(CondInletNode).MassFlowRateMinAvail = 0.0; - DataLoopNode::Node(CondInletNode).MassFlowRateMin = 0.0; - DataLoopNode::Node(CondOutletNode).MassFlowRateMinAvail = 0.0; - DataLoopNode::Node(CondOutletNode).MassFlowRateMin = 0.0; - DataLoopNode::Node(CondInletNode).Temp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum).MassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRateMaxAvail = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRateMax = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum).MassFlowRateMax = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRateMinAvail = 0.0; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRateMin = 0.0; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum).MassFlowRateMinAvail = 0.0; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum).MassFlowRateMin = 0.0; + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; } if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { @@ -1032,6 +1002,8 @@ namespace ChillerReformulatedEIR { DataLoopNode::Node(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } + Real64 mdot; + Real64 mdotCond; if ((std::abs(MyLoad) > 0.0) && RunFlag) { mdot = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax; mdotCond = ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax; @@ -1041,8 +1013,8 @@ namespace ChillerReformulatedEIR { } PlantUtilities::SetComponentFlowRate(mdot, - EvapInletNode, - EvapOutletNode, + ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, + ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CWBranchNum, @@ -1050,8 +1022,8 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { PlantUtilities::SetComponentFlowRate(mdotCond, - CondInletNode, - CondOutletNode, + ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, + ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, ElecReformEIRChiller(EIRChillNum).CDBranchNum, @@ -1059,15 +1031,16 @@ namespace ChillerReformulatedEIR { } // Initialize heat recovery flow rates at node if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - LoopNum = ElecReformEIRChiller(EIRChillNum).HRLoopNum; - LoopSideNum = ElecReformEIRChiller(EIRChillNum).HRLoopSideNum; - BranchIndex = ElecReformEIRChiller(EIRChillNum).HRBranchNum; - CompIndex = ElecReformEIRChiller(EIRChillNum).HRCompNum; + int LoopNum = ElecReformEIRChiller(EIRChillNum).HRLoopNum; + int LoopSideNum = ElecReformEIRChiller(EIRChillNum).HRLoopSideNum; + int BranchIndex = ElecReformEIRChiller(EIRChillNum).HRBranchNum; + int CompIndex = ElecReformEIRChiller(EIRChillNum).HRCompNum; // check if inlet limit active and if exceeded. + bool HeatRecRunFlag; if (ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum > 0) { - HeatRecHighInletLimit = ScheduleManager::GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); - if (DataLoopNode::Node(HeatRecInNode).Temp > HeatRecHighInletLimit) { // shut down heat recovery + Real64 HeatRecHighInletLimit = ScheduleManager::GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); + if (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum).Temp > HeatRecHighInletLimit) { // shut down heat recovery HeatRecRunFlag = false; } else { HeatRecRunFlag = RunFlag; @@ -1082,7 +1055,7 @@ namespace ChillerReformulatedEIR { mdot = 0.0; } - PlantUtilities::SetComponentFlowRate(mdot, HeatRecInNode, HeatRecOutNode, LoopNum, LoopSideNum, BranchIndex, CompIndex); + PlantUtilities::SetComponentFlowRate(mdot, ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, ElecReformEIRChiller(EIRChillNum).HeatRecOutletNodeNum, LoopNum, LoopSideNum, BranchIndex, CompIndex); } } @@ -1107,17 +1080,7 @@ namespace ChillerReformulatedEIR { static std::string const RoutineName("SizeElecReformEIRChiller"); - int PltSizNum(0); // Plant Sizing index corresponding to CurLoopNum - int PltSizCondNum(0); // Plant Sizing index for condenser loop bool ErrorsFound(false); // If errors detected in input - Real64 SizingEvapOutletTemp; // Plant Sizing outlet temperature for CurLoopNum [C] - Real64 SizingCondOutletTemp; // Plant Sizing outlet temperature for condenser loop [C] - Real64 RefCapFT; // Capacity as a function of temperature curve output used for sizing - std::string equipName; // Name of chiller - Real64 CurveVal(0.0); // Used to verify EIR-FT/CAP-FT curves = 1 at reference conditions - Real64 CondTemp; // Used to verify EIRFPLR curve is > than 0 at reference conditions - Array1D CurveValArray(11); // Used to evaluate EIRFPLR curve objects - Array1D CondTempArray(11); // Used to evaluate EIRFPLR curve objects Real64 CurveValTmp; // Used to evaluate EIRFPLR curve objects Real64 Density; // Density of condenser water used in warning messages Real64 SpecificHeat; // Specific heat of condenser water used in warning messages @@ -1145,12 +1108,13 @@ namespace ChillerReformulatedEIR { tmpEvapVolFlowRate = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate; tmpCondVolFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; + int PltSizCondNum(0); // Plant Sizing index for condenser loop if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { PltSizCondNum = DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).PlantSizNum; } // find the appropriate Plant Sizing object - PltSizNum = DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).PlantSizNum; + int PltSizNum = DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).PlantSizNum; if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { @@ -1219,6 +1183,8 @@ namespace ChillerReformulatedEIR { if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + Real64 SizingEvapOutletTemp; // Plant Sizing outlet temperature for CurLoopNum [C] + Real64 SizingCondOutletTemp; // Plant Sizing outlet temperature for condenser loop [C] if (PltSizCondNum > 0 && PltSizNum > 0) { SizingEvapOutletTemp = DataSizing::PlantSizData(PltSizNum).ExitTemp; SizingCondOutletTemp = DataSizing::PlantSizData(PltSizCondNum).ExitTemp + DataSizing::PlantSizData(PltSizCondNum).DeltaT; @@ -1234,7 +1200,7 @@ namespace ChillerReformulatedEIR { DataGlobals::CWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); - RefCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, SizingEvapOutletTemp, SizingCondOutletTemp); + Real64 RefCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, SizingEvapOutletTemp, SizingCondOutletTemp); tmpNomCap = (Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate) / RefCapFT; } else { if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized) tmpNomCap = 0.0; @@ -1425,6 +1391,7 @@ namespace ChillerReformulatedEIR { PlantUtilities::RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, tmpHeatRecVolFlowRate); } + std::string equipName; // Name of chiller if (DataPlant::PlantFinalSizesOkayToReport) { if (ElecReformEIRChiller(EIRChillNum).MySizeFlag) { Real64 IPLV; @@ -1454,7 +1421,7 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0 && ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0) { // Check the CAP-FT, EIR-FT, and PLR curves at reference conditions and warn user if different from 1.0 by more than +-10% if (ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex > 0) { - CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, + Real64 CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, ElecReformEIRChiller(EIRChillNum).TempRefEvapOut, ElecReformEIRChiller(EIRChillNum).TempRefCondOut); if (CurveVal > 1.10 || CurveVal < 0.90) { @@ -1470,7 +1437,7 @@ namespace ChillerReformulatedEIR { } if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex > 0) { - CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, + Real64 CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, ElecReformEIRChiller(EIRChillNum).TempRefEvapOut, ElecReformEIRChiller(EIRChillNum).TempRefCondOut); if (CurveVal > 1.10 || CurveVal < 0.90) { @@ -1486,6 +1453,7 @@ namespace ChillerReformulatedEIR { } if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex > 0) { + Real64 CurveVal(0.0); // Used to verify EIR-FT/CAP-FT curves = 1 at reference conditions if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, 1.0); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { @@ -1554,12 +1522,14 @@ namespace ChillerReformulatedEIR { // chiller capacity, and mass flow rate. Starting with the calculated condenser inlet temp and PLR = 0, // calculate the condenser outlet temp proportional to PLR and test the EIRFPLR curve output for negative numbers. bool FoundNegValue = false; + Array1D CurveValArray(11, 0.0); // Used to evaluate EIRFPLR curve objects + Array1D CondTempArray(11, 0.0); // Used to evaluate EIRFPLR curve objects + if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex > 0) { - CurveValArray = 0.0; CondTempArray = 0.0; for (int CurveCheck = 0; CurveCheck <= 10; ++CurveCheck) { PLRTemp = CurveCheck / 10.0; - CondTemp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn + (DeltaTCond * PLRTemp); + Real64 CondTemp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn + (DeltaTCond * PLRTemp); CondTemp = min(CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax); CondTemp = max(CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin); if (PLRTemp < ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin) { @@ -1785,7 +1755,6 @@ namespace ChillerReformulatedEIR { static std::string const RoutineName("EIRChillerHeatRecovery"); - int HeatRecInNode; // Node number for heat recovery water inlet node Real64 QTotal; // Total condenser heat [W] Real64 HeatRecInletTemp; // Heat reclaim inlet temp [C] Real64 HeatRecMassFlowRate; // Heat reclaim mass flow rate [m3/s] @@ -1797,12 +1766,9 @@ namespace ChillerReformulatedEIR { Real64 THeatRecSetPoint(0.0); Real64 HeatRecHighInletLimit; - // Begin routine - HeatRecInNode = ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum; - // inlet node to the heat recovery heat exchanger - HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; - HeatRecMassFlowRate = DataLoopNode::Node(HeatRecInNode).MassFlowRate; + HeatRecInletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum).Temp; + HeatRecMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum).MassFlowRate; CpHeatRec = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, HeatRecInletTemp, @@ -1876,24 +1842,10 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // Reporting - int EvapInletNode; // Evaporator inlet node number - int EvapOutletNode; // Evaporator outlet node number - int CondInletNode; // Condenser inlet node number - int CondOutletNode; // Condenser outlet node number - int HeatRecInNode; // Node number for the heat recovery water inlet node - int HeatRecOutNode; // Node number for the heat recovery water outlet node - - EvapInletNode = ElecReformEIRChiller(Num).EvapInletNodeNum; - EvapOutletNode = ElecReformEIRChiller(Num).EvapOutletNodeNum; - CondInletNode = ElecReformEIRChiller(Num).CondInletNodeNum; - CondOutletNode = ElecReformEIRChiller(Num).CondOutletNodeNum; - HeatRecInNode = ElecReformEIRChiller(Num).HeatRecInletNodeNum; - HeatRecOutNode = ElecReformEIRChiller(Num).HeatRecOutletNodeNum; - if (MyLoad >= 0.0 || !RunFlag) { // Chiller not running so pass inlet states to outlet states // Set node temperatures - DataLoopNode::Node(EvapOutletNode).Temp = DataLoopNode::Node(EvapInletNode).Temp; - DataLoopNode::Node(CondOutletNode).Temp = DataLoopNode::Node(CondInletNode).Temp; + DataLoopNode::Node(ElecReformEIRChiller(Num).EvapOutletNodeNum).Temp = DataLoopNode::Node(ElecReformEIRChiller(Num).EvapInletNodeNum).Temp; + DataLoopNode::Node(ElecReformEIRChiller(Num).CondOutletNodeNum).Temp = DataLoopNode::Node(ElecReformEIRChiller(Num).CondInletNodeNum).Temp; ElecReformEIRChiller(Num).ChillerPartLoadRatio = 0.0; ElecReformEIRChiller(Num).ChillerCyclingRatio = 0.0; @@ -1905,34 +1857,34 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(Num).Energy = 0.0; ElecReformEIRChiller(Num).EvapEnergy = 0.0; ElecReformEIRChiller(Num).CondEnergy = 0.0; - ElecReformEIRChiller(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; - ElecReformEIRChiller(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; - ElecReformEIRChiller(Num).CondOutletTemp = DataLoopNode::Node(CondOutletNode).Temp; - ElecReformEIRChiller(Num).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).Temp; + ElecReformEIRChiller(Num).EvapInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).EvapInletNodeNum).Temp; + ElecReformEIRChiller(Num).CondInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).CondInletNodeNum).Temp; + ElecReformEIRChiller(Num).CondOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).CondOutletNodeNum).Temp; + ElecReformEIRChiller(Num).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).EvapOutletNodeNum).Temp; ElecReformEIRChiller(Num).ActualCOP = 0.0; if (ElecReformEIRChiller(Num).HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); + PlantUtilities::SafeCopyPlantNode(ElecReformEIRChiller(Num).HeatRecInletNodeNum, ElecReformEIRChiller(Num).HeatRecOutletNodeNum); ElecReformEIRChiller(Num).QHeatRecovery = 0.0; ElecReformEIRChiller(Num).EnergyHeatRecovery = 0.0; - ElecReformEIRChiller(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; - ElecReformEIRChiller(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; - ElecReformEIRChiller(Num).HeatRecMassFlow = DataLoopNode::Node(HeatRecInNode).MassFlowRate; + ElecReformEIRChiller(Num).HeatRecInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecInletNodeNum).Temp; + ElecReformEIRChiller(Num).HeatRecOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecOutletNodeNum).Temp; + ElecReformEIRChiller(Num).HeatRecMassFlow = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecInletNodeNum).MassFlowRate; } } else { // Chiller is running, so pass calculated values // Set node temperatures - DataLoopNode::Node(EvapOutletNode).Temp = ElecReformEIRChiller(Num).EvapOutletTemp; - DataLoopNode::Node(CondOutletNode).Temp = ElecReformEIRChiller(Num).CondOutletTemp; + DataLoopNode::Node(ElecReformEIRChiller(Num).EvapOutletNodeNum).Temp = ElecReformEIRChiller(Num).EvapOutletTemp; + DataLoopNode::Node(ElecReformEIRChiller(Num).CondOutletNodeNum).Temp = ElecReformEIRChiller(Num).CondOutletTemp; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available ElecReformEIRChiller(Num).ChillerFalseLoad = ElecReformEIRChiller(Num).ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; ElecReformEIRChiller(Num).Energy = ElecReformEIRChiller(Num).Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; ElecReformEIRChiller(Num).EvapEnergy = ElecReformEIRChiller(Num).QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; ElecReformEIRChiller(Num).CondEnergy = ElecReformEIRChiller(Num).QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChiller(Num).EvapInletTemp = DataLoopNode::Node(EvapInletNode).Temp; - ElecReformEIRChiller(Num).CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; + ElecReformEIRChiller(Num).EvapInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).EvapInletNodeNum).Temp; + ElecReformEIRChiller(Num).CondInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).CondInletNodeNum).Temp; if (ElecReformEIRChiller(Num).Power != 0.0) { ElecReformEIRChiller(Num).ActualCOP = (ElecReformEIRChiller(Num).QEvaporator + ElecReformEIRChiller(Num).ChillerFalseLoadRate) / ElecReformEIRChiller(Num).Power; } else { @@ -1941,12 +1893,12 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(Num).HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); + PlantUtilities::SafeCopyPlantNode(ElecReformEIRChiller(Num).HeatRecInletNodeNum, ElecReformEIRChiller(Num).HeatRecOutletNodeNum); ElecReformEIRChiller(Num).EnergyHeatRecovery = ElecReformEIRChiller(Num).QHeatRecovery * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - DataLoopNode::Node(HeatRecOutNode).Temp = ElecReformEIRChiller(Num).HeatRecOutletTemp; - ElecReformEIRChiller(Num).HeatRecInletTemp = DataLoopNode::Node(HeatRecInNode).Temp; - ElecReformEIRChiller(Num).HeatRecOutletTemp = DataLoopNode::Node(HeatRecOutNode).Temp; - ElecReformEIRChiller(Num).HeatRecMassFlow = DataLoopNode::Node(HeatRecInNode).MassFlowRate; + DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecOutletNodeNum).Temp = ElecReformEIRChiller(Num).HeatRecOutletTemp; + ElecReformEIRChiller(Num).HeatRecInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecInletNodeNum).Temp; + ElecReformEIRChiller(Num).HeatRecOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecOutletNodeNum).Temp; + ElecReformEIRChiller(Num).HeatRecMassFlow = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecInletNodeNum).MassFlowRate; } } } @@ -2043,10 +1995,6 @@ namespace ChillerReformulatedEIR { Real64 ChillerTdevNom; // Normalized ChillerTdev int PartLoadCurveType; // Part Load Ratio Curve Type: 1_LeavingCondenserWaterTemperature; 2_Lift - int EvapInletNode; // evaporator inlet node number - int EvapOutletNode; // evaporator outlet node number - int CondInletNode; // condenser inlet node number - int CondOutletNode; // condenser outlet node number Real64 TempLoad; // actual load to be met by chiller. This value is compared to MyLoad // and reset when necessary since this chiller can cycle, the load passed // should be the actual load. Instead the minimum PLR * RefCap is @@ -2066,10 +2014,6 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).QCondenser = 0.0; ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; ElecReformEIRChiller(EIRChillNum).QHeatRecovery = 0.0; - EvapInletNode = ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum; - EvapOutletNode = ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum; - CondInletNode = ElecReformEIRChiller(EIRChillNum).CondInletNodeNum; - CondOutletNode = ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum; PlantLoopNum = ElecReformEIRChiller(EIRChillNum).CWLoopNum; LoopSideNum = ElecReformEIRChiller(EIRChillNum).CWLoopSideNum; BranchNum = ElecReformEIRChiller(EIRChillNum).CWBranchNum; @@ -2081,7 +2025,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = 0.0; // Set module-level chiller evap and condenser inlet temperature variables - CondInletTemp = DataLoopNode::Node(CondInletNode).Temp; + CondInletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp; // If no loop demand or chiller OFF, return // If chiller load is 0 or chiller is not running then leave the subroutine. Before leaving @@ -2089,7 +2033,7 @@ namespace ChillerReformulatedEIR { // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).MassFlowRate; } if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { if (DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum) @@ -2097,7 +2041,7 @@ namespace ChillerReformulatedEIR { .Branch(ElecReformEIRChiller(EIRChillNum).CDBranchNum) .Comp(ElecReformEIRChiller(EIRChillNum).CDCompNum) .FlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive) { - ElecReformEIRChiller(EIRChillNum).CondMassFlowRate = DataLoopNode::Node(CondInletNode).MassFlowRate; + ElecReformEIRChiller(EIRChillNum).CondMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate; } } @@ -2134,8 +2078,8 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { ElecReformEIRChiller(EIRChillNum).CondMassFlowRate = ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax; PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).CondMassFlowRate, - CondInletNode, - CondOutletNode, + ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, + ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, ElecReformEIRChiller(EIRChillNum).CDLoopNum, ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, ElecReformEIRChiller(EIRChillNum).CDBranchNum, @@ -2161,7 +2105,7 @@ namespace ChillerReformulatedEIR { (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = DataLoopNode::Node(EvapOutletNode).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } @@ -2170,7 +2114,7 @@ namespace ChillerReformulatedEIR { (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = DataLoopNode::Node(EvapOutletNode).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; } @@ -2189,7 +2133,7 @@ namespace ChillerReformulatedEIR { // update the EvapOutletTempSetPoint EvapOutletTempSetPoint = max(ElecReformEIRChiller(EIRChillNum).TempLowLimitEvapOut, - min(DataLoopNode::Node(EvapInletNode).Temp, EvapOutletTempSetPoint_ff - ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset)); + min(DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp, EvapOutletTempSetPoint_ff - ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset)); ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset = EvapOutletTempSetPoint_ff - EvapOutletTempSetPoint; } @@ -2214,7 +2158,7 @@ namespace ChillerReformulatedEIR { // Available chiller capacity as a function of temperature AvailChillerCap = ChillerRefCap * ElecReformEIRChiller(EIRChillNum).ChillerCapFT; - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).MassFlowRate; // Some other component set the flow to 0. No reason to continue with calculations. if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate == 0.0) { MyLoad = 0.0; @@ -2225,11 +2169,11 @@ namespace ChillerReformulatedEIR { // Calculate water side load Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, - DataLoopNode::Node(EvapInletNode).Temp, + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); - TempLoad = DataLoopNode::Node(EvapInletNode).MassFlowRateMaxAvail * Cp * (DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTempSetPoint); + TempLoad = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).MassFlowRateMaxAvail * Cp * (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapOutletTempSetPoint); TempLoad = max(0.0, TempLoad); @@ -2263,8 +2207,8 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = EvapMassFlowRateMax; // Use PlantUtilities::SetComponentFlowRate to decide actual flow PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, - EvapInletNode, - EvapOutletNode, + ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, + ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CWBranchNum, @@ -2274,15 +2218,15 @@ namespace ChillerReformulatedEIR { } else { EvapDeltaTemp = 0.0; } - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapDeltaTemp; } else if (ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - DataLoopNode::Node(EvapOutletNode).TempSetPoint; + EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - DataLoopNode::Node(EvapOutletNode).TempSetPointHi; + EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi; } else { assert(false); } @@ -2295,8 +2239,8 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = min(EvapMassFlowRateMax, ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate); // Use PlantUtilities::SetComponentFlowRate to decide actual flow PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, - EvapInletNode, - EvapOutletNode, + ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, + ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CWBranchNum, @@ -2305,9 +2249,9 @@ namespace ChillerReformulatedEIR { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempSetPoint; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempSetPointHi; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi; } } ElecReformEIRChiller(EIRChillNum).QEvaporator = max(0.0, (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp)); @@ -2316,14 +2260,14 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = 0.0; // Use PlantUtilities::SetComponentFlowRate to decide actual flow PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, - EvapInletNode, - EvapOutletNode, + ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, + ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CWBranchNum, ElecReformEIRChiller(EIRChillNum).CWCompNum); // No deltaT since component is not running - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp; ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; PartLoadRat = 0.0; ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; @@ -2353,7 +2297,7 @@ namespace ChillerReformulatedEIR { .CalFaultChillerSWT(VarFlowFlag, ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset, Cp, - DataLoopNode::Node(EvapInletNode).Temp, + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp, ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, ElecReformEIRChiller(EIRChillNum).QEvaporator); @@ -2364,10 +2308,10 @@ namespace ChillerReformulatedEIR { } } else { // If FlowLock is True - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(EvapInletNode).MassFlowRate; + ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).MassFlowRate; PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, - EvapInletNode, - EvapOutletNode, + ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, + ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, ElecReformEIRChiller(EIRChillNum).CWLoopNum, ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, ElecReformEIRChiller(EIRChillNum).CWBranchNum, @@ -2380,31 +2324,31 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).PossibleSubcooling) { ElecReformEIRChiller(EIRChillNum).QEvaporator = std::abs(MyLoad); EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapDeltaTemp; } else { - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapOutletTempSetPoint; + EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapOutletTempSetPoint; ElecReformEIRChiller(EIRChillNum).QEvaporator = max(0.0, (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp)); ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = EvapOutletTempSetPoint; } if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < TempLowLimitEout) { - if ((DataLoopNode::Node(EvapInletNode).Temp - TempLowLimitEout) > DataPlant::DeltaTempTol) { + if ((DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - TempLowLimitEout) > DataPlant::DeltaTempTol) { ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = TempLowLimitEout; - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; } else { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp; + EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; } } - if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < DataLoopNode::Node(EvapOutletNode).TempMin) { - if ((DataLoopNode::Node(EvapInletNode).Temp - DataLoopNode::Node(EvapOutletNode).TempMin) > DataPlant::DeltaTempTol) { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapOutletNode).TempMin; - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempMin) { + if ((DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempMin) > DataPlant::DeltaTempTol) { + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempMin; + EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; } else { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; - EvapDeltaTemp = DataLoopNode::Node(EvapInletNode).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp; + EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; } } @@ -2413,10 +2357,10 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { ElecReformEIRChiller(EIRChillNum).QEvaporator = std::abs(MyLoad); EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapDeltaTemp; } else { ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp; } } @@ -2430,7 +2374,7 @@ namespace ChillerReformulatedEIR { .CalFaultChillerSWT(VarFlowFlag, ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset, Cp, - DataLoopNode::Node(EvapInletNode).Temp, + DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp, ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, ElecReformEIRChiller(EIRChillNum).QEvaporator); @@ -2443,10 +2387,10 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).QEvaporator = AvailChillerCap * MaxPartLoadRat; EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; // evaporator outlet temperature is allowed to float upwards (recalculate AvailChillerCap? iterate?) - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp - EvapDeltaTemp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapDeltaTemp; } else { ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(EvapInletNode).Temp; + ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp; } } @@ -2529,7 +2473,6 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // To compare the evaporator/condenser outlet temperatures to curve object min/max values - int EvapOutletNode; // Chiller evaporator outlet node number Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] Real64 CAPFTXTmin; // Minimum evaporator leaving temperature allowed by CAPFT curve [C] Real64 CAPFTXTmax; // Maximum evaporator leaving temperature allowed by CAPFT curve [C] @@ -2561,8 +2504,6 @@ namespace ChillerReformulatedEIR { if (FirstIteration || DataGlobals::WarmupFlag || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; - EvapOutletNode = ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum; - // Move CAPFT and EIRFT min/max values for evaporator outlet temperature to local variables CAPFTXTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin; CAPFTXTmax = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMax; @@ -2745,7 +2686,7 @@ namespace ChillerReformulatedEIR { (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = DataLoopNode::Node(EvapOutletNode).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } @@ -2754,7 +2695,7 @@ namespace ChillerReformulatedEIR { (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = DataLoopNode::Node(EvapOutletNode).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; } From adb688ecf551ff44c46893a5bce93f08b564ccdd Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 10:31:50 -0700 Subject: [PATCH 12/41] cleaning up local vars --- src/EnergyPlus/ChillerReformulatedEIR.cc | 58 +++++++++--------------- 1 file changed, 21 insertions(+), 37 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 5353db8df47..3d9fd1289a5 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -1081,32 +1081,14 @@ namespace ChillerReformulatedEIR { static std::string const RoutineName("SizeElecReformEIRChiller"); bool ErrorsFound(false); // If errors detected in input - Real64 CurveValTmp; // Used to evaluate EIRFPLR curve objects - Real64 Density; // Density of condenser water used in warning messages - Real64 SpecificHeat; // Specific heat of condenser water used in warning messages - Real64 CondenserCapacity; // Full load (reference) condenser capacity used in warning messages - std::string StringVar; // Used for EIRFPLR warning messages - int CurveValPtr; // Index to EIRFPLR curve output - Real64 DeltaTCond; // Full load delta T at condenser, used for checking curve objects - Real64 PLRTemp; // Temporary variable used for warning messages - Real64 rho; - Real64 Cp; - Real64 tmpNomCap; // local nominal capacity cooling power - Real64 tmpEvapVolFlowRate; // local evaporator design volume flow rate - Real64 tmpCondVolFlowRate; // local condenser design volume flow rate - Real64 tmpHeatRecVolFlowRate; // local heat recovery design volume flow rate - Real64 EvapVolFlowRateUser(0.0); // Hardsized evaporator flow for reporting - Real64 RefCapUser(0.0); // Hardsized reference capacity for reporting - Real64 CondVolFlowRateUser(0.0); // Hardsized condenser flow for reporting - Real64 DesignHeatRecVolFlowRateUser(0.0); // Hardsized design heat recovery flow for reporting // Formats static ObjexxFCL::gio::Fmt Format_530("('Cond Temp (C) = ',11(F7.2))"); static ObjexxFCL::gio::Fmt Format_531("('Curve Output = ',11(F7.2))"); - tmpNomCap = ElecReformEIRChiller(EIRChillNum).RefCap; - tmpEvapVolFlowRate = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate; - tmpCondVolFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; + Real64 tmpNomCap = ElecReformEIRChiller(EIRChillNum).RefCap; + Real64 tmpEvapVolFlowRate = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate; + Real64 tmpCondVolFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; int PltSizCondNum(0); // Plant Sizing index for condenser loop if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { @@ -1139,7 +1121,7 @@ namespace ChillerReformulatedEIR { } } else { // Hard-size with sizing data if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { - EvapVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate; + Real64 EvapVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, @@ -1192,11 +1174,11 @@ namespace ChillerReformulatedEIR { SizingEvapOutletTemp = ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; SizingCondOutletTemp = ElecReformEIRChiller(EIRChillNum).TempRefCondOut; } - Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); - rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); @@ -1222,7 +1204,7 @@ namespace ChillerReformulatedEIR { } } else { if (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0 && tmpNomCap > 0.0) { - RefCapUser = ElecReformEIRChiller(EIRChillNum).RefCap; + Real64 RefCapUser = ElecReformEIRChiller(EIRChillNum).RefCap; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, @@ -1262,11 +1244,11 @@ namespace ChillerReformulatedEIR { if (PltSizCondNum > 0 && PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { - rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, DataGlobals::CWInitConvTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); - Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondIn, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); @@ -1296,7 +1278,7 @@ namespace ChillerReformulatedEIR { } } else { if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { - CondVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; + Real64 CondVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, @@ -1341,7 +1323,7 @@ namespace ChillerReformulatedEIR { PlantUtilities::RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, tmpCondVolFlowRate); if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - tmpHeatRecVolFlowRate = tmpCondVolFlowRate * ElecReformEIRChiller(EIRChillNum).HeatRecCapacityFraction; + Real64 tmpHeatRecVolFlowRate = tmpCondVolFlowRate * ElecReformEIRChiller(EIRChillNum).HeatRecCapacityFraction; if (!ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; if (DataPlant::PlantFirstSizesOkayToFinalize) { @@ -1361,7 +1343,7 @@ namespace ChillerReformulatedEIR { } } else { if (ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { - DesignHeatRecVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; + Real64 DesignHeatRecVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", ElecReformEIRChiller(EIRChillNum).Name, @@ -1503,18 +1485,18 @@ namespace ChillerReformulatedEIR { } // Initialize condenser reference inlet temperature (not a user input) - Density = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Real64 Density = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); - SpecificHeat = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Real64 SpecificHeat = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); - CondenserCapacity = ElecReformEIRChiller(EIRChillNum).RefCap * + Real64 CondenserCapacity = ElecReformEIRChiller(EIRChillNum).RefCap * (1.0 + (1.0 / ElecReformEIRChiller(EIRChillNum).RefCOP) * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac); - DeltaTCond = (CondenserCapacity) / (ElecReformEIRChiller(EIRChillNum).CondVolFlowRate * Density * SpecificHeat); + Real64 DeltaTCond = (CondenserCapacity) / (ElecReformEIRChiller(EIRChillNum).CondVolFlowRate * Density * SpecificHeat); ElecReformEIRChiller(EIRChillNum).TempRefCondIn = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - DeltaTCond; if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { @@ -1528,10 +1510,11 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex > 0) { CondTempArray = 0.0; for (int CurveCheck = 0; CurveCheck <= 10; ++CurveCheck) { - PLRTemp = CurveCheck / 10.0; + Real64 PLRTemp = CurveCheck / 10.0; Real64 CondTemp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn + (DeltaTCond * PLRTemp); CondTemp = min(CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax); CondTemp = max(CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin); + Real64 CurveValTmp; // Used to evaluate EIRFPLR curve objects if (PLRTemp < ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin) { CurveValTmp = CurveManager::CurveValue( ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin); @@ -1551,14 +1534,15 @@ namespace ChillerReformulatedEIR { ShowContinueError( "EIR as a function of PLR curve output at various part-load ratios and condenser water temperatures shown below:"); ShowContinueError("PLR = 0.00 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00"); + std::string StringVar; // Used for EIRFPLR warning messages ObjexxFCL::gio::write(StringVar, "'Cond Temp(C) = '"); - for (CurveValPtr = 1; CurveValPtr <= 11; ++CurveValPtr) { + for (int CurveValPtr = 1; CurveValPtr <= 11; ++CurveValPtr) { ObjexxFCL::gio::write(StringVar, "(F7.2,$)") << CondTempArray(CurveValPtr); } ObjexxFCL::gio::write(StringVar); ShowContinueError(StringVar); ObjexxFCL::gio::write(StringVar, "'Curve Output = '"); - for (CurveValPtr = 1; CurveValPtr <= 11; ++CurveValPtr) { + for (int CurveValPtr = 1; CurveValPtr <= 11; ++CurveValPtr) { ObjexxFCL::gio::write(StringVar, "(F7.2,$)") << CurveValArray(CurveValPtr); } ObjexxFCL::gio::write(StringVar); From 7813ff79c6000482102f7a53c5c39563819880b0 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 11:28:53 -0700 Subject: [PATCH 13/41] cleaning up local vars --- src/EnergyPlus/ChillerReformulatedEIR.cc | 302 +++++++++++------------ 1 file changed, 150 insertions(+), 152 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 3d9fd1289a5..05a7dd36266 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -1612,39 +1612,38 @@ namespace ChillerReformulatedEIR { Real64 const Acc(0.0001); // Accuracy control for General::SolveRoot int const MaxIter(500); // Iteration control for General::SolveRoot - Real64 CAPFTYTmin; // Minimum condenser leaving temperature allowed by CAPFT curve [C] - Real64 CAPFTYTmax; // Maximum condenser leaving temperature allowed by CAPFT curve [C] - Real64 EIRFTYTmin; // Minimum condenser leaving temperature allowed by EIRFT curve [C] - Real64 EIRFTYTmax; // Maximum condenser leaving temperature allowed by EIRFT curve [C] - Real64 EIRFPLRTmin; // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] - Real64 EIRFPLRTmax; // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] - Real64 Tmin(-99); // Minimum condenser leaving temperature allowed by curve objects [C] - Real64 Tmax(-99); // Maximum condenser leaving temperature allowed by curve objects [C] - Array1D Par(6); // Pass parameters for RegulaFalsi solver - Real64 FalsiCondOutTemp; // RegulaFalsi condenser outlet temperature result [C] - int SolFla; // Feedback flag from General::SolveRoot - Real64 CondTempMin; // Condenser outlet temperature when using Tmin as input to CalcReformEIRChillerModel [C] - Real64 CondTempMax; // Condenser outlet temperature when using Tmax as input to CalcReformEIRChillerModel [C] - if (MyLoad >= 0.0 || !RunFlag) { CalcReformEIRChillerModel( EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp); } else { // Find min/max condenser outlet temperature used by curve objects - CAPFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin; - EIRFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin; + + // Minimum condenser leaving temperature allowed by CAPFT curve [C] + Real64 CAPFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin; + + // Minimum condenser leaving temperature allowed by EIRFT curve [C] + Real64 Tmin(-99); // Minimum condenser leaving temperature allowed by curve objects [C] + + Real64 EIRFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin; if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - EIRFPLRTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin; + // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] + Real64 EIRFPLRTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin; Tmin = min(CAPFTYTmin, EIRFTYTmin, EIRFPLRTmin); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 Tmin = min(CAPFTYTmin, EIRFTYTmin); } - CAPFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax; - EIRFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax; + // Maximum condenser leaving temperature allowed by CAPFT curve [C] + Real64 CAPFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax; + + Real64 Tmax(-99); // Maximum condenser leaving temperature allowed by curve objects [C] + + // Maximum condenser leaving temperature allowed by EIRFT curve [C] + Real64 EIRFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax; if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - EIRFPLRTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax; + // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] + Real64 EIRFPLRTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax; Tmax = max(CAPFTYTmax, EIRFTYTmax, EIRFPLRTmax); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 Tmax = max(CAPFTYTmax, EIRFTYTmax); @@ -1652,12 +1651,18 @@ namespace ChillerReformulatedEIR { // Check that condenser outlet temperature is within curve object limits prior to calling RegulaFalsi CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Tmin); - CondTempMin = ElecReformEIRChiller(EIRChillNum).CondOutletTemp; + + // Condenser outlet temperature when using Tmin as input to CalcReformEIRChillerModel [C] + Real64 CondTempMin = ElecReformEIRChiller(EIRChillNum).CondOutletTemp; CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Tmax); - CondTempMax = ElecReformEIRChiller(EIRChillNum).CondOutletTemp; + + // Condenser outlet temperature when using Tmax as input to CalcReformEIRChillerModel [C] + Real64 CondTempMax = ElecReformEIRChiller(EIRChillNum).CondOutletTemp; if (CondTempMin > Tmin && CondTempMax < Tmax) { + Array1D Par(6); // Pass parameters for RegulaFalsi solver + // Initialize iteration parameters for RegulaFalsi function Par(1) = EIRChillNum; Par(2) = MyLoad; @@ -1674,6 +1679,8 @@ namespace ChillerReformulatedEIR { // Par(5) = FlowLock !DSU Par(6) = EquipFlowCtrl; + int SolFla; // Feedback flag from General::SolveRoot + Real64 FalsiCondOutTemp; // RegulaFalsi condenser outlet temperature result [C] General::SolveRoot(Acc, MaxIter, SolFla, FalsiCondOutTemp, CondOutTempResidual, Tmin, Tmax, Par); if (SolFla == -1) { @@ -1739,47 +1746,37 @@ namespace ChillerReformulatedEIR { static std::string const RoutineName("EIRChillerHeatRecovery"); - Real64 QTotal; // Total condenser heat [W] - Real64 HeatRecInletTemp; // Heat reclaim inlet temp [C] - Real64 HeatRecMassFlowRate; // Heat reclaim mass flow rate [m3/s] - Real64 TAvgIn; // Average inlet temperature of heat reclaim inlet and condenser inlet [C] - Real64 TAvgOut; // Average outlet temperature [C] - Real64 CpHeatRec; // Heat reclaim water inlet specific heat [J/kg-K] - Real64 CpCond; // Condenser water inlet specific heat [J/kg-K] - Real64 QHeatRecToSetPoint; - Real64 THeatRecSetPoint(0.0); - Real64 HeatRecHighInletLimit; - // inlet node to the heat recovery heat exchanger - HeatRecInletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum).Temp; - HeatRecMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum).MassFlowRate; + Real64 HeatRecInletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum).Temp; + Real64 HeatRecMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum).MassFlowRate; - CpHeatRec = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, + Real64 CpHeatRec = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, HeatRecInletTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidIndex, RoutineName); - CpCond = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Real64 CpCond = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, RoutineName); // Before we modify the QCondenser, the total or original value is transferred to QTot - QTotal = QCond; + Real64 QTotal = QCond; if (ElecReformEIRChiller(EIRChillNum).HeatRecSetPointNodeNum == 0) { // use original algorithm that blends temps - TAvgIn = (HeatRecMassFlowRate * CpHeatRec * HeatRecInletTemp + CondMassFlow * CpCond * CondInletTemp) / + Real64 TAvgIn = (HeatRecMassFlowRate * CpHeatRec * HeatRecInletTemp + CondMassFlow * CpCond * CondInletTemp) / (HeatRecMassFlowRate * CpHeatRec + CondMassFlow * CpCond); - TAvgOut = QTotal / (HeatRecMassFlowRate * CpHeatRec + CondMassFlow * CpCond) + TAvgIn; + Real64 TAvgOut = QTotal / (HeatRecMassFlowRate * CpHeatRec + CondMassFlow * CpCond) + TAvgIn; QHeatRec = HeatRecMassFlowRate * CpHeatRec * (TAvgOut - HeatRecInletTemp); QHeatRec = max(QHeatRec, 0.0); // ensure non negative // check if heat flow too large for physical size of bundle QHeatRec = min(QHeatRec, ElecReformEIRChiller(EIRChillNum).HeatRecMaxCapacityLimit); } else { // use new algorithm to meet setpoint + Real64 THeatRecSetPoint(0.0); + { auto const SELECT_CASE_var(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecSetPointNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { @@ -1789,7 +1786,7 @@ namespace ChillerReformulatedEIR { } } - QHeatRecToSetPoint = HeatRecMassFlowRate * CpHeatRec * (THeatRecSetPoint - HeatRecInletTemp); + Real64 QHeatRecToSetPoint = HeatRecMassFlowRate * CpHeatRec * (THeatRecSetPoint - HeatRecInletTemp); QHeatRecToSetPoint = max(QHeatRecToSetPoint, 0.0); QHeatRec = min(QTotal, QHeatRecToSetPoint); // check if heat flow too large for physical size of bundle @@ -1798,7 +1795,7 @@ namespace ChillerReformulatedEIR { // check if limit on inlet is present and exceeded. if (ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum > 0) { - HeatRecHighInletLimit = ScheduleManager::GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); + Real64 HeatRecHighInletLimit = ScheduleManager::GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); if (HeatRecInletTemp > HeatRecHighInletLimit) { // shut down heat recovery QHeatRec = 0.0; } @@ -1905,22 +1902,14 @@ namespace ChillerReformulatedEIR { // METHODOLOGY EMPLOYED: // Regula Falsi solver is used to calculate condenser outlet temperature. - Real64 CondOutTempResidual; - - int EIRChillNum; // Chiller number - Real64 MyLoad; // Operating load [W] - bool FirstIteration; // TRUE when first iteration of timestep - bool RunFlag; // TRUE when chiller operating - int EquipFlowCtrl; // Flow control mode for the equipment - - EIRChillNum = int(Par(1)); - MyLoad = Par(2); - RunFlag = (int(Par(3)) == 1); - FirstIteration = (int(Par(4)) == 1); - EquipFlowCtrl = int(Par(6)); + int EIRChillNum = int(Par(1)); + Real64 MyLoad = Par(2); + bool RunFlag = (int(Par(3)) == 1); + bool FirstIteration = (int(Par(4)) == 1); + bool EquipFlowCtrl = int(Par(6)); CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, FalsiCondOutTemp); - CondOutTempResidual = FalsiCondOutTemp - ElecReformEIRChiller(EIRChillNum).CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting + Real64 CondOutTempResidual = FalsiCondOutTemp - ElecReformEIRChiller(EIRChillNum).CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting return CondOutTempResidual; } @@ -1958,37 +1947,6 @@ namespace ChillerReformulatedEIR { static ObjexxFCL::gio::Fmt OutputFormat("(F6.2)"); static std::string const RoutineName("CalcElecReformEIRChillerModel"); - Real64 FRAC; // Chiller cycling ratio - Real64 MinPartLoadRat; // Minimum allowed operating fraction of full load - Real64 MinUnloadRat; // Minimum allowed unloading fraction of full load - Real64 MaxPartLoadRat; // Maximum allowed operating fraction of full load - Real64 CondInletTemp; // Condenser inlet temperature [C] - Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] - Real64 AvailChillerCap; // Chiller available capacity [W] - Real64 ChillerRefCap; // Chiller reference capacity [W] - Real64 EvapDeltaTemp(0.0); // Evaporator temperature difference [C] - Real64 ReferenceCOP; // Reference coefficient of performance, from user input - Real64 PartLoadRat; // Operating part load ratio - Real64 TempLowLimitEout; // Evaporator low temp. limit cut off [C] - Real64 EvapMassFlowRateMax; // Maximum evaporator mass flow rate converted from volume flow rate [kg/s] - - Real64 ChillerLift; // Chiller lift - Real64 ChillerLiftRef; // Chiller lift under the reference condition - Real64 ChillerLiftNom; // Normalized chiller lift - Real64 ChillerTdev; // Deviation of leaving chilled water temperature from the reference condition - Real64 ChillerTdevNom; // Normalized ChillerTdev - int PartLoadCurveType; // Part Load Ratio Curve Type: 1_LeavingCondenserWaterTemperature; 2_Lift - - Real64 TempLoad; // actual load to be met by chiller. This value is compared to MyLoad - // and reset when necessary since this chiller can cycle, the load passed - // should be the actual load. Instead the minimum PLR * RefCap is - // passed in. - int PlantLoopNum; // Plant loop which contains the current chiller - int LoopSideNum; // Plant loop side which contains the current chiller (usually supply side) - int BranchNum; - int CompNum; - Real64 Cp; // Local fluid specific heat - ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = 0.0; ElecReformEIRChiller(EIRChillNum).ChillerCyclingRatio = 0.0; ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = 0.0; @@ -1998,10 +1956,10 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).QCondenser = 0.0; ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; ElecReformEIRChiller(EIRChillNum).QHeatRecovery = 0.0; - PlantLoopNum = ElecReformEIRChiller(EIRChillNum).CWLoopNum; - LoopSideNum = ElecReformEIRChiller(EIRChillNum).CWLoopSideNum; - BranchNum = ElecReformEIRChiller(EIRChillNum).CWBranchNum; - CompNum = ElecReformEIRChiller(EIRChillNum).CWCompNum; + int PlantLoopNum = ElecReformEIRChiller(EIRChillNum).CWLoopNum; + int LoopSideNum = ElecReformEIRChiller(EIRChillNum).CWLoopSideNum; + int BranchNum = ElecReformEIRChiller(EIRChillNum).CWBranchNum; + int CompNum = ElecReformEIRChiller(EIRChillNum).CWCompNum; // Set performance curve outputs to 0.0 when chiller is off ElecReformEIRChiller(EIRChillNum).ChillerCapFT = 0.0; @@ -2009,7 +1967,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = 0.0; // Set module-level chiller evap and condenser inlet temperature variables - CondInletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp; + Real64 CondInletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp; // If no loop demand or chiller OFF, return // If chiller load is 0 or chiller is not running then leave the subroutine. Before leaving @@ -2033,15 +1991,23 @@ namespace ChillerReformulatedEIR { } // LOAD LOCAL VARIABLES FROM DATA STRUCTURE (for code readability) - MinPartLoadRat = ElecReformEIRChiller(EIRChillNum).MinPartLoadRat; - MaxPartLoadRat = ElecReformEIRChiller(EIRChillNum).MaxPartLoadRat; - MinUnloadRat = ElecReformEIRChiller(EIRChillNum).MinUnloadRat; - ChillerRefCap = ElecReformEIRChiller(EIRChillNum).RefCap; - ReferenceCOP = ElecReformEIRChiller(EIRChillNum).RefCOP; + Real64 MinPartLoadRat = ElecReformEIRChiller(EIRChillNum).MinPartLoadRat; + Real64 MaxPartLoadRat = ElecReformEIRChiller(EIRChillNum).MaxPartLoadRat; + Real64 MinUnloadRat = ElecReformEIRChiller(EIRChillNum).MinUnloadRat; + + // Chiller reference capacity [W] + Real64 ChillerRefCap = ElecReformEIRChiller(EIRChillNum).RefCap; + + // Reference coefficient of performance, from user input + Real64 ReferenceCOP = ElecReformEIRChiller(EIRChillNum).RefCOP; ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).Temp; - TempLowLimitEout = ElecReformEIRChiller(EIRChillNum).TempLowLimitEvapOut; - EvapMassFlowRateMax = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax; - PartLoadCurveType = ElecReformEIRChiller(EIRChillNum).PartLoadCurveType; // zrp_Aug2014 + + // Evaporator low temp. limit cut off [C] + Real64 TempLowLimitEout = ElecReformEIRChiller(EIRChillNum).TempLowLimitEvapOut; + + // Maximum evaporator mass flow rate converted from volume flow rate [kg/s] + Real64 EvapMassFlowRateMax = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax; + int PartLoadCurveType = ElecReformEIRChiller(EIRChillNum).PartLoadCurveType; // If there is a fault of chiller fouling if (ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { @@ -2080,8 +2046,8 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; } - FRAC = 1.0; - + Real64 FRAC = 1.0; + Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { @@ -2140,7 +2106,7 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillNum).ChillerCapFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, EvapOutletTempSetPoint, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp)); // Available chiller capacity as a function of temperature - AvailChillerCap = ChillerRefCap * ElecReformEIRChiller(EIRChillNum).ChillerCapFT; + Real64 AvailChillerCap = ChillerRefCap * ElecReformEIRChiller(EIRChillNum).ChillerCapFT; ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).MassFlowRate; // Some other component set the flow to 0. No reason to continue with calculations. @@ -2152,11 +2118,16 @@ namespace ChillerReformulatedEIR { // This chiller is currently has only a water-cooled condenser // Calculate water side load - Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp, DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, RoutineName); + Real64 TempLoad; // actual load to be met by chiller. This value is compared to MyLoad + // and reset when necessary since this chiller can cycle, the load passed + // should be the actual load. Instead the minimum PLR * RefCap is + // passed in. + TempLoad = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).MassFlowRateMaxAvail * Cp * (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapOutletTempSetPoint); TempLoad = max(0.0, TempLoad); @@ -2167,6 +2138,7 @@ namespace ChillerReformulatedEIR { } // Part load ratio based on load and available chiller capacity, cap at max part load ratio + Real64 PartLoadRat; // Operating part load ratio if (AvailChillerCap > 0) { PartLoadRat = max(0.0, min(std::abs(MyLoad) / AvailChillerCap, MaxPartLoadRat)); } else { @@ -2184,6 +2156,9 @@ namespace ChillerReformulatedEIR { } else { ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = true; } + + Real64 EvapDeltaTemp(0.0); // Evaporator temperature difference [C] + // Either set the flow to the Constant value or calculate the flow for the variable volume case if ((ElecReformEIRChiller(EIRChillNum).FlowMode == ConstantFlow) || (ElecReformEIRChiller(EIRChillNum).FlowMode == NotModulated)) { // Set the evaporator mass flow rate to design @@ -2305,6 +2280,9 @@ namespace ChillerReformulatedEIR { MyLoad = 0.0; return; } + + Real64 EvapDeltaTemp; + if (ElecReformEIRChiller(EIRChillNum).PossibleSubcooling) { ElecReformEIRChiller(EIRChillNum).QEvaporator = std::abs(MyLoad); EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; @@ -2414,13 +2392,23 @@ namespace ChillerReformulatedEIR { if (PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp, PartLoadRat)); } else if (PartLoadCurveType == PLR_Lift) { - ChillerLift = ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; - ChillerTdev = std::abs(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); - ChillerLiftRef = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; + + // Chiller lift + Real64 ChillerLift = ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + + // Deviation of leaving chilled water temperature from the reference condition + Real64 ChillerTdev = std::abs(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); + + // Chiller lift under the reference condition + Real64 ChillerLiftRef = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; if (ChillerLiftRef <= 0) ChillerLiftRef = 35 - 6.67; - ChillerLiftNom = ChillerLift / ChillerLiftRef; - ChillerTdevNom = ChillerTdev / ChillerLiftRef; + + // Normalized chiller lift + Real64 ChillerLiftNom = ChillerLift / ChillerLiftRef; + + // Normalized ChillerTdev + Real64 ChillerTdevNom = ChillerTdev / ChillerLiftRef; ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ChillerLiftNom, PartLoadRat, ChillerTdevNom)); } @@ -2457,43 +2445,27 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // To compare the evaporator/condenser outlet temperatures to curve object min/max values - Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] - Real64 CAPFTXTmin; // Minimum evaporator leaving temperature allowed by CAPFT curve [C] - Real64 CAPFTXTmax; // Maximum evaporator leaving temperature allowed by CAPFT curve [C] - Real64 CAPFTYTmin; // Minimum condenser leaving temperature allowed by CAPFT curve [C] - Real64 CAPFTYTmax; // Maximum condenser leaving temperature allowed by CAPFT curve [C] - Real64 EIRFTXTmin; // Minimum evaporator leaving temperature allowed by EIRFT curve [C] - Real64 EIRFTXTmax; // Maximum evaporator leaving temperature allowed by EIRFT curve [C] - Real64 EIRFTYTmin; // Minimum condenser leaving temperature allowed by EIRFT curve [C] - Real64 EIRFTYTmax; // Maximum condenser leaving temperature allowed by EIRFT curve [C] - Real64 EIRFPLRTmin(0.0); // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] - Real64 EIRFPLRTmax(0.0); // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] - Real64 EIRFPLRPLRmin; // Minimum PLR allowed by EIRFPLR curve - Real64 EIRFPLRPLRmax; // Maximum PLR allowed by EIRFPLR curve - Real64 ChillerLift; // Chiller lift [C] - Real64 ChillerLiftRef; // Chiller lift under the reference condition [C] - Real64 ChillerLiftNom; // Normalized chiller lift - Real64 ChillerTdev; // Deviation of leaving chilled water temperature from the reference condition - Real64 ChillerTdevNom; // Normalized ChillerTdev - int PlantLoopNum; // Plant loop which contains the current chiller - int LoopSideNum; // Plant loop side which contains the current chiller (usually supply side) - int BranchNum; - int CompNum; - // Do not print out warnings if chiller not operating or FirstIteration/DataGlobals::WarmupFlag/FlowLock - PlantLoopNum = ElecReformEIRChiller(EIRChillNum).CWLoopNum; - LoopSideNum = ElecReformEIRChiller(EIRChillNum).CWLoopSideNum; - BranchNum = ElecReformEIRChiller(EIRChillNum).CWBranchNum; - CompNum = ElecReformEIRChiller(EIRChillNum).CWCompNum; + int PlantLoopNum = ElecReformEIRChiller(EIRChillNum).CWLoopNum; + int LoopSideNum = ElecReformEIRChiller(EIRChillNum).CWLoopSideNum; + int BranchNum = ElecReformEIRChiller(EIRChillNum).CWBranchNum; + int CompNum = ElecReformEIRChiller(EIRChillNum).CWCompNum; if (FirstIteration || DataGlobals::WarmupFlag || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; // Move CAPFT and EIRFT min/max values for evaporator outlet temperature to local variables - CAPFTXTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin; - CAPFTXTmax = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMax; - EIRFTXTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMin; - EIRFTXTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMax; + // Minimum evaporator leaving temperature allowed by CAPFT curve [C] + Real64 CAPFTXTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin; + + // Maximum evaporator leaving temperature allowed by CAPFT curve [C] + Real64 CAPFTXTmax = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMax; + + // Minimum evaporator leaving temperature allowed by EIRFT curve [C] + Real64 EIRFTXTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMin; + + // Maximum evaporator leaving temperature allowed by EIRFT curve [C] + Real64 EIRFTXTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMax; // Check bounds for curves, lump min/max into same check since min/max values are reported in recurring warning messages if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < CAPFTXTmin || ElecReformEIRChiller(EIRChillNum).EvapOutletTemp > CAPFTXTmax) { @@ -2545,11 +2517,21 @@ namespace ChillerReformulatedEIR { } // Move CAPFT, EIRFT, and EIRFPLR min/max condenser outlet temperature values to local variables - CAPFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin; - CAPFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax; - EIRFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin; - EIRFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax; + // Minimum condenser leaving temperature allowed by CAPFT curve [C] + Real64 CAPFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin; + + // Maximum condenser leaving temperature allowed by CAPFT curve [C] + Real64 CAPFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax; + + // Minimum condenser leaving temperature allowed by EIRFT curve [C] + Real64 EIRFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin; + + // Maximum condenser leaving temperature allowed by EIRFT curve [C] + Real64 EIRFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax; + + Real64 EIRFPLRTmin(0.0); // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] + Real64 EIRFPLRTmax(0.0); // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { EIRFPLRTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin; @@ -2557,8 +2539,12 @@ namespace ChillerReformulatedEIR { } // Move EIRFPLR min/max part-load ratio values to local variables - EIRFPLRPLRmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin; - EIRFPLRPLRmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax; + + // Minimum PLR allowed by EIRFPLR curve + Real64 EIRFPLRPLRmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin; + + // Maximum PLR allowed by EIRFPLR curve + Real64 EIRFPLRPLRmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax; // Check bounds for curves, lump min/max into same check since min/max values are reported in recurring warning messages if (ElecReformEIRChiller(EIRChillNum).CondOutletTemp < CAPFTYTmin || ElecReformEIRChiller(EIRChillNum).CondOutletTemp > CAPFTYTmax) { @@ -2663,6 +2649,8 @@ namespace ChillerReformulatedEIR { } } + Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] + { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { @@ -2735,13 +2723,23 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).CondOutletTemp, ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio); } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { - ChillerLift = ElecReformEIRChiller(EIRChillNum).CondOutletTemp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; - ChillerTdev = std::abs(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); - ChillerLiftRef = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; + + // Chiller lift [C] + Real64 ChillerLift = ElecReformEIRChiller(EIRChillNum).CondOutletTemp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + + // Deviation of leaving chilled water temperature from the reference condition + Real64 ChillerTdev = std::abs(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); + + // Chiller lift under the reference condition [C] + Real64 ChillerLiftRef = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; if (ChillerLiftRef <= 0) ChillerLiftRef = 35 - 6.67; - ChillerLiftNom = ChillerLift / ChillerLiftRef; - ChillerTdevNom = ChillerTdev / ChillerLiftRef; + + // Normalized chiller lift + Real64 ChillerLiftNom = ChillerLift / ChillerLiftRef; + + // Normalized ChillerTdev + Real64 ChillerTdevNom = ChillerTdev / ChillerLiftRef; ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ChillerLiftNom, ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, ChillerTdevNom); } From 1a8e62013f279051edce5f0cf21cc948903b40d4 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 12:10:57 -0700 Subject: [PATCH 14/41] function to members --- src/EnergyPlus/ChillerReformulatedEIR.cc | 1208 +++++++++++----------- src/EnergyPlus/ChillerReformulatedEIR.hh | 41 +- 2 files changed, 615 insertions(+), 634 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 05a7dd36266..6d06615bee5 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -194,10 +194,10 @@ namespace ChillerReformulatedEIR { if (InitLoopEquip) { TempEvapOutDesign = ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; TempCondInDesign = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; - InitElecReformEIRChiller(EIRChillNum, RunFlag, MyLoad); + ElecReformEIRChiller(EIRChillNum).initialize(RunFlag, MyLoad); if (LoopNum == ElecReformEIRChiller(EIRChillNum).CWLoopNum) { - SizeElecReformEIRChiller(EIRChillNum); + ElecReformEIRChiller(EIRChillNum).size(); MinCap = ElecReformEIRChiller(EIRChillNum).RefCap * ElecReformEIRChiller(EIRChillNum).MinPartLoadRat; MaxCap = ElecReformEIRChiller(EIRChillNum).RefCap * ElecReformEIRChiller(EIRChillNum).MaxPartLoadRat; OptCap = ElecReformEIRChiller(EIRChillNum).RefCap * ElecReformEIRChiller(EIRChillNum).OptPartLoadRat; @@ -213,8 +213,8 @@ namespace ChillerReformulatedEIR { } if (LoopNum == ElecReformEIRChiller(EIRChillNum).CWLoopNum) { - InitElecReformEIRChiller(EIRChillNum, RunFlag, MyLoad); - ControlReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl); + ElecReformEIRChiller(EIRChillNum).initialize(RunFlag, MyLoad); + ElecReformEIRChiller(EIRChillNum).control(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl); UpdateReformEIRChillerRecords(MyLoad, RunFlag, EIRChillNum); } else if (LoopNum == ElecReformEIRChiller(EIRChillNum).CDLoopNum) { int LoopSide = ElecReformEIRChiller(EIRChillNum).CDLoopSideNum; @@ -773,10 +773,7 @@ namespace ChillerReformulatedEIR { } } - void InitElecReformEIRChiller(int const EIRChillNum, // Number of the current electric EIR chiller being simulated - bool const RunFlag, // TRUE when chiller operating - Real64 const MyLoad // Current load put on chiller - ) + void ReformulatedEIRChillerSpecs::initialize(bool const RunFlag, Real64 const MyLoad) { // SUBROUTINE INFORMATION: @@ -794,67 +791,67 @@ namespace ChillerReformulatedEIR { static std::string const RoutineName("InitElecReformEIRChiller"); // Init more variables - if (ElecReformEIRChiller(EIRChillNum).MyInitFlag) { + if (this->MyInitFlag) { // Locate the chillers on the plant loops for later usage bool errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, + PlantUtilities::ScanPlantLoopsForObject(this->Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, - ElecReformEIRChiller(EIRChillNum).CWLoopNum, - ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CWBranchNum, - ElecReformEIRChiller(EIRChillNum).CWCompNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, errFlag, - ElecReformEIRChiller(EIRChillNum).TempLowLimitEvapOut, + this->TempLowLimitEvapOut, _, _, - ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, + this->EvapInletNodeNum, _); - if (ElecReformEIRChiller(EIRChillNum).CondenserType != AirCooled) { - PlantUtilities::ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, + if (this->CondenserType != AirCooled) { + PlantUtilities::ScanPlantLoopsForObject(this->Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, - ElecReformEIRChiller(EIRChillNum).CDLoopNum, - ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CDBranchNum, - ElecReformEIRChiller(EIRChillNum).CDCompNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum, errFlag, _, _, _, - ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, + this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides(ElecReformEIRChiller(EIRChillNum).CWLoopNum, - ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CDLoopNum, - ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, + PlantUtilities::InterConnectTwoPlantLoopSides(this->CWLoopNum, + this->CWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, true); } - if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - PlantUtilities::ScanPlantLoopsForObject(ElecReformEIRChiller(EIRChillNum).Name, + if (this->HeatRecActive) { + PlantUtilities::ScanPlantLoopsForObject(this->Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, - ElecReformEIRChiller(EIRChillNum).HRLoopNum, - ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, - ElecReformEIRChiller(EIRChillNum).HRBranchNum, - ElecReformEIRChiller(EIRChillNum).HRCompNum, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum, errFlag, _, _, _, - ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, + this->HeatRecInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides(ElecReformEIRChiller(EIRChillNum).CWLoopNum, - ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, - ElecReformEIRChiller(EIRChillNum).HRLoopNum, - ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, + PlantUtilities::InterConnectTwoPlantLoopSides(this->CWLoopNum, + this->CWLoopSideNum, + this->HRLoopNum, + this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, true); } - if ((ElecReformEIRChiller(EIRChillNum).CondenserType != AirCooled) && (ElecReformEIRChiller(EIRChillNum).HeatRecActive)) { - PlantUtilities::InterConnectTwoPlantLoopSides(ElecReformEIRChiller(EIRChillNum).CDLoopNum, - ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, - ElecReformEIRChiller(EIRChillNum).HRLoopNum, - ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, + if ((this->CondenserType != AirCooled) && (this->HeatRecActive)) { + PlantUtilities::InterConnectTwoPlantLoopSides(this->CDLoopNum, + this->CDLoopSideNum, + this->HRLoopNum, + this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, false); } @@ -863,184 +860,184 @@ namespace ChillerReformulatedEIR { ShowFatalError("InitElecReformEIRChiller: Program terminated due to previous condition(s)."); } - if (ElecReformEIRChiller(EIRChillNum).FlowMode == ConstantFlow) { + if (this->FlowMode == ConstantFlow) { // reset flow priority - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum) - .LoopSide(ElecReformEIRChiller(EIRChillNum).CWLoopSideNum) - .Branch(ElecReformEIRChiller(EIRChillNum).CWBranchNum) - .Comp(ElecReformEIRChiller(EIRChillNum).CWCompNum) + DataPlant::PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } - if (ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) { + if (this->FlowMode == LeavingSetPointModulated) { // reset flow priority - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum) - .LoopSide(ElecReformEIRChiller(EIRChillNum).CWLoopSideNum) - .Branch(ElecReformEIRChiller(EIRChillNum).CWBranchNum) - .Comp(ElecReformEIRChiller(EIRChillNum).CWCompNum) + DataPlant::PlantLoop(this->CWLoopNum) + .LoopSide(this->CWLoopSideNum) + .Branch(this->CWBranchNum) + .Comp(this->CWCompNum) .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; // check if setpoint on outlet node - if ((DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && - (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { + if ((DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { if (!DataGlobals::AnyEnergyManagementSystemInModel) { - if (!ElecReformEIRChiller(EIRChillNum).ModulatedFlowErrDone) { + if (!this->ModulatedFlowErrDone) { ShowWarningError("Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + - ElecReformEIRChiller(EIRChillNum).Name); + this->Name); ShowContinueError( " A temperature setpoint is needed at the outlet node of a chiller in variable flow mode, use a SetpointManager"); ShowContinueError(" The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - ElecReformEIRChiller(EIRChillNum).ModulatedFlowErrDone = true; + this->ModulatedFlowErrDone = true; } } else { // need call to EMS to check node bool fatalError = false; // but not really fatal yet, but should be. - EMSManager::CheckIfNodeSetPointManagedByEMS(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, EMSManager::iTemperatureSetPoint, fatalError); + EMSManager::CheckIfNodeSetPointManagedByEMS(this->EvapOutletNodeNum, EMSManager::iTemperatureSetPoint, fatalError); if (fatalError) { - if (!ElecReformEIRChiller(EIRChillNum).ModulatedFlowErrDone) { + if (!this->ModulatedFlowErrDone) { ShowWarningError("Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + - ElecReformEIRChiller(EIRChillNum).Name); + this->Name); ShowContinueError( " A temperature setpoint is needed at the outlet node of a chiller evaporator in variable flow mode"); ShowContinueError(" use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); ShowContinueError(" or use an EMS actuator to establish a setpoint at the outlet node "); ShowContinueError(" The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - ElecReformEIRChiller(EIRChillNum).ModulatedFlowErrDone = true; + this->ModulatedFlowErrDone = true; } } } - ElecReformEIRChiller(EIRChillNum).ModulatedFlowSetToLoop = true; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + this->ModulatedFlowSetToLoop = true; + DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = + DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } - ElecReformEIRChiller(EIRChillNum).MyInitFlag = false; + this->MyInitFlag = false; } - if (ElecReformEIRChiller(EIRChillNum).MyEnvrnFlag && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { - Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate * rho; + this->EvapMassFlowRateMax = this->EvapVolFlowRate * rho; PlantUtilities::InitComponentNodes(0.0, - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax, - ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, - ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).CWLoopNum, - ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CWBranchNum, - ElecReformEIRChiller(EIRChillNum).CWCompNum); - - if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { - - rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, - ElecReformEIRChiller(EIRChillNum).TempRefCondIn, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + this->EvapMassFlowRateMax, + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); + + if (this->CondenserType == WaterCooled) { + + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, + this->TempRefCondIn, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); - ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax = rho * ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; + this->CondMassFlowRateMax = rho * this->CondVolFlowRate; PlantUtilities::InitComponentNodes(0.0, - ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax, - ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, - ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).CDLoopNum, - ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CDBranchNum, - ElecReformEIRChiller(EIRChillNum).CDCompNum); - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; + this->CondMassFlowRateMax, + this->CondInletNodeNum, + this->CondOutletNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); + DataLoopNode::Node(this->CondInletNodeNum).Temp = this->TempRefCondIn; } else { // air or evap air condenser // Initialize maximum available condenser flow rate - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate * - Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::StdBaroPress, ElecReformEIRChiller(EIRChillNum).TempRefCondIn, 0.0, RoutineName); - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum).MassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRateMaxAvail = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRateMax = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum).MassFlowRateMax = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRateMinAvail = 0.0; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRateMin = 0.0; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum).MassFlowRateMinAvail = 0.0; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum).MassFlowRateMin = 0.0; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; - } - - if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, + DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate = this->CondVolFlowRate * + Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::StdBaroPress, this->TempRefCondIn, 0.0, RoutineName); + DataLoopNode::Node(this->CondOutletNodeNum).MassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; + DataLoopNode::Node(this->CondInletNodeNum).MassFlowRateMaxAvail = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; + DataLoopNode::Node(this->CondInletNodeNum).MassFlowRateMax = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; + DataLoopNode::Node(this->CondOutletNodeNum).MassFlowRateMax = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; + DataLoopNode::Node(this->CondInletNodeNum).MassFlowRateMinAvail = 0.0; + DataLoopNode::Node(this->CondInletNodeNum).MassFlowRateMin = 0.0; + DataLoopNode::Node(this->CondOutletNodeNum).MassFlowRateMinAvail = 0.0; + DataLoopNode::Node(this->CondOutletNodeNum).MassFlowRateMin = 0.0; + DataLoopNode::Node(this->CondInletNodeNum).Temp = this->TempRefCondIn; + } + + if (this->HeatRecActive) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->HRLoopNum).FluidName, DataGlobals::HWInitConvTemp, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidIndex, + DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); - ElecReformEIRChiller(EIRChillNum).DesignHeatRecMassFlowRate = rho * ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; + this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; PlantUtilities::InitComponentNodes(0.0, - ElecReformEIRChiller(EIRChillNum).DesignHeatRecMassFlowRate, - ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, - ElecReformEIRChiller(EIRChillNum).HeatRecOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).HRLoopNum, - ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, - ElecReformEIRChiller(EIRChillNum).HRBranchNum, - ElecReformEIRChiller(EIRChillNum).HRCompNum); + this->DesignHeatRecMassFlowRate, + this->HeatRecInletNodeNum, + this->HeatRecOutletNodeNum, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum); // overall capacity limit - ElecReformEIRChiller(EIRChillNum).HeatRecMaxCapacityLimit = - ElecReformEIRChiller(EIRChillNum).HeatRecCapacityFraction * - (ElecReformEIRChiller(EIRChillNum).RefCap + ElecReformEIRChiller(EIRChillNum).RefCap / ElecReformEIRChiller(EIRChillNum).RefCOP); + this->HeatRecMaxCapacityLimit = + this->HeatRecCapacityFraction * + (this->RefCap + this->RefCap / this->RefCOP); } - ElecReformEIRChiller(EIRChillNum).MyEnvrnFlag = false; + this->MyEnvrnFlag = false; } if (!DataGlobals::BeginEnvrnFlag) { - ElecReformEIRChiller(EIRChillNum).MyEnvrnFlag = true; + this->MyEnvrnFlag = true; } - if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) && ElecReformEIRChiller(EIRChillNum).ModulatedFlowSetToLoop) { + if ((this->FlowMode == LeavingSetPointModulated) && this->ModulatedFlowSetToLoop) { // fix for clumsy old input that worked because loop setpoint was spread. // could be removed with transition, testing , model change, period of being obsolete. - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = + DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } Real64 mdot; Real64 mdotCond; if ((std::abs(MyLoad) > 0.0) && RunFlag) { - mdot = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax; - mdotCond = ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax; + mdot = this->EvapMassFlowRateMax; + mdotCond = this->CondMassFlowRateMax; } else { mdot = 0.0; mdotCond = 0.0; } PlantUtilities::SetComponentFlowRate(mdot, - ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, - ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).CWLoopNum, - ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CWBranchNum, - ElecReformEIRChiller(EIRChillNum).CWCompNum); - - if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); + + if (this->CondenserType == WaterCooled) { PlantUtilities::SetComponentFlowRate(mdotCond, - ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, - ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).CDLoopNum, - ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CDBranchNum, - ElecReformEIRChiller(EIRChillNum).CDCompNum); + this->CondInletNodeNum, + this->CondOutletNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } // Initialize heat recovery flow rates at node - if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - int LoopNum = ElecReformEIRChiller(EIRChillNum).HRLoopNum; - int LoopSideNum = ElecReformEIRChiller(EIRChillNum).HRLoopSideNum; - int BranchIndex = ElecReformEIRChiller(EIRChillNum).HRBranchNum; - int CompIndex = ElecReformEIRChiller(EIRChillNum).HRCompNum; + if (this->HeatRecActive) { + int LoopNum = this->HRLoopNum; + int LoopSideNum = this->HRLoopSideNum; + int BranchIndex = this->HRBranchNum; + int CompIndex = this->HRCompNum; // check if inlet limit active and if exceeded. bool HeatRecRunFlag; - if (ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum > 0) { - Real64 HeatRecHighInletLimit = ScheduleManager::GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); - if (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum).Temp > HeatRecHighInletLimit) { // shut down heat recovery + if (this->HeatRecInletLimitSchedNum > 0) { + Real64 HeatRecHighInletLimit = ScheduleManager::GetCurrentScheduleValue(this->HeatRecInletLimitSchedNum); + if (DataLoopNode::Node(this->HeatRecInletNodeNum).Temp > HeatRecHighInletLimit) { // shut down heat recovery HeatRecRunFlag = false; } else { HeatRecRunFlag = RunFlag; @@ -1050,16 +1047,16 @@ namespace ChillerReformulatedEIR { } if (HeatRecRunFlag) { - mdot = ElecReformEIRChiller(EIRChillNum).DesignHeatRecMassFlowRate; + mdot = this->DesignHeatRecMassFlowRate; } else { mdot = 0.0; } - PlantUtilities::SetComponentFlowRate(mdot, ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, ElecReformEIRChiller(EIRChillNum).HeatRecOutletNodeNum, LoopNum, LoopSideNum, BranchIndex, CompIndex); + PlantUtilities::SetComponentFlowRate(mdot, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum, LoopNum, LoopSideNum, BranchIndex, CompIndex); } } - void SizeElecReformEIRChiller(int const EIRChillNum) + void ReformulatedEIRChillerSpecs::size() { // SUBROUTINE INFORMATION: @@ -1086,45 +1083,45 @@ namespace ChillerReformulatedEIR { static ObjexxFCL::gio::Fmt Format_530("('Cond Temp (C) = ',11(F7.2))"); static ObjexxFCL::gio::Fmt Format_531("('Curve Output = ',11(F7.2))"); - Real64 tmpNomCap = ElecReformEIRChiller(EIRChillNum).RefCap; - Real64 tmpEvapVolFlowRate = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate; - Real64 tmpCondVolFlowRate = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; + Real64 tmpNomCap = this->RefCap; + Real64 tmpEvapVolFlowRate = this->EvapVolFlowRate; + Real64 tmpCondVolFlowRate = this->CondVolFlowRate; int PltSizCondNum(0); // Plant Sizing index for condenser loop - if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { - PltSizCondNum = DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).PlantSizNum; + if (this->CondenserType == WaterCooled) { + PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; } // find the appropriate Plant Sizing object - int PltSizNum = DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).PlantSizNum; + int PltSizNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { - tmpEvapVolFlowRate = DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * ElecReformEIRChiller(EIRChillNum).SizFac; + tmpEvapVolFlowRate = DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; } else { - if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; + if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized) { - ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate = tmpEvapVolFlowRate; + if (this->EvapVolFlowRateWasAutoSized) { + this->EvapVolFlowRate = tmpEvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Initial Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } } else { // Hard-size with sizing data - if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { - Real64 EvapVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate; + if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { + Real64 EvapVolFlowRateUser = this->EvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate, "User-Specified Reference Chilled Water Flow Rate [m3/s]", @@ -1132,7 +1129,7 @@ namespace ChillerReformulatedEIR { if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + - ElecReformEIRChiller(EIRChillNum).Name); + this->Name); ShowContinueError("User-Specified Reference Chilled Water Flow Rate of " + General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Reference Chilled Water Flow Rate of " + @@ -1147,21 +1144,21 @@ namespace ChillerReformulatedEIR { } } } else { - if (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("Autosizing of Reformulated Electric Chiller evap flow rate requires a loop Sizing:Plant object"); - ShowContinueError("Occurs in Reformulated Electric Chiller object=" + ElecReformEIRChiller(EIRChillNum).Name); + ShowContinueError("Occurs in Reformulated Electric Chiller object=" + this->Name); ErrorsFound = true; } - if (!ElecReformEIRChiller(EIRChillNum).EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && - (ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate > 0.0)) { // Hard-size with sizing data + if (!this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && + (this->EvapVolFlowRate > 0.0)) { // Hard-size with sizing data ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "User-Specified Reference Chilled Water Flow Rate [m3/s]", - ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate); + this->EvapVolFlowRate); } } - PlantUtilities::RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, tmpEvapVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(this->EvapInletNodeNum, tmpEvapVolFlowRate); if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { @@ -1171,43 +1168,43 @@ namespace ChillerReformulatedEIR { SizingEvapOutletTemp = DataSizing::PlantSizData(PltSizNum).ExitTemp; SizingCondOutletTemp = DataSizing::PlantSizData(PltSizCondNum).ExitTemp + DataSizing::PlantSizData(PltSizCondNum).DeltaT; } else { - SizingEvapOutletTemp = ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; - SizingCondOutletTemp = ElecReformEIRChiller(EIRChillNum).TempRefCondOut; + SizingEvapOutletTemp = this->TempRefEvapOut; + SizingCondOutletTemp = this->TempRefCondOut; } - Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); - Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); - Real64 RefCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, SizingEvapOutletTemp, SizingCondOutletTemp); + Real64 RefCapFT = CurveManager::CurveValue(this->ChillerCapFTIndex, SizingEvapOutletTemp, SizingCondOutletTemp); tmpNomCap = (Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate) / RefCapFT; } else { - if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized) tmpNomCap = 0.0; + if (this->RefCapWasAutoSized) tmpNomCap = 0.0; } if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized) { - ElecReformEIRChiller(EIRChillNum).RefCap = tmpNomCap; + if (this->RefCapWasAutoSized) { + this->RefCap = tmpNomCap; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Design Size Reference Capacity [W]", tmpNomCap); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Initial Design Size Reference Capacity [W]", tmpNomCap); } } else { - if (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0 && tmpNomCap > 0.0) { - Real64 RefCapUser = ElecReformEIRChiller(EIRChillNum).RefCap; + if (this->RefCap > 0.0 && tmpNomCap > 0.0) { + Real64 RefCapUser = this->RefCap; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Design Size Reference Capacity [W]", tmpNomCap, "User-Specified Reference Capacity [W]", @@ -1215,7 +1212,7 @@ namespace ChillerReformulatedEIR { if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpNomCap - RefCapUser) / RefCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + - ElecReformEIRChiller(EIRChillNum).Name); + this->Name); ShowContinueError("User-Specified Reference Capacity of " + General::RoundSigDigits(RefCapUser, 2) + " [W]"); ShowContinueError("differs from Design Size Reference Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + " [W]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); @@ -1228,60 +1225,60 @@ namespace ChillerReformulatedEIR { } } } else { - if (ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->RefCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("Autosizing of Reformulated Electric Chiller reference capacity requires a loop Sizing:Plant object"); - ShowContinueError("Occurs in Reformulated Electric Chiller object=" + ElecReformEIRChiller(EIRChillNum).Name); + ShowContinueError("Occurs in Reformulated Electric Chiller object=" + this->Name); ErrorsFound = true; } - if (!ElecReformEIRChiller(EIRChillNum).RefCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && - (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0)) { + if (!this->RefCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && + (this->RefCap > 0.0)) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "User-Specified Reference Capacity [W]", - ElecReformEIRChiller(EIRChillNum).RefCap); + this->RefCap); } } if (PltSizCondNum > 0 && PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { - Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); - Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, - ElecReformEIRChiller(EIRChillNum).TempRefCondIn, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, + this->TempRefCondIn, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * - (1.0 + (1.0 / ElecReformEIRChiller(EIRChillNum).RefCOP) * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac) / + (1.0 + (1.0 / this->RefCOP) * this->CompPowerToCondenserFrac) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); // IF (DataPlant::PlantFirstSizesOkayToFinalize) ElecReformEIRChiller(EIRChillNum)%CondVolFlowRate = tmpCondVolFlowRate } else { - if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; + if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; // IF (DataPlant::PlantFirstSizesOkayToFinalize) ElecReformEIRChiller(EIRChillNum)%CondVolFlowRate = tmpCondVolFlowRate } if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized) { - ElecReformEIRChiller(EIRChillNum).CondVolFlowRate = tmpCondVolFlowRate; + if (this->CondVolFlowRateWasAutoSized) { + this->CondVolFlowRate = tmpCondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Design Size Reference Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Initial Design Size Reference Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } } else { - if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { - Real64 CondVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).CondVolFlowRate; + if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { + Real64 CondVolFlowRateUser = this->CondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Design Size Reference Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate, "User-Specified Reference Condenser Water Flow Rate [m3/s]", @@ -1289,7 +1286,7 @@ namespace ChillerReformulatedEIR { if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + - ElecReformEIRChiller(EIRChillNum).Name); + this->Name); ShowContinueError("User-Specified Reference Condenser Water Flow Rate of " + General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Reference Condenser Water Flow Rate of " + @@ -1304,49 +1301,49 @@ namespace ChillerReformulatedEIR { } } } else { - if (ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("Autosizing of Reformulated Electric EIR Chiller condenser flow rate requires a condenser"); ShowContinueError("loop Sizing:Plant object"); - ShowContinueError("Occurs in Reformulated Electric EIR Chiller object=" + ElecReformEIRChiller(EIRChillNum).Name); + ShowContinueError("Occurs in Reformulated Electric EIR Chiller object=" + this->Name); ErrorsFound = true; } - if (!ElecReformEIRChiller(EIRChillNum).CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && - (ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0)) { + if (!this->CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && + (this->CondVolFlowRate > 0.0)) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "User-Specified Reference Condenser Water Flow Rate [m3/s]", - ElecReformEIRChiller(EIRChillNum).CondVolFlowRate); + this->CondVolFlowRate); } } // save the reference condenser water volumetric flow rate for use by the condenser water loop sizing algorithms - PlantUtilities::RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, tmpCondVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(this->CondInletNodeNum, tmpCondVolFlowRate); - if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - Real64 tmpHeatRecVolFlowRate = tmpCondVolFlowRate * ElecReformEIRChiller(EIRChillNum).HeatRecCapacityFraction; - if (!ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRateWasAutoSized) - tmpHeatRecVolFlowRate = ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; + if (this->HeatRecActive) { + Real64 tmpHeatRecVolFlowRate = tmpCondVolFlowRate * this->HeatRecCapacityFraction; + if (!this->DesignHeatRecVolFlowRateWasAutoSized) + tmpHeatRecVolFlowRate = this->DesignHeatRecVolFlowRate; if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRateWasAutoSized) { - ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate = tmpHeatRecVolFlowRate; + if (this->DesignHeatRecVolFlowRateWasAutoSized) { + this->DesignHeatRecVolFlowRate = tmpHeatRecVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Initial Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } } else { - if (ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { - Real64 DesignHeatRecVolFlowRateUser = ElecReformEIRChiller(EIRChillNum).DesignHeatRecVolFlowRate; + if (this->DesignHeatRecVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { + Real64 DesignHeatRecVolFlowRateUser = this->DesignHeatRecVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - ElecReformEIRChiller(EIRChillNum).Name, + this->Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate, "User-Specified Design Heat Recovery Fluid Flow Rate [m3/s]", @@ -1355,7 +1352,7 @@ namespace ChillerReformulatedEIR { if ((std::abs(tmpHeatRecVolFlowRate - DesignHeatRecVolFlowRateUser) / DesignHeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + - ElecReformEIRChiller(EIRChillNum).Name); + this->Name); ShowContinueError("User-Specified Design Heat Recovery Fluid Flow Rate of " + General::RoundSigDigits(DesignHeatRecVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Heat Recovery Fluid Flow Rate of " + @@ -1370,76 +1367,76 @@ namespace ChillerReformulatedEIR { } } // save the reference heat recovery fluid volumetric flow rate - PlantUtilities::RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, tmpHeatRecVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(this->HeatRecInletNodeNum, tmpHeatRecVolFlowRate); } std::string equipName; // Name of chiller if (DataPlant::PlantFinalSizesOkayToReport) { - if (ElecReformEIRChiller(EIRChillNum).MySizeFlag) { + if (this->MySizeFlag) { Real64 IPLV; - StandardRatings::CalcChillerIPLV(ElecReformEIRChiller(EIRChillNum).Name, + StandardRatings::CalcChillerIPLV(this->Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, - ElecReformEIRChiller(EIRChillNum).RefCap, - ElecReformEIRChiller(EIRChillNum).RefCOP, - ElecReformEIRChiller(EIRChillNum).CondenserType, - ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, - ElecReformEIRChiller(EIRChillNum).MinUnloadRat, + this->RefCap, + this->RefCOP, + this->CondenserType, + this->ChillerCapFTIndex, + this->ChillerEIRFTIndex, + this->ChillerEIRFPLRIndex, + this->MinUnloadRat, IPLV, - ElecReformEIRChiller(EIRChillNum).EvapVolFlowRate, - ElecReformEIRChiller(EIRChillNum).CDLoopNum, - ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac); - ElecReformEIRChiller(EIRChillNum).MySizeFlag = false; + this->EvapVolFlowRate, + this->CDLoopNum, + this->CompPowerToCondenserFrac); + this->MySizeFlag = false; } // create predefined report - equipName = ElecReformEIRChiller(EIRChillNum).Name; + equipName = this->Name; OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechType, equipName, "Chiller:Electric:ReformulatedEIR"); - OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomEff, equipName, ElecReformEIRChiller(EIRChillNum).RefCOP); - OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomCap, equipName, ElecReformEIRChiller(EIRChillNum).RefCap); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomEff, equipName, this->RefCOP); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomCap, equipName, this->RefCap); } // Only check performance curves if Capacity and volumetric flow rate are greater than 0 - if (ElecReformEIRChiller(EIRChillNum).RefCap > 0.0 && ElecReformEIRChiller(EIRChillNum).CondVolFlowRate > 0.0) { + if (this->RefCap > 0.0 && this->CondVolFlowRate > 0.0) { // Check the CAP-FT, EIR-FT, and PLR curves at reference conditions and warn user if different from 1.0 by more than +-10% - if (ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex > 0) { - Real64 CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut, - ElecReformEIRChiller(EIRChillNum).TempRefCondOut); + if (this->ChillerCapFTIndex > 0) { + Real64 CurveVal = CurveManager::CurveValue(this->ChillerCapFTIndex, + this->TempRefEvapOut, + this->TempRefCondOut); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError("Capacity ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError("(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); ShowContinueError("Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); } - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, - ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin, - ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMax, - ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin, - ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax); + CurveManager::GetCurveMinMaxValues(this->ChillerCapFTIndex, + this->ChillerCAPFTXTempMin, + this->ChillerCAPFTXTempMax, + this->ChillerCAPFTYTempMin, + this->ChillerCAPFTYTempMax); } - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex > 0) { - Real64 CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut, - ElecReformEIRChiller(EIRChillNum).TempRefCondOut); + if (this->ChillerEIRFTIndex > 0) { + Real64 CurveVal = CurveManager::CurveValue(this->ChillerEIRFTIndex, + this->TempRefEvapOut, + this->TempRefCondOut); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError("Energy input ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError("(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); ShowContinueError("Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); } - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMin, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMax, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax); + CurveManager::GetCurveMinMaxValues(this->ChillerEIRFTIndex, + this->ChillerEIRFTXTempMin, + this->ChillerEIRFTXTempMax, + this->ChillerEIRFTYTempMin, + this->ChillerEIRFTYTempMax); } - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex > 0) { + if (this->ChillerEIRFPLRIndex > 0) { Real64 CurveVal(0.0); // Used to verify EIR-FT/CAP-FT curves = 1 at reference conditions - if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).TempRefCondOut, 1.0); - } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { - CurveVal = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, 1.0, 1.0, 0.0); // zrp_Aug2014 + if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { + CurveVal = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, this->TempRefCondOut, 1.0); + } else if (this->PartLoadCurveType == PLR_Lift) { + CurveVal = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, 1.0, 1.0, 0.0); // zrp_Aug2014 } if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError("Energy input ratio as a function of part-load ratio curve output is not equal to 1.0"); @@ -1447,36 +1444,36 @@ namespace ChillerReformulatedEIR { ShowContinueError("Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); } - if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax); - } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, - ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMin, - ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMax, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax, - ElecReformEIRChiller(EIRChillNum).ChillerTdevNomMin, - ElecReformEIRChiller(EIRChillNum).ChillerTdevNomMax); + if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { + CurveManager::GetCurveMinMaxValues(this->ChillerEIRFPLRIndex, + this->ChillerEIRFPLRTempMin, + this->ChillerEIRFPLRTempMax, + this->ChillerEIRFPLRPLRMin, + this->ChillerEIRFPLRPLRMax); + } else if (this->PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 + CurveManager::GetCurveMinMaxValues(this->ChillerEIRFPLRIndex, + this->ChillerLiftNomMin, + this->ChillerLiftNomMax, + this->ChillerEIRFPLRPLRMin, + this->ChillerEIRFPLRPLRMax, + this->ChillerTdevNomMin, + this->ChillerTdevNomMax); } - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin < 0 || - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin >= ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax || - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin > 1) { - ShowSevereError("Invalid minimum value of PLR = " + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, 3) + - " in bicubic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFPLRName + " which is used"); + if (this->ChillerEIRFPLRPLRMin < 0 || + this->ChillerEIRFPLRPLRMin >= this->ChillerEIRFPLRPLRMax || + this->ChillerEIRFPLRPLRMin > 1) { + ShowSevereError("Invalid minimum value of PLR = " + General::TrimSigDigits(this->ChillerEIRFPLRPLRMin, 3) + + " in bicubic curve = " + this->EIRFPLRName + " which is used"); ShowContinueError("by Chiller:Electric:ReformulatedEIR = " + equipName + '.'); ShowContinueError("The minimum value of PLR [y] must be from zero to 1, and less than the maximum value of PLR."); ErrorsFound = true; } - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax > 1.1 || - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax <= ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin || - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax < 0) { - ShowSevereError("Invalid maximum value of PLR = " + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax, 3) + - " in bicubic curve = " + ElecReformEIRChiller(EIRChillNum).EIRFPLRName + " which is used"); + if (this->ChillerEIRFPLRPLRMax > 1.1 || + this->ChillerEIRFPLRPLRMax <= this->ChillerEIRFPLRPLRMin || + this->ChillerEIRFPLRPLRMax < 0) { + ShowSevereError("Invalid maximum value of PLR = " + General::TrimSigDigits(this->ChillerEIRFPLRPLRMax, 3) + + " in bicubic curve = " + this->EIRFPLRName + " which is used"); ShowContinueError("by Chiller:Electric:ReformulatedEIR = " + equipName + '.'); ShowContinueError("The maximum value of PLR [y] must be from zero to 1.1, and greater than the minimum value of PLR."); ErrorsFound = true; @@ -1485,21 +1482,21 @@ namespace ChillerReformulatedEIR { } // Initialize condenser reference inlet temperature (not a user input) - Real64 Density = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, - ElecReformEIRChiller(EIRChillNum).TempRefCondOut, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + Real64 Density = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, + this->TempRefCondOut, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); - Real64 SpecificHeat = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, - ElecReformEIRChiller(EIRChillNum).TempRefCondOut, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, + Real64 SpecificHeat = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, + this->TempRefCondOut, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); - Real64 CondenserCapacity = ElecReformEIRChiller(EIRChillNum).RefCap * - (1.0 + (1.0 / ElecReformEIRChiller(EIRChillNum).RefCOP) * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac); - Real64 DeltaTCond = (CondenserCapacity) / (ElecReformEIRChiller(EIRChillNum).CondVolFlowRate * Density * SpecificHeat); - ElecReformEIRChiller(EIRChillNum).TempRefCondIn = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - DeltaTCond; + Real64 CondenserCapacity = this->RefCap * + (1.0 + (1.0 / this->RefCOP) * this->CompPowerToCondenserFrac); + Real64 DeltaTCond = (CondenserCapacity) / (this->CondVolFlowRate * Density * SpecificHeat); + this->TempRefCondIn = this->TempRefCondOut - DeltaTCond; - if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { + if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { // Check EIRFPLR curve output. Calculate condenser inlet temp based on reference condenser outlet temp, // chiller capacity, and mass flow rate. Starting with the calculated condenser inlet temp and PLR = 0, // calculate the condenser outlet temp proportional to PLR and test the EIRFPLR curve output for negative numbers. @@ -1507,19 +1504,19 @@ namespace ChillerReformulatedEIR { Array1D CurveValArray(11, 0.0); // Used to evaluate EIRFPLR curve objects Array1D CondTempArray(11, 0.0); // Used to evaluate EIRFPLR curve objects - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex > 0) { + if (this->ChillerEIRFPLRIndex > 0) { CondTempArray = 0.0; for (int CurveCheck = 0; CurveCheck <= 10; ++CurveCheck) { Real64 PLRTemp = CurveCheck / 10.0; - Real64 CondTemp = ElecReformEIRChiller(EIRChillNum).TempRefCondIn + (DeltaTCond * PLRTemp); - CondTemp = min(CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax); - CondTemp = max(CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin); + Real64 CondTemp = this->TempRefCondIn + (DeltaTCond * PLRTemp); + CondTemp = min(CondTemp, this->ChillerEIRFPLRTempMax); + CondTemp = max(CondTemp, this->ChillerEIRFPLRTempMin); Real64 CurveValTmp; // Used to evaluate EIRFPLR curve objects - if (PLRTemp < ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin) { + if (PLRTemp < this->ChillerEIRFPLRPLRMin) { CurveValTmp = CurveManager::CurveValue( - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, CondTemp, ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin); + this->ChillerEIRFPLRIndex, CondTemp, this->ChillerEIRFPLRPLRMin); } else { - CurveValTmp = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, CondTemp, PLRTemp); + CurveValTmp = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, CondTemp, PLRTemp); } if (CurveValTmp < 0.0) FoundNegValue = true; CurveValArray(CurveCheck + 1) = int(CurveValTmp * 100.0) / 100.0; @@ -1551,30 +1548,30 @@ namespace ChillerReformulatedEIR { } } } else { // just get curve min/max values if capacity or cond volume flow rate = 0 - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, - ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin, - ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMax, - ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin, - ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax); - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMin, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMax, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax); - if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax); - } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 - CurveManager::GetCurveMinMaxValues(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, - ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMin, - ElecReformEIRChiller(EIRChillNum).ChillerLiftNomMax, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax, - ElecReformEIRChiller(EIRChillNum).ChillerTdevNomMin, - ElecReformEIRChiller(EIRChillNum).ChillerTdevNomMax); + CurveManager::GetCurveMinMaxValues(this->ChillerCapFTIndex, + this->ChillerCAPFTXTempMin, + this->ChillerCAPFTXTempMax, + this->ChillerCAPFTYTempMin, + this->ChillerCAPFTYTempMax); + CurveManager::GetCurveMinMaxValues(this->ChillerEIRFTIndex, + this->ChillerEIRFTXTempMin, + this->ChillerEIRFTXTempMax, + this->ChillerEIRFTYTempMin, + this->ChillerEIRFTYTempMax); + if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { + CurveManager::GetCurveMinMaxValues(this->ChillerEIRFPLRIndex, + this->ChillerEIRFPLRTempMin, + this->ChillerEIRFPLRTempMax, + this->ChillerEIRFPLRPLRMin, + this->ChillerEIRFPLRPLRMax); + } else if (this->PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 + CurveManager::GetCurveMinMaxValues(this->ChillerEIRFPLRIndex, + this->ChillerLiftNomMin, + this->ChillerLiftNomMax, + this->ChillerEIRFPLRPLRMin, + this->ChillerEIRFPLRPLRMax, + this->ChillerTdevNomMin, + this->ChillerTdevNomMax); } } @@ -1583,7 +1580,7 @@ namespace ChillerReformulatedEIR { } } - void ControlReformEIRChillerModel(int &EIRChillNum, // Chiller number + void ReformulatedEIRChillerSpecs::control(int &EIRChillNum, // Chiller number Real64 &MyLoad, // Operating load [W] bool const RunFlag, // TRUE when chiller operating bool const FirstIteration, // TRUE when first iteration of timestep @@ -1613,51 +1610,50 @@ namespace ChillerReformulatedEIR { int const MaxIter(500); // Iteration control for General::SolveRoot if (MyLoad >= 0.0 || !RunFlag) { - CalcReformEIRChillerModel( - EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp); + this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, DataLoopNode::Node(this->CondInletNodeNum).Temp); } else { // Find min/max condenser outlet temperature used by curve objects // Minimum condenser leaving temperature allowed by CAPFT curve [C] - Real64 CAPFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin; + Real64 CAPFTYTmin = this->ChillerCAPFTYTempMin; // Minimum condenser leaving temperature allowed by EIRFT curve [C] Real64 Tmin(-99); // Minimum condenser leaving temperature allowed by curve objects [C] - Real64 EIRFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin; - if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { + Real64 EIRFTYTmin = this->ChillerEIRFTYTempMin; + if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] - Real64 EIRFPLRTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin; + Real64 EIRFPLRTmin = this->ChillerEIRFPLRTempMin; Tmin = min(CAPFTYTmin, EIRFTYTmin, EIRFPLRTmin); - } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 + } else if (this->PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 Tmin = min(CAPFTYTmin, EIRFTYTmin); } // Maximum condenser leaving temperature allowed by CAPFT curve [C] - Real64 CAPFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax; + Real64 CAPFTYTmax = this->ChillerCAPFTYTempMax; Real64 Tmax(-99); // Maximum condenser leaving temperature allowed by curve objects [C] // Maximum condenser leaving temperature allowed by EIRFT curve [C] - Real64 EIRFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax; - if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { + Real64 EIRFTYTmax = this->ChillerEIRFTYTempMax; + if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] - Real64 EIRFPLRTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax; + Real64 EIRFPLRTmax = this->ChillerEIRFPLRTempMax; Tmax = max(CAPFTYTmax, EIRFTYTmax, EIRFPLRTmax); - } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 + } else if (this->PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 Tmax = max(CAPFTYTmax, EIRFTYTmax); } // Check that condenser outlet temperature is within curve object limits prior to calling RegulaFalsi - CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Tmin); + this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Tmin); - // Condenser outlet temperature when using Tmin as input to CalcReformEIRChillerModel [C] - Real64 CondTempMin = ElecReformEIRChiller(EIRChillNum).CondOutletTemp; - CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Tmax); + // Condenser outlet temperature when using Tmin as input to calculate [C] + Real64 CondTempMin = this->CondOutletTemp; + this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Tmax); // Condenser outlet temperature when using Tmax as input to CalcReformEIRChillerModel [C] - Real64 CondTempMax = ElecReformEIRChiller(EIRChillNum).CondOutletTemp; + Real64 CondTempMax = this->CondOutletTemp; if (CondTempMin > Tmin && CondTempMax < Tmax) { @@ -1685,43 +1681,42 @@ namespace ChillerReformulatedEIR { if (SolFla == -1) { if (!DataGlobals::WarmupFlag) { - ++ElecReformEIRChiller(EIRChillNum).IterLimitExceededNum; - if (ElecReformEIRChiller(EIRChillNum).IterLimitExceededNum == 1) { + ++this->IterLimitExceededNum; + if (this->IterLimitExceededNum == 1) { ShowWarningError( - ElecReformEIRChiller(EIRChillNum).Name + + this->Name + ": Iteration limit exceeded calculating condenser outlet temperature and non-converged temperature is used"); } else { - ShowRecurringWarningErrorAtEnd(ElecReformEIRChiller(EIRChillNum).Name + + ShowRecurringWarningErrorAtEnd(this->Name + ": Iteration limit exceeded calculating condenser outlet temperature.", - ElecReformEIRChiller(EIRChillNum).IterLimitErrIndex, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->IterLimitErrIndex, + this->CondOutletTemp, + this->CondOutletTemp); } } } else if (SolFla == -2) { if (!DataGlobals::WarmupFlag) { - ++ElecReformEIRChiller(EIRChillNum).IterFailed; - if (ElecReformEIRChiller(EIRChillNum).IterFailed == 1) { - ShowWarningError(ElecReformEIRChiller(EIRChillNum).Name + ": Solution found when calculating condenser outlet " + ++this->IterFailed; + if (this->IterFailed == 1) { + ShowWarningError(this->Name + ": Solution found when calculating condenser outlet " "temperature. The inlet temperature will used and the " "simulation continues..."); ShowContinueError("Please check minimum and maximum values of x in EIRFPLR Curve " + - ElecReformEIRChiller(EIRChillNum).EIRFPLRName); + this->EIRFPLRName); } else { - ShowRecurringWarningErrorAtEnd(ElecReformEIRChiller(EIRChillNum).Name + + ShowRecurringWarningErrorAtEnd(this->Name + ": Solution is not found in calculating condenser outlet temperature.", - ElecReformEIRChiller(EIRChillNum).IterFailedIndex, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->IterFailedIndex, + this->CondOutletTemp, + this->CondOutletTemp); } } - CalcReformEIRChillerModel( - EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp); + this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, DataLoopNode::Node(this->CondInletNodeNum).Temp); } } else { // If iteration is not possible, average the min/max condenser outlet temperature and manually determine solution - CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, (CondTempMin + CondTempMax) / 2.0); - CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, (CondTempMin + CondTempMax) / 2.0); + this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, this->CondOutletTemp); } // Call subroutine to evaluate all performance curve min/max values against evaporator/condenser outlet temps and PLR @@ -1908,13 +1903,13 @@ namespace ChillerReformulatedEIR { bool FirstIteration = (int(Par(4)) == 1); bool EquipFlowCtrl = int(Par(6)); - CalcReformEIRChillerModel(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, FalsiCondOutTemp); + ElecReformEIRChiller(EIRChillNum).calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, FalsiCondOutTemp); Real64 CondOutTempResidual = FalsiCondOutTemp - ElecReformEIRChiller(EIRChillNum).CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting return CondOutTempResidual; } - void CalcReformEIRChillerModel(int const EIRChillNum, // Chiller number + void ReformulatedEIRChillerSpecs::calculate(int const EIRChillNum, // Chiller number Real64 &MyLoad, // Operating load [W] bool const RunFlag, // TRUE when chiller operating bool const EP_UNUSED(FirstIteration), // TRUE when first iteration of timestep !unused1208 @@ -1947,27 +1942,27 @@ namespace ChillerReformulatedEIR { static ObjexxFCL::gio::Fmt OutputFormat("(F6.2)"); static std::string const RoutineName("CalcElecReformEIRChillerModel"); - ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = 0.0; - ElecReformEIRChiller(EIRChillNum).ChillerCyclingRatio = 0.0; - ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = 0.0; - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = 0.0; - ElecReformEIRChiller(EIRChillNum).CondMassFlowRate = 0.0; - ElecReformEIRChiller(EIRChillNum).Power = 0.0; - ElecReformEIRChiller(EIRChillNum).QCondenser = 0.0; - ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; - ElecReformEIRChiller(EIRChillNum).QHeatRecovery = 0.0; - int PlantLoopNum = ElecReformEIRChiller(EIRChillNum).CWLoopNum; - int LoopSideNum = ElecReformEIRChiller(EIRChillNum).CWLoopSideNum; - int BranchNum = ElecReformEIRChiller(EIRChillNum).CWBranchNum; - int CompNum = ElecReformEIRChiller(EIRChillNum).CWCompNum; + this->ChillerPartLoadRatio = 0.0; + this->ChillerCyclingRatio = 0.0; + this->ChillerFalseLoadRate = 0.0; + this->EvapMassFlowRate = 0.0; + this->CondMassFlowRate = 0.0; + this->Power = 0.0; + this->QCondenser = 0.0; + this->QEvaporator = 0.0; + this->QHeatRecovery = 0.0; + int PlantLoopNum = this->CWLoopNum; + int LoopSideNum = this->CWLoopSideNum; + int BranchNum = this->CWBranchNum; + int CompNum = this->CWCompNum; // Set performance curve outputs to 0.0 when chiller is off - ElecReformEIRChiller(EIRChillNum).ChillerCapFT = 0.0; - ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = 0.0; - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = 0.0; + this->ChillerCapFT = 0.0; + this->ChillerEIRFT = 0.0; + this->ChillerEIRFPLR = 0.0; // Set module-level chiller evap and condenser inlet temperature variables - Real64 CondInletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).Temp; + Real64 condInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; // If no loop demand or chiller OFF, return // If chiller load is 0 or chiller is not running then leave the subroutine. Before leaving @@ -1975,96 +1970,87 @@ namespace ChillerReformulatedEIR { // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).MassFlowRate; + this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } - if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { - if (DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum) - .LoopSide(ElecReformEIRChiller(EIRChillNum).CDLoopSideNum) - .Branch(ElecReformEIRChiller(EIRChillNum).CDBranchNum) - .Comp(ElecReformEIRChiller(EIRChillNum).CDCompNum) + if (this->CondenserType == WaterCooled) { + if (DataPlant::PlantLoop(this->CDLoopNum) + .LoopSide(this->CDLoopSideNum) + .Branch(this->CDBranchNum) + .Comp(this->CDCompNum) .FlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive) { - ElecReformEIRChiller(EIRChillNum).CondMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).CondInletNodeNum).MassFlowRate; + this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; } } return; } - // LOAD LOCAL VARIABLES FROM DATA STRUCTURE (for code readability) - Real64 MinPartLoadRat = ElecReformEIRChiller(EIRChillNum).MinPartLoadRat; - Real64 MaxPartLoadRat = ElecReformEIRChiller(EIRChillNum).MaxPartLoadRat; - Real64 MinUnloadRat = ElecReformEIRChiller(EIRChillNum).MinUnloadRat; - // Chiller reference capacity [W] - Real64 ChillerRefCap = ElecReformEIRChiller(EIRChillNum).RefCap; + Real64 ChillerRefCap = this->RefCap; // Reference coefficient of performance, from user input - Real64 ReferenceCOP = ElecReformEIRChiller(EIRChillNum).RefCOP; - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).Temp; + Real64 ReferenceCOP = this->RefCOP; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).Temp; // Evaporator low temp. limit cut off [C] - Real64 TempLowLimitEout = ElecReformEIRChiller(EIRChillNum).TempLowLimitEvapOut; - - // Maximum evaporator mass flow rate converted from volume flow rate [kg/s] - Real64 EvapMassFlowRateMax = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRateMax; - int PartLoadCurveType = ElecReformEIRChiller(EIRChillNum).PartLoadCurveType; + Real64 TempLowLimitEout = this->TempLowLimitEvapOut; // If there is a fault of chiller fouling - if (ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { - int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingIndex; + if (this->FaultyChillerFoulingFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { + int FaultIndex = this->FaultyChillerFoulingIndex; Real64 NomCap_ff = ChillerRefCap; Real64 ReferenceCOP_ff = ReferenceCOP; // calculate the Faulty Chiller Fouling Factor using fault information - ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFactor = FaultsManager::FaultsChillerFouling(FaultIndex).CalFoulingFactor(); + this->FaultyChillerFoulingFactor = FaultsManager::FaultsChillerFouling(FaultIndex).CalFoulingFactor(); // update the Chiller nominal capacity and COP at faulty cases - ChillerRefCap = NomCap_ff * ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFactor; - ReferenceCOP = ReferenceCOP_ff * ElecReformEIRChiller(EIRChillNum).FaultyChillerFoulingFactor; + ChillerRefCap = NomCap_ff * this->FaultyChillerFoulingFactor; + ReferenceCOP = ReferenceCOP_ff * this->FaultyChillerFoulingFactor; } // Set mass flow rates - if (ElecReformEIRChiller(EIRChillNum).CondenserType == WaterCooled) { - ElecReformEIRChiller(EIRChillNum).CondMassFlowRate = ElecReformEIRChiller(EIRChillNum).CondMassFlowRateMax; - PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).CondMassFlowRate, - ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, - ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).CDLoopNum, - ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CDBranchNum, - ElecReformEIRChiller(EIRChillNum).CDCompNum); - PlantUtilities::PullCompInterconnectTrigger(ElecReformEIRChiller(EIRChillNum).CWLoopNum, - ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CWBranchNum, - ElecReformEIRChiller(EIRChillNum).CWCompNum, - ElecReformEIRChiller(EIRChillNum).CondMassFlowIndex, - ElecReformEIRChiller(EIRChillNum).CDLoopNum, - ElecReformEIRChiller(EIRChillNum).CDLoopSideNum, + if (this->CondenserType == WaterCooled) { + this->CondMassFlowRate = this->CondMassFlowRateMax; + PlantUtilities::SetComponentFlowRate(this->CondMassFlowRate, + this->CondInletNodeNum, + this->CondOutletNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); + PlantUtilities::PullCompInterconnectTrigger(this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + this->CondMassFlowIndex, + this->CDLoopNum, + this->CDLoopSideNum, DataPlant::CriteriaType_MassFlowRate, - ElecReformEIRChiller(EIRChillNum).CondMassFlowRate); + this->CondMassFlowRate); - if (ElecReformEIRChiller(EIRChillNum).CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; + if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; } Real64 FRAC = 1.0; Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) || + if ((this->FlowMode == LeavingSetPointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || - (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { + (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) || + if ((this->FlowMode == LeavingSetPointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || - (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { + (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; } @@ -2074,43 +2060,43 @@ namespace ChillerReformulatedEIR { } // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) - if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { - int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTIndex; + if (this->FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { + int FaultIndex = this->FaultyChillerSWTIndex; Real64 EvapOutletTempSetPoint_ff = EvapOutletTempSetPoint; // calculate the sensor offset using fault information - ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset = FaultsManager::FaultsChillerSWTSensor(FaultIndex).CalFaultOffsetAct(); + this->FaultyChillerSWTOffset = FaultsManager::FaultsChillerSWTSensor(FaultIndex).CalFaultOffsetAct(); // update the EvapOutletTempSetPoint EvapOutletTempSetPoint = - max(ElecReformEIRChiller(EIRChillNum).TempLowLimitEvapOut, - min(DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp, EvapOutletTempSetPoint_ff - ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset)); - ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset = EvapOutletTempSetPoint_ff - EvapOutletTempSetPoint; + max(this->TempLowLimitEvapOut, + min(DataLoopNode::Node(this->EvapInletNodeNum).Temp, EvapOutletTempSetPoint_ff - this->FaultyChillerSWTOffset)); + this->FaultyChillerSWTOffset = EvapOutletTempSetPoint_ff - EvapOutletTempSetPoint; } // correct temperature if using heat recovery // use report values for latest valid calculation, lagged somewhat - if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) { - if ((ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChiller(EIRChillNum).QCondenser) > + if (this->HeatRecActive) { + if ((this->QHeatRecovery + this->QCondenser) > 0.0) { // protect div by zero - ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = (ElecReformEIRChiller(EIRChillNum).QHeatRecovery * ElecReformEIRChiller(EIRChillNum).HeatRecOutletTemp + - ElecReformEIRChiller(EIRChillNum).QCondenser * ElecReformEIRChiller(EIRChillNum).CondOutletTemp) / - (ElecReformEIRChiller(EIRChillNum).QHeatRecovery + ElecReformEIRChiller(EIRChillNum).QCondenser); + this->ChillerCondAvgTemp = (this->QHeatRecovery * this->HeatRecOutletTemp + + this->QCondenser * this->CondOutletTemp) / + (this->QHeatRecovery + this->QCondenser); } else { - ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = FalsiCondOutTemp; + this->ChillerCondAvgTemp = FalsiCondOutTemp; } } else { - ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp = FalsiCondOutTemp; + this->ChillerCondAvgTemp = FalsiCondOutTemp; } // Get capacity curve info with respect to CW setpoint and leaving condenser water temps - ElecReformEIRChiller(EIRChillNum).ChillerCapFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, EvapOutletTempSetPoint, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp)); + this->ChillerCapFT = max(0.0, CurveManager::CurveValue(this->ChillerCapFTIndex, EvapOutletTempSetPoint, this->ChillerCondAvgTemp)); // Available chiller capacity as a function of temperature - Real64 AvailChillerCap = ChillerRefCap * ElecReformEIRChiller(EIRChillNum).ChillerCapFT; + Real64 AvailChillerCap = ChillerRefCap * this->ChillerCapFT; - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).MassFlowRate; + this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; // Some other component set the flow to 0. No reason to continue with calculations. - if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate == 0.0) { + if (this->EvapMassFlowRate == 0.0) { MyLoad = 0.0; return; } @@ -2118,9 +2104,9 @@ namespace ChillerReformulatedEIR { // This chiller is currently has only a water-cooled condenser // Calculate water side load - Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidName, - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CWLoopNum).FluidIndex, + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, + DataLoopNode::Node(this->EvapInletNodeNum).Temp, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 TempLoad; // actual load to be met by chiller. This value is compared to MyLoad @@ -2128,7 +2114,7 @@ namespace ChillerReformulatedEIR { // should be the actual load. Instead the minimum PLR * RefCap is // passed in. - TempLoad = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).MassFlowRateMaxAvail * Cp * (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapOutletTempSetPoint); + TempLoad = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRateMaxAvail * Cp * (DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapOutletTempSetPoint); TempLoad = max(0.0, TempLoad); @@ -2140,106 +2126,106 @@ namespace ChillerReformulatedEIR { // Part load ratio based on load and available chiller capacity, cap at max part load ratio Real64 PartLoadRat; // Operating part load ratio if (AvailChillerCap > 0) { - PartLoadRat = max(0.0, min(std::abs(MyLoad) / AvailChillerCap, MaxPartLoadRat)); + PartLoadRat = max(0.0, min(std::abs(MyLoad) / AvailChillerCap, this->MaxPartLoadRat)); } else { PartLoadRat = 0.0; } // Set evaporator heat transfer rate - ElecReformEIRChiller(EIRChillNum).QEvaporator = AvailChillerCap * PartLoadRat; - ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; + this->QEvaporator = AvailChillerCap * PartLoadRat; + this->ChillerPartLoadRatio = PartLoadRat; // If FlowLock is False (0), the chiller sets the plant loop mdot // If FlowLock is True (1), the new resolved plant loop mdot is used if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) { if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) { - ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = false; + this->PossibleSubcooling = false; } else { - ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = true; + this->PossibleSubcooling = true; } Real64 EvapDeltaTemp(0.0); // Evaporator temperature difference [C] // Either set the flow to the Constant value or calculate the flow for the variable volume case - if ((ElecReformEIRChiller(EIRChillNum).FlowMode == ConstantFlow) || (ElecReformEIRChiller(EIRChillNum).FlowMode == NotModulated)) { + if ((this->FlowMode == ConstantFlow) || (this->FlowMode == NotModulated)) { // Set the evaporator mass flow rate to design // Start by assuming max (design) flow - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = EvapMassFlowRateMax; + this->EvapMassFlowRate = this->EvapMassFlowRateMax; // Use PlantUtilities::SetComponentFlowRate to decide actual flow - PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, - ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, - ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).CWLoopNum, - ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CWBranchNum, - ElecReformEIRChiller(EIRChillNum).CWCompNum); - if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate != 0.0) { - EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; + PlantUtilities::SetComponentFlowRate(this->EvapMassFlowRate, + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); + if (this->EvapMassFlowRate != 0.0) { + EvapDeltaTemp = this->QEvaporator / this->EvapMassFlowRate / Cp; } else { EvapDeltaTemp = 0.0; } - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapDeltaTemp; - } else if (ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) { + this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; + } else if (this->FlowMode == LeavingSetPointModulated) { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint - EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint; + EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi; + EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { assert(false); } } if (EvapDeltaTemp != 0) { - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = max(0.0, (ElecReformEIRChiller(EIRChillNum).QEvaporator / Cp / EvapDeltaTemp)); - if ((ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate - EvapMassFlowRateMax) > DataBranchAirLoopPlant::MassFlowTolerance) ElecReformEIRChiller(EIRChillNum).PossibleSubcooling = true; + this->EvapMassFlowRate = max(0.0, (this->QEvaporator / Cp / EvapDeltaTemp)); + if ((this->EvapMassFlowRate - this->EvapMassFlowRateMax) > DataBranchAirLoopPlant::MassFlowTolerance) this->PossibleSubcooling = true; // Check to see if the Maximum is exceeded, if so set to maximum - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = min(EvapMassFlowRateMax, ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate); + this->EvapMassFlowRate = min(this->EvapMassFlowRateMax, this->EvapMassFlowRate); // Use PlantUtilities::SetComponentFlowRate to decide actual flow - PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, - ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, - ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).CWLoopNum, - ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CWBranchNum, - ElecReformEIRChiller(EIRChillNum).CWCompNum); + PlantUtilities::SetComponentFlowRate(this->EvapMassFlowRate, + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); // Should we recalculate this with the corrected setpoint? { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } - ElecReformEIRChiller(EIRChillNum).QEvaporator = max(0.0, (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp)); + this->QEvaporator = max(0.0, (this->EvapMassFlowRate * Cp * EvapDeltaTemp)); } else { // Try to request zero flow - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = 0.0; + this->EvapMassFlowRate = 0.0; // Use PlantUtilities::SetComponentFlowRate to decide actual flow - PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, - ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, - ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).CWLoopNum, - ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CWBranchNum, - ElecReformEIRChiller(EIRChillNum).CWCompNum); + PlantUtilities::SetComponentFlowRate(this->EvapMassFlowRate, + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); // No deltaT since component is not running - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp; - ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; + this->QEvaporator = 0.0; PartLoadRat = 0.0; - ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; + this->ChillerPartLoadRatio = PartLoadRat; - if (ElecReformEIRChiller(EIRChillNum).DeltaTErrCount < 1 && !DataGlobals::WarmupFlag) { - ++ElecReformEIRChiller(EIRChillNum).DeltaTErrCount; + if (this->DeltaTErrCount < 1 && !DataGlobals::WarmupFlag) { + ++this->DeltaTErrCount; ShowWarningError("Evaporator DeltaTemp = 0 in mass flow calculation (Tevapin = Tevapout setpoint temp)."); ShowContinueErrorTimeStamp(""); } else if (!DataGlobals::WarmupFlag) { - ++ElecReformEIRChiller(EIRChillNum).ChillerCapFTError; - ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + ++this->ChillerCapFTError; + ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": Evaporator DeltaTemp = 0 in mass flow calculation warning continues...", - ElecReformEIRChiller(EIRChillNum).DeltaTErrCountIndex, + this->DeltaTErrCountIndex, EvapDeltaTemp, EvapDeltaTemp); } @@ -2247,160 +2233,160 @@ namespace ChillerReformulatedEIR { } // End of Constant Variable Flow If Block // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) - if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation) && - (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate > 0)) { + if (this->FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation) && + (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator - int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTIndex; - bool VarFlowFlag = (ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated); + int FaultIndex = this->FaultyChillerSWTIndex; + bool VarFlowFlag = (this->FlowMode == LeavingSetPointModulated); FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, - ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset, + this->FaultyChillerSWTOffset, Cp, - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp, - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, - ElecReformEIRChiller(EIRChillNum).QEvaporator); + DataLoopNode::Node(this->EvapInletNodeNum).Temp, + this->EvapOutletTemp, + this->EvapMassFlowRate, + this->QEvaporator); // update corresponding variables at faulty case - PartLoadRat = (AvailChillerCap > 0.0) ? (ElecReformEIRChiller(EIRChillNum).QEvaporator / AvailChillerCap) : 0.0; - PartLoadRat = max(0.0, min(PartLoadRat, MaxPartLoadRat)); - ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; + PartLoadRat = (AvailChillerCap > 0.0) ? (this->QEvaporator / AvailChillerCap) : 0.0; + PartLoadRat = max(0.0, min(PartLoadRat, this->MaxPartLoadRat)); + this->ChillerPartLoadRatio = PartLoadRat; } } else { // If FlowLock is True - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).MassFlowRate; - PlantUtilities::SetComponentFlowRate(ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, - ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum, - ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).CWLoopNum, - ElecReformEIRChiller(EIRChillNum).CWLoopSideNum, - ElecReformEIRChiller(EIRChillNum).CWBranchNum, - ElecReformEIRChiller(EIRChillNum).CWCompNum); + this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; + PlantUtilities::SetComponentFlowRate(this->EvapMassFlowRate, + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); // Some other component set the flow to 0. No reason to continue with calculations. - if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate == 0.0) { + if (this->EvapMassFlowRate == 0.0) { MyLoad = 0.0; return; } Real64 EvapDeltaTemp; - if (ElecReformEIRChiller(EIRChillNum).PossibleSubcooling) { - ElecReformEIRChiller(EIRChillNum).QEvaporator = std::abs(MyLoad); - EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapDeltaTemp; + if (this->PossibleSubcooling) { + this->QEvaporator = std::abs(MyLoad); + EvapDeltaTemp = this->QEvaporator / this->EvapMassFlowRate / Cp; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; } else { - EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapOutletTempSetPoint; - ElecReformEIRChiller(EIRChillNum).QEvaporator = max(0.0, (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp)); - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = EvapOutletTempSetPoint; - } - if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < TempLowLimitEout) { - if ((DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - TempLowLimitEout) > DataPlant::DeltaTempTol) { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = TempLowLimitEout; - EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; - ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; + EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapOutletTempSetPoint; + this->QEvaporator = max(0.0, (this->EvapMassFlowRate * Cp * EvapDeltaTemp)); + this->EvapOutletTemp = EvapOutletTempSetPoint; + } + if (this->EvapOutletTemp < TempLowLimitEout) { + if ((DataLoopNode::Node(this->EvapInletNodeNum).Temp - TempLowLimitEout) > DataPlant::DeltaTempTol) { + this->EvapOutletTemp = TempLowLimitEout; + EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - this->EvapOutletTemp; + this->QEvaporator = this->EvapMassFlowRate * Cp * EvapDeltaTemp; } else { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp; - EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; - ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; + EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - this->EvapOutletTemp; + this->QEvaporator = this->EvapMassFlowRate * Cp * EvapDeltaTemp; } } - if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempMin) { - if ((DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempMin) > DataPlant::DeltaTempTol) { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempMin; - EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; - ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; + if (this->EvapOutletTemp < DataLoopNode::Node(this->EvapOutletNodeNum).TempMin) { + if ((DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempMin) > DataPlant::DeltaTempTol) { + this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempMin; + EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - this->EvapOutletTemp; + this->QEvaporator = this->EvapMassFlowRate * Cp * EvapDeltaTemp; } else { - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp; - EvapDeltaTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; - ElecReformEIRChiller(EIRChillNum).QEvaporator = ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate * Cp * EvapDeltaTemp; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; + EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - this->EvapOutletTemp; + this->QEvaporator = this->EvapMassFlowRate * Cp * EvapDeltaTemp; } } // If load exceeds the distributed load set to the distributed load - if (ElecReformEIRChiller(EIRChillNum).QEvaporator > std::abs(MyLoad)) { - if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { - ElecReformEIRChiller(EIRChillNum).QEvaporator = std::abs(MyLoad); - EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapDeltaTemp; + if (this->QEvaporator > std::abs(MyLoad)) { + if (this->EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { + this->QEvaporator = std::abs(MyLoad); + EvapDeltaTemp = this->QEvaporator / this->EvapMassFlowRate / Cp; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; } else { - ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp; + this->QEvaporator = 0.0; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; } } // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) - if (ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation) && - (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate > 0)) { + if (this->FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation) && + (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator - int FaultIndex = ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTIndex; + int FaultIndex = this->FaultyChillerSWTIndex; bool VarFlowFlag = false; FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, - ElecReformEIRChiller(EIRChillNum).FaultyChillerSWTOffset, + this->FaultyChillerSWTOffset, Cp, - DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp, - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, - ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate, - ElecReformEIRChiller(EIRChillNum).QEvaporator); + DataLoopNode::Node(this->EvapInletNodeNum).Temp, + this->EvapOutletTemp, + this->EvapMassFlowRate, + this->QEvaporator); // update corresponding variables at faulty case } // Checks QEvaporator on the basis of the machine limits. - if (ElecReformEIRChiller(EIRChillNum).QEvaporator > (AvailChillerCap * MaxPartLoadRat)) { - if (ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { - ElecReformEIRChiller(EIRChillNum).QEvaporator = AvailChillerCap * MaxPartLoadRat; - EvapDeltaTemp = ElecReformEIRChiller(EIRChillNum).QEvaporator / ElecReformEIRChiller(EIRChillNum).EvapMassFlowRate / Cp; + if (this->QEvaporator > (AvailChillerCap * this->MaxPartLoadRat)) { + if (this->EvapMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { + this->QEvaporator = AvailChillerCap * this->MaxPartLoadRat; + EvapDeltaTemp = this->QEvaporator / this->EvapMassFlowRate / Cp; // evaporator outlet temperature is allowed to float upwards (recalculate AvailChillerCap? iterate?) - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp - EvapDeltaTemp; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; } else { - ElecReformEIRChiller(EIRChillNum).QEvaporator = 0.0; - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapInletNodeNum).Temp; + this->QEvaporator = 0.0; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; } } if (AvailChillerCap > 0.0) { - PartLoadRat = max(0.0, min((ElecReformEIRChiller(EIRChillNum).QEvaporator / AvailChillerCap), MaxPartLoadRat)); + PartLoadRat = max(0.0, min((this->QEvaporator / AvailChillerCap), this->MaxPartLoadRat)); } else { PartLoadRat = 0.0; } // Chiller cycles below minimum part load ratio, FRAC = amount of time chiller is ON during this time step - if (PartLoadRat < MinPartLoadRat) FRAC = min(1.0, (PartLoadRat / MinPartLoadRat)); + if (PartLoadRat < this->MinPartLoadRat) FRAC = min(1.0, (PartLoadRat / this->MinPartLoadRat)); // set the module level variable used for reporting FRAC - ElecReformEIRChiller(EIRChillNum).ChillerCyclingRatio = FRAC; + this->ChillerCyclingRatio = FRAC; // Chiller is false loading below PLR = minimum unloading ratio, find PLR used for energy calculation if (AvailChillerCap > 0.0) { - PartLoadRat = max(PartLoadRat, MinUnloadRat); + PartLoadRat = max(PartLoadRat, this->MinUnloadRat); } else { PartLoadRat = 0.0; } // set the module level variable used for reporting PLR - ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio = PartLoadRat; + this->ChillerPartLoadRatio = PartLoadRat; // calculate the load due to false loading on chiller over and above water side load - ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = (AvailChillerCap * PartLoadRat * FRAC) - ElecReformEIRChiller(EIRChillNum).QEvaporator; - if (ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate < DataHVACGlobals::SmallLoad) { - ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate = 0.0; + this->ChillerFalseLoadRate = (AvailChillerCap * PartLoadRat * FRAC) - this->QEvaporator; + if (this->ChillerFalseLoadRate < DataHVACGlobals::SmallLoad) { + this->ChillerFalseLoadRate = 0.0; } } // This is the end of the FlowLock Block - ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp)); + this->ChillerEIRFT = max(0.0, CurveManager::CurveValue(this->ChillerEIRFTIndex, this->EvapOutletTemp, this->ChillerCondAvgTemp)); // Part Load Ratio Curve Type: 1_LeavingCondenserWaterTemperature; 2_Lift zrp_Aug2014 - if (PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp, PartLoadRat)); - } else if (PartLoadCurveType == PLR_Lift) { + if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { + this->ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(this->ChillerEIRFPLRIndex, this->ChillerCondAvgTemp, PartLoadRat)); + } else if (this->PartLoadCurveType == PLR_Lift) { // Chiller lift - Real64 ChillerLift = ElecReformEIRChiller(EIRChillNum).ChillerCondAvgTemp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + Real64 ChillerLift = this->ChillerCondAvgTemp - this->EvapOutletTemp; // Deviation of leaving chilled water temperature from the reference condition - Real64 ChillerTdev = std::abs(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); + Real64 ChillerTdev = std::abs(this->EvapOutletTemp - this->TempRefEvapOut); // Chiller lift under the reference condition - Real64 ChillerLiftRef = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; + Real64 ChillerLiftRef = this->TempRefCondOut - this->TempRefEvapOut; if (ChillerLiftRef <= 0) ChillerLiftRef = 35 - 6.67; @@ -2410,26 +2396,26 @@ namespace ChillerReformulatedEIR { // Normalized ChillerTdev Real64 ChillerTdevNom = ChillerTdev / ChillerLiftRef; - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ChillerLiftNom, PartLoadRat, ChillerTdevNom)); + this->ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(this->ChillerEIRFPLRIndex, ChillerLiftNom, PartLoadRat, ChillerTdevNom)); } if (ReferenceCOP <= 0) ReferenceCOP = 5.5; - ElecReformEIRChiller(EIRChillNum).Power = (AvailChillerCap / ReferenceCOP) * ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR * ElecReformEIRChiller(EIRChillNum).ChillerEIRFT * FRAC; + this->Power = (AvailChillerCap / ReferenceCOP) * this->ChillerEIRFPLR * this->ChillerEIRFT * FRAC; - ElecReformEIRChiller(EIRChillNum).QCondenser = ElecReformEIRChiller(EIRChillNum).Power * ElecReformEIRChiller(EIRChillNum).CompPowerToCondenserFrac + ElecReformEIRChiller(EIRChillNum).QEvaporator + ElecReformEIRChiller(EIRChillNum).ChillerFalseLoadRate; + this->QCondenser = this->Power * this->CompPowerToCondenserFrac + this->QEvaporator + this->ChillerFalseLoadRate; // Currently only water cooled chillers are allowed for the reformulated EIR chiller model - if (ElecReformEIRChiller(EIRChillNum).CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { + if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine - if (ElecReformEIRChiller(EIRChillNum).HeatRecActive) - ReformEIRChillerHeatRecovery(EIRChillNum, ElecReformEIRChiller(EIRChillNum).QCondenser, ElecReformEIRChiller(EIRChillNum).CondMassFlowRate, CondInletTemp, ElecReformEIRChiller(EIRChillNum).QHeatRecovery); - Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, - CondInletTemp, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, - RoutineName); - ElecReformEIRChiller(EIRChillNum).CondOutletTemp = ElecReformEIRChiller(EIRChillNum).QCondenser / ElecReformEIRChiller(EIRChillNum).CondMassFlowRate / Cp + CondInletTemp; + if (this->HeatRecActive) + ReformEIRChillerHeatRecovery(EIRChillNum, this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovery); + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, + condInletTemp, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + RoutineName); + this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / Cp + condInletTemp; } else { - ShowSevereError("ControlReformEIRChillerModel: Condenser flow = 0, for ElecReformEIRChiller=" + ElecReformEIRChiller(EIRChillNum).Name); + ShowSevereError("ControlReformEIRChillerModel: Condenser flow = 0, for ElecReformEIRChiller=" + this->Name); ShowContinueErrorTimeStamp(""); } } @@ -2453,8 +2439,6 @@ namespace ChillerReformulatedEIR { if (FirstIteration || DataGlobals::WarmupFlag || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; - // Move CAPFT and EIRFT min/max values for evaporator outlet temperature to local variables - // Minimum evaporator leaving temperature allowed by CAPFT curve [C] Real64 CAPFTXTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin; diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index 6451fe312db..f26a0d537a5 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -246,6 +246,25 @@ namespace ChillerReformulatedEIR { HeatRecMassFlow(0.0) { } + + void initialize(bool RunFlag, Real64 MyLoad); + + void size(); + + void control(int &EIRChillNum, // Chiller number + Real64 &MyLoad, // Operating load [W] + bool RunFlag, // TRUE when chiller operating + bool FirstIteration, // TRUE when first iteration of timestep + int EquipFlowCtrl // Flow control mode for the equipment + ); + + void calculate(int EIRChillNum, // Chiller number + Real64 &MyLoad, // Operating load [W] + bool RunFlag, // TRUE when chiller operating + bool FirstIteration, // TRUE when first iteration of timestep !unused1208 + int EquipFlowCtrl, // Flow control mode for the equipment + Real64 FalsiCondOutTemp // RegulaFalsi condenser outlet temperature result [C] + ); }; // Object Data @@ -270,20 +289,6 @@ namespace ChillerReformulatedEIR { void GetElecReformEIRChillerInput(); - void InitElecReformEIRChiller(int EIRChillNum, // Number of the current electric EIR chiller being simulated - bool RunFlag, // TRUE when chiller operating - Real64 MyLoad // Current load put on chiller - ); - - void SizeElecReformEIRChiller(int EIRChillNum); - - void ControlReformEIRChillerModel(int &EIRChillNum, // Chiller number - Real64 &MyLoad, // Operating load [W] - bool RunFlag, // TRUE when chiller operating - bool FirstIteration, // TRUE when first iteration of timestep - int EquipFlowCtrl // Flow control mode for the equipment - ); - void ReformEIRChillerHeatRecovery(int EIRChillNum, // Number of the current electric EIR chiller being simulated Real64 &QCond, // Current condenser load [W] Real64 CondMassFlow, // Current condenser mass flow [kg/s] @@ -300,14 +305,6 @@ namespace ChillerReformulatedEIR { Array1 const &Par // Parameter array used to interface with RegulaFalsi solver ); - void CalcReformEIRChillerModel(int EIRChillNum, // Chiller number - Real64 &MyLoad, // Operating load [W] - bool RunFlag, // TRUE when chiller operating - bool FirstIteration, // TRUE when first iteration of timestep !unused1208 - int EquipFlowCtrl, // Flow control mode for the equipment - Real64 FalsiCondOutTemp // RegulaFalsi condenser outlet temperature result [C] - ); - void CheckMinMaxCurveBoundaries(int EIRChillNum, // Number of the current electric EIR chiller being simulated bool FirstIteration // TRUE when first iteration of timestep ); From 545f2d9102bd1ec5974001b9e1a97eb6139c2619 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 12:36:02 -0700 Subject: [PATCH 15/41] function to members --- src/EnergyPlus/ChillerReformulatedEIR.cc | 509 +++++++++++------------ src/EnergyPlus/ChillerReformulatedEIR.hh | 43 +- 2 files changed, 254 insertions(+), 298 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 6d06615bee5..565df7a3464 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -214,8 +214,8 @@ namespace ChillerReformulatedEIR { if (LoopNum == ElecReformEIRChiller(EIRChillNum).CWLoopNum) { ElecReformEIRChiller(EIRChillNum).initialize(RunFlag, MyLoad); - ElecReformEIRChiller(EIRChillNum).control(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl); - UpdateReformEIRChillerRecords(MyLoad, RunFlag, EIRChillNum); + ElecReformEIRChiller(EIRChillNum).control(MyLoad, RunFlag, FirstIteration, EquipFlowCtrl); + ElecReformEIRChiller(EIRChillNum).update(MyLoad, RunFlag); } else if (LoopNum == ElecReformEIRChiller(EIRChillNum).CDLoopNum) { int LoopSide = ElecReformEIRChiller(EIRChillNum).CDLoopSideNum; PlantUtilities::UpdateChillerComponentCondenserSide(LoopNum, @@ -1580,12 +1580,7 @@ namespace ChillerReformulatedEIR { } } - void ReformulatedEIRChillerSpecs::control(int &EIRChillNum, // Chiller number - Real64 &MyLoad, // Operating load [W] - bool const RunFlag, // TRUE when chiller operating - bool const FirstIteration, // TRUE when first iteration of timestep - int const EquipFlowCtrl // Flow control mode for the equipment - ) + void ReformulatedEIRChillerSpecs::control(Real64 &MyLoad, bool const RunFlag, bool const FirstIteration, int const EquipFlowCtrl) { // SUBROUTINE INFORMATION: @@ -1610,7 +1605,7 @@ namespace ChillerReformulatedEIR { int const MaxIter(500); // Iteration control for General::SolveRoot if (MyLoad >= 0.0 || !RunFlag) { - this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, DataLoopNode::Node(this->CondInletNodeNum).Temp); + this->calculate(MyLoad, RunFlag, EquipFlowCtrl, DataLoopNode::Node(this->CondInletNodeNum).Temp); } else { // Find min/max condenser outlet temperature used by curve objects @@ -1646,11 +1641,11 @@ namespace ChillerReformulatedEIR { } // Check that condenser outlet temperature is within curve object limits prior to calling RegulaFalsi - this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Tmin); + this->calculate(MyLoad, RunFlag, EquipFlowCtrl, Tmin); // Condenser outlet temperature when using Tmin as input to calculate [C] Real64 CondTempMin = this->CondOutletTemp; - this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, Tmax); + this->calculate(MyLoad, RunFlag, EquipFlowCtrl, Tmax); // Condenser outlet temperature when using Tmax as input to CalcReformEIRChillerModel [C] Real64 CondTempMax = this->CondOutletTemp; @@ -1660,7 +1655,6 @@ namespace ChillerReformulatedEIR { Array1D Par(6); // Pass parameters for RegulaFalsi solver // Initialize iteration parameters for RegulaFalsi function - Par(1) = EIRChillNum; Par(2) = MyLoad; if (RunFlag) { Par(3) = 1.0; @@ -1677,7 +1671,8 @@ namespace ChillerReformulatedEIR { int SolFla; // Feedback flag from General::SolveRoot Real64 FalsiCondOutTemp; // RegulaFalsi condenser outlet temperature result [C] - General::SolveRoot(Acc, MaxIter, SolFla, FalsiCondOutTemp, CondOutTempResidual, Tmin, Tmax, Par); + auto f = std::bind(&ReformulatedEIRChillerSpecs::condOutTempResidual, this, std::placeholders::_1, std::placeholders::_2); + General::SolveRoot(Acc, MaxIter, SolFla, FalsiCondOutTemp, f, Tmin, Tmax, Par); if (SolFla == -1) { if (!DataGlobals::WarmupFlag) { @@ -1711,23 +1706,22 @@ namespace ChillerReformulatedEIR { this->CondOutletTemp); } } - this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, DataLoopNode::Node(this->CondInletNodeNum).Temp); + this->calculate(MyLoad, RunFlag, EquipFlowCtrl, DataLoopNode::Node(this->CondInletNodeNum).Temp); } } else { // If iteration is not possible, average the min/max condenser outlet temperature and manually determine solution - this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, (CondTempMin + CondTempMax) / 2.0); - this->calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, this->CondOutletTemp); + this->calculate(MyLoad, RunFlag, EquipFlowCtrl, (CondTempMin + CondTempMax) / 2.0); + this->calculate(MyLoad, RunFlag, EquipFlowCtrl, this->CondOutletTemp); } // Call subroutine to evaluate all performance curve min/max values against evaporator/condenser outlet temps and PLR - CheckMinMaxCurveBoundaries(EIRChillNum, FirstIteration); + this->checkMinMaxCurveBoundaries(FirstIteration); } } - void ReformEIRChillerHeatRecovery(int const EIRChillNum, // Number of the current electric EIR chiller being simulated - Real64 &QCond, // Current condenser load [W] + void ReformulatedEIRChillerSpecs::calcHeatRecovery(Real64 &QCond, // Current condenser load [W] Real64 const CondMassFlow, // Current condenser mass flow [kg/s] - Real64 const CondInletTemp, // Current condenser inlet temp [C] + Real64 const condInletTemp, // Current condenser inlet temp [C] Real64 &QHeatRec // Amount of heat recovered [W] ) { @@ -1742,56 +1736,56 @@ namespace ChillerReformulatedEIR { static std::string const RoutineName("EIRChillerHeatRecovery"); // inlet node to the heat recovery heat exchanger - Real64 HeatRecInletTemp = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum).Temp; - Real64 HeatRecMassFlowRate = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum).MassFlowRate; - - Real64 CpHeatRec = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidName, - HeatRecInletTemp, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).FluidIndex, - RoutineName); - Real64 CpCond = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidName, - CondInletTemp, - DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).CDLoopNum).FluidIndex, - RoutineName); + Real64 heatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; + Real64 HeatRecMassFlowRate = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; + + Real64 CpHeatRec = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->HRLoopNum).FluidName, + heatRecInletTemp, + DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + RoutineName); + Real64 CpCond = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, + condInletTemp, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + RoutineName); // Before we modify the QCondenser, the total or original value is transferred to QTot Real64 QTotal = QCond; - if (ElecReformEIRChiller(EIRChillNum).HeatRecSetPointNodeNum == 0) { // use original algorithm that blends temps - Real64 TAvgIn = (HeatRecMassFlowRate * CpHeatRec * HeatRecInletTemp + CondMassFlow * CpCond * CondInletTemp) / - (HeatRecMassFlowRate * CpHeatRec + CondMassFlow * CpCond); + if (this->HeatRecSetPointNodeNum == 0) { // use original algorithm that blends temps + Real64 TAvgIn = (HeatRecMassFlowRate * CpHeatRec * heatRecInletTemp + CondMassFlow * CpCond * condInletTemp) / + (HeatRecMassFlowRate * CpHeatRec + CondMassFlow * CpCond); Real64 TAvgOut = QTotal / (HeatRecMassFlowRate * CpHeatRec + CondMassFlow * CpCond) + TAvgIn; - QHeatRec = HeatRecMassFlowRate * CpHeatRec * (TAvgOut - HeatRecInletTemp); + QHeatRec = HeatRecMassFlowRate * CpHeatRec * (TAvgOut - heatRecInletTemp); QHeatRec = max(QHeatRec, 0.0); // ensure non negative // check if heat flow too large for physical size of bundle - QHeatRec = min(QHeatRec, ElecReformEIRChiller(EIRChillNum).HeatRecMaxCapacityLimit); + QHeatRec = min(QHeatRec, this->HeatRecMaxCapacityLimit); } else { // use new algorithm to meet setpoint Real64 THeatRecSetPoint(0.0); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(ElecReformEIRChiller(EIRChillNum).HRLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - THeatRecSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecSetPointNodeNum).TempSetPoint; + THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - THeatRecSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).HeatRecSetPointNodeNum).TempSetPointHi; + THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } else { assert(false); } } - Real64 QHeatRecToSetPoint = HeatRecMassFlowRate * CpHeatRec * (THeatRecSetPoint - HeatRecInletTemp); + Real64 QHeatRecToSetPoint = HeatRecMassFlowRate * CpHeatRec * (THeatRecSetPoint - heatRecInletTemp); QHeatRecToSetPoint = max(QHeatRecToSetPoint, 0.0); QHeatRec = min(QTotal, QHeatRecToSetPoint); // check if heat flow too large for physical size of bundle - QHeatRec = min(QHeatRec, ElecReformEIRChiller(EIRChillNum).HeatRecMaxCapacityLimit); + QHeatRec = min(QHeatRec, this->HeatRecMaxCapacityLimit); } // check if limit on inlet is present and exceeded. - if (ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum > 0) { - Real64 HeatRecHighInletLimit = ScheduleManager::GetCurrentScheduleValue(ElecReformEIRChiller(EIRChillNum).HeatRecInletLimitSchedNum); - if (HeatRecInletTemp > HeatRecHighInletLimit) { // shut down heat recovery + if (this->HeatRecInletLimitSchedNum > 0) { + Real64 HeatRecHighInletLimit = ScheduleManager::GetCurrentScheduleValue(this->HeatRecInletLimitSchedNum); + if (heatRecInletTemp > HeatRecHighInletLimit) { // shut down heat recovery QHeatRec = 0.0; } } @@ -1800,16 +1794,13 @@ namespace ChillerReformulatedEIR { // Calculate a new Heat Recovery Coil Outlet Temp if (HeatRecMassFlowRate > 0.0) { - ElecReformEIRChiller(EIRChillNum).HeatRecOutletTemp = QHeatRec / (HeatRecMassFlowRate * CpHeatRec) + HeatRecInletTemp; + this->HeatRecOutletTemp = QHeatRec / (HeatRecMassFlowRate * CpHeatRec) + heatRecInletTemp; } else { - ElecReformEIRChiller(EIRChillNum).HeatRecOutletTemp = HeatRecInletTemp; + this->HeatRecOutletTemp = heatRecInletTemp; } } - void UpdateReformEIRChillerRecords(Real64 const MyLoad, // Current load [W] - bool const RunFlag, // TRUE if chiller operating - int const Num // Chiller number - ) + void ReformulatedEIRChillerSpecs::update(Real64 const MyLoad, bool const RunFlag) { // SUBROUTINE INFORMATION: // AUTHOR: Lixing Gu, FSEC @@ -1820,68 +1811,66 @@ namespace ChillerReformulatedEIR { if (MyLoad >= 0.0 || !RunFlag) { // Chiller not running so pass inlet states to outlet states // Set node temperatures - DataLoopNode::Node(ElecReformEIRChiller(Num).EvapOutletNodeNum).Temp = DataLoopNode::Node(ElecReformEIRChiller(Num).EvapInletNodeNum).Temp; - DataLoopNode::Node(ElecReformEIRChiller(Num).CondOutletNodeNum).Temp = DataLoopNode::Node(ElecReformEIRChiller(Num).CondInletNodeNum).Temp; - - ElecReformEIRChiller(Num).ChillerPartLoadRatio = 0.0; - ElecReformEIRChiller(Num).ChillerCyclingRatio = 0.0; - ElecReformEIRChiller(Num).ChillerFalseLoadRate = 0.0; - ElecReformEIRChiller(Num).ChillerFalseLoad = 0.0; - ElecReformEIRChiller(Num).Power = 0.0; - ElecReformEIRChiller(Num).QEvaporator = 0.0; - ElecReformEIRChiller(Num).QCondenser = 0.0; - ElecReformEIRChiller(Num).Energy = 0.0; - ElecReformEIRChiller(Num).EvapEnergy = 0.0; - ElecReformEIRChiller(Num).CondEnergy = 0.0; - ElecReformEIRChiller(Num).EvapInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).EvapInletNodeNum).Temp; - ElecReformEIRChiller(Num).CondInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).CondInletNodeNum).Temp; - ElecReformEIRChiller(Num).CondOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).CondOutletNodeNum).Temp; - ElecReformEIRChiller(Num).EvapOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).EvapOutletNodeNum).Temp; - ElecReformEIRChiller(Num).ActualCOP = 0.0; - - if (ElecReformEIRChiller(Num).HeatRecActive) { - - PlantUtilities::SafeCopyPlantNode(ElecReformEIRChiller(Num).HeatRecInletNodeNum, ElecReformEIRChiller(Num).HeatRecOutletNodeNum); - ElecReformEIRChiller(Num).QHeatRecovery = 0.0; - ElecReformEIRChiller(Num).EnergyHeatRecovery = 0.0; - ElecReformEIRChiller(Num).HeatRecInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecInletNodeNum).Temp; - ElecReformEIRChiller(Num).HeatRecOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecOutletNodeNum).Temp; - ElecReformEIRChiller(Num).HeatRecMassFlow = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecInletNodeNum).MassFlowRate; + DataLoopNode::Node(this->EvapOutletNodeNum).Temp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; + DataLoopNode::Node(this->CondOutletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).Temp; + + this->ChillerPartLoadRatio = 0.0; + this->ChillerCyclingRatio = 0.0; + this->ChillerFalseLoadRate = 0.0; + this->ChillerFalseLoad = 0.0; + this->Power = 0.0; + this->QEvaporator = 0.0; + this->QCondenser = 0.0; + this->Energy = 0.0; + this->EvapEnergy = 0.0; + this->CondEnergy = 0.0; + this->EvapInletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; + this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; + this->CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; + this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).Temp; + this->ActualCOP = 0.0; + + if (this->HeatRecActive) { + + PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); + this->QHeatRecovery = 0.0; + this->EnergyHeatRecovery = 0.0; + this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; + this->HeatRecOutletTemp = DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp; + this->HeatRecMassFlow = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; } } else { // Chiller is running, so pass calculated values // Set node temperatures - DataLoopNode::Node(ElecReformEIRChiller(Num).EvapOutletNodeNum).Temp = ElecReformEIRChiller(Num).EvapOutletTemp; - DataLoopNode::Node(ElecReformEIRChiller(Num).CondOutletNodeNum).Temp = ElecReformEIRChiller(Num).CondOutletTemp; + DataLoopNode::Node(this->EvapOutletNodeNum).Temp = this->EvapOutletTemp; + DataLoopNode::Node(this->CondOutletNodeNum).Temp = this->CondOutletTemp; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available - ElecReformEIRChiller(Num).ChillerFalseLoad = ElecReformEIRChiller(Num).ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChiller(Num).Energy = ElecReformEIRChiller(Num).Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChiller(Num).EvapEnergy = ElecReformEIRChiller(Num).QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChiller(Num).CondEnergy = ElecReformEIRChiller(Num).QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ElecReformEIRChiller(Num).EvapInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).EvapInletNodeNum).Temp; - ElecReformEIRChiller(Num).CondInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).CondInletNodeNum).Temp; - if (ElecReformEIRChiller(Num).Power != 0.0) { - ElecReformEIRChiller(Num).ActualCOP = (ElecReformEIRChiller(Num).QEvaporator + ElecReformEIRChiller(Num).ChillerFalseLoadRate) / ElecReformEIRChiller(Num).Power; + this->ChillerFalseLoad = this->ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->Energy = this->Power * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->EvapEnergy = this->QEvaporator * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->CondEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + this->EvapInletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; + this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; + if (this->Power != 0.0) { + this->ActualCOP = (this->QEvaporator + this->ChillerFalseLoadRate) / this->Power; } else { - ElecReformEIRChiller(Num).ActualCOP = 0.0; + this->ActualCOP = 0.0; } - if (ElecReformEIRChiller(Num).HeatRecActive) { + if (this->HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(ElecReformEIRChiller(Num).HeatRecInletNodeNum, ElecReformEIRChiller(Num).HeatRecOutletNodeNum); - ElecReformEIRChiller(Num).EnergyHeatRecovery = ElecReformEIRChiller(Num).QHeatRecovery * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecOutletNodeNum).Temp = ElecReformEIRChiller(Num).HeatRecOutletTemp; - ElecReformEIRChiller(Num).HeatRecInletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecInletNodeNum).Temp; - ElecReformEIRChiller(Num).HeatRecOutletTemp = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecOutletNodeNum).Temp; - ElecReformEIRChiller(Num).HeatRecMassFlow = DataLoopNode::Node(ElecReformEIRChiller(Num).HeatRecInletNodeNum).MassFlowRate; + PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); + this->EnergyHeatRecovery = this->QHeatRecovery * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; + DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp = this->HeatRecOutletTemp; + this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; + this->HeatRecOutletTemp = DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp; + this->HeatRecMassFlow = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; } } } - Real64 CondOutTempResidual(Real64 const FalsiCondOutTemp, // RegulaFalsi condenser outlet temperature result [C] - Array1 const &Par // Parameter array used to interface with RegulaFalsi solver - ) + Real64 ReformulatedEIRChillerSpecs::condOutTempResidual(Real64 const FalsiCondOutTemp, Array1 const &Par) { // FUNCTION INFORMATION: @@ -1897,25 +1886,17 @@ namespace ChillerReformulatedEIR { // METHODOLOGY EMPLOYED: // Regula Falsi solver is used to calculate condenser outlet temperature. - int EIRChillNum = int(Par(1)); Real64 MyLoad = Par(2); bool RunFlag = (int(Par(3)) == 1); - bool FirstIteration = (int(Par(4)) == 1); bool EquipFlowCtrl = int(Par(6)); - ElecReformEIRChiller(EIRChillNum).calculate(EIRChillNum, MyLoad, RunFlag, FirstIteration, EquipFlowCtrl, FalsiCondOutTemp); - Real64 CondOutTempResidual = FalsiCondOutTemp - ElecReformEIRChiller(EIRChillNum).CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting + this->calculate(MyLoad, RunFlag, EquipFlowCtrl, FalsiCondOutTemp); + Real64 CondOutTempResidual = FalsiCondOutTemp - this->CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting return CondOutTempResidual; } - void ReformulatedEIRChillerSpecs::calculate(int const EIRChillNum, // Chiller number - Real64 &MyLoad, // Operating load [W] - bool const RunFlag, // TRUE when chiller operating - bool const EP_UNUSED(FirstIteration), // TRUE when first iteration of timestep !unused1208 - int const EquipFlowCtrl, // Flow control mode for the equipment - Real64 const FalsiCondOutTemp // RegulaFalsi condenser outlet temperature result [C] - ) + void ReformulatedEIRChillerSpecs::calculate(Real64 &MyLoad, bool const RunFlag, int const EquipFlowCtrl, Real64 const FalsiCondOutTemp ) { // SUBROUTINE INFORMATION: @@ -2408,7 +2389,7 @@ namespace ChillerReformulatedEIR { if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine if (this->HeatRecActive) - ReformEIRChillerHeatRecovery(EIRChillNum, this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovery); + this->calcHeatRecovery(this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovery); Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, @@ -2420,9 +2401,7 @@ namespace ChillerReformulatedEIR { } } - void CheckMinMaxCurveBoundaries(int const EIRChillNum, // Number of the current electric EIR chiller being simulated - bool const FirstIteration // TRUE when first iteration of timestep - ) + void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(bool const FirstIteration ) { // SUBROUTINE INFORMATION: // AUTHOR: R Raustad, FSEC @@ -2432,204 +2411,204 @@ namespace ChillerReformulatedEIR { // To compare the evaporator/condenser outlet temperatures to curve object min/max values // Do not print out warnings if chiller not operating or FirstIteration/DataGlobals::WarmupFlag/FlowLock - int PlantLoopNum = ElecReformEIRChiller(EIRChillNum).CWLoopNum; - int LoopSideNum = ElecReformEIRChiller(EIRChillNum).CWLoopSideNum; - int BranchNum = ElecReformEIRChiller(EIRChillNum).CWBranchNum; - int CompNum = ElecReformEIRChiller(EIRChillNum).CWCompNum; + int PlantLoopNum = this->CWLoopNum; + int LoopSideNum = this->CWLoopSideNum; + int BranchNum = this->CWBranchNum; + int CompNum = this->CWCompNum; if (FirstIteration || DataGlobals::WarmupFlag || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; // Minimum evaporator leaving temperature allowed by CAPFT curve [C] - Real64 CAPFTXTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMin; + Real64 CAPFTXTmin = this->ChillerCAPFTXTempMin; // Maximum evaporator leaving temperature allowed by CAPFT curve [C] - Real64 CAPFTXTmax = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTXTempMax; + Real64 CAPFTXTmax = this->ChillerCAPFTXTempMax; // Minimum evaporator leaving temperature allowed by EIRFT curve [C] - Real64 EIRFTXTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMin; + Real64 EIRFTXTmin = this->ChillerEIRFTXTempMin; // Maximum evaporator leaving temperature allowed by EIRFT curve [C] - Real64 EIRFTXTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTXTempMax; + Real64 EIRFTXTmax = this->ChillerEIRFTXTempMax; // Check bounds for curves, lump min/max into same check since min/max values are reported in recurring warning messages - if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < CAPFTXTmin || ElecReformEIRChiller(EIRChillNum).EvapOutletTemp > CAPFTXTmax) { - ++ElecReformEIRChiller(EIRChillNum).CAPFTXIter; - if (ElecReformEIRChiller(EIRChillNum).CAPFTXIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The evaporator outlet temperature (" + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, 2) + + if (this->EvapOutletTemp < CAPFTXTmin || this->EvapOutletTemp > CAPFTXTmax) { + ++this->CAPFTXIter; + if (this->CAPFTXIter == 1) { + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + + "\": The evaporator outlet temperature (" + General::TrimSigDigits(this->EvapOutletTemp, 2) + " C) is outside the range of evaporator outlet temperatures (X var) given in Cooling Capacity Function of " "Temperature biquadratic curve = " + - ElecReformEIRChiller(EIRChillNum).CAPFTName); + this->CAPFTName); ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(CAPFTXTmin, 2) + " C to " + General::TrimSigDigits(CAPFTXTmax, 2) + " C."); - ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evap outlet temp range in Cooling Capacity Function of Temp curve error continues.", - ElecReformEIRChiller(EIRChillNum).CAPFTXIterIndex, - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp); + this->CAPFTXIterIndex, + this->EvapOutletTemp, + this->EvapOutletTemp); } else { - ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evap outlet temp range in Cooling Capacity Function of Temp curve error continues.", - ElecReformEIRChiller(EIRChillNum).CAPFTXIterIndex, - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp); + this->CAPFTXIterIndex, + this->EvapOutletTemp, + this->EvapOutletTemp); } } - if (ElecReformEIRChiller(EIRChillNum).EvapOutletTemp < EIRFTXTmin || ElecReformEIRChiller(EIRChillNum).EvapOutletTemp > EIRFTXTmax) { - ++ElecReformEIRChiller(EIRChillNum).EIRFTXIter; - if (ElecReformEIRChiller(EIRChillNum).EIRFTXIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The evaporator outlet temperature (" + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, 2) + + if (this->EvapOutletTemp < EIRFTXTmin || this->EvapOutletTemp > EIRFTXTmax) { + ++this->EIRFTXIter; + if (this->EIRFTXIter == 1) { + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + + "\": The evaporator outlet temperature (" + General::TrimSigDigits(this->EvapOutletTemp, 2) + " C) is outside the range of evaporator outlet temperatures (X var) given in Electric Input to Cooling Output Ratio " "Function of Temperature biquadratic curve = " + - ElecReformEIRChiller(EIRChillNum).EIRFTName); + this->EIRFTName); ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFTXTmin, 2) + " C to " + General::TrimSigDigits(EIRFTXTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd( - "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evap outlet temp range in Electric Input to Cooling Output Ratio Function of Temp curve error continues.", - ElecReformEIRChiller(EIRChillNum).EIRFTXIterIndex, - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp); + this->EIRFTXIterIndex, + this->EvapOutletTemp, + this->EvapOutletTemp); } else { ShowRecurringWarningErrorAtEnd( - "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evap outlet temp range in Electric Input to Cooling Output Ratio Function of Temp curve error continues.", - ElecReformEIRChiller(EIRChillNum).EIRFTXIterIndex, - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp); + this->EIRFTXIterIndex, + this->EvapOutletTemp, + this->EvapOutletTemp); } } // Move CAPFT, EIRFT, and EIRFPLR min/max condenser outlet temperature values to local variables // Minimum condenser leaving temperature allowed by CAPFT curve [C] - Real64 CAPFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMin; + Real64 CAPFTYTmin = this->ChillerCAPFTYTempMin; // Maximum condenser leaving temperature allowed by CAPFT curve [C] - Real64 CAPFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerCAPFTYTempMax; + Real64 CAPFTYTmax = this->ChillerCAPFTYTempMax; // Minimum condenser leaving temperature allowed by EIRFT curve [C] - Real64 EIRFTYTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMin; + Real64 EIRFTYTmin = this->ChillerEIRFTYTempMin; // Maximum condenser leaving temperature allowed by EIRFT curve [C] - Real64 EIRFTYTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFTYTempMax; + Real64 EIRFTYTmax = this->ChillerEIRFTYTempMax; Real64 EIRFPLRTmin(0.0); // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] Real64 EIRFPLRTmax(0.0); // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] - if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - EIRFPLRTmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMin; - EIRFPLRTmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRTempMax; + if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { + EIRFPLRTmin = this->ChillerEIRFPLRTempMin; + EIRFPLRTmax = this->ChillerEIRFPLRTempMax; } // Move EIRFPLR min/max part-load ratio values to local variables // Minimum PLR allowed by EIRFPLR curve - Real64 EIRFPLRPLRmin = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMin; + Real64 EIRFPLRPLRmin = this->ChillerEIRFPLRPLRMin; // Maximum PLR allowed by EIRFPLR curve - Real64 EIRFPLRPLRmax = ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRPLRMax; + Real64 EIRFPLRPLRmax = this->ChillerEIRFPLRPLRMax; // Check bounds for curves, lump min/max into same check since min/max values are reported in recurring warning messages - if (ElecReformEIRChiller(EIRChillNum).CondOutletTemp < CAPFTYTmin || ElecReformEIRChiller(EIRChillNum).CondOutletTemp > CAPFTYTmax) { - ++ElecReformEIRChiller(EIRChillNum).CAPFTYIter; - if (ElecReformEIRChiller(EIRChillNum).CAPFTYIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 2) + + if (this->CondOutletTemp < CAPFTYTmin || this->CondOutletTemp > CAPFTYTmax) { + ++this->CAPFTYIter; + if (this->CAPFTYIter == 1) { + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + + "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Cooling Capacity Function of " "Temperature biquadratic curve = " + - ElecReformEIRChiller(EIRChillNum).CAPFTName); + this->CAPFTName); ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(CAPFTYTmin, 2) + " C to " + General::TrimSigDigits(CAPFTYTmax, 2) + " C."); - ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", - ElecReformEIRChiller(EIRChillNum).CAPFTYIterIndex, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->CAPFTYIterIndex, + this->CondOutletTemp, + this->CondOutletTemp); } else { - ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", - ElecReformEIRChiller(EIRChillNum).CAPFTYIterIndex, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->CAPFTYIterIndex, + this->CondOutletTemp, + this->CondOutletTemp); } } - if (ElecReformEIRChiller(EIRChillNum).CondOutletTemp < EIRFTYTmin || ElecReformEIRChiller(EIRChillNum).CondOutletTemp > EIRFTYTmax) { - ++ElecReformEIRChiller(EIRChillNum).EIRFTYIter; - if (ElecReformEIRChiller(EIRChillNum).EIRFTYIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 2) + + if (this->CondOutletTemp < EIRFTYTmin || this->CondOutletTemp > EIRFTYTmax) { + ++this->EIRFTYIter; + if (this->EIRFTYIter == 1) { + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + + "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Electric Input to Cooling Output Ratio " "Function of Temperature biquadratic curve = " + - ElecReformEIRChiller(EIRChillNum).EIRFTName); + this->EIRFTName); ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFTYTmin, 2) + " C to " + General::TrimSigDigits(EIRFTYTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd( - "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", - ElecReformEIRChiller(EIRChillNum).EIRFTYIterIndex, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->EIRFTYIterIndex, + this->CondOutletTemp, + this->CondOutletTemp); } else { ShowRecurringWarningErrorAtEnd( - "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", - ElecReformEIRChiller(EIRChillNum).EIRFTYIterIndex, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->EIRFTYIterIndex, + this->CondOutletTemp, + this->CondOutletTemp); } } - if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - if (ElecReformEIRChiller(EIRChillNum).CondOutletTemp < EIRFPLRTmin || ElecReformEIRChiller(EIRChillNum).CondOutletTemp > EIRFPLRTmax) { - ++ElecReformEIRChiller(EIRChillNum).EIRFPLRTIter; - if (ElecReformEIRChiller(EIRChillNum).EIRFPLRTIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 2) + + if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { + if (this->CondOutletTemp < EIRFPLRTmin || this->CondOutletTemp > EIRFPLRTmax) { + ++this->EIRFPLRTIter; + if (this->EIRFPLRTIter == 1) { + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + + "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (X var) given in Electric Input to Cooling Output " "Ratio Function of Part-load Ratio bicubic curve = " + - ElecReformEIRChiller(EIRChillNum).EIRFPLRName); + this->EIRFPLRName); ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFPLRTmin, 2) + " C to " + General::TrimSigDigits(EIRFPLRTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd( - "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", - ElecReformEIRChiller(EIRChillNum).EIRFPLRTIterIndex, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->EIRFPLRTIterIndex, + this->CondOutletTemp, + this->CondOutletTemp); } else { ShowRecurringWarningErrorAtEnd( - "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", - ElecReformEIRChiller(EIRChillNum).EIRFPLRTIterIndex, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->EIRFPLRTIterIndex, + this->CondOutletTemp, + this->CondOutletTemp); } } } - if (ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio < EIRFPLRPLRmin || ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio > EIRFPLRPLRmax) { - ++ElecReformEIRChiller(EIRChillNum).EIRFPLRPLRIter; - if (ElecReformEIRChiller(EIRChillNum).EIRFPLRPLRIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\": The part-load ratio (" + - General::TrimSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, 3) + + if (this->ChillerPartLoadRatio < EIRFPLRPLRmin || this->ChillerPartLoadRatio > EIRFPLRPLRmax) { + ++this->EIRFPLRPLRIter; + if (this->EIRFPLRPLRIter == 1) { + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The part-load ratio (" + + General::TrimSigDigits(this->ChillerPartLoadRatio, 3) + ") is outside the range of part-load ratios (Y var) given in Electric Input to Cooling Output Ratio Function of " "Part-load Ratio bicubic curve = " + - ElecReformEIRChiller(EIRChillNum).EIRFPLRName); + this->EIRFPLRName); ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFPLRPLRmin, 3) + " to " + General::TrimSigDigits(EIRFPLRPLRmax, 3) + '.'); ShowRecurringWarningErrorAtEnd( - "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The part-load ratio range in Electric Input to Cooling Output Ratio Function of PLRatio curve error continues.", - ElecReformEIRChiller(EIRChillNum).EIRFPLRPLRIterIndex, - ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, - ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio); + this->EIRFPLRPLRIterIndex, + this->ChillerPartLoadRatio, + this->ChillerPartLoadRatio); } else { ShowRecurringWarningErrorAtEnd( - "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The part-load ratio range in Electric Input to Cooling Output Ratio Function of PLRatio curve error continues.", - ElecReformEIRChiller(EIRChillNum).EIRFPLRPLRIterIndex, - ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, - ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio); + this->EIRFPLRPLRIterIndex, + this->ChillerPartLoadRatio, + this->ChillerPartLoadRatio); } } @@ -2638,20 +2617,20 @@ namespace ChillerReformulatedEIR { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) || + if ((this->FlowMode == LeavingSetPointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || - (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { + (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((ElecReformEIRChiller(EIRChillNum).FlowMode == LeavingSetPointModulated) || + if ((this->FlowMode == LeavingSetPointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || - (DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { + (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet - EvapOutletTempSetPoint = DataLoopNode::Node(ElecReformEIRChiller(EIRChillNum).EvapOutletNodeNum).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; } @@ -2660,62 +2639,62 @@ namespace ChillerReformulatedEIR { } } - ElecReformEIRChiller(EIRChillNum).ChillerCapFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerCapFTIndex, EvapOutletTempSetPoint, ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->ChillerCapFT = CurveManager::CurveValue(this->ChillerCapFTIndex, EvapOutletTempSetPoint, this->CondOutletTemp); - if (ElecReformEIRChiller(EIRChillNum).ChillerCapFT < 0) { - if (ElecReformEIRChiller(EIRChillNum).ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && + if (this->ChillerCapFT < 0) { + if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { - ++ElecReformEIRChiller(EIRChillNum).ChillerCapFTError; - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); - ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerCapFT, 3) + + ++this->ChillerCapFTError; + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); + ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + General::RoundSigDigits(this->ChillerCapFT, 3) + ")."); ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTempSetPoint, 1) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 1) + '.'); + " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { - ++ElecReformEIRChiller(EIRChillNum).ChillerCapFTError; - ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + ++this->ChillerCapFTError; + ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": Chiller Capacity as a Function of Temperature curve output is negative warning continues...", - ElecReformEIRChiller(EIRChillNum).ChillerCapFTErrorIndex, - ElecReformEIRChiller(EIRChillNum).ChillerCapFT, - ElecReformEIRChiller(EIRChillNum).ChillerCapFT); + this->ChillerCapFTErrorIndex, + this->ChillerCapFT, + this->ChillerCapFT); } } - ElecReformEIRChiller(EIRChillNum).ChillerEIRFT = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFTIndex, ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, ElecReformEIRChiller(EIRChillNum).CondOutletTemp); + this->ChillerEIRFT = CurveManager::CurveValue(this->ChillerEIRFTIndex, this->EvapOutletTemp, this->CondOutletTemp); - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFT < 0.0) { - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && + if (this->ChillerEIRFT < 0.0) { + if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { - ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError; - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); + ++this->ChillerEIRFTError; + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); ShowContinueError(" Reformulated Chiller EIR as a Function of Temperature curve output is negative (" + - General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, 3) + ")."); - ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp, 1) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 1) + '.'); + General::RoundSigDigits(this->ChillerEIRFT, 3) + ")."); + ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(this->EvapOutletTemp, 1) + + " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { - ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFTError; - ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + ++this->ChillerEIRFTError; + ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": Chiller EIR as a Function of Temperature curve output is negative warning continues...", - ElecReformEIRChiller(EIRChillNum).ChillerEIRFTErrorIndex, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFT, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFT); + this->ChillerEIRFTErrorIndex, + this->ChillerEIRFT, + this->ChillerEIRFT); } } - if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ElecReformEIRChiller(EIRChillNum).CondOutletTemp, ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio); - } else if (ElecReformEIRChiller(EIRChillNum).PartLoadCurveType == PLR_Lift) { + if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { + this->ChillerEIRFPLR = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, this->CondOutletTemp, this->ChillerPartLoadRatio); + } else if (this->PartLoadCurveType == PLR_Lift) { // Chiller lift [C] - Real64 ChillerLift = ElecReformEIRChiller(EIRChillNum).CondOutletTemp - ElecReformEIRChiller(EIRChillNum).EvapOutletTemp; + Real64 ChillerLift = this->CondOutletTemp - this->EvapOutletTemp; // Deviation of leaving chilled water temperature from the reference condition - Real64 ChillerTdev = std::abs(ElecReformEIRChiller(EIRChillNum).EvapOutletTemp - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut); + Real64 ChillerTdev = std::abs(this->EvapOutletTemp - this->TempRefEvapOut); // Chiller lift under the reference condition [C] - Real64 ChillerLiftRef = ElecReformEIRChiller(EIRChillNum).TempRefCondOut - ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; + Real64 ChillerLiftRef = this->TempRefCondOut - this->TempRefEvapOut; if (ChillerLiftRef <= 0) ChillerLiftRef = 35 - 6.67; @@ -2725,26 +2704,26 @@ namespace ChillerReformulatedEIR { // Normalized ChillerTdev Real64 ChillerTdevNom = ChillerTdev / ChillerLiftRef; - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR = CurveManager::CurveValue(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRIndex, ChillerLiftNom, ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, ChillerTdevNom); + this->ChillerEIRFPLR = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, ChillerLiftNom, this->ChillerPartLoadRatio, ChillerTdevNom); } - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR < 0.0) { - if (ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && + if (this->ChillerEIRFPLR < 0.0) { + if (this->ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { - ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError; - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + "\":"); + ++this->ChillerEIRFPLRError; + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); ShowContinueError(" Chiller EIR as a function of PLR and condenser water temperature curve output is negative (" + - General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, 3) + ")."); - ShowContinueError(" Negative value occurs using a part-load ratio of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).ChillerPartLoadRatio, 3) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(ElecReformEIRChiller(EIRChillNum).CondOutletTemp, 1) + " C."); + General::RoundSigDigits(this->ChillerEIRFPLR, 3) + ")."); + ShowContinueError(" Negative value occurs using a part-load ratio of " + General::RoundSigDigits(this->ChillerPartLoadRatio, 3) + + " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + " C."); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { - ++ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRError; - ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + ElecReformEIRChiller(EIRChillNum).Name + + ++this->ChillerEIRFPLRError; + ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": Chiller EIR as a function of PLR curve output is negative warning continues...", - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLRErrorIndex, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR, - ElecReformEIRChiller(EIRChillNum).ChillerEIRFPLR); + this->ChillerEIRFPLRErrorIndex, + this->ChillerEIRFPLR, + this->ChillerEIRFPLR); } } } diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index f26a0d537a5..642f74fe5f4 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -251,20 +251,17 @@ namespace ChillerReformulatedEIR { void size(); - void control(int &EIRChillNum, // Chiller number - Real64 &MyLoad, // Operating load [W] - bool RunFlag, // TRUE when chiller operating - bool FirstIteration, // TRUE when first iteration of timestep - int EquipFlowCtrl // Flow control mode for the equipment - ); + void control(Real64 &MyLoad, bool RunFlag, bool FirstIteration, int EquipFlowCtrl); - void calculate(int EIRChillNum, // Chiller number - Real64 &MyLoad, // Operating load [W] - bool RunFlag, // TRUE when chiller operating - bool FirstIteration, // TRUE when first iteration of timestep !unused1208 - int EquipFlowCtrl, // Flow control mode for the equipment - Real64 FalsiCondOutTemp // RegulaFalsi condenser outlet temperature result [C] - ); + void calculate(Real64 &MyLoad, bool RunFlag, int EquipFlowCtrl, Real64 FalsiCondOutTemp); + + void calcHeatRecovery(Real64 &QCond, Real64 CondMassFlow, Real64 condInletTemp, Real64 &QHeatRec); + + void update(Real64 MyLoad, bool RunFlag); + + void checkMinMaxCurveBoundaries(bool FirstIteration); + + Real64 condOutTempResidual(Real64 FalsiCondOutTemp, Array1 const &Par); }; // Object Data @@ -289,26 +286,6 @@ namespace ChillerReformulatedEIR { void GetElecReformEIRChillerInput(); - void ReformEIRChillerHeatRecovery(int EIRChillNum, // Number of the current electric EIR chiller being simulated - Real64 &QCond, // Current condenser load [W] - Real64 CondMassFlow, // Current condenser mass flow [kg/s] - Real64 CondInletTemp, // Current condenser inlet temp [C] - Real64 &QHeatRec // Amount of heat recovered [W] - ); - - void UpdateReformEIRChillerRecords(Real64 MyLoad, // Current load [W] - bool RunFlag, // TRUE if chiller operating - int Num // Chiller number - ); - - Real64 CondOutTempResidual(Real64 FalsiCondOutTemp, // RegulaFalsi condenser outlet temperature result [C] - Array1 const &Par // Parameter array used to interface with RegulaFalsi solver - ); - - void CheckMinMaxCurveBoundaries(int EIRChillNum, // Number of the current electric EIR chiller being simulated - bool FirstIteration // TRUE when first iteration of timestep - ); - } // namespace ChillerReformulatedEIR } // namespace EnergyPlus From 567a773e6f23c80481df5f2b95876d498158b20e Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 12:51:09 -0700 Subject: [PATCH 16/41] moving setupOutputVars to member function. small diffs and text diffs introduced here --- src/EnergyPlus/ChillerReformulatedEIR.cc | 358 ++++++++++++----------- src/EnergyPlus/ChillerReformulatedEIR.hh | 5 +- 2 files changed, 196 insertions(+), 167 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 565df7a3464..be3db5e8388 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -212,6 +212,11 @@ namespace ChillerReformulatedEIR { return; } + if (ElecReformEIRChiller(EIRChillNum).oneTimeFlag) { + ElecReformEIRChiller(EIRChillNum).setupOutputVars(); + ElecReformEIRChiller(EIRChillNum).oneTimeFlag = false; + } + if (LoopNum == ElecReformEIRChiller(EIRChillNum).CWLoopNum) { ElecReformEIRChiller(EIRChillNum).initialize(RunFlag, MyLoad); ElecReformEIRChiller(EIRChillNum).control(MyLoad, RunFlag, FirstIteration, EquipFlowCtrl); @@ -579,197 +584,218 @@ namespace ChillerReformulatedEIR { if (ErrorsFound) { ShowFatalError("Errors found in processing input for " + DataIPShortCuts::cCurrentModuleObject); } + } - for (int EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { - SetupOutputVariable("Chiller Part Load Ratio", - OutputProcessor::Unit::None, - ElecReformEIRChiller(EIRChillerNum).ChillerPartLoadRatio, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Cycling Ratio", - OutputProcessor::Unit::None, - ElecReformEIRChiller(EIRChillerNum).ChillerCyclingRatio, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Electric Power", + void ReformulatedEIRChillerSpecs::setupOutputVars() + { + SetupOutputVariable("Chiller Part Load Ratio", + OutputProcessor::Unit::None, + this->ChillerPartLoadRatio, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Cycling Ratio", + OutputProcessor::Unit::None, + this->ChillerCyclingRatio, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Electric Power", + OutputProcessor::Unit::W, + this->Power, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Electric Energy", + OutputProcessor::Unit::J, + this->Energy, + "System", + "Sum", + this->Name, + _, + "ELECTRICITY", + "Cooling", + this->EndUseSubcategory, + "Plant"); + + SetupOutputVariable("Chiller Evaporator Cooling Rate", + OutputProcessor::Unit::W, + this->QEvaporator, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Evaporator Cooling Energy", + OutputProcessor::Unit::J, + this->EvapEnergy, + "System", + "Sum", + this->Name, + _, + "ENERGYTRANSFER", + "CHILLERS", + _, + "Plant"); + + SetupOutputVariable("Chiller False Load Heat Transfer Rate", + OutputProcessor::Unit::W, + this->ChillerFalseLoadRate, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller False Load Heat Transfer Energy", + OutputProcessor::Unit::J, + this->ChillerFalseLoad, + "System", + "Sum", + this->Name); + + SetupOutputVariable("Chiller Evaporator Inlet Temperature", + OutputProcessor::Unit::C, + this->EvapInletTemp, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Evaporator Outlet Temperature", + OutputProcessor::Unit::C, + this->EvapOutletTemp, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Evaporator Mass Flow Rate", + OutputProcessor::Unit::kg_s, + this->EvapMassFlowRate, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Condenser Heat Transfer Rate", + OutputProcessor::Unit::W, + this->QCondenser, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Condenser Heat Transfer Energy", + OutputProcessor::Unit::J, + this->CondEnergy, + "System", + "Sum", + this->Name, + _, + "ENERGYTRANSFER", + "HEATREJECTION", + _, + "Plant"); + + SetupOutputVariable("Chiller COP", + OutputProcessor::Unit::W_W, + this->ActualCOP, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Capacity Temperature Modifier Multiplier", + OutputProcessor::Unit::None, + this->ChillerCapFT, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller EIR Temperature Modifier Multiplier", + OutputProcessor::Unit::None, + this->ChillerEIRFT, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller EIR Part Load Modifier Multiplier", + OutputProcessor::Unit::None, + this->ChillerEIRFPLR, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Condenser Inlet Temperature", + OutputProcessor::Unit::C, + this->CondInletTemp, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Condenser Outlet Temperature", + OutputProcessor::Unit::C, + this->CondOutletTemp, + "System", + "Average", + this->Name); + + SetupOutputVariable("Chiller Condenser Mass Flow Rate", + OutputProcessor::Unit::kg_s, + this->CondMassFlowRate, + "System", + "Average", + this->Name); + + // If heat recovery is active then setup report variables + if (this->HeatRecActive) { + SetupOutputVariable("Chiller Total Recovered Heat Rate", OutputProcessor::Unit::W, - ElecReformEIRChiller(EIRChillerNum).Power, + this->QHeatRecovery, "System", "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Electric Energy", - OutputProcessor::Unit::J, - ElecReformEIRChiller(EIRChillerNum).Energy, - "System", - "Sum", - ElecReformEIRChiller(EIRChillerNum).Name, - _, - "ELECTRICITY", - "Cooling", - ElecReformEIRChiller(EIRChillerNum).EndUseSubcategory, - "Plant"); + this->Name); - SetupOutputVariable("Chiller Evaporator Cooling Rate", - OutputProcessor::Unit::W, - ElecReformEIRChiller(EIRChillerNum).QEvaporator, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Evaporator Cooling Energy", + SetupOutputVariable("Chiller Total Recovered Heat Energy", OutputProcessor::Unit::J, - ElecReformEIRChiller(EIRChillerNum).EvapEnergy, + this->EnergyHeatRecovery, "System", "Sum", - ElecReformEIRChiller(EIRChillerNum).Name, + this->Name, _, "ENERGYTRANSFER", - "CHILLERS", + "HEATRECOVERY", _, "Plant"); - SetupOutputVariable("Chiller False Load Heat Transfer Rate", - OutputProcessor::Unit::W, - ElecReformEIRChiller(EIRChillerNum).ChillerFalseLoadRate, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller False Load Heat Transfer Energy", - OutputProcessor::Unit::J, - ElecReformEIRChiller(EIRChillerNum).ChillerFalseLoad, - "System", - "Sum", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Evaporator Inlet Temperature", - OutputProcessor::Unit::C, - ElecReformEIRChiller(EIRChillerNum).EvapInletTemp, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Evaporator Outlet Temperature", + + SetupOutputVariable("Chiller Heat Recovery Inlet Temperature", OutputProcessor::Unit::C, - ElecReformEIRChiller(EIRChillerNum).EvapOutletTemp, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Evaporator Mass Flow Rate", - OutputProcessor::Unit::kg_s, - ElecReformEIRChiller(EIRChillerNum).EvapMassFlowRate, + this->HeatRecInletTemp, "System", "Average", - ElecReformEIRChiller(EIRChillerNum).Name); + this->Name); - SetupOutputVariable("Chiller Condenser Heat Transfer Rate", - OutputProcessor::Unit::W, - ElecReformEIRChiller(EIRChillerNum).QCondenser, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Condenser Heat Transfer Energy", - OutputProcessor::Unit::J, - ElecReformEIRChiller(EIRChillerNum).CondEnergy, - "System", - "Sum", - ElecReformEIRChiller(EIRChillerNum).Name, - _, - "ENERGYTRANSFER", - "HEATREJECTION", - _, - "Plant"); - SetupOutputVariable("Chiller COP", - OutputProcessor::Unit::W_W, - ElecReformEIRChiller(EIRChillerNum).ActualCOP, + SetupOutputVariable("Chiller Heat Recovery Outlet Temperature", + OutputProcessor::Unit::C, + this->HeatRecOutletTemp, "System", "Average", - ElecReformEIRChiller(EIRChillerNum).Name); + this->Name); - SetupOutputVariable("Chiller Capacity Temperature Modifier Multiplier", - OutputProcessor::Unit::None, - ElecReformEIRChiller(EIRChillerNum).ChillerCapFT, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller EIR Temperature Modifier Multiplier", - OutputProcessor::Unit::None, - ElecReformEIRChiller(EIRChillerNum).ChillerEIRFT, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller EIR Part Load Modifier Multiplier", - OutputProcessor::Unit::None, - ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR, + SetupOutputVariable("Chiller Heat Recovery Mass Flow Rate", + OutputProcessor::Unit::kg_s, + this->HeatRecMassFlow, "System", "Average", - ElecReformEIRChiller(EIRChillerNum).Name); + this->Name); - SetupOutputVariable("Chiller Condenser Inlet Temperature", + SetupOutputVariable("Chiller Effective Heat Rejection Temperature", OutputProcessor::Unit::C, - ElecReformEIRChiller(EIRChillerNum).CondInletTemp, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Condenser Outlet Temperature", - OutputProcessor::Unit::C, - ElecReformEIRChiller(EIRChillerNum).CondOutletTemp, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Condenser Mass Flow Rate", - OutputProcessor::Unit::kg_s, - ElecReformEIRChiller(EIRChillerNum).CondMassFlowRate, + this->ChillerCondAvgTemp, "System", "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - - // If heat recovery is active then setup report variables - if (ElecReformEIRChiller(EIRChillerNum).HeatRecActive) { - SetupOutputVariable("Chiller Total Recovered Heat Rate", - OutputProcessor::Unit::W, - ElecReformEIRChiller(EIRChillerNum).QHeatRecovery, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Total Recovered Heat Energy", - OutputProcessor::Unit::J, - ElecReformEIRChiller(EIRChillerNum).EnergyHeatRecovery, - "System", - "Sum", - ElecReformEIRChiller(EIRChillerNum).Name, - _, - "ENERGYTRANSFER", - "HEATRECOVERY", - _, - "Plant"); - SetupOutputVariable("Chiller Heat Recovery Inlet Temperature", - OutputProcessor::Unit::C, - ElecReformEIRChiller(EIRChillerNum).HeatRecInletTemp, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Heat Recovery Outlet Temperature", - OutputProcessor::Unit::C, - ElecReformEIRChiller(EIRChillerNum).HeatRecOutletTemp, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Heat Recovery Mass Flow Rate", - OutputProcessor::Unit::kg_s, - ElecReformEIRChiller(EIRChillerNum).HeatRecMassFlow, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - SetupOutputVariable("Chiller Effective Heat Rejection Temperature", - OutputProcessor::Unit::C, - ElecReformEIRChiller(EIRChillerNum).ChillerCondAvgTemp, - "System", - "Average", - ElecReformEIRChiller(EIRChillerNum).Name); - } - - if (DataGlobals::AnyEnergyManagementSystemInModel) { - SetupEMSInternalVariable( - "Chiller Nominal Capacity", ElecReformEIRChiller(EIRChillerNum).Name, "[W]", ElecReformEIRChiller(EIRChillerNum).RefCap); - } + this->Name); + } + + if (DataGlobals::AnyEnergyManagementSystemInModel) { + SetupEMSInternalVariable( + "Chiller Nominal Capacity", this->Name, "[W]", this->RefCap); } } diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index 642f74fe5f4..0aa8fd6bf83 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -215,6 +215,7 @@ namespace ChillerReformulatedEIR { Real64 EnergyHeatRecovery; // reporting: Energy recovered from water-cooled condenser [J] Real64 HeatRecInletTemp; // reporting: Heat reclaim inlet temperature [C] Real64 HeatRecMassFlow; // reporting: Heat reclaim mass flow rate [kg/s] + bool oneTimeFlag; // Default Constructor ReformulatedEIRChillerSpecs() @@ -243,12 +244,14 @@ namespace ChillerReformulatedEIR { QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0), CondOutletTemp(0.0), EvapMassFlowRate(0.0), CondMassFlowRate(0.0), ChillerFalseLoad(0.0), Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), - HeatRecMassFlow(0.0) + HeatRecMassFlow(0.0), oneTimeFlag(true) { } void initialize(bool RunFlag, Real64 MyLoad); + void setupOutputVars(); + void size(); void control(Real64 &MyLoad, bool RunFlag, bool FirstIteration, int EquipFlowCtrl); From 5d94d93388866ea00eda475fb25c52c325533b7d Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 13:55:11 -0700 Subject: [PATCH 17/41] move to PlantComponent --- src/EnergyPlus/ChillerReformulatedEIR.cc | 198 +++++++++++------------ src/EnergyPlus/ChillerReformulatedEIR.hh | 40 +++-- src/EnergyPlus/Plant/PlantManager.cc | 2 + src/EnergyPlus/PlantLoopEquip.cc | 29 +--- 4 files changed, 115 insertions(+), 154 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index be3db5e8388..06539d773d5 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -74,6 +74,7 @@ #include #include #include +#include #include #include #include @@ -137,113 +138,100 @@ namespace ChillerReformulatedEIR { // Object Data Array1D ElecReformEIRChiller; // dimension to number of machines - void SimReformulatedEIRChiller(std::string const &EP_UNUSED(EIRChillerType), // Type of chiller !unused1208 - std::string const &EIRChillerName, // User specified name of chiller - int const EquipFlowCtrl, // Flow control mode for the equipment - int &CompIndex, // Chiller number pointer - int const LoopNum, // plant loop index pointer - bool const RunFlag, // Simulate chiller when TRUE - bool const FirstIteration, // Initialize variables when TRUE - bool &InitLoopEquip, // If not zero, calculate the max load for operating conditions - Real64 &MyLoad, // Loop demand component will meet [W] - Real64 &MaxCap, // Maximum operating capacity of chiller [W] - Real64 &MinCap, // Minimum operating capacity of chiller [W] - Real64 &OptCap, // Optimal operating capacity of chiller [W] - bool const GetSizingFactor, // TRUE when just the sizing factor is requested - Real64 &SizingFactor, // sizing factor - Real64 &TempCondInDesign, - Real64 &TempEvapOutDesign) + PlantComponent *ReformulatedEIRChillerSpecs::factory(std::string const &objectName) { - // SUBROUTINE INFORMATION: - // AUTHOR Lixing Gu - // DATE WRITTEN July 2004 - // MODIFIED na - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: - // This is the reformulated EIR chiller model driver. It gets the input for the - // models, initializes simulation variables, calls the appropriate model and sets - // up reporting variables. - - int EIRChillNum; - + // Process the input data if it hasn't been done already if (GetInputREIR) { GetElecReformEIRChillerInput(); GetInputREIR = false; } - - // Find the correct Chiller - if (CompIndex == 0) { - EIRChillNum = UtilityRoutines::FindItemInList(EIRChillerName, ElecReformEIRChiller); - if (EIRChillNum == 0) { - ShowFatalError("SimReformulatedEIRChiller: Specified Chiller not one of Valid Reformulated EIR Electric Chillers=" + EIRChillerName); + // Now look for this particular object in the list + for (auto &obj : ElecReformEIRChiller) { + if (obj.Name == objectName) { + return &obj; } - CompIndex = EIRChillNum; + } + // If we didn't find it, fatal + ShowFatalError("LocalReformulatedElectEIRChillerFactory: Error getting inputs for object named: " + objectName); // LCOV_EXCL_LINE + // Shut up the compiler + return nullptr; // LCOV_EXCL_LINE + } + + void ReformulatedEIRChillerSpecs::getDesignCapacities(const PlantLocation &calledFromLocation, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) + { + if (calledFromLocation.loopNum == this->CWLoopNum) { + MinLoad = this->RefCap * this->MinPartLoadRat; + MaxLoad = this->RefCap * this->MaxPartLoadRat; + OptLoad = this->RefCap * this->OptPartLoadRat; } else { - EIRChillNum = CompIndex; - if (EIRChillNum > NumElecReformEIRChillers || EIRChillNum < 1) { - ShowFatalError("SimReformulatedEIRChiller: Invalid CompIndex passed=" + General::TrimSigDigits(EIRChillNum) + - ", Number of Units=" + General::TrimSigDigits(NumElecReformEIRChillers) + ", Entered Unit name=" + EIRChillerName); - } - if (EIRChillerName != ElecReformEIRChiller(EIRChillNum).Name) { - ShowFatalError("SimReformulatedEIRChiller: Invalid CompIndex passed=" + General::TrimSigDigits(EIRChillNum) + ", Unit name=" + EIRChillerName + - ", stored Unit Name for that index=" + ElecReformEIRChiller(EIRChillNum).Name); - } + MinLoad = 0.0; + MaxLoad = 0.0; + OptLoad = 0.0; } + } - if (InitLoopEquip) { - TempEvapOutDesign = ElecReformEIRChiller(EIRChillNum).TempRefEvapOut; - TempCondInDesign = ElecReformEIRChiller(EIRChillNum).TempRefCondIn; - ElecReformEIRChiller(EIRChillNum).initialize(RunFlag, MyLoad); + void ReformulatedEIRChillerSpecs::getDesignTemperatures(Real64 &TempDesCondIn, Real64 &TempDesEvapOut) + { + TempDesEvapOut = this->TempRefEvapOut; + TempDesCondIn = this->TempRefCondIn; + } - if (LoopNum == ElecReformEIRChiller(EIRChillNum).CWLoopNum) { - ElecReformEIRChiller(EIRChillNum).size(); - MinCap = ElecReformEIRChiller(EIRChillNum).RefCap * ElecReformEIRChiller(EIRChillNum).MinPartLoadRat; - MaxCap = ElecReformEIRChiller(EIRChillNum).RefCap * ElecReformEIRChiller(EIRChillNum).MaxPartLoadRat; - OptCap = ElecReformEIRChiller(EIRChillNum).RefCap * ElecReformEIRChiller(EIRChillNum).OptPartLoadRat; - } else { - MinCap = 0.0; - MaxCap = 0.0; - OptCap = 0.0; - } - if (GetSizingFactor) { - SizingFactor = ElecReformEIRChiller(EIRChillNum).SizFac; - } - return; - } + void ReformulatedEIRChillerSpecs::getSizingFactor(Real64 &sizFac) + { + sizFac = this->SizFac; + } + + void ReformulatedEIRChillerSpecs::onInitLoopEquip(const PlantLocation &calledFromLocation) + { + bool runFlag = true; + Real64 myLoad = 0.0; + this->initialize(runFlag, myLoad); - if (ElecReformEIRChiller(EIRChillNum).oneTimeFlag) { - ElecReformEIRChiller(EIRChillNum).setupOutputVars(); - ElecReformEIRChiller(EIRChillNum).oneTimeFlag = false; + if (calledFromLocation.loopNum == this->CWLoopNum) { + this->size(); } + } - if (LoopNum == ElecReformEIRChiller(EIRChillNum).CWLoopNum) { - ElecReformEIRChiller(EIRChillNum).initialize(RunFlag, MyLoad); - ElecReformEIRChiller(EIRChillNum).control(MyLoad, RunFlag, FirstIteration, EquipFlowCtrl); - ElecReformEIRChiller(EIRChillNum).update(MyLoad, RunFlag); - } else if (LoopNum == ElecReformEIRChiller(EIRChillNum).CDLoopNum) { - int LoopSide = ElecReformEIRChiller(EIRChillNum).CDLoopSideNum; - PlantUtilities::UpdateChillerComponentCondenserSide(LoopNum, + void ReformulatedEIRChillerSpecs::simulate(const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) + { + // SUBROUTINE INFORMATION: + // AUTHOR Lixing Gu + // DATE WRITTEN July 2004 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS SUBROUTINE: + // This is the reformulated EIR chiller model driver. It gets the input for the + // models, initializes simulation variables, calls the appropriate model and sets + // up reporting variables. + + if (calledFromLocation.loopNum == this->CWLoopNum) { + this->initialize(RunFlag, CurLoad); + this->control(CurLoad, RunFlag, FirstHVACIteration); + this->update(CurLoad, RunFlag); + } else if (calledFromLocation.loopNum == this->CDLoopNum) { + int LoopSide = this->CDLoopSideNum; + PlantUtilities::UpdateChillerComponentCondenserSide(calledFromLocation.loopNum, LoopSide, DataPlant::TypeOf_Chiller_ElectricReformEIR, - ElecReformEIRChiller(EIRChillNum).CondInletNodeNum, - ElecReformEIRChiller(EIRChillNum).CondOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).QCondenser, - ElecReformEIRChiller(EIRChillNum).CondInletTemp, - ElecReformEIRChiller(EIRChillNum).CondOutletTemp, - ElecReformEIRChiller(EIRChillNum).CondMassFlowRate, - FirstIteration); - } else if (LoopNum == ElecReformEIRChiller(EIRChillNum).HRLoopNum) { - PlantUtilities::UpdateComponentHeatRecoverySide(ElecReformEIRChiller(EIRChillNum).HRLoopNum, - ElecReformEIRChiller(EIRChillNum).HRLoopSideNum, + this->CondInletNodeNum, + this->CondOutletNodeNum, + this->QCondenser, + this->CondInletTemp, + this->CondOutletTemp, + this->CondMassFlowRate, + FirstHVACIteration); + } else if (calledFromLocation.loopNum == this->HRLoopNum) { + PlantUtilities::UpdateComponentHeatRecoverySide(this->HRLoopNum, + this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, - ElecReformEIRChiller(EIRChillNum).HeatRecInletNodeNum, - ElecReformEIRChiller(EIRChillNum).HeatRecOutletNodeNum, - ElecReformEIRChiller(EIRChillNum).QHeatRecovery, - ElecReformEIRChiller(EIRChillNum).HeatRecInletTemp, - ElecReformEIRChiller(EIRChillNum).HeatRecOutletTemp, - ElecReformEIRChiller(EIRChillNum).HeatRecMassFlow, - FirstIteration); + this->HeatRecInletNodeNum, + this->HeatRecOutletNodeNum, + this->QHeatRecovery, + this->HeatRecInletTemp, + this->HeatRecOutletTemp, + this->HeatRecMassFlow, + FirstHVACIteration); } } @@ -818,6 +806,9 @@ namespace ChillerReformulatedEIR { // Init more variables if (this->MyInitFlag) { + + this->setupOutputVars(); + // Locate the chillers on the plant loops for later usage bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(this->Name, @@ -941,6 +932,8 @@ namespace ChillerReformulatedEIR { this->MyInitFlag = false; } + this->EquipFlowCtrl = DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; + if (this->MyEnvrnFlag && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, @@ -1606,7 +1599,7 @@ namespace ChillerReformulatedEIR { } } - void ReformulatedEIRChillerSpecs::control(Real64 &MyLoad, bool const RunFlag, bool const FirstIteration, int const EquipFlowCtrl) + void ReformulatedEIRChillerSpecs::control(Real64 &MyLoad, bool const RunFlag, bool const FirstIteration) { // SUBROUTINE INFORMATION: @@ -1631,7 +1624,7 @@ namespace ChillerReformulatedEIR { int const MaxIter(500); // Iteration control for General::SolveRoot if (MyLoad >= 0.0 || !RunFlag) { - this->calculate(MyLoad, RunFlag, EquipFlowCtrl, DataLoopNode::Node(this->CondInletNodeNum).Temp); + this->calculate(MyLoad, RunFlag, DataLoopNode::Node(this->CondInletNodeNum).Temp); } else { // Find min/max condenser outlet temperature used by curve objects @@ -1667,11 +1660,11 @@ namespace ChillerReformulatedEIR { } // Check that condenser outlet temperature is within curve object limits prior to calling RegulaFalsi - this->calculate(MyLoad, RunFlag, EquipFlowCtrl, Tmin); + this->calculate(MyLoad, RunFlag, Tmin); // Condenser outlet temperature when using Tmin as input to calculate [C] Real64 CondTempMin = this->CondOutletTemp; - this->calculate(MyLoad, RunFlag, EquipFlowCtrl, Tmax); + this->calculate(MyLoad, RunFlag, Tmax); // Condenser outlet temperature when using Tmax as input to CalcReformEIRChillerModel [C] Real64 CondTempMax = this->CondOutletTemp; @@ -1692,8 +1685,6 @@ namespace ChillerReformulatedEIR { } else { Par(4) = 0.0; } - // Par(5) = FlowLock !DSU - Par(6) = EquipFlowCtrl; int SolFla; // Feedback flag from General::SolveRoot Real64 FalsiCondOutTemp; // RegulaFalsi condenser outlet temperature result [C] @@ -1732,12 +1723,12 @@ namespace ChillerReformulatedEIR { this->CondOutletTemp); } } - this->calculate(MyLoad, RunFlag, EquipFlowCtrl, DataLoopNode::Node(this->CondInletNodeNum).Temp); + this->calculate(MyLoad, RunFlag, DataLoopNode::Node(this->CondInletNodeNum).Temp); } } else { // If iteration is not possible, average the min/max condenser outlet temperature and manually determine solution - this->calculate(MyLoad, RunFlag, EquipFlowCtrl, (CondTempMin + CondTempMax) / 2.0); - this->calculate(MyLoad, RunFlag, EquipFlowCtrl, this->CondOutletTemp); + this->calculate(MyLoad, RunFlag, (CondTempMin + CondTempMax) / 2.0); + this->calculate(MyLoad, RunFlag, this->CondOutletTemp); } // Call subroutine to evaluate all performance curve min/max values against evaporator/condenser outlet temps and PLR @@ -1914,15 +1905,14 @@ namespace ChillerReformulatedEIR { Real64 MyLoad = Par(2); bool RunFlag = (int(Par(3)) == 1); - bool EquipFlowCtrl = int(Par(6)); - this->calculate(MyLoad, RunFlag, EquipFlowCtrl, FalsiCondOutTemp); + this->calculate(MyLoad, RunFlag, FalsiCondOutTemp); Real64 CondOutTempResidual = FalsiCondOutTemp - this->CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting return CondOutTempResidual; } - void ReformulatedEIRChillerSpecs::calculate(Real64 &MyLoad, bool const RunFlag, int const EquipFlowCtrl, Real64 const FalsiCondOutTemp ) + void ReformulatedEIRChillerSpecs::calculate(Real64 &MyLoad, bool const RunFlag, Real64 const FalsiCondOutTemp ) { // SUBROUTINE INFORMATION: @@ -1976,7 +1966,7 @@ namespace ChillerReformulatedEIR { // if the component control is SERIESACTIVE we set the component flow to inlet flow so that // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { - if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { + if (this->EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } if (this->CondenserType == WaterCooled) { diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index 0aa8fd6bf83..95a38228638 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -54,6 +54,7 @@ // EnergyPlus Headers #include #include +#include namespace EnergyPlus { @@ -69,7 +70,7 @@ namespace ChillerReformulatedEIR { extern bool GetInputREIR; // When TRUE, calls subroutine to read input file - struct ReformulatedEIRChillerSpecs + struct ReformulatedEIRChillerSpecs : PlantComponent { // Members std::string Name; // User identifier @@ -215,7 +216,7 @@ namespace ChillerReformulatedEIR { Real64 EnergyHeatRecovery; // reporting: Energy recovered from water-cooled condenser [J] Real64 HeatRecInletTemp; // reporting: Heat reclaim inlet temperature [C] Real64 HeatRecMassFlow; // reporting: Heat reclaim mass flow rate [kg/s] - bool oneTimeFlag; + int EquipFlowCtrl; // Default Constructor ReformulatedEIRChillerSpecs() @@ -244,19 +245,31 @@ namespace ChillerReformulatedEIR { QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0), CondOutletTemp(0.0), EvapMassFlowRate(0.0), CondMassFlowRate(0.0), ChillerFalseLoad(0.0), Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), - HeatRecMassFlow(0.0), oneTimeFlag(true) + HeatRecMassFlow(0.0), EquipFlowCtrl(0) { } + static PlantComponent *factory(std::string const &objectName); + + void simulate(const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) override; + + void getDesignCapacities(const PlantLocation &calledFromLocation, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) override; + + void getDesignTemperatures(Real64 &TempDesCondIn, Real64 &TempDesEvapOut) override; + + void getSizingFactor(Real64 &sizFac) override; + + void onInitLoopEquip(const PlantLocation &calledFromLocation) override; + void initialize(bool RunFlag, Real64 MyLoad); void setupOutputVars(); void size(); - void control(Real64 &MyLoad, bool RunFlag, bool FirstIteration, int EquipFlowCtrl); + void control(Real64 &MyLoad, bool RunFlag, bool FirstIteration); - void calculate(Real64 &MyLoad, bool RunFlag, int EquipFlowCtrl, Real64 FalsiCondOutTemp); + void calculate(Real64 &MyLoad, bool RunFlag, Real64 FalsiCondOutTemp); void calcHeatRecovery(Real64 &QCond, Real64 CondMassFlow, Real64 condInletTemp, Real64 &QHeatRec); @@ -270,23 +283,6 @@ namespace ChillerReformulatedEIR { // Object Data extern Array1D ElecReformEIRChiller; // dimension to number of machines - void SimReformulatedEIRChiller(std::string const &EIRChillerType, // Type of chiller !unused1208 - std::string const &EIRChillerName, // User specified name of chiller - int EquipFlowCtrl, // Flow control mode for the equipment - int &CompIndex, // Chiller number pointer - int LoopNum, // plant loop index pointer - bool RunFlag, // Simulate chiller when TRUE - bool FirstIteration, // Initialize variables when TRUE - bool &InitLoopEquip, // If not zero, calculate the max load for operating conditions - Real64 &MyLoad, // Loop demand component will meet [W] - Real64 &MaxCap, // Maximum operating capacity of chiller [W] - Real64 &MinCap, // Minimum operating capacity of chiller [W] - Real64 &OptCap, // Optimal operating capacity of chiller [W] - bool GetSizingFactor, // TRUE when just the sizing factor is requested - Real64 &SizingFactor, // sizing factor - Real64 &TempCondInDesign, - Real64 &TempEvapOutDesign); - void GetElecReformEIRChillerInput(); } // namespace ChillerReformulatedEIR diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index 3410f2ace12..c886f385155 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -1078,6 +1079,7 @@ namespace EnergyPlus { } else if (LoopSideNum == SupplySide) { this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; } + this_comp.compPtr = ChillerReformulatedEIR::ReformulatedEIRChillerSpecs::factory(CompNames(CompNum)); } else if (UtilityRoutines::SameString(this_comp_type, "Chiller:Electric")) { this_comp.TypeOf_Num = TypeOf_Chiller_Electric; this_comp.GeneralEquipType = GenEquipTypes_Chiller; diff --git a/src/EnergyPlus/PlantLoopEquip.cc b/src/EnergyPlus/PlantLoopEquip.cc index 20d33517a31..44b02b94e3c 100644 --- a/src/EnergyPlus/PlantLoopEquip.cc +++ b/src/EnergyPlus/PlantLoopEquip.cc @@ -180,7 +180,6 @@ namespace PlantLoopEquip { using ChillerElectricEIR::SimElectricEIRChiller; using ChillerExhaustAbsorption::SimExhaustAbsorber; using ChillerGasAbsorption::SimGasAbsorber; - using ChillerReformulatedEIR::SimReformulatedEIRChiller; using Pumps::SimPumps; using ScheduleManager::GetCurrentScheduleValue; using BaseboardRadiator::UpdateBaseboardPlantConnection; @@ -349,33 +348,7 @@ namespace PlantLoopEquip { } } else if (EquipTypeNum == TypeOf_Chiller_ElectricReformEIR) { - SimReformulatedEIRChiller(sim_component.TypeOf, - sim_component.Name, - EquipFlowCtrl, - EquipNum, - LoopNum, - RunFlag, - FirstHVACIteration, - InitLoopEquip, - CurLoad, - MaxLoad, - MinLoad, - OptLoad, - GetCompSizFac, - SizingFac, - TempCondInDesign, - TempEvapOutDesign); - if (InitLoopEquip) { - sim_component.MaxLoad = MaxLoad; - sim_component.MinLoad = MinLoad; - sim_component.OptLoad = OptLoad; - sim_component.CompNum = EquipNum; - sim_component.TempDesCondIn = TempCondInDesign; - sim_component.TempDesEvapOut = TempEvapOutDesign; - } - if (GetCompSizFac) { - sim_component.SizFac = SizingFac; - } + sim_component.compPtr->simulate(sim_component_location, FirstHVACIteration, CurLoad, RunFlag); // Chiller-Heater needs to know whether it is being called for heating or cooling // Since loops are generic, pass the branch inlet nodenum From 91369383104819c523f5c974244f950054178b5e Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 16 Jan 2020 14:32:07 -0700 Subject: [PATCH 18/41] add clear_state --- src/EnergyPlus/ChillerReformulatedEIR.cc | 11 +++++++++-- src/EnergyPlus/ChillerReformulatedEIR.hh | 2 ++ tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 06539d773d5..6265fcfb561 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -119,7 +119,7 @@ namespace ChillerReformulatedEIR { int const AirCooled(1); // Air-cooled condenser currently not allowed int const WaterCooled(2); // Only water-cooled condensers are currently allowed int const EvapCooled(3); // Evap-cooled condenser currently not allowed - + // chiller flow modes int const FlowModeNotSet(200); int const ConstantFlow(201); @@ -138,6 +138,13 @@ namespace ChillerReformulatedEIR { // Object Data Array1D ElecReformEIRChiller; // dimension to number of machines + void clear_state() + { + NumElecReformEIRChillers = 0; + GetInputREIR = true; + ElecReformEIRChiller.deallocate(); + } + PlantComponent *ReformulatedEIRChillerSpecs::factory(std::string const &objectName) { // Process the input data if it hasn't been done already @@ -1749,7 +1756,7 @@ namespace ChillerReformulatedEIR { // PURPOSE OF THIS SUBROUTINE: // Calculate the heat recovered from the chiller condenser - + static std::string const RoutineName("EIRChillerHeatRecovery"); // inlet node to the heat recovery heat exchanger diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index 95a38228638..7992d31f4c3 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -283,6 +283,8 @@ namespace ChillerReformulatedEIR { // Object Data extern Array1D ElecReformEIRChiller; // dimension to number of machines + void clear_state(); + void GetElecReformEIRChillerInput(); } // namespace ChillerReformulatedEIR diff --git a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc index 16ff47bdafd..3bc2b57e2c8 100644 --- a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc +++ b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -320,6 +321,7 @@ void EnergyPlusFixture::clear_all_states() ChillerExhaustAbsorption::clear_state(); ChillerGasAbsorption::clear_state(); ChillerIndirectAbsorption::clear_state(); + ChillerReformulatedEIR::clear_state(); clearCoilSelectionReportObj(); // ReportCoilSelection clearFacilityElectricPowerServiceObject(); CondenserLoopTowers::clear_state(); From c6bd3f7c497dbf626441e0ef613b17e1050c0d2f Mon Sep 17 00:00:00 2001 From: nigusse Date: Fri, 17 Jan 2020 10:51:46 -0500 Subject: [PATCH 19/41] update damper position --- src/EnergyPlus/SingleDuct.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 5e735b43228..5483c8125c4 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -4883,6 +4883,14 @@ namespace SingleDuct { ShowFatalError("Invalid Reheat Component=" + Sys(SysNum).ReheatComp); } } + // Calculate Damper Position. + if (AirMassFlow == 0.0) { + Sys(SysNum).DamperPosition = 0.0; + } else if ((AirMassFlow > 0.0) && (AirMassFlow < Sys(SysNum).AirMassFlowRateMax)) { + Sys(SysNum).DamperPosition = AirMassFlow / Sys(SysNum).AirMassFlowRateMax; + } else if (AirMassFlow == Sys(SysNum).AirMassFlowRateMax) { + Sys(SysNum).DamperPosition = 1.0; + } LoadMet = AirMassFlow * CpAirZn * (Node(HCOutNode).Temp - Node(ZoneNode).Temp); } From 6fbbd6c6c00e7790e7ece5662b18fa59d669b24c Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 17 Jan 2020 11:59:21 -0700 Subject: [PATCH 20/41] rollback CondOutletTemp to mod-level variable to cleanup math diffs --- src/EnergyPlus/ChillerReformulatedEIR.cc | 85 +++++++++++++----------- src/EnergyPlus/ChillerReformulatedEIR.hh | 16 ++++- 2 files changed, 59 insertions(+), 42 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 6265fcfb561..a1552076ed5 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -133,16 +133,20 @@ namespace ChillerReformulatedEIR { // MODULE VARIABLE DECLARATIONS: int NumElecReformEIRChillers(0); // Number of electric reformulated EIR chillers specified in input + Real64 condOutletTempMod(0.0); + bool GetInputREIR(true); // When TRUE, calls subroutine to read input file // Object Data Array1D ElecReformEIRChiller; // dimension to number of machines + Array1D RefEIRReport; // dimension to number of machines void clear_state() { NumElecReformEIRChillers = 0; GetInputREIR = true; ElecReformEIRChiller.deallocate(); + RefEIRReport.deallocate(); } PlantComponent *ReformulatedEIRChillerSpecs::factory(std::string const &objectName) @@ -225,7 +229,7 @@ namespace ChillerReformulatedEIR { this->CondOutletNodeNum, this->QCondenser, this->CondInletTemp, - this->CondOutletTemp, + RefEIRReport(this->myIdx).CondOutletTemp, this->CondMassFlowRate, FirstHVACIteration); } else if (calledFromLocation.loopNum == this->HRLoopNum) { @@ -268,6 +272,7 @@ namespace ChillerReformulatedEIR { // ALLOCATE ARRAYS ElecReformEIRChiller.allocate(NumElecReformEIRChillers); + RefEIRReport.allocate(NumElecReformEIRChillers); // Load arrays with reformulated electric EIR chiller data for (int EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { @@ -290,6 +295,7 @@ namespace ChillerReformulatedEIR { // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueChillerName(DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), ErrorsFound, DataIPShortCuts::cCurrentModuleObject + " Name"); + ElecReformEIRChiller(EIRChillerNum).myIdx = EIRChillerNum; ElecReformEIRChiller(EIRChillerNum).Name = DataIPShortCuts::cAlphaArgs(1); // Performance curves ElecReformEIRChiller(EIRChillerNum).ChillerCapFTIndex = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(2)); @@ -726,7 +732,7 @@ namespace ChillerReformulatedEIR { SetupOutputVariable("Chiller Condenser Outlet Temperature", OutputProcessor::Unit::C, - this->CondOutletTemp, + RefEIRReport(this->myIdx).CondOutletTemp, "System", "Average", this->Name); @@ -1670,11 +1676,11 @@ namespace ChillerReformulatedEIR { this->calculate(MyLoad, RunFlag, Tmin); // Condenser outlet temperature when using Tmin as input to calculate [C] - Real64 CondTempMin = this->CondOutletTemp; + Real64 CondTempMin = condOutletTempMod; this->calculate(MyLoad, RunFlag, Tmax); // Condenser outlet temperature when using Tmax as input to CalcReformEIRChillerModel [C] - Real64 CondTempMax = this->CondOutletTemp; + Real64 CondTempMax = condOutletTempMod; if (CondTempMin > Tmin && CondTempMax < Tmax) { @@ -1709,8 +1715,8 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd(this->Name + ": Iteration limit exceeded calculating condenser outlet temperature.", this->IterLimitErrIndex, - this->CondOutletTemp, - this->CondOutletTemp); + condOutletTempMod, + condOutletTempMod); } } } else if (SolFla == -2) { @@ -1726,8 +1732,8 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd(this->Name + ": Solution is not found in calculating condenser outlet temperature.", this->IterFailedIndex, - this->CondOutletTemp, - this->CondOutletTemp); + condOutletTempMod, + condOutletTempMod); } } this->calculate(MyLoad, RunFlag, DataLoopNode::Node(this->CondInletNodeNum).Temp); @@ -1735,7 +1741,7 @@ namespace ChillerReformulatedEIR { } else { // If iteration is not possible, average the min/max condenser outlet temperature and manually determine solution this->calculate(MyLoad, RunFlag, (CondTempMin + CondTempMax) / 2.0); - this->calculate(MyLoad, RunFlag, this->CondOutletTemp); + this->calculate(MyLoad, RunFlag, condOutletTempMod); } // Call subroutine to evaluate all performance curve min/max values against evaporator/condenser outlet temps and PLR @@ -1850,7 +1856,7 @@ namespace ChillerReformulatedEIR { this->CondEnergy = 0.0; this->EvapInletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; - this->CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; + RefEIRReport(this->myIdx).CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).Temp; this->ActualCOP = 0.0; @@ -1867,7 +1873,7 @@ namespace ChillerReformulatedEIR { } else { // Chiller is running, so pass calculated values // Set node temperatures DataLoopNode::Node(this->EvapOutletNodeNum).Temp = this->EvapOutletTemp; - DataLoopNode::Node(this->CondOutletNodeNum).Temp = this->CondOutletTemp; + DataLoopNode::Node(this->CondOutletNodeNum).Temp = condOutletTempMod; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available this->ChillerFalseLoad = this->ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; @@ -1876,6 +1882,7 @@ namespace ChillerReformulatedEIR { this->CondEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; this->EvapInletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; + RefEIRReport(this->myIdx).CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; // missed here if (this->Power != 0.0) { this->ActualCOP = (this->QEvaporator + this->ChillerFalseLoadRate) / this->Power; } else { @@ -1914,7 +1921,7 @@ namespace ChillerReformulatedEIR { bool RunFlag = (int(Par(3)) == 1); this->calculate(MyLoad, RunFlag, FalsiCondOutTemp); - Real64 CondOutTempResidual = FalsiCondOutTemp - this->CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting + Real64 CondOutTempResidual = FalsiCondOutTemp - condOutletTempMod; // CondOutletTemp is module level variable, final value used for reporting return CondOutTempResidual; } @@ -2083,7 +2090,7 @@ namespace ChillerReformulatedEIR { if ((this->QHeatRecovery + this->QCondenser) > 0.0) { // protect div by zero this->ChillerCondAvgTemp = (this->QHeatRecovery * this->HeatRecOutletTemp + - this->QCondenser * this->CondOutletTemp) / + this->QCondenser * RefEIRReport(this->myIdx).CondOutletTemp) / // Maybe here too (this->QHeatRecovery + this->QCondenser); } else { this->ChillerCondAvgTemp = FalsiCondOutTemp; @@ -2417,7 +2424,7 @@ namespace ChillerReformulatedEIR { condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); - this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / Cp + condInletTemp; + condOutletTempMod = this->QCondenser / this->CondMassFlowRate / Cp + condInletTemp; } else { ShowSevereError("ControlReformEIRChillerModel: Condenser flow = 0, for ElecReformEIRChiller=" + this->Name); ShowContinueErrorTimeStamp(""); @@ -2533,11 +2540,11 @@ namespace ChillerReformulatedEIR { Real64 EIRFPLRPLRmax = this->ChillerEIRFPLRPLRMax; // Check bounds for curves, lump min/max into same check since min/max values are reported in recurring warning messages - if (this->CondOutletTemp < CAPFTYTmin || this->CondOutletTemp > CAPFTYTmax) { + if (condOutletTempMod < CAPFTYTmin || condOutletTempMod > CAPFTYTmax) { ++this->CAPFTYIter; if (this->CAPFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(condOutletTempMod, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Cooling Capacity Function of " "Temperature biquadratic curve = " + this->CAPFTName); @@ -2545,22 +2552,22 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", this->CAPFTYIterIndex, - this->CondOutletTemp, - this->CondOutletTemp); + condOutletTempMod, + condOutletTempMod); } else { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", this->CAPFTYIterIndex, - this->CondOutletTemp, - this->CondOutletTemp); + condOutletTempMod, + condOutletTempMod); } } - if (this->CondOutletTemp < EIRFTYTmin || this->CondOutletTemp > EIRFTYTmax) { + if (condOutletTempMod < EIRFTYTmin || condOutletTempMod > EIRFTYTmax) { ++this->EIRFTYIter; if (this->EIRFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(condOutletTempMod, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Electric Input to Cooling Output Ratio " "Function of Temperature biquadratic curve = " + this->EIRFTName); @@ -2569,24 +2576,24 @@ namespace ChillerReformulatedEIR { "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", this->EIRFTYIterIndex, - this->CondOutletTemp, - this->CondOutletTemp); + condOutletTempMod, + condOutletTempMod); } else { ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", this->EIRFTYIterIndex, - this->CondOutletTemp, - this->CondOutletTemp); + condOutletTempMod, + condOutletTempMod); } } if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - if (this->CondOutletTemp < EIRFPLRTmin || this->CondOutletTemp > EIRFPLRTmax) { + if (condOutletTempMod < EIRFPLRTmin || condOutletTempMod > EIRFPLRTmax) { ++this->EIRFPLRTIter; if (this->EIRFPLRTIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(condOutletTempMod, 2) + " C) is outside the range of condenser outlet temperatures (X var) given in Electric Input to Cooling Output " "Ratio Function of Part-load Ratio bicubic curve = " + this->EIRFPLRName); @@ -2596,15 +2603,15 @@ namespace ChillerReformulatedEIR { "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", this->EIRFPLRTIterIndex, - this->CondOutletTemp, - this->CondOutletTemp); + condOutletTempMod, + condOutletTempMod); } else { ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", this->EIRFPLRTIterIndex, - this->CondOutletTemp, - this->CondOutletTemp); + condOutletTempMod, + condOutletTempMod); } } } @@ -2662,7 +2669,7 @@ namespace ChillerReformulatedEIR { } } - this->ChillerCapFT = CurveManager::CurveValue(this->ChillerCapFTIndex, EvapOutletTempSetPoint, this->CondOutletTemp); + this->ChillerCapFT = CurveManager::CurveValue(this->ChillerCapFTIndex, EvapOutletTempSetPoint, condOutletTempMod); if (this->ChillerCapFT < 0) { if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && @@ -2672,7 +2679,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + General::RoundSigDigits(this->ChillerCapFT, 3) + ")."); ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTempSetPoint, 1) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + '.'); + " and a Condenser Leaving Temp of " + General::RoundSigDigits(condOutletTempMod, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++this->ChillerCapFTError; @@ -2684,7 +2691,7 @@ namespace ChillerReformulatedEIR { } } - this->ChillerEIRFT = CurveManager::CurveValue(this->ChillerEIRFTIndex, this->EvapOutletTemp, this->CondOutletTemp); + this->ChillerEIRFT = CurveManager::CurveValue(this->ChillerEIRFTIndex, this->EvapOutletTemp, condOutletTempMod); if (this->ChillerEIRFT < 0.0) { if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && @@ -2694,7 +2701,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Reformulated Chiller EIR as a Function of Temperature curve output is negative (" + General::RoundSigDigits(this->ChillerEIRFT, 3) + ")."); ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(this->EvapOutletTemp, 1) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + '.'); + " and a Condenser Leaving Temp of " + General::RoundSigDigits(condOutletTempMod, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++this->ChillerEIRFTError; @@ -2707,11 +2714,11 @@ namespace ChillerReformulatedEIR { } if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - this->ChillerEIRFPLR = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, this->CondOutletTemp, this->ChillerPartLoadRatio); + this->ChillerEIRFPLR = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, condOutletTempMod, this->ChillerPartLoadRatio); } else if (this->PartLoadCurveType == PLR_Lift) { // Chiller lift [C] - Real64 ChillerLift = this->CondOutletTemp - this->EvapOutletTemp; + Real64 ChillerLift = condOutletTempMod - this->EvapOutletTemp; // Deviation of leaving chilled water temperature from the reference condition Real64 ChillerTdev = std::abs(this->EvapOutletTemp - this->TempRefEvapOut); @@ -2738,7 +2745,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Chiller EIR as a function of PLR and condenser water temperature curve output is negative (" + General::RoundSigDigits(this->ChillerEIRFPLR, 3) + ")."); ShowContinueError(" Negative value occurs using a part-load ratio of " + General::RoundSigDigits(this->ChillerPartLoadRatio, 3) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + " C."); + " and a Condenser Leaving Temp of " + General::RoundSigDigits(condOutletTempMod, 1) + " C."); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++this->ChillerEIRFPLRError; diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index 7992d31f4c3..acc07f8334a 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -70,9 +70,19 @@ namespace ChillerReformulatedEIR { extern bool GetInputREIR; // When TRUE, calls subroutine to read input file + struct RefEIRReportSpecs + { + Real64 CondOutletTemp; + + RefEIRReportSpecs() : CondOutletTemp(0.0) + { + }; + }; + struct ReformulatedEIRChillerSpecs : PlantComponent { // Members + int myIdx; std::string Name; // User identifier int TypeNum; // plant loop type identifier std::string CAPFTName; // CAPFT curve name @@ -203,7 +213,7 @@ namespace ChillerReformulatedEIR { Real64 QEvaporator; // reporting: Evaporator heat transfer rate [W] Real64 Power; // reporting: Chiller power [W] Real64 EvapOutletTemp; // reporting: Evaporator outlet temperature [C] - Real64 CondOutletTemp; // reporting: Condenser outlet temperature [C] +// Real64 CondOutletTemp; // reporting: Condenser outlet temperature [C] Real64 EvapMassFlowRate; // reporting: Evaporator mass flow rate [kg/s] Real64 CondMassFlowRate; // Condenser mass flow rate [kg/s] Real64 ChillerFalseLoad; // reporting: Chiller false load over and above water side load [W] @@ -220,7 +230,7 @@ namespace ChillerReformulatedEIR { // Default Constructor ReformulatedEIRChillerSpecs() - : TypeNum(0), CondenserType(0), PartLoadCurveType(0), RefCap(0.0), RefCapWasAutoSized(false), RefCOP(0.0), FlowMode(FlowModeNotSet), + : myIdx(0), TypeNum(0), CondenserType(0), PartLoadCurveType(0), RefCap(0.0), RefCapWasAutoSized(false), RefCOP(0.0), FlowMode(FlowModeNotSet), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), EvapVolFlowRate(0.0), EvapVolFlowRateWasAutoSized(false), EvapMassFlowRateMax(0.0), CondVolFlowRate(0.0), CondVolFlowRateWasAutoSized(false), CondMassFlowRateMax(0.0), CompPowerToCondenserFrac(0.0), EvapInletNodeNum(0), EvapOutletNodeNum(0), CondInletNodeNum(0), CondOutletNodeNum(0), @@ -242,7 +252,7 @@ namespace ChillerReformulatedEIR { FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0), FaultyChillerFoulingFactor(1.0), MyEnvrnFlag(true), MyInitFlag(true), MySizeFlag(true), ChillerCondAvgTemp(0.0), ChillerFalseLoadRate(0.0), ChillerCyclingRatio(0.0), ChillerPartLoadRatio(0.0), ChillerEIRFPLR(0.0), ChillerEIRFT(0.0), ChillerCapFT(0.0), HeatRecOutletTemp(0.0), - QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0), CondOutletTemp(0.0), + QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0), EvapMassFlowRate(0.0), CondMassFlowRate(0.0), ChillerFalseLoad(0.0), Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), HeatRecMassFlow(0.0), EquipFlowCtrl(0) From b7bb7b45127e743f0fbb16f8630f804c89e03022 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 17 Jan 2020 13:02:49 -0600 Subject: [PATCH 21/41] Minimal, comment-mostly changes --- src/EnergyPlus/ChillerExhaustAbsorption.cc | 91 ---------------------- src/EnergyPlus/ChillerExhaustAbsorption.hh | 91 ++++------------------ 2 files changed, 17 insertions(+), 165 deletions(-) diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index ef71bc1d402..41ad9d6eb07 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -301,12 +301,6 @@ namespace ChillerExhaustAbsorption { } } - // End Absorption Chiller Module Driver Subroutines - //****************************************************************************** - - // Beginning of Absorption Chiller Module Get Input subroutines - //****************************************************************************** - void GetExhaustAbsorberInput() { // SUBROUTINE INFORMATION: @@ -779,9 +773,6 @@ namespace ChillerExhaustAbsorption { } } - // End of Get Input subroutines for the Absorption Chiller Module - //****************************************************************************** - void InitExhaustAbsorber(int const ChillNum, // number of the current engine driven chiller being simulated bool const EP_UNUSED(RunFlag) // TRUE when chiller operating ) @@ -1477,9 +1468,6 @@ namespace ChillerExhaustAbsorption { } } - // Beginning of Absorber model Subroutines - // ***************************************************************************** - void CalcExhaustAbsorberChillerModel(int &ChillNum, // Absorber number Real64 &MyLoad, // operating load bool const EP_UNUSED(RunFlag) // TRUE when Absorber operating @@ -1524,12 +1512,6 @@ namespace ChillerExhaustAbsorption { Real64 const AbsLeavingTemp(176.667); // C - Minimum temperature leaving the Chiller absorber (350 F) std::string const RoutineName("CalcExhaustAbsorberChillerModel"); - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // Local copies of ExhaustAbsorberSpecs Type // all variables that are local copies of data structure @@ -2012,12 +1994,6 @@ namespace ChillerExhaustAbsorption { // SUBROUTINE PARAMETER DEFINITIONS: Real64 const AbsLeavingTemp(176.667); // C - Minimum temperature leaving the Chiller absorber (350 F) static std::string const RoutineName("CalcExhaustAbsorberHeaterModel"); - // INTEGER :: ExhTempLTAbsLeavingTempCount = 0 ! Counter for exhaust temp < absorber leaving air temp warning messages - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // Local copies of ExhaustAbsorberSpecs Type @@ -2257,12 +2233,6 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorberReport(ChillNum).ExhHeatRecPotentialHeat = lExhHeatRecPotentialHeat; } - // End of Absorption Chiller Module Utility Subroutines - // ***************************************************************************** - - // Beginning of Record Keeping subroutines for the Absorption Chiller Module - // ***************************************************************************** - void UpdateExhaustAbsorberCoolRecords(Real64 const MyLoad, // current load bool const RunFlag, // TRUE if Absorber operating int const ChillNum // Absorber number @@ -2283,13 +2253,9 @@ namespace ChillerExhaustAbsorption { int lChillSupplyNodeNum; // Node number on the outlet side of the plant int lCondReturnNodeNum; // Node number on the inlet side of the condenser int lCondSupplyNodeNum; // Node number on the outlet side of the condenser - // MBadded int lExhaustAirInletNodeNum; // Node number on the inlet side of the plant - // INTEGER :: lExhaustAirOutletNodeNum ! Node number on the outlet side of the plant Real64 RptConstant; - // BEGIN ROUTINE - lChillReturnNodeNum = ExhaustAbsorber(ChillNum).ChillReturnNodeNum; lChillSupplyNodeNum = ExhaustAbsorber(ChillNum).ChillSupplyNodeNum; lCondReturnNodeNum = ExhaustAbsorber(ChillNum).CondReturnNodeNum; @@ -2297,36 +2263,17 @@ namespace ChillerExhaustAbsorption { lExhaustAirInletNodeNum = ExhaustAbsorber(ChillNum).ExhaustAirInletNodeNum; if (MyLoad == 0 || !RunFlag) { - // set node temperatures - Node(lChillSupplyNodeNum).Temp = Node(lChillReturnNodeNum).Temp; if (ExhaustAbsorber(ChillNum).isWaterCooled) { Node(lCondSupplyNodeNum).Temp = Node(lCondReturnNodeNum).Temp; } - Node(lExhaustAirInletNodeNum).Temp = Node(lExhaustAirInletNodeNum).Temp; - // set node flow rates - // Update Outlet Conditions so that same as Inlet, so component - // can be bypassed if necessary - // FlowResolver/EnforceSplitterContinuity will determine flow - // received, whether component is running or not. - // Node(lChillReturnNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%ChillWaterFlowRate - // Node(lChillSupplyNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%ChillWaterFlowRate - // Node(lCondReturnNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%CondWaterFlowRate - // Node(lCondSupplyNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%CondWaterFlowRate Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorberReport(ChillNum).ExhaustInFlow; } else { - // set node temperatures Node(lChillSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).ChillSupplyTemp; if (ExhaustAbsorber(ChillNum).isWaterCooled) { Node(lCondSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).CondSupplyTemp; } - // set node flow rates; for these load based models - // assume that the sufficient evaporator flow rate available - // Node(lChillReturnNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%ChillWaterFlowRate - // Node(lChillSupplyNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%ChillWaterFlowRate - // Node(lCondReturnNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%CondWaterFlowRate - // Node(lCondSupplyNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%CondWaterFlowRate Node(lExhaustAirInletNodeNum).Temp = ExhaustAbsorberReport(ChillNum).ExhaustInTemp; Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorberReport(ChillNum).ExhaustInFlow; } @@ -2369,29 +2316,13 @@ namespace ChillerExhaustAbsorption { int lHeatSupplyNodeNum; // absorber steam outlet node number, water side Real64 RptConstant; - // BEGIN ROUTINE - lHeatReturnNodeNum = ExhaustAbsorber(ChillNum).HeatReturnNodeNum; lHeatSupplyNodeNum = ExhaustAbsorber(ChillNum).HeatSupplyNodeNum; if (MyLoad == 0 || !RunFlag) { - // set node temperatures Node(lHeatSupplyNodeNum).Temp = Node(lHeatReturnNodeNum).Temp; - - // set node flow rates - // Update Outlet Conditions so that same as Inlet, so component - // can be bypassed if necessary - // FlowResolver/EnforceSplitterContinuity will determine flow - // received, whether component is running or not. - // Node(lHeatReturnNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%HotWaterFlowRate - // Node(lHeatSupplyNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%HotWaterFlowRate } else { - // set node temperatures Node(lHeatSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).HotWaterSupplyTemp; - // !set node flow rates; for these load based models - // !assume that the sufficient evaporator flow rate available - // Node(lHeatReturnNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%HotWaterFlowRate - // Node(lHeatSupplyNodeNum)%MassFlowRate = ExhaustAbsorberReport(ChillNum)%HotWaterFlowRate } // convert power to energy and instantaneous use to use over the time step @@ -2403,9 +2334,6 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorberReport(ChillNum).HeatElectricEnergy = ExhaustAbsorberReport(ChillNum).HeatElectricPower * RptConstant; } - // End of Record Keeping subroutines for the Exhasut Fired Absorption Chiller Module - // ***************************************************************************** - void clear_state() { NumExhaustAbsorbers = 0; @@ -2422,25 +2350,6 @@ namespace ChillerExhaustAbsorption { Get_ErrorsFound = false; } - // COPYRIGHT NOTICE - - // Portions Copyright (c) Gas Research Institute 2001. All rights reserved. - - // GRI LEGAL NOTICE - // Neither GRI, members of GRI nor any person or organization acting on behalf - // of either: - - // A. Makes any warranty of representation, express or implied with respect to - // the accuracy, completness, or usefulness of the information contained in - // in this program, including any warranty of merchantability or fitness of - // any purpose with respoect to the program, or that the use of any - // information disclosed in this program may not infringe privately-owned - // rights, or - - // B. Assumes any liability with respoct to the use of, or for any and all - // damages resulting from the use of the program or any portion thereof or - // any information disclosed therein. - } // namespace ChillerExhaustAbsorption } // namespace EnergyPlus diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.hh b/src/EnergyPlus/ChillerExhaustAbsorption.hh index e8d82cd0a64..662b7eee33a 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.hh +++ b/src/EnergyPlus/ChillerExhaustAbsorption.hh @@ -59,23 +59,9 @@ namespace EnergyPlus { namespace ChillerExhaustAbsorption { - // Using/Aliasing - - // Data - // MODULE PARAMETER DEFINITIONS: - // na - - // MODULE VARIABLE DECLARATIONS: extern int NumExhaustAbsorbers; // number of Absorption Chillers specified in input - - // This type holds the output from the algorithm i.e., the Report Variables - extern Array1D_bool CheckEquipName; - // SUBROUTINE SPECIFICATIONS FOR MODULE PrimaryPlantLoops - - // Types - struct ExhaustAbsorberSpecs { // Members @@ -167,7 +153,7 @@ namespace ChillerExhaustAbsorption { EvapVolFlowRateWasAutoSized(false), CondVolFlowRate(0.0), CondVolFlowRateWasAutoSized(false), HeatVolFlowRate(0.0), HeatVolFlowRateWasAutoSized(false), SizFac(0.0), CoolCapFTCurve(0), ThermalEnergyCoolFTCurve(0), ThermalEnergyCoolFPLRCurve(0), ElecCoolFTCurve(0), ElecCoolFPLRCurve(0), HeatCapFCoolCurve(0), ThermalEnergyHeatFHPLRCurve(0), isEnterCondensTemp(false), - isWaterCooled(false), CHWLowLimitTemp(0.0), DesCondMassFlowRate(0.0), DesHeatMassFlowRate(0.0), DesEvapMassFlowRate(0.0), + isWaterCooled(false), CHWLowLimitTemp(0.0), ExhaustAirInletNodeNum(0), DesCondMassFlowRate(0.0), DesHeatMassFlowRate(0.0), DesEvapMassFlowRate(0.0), DeltaTempCoolErrCount(0), DeltaTempHeatErrCount(0), CondErrCount(0), PossibleSubcooling(false), CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), HWLoopNum(0), HWLoopSideNum(0), HWBranchNum(0), HWCompNum(0), CompType_Num(0), ExhTempLTAbsLeavingTempIndex(0), ExhTempLTAbsLeavingHeatingTempIndex(0) @@ -229,98 +215,55 @@ namespace ChillerExhaustAbsorption { } }; - // Object Data extern Array1D ExhaustAbsorber; // dimension to number of machines extern Array1D ExhaustAbsorberReport; - // Functions - void SimExhaustAbsorber(std::string const &AbsorberType, // type of Absorber std::string const &AbsorberName, // user specified name of Absorber - int const EquipFlowCtrl, // Flow control mode for the equipment + int EquipFlowCtrl, // Flow control mode for the equipment int &CompIndex, // Absorber number counter - bool const RunFlag, // simulate Absorber when TRUE - bool const FirstIteration, // initialize variables when TRUE + bool RunFlag, // simulate Absorber when TRUE + bool FirstIteration, // initialize variables when TRUE bool &InitLoopEquip, // If not false, calculate the max load for operating conditions Real64 &MyLoad, // loop demand component will meet - int const BranchInletNodeNum, // node number of inlet to calling branch, + int BranchInletNodeNum, // node number of inlet to calling branch, Real64 &MaxCap, // W - maximum operating capacity of Absorber Real64 &MinCap, // W - minimum operating capacity of Absorber Real64 &OptCap, // W - optimal operating capacity of Absorber - bool const GetSizingFactor, // TRUE when just the sizing factor is requested + bool GetSizingFactor, // TRUE when just the sizing factor is requested Real64 &SizingFactor // sizing factor ); - // End Absorption Chiller Module Driver Subroutines - //****************************************************************************** - - // Beginning of Absorption Chiller Module Get Input subroutines - //****************************************************************************** - void GetExhaustAbsorberInput(); - // End of Get Input subroutines for the Absorption Chiller Module - //****************************************************************************** - - void InitExhaustAbsorber(int const ChillNum, // number of the current engine driven chiller being simulated - bool const RunFlag // TRUE when chiller operating + void InitExhaustAbsorber(int ChillNum, // number of the current engine driven chiller being simulated + bool RunFlag // TRUE when chiller operating ); - void SizeExhaustAbsorber(int const ChillNum); - - // Beginning of Absorber model Subroutines - // ***************************************************************************** + void SizeExhaustAbsorber(int ChillNum); void CalcExhaustAbsorberChillerModel(int &ChillNum, // Absorber number Real64 &MyLoad, // operating load - bool const RunFlag // TRUE when Absorber operating + bool RunFlag // TRUE when Absorber operating ); void CalcExhaustAbsorberHeaterModel(int &ChillNum, // Absorber number Real64 &MyLoad, // operating load - bool const RunFlag // TRUE when Absorber operating + bool RunFlag // TRUE when Absorber operating ); - // End of Absorption Chiller Module Utility Subroutines - // ***************************************************************************** - - // Beginning of Record Keeping subroutines for the Absorption Chiller Module - // ***************************************************************************** - - void UpdateExhaustAbsorberCoolRecords(Real64 const MyLoad, // current load - bool const RunFlag, // TRUE if Absorber operating - int const ChillNum // Absorber number + void UpdateExhaustAbsorberCoolRecords(Real64 MyLoad, // current load + bool RunFlag, // TRUE if Absorber operating + int ChillNum // Absorber number ); - void UpdateExhaustAbsorberHeatRecords(Real64 const MyLoad, // current load - bool const RunFlag, // TRUE if Absorber operating - int const ChillNum // Absorber number + void UpdateExhaustAbsorberHeatRecords(Real64 MyLoad, // current load + bool RunFlag, // TRUE if Absorber operating + int ChillNum // Absorber number ); - // End of Record Keeping subroutines for the Exhasut Fired Absorption Chiller Module - // ***************************************************************************** - void clear_state(); - // COPYRIGHT NOTICE - - // Portions Copyright (c) Gas Research Institute 2001. All rights reserved. - - // GRI LEGAL NOTICE - // Neither GRI, members of GRI nor any person or organization acting on behalf - // of either: - - // A. Makes any warranty of representation, express or implied with respect to - // the accuracy, completness, or usefulness of the information contained in - // in this program, including any warranty of merchantability or fitness of - // any purpose with respoect to the program, or that the use of any - // information disclosed in this program may not infringe privately-owned - // rights, or - - // B. Assumes any liability with respoct to the use of, or for any and all - // damages resulting from the use of the program or any portion thereof or - // any information disclosed therein. - } // namespace ChillerExhaustAbsorption } // namespace EnergyPlus From 4d2487413300c042743bea397f955e8e42757bbe Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 17 Jan 2020 13:18:32 -0600 Subject: [PATCH 22/41] Clean up using statements --- src/EnergyPlus/ChillerExhaustAbsorption.cc | 587 +++++++++------------ 1 file changed, 249 insertions(+), 338 deletions(-) diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index 41ad9d6eb07..a1e55cb5e48 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -114,20 +114,6 @@ namespace ChillerExhaustAbsorption { // Development of the original(GasAbsoptionChiller) module was funded by the Gas Research Institute. // (Please see copyright and disclaimer information at end of module) - // Using/Aliasing - using namespace DataPrecisionGlobals; - using namespace DataLoopNode; - using DataGlobalConstants::iGeneratorMicroturbine; - using DataGlobals::BigNumber; - using DataGlobals::DisplayExtraWarnings; - using DataGlobals::SecInHour; - using DataHVACGlobals::SmallWaterVolFlow; - using General::RoundSigDigits; - using General::TrimSigDigits; - using Psychrometrics::CPCW; - using Psychrometrics::CPHW; - using Psychrometrics::RhoH2O; - // MODULE VARIABLE DECLARATIONS: int NumExhaustAbsorbers(0); // number of Absorption Chillers specified in input @@ -181,20 +167,6 @@ namespace ChillerExhaustAbsorption { // gets the input for the models, initializes simulation variables, call // the appropriate model and sets up reporting variables. - // Using/Aliasing - using CurveManager::CurveValue; - using DataPlant::TypeOf_Chiller_ExhFiredAbsorption; - using PlantUtilities::UpdateChillerComponentCondenserSide; - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // used to determine if heating side or cooling - // side of chiller-heater is being called - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - - // unused INTEGER :: CondReturnNodeNum !holds the node number for the condenser side return - // unused REAL(r64) :: CondMassFlowRate !the rate of mass flow for the condenser (estimated) int ChillNum; // Absorber number counter // Get Absorber data from input file @@ -213,12 +185,12 @@ namespace ChillerExhaustAbsorption { } else { ChillNum = CompIndex; if (ChillNum > NumExhaustAbsorbers || ChillNum < 1) { - ShowFatalError("SimExhaustAbsorber: Invalid CompIndex passed=" + TrimSigDigits(ChillNum) + - ", Number of Units=" + TrimSigDigits(NumExhaustAbsorbers) + ", Entered Unit name=" + AbsorberName); + ShowFatalError("SimExhaustAbsorber: Invalid CompIndex passed=" + General::TrimSigDigits(ChillNum) + + ", Number of Units=" + General::TrimSigDigits(NumExhaustAbsorbers) + ", Entered Unit name=" + AbsorberName); } if (CheckEquipName(ChillNum)) { if (AbsorberName != ExhaustAbsorber(ChillNum).Name) { - ShowFatalError("SimExhaustAbsorber: Invalid CompIndex passed=" + TrimSigDigits(ChillNum) + ", Unit name=" + AbsorberName + + ShowFatalError("SimExhaustAbsorber: Invalid CompIndex passed=" + General::TrimSigDigits(ChillNum) + ", Unit name=" + AbsorberName + ", stored Unit Name for that index=" + ExhaustAbsorber(ChillNum).Name); } CheckEquipName(ChillNum) = false; @@ -282,9 +254,9 @@ namespace ChillerExhaustAbsorption { UpdateExhaustAbsorberHeatRecords(MyLoad, RunFlag, ChillNum); } else if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).CondReturnNodeNum) { // called from condenser loop if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { - UpdateChillerComponentCondenserSide(ExhaustAbsorber(ChillNum).CDLoopNum, + PlantUtilities::UpdateChillerComponentCondenserSide(ExhaustAbsorber(ChillNum).CDLoopNum, ExhaustAbsorber(ChillNum).CDLoopSideNum, - TypeOf_Chiller_ExhFiredAbsorption, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, ExhaustAbsorber(ChillNum).CondReturnNodeNum, ExhaustAbsorber(ChillNum).CondSupplyNodeNum, ExhaustAbsorberReport(ChillNum).TowerLoad, @@ -386,15 +358,15 @@ namespace ChillerExhaustAbsorption { // Assign Node Numbers to specified nodes ExhaustAbsorber(AbsorberNum).ChillReturnNodeNum = GetOnlySingleNode( - cAlphaArgs(2), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); + cAlphaArgs(2), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); ExhaustAbsorber(AbsorberNum).ChillSupplyNodeNum = GetOnlySingleNode( - cAlphaArgs(3), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); + cAlphaArgs(3), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 1, DataLoopNode::ObjectIsNotParent); TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(2), cAlphaArgs(3), "Chilled Water Nodes"); // Condenser node processing depends on condenser type, see below ExhaustAbsorber(AbsorberNum).HeatReturnNodeNum = GetOnlySingleNode( - cAlphaArgs(6), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Inlet, 3, ObjectIsNotParent); + cAlphaArgs(6), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 3, DataLoopNode::ObjectIsNotParent); ExhaustAbsorber(AbsorberNum).HeatSupplyNodeNum = GetOnlySingleNode( - cAlphaArgs(7), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Outlet, 3, ObjectIsNotParent); + cAlphaArgs(7), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 3, DataLoopNode::ObjectIsNotParent); TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(6), cAlphaArgs(7), "Hot Water Nodes"); if (Get_ErrorsFound) { ShowFatalError("Errors found in processing node input for " + cCurrentModuleObject + '=' + cAlphaArgs(1)); @@ -473,28 +445,28 @@ namespace ChillerExhaustAbsorption { Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), - NodeType_Water, - NodeConnectionType_Inlet, + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Inlet, 2, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); ExhaustAbsorber(AbsorberNum).CondSupplyNodeNum = GetOnlySingleNode(cAlphaArgs(5), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), - NodeType_Water, - NodeConnectionType_Outlet, + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Outlet, 2, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(4), cAlphaArgs(5), "Condenser Water Nodes"); } else { ExhaustAbsorber(AbsorberNum).CondReturnNodeNum = GetOnlySingleNode(cAlphaArgs(4), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), - NodeType_Air, - NodeConnectionType_OutsideAirReference, + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_OutsideAirReference, 2, - ObjectIsNotParent); + DataLoopNode::ObjectIsNotParent); // Condenser outlet node not used for air or evap cooled condenser so ingore cAlphaArgs( 5 ) // Connection not required for air or evap cooled condenser so no call to TestCompSet here CheckAndAddAirNodeNumber(ExhaustAbsorber(AbsorberNum).CondReturnNodeNum, Okay); @@ -508,7 +480,7 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorber(AbsorberNum).TypeOf = cAlphaArgs(17); if (UtilityRoutines::SameString(cAlphaArgs(17), "Generator:MicroTurbine")) { - ExhaustAbsorber(AbsorberNum).CompType_Num = iGeneratorMicroturbine; + ExhaustAbsorber(AbsorberNum).CompType_Num = DataGlobalConstants::iGeneratorMicroturbine; ExhaustAbsorber(AbsorberNum).ExhuastSourceName = cAlphaArgs(18); auto thisMTG = MicroturbineElectricGenerator::MTGeneratorSpecs::factory(ExhaustAbsorber(AbsorberNum).ExhuastSourceName); @@ -791,21 +763,6 @@ namespace ChillerExhaustAbsorption { // METHODOLOGY EMPLOYED: // Uses the status flags to trigger initializations. - // Using/Aliasing - using DataGlobals::AnyEnergyManagementSystemInModel; - using DataGlobals::BeginEnvrnFlag; - using DataPlant::PlantFirstSizesOkayToFinalize; - using DataPlant::PlantLoop; - using DataPlant::TypeOf_Chiller_ExhFiredAbsorption; - using EMSManager::CheckIfNodeSetPointManagedByEMS; - using EMSManager::iTemperatureSetPoint; - using FluidProperties::GetDensityGlycol; - using PlantUtilities::InitComponentNodes; - using PlantUtilities::InterConnectTwoPlantLoopSides; - using PlantUtilities::ScanPlantLoopsForObject; - using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::RhoH2O; - // SUBROUTINE PARAMETER DEFINITIONS: std::string const RoutineName("InitExhaustAbsorber"); @@ -830,8 +787,8 @@ namespace ChillerExhaustAbsorption { if (Init_MyPlantScanFlag(ChillNum)) { // Locate the chillers on the plant loops for later usage errFlag = false; - ScanPlantLoopsForObject(ExhaustAbsorber(ChillNum).Name, - TypeOf_Chiller_ExhFiredAbsorption, + PlantUtilities::ScanPlantLoopsForObject(ExhaustAbsorber(ChillNum).Name, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, ExhaustAbsorber(ChillNum).CWLoopNum, ExhaustAbsorber(ChillNum).CWLoopSideNum, ExhaustAbsorber(ChillNum).CWBranchNum, @@ -846,8 +803,8 @@ namespace ChillerExhaustAbsorption { ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s)."); } - ScanPlantLoopsForObject(ExhaustAbsorber(ChillNum).Name, - TypeOf_Chiller_ExhFiredAbsorption, + PlantUtilities::ScanPlantLoopsForObject(ExhaustAbsorber(ChillNum).Name, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, ExhaustAbsorber(ChillNum).HWLoopNum, ExhaustAbsorber(ChillNum).HWLoopSideNum, ExhaustAbsorber(ChillNum).HWBranchNum, @@ -863,8 +820,8 @@ namespace ChillerExhaustAbsorption { } if (ExhaustAbsorber(ChillNum).isWaterCooled) { - ScanPlantLoopsForObject(ExhaustAbsorber(ChillNum).Name, - TypeOf_Chiller_ExhFiredAbsorption, + PlantUtilities::ScanPlantLoopsForObject(ExhaustAbsorber(ChillNum).Name, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, ExhaustAbsorber(ChillNum).CDLoopNum, ExhaustAbsorber(ChillNum).CDLoopSideNum, ExhaustAbsorber(ChillNum).CDBranchNum, @@ -878,31 +835,31 @@ namespace ChillerExhaustAbsorption { if (errFlag) { ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s)."); } - InterConnectTwoPlantLoopSides(ExhaustAbsorber(ChillNum).CWLoopNum, + PlantUtilities::InterConnectTwoPlantLoopSides(ExhaustAbsorber(ChillNum).CWLoopNum, ExhaustAbsorber(ChillNum).CWLoopSideNum, ExhaustAbsorber(ChillNum).CDLoopNum, ExhaustAbsorber(ChillNum).CDLoopSideNum, - TypeOf_Chiller_ExhFiredAbsorption, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); - InterConnectTwoPlantLoopSides(ExhaustAbsorber(ChillNum).HWLoopNum, + PlantUtilities::InterConnectTwoPlantLoopSides(ExhaustAbsorber(ChillNum).HWLoopNum, ExhaustAbsorber(ChillNum).HWLoopSideNum, ExhaustAbsorber(ChillNum).CDLoopNum, ExhaustAbsorber(ChillNum).CDLoopSideNum, - TypeOf_Chiller_ExhFiredAbsorption, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); } - InterConnectTwoPlantLoopSides(ExhaustAbsorber(ChillNum).CWLoopNum, + PlantUtilities::InterConnectTwoPlantLoopSides(ExhaustAbsorber(ChillNum).CWLoopNum, ExhaustAbsorber(ChillNum).CWLoopSideNum, ExhaustAbsorber(ChillNum).HWLoopNum, ExhaustAbsorber(ChillNum).HWLoopSideNum, - TypeOf_Chiller_ExhFiredAbsorption, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); // check if outlet node of chilled water side has a setpoint. - if ((Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPoint == SensedNodeFlagValue) && - (Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPointHi == SensedNodeFlagValue)) { - if (!AnyEnergyManagementSystemInModel) { + if ((DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { + if (!DataGlobals::AnyEnergyManagementSystemInModel) { if (!ExhaustAbsorber(ChillNum).ChillSetPointErrDone) { ShowWarningError("Missing temperature setpoint on cool side for chiller heater named " + ExhaustAbsorber(ChillNum).Name); ShowContinueError(" A temperature setpoint is needed at the outlet node of this chiller, use a SetpointManager"); @@ -912,7 +869,7 @@ namespace ChillerExhaustAbsorption { } else { // need call to EMS to check node errFlag = false; // but not really fatal yet, but should be. - CheckIfNodeSetPointManagedByEMS(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum, iTemperatureSetPoint, errFlag); + EMSManager::CheckIfNodeSetPointManagedByEMS(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum, EMSManager::iTemperatureSetPoint, errFlag); if (errFlag) { if (!ExhaustAbsorber(ChillNum).ChillSetPointErrDone) { ShowWarningError("Missing temperature setpoint on cool side for chiller heater named " + ExhaustAbsorber(ChillNum).Name); @@ -925,15 +882,15 @@ namespace ChillerExhaustAbsorption { } } ExhaustAbsorber(ChillNum).ChillSetPointSetToLoop = true; - Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPoint = - Node(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; - Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPointHi = - Node(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPointHi = + DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } // check if outlet node of hot water side has a setpoint. - if ((Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPoint == SensedNodeFlagValue) && - (Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPointLo == SensedNodeFlagValue)) { - if (!AnyEnergyManagementSystemInModel) { + if ((DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPointLo == DataLoopNode::SensedNodeFlagValue)) { + if (!DataGlobals::AnyEnergyManagementSystemInModel) { if (!ExhaustAbsorber(ChillNum).HeatSetPointErrDone) { ShowWarningError("Missing temperature setpoint on heat side for chiller heater named " + ExhaustAbsorber(ChillNum).Name); ShowContinueError(" A temperature setpoint is needed at the outlet node of this chiller, use a SetpointManager"); @@ -943,7 +900,7 @@ namespace ChillerExhaustAbsorption { } else { // need call to EMS to check node errFlag = false; // but not really fatal yet, but should be. - CheckIfNodeSetPointManagedByEMS(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum, iTemperatureSetPoint, errFlag); + EMSManager::CheckIfNodeSetPointManagedByEMS(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum, EMSManager::iTemperatureSetPoint, errFlag); if (errFlag) { if (!ExhaustAbsorber(ChillNum).HeatSetPointErrDone) { ShowWarningError("Missing temperature setpoint on heat side for chiller heater named " + ExhaustAbsorber(ChillNum).Name); @@ -956,10 +913,10 @@ namespace ChillerExhaustAbsorption { } } ExhaustAbsorber(ChillNum).HeatSetPointSetToLoop = true; - Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPoint = - Node(PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPoint; - Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPointLo = - Node(PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPointLo; + DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPointLo = + DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } Init_MyPlantScanFlag(ChillNum) = false; } @@ -969,21 +926,21 @@ namespace ChillerExhaustAbsorption { HeatInletNode = ExhaustAbsorber(ChillNum).HeatReturnNodeNum; HeatOutletNode = ExhaustAbsorber(ChillNum).HeatSupplyNodeNum; - if (Init_MyEnvrnFlag(ChillNum) && BeginEnvrnFlag && (PlantFirstSizesOkayToFinalize)) { + if (Init_MyEnvrnFlag(ChillNum) && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { if (ExhaustAbsorber(ChillNum).isWaterCooled) { // init max available condenser water flow rate if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { - rho = GetDensityGlycol(PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, DataGlobals::CWInitConvTemp, - PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, RoutineName); } else { - rho = RhoH2O(DataGlobals::InitConvTemp); + rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); } ExhaustAbsorber(ChillNum).DesCondMassFlowRate = rho * ExhaustAbsorber(ChillNum).CondVolFlowRate; - InitComponentNodes(0.0, + PlantUtilities::InitComponentNodes(0.0, ExhaustAbsorber(ChillNum).DesCondMassFlowRate, CondInletNode, CondOutletNode, @@ -994,16 +951,16 @@ namespace ChillerExhaustAbsorption { } if (ExhaustAbsorber(ChillNum).HWLoopNum > 0) { - rho = GetDensityGlycol(PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).FluidName, DataGlobals::HWInitConvTemp, - PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).FluidIndex, RoutineName); } else { - rho = RhoH2O(DataGlobals::InitConvTemp); + rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); } ExhaustAbsorber(ChillNum).DesHeatMassFlowRate = rho * ExhaustAbsorber(ChillNum).HeatVolFlowRate; // init available hot water flow rate - InitComponentNodes(0.0, + PlantUtilities::InitComponentNodes(0.0, ExhaustAbsorber(ChillNum).DesHeatMassFlowRate, HeatInletNode, HeatOutletNode, @@ -1013,16 +970,16 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorber(ChillNum).HWCompNum); if (ExhaustAbsorber(ChillNum).CWLoopNum > 0) { - rho = GetDensityGlycol(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, RoutineName); } else { - rho = RhoH2O(DataGlobals::InitConvTemp); + rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); } ExhaustAbsorber(ChillNum).DesEvapMassFlowRate = rho * ExhaustAbsorber(ChillNum).EvapVolFlowRate; // init available hot water flow rate - InitComponentNodes(0.0, + PlantUtilities::InitComponentNodes(0.0, ExhaustAbsorber(ChillNum).DesEvapMassFlowRate, ExhaustAbsorber(ChillNum).ChillReturnNodeNum, ExhaustAbsorber(ChillNum).ChillSupplyNodeNum, @@ -1034,31 +991,31 @@ namespace ChillerExhaustAbsorption { Init_MyEnvrnFlag(ChillNum) = false; } - if (!BeginEnvrnFlag) { + if (!DataGlobals::BeginEnvrnFlag) { Init_MyEnvrnFlag(ChillNum) = true; } // this component model works off setpoints on the leaving node // fill from plant if needed if (ExhaustAbsorber(ChillNum).ChillSetPointSetToLoop) { - Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPoint = - Node(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; - Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPointHi = - Node(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPointHi = + DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } if (ExhaustAbsorber(ChillNum).HeatSetPointSetToLoop) { - Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPoint = - Node(PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPoint; - Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPointLo = - Node(PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPointLo; + DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPointLo = + DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } if ((ExhaustAbsorber(ChillNum).isWaterCooled) && ((ExhaustAbsorber(ChillNum).InHeatingMode) || (ExhaustAbsorber(ChillNum).InCoolingMode)) && (!Init_MyPlantScanFlag(ChillNum))) { mdot = ExhaustAbsorber(ChillNum).DesCondMassFlowRate; - SetComponentFlowRate(mdot, + PlantUtilities::SetComponentFlowRate(mdot, ExhaustAbsorber(ChillNum).CondReturnNodeNum, ExhaustAbsorber(ChillNum).CondSupplyNodeNum, ExhaustAbsorber(ChillNum).CDLoopNum, @@ -1069,7 +1026,7 @@ namespace ChillerExhaustAbsorption { } else { mdot = 0.0; if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { - SetComponentFlowRate(mdot, + PlantUtilities::SetComponentFlowRate(mdot, ExhaustAbsorber(ChillNum).CondReturnNodeNum, ExhaustAbsorber(ChillNum).CondSupplyNodeNum, ExhaustAbsorber(ChillNum).CDLoopNum, @@ -1098,18 +1055,6 @@ namespace ChillerExhaustAbsorption { // the evaporator flow rate and the chilled water loop design delta T. The condenser flow rate // is calculated from the nominal capacity, the COP, and the condenser loop design delta T. - // Using/Aliasing - using namespace DataSizing; - using DataPlant::PlantFinalSizesOkayToReport; - using DataPlant::PlantFirstSizesOkayToFinalize; - using DataPlant::PlantFirstSizesOkayToReport; - using DataPlant::PlantLoop; - using PlantUtilities::RegisterPlantCompDesignFlow; - using ReportSizingManager::ReportSizingOutput; - using namespace OutputReportPredefined; - using FluidProperties::GetDensityGlycol; - using FluidProperties::GetSpecificHeatGlycol; - // SUBROUTINE PARAMETER DEFINITIONS: std::string const RoutineName("SizeExhaustAbsorber"); @@ -1143,38 +1088,38 @@ namespace ChillerExhaustAbsorption { CondVolFlowRateUser = 0.0; HeatRecVolFlowRateUser = 0.0; - if (ExhaustAbsorber(ChillNum).isWaterCooled) PltSizCondNum = PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).PlantSizNum; + if (ExhaustAbsorber(ChillNum).isWaterCooled) PltSizCondNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).PlantSizNum; - PltSizHeatNum = PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).PlantSizNum; - PltSizCoolNum = PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).PlantSizNum; + PltSizHeatNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).PlantSizNum; + PltSizCoolNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).PlantSizNum; if (PltSizCoolNum > 0) { - if (PlantSizData(PltSizCoolNum).DesVolFlowRate >= SmallWaterVolFlow) { - Cp = GetSpecificHeatGlycol(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, + if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, RoutineName); - rho = GetDensityGlycol(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, RoutineName); tmpNomCap = - Cp * rho * PlantSizData(PltSizCoolNum).DeltaT * PlantSizData(PltSizCoolNum).DesVolFlowRate * ExhaustAbsorber(ChillNum).SizFac; + Cp * rho * DataSizing::PlantSizData(PltSizCoolNum).DeltaT * DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * ExhaustAbsorber(ChillNum).SizFac; if (!ExhaustAbsorber(ChillNum).NomCoolingCapWasAutoSized) tmpNomCap = ExhaustAbsorber(ChillNum).NomCoolingCap; } else { if (ExhaustAbsorber(ChillNum).NomCoolingCapWasAutoSized) tmpNomCap = 0.0; } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (ExhaustAbsorber(ChillNum).NomCoolingCapWasAutoSized) { ExhaustAbsorber(ChillNum).NomCoolingCap = tmpNomCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Design Size Nominal Cooling Capacity [W]", tmpNomCap); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Initial Design Size Nominal Cooling Capacity [W]", tmpNomCap); @@ -1182,19 +1127,19 @@ namespace ChillerExhaustAbsorption { } else { if (ExhaustAbsorber(ChillNum).NomCoolingCap > 0.0 && tmpNomCap > 0.0) { NomCapUser = ExhaustAbsorber(ChillNum).NomCoolingCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Design Size Nominal Cooling Capacity [W]", tmpNomCap, "User-Specified Nominal Cooling Capacity [W]", NomCapUser); - if (DisplayExtraWarnings) { - if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > AutoVsHardSizingThreshold) { + if (DataGlobals::DisplayExtraWarnings) { + if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + ExhaustAbsorber(ChillNum).Name); - ShowContinueError("User-Specified Nominal Capacity of " + RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError("differs from Design Size Nominal Capacity of " + RoundSigDigits(tmpNomCap, 2) + " [W]"); + ShowContinueError("User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); + ShowContinueError("differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + " [W]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1206,7 +1151,7 @@ namespace ChillerExhaustAbsorption { } } else { if (ExhaustAbsorber(ChillNum).NomCoolingCapWasAutoSized) { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + ExhaustAbsorber(ChillNum).Name + "\", autosize error."); ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller nominal cooling capacity requires"); @@ -1214,9 +1159,9 @@ namespace ChillerExhaustAbsorption { ErrorsFound = true; } } else { - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { if (ExhaustAbsorber(ChillNum).NomCoolingCap > 0.0) { - ReportSizingOutput("Chiller:Absorption:DoubleEffect", + ReportSizingManager::ReportSizingOutput("Chiller:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "User-Specified Nominal Capacity [W]", ExhaustAbsorber(ChillNum).NomCoolingCap); @@ -1226,24 +1171,24 @@ namespace ChillerExhaustAbsorption { } if (PltSizCoolNum > 0) { - if (PlantSizData(PltSizCoolNum).DesVolFlowRate >= SmallWaterVolFlow) { - tmpEvapVolFlowRate = PlantSizData(PltSizCoolNum).DesVolFlowRate * ExhaustAbsorber(ChillNum).SizFac; + if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + tmpEvapVolFlowRate = DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * ExhaustAbsorber(ChillNum).SizFac; if (!ExhaustAbsorber(ChillNum).EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = ExhaustAbsorber(ChillNum).EvapVolFlowRate; } else { if (ExhaustAbsorber(ChillNum).EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (ExhaustAbsorber(ChillNum).EvapVolFlowRateWasAutoSized) { ExhaustAbsorber(ChillNum).EvapVolFlowRate = tmpEvapVolFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Initial Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); @@ -1251,21 +1196,21 @@ namespace ChillerExhaustAbsorption { } else { if (ExhaustAbsorber(ChillNum).EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { EvapVolFlowRateUser = ExhaustAbsorber(ChillNum).EvapVolFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate, "User-Specified Design Chilled Water Flow Rate [m3/s]", EvapVolFlowRateUser); - if (DisplayExtraWarnings) { - if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > AutoVsHardSizingThreshold) { + if (DataGlobals::DisplayExtraWarnings) { + if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + ExhaustAbsorber(ChillNum).Name); - ShowContinueError("User-Specified Design Chilled Water Flow Rate of " + RoundSigDigits(EvapVolFlowRateUser, 5) + + ShowContinueError("User-Specified Design Chilled Water Flow Rate of " + General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Chilled Water Flow Rate of " + - RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1277,7 +1222,7 @@ namespace ChillerExhaustAbsorption { } } else { if (ExhaustAbsorber(ChillNum).EvapVolFlowRateWasAutoSized) { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + ExhaustAbsorber(ChillNum).Name + "\", autosize error."); ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller evap flow rate requires"); @@ -1285,9 +1230,9 @@ namespace ChillerExhaustAbsorption { ErrorsFound = true; } } else { - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { if (ExhaustAbsorber(ChillNum).EvapVolFlowRate > 0.0) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "User-Specified Design Chilled Water Flow Rate [m3/s]", ExhaustAbsorber(ChillNum).EvapVolFlowRate); @@ -1296,27 +1241,27 @@ namespace ChillerExhaustAbsorption { } } - RegisterPlantCompDesignFlow(ExhaustAbsorber(ChillNum).ChillReturnNodeNum, tmpEvapVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(ExhaustAbsorber(ChillNum).ChillReturnNodeNum, tmpEvapVolFlowRate); if (PltSizHeatNum > 0) { - if (PlantSizData(PltSizHeatNum).DesVolFlowRate >= SmallWaterVolFlow) { - tmpHeatRecVolFlowRate = PlantSizData(PltSizHeatNum).DesVolFlowRate * ExhaustAbsorber(ChillNum).SizFac; + if (DataSizing::PlantSizData(PltSizHeatNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + tmpHeatRecVolFlowRate = DataSizing::PlantSizData(PltSizHeatNum).DesVolFlowRate * ExhaustAbsorber(ChillNum).SizFac; if (!ExhaustAbsorber(ChillNum).HeatVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = ExhaustAbsorber(ChillNum).HeatVolFlowRate; } else { if (ExhaustAbsorber(ChillNum).HeatVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = 0.0; } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (ExhaustAbsorber(ChillNum).HeatVolFlowRateWasAutoSized) { ExhaustAbsorber(ChillNum).HeatVolFlowRate = tmpHeatRecVolFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Design Size Design Hot Water Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Initial Design Size Design Hot Water Flow Rate [m3/s]", tmpHeatRecVolFlowRate); @@ -1324,21 +1269,21 @@ namespace ChillerExhaustAbsorption { } else { if (ExhaustAbsorber(ChillNum).HeatVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { HeatRecVolFlowRateUser = ExhaustAbsorber(ChillNum).HeatVolFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Design Size Design Hot Water Flow Rate [m3/s]", tmpHeatRecVolFlowRate, "User-Specified Design Hot Water Flow Rate [m3/s]", HeatRecVolFlowRateUser); - if (DisplayExtraWarnings) { - if ((std::abs(tmpHeatRecVolFlowRate - HeatRecVolFlowRateUser) / HeatRecVolFlowRateUser) > AutoVsHardSizingThreshold) { + if (DataGlobals::DisplayExtraWarnings) { + if ((std::abs(tmpHeatRecVolFlowRate - HeatRecVolFlowRateUser) / HeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + ExhaustAbsorber(ChillNum).Name); - ShowContinueError("User-Specified Design Hot Water Flow Rate of " + RoundSigDigits(HeatRecVolFlowRateUser, 5) + + ShowContinueError("User-Specified Design Hot Water Flow Rate of " + General::RoundSigDigits(HeatRecVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Hot Water Flow Rate of " + - RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); + General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1350,7 +1295,7 @@ namespace ChillerExhaustAbsorption { } } else { if (ExhaustAbsorber(ChillNum).HeatVolFlowRateWasAutoSized) { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + ExhaustAbsorber(ChillNum).Name + "\", autosize error."); ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller hot water flow rate requires"); @@ -1358,9 +1303,9 @@ namespace ChillerExhaustAbsorption { ErrorsFound = true; } } else { - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { if (ExhaustAbsorber(ChillNum).HeatVolFlowRate > 0.0) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "User-Specified Design Hot Water Flow Rate [m3/s]", ExhaustAbsorber(ChillNum).HeatVolFlowRate); @@ -1369,37 +1314,37 @@ namespace ChillerExhaustAbsorption { } } - RegisterPlantCompDesignFlow(ExhaustAbsorber(ChillNum).HeatReturnNodeNum, tmpHeatRecVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(ExhaustAbsorber(ChillNum).HeatReturnNodeNum, tmpHeatRecVolFlowRate); if (PltSizCondNum > 0 && PltSizCoolNum > 0) { - if (PlantSizData(PltSizCoolNum).DesVolFlowRate >= SmallWaterVolFlow && tmpNomCap > 0.0) { + if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { - Cp = GetSpecificHeatGlycol(PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, ExhaustAbsorber(ChillNum).TempDesCondReturn, - PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, RoutineName); - rho = GetDensityGlycol(PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, ExhaustAbsorber(ChillNum).TempDesCondReturn, - PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = - tmpNomCap * (1.0 + ExhaustAbsorber(ChillNum).ThermalEnergyCoolRatio) / (PlantSizData(PltSizCondNum).DeltaT * Cp * rho); + tmpNomCap * (1.0 + ExhaustAbsorber(ChillNum).ThermalEnergyCoolRatio) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); if (!ExhaustAbsorber(ChillNum).CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = ExhaustAbsorber(ChillNum).CondVolFlowRate; } else { if (ExhaustAbsorber(ChillNum).CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (ExhaustAbsorber(ChillNum).CondVolFlowRateWasAutoSized) { ExhaustAbsorber(ChillNum).CondVolFlowRate = tmpCondVolFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Initial Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); @@ -1407,21 +1352,21 @@ namespace ChillerExhaustAbsorption { } else { if (ExhaustAbsorber(ChillNum).CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { CondVolFlowRateUser = ExhaustAbsorber(ChillNum).CondVolFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate, "User-Specified Design Condenser Water Flow Rate [m3/s]", CondVolFlowRateUser); - if (DisplayExtraWarnings) { - if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > AutoVsHardSizingThreshold) { + if (DataGlobals::DisplayExtraWarnings) { + if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + ExhaustAbsorber(ChillNum).Name); - ShowContinueError("User-Specified Design Condenser Water Flow Rate of " + RoundSigDigits(CondVolFlowRateUser, 5) + + ShowContinueError("User-Specified Design Condenser Water Flow Rate of " + General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Condenser Water Flow Rate of " + - RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1433,7 +1378,7 @@ namespace ChillerExhaustAbsorption { } } else { if (ExhaustAbsorber(ChillNum).CondVolFlowRateWasAutoSized) { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + ExhaustAbsorber(ChillNum).Name + "\", autosize error."); ShowSevereError("Autosizing of Exhaust Fired Absorption Chiller condenser flow rate requires a condenser"); @@ -1441,9 +1386,9 @@ namespace ChillerExhaustAbsorption { ErrorsFound = true; } } else { - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { if (ExhaustAbsorber(ChillNum).CondVolFlowRate > 0.0) { - ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", + ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", ExhaustAbsorber(ChillNum).Name, "User-Specified Design Condenser Water Flow Rate [m3/s]", ExhaustAbsorber(ChillNum).CondVolFlowRate); @@ -1453,18 +1398,18 @@ namespace ChillerExhaustAbsorption { } // save the design condenser water volumetric flow rate for use by the condenser water loop sizing algorithms - if (ExhaustAbsorber(ChillNum).isWaterCooled) RegisterPlantCompDesignFlow(ExhaustAbsorber(ChillNum).CondReturnNodeNum, tmpCondVolFlowRate); + if (ExhaustAbsorber(ChillNum).isWaterCooled) PlantUtilities::RegisterPlantCompDesignFlow(ExhaustAbsorber(ChillNum).CondReturnNodeNum, tmpCondVolFlowRate); if (ErrorsFound) { ShowFatalError("Preceding sizing errors cause program termination"); } - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { // create predefined report equipName = ExhaustAbsorber(ChillNum).Name; - PreDefTableEntry(pdchMechType, equipName, "ChillerHeater:Absorption:DoubleEffect"); - PreDefTableEntry(pdchMechNomEff, equipName, ExhaustAbsorber(ChillNum).ThermalEnergyCoolRatio); - PreDefTableEntry(pdchMechNomCap, equipName, ExhaustAbsorber(ChillNum).NomCoolingCap); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechType, equipName, "ChillerHeater:Absorption:DoubleEffect"); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomEff, equipName, ExhaustAbsorber(ChillNum).ThermalEnergyCoolRatio); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomCap, equipName, ExhaustAbsorber(ChillNum).NomCoolingCap); } } @@ -1490,21 +1435,6 @@ namespace ChillerExhaustAbsorption { // 1. DOE-2.1e Supplement and source code // 2. CoolTools GasMod work - // Using/Aliasing - using CurveManager::CurveValue; - using DataBranchAirLoopPlant::MassFlowTolerance; - using DataPlant::DeltaTempTol; - using DataPlant::DualSetPointDeadBand; - using DataPlant::PlantLoop; - using DataPlant::SingleSetPoint; - using FluidProperties::GetDensityGlycol; - using FluidProperties::GetSpecificHeatGlycol; - using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // FlowLock = 0 if mass flow rates may be changed by loop components // FlowLock = 1 if mass flow rates may not be changed by loop components @@ -1620,41 +1550,41 @@ namespace ChillerExhaustAbsorption { lHeatPartLoadRatio = ExhaustAbsorberReport(ChillNum).HeatPartLoadRatio; // initialize entering conditions - lChillReturnTemp = Node(lChillReturnNodeNum).Temp; - lChillWaterMassFlowRate = Node(lChillReturnNodeNum).MassFlowRate; - lCondReturnTemp = Node(lCondReturnNodeNum).Temp; - lCondWaterMassFlowRate = Node(lCondReturnNodeNum).MassFlowRate; + lChillReturnTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp; + lChillWaterMassFlowRate = DataLoopNode::Node(lChillReturnNodeNum).MassFlowRate; + lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp; + lCondWaterMassFlowRate = DataLoopNode::Node(lCondReturnNodeNum).MassFlowRate; { - auto const SELECT_CASE_var(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { - ChillSupplySetPointTemp = Node(lChillSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DualSetPointDeadBand) { - ChillSupplySetPointTemp = Node(lChillSupplyNodeNum).TempSetPointHi; + auto const SELECT_CASE_var(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPoint; + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPointHi; } else { assert(false); } } ChillDeltaTemp = std::abs(lChillReturnTemp - ChillSupplySetPointTemp); - lExhaustInTemp = Node(lExhaustAirInletNodeNum).Temp; - lExhaustInFlow = Node(lExhaustAirInletNodeNum).MassFlowRate; - lExhaustAirHumRat = Node(lExhaustAirInletNodeNum).HumRat; + lExhaustInTemp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp; + lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate; + lExhaustAirHumRat = DataLoopNode::Node(lExhaustAirInletNodeNum).HumRat; - rhoCW = GetDensityGlycol(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, + rhoCW = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, lChillReturnTemp, - PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, RoutineName); - Cp_CW = GetSpecificHeatGlycol(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, + Cp_CW = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, lChillReturnTemp, - PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, RoutineName); if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { - rhoCD = GetDensityGlycol(PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, + rhoCD = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, lChillReturnTemp, - PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, RoutineName); - Cp_CD = GetSpecificHeatGlycol(PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, + Cp_CD = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, lChillReturnTemp, - PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, RoutineName); } @@ -1666,7 +1596,7 @@ namespace ChillerExhaustAbsorption { lCondSupplyTemp = lCondReturnTemp; lCondWaterMassFlowRate = 0.0; if (lIsWaterCooled) { - SetComponentFlowRate(lCondWaterMassFlowRate, + PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate, ExhaustAbsorber(ChillNum).CondReturnNodeNum, ExhaustAbsorber(ChillNum).CondSupplyNodeNum, ExhaustAbsorber(ChillNum).CDLoopNum, @@ -1684,7 +1614,7 @@ namespace ChillerExhaustAbsorption { // most manufacturers rate have tables of entering condenser water temperature // but a few use leaving condenser water temperature so we have a flag // when leaving is used it uses the previous iterations value of the value - lCondReturnTemp = Node(lCondReturnNodeNum).Temp; + lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp; if (lIsEnterCondensTemp) { calcCondTemp = lCondReturnTemp; } else { @@ -1695,7 +1625,7 @@ namespace ChillerExhaustAbsorption { } // Set mass flow rates lCondWaterMassFlowRate = ExhaustAbsorber(ChillNum).DesCondMassFlowRate; - SetComponentFlowRate(lCondWaterMassFlowRate, + PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate, ExhaustAbsorber(ChillNum).CondReturnNodeNum, ExhaustAbsorber(ChillNum).CondSupplyNodeNum, ExhaustAbsorber(ChillNum).CDLoopNum, @@ -1704,12 +1634,12 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorber(ChillNum).CDCompNum); } else { // air cooled - Node(lCondReturnNodeNum).Temp = Node(lCondReturnNodeNum).OutAirDryBulb; - calcCondTemp = Node(lCondReturnNodeNum).OutAirDryBulb; - lCondReturnTemp = Node(lCondReturnNodeNum).Temp; + DataLoopNode::Node(lCondReturnNodeNum).Temp = DataLoopNode::Node(lCondReturnNodeNum).OutAirDryBulb; + calcCondTemp = DataLoopNode::Node(lCondReturnNodeNum).OutAirDryBulb; + lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp; lCondWaterMassFlowRate = 0.0; if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { - SetComponentFlowRate(lCondWaterMassFlowRate, + PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate, ExhaustAbsorber(ChillNum).CondReturnNodeNum, ExhaustAbsorber(ChillNum).CondSupplyNodeNum, ExhaustAbsorber(ChillNum).CDLoopNum, @@ -1720,7 +1650,7 @@ namespace ChillerExhaustAbsorption { } // Determine available cooling capacity using the setpoint temperature - lAvailableCoolingCapacity = lNomCoolingCap * CurveValue(lCoolCapFTCurve, ChillSupplySetPointTemp, calcCondTemp); + lAvailableCoolingCapacity = lNomCoolingCap * CurveManager::CurveValue(lCoolCapFTCurve, ChillSupplySetPointTemp, calcCondTemp); // Calculate current load for cooling MyLoad = sign(max(std::abs(MyLoad), lAvailableCoolingCapacity * lMinPartLoadRat), MyLoad); @@ -1736,16 +1666,16 @@ namespace ChillerExhaustAbsorption { LoopNum = ExhaustAbsorber(ChillNum).CWLoopNum; LoopSideNum = ExhaustAbsorber(ChillNum).CWLoopSideNum; { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); + auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); if (SELECT_CASE_var == 0) { // mass flow rates may be changed by loop components ExhaustAbsorber(ChillNum).PossibleSubcooling = false; lCoolingLoad = std::abs(MyLoad); if (ChillDeltaTemp != 0.0) { lChillWaterMassFlowRate = std::abs(lCoolingLoad / (Cp_CW * ChillDeltaTemp)); - if (lChillWaterMassFlowRate - lChillWaterMassflowratemax > MassFlowTolerance) + if (lChillWaterMassFlowRate - lChillWaterMassflowratemax > DataBranchAirLoopPlant::MassFlowTolerance) ExhaustAbsorber(ChillNum).PossibleSubcooling = true; - SetComponentFlowRate(lChillWaterMassFlowRate, + PlantUtilities::SetComponentFlowRate(lChillWaterMassFlowRate, ExhaustAbsorber(ChillNum).ChillReturnNodeNum, ExhaustAbsorber(ChillNum).ChillSupplyNodeNum, ExhaustAbsorber(ChillNum).CWLoopNum, @@ -1753,11 +1683,11 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorber(ChillNum).CWBranchNum, ExhaustAbsorber(ChillNum).CWCompNum); { - auto const SELECT_CASE_var1(PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var1 == SingleSetPoint) { - lChillSupplyTemp = Node(lChillSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var1 == DualSetPointDeadBand) { - lChillSupplyTemp = Node(lChillSupplyNodeNum).TempSetPointHi; + auto const SELECT_CASE_var1(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var1 == DataPlant::SingleSetPoint) { + lChillSupplyTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPoint; + } else if (SELECT_CASE_var1 == DataPlant::DualSetPointDeadBand) { + lChillSupplyTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPointHi; } } } else { @@ -1768,51 +1698,51 @@ namespace ChillerExhaustAbsorption { } lChillSupplyTemp = ChillSupplySetPointTemp; } else if (SELECT_CASE_var == 1) { // mass flow rates may not be changed by loop components - lChillWaterMassFlowRate = Node(lChillReturnNodeNum).MassFlowRate; + lChillWaterMassFlowRate = DataLoopNode::Node(lChillReturnNodeNum).MassFlowRate; if (ExhaustAbsorber(ChillNum).PossibleSubcooling) { lCoolingLoad = std::abs(MyLoad); ChillDeltaTemp = lCoolingLoad / lChillWaterMassFlowRate / Cp_CW; - lChillSupplyTemp = Node(lChillReturnNodeNum).Temp - ChillDeltaTemp; + lChillSupplyTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - ChillDeltaTemp; } else { - ChillDeltaTemp = Node(lChillReturnNodeNum).Temp - ChillSupplySetPointTemp; + ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - ChillSupplySetPointTemp; lCoolingLoad = std::abs(lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp); lChillSupplyTemp = ChillSupplySetPointTemp; } // Check that the Chiller Supply outlet temp honors both plant loop temp low limit and also the chiller low limit if (lChillSupplyTemp < lCHWLowLimitTemp) { - if ((Node(lChillReturnNodeNum).Temp - lCHWLowLimitTemp) > DeltaTempTol) { + if ((DataLoopNode::Node(lChillReturnNodeNum).Temp - lCHWLowLimitTemp) > DataPlant::DeltaTempTol) { lChillSupplyTemp = lCHWLowLimitTemp; - ChillDeltaTemp = Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; + ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp; } else { - lChillSupplyTemp = Node(lChillReturnNodeNum).Temp; - ChillDeltaTemp = Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; + lChillSupplyTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp; + ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp; } } - if (lChillSupplyTemp < Node(lChillSupplyNodeNum).TempMin) { - if ((Node(lChillReturnNodeNum).Temp - Node(lChillSupplyNodeNum).TempMin) > DeltaTempTol) { - lChillSupplyTemp = Node(lChillSupplyNodeNum).TempMin; - ChillDeltaTemp = Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; + if (lChillSupplyTemp < DataLoopNode::Node(lChillSupplyNodeNum).TempMin) { + if ((DataLoopNode::Node(lChillReturnNodeNum).Temp - DataLoopNode::Node(lChillSupplyNodeNum).TempMin) > DataPlant::DeltaTempTol) { + lChillSupplyTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempMin; + ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp; } else { - lChillSupplyTemp = Node(lChillReturnNodeNum).Temp; - ChillDeltaTemp = Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; + lChillSupplyTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp; + ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp; } } // Checks Coolingload on the basis of the machine limits. if (lCoolingLoad > std::abs(MyLoad)) { - if (lChillWaterMassFlowRate > MassFlowTolerance) { + if (lChillWaterMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { lCoolingLoad = std::abs(MyLoad); ChillDeltaTemp = lCoolingLoad / lChillWaterMassFlowRate / Cp_CW; - lChillSupplyTemp = Node(lChillReturnNodeNum).Temp - ChillDeltaTemp; + lChillSupplyTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - ChillDeltaTemp; } else { - lChillSupplyTemp = Node(lChillReturnNodeNum).Temp; - ChillDeltaTemp = Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; + lChillSupplyTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp; + ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp; } } @@ -1844,23 +1774,23 @@ namespace ChillerExhaustAbsorption { // Calculate thermal energy consumption for cooling // Thermal Energy used for cooling availCap * TeFIR * TeFIR-FT * TeFIR-FPLR lCoolThermalEnergyUseRate = lAvailableCoolingCapacity * lThermalEnergyCoolRatio * - CurveValue(lThermalEnergyCoolFTCurve, lChillSupplyTemp, calcCondTemp) * - CurveValue(lThermalEnergyCoolFPLRCurve, lCoolPartLoadRatio) * lFractionOfPeriodRunning; + CurveManager::CurveValue(lThermalEnergyCoolFTCurve, lChillSupplyTemp, calcCondTemp) * + CurveManager::CurveValue(lThermalEnergyCoolFPLRCurve, lCoolPartLoadRatio) * lFractionOfPeriodRunning; // Calculate electric parasitics used // based on nominal capacity, not available capacity, // electric used for cooling nomCap * %OP * EIR * EIR-FT * EIR-FPLR lCoolElectricPower = lNomCoolingCap * lElecCoolRatio * lFractionOfPeriodRunning * - CurveValue(lElecCoolFTCurve, lChillSupplyTemp, calcCondTemp) * CurveValue(lElecCoolFPLRCurve, lCoolPartLoadRatio); + CurveManager::CurveValue(lElecCoolFTCurve, lChillSupplyTemp, calcCondTemp) * CurveManager::CurveValue(lElecCoolFPLRCurve, lCoolPartLoadRatio); // determine conderser load which is cooling load plus the // ThermalEnergy used for cooling plus // the electricity used lTowerLoad = lCoolingLoad + lCoolThermalEnergyUseRate / lThermalEnergyHeatRatio + lCoolElectricPower; - lExhaustInTemp = Node(lExhaustAirInletNodeNum).Temp; - lExhaustInFlow = Node(lExhaustAirInletNodeNum).MassFlowRate; - CpAir = PsyCpAirFnWTdb(lExhaustAirHumRat, lExhaustInTemp); + lExhaustInTemp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp; + lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate; + CpAir = Psychrometrics::PsyCpAirFnWTdb(lExhaustAirHumRat, lExhaustInTemp); lExhHeatRecPotentialCool = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp); // If Microturbine Exhaust temperature and flow rate is not sufficient to run the chiller, then chiller will not run // lCoolThermalEnergyUseRate , lTowerLoad and lCoolElectricPower will be set to 0.0 @@ -1870,9 +1800,9 @@ namespace ChillerExhaustAbsorption { ShowWarningError("ChillerHeater:Absorption:DoubleEffect \"" + ExhaustAbsorber(ChillNum).Name + "\""); ShowContinueError( "...Exhaust temperature and flow input from Micro Turbine is not sufficient during cooling to run the chiller "); - ShowContinueError("...Value of Exhaust air inlet temp =" + TrimSigDigits(lExhaustInTemp, 4) + " C."); - ShowContinueError("... and Exhaust air flow rate of " + TrimSigDigits(lExhaustInFlow, 2) + " kg/s."); - ShowContinueError("...Value of minimum absorber leaving temp =" + TrimSigDigits(AbsLeavingTemp, 4) + " C."); + ShowContinueError("...Value of Exhaust air inlet temp =" + General::TrimSigDigits(lExhaustInTemp, 4) + " C."); + ShowContinueError("... and Exhaust air flow rate of " + General::TrimSigDigits(lExhaustInFlow, 2) + " kg/s."); + ShowContinueError("...Value of minimum absorber leaving temp =" + General::TrimSigDigits(AbsLeavingTemp, 4) + " C."); ShowContinueError("...Either increase the Exhaust temperature (min required = 350 C ) or flow or both of Micro Turbine to meet " "the min available potential criteria."); ShowContinueErrorTimeStamp("... Simulation will continue."); @@ -1895,7 +1825,7 @@ namespace ChillerExhaustAbsorption { // for water cooled condenser make sure enough flow rate // for air cooled condenser just set supply to return temperature if (lIsWaterCooled) { - if (lCondWaterMassFlowRate > MassFlowTolerance) { + if (lCondWaterMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { lCondSupplyTemp = lCondReturnTemp + lTowerLoad / (lCondWaterMassFlowRate * Cp_CD); } else { ShowSevereError("CalcExhaustAbsorberChillerModel: Condenser flow = 0, for Exhaust Absorber Chiller=" + @@ -1915,7 +1845,7 @@ namespace ChillerExhaustAbsorption { // iteration's value of condenser supply temperature and the actual calculated condenser supply // temperature. If this becomes too common then may need to iterate a solution instead of // relying on previous iteration method. - revisedEstimateAvailCap = lNomCoolingCap * CurveValue(lCoolCapFTCurve, ChillSupplySetPointTemp, lCondSupplyTemp); + revisedEstimateAvailCap = lNomCoolingCap * CurveManager::CurveValue(lCoolCapFTCurve, ChillSupplySetPointTemp, lCondSupplyTemp); if (revisedEstimateAvailCap > 0.0) { errorAvailCap = std::abs((revisedEstimateAvailCap - lAvailableCoolingCapacity) / revisedEstimateAvailCap); if (errorAvailCap > 0.05) { // if more than 5% error in estimate @@ -1973,17 +1903,6 @@ namespace ChillerExhaustAbsorption { // 1. DOE-2.1e Supplement and source code // 2. CoolTools GasMod work - // Using/Aliasing - using CurveManager::CurveValue; - using DataBranchAirLoopPlant::MassFlowTolerance; - using DataPlant::DualSetPointDeadBand; - using DataPlant::PlantLoop; - using DataPlant::SingleSetPoint; - using FluidProperties::GetDensityGlycol; - using FluidProperties::GetSpecificHeatGlycol; - using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; - // Locals // SUBROUTINE ARGUMENT DEFINITIONS: // FlowLock = 0 if mass flow rates may be changed by loop components @@ -2066,22 +1985,22 @@ namespace ChillerExhaustAbsorption { LoopNum = ExhaustAbsorber(ChillNum).HWLoopNum; LoopSideNum = ExhaustAbsorber(ChillNum).HWLoopSideNum; - Cp_HW = GetSpecificHeatGlycol(PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, PlantLoop(LoopNum).FluidIndex, RoutineName); - rhoHW = GetDensityGlycol(PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, PlantLoop(LoopNum).FluidIndex, RoutineName); + Cp_HW = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); + rhoHW = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); lCoolElectricPower = ExhaustAbsorberReport(ChillNum).CoolElectricPower; lCoolThermalEnergyUseRate = ExhaustAbsorberReport(ChillNum).CoolThermalEnergyUseRate; lCoolPartLoadRatio = ExhaustAbsorberReport(ChillNum).CoolPartLoadRatio; // initialize entering conditions - lHotWaterReturnTemp = Node(lHeatReturnNodeNum).Temp; - lHotWaterMassFlowRate = Node(lHeatReturnNodeNum).MassFlowRate; + lHotWaterReturnTemp = DataLoopNode::Node(lHeatReturnNodeNum).Temp; + lHotWaterMassFlowRate = DataLoopNode::Node(lHeatReturnNodeNum).MassFlowRate; { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { - HeatSupplySetPointTemp = Node(lHeatSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DualSetPointDeadBand) { - HeatSupplySetPointTemp = Node(lHeatSupplyNodeNum).TempSetPointLo; + auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + HeatSupplySetPointTemp = DataLoopNode::Node(lHeatSupplyNodeNum).TempSetPoint; + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + HeatSupplySetPointTemp = DataLoopNode::Node(lHeatSupplyNodeNum).TempSetPointLo; } else { assert(false); } @@ -2100,7 +2019,7 @@ namespace ChillerExhaustAbsorption { // Determine available heating capacity using the current cooling load lAvailableHeatingCapacity = ExhaustAbsorber(ChillNum).NomHeatCoolRatio * ExhaustAbsorber(ChillNum).NomCoolingCap * - CurveValue(lHeatCapFCoolCurve, (ExhaustAbsorberReport(ChillNum).CoolingLoad / ExhaustAbsorber(ChillNum).NomCoolingCap)); + CurveManager::CurveValue(lHeatCapFCoolCurve, (ExhaustAbsorberReport(ChillNum).CoolingLoad / ExhaustAbsorber(ChillNum).NomCoolingCap)); // Calculate current load for heating MyLoad = sign(max(std::abs(MyLoad), ExhaustAbsorberReport(ChillNum).HeatingCapacity * lMinPartLoadRat), MyLoad); @@ -2112,13 +2031,13 @@ namespace ChillerExhaustAbsorption { // cooling load taken by the chiller, and // supply temperature { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); + auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); if (SELECT_CASE_var == 0) { // mass flow rates may be changed by loop components lHeatingLoad = std::abs(MyLoad); if (HeatDeltaTemp != 0) { lHotWaterMassFlowRate = std::abs(lHeatingLoad / (Cp_HW * HeatDeltaTemp)); - SetComponentFlowRate(lHotWaterMassFlowRate, + PlantUtilities::SetComponentFlowRate(lHotWaterMassFlowRate, ExhaustAbsorber(ChillNum).HeatReturnNodeNum, ExhaustAbsorber(ChillNum).HeatSupplyNodeNum, ExhaustAbsorber(ChillNum).HWLoopNum, @@ -2145,7 +2064,7 @@ namespace ChillerExhaustAbsorption { // The following conditional statements are made to avoid extremely small EvapMdot // & unreasonable EvapOutletTemp due to overloading. // Avoid 'divide by zero' due to small EvapMdot - if (lHotWaterMassFlowRate < MassFlowTolerance) { + if (lHotWaterMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { HeatDeltaTemp = 0.0; } else { HeatDeltaTemp = std::abs(MyLoad) / (Cp_HW * lHotWaterMassFlowRate); @@ -2163,7 +2082,7 @@ namespace ChillerExhaustAbsorption { // ThermalEnergy used for heating availCap * HIR * HIR-FT * HIR-FPLR lHeatThermalEnergyUseRate = - lAvailableHeatingCapacity * lThermalEnergyHeatRatio * CurveValue(lThermalEnergyHeatFHPLRCurve, lHeatPartLoadRatio); + lAvailableHeatingCapacity * lThermalEnergyHeatRatio * CurveManager::CurveValue(lThermalEnergyHeatFHPLRCurve, lHeatPartLoadRatio); // calculate the fraction of the time period that the chiller would be running // use maximum from heating and cooling sides @@ -2177,18 +2096,18 @@ namespace ChillerExhaustAbsorption { // If heating electric is greater, leave cooling electric and subtract if off of heating elec // If cooling electric is greater, set heating electric to zero - lExhaustInTemp = Node(lExhaustAirInletNodeNum).Temp; - lExhaustInFlow = Node(lExhaustAirInletNodeNum).MassFlowRate; - CpAir = PsyCpAirFnWTdb(lExhaustAirHumRat, lExhaustInTemp); + lExhaustInTemp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp; + lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate; + CpAir = Psychrometrics::PsyCpAirFnWTdb(lExhaustAirHumRat, lExhaustInTemp); lExhHeatRecPotentialHeat = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp); if (lExhHeatRecPotentialHeat < lHeatThermalEnergyUseRate) { if (ExhaustAbsorber(ChillNum).ExhTempLTAbsLeavingHeatingTempIndex == 0) { ShowWarningError("ChillerHeater:Absorption:DoubleEffect \"" + ExhaustAbsorber(ChillNum).Name + "\""); ShowContinueError( "...Exhaust temperature and flow input from Micro Turbine is not sufficient to run the chiller during heating ."); - ShowContinueError("...Value of Exhaust air inlet temp =" + TrimSigDigits(lExhaustInTemp, 4) + " C."); - ShowContinueError("... and Exhaust air flow rate of " + TrimSigDigits(lExhaustInFlow, 2) + " kg/s."); - ShowContinueError("...Value of minimum absorber leaving temp =" + TrimSigDigits(AbsLeavingTemp, 4) + " C."); + ShowContinueError("...Value of Exhaust air inlet temp =" + General::TrimSigDigits(lExhaustInTemp, 4) + " C."); + ShowContinueError("... and Exhaust air flow rate of " + General::TrimSigDigits(lExhaustInFlow, 2) + " kg/s."); + ShowContinueError("...Value of minimum absorber leaving temp =" + General::TrimSigDigits(AbsLeavingTemp, 4) + " C."); ShowContinueError("...Either increase the Exhaust temperature (min required = 350 C ) or flow or both of Micro Turbine to meet " "the min available potential criteria."); ShowContinueErrorTimeStamp("... Simulation will continue."); @@ -2245,9 +2164,6 @@ namespace ChillerExhaustAbsorption { // PURPOSE OF THIS SUBROUTINE: // reporting - // Using/Aliasing - using DataHVACGlobals::TimeStepSys; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int lChillReturnNodeNum; // Node number on the inlet side of the plant int lChillSupplyNodeNum; // Node number on the outlet side of the plant @@ -2263,23 +2179,23 @@ namespace ChillerExhaustAbsorption { lExhaustAirInletNodeNum = ExhaustAbsorber(ChillNum).ExhaustAirInletNodeNum; if (MyLoad == 0 || !RunFlag) { - Node(lChillSupplyNodeNum).Temp = Node(lChillReturnNodeNum).Temp; + DataLoopNode::Node(lChillSupplyNodeNum).Temp = DataLoopNode::Node(lChillReturnNodeNum).Temp; if (ExhaustAbsorber(ChillNum).isWaterCooled) { - Node(lCondSupplyNodeNum).Temp = Node(lCondReturnNodeNum).Temp; + DataLoopNode::Node(lCondSupplyNodeNum).Temp = DataLoopNode::Node(lCondReturnNodeNum).Temp; } - Node(lExhaustAirInletNodeNum).Temp = Node(lExhaustAirInletNodeNum).Temp; - Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorberReport(ChillNum).ExhaustInFlow; + DataLoopNode::Node(lExhaustAirInletNodeNum).Temp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp; + DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorberReport(ChillNum).ExhaustInFlow; } else { - Node(lChillSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).ChillSupplyTemp; + DataLoopNode::Node(lChillSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).ChillSupplyTemp; if (ExhaustAbsorber(ChillNum).isWaterCooled) { - Node(lCondSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).CondSupplyTemp; + DataLoopNode::Node(lCondSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).CondSupplyTemp; } - Node(lExhaustAirInletNodeNum).Temp = ExhaustAbsorberReport(ChillNum).ExhaustInTemp; - Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorberReport(ChillNum).ExhaustInFlow; + DataLoopNode::Node(lExhaustAirInletNodeNum).Temp = ExhaustAbsorberReport(ChillNum).ExhaustInTemp; + DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorberReport(ChillNum).ExhaustInFlow; } // convert power to energy and instantaneous use to use over the time step - RptConstant = TimeStepSys * SecInHour; + RptConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; ExhaustAbsorberReport(ChillNum).CoolingEnergy = ExhaustAbsorberReport(ChillNum).CoolingLoad * RptConstant; ExhaustAbsorberReport(ChillNum).TowerEnergy = ExhaustAbsorberReport(ChillNum).TowerLoad * RptConstant; ExhaustAbsorberReport(ChillNum).ThermalEnergy = ExhaustAbsorberReport(ChillNum).ThermalEnergyUseRate * RptConstant; @@ -2292,8 +2208,6 @@ namespace ChillerExhaustAbsorption { } else { ExhaustAbsorberReport(ChillNum).ThermalEnergyCOP = 0.0; } - // Node(lChillSupplyNodeNum)%MassFlowRateMaxAvail = Node(lChillReturnNodeNum)%MassFlowRateMaxAvail - // Node(lChillSupplyNodeNum)%MassFlowRateMinAvail = Node(lChillReturnNodeNum)%MassFlowRateMinAvail } void UpdateExhaustAbsorberHeatRecords(Real64 const MyLoad, // current load @@ -2308,9 +2222,6 @@ namespace ChillerExhaustAbsorption { // PURPOSE OF THIS SUBROUTINE: // reporting - // Using/Aliasing - using DataHVACGlobals::TimeStepSys; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int lHeatReturnNodeNum; // absorber steam inlet node number, water side int lHeatSupplyNodeNum; // absorber steam outlet node number, water side @@ -2320,13 +2231,13 @@ namespace ChillerExhaustAbsorption { lHeatSupplyNodeNum = ExhaustAbsorber(ChillNum).HeatSupplyNodeNum; if (MyLoad == 0 || !RunFlag) { - Node(lHeatSupplyNodeNum).Temp = Node(lHeatReturnNodeNum).Temp; + DataLoopNode::Node(lHeatSupplyNodeNum).Temp = DataLoopNode::Node(lHeatReturnNodeNum).Temp; } else { - Node(lHeatSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).HotWaterSupplyTemp; + DataLoopNode::Node(lHeatSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).HotWaterSupplyTemp; } // convert power to energy and instantaneous use to use over the time step - RptConstant = TimeStepSys * SecInHour; + RptConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; ExhaustAbsorberReport(ChillNum).HeatingEnergy = ExhaustAbsorberReport(ChillNum).HeatingLoad * RptConstant; ExhaustAbsorberReport(ChillNum).ThermalEnergy = ExhaustAbsorberReport(ChillNum).ThermalEnergyUseRate * RptConstant; ExhaustAbsorberReport(ChillNum).HeatThermalEnergy = ExhaustAbsorberReport(ChillNum).HeatThermalEnergyUseRate * RptConstant; From 5c37e260de6838f02f965d8dc6ec03ff9fde6249 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 17 Jan 2020 13:43:56 -0600 Subject: [PATCH 23/41] Cleaning up minor IDE warnings, still a few left --- src/EnergyPlus/ChillerExhaustAbsorption.cc | 45 ++++------------------ 1 file changed, 7 insertions(+), 38 deletions(-) diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index a1e55cb5e48..01673cb31b1 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -58,13 +58,13 @@ #include #include #include -#include +//#include #include #include #include #include #include -#include +//#include #include #include #include @@ -233,22 +233,14 @@ namespace ChillerExhaustAbsorption { if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).ChillReturnNodeNum) { // Operate as chiller // Calculate Node Values // Calculate Equipment and Update Variables - if (RunFlag) { - ExhaustAbsorber(ChillNum).InCoolingMode = true; - } else { - ExhaustAbsorber(ChillNum).InCoolingMode = false; - } + ExhaustAbsorber(ChillNum).InCoolingMode = RunFlag != 0; InitExhaustAbsorber(ChillNum, RunFlag); CalcExhaustAbsorberChillerModel(ChillNum, MyLoad, RunFlag); UpdateExhaustAbsorberCoolRecords(MyLoad, RunFlag, ChillNum); } else if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).HeatReturnNodeNum) { // Operate as heater // Calculate Node Values // Calculate Equipment and Update Variables - if (RunFlag) { - ExhaustAbsorber(ChillNum).InHeatingMode = true; - } else { - ExhaustAbsorber(ChillNum).InHeatingMode = false; - } + ExhaustAbsorber(ChillNum).InHeatingMode = RunFlag != 0; InitExhaustAbsorber(ChillNum, RunFlag); CalcExhaustAbsorberHeaterModel(ChillNum, MyLoad, RunFlag); UpdateExhaustAbsorberHeatRecords(MyLoad, RunFlag, ChillNum); @@ -1058,9 +1050,6 @@ namespace ChillerExhaustAbsorption { // SUBROUTINE PARAMETER DEFINITIONS: std::string const RoutineName("SizeExhaustAbsorber"); - int PltSizCoolNum; // Plant Sizing index for cooling loop - int PltSizHeatNum; // Plant Sizing index for heating loop - int PltSizCondNum; // Plant Sizing index for condenser loop bool ErrorsFound; // If errors detected in input std::string equipName; @@ -1075,23 +1064,17 @@ namespace ChillerExhaustAbsorption { Real64 CondVolFlowRateUser; // Hardsized condenser flow rate for reporting Real64 HeatRecVolFlowRateUser; // Hardsized generator flow rate for reporting - PltSizCoolNum = 0; - PltSizCondNum = 0; - PltSizHeatNum = 0; ErrorsFound = false; tmpNomCap = ExhaustAbsorber(ChillNum).NomCoolingCap; tmpEvapVolFlowRate = ExhaustAbsorber(ChillNum).EvapVolFlowRate; tmpCondVolFlowRate = ExhaustAbsorber(ChillNum).CondVolFlowRate; tmpHeatRecVolFlowRate = ExhaustAbsorber(ChillNum).HeatVolFlowRate; - NomCapUser = 0.0; - EvapVolFlowRateUser = 0.0; - CondVolFlowRateUser = 0.0; - HeatRecVolFlowRateUser = 0.0; + int PltSizCondNum = 0; // Plant Sizing index for condenser loop if (ExhaustAbsorber(ChillNum).isWaterCooled) PltSizCondNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).PlantSizNum; - PltSizHeatNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).PlantSizNum; - PltSizCoolNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).PlantSizNum; + int PltSizHeatNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).PlantSizNum; + int PltSizCoolNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).PlantSizNum; if (PltSizCoolNum > 0) { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { @@ -1533,7 +1516,6 @@ namespace ChillerExhaustAbsorption { lElecCoolRatio = ExhaustAbsorber(ChillNum).ElecCoolRatio; lMinPartLoadRat = ExhaustAbsorber(ChillNum).MinPartLoadRat; lMaxPartLoadRat = ExhaustAbsorber(ChillNum).MaxPartLoadRat; - lOptPartLoadRat = ExhaustAbsorber(ChillNum).OptPartLoadRat; lTempDesCondReturn = ExhaustAbsorber(ChillNum).TempDesCondReturn; lTempDesCHWSupply = ExhaustAbsorber(ChillNum).TempDesCHWSupply; lCondVolFlowRate = ExhaustAbsorber(ChillNum).CondVolFlowRate; @@ -1553,7 +1535,6 @@ namespace ChillerExhaustAbsorption { lChillReturnTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp; lChillWaterMassFlowRate = DataLoopNode::Node(lChillReturnNodeNum).MassFlowRate; lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp; - lCondWaterMassFlowRate = DataLoopNode::Node(lCondReturnNodeNum).MassFlowRate; { auto const SELECT_CASE_var(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { @@ -1604,7 +1585,6 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorber(ChillNum).CDBranchNum, ExhaustAbsorber(ChillNum).CDCompNum); } - ChillDeltaTemp = 0.0; lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat); } else { @@ -1682,14 +1662,6 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorber(ChillNum).CWLoopSideNum, ExhaustAbsorber(ChillNum).CWBranchNum, ExhaustAbsorber(ChillNum).CWCompNum); - { - auto const SELECT_CASE_var1(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var1 == DataPlant::SingleSetPoint) { - lChillSupplyTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var1 == DataPlant::DualSetPointDeadBand) { - lChillSupplyTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPointHi; - } - } } else { lChillWaterMassFlowRate = 0.0; ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:Cooling\"" + ExhaustAbsorber(ChillNum).Name + @@ -1819,7 +1791,6 @@ namespace ChillerExhaustAbsorption { lCoolElectricPower = 0.0; lChillSupplyTemp = lChillReturnTemp; lCondSupplyTemp = lCondReturnTemp; - ChillDeltaTemp = 0.0; lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat); } // for water cooled condenser make sure enough flow rate @@ -1926,7 +1897,6 @@ namespace ChillerExhaustAbsorption { int lHeatSupplyNodeNum; // absorber hot water outlet node number, water side Real64 lMinPartLoadRat; // min allowed operating frac full load Real64 lMaxPartLoadRat; // max allowed operating frac full load - Real64 lOptPartLoadRat; // optimal operating frac full load int lHeatCapFCoolCurve; // Heating Capacity Function of Cooling Capacity Curve int lThermalEnergyHeatFHPLRCurve; // ThermalEnergy Input to heat output ratio during heating only function // Local copies of ExhaustAbsorberReportVars Type @@ -1978,7 +1948,6 @@ namespace ChillerExhaustAbsorption { lElecHeatRatio = ExhaustAbsorber(ChillNum).ElecHeatRatio; lMinPartLoadRat = ExhaustAbsorber(ChillNum).MinPartLoadRat; lMaxPartLoadRat = ExhaustAbsorber(ChillNum).MaxPartLoadRat; - lOptPartLoadRat = ExhaustAbsorber(ChillNum).OptPartLoadRat; lHeatCapFCoolCurve = ExhaustAbsorber(ChillNum).HeatCapFCoolCurve; lThermalEnergyHeatFHPLRCurve = ExhaustAbsorber(ChillNum).ThermalEnergyHeatFHPLRCurve; lHotWaterMassFlowRateMax = ExhaustAbsorber(ChillNum).DesHeatMassFlowRate; From 2a443fa665e4ec21bca4ef9824e930a56b5390fe Mon Sep 17 00:00:00 2001 From: nigusse Date: Fri, 17 Jan 2020 13:33:57 -0500 Subject: [PATCH 24/41] modified the fix --- src/EnergyPlus/SingleDuct.cc | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 5483c8125c4..1925407665c 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -4493,6 +4493,25 @@ namespace SingleDuct { FanOp = 0; CalcVAVVS(SysNum, FirstHVACIteration, ZoneNodeNum, HCType, 0.0, 0.0, FanType, MassFlow, FanOp, QDelivered); } + + //MassFlow = Node(SysInletNode).MassFlowRate; + // Move data to the damper outlet node + SysOutlet(SysNum).AirTemp = SysInlet(SysNum).AirTemp; + SysOutlet(SysNum).AirHumRat = SysInlet(SysNum).AirHumRat; + SysOutlet(SysNum).AirMassFlowRate = MassFlow; + SysOutlet(SysNum).AirMassFlowRateMaxAvail = SysInlet(SysNum).AirMassFlowRateMaxAvail; + SysOutlet(SysNum).AirMassFlowRateMinAvail = SysInlet(SysNum).AirMassFlowRateMinAvail; + SysOutlet(SysNum).AirEnthalpy = SysInlet(SysNum).AirEnthalpy; + + // calculate damper Position. + if (Sys(SysNum).AirMassFlowRateMax == 0.0) { + Sys(SysNum).DamperPosition = 0.0; + } else { + Sys(SysNum).DamperPosition = MassFlow / Sys(SysNum).AirMassFlowRateMax; + } + // update the air terminal outlet node data + UpdateSys(SysNum); + } void SimConstVol(int const SysNum, bool const FirstHVACIteration, int const ZoneNum, int const ZoneNodeNum) @@ -4883,14 +4902,6 @@ namespace SingleDuct { ShowFatalError("Invalid Reheat Component=" + Sys(SysNum).ReheatComp); } } - // Calculate Damper Position. - if (AirMassFlow == 0.0) { - Sys(SysNum).DamperPosition = 0.0; - } else if ((AirMassFlow > 0.0) && (AirMassFlow < Sys(SysNum).AirMassFlowRateMax)) { - Sys(SysNum).DamperPosition = AirMassFlow / Sys(SysNum).AirMassFlowRateMax; - } else if (AirMassFlow == Sys(SysNum).AirMassFlowRateMax) { - Sys(SysNum).DamperPosition = 1.0; - } LoadMet = AirMassFlow * CpAirZn * (Node(HCOutNode).Temp - Node(ZoneNode).Temp); } From e1e7017a88e6918f34526a6d03b8dc2333154d19 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 17 Jan 2020 16:33:05 -0600 Subject: [PATCH 25/41] Clean up IDE warnings, unused vars --- src/EnergyPlus/ChillerExhaustAbsorption.cc | 31 +--------------------- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index 01673cb31b1..dad2be122d5 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -1436,13 +1436,8 @@ namespace ChillerExhaustAbsorption { int lChillReturnNodeNum; // Node number on the inlet side of the plant int lChillSupplyNodeNum; // Node number on the outlet side of the plant int lCondReturnNodeNum; // Node number on the inlet side of the condenser - int lCondSupplyNodeNum; // Node number on the outlet side of the condenser Real64 lMinPartLoadRat; // min allowed operating frac full load Real64 lMaxPartLoadRat; // max allowed operating frac full load - Real64 lOptPartLoadRat; // optimal operating frac full load - Real64 lTempDesCondReturn; // design secondary loop fluid temperature at the Absorber condenser side inlet - Real64 lTempDesCHWSupply; // design chilled water supply temperature - Real64 lCondVolFlowRate; // m**3/s - design nominal water volumetric flow rate through the condenser int lCoolCapFTCurve; // cooling capacity as a function of temperature curve int lThermalEnergyCoolFTCurve; // ThermalEnergy-Input-to cooling output Ratio Function of Temperature Curve int lThermalEnergyCoolFPLRCurve; // ThermalEnergy-Input-to cooling output Ratio Function of Part Load Ratio Curve @@ -1493,10 +1488,8 @@ namespace ChillerExhaustAbsorption { Real64 errorAvailCap; // error fraction on final estimate of AvailableCoolingCapacity int LoopNum; int LoopSideNum; - Real64 rhoCW; // local fluid density for chilled water Real64 Cp_CW; // local fluid specific heat for chilled water - Real64 rhoCD; // local fluid density for condenser water - Real64 Cp_CD; // local fluid specific heat for condenser water + Real64 Cp_CD = -1; // local fluid specific heat for condenser water -- initializing to negative to ensure it isn't used uninitialized Real64 CpAir; // specific heat of exhaust air // define constant values @@ -1506,7 +1499,6 @@ namespace ChillerExhaustAbsorption { lChillReturnNodeNum = ExhaustAbsorber(ChillNum).ChillReturnNodeNum; lChillSupplyNodeNum = ExhaustAbsorber(ChillNum).ChillSupplyNodeNum; lCondReturnNodeNum = ExhaustAbsorber(ChillNum).CondReturnNodeNum; - lCondSupplyNodeNum = ExhaustAbsorber(ChillNum).CondSupplyNodeNum; lExhaustAirInletNodeNum = ExhaustAbsorber(ChillNum).ExhaustAirInletNodeNum; // set local copies of data from rest of input structure @@ -1516,9 +1508,6 @@ namespace ChillerExhaustAbsorption { lElecCoolRatio = ExhaustAbsorber(ChillNum).ElecCoolRatio; lMinPartLoadRat = ExhaustAbsorber(ChillNum).MinPartLoadRat; lMaxPartLoadRat = ExhaustAbsorber(ChillNum).MaxPartLoadRat; - lTempDesCondReturn = ExhaustAbsorber(ChillNum).TempDesCondReturn; - lTempDesCHWSupply = ExhaustAbsorber(ChillNum).TempDesCHWSupply; - lCondVolFlowRate = ExhaustAbsorber(ChillNum).CondVolFlowRate; lCoolCapFTCurve = ExhaustAbsorber(ChillNum).CoolCapFTCurve; lThermalEnergyCoolFTCurve = ExhaustAbsorber(ChillNum).ThermalEnergyCoolFTCurve; lThermalEnergyCoolFPLRCurve = ExhaustAbsorber(ChillNum).ThermalEnergyCoolFPLRCurve; @@ -1550,19 +1539,11 @@ namespace ChillerExhaustAbsorption { lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate; lExhaustAirHumRat = DataLoopNode::Node(lExhaustAirInletNodeNum).HumRat; - rhoCW = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, - lChillReturnTemp, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, - RoutineName); Cp_CW = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, lChillReturnTemp, DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, RoutineName); if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { - rhoCD = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, - lChillReturnTemp, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, - RoutineName); Cp_CD = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, lChillReturnTemp, DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, @@ -1906,12 +1887,8 @@ namespace ChillerExhaustAbsorption { // Real64 lThermalEnergy( 0.0 ); // variable to track total Thermal Energy used for a period (reference only) Real64 lCoolThermalEnergyUseRate(0.0); // instantaneous use of thermal energy for period for cooling Real64 lHeatThermalEnergyUseRate(0.0); // instantaneous use of thermal energy for period for heating - // Real64 lHeatThermalEnergy( 0.0 ); // variable to track total ThermalEnergy used for a period for heating - // Real64 lElectricPower( 0.0 ); // parasitic electric power used (was PumpingPower) - // Real64 lElectricEnergy( 0.0 ); // track the total electricity used for a period (was PumpingEnergy) Real64 lCoolElectricPower(0.0); // parasitic electric power used for cooling Real64 lHeatElectricPower(0.0); // parasitic electric power used for heating - // Real64 lHeatElectricEnergy( 0.0 ); // track the total electricity used for a period for heating Real64 lHotWaterReturnTemp(0.0); // reporting: hot water return (inlet) temperature Real64 lHotWaterSupplyTemp(0.0); // reporting: hot water supply (outlet) temperature Real64 lHotWaterMassFlowRate(0.0); // reporting: hot water mass flow rate @@ -1919,7 +1896,6 @@ namespace ChillerExhaustAbsorption { Real64 lHeatPartLoadRatio(0.0); // operating part load ratio (load/capacity for heating) Real64 lAvailableHeatingCapacity(0.0); // current heating capacity Real64 lFractionOfPeriodRunning(0.0); - Real64 lHotWaterMassFlowRateMax(0.0); // Maximum flow rate through the evaporator Real64 lExhaustInTemp(0.0); // Exhaust inlet temperature Real64 lExhaustInFlow(0.0); // Exhaust inlet flow rate Real64 lExhHeatRecPotentialHeat(0.0); // Exhaust heat recovery potential @@ -1931,7 +1907,6 @@ namespace ChillerExhaustAbsorption { int LoopSideNum; Real64 Cp_HW; // local fluid specific heat for hot water Real64 CpAir; - Real64 rhoHW; // local fluid density for hot water int lExhaustAirInletNodeNum; // Combustion Air Inlet Node number // set node values to data structure values for nodes @@ -1950,12 +1925,10 @@ namespace ChillerExhaustAbsorption { lMaxPartLoadRat = ExhaustAbsorber(ChillNum).MaxPartLoadRat; lHeatCapFCoolCurve = ExhaustAbsorber(ChillNum).HeatCapFCoolCurve; lThermalEnergyHeatFHPLRCurve = ExhaustAbsorber(ChillNum).ThermalEnergyHeatFHPLRCurve; - lHotWaterMassFlowRateMax = ExhaustAbsorber(ChillNum).DesHeatMassFlowRate; LoopNum = ExhaustAbsorber(ChillNum).HWLoopNum; LoopSideNum = ExhaustAbsorber(ChillNum).HWLoopSideNum; Cp_HW = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); - rhoHW = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); lCoolElectricPower = ExhaustAbsorberReport(ChillNum).CoolElectricPower; lCoolThermalEnergyUseRate = ExhaustAbsorberReport(ChillNum).CoolThermalEnergyUseRate; @@ -1981,7 +1954,6 @@ namespace ChillerExhaustAbsorption { if (MyLoad <= 0 || !RunFlag) { // set node temperatures lHotWaterSupplyTemp = lHotWaterReturnTemp; - HeatDeltaTemp = 0.0; lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat); } else { @@ -2091,7 +2063,6 @@ namespace ChillerExhaustAbsorption { lHeatThermalEnergyUseRate = 0.0; lHeatElectricPower = 0.0; lHotWaterSupplyTemp = lHotWaterReturnTemp; - HeatDeltaTemp = 0.0; lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat); } From e4be3e238908c90376bdd71bc7550660225e02b8 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 17 Jan 2020 15:40:23 -0700 Subject: [PATCH 26/41] fix EquipFlowCtrl type bug introduced here: bdd6800210d2772a5a89b37fcb6349d2f6e8acf9 --- src/EnergyPlus/ChillerElectricEIR.hh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/EnergyPlus/ChillerElectricEIR.hh b/src/EnergyPlus/ChillerElectricEIR.hh index 2a0ac67598c..09770e9f825 100644 --- a/src/EnergyPlus/ChillerElectricEIR.hh +++ b/src/EnergyPlus/ChillerElectricEIR.hh @@ -203,8 +203,7 @@ namespace ChillerElectricEIR { Real64 CondenserFanEnergyConsumption; // reporting: Air-cooled condenser fan energy [J] Real64 BasinHeaterConsumption; // Basin heater energy consumption (J) bool IPLVFlag; - bool EquipFlowCtrl; - bool oneTimeInit; + int EquipFlowCtrl; // Default Constructor ElectricEIRChillerSpecs() From 949e77d194e32d7fe164b88c4e29a460fd093a75 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 17 Jan 2020 16:41:25 -0600 Subject: [PATCH 27/41] Clean up module level vars --- src/EnergyPlus/ChillerExhaustAbsorption.cc | 82 ++++--------------- src/EnergyPlus/ChillerExhaustAbsorption.hh | 10 ++- .../unit/ChillerExhaustAbsorption.unit.cc | 2 +- 3 files changed, 23 insertions(+), 71 deletions(-) diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index dad2be122d5..de13fb1bcf2 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -114,32 +114,10 @@ namespace ChillerExhaustAbsorption { // Development of the original(GasAbsoptionChiller) module was funded by the Gas Research Institute. // (Please see copyright and disclaimer information at end of module) - // MODULE VARIABLE DECLARATIONS: - int NumExhaustAbsorbers(0); // number of Absorption Chillers specified in input - - // This type holds the output from the algorithm i.e., the Report Variables - - Array1D_bool CheckEquipName; - // Object Data Array1D ExhaustAbsorber; // dimension to number of machines Array1D ExhaustAbsorberReport; - - // Functions - namespace { - // These were static variables within different functions. They were pulled out into the namespace - // to facilitate easier unit testing of those functions. - // These are purposefully not in the header file as an extern variable. No one outside of this should - // use these. They are cleared by clear_state() for use by unit tests, but normal simulations should be unaffected. - // This is purposefully in an anonymous namespace so nothing outside this implementation file can use it. - Real64 Sim_HeatCap(0.0); // W - nominal heating capacity - bool Sim_GetInput(true); // then TRUE, calls subroutine to read input file. - bool Init_MyOneTimeFlag(true); - Array1D_bool Init_MyEnvrnFlag; - Array1D_bool Init_MyPlantScanFlag; - Real64 Calc_oldCondSupplyTemp(0.0); // save the last iteration value of leaving condenser water temperature - bool Get_ErrorsFound(false); - } // namespace + bool Sim_GetInput(true); // then TRUE, calls subroutine to read input file. void SimExhaustAbsorber(std::string const &EP_UNUSED(AbsorberType), // type of Absorber std::string const &AbsorberName, // user specified name of Absorber @@ -184,17 +162,6 @@ namespace ChillerExhaustAbsorption { CompIndex = ChillNum; } else { ChillNum = CompIndex; - if (ChillNum > NumExhaustAbsorbers || ChillNum < 1) { - ShowFatalError("SimExhaustAbsorber: Invalid CompIndex passed=" + General::TrimSigDigits(ChillNum) + - ", Number of Units=" + General::TrimSigDigits(NumExhaustAbsorbers) + ", Entered Unit name=" + AbsorberName); - } - if (CheckEquipName(ChillNum)) { - if (AbsorberName != ExhaustAbsorber(ChillNum).Name) { - ShowFatalError("SimExhaustAbsorber: Invalid CompIndex passed=" + General::TrimSigDigits(ChillNum) + ", Unit name=" + AbsorberName + - ", stored Unit Name for that index=" + ExhaustAbsorber(ChillNum).Name); - } - CheckEquipName(ChillNum) = false; - } } // Check that this is a valid call @@ -209,12 +176,11 @@ namespace ChillerExhaustAbsorption { MaxCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).MaxPartLoadRat; OptCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).OptPartLoadRat; } else if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).HeatReturnNodeNum) { // Operate as heater - Sim_HeatCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).NomHeatCoolRatio; + Real64 Sim_HeatCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).NomHeatCoolRatio; // W - nominal heating capacity MinCap = Sim_HeatCap * ExhaustAbsorber(ChillNum).MinPartLoadRat; MaxCap = Sim_HeatCap * ExhaustAbsorber(ChillNum).MaxPartLoadRat; OptCap = Sim_HeatCap * ExhaustAbsorber(ChillNum).OptPartLoadRat; } else if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).CondReturnNodeNum) { // called from condenser loop - Sim_HeatCap = 0.0; MinCap = 0.0; MaxCap = 0.0; OptCap = 0.0; @@ -296,10 +262,11 @@ namespace ChillerExhaustAbsorption { int IOStat; // IO Status when calling get input subroutine std::string ChillerName; bool Okay; + bool Get_ErrorsFound(false); // FLOW cCurrentModuleObject = "ChillerHeater:Absorption:DoubleEffect"; - NumExhaustAbsorbers = inputProcessor->getNumObjectsFound(cCurrentModuleObject); + int NumExhaustAbsorbers = inputProcessor->getNumObjectsFound(cCurrentModuleObject); if (NumExhaustAbsorbers <= 0) { ShowSevereError("No " + cCurrentModuleObject + " equipment found in input file"); @@ -312,7 +279,6 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorber.allocate(NumExhaustAbsorbers); ExhaustAbsorberReport.allocate(NumExhaustAbsorbers); - CheckEquipName.dimension(NumExhaustAbsorbers, true); // LOAD ARRAYS @@ -767,16 +733,8 @@ namespace ChillerExhaustAbsorption { Real64 rho; // local fluid density Real64 mdot; // lcoal fluid mass flow rate - // Do the one time initializations - if (Init_MyOneTimeFlag) { - Init_MyPlantScanFlag.allocate(NumExhaustAbsorbers); - Init_MyEnvrnFlag.dimension(NumExhaustAbsorbers, true); - Init_MyOneTimeFlag = false; - Init_MyPlantScanFlag = true; - } - // Init more variables - if (Init_MyPlantScanFlag(ChillNum)) { + if (ExhaustAbsorber(ChillNum).plantScanInit) { // Locate the chillers on the plant loops for later usage errFlag = false; PlantUtilities::ScanPlantLoopsForObject(ExhaustAbsorber(ChillNum).Name, @@ -910,7 +868,7 @@ namespace ChillerExhaustAbsorption { DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPointLo = DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } - Init_MyPlantScanFlag(ChillNum) = false; + ExhaustAbsorber(ChillNum).plantScanInit = false; } CondInletNode = ExhaustAbsorber(ChillNum).CondReturnNodeNum; @@ -918,7 +876,7 @@ namespace ChillerExhaustAbsorption { HeatInletNode = ExhaustAbsorber(ChillNum).HeatReturnNodeNum; HeatOutletNode = ExhaustAbsorber(ChillNum).HeatSupplyNodeNum; - if (Init_MyEnvrnFlag(ChillNum) && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (ExhaustAbsorber(ChillNum).envrnInit && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { if (ExhaustAbsorber(ChillNum).isWaterCooled) { // init max available condenser water flow rate @@ -980,11 +938,11 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorber(ChillNum).CWBranchNum, ExhaustAbsorber(ChillNum).CWCompNum); - Init_MyEnvrnFlag(ChillNum) = false; + ExhaustAbsorber(ChillNum).envrnInit = false; } if (!DataGlobals::BeginEnvrnFlag) { - Init_MyEnvrnFlag(ChillNum) = true; + ExhaustAbsorber(ChillNum).envrnInit = true; } // this component model works off setpoints on the leaving node @@ -1004,7 +962,7 @@ namespace ChillerExhaustAbsorption { } if ((ExhaustAbsorber(ChillNum).isWaterCooled) && ((ExhaustAbsorber(ChillNum).InHeatingMode) || (ExhaustAbsorber(ChillNum).InCoolingMode)) && - (!Init_MyPlantScanFlag(ChillNum))) { + (!ExhaustAbsorber(ChillNum).plantScanInit)) { mdot = ExhaustAbsorber(ChillNum).DesCondMassFlowRate; PlantUtilities::SetComponentFlowRate(mdot, @@ -1579,10 +1537,10 @@ namespace ChillerExhaustAbsorption { if (lIsEnterCondensTemp) { calcCondTemp = lCondReturnTemp; } else { - if (Calc_oldCondSupplyTemp == 0) { - Calc_oldCondSupplyTemp = lCondReturnTemp + 8.0; // if not previously estimated assume 8C greater than return + if (ExhaustAbsorber(ChillNum).oldCondSupplyTemp == 0) { + ExhaustAbsorber(ChillNum).oldCondSupplyTemp = lCondReturnTemp + 8.0; // if not previously estimated assume 8C greater than return } - calcCondTemp = Calc_oldCondSupplyTemp; + calcCondTemp = ExhaustAbsorber(ChillNum).oldCondSupplyTemp; } // Set mass flow rates lCondWaterMassFlowRate = ExhaustAbsorber(ChillNum).DesCondMassFlowRate; @@ -1791,7 +1749,7 @@ namespace ChillerExhaustAbsorption { // save the condenser water supply temperature for next iteration if that is used in lookup // and if capacity is large enough error than report problem - Calc_oldCondSupplyTemp = lCondSupplyTemp; + ExhaustAbsorber(ChillNum).oldCondSupplyTemp = lCondSupplyTemp; if (!lIsEnterCondensTemp) { // calculate the fraction of the estimated error between the capacity based on the previous // iteration's value of condenser supply temperature and the actual calculated condenser supply @@ -2187,18 +2145,10 @@ namespace ChillerExhaustAbsorption { void clear_state() { - NumExhaustAbsorbers = 0; - CheckEquipName.deallocate(); ExhaustAbsorber.deallocate(); - ExhaustAbsorberReport.deallocate(); - - Sim_HeatCap = 0.0; Sim_GetInput = true; - Init_MyOneTimeFlag = true; - Init_MyEnvrnFlag.deallocate(); - Init_MyPlantScanFlag.deallocate(); - Calc_oldCondSupplyTemp = 0.0; // save the last iteration value of leaving condenser water temperature - Get_ErrorsFound = false; + + ExhaustAbsorberReport.deallocate(); } } // namespace ChillerExhaustAbsorption diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.hh b/src/EnergyPlus/ChillerExhaustAbsorption.hh index 662b7eee33a..b30e221fb52 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.hh +++ b/src/EnergyPlus/ChillerExhaustAbsorption.hh @@ -59,9 +59,6 @@ namespace EnergyPlus { namespace ChillerExhaustAbsorption { - extern int NumExhaustAbsorbers; // number of Absorption Chillers specified in input - extern Array1D_bool CheckEquipName; - struct ExhaustAbsorberSpecs { // Members @@ -142,6 +139,10 @@ namespace ChillerExhaustAbsorption { int ExhTempLTAbsLeavingHeatingTempIndex; // index for exhaust potentail less than thermal energy needed during heating std::string TypeOf; // Generator type std::string ExhuastSourceName; // Generator type Name + bool oneTimeInit; + bool envrnInit; + bool plantScanInit; + Real64 oldCondSupplyTemp; // save the last iteration value of leaving condenser water temperature // Default Constructor ExhaustAbsorberSpecs() @@ -156,7 +157,8 @@ namespace ChillerExhaustAbsorption { isWaterCooled(false), CHWLowLimitTemp(0.0), ExhaustAirInletNodeNum(0), DesCondMassFlowRate(0.0), DesHeatMassFlowRate(0.0), DesEvapMassFlowRate(0.0), DeltaTempCoolErrCount(0), DeltaTempHeatErrCount(0), CondErrCount(0), PossibleSubcooling(false), CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), HWLoopNum(0), HWLoopSideNum(0), - HWBranchNum(0), HWCompNum(0), CompType_Num(0), ExhTempLTAbsLeavingTempIndex(0), ExhTempLTAbsLeavingHeatingTempIndex(0) + HWBranchNum(0), HWCompNum(0), CompType_Num(0), ExhTempLTAbsLeavingTempIndex(0), ExhTempLTAbsLeavingHeatingTempIndex(0), + oneTimeInit(true), envrnInit(true), plantScanInit(true), oldCondSupplyTemp(0.0) { } }; diff --git a/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc index 3e9b5d378e4..107fc242305 100644 --- a/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc @@ -303,7 +303,7 @@ TEST_F(ExhAbsorptionFixture, ExhAbsorption_GetInput_Test) compare_err_stream(""); - EXPECT_EQ(1, NumExhaustAbsorbers); + EXPECT_EQ(1u, ExhaustAbsorber.size()); EXPECT_EQ("EXH CHILLER", ExhaustAbsorber(1).Name); EXPECT_EQ(100000., ExhaustAbsorber(1).NomCoolingCap); From 713e676eb28b8103b49ce3faa3dfb75d299bf06c Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 17 Jan 2020 16:44:15 -0600 Subject: [PATCH 28/41] Remove extra report struct --- src/EnergyPlus/ChillerExhaustAbsorption.cc | 205 ++++++++++----------- src/EnergyPlus/ChillerExhaustAbsorption.hh | 41 ++--- 2 files changed, 116 insertions(+), 130 deletions(-) diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index de13fb1bcf2..a1e782352b7 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -116,7 +116,6 @@ namespace ChillerExhaustAbsorption { // Object Data Array1D ExhaustAbsorber; // dimension to number of machines - Array1D ExhaustAbsorberReport; bool Sim_GetInput(true); // then TRUE, calls subroutine to read input file. void SimExhaustAbsorber(std::string const &EP_UNUSED(AbsorberType), // type of Absorber @@ -217,10 +216,10 @@ namespace ChillerExhaustAbsorption { DataPlant::TypeOf_Chiller_ExhFiredAbsorption, ExhaustAbsorber(ChillNum).CondReturnNodeNum, ExhaustAbsorber(ChillNum).CondSupplyNodeNum, - ExhaustAbsorberReport(ChillNum).TowerLoad, - ExhaustAbsorberReport(ChillNum).CondReturnTemp, - ExhaustAbsorberReport(ChillNum).CondSupplyTemp, - ExhaustAbsorberReport(ChillNum).CondWaterFlowRate, + ExhaustAbsorber(ChillNum).TowerLoad, + ExhaustAbsorber(ChillNum).CondReturnTemp, + ExhaustAbsorber(ChillNum).CondSupplyTemp, + ExhaustAbsorber(ChillNum).CondWaterFlowRate, FirstIteration); } @@ -278,8 +277,6 @@ namespace ChillerExhaustAbsorption { // ALLOCATE ARRAYS ExhaustAbsorber.allocate(NumExhaustAbsorbers); - ExhaustAbsorberReport.allocate(NumExhaustAbsorbers); - // LOAD ARRAYS for (AbsorberNum = 1; AbsorberNum <= NumExhaustAbsorbers; ++AbsorberNum) { @@ -455,13 +452,13 @@ namespace ChillerExhaustAbsorption { SetupOutputVariable("Chiller Heater Evaporator Cooling Rate", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).CoolingLoad, + ExhaustAbsorber(AbsorberNum).CoolingLoad, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Evaporator Cooling Energy", OutputProcessor::Unit::J, - ExhaustAbsorberReport(AbsorberNum).CoolingEnergy, + ExhaustAbsorber(AbsorberNum).CoolingEnergy, "System", "Sum", ChillerName, @@ -473,13 +470,13 @@ namespace ChillerExhaustAbsorption { SetupOutputVariable("Chiller Heater Heating Rate", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).HeatingLoad, + ExhaustAbsorber(AbsorberNum).HeatingLoad, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Heating Energy", OutputProcessor::Unit::J, - ExhaustAbsorberReport(AbsorberNum).HeatingEnergy, + ExhaustAbsorber(AbsorberNum).HeatingEnergy, "System", "Sum", ChillerName, @@ -491,13 +488,13 @@ namespace ChillerExhaustAbsorption { SetupOutputVariable("Chiller Heater Condenser Heat Transfer Rate", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).TowerLoad, + ExhaustAbsorber(AbsorberNum).TowerLoad, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Condenser Heat Transfer Energy", OutputProcessor::Unit::J, - ExhaustAbsorberReport(AbsorberNum).TowerEnergy, + ExhaustAbsorber(AbsorberNum).TowerEnergy, "System", "Sum", ChillerName, @@ -509,34 +506,34 @@ namespace ChillerExhaustAbsorption { SetupOutputVariable("Chiller Heater Cooling Source Heat COP", OutputProcessor::Unit::W_W, - ExhaustAbsorberReport(AbsorberNum).ThermalEnergyCOP, + ExhaustAbsorber(AbsorberNum).ThermalEnergyCOP, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Electric Power", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).ElectricPower, + ExhaustAbsorber(AbsorberNum).ElectricPower, "System", "Average", ChillerName); // Do not include this on meters, this would duplicate the cool electric and heat electric SetupOutputVariable("Chiller Heater Electric Energy", OutputProcessor::Unit::J, - ExhaustAbsorberReport(AbsorberNum).ElectricEnergy, + ExhaustAbsorber(AbsorberNum).ElectricEnergy, "System", "Sum", ChillerName); SetupOutputVariable("Chiller Heater Cooling Electric Power", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).CoolElectricPower, + ExhaustAbsorber(AbsorberNum).CoolElectricPower, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Cooling Electric Energy", OutputProcessor::Unit::J, - ExhaustAbsorberReport(AbsorberNum).CoolElectricEnergy, + ExhaustAbsorber(AbsorberNum).CoolElectricEnergy, "System", "Sum", ChillerName, @@ -548,13 +545,13 @@ namespace ChillerExhaustAbsorption { SetupOutputVariable("Chiller Heater Heating Electric Power", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).HeatElectricPower, + ExhaustAbsorber(AbsorberNum).HeatElectricPower, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Heating Electric Energy", OutputProcessor::Unit::J, - ExhaustAbsorberReport(AbsorberNum).HeatElectricEnergy, + ExhaustAbsorber(AbsorberNum).HeatElectricEnergy, "System", "Sum", ChillerName, @@ -566,19 +563,19 @@ namespace ChillerExhaustAbsorption { SetupOutputVariable("Chiller Heater Evaporator Inlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorberReport(AbsorberNum).ChillReturnTemp, + ExhaustAbsorber(AbsorberNum).ChillReturnTemp, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Evaporator Outlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorberReport(AbsorberNum).ChillSupplyTemp, + ExhaustAbsorber(AbsorberNum).ChillSupplyTemp, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Evaporator Mass Flow Rate", OutputProcessor::Unit::kg_s, - ExhaustAbsorberReport(AbsorberNum).ChillWaterFlowRate, + ExhaustAbsorber(AbsorberNum).ChillWaterFlowRate, "System", "Average", ChillerName); @@ -586,26 +583,26 @@ namespace ChillerExhaustAbsorption { if (ExhaustAbsorber(AbsorberNum).isWaterCooled) { SetupOutputVariable("Chiller Heater Condenser Inlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorberReport(AbsorberNum).CondReturnTemp, + ExhaustAbsorber(AbsorberNum).CondReturnTemp, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Condenser Outlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorberReport(AbsorberNum).CondSupplyTemp, + ExhaustAbsorber(AbsorberNum).CondSupplyTemp, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, - ExhaustAbsorberReport(AbsorberNum).CondWaterFlowRate, + ExhaustAbsorber(AbsorberNum).CondWaterFlowRate, "System", "Average", ChillerName); } else { SetupOutputVariable("Chiller Heater Condenser Inlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorberReport(AbsorberNum).CondReturnTemp, + ExhaustAbsorber(AbsorberNum).CondReturnTemp, "System", "Average", ChillerName); @@ -613,90 +610,90 @@ namespace ChillerExhaustAbsorption { SetupOutputVariable("Chiller Heater Heating Inlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorberReport(AbsorberNum).HotWaterReturnTemp, + ExhaustAbsorber(AbsorberNum).HotWaterReturnTemp, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Heating Outlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorberReport(AbsorberNum).HotWaterSupplyTemp, + ExhaustAbsorber(AbsorberNum).HotWaterSupplyTemp, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Heating Mass Flow Rate", OutputProcessor::Unit::kg_s, - ExhaustAbsorberReport(AbsorberNum).HotWaterFlowRate, + ExhaustAbsorber(AbsorberNum).HotWaterFlowRate, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Cooling Part Load Ratio", OutputProcessor::Unit::None, - ExhaustAbsorberReport(AbsorberNum).CoolPartLoadRatio, + ExhaustAbsorber(AbsorberNum).CoolPartLoadRatio, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Maximum Cooling Rate", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).CoolingCapacity, + ExhaustAbsorber(AbsorberNum).CoolingCapacity, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Heating Part Load Ratio", OutputProcessor::Unit::None, - ExhaustAbsorberReport(AbsorberNum).HeatPartLoadRatio, + ExhaustAbsorber(AbsorberNum).HeatPartLoadRatio, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Maximum Heating Rate", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).HeatingCapacity, + ExhaustAbsorber(AbsorberNum).HeatingCapacity, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Runtime Fraction", OutputProcessor::Unit::None, - ExhaustAbsorberReport(AbsorberNum).FractionOfPeriodRunning, + ExhaustAbsorber(AbsorberNum).FractionOfPeriodRunning, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Source Exhaust Inlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorberReport(AbsorberNum).ExhaustInTemp, + ExhaustAbsorber(AbsorberNum).ExhaustInTemp, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Source Exhaust Inlet Mass Flow Rate", OutputProcessor::Unit::kg_s, - ExhaustAbsorberReport(AbsorberNum).ExhaustInFlow, + ExhaustAbsorber(AbsorberNum).ExhaustInFlow, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Heating Heat Recovery Potential Rate", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).ExhHeatRecPotentialHeat, + ExhaustAbsorber(AbsorberNum).ExhHeatRecPotentialHeat, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Cooling Heat Recovery Potential Rate", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).ExhHeatRecPotentialCool, + ExhaustAbsorber(AbsorberNum).ExhHeatRecPotentialCool, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Cooling Source Heat Transfer Rate", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).CoolThermalEnergyUseRate, + ExhaustAbsorber(AbsorberNum).CoolThermalEnergyUseRate, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Heating Source Heat Transfer Rate", OutputProcessor::Unit::W, - ExhaustAbsorberReport(AbsorberNum).HeatThermalEnergyUseRate, + ExhaustAbsorber(AbsorberNum).HeatThermalEnergyUseRate, "System", "Average", ChillerName); @@ -1474,9 +1471,9 @@ namespace ChillerExhaustAbsorption { lIsEnterCondensTemp = ExhaustAbsorber(ChillNum).isEnterCondensTemp; lIsWaterCooled = ExhaustAbsorber(ChillNum).isWaterCooled; lCHWLowLimitTemp = ExhaustAbsorber(ChillNum).CHWLowLimitTemp; - lHeatElectricPower = ExhaustAbsorberReport(ChillNum).HeatElectricPower; - lHeatThermalEnergyUseRate = ExhaustAbsorberReport(ChillNum).HeatThermalEnergyUseRate; - lHeatPartLoadRatio = ExhaustAbsorberReport(ChillNum).HeatPartLoadRatio; + lHeatElectricPower = ExhaustAbsorber(ChillNum).HeatElectricPower; + lHeatThermalEnergyUseRate = ExhaustAbsorber(ChillNum).HeatThermalEnergyUseRate; + lHeatPartLoadRatio = ExhaustAbsorber(ChillNum).HeatPartLoadRatio; // initialize entering conditions lChillReturnTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp; @@ -1769,26 +1766,26 @@ namespace ChillerExhaustAbsorption { } } // IF(MyLoad>=0 .OR. .NOT. RunFlag) // Write into the Report Variables except for nodes - ExhaustAbsorberReport(ChillNum).CoolingLoad = lCoolingLoad; - ExhaustAbsorberReport(ChillNum).TowerLoad = lTowerLoad; - ExhaustAbsorberReport(ChillNum).CoolThermalEnergyUseRate = lCoolThermalEnergyUseRate; - ExhaustAbsorberReport(ChillNum).CoolElectricPower = lCoolElectricPower; - ExhaustAbsorberReport(ChillNum).CondReturnTemp = lCondReturnTemp; - ExhaustAbsorberReport(ChillNum).ChillReturnTemp = lChillReturnTemp; - ExhaustAbsorberReport(ChillNum).CondSupplyTemp = lCondSupplyTemp; - ExhaustAbsorberReport(ChillNum).ChillSupplyTemp = lChillSupplyTemp; - ExhaustAbsorberReport(ChillNum).ChillWaterFlowRate = lChillWaterMassFlowRate; - ExhaustAbsorberReport(ChillNum).CondWaterFlowRate = lCondWaterMassFlowRate; - ExhaustAbsorberReport(ChillNum).CoolPartLoadRatio = lCoolPartLoadRatio; - ExhaustAbsorberReport(ChillNum).CoolingCapacity = lAvailableCoolingCapacity; - ExhaustAbsorberReport(ChillNum).FractionOfPeriodRunning = lFractionOfPeriodRunning; - ExhaustAbsorberReport(ChillNum).ExhaustInTemp = lExhaustInTemp; - ExhaustAbsorberReport(ChillNum).ExhaustInFlow = lExhaustInFlow; - ExhaustAbsorberReport(ChillNum).ExhHeatRecPotentialCool = lExhHeatRecPotentialCool; + ExhaustAbsorber(ChillNum).CoolingLoad = lCoolingLoad; + ExhaustAbsorber(ChillNum).TowerLoad = lTowerLoad; + ExhaustAbsorber(ChillNum).CoolThermalEnergyUseRate = lCoolThermalEnergyUseRate; + ExhaustAbsorber(ChillNum).CoolElectricPower = lCoolElectricPower; + ExhaustAbsorber(ChillNum).CondReturnTemp = lCondReturnTemp; + ExhaustAbsorber(ChillNum).ChillReturnTemp = lChillReturnTemp; + ExhaustAbsorber(ChillNum).CondSupplyTemp = lCondSupplyTemp; + ExhaustAbsorber(ChillNum).ChillSupplyTemp = lChillSupplyTemp; + ExhaustAbsorber(ChillNum).ChillWaterFlowRate = lChillWaterMassFlowRate; + ExhaustAbsorber(ChillNum).CondWaterFlowRate = lCondWaterMassFlowRate; + ExhaustAbsorber(ChillNum).CoolPartLoadRatio = lCoolPartLoadRatio; + ExhaustAbsorber(ChillNum).CoolingCapacity = lAvailableCoolingCapacity; + ExhaustAbsorber(ChillNum).FractionOfPeriodRunning = lFractionOfPeriodRunning; + ExhaustAbsorber(ChillNum).ExhaustInTemp = lExhaustInTemp; + ExhaustAbsorber(ChillNum).ExhaustInFlow = lExhaustInFlow; + ExhaustAbsorber(ChillNum).ExhHeatRecPotentialCool = lExhHeatRecPotentialCool; // write the combined heating and cooling ThermalEnergy used and electric used - ExhaustAbsorberReport(ChillNum).ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate; - ExhaustAbsorberReport(ChillNum).ElectricPower = lCoolElectricPower + lHeatElectricPower; + ExhaustAbsorber(ChillNum).ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate; + ExhaustAbsorber(ChillNum).ElectricPower = lCoolElectricPower + lHeatElectricPower; } void CalcExhaustAbsorberHeaterModel(int &ChillNum, // Absorber number @@ -1888,9 +1885,9 @@ namespace ChillerExhaustAbsorption { Cp_HW = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); - lCoolElectricPower = ExhaustAbsorberReport(ChillNum).CoolElectricPower; - lCoolThermalEnergyUseRate = ExhaustAbsorberReport(ChillNum).CoolThermalEnergyUseRate; - lCoolPartLoadRatio = ExhaustAbsorberReport(ChillNum).CoolPartLoadRatio; + lCoolElectricPower = ExhaustAbsorber(ChillNum).CoolElectricPower; + lCoolThermalEnergyUseRate = ExhaustAbsorber(ChillNum).CoolThermalEnergyUseRate; + lCoolPartLoadRatio = ExhaustAbsorber(ChillNum).CoolPartLoadRatio; // initialize entering conditions lHotWaterReturnTemp = DataLoopNode::Node(lHeatReturnNodeNum).Temp; @@ -1918,11 +1915,11 @@ namespace ChillerExhaustAbsorption { // Determine available heating capacity using the current cooling load lAvailableHeatingCapacity = ExhaustAbsorber(ChillNum).NomHeatCoolRatio * ExhaustAbsorber(ChillNum).NomCoolingCap * - CurveManager::CurveValue(lHeatCapFCoolCurve, (ExhaustAbsorberReport(ChillNum).CoolingLoad / ExhaustAbsorber(ChillNum).NomCoolingCap)); + CurveManager::CurveValue(lHeatCapFCoolCurve, (ExhaustAbsorber(ChillNum).CoolingLoad / ExhaustAbsorber(ChillNum).NomCoolingCap)); // Calculate current load for heating - MyLoad = sign(max(std::abs(MyLoad), ExhaustAbsorberReport(ChillNum).HeatingCapacity * lMinPartLoadRat), MyLoad); - MyLoad = sign(min(std::abs(MyLoad), ExhaustAbsorberReport(ChillNum).HeatingCapacity * lMaxPartLoadRat), MyLoad); + MyLoad = sign(max(std::abs(MyLoad), ExhaustAbsorber(ChillNum).HeatingCapacity * lMinPartLoadRat), MyLoad); + MyLoad = sign(min(std::abs(MyLoad), ExhaustAbsorber(ChillNum).HeatingCapacity * lMaxPartLoadRat), MyLoad); // Determine the following variables depending on if the flow has been set in // the nodes (flowlock=1 to 2) or if the amount of load is still be determined (flowlock=0) @@ -2032,22 +2029,22 @@ namespace ChillerExhaustAbsorption { } // IF(MyLoad==0 .OR. .NOT. RunFlag) // Write into the Report Variables except for nodes - ExhaustAbsorberReport(ChillNum).HeatingLoad = lHeatingLoad; - ExhaustAbsorberReport(ChillNum).HeatThermalEnergyUseRate = lHeatThermalEnergyUseRate; - ExhaustAbsorberReport(ChillNum).HeatElectricPower = lHeatElectricPower; - ExhaustAbsorberReport(ChillNum).HotWaterReturnTemp = lHotWaterReturnTemp; - ExhaustAbsorberReport(ChillNum).HotWaterSupplyTemp = lHotWaterSupplyTemp; - ExhaustAbsorberReport(ChillNum).HotWaterFlowRate = lHotWaterMassFlowRate; - ExhaustAbsorberReport(ChillNum).HeatPartLoadRatio = lHeatPartLoadRatio; - ExhaustAbsorberReport(ChillNum).HeatingCapacity = lAvailableHeatingCapacity; - ExhaustAbsorberReport(ChillNum).FractionOfPeriodRunning = lFractionOfPeriodRunning; + ExhaustAbsorber(ChillNum).HeatingLoad = lHeatingLoad; + ExhaustAbsorber(ChillNum).HeatThermalEnergyUseRate = lHeatThermalEnergyUseRate; + ExhaustAbsorber(ChillNum).HeatElectricPower = lHeatElectricPower; + ExhaustAbsorber(ChillNum).HotWaterReturnTemp = lHotWaterReturnTemp; + ExhaustAbsorber(ChillNum).HotWaterSupplyTemp = lHotWaterSupplyTemp; + ExhaustAbsorber(ChillNum).HotWaterFlowRate = lHotWaterMassFlowRate; + ExhaustAbsorber(ChillNum).HeatPartLoadRatio = lHeatPartLoadRatio; + ExhaustAbsorber(ChillNum).HeatingCapacity = lAvailableHeatingCapacity; + ExhaustAbsorber(ChillNum).FractionOfPeriodRunning = lFractionOfPeriodRunning; // write the combined heating and cooling ThermalEnergy used and electric used - ExhaustAbsorberReport(ChillNum).ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate; - ExhaustAbsorberReport(ChillNum).ElectricPower = lCoolElectricPower + lHeatElectricPower; - ExhaustAbsorberReport(ChillNum).ExhaustInTemp = lExhaustInTemp; - ExhaustAbsorberReport(ChillNum).ExhaustInFlow = lExhaustInFlow; - ExhaustAbsorberReport(ChillNum).ExhHeatRecPotentialHeat = lExhHeatRecPotentialHeat; + ExhaustAbsorber(ChillNum).ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate; + ExhaustAbsorber(ChillNum).ElectricPower = lCoolElectricPower + lHeatElectricPower; + ExhaustAbsorber(ChillNum).ExhaustInTemp = lExhaustInTemp; + ExhaustAbsorber(ChillNum).ExhaustInFlow = lExhaustInFlow; + ExhaustAbsorber(ChillNum).ExhHeatRecPotentialHeat = lExhHeatRecPotentialHeat; } void UpdateExhaustAbsorberCoolRecords(Real64 const MyLoad, // current load @@ -2082,29 +2079,29 @@ namespace ChillerExhaustAbsorption { DataLoopNode::Node(lCondSupplyNodeNum).Temp = DataLoopNode::Node(lCondReturnNodeNum).Temp; } DataLoopNode::Node(lExhaustAirInletNodeNum).Temp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp; - DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorberReport(ChillNum).ExhaustInFlow; + DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorber(ChillNum).ExhaustInFlow; } else { - DataLoopNode::Node(lChillSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).ChillSupplyTemp; + DataLoopNode::Node(lChillSupplyNodeNum).Temp = ExhaustAbsorber(ChillNum).ChillSupplyTemp; if (ExhaustAbsorber(ChillNum).isWaterCooled) { - DataLoopNode::Node(lCondSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).CondSupplyTemp; + DataLoopNode::Node(lCondSupplyNodeNum).Temp = ExhaustAbsorber(ChillNum).CondSupplyTemp; } - DataLoopNode::Node(lExhaustAirInletNodeNum).Temp = ExhaustAbsorberReport(ChillNum).ExhaustInTemp; - DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorberReport(ChillNum).ExhaustInFlow; + DataLoopNode::Node(lExhaustAirInletNodeNum).Temp = ExhaustAbsorber(ChillNum).ExhaustInTemp; + DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorber(ChillNum).ExhaustInFlow; } // convert power to energy and instantaneous use to use over the time step RptConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ExhaustAbsorberReport(ChillNum).CoolingEnergy = ExhaustAbsorberReport(ChillNum).CoolingLoad * RptConstant; - ExhaustAbsorberReport(ChillNum).TowerEnergy = ExhaustAbsorberReport(ChillNum).TowerLoad * RptConstant; - ExhaustAbsorberReport(ChillNum).ThermalEnergy = ExhaustAbsorberReport(ChillNum).ThermalEnergyUseRate * RptConstant; - ExhaustAbsorberReport(ChillNum).CoolThermalEnergy = ExhaustAbsorberReport(ChillNum).CoolThermalEnergyUseRate * RptConstant; - ExhaustAbsorberReport(ChillNum).ElectricEnergy = ExhaustAbsorberReport(ChillNum).ElectricPower * RptConstant; - ExhaustAbsorberReport(ChillNum).CoolElectricEnergy = ExhaustAbsorberReport(ChillNum).CoolElectricPower * RptConstant; - if (ExhaustAbsorberReport(ChillNum).CoolThermalEnergyUseRate != 0.0) { - ExhaustAbsorberReport(ChillNum).ThermalEnergyCOP = - ExhaustAbsorberReport(ChillNum).CoolingLoad / ExhaustAbsorberReport(ChillNum).CoolThermalEnergyUseRate; + ExhaustAbsorber(ChillNum).CoolingEnergy = ExhaustAbsorber(ChillNum).CoolingLoad * RptConstant; + ExhaustAbsorber(ChillNum).TowerEnergy = ExhaustAbsorber(ChillNum).TowerLoad * RptConstant; + ExhaustAbsorber(ChillNum).ThermalEnergy = ExhaustAbsorber(ChillNum).ThermalEnergyUseRate * RptConstant; + ExhaustAbsorber(ChillNum).CoolThermalEnergy = ExhaustAbsorber(ChillNum).CoolThermalEnergyUseRate * RptConstant; + ExhaustAbsorber(ChillNum).ElectricEnergy = ExhaustAbsorber(ChillNum).ElectricPower * RptConstant; + ExhaustAbsorber(ChillNum).CoolElectricEnergy = ExhaustAbsorber(ChillNum).CoolElectricPower * RptConstant; + if (ExhaustAbsorber(ChillNum).CoolThermalEnergyUseRate != 0.0) { + ExhaustAbsorber(ChillNum).ThermalEnergyCOP = + ExhaustAbsorber(ChillNum).CoolingLoad / ExhaustAbsorber(ChillNum).CoolThermalEnergyUseRate; } else { - ExhaustAbsorberReport(ChillNum).ThermalEnergyCOP = 0.0; + ExhaustAbsorber(ChillNum).ThermalEnergyCOP = 0.0; } } @@ -2131,24 +2128,22 @@ namespace ChillerExhaustAbsorption { if (MyLoad == 0 || !RunFlag) { DataLoopNode::Node(lHeatSupplyNodeNum).Temp = DataLoopNode::Node(lHeatReturnNodeNum).Temp; } else { - DataLoopNode::Node(lHeatSupplyNodeNum).Temp = ExhaustAbsorberReport(ChillNum).HotWaterSupplyTemp; + DataLoopNode::Node(lHeatSupplyNodeNum).Temp = ExhaustAbsorber(ChillNum).HotWaterSupplyTemp; } // convert power to energy and instantaneous use to use over the time step RptConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ExhaustAbsorberReport(ChillNum).HeatingEnergy = ExhaustAbsorberReport(ChillNum).HeatingLoad * RptConstant; - ExhaustAbsorberReport(ChillNum).ThermalEnergy = ExhaustAbsorberReport(ChillNum).ThermalEnergyUseRate * RptConstant; - ExhaustAbsorberReport(ChillNum).HeatThermalEnergy = ExhaustAbsorberReport(ChillNum).HeatThermalEnergyUseRate * RptConstant; - ExhaustAbsorberReport(ChillNum).ElectricEnergy = ExhaustAbsorberReport(ChillNum).ElectricPower * RptConstant; - ExhaustAbsorberReport(ChillNum).HeatElectricEnergy = ExhaustAbsorberReport(ChillNum).HeatElectricPower * RptConstant; + ExhaustAbsorber(ChillNum).HeatingEnergy = ExhaustAbsorber(ChillNum).HeatingLoad * RptConstant; + ExhaustAbsorber(ChillNum).ThermalEnergy = ExhaustAbsorber(ChillNum).ThermalEnergyUseRate * RptConstant; + ExhaustAbsorber(ChillNum).HeatThermalEnergy = ExhaustAbsorber(ChillNum).HeatThermalEnergyUseRate * RptConstant; + ExhaustAbsorber(ChillNum).ElectricEnergy = ExhaustAbsorber(ChillNum).ElectricPower * RptConstant; + ExhaustAbsorber(ChillNum).HeatElectricEnergy = ExhaustAbsorber(ChillNum).HeatElectricPower * RptConstant; } void clear_state() { ExhaustAbsorber.deallocate(); Sim_GetInput = true; - - ExhaustAbsorberReport.deallocate(); } } // namespace ChillerExhaustAbsorption diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.hh b/src/EnergyPlus/ChillerExhaustAbsorption.hh index b30e221fb52..62f6bf074da 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.hh +++ b/src/EnergyPlus/ChillerExhaustAbsorption.hh @@ -144,28 +144,7 @@ namespace ChillerExhaustAbsorption { bool plantScanInit; Real64 oldCondSupplyTemp; // save the last iteration value of leaving condenser water temperature - // Default Constructor - ExhaustAbsorberSpecs() - : Available(false), ON(false), InCoolingMode(false), InHeatingMode(false), NomCoolingCap(0.0), NomCoolingCapWasAutoSized(false), - NomHeatCoolRatio(0.0), ThermalEnergyCoolRatio(0.0), ThermalEnergyHeatRatio(0.0), ElecCoolRatio(0.0), ElecHeatRatio(0.0), - ChillReturnNodeNum(0), ChillSupplyNodeNum(0), ChillSetPointErrDone(false), ChillSetPointSetToLoop(false), CondReturnNodeNum(0), - CondSupplyNodeNum(0), HeatReturnNodeNum(0), HeatSupplyNodeNum(0), HeatSetPointErrDone(false), HeatSetPointSetToLoop(false), - MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), TempDesCondReturn(0.0), TempDesCHWSupply(0.0), EvapVolFlowRate(0.0), - EvapVolFlowRateWasAutoSized(false), CondVolFlowRate(0.0), CondVolFlowRateWasAutoSized(false), HeatVolFlowRate(0.0), - HeatVolFlowRateWasAutoSized(false), SizFac(0.0), CoolCapFTCurve(0), ThermalEnergyCoolFTCurve(0), ThermalEnergyCoolFPLRCurve(0), - ElecCoolFTCurve(0), ElecCoolFPLRCurve(0), HeatCapFCoolCurve(0), ThermalEnergyHeatFHPLRCurve(0), isEnterCondensTemp(false), - isWaterCooled(false), CHWLowLimitTemp(0.0), ExhaustAirInletNodeNum(0), DesCondMassFlowRate(0.0), DesHeatMassFlowRate(0.0), DesEvapMassFlowRate(0.0), - DeltaTempCoolErrCount(0), DeltaTempHeatErrCount(0), CondErrCount(0), PossibleSubcooling(false), CWLoopNum(0), CWLoopSideNum(0), - CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), HWLoopNum(0), HWLoopSideNum(0), - HWBranchNum(0), HWCompNum(0), CompType_Num(0), ExhTempLTAbsLeavingTempIndex(0), ExhTempLTAbsLeavingHeatingTempIndex(0), - oneTimeInit(true), envrnInit(true), plantScanInit(true), oldCondSupplyTemp(0.0) - { - } - }; - - struct ReportVars - { - // Members + // Members from old report struct Real64 CoolingLoad; // cooling load on the chiller (previously called QEvap) Real64 CoolingEnergy; // variable to track total cooling load for period (was EvapEnergy) Real64 HeatingLoad; // heating load on the chiller @@ -205,8 +184,21 @@ namespace ChillerExhaustAbsorption { Real64 ExhHeatRecPotentialCool; // reporting: Heat Recovery Potential during cooling // Default Constructor - ReportVars() - : CoolingLoad(0.0), CoolingEnergy(0.0), HeatingLoad(0.0), HeatingEnergy(0.0), TowerLoad(0.0), TowerEnergy(0.0), ThermalEnergyUseRate(0.0), + ExhaustAbsorberSpecs() + : Available(false), ON(false), InCoolingMode(false), InHeatingMode(false), NomCoolingCap(0.0), NomCoolingCapWasAutoSized(false), + NomHeatCoolRatio(0.0), ThermalEnergyCoolRatio(0.0), ThermalEnergyHeatRatio(0.0), ElecCoolRatio(0.0), ElecHeatRatio(0.0), + ChillReturnNodeNum(0), ChillSupplyNodeNum(0), ChillSetPointErrDone(false), ChillSetPointSetToLoop(false), CondReturnNodeNum(0), + CondSupplyNodeNum(0), HeatReturnNodeNum(0), HeatSupplyNodeNum(0), HeatSetPointErrDone(false), HeatSetPointSetToLoop(false), + MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), TempDesCondReturn(0.0), TempDesCHWSupply(0.0), EvapVolFlowRate(0.0), + EvapVolFlowRateWasAutoSized(false), CondVolFlowRate(0.0), CondVolFlowRateWasAutoSized(false), HeatVolFlowRate(0.0), + HeatVolFlowRateWasAutoSized(false), SizFac(0.0), CoolCapFTCurve(0), ThermalEnergyCoolFTCurve(0), ThermalEnergyCoolFPLRCurve(0), + ElecCoolFTCurve(0), ElecCoolFPLRCurve(0), HeatCapFCoolCurve(0), ThermalEnergyHeatFHPLRCurve(0), isEnterCondensTemp(false), + isWaterCooled(false), CHWLowLimitTemp(0.0), ExhaustAirInletNodeNum(0), DesCondMassFlowRate(0.0), DesHeatMassFlowRate(0.0), DesEvapMassFlowRate(0.0), + DeltaTempCoolErrCount(0), DeltaTempHeatErrCount(0), CondErrCount(0), PossibleSubcooling(false), CWLoopNum(0), CWLoopSideNum(0), + CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), HWLoopNum(0), HWLoopSideNum(0), + HWBranchNum(0), HWCompNum(0), CompType_Num(0), ExhTempLTAbsLeavingTempIndex(0), ExhTempLTAbsLeavingHeatingTempIndex(0), + oneTimeInit(true), envrnInit(true), plantScanInit(true), oldCondSupplyTemp(0.0), + CoolingLoad(0.0), CoolingEnergy(0.0), HeatingLoad(0.0), HeatingEnergy(0.0), TowerLoad(0.0), TowerEnergy(0.0), ThermalEnergyUseRate(0.0), ThermalEnergy(0.0), CoolThermalEnergyUseRate(0.0), CoolThermalEnergy(0.0), HeatThermalEnergyUseRate(0.0), HeatThermalEnergy(0.0), ElectricPower(0.0), ElectricEnergy(0.0), CoolElectricPower(0.0), CoolElectricEnergy(0.0), HeatElectricPower(0.0), HeatElectricEnergy(0.0), ChillReturnTemp(0.0), ChillSupplyTemp(0.0), ChillWaterFlowRate(0.0), CondReturnTemp(0.0), CondSupplyTemp(0.0), @@ -218,7 +210,6 @@ namespace ChillerExhaustAbsorption { }; extern Array1D ExhaustAbsorber; // dimension to number of machines - extern Array1D ExhaustAbsorberReport; void SimExhaustAbsorber(std::string const &AbsorberType, // type of Absorber std::string const &AbsorberName, // user specified name of Absorber From d4a387d77ea2a8c9e14ad773080f237c739f172f Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Fri, 17 Jan 2020 15:48:35 -0700 Subject: [PATCH 29/41] pull CondOutletTemp back into ReformulatedEIRChiller struct to demonstrate diffs --- src/EnergyPlus/ChillerReformulatedEIR.cc | 85 +++++++++++------------- src/EnergyPlus/ChillerReformulatedEIR.hh | 16 +---- src/EnergyPlus/PlantLoopEquip.cc | 3 +- 3 files changed, 43 insertions(+), 61 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index a1552076ed5..f8de4b28bbb 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -133,20 +133,16 @@ namespace ChillerReformulatedEIR { // MODULE VARIABLE DECLARATIONS: int NumElecReformEIRChillers(0); // Number of electric reformulated EIR chillers specified in input - Real64 condOutletTempMod(0.0); - bool GetInputREIR(true); // When TRUE, calls subroutine to read input file // Object Data Array1D ElecReformEIRChiller; // dimension to number of machines - Array1D RefEIRReport; // dimension to number of machines void clear_state() { NumElecReformEIRChillers = 0; GetInputREIR = true; ElecReformEIRChiller.deallocate(); - RefEIRReport.deallocate(); } PlantComponent *ReformulatedEIRChillerSpecs::factory(std::string const &objectName) @@ -229,7 +225,7 @@ namespace ChillerReformulatedEIR { this->CondOutletNodeNum, this->QCondenser, this->CondInletTemp, - RefEIRReport(this->myIdx).CondOutletTemp, + this->CondOutletTemp, this->CondMassFlowRate, FirstHVACIteration); } else if (calledFromLocation.loopNum == this->HRLoopNum) { @@ -272,7 +268,6 @@ namespace ChillerReformulatedEIR { // ALLOCATE ARRAYS ElecReformEIRChiller.allocate(NumElecReformEIRChillers); - RefEIRReport.allocate(NumElecReformEIRChillers); // Load arrays with reformulated electric EIR chiller data for (int EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { @@ -295,7 +290,6 @@ namespace ChillerReformulatedEIR { // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueChillerName(DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), ErrorsFound, DataIPShortCuts::cCurrentModuleObject + " Name"); - ElecReformEIRChiller(EIRChillerNum).myIdx = EIRChillerNum; ElecReformEIRChiller(EIRChillerNum).Name = DataIPShortCuts::cAlphaArgs(1); // Performance curves ElecReformEIRChiller(EIRChillerNum).ChillerCapFTIndex = CurveManager::GetCurveIndex(DataIPShortCuts::cAlphaArgs(2)); @@ -732,7 +726,7 @@ namespace ChillerReformulatedEIR { SetupOutputVariable("Chiller Condenser Outlet Temperature", OutputProcessor::Unit::C, - RefEIRReport(this->myIdx).CondOutletTemp, + this->CondOutletTemp, "System", "Average", this->Name); @@ -1676,11 +1670,11 @@ namespace ChillerReformulatedEIR { this->calculate(MyLoad, RunFlag, Tmin); // Condenser outlet temperature when using Tmin as input to calculate [C] - Real64 CondTempMin = condOutletTempMod; + Real64 CondTempMin = this->CondOutletTemp; this->calculate(MyLoad, RunFlag, Tmax); // Condenser outlet temperature when using Tmax as input to CalcReformEIRChillerModel [C] - Real64 CondTempMax = condOutletTempMod; + Real64 CondTempMax = this->CondOutletTemp; if (CondTempMin > Tmin && CondTempMax < Tmax) { @@ -1715,8 +1709,8 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd(this->Name + ": Iteration limit exceeded calculating condenser outlet temperature.", this->IterLimitErrIndex, - condOutletTempMod, - condOutletTempMod); + this->CondOutletTemp, + this->CondOutletTemp); } } } else if (SolFla == -2) { @@ -1732,8 +1726,8 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd(this->Name + ": Solution is not found in calculating condenser outlet temperature.", this->IterFailedIndex, - condOutletTempMod, - condOutletTempMod); + this->CondOutletTemp, + this->CondOutletTemp); } } this->calculate(MyLoad, RunFlag, DataLoopNode::Node(this->CondInletNodeNum).Temp); @@ -1741,7 +1735,7 @@ namespace ChillerReformulatedEIR { } else { // If iteration is not possible, average the min/max condenser outlet temperature and manually determine solution this->calculate(MyLoad, RunFlag, (CondTempMin + CondTempMax) / 2.0); - this->calculate(MyLoad, RunFlag, condOutletTempMod); + this->calculate(MyLoad, RunFlag, this->CondOutletTemp); } // Call subroutine to evaluate all performance curve min/max values against evaporator/condenser outlet temps and PLR @@ -1856,7 +1850,7 @@ namespace ChillerReformulatedEIR { this->CondEnergy = 0.0; this->EvapInletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; - RefEIRReport(this->myIdx).CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; + this->CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).Temp; this->ActualCOP = 0.0; @@ -1873,7 +1867,7 @@ namespace ChillerReformulatedEIR { } else { // Chiller is running, so pass calculated values // Set node temperatures DataLoopNode::Node(this->EvapOutletNodeNum).Temp = this->EvapOutletTemp; - DataLoopNode::Node(this->CondOutletNodeNum).Temp = condOutletTempMod; + DataLoopNode::Node(this->CondOutletNodeNum).Temp = this->CondOutletTemp; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available this->ChillerFalseLoad = this->ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; @@ -1882,7 +1876,6 @@ namespace ChillerReformulatedEIR { this->CondEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; this->EvapInletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; - RefEIRReport(this->myIdx).CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; // missed here if (this->Power != 0.0) { this->ActualCOP = (this->QEvaporator + this->ChillerFalseLoadRate) / this->Power; } else { @@ -1921,7 +1914,7 @@ namespace ChillerReformulatedEIR { bool RunFlag = (int(Par(3)) == 1); this->calculate(MyLoad, RunFlag, FalsiCondOutTemp); - Real64 CondOutTempResidual = FalsiCondOutTemp - condOutletTempMod; // CondOutletTemp is module level variable, final value used for reporting + Real64 CondOutTempResidual = FalsiCondOutTemp - this->CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting return CondOutTempResidual; } @@ -2090,7 +2083,7 @@ namespace ChillerReformulatedEIR { if ((this->QHeatRecovery + this->QCondenser) > 0.0) { // protect div by zero this->ChillerCondAvgTemp = (this->QHeatRecovery * this->HeatRecOutletTemp + - this->QCondenser * RefEIRReport(this->myIdx).CondOutletTemp) / // Maybe here too + this->QCondenser * this->CondOutletTemp) / // Maybe here too (this->QHeatRecovery + this->QCondenser); } else { this->ChillerCondAvgTemp = FalsiCondOutTemp; @@ -2424,7 +2417,7 @@ namespace ChillerReformulatedEIR { condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); - condOutletTempMod = this->QCondenser / this->CondMassFlowRate / Cp + condInletTemp; + this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / Cp + condInletTemp; } else { ShowSevereError("ControlReformEIRChillerModel: Condenser flow = 0, for ElecReformEIRChiller=" + this->Name); ShowContinueErrorTimeStamp(""); @@ -2540,11 +2533,11 @@ namespace ChillerReformulatedEIR { Real64 EIRFPLRPLRmax = this->ChillerEIRFPLRPLRMax; // Check bounds for curves, lump min/max into same check since min/max values are reported in recurring warning messages - if (condOutletTempMod < CAPFTYTmin || condOutletTempMod > CAPFTYTmax) { + if (this->CondOutletTemp < CAPFTYTmin || this->CondOutletTemp > CAPFTYTmax) { ++this->CAPFTYIter; if (this->CAPFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(condOutletTempMod, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Cooling Capacity Function of " "Temperature biquadratic curve = " + this->CAPFTName); @@ -2552,22 +2545,22 @@ namespace ChillerReformulatedEIR { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", this->CAPFTYIterIndex, - condOutletTempMod, - condOutletTempMod); + this->CondOutletTemp, + this->CondOutletTemp); } else { ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", this->CAPFTYIterIndex, - condOutletTempMod, - condOutletTempMod); + this->CondOutletTemp, + this->CondOutletTemp); } } - if (condOutletTempMod < EIRFTYTmin || condOutletTempMod > EIRFTYTmax) { + if (this->CondOutletTemp < EIRFTYTmin || this->CondOutletTemp > EIRFTYTmax) { ++this->EIRFTYIter; if (this->EIRFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(condOutletTempMod, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Electric Input to Cooling Output Ratio " "Function of Temperature biquadratic curve = " + this->EIRFTName); @@ -2576,24 +2569,24 @@ namespace ChillerReformulatedEIR { "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", this->EIRFTYIterIndex, - condOutletTempMod, - condOutletTempMod); + this->CondOutletTemp, + this->CondOutletTemp); } else { ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", this->EIRFTYIterIndex, - condOutletTempMod, - condOutletTempMod); + this->CondOutletTemp, + this->CondOutletTemp); } } if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - if (condOutletTempMod < EIRFPLRTmin || condOutletTempMod > EIRFPLRTmax) { + if (this->CondOutletTemp < EIRFPLRTmin || this->CondOutletTemp > EIRFPLRTmax) { ++this->EIRFPLRTIter; if (this->EIRFPLRTIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(condOutletTempMod, 2) + + "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (X var) given in Electric Input to Cooling Output " "Ratio Function of Part-load Ratio bicubic curve = " + this->EIRFPLRName); @@ -2603,15 +2596,15 @@ namespace ChillerReformulatedEIR { "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", this->EIRFPLRTIterIndex, - condOutletTempMod, - condOutletTempMod); + this->CondOutletTemp, + this->CondOutletTemp); } else { ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", this->EIRFPLRTIterIndex, - condOutletTempMod, - condOutletTempMod); + this->CondOutletTemp, + this->CondOutletTemp); } } } @@ -2669,7 +2662,7 @@ namespace ChillerReformulatedEIR { } } - this->ChillerCapFT = CurveManager::CurveValue(this->ChillerCapFTIndex, EvapOutletTempSetPoint, condOutletTempMod); + this->ChillerCapFT = CurveManager::CurveValue(this->ChillerCapFTIndex, EvapOutletTempSetPoint, this->CondOutletTemp); if (this->ChillerCapFT < 0) { if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && @@ -2679,7 +2672,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + General::RoundSigDigits(this->ChillerCapFT, 3) + ")."); ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTempSetPoint, 1) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(condOutletTempMod, 1) + '.'); + " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++this->ChillerCapFTError; @@ -2691,7 +2684,7 @@ namespace ChillerReformulatedEIR { } } - this->ChillerEIRFT = CurveManager::CurveValue(this->ChillerEIRFTIndex, this->EvapOutletTemp, condOutletTempMod); + this->ChillerEIRFT = CurveManager::CurveValue(this->ChillerEIRFTIndex, this->EvapOutletTemp, this->CondOutletTemp); if (this->ChillerEIRFT < 0.0) { if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && @@ -2701,7 +2694,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Reformulated Chiller EIR as a Function of Temperature curve output is negative (" + General::RoundSigDigits(this->ChillerEIRFT, 3) + ")."); ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(this->EvapOutletTemp, 1) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(condOutletTempMod, 1) + '.'); + " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++this->ChillerEIRFTError; @@ -2714,11 +2707,11 @@ namespace ChillerReformulatedEIR { } if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - this->ChillerEIRFPLR = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, condOutletTempMod, this->ChillerPartLoadRatio); + this->ChillerEIRFPLR = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, this->CondOutletTemp, this->ChillerPartLoadRatio); } else if (this->PartLoadCurveType == PLR_Lift) { // Chiller lift [C] - Real64 ChillerLift = condOutletTempMod - this->EvapOutletTemp; + Real64 ChillerLift = this->CondOutletTemp - this->EvapOutletTemp; // Deviation of leaving chilled water temperature from the reference condition Real64 ChillerTdev = std::abs(this->EvapOutletTemp - this->TempRefEvapOut); @@ -2745,7 +2738,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(" Chiller EIR as a function of PLR and condenser water temperature curve output is negative (" + General::RoundSigDigits(this->ChillerEIRFPLR, 3) + ")."); ShowContinueError(" Negative value occurs using a part-load ratio of " + General::RoundSigDigits(this->ChillerPartLoadRatio, 3) + - " and a Condenser Leaving Temp of " + General::RoundSigDigits(condOutletTempMod, 1) + " C."); + " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + " C."); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++this->ChillerEIRFPLRError; diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index acc07f8334a..7992d31f4c3 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -70,19 +70,9 @@ namespace ChillerReformulatedEIR { extern bool GetInputREIR; // When TRUE, calls subroutine to read input file - struct RefEIRReportSpecs - { - Real64 CondOutletTemp; - - RefEIRReportSpecs() : CondOutletTemp(0.0) - { - }; - }; - struct ReformulatedEIRChillerSpecs : PlantComponent { // Members - int myIdx; std::string Name; // User identifier int TypeNum; // plant loop type identifier std::string CAPFTName; // CAPFT curve name @@ -213,7 +203,7 @@ namespace ChillerReformulatedEIR { Real64 QEvaporator; // reporting: Evaporator heat transfer rate [W] Real64 Power; // reporting: Chiller power [W] Real64 EvapOutletTemp; // reporting: Evaporator outlet temperature [C] -// Real64 CondOutletTemp; // reporting: Condenser outlet temperature [C] + Real64 CondOutletTemp; // reporting: Condenser outlet temperature [C] Real64 EvapMassFlowRate; // reporting: Evaporator mass flow rate [kg/s] Real64 CondMassFlowRate; // Condenser mass flow rate [kg/s] Real64 ChillerFalseLoad; // reporting: Chiller false load over and above water side load [W] @@ -230,7 +220,7 @@ namespace ChillerReformulatedEIR { // Default Constructor ReformulatedEIRChillerSpecs() - : myIdx(0), TypeNum(0), CondenserType(0), PartLoadCurveType(0), RefCap(0.0), RefCapWasAutoSized(false), RefCOP(0.0), FlowMode(FlowModeNotSet), + : TypeNum(0), CondenserType(0), PartLoadCurveType(0), RefCap(0.0), RefCapWasAutoSized(false), RefCOP(0.0), FlowMode(FlowModeNotSet), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), EvapVolFlowRate(0.0), EvapVolFlowRateWasAutoSized(false), EvapMassFlowRateMax(0.0), CondVolFlowRate(0.0), CondVolFlowRateWasAutoSized(false), CondMassFlowRateMax(0.0), CompPowerToCondenserFrac(0.0), EvapInletNodeNum(0), EvapOutletNodeNum(0), CondInletNodeNum(0), CondOutletNodeNum(0), @@ -252,7 +242,7 @@ namespace ChillerReformulatedEIR { FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0), FaultyChillerFoulingFactor(1.0), MyEnvrnFlag(true), MyInitFlag(true), MySizeFlag(true), ChillerCondAvgTemp(0.0), ChillerFalseLoadRate(0.0), ChillerCyclingRatio(0.0), ChillerPartLoadRatio(0.0), ChillerEIRFPLR(0.0), ChillerEIRFT(0.0), ChillerCapFT(0.0), HeatRecOutletTemp(0.0), - QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0), + QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0), CondOutletTemp(0.0), EvapMassFlowRate(0.0), CondMassFlowRate(0.0), ChillerFalseLoad(0.0), Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), HeatRecMassFlow(0.0), EquipFlowCtrl(0) diff --git a/src/EnergyPlus/PlantLoopEquip.cc b/src/EnergyPlus/PlantLoopEquip.cc index dd5b878fa95..41c5576ebae 100644 --- a/src/EnergyPlus/PlantLoopEquip.cc +++ b/src/EnergyPlus/PlantLoopEquip.cc @@ -196,8 +196,7 @@ namespace PlantLoopEquip { Real64 OptLoad; Real64 SizingFac = 0.0; // the component sizing fraction int GeneralEquipType; // Basic Equipment type from EquipType Used to help organize this routine - Real64 TempCondInDesign; // Design condenser inlet temp. C , or 25.d0 - Real64 TempEvapOutDesign; + EnergyPlus::PlantLocation sim_component_location(LoopNum, LoopSideNum, BranchNum, Num); // set up a reference for this component From ca15b4723d2f64a449c02d22ea8e35f307b9500d Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 17 Jan 2020 16:51:29 -0600 Subject: [PATCH 30/41] Made functions into member methods --- src/EnergyPlus/ChillerExhaustAbsorption.cc | 813 ++++++++++----------- src/EnergyPlus/ChillerExhaustAbsorption.hh | 39 +- 2 files changed, 413 insertions(+), 439 deletions(-) diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index a1e782352b7..0c07f26b63f 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -163,14 +163,16 @@ namespace ChillerExhaustAbsorption { ChillNum = CompIndex; } + auto &thisChiller = ExhaustAbsorber(ChillNum); + // Check that this is a valid call if (InitLoopEquip) { - InitExhaustAbsorber(ChillNum, RunFlag); + thisChiller.initialize(RunFlag); // Match inlet node name of calling branch to determine if this call is for heating or cooling if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).ChillReturnNodeNum) { // Operate as chiller - SizeExhaustAbsorber(ChillNum); // only call from chilled water loop + thisChiller.size(); // only call from chilled water loop MinCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).MinPartLoadRat; MaxCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).MaxPartLoadRat; OptCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).OptPartLoadRat; @@ -199,16 +201,16 @@ namespace ChillerExhaustAbsorption { // Calculate Node Values // Calculate Equipment and Update Variables ExhaustAbsorber(ChillNum).InCoolingMode = RunFlag != 0; - InitExhaustAbsorber(ChillNum, RunFlag); - CalcExhaustAbsorberChillerModel(ChillNum, MyLoad, RunFlag); - UpdateExhaustAbsorberCoolRecords(MyLoad, RunFlag, ChillNum); + thisChiller.initialize(RunFlag); + thisChiller.calcChiller(MyLoad); + thisChiller.updateCoolRecords(MyLoad, RunFlag); } else if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).HeatReturnNodeNum) { // Operate as heater // Calculate Node Values // Calculate Equipment and Update Variables ExhaustAbsorber(ChillNum).InHeatingMode = RunFlag != 0; - InitExhaustAbsorber(ChillNum, RunFlag); - CalcExhaustAbsorberHeaterModel(ChillNum, MyLoad, RunFlag); - UpdateExhaustAbsorberHeatRecords(MyLoad, RunFlag, ChillNum); + thisChiller.initialize(RunFlag); + thisChiller.calcHeater(MyLoad, RunFlag); + thisChiller.updateHeatRecords(MyLoad, RunFlag); } else if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).CondReturnNodeNum) { // called from condenser loop if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { PlantUtilities::UpdateChillerComponentCondenserSide(ExhaustAbsorber(ChillNum).CDLoopNum, @@ -700,9 +702,7 @@ namespace ChillerExhaustAbsorption { } } - void InitExhaustAbsorber(int const ChillNum, // number of the current engine driven chiller being simulated - bool const EP_UNUSED(RunFlag) // TRUE when chiller operating - ) + void ExhaustAbsorberSpecs::initialize(bool const EP_UNUSED(RunFlag)) { // SUBROUTINE INFORMATION: @@ -731,261 +731,260 @@ namespace ChillerExhaustAbsorption { Real64 mdot; // lcoal fluid mass flow rate // Init more variables - if (ExhaustAbsorber(ChillNum).plantScanInit) { + if (this->plantScanInit) { // Locate the chillers on the plant loops for later usage errFlag = false; - PlantUtilities::ScanPlantLoopsForObject(ExhaustAbsorber(ChillNum).Name, + PlantUtilities::ScanPlantLoopsForObject(this->Name, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - ExhaustAbsorber(ChillNum).CWLoopNum, - ExhaustAbsorber(ChillNum).CWLoopSideNum, - ExhaustAbsorber(ChillNum).CWBranchNum, - ExhaustAbsorber(ChillNum).CWCompNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, errFlag, - ExhaustAbsorber(ChillNum).CHWLowLimitTemp, + this->CHWLowLimitTemp, _, _, - ExhaustAbsorber(ChillNum).ChillReturnNodeNum, + this->ChillReturnNodeNum, _); if (errFlag) { ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s)."); } - PlantUtilities::ScanPlantLoopsForObject(ExhaustAbsorber(ChillNum).Name, + PlantUtilities::ScanPlantLoopsForObject(this->Name, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - ExhaustAbsorber(ChillNum).HWLoopNum, - ExhaustAbsorber(ChillNum).HWLoopSideNum, - ExhaustAbsorber(ChillNum).HWBranchNum, - ExhaustAbsorber(ChillNum).HWCompNum, + this->HWLoopNum, + this->HWLoopSideNum, + this->HWBranchNum, + this->HWCompNum, errFlag, _, _, _, - ExhaustAbsorber(ChillNum).HeatReturnNodeNum, + this->HeatReturnNodeNum, _); if (errFlag) { ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s)."); } - if (ExhaustAbsorber(ChillNum).isWaterCooled) { - PlantUtilities::ScanPlantLoopsForObject(ExhaustAbsorber(ChillNum).Name, + if (this->isWaterCooled) { + PlantUtilities::ScanPlantLoopsForObject(this->Name, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - ExhaustAbsorber(ChillNum).CDLoopNum, - ExhaustAbsorber(ChillNum).CDLoopSideNum, - ExhaustAbsorber(ChillNum).CDBranchNum, - ExhaustAbsorber(ChillNum).CDCompNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum, errFlag, _, _, _, - ExhaustAbsorber(ChillNum).CondReturnNodeNum, + this->CondReturnNodeNum, _); if (errFlag) { ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s)."); } - PlantUtilities::InterConnectTwoPlantLoopSides(ExhaustAbsorber(ChillNum).CWLoopNum, - ExhaustAbsorber(ChillNum).CWLoopSideNum, - ExhaustAbsorber(ChillNum).CDLoopNum, - ExhaustAbsorber(ChillNum).CDLoopSideNum, + PlantUtilities::InterConnectTwoPlantLoopSides(this->CWLoopNum, + this->CWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); - PlantUtilities::InterConnectTwoPlantLoopSides(ExhaustAbsorber(ChillNum).HWLoopNum, - ExhaustAbsorber(ChillNum).HWLoopSideNum, - ExhaustAbsorber(ChillNum).CDLoopNum, - ExhaustAbsorber(ChillNum).CDLoopSideNum, + PlantUtilities::InterConnectTwoPlantLoopSides(this->HWLoopNum, + this->HWLoopSideNum, + this->CDLoopNum, + this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); } - PlantUtilities::InterConnectTwoPlantLoopSides(ExhaustAbsorber(ChillNum).CWLoopNum, - ExhaustAbsorber(ChillNum).CWLoopSideNum, - ExhaustAbsorber(ChillNum).HWLoopNum, - ExhaustAbsorber(ChillNum).HWLoopSideNum, + PlantUtilities::InterConnectTwoPlantLoopSides(this->CWLoopNum, + this->CWLoopSideNum, + this->HWLoopNum, + this->HWLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); // check if outlet node of chilled water side has a setpoint. - if ((DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && - (DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { + if ((DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { if (!DataGlobals::AnyEnergyManagementSystemInModel) { - if (!ExhaustAbsorber(ChillNum).ChillSetPointErrDone) { - ShowWarningError("Missing temperature setpoint on cool side for chiller heater named " + ExhaustAbsorber(ChillNum).Name); + if (!this->ChillSetPointErrDone) { + ShowWarningError("Missing temperature setpoint on cool side for chiller heater named " + this->Name); ShowContinueError(" A temperature setpoint is needed at the outlet node of this chiller, use a SetpointManager"); ShowContinueError(" The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - ExhaustAbsorber(ChillNum).ChillSetPointErrDone = true; + this->ChillSetPointErrDone = true; } } else { // need call to EMS to check node errFlag = false; // but not really fatal yet, but should be. - EMSManager::CheckIfNodeSetPointManagedByEMS(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum, EMSManager::iTemperatureSetPoint, errFlag); + EMSManager::CheckIfNodeSetPointManagedByEMS(this->ChillSupplyNodeNum, EMSManager::iTemperatureSetPoint, errFlag); if (errFlag) { - if (!ExhaustAbsorber(ChillNum).ChillSetPointErrDone) { - ShowWarningError("Missing temperature setpoint on cool side for chiller heater named " + ExhaustAbsorber(ChillNum).Name); + if (!this->ChillSetPointErrDone) { + ShowWarningError("Missing temperature setpoint on cool side for chiller heater named " + this->Name); ShowContinueError(" A temperature setpoint is needed at the outlet node of this chiller evaporator "); ShowContinueError(" use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); ShowContinueError(" or use an EMS actuator to establish a setpoint at the outlet node "); ShowContinueError(" The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - ExhaustAbsorber(ChillNum).ChillSetPointErrDone = true; + this->ChillSetPointErrDone = true; } } } - ExhaustAbsorber(ChillNum).ChillSetPointSetToLoop = true; - DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; - DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + this->ChillSetPointSetToLoop = true; + DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPointHi = + DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } // check if outlet node of hot water side has a setpoint. - if ((DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && - (DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPointLo == DataLoopNode::SensedNodeFlagValue)) { + if ((DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPointLo == DataLoopNode::SensedNodeFlagValue)) { if (!DataGlobals::AnyEnergyManagementSystemInModel) { - if (!ExhaustAbsorber(ChillNum).HeatSetPointErrDone) { - ShowWarningError("Missing temperature setpoint on heat side for chiller heater named " + ExhaustAbsorber(ChillNum).Name); + if (!this->HeatSetPointErrDone) { + ShowWarningError("Missing temperature setpoint on heat side for chiller heater named " + this->Name); ShowContinueError(" A temperature setpoint is needed at the outlet node of this chiller, use a SetpointManager"); ShowContinueError(" The overall loop setpoint will be assumed for chiller. The simulation continues ... "); - ExhaustAbsorber(ChillNum).HeatSetPointErrDone = true; + this->HeatSetPointErrDone = true; } } else { // need call to EMS to check node errFlag = false; // but not really fatal yet, but should be. - EMSManager::CheckIfNodeSetPointManagedByEMS(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum, EMSManager::iTemperatureSetPoint, errFlag); + EMSManager::CheckIfNodeSetPointManagedByEMS(this->HeatSupplyNodeNum, EMSManager::iTemperatureSetPoint, errFlag); if (errFlag) { - if (!ExhaustAbsorber(ChillNum).HeatSetPointErrDone) { - ShowWarningError("Missing temperature setpoint on heat side for chiller heater named " + ExhaustAbsorber(ChillNum).Name); + if (!this->HeatSetPointErrDone) { + ShowWarningError("Missing temperature setpoint on heat side for chiller heater named " + this->Name); ShowContinueError(" A temperature setpoint is needed at the outlet node of this chiller heater "); ShowContinueError(" use a Setpoint Manager to establish a setpoint at the heater side outlet node "); ShowContinueError(" or use an EMS actuator to establish a setpoint at the outlet node "); ShowContinueError(" The overall loop setpoint will be assumed for heater side. The simulation continues ... "); - ExhaustAbsorber(ChillNum).HeatSetPointErrDone = true; + this->HeatSetPointErrDone = true; } } } - ExhaustAbsorber(ChillNum).HeatSetPointSetToLoop = true; - DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPoint; - DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPointLo = - DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPointLo; + this->HeatSetPointSetToLoop = true; + DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPointLo = + DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } - ExhaustAbsorber(ChillNum).plantScanInit = false; + this->plantScanInit = false; } - CondInletNode = ExhaustAbsorber(ChillNum).CondReturnNodeNum; - CondOutletNode = ExhaustAbsorber(ChillNum).CondSupplyNodeNum; - HeatInletNode = ExhaustAbsorber(ChillNum).HeatReturnNodeNum; - HeatOutletNode = ExhaustAbsorber(ChillNum).HeatSupplyNodeNum; + CondInletNode = this->CondReturnNodeNum; + CondOutletNode = this->CondSupplyNodeNum; + HeatInletNode = this->HeatReturnNodeNum; + HeatOutletNode = this->HeatSupplyNodeNum; - if (ExhaustAbsorber(ChillNum).envrnInit && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->envrnInit && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { - if (ExhaustAbsorber(ChillNum).isWaterCooled) { + if (this->isWaterCooled) { // init max available condenser water flow rate - if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { - rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, + if (this->CDLoopNum > 0) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); } - ExhaustAbsorber(ChillNum).DesCondMassFlowRate = rho * ExhaustAbsorber(ChillNum).CondVolFlowRate; + this->DesCondMassFlowRate = rho * this->CondVolFlowRate; PlantUtilities::InitComponentNodes(0.0, - ExhaustAbsorber(ChillNum).DesCondMassFlowRate, + this->DesCondMassFlowRate, CondInletNode, CondOutletNode, - ExhaustAbsorber(ChillNum).CDLoopNum, - ExhaustAbsorber(ChillNum).CDLoopSideNum, - ExhaustAbsorber(ChillNum).CDBranchNum, - ExhaustAbsorber(ChillNum).CDCompNum); + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } - if (ExhaustAbsorber(ChillNum).HWLoopNum > 0) { - rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).FluidName, + if (this->HWLoopNum > 0) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->HWLoopNum).FluidName, DataGlobals::HWInitConvTemp, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).FluidIndex, + DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); } - ExhaustAbsorber(ChillNum).DesHeatMassFlowRate = rho * ExhaustAbsorber(ChillNum).HeatVolFlowRate; + this->DesHeatMassFlowRate = rho * this->HeatVolFlowRate; // init available hot water flow rate PlantUtilities::InitComponentNodes(0.0, - ExhaustAbsorber(ChillNum).DesHeatMassFlowRate, + this->DesHeatMassFlowRate, HeatInletNode, HeatOutletNode, - ExhaustAbsorber(ChillNum).HWLoopNum, - ExhaustAbsorber(ChillNum).HWLoopSideNum, - ExhaustAbsorber(ChillNum).HWBranchNum, - ExhaustAbsorber(ChillNum).HWCompNum); + this->HWLoopNum, + this->HWLoopSideNum, + this->HWBranchNum, + this->HWCompNum); - if (ExhaustAbsorber(ChillNum).CWLoopNum > 0) { - rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, + if (this->CWLoopNum > 0) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); } - ExhaustAbsorber(ChillNum).DesEvapMassFlowRate = rho * ExhaustAbsorber(ChillNum).EvapVolFlowRate; + this->DesEvapMassFlowRate = rho * this->EvapVolFlowRate; // init available hot water flow rate PlantUtilities::InitComponentNodes(0.0, - ExhaustAbsorber(ChillNum).DesEvapMassFlowRate, - ExhaustAbsorber(ChillNum).ChillReturnNodeNum, - ExhaustAbsorber(ChillNum).ChillSupplyNodeNum, - ExhaustAbsorber(ChillNum).CWLoopNum, - ExhaustAbsorber(ChillNum).CWLoopSideNum, - ExhaustAbsorber(ChillNum).CWBranchNum, - ExhaustAbsorber(ChillNum).CWCompNum); - - ExhaustAbsorber(ChillNum).envrnInit = false; + this->DesEvapMassFlowRate, + this->ChillReturnNodeNum, + this->ChillSupplyNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); + + this->envrnInit = false; } if (!DataGlobals::BeginEnvrnFlag) { - ExhaustAbsorber(ChillNum).envrnInit = true; + this->envrnInit = true; } // this component model works off setpoints on the leaving node // fill from plant if needed - if (ExhaustAbsorber(ChillNum).ChillSetPointSetToLoop) { - DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPoint; - DataLoopNode::Node(ExhaustAbsorber(ChillNum).ChillSupplyNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + if (this->ChillSetPointSetToLoop) { + DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPointHi = + DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } - if (ExhaustAbsorber(ChillNum).HeatSetPointSetToLoop) { - DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPoint; - DataLoopNode::Node(ExhaustAbsorber(ChillNum).HeatSupplyNodeNum).TempSetPointLo = - DataLoopNode::Node(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).TempSetPointNodeNum).TempSetPointLo; + if (this->HeatSetPointSetToLoop) { + DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint = + DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPointLo = + DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } - if ((ExhaustAbsorber(ChillNum).isWaterCooled) && ((ExhaustAbsorber(ChillNum).InHeatingMode) || (ExhaustAbsorber(ChillNum).InCoolingMode)) && - (!ExhaustAbsorber(ChillNum).plantScanInit)) { - mdot = ExhaustAbsorber(ChillNum).DesCondMassFlowRate; + if ((this->isWaterCooled) && ((this->InHeatingMode) || (this->InCoolingMode)) && + (!this->plantScanInit)) { + mdot = this->DesCondMassFlowRate; PlantUtilities::SetComponentFlowRate(mdot, - ExhaustAbsorber(ChillNum).CondReturnNodeNum, - ExhaustAbsorber(ChillNum).CondSupplyNodeNum, - ExhaustAbsorber(ChillNum).CDLoopNum, - ExhaustAbsorber(ChillNum).CDLoopSideNum, - ExhaustAbsorber(ChillNum).CDBranchNum, - ExhaustAbsorber(ChillNum).CDCompNum); + this->CondReturnNodeNum, + this->CondSupplyNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } else { mdot = 0.0; - if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { + if (this->CDLoopNum > 0) { PlantUtilities::SetComponentFlowRate(mdot, - ExhaustAbsorber(ChillNum).CondReturnNodeNum, - ExhaustAbsorber(ChillNum).CondSupplyNodeNum, - ExhaustAbsorber(ChillNum).CDLoopNum, - ExhaustAbsorber(ChillNum).CDLoopSideNum, - ExhaustAbsorber(ChillNum).CDBranchNum, - ExhaustAbsorber(ChillNum).CDCompNum); + this->CondReturnNodeNum, + this->CondSupplyNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } } } - void SizeExhaustAbsorber(int const ChillNum) - { + void ExhaustAbsorberSpecs::size() { // SUBROUTINE INFORMATION: // AUTHOR Fred Buhl @@ -1020,54 +1019,54 @@ namespace ChillerExhaustAbsorption { Real64 HeatRecVolFlowRateUser; // Hardsized generator flow rate for reporting ErrorsFound = false; - tmpNomCap = ExhaustAbsorber(ChillNum).NomCoolingCap; - tmpEvapVolFlowRate = ExhaustAbsorber(ChillNum).EvapVolFlowRate; - tmpCondVolFlowRate = ExhaustAbsorber(ChillNum).CondVolFlowRate; - tmpHeatRecVolFlowRate = ExhaustAbsorber(ChillNum).HeatVolFlowRate; + tmpNomCap = this->NomCoolingCap; + tmpEvapVolFlowRate = this->EvapVolFlowRate; + tmpCondVolFlowRate = this->CondVolFlowRate; + tmpHeatRecVolFlowRate = this->HeatVolFlowRate; int PltSizCondNum = 0; // Plant Sizing index for condenser loop - if (ExhaustAbsorber(ChillNum).isWaterCooled) PltSizCondNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).PlantSizNum; + if (this->isWaterCooled) PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; - int PltSizHeatNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).HWLoopNum).PlantSizNum; - int PltSizCoolNum = DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).PlantSizNum; + int PltSizHeatNum = DataPlant::PlantLoop(this->HWLoopNum).PlantSizNum; + int PltSizCoolNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; if (PltSizCoolNum > 0) { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { - Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); - rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = - Cp * rho * DataSizing::PlantSizData(PltSizCoolNum).DeltaT * DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * ExhaustAbsorber(ChillNum).SizFac; - if (!ExhaustAbsorber(ChillNum).NomCoolingCapWasAutoSized) tmpNomCap = ExhaustAbsorber(ChillNum).NomCoolingCap; + Cp * rho * DataSizing::PlantSizData(PltSizCoolNum).DeltaT * DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * this->SizFac; + if (!this->NomCoolingCapWasAutoSized) tmpNomCap = this->NomCoolingCap; } else { - if (ExhaustAbsorber(ChillNum).NomCoolingCapWasAutoSized) tmpNomCap = 0.0; + if (this->NomCoolingCapWasAutoSized) tmpNomCap = 0.0; } if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (ExhaustAbsorber(ChillNum).NomCoolingCapWasAutoSized) { - ExhaustAbsorber(ChillNum).NomCoolingCap = tmpNomCap; + if (this->NomCoolingCapWasAutoSized) { + this->NomCoolingCap = tmpNomCap; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Design Size Nominal Cooling Capacity [W]", tmpNomCap); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Initial Design Size Nominal Cooling Capacity [W]", tmpNomCap); } } else { - if (ExhaustAbsorber(ChillNum).NomCoolingCap > 0.0 && tmpNomCap > 0.0) { - NomCapUser = ExhaustAbsorber(ChillNum).NomCoolingCap; + if (this->NomCoolingCap > 0.0 && tmpNomCap > 0.0) { + NomCapUser = this->NomCoolingCap; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Design Size Nominal Cooling Capacity [W]", tmpNomCap, "User-Specified Nominal Cooling Capacity [W]", @@ -1075,7 +1074,7 @@ namespace ChillerExhaustAbsorption { if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + - ExhaustAbsorber(ChillNum).Name); + this->Name); ShowContinueError("User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); ShowContinueError("differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + " [W]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); @@ -1088,9 +1087,9 @@ namespace ChillerExhaustAbsorption { } } } else { - if (ExhaustAbsorber(ChillNum).NomCoolingCapWasAutoSized) { + if (this->NomCoolingCapWasAutoSized) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + ExhaustAbsorber(ChillNum).Name + + ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller nominal cooling capacity requires"); ShowContinueError("a cooling loop Sizing:Plant object."); @@ -1098,11 +1097,11 @@ namespace ChillerExhaustAbsorption { } } else { if (DataPlant::PlantFinalSizesOkayToReport) { - if (ExhaustAbsorber(ChillNum).NomCoolingCap > 0.0) { + if (this->NomCoolingCap > 0.0) { ReportSizingManager::ReportSizingOutput("Chiller:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "User-Specified Nominal Capacity [W]", - ExhaustAbsorber(ChillNum).NomCoolingCap); + this->NomCoolingCap); } } } @@ -1110,33 +1109,33 @@ namespace ChillerExhaustAbsorption { if (PltSizCoolNum > 0) { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { - tmpEvapVolFlowRate = DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * ExhaustAbsorber(ChillNum).SizFac; - if (!ExhaustAbsorber(ChillNum).EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = ExhaustAbsorber(ChillNum).EvapVolFlowRate; + tmpEvapVolFlowRate = DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * this->SizFac; + if (!this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = this->EvapVolFlowRate; } else { - if (ExhaustAbsorber(ChillNum).EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; + if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (ExhaustAbsorber(ChillNum).EvapVolFlowRateWasAutoSized) { - ExhaustAbsorber(ChillNum).EvapVolFlowRate = tmpEvapVolFlowRate; + if (this->EvapVolFlowRateWasAutoSized) { + this->EvapVolFlowRate = tmpEvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Initial Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } } else { - if (ExhaustAbsorber(ChillNum).EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { - EvapVolFlowRateUser = ExhaustAbsorber(ChillNum).EvapVolFlowRate; + if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { + EvapVolFlowRateUser = this->EvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate, "User-Specified Design Chilled Water Flow Rate [m3/s]", @@ -1144,7 +1143,7 @@ namespace ChillerExhaustAbsorption { if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + - ExhaustAbsorber(ChillNum).Name); + this->Name); ShowContinueError("User-Specified Design Chilled Water Flow Rate of " + General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Chilled Water Flow Rate of " + @@ -1159,9 +1158,9 @@ namespace ChillerExhaustAbsorption { } } } else { - if (ExhaustAbsorber(ChillNum).EvapVolFlowRateWasAutoSized) { + if (this->EvapVolFlowRateWasAutoSized) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + ExhaustAbsorber(ChillNum).Name + + ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller evap flow rate requires"); ShowContinueError("a cooling loop Sizing:Plant object."); @@ -1169,47 +1168,47 @@ namespace ChillerExhaustAbsorption { } } else { if (DataPlant::PlantFinalSizesOkayToReport) { - if (ExhaustAbsorber(ChillNum).EvapVolFlowRate > 0.0) { + if (this->EvapVolFlowRate > 0.0) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "User-Specified Design Chilled Water Flow Rate [m3/s]", - ExhaustAbsorber(ChillNum).EvapVolFlowRate); + this->EvapVolFlowRate); } } } } - PlantUtilities::RegisterPlantCompDesignFlow(ExhaustAbsorber(ChillNum).ChillReturnNodeNum, tmpEvapVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(this->ChillReturnNodeNum, tmpEvapVolFlowRate); if (PltSizHeatNum > 0) { if (DataSizing::PlantSizData(PltSizHeatNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { - tmpHeatRecVolFlowRate = DataSizing::PlantSizData(PltSizHeatNum).DesVolFlowRate * ExhaustAbsorber(ChillNum).SizFac; - if (!ExhaustAbsorber(ChillNum).HeatVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = ExhaustAbsorber(ChillNum).HeatVolFlowRate; + tmpHeatRecVolFlowRate = DataSizing::PlantSizData(PltSizHeatNum).DesVolFlowRate * this->SizFac; + if (!this->HeatVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = this->HeatVolFlowRate; } else { - if (ExhaustAbsorber(ChillNum).HeatVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = 0.0; + if (this->HeatVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = 0.0; } if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (ExhaustAbsorber(ChillNum).HeatVolFlowRateWasAutoSized) { - ExhaustAbsorber(ChillNum).HeatVolFlowRate = tmpHeatRecVolFlowRate; + if (this->HeatVolFlowRateWasAutoSized) { + this->HeatVolFlowRate = tmpHeatRecVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Design Size Design Hot Water Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Initial Design Size Design Hot Water Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } } else { - if (ExhaustAbsorber(ChillNum).HeatVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { - HeatRecVolFlowRateUser = ExhaustAbsorber(ChillNum).HeatVolFlowRate; + if (this->HeatVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { + HeatRecVolFlowRateUser = this->HeatVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Design Size Design Hot Water Flow Rate [m3/s]", tmpHeatRecVolFlowRate, "User-Specified Design Hot Water Flow Rate [m3/s]", @@ -1217,7 +1216,7 @@ namespace ChillerExhaustAbsorption { if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpHeatRecVolFlowRate - HeatRecVolFlowRateUser) / HeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + - ExhaustAbsorber(ChillNum).Name); + this->Name); ShowContinueError("User-Specified Design Hot Water Flow Rate of " + General::RoundSigDigits(HeatRecVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Hot Water Flow Rate of " + @@ -1232,9 +1231,9 @@ namespace ChillerExhaustAbsorption { } } } else { - if (ExhaustAbsorber(ChillNum).HeatVolFlowRateWasAutoSized) { + if (this->HeatVolFlowRateWasAutoSized) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + ExhaustAbsorber(ChillNum).Name + + ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller hot water flow rate requires"); ShowContinueError("a heating loop Sizing:Plant object."); @@ -1242,57 +1241,57 @@ namespace ChillerExhaustAbsorption { } } else { if (DataPlant::PlantFinalSizesOkayToReport) { - if (ExhaustAbsorber(ChillNum).HeatVolFlowRate > 0.0) { + if (this->HeatVolFlowRate > 0.0) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "User-Specified Design Hot Water Flow Rate [m3/s]", - ExhaustAbsorber(ChillNum).HeatVolFlowRate); + this->HeatVolFlowRate); } } } } - PlantUtilities::RegisterPlantCompDesignFlow(ExhaustAbsorber(ChillNum).HeatReturnNodeNum, tmpHeatRecVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(this->HeatReturnNodeNum, tmpHeatRecVolFlowRate); if (PltSizCondNum > 0 && PltSizCoolNum > 0) { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { - Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, - ExhaustAbsorber(ChillNum).TempDesCondReturn, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, + this->TempDesCondReturn, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); - rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, - ExhaustAbsorber(ChillNum).TempDesCondReturn, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, + this->TempDesCondReturn, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = - tmpNomCap * (1.0 + ExhaustAbsorber(ChillNum).ThermalEnergyCoolRatio) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); - if (!ExhaustAbsorber(ChillNum).CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = ExhaustAbsorber(ChillNum).CondVolFlowRate; + tmpNomCap * (1.0 + this->ThermalEnergyCoolRatio) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); + if (!this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = this->CondVolFlowRate; } else { - if (ExhaustAbsorber(ChillNum).CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; + if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; } if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (ExhaustAbsorber(ChillNum).CondVolFlowRateWasAutoSized) { - ExhaustAbsorber(ChillNum).CondVolFlowRate = tmpCondVolFlowRate; + if (this->CondVolFlowRateWasAutoSized) { + this->CondVolFlowRate = tmpCondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Initial Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } } else { - if (ExhaustAbsorber(ChillNum).CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { - CondVolFlowRateUser = ExhaustAbsorber(ChillNum).CondVolFlowRate; + if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { + CondVolFlowRateUser = this->CondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate, "User-Specified Design Condenser Water Flow Rate [m3/s]", @@ -1300,7 +1299,7 @@ namespace ChillerExhaustAbsorption { if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + - ExhaustAbsorber(ChillNum).Name); + this->Name); ShowContinueError("User-Specified Design Condenser Water Flow Rate of " + General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Condenser Water Flow Rate of " + @@ -1315,9 +1314,9 @@ namespace ChillerExhaustAbsorption { } } } else { - if (ExhaustAbsorber(ChillNum).CondVolFlowRateWasAutoSized) { + if (this->CondVolFlowRateWasAutoSized) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + ExhaustAbsorber(ChillNum).Name + + ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowSevereError("Autosizing of Exhaust Fired Absorption Chiller condenser flow rate requires a condenser"); ShowContinueError("loop Sizing:Plant object."); @@ -1325,18 +1324,18 @@ namespace ChillerExhaustAbsorption { } } else { if (DataPlant::PlantFinalSizesOkayToReport) { - if (ExhaustAbsorber(ChillNum).CondVolFlowRate > 0.0) { + if (this->CondVolFlowRate > 0.0) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - ExhaustAbsorber(ChillNum).Name, + this->Name, "User-Specified Design Condenser Water Flow Rate [m3/s]", - ExhaustAbsorber(ChillNum).CondVolFlowRate); + this->CondVolFlowRate); } } } } // save the design condenser water volumetric flow rate for use by the condenser water loop sizing algorithms - if (ExhaustAbsorber(ChillNum).isWaterCooled) PlantUtilities::RegisterPlantCompDesignFlow(ExhaustAbsorber(ChillNum).CondReturnNodeNum, tmpCondVolFlowRate); + if (this->isWaterCooled) PlantUtilities::RegisterPlantCompDesignFlow(this->CondReturnNodeNum, tmpCondVolFlowRate); if (ErrorsFound) { ShowFatalError("Preceding sizing errors cause program termination"); @@ -1344,18 +1343,15 @@ namespace ChillerExhaustAbsorption { if (DataPlant::PlantFinalSizesOkayToReport) { // create predefined report - equipName = ExhaustAbsorber(ChillNum).Name; + equipName = this->Name; OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechType, equipName, "ChillerHeater:Absorption:DoubleEffect"); - OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomEff, equipName, ExhaustAbsorber(ChillNum).ThermalEnergyCoolRatio); - OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomCap, equipName, ExhaustAbsorber(ChillNum).NomCoolingCap); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomEff, equipName, this->ThermalEnergyCoolRatio); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomCap, equipName, this->NomCoolingCap); } } - void CalcExhaustAbsorberChillerModel(int &ChillNum, // Absorber number - Real64 &MyLoad, // operating load - bool const EP_UNUSED(RunFlag) // TRUE when Absorber operating - ) - { + void ExhaustAbsorberSpecs::calcChiller(Real64 &MyLoad){ + // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer // DATE WRITTEN March 2001 @@ -1451,36 +1447,36 @@ namespace ChillerExhaustAbsorption { // set node values to data structure values for nodes - lChillReturnNodeNum = ExhaustAbsorber(ChillNum).ChillReturnNodeNum; - lChillSupplyNodeNum = ExhaustAbsorber(ChillNum).ChillSupplyNodeNum; - lCondReturnNodeNum = ExhaustAbsorber(ChillNum).CondReturnNodeNum; - lExhaustAirInletNodeNum = ExhaustAbsorber(ChillNum).ExhaustAirInletNodeNum; + lChillReturnNodeNum = this->ChillReturnNodeNum; + lChillSupplyNodeNum = this->ChillSupplyNodeNum; + lCondReturnNodeNum = this->CondReturnNodeNum; + lExhaustAirInletNodeNum = this->ExhaustAirInletNodeNum; // set local copies of data from rest of input structure - lNomCoolingCap = ExhaustAbsorber(ChillNum).NomCoolingCap; - lThermalEnergyCoolRatio = ExhaustAbsorber(ChillNum).ThermalEnergyCoolRatio; - lThermalEnergyHeatRatio = ExhaustAbsorber(ChillNum).ThermalEnergyHeatRatio; - lElecCoolRatio = ExhaustAbsorber(ChillNum).ElecCoolRatio; - lMinPartLoadRat = ExhaustAbsorber(ChillNum).MinPartLoadRat; - lMaxPartLoadRat = ExhaustAbsorber(ChillNum).MaxPartLoadRat; - lCoolCapFTCurve = ExhaustAbsorber(ChillNum).CoolCapFTCurve; - lThermalEnergyCoolFTCurve = ExhaustAbsorber(ChillNum).ThermalEnergyCoolFTCurve; - lThermalEnergyCoolFPLRCurve = ExhaustAbsorber(ChillNum).ThermalEnergyCoolFPLRCurve; - lElecCoolFTCurve = ExhaustAbsorber(ChillNum).ElecCoolFTCurve; - lElecCoolFPLRCurve = ExhaustAbsorber(ChillNum).ElecCoolFPLRCurve; - lIsEnterCondensTemp = ExhaustAbsorber(ChillNum).isEnterCondensTemp; - lIsWaterCooled = ExhaustAbsorber(ChillNum).isWaterCooled; - lCHWLowLimitTemp = ExhaustAbsorber(ChillNum).CHWLowLimitTemp; - lHeatElectricPower = ExhaustAbsorber(ChillNum).HeatElectricPower; - lHeatThermalEnergyUseRate = ExhaustAbsorber(ChillNum).HeatThermalEnergyUseRate; - lHeatPartLoadRatio = ExhaustAbsorber(ChillNum).HeatPartLoadRatio; + lNomCoolingCap = this->NomCoolingCap; + lThermalEnergyCoolRatio = this->ThermalEnergyCoolRatio; + lThermalEnergyHeatRatio = this->ThermalEnergyHeatRatio; + lElecCoolRatio = this->ElecCoolRatio; + lMinPartLoadRat = this->MinPartLoadRat; + lMaxPartLoadRat = this->MaxPartLoadRat; + lCoolCapFTCurve = this->CoolCapFTCurve; + lThermalEnergyCoolFTCurve = this->ThermalEnergyCoolFTCurve; + lThermalEnergyCoolFPLRCurve = this->ThermalEnergyCoolFPLRCurve; + lElecCoolFTCurve = this->ElecCoolFTCurve; + lElecCoolFPLRCurve = this->ElecCoolFPLRCurve; + lIsEnterCondensTemp = this->isEnterCondensTemp; + lIsWaterCooled = this->isWaterCooled; + lCHWLowLimitTemp = this->CHWLowLimitTemp; + lHeatElectricPower = this->HeatElectricPower; + lHeatThermalEnergyUseRate = this->HeatThermalEnergyUseRate; + lHeatPartLoadRatio = this->HeatPartLoadRatio; // initialize entering conditions lChillReturnTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp; lChillWaterMassFlowRate = DataLoopNode::Node(lChillReturnNodeNum).MassFlowRate; lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { @@ -1494,32 +1490,32 @@ namespace ChillerExhaustAbsorption { lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate; lExhaustAirHumRat = DataLoopNode::Node(lExhaustAirInletNodeNum).HumRat; - Cp_CW = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidName, + Cp_CW = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, lChillReturnTemp, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CWLoopNum).FluidIndex, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); - if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { - Cp_CD = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidName, + if (this->CDLoopNum > 0) { + Cp_CD = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, lChillReturnTemp, - DataPlant::PlantLoop(ExhaustAbsorber(ChillNum).CDLoopNum).FluidIndex, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } // If no loop demand or Absorber OFF, return // will need to modify when absorber can act as a boiler - if (MyLoad >= 0 || !((ExhaustAbsorber(ChillNum).InHeatingMode) || (ExhaustAbsorber(ChillNum).InCoolingMode))) { + if (MyLoad >= 0 || !((this->InHeatingMode) || (this->InCoolingMode))) { // set node temperatures lChillSupplyTemp = lChillReturnTemp; lCondSupplyTemp = lCondReturnTemp; lCondWaterMassFlowRate = 0.0; if (lIsWaterCooled) { PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate, - ExhaustAbsorber(ChillNum).CondReturnNodeNum, - ExhaustAbsorber(ChillNum).CondSupplyNodeNum, - ExhaustAbsorber(ChillNum).CDLoopNum, - ExhaustAbsorber(ChillNum).CDLoopSideNum, - ExhaustAbsorber(ChillNum).CDBranchNum, - ExhaustAbsorber(ChillNum).CDCompNum); + this->CondReturnNodeNum, + this->CondSupplyNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat); @@ -1534,34 +1530,34 @@ namespace ChillerExhaustAbsorption { if (lIsEnterCondensTemp) { calcCondTemp = lCondReturnTemp; } else { - if (ExhaustAbsorber(ChillNum).oldCondSupplyTemp == 0) { - ExhaustAbsorber(ChillNum).oldCondSupplyTemp = lCondReturnTemp + 8.0; // if not previously estimated assume 8C greater than return + if (this->oldCondSupplyTemp == 0) { + this->oldCondSupplyTemp = lCondReturnTemp + 8.0; // if not previously estimated assume 8C greater than return } - calcCondTemp = ExhaustAbsorber(ChillNum).oldCondSupplyTemp; + calcCondTemp = this->oldCondSupplyTemp; } // Set mass flow rates - lCondWaterMassFlowRate = ExhaustAbsorber(ChillNum).DesCondMassFlowRate; + lCondWaterMassFlowRate = this->DesCondMassFlowRate; PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate, - ExhaustAbsorber(ChillNum).CondReturnNodeNum, - ExhaustAbsorber(ChillNum).CondSupplyNodeNum, - ExhaustAbsorber(ChillNum).CDLoopNum, - ExhaustAbsorber(ChillNum).CDLoopSideNum, - ExhaustAbsorber(ChillNum).CDBranchNum, - ExhaustAbsorber(ChillNum).CDCompNum); + this->CondReturnNodeNum, + this->CondSupplyNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } else { // air cooled DataLoopNode::Node(lCondReturnNodeNum).Temp = DataLoopNode::Node(lCondReturnNodeNum).OutAirDryBulb; calcCondTemp = DataLoopNode::Node(lCondReturnNodeNum).OutAirDryBulb; lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp; lCondWaterMassFlowRate = 0.0; - if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { + if (this->CDLoopNum > 0) { PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate, - ExhaustAbsorber(ChillNum).CondReturnNodeNum, - ExhaustAbsorber(ChillNum).CondSupplyNodeNum, - ExhaustAbsorber(ChillNum).CDLoopNum, - ExhaustAbsorber(ChillNum).CDLoopSideNum, - ExhaustAbsorber(ChillNum).CDBranchNum, - ExhaustAbsorber(ChillNum).CDCompNum); + this->CondReturnNodeNum, + this->CondSupplyNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } } @@ -1577,37 +1573,37 @@ namespace ChillerExhaustAbsorption { // chilled water flow, // cooling load taken by the chiller, and // supply temperature - lChillWaterMassflowratemax = ExhaustAbsorber(ChillNum).DesEvapMassFlowRate; + lChillWaterMassflowratemax = this->DesEvapMassFlowRate; - LoopNum = ExhaustAbsorber(ChillNum).CWLoopNum; - LoopSideNum = ExhaustAbsorber(ChillNum).CWLoopSideNum; + LoopNum = this->CWLoopNum; + LoopSideNum = this->CWLoopSideNum; { auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); if (SELECT_CASE_var == 0) { // mass flow rates may be changed by loop components - ExhaustAbsorber(ChillNum).PossibleSubcooling = false; + this->PossibleSubcooling = false; lCoolingLoad = std::abs(MyLoad); if (ChillDeltaTemp != 0.0) { lChillWaterMassFlowRate = std::abs(lCoolingLoad / (Cp_CW * ChillDeltaTemp)); if (lChillWaterMassFlowRate - lChillWaterMassflowratemax > DataBranchAirLoopPlant::MassFlowTolerance) - ExhaustAbsorber(ChillNum).PossibleSubcooling = true; + this->PossibleSubcooling = true; PlantUtilities::SetComponentFlowRate(lChillWaterMassFlowRate, - ExhaustAbsorber(ChillNum).ChillReturnNodeNum, - ExhaustAbsorber(ChillNum).ChillSupplyNodeNum, - ExhaustAbsorber(ChillNum).CWLoopNum, - ExhaustAbsorber(ChillNum).CWLoopSideNum, - ExhaustAbsorber(ChillNum).CWBranchNum, - ExhaustAbsorber(ChillNum).CWCompNum); + this->ChillReturnNodeNum, + this->ChillSupplyNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); } else { lChillWaterMassFlowRate = 0.0; - ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:Cooling\"" + ExhaustAbsorber(ChillNum).Name + + ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:Cooling\"" + this->Name + "\", DeltaTemp = 0 in mass flow calculation", - ExhaustAbsorber(ChillNum).DeltaTempCoolErrCount); + this->DeltaTempCoolErrCount); } lChillSupplyTemp = ChillSupplySetPointTemp; } else if (SELECT_CASE_var == 1) { // mass flow rates may not be changed by loop components lChillWaterMassFlowRate = DataLoopNode::Node(lChillReturnNodeNum).MassFlowRate; - if (ExhaustAbsorber(ChillNum).PossibleSubcooling) { + if (this->PossibleSubcooling) { lCoolingLoad = std::abs(MyLoad); ChillDeltaTemp = lCoolingLoad / lChillWaterMassFlowRate / Cp_CW; @@ -1704,8 +1700,8 @@ namespace ChillerExhaustAbsorption { // lCoolThermalEnergyUseRate , lTowerLoad and lCoolElectricPower will be set to 0.0 if (lExhHeatRecPotentialCool < lCoolThermalEnergyUseRate) { - if (ExhaustAbsorber(ChillNum).ExhTempLTAbsLeavingTempIndex == 0) { - ShowWarningError("ChillerHeater:Absorption:DoubleEffect \"" + ExhaustAbsorber(ChillNum).Name + "\""); + if (this->ExhTempLTAbsLeavingTempIndex == 0) { + ShowWarningError("ChillerHeater:Absorption:DoubleEffect \"" + this->Name + "\""); ShowContinueError( "...Exhaust temperature and flow input from Micro Turbine is not sufficient during cooling to run the chiller "); ShowContinueError("...Value of Exhaust air inlet temp =" + General::TrimSigDigits(lExhaustInTemp, 4) + " C."); @@ -1716,9 +1712,9 @@ namespace ChillerExhaustAbsorption { ShowContinueErrorTimeStamp("... Simulation will continue."); } ShowRecurringWarningErrorAtEnd( - "ChillerHeater:Absorption:DoubleEffect \"" + ExhaustAbsorber(ChillNum).Name + + "ChillerHeater:Absorption:DoubleEffect \"" + this->Name + "\": Exhaust temperature from Micro Turbine is not sufficient to run the chiller during cooling warning continues...", - ExhaustAbsorber(ChillNum).ExhTempLTAbsLeavingTempIndex, + this->ExhTempLTAbsLeavingTempIndex, lExhaustInTemp, AbsLeavingTemp); // If exhaust is not available, it means the avilable thermal energy is 0.0 and Chiller is not available @@ -1736,7 +1732,7 @@ namespace ChillerExhaustAbsorption { lCondSupplyTemp = lCondReturnTemp + lTowerLoad / (lCondWaterMassFlowRate * Cp_CD); } else { ShowSevereError("CalcExhaustAbsorberChillerModel: Condenser flow = 0, for Exhaust Absorber Chiller=" + - ExhaustAbsorber(ChillNum).Name); + this->Name); ShowContinueErrorTimeStamp(""); ShowFatalError("Program Terminates due to previous error condition."); } @@ -1746,7 +1742,7 @@ namespace ChillerExhaustAbsorption { // save the condenser water supply temperature for next iteration if that is used in lookup // and if capacity is large enough error than report problem - ExhaustAbsorber(ChillNum).oldCondSupplyTemp = lCondSupplyTemp; + this->oldCondSupplyTemp = lCondSupplyTemp; if (!lIsEnterCondensTemp) { // calculate the fraction of the estimated error between the capacity based on the previous // iteration's value of condenser supply temperature and the actual calculated condenser supply @@ -1756,9 +1752,9 @@ namespace ChillerExhaustAbsorption { if (revisedEstimateAvailCap > 0.0) { errorAvailCap = std::abs((revisedEstimateAvailCap - lAvailableCoolingCapacity) / revisedEstimateAvailCap); if (errorAvailCap > 0.05) { // if more than 5% error in estimate - ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:\"" + ExhaustAbsorber(ChillNum).Name + + ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:\"" + this->Name + "\", poor Condenser Supply Estimate", - ExhaustAbsorber(ChillNum).CondErrCount, + this->CondErrCount, errorAvailCap, errorAvailCap); } @@ -1766,33 +1762,30 @@ namespace ChillerExhaustAbsorption { } } // IF(MyLoad>=0 .OR. .NOT. RunFlag) // Write into the Report Variables except for nodes - ExhaustAbsorber(ChillNum).CoolingLoad = lCoolingLoad; - ExhaustAbsorber(ChillNum).TowerLoad = lTowerLoad; - ExhaustAbsorber(ChillNum).CoolThermalEnergyUseRate = lCoolThermalEnergyUseRate; - ExhaustAbsorber(ChillNum).CoolElectricPower = lCoolElectricPower; - ExhaustAbsorber(ChillNum).CondReturnTemp = lCondReturnTemp; - ExhaustAbsorber(ChillNum).ChillReturnTemp = lChillReturnTemp; - ExhaustAbsorber(ChillNum).CondSupplyTemp = lCondSupplyTemp; - ExhaustAbsorber(ChillNum).ChillSupplyTemp = lChillSupplyTemp; - ExhaustAbsorber(ChillNum).ChillWaterFlowRate = lChillWaterMassFlowRate; - ExhaustAbsorber(ChillNum).CondWaterFlowRate = lCondWaterMassFlowRate; - ExhaustAbsorber(ChillNum).CoolPartLoadRatio = lCoolPartLoadRatio; - ExhaustAbsorber(ChillNum).CoolingCapacity = lAvailableCoolingCapacity; - ExhaustAbsorber(ChillNum).FractionOfPeriodRunning = lFractionOfPeriodRunning; - ExhaustAbsorber(ChillNum).ExhaustInTemp = lExhaustInTemp; - ExhaustAbsorber(ChillNum).ExhaustInFlow = lExhaustInFlow; - ExhaustAbsorber(ChillNum).ExhHeatRecPotentialCool = lExhHeatRecPotentialCool; + this->CoolingLoad = lCoolingLoad; + this->TowerLoad = lTowerLoad; + this->CoolThermalEnergyUseRate = lCoolThermalEnergyUseRate; + this->CoolElectricPower = lCoolElectricPower; + this->CondReturnTemp = lCondReturnTemp; + this->ChillReturnTemp = lChillReturnTemp; + this->CondSupplyTemp = lCondSupplyTemp; + this->ChillSupplyTemp = lChillSupplyTemp; + this->ChillWaterFlowRate = lChillWaterMassFlowRate; + this->CondWaterFlowRate = lCondWaterMassFlowRate; + this->CoolPartLoadRatio = lCoolPartLoadRatio; + this->CoolingCapacity = lAvailableCoolingCapacity; + this->FractionOfPeriodRunning = lFractionOfPeriodRunning; + this->ExhaustInTemp = lExhaustInTemp; + this->ExhaustInFlow = lExhaustInFlow; + this->ExhHeatRecPotentialCool = lExhHeatRecPotentialCool; // write the combined heating and cooling ThermalEnergy used and electric used - ExhaustAbsorber(ChillNum).ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate; - ExhaustAbsorber(ChillNum).ElectricPower = lCoolElectricPower + lHeatElectricPower; + this->ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate; + this->ElectricPower = lCoolElectricPower + lHeatElectricPower; } - void CalcExhaustAbsorberHeaterModel(int &ChillNum, // Absorber number - Real64 &MyLoad, // operating load - bool const RunFlag // TRUE when Absorber operating - ) - { + void ExhaustAbsorberSpecs::calcHeater(Real64 &MyLoad, bool RunFlag) { + // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer and Michael J. Witte // DATE WRITTEN March 2001 @@ -1866,28 +1859,28 @@ namespace ChillerExhaustAbsorption { // set node values to data structure values for nodes - lHeatReturnNodeNum = ExhaustAbsorber(ChillNum).HeatReturnNodeNum; - lHeatSupplyNodeNum = ExhaustAbsorber(ChillNum).HeatSupplyNodeNum; - lExhaustAirInletNodeNum = ExhaustAbsorber(ChillNum).ExhaustAirInletNodeNum; + lHeatReturnNodeNum = this->HeatReturnNodeNum; + lHeatSupplyNodeNum = this->HeatSupplyNodeNum; + lExhaustAirInletNodeNum = this->ExhaustAirInletNodeNum; // set local copies of data from rest of input structure - lNomCoolingCap = ExhaustAbsorber(ChillNum).NomCoolingCap; - lNomHeatCoolRatio = ExhaustAbsorber(ChillNum).NomHeatCoolRatio; - lThermalEnergyHeatRatio = ExhaustAbsorber(ChillNum).ThermalEnergyHeatRatio; - lElecHeatRatio = ExhaustAbsorber(ChillNum).ElecHeatRatio; - lMinPartLoadRat = ExhaustAbsorber(ChillNum).MinPartLoadRat; - lMaxPartLoadRat = ExhaustAbsorber(ChillNum).MaxPartLoadRat; - lHeatCapFCoolCurve = ExhaustAbsorber(ChillNum).HeatCapFCoolCurve; - lThermalEnergyHeatFHPLRCurve = ExhaustAbsorber(ChillNum).ThermalEnergyHeatFHPLRCurve; - LoopNum = ExhaustAbsorber(ChillNum).HWLoopNum; - LoopSideNum = ExhaustAbsorber(ChillNum).HWLoopSideNum; + lNomCoolingCap = this->NomCoolingCap; + lNomHeatCoolRatio = this->NomHeatCoolRatio; + lThermalEnergyHeatRatio = this->ThermalEnergyHeatRatio; + lElecHeatRatio = this->ElecHeatRatio; + lMinPartLoadRat = this->MinPartLoadRat; + lMaxPartLoadRat = this->MaxPartLoadRat; + lHeatCapFCoolCurve = this->HeatCapFCoolCurve; + lThermalEnergyHeatFHPLRCurve = this->ThermalEnergyHeatFHPLRCurve; + LoopNum = this->HWLoopNum; + LoopSideNum = this->HWLoopSideNum; Cp_HW = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); - lCoolElectricPower = ExhaustAbsorber(ChillNum).CoolElectricPower; - lCoolThermalEnergyUseRate = ExhaustAbsorber(ChillNum).CoolThermalEnergyUseRate; - lCoolPartLoadRatio = ExhaustAbsorber(ChillNum).CoolPartLoadRatio; + lCoolElectricPower = this->CoolElectricPower; + lCoolThermalEnergyUseRate = this->CoolThermalEnergyUseRate; + lCoolPartLoadRatio = this->CoolPartLoadRatio; // initialize entering conditions lHotWaterReturnTemp = DataLoopNode::Node(lHeatReturnNodeNum).Temp; @@ -1914,12 +1907,12 @@ namespace ChillerExhaustAbsorption { // Determine available heating capacity using the current cooling load lAvailableHeatingCapacity = - ExhaustAbsorber(ChillNum).NomHeatCoolRatio * ExhaustAbsorber(ChillNum).NomCoolingCap * - CurveManager::CurveValue(lHeatCapFCoolCurve, (ExhaustAbsorber(ChillNum).CoolingLoad / ExhaustAbsorber(ChillNum).NomCoolingCap)); + this->NomHeatCoolRatio * this->NomCoolingCap * + CurveManager::CurveValue(lHeatCapFCoolCurve, (this->CoolingLoad / this->NomCoolingCap)); // Calculate current load for heating - MyLoad = sign(max(std::abs(MyLoad), ExhaustAbsorber(ChillNum).HeatingCapacity * lMinPartLoadRat), MyLoad); - MyLoad = sign(min(std::abs(MyLoad), ExhaustAbsorber(ChillNum).HeatingCapacity * lMaxPartLoadRat), MyLoad); + MyLoad = sign(max(std::abs(MyLoad), this->HeatingCapacity * lMinPartLoadRat), MyLoad); + MyLoad = sign(min(std::abs(MyLoad), this->HeatingCapacity * lMaxPartLoadRat), MyLoad); // Determine the following variables depending on if the flow has been set in // the nodes (flowlock=1 to 2) or if the amount of load is still be determined (flowlock=0) @@ -1934,18 +1927,18 @@ namespace ChillerExhaustAbsorption { lHotWaterMassFlowRate = std::abs(lHeatingLoad / (Cp_HW * HeatDeltaTemp)); PlantUtilities::SetComponentFlowRate(lHotWaterMassFlowRate, - ExhaustAbsorber(ChillNum).HeatReturnNodeNum, - ExhaustAbsorber(ChillNum).HeatSupplyNodeNum, - ExhaustAbsorber(ChillNum).HWLoopNum, - ExhaustAbsorber(ChillNum).HWLoopSideNum, - ExhaustAbsorber(ChillNum).HWBranchNum, - ExhaustAbsorber(ChillNum).HWCompNum); + this->HeatReturnNodeNum, + this->HeatSupplyNodeNum, + this->HWLoopNum, + this->HWLoopSideNum, + this->HWBranchNum, + this->HWCompNum); } else { lHotWaterMassFlowRate = 0.0; - ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:Heating\"" + ExhaustAbsorber(ChillNum).Name + + ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:Heating\"" + this->Name + "\", DeltaTemp = 0 in mass flow calculation", - ExhaustAbsorber(ChillNum).DeltaTempHeatErrCount); + this->DeltaTempHeatErrCount); } lHotWaterSupplyTemp = HeatSupplySetPointTemp; } else if (SELECT_CASE_var == 1) { // mass flow rates may not be changed by loop components @@ -1997,8 +1990,8 @@ namespace ChillerExhaustAbsorption { CpAir = Psychrometrics::PsyCpAirFnWTdb(lExhaustAirHumRat, lExhaustInTemp); lExhHeatRecPotentialHeat = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp); if (lExhHeatRecPotentialHeat < lHeatThermalEnergyUseRate) { - if (ExhaustAbsorber(ChillNum).ExhTempLTAbsLeavingHeatingTempIndex == 0) { - ShowWarningError("ChillerHeater:Absorption:DoubleEffect \"" + ExhaustAbsorber(ChillNum).Name + "\""); + if (this->ExhTempLTAbsLeavingHeatingTempIndex == 0) { + ShowWarningError("ChillerHeater:Absorption:DoubleEffect \"" + this->Name + "\""); ShowContinueError( "...Exhaust temperature and flow input from Micro Turbine is not sufficient to run the chiller during heating ."); ShowContinueError("...Value of Exhaust air inlet temp =" + General::TrimSigDigits(lExhaustInTemp, 4) + " C."); @@ -2009,9 +2002,9 @@ namespace ChillerExhaustAbsorption { ShowContinueErrorTimeStamp("... Simulation will continue."); } ShowRecurringWarningErrorAtEnd( - "ChillerHeater:Absorption:DoubleEffect \"" + ExhaustAbsorber(ChillNum).Name + + "ChillerHeater:Absorption:DoubleEffect \"" + this->Name + "\": Exhaust temperature from Micro Turbine is not sufficient to run the chiller during heating warning continues...", - ExhaustAbsorber(ChillNum).ExhTempLTAbsLeavingHeatingTempIndex, + this->ExhTempLTAbsLeavingHeatingTempIndex, lExhaustInTemp, AbsLeavingTemp); // If exhaust is not available, it means the avilable thermal energy is 0.0 and Chiller is not available @@ -2029,29 +2022,26 @@ namespace ChillerExhaustAbsorption { } // IF(MyLoad==0 .OR. .NOT. RunFlag) // Write into the Report Variables except for nodes - ExhaustAbsorber(ChillNum).HeatingLoad = lHeatingLoad; - ExhaustAbsorber(ChillNum).HeatThermalEnergyUseRate = lHeatThermalEnergyUseRate; - ExhaustAbsorber(ChillNum).HeatElectricPower = lHeatElectricPower; - ExhaustAbsorber(ChillNum).HotWaterReturnTemp = lHotWaterReturnTemp; - ExhaustAbsorber(ChillNum).HotWaterSupplyTemp = lHotWaterSupplyTemp; - ExhaustAbsorber(ChillNum).HotWaterFlowRate = lHotWaterMassFlowRate; - ExhaustAbsorber(ChillNum).HeatPartLoadRatio = lHeatPartLoadRatio; - ExhaustAbsorber(ChillNum).HeatingCapacity = lAvailableHeatingCapacity; - ExhaustAbsorber(ChillNum).FractionOfPeriodRunning = lFractionOfPeriodRunning; + this->HeatingLoad = lHeatingLoad; + this->HeatThermalEnergyUseRate = lHeatThermalEnergyUseRate; + this->HeatElectricPower = lHeatElectricPower; + this->HotWaterReturnTemp = lHotWaterReturnTemp; + this->HotWaterSupplyTemp = lHotWaterSupplyTemp; + this->HotWaterFlowRate = lHotWaterMassFlowRate; + this->HeatPartLoadRatio = lHeatPartLoadRatio; + this->HeatingCapacity = lAvailableHeatingCapacity; + this->FractionOfPeriodRunning = lFractionOfPeriodRunning; // write the combined heating and cooling ThermalEnergy used and electric used - ExhaustAbsorber(ChillNum).ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate; - ExhaustAbsorber(ChillNum).ElectricPower = lCoolElectricPower + lHeatElectricPower; - ExhaustAbsorber(ChillNum).ExhaustInTemp = lExhaustInTemp; - ExhaustAbsorber(ChillNum).ExhaustInFlow = lExhaustInFlow; - ExhaustAbsorber(ChillNum).ExhHeatRecPotentialHeat = lExhHeatRecPotentialHeat; + this->ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate; + this->ElectricPower = lCoolElectricPower + lHeatElectricPower; + this->ExhaustInTemp = lExhaustInTemp; + this->ExhaustInFlow = lExhaustInFlow; + this->ExhHeatRecPotentialHeat = lExhHeatRecPotentialHeat; } - void UpdateExhaustAbsorberCoolRecords(Real64 const MyLoad, // current load - bool const RunFlag, // TRUE if Absorber operating - int const ChillNum // Absorber number - ) - { + void ExhaustAbsorberSpecs::updateCoolRecords(Real64 MyLoad, bool RunFlag) { + // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer // DATE WRITTEN March 2001 @@ -2067,49 +2057,46 @@ namespace ChillerExhaustAbsorption { int lExhaustAirInletNodeNum; // Node number on the inlet side of the plant Real64 RptConstant; - lChillReturnNodeNum = ExhaustAbsorber(ChillNum).ChillReturnNodeNum; - lChillSupplyNodeNum = ExhaustAbsorber(ChillNum).ChillSupplyNodeNum; - lCondReturnNodeNum = ExhaustAbsorber(ChillNum).CondReturnNodeNum; - lCondSupplyNodeNum = ExhaustAbsorber(ChillNum).CondSupplyNodeNum; + lChillReturnNodeNum = this->ChillReturnNodeNum; + lChillSupplyNodeNum = this->ChillSupplyNodeNum; + lCondReturnNodeNum = this->CondReturnNodeNum; + lCondSupplyNodeNum = this->CondSupplyNodeNum; - lExhaustAirInletNodeNum = ExhaustAbsorber(ChillNum).ExhaustAirInletNodeNum; + lExhaustAirInletNodeNum = this->ExhaustAirInletNodeNum; if (MyLoad == 0 || !RunFlag) { DataLoopNode::Node(lChillSupplyNodeNum).Temp = DataLoopNode::Node(lChillReturnNodeNum).Temp; - if (ExhaustAbsorber(ChillNum).isWaterCooled) { + if (this->isWaterCooled) { DataLoopNode::Node(lCondSupplyNodeNum).Temp = DataLoopNode::Node(lCondReturnNodeNum).Temp; } DataLoopNode::Node(lExhaustAirInletNodeNum).Temp = DataLoopNode::Node(lExhaustAirInletNodeNum).Temp; - DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorber(ChillNum).ExhaustInFlow; + DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = this->ExhaustInFlow; } else { - DataLoopNode::Node(lChillSupplyNodeNum).Temp = ExhaustAbsorber(ChillNum).ChillSupplyTemp; - if (ExhaustAbsorber(ChillNum).isWaterCooled) { - DataLoopNode::Node(lCondSupplyNodeNum).Temp = ExhaustAbsorber(ChillNum).CondSupplyTemp; + DataLoopNode::Node(lChillSupplyNodeNum).Temp = this->ChillSupplyTemp; + if (this->isWaterCooled) { + DataLoopNode::Node(lCondSupplyNodeNum).Temp = this->CondSupplyTemp; } - DataLoopNode::Node(lExhaustAirInletNodeNum).Temp = ExhaustAbsorber(ChillNum).ExhaustInTemp; - DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = ExhaustAbsorber(ChillNum).ExhaustInFlow; + DataLoopNode::Node(lExhaustAirInletNodeNum).Temp = this->ExhaustInTemp; + DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate = this->ExhaustInFlow; } // convert power to energy and instantaneous use to use over the time step RptConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ExhaustAbsorber(ChillNum).CoolingEnergy = ExhaustAbsorber(ChillNum).CoolingLoad * RptConstant; - ExhaustAbsorber(ChillNum).TowerEnergy = ExhaustAbsorber(ChillNum).TowerLoad * RptConstant; - ExhaustAbsorber(ChillNum).ThermalEnergy = ExhaustAbsorber(ChillNum).ThermalEnergyUseRate * RptConstant; - ExhaustAbsorber(ChillNum).CoolThermalEnergy = ExhaustAbsorber(ChillNum).CoolThermalEnergyUseRate * RptConstant; - ExhaustAbsorber(ChillNum).ElectricEnergy = ExhaustAbsorber(ChillNum).ElectricPower * RptConstant; - ExhaustAbsorber(ChillNum).CoolElectricEnergy = ExhaustAbsorber(ChillNum).CoolElectricPower * RptConstant; - if (ExhaustAbsorber(ChillNum).CoolThermalEnergyUseRate != 0.0) { - ExhaustAbsorber(ChillNum).ThermalEnergyCOP = - ExhaustAbsorber(ChillNum).CoolingLoad / ExhaustAbsorber(ChillNum).CoolThermalEnergyUseRate; + this->CoolingEnergy = this->CoolingLoad * RptConstant; + this->TowerEnergy = this->TowerLoad * RptConstant; + this->ThermalEnergy = this->ThermalEnergyUseRate * RptConstant; + this->CoolThermalEnergy = this->CoolThermalEnergyUseRate * RptConstant; + this->ElectricEnergy = this->ElectricPower * RptConstant; + this->CoolElectricEnergy = this->CoolElectricPower * RptConstant; + if (this->CoolThermalEnergyUseRate != 0.0) { + this->ThermalEnergyCOP = + this->CoolingLoad / this->CoolThermalEnergyUseRate; } else { - ExhaustAbsorber(ChillNum).ThermalEnergyCOP = 0.0; + this->ThermalEnergyCOP = 0.0; } } - void UpdateExhaustAbsorberHeatRecords(Real64 const MyLoad, // current load - bool const RunFlag, // TRUE if Absorber operating - int const ChillNum // Absorber number - ) - { + void ExhaustAbsorberSpecs::updateHeatRecords(Real64 MyLoad, bool RunFlag) { + // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer // DATE WRITTEN March 2001 @@ -2122,22 +2109,22 @@ namespace ChillerExhaustAbsorption { int lHeatSupplyNodeNum; // absorber steam outlet node number, water side Real64 RptConstant; - lHeatReturnNodeNum = ExhaustAbsorber(ChillNum).HeatReturnNodeNum; - lHeatSupplyNodeNum = ExhaustAbsorber(ChillNum).HeatSupplyNodeNum; + lHeatReturnNodeNum = this->HeatReturnNodeNum; + lHeatSupplyNodeNum = this->HeatSupplyNodeNum; if (MyLoad == 0 || !RunFlag) { DataLoopNode::Node(lHeatSupplyNodeNum).Temp = DataLoopNode::Node(lHeatReturnNodeNum).Temp; } else { - DataLoopNode::Node(lHeatSupplyNodeNum).Temp = ExhaustAbsorber(ChillNum).HotWaterSupplyTemp; + DataLoopNode::Node(lHeatSupplyNodeNum).Temp = this->HotWaterSupplyTemp; } // convert power to energy and instantaneous use to use over the time step RptConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; - ExhaustAbsorber(ChillNum).HeatingEnergy = ExhaustAbsorber(ChillNum).HeatingLoad * RptConstant; - ExhaustAbsorber(ChillNum).ThermalEnergy = ExhaustAbsorber(ChillNum).ThermalEnergyUseRate * RptConstant; - ExhaustAbsorber(ChillNum).HeatThermalEnergy = ExhaustAbsorber(ChillNum).HeatThermalEnergyUseRate * RptConstant; - ExhaustAbsorber(ChillNum).ElectricEnergy = ExhaustAbsorber(ChillNum).ElectricPower * RptConstant; - ExhaustAbsorber(ChillNum).HeatElectricEnergy = ExhaustAbsorber(ChillNum).HeatElectricPower * RptConstant; + this->HeatingEnergy = this->HeatingLoad * RptConstant; + this->ThermalEnergy = this->ThermalEnergyUseRate * RptConstant; + this->HeatThermalEnergy = this->HeatThermalEnergyUseRate * RptConstant; + this->ElectricEnergy = this->ElectricPower * RptConstant; + this->HeatElectricEnergy = this->HeatElectricPower * RptConstant; } void clear_state() diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.hh b/src/EnergyPlus/ChillerExhaustAbsorption.hh index 62f6bf074da..aa666db94a0 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.hh +++ b/src/EnergyPlus/ChillerExhaustAbsorption.hh @@ -207,6 +207,19 @@ namespace ChillerExhaustAbsorption { ExhaustInTemp(0.0), ExhaustInFlow(0.0), ExhHeatRecPotentialHeat(0.0), ExhHeatRecPotentialCool(0.0) { } + + void initialize(bool RunFlag); + + void size(); + + void calcChiller(Real64 &MyLoad); + + void calcHeater(Real64 &MyLoad, bool RunFlag); + + void updateCoolRecords(Real64 MyLoad, bool RunFlag); + + void updateHeatRecords(Real64 MyLoad, bool RunFlag); + }; extern Array1D ExhaustAbsorber; // dimension to number of machines @@ -229,32 +242,6 @@ namespace ChillerExhaustAbsorption { void GetExhaustAbsorberInput(); - void InitExhaustAbsorber(int ChillNum, // number of the current engine driven chiller being simulated - bool RunFlag // TRUE when chiller operating - ); - - void SizeExhaustAbsorber(int ChillNum); - - void CalcExhaustAbsorberChillerModel(int &ChillNum, // Absorber number - Real64 &MyLoad, // operating load - bool RunFlag // TRUE when Absorber operating - ); - - void CalcExhaustAbsorberHeaterModel(int &ChillNum, // Absorber number - Real64 &MyLoad, // operating load - bool RunFlag // TRUE when Absorber operating - ); - - void UpdateExhaustAbsorberCoolRecords(Real64 MyLoad, // current load - bool RunFlag, // TRUE if Absorber operating - int ChillNum // Absorber number - ); - - void UpdateExhaustAbsorberHeatRecords(Real64 MyLoad, // current load - bool RunFlag, // TRUE if Absorber operating - int ChillNum // Absorber number - ); - void clear_state(); } // namespace ChillerExhaustAbsorption From fa8f1913f705a9379cafca0a53ec305ec68bbc62 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 17 Jan 2020 16:54:48 -0600 Subject: [PATCH 31/41] Move setupOutputVars to separate method --- src/EnergyPlus/ChillerExhaustAbsorption.cc | 475 +++++++++++---------- src/EnergyPlus/ChillerExhaustAbsorption.hh | 2 + 2 files changed, 243 insertions(+), 234 deletions(-) diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index 0c07f26b63f..567d54445a4 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -449,259 +449,261 @@ namespace ChillerExhaustAbsorption { ShowFatalError("Errors found in processing input for " + cCurrentModuleObject); } - for (AbsorberNum = 1; AbsorberNum <= NumExhaustAbsorbers; ++AbsorberNum) { - ChillerName = ExhaustAbsorber(AbsorberNum).Name; - - SetupOutputVariable("Chiller Heater Evaporator Cooling Rate", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).CoolingLoad, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Evaporator Cooling Energy", - OutputProcessor::Unit::J, - ExhaustAbsorber(AbsorberNum).CoolingEnergy, - "System", - "Sum", - ChillerName, - _, - "ENERGYTRANSFER", - "CHILLERS", - _, - "Plant"); - - SetupOutputVariable("Chiller Heater Heating Rate", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).HeatingLoad, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Heating Energy", - OutputProcessor::Unit::J, - ExhaustAbsorber(AbsorberNum).HeatingEnergy, - "System", - "Sum", - ChillerName, - _, - "ENERGYTRANSFER", - "BOILERS", - _, - "Plant"); - - SetupOutputVariable("Chiller Heater Condenser Heat Transfer Rate", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).TowerLoad, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Condenser Heat Transfer Energy", - OutputProcessor::Unit::J, - ExhaustAbsorber(AbsorberNum).TowerEnergy, - "System", - "Sum", - ChillerName, - _, - "ENERGYTRANSFER", - "HEATREJECTION", - _, - "Plant"); - - SetupOutputVariable("Chiller Heater Cooling Source Heat COP", - OutputProcessor::Unit::W_W, - ExhaustAbsorber(AbsorberNum).ThermalEnergyCOP, - "System", - "Average", - ChillerName); - - SetupOutputVariable("Chiller Heater Electric Power", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).ElectricPower, - "System", - "Average", - ChillerName); - // Do not include this on meters, this would duplicate the cool electric and heat electric - SetupOutputVariable("Chiller Heater Electric Energy", - OutputProcessor::Unit::J, - ExhaustAbsorber(AbsorberNum).ElectricEnergy, - "System", - "Sum", - ChillerName); - - SetupOutputVariable("Chiller Heater Cooling Electric Power", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).CoolElectricPower, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Cooling Electric Energy", - OutputProcessor::Unit::J, - ExhaustAbsorber(AbsorberNum).CoolElectricEnergy, - "System", - "Sum", - ChillerName, - _, - "Electricity", - "Cooling", - _, - "Plant"); - - SetupOutputVariable("Chiller Heater Heating Electric Power", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).HeatElectricPower, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Heating Electric Energy", - OutputProcessor::Unit::J, - ExhaustAbsorber(AbsorberNum).HeatElectricEnergy, - "System", - "Sum", - ChillerName, - _, - "Electricity", - "Heating", - _, - "Plant"); - - SetupOutputVariable("Chiller Heater Evaporator Inlet Temperature", - OutputProcessor::Unit::C, - ExhaustAbsorber(AbsorberNum).ChillReturnTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Evaporator Outlet Temperature", - OutputProcessor::Unit::C, - ExhaustAbsorber(AbsorberNum).ChillSupplyTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Evaporator Mass Flow Rate", - OutputProcessor::Unit::kg_s, - ExhaustAbsorber(AbsorberNum).ChillWaterFlowRate, - "System", - "Average", - ChillerName); - - if (ExhaustAbsorber(AbsorberNum).isWaterCooled) { - SetupOutputVariable("Chiller Heater Condenser Inlet Temperature", - OutputProcessor::Unit::C, - ExhaustAbsorber(AbsorberNum).CondReturnTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Condenser Outlet Temperature", - OutputProcessor::Unit::C, - ExhaustAbsorber(AbsorberNum).CondSupplyTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Condenser Mass Flow Rate", - OutputProcessor::Unit::kg_s, - ExhaustAbsorber(AbsorberNum).CondWaterFlowRate, - "System", - "Average", - ChillerName); - } else { - SetupOutputVariable("Chiller Heater Condenser Inlet Temperature", - OutputProcessor::Unit::C, - ExhaustAbsorber(AbsorberNum).CondReturnTemp, - "System", - "Average", - ChillerName); - } + } - SetupOutputVariable("Chiller Heater Heating Inlet Temperature", + void ExhaustAbsorberSpecs::setupOutputVariables() + { + std::string const ChillerName = this->Name; + + SetupOutputVariable("Chiller Heater Evaporator Cooling Rate", + OutputProcessor::Unit::W, + this->CoolingLoad, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Evaporator Cooling Energy", + OutputProcessor::Unit::J, + this->CoolingEnergy, + "System", + "Sum", + ChillerName, + _, + "ENERGYTRANSFER", + "CHILLERS", + _, + "Plant"); + + SetupOutputVariable("Chiller Heater Heating Rate", + OutputProcessor::Unit::W, + this->HeatingLoad, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Heating Energy", + OutputProcessor::Unit::J, + this->HeatingEnergy, + "System", + "Sum", + ChillerName, + _, + "ENERGYTRANSFER", + "BOILERS", + _, + "Plant"); + + SetupOutputVariable("Chiller Heater Condenser Heat Transfer Rate", + OutputProcessor::Unit::W, + this->TowerLoad, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Condenser Heat Transfer Energy", + OutputProcessor::Unit::J, + this->TowerEnergy, + "System", + "Sum", + ChillerName, + _, + "ENERGYTRANSFER", + "HEATREJECTION", + _, + "Plant"); + + SetupOutputVariable("Chiller Heater Cooling Source Heat COP", + OutputProcessor::Unit::W_W, + this->ThermalEnergyCOP, + "System", + "Average", + ChillerName); + + SetupOutputVariable("Chiller Heater Electric Power", + OutputProcessor::Unit::W, + this->ElectricPower, + "System", + "Average", + ChillerName); + // Do not include this on meters, this would duplicate the cool electric and heat electric + SetupOutputVariable("Chiller Heater Electric Energy", + OutputProcessor::Unit::J, + this->ElectricEnergy, + "System", + "Sum", + ChillerName); + + SetupOutputVariable("Chiller Heater Cooling Electric Power", + OutputProcessor::Unit::W, + this->CoolElectricPower, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Cooling Electric Energy", + OutputProcessor::Unit::J, + this->CoolElectricEnergy, + "System", + "Sum", + ChillerName, + _, + "Electricity", + "Cooling", + _, + "Plant"); + + SetupOutputVariable("Chiller Heater Heating Electric Power", + OutputProcessor::Unit::W, + this->HeatElectricPower, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Heating Electric Energy", + OutputProcessor::Unit::J, + this->HeatElectricEnergy, + "System", + "Sum", + ChillerName, + _, + "Electricity", + "Heating", + _, + "Plant"); + + SetupOutputVariable("Chiller Heater Evaporator Inlet Temperature", + OutputProcessor::Unit::C, + this->ChillReturnTemp, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Evaporator Outlet Temperature", + OutputProcessor::Unit::C, + this->ChillSupplyTemp, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Evaporator Mass Flow Rate", + OutputProcessor::Unit::kg_s, + this->ChillWaterFlowRate, + "System", + "Average", + ChillerName); + + if (this->isWaterCooled) { + SetupOutputVariable("Chiller Heater Condenser Inlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorber(AbsorberNum).HotWaterReturnTemp, + this->CondReturnTemp, "System", "Average", ChillerName); - SetupOutputVariable("Chiller Heater Heating Outlet Temperature", + SetupOutputVariable("Chiller Heater Condenser Outlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorber(AbsorberNum).HotWaterSupplyTemp, + this->CondSupplyTemp, "System", "Average", ChillerName); - SetupOutputVariable("Chiller Heater Heating Mass Flow Rate", + SetupOutputVariable("Chiller Heater Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, - ExhaustAbsorber(AbsorberNum).HotWaterFlowRate, - "System", - "Average", - ChillerName); - - SetupOutputVariable("Chiller Heater Cooling Part Load Ratio", - OutputProcessor::Unit::None, - ExhaustAbsorber(AbsorberNum).CoolPartLoadRatio, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Maximum Cooling Rate", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).CoolingCapacity, + this->CondWaterFlowRate, "System", "Average", ChillerName); - SetupOutputVariable("Chiller Heater Heating Part Load Ratio", - OutputProcessor::Unit::None, - ExhaustAbsorber(AbsorberNum).HeatPartLoadRatio, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Maximum Heating Rate", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).HeatingCapacity, - "System", - "Average", - ChillerName); - - SetupOutputVariable("Chiller Heater Runtime Fraction", - OutputProcessor::Unit::None, - ExhaustAbsorber(AbsorberNum).FractionOfPeriodRunning, - "System", - "Average", - ChillerName); - - SetupOutputVariable("Chiller Heater Source Exhaust Inlet Temperature", + } else { + SetupOutputVariable("Chiller Heater Condenser Inlet Temperature", OutputProcessor::Unit::C, - ExhaustAbsorber(AbsorberNum).ExhaustInTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Source Exhaust Inlet Mass Flow Rate", - OutputProcessor::Unit::kg_s, - ExhaustAbsorber(AbsorberNum).ExhaustInFlow, - "System", - "Average", - ChillerName); - - SetupOutputVariable("Chiller Heater Heating Heat Recovery Potential Rate", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).ExhHeatRecPotentialHeat, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Cooling Heat Recovery Potential Rate", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).ExhHeatRecPotentialCool, - "System", - "Average", - ChillerName); - - SetupOutputVariable("Chiller Heater Cooling Source Heat Transfer Rate", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).CoolThermalEnergyUseRate, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Heating Source Heat Transfer Rate", - OutputProcessor::Unit::W, - ExhaustAbsorber(AbsorberNum).HeatThermalEnergyUseRate, + this->CondReturnTemp, "System", "Average", ChillerName); } - } + SetupOutputVariable("Chiller Heater Heating Inlet Temperature", + OutputProcessor::Unit::C, + this->HotWaterReturnTemp, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Heating Outlet Temperature", + OutputProcessor::Unit::C, + this->HotWaterSupplyTemp, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Heating Mass Flow Rate", + OutputProcessor::Unit::kg_s, + this->HotWaterFlowRate, + "System", + "Average", + ChillerName); + + SetupOutputVariable("Chiller Heater Cooling Part Load Ratio", + OutputProcessor::Unit::None, + this->CoolPartLoadRatio, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Maximum Cooling Rate", + OutputProcessor::Unit::W, + this->CoolingCapacity, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Heating Part Load Ratio", + OutputProcessor::Unit::None, + this->HeatPartLoadRatio, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Maximum Heating Rate", + OutputProcessor::Unit::W, + this->HeatingCapacity, + "System", + "Average", + ChillerName); + + SetupOutputVariable("Chiller Heater Runtime Fraction", + OutputProcessor::Unit::None, + this->FractionOfPeriodRunning, + "System", + "Average", + ChillerName); + + SetupOutputVariable("Chiller Heater Source Exhaust Inlet Temperature", + OutputProcessor::Unit::C, + this->ExhaustInTemp, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Source Exhaust Inlet Mass Flow Rate", + OutputProcessor::Unit::kg_s, + this->ExhaustInFlow, + "System", + "Average", + ChillerName); + + SetupOutputVariable("Chiller Heater Heating Heat Recovery Potential Rate", + OutputProcessor::Unit::W, + this->ExhHeatRecPotentialHeat, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Cooling Heat Recovery Potential Rate", + OutputProcessor::Unit::W, + this->ExhHeatRecPotentialCool, + "System", + "Average", + ChillerName); + + SetupOutputVariable("Chiller Heater Cooling Source Heat Transfer Rate", + OutputProcessor::Unit::W, + this->CoolThermalEnergyUseRate, + "System", + "Average", + ChillerName); + SetupOutputVariable("Chiller Heater Heating Source Heat Transfer Rate", + OutputProcessor::Unit::W, + this->HeatThermalEnergyUseRate, + "System", + "Average", + ChillerName); + } + void ExhaustAbsorberSpecs::initialize(bool const EP_UNUSED(RunFlag)) { @@ -730,6 +732,11 @@ namespace ChillerExhaustAbsorption { Real64 rho; // local fluid density Real64 mdot; // lcoal fluid mass flow rate + if (this->oneTimeInit) { + this->setupOutputVariables(); + this->oneTimeInit = false; + } + // Init more variables if (this->plantScanInit) { // Locate the chillers on the plant loops for later usage diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.hh b/src/EnergyPlus/ChillerExhaustAbsorption.hh index aa666db94a0..f852fa92a77 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.hh +++ b/src/EnergyPlus/ChillerExhaustAbsorption.hh @@ -210,6 +210,8 @@ namespace ChillerExhaustAbsorption { void initialize(bool RunFlag); + void setupOutputVariables(); + void size(); void calcChiller(Real64 &MyLoad); From ad31165851aa43573aa3176584a3afaa0bbed67a Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 17 Jan 2020 17:11:32 -0600 Subject: [PATCH 32/41] Move to PlantComponent interface --- src/EnergyPlus/ChillerExhaustAbsorption.cc | 195 ++++++++++----------- src/EnergyPlus/ChillerExhaustAbsorption.hh | 34 ++-- src/EnergyPlus/Plant/PlantManager.cc | 2 + src/EnergyPlus/PlantLoopEquip.cc | 31 +--- 4 files changed, 113 insertions(+), 149 deletions(-) diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index 567d54445a4..3980b93773e 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -117,120 +117,113 @@ namespace ChillerExhaustAbsorption { // Object Data Array1D ExhaustAbsorber; // dimension to number of machines bool Sim_GetInput(true); // then TRUE, calls subroutine to read input file. - - void SimExhaustAbsorber(std::string const &EP_UNUSED(AbsorberType), // type of Absorber - std::string const &AbsorberName, // user specified name of Absorber - int const EP_UNUSED(EquipFlowCtrl), // Flow control mode for the equipment - int &CompIndex, // Absorber number counter - bool const RunFlag, // simulate Absorber when TRUE - bool const FirstIteration, // initialize variables when TRUE - bool &InitLoopEquip, // If not false, calculate the max load for operating conditions - Real64 &MyLoad, // loop demand component will meet - int const BranchInletNodeNum, // node number of inlet to calling branch, - Real64 &MaxCap, // W - maximum operating capacity of Absorber - Real64 &MinCap, // W - minimum operating capacity of Absorber - Real64 &OptCap, // W - optimal operating capacity of Absorber - bool const GetSizingFactor, // TRUE when just the sizing factor is requested - Real64 &SizingFactor // sizing factor - ) - { - // SUBROUTINE INFORMATION: - // AUTHOR Jason Glazer - // DATE WRITTEN March 2001 - // MODIFIED Mahabir Bhandari, ORNL, Aug 2011, modified to accomodate Exhaust Fired Double Effect Absorption Chiller - // RE-ENGINEERED na - - // PURPOSE OF THIS SUBROUTINE: This is the Absorption Chiller model driver. It - // gets the input for the models, initializes simulation variables, call - // the appropriate model and sets up reporting variables. - - int ChillNum; // Absorber number counter - - // Get Absorber data from input file + + PlantComponent *ExhaustAbsorberSpecs::factory(std::string const &objectName) { + // Process the input data if it hasn't been done already if (Sim_GetInput) { GetExhaustAbsorberInput(); Sim_GetInput = false; } - - // Find the correct Equipment - if (CompIndex == 0) { - ChillNum = UtilityRoutines::FindItemInList(AbsorberName, ExhaustAbsorber); - if (ChillNum == 0) { - ShowFatalError("SimExhaustAbsorber: Unit not found=" + AbsorberName); - } - CompIndex = ChillNum; - } else { - ChillNum = CompIndex; - } - - auto &thisChiller = ExhaustAbsorber(ChillNum); - - // Check that this is a valid call - if (InitLoopEquip) { - - thisChiller.initialize(RunFlag); - - // Match inlet node name of calling branch to determine if this call is for heating or cooling - if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).ChillReturnNodeNum) { // Operate as chiller - thisChiller.size(); // only call from chilled water loop - MinCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).MinPartLoadRat; - MaxCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).MaxPartLoadRat; - OptCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).OptPartLoadRat; - } else if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).HeatReturnNodeNum) { // Operate as heater - Real64 Sim_HeatCap = ExhaustAbsorber(ChillNum).NomCoolingCap * ExhaustAbsorber(ChillNum).NomHeatCoolRatio; // W - nominal heating capacity - MinCap = Sim_HeatCap * ExhaustAbsorber(ChillNum).MinPartLoadRat; - MaxCap = Sim_HeatCap * ExhaustAbsorber(ChillNum).MaxPartLoadRat; - OptCap = Sim_HeatCap * ExhaustAbsorber(ChillNum).OptPartLoadRat; - } else if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).CondReturnNodeNum) { // called from condenser loop - MinCap = 0.0; - MaxCap = 0.0; - OptCap = 0.0; - } else { // Error, nodes do not match - ShowSevereError("SimExhaustAbsorber: Invalid call to Exhaust Absorbtion Chiller-Heater " + AbsorberName); - ShowContinueError("Node connections in branch are not consistent with object nodes."); - ShowFatalError("Preceding conditions cause termination."); - } // Operate as Chiller or Heater - if (GetSizingFactor) { - SizingFactor = ExhaustAbsorber(ChillNum).SizFac; + // Now look for this particular pipe in the list + for (auto &comp : ExhaustAbsorber) { + if (comp.Name == objectName) { + return ∁ } - return; } - + // If we didn't find it, fatal + ShowFatalError("LocalExhaustAbsorberFactory: Error getting inputs for comp named: " + objectName); // LCOV_EXCL_LINE + // Shut up the compiler + return nullptr; // LCOV_EXCL_LINE + } + + void ExhaustAbsorberSpecs::simulate(const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) { + + // kind of a hacky way to find the location of this, but it's what plantloopequip was doing + int BranchInletNodeNum = + DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn; + // Match inlet node name of calling branch to determine if this call is for heating or cooling - if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).ChillReturnNodeNum) { // Operate as chiller - // Calculate Node Values - // Calculate Equipment and Update Variables - ExhaustAbsorber(ChillNum).InCoolingMode = RunFlag != 0; - thisChiller.initialize(RunFlag); - thisChiller.calcChiller(MyLoad); - thisChiller.updateCoolRecords(MyLoad, RunFlag); - } else if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).HeatReturnNodeNum) { // Operate as heater - // Calculate Node Values - // Calculate Equipment and Update Variables - ExhaustAbsorber(ChillNum).InHeatingMode = RunFlag != 0; - thisChiller.initialize(RunFlag); - thisChiller.calcHeater(MyLoad, RunFlag); - thisChiller.updateHeatRecords(MyLoad, RunFlag); - } else if (BranchInletNodeNum == ExhaustAbsorber(ChillNum).CondReturnNodeNum) { // called from condenser loop - if (ExhaustAbsorber(ChillNum).CDLoopNum > 0) { - PlantUtilities::UpdateChillerComponentCondenserSide(ExhaustAbsorber(ChillNum).CDLoopNum, - ExhaustAbsorber(ChillNum).CDLoopSideNum, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - ExhaustAbsorber(ChillNum).CondReturnNodeNum, - ExhaustAbsorber(ChillNum).CondSupplyNodeNum, - ExhaustAbsorber(ChillNum).TowerLoad, - ExhaustAbsorber(ChillNum).CondReturnTemp, - ExhaustAbsorber(ChillNum).CondSupplyTemp, - ExhaustAbsorber(ChillNum).CondWaterFlowRate, - FirstIteration); + if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller + this->InCoolingMode = RunFlag != 0; + this->initialize(); + this->calcChiller(CurLoad); + this->updateCoolRecords(CurLoad, RunFlag); + } else if (BranchInletNodeNum == this->HeatReturnNodeNum) { // Operate as heater + this->InHeatingMode = RunFlag != 0; + this->initialize(); + this->calcHeater(CurLoad, RunFlag); + this->updateHeatRecords(CurLoad, RunFlag); + } else if (BranchInletNodeNum == this->CondReturnNodeNum) { // called from condenser loop + if (this->CDLoopNum > 0) { + PlantUtilities::UpdateChillerComponentCondenserSide(this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + this->CondReturnNodeNum, + this->CondSupplyNodeNum, + this->TowerLoad, + this->CondReturnTemp, + this->CondSupplyTemp, + this->CondWaterFlowRate, + FirstHVACIteration); } } else { // Error, nodes do not match - ShowSevereError("Invalid call to Exhaust Absorber Chiller " + AbsorberName); + ShowSevereError("Invalid call to Exhaust Absorber Chiller " + this->Name); + ShowContinueError("Node connections in branch are not consistent with object nodes."); + ShowFatalError("Preceding conditions cause termination."); + } + } + + void ExhaustAbsorberSpecs::getDesignCapacities(const PlantLocation &calledFromLocation, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) { + + // kind of a hacky way to find the location of this, but it's what plantloopequip was doing + int BranchInletNodeNum = + DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn; + + // Match inlet node name of calling branch to determine if this call is for heating or cooling + if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller + MinLoad = this->NomCoolingCap * this->MinPartLoadRat; + MaxLoad = this->NomCoolingCap * this->MaxPartLoadRat; + OptLoad = this->NomCoolingCap * this->OptPartLoadRat; + } else if (BranchInletNodeNum == this->HeatReturnNodeNum) { // Operate as heater + Real64 Sim_HeatCap = this->NomCoolingCap * this->NomHeatCoolRatio; // W - nominal heating capacity + MinLoad = Sim_HeatCap * this->MinPartLoadRat; + MaxLoad = Sim_HeatCap * this->MaxPartLoadRat; + OptLoad = Sim_HeatCap * this->OptPartLoadRat; + } else if (BranchInletNodeNum == this->CondReturnNodeNum) { // called from condenser loop + MinLoad = 0.0; + MaxLoad = 0.0; + OptLoad = 0.0; + } else { // Error, nodes do not match + ShowSevereError("SimExhaustAbsorber: Invalid call to Exhaust Absorbtion Chiller-Heater " + this->Name); ShowContinueError("Node connections in branch are not consistent with object nodes."); ShowFatalError("Preceding conditions cause termination."); + } // Operate as Chiller or Heater + + } + + void ExhaustAbsorberSpecs::getSizingFactor(Real64 &_SizFac) { + _SizFac = this->SizFac; + } + + void ExhaustAbsorberSpecs::onInitLoopEquip(const PlantLocation &calledFromLocation) { + this->initialize(); + + // kind of a hacky way to find the location of this, but it's what plantloopequip was doing + int BranchInletNodeNum = + DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn; + + if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller + this->size(); // only call from chilled water loop + } else { + // don't do anything here } } + + void ExhaustAbsorberSpecs::getDesignTemperatures(Real64 &TempDesCondIn, Real64 &TempDesEvapOut) { + TempDesEvapOut = this->TempDesCHWSupply; + TempDesCondIn = this->TempDesCondReturn; + } void GetExhaustAbsorberInput() { @@ -704,7 +697,7 @@ namespace ChillerExhaustAbsorption { ChillerName); } - void ExhaustAbsorberSpecs::initialize(bool const EP_UNUSED(RunFlag)) + void ExhaustAbsorberSpecs::initialize() { // SUBROUTINE INFORMATION: diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.hh b/src/EnergyPlus/ChillerExhaustAbsorption.hh index f852fa92a77..b09ebec70c7 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.hh +++ b/src/EnergyPlus/ChillerExhaustAbsorption.hh @@ -54,12 +54,14 @@ // EnergyPlus Headers #include #include +#include +#include namespace EnergyPlus { namespace ChillerExhaustAbsorption { - struct ExhaustAbsorberSpecs + struct ExhaustAbsorberSpecs : PlantComponent { // Members // Parts of Type that do not correspond with IDD definition @@ -208,7 +210,19 @@ namespace ChillerExhaustAbsorption { { } - void initialize(bool RunFlag); + static PlantComponent *factory(std::string const &objectName); + + void simulate(const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) override; + + void getDesignCapacities(const PlantLocation &calledFromLocation, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) override; + + void getSizingFactor(Real64 &SizFac) override; + + void onInitLoopEquip(const PlantLocation &calledFromLocation) override; + + void getDesignTemperatures(Real64 &TempDesCondIn, Real64 &TempDesEvapOut) override; + + void initialize(); void setupOutputVariables(); @@ -226,22 +240,6 @@ namespace ChillerExhaustAbsorption { extern Array1D ExhaustAbsorber; // dimension to number of machines - void SimExhaustAbsorber(std::string const &AbsorberType, // type of Absorber - std::string const &AbsorberName, // user specified name of Absorber - int EquipFlowCtrl, // Flow control mode for the equipment - int &CompIndex, // Absorber number counter - bool RunFlag, // simulate Absorber when TRUE - bool FirstIteration, // initialize variables when TRUE - bool &InitLoopEquip, // If not false, calculate the max load for operating conditions - Real64 &MyLoad, // loop demand component will meet - int BranchInletNodeNum, // node number of inlet to calling branch, - Real64 &MaxCap, // W - maximum operating capacity of Absorber - Real64 &MinCap, // W - minimum operating capacity of Absorber - Real64 &OptCap, // W - optimal operating capacity of Absorber - bool GetSizingFactor, // TRUE when just the sizing factor is requested - Real64 &SizingFactor // sizing factor - ); - void GetExhaustAbsorberInput(); void clear_state(); diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index d2e20849573..e7af401e041 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -973,6 +974,7 @@ namespace EnergyPlus { "ChillerHeater:Absorption:DoubleEffect")) { this_comp.TypeOf_Num = TypeOf_Chiller_ExhFiredAbsorption; this_comp.GeneralEquipType = GenEquipTypes_Chiller; + this_comp.compPtr = ChillerExhaustAbsorption::ExhaustAbsorberSpecs::factory(CompNames(CompNum)); } else if (UtilityRoutines::SameString(this_comp_type, "ThermalStorage:ChilledWater:Mixed")) { this_comp.TypeOf_Num = TypeOf_ChilledWaterTankMixed; diff --git a/src/EnergyPlus/PlantLoopEquip.cc b/src/EnergyPlus/PlantLoopEquip.cc index f5a19b10d70..714e84fa2c5 100644 --- a/src/EnergyPlus/PlantLoopEquip.cc +++ b/src/EnergyPlus/PlantLoopEquip.cc @@ -177,14 +177,7 @@ namespace PlantLoopEquip { // na // Using/Aliasing - using ChillerExhaustAbsorption::SimExhaustAbsorber; using ChillerReformulatedEIR::SimReformulatedEIRChiller; - using Pumps::SimPumps; - using ScheduleManager::GetCurrentScheduleValue; - using BaseboardRadiator::UpdateBaseboardPlantConnection; - using HWBaseboardRadiator::UpdateHWBaseboardPlantConnection; - using SteamBaseboardRadiator::UpdateSteamBaseboardPlantConnection; - using WaterCoils::UpdateWaterToAirCoilPlantConnection; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int EquipNum; // Plant side component list equipment number @@ -356,29 +349,7 @@ namespace PlantLoopEquip { // Exhaust Fired Absorption Chiller } else if (EquipTypeNum == TypeOf_Chiller_ExhFiredAbsorption) { - SimExhaustAbsorber(sim_component.TypeOf, - sim_component.Name, - EquipFlowCtrl, - EquipNum, - RunFlag, - FirstHVACIteration, - InitLoopEquip, - CurLoad, - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumIn, - MaxLoad, - MinLoad, - OptLoad, - GetCompSizFac, - SizingFac); // DSU - if (InitLoopEquip) { - sim_component.MaxLoad = MaxLoad; - sim_component.MinLoad = MinLoad; - sim_component.OptLoad = OptLoad; - sim_component.CompNum = EquipNum; - } - if (GetCompSizFac) { - sim_component.SizFac = SizingFac; - } + sim_component.compPtr->simulate(sim_component_location, FirstHVACIteration, CurLoad, RunFlag); } else { ShowSevereError("SimPlantEquip: Invalid Chiller Type=" + sim_component.TypeOf); From efd149fdf27a302fdf9d315a2487f7b1489d68ff Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 17 Jan 2020 17:12:04 -0600 Subject: [PATCH 33/41] Apply style --- src/EnergyPlus/ChillerExhaustAbsorption.cc | 796 +++++++++------------ src/EnergyPlus/ChillerExhaustAbsorption.hh | 13 +- 2 files changed, 348 insertions(+), 461 deletions(-) diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index 3980b93773e..bf1c1f77cff 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -116,9 +116,10 @@ namespace ChillerExhaustAbsorption { // Object Data Array1D ExhaustAbsorber; // dimension to number of machines - bool Sim_GetInput(true); // then TRUE, calls subroutine to read input file. - - PlantComponent *ExhaustAbsorberSpecs::factory(std::string const &objectName) { + bool Sim_GetInput(true); // then TRUE, calls subroutine to read input file. + + PlantComponent *ExhaustAbsorberSpecs::factory(std::string const &objectName) + { // Process the input data if it hasn't been done already if (Sim_GetInput) { GetExhaustAbsorberInput(); @@ -135,13 +136,14 @@ namespace ChillerExhaustAbsorption { // Shut up the compiler return nullptr; // LCOV_EXCL_LINE } - - void ExhaustAbsorberSpecs::simulate(const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) { - + + void ExhaustAbsorberSpecs::simulate(const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) + { + // kind of a hacky way to find the location of this, but it's what plantloopequip was doing int BranchInletNodeNum = DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn; - + // Match inlet node name of calling branch to determine if this call is for heating or cooling if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller this->InCoolingMode = RunFlag != 0; @@ -173,19 +175,20 @@ namespace ChillerExhaustAbsorption { ShowFatalError("Preceding conditions cause termination."); } } - - void ExhaustAbsorberSpecs::getDesignCapacities(const PlantLocation &calledFromLocation, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) { - + + void ExhaustAbsorberSpecs::getDesignCapacities(const PlantLocation &calledFromLocation, Real64 &MaxLoad, Real64 &MinLoad, Real64 &OptLoad) + { + // kind of a hacky way to find the location of this, but it's what plantloopequip was doing int BranchInletNodeNum = DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn; - + // Match inlet node name of calling branch to determine if this call is for heating or cooling if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller MinLoad = this->NomCoolingCap * this->MinPartLoadRat; MaxLoad = this->NomCoolingCap * this->MaxPartLoadRat; OptLoad = this->NomCoolingCap * this->OptPartLoadRat; - } else if (BranchInletNodeNum == this->HeatReturnNodeNum) { // Operate as heater + } else if (BranchInletNodeNum == this->HeatReturnNodeNum) { // Operate as heater Real64 Sim_HeatCap = this->NomCoolingCap * this->NomHeatCoolRatio; // W - nominal heating capacity MinLoad = Sim_HeatCap * this->MinPartLoadRat; MaxLoad = Sim_HeatCap * this->MaxPartLoadRat; @@ -199,14 +202,15 @@ namespace ChillerExhaustAbsorption { ShowContinueError("Node connections in branch are not consistent with object nodes."); ShowFatalError("Preceding conditions cause termination."); } // Operate as Chiller or Heater - } - - void ExhaustAbsorberSpecs::getSizingFactor(Real64 &_SizFac) { + + void ExhaustAbsorberSpecs::getSizingFactor(Real64 &_SizFac) + { _SizFac = this->SizFac; } - - void ExhaustAbsorberSpecs::onInitLoopEquip(const PlantLocation &calledFromLocation) { + + void ExhaustAbsorberSpecs::onInitLoopEquip(const PlantLocation &calledFromLocation) + { this->initialize(); // kind of a hacky way to find the location of this, but it's what plantloopequip was doing @@ -214,13 +218,14 @@ namespace ChillerExhaustAbsorption { DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn; if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller - this->size(); // only call from chilled water loop + this->size(); // only call from chilled water loop } else { // don't do anything here } } - - void ExhaustAbsorberSpecs::getDesignTemperatures(Real64 &TempDesCondIn, Real64 &TempDesEvapOut) { + + void ExhaustAbsorberSpecs::getDesignTemperatures(Real64 &TempDesCondIn, Real64 &TempDesEvapOut) + { TempDesEvapOut = this->TempDesCHWSupply; TempDesCondIn = this->TempDesCondReturn; } @@ -250,10 +255,10 @@ namespace ChillerExhaustAbsorption { using OutAirNodeManager::CheckAndAddAirNodeNumber; // LOCAL VARIABLES - int AbsorberNum; // Absorber counter - int NumAlphas; // Number of elements in the alpha array - int NumNums; // Number of elements in the numeric array - int IOStat; // IO Status when calling get input subroutine + int AbsorberNum; // Absorber counter + int NumAlphas; // Number of elements in the alpha array + int NumNums; // Number of elements in the numeric array + int IOStat; // IO Status when calling get input subroutine std::string ChillerName; bool Okay; bool Get_ErrorsFound(false); @@ -307,16 +312,40 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorber(AbsorberNum).ElecHeatRatio = rNumericArgs(6); // Assign Node Numbers to specified nodes - ExhaustAbsorber(AbsorberNum).ChillReturnNodeNum = GetOnlySingleNode( - cAlphaArgs(2), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); - ExhaustAbsorber(AbsorberNum).ChillSupplyNodeNum = GetOnlySingleNode( - cAlphaArgs(3), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 1, DataLoopNode::ObjectIsNotParent); + ExhaustAbsorber(AbsorberNum).ChillReturnNodeNum = GetOnlySingleNode(cAlphaArgs(2), + Get_ErrorsFound, + cCurrentModuleObject, + cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Inlet, + 1, + DataLoopNode::ObjectIsNotParent); + ExhaustAbsorber(AbsorberNum).ChillSupplyNodeNum = GetOnlySingleNode(cAlphaArgs(3), + Get_ErrorsFound, + cCurrentModuleObject, + cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Outlet, + 1, + DataLoopNode::ObjectIsNotParent); TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(2), cAlphaArgs(3), "Chilled Water Nodes"); // Condenser node processing depends on condenser type, see below - ExhaustAbsorber(AbsorberNum).HeatReturnNodeNum = GetOnlySingleNode( - cAlphaArgs(6), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 3, DataLoopNode::ObjectIsNotParent); - ExhaustAbsorber(AbsorberNum).HeatSupplyNodeNum = GetOnlySingleNode( - cAlphaArgs(7), Get_ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 3, DataLoopNode::ObjectIsNotParent); + ExhaustAbsorber(AbsorberNum).HeatReturnNodeNum = GetOnlySingleNode(cAlphaArgs(6), + Get_ErrorsFound, + cCurrentModuleObject, + cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Inlet, + 3, + DataLoopNode::ObjectIsNotParent); + ExhaustAbsorber(AbsorberNum).HeatSupplyNodeNum = GetOnlySingleNode(cAlphaArgs(7), + Get_ErrorsFound, + cCurrentModuleObject, + cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Outlet, + 3, + DataLoopNode::ObjectIsNotParent); TestCompSet(cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(6), cAlphaArgs(7), "Hot Water Nodes"); if (Get_ErrorsFound) { ShowFatalError("Errors found in processing node input for " + cCurrentModuleObject + '=' + cAlphaArgs(1)); @@ -434,26 +463,21 @@ namespace ChillerExhaustAbsorption { ExhaustAbsorber(AbsorberNum).ExhuastSourceName = cAlphaArgs(18); auto thisMTG = MicroturbineElectricGenerator::MTGeneratorSpecs::factory(ExhaustAbsorber(AbsorberNum).ExhuastSourceName); - ExhaustAbsorber(AbsorberNum).ExhaustAirInletNodeNum =dynamic_cast (thisMTG)->CombustionAirOutletNodeNum; + ExhaustAbsorber(AbsorberNum).ExhaustAirInletNodeNum = + dynamic_cast(thisMTG)->CombustionAirOutletNodeNum; } } if (Get_ErrorsFound) { ShowFatalError("Errors found in processing input for " + cCurrentModuleObject); } - } void ExhaustAbsorberSpecs::setupOutputVariables() { std::string const ChillerName = this->Name; - SetupOutputVariable("Chiller Heater Evaporator Cooling Rate", - OutputProcessor::Unit::W, - this->CoolingLoad, - "System", - "Average", - ChillerName); + SetupOutputVariable("Chiller Heater Evaporator Cooling Rate", OutputProcessor::Unit::W, this->CoolingLoad, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Evaporator Cooling Energy", OutputProcessor::Unit::J, this->CoolingEnergy, @@ -466,12 +490,7 @@ namespace ChillerExhaustAbsorption { _, "Plant"); - SetupOutputVariable("Chiller Heater Heating Rate", - OutputProcessor::Unit::W, - this->HeatingLoad, - "System", - "Average", - ChillerName); + SetupOutputVariable("Chiller Heater Heating Rate", OutputProcessor::Unit::W, this->HeatingLoad, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Heating Energy", OutputProcessor::Unit::J, this->HeatingEnergy, @@ -484,12 +503,8 @@ namespace ChillerExhaustAbsorption { _, "Plant"); - SetupOutputVariable("Chiller Heater Condenser Heat Transfer Rate", - OutputProcessor::Unit::W, - this->TowerLoad, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Condenser Heat Transfer Rate", OutputProcessor::Unit::W, this->TowerLoad, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Condenser Heat Transfer Energy", OutputProcessor::Unit::J, this->TowerEnergy, @@ -502,33 +517,15 @@ namespace ChillerExhaustAbsorption { _, "Plant"); - SetupOutputVariable("Chiller Heater Cooling Source Heat COP", - OutputProcessor::Unit::W_W, - this->ThermalEnergyCOP, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Cooling Source Heat COP", OutputProcessor::Unit::W_W, this->ThermalEnergyCOP, "System", "Average", ChillerName); - SetupOutputVariable("Chiller Heater Electric Power", - OutputProcessor::Unit::W, - this->ElectricPower, - "System", - "Average", - ChillerName); + SetupOutputVariable("Chiller Heater Electric Power", OutputProcessor::Unit::W, this->ElectricPower, "System", "Average", ChillerName); // Do not include this on meters, this would duplicate the cool electric and heat electric - SetupOutputVariable("Chiller Heater Electric Energy", - OutputProcessor::Unit::J, - this->ElectricEnergy, - "System", - "Sum", - ChillerName); + SetupOutputVariable("Chiller Heater Electric Energy", OutputProcessor::Unit::J, this->ElectricEnergy, "System", "Sum", ChillerName); - SetupOutputVariable("Chiller Heater Cooling Electric Power", - OutputProcessor::Unit::W, - this->CoolElectricPower, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Cooling Electric Power", OutputProcessor::Unit::W, this->CoolElectricPower, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Cooling Electric Energy", OutputProcessor::Unit::J, this->CoolElectricEnergy, @@ -541,12 +538,8 @@ namespace ChillerExhaustAbsorption { _, "Plant"); - SetupOutputVariable("Chiller Heater Heating Electric Power", - OutputProcessor::Unit::W, - this->HeatElectricPower, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Heating Electric Power", OutputProcessor::Unit::W, this->HeatElectricPower, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Heating Electric Energy", OutputProcessor::Unit::J, this->HeatElectricEnergy, @@ -559,116 +552,46 @@ namespace ChillerExhaustAbsorption { _, "Plant"); - SetupOutputVariable("Chiller Heater Evaporator Inlet Temperature", - OutputProcessor::Unit::C, - this->ChillReturnTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Evaporator Outlet Temperature", - OutputProcessor::Unit::C, - this->ChillSupplyTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Evaporator Mass Flow Rate", - OutputProcessor::Unit::kg_s, - this->ChillWaterFlowRate, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Evaporator Inlet Temperature", OutputProcessor::Unit::C, this->ChillReturnTemp, "System", "Average", ChillerName); + SetupOutputVariable( + "Chiller Heater Evaporator Outlet Temperature", OutputProcessor::Unit::C, this->ChillSupplyTemp, "System", "Average", ChillerName); + SetupOutputVariable( + "Chiller Heater Evaporator Mass Flow Rate", OutputProcessor::Unit::kg_s, this->ChillWaterFlowRate, "System", "Average", ChillerName); if (this->isWaterCooled) { - SetupOutputVariable("Chiller Heater Condenser Inlet Temperature", - OutputProcessor::Unit::C, - this->CondReturnTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Condenser Outlet Temperature", - OutputProcessor::Unit::C, - this->CondSupplyTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Condenser Mass Flow Rate", - OutputProcessor::Unit::kg_s, - this->CondWaterFlowRate, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Condenser Inlet Temperature", OutputProcessor::Unit::C, this->CondReturnTemp, "System", "Average", ChillerName); + SetupOutputVariable( + "Chiller Heater Condenser Outlet Temperature", OutputProcessor::Unit::C, this->CondSupplyTemp, "System", "Average", ChillerName); + SetupOutputVariable( + "Chiller Heater Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, this->CondWaterFlowRate, "System", "Average", ChillerName); } else { - SetupOutputVariable("Chiller Heater Condenser Inlet Temperature", - OutputProcessor::Unit::C, - this->CondReturnTemp, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Condenser Inlet Temperature", OutputProcessor::Unit::C, this->CondReturnTemp, "System", "Average", ChillerName); } - SetupOutputVariable("Chiller Heater Heating Inlet Temperature", - OutputProcessor::Unit::C, - this->HotWaterReturnTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Heating Outlet Temperature", - OutputProcessor::Unit::C, - this->HotWaterSupplyTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Heating Mass Flow Rate", - OutputProcessor::Unit::kg_s, - this->HotWaterFlowRate, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Heating Inlet Temperature", OutputProcessor::Unit::C, this->HotWaterReturnTemp, "System", "Average", ChillerName); + SetupOutputVariable( + "Chiller Heater Heating Outlet Temperature", OutputProcessor::Unit::C, this->HotWaterSupplyTemp, "System", "Average", ChillerName); + SetupOutputVariable( + "Chiller Heater Heating Mass Flow Rate", OutputProcessor::Unit::kg_s, this->HotWaterFlowRate, "System", "Average", ChillerName); - SetupOutputVariable("Chiller Heater Cooling Part Load Ratio", - OutputProcessor::Unit::None, - this->CoolPartLoadRatio, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Maximum Cooling Rate", - OutputProcessor::Unit::W, - this->CoolingCapacity, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Heating Part Load Ratio", - OutputProcessor::Unit::None, - this->HeatPartLoadRatio, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Maximum Heating Rate", - OutputProcessor::Unit::W, - this->HeatingCapacity, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Cooling Part Load Ratio", OutputProcessor::Unit::None, this->CoolPartLoadRatio, "System", "Average", ChillerName); + SetupOutputVariable("Chiller Heater Maximum Cooling Rate", OutputProcessor::Unit::W, this->CoolingCapacity, "System", "Average", ChillerName); + SetupOutputVariable( + "Chiller Heater Heating Part Load Ratio", OutputProcessor::Unit::None, this->HeatPartLoadRatio, "System", "Average", ChillerName); + SetupOutputVariable("Chiller Heater Maximum Heating Rate", OutputProcessor::Unit::W, this->HeatingCapacity, "System", "Average", ChillerName); - SetupOutputVariable("Chiller Heater Runtime Fraction", - OutputProcessor::Unit::None, - this->FractionOfPeriodRunning, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Runtime Fraction", OutputProcessor::Unit::None, this->FractionOfPeriodRunning, "System", "Average", ChillerName); - SetupOutputVariable("Chiller Heater Source Exhaust Inlet Temperature", - OutputProcessor::Unit::C, - this->ExhaustInTemp, - "System", - "Average", - ChillerName); - SetupOutputVariable("Chiller Heater Source Exhaust Inlet Mass Flow Rate", - OutputProcessor::Unit::kg_s, - this->ExhaustInFlow, - "System", - "Average", - ChillerName); + SetupOutputVariable( + "Chiller Heater Source Exhaust Inlet Temperature", OutputProcessor::Unit::C, this->ExhaustInTemp, "System", "Average", ChillerName); + SetupOutputVariable( + "Chiller Heater Source Exhaust Inlet Mass Flow Rate", OutputProcessor::Unit::kg_s, this->ExhaustInFlow, "System", "Average", ChillerName); SetupOutputVariable("Chiller Heater Heating Heat Recovery Potential Rate", OutputProcessor::Unit::W, @@ -696,7 +619,7 @@ namespace ChillerExhaustAbsorption { "Average", ChillerName); } - + void ExhaustAbsorberSpecs::initialize() { @@ -735,73 +658,61 @@ namespace ChillerExhaustAbsorption { // Locate the chillers on the plant loops for later usage errFlag = false; PlantUtilities::ScanPlantLoopsForObject(this->Name, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum, - errFlag, - this->CHWLowLimitTemp, - _, - _, - this->ChillReturnNodeNum, - _); + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + errFlag, + this->CHWLowLimitTemp, + _, + _, + this->ChillReturnNodeNum, + _); if (errFlag) { ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s)."); } PlantUtilities::ScanPlantLoopsForObject(this->Name, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - this->HWLoopNum, - this->HWLoopSideNum, - this->HWBranchNum, - this->HWCompNum, - errFlag, - _, - _, - _, - this->HeatReturnNodeNum, - _); + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + this->HWLoopNum, + this->HWLoopSideNum, + this->HWBranchNum, + this->HWCompNum, + errFlag, + _, + _, + _, + this->HeatReturnNodeNum, + _); if (errFlag) { ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s)."); } if (this->isWaterCooled) { PlantUtilities::ScanPlantLoopsForObject(this->Name, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum, - errFlag, - _, - _, - _, - this->CondReturnNodeNum, - _); + DataPlant::TypeOf_Chiller_ExhFiredAbsorption, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum, + errFlag, + _, + _, + _, + this->CondReturnNodeNum, + _); if (errFlag) { ShowFatalError("InitExhaustAbsorber: Program terminated due to previous condition(s)."); } - PlantUtilities::InterConnectTwoPlantLoopSides(this->CWLoopNum, - this->CWLoopSideNum, - this->CDLoopNum, - this->CDLoopSideNum, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - true); - PlantUtilities::InterConnectTwoPlantLoopSides(this->HWLoopNum, - this->HWLoopSideNum, - this->CDLoopNum, - this->CDLoopSideNum, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - true); + PlantUtilities::InterConnectTwoPlantLoopSides( + this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); + PlantUtilities::InterConnectTwoPlantLoopSides( + this->HWLoopNum, this->HWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); } - PlantUtilities::InterConnectTwoPlantLoopSides(this->CWLoopNum, - this->CWLoopSideNum, - this->HWLoopNum, - this->HWLoopSideNum, - DataPlant::TypeOf_Chiller_ExhFiredAbsorption, - true); + PlantUtilities::InterConnectTwoPlantLoopSides( + this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); // check if outlet node of chilled water side has a setpoint. if ((DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && @@ -879,61 +790,61 @@ namespace ChillerExhaustAbsorption { // init max available condenser water flow rate if (this->CDLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); + DataGlobals::CWInitConvTemp, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); } this->DesCondMassFlowRate = rho * this->CondVolFlowRate; PlantUtilities::InitComponentNodes(0.0, - this->DesCondMassFlowRate, - CondInletNode, - CondOutletNode, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum); + this->DesCondMassFlowRate, + CondInletNode, + CondOutletNode, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } if (this->HWLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->HWLoopNum).FluidName, - DataGlobals::HWInitConvTemp, - DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, - RoutineName); + DataGlobals::HWInitConvTemp, + DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, + RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); } this->DesHeatMassFlowRate = rho * this->HeatVolFlowRate; // init available hot water flow rate PlantUtilities::InitComponentNodes(0.0, - this->DesHeatMassFlowRate, - HeatInletNode, - HeatOutletNode, - this->HWLoopNum, - this->HWLoopSideNum, - this->HWBranchNum, - this->HWCompNum); + this->DesHeatMassFlowRate, + HeatInletNode, + HeatOutletNode, + this->HWLoopNum, + this->HWLoopSideNum, + this->HWBranchNum, + this->HWCompNum); if (this->CWLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, - RoutineName); + DataGlobals::CWInitConvTemp, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobals::InitConvTemp); } this->DesEvapMassFlowRate = rho * this->EvapVolFlowRate; // init available hot water flow rate PlantUtilities::InitComponentNodes(0.0, - this->DesEvapMassFlowRate, - this->ChillReturnNodeNum, - this->ChillSupplyNodeNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum); + this->DesEvapMassFlowRate, + this->ChillReturnNodeNum, + this->ChillSupplyNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); this->envrnInit = false; } @@ -958,33 +869,23 @@ namespace ChillerExhaustAbsorption { DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } - if ((this->isWaterCooled) && ((this->InHeatingMode) || (this->InCoolingMode)) && - (!this->plantScanInit)) { + if ((this->isWaterCooled) && ((this->InHeatingMode) || (this->InCoolingMode)) && (!this->plantScanInit)) { mdot = this->DesCondMassFlowRate; - PlantUtilities::SetComponentFlowRate(mdot, - this->CondReturnNodeNum, - this->CondSupplyNodeNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum); + PlantUtilities::SetComponentFlowRate( + mdot, this->CondReturnNodeNum, this->CondSupplyNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); } else { mdot = 0.0; if (this->CDLoopNum > 0) { - PlantUtilities::SetComponentFlowRate(mdot, - this->CondReturnNodeNum, - this->CondSupplyNodeNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum); + PlantUtilities::SetComponentFlowRate( + mdot, this->CondReturnNodeNum, this->CondSupplyNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); } } } - void ExhaustAbsorberSpecs::size() { + void ExhaustAbsorberSpecs::size() + { // SUBROUTINE INFORMATION: // AUTHOR Fred Buhl @@ -1004,7 +905,6 @@ namespace ChillerExhaustAbsorption { // SUBROUTINE PARAMETER DEFINITIONS: std::string const RoutineName("SizeExhaustAbsorber"); - bool ErrorsFound; // If errors detected in input std::string equipName; Real64 Cp; // local fluid specific heat @@ -1033,13 +933,13 @@ namespace ChillerExhaustAbsorption { if (PltSizCoolNum > 0) { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, - RoutineName); + DataGlobals::CWInitConvTemp, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + RoutineName); rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, - RoutineName); + DataGlobals::CWInitConvTemp, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizCoolNum).DeltaT * DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * this->SizFac; if (!this->NomCoolingCapWasAutoSized) tmpNomCap = this->NomCoolingCap; @@ -1050,33 +950,29 @@ namespace ChillerExhaustAbsorption { if (this->NomCoolingCapWasAutoSized) { this->NomCoolingCap = tmpNomCap; if (DataPlant::PlantFinalSizesOkayToReport) { - ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Design Size Nominal Cooling Capacity [W]", - tmpNomCap); + ReportSizingManager::ReportSizingOutput( + "ChillerHeater:Absorption:DoubleEffect", this->Name, "Design Size Nominal Cooling Capacity [W]", tmpNomCap); } if (DataPlant::PlantFirstSizesOkayToReport) { - ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Initial Design Size Nominal Cooling Capacity [W]", - tmpNomCap); + ReportSizingManager::ReportSizingOutput( + "ChillerHeater:Absorption:DoubleEffect", this->Name, "Initial Design Size Nominal Cooling Capacity [W]", tmpNomCap); } } else { if (this->NomCoolingCap > 0.0 && tmpNomCap > 0.0) { NomCapUser = this->NomCoolingCap; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Design Size Nominal Cooling Capacity [W]", - tmpNomCap, - "User-Specified Nominal Cooling Capacity [W]", - NomCapUser); + this->Name, + "Design Size Nominal Cooling Capacity [W]", + tmpNomCap, + "User-Specified Nominal Cooling Capacity [W]", + NomCapUser); if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { - ShowMessage("SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + - this->Name); + ShowMessage("SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name); ShowContinueError("User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); - ShowContinueError("differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + " [W]"); + ShowContinueError("differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + + " [W]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1089,8 +985,7 @@ namespace ChillerExhaustAbsorption { } else { if (this->NomCoolingCapWasAutoSized) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + - "\", autosize error."); + ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller nominal cooling capacity requires"); ShowContinueError("a cooling loop Sizing:Plant object."); ErrorsFound = true; @@ -1098,10 +993,8 @@ namespace ChillerExhaustAbsorption { } else { if (DataPlant::PlantFinalSizesOkayToReport) { if (this->NomCoolingCap > 0.0) { - ReportSizingManager::ReportSizingOutput("Chiller:Absorption:DoubleEffect", - this->Name, - "User-Specified Nominal Capacity [W]", - this->NomCoolingCap); + ReportSizingManager::ReportSizingOutput( + "Chiller:Absorption:DoubleEffect", this->Name, "User-Specified Nominal Capacity [W]", this->NomCoolingCap); } } } @@ -1120,34 +1013,34 @@ namespace ChillerExhaustAbsorption { this->EvapVolFlowRate = tmpEvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Design Size Design Chilled Water Flow Rate [m3/s]", - tmpEvapVolFlowRate); + this->Name, + "Design Size Design Chilled Water Flow Rate [m3/s]", + tmpEvapVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Initial Design Size Design Chilled Water Flow Rate [m3/s]", - tmpEvapVolFlowRate); + this->Name, + "Initial Design Size Design Chilled Water Flow Rate [m3/s]", + tmpEvapVolFlowRate); } } else { if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { EvapVolFlowRateUser = this->EvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Design Size Design Chilled Water Flow Rate [m3/s]", - tmpEvapVolFlowRate, - "User-Specified Design Chilled Water Flow Rate [m3/s]", - EvapVolFlowRateUser); + this->Name, + "Design Size Design Chilled Water Flow Rate [m3/s]", + tmpEvapVolFlowRate, + "User-Specified Design Chilled Water Flow Rate [m3/s]", + EvapVolFlowRateUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { - ShowMessage("SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + - this->Name); - ShowContinueError("User-Specified Design Chilled Water Flow Rate of " + General::RoundSigDigits(EvapVolFlowRateUser, 5) + - " [m3/s]"); + if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > + DataSizing::AutoVsHardSizingThreshold) { + ShowMessage("SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name); + ShowContinueError("User-Specified Design Chilled Water Flow Rate of " + + General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Chilled Water Flow Rate of " + - General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); + General::RoundSigDigits(tmpEvapVolFlowRate, 5) + " [m3/s]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1160,8 +1053,7 @@ namespace ChillerExhaustAbsorption { } else { if (this->EvapVolFlowRateWasAutoSized) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + - "\", autosize error."); + ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller evap flow rate requires"); ShowContinueError("a cooling loop Sizing:Plant object."); ErrorsFound = true; @@ -1170,9 +1062,9 @@ namespace ChillerExhaustAbsorption { if (DataPlant::PlantFinalSizesOkayToReport) { if (this->EvapVolFlowRate > 0.0) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "User-Specified Design Chilled Water Flow Rate [m3/s]", - this->EvapVolFlowRate); + this->Name, + "User-Specified Design Chilled Water Flow Rate [m3/s]", + this->EvapVolFlowRate); } } } @@ -1193,34 +1085,34 @@ namespace ChillerExhaustAbsorption { this->HeatVolFlowRate = tmpHeatRecVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Design Size Design Hot Water Flow Rate [m3/s]", - tmpHeatRecVolFlowRate); + this->Name, + "Design Size Design Hot Water Flow Rate [m3/s]", + tmpHeatRecVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Initial Design Size Design Hot Water Flow Rate [m3/s]", - tmpHeatRecVolFlowRate); + this->Name, + "Initial Design Size Design Hot Water Flow Rate [m3/s]", + tmpHeatRecVolFlowRate); } } else { if (this->HeatVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { HeatRecVolFlowRateUser = this->HeatVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Design Size Design Hot Water Flow Rate [m3/s]", - tmpHeatRecVolFlowRate, - "User-Specified Design Hot Water Flow Rate [m3/s]", - HeatRecVolFlowRateUser); + this->Name, + "Design Size Design Hot Water Flow Rate [m3/s]", + tmpHeatRecVolFlowRate, + "User-Specified Design Hot Water Flow Rate [m3/s]", + HeatRecVolFlowRateUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpHeatRecVolFlowRate - HeatRecVolFlowRateUser) / HeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { - ShowMessage("SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + - this->Name); - ShowContinueError("User-Specified Design Hot Water Flow Rate of " + General::RoundSigDigits(HeatRecVolFlowRateUser, 5) + - " [m3/s]"); + if ((std::abs(tmpHeatRecVolFlowRate - HeatRecVolFlowRateUser) / HeatRecVolFlowRateUser) > + DataSizing::AutoVsHardSizingThreshold) { + ShowMessage("SizeChillerHeaterAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name); + ShowContinueError("User-Specified Design Hot Water Flow Rate of " + + General::RoundSigDigits(HeatRecVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Hot Water Flow Rate of " + - General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); + General::RoundSigDigits(tmpHeatRecVolFlowRate, 5) + " [m3/s]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1233,8 +1125,7 @@ namespace ChillerExhaustAbsorption { } else { if (this->HeatVolFlowRateWasAutoSized) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + - "\", autosize error."); + ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowContinueError("Autosizing of Exhaust Fired Absorption Chiller hot water flow rate requires"); ShowContinueError("a heating loop Sizing:Plant object."); ErrorsFound = true; @@ -1243,9 +1134,9 @@ namespace ChillerExhaustAbsorption { if (DataPlant::PlantFinalSizesOkayToReport) { if (this->HeatVolFlowRate > 0.0) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "User-Specified Design Hot Water Flow Rate [m3/s]", - this->HeatVolFlowRate); + this->Name, + "User-Specified Design Hot Water Flow Rate [m3/s]", + this->HeatVolFlowRate); } } } @@ -1257,15 +1148,14 @@ namespace ChillerExhaustAbsorption { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - this->TempDesCondReturn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); + this->TempDesCondReturn, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + RoutineName); rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - this->TempDesCondReturn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); - tmpCondVolFlowRate = - tmpNomCap * (1.0 + this->ThermalEnergyCoolRatio) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); + this->TempDesCondReturn, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + RoutineName); + tmpCondVolFlowRate = tmpNomCap * (1.0 + this->ThermalEnergyCoolRatio) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); if (!this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = this->CondVolFlowRate; } else { @@ -1276,34 +1166,34 @@ namespace ChillerExhaustAbsorption { this->CondVolFlowRate = tmpCondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Design Size Design Condenser Water Flow Rate [m3/s]", - tmpCondVolFlowRate); + this->Name, + "Design Size Design Condenser Water Flow Rate [m3/s]", + tmpCondVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Initial Design Size Design Condenser Water Flow Rate [m3/s]", - tmpCondVolFlowRate); + this->Name, + "Initial Design Size Design Condenser Water Flow Rate [m3/s]", + tmpCondVolFlowRate); } } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { CondVolFlowRateUser = this->CondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "Design Size Design Condenser Water Flow Rate [m3/s]", - tmpCondVolFlowRate, - "User-Specified Design Condenser Water Flow Rate [m3/s]", - CondVolFlowRateUser); + this->Name, + "Design Size Design Condenser Water Flow Rate [m3/s]", + tmpCondVolFlowRate, + "User-Specified Design Condenser Water Flow Rate [m3/s]", + CondVolFlowRateUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { - ShowMessage("SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + - this->Name); - ShowContinueError("User-Specified Design Condenser Water Flow Rate of " + General::RoundSigDigits(CondVolFlowRateUser, 5) + - " [m3/s]"); + if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > + DataSizing::AutoVsHardSizingThreshold) { + ShowMessage("SizeChillerAbsorptionDoubleEffect: Potential issue with equipment sizing for " + this->Name); + ShowContinueError("User-Specified Design Condenser Water Flow Rate of " + + General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Condenser Water Flow Rate of " + - General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); + General::RoundSigDigits(tmpCondVolFlowRate, 5) + " [m3/s]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1316,8 +1206,7 @@ namespace ChillerExhaustAbsorption { } else { if (this->CondVolFlowRateWasAutoSized) { if (DataPlant::PlantFirstSizesOkayToFinalize) { - ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + - "\", autosize error."); + ShowSevereError("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowSevereError("Autosizing of Exhaust Fired Absorption Chiller condenser flow rate requires a condenser"); ShowContinueError("loop Sizing:Plant object."); ErrorsFound = true; @@ -1326,9 +1215,9 @@ namespace ChillerExhaustAbsorption { if (DataPlant::PlantFinalSizesOkayToReport) { if (this->CondVolFlowRate > 0.0) { ReportSizingManager::ReportSizingOutput("ChillerHeater:Absorption:DoubleEffect", - this->Name, - "User-Specified Design Condenser Water Flow Rate [m3/s]", - this->CondVolFlowRate); + this->Name, + "User-Specified Design Condenser Water Flow Rate [m3/s]", + this->CondVolFlowRate); } } } @@ -1350,8 +1239,9 @@ namespace ChillerExhaustAbsorption { } } - void ExhaustAbsorberSpecs::calcChiller(Real64 &MyLoad){ - + void ExhaustAbsorberSpecs::calcChiller(Real64 &MyLoad) + { + // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer // DATE WRITTEN March 2001 @@ -1439,9 +1329,9 @@ namespace ChillerExhaustAbsorption { Real64 errorAvailCap; // error fraction on final estimate of AvailableCoolingCapacity int LoopNum; int LoopSideNum; - Real64 Cp_CW; // local fluid specific heat for chilled water + Real64 Cp_CW; // local fluid specific heat for chilled water Real64 Cp_CD = -1; // local fluid specific heat for condenser water -- initializing to negative to ensure it isn't used uninitialized - Real64 CpAir; // specific heat of exhaust air + Real64 CpAir; // specific heat of exhaust air // define constant values @@ -1490,15 +1380,11 @@ namespace ChillerExhaustAbsorption { lExhaustInFlow = DataLoopNode::Node(lExhaustAirInletNodeNum).MassFlowRate; lExhaustAirHumRat = DataLoopNode::Node(lExhaustAirInletNodeNum).HumRat; - Cp_CW = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, - lChillReturnTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, - RoutineName); + Cp_CW = FluidProperties::GetSpecificHeatGlycol( + DataPlant::PlantLoop(this->CWLoopNum).FluidName, lChillReturnTemp, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); if (this->CDLoopNum > 0) { - Cp_CD = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - lChillReturnTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); + Cp_CD = FluidProperties::GetSpecificHeatGlycol( + DataPlant::PlantLoop(this->CDLoopNum).FluidName, lChillReturnTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } // If no loop demand or Absorber OFF, return @@ -1510,12 +1396,12 @@ namespace ChillerExhaustAbsorption { lCondWaterMassFlowRate = 0.0; if (lIsWaterCooled) { PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate, - this->CondReturnNodeNum, - this->CondSupplyNodeNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum); + this->CondReturnNodeNum, + this->CondSupplyNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat); @@ -1538,12 +1424,12 @@ namespace ChillerExhaustAbsorption { // Set mass flow rates lCondWaterMassFlowRate = this->DesCondMassFlowRate; PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate, - this->CondReturnNodeNum, - this->CondSupplyNodeNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum); + this->CondReturnNodeNum, + this->CondSupplyNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } else { // air cooled DataLoopNode::Node(lCondReturnNodeNum).Temp = DataLoopNode::Node(lCondReturnNodeNum).OutAirDryBulb; @@ -1552,12 +1438,12 @@ namespace ChillerExhaustAbsorption { lCondWaterMassFlowRate = 0.0; if (this->CDLoopNum > 0) { PlantUtilities::SetComponentFlowRate(lCondWaterMassFlowRate, - this->CondReturnNodeNum, - this->CondSupplyNodeNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum); + this->CondReturnNodeNum, + this->CondSupplyNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); } } @@ -1588,12 +1474,12 @@ namespace ChillerExhaustAbsorption { this->PossibleSubcooling = true; PlantUtilities::SetComponentFlowRate(lChillWaterMassFlowRate, - this->ChillReturnNodeNum, - this->ChillSupplyNodeNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum); + this->ChillReturnNodeNum, + this->ChillSupplyNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); } else { lChillWaterMassFlowRate = 0.0; ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:Cooling\"" + this->Name + @@ -1627,7 +1513,8 @@ namespace ChillerExhaustAbsorption { } } if (lChillSupplyTemp < DataLoopNode::Node(lChillSupplyNodeNum).TempMin) { - if ((DataLoopNode::Node(lChillReturnNodeNum).Temp - DataLoopNode::Node(lChillSupplyNodeNum).TempMin) > DataPlant::DeltaTempTol) { + if ((DataLoopNode::Node(lChillReturnNodeNum).Temp - DataLoopNode::Node(lChillSupplyNodeNum).TempMin) > + DataPlant::DeltaTempTol) { lChillSupplyTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempMin; ChillDeltaTemp = DataLoopNode::Node(lChillReturnNodeNum).Temp - lChillSupplyTemp; lCoolingLoad = lChillWaterMassFlowRate * Cp_CW * ChillDeltaTemp; @@ -1678,14 +1565,15 @@ namespace ChillerExhaustAbsorption { // Calculate thermal energy consumption for cooling // Thermal Energy used for cooling availCap * TeFIR * TeFIR-FT * TeFIR-FPLR lCoolThermalEnergyUseRate = lAvailableCoolingCapacity * lThermalEnergyCoolRatio * - CurveManager::CurveValue(lThermalEnergyCoolFTCurve, lChillSupplyTemp, calcCondTemp) * - CurveManager::CurveValue(lThermalEnergyCoolFPLRCurve, lCoolPartLoadRatio) * lFractionOfPeriodRunning; + CurveManager::CurveValue(lThermalEnergyCoolFTCurve, lChillSupplyTemp, calcCondTemp) * + CurveManager::CurveValue(lThermalEnergyCoolFPLRCurve, lCoolPartLoadRatio) * lFractionOfPeriodRunning; // Calculate electric parasitics used // based on nominal capacity, not available capacity, // electric used for cooling nomCap * %OP * EIR * EIR-FT * EIR-FPLR lCoolElectricPower = lNomCoolingCap * lElecCoolRatio * lFractionOfPeriodRunning * - CurveManager::CurveValue(lElecCoolFTCurve, lChillSupplyTemp, calcCondTemp) * CurveManager::CurveValue(lElecCoolFPLRCurve, lCoolPartLoadRatio); + CurveManager::CurveValue(lElecCoolFTCurve, lChillSupplyTemp, calcCondTemp) * + CurveManager::CurveValue(lElecCoolFPLRCurve, lCoolPartLoadRatio); // determine conderser load which is cooling load plus the // ThermalEnergy used for cooling plus @@ -1731,8 +1619,7 @@ namespace ChillerExhaustAbsorption { if (lCondWaterMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { lCondSupplyTemp = lCondReturnTemp + lTowerLoad / (lCondWaterMassFlowRate * Cp_CD); } else { - ShowSevereError("CalcExhaustAbsorberChillerModel: Condenser flow = 0, for Exhaust Absorber Chiller=" + - this->Name); + ShowSevereError("CalcExhaustAbsorberChillerModel: Condenser flow = 0, for Exhaust Absorber Chiller=" + this->Name); ShowContinueErrorTimeStamp(""); ShowFatalError("Program Terminates due to previous error condition."); } @@ -1752,8 +1639,7 @@ namespace ChillerExhaustAbsorption { if (revisedEstimateAvailCap > 0.0) { errorAvailCap = std::abs((revisedEstimateAvailCap - lAvailableCoolingCapacity) / revisedEstimateAvailCap); if (errorAvailCap > 0.05) { // if more than 5% error in estimate - ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:\"" + this->Name + - "\", poor Condenser Supply Estimate", + ShowRecurringWarningErrorAtEnd("ExhaustAbsorberChillerModel:\"" + this->Name + "\", poor Condenser Supply Estimate", this->CondErrCount, errorAvailCap, errorAvailCap); @@ -1784,8 +1670,9 @@ namespace ChillerExhaustAbsorption { this->ElectricPower = lCoolElectricPower + lHeatElectricPower; } - void ExhaustAbsorberSpecs::calcHeater(Real64 &MyLoad, bool RunFlag) { - + void ExhaustAbsorberSpecs::calcHeater(Real64 &MyLoad, bool RunFlag) + { + // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer and Michael J. Witte // DATE WRITTEN March 2001 @@ -1835,8 +1722,8 @@ namespace ChillerExhaustAbsorption { // Real64 lThermalEnergy( 0.0 ); // variable to track total Thermal Energy used for a period (reference only) Real64 lCoolThermalEnergyUseRate(0.0); // instantaneous use of thermal energy for period for cooling Real64 lHeatThermalEnergyUseRate(0.0); // instantaneous use of thermal energy for period for heating - Real64 lCoolElectricPower(0.0); // parasitic electric power used for cooling - Real64 lHeatElectricPower(0.0); // parasitic electric power used for heating + Real64 lCoolElectricPower(0.0); // parasitic electric power used for cooling + Real64 lHeatElectricPower(0.0); // parasitic electric power used for heating Real64 lHotWaterReturnTemp(0.0); // reporting: hot water return (inlet) temperature Real64 lHotWaterSupplyTemp(0.0); // reporting: hot water supply (outlet) temperature Real64 lHotWaterMassFlowRate(0.0); // reporting: hot water mass flow rate @@ -1876,7 +1763,8 @@ namespace ChillerExhaustAbsorption { LoopNum = this->HWLoopNum; LoopSideNum = this->HWLoopSideNum; - Cp_HW = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); + Cp_HW = FluidProperties::GetSpecificHeatGlycol( + DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); lCoolElectricPower = this->CoolElectricPower; lCoolThermalEnergyUseRate = this->CoolThermalEnergyUseRate; @@ -1906,9 +1794,8 @@ namespace ChillerExhaustAbsorption { } else { // Determine available heating capacity using the current cooling load - lAvailableHeatingCapacity = - this->NomHeatCoolRatio * this->NomCoolingCap * - CurveManager::CurveValue(lHeatCapFCoolCurve, (this->CoolingLoad / this->NomCoolingCap)); + lAvailableHeatingCapacity = this->NomHeatCoolRatio * this->NomCoolingCap * + CurveManager::CurveValue(lHeatCapFCoolCurve, (this->CoolingLoad / this->NomCoolingCap)); // Calculate current load for heating MyLoad = sign(max(std::abs(MyLoad), this->HeatingCapacity * lMinPartLoadRat), MyLoad); @@ -1927,12 +1814,12 @@ namespace ChillerExhaustAbsorption { lHotWaterMassFlowRate = std::abs(lHeatingLoad / (Cp_HW * HeatDeltaTemp)); PlantUtilities::SetComponentFlowRate(lHotWaterMassFlowRate, - this->HeatReturnNodeNum, - this->HeatSupplyNodeNum, - this->HWLoopNum, - this->HWLoopSideNum, - this->HWBranchNum, - this->HWCompNum); + this->HeatReturnNodeNum, + this->HeatSupplyNodeNum, + this->HWLoopNum, + this->HWLoopSideNum, + this->HWBranchNum, + this->HWCompNum); } else { lHotWaterMassFlowRate = 0.0; @@ -2040,8 +1927,9 @@ namespace ChillerExhaustAbsorption { this->ExhHeatRecPotentialHeat = lExhHeatRecPotentialHeat; } - void ExhaustAbsorberSpecs::updateCoolRecords(Real64 MyLoad, bool RunFlag) { - + void ExhaustAbsorberSpecs::updateCoolRecords(Real64 MyLoad, bool RunFlag) + { + // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer // DATE WRITTEN March 2001 @@ -2050,10 +1938,10 @@ namespace ChillerExhaustAbsorption { // reporting // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int lChillReturnNodeNum; // Node number on the inlet side of the plant - int lChillSupplyNodeNum; // Node number on the outlet side of the plant - int lCondReturnNodeNum; // Node number on the inlet side of the condenser - int lCondSupplyNodeNum; // Node number on the outlet side of the condenser + int lChillReturnNodeNum; // Node number on the inlet side of the plant + int lChillSupplyNodeNum; // Node number on the outlet side of the plant + int lCondReturnNodeNum; // Node number on the inlet side of the condenser + int lCondSupplyNodeNum; // Node number on the outlet side of the condenser int lExhaustAirInletNodeNum; // Node number on the inlet side of the plant Real64 RptConstant; @@ -2088,15 +1976,15 @@ namespace ChillerExhaustAbsorption { this->ElectricEnergy = this->ElectricPower * RptConstant; this->CoolElectricEnergy = this->CoolElectricPower * RptConstant; if (this->CoolThermalEnergyUseRate != 0.0) { - this->ThermalEnergyCOP = - this->CoolingLoad / this->CoolThermalEnergyUseRate; + this->ThermalEnergyCOP = this->CoolingLoad / this->CoolThermalEnergyUseRate; } else { this->ThermalEnergyCOP = 0.0; } } - void ExhaustAbsorberSpecs::updateHeatRecords(Real64 MyLoad, bool RunFlag) { - + void ExhaustAbsorberSpecs::updateHeatRecords(Real64 MyLoad, bool RunFlag) + { + // SUBROUTINE INFORMATION: // AUTHOR Jason Glazer // DATE WRITTEN March 2001 diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.hh b/src/EnergyPlus/ChillerExhaustAbsorption.hh index b09ebec70c7..302fb226c23 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.hh +++ b/src/EnergyPlus/ChillerExhaustAbsorption.hh @@ -54,8 +54,8 @@ // EnergyPlus Headers #include #include -#include #include +#include namespace EnergyPlus { @@ -195,11 +195,11 @@ namespace ChillerExhaustAbsorption { EvapVolFlowRateWasAutoSized(false), CondVolFlowRate(0.0), CondVolFlowRateWasAutoSized(false), HeatVolFlowRate(0.0), HeatVolFlowRateWasAutoSized(false), SizFac(0.0), CoolCapFTCurve(0), ThermalEnergyCoolFTCurve(0), ThermalEnergyCoolFPLRCurve(0), ElecCoolFTCurve(0), ElecCoolFPLRCurve(0), HeatCapFCoolCurve(0), ThermalEnergyHeatFHPLRCurve(0), isEnterCondensTemp(false), - isWaterCooled(false), CHWLowLimitTemp(0.0), ExhaustAirInletNodeNum(0), DesCondMassFlowRate(0.0), DesHeatMassFlowRate(0.0), DesEvapMassFlowRate(0.0), - DeltaTempCoolErrCount(0), DeltaTempHeatErrCount(0), CondErrCount(0), PossibleSubcooling(false), CWLoopNum(0), CWLoopSideNum(0), - CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), HWLoopNum(0), HWLoopSideNum(0), - HWBranchNum(0), HWCompNum(0), CompType_Num(0), ExhTempLTAbsLeavingTempIndex(0), ExhTempLTAbsLeavingHeatingTempIndex(0), - oneTimeInit(true), envrnInit(true), plantScanInit(true), oldCondSupplyTemp(0.0), + isWaterCooled(false), CHWLowLimitTemp(0.0), ExhaustAirInletNodeNum(0), DesCondMassFlowRate(0.0), DesHeatMassFlowRate(0.0), + DesEvapMassFlowRate(0.0), DeltaTempCoolErrCount(0), DeltaTempHeatErrCount(0), CondErrCount(0), PossibleSubcooling(false), CWLoopNum(0), + CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), HWLoopNum(0), + HWLoopSideNum(0), HWBranchNum(0), HWCompNum(0), CompType_Num(0), ExhTempLTAbsLeavingTempIndex(0), + ExhTempLTAbsLeavingHeatingTempIndex(0), oneTimeInit(true), envrnInit(true), plantScanInit(true), oldCondSupplyTemp(0.0), CoolingLoad(0.0), CoolingEnergy(0.0), HeatingLoad(0.0), HeatingEnergy(0.0), TowerLoad(0.0), TowerEnergy(0.0), ThermalEnergyUseRate(0.0), ThermalEnergy(0.0), CoolThermalEnergyUseRate(0.0), CoolThermalEnergy(0.0), HeatThermalEnergyUseRate(0.0), HeatThermalEnergy(0.0), ElectricPower(0.0), ElectricEnergy(0.0), CoolElectricPower(0.0), CoolElectricEnergy(0.0), HeatElectricPower(0.0), @@ -235,7 +235,6 @@ namespace ChillerExhaustAbsorption { void updateCoolRecords(Real64 MyLoad, bool RunFlag); void updateHeatRecords(Real64 MyLoad, bool RunFlag); - }; extern Array1D ExhaustAbsorber; // dimension to number of machines From 1e697b297125ad38885f0c14542c6eee48803ca7 Mon Sep 17 00:00:00 2001 From: nigusse Date: Tue, 21 Jan 2020 09:03:32 -0500 Subject: [PATCH 34/41] addressed warning --- src/EnergyPlus/SingleDuct.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 1925407665c..49769e37a0c 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -4463,6 +4463,7 @@ namespace SingleDuct { Par(7) = double(FanOp); Par(8) = QTotLoad; SolveRoot(UnitFlowToler, 50, SolFlag, FracDelivered, VAVVSHCFanOnResidual, 0.0, 1.0, Par); + MassFlow = Node(SysInletNode).MassFlowRate; if (SolFlag == -1) { if (Sys(SysNum).IterationLimit == 0) { ShowWarningError("Heating coil control failed in VS VAV terminal unit " + Sys(SysNum).SysName); From 9e810953161b43d441f03e0545c7c69ed7eb42b6 Mon Sep 17 00:00:00 2001 From: nigusse Date: Tue, 21 Jan 2020 09:21:34 -0500 Subject: [PATCH 35/41] added unit test --- .../unit/AirTerminalSingleDuct.unit.cc | 177 ++++++++++++++++++ 1 file changed, 177 insertions(+) diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc index dea5a0d48b6..9fafe271016 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -682,4 +683,180 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctVAVReheat_NormalActionTest) EXPECT_EQ(1.0, Sys(SysNum).AirMassFlowRateMax); } +TEST_F(EnergyPlusFixture, SingleDuctVAVReheatVSFan_DamperPositionTest) +{ + std::string const idf_objects = delimited_string({ + " Zone,", + " Thermal Zone; !- Name", + + " ZoneHVAC:EquipmentConnections,", + " Thermal Zone, !- Zone Name", + " Thermal Zone Equipment, !- Zone Conditioning Equipment List Name", + " Zone 1 In Node, !- Zone Air Inlet Node or NodeList Name", + " , !- Zone Air Exhaust Node or NodeList Name", + " Zone 1 Air Node, !- Zone Air Node Name", + " Zone 1 Return Node; !- Zone Return Air Node Name", + + " ZoneHVAC:EquipmentList,", + " Thermal Zone Equipment, !- Name", + " SequentialLoad, !- Load Distribution Scheme", + " ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type", + " ADU VAV Rht VS Fan, !- Zone Equipment 1 Name", + " 1, !- Zone Equipment 1 Cooling Sequence", + " 1; !- Zone Equipment 1 Heating or No-Load Sequence", + + " ZoneHVAC:AirDistributionUnit,", + " ADU VAV Rht VS Fan, !- Name", + " Zone 1 In Node, !- Air Distribution Unit Outlet Node Name", + " AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan, !- Air Terminal Object Type", + " VAV Rht VS Fan AirTerm; !- Air Terminal Name", + + " AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan,", + " VAV Rht VS Fan AirTerm, !- Name", + " , !- Availability Schedule Name", + " 1.0, !- Maximum Cooling Air Flow Rate {m3/s}", + " 0.5, !- Maximum Heating Air Flow Rate {m3/s}", + " 0.05, !- Zone Minimum Air Flow Fraction", + " Zone 1 ATU In Node, !- Air Inlet Node Name", + " Zone 1 In Node, !- Air Outlet Node Name", + " Fan:SystemModel, !- Fan Object Type", + " Zone 1 VS Fan, !- Fan Name", + " Coil:Heating:Electric, !- Heating Coil Object Type", + " Zone 1 Reheat Coil, !- Heating Coil Name", + " autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s}", + " 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s}", + " 0.001; !- Heating Convergence Tolerance", + + " Coil:Heating:Electric,", + " Zone 1 Reheat Coil, !- Name", + " , !- Availability Schedule Name", + " 1.0, !- Efficiency", + " autosize, !- Nominal Capacity {W}", + " Reheat Air Inlet Node, !- Air Inlet Node Name", + " Zone 1 In Node; !- Air Outlet Node Name", + + " Fan:SystemModel,", + " Zone 1 VS Fan, !- Name", + " , !- Availability Schedule Name", + " Zone 1 ATU In Node, !- Air Inlet Node Name", + " Reheat Air Inlet Node, !- Air Outlet Node Name", + " 1.0, !- Design Maximum Air Flow Rate {m3/s}", + " Continuous, !- Speed Control Method", + " 0.0, !- Electric Power Minimum Flow Rate Fraction", + " 125.0, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " AUTOSIZE, !- Design Electric Power Consumption {W}", + " TotalEfficiencyAndPressure, !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " VAV Fan Curve, !- Electric Power Function of Flow Fraction Curve Name", + " , !- Night Ventilation Mode Pressure Rise {Pa}", + " , !- Night Ventilation Mode Flow Fraction", + " , !- Motor Loss Zone Name", + " , !- Motor Loss Radiative Fraction", + " ATU Fan Energy; !- End-Use Subcategory", + + " Curve:Quartic,", + " VAV Fan Curve, !- Name", + " 0.00153028, !- Coefficient1 Constant", + " 0.00520806, !- Coefficient2 x", + " 1.1086242, !- Coefficient3 x**2", + " -.11635563, !- Coefficient4 x**3", + " 0.0, !- Coefficient5 x**4", + " 0.0, !- Minimum Value of x", + " 1.0, !- Maximum Value of x", + " 0.0, !- Minimum Curve Output", + " 1.0, !- Maximum Curve Output", + " Dimensionless, !- Input Unit Type for X", + " Dimensionless; !- Output Unit Type", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + // setup variables for VAV Reheat VS Fan + int SysNum = 1; + int ZoneNum = 1; + int ZoneNodeNum = 1; + int InletNodeNum = 5; + bool ErrorsFound = false; + bool FirstHVACIteration = true; + + DataGlobals::NumOfTimeStepInHour = 1; + DataGlobals::MinutesPerTimeStep = 60; + ScheduleManager::ProcessScheduleInput(); + ScheduleManager::ScheduleInputProcessed = true; + DataEnvironment::Month = 1; + DataEnvironment::DayOfMonth = 21; + DataGlobals::HourOfDay = 1; + DataGlobals::TimeStep = 1; + DataEnvironment::DSTIndicator = 0; + DataEnvironment::DayOfWeek = 2; + DataEnvironment::HolidayIndex = 0; + DataEnvironment::DayOfYear_Schedule = General::OrdinalDay(DataEnvironment::Month, DataEnvironment::DayOfMonth, 1); + DataEnvironment::StdRhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(101325.0, 20.0, 0.0); + ScheduleManager::UpdateScheduleValues(); + DataZoneEnergyDemands::ZoneSysEnergyDemand.allocate(1); + DataHeatBalFanSys::TempControlType.allocate(1); + DataHeatBalFanSys::TempControlType(1) = DataHVACGlobals::DualSetPointWithDeadBand; + HeatBalanceManager::GetZoneData(ErrorsFound); + ASSERT_FALSE(ErrorsFound); + DataZoneEquipment::GetZoneEquipmentData1(); + ZoneAirLoopEquipmentManager::GetZoneAirLoopEquipment(); + SingleDuct::GetSysInput(); + EXPECT_TRUE(compare_err_stream("")); + + auto &thisAirTerminal = SingleDuct::Sys(SysNum); + auto &thisAirTerminalOutlet = SingleDuct::SysOutlet(SysNum); + + // check VAV reheat VS Fan air terminal inputs + EXPECT_EQ("AirTerminal:SingleDuct:VAV:Reheat:VariableSpeedFan", thisAirTerminal.SysType); + EXPECT_EQ("VAV RHT VS FAN AIRTERM", thisAirTerminal.SysName); + EXPECT_EQ("COIL:HEATING:ELECTRIC", thisAirTerminal.ReheatComp); + EXPECT_EQ("ZONE 1 REHEAT COIL", thisAirTerminal.ReheatName); + EXPECT_EQ("FAN:SYSTEMMODEL", thisAirTerminal.FanType); + EXPECT_EQ("ZONE 1 VS FAN", thisAirTerminal.FanName); + EXPECT_EQ(thisAirTerminal.ZoneMinAirFrac, 0.05); + EXPECT_EQ(thisAirTerminal.MaxAirVolFlowRate, 1.0); + // test 1: 0.05 fraction damper position + Real64 SysMinMassFlowRes = 1.0 * DataEnvironment::StdRhoAir * 0.05; + Real64 SysMaxMassFlowRes = 1.0 * DataEnvironment::StdRhoAir; + DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = 0.0; + DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMaxMassFlowRes; + DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlowRes; + CurDeadBandOrSetback.allocate(1); + CurDeadBandOrSetback(1) = false; + DataGlobals::BeginEnvrnFlag = true; + FirstHVACIteration = true; + SingleDuct::InitSys(SysNum, FirstHVACIteration); + DataGlobals::BeginEnvrnFlag = false; + FirstHVACIteration = false; + SingleDuct::InitSys(SysNum, FirstHVACIteration); + SingleDuct::SimVAVVS(SysNum, FirstHVACIteration, ZoneNum, ZoneNodeNum); + // check inputs and calculated values for zone air fraction 0.05 + EXPECT_EQ(0.05,thisAirTerminal.ZoneMinAirFrac); // user input + EXPECT_EQ(0.05, thisAirTerminal.DamperPosition); + EXPECT_EQ(SysMinMassFlowRes, thisAirTerminal.AirMassFlowRateMax * thisAirTerminal.ZoneMinAirFrac); + EXPECT_EQ(SysMinMassFlowRes, thisAirTerminalOutlet.AirMassFlowRate); + + // test 2: 0.10 fraction damper position + thisAirTerminal.ZoneMinAirFrac = 0.10; // modified user input + SysMinMassFlowRes = 1.0 * DataEnvironment::StdRhoAir * 0.10; + DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = 0.0; + DataLoopNode::Node(InletNodeNum).MassFlowRate = SysMaxMassFlowRes; + DataLoopNode::Node(InletNodeNum).MassFlowRateMaxAvail = SysMaxMassFlowRes; + DataGlobals::BeginEnvrnFlag = true; + FirstHVACIteration = true; + SingleDuct::InitSys(SysNum, FirstHVACIteration); + DataGlobals::BeginEnvrnFlag = false; + FirstHVACIteration = false; + SingleDuct::InitSys(SysNum, FirstHVACIteration); + SingleDuct::SimVAVVS(SysNum, FirstHVACIteration, ZoneNum, ZoneNodeNum); + // check inputs and calculated values for zone air fraction 0.10 + EXPECT_EQ(0.10, thisAirTerminal.ZoneMinAirFrac); + EXPECT_EQ(0.10, thisAirTerminal.DamperPosition); + EXPECT_EQ(SysMinMassFlowRes, thisAirTerminal.AirMassFlowRateMax * thisAirTerminal.ZoneMinAirFrac); + EXPECT_EQ(SysMinMassFlowRes, thisAirTerminalOutlet.AirMassFlowRate); +} + } // namespace EnergyPlus From 6cda2a7cfcd99d0ca75105aa62e4c6870d377b0d Mon Sep 17 00:00:00 2001 From: nigusse Date: Tue, 21 Jan 2020 11:32:36 -0500 Subject: [PATCH 36/41] modified the fix --- src/EnergyPlus/SingleDuct.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 49769e37a0c..235fbbeb201 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -4495,16 +4495,12 @@ namespace SingleDuct { CalcVAVVS(SysNum, FirstHVACIteration, ZoneNodeNum, HCType, 0.0, 0.0, FanType, MassFlow, FanOp, QDelivered); } - //MassFlow = Node(SysInletNode).MassFlowRate; - // Move data to the damper outlet node - SysOutlet(SysNum).AirTemp = SysInlet(SysNum).AirTemp; - SysOutlet(SysNum).AirHumRat = SysInlet(SysNum).AirHumRat; + // Move mass flow rates to the damper outlet node SysOutlet(SysNum).AirMassFlowRate = MassFlow; SysOutlet(SysNum).AirMassFlowRateMaxAvail = SysInlet(SysNum).AirMassFlowRateMaxAvail; SysOutlet(SysNum).AirMassFlowRateMinAvail = SysInlet(SysNum).AirMassFlowRateMinAvail; - SysOutlet(SysNum).AirEnthalpy = SysInlet(SysNum).AirEnthalpy; - // calculate damper Position. + // calculate VAV damper Position. if (Sys(SysNum).AirMassFlowRateMax == 0.0) { Sys(SysNum).DamperPosition = 0.0; } else { From 28bd562d29421cff19c2494725205ebc1e339afd Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 22 Jan 2020 04:54:48 -0700 Subject: [PATCH 37/41] debugging math diffs --- src/EnergyPlus/ChillerReformulatedEIR.cc | 27 +++++++++++++----------- src/EnergyPlus/PlantLoopEquip.cc | 6 ------ 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index f8de4b28bbb..75b1ec97e1b 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -133,6 +133,8 @@ namespace ChillerReformulatedEIR { // MODULE VARIABLE DECLARATIONS: int NumElecReformEIRChillers(0); // Number of electric reformulated EIR chillers specified in input + Real64 condOutletTempMod(0.0); + bool GetInputREIR(true); // When TRUE, calls subroutine to read input file // Object Data @@ -1735,7 +1737,7 @@ namespace ChillerReformulatedEIR { } else { // If iteration is not possible, average the min/max condenser outlet temperature and manually determine solution this->calculate(MyLoad, RunFlag, (CondTempMin + CondTempMax) / 2.0); - this->calculate(MyLoad, RunFlag, this->CondOutletTemp); + this->calculate(MyLoad, RunFlag, condOutletTempMod); } // Call subroutine to evaluate all performance curve min/max values against evaporator/condenser outlet temps and PLR @@ -1867,7 +1869,7 @@ namespace ChillerReformulatedEIR { } else { // Chiller is running, so pass calculated values // Set node temperatures DataLoopNode::Node(this->EvapOutletNodeNum).Temp = this->EvapOutletTemp; - DataLoopNode::Node(this->CondOutletNodeNum).Temp = this->CondOutletTemp; + DataLoopNode::Node(this->CondOutletNodeNum).Temp = condOutletTempMod; // Set node flow rates; for these load based models // assume that sufficient evaporator flow rate is available this->ChillerFalseLoad = this->ChillerFalseLoadRate * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; @@ -1876,6 +1878,7 @@ namespace ChillerReformulatedEIR { this->CondEnergy = this->QCondenser * DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; this->EvapInletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; + this->CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; if (this->Power != 0.0) { this->ActualCOP = (this->QEvaporator + this->ChillerFalseLoadRate) / this->Power; } else { @@ -1914,7 +1917,7 @@ namespace ChillerReformulatedEIR { bool RunFlag = (int(Par(3)) == 1); this->calculate(MyLoad, RunFlag, FalsiCondOutTemp); - Real64 CondOutTempResidual = FalsiCondOutTemp - this->CondOutletTemp; // CondOutletTemp is module level variable, final value used for reporting + Real64 CondOutTempResidual = FalsiCondOutTemp - condOutletTempMod; // CondOutletTemp is module level variable, final value used for reporting return CondOutTempResidual; } @@ -2083,7 +2086,7 @@ namespace ChillerReformulatedEIR { if ((this->QHeatRecovery + this->QCondenser) > 0.0) { // protect div by zero this->ChillerCondAvgTemp = (this->QHeatRecovery * this->HeatRecOutletTemp + - this->QCondenser * this->CondOutletTemp) / // Maybe here too + this->QCondenser * this->CondOutletTemp) / (this->QHeatRecovery + this->QCondenser); } else { this->ChillerCondAvgTemp = FalsiCondOutTemp; @@ -2417,7 +2420,7 @@ namespace ChillerReformulatedEIR { condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); - this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / Cp + condInletTemp; + condOutletTempMod = this->QCondenser / this->CondMassFlowRate / Cp + condInletTemp; } else { ShowSevereError("ControlReformEIRChillerModel: Condenser flow = 0, for ElecReformEIRChiller=" + this->Name); ShowContinueErrorTimeStamp(""); @@ -2533,7 +2536,7 @@ namespace ChillerReformulatedEIR { Real64 EIRFPLRPLRmax = this->ChillerEIRFPLRPLRMax; // Check bounds for curves, lump min/max into same check since min/max values are reported in recurring warning messages - if (this->CondOutletTemp < CAPFTYTmin || this->CondOutletTemp > CAPFTYTmax) { + if (condOutletTempMod < CAPFTYTmin || condOutletTempMod > CAPFTYTmax) { ++this->CAPFTYIter; if (this->CAPFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + @@ -2556,7 +2559,7 @@ namespace ChillerReformulatedEIR { } } - if (this->CondOutletTemp < EIRFTYTmin || this->CondOutletTemp > EIRFTYTmax) { + if (condOutletTempMod < EIRFTYTmin || condOutletTempMod > EIRFTYTmax) { ++this->EIRFTYIter; if (this->EIRFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + @@ -2582,7 +2585,7 @@ namespace ChillerReformulatedEIR { } if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - if (this->CondOutletTemp < EIRFPLRTmin || this->CondOutletTemp > EIRFPLRTmax) { + if (condOutletTempMod < EIRFPLRTmin || condOutletTempMod > EIRFPLRTmax) { ++this->EIRFPLRTIter; if (this->EIRFPLRTIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + @@ -2662,7 +2665,7 @@ namespace ChillerReformulatedEIR { } } - this->ChillerCapFT = CurveManager::CurveValue(this->ChillerCapFTIndex, EvapOutletTempSetPoint, this->CondOutletTemp); + this->ChillerCapFT = CurveManager::CurveValue(this->ChillerCapFTIndex, EvapOutletTempSetPoint, condOutletTempMod); if (this->ChillerCapFT < 0) { if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && @@ -2684,7 +2687,7 @@ namespace ChillerReformulatedEIR { } } - this->ChillerEIRFT = CurveManager::CurveValue(this->ChillerEIRFTIndex, this->EvapOutletTemp, this->CondOutletTemp); + this->ChillerEIRFT = CurveManager::CurveValue(this->ChillerEIRFTIndex, this->EvapOutletTemp, condOutletTempMod); if (this->ChillerEIRFT < 0.0) { if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && @@ -2707,11 +2710,11 @@ namespace ChillerReformulatedEIR { } if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - this->ChillerEIRFPLR = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, this->CondOutletTemp, this->ChillerPartLoadRatio); + this->ChillerEIRFPLR = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, condOutletTempMod, this->ChillerPartLoadRatio); } else if (this->PartLoadCurveType == PLR_Lift) { // Chiller lift [C] - Real64 ChillerLift = this->CondOutletTemp - this->EvapOutletTemp; + Real64 ChillerLift = condOutletTempMod - this->EvapOutletTemp; // Deviation of leaving chilled water temperature from the reference condition Real64 ChillerTdev = std::abs(this->EvapOutletTemp - this->TempRefEvapOut); diff --git a/src/EnergyPlus/PlantLoopEquip.cc b/src/EnergyPlus/PlantLoopEquip.cc index 6959d9c9c46..518282ce03c 100644 --- a/src/EnergyPlus/PlantLoopEquip.cc +++ b/src/EnergyPlus/PlantLoopEquip.cc @@ -172,13 +172,7 @@ namespace PlantLoopEquip { bool RunFlag; // TRUE if operating this iteration int EquipFlowCtrl; Real64 CurLoad; - Real64 MaxLoad; - Real64 MinLoad; - Real64 OptLoad; - Real64 SizingFac = 0.0; // the component sizing fraction int GeneralEquipType; // Basic Equipment type from EquipType Used to help organize this routine - Real64 TempCondInDesign; // Design condenser inlet temp. C , or 25.d0 - Real64 TempEvapOutDesign; EnergyPlus::PlantLocation sim_component_location(LoopNum, LoopSideNum, BranchNum, Num); // set up a reference for this component From afeb2eb74ba22cd9783b08a5e2a39367676aa362 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 22 Jan 2020 05:05:27 -0700 Subject: [PATCH 38/41] debugging math diffs --- src/EnergyPlus/ChillerReformulatedEIR.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 75b1ec97e1b..1864ca3d9db 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -1737,7 +1737,7 @@ namespace ChillerReformulatedEIR { } else { // If iteration is not possible, average the min/max condenser outlet temperature and manually determine solution this->calculate(MyLoad, RunFlag, (CondTempMin + CondTempMax) / 2.0); - this->calculate(MyLoad, RunFlag, condOutletTempMod); + this->calculate(MyLoad, RunFlag, this->CondOutletTemp); } // Call subroutine to evaluate all performance curve min/max values against evaporator/condenser outlet temps and PLR @@ -2536,7 +2536,7 @@ namespace ChillerReformulatedEIR { Real64 EIRFPLRPLRmax = this->ChillerEIRFPLRPLRMax; // Check bounds for curves, lump min/max into same check since min/max values are reported in recurring warning messages - if (condOutletTempMod < CAPFTYTmin || condOutletTempMod > CAPFTYTmax) { + if (this->CondOutletTemp < CAPFTYTmin || this->CondOutletTemp > CAPFTYTmax) { ++this->CAPFTYIter; if (this->CAPFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + @@ -2559,7 +2559,7 @@ namespace ChillerReformulatedEIR { } } - if (condOutletTempMod < EIRFTYTmin || condOutletTempMod > EIRFTYTmax) { + if (this->CondOutletTemp < EIRFTYTmin || this->CondOutletTemp > EIRFTYTmax) { ++this->EIRFTYIter; if (this->EIRFTYIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + @@ -2585,7 +2585,7 @@ namespace ChillerReformulatedEIR { } if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { - if (condOutletTempMod < EIRFPLRTmin || condOutletTempMod > EIRFPLRTmax) { + if (this->CondOutletTemp < EIRFPLRTmin || this->CondOutletTemp > EIRFPLRTmax) { ++this->EIRFPLRTIter; if (this->EIRFPLRTIter == 1) { ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + From 23df99126e55ee9004da34c4fcf5734775988207 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 22 Jan 2020 05:44:16 -0700 Subject: [PATCH 39/41] debugging math diffs --- src/EnergyPlus/ChillerReformulatedEIR.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 1864ca3d9db..fb0f54c0a81 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -1672,11 +1672,13 @@ namespace ChillerReformulatedEIR { this->calculate(MyLoad, RunFlag, Tmin); // Condenser outlet temperature when using Tmin as input to calculate [C] - Real64 CondTempMin = this->CondOutletTemp; + Real64 CondTempMin = condOutletTempMod; + + // Check that condenser outlet temperature is within curve object limits prior to calling RegulaFalsi this->calculate(MyLoad, RunFlag, Tmax); // Condenser outlet temperature when using Tmax as input to CalcReformEIRChillerModel [C] - Real64 CondTempMax = this->CondOutletTemp; + Real64 CondTempMax = condOutletTempMod; if (CondTempMin > Tmin && CondTempMax < Tmax) { @@ -2083,8 +2085,7 @@ namespace ChillerReformulatedEIR { // correct temperature if using heat recovery // use report values for latest valid calculation, lagged somewhat if (this->HeatRecActive) { - if ((this->QHeatRecovery + this->QCondenser) > - 0.0) { // protect div by zero + if ((this->QHeatRecovery + this->QCondenser) > 0.0) { // protect div by zero this->ChillerCondAvgTemp = (this->QHeatRecovery * this->HeatRecOutletTemp + this->QCondenser * this->CondOutletTemp) / (this->QHeatRecovery + this->QCondenser); From 50e8806edfc6cf2a0335564c8bf72fc4f9b14090 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 22 Jan 2020 11:02:54 -0700 Subject: [PATCH 40/41] minor comments cleanup --- src/EnergyPlus/ChillerReformulatedEIR.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index fb0f54c0a81..d2f35aac1c6 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -326,7 +326,7 @@ namespace ChillerReformulatedEIR { ErrorsFound = true; } - // Check the type of part-load curves implemented: 1_LeavingCondenserWaterTemperature, 2_Lift zrp_Aug2014 + // Check the type of part-load curves implemented: 1_LeavingCondenserWaterTemperature, 2_Lift if (UtilityRoutines::SameString(PartLoadCurveType, "LeavingCondenserWaterTemperature") && CurveManager::PerfCurve(ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLRIndex).NumDims == 2) { ElecReformEIRChiller(EIRChillerNum).PartLoadCurveType = PLR_LeavingCondenserWaterTemperature; @@ -1464,7 +1464,7 @@ namespace ChillerReformulatedEIR { if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { CurveVal = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, this->TempRefCondOut, 1.0); } else if (this->PartLoadCurveType == PLR_Lift) { - CurveVal = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, 1.0, 1.0, 0.0); // zrp_Aug2014 + CurveVal = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, 1.0, 1.0, 0.0); } if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError("Energy input ratio as a function of part-load ratio curve output is not equal to 1.0"); @@ -1478,7 +1478,7 @@ namespace ChillerReformulatedEIR { this->ChillerEIRFPLRTempMax, this->ChillerEIRFPLRPLRMin, this->ChillerEIRFPLRPLRMax); - } else if (this->PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 + } else if (this->PartLoadCurveType == PLR_Lift) { CurveManager::GetCurveMinMaxValues(this->ChillerEIRFPLRIndex, this->ChillerLiftNomMin, this->ChillerLiftNomMax, @@ -1592,7 +1592,7 @@ namespace ChillerReformulatedEIR { this->ChillerEIRFPLRTempMax, this->ChillerEIRFPLRPLRMin, this->ChillerEIRFPLRPLRMax); - } else if (this->PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 + } else if (this->PartLoadCurveType == PLR_Lift) { CurveManager::GetCurveMinMaxValues(this->ChillerEIRFPLRIndex, this->ChillerLiftNomMin, this->ChillerLiftNomMax, @@ -1649,7 +1649,7 @@ namespace ChillerReformulatedEIR { // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] Real64 EIRFPLRTmin = this->ChillerEIRFPLRTempMin; Tmin = min(CAPFTYTmin, EIRFTYTmin, EIRFPLRTmin); - } else if (this->PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 + } else if (this->PartLoadCurveType == PLR_Lift) { Tmin = min(CAPFTYTmin, EIRFTYTmin); } @@ -1664,7 +1664,7 @@ namespace ChillerReformulatedEIR { // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] Real64 EIRFPLRTmax = this->ChillerEIRFPLRTempMax; Tmax = max(CAPFTYTmax, EIRFTYTmax, EIRFPLRTmax); - } else if (this->PartLoadCurveType == PLR_Lift) { // zrp_Aug2014 + } else if (this->PartLoadCurveType == PLR_Lift) { Tmax = max(CAPFTYTmax, EIRFTYTmax); } @@ -2068,7 +2068,7 @@ namespace ChillerReformulatedEIR { } } - // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) + // If there is a fault of Chiller SWT Sensor if (this->FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = this->FaultyChillerSWTIndex; Real64 EvapOutletTempSetPoint_ff = EvapOutletTempSetPoint; @@ -2240,7 +2240,7 @@ namespace ChillerReformulatedEIR { } } // End of Constant Variable Flow If Block - // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) + // If there is a fault of Chiller SWT Sensor if (this->FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation) && (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator @@ -2320,7 +2320,7 @@ namespace ChillerReformulatedEIR { } } - // If there is a fault of Chiller SWT Sensor (zrp_Jun2016) + // If there is a fault of Chiller SWT Sensor if (this->FaultyChillerSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation) && (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator @@ -2382,7 +2382,7 @@ namespace ChillerReformulatedEIR { this->ChillerEIRFT = max(0.0, CurveManager::CurveValue(this->ChillerEIRFTIndex, this->EvapOutletTemp, this->ChillerCondAvgTemp)); - // Part Load Ratio Curve Type: 1_LeavingCondenserWaterTemperature; 2_Lift zrp_Aug2014 + // Part Load Ratio Curve Type: 1_LeavingCondenserWaterTemperature; 2_Lift if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { this->ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(this->ChillerEIRFPLRIndex, this->ChillerCondAvgTemp, PartLoadRat)); } else if (this->PartLoadCurveType == PLR_Lift) { From c32ff50feaf2364118d912f5215c5318676d4b11 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 22 Jan 2020 11:04:23 -0700 Subject: [PATCH 41/41] apply style --- src/EnergyPlus/ChillerReformulatedEIR.cc | 1105 ++++++++++------------ src/EnergyPlus/ChillerReformulatedEIR.hh | 86 +- 2 files changed, 540 insertions(+), 651 deletions(-) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index d2f35aac1c6..80387eef100 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -142,9 +142,9 @@ namespace ChillerReformulatedEIR { void clear_state() { - NumElecReformEIRChillers = 0; - GetInputREIR = true; - ElecReformEIRChiller.deallocate(); + NumElecReformEIRChillers = 0; + GetInputREIR = true; + ElecReformEIRChiller.deallocate(); } PlantComponent *ReformulatedEIRChillerSpecs::factory(std::string const &objectName) @@ -221,26 +221,26 @@ namespace ChillerReformulatedEIR { } else if (calledFromLocation.loopNum == this->CDLoopNum) { int LoopSide = this->CDLoopSideNum; PlantUtilities::UpdateChillerComponentCondenserSide(calledFromLocation.loopNum, - LoopSide, - DataPlant::TypeOf_Chiller_ElectricReformEIR, - this->CondInletNodeNum, - this->CondOutletNodeNum, - this->QCondenser, - this->CondInletTemp, - this->CondOutletTemp, - this->CondMassFlowRate, - FirstHVACIteration); + LoopSide, + DataPlant::TypeOf_Chiller_ElectricReformEIR, + this->CondInletNodeNum, + this->CondOutletNodeNum, + this->QCondenser, + this->CondInletTemp, + this->CondOutletTemp, + this->CondMassFlowRate, + FirstHVACIteration); } else if (calledFromLocation.loopNum == this->HRLoopNum) { PlantUtilities::UpdateComponentHeatRecoverySide(this->HRLoopNum, - this->HRLoopSideNum, - DataPlant::TypeOf_Chiller_ElectricReformEIR, - this->HeatRecInletNodeNum, - this->HeatRecOutletNodeNum, - this->QHeatRecovery, - this->HeatRecInletTemp, - this->HeatRecOutletTemp, - this->HeatRecMassFlow, - FirstHVACIteration); + this->HRLoopSideNum, + DataPlant::TypeOf_Chiller_ElectricReformEIR, + this->HeatRecInletNodeNum, + this->HeatRecOutletNodeNum, + this->QHeatRecovery, + this->HeatRecInletTemp, + this->HeatRecOutletTemp, + this->HeatRecMassFlow, + FirstHVACIteration); } } @@ -258,7 +258,7 @@ namespace ChillerReformulatedEIR { static std::string const RoutineName("GetElecReformEIRChillerInput: "); // include trailing blank space - bool ErrorsFound(false); // True when input errors found + bool ErrorsFound(false); // True when input errors found DataIPShortCuts::cCurrentModuleObject = "Chiller:Electric:ReformulatedEIR"; NumElecReformEIRChillers = inputProcessor->getNumObjectsFound(DataIPShortCuts::cCurrentModuleObject); @@ -273,9 +273,9 @@ namespace ChillerReformulatedEIR { // Load arrays with reformulated electric EIR chiller data for (int EIRChillerNum = 1; EIRChillerNum <= NumElecReformEIRChillers; ++EIRChillerNum) { - int NumAlphas; // Number of elements in the alpha array - int NumNums; // Number of elements in the numeric array - int IOStat; // IO Status when calling get input subroutine + int NumAlphas; // Number of elements in the alpha array + int NumNums; // Number of elements in the numeric array + int IOStat; // IO Status when calling get input subroutine inputProcessor->getObjectItem(DataIPShortCuts::cCurrentModuleObject, EIRChillerNum, DataIPShortCuts::cAlphaArgs, @@ -290,7 +290,8 @@ namespace ChillerReformulatedEIR { UtilityRoutines::IsNameEmpty(DataIPShortCuts::cAlphaArgs(1), DataIPShortCuts::cCurrentModuleObject, ErrorsFound); // ErrorsFound will be set to True if problem was found, left untouched otherwise - GlobalNames::VerifyUniqueChillerName(DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), ErrorsFound, DataIPShortCuts::cCurrentModuleObject + " Name"); + GlobalNames::VerifyUniqueChillerName( + DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), ErrorsFound, DataIPShortCuts::cCurrentModuleObject + " Name"); ElecReformEIRChiller(EIRChillerNum).Name = DataIPShortCuts::cAlphaArgs(1); // Performance curves @@ -311,7 +312,7 @@ namespace ChillerReformulatedEIR { } // The default type of part-load curve is: LeavingCondenserWaterTemperature - std::string PartLoadCurveType; // Part load curve type + std::string PartLoadCurveType; // Part load curve type if (DataIPShortCuts::lAlphaFieldBlanks(4)) { PartLoadCurveType = "LeavingCondenserWaterTemperature"; } else { @@ -335,7 +336,8 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).PartLoadCurveType = PLR_Lift; } else { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(5) + '=' + DataIPShortCuts::cAlphaArgs(5) + " for " + DataIPShortCuts::cAlphaFieldNames(4) + '=' + DataIPShortCuts::cAlphaArgs(4)); + ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(5) + '=' + DataIPShortCuts::cAlphaArgs(5) + " for " + + DataIPShortCuts::cAlphaFieldNames(4) + '=' + DataIPShortCuts::cAlphaArgs(4)); ErrorsFound = true; } @@ -351,11 +353,27 @@ namespace ChillerReformulatedEIR { ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).EvapInletNodeNum = NodeInputManager::GetOnlySingleNode( - DataIPShortCuts::cAlphaArgs(6), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); - ElecReformEIRChiller(EIRChillerNum).EvapOutletNodeNum = NodeInputManager::GetOnlySingleNode( - DataIPShortCuts::cAlphaArgs(7), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 1, DataLoopNode::ObjectIsNotParent); - BranchNodeConnections::TestCompSet(DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataIPShortCuts::cAlphaArgs(6), DataIPShortCuts::cAlphaArgs(7), "Chilled Water Nodes"); + ElecReformEIRChiller(EIRChillerNum).EvapInletNodeNum = NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(6), + ErrorsFound, + DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Inlet, + 1, + DataLoopNode::ObjectIsNotParent); + ElecReformEIRChiller(EIRChillerNum).EvapOutletNodeNum = NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(7), + ErrorsFound, + DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Outlet, + 1, + DataLoopNode::ObjectIsNotParent); + BranchNodeConnections::TestCompSet(DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), + DataIPShortCuts::cAlphaArgs(6), + DataIPShortCuts::cAlphaArgs(7), + "Chilled Water Nodes"); ElecReformEIRChiller(EIRChillerNum).CondenserType = WaterCooled; @@ -371,12 +389,28 @@ namespace ChillerReformulatedEIR { ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).CondInletNodeNum = NodeInputManager::GetOnlySingleNode( - DataIPShortCuts::cAlphaArgs(8), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 2, DataLoopNode::ObjectIsNotParent); - ElecReformEIRChiller(EIRChillerNum).CondOutletNodeNum = NodeInputManager::GetOnlySingleNode( - DataIPShortCuts::cAlphaArgs(9), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 2, DataLoopNode::ObjectIsNotParent); - - BranchNodeConnections::TestCompSet(DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataIPShortCuts::cAlphaArgs(8), DataIPShortCuts::cAlphaArgs(9), "Condenser Water Nodes"); + ElecReformEIRChiller(EIRChillerNum).CondInletNodeNum = NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(8), + ErrorsFound, + DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Inlet, + 2, + DataLoopNode::ObjectIsNotParent); + ElecReformEIRChiller(EIRChillerNum).CondOutletNodeNum = NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(9), + ErrorsFound, + DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Outlet, + 2, + DataLoopNode::ObjectIsNotParent); + + BranchNodeConnections::TestCompSet(DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), + DataIPShortCuts::cAlphaArgs(8), + DataIPShortCuts::cAlphaArgs(9), + "Condenser Water Nodes"); { auto const SELECT_CASE_var(DataIPShortCuts::cAlphaArgs(10)); @@ -402,14 +436,16 @@ namespace ChillerReformulatedEIR { } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); + ShowContinueError("Invalid " + DataIPShortCuts::cNumericFieldNames(1) + '=' + + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(1), 2)); ErrorsFound = true; } ElecReformEIRChiller(EIRChillerNum).RefCOP = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) == 0.0) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError("Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); + ShowContinueError("Invalid " + DataIPShortCuts::cNumericFieldNames(2) + '=' + + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(2), 2)); ErrorsFound = true; } @@ -417,7 +453,8 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).TempRefCondOut = DataIPShortCuts::rNumericArgs(4); if (ElecReformEIRChiller(EIRChillerNum).TempRefEvapOut >= ElecReformEIRChiller(EIRChillerNum).TempRefCondOut) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(DataIPShortCuts::cNumericFieldNames(3) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(3), 2) + "] >= " + DataIPShortCuts::cNumericFieldNames(4) + " [" + + ShowContinueError(DataIPShortCuts::cNumericFieldNames(3) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(3), 2) + + "] >= " + DataIPShortCuts::cNumericFieldNames(4) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(4), 2) + ']'); ShowContinueError("Reference Leaving Chilled Water Temperature must be less than Reference Leaving Condenser Water Temperature "); ErrorsFound = true; @@ -440,7 +477,8 @@ namespace ChillerReformulatedEIR { if (ElecReformEIRChiller(EIRChillerNum).MinPartLoadRat > ElecReformEIRChiller(EIRChillerNum).MaxPartLoadRat) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); - ShowContinueError(DataIPShortCuts::cNumericFieldNames(7) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(7), 3) + "] > " + DataIPShortCuts::cNumericFieldNames(8) + " [" + + ShowContinueError(DataIPShortCuts::cNumericFieldNames(7) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(7), 3) + + "] > " + DataIPShortCuts::cNumericFieldNames(8) + " [" + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(8), 3) + ']'); ShowContinueError("Minimum part load ratio must be less than or equal to the maximum part load ratio "); ErrorsFound = true; @@ -450,8 +488,10 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).MinUnloadRat > ElecReformEIRChiller(EIRChillerNum).MaxPartLoadRat) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError(DataIPShortCuts::cNumericFieldNames(10) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(10), 3)); - ShowContinueError(DataIPShortCuts::cNumericFieldNames(10) + " must be greater than or equal to the " + DataIPShortCuts::cNumericFieldNames(7)); - ShowContinueError(DataIPShortCuts::cNumericFieldNames(10) + " must be less than or equal to the " + DataIPShortCuts::cNumericFieldNames(8)); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(10) + " must be greater than or equal to the " + + DataIPShortCuts::cNumericFieldNames(7)); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(10) + " must be less than or equal to the " + + DataIPShortCuts::cNumericFieldNames(8)); ErrorsFound = true; } @@ -459,8 +499,10 @@ namespace ChillerReformulatedEIR { ElecReformEIRChiller(EIRChillerNum).OptPartLoadRat > ElecReformEIRChiller(EIRChillerNum).MaxPartLoadRat) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError(DataIPShortCuts::cNumericFieldNames(9) + " = " + General::RoundSigDigits(DataIPShortCuts::rNumericArgs(9), 3)); - ShowContinueError(DataIPShortCuts::cNumericFieldNames(9) + " must be greater than or equal to the " + DataIPShortCuts::cNumericFieldNames(7)); - ShowContinueError(DataIPShortCuts::cNumericFieldNames(9) + " must be less than or equal to the " + DataIPShortCuts::cNumericFieldNames(8)); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(9) + " must be greater than or equal to the " + + DataIPShortCuts::cNumericFieldNames(7)); + ShowContinueError(DataIPShortCuts::cNumericFieldNames(9) + " must be less than or equal to the " + + DataIPShortCuts::cNumericFieldNames(8)); ErrorsFound = true; } @@ -485,21 +527,28 @@ namespace ChillerReformulatedEIR { if ((ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate > 0.0) || (ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate == DataSizing::AutoSize)) { ElecReformEIRChiller(EIRChillerNum).HeatRecActive = true; - ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum = NodeInputManager::GetOnlySingleNode( - DataIPShortCuts::cAlphaArgs(11), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 3, DataLoopNode::ObjectIsNotParent); + ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum = NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(11), + ErrorsFound, + DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Inlet, + 3, + DataLoopNode::ObjectIsNotParent); if (ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum == 0) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(11) + '=' + DataIPShortCuts::cAlphaArgs(11)); ErrorsFound = true; } - ElecReformEIRChiller(EIRChillerNum).HeatRecOutletNodeNum = NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(12), - ErrorsFound, - DataIPShortCuts::cCurrentModuleObject, - DataIPShortCuts::cAlphaArgs(1), - DataLoopNode::NodeType_Water, - DataLoopNode::NodeConnectionType_Outlet, - 3, - DataLoopNode::ObjectIsNotParent); + ElecReformEIRChiller(EIRChillerNum).HeatRecOutletNodeNum = + NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(12), + ErrorsFound, + DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Outlet, + 3, + DataLoopNode::ObjectIsNotParent); if (ElecReformEIRChiller(EIRChillerNum).HeatRecOutletNodeNum == 0) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(12) + '=' + DataIPShortCuts::cAlphaArgs(12)); @@ -511,11 +560,15 @@ namespace ChillerReformulatedEIR { ErrorsFound = true; } - BranchNodeConnections::TestCompSet(DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), DataIPShortCuts::cAlphaArgs(11), DataIPShortCuts::cAlphaArgs(12), "Heat Recovery Nodes"); + BranchNodeConnections::TestCompSet(DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), + DataIPShortCuts::cAlphaArgs(11), + DataIPShortCuts::cAlphaArgs(12), + "Heat Recovery Nodes"); if (ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate > 0.0) { PlantUtilities::RegisterPlantCompDesignFlow(ElecReformEIRChiller(EIRChillerNum).HeatRecInletNodeNum, - ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate); + ElecReformEIRChiller(EIRChillerNum).DesignHeatRecVolFlowRate); } if (NumNums > 14) { if (!DataIPShortCuts::lNumericFieldBlanks(15)) { @@ -529,7 +582,8 @@ namespace ChillerReformulatedEIR { if (NumAlphas > 12) { if (!DataIPShortCuts::lAlphaFieldBlanks(13)) { - ElecReformEIRChiller(EIRChillerNum).HeatRecInletLimitSchedNum = ScheduleManager::GetScheduleIndex(DataIPShortCuts::cAlphaArgs(13)); + ElecReformEIRChiller(EIRChillerNum).HeatRecInletLimitSchedNum = + ScheduleManager::GetScheduleIndex(DataIPShortCuts::cAlphaArgs(13)); if (ElecReformEIRChiller(EIRChillerNum).HeatRecInletLimitSchedNum == 0) { ShowSevereError(RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError("Invalid " + DataIPShortCuts::cAlphaFieldNames(13) + '=' + DataIPShortCuts::cAlphaArgs(13)); @@ -544,14 +598,15 @@ namespace ChillerReformulatedEIR { if (NumAlphas > 13) { if (!DataIPShortCuts::lAlphaFieldBlanks(14)) { - ElecReformEIRChiller(EIRChillerNum).HeatRecSetPointNodeNum = NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(14), - ErrorsFound, - DataIPShortCuts::cCurrentModuleObject, - DataIPShortCuts::cAlphaArgs(1), - DataLoopNode::NodeType_Water, - DataLoopNode::NodeConnectionType_Sensor, - 1, - DataLoopNode::ObjectIsNotParent); + ElecReformEIRChiller(EIRChillerNum).HeatRecSetPointNodeNum = + NodeInputManager::GetOnlySingleNode(DataIPShortCuts::cAlphaArgs(14), + ErrorsFound, + DataIPShortCuts::cCurrentModuleObject, + DataIPShortCuts::cAlphaArgs(1), + DataLoopNode::NodeType_Water, + DataLoopNode::NodeConnectionType_Sensor, + 1, + DataLoopNode::ObjectIsNotParent); } else { ElecReformEIRChiller(EIRChillerNum).HeatRecSetPointNodeNum = 0; } @@ -585,26 +640,11 @@ namespace ChillerReformulatedEIR { void ReformulatedEIRChillerSpecs::setupOutputVars() { - SetupOutputVariable("Chiller Part Load Ratio", - OutputProcessor::Unit::None, - this->ChillerPartLoadRatio, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Part Load Ratio", OutputProcessor::Unit::None, this->ChillerPartLoadRatio, "System", "Average", this->Name); - SetupOutputVariable("Chiller Cycling Ratio", - OutputProcessor::Unit::None, - this->ChillerCyclingRatio, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Cycling Ratio", OutputProcessor::Unit::None, this->ChillerCyclingRatio, "System", "Average", this->Name); - SetupOutputVariable("Chiller Electric Power", - OutputProcessor::Unit::W, - this->Power, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Electric Power", OutputProcessor::Unit::W, this->Power, "System", "Average", this->Name); SetupOutputVariable("Chiller Electric Energy", OutputProcessor::Unit::J, @@ -618,12 +658,7 @@ namespace ChillerReformulatedEIR { this->EndUseSubcategory, "Plant"); - SetupOutputVariable("Chiller Evaporator Cooling Rate", - OutputProcessor::Unit::W, - this->QEvaporator, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Evaporator Cooling Rate", OutputProcessor::Unit::W, this->QEvaporator, "System", "Average", this->Name); SetupOutputVariable("Chiller Evaporator Cooling Energy", OutputProcessor::Unit::J, @@ -637,47 +672,19 @@ namespace ChillerReformulatedEIR { _, "Plant"); - SetupOutputVariable("Chiller False Load Heat Transfer Rate", - OutputProcessor::Unit::W, - this->ChillerFalseLoadRate, - "System", - "Average", - this->Name); + SetupOutputVariable( + "Chiller False Load Heat Transfer Rate", OutputProcessor::Unit::W, this->ChillerFalseLoadRate, "System", "Average", this->Name); - SetupOutputVariable("Chiller False Load Heat Transfer Energy", - OutputProcessor::Unit::J, - this->ChillerFalseLoad, - "System", - "Sum", - this->Name); + SetupOutputVariable("Chiller False Load Heat Transfer Energy", OutputProcessor::Unit::J, this->ChillerFalseLoad, "System", "Sum", this->Name); - SetupOutputVariable("Chiller Evaporator Inlet Temperature", - OutputProcessor::Unit::C, - this->EvapInletTemp, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Evaporator Inlet Temperature", OutputProcessor::Unit::C, this->EvapInletTemp, "System", "Average", this->Name); - SetupOutputVariable("Chiller Evaporator Outlet Temperature", - OutputProcessor::Unit::C, - this->EvapOutletTemp, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Evaporator Outlet Temperature", OutputProcessor::Unit::C, this->EvapOutletTemp, "System", "Average", this->Name); - SetupOutputVariable("Chiller Evaporator Mass Flow Rate", - OutputProcessor::Unit::kg_s, - this->EvapMassFlowRate, - "System", - "Average", - this->Name); + SetupOutputVariable( + "Chiller Evaporator Mass Flow Rate", OutputProcessor::Unit::kg_s, this->EvapMassFlowRate, "System", "Average", this->Name); - SetupOutputVariable("Chiller Condenser Heat Transfer Rate", - OutputProcessor::Unit::W, - this->QCondenser, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Condenser Heat Transfer Rate", OutputProcessor::Unit::W, this->QCondenser, "System", "Average", this->Name); SetupOutputVariable("Chiller Condenser Heat Transfer Energy", OutputProcessor::Unit::J, @@ -691,63 +698,26 @@ namespace ChillerReformulatedEIR { _, "Plant"); - SetupOutputVariable("Chiller COP", - OutputProcessor::Unit::W_W, - this->ActualCOP, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller COP", OutputProcessor::Unit::W_W, this->ActualCOP, "System", "Average", this->Name); - SetupOutputVariable("Chiller Capacity Temperature Modifier Multiplier", - OutputProcessor::Unit::None, - this->ChillerCapFT, - "System", - "Average", - this->Name); + SetupOutputVariable( + "Chiller Capacity Temperature Modifier Multiplier", OutputProcessor::Unit::None, this->ChillerCapFT, "System", "Average", this->Name); - SetupOutputVariable("Chiller EIR Temperature Modifier Multiplier", - OutputProcessor::Unit::None, - this->ChillerEIRFT, - "System", - "Average", - this->Name); + SetupOutputVariable( + "Chiller EIR Temperature Modifier Multiplier", OutputProcessor::Unit::None, this->ChillerEIRFT, "System", "Average", this->Name); - SetupOutputVariable("Chiller EIR Part Load Modifier Multiplier", - OutputProcessor::Unit::None, - this->ChillerEIRFPLR, - "System", - "Average", - this->Name); + SetupOutputVariable( + "Chiller EIR Part Load Modifier Multiplier", OutputProcessor::Unit::None, this->ChillerEIRFPLR, "System", "Average", this->Name); - SetupOutputVariable("Chiller Condenser Inlet Temperature", - OutputProcessor::Unit::C, - this->CondInletTemp, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Condenser Inlet Temperature", OutputProcessor::Unit::C, this->CondInletTemp, "System", "Average", this->Name); - SetupOutputVariable("Chiller Condenser Outlet Temperature", - OutputProcessor::Unit::C, - this->CondOutletTemp, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Condenser Outlet Temperature", OutputProcessor::Unit::C, this->CondOutletTemp, "System", "Average", this->Name); - SetupOutputVariable("Chiller Condenser Mass Flow Rate", - OutputProcessor::Unit::kg_s, - this->CondMassFlowRate, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, this->CondMassFlowRate, "System", "Average", this->Name); // If heat recovery is active then setup report variables if (this->HeatRecActive) { - SetupOutputVariable("Chiller Total Recovered Heat Rate", - OutputProcessor::Unit::W, - this->QHeatRecovery, - "System", - "Average", - this->Name); + SetupOutputVariable("Chiller Total Recovered Heat Rate", OutputProcessor::Unit::W, this->QHeatRecovery, "System", "Average", this->Name); SetupOutputVariable("Chiller Total Recovered Heat Energy", OutputProcessor::Unit::J, @@ -761,38 +731,21 @@ namespace ChillerReformulatedEIR { _, "Plant"); - SetupOutputVariable("Chiller Heat Recovery Inlet Temperature", - OutputProcessor::Unit::C, - this->HeatRecInletTemp, - "System", - "Average", - this->Name); + SetupOutputVariable( + "Chiller Heat Recovery Inlet Temperature", OutputProcessor::Unit::C, this->HeatRecInletTemp, "System", "Average", this->Name); - SetupOutputVariable("Chiller Heat Recovery Outlet Temperature", - OutputProcessor::Unit::C, - this->HeatRecOutletTemp, - "System", - "Average", - this->Name); + SetupOutputVariable( + "Chiller Heat Recovery Outlet Temperature", OutputProcessor::Unit::C, this->HeatRecOutletTemp, "System", "Average", this->Name); - SetupOutputVariable("Chiller Heat Recovery Mass Flow Rate", - OutputProcessor::Unit::kg_s, - this->HeatRecMassFlow, - "System", - "Average", - this->Name); + SetupOutputVariable( + "Chiller Heat Recovery Mass Flow Rate", OutputProcessor::Unit::kg_s, this->HeatRecMassFlow, "System", "Average", this->Name); - SetupOutputVariable("Chiller Effective Heat Rejection Temperature", - OutputProcessor::Unit::C, - this->ChillerCondAvgTemp, - "System", - "Average", - this->Name); + SetupOutputVariable( + "Chiller Effective Heat Rejection Temperature", OutputProcessor::Unit::C, this->ChillerCondAvgTemp, "System", "Average", this->Name); } if (DataGlobals::AnyEnergyManagementSystemInModel) { - SetupEMSInternalVariable( - "Chiller Nominal Capacity", this->Name, "[W]", this->RefCap); + SetupEMSInternalVariable("Chiller Nominal Capacity", this->Name, "[W]", this->RefCap); } } @@ -821,65 +774,53 @@ namespace ChillerReformulatedEIR { // Locate the chillers on the plant loops for later usage bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(this->Name, - DataPlant::TypeOf_Chiller_ElectricReformEIR, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum, - errFlag, - this->TempLowLimitEvapOut, - _, - _, - this->EvapInletNodeNum, - _); + DataPlant::TypeOf_Chiller_ElectricReformEIR, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + errFlag, + this->TempLowLimitEvapOut, + _, + _, + this->EvapInletNodeNum, + _); if (this->CondenserType != AirCooled) { PlantUtilities::ScanPlantLoopsForObject(this->Name, - DataPlant::TypeOf_Chiller_ElectricReformEIR, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum, - errFlag, - _, - _, - _, - this->CondInletNodeNum, - _); - PlantUtilities::InterConnectTwoPlantLoopSides(this->CWLoopNum, - this->CWLoopSideNum, - this->CDLoopNum, - this->CDLoopSideNum, - DataPlant::TypeOf_Chiller_ElectricReformEIR, - true); + DataPlant::TypeOf_Chiller_ElectricReformEIR, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum, + errFlag, + _, + _, + _, + this->CondInletNodeNum, + _); + PlantUtilities::InterConnectTwoPlantLoopSides( + this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, true); } if (this->HeatRecActive) { PlantUtilities::ScanPlantLoopsForObject(this->Name, - DataPlant::TypeOf_Chiller_ElectricReformEIR, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum, - errFlag, - _, - _, - _, - this->HeatRecInletNodeNum, - _); - PlantUtilities::InterConnectTwoPlantLoopSides(this->CWLoopNum, - this->CWLoopSideNum, - this->HRLoopNum, - this->HRLoopSideNum, - DataPlant::TypeOf_Chiller_ElectricReformEIR, - true); + DataPlant::TypeOf_Chiller_ElectricReformEIR, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum, + errFlag, + _, + _, + _, + this->HeatRecInletNodeNum, + _); + PlantUtilities::InterConnectTwoPlantLoopSides( + this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, true); } if ((this->CondenserType != AirCooled) && (this->HeatRecActive)) { - PlantUtilities::InterConnectTwoPlantLoopSides(this->CDLoopNum, - this->CDLoopSideNum, - this->HRLoopNum, - this->HRLoopSideNum, - DataPlant::TypeOf_Chiller_ElectricReformEIR, - false); + PlantUtilities::InterConnectTwoPlantLoopSides( + this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, false); } if (errFlag) { @@ -888,27 +829,20 @@ namespace ChillerReformulatedEIR { if (this->FlowMode == ConstantFlow) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + DataPlant::LoopFlowStatus_NeedyIfLoopOn; } if (this->FlowMode == LeavingSetPointModulated) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum) - .LoopSide(this->CWLoopSideNum) - .Branch(this->CWBranchNum) - .Comp(this->CWCompNum) - .FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + DataPlant::LoopFlowStatus_NeedyIfLoopOn; // check if setpoint on outlet node if ((DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)) { if (!DataGlobals::AnyEnergyManagementSystemInModel) { if (!this->ModulatedFlowErrDone) { - ShowWarningError("Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + - this->Name); + ShowWarningError("Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); ShowContinueError( " A temperature setpoint is needed at the outlet node of a chiller in variable flow mode, use a SetpointManager"); ShowContinueError(" The overall loop setpoint will be assumed for chiller. The simulation continues ... "); @@ -920,8 +854,7 @@ namespace ChillerReformulatedEIR { EMSManager::CheckIfNodeSetPointManagedByEMS(this->EvapOutletNodeNum, EMSManager::iTemperatureSetPoint, fatalError); if (fatalError) { if (!this->ModulatedFlowErrDone) { - ShowWarningError("Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + - this->Name); + ShowWarningError("Missing temperature setpoint for LeavingSetpointModulated mode chiller named " + this->Name); ShowContinueError( " A temperature setpoint is needed at the outlet node of a chiller evaporator in variable flow mode"); ShowContinueError(" use a Setpoint Manager to establish a setpoint at the chiller evaporator outlet node "); @@ -941,46 +874,47 @@ namespace ChillerReformulatedEIR { this->MyInitFlag = false; } - this->EquipFlowCtrl = DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; + this->EquipFlowCtrl = + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; if (this->MyEnvrnFlag && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, - RoutineName); + DataGlobals::CWInitConvTemp, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + RoutineName); this->EvapMassFlowRateMax = this->EvapVolFlowRate * rho; PlantUtilities::InitComponentNodes(0.0, - this->EvapMassFlowRateMax, - this->EvapInletNodeNum, - this->EvapOutletNodeNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum); + this->EvapMassFlowRateMax, + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); if (this->CondenserType == WaterCooled) { rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - this->TempRefCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); + this->TempRefCondIn, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + RoutineName); this->CondMassFlowRateMax = rho * this->CondVolFlowRate; PlantUtilities::InitComponentNodes(0.0, - this->CondMassFlowRateMax, - this->CondInletNodeNum, - this->CondOutletNodeNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum); + this->CondMassFlowRateMax, + this->CondInletNodeNum, + this->CondOutletNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); DataLoopNode::Node(this->CondInletNodeNum).Temp = this->TempRefCondIn; } else { // air or evap air condenser // Initialize maximum available condenser flow rate - DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate = this->CondVolFlowRate * - Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::StdBaroPress, this->TempRefCondIn, 0.0, RoutineName); + DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate = + this->CondVolFlowRate * Psychrometrics::PsyRhoAirFnPbTdbW(DataEnvironment::StdBaroPress, this->TempRefCondIn, 0.0, RoutineName); DataLoopNode::Node(this->CondOutletNodeNum).MassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; DataLoopNode::Node(this->CondInletNodeNum).MassFlowRateMaxAvail = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; DataLoopNode::Node(this->CondInletNodeNum).MassFlowRateMax = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; @@ -994,22 +928,20 @@ namespace ChillerReformulatedEIR { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->HRLoopNum).FluidName, - DataGlobals::HWInitConvTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, - RoutineName); + DataGlobals::HWInitConvTemp, + DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; PlantUtilities::InitComponentNodes(0.0, - this->DesignHeatRecMassFlowRate, - this->HeatRecInletNodeNum, - this->HeatRecOutletNodeNum, - this->HRLoopNum, - this->HRLoopSideNum, - this->HRBranchNum, - this->HRCompNum); + this->DesignHeatRecMassFlowRate, + this->HeatRecInletNodeNum, + this->HeatRecOutletNodeNum, + this->HRLoopNum, + this->HRLoopSideNum, + this->HRBranchNum, + this->HRCompNum); // overall capacity limit - this->HeatRecMaxCapacityLimit = - this->HeatRecCapacityFraction * - (this->RefCap + this->RefCap / this->RefCOP); + this->HeatRecMaxCapacityLimit = this->HeatRecCapacityFraction * (this->RefCap + this->RefCap / this->RefCOP); } this->MyEnvrnFlag = false; @@ -1037,22 +969,12 @@ namespace ChillerReformulatedEIR { mdotCond = 0.0; } - PlantUtilities::SetComponentFlowRate(mdot, - this->EvapInletNodeNum, - this->EvapOutletNodeNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum); + PlantUtilities::SetComponentFlowRate( + mdot, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum); if (this->CondenserType == WaterCooled) { - PlantUtilities::SetComponentFlowRate(mdotCond, - this->CondInletNodeNum, - this->CondOutletNodeNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum); + PlantUtilities::SetComponentFlowRate( + mdotCond, this->CondInletNodeNum, this->CondOutletNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); } // Initialize heat recovery flow rates at node if (this->HeatRecActive) { @@ -1080,7 +1002,8 @@ namespace ChillerReformulatedEIR { mdot = 0.0; } - PlantUtilities::SetComponentFlowRate(mdot, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum, LoopNum, LoopSideNum, BranchIndex, CompIndex); + PlantUtilities::SetComponentFlowRate( + mdot, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum, LoopNum, LoopSideNum, BranchIndex, CompIndex); } } @@ -1105,7 +1028,7 @@ namespace ChillerReformulatedEIR { static std::string const RoutineName("SizeElecReformEIRChiller"); - bool ErrorsFound(false); // If errors detected in input + bool ErrorsFound(false); // If errors detected in input // Formats static ObjexxFCL::gio::Fmt Format_530("('Cond Temp (C) = ',11(F7.2))"); @@ -1115,7 +1038,7 @@ namespace ChillerReformulatedEIR { Real64 tmpEvapVolFlowRate = this->EvapVolFlowRate; Real64 tmpCondVolFlowRate = this->CondVolFlowRate; - int PltSizCondNum(0); // Plant Sizing index for condenser loop + int PltSizCondNum(0); // Plant Sizing index for condenser loop if (this->CondenserType == WaterCooled) { PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; } @@ -1134,30 +1057,30 @@ namespace ChillerReformulatedEIR { this->EvapVolFlowRate = tmpEvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Design Size Reference Chilled Water Flow Rate [m3/s]", - tmpEvapVolFlowRate); + this->Name, + "Design Size Reference Chilled Water Flow Rate [m3/s]", + tmpEvapVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Initial Design Size Reference Chilled Water Flow Rate [m3/s]", - tmpEvapVolFlowRate); + this->Name, + "Initial Design Size Reference Chilled Water Flow Rate [m3/s]", + tmpEvapVolFlowRate); } } else { // Hard-size with sizing data if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { Real64 EvapVolFlowRateUser = this->EvapVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Design Size Reference Chilled Water Flow Rate [m3/s]", - tmpEvapVolFlowRate, - "User-Specified Reference Chilled Water Flow Rate [m3/s]", - EvapVolFlowRateUser); + this->Name, + "Design Size Reference Chilled Water Flow Rate [m3/s]", + tmpEvapVolFlowRate, + "User-Specified Reference Chilled Water Flow Rate [m3/s]", + EvapVolFlowRateUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { - ShowMessage("SizeChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + - this->Name); + if ((std::abs(tmpEvapVolFlowRate - EvapVolFlowRateUser) / EvapVolFlowRateUser) > + DataSizing::AutoVsHardSizingThreshold) { + ShowMessage("SizeChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + this->Name); ShowContinueError("User-Specified Reference Chilled Water Flow Rate of " + General::RoundSigDigits(EvapVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Reference Chilled Water Flow Rate of " + @@ -1179,10 +1102,8 @@ namespace ChillerReformulatedEIR { } if (!this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { // Hard-size with sizing data - ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "User-Specified Reference Chilled Water Flow Rate [m3/s]", - this->EvapVolFlowRate); + ReportSizingManager::ReportSizingOutput( + "Chiller:Electric:ReformulatedEIR", this->Name, "User-Specified Reference Chilled Water Flow Rate [m3/s]", this->EvapVolFlowRate); } } @@ -1190,8 +1111,8 @@ namespace ChillerReformulatedEIR { if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { - Real64 SizingEvapOutletTemp; // Plant Sizing outlet temperature for CurLoopNum [C] - Real64 SizingCondOutletTemp; // Plant Sizing outlet temperature for condenser loop [C] + Real64 SizingEvapOutletTemp; // Plant Sizing outlet temperature for CurLoopNum [C] + Real64 SizingCondOutletTemp; // Plant Sizing outlet temperature for condenser loop [C] if (PltSizCondNum > 0 && PltSizNum > 0) { SizingEvapOutletTemp = DataSizing::PlantSizData(PltSizNum).ExitTemp; SizingCondOutletTemp = DataSizing::PlantSizData(PltSizCondNum).ExitTemp + DataSizing::PlantSizData(PltSizCondNum).DeltaT; @@ -1200,13 +1121,13 @@ namespace ChillerReformulatedEIR { SizingCondOutletTemp = this->TempRefCondOut; } Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, - RoutineName); + DataGlobals::CWInitConvTemp, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, - RoutineName); + DataGlobals::CWInitConvTemp, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + RoutineName); Real64 RefCapFT = CurveManager::CurveValue(this->ChillerCapFTIndex, SizingEvapOutletTemp, SizingCondOutletTemp); tmpNomCap = (Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate) / RefCapFT; } else { @@ -1216,33 +1137,29 @@ namespace ChillerReformulatedEIR { if (this->RefCapWasAutoSized) { this->RefCap = tmpNomCap; if (DataPlant::PlantFinalSizesOkayToReport) { - ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Design Size Reference Capacity [W]", - tmpNomCap); + ReportSizingManager::ReportSizingOutput( + "Chiller:Electric:ReformulatedEIR", this->Name, "Design Size Reference Capacity [W]", tmpNomCap); } if (DataPlant::PlantFirstSizesOkayToReport) { - ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Initial Design Size Reference Capacity [W]", - tmpNomCap); + ReportSizingManager::ReportSizingOutput( + "Chiller:Electric:ReformulatedEIR", this->Name, "Initial Design Size Reference Capacity [W]", tmpNomCap); } } else { if (this->RefCap > 0.0 && tmpNomCap > 0.0) { Real64 RefCapUser = this->RefCap; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Design Size Reference Capacity [W]", - tmpNomCap, - "User-Specified Reference Capacity [W]", - RefCapUser); + this->Name, + "Design Size Reference Capacity [W]", + tmpNomCap, + "User-Specified Reference Capacity [W]", + RefCapUser); if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpNomCap - RefCapUser) / RefCapUser) > DataSizing::AutoVsHardSizingThreshold) { - ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + - this->Name); + ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + this->Name); ShowContinueError("User-Specified Reference Capacity of " + General::RoundSigDigits(RefCapUser, 2) + " [W]"); - ShowContinueError("differs from Design Size Reference Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + " [W]"); + ShowContinueError("differs from Design Size Reference Capacity of " + General::RoundSigDigits(tmpNomCap, 2) + + " [W]"); ShowContinueError("This may, or may not, indicate mismatched component sizes."); ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } @@ -1258,29 +1175,24 @@ namespace ChillerReformulatedEIR { ShowContinueError("Occurs in Reformulated Electric Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->RefCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && - (this->RefCap > 0.0)) { - ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "User-Specified Reference Capacity [W]", - this->RefCap); + if (!this->RefCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->RefCap > 0.0)) { + ReportSizingManager::ReportSizingOutput( + "Chiller:Electric:ReformulatedEIR", this->Name, "User-Specified Reference Capacity [W]", this->RefCap); } } if (PltSizCondNum > 0 && PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - DataGlobals::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); + DataGlobals::CWInitConvTemp, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - this->TempRefCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); - tmpCondVolFlowRate = - tmpNomCap * - (1.0 + (1.0 / this->RefCOP) * this->CompPowerToCondenserFrac) / - (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); + this->TempRefCondIn, + DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + RoutineName); + tmpCondVolFlowRate = tmpNomCap * (1.0 + (1.0 / this->RefCOP) * this->CompPowerToCondenserFrac) / + (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); // IF (DataPlant::PlantFirstSizesOkayToFinalize) ElecReformEIRChiller(EIRChillNum)%CondVolFlowRate = tmpCondVolFlowRate } else { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; @@ -1291,30 +1203,30 @@ namespace ChillerReformulatedEIR { this->CondVolFlowRate = tmpCondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Design Size Reference Condenser Water Flow Rate [m3/s]", - tmpCondVolFlowRate); + this->Name, + "Design Size Reference Condenser Water Flow Rate [m3/s]", + tmpCondVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Initial Design Size Reference Condenser Water Flow Rate [m3/s]", - tmpCondVolFlowRate); + this->Name, + "Initial Design Size Reference Condenser Water Flow Rate [m3/s]", + tmpCondVolFlowRate); } } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { Real64 CondVolFlowRateUser = this->CondVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Design Size Reference Condenser Water Flow Rate [m3/s]", - tmpCondVolFlowRate, - "User-Specified Reference Condenser Water Flow Rate [m3/s]", - CondVolFlowRateUser); + this->Name, + "Design Size Reference Condenser Water Flow Rate [m3/s]", + tmpCondVolFlowRate, + "User-Specified Reference Condenser Water Flow Rate [m3/s]", + CondVolFlowRateUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { - ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + - this->Name); + if ((std::abs(tmpCondVolFlowRate - CondVolFlowRateUser) / CondVolFlowRateUser) > + DataSizing::AutoVsHardSizingThreshold) { + ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + this->Name); ShowContinueError("User-Specified Reference Condenser Water Flow Rate of " + General::RoundSigDigits(CondVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Reference Condenser Water Flow Rate of " + @@ -1335,12 +1247,11 @@ namespace ChillerReformulatedEIR { ShowContinueError("Occurs in Reformulated Electric EIR Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && - (this->CondVolFlowRate > 0.0)) { + if (!this->CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "User-Specified Reference Condenser Water Flow Rate [m3/s]", - this->CondVolFlowRate); + this->Name, + "User-Specified Reference Condenser Water Flow Rate [m3/s]", + this->CondVolFlowRate); } } @@ -1349,38 +1260,36 @@ namespace ChillerReformulatedEIR { if (this->HeatRecActive) { Real64 tmpHeatRecVolFlowRate = tmpCondVolFlowRate * this->HeatRecCapacityFraction; - if (!this->DesignHeatRecVolFlowRateWasAutoSized) - tmpHeatRecVolFlowRate = this->DesignHeatRecVolFlowRate; + if (!this->DesignHeatRecVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = this->DesignHeatRecVolFlowRate; if (DataPlant::PlantFirstSizesOkayToFinalize) { if (this->DesignHeatRecVolFlowRateWasAutoSized) { this->DesignHeatRecVolFlowRate = tmpHeatRecVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", - tmpHeatRecVolFlowRate); + this->Name, + "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", + tmpHeatRecVolFlowRate); } if (DataPlant::PlantFirstSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Initial Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", - tmpHeatRecVolFlowRate); + this->Name, + "Initial Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", + tmpHeatRecVolFlowRate); } } else { if (this->DesignHeatRecVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { Real64 DesignHeatRecVolFlowRateUser = this->DesignHeatRecVolFlowRate; if (DataPlant::PlantFinalSizesOkayToReport) { ReportSizingManager::ReportSizingOutput("Chiller:Electric:ReformulatedEIR", - this->Name, - "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", - tmpHeatRecVolFlowRate, - "User-Specified Design Heat Recovery Fluid Flow Rate [m3/s]", - DesignHeatRecVolFlowRateUser); + this->Name, + "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", + tmpHeatRecVolFlowRate, + "User-Specified Design Heat Recovery Fluid Flow Rate [m3/s]", + DesignHeatRecVolFlowRateUser); if (DataGlobals::DisplayExtraWarnings) { if ((std::abs(tmpHeatRecVolFlowRate - DesignHeatRecVolFlowRateUser) / DesignHeatRecVolFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { - ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + - this->Name); + ShowMessage("Size:ChillerElectricReformulatedEIR: Potential issue with equipment sizing for " + this->Name); ShowContinueError("User-Specified Design Heat Recovery Fluid Flow Rate of " + General::RoundSigDigits(DesignHeatRecVolFlowRateUser, 5) + " [m3/s]"); ShowContinueError("differs from Design Size Design Heat Recovery Fluid Flow Rate of " + @@ -1398,23 +1307,23 @@ namespace ChillerReformulatedEIR { PlantUtilities::RegisterPlantCompDesignFlow(this->HeatRecInletNodeNum, tmpHeatRecVolFlowRate); } - std::string equipName; // Name of chiller + std::string equipName; // Name of chiller if (DataPlant::PlantFinalSizesOkayToReport) { if (this->MySizeFlag) { Real64 IPLV; StandardRatings::CalcChillerIPLV(this->Name, - DataPlant::TypeOf_Chiller_ElectricReformEIR, - this->RefCap, - this->RefCOP, - this->CondenserType, - this->ChillerCapFTIndex, - this->ChillerEIRFTIndex, - this->ChillerEIRFPLRIndex, - this->MinUnloadRat, - IPLV, - this->EvapVolFlowRate, - this->CDLoopNum, - this->CompPowerToCondenserFrac); + DataPlant::TypeOf_Chiller_ElectricReformEIR, + this->RefCap, + this->RefCOP, + this->CondenserType, + this->ChillerCapFTIndex, + this->ChillerEIRFTIndex, + this->ChillerEIRFPLRIndex, + this->MinUnloadRat, + IPLV, + this->EvapVolFlowRate, + this->CDLoopNum, + this->CompPowerToCondenserFrac); this->MySizeFlag = false; } // create predefined report @@ -1428,39 +1337,35 @@ namespace ChillerReformulatedEIR { if (this->RefCap > 0.0 && this->CondVolFlowRate > 0.0) { // Check the CAP-FT, EIR-FT, and PLR curves at reference conditions and warn user if different from 1.0 by more than +-10% if (this->ChillerCapFTIndex > 0) { - Real64 CurveVal = CurveManager::CurveValue(this->ChillerCapFTIndex, - this->TempRefEvapOut, - this->TempRefCondOut); + Real64 CurveVal = CurveManager::CurveValue(this->ChillerCapFTIndex, this->TempRefEvapOut, this->TempRefCondOut); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError("Capacity ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError("(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); ShowContinueError("Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); } CurveManager::GetCurveMinMaxValues(this->ChillerCapFTIndex, - this->ChillerCAPFTXTempMin, - this->ChillerCAPFTXTempMax, - this->ChillerCAPFTYTempMin, - this->ChillerCAPFTYTempMax); + this->ChillerCAPFTXTempMin, + this->ChillerCAPFTXTempMax, + this->ChillerCAPFTYTempMin, + this->ChillerCAPFTYTempMax); } if (this->ChillerEIRFTIndex > 0) { - Real64 CurveVal = CurveManager::CurveValue(this->ChillerEIRFTIndex, - this->TempRefEvapOut, - this->TempRefCondOut); + Real64 CurveVal = CurveManager::CurveValue(this->ChillerEIRFTIndex, this->TempRefEvapOut, this->TempRefCondOut); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError("Energy input ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError("(+ or - 10%) at reference conditions for Chiller:Electric:ReformulatedEIR = " + equipName); ShowContinueError("Curve output at reference conditions = " + General::TrimSigDigits(CurveVal, 3)); } CurveManager::GetCurveMinMaxValues(this->ChillerEIRFTIndex, - this->ChillerEIRFTXTempMin, - this->ChillerEIRFTXTempMax, - this->ChillerEIRFTYTempMin, - this->ChillerEIRFTYTempMax); + this->ChillerEIRFTXTempMin, + this->ChillerEIRFTXTempMax, + this->ChillerEIRFTYTempMin, + this->ChillerEIRFTYTempMax); } if (this->ChillerEIRFPLRIndex > 0) { - Real64 CurveVal(0.0); // Used to verify EIR-FT/CAP-FT curves = 1 at reference conditions + Real64 CurveVal(0.0); // Used to verify EIR-FT/CAP-FT curves = 1 at reference conditions if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { CurveVal = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, this->TempRefCondOut, 1.0); } else if (this->PartLoadCurveType == PLR_Lift) { @@ -1474,32 +1379,28 @@ namespace ChillerReformulatedEIR { if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { CurveManager::GetCurveMinMaxValues(this->ChillerEIRFPLRIndex, - this->ChillerEIRFPLRTempMin, - this->ChillerEIRFPLRTempMax, - this->ChillerEIRFPLRPLRMin, - this->ChillerEIRFPLRPLRMax); + this->ChillerEIRFPLRTempMin, + this->ChillerEIRFPLRTempMax, + this->ChillerEIRFPLRPLRMin, + this->ChillerEIRFPLRPLRMax); } else if (this->PartLoadCurveType == PLR_Lift) { CurveManager::GetCurveMinMaxValues(this->ChillerEIRFPLRIndex, - this->ChillerLiftNomMin, - this->ChillerLiftNomMax, - this->ChillerEIRFPLRPLRMin, - this->ChillerEIRFPLRPLRMax, - this->ChillerTdevNomMin, - this->ChillerTdevNomMax); + this->ChillerLiftNomMin, + this->ChillerLiftNomMax, + this->ChillerEIRFPLRPLRMin, + this->ChillerEIRFPLRPLRMax, + this->ChillerTdevNomMin, + this->ChillerTdevNomMax); } - if (this->ChillerEIRFPLRPLRMin < 0 || - this->ChillerEIRFPLRPLRMin >= this->ChillerEIRFPLRPLRMax || - this->ChillerEIRFPLRPLRMin > 1) { + if (this->ChillerEIRFPLRPLRMin < 0 || this->ChillerEIRFPLRPLRMin >= this->ChillerEIRFPLRPLRMax || this->ChillerEIRFPLRPLRMin > 1) { ShowSevereError("Invalid minimum value of PLR = " + General::TrimSigDigits(this->ChillerEIRFPLRPLRMin, 3) + " in bicubic curve = " + this->EIRFPLRName + " which is used"); ShowContinueError("by Chiller:Electric:ReformulatedEIR = " + equipName + '.'); ShowContinueError("The minimum value of PLR [y] must be from zero to 1, and less than the maximum value of PLR."); ErrorsFound = true; } - if (this->ChillerEIRFPLRPLRMax > 1.1 || - this->ChillerEIRFPLRPLRMax <= this->ChillerEIRFPLRPLRMin || - this->ChillerEIRFPLRPLRMax < 0) { + if (this->ChillerEIRFPLRPLRMax > 1.1 || this->ChillerEIRFPLRPLRMax <= this->ChillerEIRFPLRPLRMin || this->ChillerEIRFPLRPLRMax < 0) { ShowSevereError("Invalid maximum value of PLR = " + General::TrimSigDigits(this->ChillerEIRFPLRPLRMax, 3) + " in bicubic curve = " + this->EIRFPLRName + " which is used"); ShowContinueError("by Chiller:Electric:ReformulatedEIR = " + equipName + '.'); @@ -1510,17 +1411,12 @@ namespace ChillerReformulatedEIR { } // Initialize condenser reference inlet temperature (not a user input) - Real64 Density = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - this->TempRefCondOut, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); - - Real64 SpecificHeat = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - this->TempRefCondOut, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); - Real64 CondenserCapacity = this->RefCap * - (1.0 + (1.0 / this->RefCOP) * this->CompPowerToCondenserFrac); + Real64 Density = FluidProperties::GetDensityGlycol( + DataPlant::PlantLoop(this->CDLoopNum).FluidName, this->TempRefCondOut, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + + Real64 SpecificHeat = FluidProperties::GetSpecificHeatGlycol( + DataPlant::PlantLoop(this->CDLoopNum).FluidName, this->TempRefCondOut, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + Real64 CondenserCapacity = this->RefCap * (1.0 + (1.0 / this->RefCOP) * this->CompPowerToCondenserFrac); Real64 DeltaTCond = (CondenserCapacity) / (this->CondVolFlowRate * Density * SpecificHeat); this->TempRefCondIn = this->TempRefCondOut - DeltaTCond; @@ -1539,10 +1435,9 @@ namespace ChillerReformulatedEIR { Real64 CondTemp = this->TempRefCondIn + (DeltaTCond * PLRTemp); CondTemp = min(CondTemp, this->ChillerEIRFPLRTempMax); CondTemp = max(CondTemp, this->ChillerEIRFPLRTempMin); - Real64 CurveValTmp; // Used to evaluate EIRFPLR curve objects + Real64 CurveValTmp; // Used to evaluate EIRFPLR curve objects if (PLRTemp < this->ChillerEIRFPLRPLRMin) { - CurveValTmp = CurveManager::CurveValue( - this->ChillerEIRFPLRIndex, CondTemp, this->ChillerEIRFPLRPLRMin); + CurveValTmp = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, CondTemp, this->ChillerEIRFPLRPLRMin); } else { CurveValTmp = CurveManager::CurveValue(this->ChillerEIRFPLRIndex, CondTemp, PLRTemp); } @@ -1559,7 +1454,7 @@ namespace ChillerReformulatedEIR { ShowContinueError( "EIR as a function of PLR curve output at various part-load ratios and condenser water temperatures shown below:"); ShowContinueError("PLR = 0.00 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00"); - std::string StringVar; // Used for EIRFPLR warning messages + std::string StringVar; // Used for EIRFPLR warning messages ObjexxFCL::gio::write(StringVar, "'Cond Temp(C) = '"); for (int CurveValPtr = 1; CurveValPtr <= 11; ++CurveValPtr) { ObjexxFCL::gio::write(StringVar, "(F7.2,$)") << CondTempArray(CurveValPtr); @@ -1577,29 +1472,29 @@ namespace ChillerReformulatedEIR { } } else { // just get curve min/max values if capacity or cond volume flow rate = 0 CurveManager::GetCurveMinMaxValues(this->ChillerCapFTIndex, - this->ChillerCAPFTXTempMin, - this->ChillerCAPFTXTempMax, - this->ChillerCAPFTYTempMin, - this->ChillerCAPFTYTempMax); + this->ChillerCAPFTXTempMin, + this->ChillerCAPFTXTempMax, + this->ChillerCAPFTYTempMin, + this->ChillerCAPFTYTempMax); CurveManager::GetCurveMinMaxValues(this->ChillerEIRFTIndex, - this->ChillerEIRFTXTempMin, - this->ChillerEIRFTXTempMax, - this->ChillerEIRFTYTempMin, - this->ChillerEIRFTYTempMax); + this->ChillerEIRFTXTempMin, + this->ChillerEIRFTXTempMax, + this->ChillerEIRFTYTempMin, + this->ChillerEIRFTYTempMax); if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { CurveManager::GetCurveMinMaxValues(this->ChillerEIRFPLRIndex, - this->ChillerEIRFPLRTempMin, - this->ChillerEIRFPLRTempMax, - this->ChillerEIRFPLRPLRMin, - this->ChillerEIRFPLRPLRMax); + this->ChillerEIRFPLRTempMin, + this->ChillerEIRFPLRTempMax, + this->ChillerEIRFPLRPLRMin, + this->ChillerEIRFPLRPLRMax); } else if (this->PartLoadCurveType == PLR_Lift) { CurveManager::GetCurveMinMaxValues(this->ChillerEIRFPLRIndex, - this->ChillerLiftNomMin, - this->ChillerLiftNomMax, - this->ChillerEIRFPLRPLRMin, - this->ChillerEIRFPLRPLRMax, - this->ChillerTdevNomMin, - this->ChillerTdevNomMax); + this->ChillerLiftNomMin, + this->ChillerLiftNomMax, + this->ChillerEIRFPLRPLRMin, + this->ChillerEIRFPLRPLRMax, + this->ChillerTdevNomMin, + this->ChillerTdevNomMax); } } @@ -1642,7 +1537,7 @@ namespace ChillerReformulatedEIR { Real64 CAPFTYTmin = this->ChillerCAPFTYTempMin; // Minimum condenser leaving temperature allowed by EIRFT curve [C] - Real64 Tmin(-99); // Minimum condenser leaving temperature allowed by curve objects [C] + Real64 Tmin(-99); // Minimum condenser leaving temperature allowed by curve objects [C] Real64 EIRFTYTmin = this->ChillerEIRFTYTempMin; if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { @@ -1656,7 +1551,7 @@ namespace ChillerReformulatedEIR { // Maximum condenser leaving temperature allowed by CAPFT curve [C] Real64 CAPFTYTmax = this->ChillerCAPFTYTempMax; - Real64 Tmax(-99); // Maximum condenser leaving temperature allowed by curve objects [C] + Real64 Tmax(-99); // Maximum condenser leaving temperature allowed by curve objects [C] // Maximum condenser leaving temperature allowed by EIRFT curve [C] Real64 EIRFTYTmax = this->ChillerEIRFTYTempMax; @@ -1682,7 +1577,7 @@ namespace ChillerReformulatedEIR { if (CondTempMin > Tmin && CondTempMax < Tmax) { - Array1D Par(6); // Pass parameters for RegulaFalsi solver + Array1D Par(6); // Pass parameters for RegulaFalsi solver // Initialize iteration parameters for RegulaFalsi function Par(2) = MyLoad; @@ -1710,8 +1605,7 @@ namespace ChillerReformulatedEIR { this->Name + ": Iteration limit exceeded calculating condenser outlet temperature and non-converged temperature is used"); } else { - ShowRecurringWarningErrorAtEnd(this->Name + - ": Iteration limit exceeded calculating condenser outlet temperature.", + ShowRecurringWarningErrorAtEnd(this->Name + ": Iteration limit exceeded calculating condenser outlet temperature.", this->IterLimitErrIndex, this->CondOutletTemp, this->CondOutletTemp); @@ -1722,13 +1616,11 @@ namespace ChillerReformulatedEIR { ++this->IterFailed; if (this->IterFailed == 1) { ShowWarningError(this->Name + ": Solution found when calculating condenser outlet " - "temperature. The inlet temperature will used and the " - "simulation continues..."); - ShowContinueError("Please check minimum and maximum values of x in EIRFPLR Curve " + - this->EIRFPLRName); + "temperature. The inlet temperature will used and the " + "simulation continues..."); + ShowContinueError("Please check minimum and maximum values of x in EIRFPLR Curve " + this->EIRFPLRName); } else { - ShowRecurringWarningErrorAtEnd(this->Name + - ": Solution is not found in calculating condenser outlet temperature.", + ShowRecurringWarningErrorAtEnd(this->Name + ": Solution is not found in calculating condenser outlet temperature.", this->IterFailedIndex, this->CondOutletTemp, this->CondOutletTemp); @@ -1748,9 +1640,9 @@ namespace ChillerReformulatedEIR { } void ReformulatedEIRChillerSpecs::calcHeatRecovery(Real64 &QCond, // Current condenser load [W] - Real64 const CondMassFlow, // Current condenser mass flow [kg/s] - Real64 const condInletTemp, // Current condenser inlet temp [C] - Real64 &QHeatRec // Amount of heat recovered [W] + Real64 const CondMassFlow, // Current condenser mass flow [kg/s] + Real64 const condInletTemp, // Current condenser inlet temp [C] + Real64 &QHeatRec // Amount of heat recovered [W] ) { // SUBROUTINE INFORMATION: @@ -1767,14 +1659,10 @@ namespace ChillerReformulatedEIR { Real64 heatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; Real64 HeatRecMassFlowRate = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; - Real64 CpHeatRec = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->HRLoopNum).FluidName, - heatRecInletTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, - RoutineName); - Real64 CpCond = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - condInletTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); + Real64 CpHeatRec = FluidProperties::GetSpecificHeatGlycol( + DataPlant::PlantLoop(this->HRLoopNum).FluidName, heatRecInletTemp, DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); + Real64 CpCond = FluidProperties::GetSpecificHeatGlycol( + DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); // Before we modify the QCondenser, the total or original value is transferred to QTot Real64 QTotal = QCond; @@ -1924,7 +1812,7 @@ namespace ChillerReformulatedEIR { return CondOutTempResidual; } - void ReformulatedEIRChillerSpecs::calculate(Real64 &MyLoad, bool const RunFlag, Real64 const FalsiCondOutTemp ) + void ReformulatedEIRChillerSpecs::calculate(Real64 &MyLoad, bool const RunFlag, Real64 const FalsiCondOutTemp) { // SUBROUTINE INFORMATION: @@ -1978,15 +1866,13 @@ namespace ChillerReformulatedEIR { // if the component control is SERIESACTIVE we set the component flow to inlet flow so that // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { - if (this->EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { + if (this->EquipFlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive || + DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } if (this->CondenserType == WaterCooled) { - if (DataPlant::PlantLoop(this->CDLoopNum) - .LoopSide(this->CDLoopSideNum) - .Branch(this->CDBranchNum) - .Comp(this->CDCompNum) - .FlowCtrl == DataBranchAirLoopPlant::ControlType_SeriesActive) { + if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == + DataBranchAirLoopPlant::ControlType_SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; } } @@ -2023,21 +1909,21 @@ namespace ChillerReformulatedEIR { if (this->CondenserType == WaterCooled) { this->CondMassFlowRate = this->CondMassFlowRateMax; PlantUtilities::SetComponentFlowRate(this->CondMassFlowRate, - this->CondInletNodeNum, - this->CondOutletNodeNum, - this->CDLoopNum, - this->CDLoopSideNum, - this->CDBranchNum, - this->CDCompNum); + this->CondInletNodeNum, + this->CondOutletNodeNum, + this->CDLoopNum, + this->CDLoopSideNum, + this->CDBranchNum, + this->CDCompNum); PlantUtilities::PullCompInterconnectTrigger(this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum, - this->CondMassFlowIndex, - this->CDLoopNum, - this->CDLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, - this->CondMassFlowRate); + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum, + this->CondMassFlowIndex, + this->CDLoopNum, + this->CDLoopSideNum, + DataPlant::CriteriaType_MassFlowRate, + this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; } @@ -2047,7 +1933,8 @@ namespace ChillerReformulatedEIR { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { if ((this->FlowMode == LeavingSetPointModulated) || - (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == + DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; @@ -2056,7 +1943,8 @@ namespace ChillerReformulatedEIR { } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { if ((this->FlowMode == LeavingSetPointModulated) || - (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == + DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; @@ -2086,9 +1974,8 @@ namespace ChillerReformulatedEIR { // use report values for latest valid calculation, lagged somewhat if (this->HeatRecActive) { if ((this->QHeatRecovery + this->QCondenser) > 0.0) { // protect div by zero - this->ChillerCondAvgTemp = (this->QHeatRecovery * this->HeatRecOutletTemp + - this->QCondenser * this->CondOutletTemp) / - (this->QHeatRecovery + this->QCondenser); + this->ChillerCondAvgTemp = (this->QHeatRecovery * this->HeatRecOutletTemp + this->QCondenser * this->CondOutletTemp) / + (this->QHeatRecovery + this->QCondenser); } else { this->ChillerCondAvgTemp = FalsiCondOutTemp; } @@ -2113,16 +2000,17 @@ namespace ChillerReformulatedEIR { // Calculate water side load Real64 Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName, - DataLoopNode::Node(this->EvapInletNodeNum).Temp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, - RoutineName); + DataLoopNode::Node(this->EvapInletNodeNum).Temp, + DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + RoutineName); Real64 TempLoad; // actual load to be met by chiller. This value is compared to MyLoad // and reset when necessary since this chiller can cycle, the load passed // should be the actual load. Instead the minimum PLR * RefCap is // passed in. - TempLoad = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRateMaxAvail * Cp * (DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapOutletTempSetPoint); + TempLoad = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRateMaxAvail * Cp * + (DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapOutletTempSetPoint); TempLoad = max(0.0, TempLoad); @@ -2132,7 +2020,7 @@ namespace ChillerReformulatedEIR { } // Part load ratio based on load and available chiller capacity, cap at max part load ratio - Real64 PartLoadRat; // Operating part load ratio + Real64 PartLoadRat; // Operating part load ratio if (AvailChillerCap > 0) { PartLoadRat = max(0.0, min(std::abs(MyLoad) / AvailChillerCap, this->MaxPartLoadRat)); } else { @@ -2145,13 +2033,14 @@ namespace ChillerReformulatedEIR { // If FlowLock is False (0), the chiller sets the plant loop mdot // If FlowLock is True (1), the new resolved plant loop mdot is used if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) { - if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) { + if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == + DataPlant::CompSetPtBasedSchemeType) { this->PossibleSubcooling = false; } else { this->PossibleSubcooling = true; } - Real64 EvapDeltaTemp(0.0); // Evaporator temperature difference [C] + Real64 EvapDeltaTemp(0.0); // Evaporator temperature difference [C] // Either set the flow to the Constant value or calculate the flow for the variable volume case if ((this->FlowMode == ConstantFlow) || (this->FlowMode == NotModulated)) { @@ -2160,12 +2049,12 @@ namespace ChillerReformulatedEIR { this->EvapMassFlowRate = this->EvapMassFlowRateMax; // Use PlantUtilities::SetComponentFlowRate to decide actual flow PlantUtilities::SetComponentFlowRate(this->EvapMassFlowRate, - this->EvapInletNodeNum, - this->EvapOutletNodeNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum); + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); if (this->EvapMassFlowRate != 0.0) { EvapDeltaTemp = this->QEvaporator / this->EvapMassFlowRate / Cp; } else { @@ -2187,17 +2076,18 @@ namespace ChillerReformulatedEIR { if (EvapDeltaTemp != 0) { this->EvapMassFlowRate = max(0.0, (this->QEvaporator / Cp / EvapDeltaTemp)); - if ((this->EvapMassFlowRate - this->EvapMassFlowRateMax) > DataBranchAirLoopPlant::MassFlowTolerance) this->PossibleSubcooling = true; + if ((this->EvapMassFlowRate - this->EvapMassFlowRateMax) > DataBranchAirLoopPlant::MassFlowTolerance) + this->PossibleSubcooling = true; // Check to see if the Maximum is exceeded, if so set to maximum this->EvapMassFlowRate = min(this->EvapMassFlowRateMax, this->EvapMassFlowRate); // Use PlantUtilities::SetComponentFlowRate to decide actual flow PlantUtilities::SetComponentFlowRate(this->EvapMassFlowRate, - this->EvapInletNodeNum, - this->EvapOutletNodeNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum); + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); // Should we recalculate this with the corrected setpoint? { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); @@ -2213,12 +2103,12 @@ namespace ChillerReformulatedEIR { this->EvapMassFlowRate = 0.0; // Use PlantUtilities::SetComponentFlowRate to decide actual flow PlantUtilities::SetComponentFlowRate(this->EvapMassFlowRate, - this->EvapInletNodeNum, - this->EvapOutletNodeNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum); + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); // No deltaT since component is not running this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; this->QEvaporator = 0.0; @@ -2263,12 +2153,12 @@ namespace ChillerReformulatedEIR { } else { // If FlowLock is True this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; PlantUtilities::SetComponentFlowRate(this->EvapMassFlowRate, - this->EvapInletNodeNum, - this->EvapOutletNodeNum, - this->CWLoopNum, - this->CWLoopSideNum, - this->CWBranchNum, - this->CWCompNum); + this->EvapInletNodeNum, + this->EvapOutletNodeNum, + this->CWLoopNum, + this->CWLoopSideNum, + this->CWBranchNum, + this->CWCompNum); // Some other component set the flow to 0. No reason to continue with calculations. if (this->EvapMassFlowRate == 0.0) { MyLoad = 0.0; @@ -2298,7 +2188,8 @@ namespace ChillerReformulatedEIR { } } if (this->EvapOutletTemp < DataLoopNode::Node(this->EvapOutletNodeNum).TempMin) { - if ((DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempMin) > DataPlant::DeltaTempTol) { + if ((DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempMin) > + DataPlant::DeltaTempTol) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempMin; EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - this->EvapOutletTemp; this->QEvaporator = this->EvapMassFlowRate * Cp * EvapDeltaTemp; @@ -2415,12 +2306,9 @@ namespace ChillerReformulatedEIR { // Currently only water cooled chillers are allowed for the reformulated EIR chiller model if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine - if (this->HeatRecActive) - this->calcHeatRecovery(this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovery); - Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->CDLoopNum).FluidName, - condInletTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, - RoutineName); + if (this->HeatRecActive) this->calcHeatRecovery(this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovery); + Cp = FluidProperties::GetSpecificHeatGlycol( + DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); condOutletTempMod = this->QCondenser / this->CondMassFlowRate / Cp + condInletTemp; } else { ShowSevereError("ControlReformEIRChillerModel: Condenser flow = 0, for ElecReformEIRChiller=" + this->Name); @@ -2428,7 +2316,7 @@ namespace ChillerReformulatedEIR { } } - void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(bool const FirstIteration ) + void ReformulatedEIRChillerSpecs::checkMinMaxCurveBoundaries(bool const FirstIteration) { // SUBROUTINE INFORMATION: // AUTHOR: R Raustad, FSEC @@ -2461,12 +2349,13 @@ namespace ChillerReformulatedEIR { if (this->EvapOutletTemp < CAPFTXTmin || this->EvapOutletTemp > CAPFTXTmax) { ++this->CAPFTXIter; if (this->CAPFTXIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The evaporator outlet temperature (" + General::TrimSigDigits(this->EvapOutletTemp, 2) + + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evaporator outlet temperature (" + + General::TrimSigDigits(this->EvapOutletTemp, 2) + " C) is outside the range of evaporator outlet temperatures (X var) given in Cooling Capacity Function of " "Temperature biquadratic curve = " + this->CAPFTName); - ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(CAPFTXTmin, 2) + " C to " + General::TrimSigDigits(CAPFTXTmax, 2) + " C."); + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(CAPFTXTmin, 2) + " C to " + + General::TrimSigDigits(CAPFTXTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evap outlet temp range in Cooling Capacity Function of Temp curve error continues.", this->CAPFTXIterIndex, @@ -2484,12 +2373,13 @@ namespace ChillerReformulatedEIR { if (this->EvapOutletTemp < EIRFTXTmin || this->EvapOutletTemp > EIRFTXTmax) { ++this->EIRFTXIter; if (this->EIRFTXIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The evaporator outlet temperature (" + General::TrimSigDigits(this->EvapOutletTemp, 2) + + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evaporator outlet temperature (" + + General::TrimSigDigits(this->EvapOutletTemp, 2) + " C) is outside the range of evaporator outlet temperatures (X var) given in Electric Input to Cooling Output Ratio " "Function of Temperature biquadratic curve = " + this->EIRFTName); - ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFTXTmin, 2) + " C to " + General::TrimSigDigits(EIRFTXTmax, 2) + " C."); + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFTXTmin, 2) + " C to " + + General::TrimSigDigits(EIRFTXTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The evap outlet temp range in Electric Input to Cooling Output Ratio Function of Temp curve error continues.", @@ -2520,8 +2410,8 @@ namespace ChillerReformulatedEIR { // Maximum condenser leaving temperature allowed by EIRFT curve [C] Real64 EIRFTYTmax = this->ChillerEIRFTYTempMax; - Real64 EIRFPLRTmin(0.0); // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] - Real64 EIRFPLRTmax(0.0); // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] + Real64 EIRFPLRTmin(0.0); // Minimum condenser leaving temperature allowed by EIRFPLR curve [C] + Real64 EIRFPLRTmax(0.0); // Maximum condenser leaving temperature allowed by EIRFPLR curve [C] if (this->PartLoadCurveType == PLR_LeavingCondenserWaterTemperature) { EIRFPLRTmin = this->ChillerEIRFPLRTempMin; @@ -2540,12 +2430,13 @@ namespace ChillerReformulatedEIR { if (this->CondOutletTemp < CAPFTYTmin || this->CondOutletTemp > CAPFTYTmax) { ++this->CAPFTYIter; if (this->CAPFTYIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The condenser outlet temperature (" + + General::TrimSigDigits(this->CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Cooling Capacity Function of " "Temperature biquadratic curve = " + this->CAPFTName); - ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(CAPFTYTmin, 2) + " C to " + General::TrimSigDigits(CAPFTYTmax, 2) + " C."); + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(CAPFTYTmin, 2) + " C to " + + General::TrimSigDigits(CAPFTYTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Cooling Capacity Function of Temp curve error continues.", this->CAPFTYIterIndex, @@ -2563,12 +2454,13 @@ namespace ChillerReformulatedEIR { if (this->CondOutletTemp < EIRFTYTmin || this->CondOutletTemp > EIRFTYTmax) { ++this->EIRFTYIter; if (this->EIRFTYIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The condenser outlet temperature (" + + General::TrimSigDigits(this->CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (Y var) given in Electric Input to Cooling Output Ratio " "Function of Temperature biquadratic curve = " + this->EIRFTName); - ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFTYTmin, 2) + " C to " + General::TrimSigDigits(EIRFTYTmax, 2) + " C."); + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFTYTmin, 2) + " C to " + + General::TrimSigDigits(EIRFTYTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio as a Function of Temp curve error continues.", @@ -2589,13 +2481,13 @@ namespace ChillerReformulatedEIR { if (this->CondOutletTemp < EIRFPLRTmin || this->CondOutletTemp > EIRFPLRTmax) { ++this->EIRFPLRTIter; if (this->EIRFPLRTIter == 1) { - ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + - "\": The condenser outlet temperature (" + General::TrimSigDigits(this->CondOutletTemp, 2) + + ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The condenser outlet temperature (" + + General::TrimSigDigits(this->CondOutletTemp, 2) + " C) is outside the range of condenser outlet temperatures (X var) given in Electric Input to Cooling Output " "Ratio Function of Part-load Ratio bicubic curve = " + this->EIRFPLRName); - ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFPLRTmin, 2) + " C to " + General::TrimSigDigits(EIRFPLRTmax, 2) + - " C."); + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFPLRTmin, 2) + " C to " + + General::TrimSigDigits(EIRFPLRTmax, 2) + " C."); ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The cond outlet temp range in Electric Input to Cooling Output Ratio Function of PLR curve error continues.", @@ -2621,8 +2513,8 @@ namespace ChillerReformulatedEIR { ") is outside the range of part-load ratios (Y var) given in Electric Input to Cooling Output Ratio Function of " "Part-load Ratio bicubic curve = " + this->EIRFPLRName); - ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFPLRPLRmin, 3) + " to " + General::TrimSigDigits(EIRFPLRPLRmax, 3) + - '.'); + ShowContinueErrorTimeStamp("The range specified = " + General::TrimSigDigits(EIRFPLRPLRmin, 3) + " to " + + General::TrimSigDigits(EIRFPLRPLRmax, 3) + '.'); ShowRecurringWarningErrorAtEnd( "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": The part-load ratio range in Electric Input to Cooling Output Ratio Function of PLRatio curve error continues.", @@ -2645,7 +2537,8 @@ namespace ChillerReformulatedEIR { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { if ((this->FlowMode == LeavingSetPointModulated) || - (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == + DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; @@ -2654,7 +2547,8 @@ namespace ChillerReformulatedEIR { } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { if ((this->FlowMode == LeavingSetPointModulated) || - (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || + (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == + DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; @@ -2669,12 +2563,11 @@ namespace ChillerReformulatedEIR { this->ChillerCapFT = CurveManager::CurveValue(this->ChillerCapFTIndex, EvapOutletTempSetPoint, condOutletTempMod); if (this->ChillerCapFT < 0) { - if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && - !DataGlobals::WarmupFlag) { + if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++this->ChillerCapFTError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); - ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + General::RoundSigDigits(this->ChillerCapFT, 3) + - ")."); + ShowContinueError(" Chiller Capacity as a Function of Temperature curve output is negative (" + + General::RoundSigDigits(this->ChillerCapFT, 3) + ")."); ShowContinueError(" Negative value occurs using an Evaporator Leaving Temp of " + General::RoundSigDigits(EvapOutletTempSetPoint, 1) + " and a Condenser Leaving Temp of " + General::RoundSigDigits(this->CondOutletTemp, 1) + '.'); ShowContinueErrorTimeStamp(" Resetting curve output to zero and continuing simulation."); @@ -2691,8 +2584,7 @@ namespace ChillerReformulatedEIR { this->ChillerEIRFT = CurveManager::CurveValue(this->ChillerEIRFTIndex, this->EvapOutletTemp, condOutletTempMod); if (this->ChillerEIRFT < 0.0) { - if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && - !DataGlobals::WarmupFlag) { + if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++this->ChillerEIRFTError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); ShowContinueError(" Reformulated Chiller EIR as a Function of Temperature curve output is negative (" + @@ -2735,8 +2627,7 @@ namespace ChillerReformulatedEIR { } if (this->ChillerEIRFPLR < 0.0) { - if (this->ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && - !DataGlobals::WarmupFlag) { + if (this->ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !DataGlobals::WarmupFlag) { ++this->ChillerEIRFPLRError; ShowWarningError("CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); ShowContinueError(" Chiller EIR as a function of PLR and condenser water temperature curve output is negative (" + diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index 7992d31f4c3..8db79d44d59 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -119,7 +119,7 @@ namespace ChillerReformulatedEIR { Real64 HeatRecMaxCapacityLimit; // Capacity limit for Heat recovery, one time calc [W] int HeatRecSetPointNodeNum; // index for system node with the heat recover leaving setpoint int HeatRecInletLimitSchedNum; // index for schedule for the inlet high limit for heat recovery operation - int ChillerCapFTIndex; // Index for the total cooling capacity modifier curve + int ChillerCapFTIndex; // Index for the total cooling capacity modifier curve // (function of leaving evaporator and condenser water temperatures) int ChillerEIRFTIndex; // Index for the energy input ratio modifier curve // (function of leaving evaporator and condenser water temperatures) @@ -190,32 +190,32 @@ namespace ChillerReformulatedEIR { bool MyEnvrnFlag; bool MyInitFlag; bool MySizeFlag; - Real64 ChillerCondAvgTemp; // reporting: average condenser temp for curves with Heat recovery [C] - Real64 ChillerFalseLoadRate; // reporting: Chiller false load over and above water side load [J] - Real64 ChillerCyclingRatio; // reporting: Chiller cycling ratio (time on/time step) - Real64 ChillerPartLoadRatio; // reporting: Chiller PLR (Load/Capacity) - Real64 ChillerEIRFPLR; // reporting: Chiller EIRFPLR curve output value - Real64 ChillerEIRFT; // reporting: Chiller EIRFT curve output value - Real64 ChillerCapFT; // reporting: Chiller capacity curve output value + Real64 ChillerCondAvgTemp; // average condenser temp for curves with Heat recovery [C] + Real64 ChillerFalseLoadRate; // Chiller false load over and above water side load [J] + Real64 ChillerCyclingRatio; // Chiller cycling ratio (time on/time step) + Real64 ChillerPartLoadRatio; // Chiller PLR (Load/Capacity) + Real64 ChillerEIRFPLR; // Chiller EIRFPLR curve output value + Real64 ChillerEIRFT; // Chiller EIRFT curve output value + Real64 ChillerCapFT; // Chiller capacity curve output value Real64 HeatRecOutletTemp; - Real64 QHeatRecovery; // reporting: Heat recovered from water-cooled condenser [W] + Real64 QHeatRecovery; // Heat recovered from water-cooled condenser [W] Real64 QCondenser; - Real64 QEvaporator; // reporting: Evaporator heat transfer rate [W] - Real64 Power; // reporting: Chiller power [W] - Real64 EvapOutletTemp; // reporting: Evaporator outlet temperature [C] - Real64 CondOutletTemp; // reporting: Condenser outlet temperature [C] - Real64 EvapMassFlowRate; // reporting: Evaporator mass flow rate [kg/s] - Real64 CondMassFlowRate; // Condenser mass flow rate [kg/s] - Real64 ChillerFalseLoad; // reporting: Chiller false load over and above water side load [W] - Real64 Energy; // reporting: Chiller electric consumption [J] - Real64 EvapEnergy; // reporting: Evaporator heat transfer energy [J] - Real64 CondEnergy; // reporting: Condenser heat transfer energy [J] - Real64 CondInletTemp; // reporting: Condenser inlet temperature [C] - Real64 EvapInletTemp; // reporting: Evaporator inlet temperature [C] - Real64 ActualCOP; // reporting: Coefficient of performance - Real64 EnergyHeatRecovery; // reporting: Energy recovered from water-cooled condenser [J] - Real64 HeatRecInletTemp; // reporting: Heat reclaim inlet temperature [C] - Real64 HeatRecMassFlow; // reporting: Heat reclaim mass flow rate [kg/s] + Real64 QEvaporator; // Evaporator heat transfer rate [W] + Real64 Power; // Chiller power [W] + Real64 EvapOutletTemp; // Evaporator outlet temperature [C] + Real64 CondOutletTemp; // Condenser outlet temperature [C] + Real64 EvapMassFlowRate; // Evaporator mass flow rate [kg/s] + Real64 CondMassFlowRate; // Condenser mass flow rate [kg/s] + Real64 ChillerFalseLoad; // Chiller false load over and above water side load [W] + Real64 Energy; // Chiller electric consumption [J] + Real64 EvapEnergy; // Evaporator heat transfer energy [J] + Real64 CondEnergy; // Condenser heat transfer energy [J] + Real64 CondInletTemp; // Condenser inlet temperature [C] + Real64 EvapInletTemp; // Evaporator inlet temperature [C] + Real64 ActualCOP; // Coefficient of performance + Real64 EnergyHeatRecovery; // Energy recovered from water-cooled condenser [J] + Real64 HeatRecInletTemp; // Heat reclaim inlet temperature [C] + Real64 HeatRecMassFlow; // Heat reclaim mass flow rate [kg/s] int EquipFlowCtrl; // Default Constructor @@ -227,25 +227,23 @@ namespace ChillerReformulatedEIR { MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), MinUnloadRat(0.0), TempRefCondIn(0.0), TempRefCondOut(0.0), TempRefEvapOut(0.0), TempLowLimitEvapOut(0.0), DesignHeatRecVolFlowRate(0.0), DesignHeatRecVolFlowRateWasAutoSized(false), DesignHeatRecMassFlowRate(0.0), SizFac(0.0), HeatRecActive(false), HeatRecInletNodeNum(0), HeatRecOutletNodeNum(0), - HeatRecCapacityFraction(0.0), HeatRecMaxCapacityLimit(0.0), HeatRecSetPointNodeNum(0), HeatRecInletLimitSchedNum(0), ChillerCapFTIndex(0), - ChillerEIRFTIndex(0), ChillerEIRFPLRIndex(0), ChillerCapFTError(0), ChillerCapFTErrorIndex(0), ChillerEIRFTError(0), ChillerEIRFTErrorIndex(0), - ChillerEIRFPLRError(0), ChillerEIRFPLRErrorIndex(0), ChillerCAPFTXTempMin(0.0), ChillerCAPFTXTempMax(0.0), ChillerCAPFTYTempMin(0.0), - ChillerCAPFTYTempMax(0.0), ChillerEIRFTXTempMin(0.0), ChillerEIRFTXTempMax(0.0), ChillerEIRFTYTempMin(0.0), ChillerEIRFTYTempMax(0.0), - ChillerEIRFPLRTempMin(0.0), ChillerEIRFPLRTempMax(0.0), ChillerEIRFPLRPLRMin(0.0), ChillerEIRFPLRPLRMax(0.0), - ChillerLiftNomMin(0.0), - ChillerLiftNomMax(10.0), ChillerTdevNomMin(0.0), ChillerTdevNomMax(10.0), CAPFTXIter(0), CAPFTXIterIndex(0), CAPFTYIter(0), - CAPFTYIterIndex(0), EIRFTXIter(0), EIRFTXIterIndex(0), EIRFTYIter(0), EIRFTYIterIndex(0), EIRFPLRTIter(0), EIRFPLRTIterIndex(0), - EIRFPLRPLRIter(0), EIRFPLRPLRIterIndex(0), FaultyChillerSWTFlag(false), FaultyChillerSWTIndex(0), FaultyChillerSWTOffset(0.0), - IterLimitExceededNum(0), IterLimitErrIndex(0), IterFailed(0), IterFailedIndex(0), DeltaTErrCount(0), DeltaTErrCountIndex(0), - CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), - HRLoopNum(0), HRLoopSideNum(0), HRBranchNum(0), HRCompNum(0), CondMassFlowIndex(0), PossibleSubcooling(false), - FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0), FaultyChillerFoulingFactor(1.0), MyEnvrnFlag(true), - MyInitFlag(true), MySizeFlag(true), ChillerCondAvgTemp(0.0), ChillerFalseLoadRate(0.0), ChillerCyclingRatio(0.0), - ChillerPartLoadRatio(0.0), ChillerEIRFPLR(0.0), ChillerEIRFT(0.0), ChillerCapFT(0.0), HeatRecOutletTemp(0.0), - QHeatRecovery(0.0), QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0), CondOutletTemp(0.0), - EvapMassFlowRate(0.0), CondMassFlowRate(0.0), ChillerFalseLoad(0.0), Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), - CondInletTemp(0.0), EvapInletTemp(0.0), ActualCOP(0.0), EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), - HeatRecMassFlow(0.0), EquipFlowCtrl(0) + HeatRecCapacityFraction(0.0), HeatRecMaxCapacityLimit(0.0), HeatRecSetPointNodeNum(0), HeatRecInletLimitSchedNum(0), + ChillerCapFTIndex(0), ChillerEIRFTIndex(0), ChillerEIRFPLRIndex(0), ChillerCapFTError(0), ChillerCapFTErrorIndex(0), + ChillerEIRFTError(0), ChillerEIRFTErrorIndex(0), ChillerEIRFPLRError(0), ChillerEIRFPLRErrorIndex(0), ChillerCAPFTXTempMin(0.0), + ChillerCAPFTXTempMax(0.0), ChillerCAPFTYTempMin(0.0), ChillerCAPFTYTempMax(0.0), ChillerEIRFTXTempMin(0.0), ChillerEIRFTXTempMax(0.0), + ChillerEIRFTYTempMin(0.0), ChillerEIRFTYTempMax(0.0), ChillerEIRFPLRTempMin(0.0), ChillerEIRFPLRTempMax(0.0), ChillerEIRFPLRPLRMin(0.0), + ChillerEIRFPLRPLRMax(0.0), ChillerLiftNomMin(0.0), ChillerLiftNomMax(10.0), ChillerTdevNomMin(0.0), ChillerTdevNomMax(10.0), + CAPFTXIter(0), CAPFTXIterIndex(0), CAPFTYIter(0), CAPFTYIterIndex(0), EIRFTXIter(0), EIRFTXIterIndex(0), EIRFTYIter(0), + EIRFTYIterIndex(0), EIRFPLRTIter(0), EIRFPLRTIterIndex(0), EIRFPLRPLRIter(0), EIRFPLRPLRIterIndex(0), FaultyChillerSWTFlag(false), + FaultyChillerSWTIndex(0), FaultyChillerSWTOffset(0.0), IterLimitExceededNum(0), IterLimitErrIndex(0), IterFailed(0), IterFailedIndex(0), + DeltaTErrCount(0), DeltaTErrCountIndex(0), CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), + CDBranchNum(0), CDCompNum(0), HRLoopNum(0), HRLoopSideNum(0), HRBranchNum(0), HRCompNum(0), CondMassFlowIndex(0), + PossibleSubcooling(false), FaultyChillerFoulingFlag(false), FaultyChillerFoulingIndex(0), FaultyChillerFoulingFactor(1.0), + MyEnvrnFlag(true), MyInitFlag(true), MySizeFlag(true), ChillerCondAvgTemp(0.0), ChillerFalseLoadRate(0.0), ChillerCyclingRatio(0.0), + ChillerPartLoadRatio(0.0), ChillerEIRFPLR(0.0), ChillerEIRFT(0.0), ChillerCapFT(0.0), HeatRecOutletTemp(0.0), QHeatRecovery(0.0), + QCondenser(0.0), QEvaporator(0.0), Power(0.0), EvapOutletTemp(0.0), CondOutletTemp(0.0), EvapMassFlowRate(0.0), CondMassFlowRate(0.0), + ChillerFalseLoad(0.0), Energy(0.0), EvapEnergy(0.0), CondEnergy(0.0), CondInletTemp(0.0), EvapInletTemp(0.0), ActualCOP(0.0), + EnergyHeatRecovery(0.0), HeatRecInletTemp(0.0), HeatRecMassFlow(0.0), EquipFlowCtrl(0) { }