From 36043c45a7b6d0e1373e3b5fce6e6b98bdd0fdfa Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 4 Jan 2021 09:33:22 -0700 Subject: [PATCH 01/17] move Pipes and PipeHeatTransfer to state --- src/EnergyPlus/PipeHeatTransfer.cc | 524 +++++++++++++---------------- src/EnergyPlus/PipeHeatTransfer.hh | 97 +++--- src/EnergyPlus/Pipes.cc | 60 +--- src/EnergyPlus/Pipes.hh | 22 +- src/EnergyPlus/StateManagement.cc | 4 - tst/EnergyPlus/unit/Pipes.unit.cc | 6 +- 6 files changed, 311 insertions(+), 402 deletions(-) diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index f20309a290b..90accd1675e 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -81,9 +81,7 @@ #include #include -namespace EnergyPlus { - -namespace PipeHeatTransfer { +namespace EnergyPlus::PipeHeatTransfer { // Module containing the routines dealing with pipes with transport delay // and heat transfer. @@ -119,59 +117,17 @@ namespace PipeHeatTransfer { using DataPlant::TypeOf_PipeInterior; using DataPlant::TypeOf_PipeUnderground; - int const None(0); - int const ZoneEnv(1); - int const ScheduleEnv(2); - int const OutsideAirEnv(3); - int const GroundEnv(4); - - int const PreviousTimeIndex(1); - int const CurrentTimeIndex(2); - int const TentativeTimeIndex(3); - - Real64 const InnerDeltaTime(60.0); // one minute time step in seconds - - // DERIVED TYPE DEFINITIONS - - // the model data structures - - // MODULE VARIABLE DECLARATIONS: - int nsvNumOfPipeHT(0); // Number of Pipe Heat Transfer objects - int nsvInletNodeNum(0); // module variable for inlet node number - int nsvOutletNodeNum(0); // module variable for outlet node number - int nsvPipeHTNum(0); // object index - Real64 nsvMassFlowRate(0.0); // pipe mass flow rate - Real64 nsvVolumeFlowRate(0.0); // pipe volumetric flow rate - Real64 nsvDeltaTime(0.0); // time change from last update - Real64 nsvInletTemp(0.0); // pipe inlet temperature - Real64 nsvOutletTemp(0.0); // pipe outlet temperature - Real64 nsvEnvironmentTemp(0.0); // environmental temperature (surrounding pipe) - Real64 nsvEnvHeatLossRate(0.0); // heat loss rate from pipe to the environment - Real64 nsvFluidHeatLossRate(0.0); // overall heat loss from fluid to pipe - int nsvNumInnerTimeSteps(0); // the number of "inner" time steps for our model - - bool GetPipeInputFlag(true); // First time, input is "gotten" - bool MyEnvrnFlag; - - // SUBROUTINE SPECIFICATIONS FOR MODULE - - // Object Data - Array1D PipeHT; - std::unordered_map PipeHTUniqueNames; - - //============================================================================== - // Functions PlantComponent *PipeHTData::factory(EnergyPlusData &state, int objectType, std::string objectName) { // Process the input data for pipes if it hasn't been done already - if (GetPipeInputFlag) { + if (state.dataPipeHT->GetPipeInputFlag) { GetPipesHeatTransfer(state); - GetPipeInputFlag = false; + state.dataPipeHT->GetPipeInputFlag = false; } // Now look for this particular pipe in the list - for (auto &pipe : PipeHT) { + for (auto &pipe : state.dataPipeHT->PipeHT) { if (pipe.TypeOf == objectType && pipe.Name == objectName) { return &pipe; } @@ -182,14 +138,6 @@ namespace PipeHeatTransfer { return nullptr; } - void clear_state() - { - GetPipeInputFlag = true; - PipeHT.clear(); - PipeHTUniqueNames.clear(); - MyEnvrnFlag = true; - } - void PipeHTData::simulate(EnergyPlusData &state, [[maybe_unused]] const PlantLocation &calledFromLocation, bool const FirstHVACIteration, @@ -198,10 +146,10 @@ namespace PipeHeatTransfer { { this->InitPipesHeatTransfer(state, FirstHVACIteration); // make the calculations - for (int InnerTimeStepCtr = 1; InnerTimeStepCtr <= nsvNumInnerTimeSteps; ++InnerTimeStepCtr) { + for (int InnerTimeStepCtr = 1; InnerTimeStepCtr <= state.dataPipeHT->nsvNumInnerTimeSteps; ++InnerTimeStepCtr) { { auto const SELECT_CASE_var(this->EnvironmentPtr); - if (SELECT_CASE_var == GroundEnv) { + if (SELECT_CASE_var == iEnvrnPtr::GroundEnv) { this->CalcBuriedPipeSoil(state); } else { this->CalcPipesHeatTransfer(state); @@ -209,15 +157,15 @@ namespace PipeHeatTransfer { } this->PushInnerTimeStepArrays(); } - // update vaiables - this->UpdatePipesHeatTransfer(); + // update variables + this->UpdatePipesHeatTransfer(state); // update report variables - this->ReportPipesHeatTransfer(); + this->ReportPipesHeatTransfer(state); } void PipeHTData::PushInnerTimeStepArrays() { - if (this->EnvironmentPtr == GroundEnv) { + if (this->EnvironmentPtr == iEnvrnPtr::GroundEnv) { for (int LengthIndex = 2; LengthIndex <= this->NumSections; ++LengthIndex) { for (int DepthIndex = 1; DepthIndex <= this->NumDepthNodes; ++DepthIndex) { for (int WidthIndex = 2; WidthIndex <= this->PipeNodeWidth; ++WidthIndex) { @@ -285,12 +233,12 @@ namespace PipeHeatTransfer { cCurrentModuleObject = "Pipe:Underground"; NumOfPipeHTUG = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - nsvNumOfPipeHT = NumOfPipeHTInt + NumOfPipeHTExt + NumOfPipeHTUG; + state.dataPipeHT->nsvNumOfPipeHT = NumOfPipeHTInt + NumOfPipeHTExt + NumOfPipeHTUG; // allocate data structures - if (allocated(PipeHT)) PipeHT.deallocate(); + if (allocated(state.dataPipeHT->PipeHT)) state.dataPipeHT->PipeHT.deallocate(); - PipeHT.allocate(nsvNumOfPipeHT); - PipeHTUniqueNames.reserve(static_cast(nsvNumOfPipeHT)); + state.dataPipeHT->PipeHT.allocate(state.dataPipeHT->nsvNumOfPipeHT); + state.dataPipeHT->PipeHTUniqueNames.reserve(static_cast(state.dataPipeHT->nsvNumOfPipeHT)); Item = 0; cCurrentModuleObject = "Pipe:Indoor"; @@ -310,35 +258,35 @@ namespace PipeHeatTransfer { cAlphaFieldNames, cNumericFieldNames); - GlobalNames::VerifyUniqueInterObjectName(state, PipeHTUniqueNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); - PipeHT(Item).Name = cAlphaArgs(1); - PipeHT(Item).TypeOf = TypeOf_PipeInterior; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataPipeHT->PipeHTUniqueNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); + state.dataPipeHT->PipeHT(Item).Name = cAlphaArgs(1); + state.dataPipeHT->PipeHT(Item).TypeOf = TypeOf_PipeInterior; // General user input data - PipeHT(Item).Construction = cAlphaArgs(2); - PipeHT(Item).ConstructionNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataConstruction->Construct); + state.dataPipeHT->PipeHT(Item).Construction = cAlphaArgs(2); + state.dataPipeHT->PipeHT(Item).ConstructionNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataConstruction->Construct); - if (PipeHT(Item).ConstructionNum == 0) { + if (state.dataPipeHT->PipeHT(Item).ConstructionNum == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(2) + '=' + cAlphaArgs(2)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; } // get inlet node data - PipeHT(Item).InletNode = cAlphaArgs(3); - PipeHT(Item).InletNodeNum = GetOnlySingleNode(state, + state.dataPipeHT->PipeHT(Item).InletNode = cAlphaArgs(3); + state.dataPipeHT->PipeHT(Item).InletNodeNum = GetOnlySingleNode(state, cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - if (PipeHT(Item).InletNodeNum == 0) { + if (state.dataPipeHT->PipeHT(Item).InletNodeNum == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(3) + '=' + cAlphaArgs(3)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; } // get outlet node data - PipeHT(Item).OutletNode = cAlphaArgs(4); - PipeHT(Item).OutletNodeNum = GetOnlySingleNode(state, + state.dataPipeHT->PipeHT(Item).OutletNode = cAlphaArgs(4); + state.dataPipeHT->PipeHT(Item).OutletNodeNum = GetOnlySingleNode(state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); - if (PipeHT(Item).OutletNodeNum == 0) { + if (state.dataPipeHT->PipeHT(Item).OutletNodeNum == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(4) + '=' + cAlphaArgs(4)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; @@ -354,27 +302,27 @@ namespace PipeHeatTransfer { auto const SELECT_CASE_var(cAlphaArgs(5)); if (SELECT_CASE_var == "ZONE") { - PipeHT(Item).EnvironmentPtr = ZoneEnv; - PipeHT(Item).EnvrZone = cAlphaArgs(6); - PipeHT(Item).EnvrZonePtr = UtilityRoutines::FindItemInList(cAlphaArgs(6), Zone); - if (PipeHT(Item).EnvrZonePtr == 0) { + state.dataPipeHT->PipeHT(Item).EnvironmentPtr = iEnvrnPtr::ZoneEnv; + state.dataPipeHT->PipeHT(Item).EnvrZone = cAlphaArgs(6); + state.dataPipeHT->PipeHT(Item).EnvrZonePtr = UtilityRoutines::FindItemInList(cAlphaArgs(6), Zone); + if (state.dataPipeHT->PipeHT(Item).EnvrZonePtr == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(6) + '=' + cAlphaArgs(6)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; } } else if (SELECT_CASE_var == "SCHEDULE") { - PipeHT(Item).EnvironmentPtr = ScheduleEnv; - PipeHT(Item).EnvrSchedule = cAlphaArgs(7); - PipeHT(Item).EnvrSchedPtr = GetScheduleIndex(state, PipeHT(Item).EnvrSchedule); - PipeHT(Item).EnvrVelSchedule = cAlphaArgs(8); - PipeHT(Item).EnvrVelSchedPtr = GetScheduleIndex(state, PipeHT(Item).EnvrVelSchedule); - if (PipeHT(Item).EnvrSchedPtr == 0) { + state.dataPipeHT->PipeHT(Item).EnvironmentPtr = iEnvrnPtr::ScheduleEnv; + state.dataPipeHT->PipeHT(Item).EnvrSchedule = cAlphaArgs(7); + state.dataPipeHT->PipeHT(Item).EnvrSchedPtr = GetScheduleIndex(state, state.dataPipeHT->PipeHT(Item).EnvrSchedule); + state.dataPipeHT->PipeHT(Item).EnvrVelSchedule = cAlphaArgs(8); + state.dataPipeHT->PipeHT(Item).EnvrVelSchedPtr = GetScheduleIndex(state, state.dataPipeHT->PipeHT(Item).EnvrVelSchedule); + if (state.dataPipeHT->PipeHT(Item).EnvrSchedPtr == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(7) + '=' + cAlphaArgs(7)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; } - if (PipeHT(Item).EnvrVelSchedPtr == 0) { + if (state.dataPipeHT->PipeHT(Item).EnvrVelSchedPtr == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(8) + '=' + cAlphaArgs(8)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; @@ -383,13 +331,13 @@ namespace PipeHeatTransfer { } else { ShowSevereError(state, "Invalid " + cAlphaFieldNames(5) + '=' + cAlphaArgs(5)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); - ShowContinueError(state, "Should be \"ZONE\" or \"SCHEDULE\""); // TODO rename point + ShowContinueError(state, R"(Should be "ZONE" or "SCHEDULE")"); // TODO rename point ErrorsFound = true; } } // dimensions - PipeHT(Item).PipeID = rNumericArgs(1); + state.dataPipeHT->PipeHT(Item).PipeID = rNumericArgs(1); if (rNumericArgs(1) <= 0.0) { // not really necessary because idd field has "minimum> 0" ShowSevereError(state, format("GetPipesHeatTransfer: invalid {} of {:.4R}", cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, cNumericFieldNames(1) + " must be > 0.0"); @@ -398,7 +346,7 @@ namespace PipeHeatTransfer { ErrorsFound = true; } - PipeHT(Item).Length = rNumericArgs(2); + state.dataPipeHT->PipeHT(Item).Length = rNumericArgs(2); if (rNumericArgs(2) <= 0.0) { // not really necessary because idd field has "minimum> 0" ShowSevereError(state, format("GetPipesHeatTransfer: invalid {} of {:.4R}", cNumericFieldNames(2), rNumericArgs(2))); ShowContinueError(state, cNumericFieldNames(2) + " must be > 0.0"); @@ -406,9 +354,9 @@ namespace PipeHeatTransfer { ErrorsFound = true; } - if (PipeHT(Item).ConstructionNum != 0) { - PipeHT(Item).ValidatePipeConstruction( - state, cCurrentModuleObject, cAlphaArgs(2), cAlphaFieldNames(2), PipeHT(Item).ConstructionNum, ErrorsFound); + if (state.dataPipeHT->PipeHT(Item).ConstructionNum != 0) { + state.dataPipeHT->PipeHT(Item).ValidatePipeConstruction( + state, cCurrentModuleObject, cAlphaArgs(2), cAlphaFieldNames(2), state.dataPipeHT->PipeHT(Item).ConstructionNum, ErrorsFound); } } // end of input loop @@ -430,35 +378,35 @@ namespace PipeHeatTransfer { cAlphaFieldNames, cNumericFieldNames); - GlobalNames::VerifyUniqueInterObjectName(state, PipeHTUniqueNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); - PipeHT(Item).Name = cAlphaArgs(1); - PipeHT(Item).TypeOf = TypeOf_PipeExterior; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataPipeHT->PipeHTUniqueNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); + state.dataPipeHT->PipeHT(Item).Name = cAlphaArgs(1); + state.dataPipeHT->PipeHT(Item).TypeOf = TypeOf_PipeExterior; // General user input data - PipeHT(Item).Construction = cAlphaArgs(2); - PipeHT(Item).ConstructionNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataConstruction->Construct); + state.dataPipeHT->PipeHT(Item).Construction = cAlphaArgs(2); + state.dataPipeHT->PipeHT(Item).ConstructionNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataConstruction->Construct); - if (PipeHT(Item).ConstructionNum == 0) { + if (state.dataPipeHT->PipeHT(Item).ConstructionNum == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(2) + '=' + cAlphaArgs(2)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; } // get inlet node data - PipeHT(Item).InletNode = cAlphaArgs(3); - PipeHT(Item).InletNodeNum = GetOnlySingleNode(state, + state.dataPipeHT->PipeHT(Item).InletNode = cAlphaArgs(3); + state.dataPipeHT->PipeHT(Item).InletNodeNum = GetOnlySingleNode(state, cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - if (PipeHT(Item).InletNodeNum == 0) { + if (state.dataPipeHT->PipeHT(Item).InletNodeNum == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(3) + '=' + cAlphaArgs(3)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; } // get outlet node data - PipeHT(Item).OutletNode = cAlphaArgs(4); - PipeHT(Item).OutletNodeNum = GetOnlySingleNode(state, + state.dataPipeHT->PipeHT(Item).OutletNode = cAlphaArgs(4); + state.dataPipeHT->PipeHT(Item).OutletNodeNum = GetOnlySingleNode(state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); - if (PipeHT(Item).OutletNodeNum == 0) { + if (state.dataPipeHT->PipeHT(Item).OutletNodeNum == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(4) + '=' + cAlphaArgs(4)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; @@ -468,10 +416,10 @@ namespace PipeHeatTransfer { // get environmental boundary condition type // PipeHT(Item)%Environment = 'OutdoorAir' - PipeHT(Item).EnvironmentPtr = OutsideAirEnv; + state.dataPipeHT->PipeHT(Item).EnvironmentPtr = iEnvrnPtr::OutsideAirEnv; - PipeHT(Item).EnvrAirNode = cAlphaArgs(5); - PipeHT(Item).EnvrAirNodeNum = GetOnlySingleNode(state, cAlphaArgs(5), + state.dataPipeHT->PipeHT(Item).EnvrAirNode = cAlphaArgs(5); + state.dataPipeHT->PipeHT(Item).EnvrAirNodeNum = GetOnlySingleNode(state, cAlphaArgs(5), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), @@ -480,7 +428,7 @@ namespace PipeHeatTransfer { 1, ObjectIsNotParent); if (!lAlphaFieldBlanks(5)) { - if (!CheckOutAirNodeNumber(state, PipeHT(Item).EnvrAirNodeNum)) { + if (!CheckOutAirNodeNumber(state, state.dataPipeHT->PipeHT(Item).EnvrAirNodeNum)) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(5) + '=' + cAlphaArgs(5)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, "Outdoor Air Node not on OutdoorAir:NodeList or OutdoorAir:Node"); @@ -494,7 +442,7 @@ namespace PipeHeatTransfer { } // dimensions - PipeHT(Item).PipeID = rNumericArgs(1); + state.dataPipeHT->PipeHT(Item).PipeID = rNumericArgs(1); if (rNumericArgs(1) <= 0.0) { // not really necessary because idd field has "minimum> 0" ShowSevereError(state, format("Invalid {} of {:.4R}", cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, cNumericFieldNames(1) + " must be > 0.0"); @@ -502,7 +450,7 @@ namespace PipeHeatTransfer { ErrorsFound = true; } - PipeHT(Item).Length = rNumericArgs(2); + state.dataPipeHT->PipeHT(Item).Length = rNumericArgs(2); if (rNumericArgs(2) <= 0.0) { // not really necessary because idd field has "minimum> 0" ShowSevereError(state, format("Invalid {} of {:.4R}", cNumericFieldNames(2), rNumericArgs(2))); ShowContinueError(state, cNumericFieldNames(2) + " must be > 0.0"); @@ -510,9 +458,9 @@ namespace PipeHeatTransfer { ErrorsFound = true; } - if (PipeHT(Item).ConstructionNum != 0) { - PipeHT(Item).ValidatePipeConstruction( - state, cCurrentModuleObject, cAlphaArgs(2), cAlphaFieldNames(2), PipeHT(Item).ConstructionNum, ErrorsFound); + if (state.dataPipeHT->PipeHT(Item).ConstructionNum != 0) { + state.dataPipeHT->PipeHT(Item).ValidatePipeConstruction( + state, cCurrentModuleObject, cAlphaArgs(2), cAlphaFieldNames(2), state.dataPipeHT->PipeHT(Item).ConstructionNum, ErrorsFound); } } // end of input loop @@ -535,35 +483,35 @@ namespace PipeHeatTransfer { cAlphaFieldNames, cNumericFieldNames); - GlobalNames::VerifyUniqueInterObjectName(state, PipeHTUniqueNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); - PipeHT(Item).Name = cAlphaArgs(1); - PipeHT(Item).TypeOf = TypeOf_PipeUnderground; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataPipeHT->PipeHTUniqueNames, cAlphaArgs(1), cCurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); + state.dataPipeHT->PipeHT(Item).Name = cAlphaArgs(1); + state.dataPipeHT->PipeHT(Item).TypeOf = TypeOf_PipeUnderground; // General user input data - PipeHT(Item).Construction = cAlphaArgs(2); - PipeHT(Item).ConstructionNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataConstruction->Construct); + state.dataPipeHT->PipeHT(Item).Construction = cAlphaArgs(2); + state.dataPipeHT->PipeHT(Item).ConstructionNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataConstruction->Construct); - if (PipeHT(Item).ConstructionNum == 0) { + if (state.dataPipeHT->PipeHT(Item).ConstructionNum == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(2) + '=' + cAlphaArgs(2)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; } // get inlet node data - PipeHT(Item).InletNode = cAlphaArgs(3); - PipeHT(Item).InletNodeNum = GetOnlySingleNode(state, + state.dataPipeHT->PipeHT(Item).InletNode = cAlphaArgs(3); + state.dataPipeHT->PipeHT(Item).InletNodeNum = GetOnlySingleNode(state, cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - if (PipeHT(Item).InletNodeNum == 0) { + if (state.dataPipeHT->PipeHT(Item).InletNodeNum == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(3) + '=' + cAlphaArgs(3)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; } // get outlet node data - PipeHT(Item).OutletNode = cAlphaArgs(4); - PipeHT(Item).OutletNodeNum = GetOnlySingleNode(state, + state.dataPipeHT->PipeHT(Item).OutletNode = cAlphaArgs(4); + state.dataPipeHT->PipeHT(Item).OutletNodeNum = GetOnlySingleNode(state, cAlphaArgs(4), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); - if (PipeHT(Item).OutletNodeNum == 0) { + if (state.dataPipeHT->PipeHT(Item).OutletNodeNum == 0) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(4) + '=' + cAlphaArgs(4)); ShowContinueError(state, "Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ErrorsFound = true; @@ -571,14 +519,14 @@ namespace PipeHeatTransfer { TestCompSet(state, cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(3), cAlphaArgs(4), "Pipe Nodes"); - PipeHT(Item).EnvironmentPtr = GroundEnv; + state.dataPipeHT->PipeHT(Item).EnvironmentPtr = iEnvrnPtr::GroundEnv; // Solar inclusion flag // A6, \field Sun Exposure if (UtilityRoutines::SameString(cAlphaArgs(5), "SUNEXPOSED")) { - PipeHT(Item).SolarExposed = true; + state.dataPipeHT->PipeHT(Item).SolarExposed = true; } else if (UtilityRoutines::SameString(cAlphaArgs(5), "NOSUN")) { - PipeHT(Item).SolarExposed = false; + state.dataPipeHT->PipeHT(Item).SolarExposed = false; } else { ShowSevereError(state, "GetPipesHeatTransfer: invalid key for sun exposure flag for " + cAlphaArgs(1)); ShowContinueError(state, "Key should be either SunExposed or NoSun. Entered Key: " + cAlphaArgs(5)); @@ -586,7 +534,7 @@ namespace PipeHeatTransfer { } // dimensions - PipeHT(Item).PipeID = rNumericArgs(1); + state.dataPipeHT->PipeHT(Item).PipeID = rNumericArgs(1); if (rNumericArgs(1) <= 0.0) { // not really necessary because idd field has "minimum> 0" ShowSevereError(state, format("Invalid {} of {:.4R}", cNumericFieldNames(1), rNumericArgs(1))); ShowContinueError(state, cNumericFieldNames(1) + " must be > 0.0"); @@ -594,7 +542,7 @@ namespace PipeHeatTransfer { ErrorsFound = true; } - PipeHT(Item).Length = rNumericArgs(2); + state.dataPipeHT->PipeHT(Item).Length = rNumericArgs(2); if (rNumericArgs(2) <= 0.0) { // not really necessary because idd field has "minimum> 0" ShowSevereError(state, format("Invalid {} of {:.4R}", cNumericFieldNames(2), rNumericArgs(2))); ShowContinueError(state, cNumericFieldNames(2) + " must be > 0.0"); @@ -604,81 +552,81 @@ namespace PipeHeatTransfer { // Also get the soil material name // A7, \field Soil Material - PipeHT(Item).SoilMaterial = cAlphaArgs(6); - PipeHT(Item).SoilMaterialNum = UtilityRoutines::FindItemInList(cAlphaArgs(6), state.dataMaterial->Material); - if (PipeHT(Item).SoilMaterialNum == 0) { - ShowSevereError(state, "Invalid " + cAlphaFieldNames(6) + '=' + PipeHT(Item).SoilMaterial); - ShowContinueError(state, "Found in " + cCurrentModuleObject + '=' + PipeHT(Item).Name); + state.dataPipeHT->PipeHT(Item).SoilMaterial = cAlphaArgs(6); + state.dataPipeHT->PipeHT(Item).SoilMaterialNum = UtilityRoutines::FindItemInList(cAlphaArgs(6), state.dataMaterial->Material); + if (state.dataPipeHT->PipeHT(Item).SoilMaterialNum == 0) { + ShowSevereError(state, "Invalid " + cAlphaFieldNames(6) + '=' + state.dataPipeHT->PipeHT(Item).SoilMaterial); + ShowContinueError(state, "Found in " + cCurrentModuleObject + '=' + state.dataPipeHT->PipeHT(Item).Name); ErrorsFound = true; } else { - PipeHT(Item).SoilDensity = state.dataMaterial->Material(PipeHT(Item).SoilMaterialNum).Density; - PipeHT(Item).SoilDepth = state.dataMaterial->Material(PipeHT(Item).SoilMaterialNum).Thickness; - PipeHT(Item).SoilCp = state.dataMaterial->Material(PipeHT(Item).SoilMaterialNum).SpecHeat; - PipeHT(Item).SoilConductivity = state.dataMaterial->Material(PipeHT(Item).SoilMaterialNum).Conductivity; - PipeHT(Item).SoilThermAbs = state.dataMaterial->Material(PipeHT(Item).SoilMaterialNum).AbsorpThermal; - PipeHT(Item).SoilSolarAbs = state.dataMaterial->Material(PipeHT(Item).SoilMaterialNum).AbsorpSolar; - PipeHT(Item).SoilRoughness = state.dataMaterial->Material(PipeHT(Item).SoilMaterialNum).Roughness; - PipeHT(Item).PipeDepth = PipeHT(Item).SoilDepth + PipeHT(Item).PipeID / 2.0; - PipeHT(Item).DomainDepth = PipeHT(Item).PipeDepth * 2.0; - PipeHT(Item).SoilDiffusivity = PipeHT(Item).SoilConductivity / (PipeHT(Item).SoilDensity * PipeHT(Item).SoilCp); - PipeHT(Item).SoilDiffusivityPerDay = PipeHT(Item).SoilDiffusivity * SecondsInHour * DataGlobalConstants::HoursInDay; + state.dataPipeHT->PipeHT(Item).SoilDensity = state.dataMaterial->Material(state.dataPipeHT->PipeHT(Item).SoilMaterialNum).Density; + state.dataPipeHT->PipeHT(Item).SoilDepth = state.dataMaterial->Material(state.dataPipeHT->PipeHT(Item).SoilMaterialNum).Thickness; + state.dataPipeHT->PipeHT(Item).SoilCp = state.dataMaterial->Material(state.dataPipeHT->PipeHT(Item).SoilMaterialNum).SpecHeat; + state.dataPipeHT->PipeHT(Item).SoilConductivity = state.dataMaterial->Material(state.dataPipeHT->PipeHT(Item).SoilMaterialNum).Conductivity; + state.dataPipeHT->PipeHT(Item).SoilThermAbs = state.dataMaterial->Material(state.dataPipeHT->PipeHT(Item).SoilMaterialNum).AbsorpThermal; + state.dataPipeHT->PipeHT(Item).SoilSolarAbs = state.dataMaterial->Material(state.dataPipeHT->PipeHT(Item).SoilMaterialNum).AbsorpSolar; + state.dataPipeHT->PipeHT(Item).SoilRoughness = state.dataMaterial->Material(state.dataPipeHT->PipeHT(Item).SoilMaterialNum).Roughness; + state.dataPipeHT->PipeHT(Item).PipeDepth = state.dataPipeHT->PipeHT(Item).SoilDepth + state.dataPipeHT->PipeHT(Item).PipeID / 2.0; + state.dataPipeHT->PipeHT(Item).DomainDepth = state.dataPipeHT->PipeHT(Item).PipeDepth * 2.0; + state.dataPipeHT->PipeHT(Item).SoilDiffusivity = state.dataPipeHT->PipeHT(Item).SoilConductivity / (state.dataPipeHT->PipeHT(Item).SoilDensity * state.dataPipeHT->PipeHT(Item).SoilCp); + state.dataPipeHT->PipeHT(Item).SoilDiffusivityPerDay = state.dataPipeHT->PipeHT(Item).SoilDiffusivity * SecondsInHour * DataGlobalConstants::HoursInDay; // Mesh the cartesian domain - PipeHT(Item).NumDepthNodes = NumberOfDepthNodes; - PipeHT(Item).PipeNodeDepth = PipeHT(Item).NumDepthNodes / 2; - PipeHT(Item).PipeNodeWidth = PipeHT(Item).NumDepthNodes / 2; - PipeHT(Item).DomainDepth = PipeHT(Item).PipeDepth * 2.0; - PipeHT(Item).dSregular = PipeHT(Item).DomainDepth / (PipeHT(Item).NumDepthNodes - 1); + state.dataPipeHT->PipeHT(Item).NumDepthNodes = NumberOfDepthNodes; + state.dataPipeHT->PipeHT(Item).PipeNodeDepth = state.dataPipeHT->PipeHT(Item).NumDepthNodes / 2; + state.dataPipeHT->PipeHT(Item).PipeNodeWidth = state.dataPipeHT->PipeHT(Item).NumDepthNodes / 2; + state.dataPipeHT->PipeHT(Item).DomainDepth = state.dataPipeHT->PipeHT(Item).PipeDepth * 2.0; + state.dataPipeHT->PipeHT(Item).dSregular = state.dataPipeHT->PipeHT(Item).DomainDepth / (state.dataPipeHT->PipeHT(Item).NumDepthNodes - 1); } - if (PipeHT(Item).ConstructionNum != 0) { - PipeHT(Item).ValidatePipeConstruction( - state, cCurrentModuleObject, cAlphaArgs(2), cAlphaFieldNames(2), PipeHT(Item).ConstructionNum, ErrorsFound); + if (state.dataPipeHT->PipeHT(Item).ConstructionNum != 0) { + state.dataPipeHT->PipeHT(Item).ValidatePipeConstruction( + state, cCurrentModuleObject, cAlphaArgs(2), cAlphaFieldNames(2), state.dataPipeHT->PipeHT(Item).ConstructionNum, ErrorsFound); } // Get ground temperature model - PipeHT(Item).groundTempModel = GetGroundTempModelAndInit(state, cAlphaArgs(7), cAlphaArgs(8)); + state.dataPipeHT->PipeHT(Item).groundTempModel = GetGroundTempModelAndInit(state, cAlphaArgs(7), cAlphaArgs(8)); // Select number of pipe sections. Hanby's optimal number of 20 section is selected. NumSections = NumPipeSections; - PipeHT(Item).NumSections = NumPipeSections; + state.dataPipeHT->PipeHT(Item).NumSections = NumPipeSections; // For buried pipes, we need to allocate the cartesian finite difference array - PipeHT(Item).T.allocate(PipeHT(Item).PipeNodeWidth, PipeHT(Item).NumDepthNodes, PipeHT(Item).NumSections, TentativeTimeIndex); - PipeHT(Item).T = 0.0; + state.dataPipeHT->PipeHT(Item).T.allocate(state.dataPipeHT->PipeHT(Item).PipeNodeWidth, state.dataPipeHT->PipeHT(Item).NumDepthNodes, state.dataPipeHT->PipeHT(Item).NumSections, TentativeTimeIndex); + state.dataPipeHT->PipeHT(Item).T = 0.0; } // PipeUG input loop - for (Item = 1; Item <= nsvNumOfPipeHT; ++Item) { + for (Item = 1; Item <= state.dataPipeHT->nsvNumOfPipeHT; ++Item) { // Select number of pipe sections. Hanby's optimal number of 20 section is selected. NumSections = NumPipeSections; - PipeHT(Item).NumSections = NumPipeSections; + state.dataPipeHT->PipeHT(Item).NumSections = NumPipeSections; // We need to allocate the Hanby model arrays for all pipes, including buried - PipeHT(Item).TentativeFluidTemp.allocate({0, NumSections}); - PipeHT(Item).TentativePipeTemp.allocate({0, NumSections}); - PipeHT(Item).FluidTemp.allocate({0, NumSections}); - PipeHT(Item).PreviousFluidTemp.allocate({0, NumSections}); - PipeHT(Item).PipeTemp.allocate({0, NumSections}); - PipeHT(Item).PreviousPipeTemp.allocate({0, NumSections}); - - PipeHT(Item).TentativeFluidTemp = 0.0; - PipeHT(Item).FluidTemp = 0.0; - PipeHT(Item).PreviousFluidTemp = 0.0; - PipeHT(Item).TentativePipeTemp = 0.0; - PipeHT(Item).PipeTemp = 0.0; - PipeHT(Item).PreviousPipeTemp = 0.0; + state.dataPipeHT->PipeHT(Item).TentativeFluidTemp.allocate({0, NumSections}); + state.dataPipeHT->PipeHT(Item).TentativePipeTemp.allocate({0, NumSections}); + state.dataPipeHT->PipeHT(Item).FluidTemp.allocate({0, NumSections}); + state.dataPipeHT->PipeHT(Item).PreviousFluidTemp.allocate({0, NumSections}); + state.dataPipeHT->PipeHT(Item).PipeTemp.allocate({0, NumSections}); + state.dataPipeHT->PipeHT(Item).PreviousPipeTemp.allocate({0, NumSections}); + + state.dataPipeHT->PipeHT(Item).TentativeFluidTemp = 0.0; + state.dataPipeHT->PipeHT(Item).FluidTemp = 0.0; + state.dataPipeHT->PipeHT(Item).PreviousFluidTemp = 0.0; + state.dataPipeHT->PipeHT(Item).TentativePipeTemp = 0.0; + state.dataPipeHT->PipeHT(Item).PipeTemp = 0.0; + state.dataPipeHT->PipeHT(Item).PreviousPipeTemp = 0.0; // work out heat transfer areas (area per section) - PipeHT(Item).InsideArea = DataGlobalConstants::Pi * PipeHT(Item).PipeID * PipeHT(Item).Length / NumSections; - PipeHT(Item).OutsideArea = DataGlobalConstants::Pi * (PipeHT(Item).PipeOD + 2 * PipeHT(Item).InsulationThickness) * PipeHT(Item).Length / NumSections; + state.dataPipeHT->PipeHT(Item).InsideArea = DataGlobalConstants::Pi * state.dataPipeHT->PipeHT(Item).PipeID * state.dataPipeHT->PipeHT(Item).Length / NumSections; + state.dataPipeHT->PipeHT(Item).OutsideArea = DataGlobalConstants::Pi * (state.dataPipeHT->PipeHT(Item).PipeOD + 2 * state.dataPipeHT->PipeHT(Item).InsulationThickness) * state.dataPipeHT->PipeHT(Item).Length / NumSections; // cross sectional area - PipeHT(Item).SectionArea = DataGlobalConstants::Pi * 0.25 * pow_2(PipeHT(Item).PipeID); + state.dataPipeHT->PipeHT(Item).SectionArea = DataGlobalConstants::Pi * 0.25 * pow_2(state.dataPipeHT->PipeHT(Item).PipeID); // pipe & insulation mass - PipeHT(Item).PipeHeatCapacity = PipeHT(Item).PipeCp * PipeHT(Item).PipeDensity * - (DataGlobalConstants::Pi * 0.25 * pow_2(PipeHT(Item).PipeOD) - PipeHT(Item).SectionArea); // the metal component + state.dataPipeHT->PipeHT(Item).PipeHeatCapacity = state.dataPipeHT->PipeHT(Item).PipeCp * state.dataPipeHT->PipeHT(Item).PipeDensity * + (DataGlobalConstants::Pi * 0.25 * pow_2(state.dataPipeHT->PipeHT(Item).PipeOD) - state.dataPipeHT->PipeHT(Item).SectionArea); // the metal component } // final error check @@ -687,34 +635,34 @@ namespace PipeHeatTransfer { } // Set up the output variables CurrentModuleObject='Pipe:Indoor/Outdoor/Underground' - for (Item = 1; Item <= nsvNumOfPipeHT; ++Item) { + for (Item = 1; Item <= state.dataPipeHT->nsvNumOfPipeHT; ++Item) { SetupOutputVariable(state, - "Pipe Fluid Heat Transfer Rate", OutputProcessor::Unit::W, PipeHT(Item).FluidHeatLossRate, "Plant", "Average", PipeHT(Item).Name); + "Pipe Fluid Heat Transfer Rate", OutputProcessor::Unit::W, state.dataPipeHT->PipeHT(Item).FluidHeatLossRate, "Plant", "Average", state.dataPipeHT->PipeHT(Item).Name); SetupOutputVariable(state, - "Pipe Fluid Heat Transfer Energy", OutputProcessor::Unit::J, PipeHT(Item).FluidHeatLossEnergy, "Plant", "Sum", PipeHT(Item).Name); + "Pipe Fluid Heat Transfer Energy", OutputProcessor::Unit::J, state.dataPipeHT->PipeHT(Item).FluidHeatLossEnergy, "Plant", "Sum", state.dataPipeHT->PipeHT(Item).Name); - if (PipeHT(Item).EnvironmentPtr == ZoneEnv) { + if (state.dataPipeHT->PipeHT(Item).EnvironmentPtr == iEnvrnPtr::ZoneEnv) { SetupOutputVariable(state, "Pipe Ambient Heat Transfer Rate", OutputProcessor::Unit::W, - PipeHT(Item).EnvironmentHeatLossRate, + state.dataPipeHT->PipeHT(Item).EnvironmentHeatLossRate, "Plant", "Average", - PipeHT(Item).Name); + state.dataPipeHT->PipeHT(Item).Name); SetupOutputVariable(state, - "Pipe Ambient Heat Transfer Energy", OutputProcessor::Unit::J, PipeHT(Item).EnvHeatLossEnergy, "Plant", "Sum", PipeHT(Item).Name); + "Pipe Ambient Heat Transfer Energy", OutputProcessor::Unit::J, state.dataPipeHT->PipeHT(Item).EnvHeatLossEnergy, "Plant", "Sum", state.dataPipeHT->PipeHT(Item).Name); SetupZoneInternalGain(state, - PipeHT(Item).EnvrZonePtr, "Pipe:Indoor", PipeHT(Item).Name, IntGainTypeOf_PipeIndoor, &PipeHT(Item).ZoneHeatGainRate); + state.dataPipeHT->PipeHT(Item).EnvrZonePtr, "Pipe:Indoor", state.dataPipeHT->PipeHT(Item).Name, IntGainTypeOf_PipeIndoor, &state.dataPipeHT->PipeHT(Item).ZoneHeatGainRate); } - SetupOutputVariable(state, "Pipe Mass Flow Rate", OutputProcessor::Unit::kg_s, PipeHT(Item).MassFlowRate, "Plant", "Average", PipeHT(Item).Name); + SetupOutputVariable(state, "Pipe Mass Flow Rate", OutputProcessor::Unit::kg_s, state.dataPipeHT->PipeHT(Item).MassFlowRate, "Plant", "Average", state.dataPipeHT->PipeHT(Item).Name); SetupOutputVariable(state, - "Pipe Volume Flow Rate", OutputProcessor::Unit::m3_s, PipeHT(Item).VolumeFlowRate, "Plant", "Average", PipeHT(Item).Name); + "Pipe Volume Flow Rate", OutputProcessor::Unit::m3_s, state.dataPipeHT->PipeHT(Item).VolumeFlowRate, "Plant", "Average", state.dataPipeHT->PipeHT(Item).Name); SetupOutputVariable(state, - "Pipe Inlet Temperature", OutputProcessor::Unit::C, PipeHT(Item).FluidInletTemp, "Plant", "Average", PipeHT(Item).Name); + "Pipe Inlet Temperature", OutputProcessor::Unit::C, state.dataPipeHT->PipeHT(Item).FluidInletTemp, "Plant", "Average", state.dataPipeHT->PipeHT(Item).Name); SetupOutputVariable(state, - "Pipe Outlet Temperature", OutputProcessor::Unit::C, PipeHT(Item).FluidOutletTemp, "Plant", "Average", PipeHT(Item).Name); + "Pipe Outlet Temperature", OutputProcessor::Unit::C, state.dataPipeHT->PipeHT(Item).FluidOutletTemp, "Plant", "Average", state.dataPipeHT->PipeHT(Item).Name); } } @@ -866,10 +814,10 @@ namespace PipeHeatTransfer { CurSimDay = double(state.dataGlobal->DayOfSim); // some useful module variables - nsvInletNodeNum = this->InletNodeNum; - nsvOutletNodeNum = this->OutletNodeNum; - nsvMassFlowRate = Node(nsvInletNodeNum).MassFlowRate; - nsvInletTemp = Node(nsvInletNodeNum).Temp; + state.dataPipeHT->nsvInletNodeNum = this->InletNodeNum; + state.dataPipeHT->nsvOutletNodeNum = this->OutletNodeNum; + state.dataPipeHT->nsvMassFlowRate = Node(state.dataPipeHT->nsvInletNodeNum).MassFlowRate; + state.dataPipeHT->nsvInletTemp = Node(state.dataPipeHT->nsvInletNodeNum).Temp; // get some data only once if (this->OneTimeInit) { @@ -886,7 +834,7 @@ namespace PipeHeatTransfer { // initialize temperatures by inlet node temp if ((state.dataGlobal->BeginSimFlag && this->BeginSimInit) || (state.dataGlobal->BeginEnvrnFlag && this->BeginSimEnvrn)) { - if (this->EnvironmentPtr == GroundEnv) { + if (this->EnvironmentPtr == iEnvrnPtr::GroundEnv) { for (TimeIndex = PreviousTimeIndex; TimeIndex <= TentativeTimeIndex; ++TimeIndex) { // Loop through all length, depth, and width of pipe to init soil temperature for (LengthIndex = 1; LengthIndex <= this->NumSections; ++LengthIndex) { @@ -909,11 +857,11 @@ namespace PipeHeatTransfer { this->PipeTemp = FirstTemperatures; this->PreviousPipeTemp = FirstTemperatures; this->PreviousSimTime = 0.0; - nsvDeltaTime = 0.0; - nsvOutletTemp = 0.0; - nsvEnvironmentTemp = 0.0; - nsvEnvHeatLossRate = 0.0; - nsvFluidHeatLossRate = 0.0; + state.dataPipeHT->nsvDeltaTime = 0.0; + state.dataPipeHT->nsvOutletTemp = 0.0; + state.dataPipeHT->nsvEnvironmentTemp = 0.0; + state.dataPipeHT->nsvEnvHeatLossRate = 0.0; + state.dataPipeHT->nsvFluidHeatLossRate = 0.0; this->BeginSimInit = false; this->BeginSimEnvrn = false; @@ -923,14 +871,14 @@ namespace PipeHeatTransfer { if (!state.dataGlobal->BeginEnvrnFlag) this->BeginSimEnvrn = true; // time step in seconds - nsvDeltaTime = TimeStepSys * DataGlobalConstants::SecInHour; - nsvNumInnerTimeSteps = int(nsvDeltaTime / InnerDeltaTime); + state.dataPipeHT->nsvDeltaTime = TimeStepSys * DataGlobalConstants::SecInHour; + state.dataPipeHT->nsvNumInnerTimeSteps = int(state.dataPipeHT->nsvDeltaTime / InnerDeltaTime); // previous temps are updated if necessary at start of timestep rather than end if ((FirstHVACIteration && this->FirstHVACupdateFlag) || (state.dataGlobal->BeginEnvrnFlag && this->BeginEnvrnupdateFlag)) { // We need to update boundary conditions here, as well as updating the arrays - if (this->EnvironmentPtr == GroundEnv) { + if (this->EnvironmentPtr == iEnvrnPtr::GroundEnv) { // And then update Ground Boundary Conditions for (TimeIndex = 1; TimeIndex <= TentativeTimeIndex; ++TimeIndex) { @@ -954,16 +902,16 @@ namespace PipeHeatTransfer { // should next choose environment temperature according to coupled with air or ground { auto const SELECT_CASE_var(this->EnvironmentPtr); - if (SELECT_CASE_var == GroundEnv) { + if (SELECT_CASE_var == iEnvrnPtr::GroundEnv) { // EnvironmentTemp = GroundTemp - } else if (SELECT_CASE_var == OutsideAirEnv) { - nsvEnvironmentTemp = state.dataEnvrn->OutDryBulbTemp; - } else if (SELECT_CASE_var == ZoneEnv) { - nsvEnvironmentTemp = MAT(this->EnvrZonePtr); - } else if (SELECT_CASE_var == ScheduleEnv) { - nsvEnvironmentTemp = GetCurrentScheduleValue(state, this->EnvrSchedPtr); - } else if (SELECT_CASE_var == None) { // default to outside temp - nsvEnvironmentTemp = state.dataEnvrn->OutDryBulbTemp; + } else if (SELECT_CASE_var == iEnvrnPtr::OutsideAirEnv) { + state.dataPipeHT->nsvEnvironmentTemp = state.dataEnvrn->OutDryBulbTemp; + } else if (SELECT_CASE_var == iEnvrnPtr::ZoneEnv) { + state.dataPipeHT->nsvEnvironmentTemp = MAT(this->EnvrZonePtr); + } else if (SELECT_CASE_var == iEnvrnPtr::ScheduleEnv) { + state.dataPipeHT->nsvEnvironmentTemp = GetCurrentScheduleValue(state, this->EnvrSchedPtr); + } else if (SELECT_CASE_var == iEnvrnPtr::None) { // default to outside temp + state.dataPipeHT->nsvEnvironmentTemp = state.dataEnvrn->OutDryBulbTemp; } } @@ -988,7 +936,7 @@ namespace PipeHeatTransfer { // If sim time has changed all values from previous runs should have been acceptable. // Thus we will now shift the arrays from 2>1 and 3>2 so we can then begin // to update 2 and 3 again. - if (this->EnvironmentPtr == GroundEnv) { + if (this->EnvironmentPtr == iEnvrnPtr::GroundEnv) { for (LengthIndex = 2; LengthIndex <= this->NumSections; ++LengthIndex) { for (DepthIndex = 1; DepthIndex <= this->NumDepthNodes; ++DepthIndex) { for (WidthIndex = 2; WidthIndex <= this->PipeNodeWidth; ++WidthIndex) { @@ -1030,8 +978,8 @@ namespace PipeHeatTransfer { // Thus, this is called at the beginning of every time step once. this->FluidSpecHeat = - GetSpecificHeatGlycol(state, PlantLoop(this->LoopNum).FluidName, nsvInletTemp, PlantLoop(this->LoopNum).FluidIndex, RoutineName); - this->FluidDensity = GetDensityGlycol(state, PlantLoop(this->LoopNum).FluidName, nsvInletTemp, PlantLoop(this->LoopNum).FluidIndex, RoutineName); + GetSpecificHeatGlycol(state, PlantLoop(this->LoopNum).FluidName, state.dataPipeHT->nsvInletTemp, PlantLoop(this->LoopNum).FluidIndex, RoutineName); + this->FluidDensity = GetDensityGlycol(state, PlantLoop(this->LoopNum).FluidName, state.dataPipeHT->nsvInletTemp, PlantLoop(this->LoopNum).FluidIndex, RoutineName); // At this point, for all Pipe:Interior objects we should zero out the energy and rate arrays this->FluidHeatLossRate = 0.0; @@ -1039,13 +987,13 @@ namespace PipeHeatTransfer { this->EnvironmentHeatLossRate = 0.0; this->EnvHeatLossEnergy = 0.0; this->ZoneHeatGainRate = 0.0; - nsvFluidHeatLossRate = 0.0; - nsvEnvHeatLossRate = 0.0; - nsvOutletTemp = 0.0; + state.dataPipeHT->nsvFluidHeatLossRate = 0.0; + state.dataPipeHT->nsvEnvHeatLossRate = 0.0; + state.dataPipeHT->nsvOutletTemp = 0.0; if (this->FluidDensity > 0.0) { // The density will only be zero the first time through, which will be a warmup day, and not reported - nsvVolumeFlowRate = nsvMassFlowRate / this->FluidDensity; + state.dataPipeHT->nsvVolumeFlowRate = state.dataPipeHT->nsvMassFlowRate / this->FluidDensity; } } @@ -1117,36 +1065,36 @@ namespace PipeHeatTransfer { // traps fluid properties problems such as freezing conditions if (this->FluidSpecHeat <= 0.0 || this->FluidDensity <= 0.0) { // leave the state of the pipe as it was - nsvOutletTemp = this->TentativeFluidTemp(this->NumSections); + state.dataPipeHT->nsvOutletTemp = this->TentativeFluidTemp(this->NumSections); // set heat transfer rates to zero for consistency - nsvEnvHeatLossRate = 0.0; - nsvFluidHeatLossRate = 0.0; + state.dataPipeHT->nsvEnvHeatLossRate = 0.0; + state.dataPipeHT->nsvFluidHeatLossRate = 0.0; return; } // AirConvCoef = OutsidePipeHeatTransCoef(PipeHTNum) // Revised by L. Gu by including insulation conductance 6/19/08 - if (this->EnvironmentPtr != GroundEnv) { + if (this->EnvironmentPtr != iEnvrnPtr::GroundEnv) { AirConvCoef = 1.0 / (1.0 / this->OutsidePipeHeatTransCoef(state) + this->InsulationResistance); } - FluidConvCoef = this->CalcPipeHeatTransCoef(state, nsvInletTemp, nsvMassFlowRate, this->PipeID); + FluidConvCoef = this->CalcPipeHeatTransCoef(state, state.dataPipeHT->nsvInletTemp, state.dataPipeHT->nsvMassFlowRate, this->PipeID); // heat transfer to air or ground { auto const SELECT_CASE_var(this->EnvironmentPtr); - if (SELECT_CASE_var == GroundEnv) { + if (SELECT_CASE_var == iEnvrnPtr::GroundEnv) { // Approximate conductance using ground conductivity, (h=k/L), where L is grid spacing // between pipe wall and next closest node. EnvHeatTransCoef = this->SoilConductivity / (this->dSregular - (this->PipeID / 2.0)); - } else if (SELECT_CASE_var == OutsideAirEnv) { + } else if (SELECT_CASE_var == iEnvrnPtr::OutsideAirEnv) { EnvHeatTransCoef = AirConvCoef; - } else if (SELECT_CASE_var == ZoneEnv) { + } else if (SELECT_CASE_var == iEnvrnPtr::ZoneEnv) { EnvHeatTransCoef = AirConvCoef; - } else if (SELECT_CASE_var == ScheduleEnv) { + } else if (SELECT_CASE_var == iEnvrnPtr::ScheduleEnv) { EnvHeatTransCoef = AirConvCoef; - } else if (SELECT_CASE_var == None) { + } else if (SELECT_CASE_var == iEnvrnPtr::None) { EnvHeatTransCoef = 0.0; } else { EnvHeatTransCoef = 0.0; @@ -1158,24 +1106,24 @@ namespace PipeHeatTransfer { this->SectionArea * this->Length / this->NumSections * this->FluidSpecHeat * this->FluidDensity; // Mass of Node x Specific heat // coef of fluid heat balance - A1 = FluidNodeHeatCapacity + nsvMassFlowRate * this->FluidSpecHeat * nsvDeltaTime + FluidConvCoef * this->InsideArea * nsvDeltaTime; + A1 = FluidNodeHeatCapacity + state.dataPipeHT->nsvMassFlowRate * this->FluidSpecHeat * state.dataPipeHT->nsvDeltaTime + FluidConvCoef * this->InsideArea * state.dataPipeHT->nsvDeltaTime; - A2 = nsvMassFlowRate * this->FluidSpecHeat * nsvDeltaTime; + A2 = state.dataPipeHT->nsvMassFlowRate * this->FluidSpecHeat * state.dataPipeHT->nsvDeltaTime; - A3 = FluidConvCoef * this->InsideArea * nsvDeltaTime; + A3 = FluidConvCoef * this->InsideArea * state.dataPipeHT->nsvDeltaTime; A4 = FluidNodeHeatCapacity; // coef of pipe heat balance - B1 = this->PipeHeatCapacity + FluidConvCoef * this->InsideArea * nsvDeltaTime + EnvHeatTransCoef * this->OutsideArea * nsvDeltaTime; + B1 = this->PipeHeatCapacity + FluidConvCoef * this->InsideArea * state.dataPipeHT->nsvDeltaTime + EnvHeatTransCoef * this->OutsideArea * state.dataPipeHT->nsvDeltaTime; B2 = A3; - B3 = EnvHeatTransCoef * this->OutsideArea * nsvDeltaTime; + B3 = EnvHeatTransCoef * this->OutsideArea * state.dataPipeHT->nsvDeltaTime; B4 = this->PipeHeatCapacity; - this->TentativeFluidTemp(0) = nsvInletTemp; + this->TentativeFluidTemp(0) = state.dataPipeHT->nsvInletTemp; this->TentativePipeTemp(0) = this->PipeTemp(1); // for convenience @@ -1186,23 +1134,23 @@ namespace PipeHeatTransfer { TempBelow = this->T(PipeWidth, PipeDepth + 1, LengthIndex, CurrentTimeIndex); TempBeside = this->T(PipeWidth - 1, PipeDepth, LengthIndex, CurrentTimeIndex); TempAbove = this->T(PipeWidth, PipeDepth - 1, LengthIndex, CurrentTimeIndex); - nsvEnvironmentTemp = (TempBelow + TempBeside + TempAbove) / 3.0; + state.dataPipeHT->nsvEnvironmentTemp = (TempBelow + TempBeside + TempAbove) / 3.0; this->TentativeFluidTemp(LengthIndex) = - (A2 * this->TentativeFluidTemp(LengthIndex - 1) + A3 / B1 * (B3 * nsvEnvironmentTemp + B4 * this->PreviousPipeTemp(LengthIndex)) + + (A2 * this->TentativeFluidTemp(LengthIndex - 1) + A3 / B1 * (B3 * state.dataPipeHT->nsvEnvironmentTemp + B4 * this->PreviousPipeTemp(LengthIndex)) + A4 * this->PreviousFluidTemp(LengthIndex)) / (A1 - A3 * B2 / B1); this->TentativePipeTemp(LengthIndex) = - (B2 * this->TentativeFluidTemp(LengthIndex) + B3 * nsvEnvironmentTemp + B4 * this->PreviousPipeTemp(LengthIndex)) / B1; + (B2 * this->TentativeFluidTemp(LengthIndex) + B3 * state.dataPipeHT->nsvEnvironmentTemp + B4 * this->PreviousPipeTemp(LengthIndex)) / B1; // Get exterior surface temperature from energy balance at the surface - Numerator = nsvEnvironmentTemp - this->TentativeFluidTemp(LengthIndex); + Numerator = state.dataPipeHT->nsvEnvironmentTemp - this->TentativeFluidTemp(LengthIndex); Denominator = EnvHeatTransCoef * ((1 / EnvHeatTransCoef) + this->SumTK); - SurfaceTemp = nsvEnvironmentTemp - Numerator / Denominator; + SurfaceTemp = state.dataPipeHT->nsvEnvironmentTemp - Numerator / Denominator; // keep track of environmental heat loss rate - not same as fluid loss at same time - nsvEnvHeatLossRate += EnvHeatTransCoef * this->OutsideArea * (SurfaceTemp - nsvEnvironmentTemp); + state.dataPipeHT->nsvEnvHeatLossRate += EnvHeatTransCoef * this->OutsideArea * (SurfaceTemp - state.dataPipeHT->nsvEnvironmentTemp); } else { // Simulate all sections at once if not pipe:underground @@ -1210,26 +1158,26 @@ namespace PipeHeatTransfer { // b1 must not be zero but this should have been checked on input for (curnode = 1; curnode <= this->NumSections; ++curnode) { this->TentativeFluidTemp(curnode) = - (A2 * this->TentativeFluidTemp(curnode - 1) + A3 / B1 * (B3 * nsvEnvironmentTemp + B4 * this->PreviousPipeTemp(curnode)) + + (A2 * this->TentativeFluidTemp(curnode - 1) + A3 / B1 * (B3 * state.dataPipeHT->nsvEnvironmentTemp + B4 * this->PreviousPipeTemp(curnode)) + A4 * this->PreviousFluidTemp(curnode)) / (A1 - A3 * B2 / B1); this->TentativePipeTemp(curnode) = - (B2 * this->TentativeFluidTemp(curnode) + B3 * nsvEnvironmentTemp + B4 * this->PreviousPipeTemp(curnode)) / B1; + (B2 * this->TentativeFluidTemp(curnode) + B3 * state.dataPipeHT->nsvEnvironmentTemp + B4 * this->PreviousPipeTemp(curnode)) / B1; // Get exterior surface temperature from energy balance at the surface - Numerator = nsvEnvironmentTemp - this->TentativeFluidTemp(curnode); + Numerator = state.dataPipeHT->nsvEnvironmentTemp - this->TentativeFluidTemp(curnode); Denominator = EnvHeatTransCoef * ((1 / EnvHeatTransCoef) + this->SumTK); - SurfaceTemp = nsvEnvironmentTemp - Numerator / Denominator; + SurfaceTemp = state.dataPipeHT->nsvEnvironmentTemp - Numerator / Denominator; // Keep track of environmental heat loss - nsvEnvHeatLossRate += EnvHeatTransCoef * this->OutsideArea * (SurfaceTemp - nsvEnvironmentTemp); + state.dataPipeHT->nsvEnvHeatLossRate += EnvHeatTransCoef * this->OutsideArea * (SurfaceTemp - state.dataPipeHT->nsvEnvironmentTemp); } } - nsvFluidHeatLossRate = nsvMassFlowRate * this->FluidSpecHeat * (this->TentativeFluidTemp(0) - this->TentativeFluidTemp(this->NumSections)); + state.dataPipeHT->nsvFluidHeatLossRate = state.dataPipeHT->nsvMassFlowRate * this->FluidSpecHeat * (this->TentativeFluidTemp(0) - this->TentativeFluidTemp(this->NumSections)); - nsvOutletTemp = this->TentativeFluidTemp(this->NumSections); + state.dataPipeHT->nsvOutletTemp = this->TentativeFluidTemp(this->NumSections); } //============================================================================== @@ -1296,7 +1244,7 @@ namespace PipeHeatTransfer { static Real64 Cp(0.0); // Placeholder for soil specific heat // There are a number of coefficients which change through the simulation, and they are updated here - this->FourierDS = this->SoilDiffusivity * nsvDeltaTime / pow_2(this->dSregular); // Eq. D4 + this->FourierDS = this->SoilDiffusivity * state.dataPipeHT->nsvDeltaTime / pow_2(this->dSregular); // Eq. D4 this->CoefA1 = this->FourierDS / (1 + 4 * this->FourierDS); // Eq. D2 this->CoefA2 = 1 / (1 + 4 * this->FourierDS); // Eq. D3 @@ -1362,8 +1310,8 @@ namespace PipeHeatTransfer { //-Update Equation, basically a detailed energy balance at the surface this->T(WidthIndex, DepthIndex, LengthIndex, TentativeTimeIndex) = (QSolAbsorbed + RadCoef * state.dataEnvrn->SkyTemp + ConvCoef * state.dataEnvrn->OutDryBulbTemp + (kSoil / dS) * (NodeBelow + 2 * NodeLeft) + - (rho * Cp / nsvDeltaTime) * NodePast) / - (RadCoef + ConvCoef + 3 * (kSoil / dS) + (rho * Cp / nsvDeltaTime)); + (rho * Cp / state.dataPipeHT->nsvDeltaTime) * NodePast) / + (RadCoef + ConvCoef + 3 * (kSoil / dS) + (rho * Cp / state.dataPipeHT->nsvDeltaTime)); } else { // Soil surface, but not on centerline @@ -1375,8 +1323,8 @@ namespace PipeHeatTransfer { //-Update Equation this->T(WidthIndex, DepthIndex, LengthIndex, TentativeTimeIndex) = (QSolAbsorbed + RadCoef * state.dataEnvrn->SkyTemp + ConvCoef * state.dataEnvrn->OutDryBulbTemp + - (kSoil / dS) * (NodeBelow + NodeLeft + NodeRight) + (rho * Cp / nsvDeltaTime) * NodePast) / - (RadCoef + ConvCoef + 3 * (kSoil / dS) + (rho * Cp / nsvDeltaTime)); + (kSoil / dS) * (NodeBelow + NodeLeft + NodeRight) + (rho * Cp / state.dataPipeHT->nsvDeltaTime) * NodePast) / + (RadCoef + ConvCoef + 3 * (kSoil / dS) + (rho * Cp / state.dataPipeHT->nsvDeltaTime)); } // Soil-to-air surface node structure @@ -1447,7 +1395,7 @@ namespace PipeHeatTransfer { //============================================================================== - void PipeHTData::UpdatePipesHeatTransfer() + void PipeHTData::UpdatePipesHeatTransfer(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -1483,30 +1431,30 @@ namespace PipeHeatTransfer { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // only outlet node temp should need updating - Node(nsvOutletNodeNum).Temp = nsvOutletTemp; + Node(state.dataPipeHT->nsvOutletNodeNum).Temp = state.dataPipeHT->nsvOutletTemp; // pass everything else through - Node(nsvOutletNodeNum).TempMin = Node(nsvInletNodeNum).TempMin; - Node(nsvOutletNodeNum).TempMax = Node(nsvInletNodeNum).TempMax; - Node(nsvOutletNodeNum).MassFlowRate = Node(nsvInletNodeNum).MassFlowRate; - Node(nsvOutletNodeNum).MassFlowRateMin = Node(nsvInletNodeNum).MassFlowRateMin; - Node(nsvOutletNodeNum).MassFlowRateMax = Node(nsvInletNodeNum).MassFlowRateMax; - Node(nsvOutletNodeNum).MassFlowRateMinAvail = Node(nsvInletNodeNum).MassFlowRateMinAvail; - Node(nsvOutletNodeNum).MassFlowRateMaxAvail = Node(nsvInletNodeNum).MassFlowRateMaxAvail; - Node(nsvOutletNodeNum).Quality = Node(nsvInletNodeNum).Quality; + Node(state.dataPipeHT->nsvOutletNodeNum).TempMin = Node(state.dataPipeHT->nsvInletNodeNum).TempMin; + Node(state.dataPipeHT->nsvOutletNodeNum).TempMax = Node(state.dataPipeHT->nsvInletNodeNum).TempMax; + Node(state.dataPipeHT->nsvOutletNodeNum).MassFlowRate = Node(state.dataPipeHT->nsvInletNodeNum).MassFlowRate; + Node(state.dataPipeHT->nsvOutletNodeNum).MassFlowRateMin = Node(state.dataPipeHT->nsvInletNodeNum).MassFlowRateMin; + Node(state.dataPipeHT->nsvOutletNodeNum).MassFlowRateMax = Node(state.dataPipeHT->nsvInletNodeNum).MassFlowRateMax; + Node(state.dataPipeHT->nsvOutletNodeNum).MassFlowRateMinAvail = Node(state.dataPipeHT->nsvInletNodeNum).MassFlowRateMinAvail; + Node(state.dataPipeHT->nsvOutletNodeNum).MassFlowRateMaxAvail = Node(state.dataPipeHT->nsvInletNodeNum).MassFlowRateMaxAvail; + Node(state.dataPipeHT->nsvOutletNodeNum).Quality = Node(state.dataPipeHT->nsvInletNodeNum).Quality; // Only pass pressure if we aren't doing a pressure simulation if (PlantLoop(this->LoopNum).PressureSimType > 1) { // Don't do anything } else { - Node(nsvOutletNodeNum).Press = Node(nsvInletNodeNum).Press; + Node(state.dataPipeHT->nsvOutletNodeNum).Press = Node(state.dataPipeHT->nsvInletNodeNum).Press; } - Node(nsvOutletNodeNum).Enthalpy = Node(nsvInletNodeNum).Enthalpy; - Node(nsvOutletNodeNum).HumRat = Node(nsvInletNodeNum).HumRat; + Node(state.dataPipeHT->nsvOutletNodeNum).Enthalpy = Node(state.dataPipeHT->nsvInletNodeNum).Enthalpy; + Node(state.dataPipeHT->nsvOutletNodeNum).HumRat = Node(state.dataPipeHT->nsvInletNodeNum).HumRat; } //============================================================================== - void PipeHTData::ReportPipesHeatTransfer() + void PipeHTData::ReportPipesHeatTransfer(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -1541,23 +1489,23 @@ namespace PipeHeatTransfer { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // update flows and temps from module variables - this->FluidInletTemp = nsvInletTemp; - this->FluidOutletTemp = nsvOutletTemp; - this->MassFlowRate = nsvMassFlowRate; - this->VolumeFlowRate = nsvVolumeFlowRate; + this->FluidInletTemp = state.dataPipeHT->nsvInletTemp; + this->FluidOutletTemp = state.dataPipeHT->nsvOutletTemp; + this->MassFlowRate = state.dataPipeHT->nsvMassFlowRate; + this->VolumeFlowRate = state.dataPipeHT->nsvVolumeFlowRate; // update other variables from module variables - this->FluidHeatLossRate = nsvFluidHeatLossRate; - this->FluidHeatLossEnergy = nsvFluidHeatLossRate * nsvDeltaTime; // DeltaTime is in seconds + this->FluidHeatLossRate = state.dataPipeHT->nsvFluidHeatLossRate; + this->FluidHeatLossEnergy = state.dataPipeHT->nsvFluidHeatLossRate * state.dataPipeHT->nsvDeltaTime; // DeltaTime is in seconds this->PipeInletTemp = this->PipeTemp(1); this->PipeOutletTemp = this->PipeTemp(this->NumSections); // need to average the heat rate because it is now summing over multiple inner time steps - this->EnvironmentHeatLossRate = nsvEnvHeatLossRate / nsvNumInnerTimeSteps; - this->EnvHeatLossEnergy = this->EnvironmentHeatLossRate * nsvDeltaTime; + this->EnvironmentHeatLossRate = state.dataPipeHT->nsvEnvHeatLossRate / state.dataPipeHT->nsvNumInnerTimeSteps; + this->EnvHeatLossEnergy = this->EnvironmentHeatLossRate * state.dataPipeHT->nsvDeltaTime; // for zone heat gains, we assign the averaged heat rate over all inner time steps - if (this->EnvironmentPtr == ZoneEnv) { + if (this->EnvironmentPtr == iEnvrnPtr::ZoneEnv) { this->ZoneHeatGainRate = this->EnvironmentHeatLossRate; } } @@ -1580,15 +1528,15 @@ namespace PipeHeatTransfer { // Sums the heat losses from all of the water heaters in the zone to add as a gain to the zone. // Using/Aliasing - if (nsvNumOfPipeHT == 0) return; + if (state.dataPipeHT->nsvNumOfPipeHT == 0) return; - if (state.dataGlobal->BeginEnvrnFlag && MyEnvrnFlag) { - for (auto &e : PipeHT) + if (state.dataGlobal->BeginEnvrnFlag && state.dataPipeHT->MyEnvrnFlag) { + for (auto &e : state.dataPipeHT->PipeHT) e.ZoneHeatGainRate = 0.0; - MyEnvrnFlag = false; + state.dataPipeHT->MyEnvrnFlag = false; } - if (!state.dataGlobal->BeginEnvrnFlag) MyEnvrnFlag = true; + if (!state.dataGlobal->BeginEnvrnFlag) state.dataPipeHT->MyEnvrnFlag = true; } @@ -1805,11 +1753,11 @@ namespace PipeHeatTransfer { { auto const SELECT_CASE_var1(this->EnvironmentPtr); - if (SELECT_CASE_var1 == ScheduleEnv) { + if (SELECT_CASE_var1 == iEnvrnPtr::ScheduleEnv) { AirTemp = GetCurrentScheduleValue(state, this->EnvrSchedPtr); AirVel = GetCurrentScheduleValue(state, this->EnvrVelSchedPtr); - } else if (SELECT_CASE_var1 == ZoneEnv) { + } else if (SELECT_CASE_var1 == iEnvrnPtr::ZoneEnv) { AirTemp = MAT(this->EnvrZonePtr); AirVel = RoomAirVel; } @@ -1819,7 +1767,7 @@ namespace PipeHeatTransfer { { auto const SELECT_CASE_var1(this->EnvironmentPtr); - if (SELECT_CASE_var1 == OutsideAirEnv) { + if (SELECT_CASE_var1 == iEnvrnPtr::OutsideAirEnv) { AirTemp = Node(this->EnvrAirNodeNum).Temp; AirVel = state.dataEnvrn->WindSpeed; } @@ -1912,6 +1860,4 @@ namespace PipeHeatTransfer { //=============================================================================== -} // namespace PipeHeatTransfer - } // namespace EnergyPlus diff --git a/src/EnergyPlus/PipeHeatTransfer.hh b/src/EnergyPlus/PipeHeatTransfer.hh index 15558ded1cb..dc5ec097fa4 100644 --- a/src/EnergyPlus/PipeHeatTransfer.hh +++ b/src/EnergyPlus/PipeHeatTransfer.hh @@ -76,49 +76,25 @@ namespace PipeHeatTransfer { // Data // MODULE PARAMETER DEFINITIONS - extern int const None; - extern int const ZoneEnv; - extern int const ScheduleEnv; - extern int const OutsideAirEnv; - extern int const GroundEnv; - - extern int const PreviousTimeIndex; - extern int const CurrentTimeIndex; - extern int const TentativeTimeIndex; - - extern Real64 const InnerDeltaTime; // one minute time step in seconds - - // DERIVED TYPE DEFINITIONS - - // the model data structures - - // MODULE VARIABLE DECLARATIONS: - extern int nsvNumOfPipeHT; // Number of Pipe Heat Transfer objects - extern int nsvInletNodeNum; // module variable for inlet node number - extern int nsvOutletNodeNum; // module variable for outlet node number - extern int nsvPipeHTNum; // object index - extern Real64 nsvMassFlowRate; // pipe mass flow rate - extern Real64 nsvVolumeFlowRate; // pipe volumetric flow rate - extern Real64 nsvDeltaTime; // time change from last update - extern Real64 nsvInletTemp; // pipe inlet temperature - extern Real64 nsvOutletTemp; // pipe outlet temperature - extern Real64 nsvEnvironmentTemp; // environmental temperature (surrounding pipe) - extern Real64 nsvEnvHeatLossRate; // heat loss rate from pipe to the environment - extern Real64 nsvFluidHeatLossRate; // overall heat loss from fluid to pipe - extern int nsvNumInnerTimeSteps; // the number of "inner" time steps for our model - - extern bool GetPipeInputFlag; // First time, input is "gotten" + enum class iEnvrnPtr + { + None, + ZoneEnv, + ScheduleEnv, + OutsideAirEnv, + GroundEnv, + }; - // SUBROUTINE SPECIFICATIONS FOR MODULE + constexpr int PreviousTimeIndex(1); + constexpr int CurrentTimeIndex(2); + constexpr int TentativeTimeIndex(3); - // Types + constexpr Real64 InnerDeltaTime(60.0); // one minute time step in seconds struct PipeHTData : public PlantComponent { - virtual ~PipeHTData() - { - } + virtual ~PipeHTData() = default; // Members // Input data @@ -138,7 +114,7 @@ namespace PipeHeatTransfer { int TypeOf; // Type of pipe // derived data int ConstructionNum; // construction ref number - int EnvironmentPtr; + iEnvrnPtr EnvironmentPtr; int EnvrSchedPtr; // pointer to schedule used to set environmental temp int EnvrVelSchedPtr; // pointer to schedule used to set environmental temp int EnvrZonePtr; // pointer to zone number used to set environmental temp @@ -225,7 +201,7 @@ namespace PipeHeatTransfer { // Default Constructor PipeHTData() - : Length(0.0), PipeID(0.0), InletNodeNum(0), OutletNodeNum(0), TypeOf(0), ConstructionNum(0), EnvironmentPtr(0), EnvrSchedPtr(0), + : Length(0.0), PipeID(0.0), InletNodeNum(0), OutletNodeNum(0), TypeOf(0), ConstructionNum(0), EnvironmentPtr(iEnvrnPtr::None), EnvrSchedPtr(0), EnvrVelSchedPtr(0), EnvrZonePtr(0), EnvrAirNodeNum(0), NumSections(0), FluidSpecHeat(0.0), FluidDensity(0.0), MaxFlowRate(0.0), FluidSectionVol(0.0), InsideArea(0.0), OutsideArea(0.0), SectionArea(0.0), PipeHeatCapacity(0.0), PipeOD(0.0), PipeCp(0.0), PipeDensity(0.0), PipeConductivity(0.0), InsulationOD(0.0), InsulationCp(0.0), InsulationDensity(0.0), InsulationConductivity(0.0), @@ -266,9 +242,9 @@ namespace PipeHeatTransfer { Real64 const Diameter // Pipe diameter, m ); - void ReportPipesHeatTransfer(); // Index for the surface under consideration + void ReportPipesHeatTransfer(EnergyPlusData &state); // Index for the surface under consideration - void UpdatePipesHeatTransfer(); + void UpdatePipesHeatTransfer(EnergyPlusData &state); void ValidatePipeConstruction(EnergyPlusData &state, std::string const &PipeType, // module object of pipe (error messages) @@ -281,20 +257,47 @@ namespace PipeHeatTransfer { static void CalcZonePipesHeatGain(EnergyPlusData &state); }; - // Object Data - extern Array1D PipeHT; - - void clear_state(); - void GetPipesHeatTransfer(EnergyPlusData &state); } // namespace PipeHeatTransfer struct PipeHeatTransferData : BaseGlobalStruct { + int nsvNumOfPipeHT = 0; // Number of Pipe Heat Transfer objects + int nsvInletNodeNum = 0; // module variable for inlet node number + int nsvOutletNodeNum = 0; // module variable for outlet node number + Real64 nsvMassFlowRate = 0.0; // pipe mass flow rate + Real64 nsvVolumeFlowRate = 0.0; // pipe volumetric flow rate + Real64 nsvDeltaTime = 0.0; // time change from last update + Real64 nsvInletTemp = 0.0; // pipe inlet temperature + Real64 nsvOutletTemp = 0.0; // pipe outlet temperature + Real64 nsvEnvironmentTemp = 0.0; // environmental temperature (surrounding pipe) + Real64 nsvEnvHeatLossRate = 0.0; // heat loss rate from pipe to the environment + Real64 nsvFluidHeatLossRate = 0.0; // overall heat loss from fluid to pipe + int nsvNumInnerTimeSteps = 0; // the number of "inner" time steps for our model + bool GetPipeInputFlag = true; // First time, input is "gotten" + bool MyEnvrnFlag = true; + Array1D PipeHT; + std::unordered_map PipeHTUniqueNames; + void clear_state() override { - + this->nsvNumOfPipeHT = 0; + this->nsvInletNodeNum = 0; + this->nsvOutletNodeNum = 0; + this->nsvMassFlowRate = 0.0; + this->nsvVolumeFlowRate = 0.0; + this->nsvDeltaTime = 0.0; + this->nsvInletTemp = 0.0; + this->nsvOutletTemp = 0.0; + this->nsvEnvironmentTemp = 0.0; + this->nsvEnvHeatLossRate = 0.0; + this->nsvFluidHeatLossRate = 0.0; + this->nsvNumInnerTimeSteps = 0; + this->GetPipeInputFlag = true; + this->MyEnvrnFlag = true; + this->PipeHT.deallocate(); + this->PipeHTUniqueNames.clear(); } }; diff --git a/src/EnergyPlus/Pipes.cc b/src/EnergyPlus/Pipes.cc index 96d719c9c52..43b3b73698d 100644 --- a/src/EnergyPlus/Pipes.cc +++ b/src/EnergyPlus/Pipes.cc @@ -80,45 +80,13 @@ namespace Pipes { // PURPOSE OF THIS MODULE: // Added steam pipe to the module: RC - // METHODOLOGY EMPLOYED: - // Needs description, as appropriate. - - // REFERENCES: none - - // OTHER NOTES: none - - // USE STATEMENTS: - // Use statements for data only modules // Using/Aliasing using namespace DataHVACGlobals; using namespace DataLoopNode; using DataPlant::TypeOf_Pipe; using DataPlant::TypeOf_PipeSteam; - // Use statements for access to subroutines in other modules - - // Data - // MODULE PARAMETER DEFINITIONS - // na - - // DERIVED TYPE DEFINITIONS - - // MODULE VARIABLE DECLARATIONS: - - // SUBROUTINE SPECIFICATIONS FOR MODULE Pipe - - // Object Data - Array1D LocalPipe; // dimension to number of pipes - std::unordered_map LocalPipeUniqueNames; - - // Functions - void clear_state() - { - LocalPipe.deallocate(); - LocalPipeUniqueNames.clear(); - } - - PlantComponent *LocalPipeData::factory(EnergyPlusData &state, int objectType, std::string objectName) + PlantComponent *LocalPipeData::factory(EnergyPlusData &state, int objectType, std::string const &objectName) { // Process the input data for pipes if it hasn't been done already if (state.dataPipes->GetPipeInputFlag) { @@ -126,7 +94,7 @@ namespace Pipes { state.dataPipes->GetPipeInputFlag = false; } // Now look for this particular pipe in the list - for (auto &pipe : LocalPipe) { + for (auto &pipe : state.dataPipes->LocalPipe) { if (pipe.TypeOf == objectType && pipe.Name == objectName) { return &pipe; } @@ -208,20 +176,20 @@ namespace Pipes { NumWaterPipes = inputProcessor->getNumObjectsFound(state, "Pipe:Adiabatic"); NumSteamPipes = inputProcessor->getNumObjectsFound(state, "Pipe:Adiabatic:Steam"); state.dataPipes->NumLocalPipes = NumWaterPipes + NumSteamPipes; - LocalPipe.allocate(state.dataPipes->NumLocalPipes); - LocalPipeUniqueNames.reserve(static_cast(state.dataPipes->NumLocalPipes)); + state.dataPipes->LocalPipe.allocate(state.dataPipes->NumLocalPipes); + state.dataPipes->LocalPipeUniqueNames.reserve(static_cast(state.dataPipes->NumLocalPipes)); cCurrentModuleObject = "Pipe:Adiabatic"; for (PipeWaterNum = 1; PipeWaterNum <= NumWaterPipes; ++PipeWaterNum) { PipeNum = PipeWaterNum; inputProcessor->getObjectItem(state, cCurrentModuleObject, PipeWaterNum, cAlphaArgs, NumAlphas, rNumericArgs, NumNums, IOStat); - GlobalNames::VerifyUniqueInterObjectName(state, LocalPipeUniqueNames, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - LocalPipe(PipeNum).Name = cAlphaArgs(1); - LocalPipe(PipeNum).TypeOf = TypeOf_Pipe; + GlobalNames::VerifyUniqueInterObjectName(state, state.dataPipes->LocalPipeUniqueNames, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + state.dataPipes->LocalPipe(PipeNum).Name = cAlphaArgs(1); + state.dataPipes->LocalPipe(PipeNum).TypeOf = TypeOf_Pipe; - LocalPipe(PipeNum).InletNodeNum = GetOnlySingleNode(state, + state.dataPipes->LocalPipe(PipeNum).InletNodeNum = GetOnlySingleNode(state, cAlphaArgs(2), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - LocalPipe(PipeNum).OutletNodeNum = GetOnlySingleNode(state, + state.dataPipes->LocalPipe(PipeNum).OutletNodeNum = GetOnlySingleNode(state, cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); TestCompSet(state, cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(2), cAlphaArgs(3), "Pipe Nodes"); } @@ -232,12 +200,12 @@ namespace Pipes { for (PipeSteamNum = 1; PipeSteamNum <= NumSteamPipes; ++PipeSteamNum) { ++PipeNum; inputProcessor->getObjectItem(state, cCurrentModuleObject, PipeSteamNum, cAlphaArgs, NumAlphas, rNumericArgs, NumNums, IOStat); - GlobalNames::VerifyUniqueInterObjectName(state, LocalPipeUniqueNames, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - LocalPipe(PipeNum).Name = cAlphaArgs(1); - LocalPipe(PipeNum).TypeOf = TypeOf_PipeSteam; - LocalPipe(PipeNum).InletNodeNum = GetOnlySingleNode(state, + GlobalNames::VerifyUniqueInterObjectName(state, state.dataPipes->LocalPipeUniqueNames, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); + state.dataPipes->LocalPipe(PipeNum).Name = cAlphaArgs(1); + state.dataPipes->LocalPipe(PipeNum).TypeOf = TypeOf_PipeSteam; + state.dataPipes->LocalPipe(PipeNum).InletNodeNum = GetOnlySingleNode(state, cAlphaArgs(2), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Steam, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - LocalPipe(PipeNum).OutletNodeNum = GetOnlySingleNode(state, + state.dataPipes->LocalPipe(PipeNum).OutletNodeNum = GetOnlySingleNode(state, cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), NodeType_Steam, NodeConnectionType_Outlet, 1, ObjectIsNotParent); TestCompSet(state, cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(2), cAlphaArgs(3), "Pipe Nodes"); } diff --git a/src/EnergyPlus/Pipes.hh b/src/EnergyPlus/Pipes.hh index f345f8f589f..84d992fe7de 100644 --- a/src/EnergyPlus/Pipes.hh +++ b/src/EnergyPlus/Pipes.hh @@ -89,29 +89,25 @@ namespace Pipes { { } - static PlantComponent *factory(EnergyPlusData &state, int objectType, std::string objectName); + static PlantComponent *factory(EnergyPlusData &state, int objectType, std::string const &objectName); void simulate([[maybe_unused]] EnergyPlusData &states, const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) override; }; - // Object Data - extern Array1D LocalPipe; // dimension to number of pipes - - // Functions - void clear_state(); - void GetPipeInput(EnergyPlusData &state); } // namespace Pipes struct PipesData : BaseGlobalStruct { - int NumLocalPipes; - bool GetPipeInputFlag; - - PipesData() : NumLocalPipes(0), GetPipeInputFlag(true) {} + int NumLocalPipes = 0; + bool GetPipeInputFlag = true; + Array1D LocalPipe; + std::unordered_map LocalPipeUniqueNames; void clear_state() override { - NumLocalPipes = 0; - GetPipeInputFlag = true; + this->NumLocalPipes = 0; + this->GetPipeInputFlag = true; + this->LocalPipe.deallocate(); + this->LocalPipeUniqueNames.clear(); } }; diff --git a/src/EnergyPlus/StateManagement.cc b/src/EnergyPlus/StateManagement.cc index 593b4de7207..db5af491a6d 100644 --- a/src/EnergyPlus/StateManagement.cc +++ b/src/EnergyPlus/StateManagement.cc @@ -144,8 +144,6 @@ #include #include #include -#include -#include #include #include #include @@ -271,8 +269,6 @@ void EnergyPlus::clearAllStates(EnergyPlusData &state) PackagedThermalStorageCoil::clear_state(); Photovoltaics::clear_state(); PhotovoltaicThermalCollectors::clear_state(); - Pipes::clear_state(); - PipeHeatTransfer::clear_state(); PlantCentralGSHP::clear_state(); PlantComponentTemperatureSources::clear_state(); PlantCondLoopOperation::clear_state(); diff --git a/tst/EnergyPlus/unit/Pipes.unit.cc b/tst/EnergyPlus/unit/Pipes.unit.cc index ad0f3b6f3b9..2a2231e885f 100644 --- a/tst/EnergyPlus/unit/Pipes.unit.cc +++ b/tst/EnergyPlus/unit/Pipes.unit.cc @@ -73,8 +73,8 @@ TEST_F(EnergyPlusFixture, TestPipesInput) ASSERT_TRUE(process_idf(idf_objects)); Pipes::GetPipeInput(*state); - EXPECT_EQ(2u, Pipes::LocalPipe.size()); - EXPECT_EQ(DataPlant::TypeOf_Pipe, Pipes::LocalPipe(1).TypeOf); - EXPECT_EQ(DataPlant::TypeOf_PipeSteam, Pipes::LocalPipe(2).TypeOf); + EXPECT_EQ(2u, state->dataPipes->LocalPipe.size()); + EXPECT_EQ(DataPlant::TypeOf_Pipe, state->dataPipes->LocalPipe(1).TypeOf); + EXPECT_EQ(DataPlant::TypeOf_PipeSteam, state->dataPipes->LocalPipe(2).TypeOf); } } // namespace EnergyPlus From b45ed19709ac49a093535d567be23f61e4fd4457 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 4 Jan 2021 12:03:17 -0700 Subject: [PATCH 02/17] PascalCase FlowMode and CondenserType; move loading scheme to enum --- src/EnergyPlus/Boilers.cc | 18 +- src/EnergyPlus/Boilers.hh | 2 +- src/EnergyPlus/CMakeLists.txt | 92 ++--- src/EnergyPlus/ChillerAbsorption.cc | 26 +- src/EnergyPlus/ChillerAbsorption.hh | 2 +- src/EnergyPlus/ChillerElectricEIR.cc | 82 ++-- src/EnergyPlus/ChillerElectricEIR.hh | 2 +- src/EnergyPlus/ChillerIndirectAbsorption.cc | 26 +- src/EnergyPlus/ChillerIndirectAbsorption.hh | 2 +- src/EnergyPlus/ChillerReformulatedEIR.cc | 46 +-- src/EnergyPlus/ChillerReformulatedEIR.hh | 4 +- src/EnergyPlus/FaultsManager.cc | 12 +- src/EnergyPlus/OutputReportTabular.cc | 12 +- src/EnergyPlus/Plant/DataPlant.cc | 6 +- src/EnergyPlus/Plant/DataPlant.hh | 22 +- src/EnergyPlus/Plant/Enums.hh | 11 +- src/EnergyPlus/Plant/Loop.hh | 39 +- src/EnergyPlus/Plant/PlantManager.cc | 14 +- src/EnergyPlus/PlantChillers.cc | 354 +++++++++--------- src/EnergyPlus/PlantChillers.hh | 2 +- src/EnergyPlus/PlantCondLoopOperation.cc | 17 +- src/EnergyPlus/StandardRatings.cc | 8 +- tst/EnergyPlus/unit/ChillerAbsorption.unit.cc | 2 +- .../unit/ChillerElectricEIR.unit.cc | 2 +- tst/EnergyPlus/unit/PlantChillers.unit.cc | 4 +- tst/EnergyPlus/unit/StandardRatings.unit.cc | 2 +- 26 files changed, 404 insertions(+), 405 deletions(-) diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index ba0ca994594..a63c511873e 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -327,18 +327,18 @@ namespace EnergyPlus::Boilers { "Hot Water Nodes"); if (DataIPShortCuts::cAlphaArgs(7) == "CONSTANTFLOW") { - thisBoiler.FlowMode = DataPlant::FlowMode::CONSTANT; + thisBoiler.FlowMode = DataPlant::FlowMode::Constant; } else if (DataIPShortCuts::cAlphaArgs(7) == "LEAVINGSETPOINTMODULATED") { - thisBoiler.FlowMode = DataPlant::FlowMode::LEAVINGSETPOINTMODULATED; + thisBoiler.FlowMode = DataPlant::FlowMode::LeavingSetpointModulated; } else if (DataIPShortCuts::cAlphaArgs(7) == "NOTMODULATED") { - thisBoiler.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisBoiler.FlowMode = DataPlant::FlowMode::NotModulated; } else { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(7) + '=' + DataIPShortCuts::cAlphaArgs(7)); ShowContinueError(state, "Available choices are ConstantFlow, NotModulated, or LeavingSetpointModulated"); ShowContinueError(state, "Flow mode NotModulated is assumed and the simulation continues."); // We will assume variable flow if not specified - thisBoiler.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisBoiler.FlowMode = DataPlant::FlowMode::NotModulated; } if (NumAlphas > 7) { @@ -446,7 +446,7 @@ namespace EnergyPlus::Boilers { ShowFatalError(state, "InitBoiler: Program terminated due to previous condition(s)."); } - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || (this->FlowMode == DataPlant::FlowMode::CONSTANT)) { + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (this->FlowMode == DataPlant::FlowMode::Constant)) { // reset flow priority DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; @@ -473,7 +473,7 @@ namespace EnergyPlus::Boilers { this->BranchNum, this->CompNum); - if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { // check if setpoint on outlet node + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // check if setpoint on outlet node if ((DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && (DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPointLo == DataLoopNode::SensedNodeFlagValue)) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { @@ -513,7 +513,7 @@ namespace EnergyPlus::Boilers { // every iteration inits. (most in calc routine) - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) && this->ModulatedFlowSetToLoop) { + if ((this->FlowMode == DataPlant::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. if (DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::SingleSetPoint) { @@ -762,7 +762,7 @@ namespace EnergyPlus::Boilers { if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0) { // Either set the flow to the Constant value or calculate the flow for the variable volume - if ((this->FlowMode == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { // Then find the flow rate and outlet temp this->BoilerMassFlowRate = BoilerMassFlowRateMax; PlantUtilities::SetComponentFlowRate( @@ -775,7 +775,7 @@ namespace EnergyPlus::Boilers { } this->BoilerOutletTemp = BoilerDeltaTemp + DataLoopNode::Node(BoilerInletNode).Temp; - } else if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the boiler outlet setpoint // Then find the flow rate and outlet temp diff --git a/src/EnergyPlus/Boilers.hh b/src/EnergyPlus/Boilers.hh index 131c9299742..1fcd6a0da08 100644 --- a/src/EnergyPlus/Boilers.hh +++ b/src/EnergyPlus/Boilers.hh @@ -141,7 +141,7 @@ namespace Boilers { BoilerSpecs() : FuelType(DataGlobalConstants::ResourceType::None), TypeNum(0), LoopNum(0), LoopSideNum(0), BranchNum(0), CompNum(0), Available(false), ON(false), NomCap(0.0), - NomCapWasAutoSized(false), NomEffic(0.0), TempDesBoilerOut(0.0), FlowMode(DataPlant::FlowMode::NOTSET), ModulatedFlowSetToLoop(false), + NomCapWasAutoSized(false), NomEffic(0.0), TempDesBoilerOut(0.0), FlowMode(DataPlant::FlowMode::Unassigned), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), VolFlowRate(0.0), VolFlowRateWasAutoSized(false), DesMassFlowRate(0.0), MassFlowRate(0.0), SizFac(0.0), BoilerInletNodeNum(0), BoilerOutletNodeNum(0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), OptPartLoadRat(0.0), OperPartLoadRat(0.0), CurveTempMode(TempMode::NOTSET), EfficiencyCurvePtr(0), TempUpLimitBoilerOut(0.0), ParasiticElecLoad(0.0), EffCurveOutputError(0), diff --git a/src/EnergyPlus/CMakeLists.txt b/src/EnergyPlus/CMakeLists.txt index c2ff6a3becd..16b2072854b 100644 --- a/src/EnergyPlus/CMakeLists.txt +++ b/src/EnergyPlus/CMakeLists.txt @@ -34,17 +34,15 @@ if(USE_PSYCH_ERRORS) endif() SET( SRC - StateManagement.cc - StateManagement.hh "${PROJECT_SOURCE_DIR}/third_party/milo/dtoa.h" "${PROJECT_SOURCE_DIR}/third_party/milo/itoa.h" "${PROJECT_SOURCE_DIR}/third_party/milo/diyfp.h" "${PROJECT_SOURCE_DIR}/third_party/milo/ieee754.h" - AirflowNetworkBalanceManager.cc - AirflowNetworkBalanceManager.hh AirLoopHVACDOAS.cc AirLoopHVACDOAS.hh AirTerminalUnit.hh + AirflowNetworkBalanceManager.cc + AirflowNetworkBalanceManager.hh Autosizing/All_Simple_Sizing.cc Autosizing/All_Simple_Sizing.hh Autosizing/Base.cc @@ -69,22 +67,22 @@ SET( SRC Autosizing/CoolingWaterDesAirOutletTempSizing.hh Autosizing/CoolingWaterDesWaterInletTempSizing.cc Autosizing/CoolingWaterDesWaterInletTempSizing.hh - Autosizing/CoolingWaterflowSizing.cc - Autosizing/CoolingWaterflowSizing.hh Autosizing/CoolingWaterNumofTubesPerRowSizing.cc Autosizing/CoolingWaterNumofTubesPerRowSizing.hh + Autosizing/CoolingWaterflowSizing.cc + Autosizing/CoolingWaterflowSizing.hh Autosizing/HeatingAirFlowSizing.cc Autosizing/HeatingAirFlowSizing.hh Autosizing/HeatingAirflowUASizing.cc Autosizing/HeatingAirflowUASizing.hh Autosizing/HeatingCapacitySizing.cc Autosizing/HeatingCapacitySizing.hh - Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc - Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.hh Autosizing/HeatingWaterDesAirInletHumRatSizing.cc Autosizing/HeatingWaterDesAirInletHumRatSizing.hh Autosizing/HeatingWaterDesAirInletTempSizing.cc Autosizing/HeatingWaterDesAirInletTempSizing.hh + Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc + Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.hh Autosizing/HeatingWaterDesCoilWaterVolFlowUsedForUASizing.cc Autosizing/HeatingWaterDesCoilWaterVolFlowUsedForUASizing.hh Autosizing/HeatingWaterflowSizing.cc @@ -125,20 +123,20 @@ SET( SRC ChillerReformulatedEIR.hh Coils/CoilCoolingDX.cc Coils/CoilCoolingDX.hh - Coils/CoilCoolingDXCurveFitPerformance.cc - Coils/CoilCoolingDXCurveFitPerformance.hh Coils/CoilCoolingDXCurveFitOperatingMode.cc Coils/CoilCoolingDXCurveFitOperatingMode.hh + Coils/CoilCoolingDXCurveFitPerformance.cc + Coils/CoilCoolingDXCurveFitPerformance.hh Coils/CoilCoolingDXCurveFitSpeed.cc Coils/CoilCoolingDXCurveFitSpeed.hh CondenserLoopTowers.cc CondenserLoopTowers.hh ConfiguredFunctions.hh "${CMAKE_CURRENT_BINARY_DIR}/ConfiguredFunctions.cc" - ConvectionCoefficients.cc - ConvectionCoefficients.hh Construction.cc Construction.hh + ConvectionCoefficients.cc + ConvectionCoefficients.hh CoolTower.cc CoolTower.hh CostEstimateManager.cc @@ -268,8 +266,8 @@ SET( SRC EconomicTariff.hh ElectricBaseboardRadiator.cc ElectricBaseboardRadiator.hh - ElectricPowerServiceManager.hh ElectricPowerServiceManager.cc + ElectricPowerServiceManager.hh EnergyPlus.hh EvaporativeCoolers.cc EvaporativeCoolers.hh @@ -360,8 +358,6 @@ SET( SRC HWBaseboardRadiator.hh HeatBalFiniteDiffManager.cc HeatBalFiniteDiffManager.hh - HeatBalanceKivaManager.cc - HeatBalanceKivaManager.hh HeatBalanceAirManager.cc HeatBalanceAirManager.hh HeatBalanceHAMTManager.cc @@ -370,6 +366,8 @@ SET( SRC HeatBalanceIntRadExchange.hh HeatBalanceInternalHeatGains.cc HeatBalanceInternalHeatGains.hh + HeatBalanceKivaManager.cc + HeatBalanceKivaManager.hh HeatBalanceManager.cc HeatBalanceManager.hh HeatBalanceMovableInsulation.cc @@ -390,12 +388,12 @@ SET( SRC HighTempRadiantSystem.hh Humidifiers.cc Humidifiers.hh - HybridUnitaryAirConditioners.cc - HybridUnitaryAirConditioners.hh HybridEvapCoolingModel.cc HybridEvapCoolingModel.hh HybridModel.cc HybridModel.hh + HybridUnitaryAirConditioners.cc + HybridUnitaryAirConditioners.hh ICEngineElectricGenerator.cc ICEngineElectricGenerator.hh IceThermalStorage.cc @@ -403,6 +401,8 @@ SET( SRC InputProcessing/DataStorage.hh InputProcessing/EmbeddedEpJSONSchema.hh "${CMAKE_CURRENT_BINARY_DIR}/EmbeddedEpJSONSchema.cc" + IOFiles.cc + IOFiles.hh InputProcessing/IdfParser.cc InputProcessing/IdfParser.hh InputProcessing/InputProcessor.cc @@ -438,10 +438,10 @@ SET( SRC OutAirNodeManager.hh OutdoorAirUnit.cc OutdoorAirUnit.hh - IOFiles.cc - IOFiles.hh OutputProcessor.cc OutputProcessor.hh + OutputReportData.cc + OutputReportData.hh OutputReportPredefined.cc OutputReportPredefined.hh OutputReportTabular.cc @@ -450,10 +450,12 @@ SET( SRC OutputReportTabularAnnual.hh OutputReports.cc OutputReports.hh - OutputReportData.cc - OutputReportData.hh OutsideEnergySources.cc OutsideEnergySources.hh + PVWatts.cc + PVWatts.hh + PVWattsSSC.cc + PVWattsSSC.hh PackagedTerminalHeatPump.cc PackagedTerminalHeatPump.hh PackagedThermalStorageCoil.cc @@ -469,29 +471,32 @@ SET( SRC PipeHeatTransfer.hh Pipes.cc Pipes.hh - Plant/CallingOrder.hh - Plant/DataPlant.cc - Plant/DataPlant.hh - Plant/Enums.hh - Plant/EquipAndOperations.hh - Plant/LoopSidePumpInformation.hh - Plant/PlantAvailManager.hh - Plant/PlantConvergencePoint.hh - Plant/MeterData.hh - Plant/ReportBranchData.hh - Plant/ReportCompData.hh - Plant/ReportLoopData.hh Plant/Branch.cc Plant/Branch.hh + Plant/CallingOrder.hh Plant/Component.cc Plant/Component.hh Plant/ConnectedLoopData.hh Plant/Connection.hh + Plant/DataPlant.cc + Plant/DataPlant.hh + Plant/Enums.hh + Plant/EquipAndOperations.hh Plant/Loop.cc Plant/Loop.hh Plant/LoopSide.cc Plant/LoopSide.hh + Plant/LoopSidePumpInformation.hh + Plant/MeterData.hh Plant/MixerData.hh + Plant/PlantAvailManager.hh + Plant/PlantConvergencePoint.hh + Plant/PlantLocation.hh + Plant/PlantManager.cc + Plant/PlantManager.hh + Plant/ReportBranchData.hh + Plant/ReportCompData.hh + Plant/ReportLoopData.hh Plant/SplitterData.hh Plant/Subcomponents.hh PlantCentralGSHP.cc @@ -509,9 +514,6 @@ SET( SRC PlantLoadProfile.hh PlantLoopHeatPumpEIR.cc PlantLoopHeatPumpEIR.hh - Plant/PlantLocation.hh - Plant/PlantManager.cc - Plant/PlantManager.hh PlantPipingSystemsManager.cc PlantPipingSystemsManager.hh PlantPressureSystem.cc @@ -535,10 +537,6 @@ SET( SRC Pumps.hh PurchasedAirManager.cc PurchasedAirManager.hh - PVWatts.cc - PVWatts.hh - PVWattsSSC.cc - PVWattsSSC.hh RefrigeratedCase.cc RefrigeratedCase.hh ReportCoilSelection.cc @@ -559,6 +557,8 @@ SET( SRC RuntimeLanguageProcessor.hh SQLiteProcedures.cc SQLiteProcedures.hh + SZVAVModel.cc + SZVAVModel.hh ScheduleManager.cc ScheduleManager.hh SetPointManager.cc @@ -586,6 +586,8 @@ SET( SRC SplitterComponent.hh StandardRatings.cc StandardRatings.hh + StateManagement.cc + StateManagement.hh SteamBaseboardRadiator.cc SteamBaseboardRadiator.hh SteamCoils.cc @@ -603,8 +605,6 @@ SET( SRC SystemAvailabilityManager.hh SystemReports.cc SystemReports.hh - SZVAVModel.cc - SZVAVModel.hh TARCOGArgs.cc TARCOGArgs.hh TARCOGCommon.cc @@ -638,12 +638,12 @@ SET( SRC TranspiredCollector.hh UFADManager.cc UFADManager.hh - UnitarySystem.cc - UnitarySystem.hh UnitHeater.cc UnitHeater.hh UnitVentilator.cc UnitVentilator.hh + UnitarySystem.cc + UnitarySystem.hh UserDefinedComponents.cc UserDefinedComponents.hh UtilityRoutines.cc @@ -681,10 +681,10 @@ SET( SRC WindowManager.hh WindowManagerExteriorData.cc WindowManagerExteriorData.hh - WindowManagerExteriorThermal.cc - WindowManagerExteriorThermal.hh WindowManagerExteriorOptical.cc WindowManagerExteriorOptical.hh + WindowManagerExteriorThermal.cc + WindowManagerExteriorThermal.hh WindowModel.cc WindowModel.hh ZoneAirLoopEquipmentManager.cc diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index b8b1acfb543..31d7788a47d 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -435,17 +435,17 @@ namespace EnergyPlus::ChillerAbsorption { { auto const SELECT_CASE_var(DataIPShortCuts::cAlphaArgs(8)); if (SELECT_CASE_var == "CONSTANTFLOW") { - thisChiller.FlowMode = DataPlant::FlowMode::CONSTANT; + thisChiller.FlowMode = DataPlant::FlowMode::Constant; } else if (SELECT_CASE_var == "LEAVINGSETPOINTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::LEAVINGSETPOINTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::LeavingSetpointModulated; } else if (SELECT_CASE_var == "NOTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } else { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(8) + '=' + DataIPShortCuts::cAlphaArgs(8)); ShowContinueError(state, "Available choices are ConstantFlow, NotModulated, or LeavingSetpointModulated"); ShowContinueError(state, "Flow mode NotModulated is assumed and the simulation continues."); - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } } @@ -666,12 +666,12 @@ namespace EnergyPlus::ChillerAbsorption { ShowFatalError(state, "InitBLASTAbsorberModel: Program terminated due to previous condition(s)."); } - if (this->FlowMode == DataPlant::FlowMode::CONSTANT) { + if (this->FlowMode == DataPlant::FlowMode::Constant) { DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } - if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; @@ -806,7 +806,7 @@ namespace EnergyPlus::ChillerAbsorption { // every time inits - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) && this->ModulatedFlowSetToLoop) { + if ((this->FlowMode == DataPlant::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(this->EvapOutletNodeNum).TempSetPoint = @@ -1413,7 +1413,7 @@ namespace EnergyPlus::ChillerAbsorption { this->QEvaporator = min(this->QEvaporator, (this->MaxPartLoadRat * this->NomCap)); // Either set the flow to the Constant value or caluclate the flow for the variable volume - if ((this->FlowMode == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; if (this->EvapMassFlowRate != 0.0) { @@ -1423,7 +1423,7 @@ namespace EnergyPlus::ChillerAbsorption { } this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; - } else if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); @@ -1473,7 +1473,7 @@ namespace EnergyPlus::ChillerAbsorption { (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = this->FaultyChillerSWTIndex; - bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED); + bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated); FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, this->FaultyChillerSWTOffset, @@ -1501,7 +1501,7 @@ namespace EnergyPlus::ChillerAbsorption { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -1513,7 +1513,7 @@ namespace EnergyPlus::ChillerAbsorption { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -1650,7 +1650,7 @@ namespace EnergyPlus::ChillerAbsorption { DataPlant::PlantLoop(GenLoopSideNum).FluidIndex, RoutineName); if (DataPlant::PlantLoop(this->GenLoopNum).LoopSide(this->GenLoopSideNum).FlowLock == 0) { - if ((this->FlowMode == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { GenMassFlowRate = this->GenMassFlowRateMax; } else { // LeavingSetpointModulated // since the .FlowMode applies to the chiller evaporator, the generater mass flow rate will be proportional to the evaporator diff --git a/src/EnergyPlus/ChillerAbsorption.hh b/src/EnergyPlus/ChillerAbsorption.hh index 2d71458e4dc..22f6180a091 100644 --- a/src/EnergyPlus/ChillerAbsorption.hh +++ b/src/EnergyPlus/ChillerAbsorption.hh @@ -179,7 +179,7 @@ namespace ChillerAbsorption { // Default Constructor BLASTAbsorberSpecs() : Available(false), ON(false), NomCap(0.0), NomCapWasAutoSized(false), NomPumpPower(0.0), NomPumpPowerWasAutoSized(false), - FlowMode(DataPlant::FlowMode::NOTSET), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), EvapVolFlowRate(0.0), + FlowMode(DataPlant::FlowMode::Unassigned), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), EvapVolFlowRate(0.0), EvapVolFlowRateWasAutoSized(false), CondVolFlowRate(0.0), CondVolFlowRateWasAutoSized(false), EvapMassFlowRateMax(0.0), CondMassFlowRateMax(0.0), GenMassFlowRateMax(0.0), SizFac(0.0), EvapInletNodeNum(0), EvapOutletNodeNum(0), CondInletNodeNum(0), CondOutletNodeNum(0), GeneratorInletNodeNum(0), GeneratorOutletNodeNum(0), MinPartLoadRat(0.0), MaxPartLoadRat(0.0), diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 13f9ee8363f..3822afeba68 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -311,11 +311,11 @@ namespace ChillerElectricEIR { "Chilled Water Nodes"); if (UtilityRoutines::SameString(DataIPShortCuts::cAlphaArgs(9), "WaterCooled")) { - thisChiller.CondenserType = DataPlant::CondenserType::WATERCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::WaterCooled; } else if (UtilityRoutines::SameString(DataIPShortCuts::cAlphaArgs(9), "AirCooled")) { - thisChiller.CondenserType = DataPlant::CondenserType::AIRCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::AirCooled; } else if (UtilityRoutines::SameString(DataIPShortCuts::cAlphaArgs(9), "EvaporativelyCooled")) { - thisChiller.CondenserType = DataPlant::CondenserType::EVAPCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::EvapCooled; } else { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + ": " + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(9) + '=' + DataIPShortCuts::cAlphaArgs(9)); @@ -323,7 +323,7 @@ namespace ChillerElectricEIR { ErrorsFound = true; } - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { // Connection not required for air or evap cooled condenser // If the condenser inlet is blank for air cooled and evap cooled condensers then supply a generic name // since it is not used elsewhere for connection @@ -367,7 +367,7 @@ namespace ChillerElectricEIR { 2, DataLoopNode::ObjectIsNotParent); - } else if (thisChiller.CondenserType == DataPlant::CondenserType::WATERCOOLED) { + } else if (thisChiller.CondenserType == DataPlant::CondenserType::WaterCooled) { // Condenser inlet node name is necessary for water-cooled condenser if (DataIPShortCuts::lAlphaFieldBlanks(7) || DataIPShortCuts::lAlphaFieldBlanks(8)) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); @@ -434,17 +434,17 @@ namespace ChillerElectricEIR { { auto const SELECT_CASE_var(DataIPShortCuts::cAlphaArgs(10)); if (SELECT_CASE_var == "CONSTANTFLOW") { - thisChiller.FlowMode = DataPlant::FlowMode::CONSTANT; + thisChiller.FlowMode = DataPlant::FlowMode::Constant; } else if (SELECT_CASE_var == "LEAVINGSETPOINTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::LEAVINGSETPOINTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::LeavingSetpointModulated; } else if (SELECT_CASE_var == "NOTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } else { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(10) + '=' + DataIPShortCuts::cAlphaArgs(10)); ShowContinueError(state, "Available choices are ConstantFlow, NotModulated, or LeavingSetpointModulated"); ShowContinueError(state, "Flow mode NotModulated is assumed and the simulation continues."); - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } } @@ -564,7 +564,7 @@ namespace ChillerElectricEIR { ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(12) + '=' + DataIPShortCuts::cAlphaArgs(12)); ErrorsFound = true; } - if (thisChiller.CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (thisChiller.CondenserType != DataPlant::CondenserType::WaterCooled) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError(state, "Heat Recovery requires a Water Cooled Condenser."); ErrorsFound = true; @@ -806,7 +806,7 @@ namespace ChillerElectricEIR { "Chiller EIR Part Load Modifier Multiplier", OutputProcessor::Unit::None, this->ChillerEIRFPLR, "System", "Average", this->Name); // Condenser mass flow and outlet temp are valid for water cooled - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { SetupOutputVariable(state, "Chiller Condenser Inlet Temperature", OutputProcessor::Unit::C, this->CondInletTemp, "System", "Average", this->Name); @@ -870,7 +870,7 @@ namespace ChillerElectricEIR { _, "Plant"); } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { SetupOutputVariable(state, "Chiller Evaporative Condenser Water Volume", OutputProcessor::Unit::m3, this->EvapWaterConsump, @@ -955,7 +955,7 @@ namespace ChillerElectricEIR { _, this->EvapInletNodeNum, _); - if (this->CondenserType != DataPlant::CondenserType::AIRCOOLED && this->CondenserType != DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, DataPlant::TypeOf_Chiller_ElectricEIR, @@ -990,7 +990,7 @@ namespace ChillerElectricEIR { this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricEIR, true); } - if (this->CondenserType != DataPlant::CondenserType::AIRCOOLED && this->CondenserType != DataPlant::CondenserType::EVAPCOOLED && this->HeatRecActive) { + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { PlantUtilities::InterConnectTwoPlantLoopSides( this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricEIR, false); } @@ -999,13 +999,13 @@ namespace ChillerElectricEIR { ShowFatalError(state, "InitElectricEIRChiller: Program terminated due to previous condition(s)."); } - if (this->FlowMode == DataPlant::FlowMode::CONSTANT) { + if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } - if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; @@ -1068,7 +1068,7 @@ namespace ChillerElectricEIR { this->CWBranchNum, this->CWCompNum); - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, @@ -1170,7 +1170,7 @@ namespace ChillerElectricEIR { this->MyEnvrnFlag = true; } - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) && this->ModulatedFlowSetToLoop) { + if ((this->FlowMode == DataPlant::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(this->EvapOutletNodeNum).TempSetPoint = @@ -1192,7 +1192,7 @@ namespace ChillerElectricEIR { PlantUtilities::SetComponentFlowRate(state, mdot, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum); - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PlantUtilities::SetComponentFlowRate(state, mdotCond, this->CondInletNodeNum, this->CondOutletNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); } @@ -1212,7 +1212,7 @@ namespace ChillerElectricEIR { mdot, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum, LoopNum, LoopSideNum, BranchIndex, CompIndex); } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = 0.0; } } @@ -1243,7 +1243,7 @@ namespace ChillerElectricEIR { Real64 tmpEvapVolFlowRate = this->EvapVolFlowRate; Real64 tmpCondVolFlowRate = this->CondVolFlowRate; - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; } @@ -1430,7 +1430,7 @@ namespace ChillerElectricEIR { } } } else { - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { if (this->CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Electric EIR Chiller condenser fluid flow rate requires a condenser"); @@ -1621,13 +1621,13 @@ namespace ChillerElectricEIR { DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 1) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; } } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -1638,7 +1638,7 @@ namespace ChillerElectricEIR { // initialize outlet air humidity ratio of air or evap cooled chillers this->CondOutletHumRat = DataLoopNode::Node(this->CondInletNodeNum).HumRat; - if (this->CondenserType == DataPlant::CondenserType::AIRCOOLED) { // Condenser inlet temp = outdoor temp + if (this->CondenserType == DataPlant::CondenserType::AirCooled) { // Condenser inlet temp = outdoor temp DataLoopNode::Node(this->CondInletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).OutAirDryBulb; // Warn user if entering condenser dry-bulb temperature falls below 0 C @@ -1657,7 +1657,7 @@ namespace ChillerElectricEIR { } else { this->PrintMessage = false; } - } else if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { // Condenser inlet temp = (outdoor wet bulb) + } else if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { // Condenser inlet temp = (outdoor wet bulb) DataLoopNode::Node(this->CondInletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).OutAirWetBulb; // line above assumes evaporation pushes condenser inlet air humidity ratio to saturation this->CondOutletHumRat = Psychrometrics::PsyWFnTdbTwbPb(state, DataLoopNode::Node(this->CondInletNodeNum).Temp, @@ -1704,7 +1704,7 @@ namespace ChillerElectricEIR { } // Set mass flow rates - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { this->CondMassFlowRate = this->CondMassFlowRateMax; PlantUtilities::SetComponentFlowRate(state, this->CondMassFlowRate, this->CondInletNodeNum, @@ -1741,7 +1741,7 @@ namespace ChillerElectricEIR { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -1754,7 +1754,7 @@ namespace ChillerElectricEIR { EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -1883,7 +1883,7 @@ namespace ChillerElectricEIR { this->QEvaporator = AvailChillerCap * PartLoadRat; // Either set the flow to the Constant value or calculate the flow for the variable volume - if ((this->FlowMode == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { // Set the evaporator mass flow rate to design // Start by assuming max (design) flow this->EvapMassFlowRate = this->EvapMassFlowRateMax; @@ -1903,7 +1903,7 @@ namespace ChillerElectricEIR { // Evaluate outlet temp based on delta this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; - } else if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { @@ -1976,7 +1976,7 @@ namespace ChillerElectricEIR { if (this->EvapMassFlowRate == 0.0) { MyLoad = 0.0; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -2033,7 +2033,7 @@ namespace ChillerElectricEIR { (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = this->FaultyChillerSWTIndex; - bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED); + bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated); FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, this->FaultyChillerSWTOffset, @@ -2088,7 +2088,7 @@ namespace ChillerElectricEIR { if (this->ChillerFalseLoadRate < DataHVACGlobals::SmallLoad) { this->ChillerFalseLoadRate = 0.0; } - if (this->QEvaporator == 0.0 && this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->QEvaporator == 0.0 && this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -2140,7 +2140,7 @@ namespace ChillerElectricEIR { this->QCondenser = this->Power * this->CompPowerToCondenserFrac + this->QEvaporator + this->ChillerFalseLoadRate; - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { 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(state, this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovered); @@ -2174,7 +2174,7 @@ namespace ChillerElectricEIR { this->CondOutletTemp = condInletTemp; } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { Real64 const RhoWater = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp); // CondMassFlowRate is already multiplied by PLR, convert to water use rate this->EvapWaterConsumpRate = @@ -2286,7 +2286,7 @@ namespace ChillerElectricEIR { // Set node conditions DataLoopNode::Node(this->EvapOutletNodeNum).Temp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; DataLoopNode::Node(this->CondOutletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).Temp; - if (this->CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::WaterCooled) { DataLoopNode::Node(this->CondOutletNodeNum).HumRat = DataLoopNode::Node(this->CondInletNodeNum).HumRat; DataLoopNode::Node(this->CondOutletNodeNum).Enthalpy = DataLoopNode::Node(this->CondInletNodeNum).Enthalpy; DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate = 0.0; @@ -2310,7 +2310,7 @@ namespace ChillerElectricEIR { this->ActualCOP = 0.0; this->CondenserFanPower = 0.0; this->CondenserFanEnergyConsumption = 0.0; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; this->EvapWaterConsump = 0.0; } @@ -2332,7 +2332,7 @@ namespace ChillerElectricEIR { this->EvapMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { DataLoopNode::Node(this->EvapOutletNodeNum).Temp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; DataLoopNode::Node(this->CondOutletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).Temp; - if (this->CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::WaterCooled) { DataLoopNode::Node(this->CondOutletNodeNum).HumRat = DataLoopNode::Node(this->CondInletNodeNum).HumRat; DataLoopNode::Node(this->CondOutletNodeNum).Enthalpy = DataLoopNode::Node(this->CondInletNodeNum).Enthalpy; DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate = 0.0; @@ -2341,7 +2341,7 @@ namespace ChillerElectricEIR { } else { DataLoopNode::Node(this->EvapOutletNodeNum).Temp = this->EvapOutletTemp; DataLoopNode::Node(this->CondOutletNodeNum).Temp = this->CondOutletTemp; - if (this->CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::WaterCooled) { DataLoopNode::Node(this->CondOutletNodeNum).HumRat = this->CondOutletHumRat; DataLoopNode::Node(this->CondOutletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(this->CondOutletTemp, this->CondOutletHumRat); DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate = this->CondMassFlowRate; @@ -2365,7 +2365,7 @@ namespace ChillerElectricEIR { } else { this->ActualCOP = 0.0; } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; this->EvapWaterConsump = this->EvapWaterConsumpRate * ReportingConstant; } diff --git a/src/EnergyPlus/ChillerElectricEIR.hh b/src/EnergyPlus/ChillerElectricEIR.hh index ee03cdf36b0..ef68c25dfad 100644 --- a/src/EnergyPlus/ChillerElectricEIR.hh +++ b/src/EnergyPlus/ChillerElectricEIR.hh @@ -200,7 +200,7 @@ namespace ChillerElectricEIR { // Default Constructor ElectricEIRChillerSpecs() - : TypeNum(0), CondenserType(DataPlant::CondenserType::NOTSET), RefCap(0.0), RefCapWasAutoSized(false), RefCOP(0.0), FlowMode(DataPlant::FlowMode::NOTSET), + : TypeNum(0), CondenserType(DataPlant::CondenserType::Unassigned), RefCap(0.0), RefCapWasAutoSized(false), RefCOP(0.0), FlowMode(DataPlant::FlowMode::Unassigned), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), HRSPErrDone(false), EvapVolFlowRate(0.0), EvapVolFlowRateWasAutoSized(false), EvapMassFlowRate(0.0), EvapMassFlowRateMax(0.0), CondVolFlowRate(0.0), CondVolFlowRateWasAutoSized(false), CondMassFlowRate(0.0), CondMassFlowRateMax(0.0), CondenserFanPowerRatio(0.0), diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index 3ce51c08fa9..160766700bf 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -430,17 +430,17 @@ namespace ChillerIndirectAbsorption { { auto const SELECT_CASE_var(DataIPShortCuts::cAlphaArgs(6)); if (SELECT_CASE_var == "CONSTANTFLOW") { - thisChiller.FlowMode = DataPlant::FlowMode::CONSTANT; + thisChiller.FlowMode = DataPlant::FlowMode::Constant; } else if (SELECT_CASE_var == "LEAVINGSETPOINTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::LEAVINGSETPOINTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::LeavingSetpointModulated; } else if (SELECT_CASE_var == "NOTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } else { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(6) + '=' + DataIPShortCuts::cAlphaArgs(6)); ShowContinueError(state, "Available choices are ConstantFlow, NotModulated, or LeavingSetpointModulated"); ShowContinueError(state, "Flow mode NotModulated is assumed and the simulation continues."); - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } } @@ -759,13 +759,13 @@ namespace ChillerIndirectAbsorption { ShowFatalError(state, "InitIndirectAbsorpChiller: Program terminated due to previous condition(s)."); } - if (this->FlowMode == DataPlant::FlowMode::CONSTANT) { + if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } - if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; @@ -886,7 +886,7 @@ namespace ChillerIndirectAbsorption { this->MyEnvrnFlag = true; } - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) && this->ModulatedFlowSetToLoop) { + if ((this->FlowMode == DataPlant::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(this->EvapOutletNodeNum).TempSetPoint = @@ -1659,7 +1659,7 @@ namespace ChillerIndirectAbsorption { this->QEvaporator = std::abs(MyLoad); // Either set the flow to the Constant value or caluclate the flow for the variable volume - if ((this->FlowMode == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; if (this->EvapMassFlowRate != 0.0) { @@ -1669,7 +1669,7 @@ namespace ChillerIndirectAbsorption { } this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; - } else if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); @@ -1718,7 +1718,7 @@ namespace ChillerIndirectAbsorption { (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = this->FaultyChillerSWTIndex; - bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED); + bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated); FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, this->FaultyChillerSWTOffset, @@ -1744,7 +1744,7 @@ namespace ChillerIndirectAbsorption { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -1756,7 +1756,7 @@ namespace ChillerIndirectAbsorption { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -1918,7 +1918,7 @@ namespace ChillerIndirectAbsorption { DataLoopNode::Node(this->GeneratorInletNodeNum).Temp, DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); - if ((this->FlowMode == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { this->GenMassFlowRate = this->GenMassFlowRateMax; } else { this->GenMassFlowRate = this->QGenerator / CpFluid / this->GeneratorDeltaTemp; diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.hh b/src/EnergyPlus/ChillerIndirectAbsorption.hh index 3ecc6e86023..bb7797d9158 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.hh +++ b/src/EnergyPlus/ChillerIndirectAbsorption.hh @@ -202,7 +202,7 @@ namespace ChillerIndirectAbsorption { GeneratorDeltaTempWasAutoSized(true), SizFac(0.0), EvapInletNodeNum(0), EvapOutletNodeNum(0), CondInletNodeNum(0), CondOutletNodeNum(0), GeneratorInletNodeNum(0), GeneratorOutletNodeNum(0), GeneratorInputCurvePtr(0), PumpPowerCurvePtr(0), CapFCondenserTempPtr(0), CapFEvaporatorTempPtr(0), CapFGeneratorTempPtr(0), HeatInputFCondTempPtr(0), HeatInputFEvapTempPtr(0), ErrCount2(0), - GenHeatSourceType(0), SteamFluidIndex(0), Available(false), ON(false), FlowMode(DataPlant::FlowMode::NOTSET), ModulatedFlowSetToLoop(false), + GenHeatSourceType(0), SteamFluidIndex(0), Available(false), ON(false), FlowMode(DataPlant::FlowMode::Unassigned), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), MinCondInletTempCtr(0), MinCondInletTempIndex(0), MinGenInletTempCtr(0), MinGenInletTempIndex(0), CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), CDLoopNum(0), CDLoopSideNum(0), CDBranchNum(0), CDCompNum(0), GenLoopNum(0), GenLoopSideNum(0), GenBranchNum(0), GenCompNum(0), FaultyChillerSWTFlag(false), FaultyChillerSWTIndex(0), diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index fd5089baddd..f837bb0e5d3 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -348,7 +348,7 @@ namespace ChillerReformulatedEIR { DataIPShortCuts::cAlphaArgs(7), "Chilled Water Nodes"); - thisChiller.CondenserType = DataPlant::CondenserType::WATERCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::WaterCooled; // Condenser inlet/outlet node names are necessary if (DataIPShortCuts::lAlphaFieldBlanks(8)) { @@ -388,17 +388,17 @@ namespace ChillerReformulatedEIR { { auto const SELECT_CASE_var(DataIPShortCuts::cAlphaArgs(10)); if (SELECT_CASE_var == "CONSTANTFLOW") { - thisChiller.FlowMode = DataPlant::FlowMode::CONSTANT; + thisChiller.FlowMode = DataPlant::FlowMode::Constant; } else if (SELECT_CASE_var == "LEAVINGSETPOINTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::LEAVINGSETPOINTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::LeavingSetpointModulated; } else if (SELECT_CASE_var == "NOTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } else { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(10) + '=' + DataIPShortCuts::cAlphaArgs(10)); ShowContinueError(state, "Available choices are ConstantFlow, NotModulated, or LeavingSetpointModulated"); ShowContinueError(state, "Flow mode NotModulated is assumed and the simulation continues."); - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } } @@ -531,7 +531,7 @@ namespace ChillerReformulatedEIR { ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(12) + '=' + DataIPShortCuts::cAlphaArgs(12)); ErrorsFound = true; } - if (thisChiller.CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (thisChiller.CondenserType != DataPlant::CondenserType::WaterCooled) { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\""); ShowContinueError(state, "Heat Recovery requires a Water Cooled Condenser."); ErrorsFound = true; @@ -763,7 +763,7 @@ namespace ChillerReformulatedEIR { _, this->EvapInletNodeNum, _); - if (this->CondenserType != DataPlant::CondenserType::AIRCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::AirCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, DataPlant::TypeOf_Chiller_ElectricReformEIR, @@ -798,7 +798,7 @@ namespace ChillerReformulatedEIR { this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, true); } - if ((this->CondenserType != DataPlant::CondenserType::AIRCOOLED) && (this->HeatRecActive)) { + if ((this->CondenserType != DataPlant::CondenserType::AirCooled) && (this->HeatRecActive)) { PlantUtilities::InterConnectTwoPlantLoopSides( this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, false); } @@ -807,13 +807,13 @@ namespace ChillerReformulatedEIR { ShowFatalError(state, "InitElecReformEIRChiller: Program terminated due to previous condition(s)."); } - if (this->FlowMode == DataPlant::FlowMode::CONSTANT) { + if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } - if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; @@ -877,7 +877,7 @@ namespace ChillerReformulatedEIR { this->CWBranchNum, this->CWCompNum); - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, @@ -934,7 +934,7 @@ namespace ChillerReformulatedEIR { this->MyEnvrnFlag = true; } - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) && this->ModulatedFlowSetToLoop) { + if ((this->FlowMode == DataPlant::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(this->EvapOutletNodeNum).TempSetPoint = @@ -956,7 +956,7 @@ namespace ChillerReformulatedEIR { PlantUtilities::SetComponentFlowRate(state, mdot, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum); - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PlantUtilities::SetComponentFlowRate(state, mdotCond, this->CondInletNodeNum, this->CondOutletNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); } @@ -1019,7 +1019,7 @@ namespace ChillerReformulatedEIR { Real64 tmpCondVolFlowRate = this->CondVolFlowRate; int PltSizCondNum(0); // Plant Sizing index for condenser loop - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; } @@ -1854,7 +1854,7 @@ namespace ChillerReformulatedEIR { DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; @@ -1890,7 +1890,7 @@ namespace ChillerReformulatedEIR { // Set mass flow rates - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { this->CondMassFlowRate = this->CondMassFlowRateMax; PlantUtilities::SetComponentFlowRate(state, this->CondMassFlowRate, this->CondInletNodeNum, @@ -1916,7 +1916,7 @@ namespace ChillerReformulatedEIR { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { @@ -1926,7 +1926,7 @@ namespace ChillerReformulatedEIR { EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { @@ -2024,7 +2024,7 @@ namespace ChillerReformulatedEIR { 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 == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { // Set the evaporator mass flow rate to design // Start by assuming max (design) flow this->EvapMassFlowRate = this->EvapMassFlowRateMax; @@ -2042,7 +2042,7 @@ namespace ChillerReformulatedEIR { EvapDeltaTemp = 0.0; } this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; - } else if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { @@ -2116,7 +2116,7 @@ namespace ChillerReformulatedEIR { (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = this->FaultyChillerSWTIndex; - bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED); + bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated); FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, this->FaultyChillerSWTOffset, @@ -2525,7 +2525,7 @@ namespace ChillerReformulatedEIR { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { @@ -2535,7 +2535,7 @@ namespace ChillerReformulatedEIR { EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { diff --git a/src/EnergyPlus/ChillerReformulatedEIR.hh b/src/EnergyPlus/ChillerReformulatedEIR.hh index a85ebb47a35..29c7c017bb9 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -221,8 +221,8 @@ namespace ChillerReformulatedEIR { // Default Constructor ReformulatedEIRChillerSpecs() - : TypeNum(0), CondenserType(DataPlant::CondenserType::NOTSET), PartLoadCurveType(PLR::Unassigned), RefCap(0.0), RefCapWasAutoSized(false), - RefCOP(0.0), FlowMode(DataPlant::FlowMode::NOTSET), + : TypeNum(0), CondenserType(DataPlant::CondenserType::Unassigned), PartLoadCurveType(PLR::Unassigned), RefCap(0.0), RefCapWasAutoSized(false), + RefCOP(0.0), FlowMode(DataPlant::FlowMode::Unassigned), 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), diff --git a/src/EnergyPlus/FaultsManager.cc b/src/EnergyPlus/FaultsManager.cc index 996eeedf3f2..3ea536ff0eb 100644 --- a/src/EnergyPlus/FaultsManager.cc +++ b/src/EnergyPlus/FaultsManager.cc @@ -539,7 +539,7 @@ namespace FaultsManager { ErrorsFound = true; } else { - if (state.dataPlantChillers->ElectricChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataPlantChillers->ElectricChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WaterCooled) { // The fault model is only applicable to the chillers with water based condensers ShowWarningError(state, cFaultCurrentObject + " = \"" + cAlphaArgs(1) + "\" invalid " + cAlphaFieldNames(5) + " = \"" + cAlphaArgs(5) + @@ -568,7 +568,7 @@ namespace FaultsManager { ErrorsFound = true; } else { - if (state.dataChillerElectricEIR->ElectricEIRChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataChillerElectricEIR->ElectricEIRChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WaterCooled) { // The fault model is only applicable to the chillers with water based condensers ShowWarningError(state, cFaultCurrentObject + " = \"" + cAlphaArgs(1) + "\" invalid " + cAlphaFieldNames(5) + " = \"" + cAlphaArgs(5) + @@ -598,7 +598,7 @@ namespace FaultsManager { ErrorsFound = true; } else { - if (state.dataChillerReformulatedEIR->ElecReformEIRChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataChillerReformulatedEIR->ElecReformEIRChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WaterCooled) { // The fault model is only applicable to the chillers with water based condensers ShowWarningError(state, cFaultCurrentObject + " = \"" + cAlphaArgs(1) + "\" invalid " + cAlphaFieldNames(5) + " = \"" + cAlphaArgs(5) + @@ -627,7 +627,7 @@ namespace FaultsManager { ErrorsFound = true; } else { - if (state.dataPlantChillers->ConstCOPChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataPlantChillers->ConstCOPChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WaterCooled) { // The fault model is only applicable to the chillers with water based condensers ShowWarningError(state, cFaultCurrentObject + " = \"" + cAlphaArgs(1) + "\" invalid " + cAlphaFieldNames(5) + " = \"" + cAlphaArgs(5) + @@ -656,7 +656,7 @@ namespace FaultsManager { ErrorsFound = true; } else { - if (state.dataPlantChillers->EngineDrivenChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataPlantChillers->EngineDrivenChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WaterCooled) { // The fault model is only applicable to the chillers with water based condensers ShowWarningError(state, cFaultCurrentObject + " = \"" + cAlphaArgs(1) + "\" invalid " + cAlphaFieldNames(5) + " = \"" + cAlphaArgs(5) + @@ -685,7 +685,7 @@ namespace FaultsManager { ErrorsFound = true; } else { - if (state.dataPlantChillers->GTChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataPlantChillers->GTChiller(ChillerNum).CondenserType != DataPlant::CondenserType::WaterCooled) { // The fault model is only applicable to the chillers with water based condensers ShowWarningError(state, cFaultCurrentObject + " = \"" + cAlphaArgs(1) + "\" invalid " + cAlphaFieldNames(5) + " = \"" + cAlphaArgs(5) + diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index c555a9dbbb3..3c451dc0e00 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -4359,32 +4359,32 @@ namespace EnergyPlus::OutputReportTabular { // Air- and Evap-cooled chiller for (iChiller = 1; iChiller <= state.dataPlantChillers->NumElectricChillers; ++iChiller) { - if (state.dataPlantChillers->ElectricChiller(iChiller).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataPlantChillers->ElectricChiller(iChiller).CondenserType != DataPlant::CondenserType::WaterCooled) { SysTotalHVACRejectHeatLoss += state.dataPlantChillers->ElectricChiller(iChiller).CondenserEnergy; } } for (iChiller = 1; iChiller <= state.dataPlantChillers->NumEngineDrivenChillers; ++iChiller) { - if (state.dataPlantChillers->EngineDrivenChiller(iChiller).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataPlantChillers->EngineDrivenChiller(iChiller).CondenserType != DataPlant::CondenserType::WaterCooled) { SysTotalHVACRejectHeatLoss += state.dataPlantChillers->EngineDrivenChiller(iChiller).CondenserEnergy; } } for (iChiller = 1; iChiller <= state.dataPlantChillers->NumGTChillers; ++iChiller) { - if (state.dataPlantChillers->GTChiller(iChiller).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataPlantChillers->GTChiller(iChiller).CondenserType != DataPlant::CondenserType::WaterCooled) { SysTotalHVACRejectHeatLoss += state.dataPlantChillers->GTChiller(iChiller).CondenserEnergy; } } for (iChiller = 1; iChiller <= state.dataPlantChillers->NumConstCOPChillers; ++iChiller) { - if (state.dataPlantChillers->ConstCOPChiller(iChiller).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataPlantChillers->ConstCOPChiller(iChiller).CondenserType != DataPlant::CondenserType::WaterCooled) { SysTotalHVACRejectHeatLoss += state.dataPlantChillers->ConstCOPChiller(iChiller).CondenserEnergy; } } for (iChiller = 1; iChiller <= state.dataChillerElectricEIR->NumElectricEIRChillers; ++iChiller) { - if (state.dataChillerElectricEIR->ElectricEIRChiller(iChiller).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataChillerElectricEIR->ElectricEIRChiller(iChiller).CondenserType != DataPlant::CondenserType::WaterCooled) { SysTotalHVACRejectHeatLoss += state.dataChillerElectricEIR->ElectricEIRChiller(iChiller).CondEnergy; } } for (iChiller = 1; iChiller <= state.dataChillerReformulatedEIR->NumElecReformEIRChillers; ++iChiller) { - if (state.dataChillerReformulatedEIR->ElecReformEIRChiller(iChiller).CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (state.dataChillerReformulatedEIR->ElecReformEIRChiller(iChiller).CondenserType != DataPlant::CondenserType::WaterCooled) { SysTotalHVACRejectHeatLoss += state.dataChillerReformulatedEIR->ElecReformEIRChiller(iChiller).CondEnergy; } } diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index a412a69635a..8bf67a86b51 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -52,9 +52,7 @@ #include #include -namespace EnergyPlus { - -namespace DataPlant { +namespace EnergyPlus::DataPlant { // PURPOSE OF THIS MODULE: // This data-only module contains the structures for various parts of the Plant and @@ -481,6 +479,4 @@ namespace DataPlant { PlantCallingOrderInfo.deallocate(); } -} // namespace DataPlant - } // namespace EnergyPlus diff --git a/src/EnergyPlus/Plant/DataPlant.hh b/src/EnergyPlus/Plant/DataPlant.hh index 397b6c80d09..1ba84f682d4 100644 --- a/src/EnergyPlus/Plant/DataPlant.hh +++ b/src/EnergyPlus/Plant/DataPlant.hh @@ -72,12 +72,6 @@ namespace DataPlant { // Using/Aliasing using DataLoopNode::SensedNodeFlagValue; - int const OptimalLoading(1); // Optimal Load Distribution Scheme - int const SequentialLoading(2); // Sequential Load Distribution Scheme - int const UniformLoading(3); // Uniform Load Distribution Scheme - int const UniformPLRLoading(4); // Uniform PLR Load Distribution Scheme - int const SequentialUniformPLRLoading(5); // Sequential Uniform PLR Load Distribution Scheme - extern int const LoadRangeBasedMin; extern int const LoadRangeBasedMax; @@ -260,18 +254,18 @@ namespace DataPlant { // Enum classes enum class FlowMode { - NOTSET, - CONSTANT, - NOTMODULATED, - LEAVINGSETPOINTMODULATED + Unassigned, + Constant, + NotModulated, + LeavingSetpointModulated, }; enum class CondenserType { - NOTSET, - AIRCOOLED, - WATERCOOLED, - EVAPCOOLED + Unassigned, + AirCooled, + WaterCooled, + EvapCooled, }; // Object Data diff --git a/src/EnergyPlus/Plant/Enums.hh b/src/EnergyPlus/Plant/Enums.hh index 9c4b44cd479..2421287cf70 100644 --- a/src/EnergyPlus/Plant/Enums.hh +++ b/src/EnergyPlus/Plant/Enums.hh @@ -82,7 +82,7 @@ namespace EnergyPlus::DataPlant { DryBulbTDBOpSchemeType = 7, // Scheme Type for relative humidity range based Operation WetBulbTDBOpSchemeType = 8, // Scheme Type for Wet bulb range based Operation DewPointTDBOpSchemeType = 9, // Scheme Type for Wet bulb range based Operation - CompSetPtBasedSchemeType = 10, // *Sankar Temp Based Control + CompSetPtBasedSchemeType = 10, // Temp Based Control UncontrolledOpSchemeType = 11, // Scheme Type for Uncontrolled Operation EMSOpSchemeType = 12, // Scheme Type for EMS based operation user Define scheme PumpOpSchemeType = 13, // Not really an OpScheme, just a placeholder @@ -103,6 +103,15 @@ namespace EnergyPlus::DataPlant { int const HowMet_ByNominalCapFreeCoolCntrl(56); // HowMet_ByNominalCap with free cool shutdown int const HowMet_ByNominalCapLowOutLimitFreeCoolCntrl(57); // HowMet_ByNominalCapLowOutLimit with free cool shutdown + enum class iLoadingScheme { + Unassigned, + Optimal, // Optimal Load Distribution Scheme + Sequential, // Sequential Load Distribution Scheme + Uniform, // Uniform Load Distribution Scheme + UniformPLR, // Uniform PLR Load Distribution Scheme + SequentialUniformPLR, // Sequential Uniform PLR Load Distribution Scheme + }; + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/Plant/Loop.hh b/src/EnergyPlus/Plant/Loop.hh index 377cbf1af08..5f5053327f9 100644 --- a/src/EnergyPlus/Plant/Loop.hh +++ b/src/EnergyPlus/Plant/Loop.hh @@ -48,6 +48,7 @@ #ifndef PlantTopologyLoop_hh_INCLUDED #define PlantTopologyLoop_hh_INCLUDED +#include #include namespace EnergyPlus { @@ -94,17 +95,17 @@ namespace DataPlant { std::string OperationScheme; // Operation scheme name for the loop int NumOpSchemes; // Number of items in list identified by "OpScheme" Array1D OpScheme; // Operation scheme data - int LoadDistribution; // Load distribution scheme 1 for optimal, 2 for overloading + DataPlant::iLoadingScheme LoadDistribution; // Load distribution scheme 1 for optimal, 2 for overloading int PlantSizNum; // index to corresponding plant sizing data array int LoopDemandCalcScheme; // Load distribution scheme 1 SingleSetPoint, // 2 DualSetPointwithDeadBand int CommonPipeType; - int EconPlantSideSensedNodeNum; // DSU review, should move these out of here - int EconCondSideSensedNodeNum; // DSU review, should move these out of here - int EconPlacement; // DSU review, should move these out of here - int EconBranch; // DSU review, should move these out of here - int EconComp; // DSU review, should move these out of here - Real64 EconControlTempDiff; // DSU review, should move these out of here + int EconPlantSideSensedNodeNum; + int EconCondSideSensedNodeNum; + int EconPlacement; + int EconBranch; + int EconComp; + Real64 EconControlTempDiff; bool LoopHasConnectionComp; LoopType TypeOfLoop; int PressureSimType; @@ -117,11 +118,11 @@ namespace DataPlant { Real64 HeatingDemand; // Plant Loop Heating Demand[W] Real64 DemandNotDispatched; // Plant Loop Demand that was not distributed [W] Real64 UnmetDemand; // Plant Loop Unmet Demand [W] - Real64 BypassFrac; // Debug Variable - Real64 InletNodeFlowrate; // Debug Variable - Real64 InletNodeTemperature; // Debug Variable - Real64 OutletNodeFlowrate; // Debug Variable - Real64 OutletNodeTemperature; // Debug Variable + Real64 BypassFrac; + Real64 InletNodeFlowrate; + Real64 InletNodeTemperature; + Real64 OutletNodeFlowrate; + Real64 OutletNodeTemperature; int LastLoopSideSimulated; // Default Constructor @@ -130,16 +131,16 @@ namespace DataPlant { MFErrIndex(0), MFErrIndex1(0), MFErrIndex2(0), TempSetPointNodeNum(0), MaxBranch(0), MinTemp(0.0), MaxTemp(0.0), MinTempErrIndex(0), MaxTempErrIndex(0), MinVolFlowRate(0.0), MaxVolFlowRate(0.0), MaxVolFlowRateWasAutoSized(false), MinMassFlowRate(0.0), MaxMassFlowRate(0.0), Volume(0.0), VolumeWasAutoSized(false), // true if Volume was set to autocalculate - CirculationTime(2.0), Mass(0.0), EMSCtrl(false), EMSValue(0.0), NumOpSchemes(0), LoadDistribution(0), PlantSizNum(0), - LoopDemandCalcScheme(0), CommonPipeType(0), EconPlantSideSensedNodeNum(0), EconCondSideSensedNodeNum(0), EconPlacement(0), - EconBranch(0), EconComp(0), EconControlTempDiff(0.0), LoopHasConnectionComp(false), TypeOfLoop(LoopType::Unassigned), PressureSimType(1), - HasPressureComponents(false), PressureDrop(0.0), UsePressureForPumpCalcs(false), PressureEffectiveK(0.0), - CoolingDemand(0.0), HeatingDemand(0.0), DemandNotDispatched(0.0), UnmetDemand(0.0), BypassFrac(0.0), - InletNodeFlowrate(0.0), InletNodeTemperature(0.0), OutletNodeFlowrate(0.0), OutletNodeTemperature(0.0), LastLoopSideSimulated(0) + CirculationTime(2.0), Mass(0.0), EMSCtrl(false), EMSValue(0.0), NumOpSchemes(0), + LoadDistribution(DataPlant::iLoadingScheme::Unassigned), PlantSizNum(0), LoopDemandCalcScheme(0), CommonPipeType(0), + EconPlantSideSensedNodeNum(0), EconCondSideSensedNodeNum(0), EconPlacement(0), EconBranch(0), EconComp(0), EconControlTempDiff(0.0), + LoopHasConnectionComp(false), TypeOfLoop(LoopType::Unassigned), PressureSimType(1), HasPressureComponents(false), PressureDrop(0.0), + UsePressureForPumpCalcs(false), PressureEffectiveK(0.0), CoolingDemand(0.0), HeatingDemand(0.0), DemandNotDispatched(0.0), + UnmetDemand(0.0), BypassFrac(0.0), InletNodeFlowrate(0.0), InletNodeTemperature(0.0), OutletNodeFlowrate(0.0), + OutletNodeTemperature(0.0), LastLoopSideSimulated(0) { } - void UpdateLoopSideReportVars(EnergyPlusData &state, Real64 OtherSideDemand, Real64 LocalRemLoopDemand); void CheckLoopExitNode(EnergyPlusData &state, bool FirstHVACIteration); diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index 89e81d0334c..c25962ccdfc 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -494,23 +494,23 @@ namespace EnergyPlus { // Load the load distribution scheme. LoadingScheme = Alpha(14); if (UtilityRoutines::SameString(LoadingScheme, "Optimal")) { - this_loop.LoadDistribution = OptimalLoading; + this_loop.LoadDistribution = DataPlant::iLoadingScheme::Optimal; } else if (UtilityRoutines::SameString(LoadingScheme, "SequentialLoad")) { - this_loop.LoadDistribution = SequentialLoading; + this_loop.LoadDistribution = DataPlant::iLoadingScheme::Sequential; } else if (UtilityRoutines::SameString(LoadingScheme, "UniformLoad")) { - this_loop.LoadDistribution = UniformLoading; + this_loop.LoadDistribution = DataPlant::iLoadingScheme::Uniform; } else if (UtilityRoutines::SameString(LoadingScheme, "UniformPLR")) { - this_loop.LoadDistribution = UniformPLRLoading; + this_loop.LoadDistribution = DataPlant::iLoadingScheme::UniformPLR; } else if (UtilityRoutines::SameString(LoadingScheme, "SequentialUniformPLR")) { - this_loop.LoadDistribution = SequentialUniformPLRLoading; + this_loop.LoadDistribution = DataPlant::iLoadingScheme::SequentialUniformPLR; } else { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); ShowContinueError(state, "..." + cAlphaFieldNames(14) + "=\"" + Alpha(14) + "\"."); ShowContinueError(state, "Will default to SequentialLoad."); // TODO rename point - this_loop.LoadDistribution = SequentialLoading; + this_loop.LoadDistribution = DataPlant::iLoadingScheme::Sequential; } - // When dual setpoint is allowed in condenser loop modify this code. Sankar 06/29/2009 + // When dual setpoint is allowed in condenser loop modify this code. if (this_loop.TypeOfLoop == LoopType::Plant) { // Get the Loop Demand Calculation Scheme if (UtilityRoutines::SameString(Alpha(16), "SingleSetpoint")) { diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index 874e914d2ff..8aace7f4772 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -214,11 +214,11 @@ namespace PlantChillers { thisChiller.plantTypeOfNum = DataPlant::TypeOf_Chiller_Electric; if (DataIPShortCuts::cAlphaArgs(2) == "AIRCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::AIRCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::AirCooled; } else if (DataIPShortCuts::cAlphaArgs(2) == "WATERCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::WATERCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::WaterCooled; } else if (DataIPShortCuts::cAlphaArgs(2) == "EVAPORATIVELYCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::EVAPCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::EvapCooled; } else { ShowSevereError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(2) + '=' + DataIPShortCuts::cAlphaArgs(2)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); @@ -262,8 +262,8 @@ namespace PlantChillers { DataIPShortCuts::cAlphaArgs(4), "Chilled Water Nodes"); - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { // Connection not required for air or evap cooled condenser // If the condenser inlet is blank for air cooled and evap cooled condensers then supply a generic name // since it is not used elsewhere for connection @@ -305,7 +305,7 @@ namespace PlantChillers { DataLoopNode::NodeConnectionType_Outlet, 2, DataLoopNode::ObjectIsNotParent); - } else if (thisChiller.CondenserType == DataPlant::CondenserType::WATERCOOLED) { + } else if (thisChiller.CondenserType == DataPlant::CondenserType::WaterCooled) { thisChiller.CondInletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(5), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, @@ -383,7 +383,7 @@ namespace PlantChillers { } thisChiller.CondVolFlowRate = DataIPShortCuts::rNumericArgs(10); if (thisChiller.CondVolFlowRate == DataSizing::AutoSize) { - if (thisChiller.CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::WaterCooled) { thisChiller.CondVolFlowRateWasAutoSized = true; } } @@ -408,17 +408,17 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataIPShortCuts::cAlphaArgs(7)); if (SELECT_CASE_var == "CONSTANTFLOW") { - thisChiller.FlowMode = DataPlant::FlowMode::CONSTANT; + thisChiller.FlowMode = DataPlant::FlowMode::Constant; } else if (SELECT_CASE_var == "LEAVINGSETPOINTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::LEAVINGSETPOINTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::LeavingSetpointModulated; } else if (SELECT_CASE_var == "NOTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } else { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(7) + '=' + DataIPShortCuts::cAlphaArgs(7)); ShowContinueError(state, "Available choices are ConstantFlow, NotModulated, or LeavingSetpointModulated"); ShowContinueError(state, "Flow mode NotModulated is assumed and the simulation continues."); - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } } @@ -466,8 +466,8 @@ namespace PlantChillers { PlantUtilities::RegisterPlantCompDesignFlow(thisChiller.HeatRecInletNodeNum, thisChiller.DesignHeatRecVolFlowRate); } // Condenser flow rate must be specified for heat reclaim - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { if (thisChiller.CondVolFlowRate <= 0.0) { ShowSevereError(state, format("Invalid {}={:.6R}", DataIPShortCuts::cNumericFieldNames(10), DataIPShortCuts::rNumericArgs(10))); @@ -525,8 +525,8 @@ namespace PlantChillers { thisChiller.HeatRecInletNodeNum = 0; thisChiller.HeatRecOutletNodeNum = 0; // if heat recovery is not used, don't care about condenser flow rate for air/evap-cooled equip. - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { thisChiller.CondVolFlowRate = 0.0011; // set to avoid errors in calc routine } if ((!DataIPShortCuts::lAlphaFieldBlanks(8)) || (!DataIPShortCuts::lAlphaFieldBlanks(9))) { @@ -622,13 +622,13 @@ namespace PlantChillers { SetupOutputVariable(state, "Chiller Condenser Inlet Temperature", OutputProcessor::Unit::C, this->CondInletTemp, "System", "Average", this->Name); // Condenser mass flow and outlet temp are valid for water cooled - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { SetupOutputVariable(state, "Chiller Condenser Outlet Temperature", OutputProcessor::Unit::C, this->CondOutletTemp, "System", "Average", this->Name); SetupOutputVariable(state, "Chiller Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, this->CondMassFlowRate, "System", "Average", this->Name); - } else if (this->CondenserType == DataPlant::CondenserType::AIRCOOLED) { - } else if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + } else if (this->CondenserType == DataPlant::CondenserType::AirCooled) { + } else if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { if (this->BasinHeaterPowerFTempDiff > 0.0) { SetupOutputVariable(state, "Chiller Basin Heater Electricity Rate", OutputProcessor::Unit::W, this->BasinHeaterPower, "System", "Average", this->Name); @@ -742,7 +742,7 @@ namespace PlantChillers { _, this->EvapInletNodeNum, _); - if (this->CondenserType != DataPlant::CondenserType::AIRCOOLED && this->CondenserType != DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, this->plantTypeOfNum, @@ -777,7 +777,7 @@ namespace PlantChillers { this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); } - if (this->CondenserType != DataPlant::CondenserType::AIRCOOLED && this->CondenserType != DataPlant::CondenserType::EVAPCOOLED && + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { PlantUtilities::InterConnectTwoPlantLoopSides( this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); @@ -787,13 +787,13 @@ namespace PlantChillers { ShowFatalError(state, "InitElectricChiller: Program terminated due to previous condition(s)."); } - if (this->FlowMode == DataPlant::FlowMode::CONSTANT) { + if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } - if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; @@ -861,7 +861,7 @@ namespace PlantChillers { this->CWCompNum); // init maximum available condenser flow rate - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { DataLoopNode::Node(this->CondInletNodeNum).Temp = this->TempDesCondIn; // DSU? old behavior, still want? @@ -962,7 +962,7 @@ namespace PlantChillers { this->MyEnvrnFlag = true; } - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) && (this->ModulatedFlowSetToLoop)) { + if ((this->FlowMode == DataPlant::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. { @@ -986,7 +986,7 @@ namespace PlantChillers { } PlantUtilities::SetComponentFlowRate(state, mdot, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum); - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PlantUtilities::SetComponentFlowRate(state, mdotCond, this->CondInletNodeNum, this->CondOutletNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); } @@ -1008,7 +1008,7 @@ namespace PlantChillers { this->HRCompNum); } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = 0.0; } } @@ -1037,7 +1037,7 @@ namespace PlantChillers { int PltSizCondNum(0); // Plant Sizing index for condenser loop bool ErrorsFound(false); // If errors detected in input - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; } @@ -1231,7 +1231,7 @@ namespace PlantChillers { } // save the design condenser water volumetric flow rate for use by the condenser water loop sizing algorithms - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PlantUtilities::RegisterPlantCompDesignFlow(this->CondInletNodeNum, tmpCondVolFlowRate); } if (ErrorsFound) { @@ -1365,7 +1365,7 @@ namespace PlantChillers { this->CWBranchNum, this->CWCompNum); } - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; @@ -1381,7 +1381,7 @@ namespace PlantChillers { } } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -1392,7 +1392,7 @@ namespace PlantChillers { // If not air or evap cooled then set to the condenser node that is attached to a cooling tower // Set mass flow rates - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { this->CondMassFlowRate = this->CondMassFlowRateMax; PlantUtilities::SetComponentFlowRate(state, this->CondMassFlowRate, this->CondInletNodeNum, @@ -1435,7 +1435,7 @@ namespace PlantChillers { // initialize outlet air humidity ratio of air or evap cooled chillers this->CondOutletHumRat = DataLoopNode::Node(this->CondInletNodeNum).HumRat; - if (this->CondenserType == DataPlant::CondenserType::AIRCOOLED) { // Condenser inlet temp = outdoor temp + if (this->CondenserType == DataPlant::CondenserType::AirCooled) { // Condenser inlet temp = outdoor temp DataLoopNode::Node(this->CondInletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).OutAirDryBulb; // Warn user if entering condenser temperature falls below 0C if (DataLoopNode::Node(this->CondInletNodeNum).Temp < 0.0 && !state.dataGlobal->WarmupFlag) { @@ -1451,7 +1451,7 @@ namespace PlantChillers { } else { this->PrintMessage = false; } - } else if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { // Condenser inlet temp = (outdoor wet bulb) + } else if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { // Condenser inlet temp = (outdoor wet bulb) DataLoopNode::Node(this->CondInletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).OutAirWetBulb; // line above assumes evaporation pushes condenser inlet air humidity ratio to saturation this->CondOutletHumRat = Psychrometrics::PsyWFnTdbTwbPb(state, @@ -1558,7 +1558,7 @@ namespace PlantChillers { this->Power = FracFullLoadPower * FullLoadPowerRat * AvailChillerCap / this->COP * FRAC; // Either set the flow to the Constant value or calculate the flow for the variable volume - if ((this->FlowMode == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { // Start by assuming max (design) flow this->EvapMassFlowRate = EvapMassFlowRateMax; @@ -1580,7 +1580,7 @@ namespace PlantChillers { // Evaluate outlet temp based on delta this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; - } else if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint Real64 EvapDeltaTemp(0.0); @@ -1640,7 +1640,7 @@ namespace PlantChillers { (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = this->FaultyChillerSWTIndex; - bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED); + bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated); FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, this->FaultyChillerSWTOffset, @@ -1665,7 +1665,7 @@ namespace PlantChillers { // Some other component set the flow to 0. No reason to continue with calculations. if (this->EvapMassFlowRate == 0.0) { MyLoad = 0.0; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -1684,7 +1684,7 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWLoopSideNum) @@ -1696,7 +1696,7 @@ namespace PlantChillers { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWLoopSideNum) @@ -1794,7 +1794,7 @@ namespace PlantChillers { this->Power = 0.0; this->PrintMessage = false; } - if (this->QEvaporator == 0.0 && this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->QEvaporator == 0.0 && this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -1804,7 +1804,7 @@ namespace PlantChillers { // depending on the performance coefficients used for the chiller model. this->QCondenser = this->Power + this->QEvaporator; - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { 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(state, this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovered); @@ -1841,7 +1841,7 @@ namespace PlantChillers { // check for problems (deal with observed negative energy results) if (this->Energy < 0.0) { // there is a serious problem - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { // first check for run away condenser loop temps (only reason yet to be observed for this?) if (condInletTemp > 70.0) { ShowSevereError(state, "CalcElectricChillerModel: Condenser loop inlet temperatures over 70.0 C for ElectricChiller=" + this->Name); @@ -1899,7 +1899,7 @@ namespace PlantChillers { state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, this->HeatRecInletTemp, DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); Real64 CpCond; - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { CpCond = FluidProperties::GetSpecificHeatGlycol( state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } else { @@ -1973,7 +1973,7 @@ namespace PlantChillers { // set node temperatures DataLoopNode::Node(this->EvapOutletNodeNum).Temp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; DataLoopNode::Node(this->CondOutletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).Temp; - if (this->CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::WaterCooled) { DataLoopNode::Node(this->CondOutletNodeNum).HumRat = DataLoopNode::Node(this->CondInletNodeNum).HumRat; DataLoopNode::Node(this->CondOutletNodeNum).Enthalpy = DataLoopNode::Node(this->CondInletNodeNum).Enthalpy; } @@ -1983,7 +1983,7 @@ namespace PlantChillers { this->CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).Temp; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = this->BasinHeaterPower; this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; } @@ -2002,7 +2002,7 @@ namespace PlantChillers { // set node temperatures DataLoopNode::Node(this->EvapOutletNodeNum).Temp = this->EvapOutletTemp; DataLoopNode::Node(this->CondOutletNodeNum).Temp = this->CondOutletTemp; - if (this->CondenserType != DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::WaterCooled) { DataLoopNode::Node(this->CondOutletNodeNum).HumRat = this->CondOutletHumRat; DataLoopNode::Node(this->CondOutletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(this->CondOutletTemp, this->CondOutletHumRat); } @@ -2012,7 +2012,7 @@ namespace PlantChillers { this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; this->CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).Temp; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = this->BasinHeaterPower; this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; } @@ -2146,11 +2146,11 @@ namespace PlantChillers { } if (DataIPShortCuts::cAlphaArgs(2) == "AIRCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::AIRCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::AirCooled; } else if (DataIPShortCuts::cAlphaArgs(2) == "WATERCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::WATERCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::WaterCooled; } else if (DataIPShortCuts::cAlphaArgs(2) == "EVAPORATIVELYCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::EVAPCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::EvapCooled; } else { ShowSevereError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(2) + '=' + DataIPShortCuts::cAlphaArgs(2)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); @@ -2179,8 +2179,8 @@ namespace PlantChillers { DataIPShortCuts::cAlphaArgs(4), "Chilled Water Nodes"); - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { // Connection not required for air or evap cooled condenser // If the condenser inlet is blank for air cooled and evap cooled condensers then supply a generic name // since it is not used elsewhere for connection @@ -2225,7 +2225,7 @@ namespace PlantChillers { // CALL // TestCompSet(state, TRIM(DataIPShortCuts::cCurrentModuleObject),DataIPShortCuts::cAlphaArgs(1),DataIPShortCuts::cAlphaArgs(5),DataIPShortCuts::cAlphaArgs(6),'Condenser // (Air) Nodes') - } else if (thisChiller.CondenserType == DataPlant::CondenserType::WATERCOOLED) { + } else if (thisChiller.CondenserType == DataPlant::CondenserType::WaterCooled) { thisChiller.CondInletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(5), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, @@ -2303,7 +2303,7 @@ namespace PlantChillers { } thisChiller.CondVolFlowRate = DataIPShortCuts::rNumericArgs(10); if (thisChiller.CondVolFlowRate == DataSizing::AutoSize) { - if (thisChiller.CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::WaterCooled) { thisChiller.CondVolFlowRateWasAutoSized = true; } } @@ -2422,8 +2422,8 @@ namespace PlantChillers { } // Condenser flow rate must be specified for heat reclaim - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { if (thisChiller.CondVolFlowRate <= 0.0) { ShowSevereError(state, format("Invalid {}={:.6R}", DataIPShortCuts::cNumericFieldNames(10), DataIPShortCuts::rNumericArgs(10))); @@ -2440,8 +2440,8 @@ namespace PlantChillers { thisChiller.HeatRecInletNodeNum = 0; thisChiller.HeatRecOutletNodeNum = 0; // if heat recovery is not used, don't care about condenser flow rate for air/evap-cooled equip. - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { thisChiller.CondVolFlowRate = 0.0011; // set to avoid errors in calc routine } if ((!DataIPShortCuts::lAlphaFieldBlanks(13)) || (!DataIPShortCuts::lAlphaFieldBlanks(14))) { @@ -2454,17 +2454,17 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataIPShortCuts::cAlphaArgs(15)); if (SELECT_CASE_var == "CONSTANTFLOW") { - thisChiller.FlowMode = DataPlant::FlowMode::CONSTANT; + thisChiller.FlowMode = DataPlant::FlowMode::Constant; } else if (SELECT_CASE_var == "LEAVINGSETPOINTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::LEAVINGSETPOINTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::LeavingSetpointModulated; } else if (SELECT_CASE_var == "NOTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } else { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(15) + '=' + DataIPShortCuts::cAlphaArgs(15)); ShowContinueError(state, "Available choices are ConstantFlow, NotModulated, or LeavingSetpointModulated"); ShowContinueError(state, "Flow mode NotModulated is assumed and the simulation continues."); - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } } @@ -2553,13 +2553,13 @@ namespace PlantChillers { SetupOutputVariable(state, "Chiller Condenser Inlet Temperature", OutputProcessor::Unit::C, this->CondInletTemp, "System", "Average", this->Name); // Condenser mass flow and outlet temp are valid for Water Cooled - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { SetupOutputVariable(state, "Chiller Condenser Outlet Temperature", OutputProcessor::Unit::C, this->CondOutletTemp, "System", "Average", this->Name); SetupOutputVariable(state, "Chiller Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, this->CondMassFlowRate, "System", "Average", this->Name); - } else if (this->CondenserType == DataPlant::CondenserType::AIRCOOLED) { - } else if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + } else if (this->CondenserType == DataPlant::CondenserType::AirCooled) { + } else if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { if (this->BasinHeaterPowerFTempDiff > 0.0) { SetupOutputVariable(state, "Chiller Basin Heater Electricity Rate", OutputProcessor::Unit::W, this->BasinHeaterPower, "System", "Average", this->Name); @@ -2690,7 +2690,7 @@ namespace PlantChillers { _, this->EvapInletNodeNum, _); - if (this->CondenserType != DataPlant::CondenserType::AIRCOOLED && this->CondenserType != DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, this->plantTypeOfNum, @@ -2725,7 +2725,7 @@ namespace PlantChillers { this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); } - if (this->CondenserType != DataPlant::CondenserType::AIRCOOLED && this->CondenserType != DataPlant::CondenserType::EVAPCOOLED && + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { PlantUtilities::InterConnectTwoPlantLoopSides( this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); @@ -2734,13 +2734,13 @@ namespace PlantChillers { ShowFatalError(state, "InitEngineDrivenChiller: Program terminated due to previous condition(s)."); } - if (this->FlowMode == DataPlant::FlowMode::CONSTANT) { + if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } - if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; @@ -2804,7 +2804,7 @@ namespace PlantChillers { // init maximum available condenser flow rate - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { DataLoopNode::Node(this->CondInletNodeNum).Temp = this->TempDesCondIn; @@ -2863,7 +2863,7 @@ namespace PlantChillers { this->MyEnvrnFlag = true; } - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) && (this->ModulatedFlowSetToLoop)) { + if ((this->FlowMode == DataPlant::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(this->EvapOutletNodeNum).TempSetPoint = @@ -2884,7 +2884,7 @@ namespace PlantChillers { PlantUtilities::SetComponentFlowRate(state, mdot, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum); - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PlantUtilities::SetComponentFlowRate(state, mdotCond, this->CondInletNodeNum, this->CondOutletNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); } @@ -2906,7 +2906,7 @@ namespace PlantChillers { this->HRBranchNum, this->HRCompNum); } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = 0.0; } } @@ -2938,7 +2938,7 @@ namespace PlantChillers { Real64 tmpEvapVolFlowRate = this->EvapVolFlowRate; Real64 tmpCondVolFlowRate = this->CondVolFlowRate; - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; } @@ -3129,7 +3129,7 @@ namespace PlantChillers { } // save the design condenser water volumetric flow rate for use by the condenser water loop sizing algorithms - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PlantUtilities::RegisterPlantCompDesignFlow(this->CondInletNodeNum, tmpCondVolFlowRate); } @@ -3297,7 +3297,7 @@ namespace PlantChillers { this->CWCompNum); } - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; @@ -3313,7 +3313,7 @@ namespace PlantChillers { } } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -3321,7 +3321,7 @@ namespace PlantChillers { return; } - if (this->CondenserType == DataPlant::CondenserType::AIRCOOLED) { // Condenser inlet temp = outdoor temp + if (this->CondenserType == DataPlant::CondenserType::AirCooled) { // Condenser inlet temp = outdoor temp DataLoopNode::Node(this->CondInletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).OutAirDryBulb; // Warn user if entering condenser temperature falls below 0C if (DataLoopNode::Node(this->CondInletNodeNum).Temp < 0.0 && !state.dataGlobal->WarmupFlag) { @@ -3337,7 +3337,7 @@ namespace PlantChillers { } else { this->PrintMessage = false; } - } else if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { // Condenser inlet temp = (outdoor wet bulb) + } else if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { // Condenser inlet temp = (outdoor wet bulb) DataLoopNode::Node(this->CondInletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).OutAirWetBulb; // Warn user if evap condenser wet bulb temperature falls below 10C if (DataLoopNode::Node(this->CondInletNodeNum).Temp < 10.0 && !state.dataGlobal->WarmupFlag) { @@ -3359,7 +3359,7 @@ namespace PlantChillers { this->CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; // Set mass flow rates - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { this->CondMassFlowRate = this->CondMassFlowRateMax; PlantUtilities::SetComponentFlowRate(state, this->CondMassFlowRate, this->CondInletNodeNum, @@ -3462,7 +3462,7 @@ namespace PlantChillers { this->Power = FracFullLoadPower * FullLoadPowerRat * AvailChillerCap / COPLocal * FRAC; // Either set the flow to the Constant value or caluclate the flow for the variable volume - if ((this->FlowMode == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { // Start by assuming max (design) flow this->EvapMassFlowRate = this->EvapMassFlowRateMax; // Use SetComponentFlowRate to decide actual flow @@ -3483,7 +3483,7 @@ namespace PlantChillers { // Evaluate outlet temp based on delta this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; - } else if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint Real64 EvapDeltaTemp(0.0); @@ -3539,7 +3539,7 @@ namespace PlantChillers { (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = this->FaultyChillerSWTIndex; - bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED); + bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated); FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, this->FaultyChillerSWTOffset, @@ -3566,7 +3566,7 @@ namespace PlantChillers { // Some other component set the flow to 0. No reason to continue with calculations. if (this->EvapMassFlowRate == 0.0) { MyLoad = 0.0; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -3590,7 +3590,7 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -3602,7 +3602,7 @@ namespace PlantChillers { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -3700,7 +3700,7 @@ namespace PlantChillers { this->Power = 0.0; this->PrintMessage = false; } - if (this->QEvaporator == 0.0 && this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->QEvaporator == 0.0 && this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -3711,7 +3711,7 @@ namespace PlantChillers { // depending on the performance coefficients used for the chiller model. this->QCondenser = this->Power + this->QEvaporator; - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { Real64 CpCond = FluidProperties::GetSpecificHeatGlycol(state, @@ -3814,7 +3814,7 @@ namespace PlantChillers { // check for problems BG 9/12/06 (deal with observed negative energy results) if (this->Energy < 0.0) { // there is a serious problem - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { // first check for run away condenser loop temps (only reason yet to be observed for this?) if (this->CondInletTemp > 70.0) { ShowSevereError(state, "CalcEngineDrivenChillerModel: Condenser loop inlet temperatures > 70.0 C for EngineDrivenChiller=" + this->Name); @@ -3923,7 +3923,7 @@ namespace PlantChillers { this->CondOutletTemp = DataLoopNode::Node(this->CondOutletNodeNum).Temp; this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).Temp; this->FuelCOP = 0.0; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = this->BasinHeaterPower; this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; } @@ -3941,7 +3941,7 @@ namespace PlantChillers { } else { this->FuelCOP = 0.0; } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = this->BasinHeaterPower; this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; } @@ -4081,11 +4081,11 @@ namespace PlantChillers { } if (DataIPShortCuts::cAlphaArgs(2) == "AIRCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::AIRCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::AirCooled; } else if (DataIPShortCuts::cAlphaArgs(2) == "WATERCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::WATERCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::WaterCooled; } else if (DataIPShortCuts::cAlphaArgs(2) == "EVAPORATIVELYCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::EVAPCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::EvapCooled; } else { ShowSevereError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(2) + '=' + DataIPShortCuts::cAlphaArgs(2)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); @@ -4114,8 +4114,8 @@ namespace PlantChillers { DataIPShortCuts::cAlphaArgs(4), "Chilled Water Nodes"); - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { // Connection not required for air or evap cooled condenser // If the condenser inlet is blank for air cooled and evap cooled condensers then supply a generic name // since it is not used elsewhere for connection @@ -4203,7 +4203,7 @@ namespace PlantChillers { thisChiller.CondVolFlowRate = DataIPShortCuts::rNumericArgs(10); if (thisChiller.CondVolFlowRate == DataSizing::AutoSize) { - if (thisChiller.CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::WaterCooled) { thisChiller.CondVolFlowRateWasAutoSized = true; } } @@ -4304,8 +4304,8 @@ namespace PlantChillers { } // Condenser flow rate must be specified for heat reclaim, but Why couldn't this be okay?? - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { if (thisChiller.CondVolFlowRate <= 0.0) { ShowSevereError(state, format("Invalid {}={:.6R}", DataIPShortCuts::cNumericFieldNames(10), DataIPShortCuts::rNumericArgs(10))); @@ -4325,8 +4325,8 @@ namespace PlantChillers { DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "However, Node names were specified for heat recovery inlet or outlet nodes"); } - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { thisChiller.CondVolFlowRate = 0.0011; // set to avoid errors in calc routine } } @@ -4334,17 +4334,17 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataIPShortCuts::cAlphaArgs(9)); if (SELECT_CASE_var == "CONSTANTFLOW") { - thisChiller.FlowMode = DataPlant::FlowMode::CONSTANT; + thisChiller.FlowMode = DataPlant::FlowMode::Constant; } else if (SELECT_CASE_var == "LEAVINGSETPOINTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::LEAVINGSETPOINTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::LeavingSetpointModulated; } else if (SELECT_CASE_var == "NOTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } else { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(9) + '=' + DataIPShortCuts::cAlphaArgs(9)); ShowContinueError(state, "Available choices are ConstantFlow, NotModulated, or LeavingSetpointModulated"); ShowContinueError(state, "Flow mode NotModulated is assumed and the simulation continues."); - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } } @@ -4455,13 +4455,13 @@ namespace PlantChillers { SetupOutputVariable(state, "Chiller Condenser Inlet Temperature", OutputProcessor::Unit::C, this->CondInletTemp, "System", "Average", this->Name); // Condenser mass flow and outlet temp are valid for water cooled - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { SetupOutputVariable(state, "Chiller Condenser Outlet Temperature", OutputProcessor::Unit::C, this->CondOutletTemp, "System", "Average", this->Name); SetupOutputVariable(state, "Chiller Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, this->CondMassFlowRate, "System", "Average", this->Name); - } else if (this->CondenserType == DataPlant::CondenserType::AIRCOOLED) { - } else if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + } else if (this->CondenserType == DataPlant::CondenserType::AirCooled) { + } else if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { if (this->BasinHeaterPowerFTempDiff > 0.0) { SetupOutputVariable(state, "Chiller Basin Heater Electricity Rate", OutputProcessor::Unit::W, this->BasinHeaterPower, "System", "Average", this->Name); @@ -4559,7 +4559,7 @@ namespace PlantChillers { _, this->EvapInletNodeNum, _); - if (this->CondenserType != DataPlant::CondenserType::AIRCOOLED && this->CondenserType != DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, this->plantTypeOfNum, @@ -4594,7 +4594,7 @@ namespace PlantChillers { this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); } - if (this->CondenserType != DataPlant::CondenserType::AIRCOOLED && this->CondenserType != DataPlant::CondenserType::EVAPCOOLED && + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { PlantUtilities::InterConnectTwoPlantLoopSides( this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); @@ -4603,13 +4603,13 @@ namespace PlantChillers { ShowFatalError(state, "InitGTChiller: Program terminated due to previous condition(s)."); } - if (this->FlowMode == DataPlant::FlowMode::CONSTANT) { + if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } - if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; @@ -4671,7 +4671,7 @@ namespace PlantChillers { this->CWCompNum); // init maximum available condenser flow rate - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { DataLoopNode::Node(this->CondInletNodeNum).Temp = this->TempDesCondIn; @@ -4730,7 +4730,7 @@ namespace PlantChillers { this->MyEnvrnFlag = true; } - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) && (this->ModulatedFlowSetToLoop)) { + if ((this->FlowMode == DataPlant::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(this->EvapOutletNodeNum).TempSetPoint = @@ -4751,7 +4751,7 @@ namespace PlantChillers { PlantUtilities::SetComponentFlowRate(state, mdot, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum); - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PlantUtilities::SetComponentFlowRate(state, mdotCond, this->CondInletNodeNum, this->CondOutletNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); } @@ -4773,7 +4773,7 @@ namespace PlantChillers { this->HRBranchNum, this->HRCompNum); } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = 0.0; } } @@ -4805,7 +4805,7 @@ namespace PlantChillers { Real64 tmpCondVolFlowRate = this->CondVolFlowRate; int PltSizCondNum(0); // Plant Sizing index for condenser loop - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; } @@ -4998,7 +4998,7 @@ namespace PlantChillers { } } // save the design condenser water volumetric flow rate for use by the condenser water loop sizing algorithms - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) PlantUtilities::RegisterPlantCompDesignFlow(this->CondInletNodeNum, tmpCondVolFlowRate); Real64 GTEngineCapacityDes = this->NomCap / (this->engineCapacityScalar * this->COP); @@ -5198,7 +5198,7 @@ namespace PlantChillers { this->CWBranchNum, this->CWCompNum); } - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; @@ -5214,7 +5214,7 @@ namespace PlantChillers { } } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -5222,7 +5222,7 @@ namespace PlantChillers { return; } - if (this->CondenserType == DataPlant::CondenserType::AIRCOOLED) { // Condenser inlet temp = outdoor temp + if (this->CondenserType == DataPlant::CondenserType::AirCooled) { // Condenser inlet temp = outdoor temp DataLoopNode::Node(this->CondInletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).OutAirDryBulb; // Warn user if entering condenser temperature falls below 0C if (DataLoopNode::Node(this->CondInletNodeNum).Temp < 0.0 && !state.dataGlobal->WarmupFlag) { @@ -5238,7 +5238,7 @@ namespace PlantChillers { } else { this->PrintMessage = false; } - } else if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { // Condenser inlet temp = (outdoor wet bulb) + } else if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { // Condenser inlet temp = (outdoor wet bulb) DataLoopNode::Node(this->CondInletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).OutAirWetBulb; // Warn user if evap condenser wet bulb temperature falls below 10C if (DataLoopNode::Node(this->CondInletNodeNum).Temp < 10.0 && !state.dataGlobal->WarmupFlag) { @@ -5260,7 +5260,7 @@ namespace PlantChillers { Real64 condInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; // Set mass flow rates - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { this->CondMassFlowRate = this->CondMassFlowRateMax; PlantUtilities::SetComponentFlowRate(state, this->CondMassFlowRate, this->CondInletNodeNum, @@ -5356,7 +5356,7 @@ namespace PlantChillers { this->Power = FracFullLoadPower * FullLoadPowerRat * AvailChillerCap / COP * FRAC; // Either set the flow to the Constant value or caluclate the flow for the variable volume - if ((this->FlowMode == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { // Start by assuming max (design) flow this->EvapMassFlowRate = this->EvapMassFlowRateMax; // Use SetComponentFlowRate to decide actual flow @@ -5375,7 +5375,7 @@ namespace PlantChillers { } // Evaluate outlet temp based on delta this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; - } else if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); @@ -5429,7 +5429,7 @@ namespace PlantChillers { (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = this->FaultyChillerSWTIndex; - bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED); + bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated); FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, this->FaultyChillerSWTOffset, @@ -5453,7 +5453,7 @@ namespace PlantChillers { // Some other component set the flow to 0. No reason to continue with calculations. if (this->EvapMassFlowRate == 0.0) { MyLoad = 0.0; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -5469,7 +5469,7 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -5481,7 +5481,7 @@ namespace PlantChillers { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -5578,7 +5578,7 @@ namespace PlantChillers { this->Power = 0.0; this->PrintMessage = false; } - if (this->QEvaporator == 0.0 && this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->QEvaporator == 0.0 && this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -5590,7 +5590,7 @@ namespace PlantChillers { // depending on the performance coefficients used for the chiller model. this->QCondenser = this->Power + this->QEvaporator; - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { Real64 CpCond = FluidProperties::GetSpecificHeatGlycol( @@ -5624,7 +5624,7 @@ namespace PlantChillers { // ??? Not sure about this Ambient Actual Temp - also do we need to have design ambient as input? Real64 AmbientDeltaT; // (ATAIR) Difference between ambient actual and ambient design temperatures - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { AmbientDeltaT = state.dataEnvrn->OutDryBulbTemp - 25.0; } else { // air or evap cooled AmbientDeltaT = DataLoopNode::Node(this->CondInletNodeNum).OutAirDryBulb - 25.0; @@ -5721,7 +5721,7 @@ namespace PlantChillers { // check for problems BG 9/12/06 (deal with observed negative energy results) if (this->Energy < 0.0) { // there is a serious problem - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { // first check for run away condenser loop temps (only reason yet to be observed for this?) if (condInletTemp > 70.0) { ShowSevereError(state, "CalcGTChillerModel: Condenser loop inlet temperatures over 70.0 C for GTChiller=" + this->Name); @@ -5788,7 +5788,7 @@ namespace PlantChillers { this->HeatRecLubeRate = 0.0; this->ExhaustStackTemp = 0.0; this->FuelCOP = 0.0; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = this->BasinHeaterPower; this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; } @@ -5816,7 +5816,7 @@ namespace PlantChillers { } else { this->FuelCOP = 0.0; } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = this->BasinHeaterPower; this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; } @@ -5938,11 +5938,11 @@ namespace PlantChillers { // Set the Condenser Type from input if (DataIPShortCuts::cAlphaArgs(6) == "AIRCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::AIRCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::AirCooled; } else if (DataIPShortCuts::cAlphaArgs(6) == "EVAPORATIVELYCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::EVAPCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::EvapCooled; } else if (DataIPShortCuts::cAlphaArgs(6) == "WATERCOOLED") { - thisChiller.CondenserType = DataPlant::CondenserType::WATERCOOLED; + thisChiller.CondenserType = DataPlant::CondenserType::WaterCooled; } else { ShowSevereError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(6) + '=' + DataIPShortCuts::cAlphaArgs(6)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); @@ -5953,13 +5953,13 @@ namespace PlantChillers { if (thisChiller.EvapVolFlowRate == DataSizing::AutoSize) { thisChiller.EvapVolFlowRateWasAutoSized = true; } - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { // Condenser flow rate not used for these cond types + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { // Condenser flow rate not used for these cond types thisChiller.CondVolFlowRate = 0.0011; } else { thisChiller.CondVolFlowRate = DataIPShortCuts::rNumericArgs(4); if (thisChiller.CondVolFlowRate == DataSizing::AutoSize) { - if (thisChiller.CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::WaterCooled) { thisChiller.CondVolFlowRateWasAutoSized = true; } } @@ -5988,8 +5988,8 @@ namespace PlantChillers { DataIPShortCuts::cAlphaArgs(3), "Chilled Water Nodes"); - if (thisChiller.CondenserType == DataPlant::CondenserType::AIRCOOLED || - thisChiller.CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (thisChiller.CondenserType == DataPlant::CondenserType::AirCooled || + thisChiller.CondenserType == DataPlant::CondenserType::EvapCooled) { // Connection not required for air or evap cooled condenser // If the condenser inlet is blank for air cooled and evap cooled condensers then supply a generic name // since it is not used elsewhere for connection @@ -6031,7 +6031,7 @@ namespace PlantChillers { DataLoopNode::NodeConnectionType_Outlet, 2, DataLoopNode::ObjectIsNotParent); - } else if (thisChiller.CondenserType == DataPlant::CondenserType::WATERCOOLED) { + } else if (thisChiller.CondenserType == DataPlant::CondenserType::WaterCooled) { thisChiller.CondInletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(4), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, @@ -6100,17 +6100,17 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataIPShortCuts::cAlphaArgs(7)); if (SELECT_CASE_var == "CONSTANTFLOW") { - thisChiller.FlowMode = DataPlant::FlowMode::CONSTANT; + thisChiller.FlowMode = DataPlant::FlowMode::Constant; } else if (SELECT_CASE_var == "LEAVINGSETPOINTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::LEAVINGSETPOINTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::LeavingSetpointModulated; } else if (SELECT_CASE_var == "NOTMODULATED") { - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } else { ShowSevereError(state, RoutineName + DataIPShortCuts::cCurrentModuleObject + "=\"" + DataIPShortCuts::cAlphaArgs(1) + "\","); ShowContinueError(state, "Invalid " + DataIPShortCuts::cAlphaFieldNames(7) + '=' + DataIPShortCuts::cAlphaArgs(7)); ShowContinueError(state, "Available choices are ConstantFlow, NotModulated, or LeavingSetpointModulated"); ShowContinueError(state, "Flow mode NotModulated is assumed and the simulation continues."); - thisChiller.FlowMode = DataPlant::FlowMode::NOTMODULATED; + thisChiller.FlowMode = DataPlant::FlowMode::NotModulated; } } @@ -6196,13 +6196,13 @@ namespace PlantChillers { SetupOutputVariable(state, "Chiller Condenser Inlet Temperature", OutputProcessor::Unit::C, this->CondInletTemp, "System", "Average", this->Name); // Condenser mass flow and outlet temp are valid for water cooled - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { SetupOutputVariable(state, "Chiller Condenser Outlet Temperature", OutputProcessor::Unit::C, this->CondOutletTemp, "System", "Average", this->Name); SetupOutputVariable(state, "Chiller Condenser Mass Flow Rate", OutputProcessor::Unit::kg_s, this->CondMassFlowRate, "System", "Average", this->Name); - } else if (this->CondenserType == DataPlant::CondenserType::AIRCOOLED) { - } else if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + } else if (this->CondenserType == DataPlant::CondenserType::AirCooled) { + } else if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { if (this->BasinHeaterPowerFTempDiff > 0.0) { SetupOutputVariable(state, "Chiller Basin Heater Electricity Rate", OutputProcessor::Unit::W, this->BasinHeaterPower, "System", "Average", this->Name); @@ -6264,7 +6264,7 @@ namespace PlantChillers { _, this->EvapInletNodeNum, _); - if (this->CondenserType != DataPlant::CondenserType::AIRCOOLED && this->CondenserType != DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled) { PlantUtilities::ScanPlantLoopsForObject(state, this->Name, this->plantTypeOfNum, @@ -6285,13 +6285,13 @@ namespace PlantChillers { if (errFlag) { ShowFatalError(state, "CalcConstCOPChillerModel: Program terminated due to previous condition(s)."); } - if (this->FlowMode == DataPlant::FlowMode::CONSTANT) { + if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } - if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; @@ -6353,7 +6353,7 @@ namespace PlantChillers { this->CWCompNum); // init maximum available condenser flow rate - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { DataLoopNode::Node(this->CondInletNodeNum).Temp = TempDesCondIn; @@ -6392,7 +6392,7 @@ namespace PlantChillers { if (!state.dataGlobal->BeginEnvrnFlag) { this->MyEnvrnFlag = true; } - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) && (this->ModulatedFlowSetToLoop)) { + if ((this->FlowMode == DataPlant::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(this->EvapOutletNodeNum).TempSetPoint = @@ -6414,12 +6414,12 @@ namespace PlantChillers { PlantUtilities::SetComponentFlowRate(state, mdot, this->EvapInletNodeNum, this->EvapOutletNodeNum, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum); - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PlantUtilities::SetComponentFlowRate(state, mdotCond, this->CondInletNodeNum, this->CondOutletNodeNum, this->CDLoopNum, this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = 0.0; } } @@ -6458,7 +6458,7 @@ namespace PlantChillers { tmpEvapVolFlowRate = this->EvapVolFlowRate; tmpCondVolFlowRate = this->CondVolFlowRate; - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; } @@ -6583,7 +6583,7 @@ namespace PlantChillers { PlantUtilities::RegisterPlantCompDesignFlow(this->EvapInletNodeNum, tmpEvapVolFlowRate); - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { if (PltSizCondNum > 0 && PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol( @@ -6648,7 +6648,7 @@ namespace PlantChillers { } // save the design condenser water volumetric flow rate for use by the condenser water loop sizing algorithms - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) PlantUtilities::RegisterPlantCompDesignFlow(this->CondInletNodeNum, tmpCondVolFlowRate); if (ErrorsFound) { @@ -6704,7 +6704,7 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -6716,7 +6716,7 @@ namespace PlantChillers { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if ((this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) || + if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) @@ -6764,7 +6764,7 @@ namespace PlantChillers { this->CWBranchNum, this->CWCompNum); } - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; @@ -6790,7 +6790,7 @@ namespace PlantChillers { this->EvaporatorEnergy = 0.0; this->CondenserEnergy = 0.0; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -6825,7 +6825,7 @@ namespace PlantChillers { // otherwise the chiller is running... - if (this->CondenserType == DataPlant::CondenserType::AIRCOOLED) { // Condenser inlet temp = outdoor temp + if (this->CondenserType == DataPlant::CondenserType::AirCooled) { // Condenser inlet temp = outdoor temp DataLoopNode::Node(this->CondInletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).OutAirDryBulb; // Warn user if entering condenser temperature falls below 0C if (DataLoopNode::Node(this->CondInletNodeNum).Temp < 0.0 && !state.dataGlobal->WarmupFlag) { @@ -6841,7 +6841,7 @@ namespace PlantChillers { } else { this->PrintMessage = false; } - } else if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { // Condenser inlet temp = (outdoor wet bulb) + } else if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { // Condenser inlet temp = (outdoor wet bulb) DataLoopNode::Node(this->CondInletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).OutAirWetBulb; // Warn user if evap condenser wet bulb temperature falls below 10C if (DataLoopNode::Node(this->CondInletNodeNum).Temp < 10.0 && !state.dataGlobal->WarmupFlag) { @@ -6860,7 +6860,7 @@ namespace PlantChillers { } // End of the Air Cooled/Evap Cooled Logic block // Set condenser flow rate - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { this->CondMassFlowRate = this->CondMassFlowRateMax; PlantUtilities::SetComponentFlowRate(state, this->CondMassFlowRate, this->CondInletNodeNum, @@ -6897,7 +6897,7 @@ namespace PlantChillers { this->Power = std::abs(MyLoad) / COP; // Either set the flow to the Constant value or caluclate the flow for the variable volume - if ((this->FlowMode == DataPlant::FlowMode::CONSTANT) || (this->FlowMode == DataPlant::FlowMode::NOTMODULATED)) { + if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { // Start by assuming max (design) flow this->EvapMassFlowRate = this->EvapMassFlowRateMax; @@ -6918,7 +6918,7 @@ namespace PlantChillers { // Evaluate outlet temp based on delta this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; - } else if (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED) { + } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { @@ -6975,7 +6975,7 @@ namespace PlantChillers { (this->EvapMassFlowRate > 0)) { // calculate directly affected variables at faulty case: EvapOutletTemp, EvapMassFlowRate, QEvaporator int FaultIndex = this->FaultyChillerSWTIndex; - bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LEAVINGSETPOINTMODULATED); + bool VarFlowFlag = (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated); FaultsManager::FaultsChillerSWTSensor(FaultIndex) .CalFaultChillerSWT(VarFlowFlag, this->FaultyChillerSWTOffset, @@ -6999,7 +6999,7 @@ namespace PlantChillers { // Some other component set the flow to 0. No reason to continue with calculations. if (this->EvapMassFlowRate == 0.0) { MyLoad = 0.0; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -7084,7 +7084,7 @@ namespace PlantChillers { this->Power = 0.0; this->PrintMessage = false; } - if (this->QEvaporator == 0.0 && this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->QEvaporator == 0.0 && this->CondenserType == DataPlant::CondenserType::EvapCooled) { CalcBasinHeaterPower(state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); } @@ -7098,7 +7098,7 @@ namespace PlantChillers { // If not air or evap cooled then set to the condenser node that is attached to a cooling tower Real64 const CondInletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { CpCond = FluidProperties::GetSpecificHeatGlycol( state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { @@ -7121,7 +7121,7 @@ namespace PlantChillers { // check for problems BG 9/12/06 (deal with observed negative energy results) if (this->Energy < 0.0) { // there is a serious problem - if (this->CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { // first check for run away condenser loop temps (only reason yet to be observed for this?) if (CondInletTemp > 70.0) { ShowSevereError(state, "CalcConstCOPChillerModel: Condenser loop inlet temperatures over 70.0 C for ConstCOPChiller=" + this->Name); @@ -7160,7 +7160,7 @@ namespace PlantChillers { this->CondOutletTemp = DataLoopNode::Node(this->CondInletNodeNum).Temp; this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp; this->ActualCOP = 0.0; - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = this->BasinHeaterPower; this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; } @@ -7177,7 +7177,7 @@ namespace PlantChillers { } else { this->ActualCOP = 0.0; } - if (this->CondenserType == DataPlant::CondenserType::EVAPCOOLED) { + if (this->CondenserType == DataPlant::CondenserType::EvapCooled) { this->BasinHeaterPower = this->BasinHeaterPower; this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; } diff --git a/src/EnergyPlus/PlantChillers.hh b/src/EnergyPlus/PlantChillers.hh index ac6ef60c1a1..478691921f3 100644 --- a/src/EnergyPlus/PlantChillers.hh +++ b/src/EnergyPlus/PlantChillers.hh @@ -150,7 +150,7 @@ namespace PlantChillers { // Default Constructor BaseChillerSpecs() : MinPartLoadRat(0.0), MaxPartLoadRat(1.0), OptPartLoadRat(1.0), TempDesCondIn(0.0), TempRiseCoef(0.0), TempDesEvapOut(0.0), - CondenserType(DataPlant::CondenserType::WATERCOOLED), NomCap(0.0), NomCapWasAutoSized(false), COP(0.0), FlowMode(DataPlant::FlowMode::NOTSET), + CondenserType(DataPlant::CondenserType::WaterCooled), NomCap(0.0), NomCapWasAutoSized(false), COP(0.0), FlowMode(DataPlant::FlowMode::Unassigned), ModulatedFlowSetToLoop(false), ModulatedFlowErrDone(false), HRSPErrDone(false), EvapInletNodeNum(0), EvapOutletNodeNum(0), CondInletNodeNum(0), CondOutletNodeNum(0), EvapVolFlowRate(0.0), EvapVolFlowRateWasAutoSized(false), EvapMassFlowRateMax(0.0), CondVolFlowRate(0.0), diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index afdeab40bdc..4bb7a5e095f 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -2207,7 +2207,6 @@ CurrentModuleObject, PlantOpSchemeName); Real64 LargestMinCompPLR; Real64 PlantPLR; Real64 CompLoad; - int LoadFlag; int BranchNum; int CompNum; @@ -2239,16 +2238,14 @@ CurrentModuleObject, PlantOpSchemeName); accrued_load_plr_values.reserve(NumCompsOnList); RemLoopDemand = LoopDemand; if (NumCompsOnList <= 0) return; - // set flag to specify optimal or sequential loading of equipment - LoadFlag = this_loop.LoadDistribution; if (std::abs(RemLoopDemand) < SmallLoad) { // no load to distribute } else { // OPTIMAL DISTRIBUTION SCHEME - switch (LoadFlag) { - case OptimalLoading: + switch (this_loop.LoadDistribution) { + case DataPlant::iLoadingScheme::Optimal: // step 1: load all machines to optimal PLR numAvail = 0; for (CompIndex = 1; CompIndex <= NumCompsOnList; ++CompIndex) { @@ -2331,7 +2328,7 @@ CurrentModuleObject, PlantOpSchemeName); break; // SEQUENTIALLOAD DISTRIBUTION SCHEME - case SequentialLoading: + case DataPlant::iLoadingScheme::Sequential: // step 1: Load machines in list order for (CompIndex = 1; CompIndex <= NumCompsOnList; ++CompIndex) { @@ -2366,7 +2363,7 @@ CurrentModuleObject, PlantOpSchemeName); break; // UNIFORMLOAD DISTRIBUTION SCHEME - case UniformLoading: + case DataPlant::iLoadingScheme::Uniform: // step 1: distribute load equally to all available machines numAvail = 0; @@ -2434,7 +2431,7 @@ CurrentModuleObject, PlantOpSchemeName); break; // UNIFORMPLR LOAD DISTRIBUTION SCHEME - case UniformPLRLoading: + case DataPlant::iLoadingScheme::UniformPLR: // Get total plant capacity and remove last component from list if load is less // than plant capacity at min PLR PlantCapacity = 0.0; @@ -2538,7 +2535,7 @@ CurrentModuleObject, PlantOpSchemeName); break; // SEQUENTIALUNIFORMPLR LOAD DISTRIBUTION SCHEME - case SequentialUniformPLRLoading: + case DataPlant::iLoadingScheme::SequentialUniformPLR: PlantCapacity = 0.0; PlantPLR = 0.0; @@ -2616,6 +2613,8 @@ CurrentModuleObject, PlantOpSchemeName); if (std::abs(RemLoopDemand) < SmallLoad) RemLoopDemand = 0.0; } + default: + assert(false); } } // load is small check diff --git a/src/EnergyPlus/StandardRatings.cc b/src/EnergyPlus/StandardRatings.cc index 0f298dc2873..24c63d9267f 100644 --- a/src/EnergyPlus/StandardRatings.cc +++ b/src/EnergyPlus/StandardRatings.cc @@ -341,7 +341,7 @@ namespace StandardRatings { // IPLV calculations: for (RedCapNum = 1; RedCapNum <= NumOfReducedCap; ++RedCapNum) { - if (CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (CondenserType == DataPlant::CondenserType::WaterCooled) { // get the entering water temperature for the reduced capacity test conditions if (ReducedPLR(RedCapNum) > 0.50) { EnteringWaterTempReduced = 8.0 + 22.0 * ReducedPLR(RedCapNum); @@ -349,7 +349,7 @@ namespace StandardRatings { EnteringWaterTempReduced = 19.0; } CondenserInletTemp = EnteringWaterTempReduced; - } else if (CondenserType == DataPlant::CondenserType::AIRCOOLED) { + } else if (CondenserType == DataPlant::CondenserType::AirCooled) { // get the outdoor air dry bulb temperature for the reduced capacity test conditions if (ReducedPLR(RedCapNum) > 0.3125) { EnteringAirDryBulbTempReduced = 3.0 + 32.0 * ReducedPLR(RedCapNum); @@ -692,10 +692,10 @@ namespace StandardRatings { GetCurveMinMaxValues(state, CapFTempCurveIndex, CapacityLWTempMin, CapacityLWTempMax, CapacityEnteringCondTempMin, CapacityEnteringCondTempMax); GetCurveMinMaxValues(state, EIRFTempCurveIndex, EIRLWTempMin, EIRLWTempMax, EIREnteringCondTempMin, EIREnteringCondTempMax); - if (CondenserType == DataPlant::CondenserType::WATERCOOLED) { + if (CondenserType == DataPlant::CondenserType::WaterCooled) { HighCondenserEnteringTempLimit = HighEWTemp; LowCondenserEnteringTempLimit = LowEWTemp; - } else if (CondenserType == DataPlant::CondenserType::AIRCOOLED) { + } else if (CondenserType == DataPlant::CondenserType::AirCooled) { HighCondenserEnteringTempLimit = OAHighEDBTemp; LowCondenserEnteringTempLimit = OAHighEDBTemp; } else { // Evaporatively Cooled Condenser diff --git a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc index 2cca9bd3198..6fce16c550b 100644 --- a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc @@ -1785,7 +1785,7 @@ TEST_F(EnergyPlusFixture, ChillerAbsorption_Calc) // check chiller inputs auto &thisChiller = state->dataChillerAbsorber->absorptionChillers(AbsChillNum); EXPECT_EQ(thisChiller.NomCap, 100000.0); - EXPECT_EQ(thisChiller.FlowMode, DataPlant::FlowMode::LEAVINGSETPOINTMODULATED); + EXPECT_EQ(thisChiller.FlowMode, DataPlant::FlowMode::LeavingSetpointModulated); // define local var int EvapInletNode = thisChiller.EvapInletNodeNum; int EvapOutletNode = thisChiller.EvapOutletNodeNum; diff --git a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc index 05d4a7071f2..b7141abb419 100644 --- a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc @@ -99,7 +99,7 @@ TEST_F(EnergyPlusFixture, ElectricEIRChiller_HeatRecoveryAutosizeTest) thisEIR.DesignHeatRecVolFlowRateWasAutoSized = true; thisEIR.HeatRecCapacityFraction = 0.5; thisEIR.HeatRecActive = true; - thisEIR.CondenserType = DataPlant::CondenserType::WATERCOOLED; + thisEIR.CondenserType = DataPlant::CondenserType::WaterCooled; thisEIR.CWLoopNum = 1; thisEIR.CDLoopNum = 2; thisEIR.EvapVolFlowRate = 1.0; diff --git a/tst/EnergyPlus/unit/PlantChillers.unit.cc b/tst/EnergyPlus/unit/PlantChillers.unit.cc index 9b06435f341..c2207937100 100644 --- a/tst/EnergyPlus/unit/PlantChillers.unit.cc +++ b/tst/EnergyPlus/unit/PlantChillers.unit.cc @@ -70,7 +70,7 @@ TEST_F(EnergyPlusFixture, GTChiller_HeatRecoveryAutosizeTest) state->dataPlantChillers->GTChiller(1).DesignHeatRecVolFlowRateWasAutoSized = true; state->dataPlantChillers->GTChiller(1).HeatRecCapacityFraction = 0.5; state->dataPlantChillers->GTChiller(1).HeatRecActive = true; - state->dataPlantChillers->GTChiller(1).CondenserType = DataPlant::CondenserType::WATERCOOLED; + state->dataPlantChillers->GTChiller(1).CondenserType = DataPlant::CondenserType::WaterCooled; state->dataPlantChillers->GTChiller(1).CWLoopNum = 1; state->dataPlantChillers->GTChiller(1).CDLoopNum = 2; state->dataPlantChillers->GTChiller(1).EvapVolFlowRate = 1.0; @@ -107,7 +107,7 @@ TEST_F(EnergyPlusFixture, EngineDrivenChiller_HeatRecoveryAutosizeTest) state->dataPlantChillers->EngineDrivenChiller(1).DesignHeatRecVolFlowRateWasAutoSized = true; state->dataPlantChillers->EngineDrivenChiller(1).HeatRecCapacityFraction = 0.5; state->dataPlantChillers->EngineDrivenChiller(1).HeatRecActive = true; - state->dataPlantChillers->EngineDrivenChiller(1).CondenserType = DataPlant::CondenserType::WATERCOOLED; + state->dataPlantChillers->EngineDrivenChiller(1).CondenserType = DataPlant::CondenserType::WaterCooled; state->dataPlantChillers->EngineDrivenChiller(1).CWLoopNum = 1; state->dataPlantChillers->EngineDrivenChiller(1).CDLoopNum = 2; state->dataPlantChillers->EngineDrivenChiller(1).EvapVolFlowRate = 1.0; diff --git a/tst/EnergyPlus/unit/StandardRatings.unit.cc b/tst/EnergyPlus/unit/StandardRatings.unit.cc index a6bb6827af1..56be2531f92 100644 --- a/tst/EnergyPlus/unit/StandardRatings.unit.cc +++ b/tst/EnergyPlus/unit/StandardRatings.unit.cc @@ -249,7 +249,7 @@ TEST_F(EnergyPlusFixture, ChillerIPLVTest) state->dataChillerElectricEIR->ElectricEIRChiller(1).Name = "Air Cooled Chiller"; state->dataChillerElectricEIR->ElectricEIRChiller(1).RefCap = 216000; // W state->dataChillerElectricEIR->ElectricEIRChiller(1).RefCOP = 2.81673861898309; // W/W - state->dataChillerElectricEIR->ElectricEIRChiller(1).CondenserType = DataPlant::CondenserType::AIRCOOLED; + state->dataChillerElectricEIR->ElectricEIRChiller(1).CondenserType = DataPlant::CondenserType::AirCooled; state->dataChillerElectricEIR->ElectricEIRChiller(1).MinUnloadRat = 0.15; int CurveNum; From 157bfcd1a0405f101d8b41c70ab59eab654026c8 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 4 Jan 2021 13:27:46 -0700 Subject: [PATCH 03/17] moving DataPlant to state --- src/EnergyPlus/ChillerElectricEIR.cc | 2 +- src/EnergyPlus/ChillerReformulatedEIR.cc | 2 +- src/EnergyPlus/HWBaseboardRadiator.cc | 9 ++--- src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc | 6 ++-- src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc | 6 ++-- src/EnergyPlus/HeatPumpWaterToWaterSimple.cc | 6 ++-- src/EnergyPlus/Plant/Component.hh | 12 +++---- src/EnergyPlus/Plant/DataPlant.cc | 17 ---------- src/EnergyPlus/Plant/DataPlant.hh | 34 +++---------------- src/EnergyPlus/Plant/Enums.hh | 30 ++++++++++++++++ src/EnergyPlus/PlantChillers.cc | 8 ++--- src/EnergyPlus/PlantCondLoopOperation.cc | 12 +++---- .../PlantHeatExchangerFluidToFluid.cc | 6 ++-- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 4 +-- src/EnergyPlus/PlantUtilities.cc | 11 +++--- src/EnergyPlus/PlantUtilities.hh | 3 +- src/EnergyPlus/SteamBaseboardRadiator.cc | 9 ++--- 17 files changed, 79 insertions(+), 98 deletions(-) diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 3822afeba68..702c9180ce7 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -1720,7 +1720,7 @@ namespace ChillerElectricEIR { this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) { diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index f837bb0e5d3..bba5aa7928a 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -1906,7 +1906,7 @@ namespace ChillerReformulatedEIR { this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index d99a52a3bad..d3552e726cf 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -1793,9 +1793,6 @@ namespace HWBaseboardRadiator { // Using/Aliasing using DataPlant::ccSimPlantEquipTypes; - using DataPlant::CriteriaType_HeatTransferRate; - using DataPlant::CriteriaType_MassFlowRate; - using DataPlant::CriteriaType_Temperature; using DataPlant::TypeOf_Baseboard_Rad_Conv_Water; using PlantUtilities::PullCompInterconnectTrigger; @@ -1852,7 +1849,7 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).BBLoadReSimIndex, HWBaseboard(BaseboardNum).LoopNum, HWBaseboard(BaseboardNum).LoopSideNum, - CriteriaType_HeatTransferRate, + DataPlant::iCriteriaType::HeatTransferRate, HWBaseboard(BaseboardNum).Power); PullCompInterconnectTrigger(HWBaseboard(BaseboardNum).LoopNum, @@ -1862,7 +1859,7 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).BBMassFlowReSimIndex, HWBaseboard(BaseboardNum).LoopNum, HWBaseboard(BaseboardNum).LoopSideNum, - CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, HWBaseboard(BaseboardNum).WaterMassFlowRate); PullCompInterconnectTrigger(HWBaseboard(BaseboardNum).LoopNum, @@ -1872,7 +1869,7 @@ namespace HWBaseboardRadiator { HWBaseboard(BaseboardNum).BBInletTempFlowReSimIndex, HWBaseboard(BaseboardNum).LoopNum, HWBaseboard(BaseboardNum).LoopSideNum, - CriteriaType_Temperature, + DataPlant::iCriteriaType::Temperature, HWBaseboard(BaseboardNum).WaterOutletTemp); } diff --git a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc index 914cc2fa8ba..0bcfaa8629d 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc @@ -672,7 +672,7 @@ namespace HeatPumpWaterToWaterCOOLING { this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); // now initialize simulation variables for "heat pump off" this->QLoad = 0.0; @@ -731,7 +731,7 @@ namespace HeatPumpWaterToWaterCOOLING { this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); this->QLoad = 0.0; this->QSource = 0.0; @@ -749,7 +749,7 @@ namespace HeatPumpWaterToWaterCOOLING { this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); } diff --git a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc index a15d6688d51..81beefeb197 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc @@ -628,7 +628,7 @@ namespace HeatPumpWaterToWaterHEATING { this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); // now initialize simulation variables for "heat pump off" this->LoadSideWaterOutletTemp = this->LoadSideWaterInletTemp; @@ -678,7 +678,7 @@ namespace HeatPumpWaterToWaterHEATING { this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); this->LoadSideWaterOutletTemp = this->LoadSideWaterInletTemp; this->SourceSideWaterOutletTemp = this->SourceSideWaterInletTemp; @@ -691,7 +691,7 @@ namespace HeatPumpWaterToWaterHEATING { this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->SourceSideWaterMassFlowRate); } diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc index 6381ef16c6f..20eecc4bb08 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -853,7 +853,7 @@ namespace HeatPumpWaterToWaterSimple { this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, // IS THIS RIGHT? - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->reportSourceSideMassFlowRate); // Set flows if the heat pump is running } else { // the heat pump must run @@ -903,7 +903,7 @@ namespace HeatPumpWaterToWaterSimple { this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->reportSourceSideMassFlowRate); return; } @@ -914,7 +914,7 @@ namespace HeatPumpWaterToWaterSimple { this->CondMassFlowIndex, this->SourceLoopNum, this->LoadLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->reportSourceSideMassFlowRate); } diff --git a/src/EnergyPlus/Plant/Component.hh b/src/EnergyPlus/Plant/Component.hh index d0c05ac7340..0e9a6cfa5e1 100644 --- a/src/EnergyPlus/Plant/Component.hh +++ b/src/EnergyPlus/Plant/Component.hh @@ -51,8 +51,8 @@ #include #include #include -#include #include +#include namespace EnergyPlus { @@ -95,7 +95,7 @@ namespace DataPlant { Real64 MaxOutletTemp; // Component exit upper limit temperature bool FreeCoolCntrlShutDown; // true if component was shut down because of free cooling Real64 FreeCoolCntrlMinCntrlTemp; // current control temp value for free cooling controls - int FreeCoolCntrlMode; // type of sensor used for free cooling controls + DataPlant::iFreeCoolControlMode FreeCoolCntrlMode; // type of sensor used for free cooling controls int FreeCoolCntrlNodeNum; // chiller condenser inlet node number for free cooling controls int IndexInLoopSidePumps; // If I'm a pump, this tells my index in PL(:)%LS(:)%Pumps Real64 TempDesCondIn; @@ -105,12 +105,12 @@ namespace DataPlant { // Default Constructor CompData() - : TypeOf_Num(0), CompNum(0), FlowCtrl(DataBranchAirLoopPlant::ControlTypeEnum::Unknown), FlowPriority(LoopFlowStatus_Unknown), ON(false), Available(false), - NodeNumIn(0), NodeNumOut(0), MyLoad(0.0), MaxLoad(0.0), MinLoad(0.0), OptLoad(0.0), SizFac(0.0), + : TypeOf_Num(0), CompNum(0), FlowCtrl(DataBranchAirLoopPlant::ControlTypeEnum::Unknown), FlowPriority(LoopFlowStatus_Unknown), ON(false), + Available(false), NodeNumIn(0), NodeNumOut(0), MyLoad(0.0), MaxLoad(0.0), MinLoad(0.0), OptLoad(0.0), SizFac(0.0), CurOpSchemeType(UnknownStatusOpSchemeType), NumOpSchemes(0), CurCompLevelOpNum(0), EquipDemand(0.0), EMSLoadOverrideOn(false), EMSLoadOverrideValue(0.0), HowLoadServed(HowMet_Unknown), MinOutletTemp(0.0), MaxOutletTemp(0.0), FreeCoolCntrlShutDown(false), - FreeCoolCntrlMinCntrlTemp(0.0), FreeCoolCntrlMode(0), FreeCoolCntrlNodeNum(0), IndexInLoopSidePumps(0), TempDesCondIn(0.0), - TempDesEvapOut(0.0), compPtr(nullptr) + FreeCoolCntrlMinCntrlTemp(0.0), FreeCoolCntrlMode(DataPlant::iFreeCoolControlMode::Unassigned), FreeCoolCntrlNodeNum(0), + IndexInLoopSidePumps(0), TempDesCondIn(0.0), TempDesEvapOut(0.0), compPtr(nullptr) { } diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index 8bf67a86b51..0d1e66dd3c7 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -62,23 +62,6 @@ namespace EnergyPlus::DataPlant { using DataLoopNode::NodeID; using DataLoopNode::SensedNodeFlagValue; - int const LoadRangeBasedMin(0); - int const LoadRangeBasedMax(2); - - // SimFlagCriteriaTypes for use in performing interconnect re-sim checks - int const CriteriaType_MassFlowRate(1); - int const CriteriaType_Temperature(2); - int const CriteriaType_HeatTransferRate(3); - - // Criteria percentage limits for determining re-simulation of connected loop sides - Real64 const CriteriaDelta_MassFlowRate(0.001); - Real64 const CriteriaDelta_Temperature(0.010); - Real64 const CriteriaDelta_HeatTransferRate(0.100); - - int const FreeCoolControlMode_WetBulb(1); // HeatExchanger:Hydronic model control type mode, outdoor wetbulb sensor - int const FreeCoolControlMode_DryBulb(2); // HeatExchanger:Hydronic model control type mode, outdoor drybulb sensor - int const FreeCoolControlMode_Loop(3); // HeatExchanger:Hydronic model control type mode, loop setpoint sensor - // Parameters for use in Loop Demand Calculation Schemes int const SingleSetPoint(1); // Uses a single temp setpoint to calculate loop demand int const DualSetPointDeadBand(2); // Uses a dual temp setpoint with a deadband between the high diff --git a/src/EnergyPlus/Plant/DataPlant.hh b/src/EnergyPlus/Plant/DataPlant.hh index 1ba84f682d4..4ecc14898c7 100644 --- a/src/EnergyPlus/Plant/DataPlant.hh +++ b/src/EnergyPlus/Plant/DataPlant.hh @@ -72,22 +72,13 @@ namespace DataPlant { // Using/Aliasing using DataLoopNode::SensedNodeFlagValue; - extern int const LoadRangeBasedMin; - extern int const LoadRangeBasedMax; - - // SimFlagCriteriaTypes for use in performing interconnect re-sim checks - extern int const CriteriaType_MassFlowRate; - extern int const CriteriaType_Temperature; - extern int const CriteriaType_HeatTransferRate; + constexpr int LoadRangeBasedMin(0); + constexpr int LoadRangeBasedMax(2); // Criteria percentage limits for determining re-simulation of connected loop sides - extern Real64 const CriteriaDelta_MassFlowRate; - extern Real64 const CriteriaDelta_Temperature; - extern Real64 const CriteriaDelta_HeatTransferRate; - - extern int const FreeCoolControlMode_WetBulb; // HeatExchanger:Hydronic model control type mode, outdoor wetbulb sensor - extern int const FreeCoolControlMode_DryBulb; // HeatExchanger:Hydronic model control type mode, outdoor drybulb sensor - extern int const FreeCoolControlMode_Loop; // HeatExchanger:Hydronic model control type mode, loop setpoint sensor + constexpr Real64 CriteriaDelta_MassFlowRate(0.001); + constexpr Real64 CriteriaDelta_Temperature(0.010); + constexpr Real64 CriteriaDelta_HeatTransferRate(0.100); // Parameters for use in Loop Demand Calculation Schemes extern int const SingleSetPoint; // Uses a single temp setpoint to calculate loop demand @@ -252,21 +243,6 @@ namespace DataPlant { extern int PlantManageHalfLoopCalls; // tracks number of half loop calls // Enum classes - enum class FlowMode - { - Unassigned, - Constant, - NotModulated, - LeavingSetpointModulated, - }; - - enum class CondenserType - { - Unassigned, - AirCooled, - WaterCooled, - EvapCooled, - }; // Object Data extern Array1D PlantLoop; diff --git a/src/EnergyPlus/Plant/Enums.hh b/src/EnergyPlus/Plant/Enums.hh index 2421287cf70..c5869fd9fc5 100644 --- a/src/EnergyPlus/Plant/Enums.hh +++ b/src/EnergyPlus/Plant/Enums.hh @@ -112,6 +112,36 @@ namespace EnergyPlus::DataPlant { SequentialUniformPLR, // Sequential Uniform PLR Load Distribution Scheme }; + enum class FlowMode + { + Unassigned, + Constant, + NotModulated, + LeavingSetpointModulated, + }; + + enum class CondenserType + { + Unassigned, + AirCooled, + WaterCooled, + EvapCooled, + }; + + // SimFlagCriteriaTypes for use in performing interconnect re-sim checks + enum class iCriteriaType { + MassFlowRate, + Temperature, + HeatTransferRate, + }; + + enum class iFreeCoolControlMode { + Unassigned, + WetBulb, // HeatExchanger:Hydronic model control type mode, outdoor wetbulb sensor + DryBulb, // HeatExchanger:Hydronic model control type mode, outdoor drybulb sensor + Loop, // HeatExchanger:Hydronic model control type mode, loop setpoint sensor + }; + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index 8aace7f4772..f2615226636 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -1408,7 +1408,7 @@ namespace PlantChillers { this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; } @@ -3375,7 +3375,7 @@ namespace PlantChillers { this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; } @@ -5276,7 +5276,7 @@ namespace PlantChillers { this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; @@ -6876,7 +6876,7 @@ namespace PlantChillers { this->CondMassFlowIndex, this->CDLoopNum, this->CDLoopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->CondMassFlowRate); if (this->CondMassFlowRate < DataBranchAirLoopPlant::MassFlowTolerance) return; diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 4bb7a5e095f..fe28b24bda0 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -2764,11 +2764,11 @@ CurrentModuleObject, PlantOpSchemeName); TinLowLimit = this_component.FreeCoolCntrlMinCntrlTemp; { auto const SELECT_CASE_var1(this_component.FreeCoolCntrlMode); - if (SELECT_CASE_var1 == FreeCoolControlMode_WetBulb) { + if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::WetBulb) { Tsensor = state.dataEnvrn->OutWetBulbTemp; - } else if (SELECT_CASE_var1 == FreeCoolControlMode_DryBulb) { + } else if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::DryBulb) { Tsensor = state.dataEnvrn->OutDryBulbTemp; - } else if (SELECT_CASE_var1 == FreeCoolControlMode_Loop) { + } else if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::Loop) { ControlNodeNum = this_component.FreeCoolCntrlNodeNum; if (ControlNodeNum > 0) { Tsensor = Node(ControlNodeNum).TempLastTimestep; // use lagged value for stability @@ -2793,11 +2793,11 @@ CurrentModuleObject, PlantOpSchemeName); TinLowLimit = this_component.FreeCoolCntrlMinCntrlTemp; { auto const SELECT_CASE_var1(this_component.FreeCoolCntrlMode); - if (SELECT_CASE_var1 == FreeCoolControlMode_WetBulb) { + if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::WetBulb) { Tsensor = state.dataEnvrn->OutWetBulbTemp; - } else if (SELECT_CASE_var1 == FreeCoolControlMode_DryBulb) { + } else if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::DryBulb) { Tsensor = state.dataEnvrn->OutDryBulbTemp; - } else if (SELECT_CASE_var1 == FreeCoolControlMode_Loop) { + } else if (SELECT_CASE_var1 == DataPlant::iFreeCoolControlMode::Loop) { ControlNodeNum = this_component.FreeCoolCntrlNodeNum; if (ControlNodeNum > 0) { Tsensor = Node(ControlNodeNum).TempLastTimestep; // use lagged value for stability diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc index 35ae962cbf1..ec13e75ad9d 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -732,13 +732,13 @@ namespace PlantHeatExchangerFluidToFluid { auto const SELECT_CASE_var(this->ControlSignalTemp); if (SELECT_CASE_var == WetBulbTemperature) { DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = - DataPlant::FreeCoolControlMode_WetBulb; + DataPlant::iFreeCoolControlMode::WetBulb; } else if (SELECT_CASE_var == DryBulbTemperature) { DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = - DataPlant::FreeCoolControlMode_DryBulb; + DataPlant::iFreeCoolControlMode::DryBulb; } else if (SELECT_CASE_var == LoopTemperature) { DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = - DataPlant::FreeCoolControlMode_Loop; + DataPlant::iFreeCoolControlMode::Loop; DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlNodeNum = this->OtherCompDemandSideLoop.inletNodeNum; } diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index ad740bae570..fbb802f7ed1 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -186,7 +186,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { this->condMassFlowRateTriggerIndex, this->sourceSideLocation.loopNum, this->sourceSideLocation.loopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->sourceSideMassFlowRate); // Set flows if the heat pump is running } else { // the heat pump must run @@ -234,7 +234,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { this->condMassFlowRateTriggerIndex, this->sourceSideLocation.loopNum, this->sourceSideLocation.loopSideNum, - DataPlant::CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, this->sourceSideMassFlowRate); } } diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index 5f2ed375c0f..0f5772d1565 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -950,7 +950,7 @@ namespace PlantUtilities { int &UniqueCriteriaCheckIndex, // An integer given to this particular check int const ConnectedLoopNum, // Component's interconnected loop number int const ConnectedLoopSide, // Component's interconnected loop side number - int const CriteriaType, // The criteria check to use, see DataPlant: SimFlagCriteriaTypes + DataPlant::iCriteriaType const CriteriaType, // The criteria check to use, see DataPlant: SimFlagCriteriaTypes Real64 const CriteriaValue // The value of the criteria check to evaluate ) { @@ -983,9 +983,6 @@ namespace PlantUtilities { using DataPlant::CriteriaDelta_HeatTransferRate; using DataPlant::CriteriaDelta_MassFlowRate; using DataPlant::CriteriaDelta_Temperature; - using DataPlant::CriteriaType_HeatTransferRate; - using DataPlant::CriteriaType_MassFlowRate; - using DataPlant::CriteriaType_Temperature; using DataPlant::PlantLoop; CriteriaData CurCriteria; // for convenience @@ -1026,17 +1023,17 @@ namespace PlantUtilities { // Initialize, then check if we are out of range { auto const SELECT_CASE_var(CriteriaType); - if (SELECT_CASE_var == CriteriaType_MassFlowRate) { + if (SELECT_CASE_var == DataPlant::iCriteriaType::MassFlowRate) { if (std::abs(CurCriteria.ThisCriteriaCheckValue - CriteriaValue) > CriteriaDelta_MassFlowRate) { PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; } - } else if (SELECT_CASE_var == CriteriaType_Temperature) { + } else if (SELECT_CASE_var == DataPlant::iCriteriaType::Temperature) { if (std::abs(CurCriteria.ThisCriteriaCheckValue - CriteriaValue) > CriteriaDelta_Temperature) { PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; } - } else if (SELECT_CASE_var == CriteriaType_HeatTransferRate) { + } else if (SELECT_CASE_var == DataPlant::iCriteriaType::HeatTransferRate) { if (std::abs(CurCriteria.ThisCriteriaCheckValue - CriteriaValue) > CriteriaDelta_HeatTransferRate) { PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; } diff --git a/src/EnergyPlus/PlantUtilities.hh b/src/EnergyPlus/PlantUtilities.hh index 808c64dc8eb..9dfd1c3fcfe 100644 --- a/src/EnergyPlus/PlantUtilities.hh +++ b/src/EnergyPlus/PlantUtilities.hh @@ -54,6 +54,7 @@ // EnergyPlus Headers #include #include +#include namespace EnergyPlus { @@ -113,7 +114,7 @@ namespace PlantUtilities { int &UniqueCriteriaCheckIndex, // An integer given to this particular check int const ConnectedLoopNum, // Component's interconnected loop number int const ConnectedLoopSide, // Component's interconnected loop side number - int const CriteriaType, // The criteria check to use, see DataPlant: SimFlagCriteriaTypes + DataPlant::iCriteriaType const CriteriaType, // The criteria check to use, see DataPlant: SimFlagCriteriaTypes Real64 const CriteriaValue // The value of the criteria check to evaluate ); diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index b1d60ce642c..0d776289d60 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -1443,9 +1443,6 @@ namespace SteamBaseboardRadiator { // Using/Aliasing using DataPlant::ccSimPlantEquipTypes; - using DataPlant::CriteriaType_HeatTransferRate; - using DataPlant::CriteriaType_MassFlowRate; - using DataPlant::CriteriaType_Temperature; using DataPlant::TypeOf_Baseboard_Rad_Conv_Steam; using PlantUtilities::PullCompInterconnectTrigger; @@ -1502,7 +1499,7 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).BBLoadReSimIndex, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopSideNum, - CriteriaType_HeatTransferRate, + DataPlant::iCriteriaType::HeatTransferRate, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).Power); PullCompInterconnectTrigger(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, @@ -1512,7 +1509,7 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).BBLoadReSimIndex, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopSideNum, - CriteriaType_MassFlowRate, + DataPlant::iCriteriaType::MassFlowRate, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamMassFlowRate); PullCompInterconnectTrigger(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, @@ -1522,7 +1519,7 @@ namespace SteamBaseboardRadiator { state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).BBLoadReSimIndex, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopSideNum, - CriteriaType_Temperature, + DataPlant::iCriteriaType::Temperature, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamOutletTemp); } From 08dd1600d2cb3a574ae64a4dec7e17f6c0d0fc11 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 4 Jan 2021 14:14:13 -0700 Subject: [PATCH 04/17] move LoopDemandSchemeCalc to enum --- src/EnergyPlus/BoilerSteam.cc | 28 ++++---- src/EnergyPlus/Boilers.cc | 8 +-- src/EnergyPlus/ChillerAbsorption.cc | 12 ++-- src/EnergyPlus/ChillerElectricEIR.cc | 24 +++---- src/EnergyPlus/ChillerExhaustAbsorption.cc | 8 +-- src/EnergyPlus/ChillerGasAbsorption.cc | 8 +-- src/EnergyPlus/ChillerIndirectAbsorption.cc | 12 ++-- src/EnergyPlus/ChillerReformulatedEIR.cc | 20 +++--- src/EnergyPlus/CondenserLoopTowers.cc | 16 ++--- src/EnergyPlus/EvaporativeFluidCoolers.cc | 8 +-- src/EnergyPlus/FluidCoolers.cc | 8 +-- src/EnergyPlus/IceThermalStorage.cc | 24 +++---- src/EnergyPlus/Plant/DataPlant.cc | 3 - src/EnergyPlus/Plant/DataPlant.hh | 3 - src/EnergyPlus/Plant/Enums.hh | 6 ++ src/EnergyPlus/Plant/Loop.cc | 8 +-- src/EnergyPlus/Plant/Loop.hh | 14 ++-- src/EnergyPlus/Plant/LoopSide.cc | 6 +- src/EnergyPlus/Plant/PlantManager.cc | 22 +++---- src/EnergyPlus/PlantChillers.cc | 64 +++++++++---------- src/EnergyPlus/PlantCondLoopOperation.cc | 8 +-- .../PlantHeatExchangerFluidToFluid.cc | 8 +-- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 4 +- .../unit/ChillerElectricEIR.unit.cc | 2 +- .../unit/PlantCondLoopOperation.unit.cc | 10 +-- .../unit/PlantLoopHeatPumpEIR.unit.cc | 24 +++---- tst/EnergyPlus/unit/PlantUtilities.unit.cc | 24 +++---- 27 files changed, 190 insertions(+), 192 deletions(-) diff --git a/src/EnergyPlus/BoilerSteam.cc b/src/EnergyPlus/BoilerSteam.cc index c1f1c081a67..66c1fc8b182 100644 --- a/src/EnergyPlus/BoilerSteam.cc +++ b/src/EnergyPlus/BoilerSteam.cc @@ -410,10 +410,10 @@ namespace BoilerSteam { // could be removed with transition, testing , model change, period of being obsolete. { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(BoilerOutletNode).TempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { DataLoopNode::Node(BoilerOutletNode).TempSetPointLo = DataLoopNode::Node(DataPlant::PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPointLo; } @@ -582,9 +582,9 @@ namespace BoilerSteam { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPointLo; } } @@ -627,9 +627,9 @@ namespace BoilerSteam { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { BoilerDeltaTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint - DataLoopNode::Node(this->BoilerInletNodeNum).Temp; - } else { // DataPlant::DualSetPointDeadBand + } else { // DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand BoilerDeltaTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPointLo - DataLoopNode::Node(this->BoilerInletNodeNum).Temp; } @@ -658,9 +658,9 @@ namespace BoilerSteam { // Assume that it can meet the setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { BoilerDeltaTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint - DataLoopNode::Node(this->BoilerInletNodeNum).Temp; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { BoilerDeltaTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPointLo - DataLoopNode::Node(this->BoilerInletNodeNum).Temp; } @@ -669,9 +669,9 @@ namespace BoilerSteam { if (BoilerDeltaTemp < 0.0) { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPointLo; } } @@ -686,9 +686,9 @@ namespace BoilerSteam { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPointLo; } } @@ -709,9 +709,9 @@ namespace BoilerSteam { // Reset later , here just for calculating latent heat { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPointLo; } } diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index a63c511873e..9886b00bfc9 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -516,10 +516,10 @@ namespace EnergyPlus::Boilers { if ((this->FlowMode == DataPlant::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. - if (DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::SingleSetPoint) { + if (DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPoint; - } else { // DataPlant::DualSetPointDeadBand + } else { // DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPointLo = DataLoopNode::Node(DataPlant::PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPointLo; } @@ -779,9 +779,9 @@ namespace EnergyPlus::Boilers { // Calculate the Delta Temp from the inlet temp to the boiler outlet setpoint // Then find the flow rate and outlet temp - if (DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::SingleSetPoint) { + if (DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { BoilerDeltaTemp = DataLoopNode::Node(BoilerOutletNode).TempSetPoint - DataLoopNode::Node(BoilerInletNode).Temp; - } else { // DataPlant::DualSetPointDeadBand + } else { // DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand BoilerDeltaTemp = DataLoopNode::Node(BoilerOutletNode).TempSetPointLo - DataLoopNode::Node(BoilerInletNode).Temp; } diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index 31d7788a47d..c378f6b1d9f 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -1427,9 +1427,9 @@ namespace EnergyPlus::ChillerAbsorption { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { assert(false); @@ -1451,9 +1451,9 @@ namespace EnergyPlus::ChillerAbsorption { this->CWCompNum); { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -1500,7 +1500,7 @@ namespace EnergyPlus::ChillerAbsorption { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -1512,7 +1512,7 @@ namespace EnergyPlus::ChillerAbsorption { } else { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 702c9180ce7..ba520f3a852 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -1125,9 +1125,9 @@ namespace ChillerElectricEIR { Real64 THeatRecSetPoint(0.0); // tests set point node for proper set point value { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } else { assert(false); @@ -1740,7 +1740,7 @@ namespace ChillerElectricEIR { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -1753,7 +1753,7 @@ namespace ChillerElectricEIR { } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -1841,10 +1841,10 @@ namespace ChillerElectricEIR { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempLoad = this->EvapMassFlowRate * Cp * (DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint); - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { TempLoad = this->EvapMassFlowRate * Cp * (DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi); } else { @@ -1908,9 +1908,9 @@ namespace ChillerElectricEIR { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { assert(false); @@ -1934,9 +1934,9 @@ namespace ChillerElectricEIR { // Should we recalculate this with the corrected setpoint? { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -2234,9 +2234,9 @@ namespace ChillerElectricEIR { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } else { assert(false); diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index c50bbb0b7b1..8a8b22bd7c7 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -1377,9 +1377,9 @@ namespace ChillerExhaustAbsorption { lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPointHi; } else { assert(false); @@ -1785,9 +1785,9 @@ namespace ChillerExhaustAbsorption { lHotWaterMassFlowRate = DataLoopNode::Node(lHeatReturnNodeNum).MassFlowRate; { auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { HeatSupplySetPointTemp = DataLoopNode::Node(lHeatSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { HeatSupplySetPointTemp = DataLoopNode::Node(lHeatSupplyNodeNum).TempSetPointLo; } else { assert(false); diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index 832c6a771fd..b0e8e54204e 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -1349,9 +1349,9 @@ namespace ChillerGasAbsorption { // Commenting this could be cause of diffs - lCondWaterMassFlowRate = DataLoopNode::Node(lCondReturnNodeNum).MassFlowRate; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPointHi; } else { assert(false); @@ -1699,9 +1699,9 @@ namespace ChillerGasAbsorption { lHotWaterMassFlowRate = DataLoopNode::Node(lHeatReturnNodeNum).MassFlowRate; { auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { HeatSupplySetPointTemp = DataLoopNode::Node(lHeatSupplyNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { HeatSupplySetPointTemp = DataLoopNode::Node(lHeatSupplyNodeNum).TempSetPointLo; } else { assert(false); diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index 160766700bf..4bb80b59cf7 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -1673,9 +1673,9 @@ namespace ChillerIndirectAbsorption { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { assert(false); @@ -1697,9 +1697,9 @@ namespace ChillerIndirectAbsorption { this->CWCompNum); { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -1743,7 +1743,7 @@ namespace ChillerIndirectAbsorption { } else { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -1755,7 +1755,7 @@ namespace ChillerIndirectAbsorption { } else { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index bba5aa7928a..1084ac93102 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -1667,9 +1667,9 @@ namespace ChillerReformulatedEIR { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } else { assert(false); @@ -1915,7 +1915,7 @@ 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) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || @@ -1925,7 +1925,7 @@ namespace ChillerReformulatedEIR { } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || @@ -2045,10 +2045,10 @@ namespace ChillerReformulatedEIR { } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { assert(false); @@ -2072,9 +2072,9 @@ namespace ChillerReformulatedEIR { // Should we recalculate this with the corrected setpoint? { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -2524,7 +2524,7 @@ namespace ChillerReformulatedEIR { { auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || @@ -2534,7 +2534,7 @@ namespace ChillerReformulatedEIR { } else { // use plant loop overall setpoint EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) || diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 4e8de845aa7..7519e2d51f4 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -4056,13 +4056,13 @@ namespace CondenserLoopTowers { Real64 TempSetPoint = 0.0; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if (this->SetpointIsOnOutlet) { TempSetPoint = DataLoopNode::Node(this->WaterOutletNodeNum).TempSetPoint; } else { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if (this->SetpointIsOnOutlet) { TempSetPoint = DataLoopNode::Node(this->WaterOutletNodeNum).TempSetPointHi; } else { @@ -4358,13 +4358,13 @@ namespace CondenserLoopTowers { Real64 TempSetPoint = 0.0; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if (this->SetpointIsOnOutlet) { TempSetPoint = DataLoopNode::Node(this->WaterOutletNodeNum).TempSetPoint; } else { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if (this->SetpointIsOnOutlet) { TempSetPoint = DataLoopNode::Node(this->WaterOutletNodeNum).TempSetPointHi; } else { @@ -4618,9 +4618,9 @@ namespace CondenserLoopTowers { Real64 TempSetPoint(0.0); // Outlet water temperature setpoint (C) { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } else { assert(false); @@ -5321,9 +5321,9 @@ namespace CondenserLoopTowers { Real64 TempSetPoint(0.0); // local temporary for loop setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } else { assert(false); diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 336f3ca0ad9..f3e0383d9de 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -1960,9 +1960,9 @@ namespace EvaporativeFluidCoolers { AirFlowRate = 0.0; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } @@ -2140,9 +2140,9 @@ namespace EvaporativeFluidCoolers { Real64 TempSetPoint = 0.0; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index c2b6f086567..84cff3fdf25 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -1479,9 +1479,9 @@ namespace FluidCoolers { this->OutletWaterTemp = DataLoopNode::Node(waterInletNode).Temp; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } @@ -1585,9 +1585,9 @@ namespace FluidCoolers { this->OutletWaterTemp = DataLoopNode::Node(waterInletNode).Temp; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } diff --git a/src/EnergyPlus/IceThermalStorage.cc b/src/EnergyPlus/IceThermalStorage.cc index 47c3e44359d..ac70ac7a6f1 100644 --- a/src/EnergyPlus/IceThermalStorage.cc +++ b/src/EnergyPlus/IceThermalStorage.cc @@ -233,9 +233,9 @@ namespace IceThermalStorage { Real64 TempIn = DataLoopNode::Node(this->PltInletNodeNum).Temp; { auto const SELECT_CASE_var1(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var1 == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPt = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var1 == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPt = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPointHi; } else { assert(false); @@ -354,9 +354,9 @@ namespace IceThermalStorage { Real64 TempSetPt(0.0); // Setpoint temperature defined by loop controls [C] { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->PlantLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPt = DataLoopNode::Node(NodeNumOut).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { TempSetPt = DataLoopNode::Node(NodeNumOut).TempSetPointHi; } else { assert(false); @@ -1356,9 +1356,9 @@ namespace IceThermalStorage { this->ITSOutletTemp = this->ITSInletTemp; //[C] { auto const SELECT_CASE_var1(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var1 == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->ITSOutletSetPointTemp = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var1 == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->ITSOutletSetPointTemp = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPointHi; } } @@ -1385,9 +1385,9 @@ namespace IceThermalStorage { this->ITSOutletTemp = this->ITSInletTemp; //[C] { auto const SELECT_CASE_var1(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var1 == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->ITSOutletSetPointTemp = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var1 == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->ITSOutletSetPointTemp = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPointHi; } } @@ -1533,9 +1533,9 @@ namespace IceThermalStorage { { auto const SELECT_CASE_var1(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var1 == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->ITSOutletSetPointTemp = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var1 == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->ITSOutletSetPointTemp = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPointHi; } } @@ -1624,9 +1624,9 @@ namespace IceThermalStorage { Real64 ITSOutletTemp_loc = 0.0; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { ITSOutletTemp_loc = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { ITSOutletTemp_loc = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPointHi; } else { assert(false); diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index 0d1e66dd3c7..f03c78e6085 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -62,9 +62,6 @@ namespace EnergyPlus::DataPlant { using DataLoopNode::NodeID; using DataLoopNode::SensedNodeFlagValue; - // Parameters for use in Loop Demand Calculation Schemes - int const SingleSetPoint(1); // Uses a single temp setpoint to calculate loop demand - int const DualSetPointDeadBand(2); // Uses a dual temp setpoint with a deadband between the high // and the low to calculate loop demand // Parameters for loop setpoint reference int const Air(1); diff --git a/src/EnergyPlus/Plant/DataPlant.hh b/src/EnergyPlus/Plant/DataPlant.hh index 4ecc14898c7..e69e7a038f2 100644 --- a/src/EnergyPlus/Plant/DataPlant.hh +++ b/src/EnergyPlus/Plant/DataPlant.hh @@ -80,9 +80,6 @@ namespace DataPlant { constexpr Real64 CriteriaDelta_Temperature(0.010); constexpr Real64 CriteriaDelta_HeatTransferRate(0.100); - // Parameters for use in Loop Demand Calculation Schemes - extern int const SingleSetPoint; // Uses a single temp setpoint to calculate loop demand - extern int const DualSetPointDeadBand; // Uses a dual temp setpoint with a deadband between the high // and the low to calculate loop demand // Parameters for loop setpoint reference extern int const Air; diff --git a/src/EnergyPlus/Plant/Enums.hh b/src/EnergyPlus/Plant/Enums.hh index c5869fd9fc5..02b9ea70d7f 100644 --- a/src/EnergyPlus/Plant/Enums.hh +++ b/src/EnergyPlus/Plant/Enums.hh @@ -142,6 +142,12 @@ namespace EnergyPlus::DataPlant { Loop, // HeatExchanger:Hydronic model control type mode, loop setpoint sensor }; + enum class iLoopDemandCalcScheme { + Unassigned, + SingleSetPoint, // Uses a single temp setpoint to calculate loop demand + DualSetPointDeadBand, // Uses a dual temp setpoint with a deadband between the high + }; + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/Plant/Loop.cc b/src/EnergyPlus/Plant/Loop.cc index 5032e644ac6..e74a6a4cbee 100644 --- a/src/EnergyPlus/Plant/Loop.cc +++ b/src/EnergyPlus/Plant/Loop.cc @@ -109,9 +109,7 @@ namespace EnergyPlus::DataPlant { using DataLoopNode::Node; using DataLoopNode::NodeType_Steam; using DataLoopNode::NodeType_Water; - using DataPlant::DualSetPointDeadBand; using DataPlant::LoopDemandTol; - using DataPlant::SingleSetPoint; using FluidProperties::GetSatEnthalpyRefrig; using FluidProperties::GetSpecificHeatGlycol; @@ -148,7 +146,7 @@ namespace EnergyPlus::DataPlant { { auto const SELECT_CASE_var(this->LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { // Pick up the loop setpoint temperature LoopSetPointTemperature = this->LoopSide(DataPlant::SupplySide).TempSetPoint; @@ -158,7 +156,7 @@ namespace EnergyPlus::DataPlant { // Calculate the demand on the loop LoadToLoopSetPoint = MassFlowRate * Cp * DeltaTemp; - } else if (SELECT_CASE_var == DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { // Get the range of setpoints LoopSetPointTemperatureHi = Node(this->TempSetPointNodeNum).TempSetPointHi; @@ -194,7 +192,7 @@ namespace EnergyPlus::DataPlant { { auto const SELECT_CASE_var(this->LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { // Pick up the loop setpoint temperature LoopSetPointTemperature = this->LoopSide(DataPlant::SupplySide).TempSetPoint; diff --git a/src/EnergyPlus/Plant/Loop.hh b/src/EnergyPlus/Plant/Loop.hh index 5f5053327f9..1539cb7b833 100644 --- a/src/EnergyPlus/Plant/Loop.hh +++ b/src/EnergyPlus/Plant/Loop.hh @@ -97,7 +97,7 @@ namespace DataPlant { Array1D OpScheme; // Operation scheme data DataPlant::iLoadingScheme LoadDistribution; // Load distribution scheme 1 for optimal, 2 for overloading int PlantSizNum; // index to corresponding plant sizing data array - int LoopDemandCalcScheme; // Load distribution scheme 1 SingleSetPoint, + DataPlant::iLoopDemandCalcScheme LoopDemandCalcScheme; // Load distribution scheme 1 SingleSetPoint, // 2 DualSetPointwithDeadBand int CommonPipeType; int EconPlantSideSensedNodeNum; @@ -132,12 +132,12 @@ namespace DataPlant { MaxTempErrIndex(0), MinVolFlowRate(0.0), MaxVolFlowRate(0.0), MaxVolFlowRateWasAutoSized(false), MinMassFlowRate(0.0), MaxMassFlowRate(0.0), Volume(0.0), VolumeWasAutoSized(false), // true if Volume was set to autocalculate CirculationTime(2.0), Mass(0.0), EMSCtrl(false), EMSValue(0.0), NumOpSchemes(0), - LoadDistribution(DataPlant::iLoadingScheme::Unassigned), PlantSizNum(0), LoopDemandCalcScheme(0), CommonPipeType(0), - EconPlantSideSensedNodeNum(0), EconCondSideSensedNodeNum(0), EconPlacement(0), EconBranch(0), EconComp(0), EconControlTempDiff(0.0), - LoopHasConnectionComp(false), TypeOfLoop(LoopType::Unassigned), PressureSimType(1), HasPressureComponents(false), PressureDrop(0.0), - UsePressureForPumpCalcs(false), PressureEffectiveK(0.0), CoolingDemand(0.0), HeatingDemand(0.0), DemandNotDispatched(0.0), - UnmetDemand(0.0), BypassFrac(0.0), InletNodeFlowrate(0.0), InletNodeTemperature(0.0), OutletNodeFlowrate(0.0), - OutletNodeTemperature(0.0), LastLoopSideSimulated(0) + LoadDistribution(DataPlant::iLoadingScheme::Unassigned), PlantSizNum(0), + LoopDemandCalcScheme(DataPlant::iLoopDemandCalcScheme::Unassigned), CommonPipeType(0), EconPlantSideSensedNodeNum(0), + EconCondSideSensedNodeNum(0), EconPlacement(0), EconBranch(0), EconComp(0), EconControlTempDiff(0.0), LoopHasConnectionComp(false), + TypeOfLoop(LoopType::Unassigned), PressureSimType(1), HasPressureComponents(false), PressureDrop(0.0), UsePressureForPumpCalcs(false), + PressureEffectiveK(0.0), CoolingDemand(0.0), HeatingDemand(0.0), DemandNotDispatched(0.0), UnmetDemand(0.0), BypassFrac(0.0), + InletNodeFlowrate(0.0), InletNodeTemperature(0.0), OutletNodeFlowrate(0.0), OutletNodeTemperature(0.0), LastLoopSideSimulated(0) { } diff --git a/src/EnergyPlus/Plant/LoopSide.cc b/src/EnergyPlus/Plant/LoopSide.cc index da5a775a4f6..dc300535651 100644 --- a/src/EnergyPlus/Plant/LoopSide.cc +++ b/src/EnergyPlus/Plant/LoopSide.cc @@ -721,7 +721,7 @@ namespace DataPlant { { auto const SELECT_CASE_var(thisPlantLoop.LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { // Pick up the loop setpoint temperature Real64 LoopSetPointTemperature = this->TempSetPoint; @@ -731,7 +731,7 @@ namespace DataPlant { // Calculate the demand on the loop LoadToLoopSetPoint = SumMdot * Cp * DeltaTemp; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { // Get the range of setpoints Real64 LoopSetPointTemperatureHi = DataLoopNode::Node(thisPlantLoop.TempSetPointNodeNum).TempSetPointHi; @@ -798,7 +798,7 @@ namespace DataPlant { { auto const SELECT_CASE_var(thisPlantLoop.LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { // Pick up the loop setpoint temperature Real64 LoopSetPointTemperature = this->TempSetPoint; diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index c25962ccdfc..9fb9d1bb069 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -514,7 +514,7 @@ namespace EnergyPlus { if (this_loop.TypeOfLoop == LoopType::Plant) { // Get the Loop Demand Calculation Scheme if (UtilityRoutines::SameString(Alpha(16), "SingleSetpoint")) { - this_loop.LoopDemandCalcScheme = SingleSetPoint; + this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; } else if (UtilityRoutines::SameString(Alpha(16), "DualSetpointDeadband")) { if (this_loop.FluidType == NodeType_Steam) { ShowWarningError(state, @@ -523,20 +523,20 @@ namespace EnergyPlus { cAlphaFieldNames(2) + "= Steam"); ShowContinueError(state, "Will reset " + cAlphaFieldNames(16) + " = SingleSetPoint and simulation will continue."); - this_loop.LoopDemandCalcScheme = SingleSetPoint; + this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; } else { - this_loop.LoopDemandCalcScheme = DualSetPointDeadBand; + this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand; } } else if (UtilityRoutines::SameString(Alpha(16), "")) { - this_loop.LoopDemandCalcScheme = SingleSetPoint; + this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; } else { ShowWarningError(state, RoutineName + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); ShowContinueError(state, "..." + cAlphaFieldNames(16) + "=\"" + Alpha(16) + "\"."); ShowContinueError(state, "Will default to SingleSetPoint."); // TODO rename point - this_loop.LoopDemandCalcScheme = SingleSetPoint; + this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; } } else if (this_loop.TypeOfLoop == LoopType::Condenser) { - this_loop.LoopDemandCalcScheme = SingleSetPoint; + this_loop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; } // When Commonpipe is allowed in condenser loop modify this code. Sankar 06/29/2009 @@ -2319,7 +2319,7 @@ namespace EnergyPlus { for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { // check if setpoints being placed on node properly - if (PlantLoop(LoopNum).LoopDemandCalcScheme == DualSetPointDeadBand) { + if (PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if (Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, @@ -2464,10 +2464,10 @@ namespace EnergyPlus { { auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { LoopSetPointTemp = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { // Get the range of setpoints LoopSetPointTemperatureHi = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi; LoopSetPointTemperatureLo = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointLo; @@ -2641,7 +2641,7 @@ namespace EnergyPlus { PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPoint = LoopSetPointTemp; // Update supply side hi-lo setpoints for dual SP control - if (PlantLoop(LoopNum).LoopDemandCalcScheme == DualSetPointDeadBand) { + if (PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { LoopSetPointTempHi = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi; LoopSetPointTempLo = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointLo; LoopSetPointTempHi = min(LoopMaxTemp, LoopSetPointTempHi); @@ -2680,7 +2680,7 @@ namespace EnergyPlus { } } else { // no secondary loop, so use supply side loop SP on demand side too. PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPoint = LoopSetPointTemp; - if (PlantLoop(LoopNum).LoopDemandCalcScheme == DualSetPointDeadBand) { + if (PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointHi = LoopSetPointTempHi; PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointLo = LoopSetPointTempLo; } diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index f2615226636..247eafef384 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -829,10 +829,10 @@ namespace PlantChillers { this->ModulatedFlowSetToLoop = true; { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } @@ -919,9 +919,9 @@ namespace PlantChillers { Real64 THeatRecSetPoint(0.0); { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } } @@ -967,10 +967,10 @@ namespace PlantChillers { // could be removed with transition, testing , model change, period of being obsolete. { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } @@ -1586,9 +1586,9 @@ namespace PlantChillers { Real64 EvapDeltaTemp(0.0); { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -1610,9 +1610,9 @@ namespace PlantChillers { this->CWCompNum); { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -1683,7 +1683,7 @@ namespace PlantChillers { Real64 TempEvapOutSetPoint(0.0); // C - evaporator outlet temperature setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -1695,7 +1695,7 @@ namespace PlantChillers { } else { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -1924,9 +1924,9 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPointHi; } } @@ -3489,9 +3489,9 @@ namespace PlantChillers { Real64 EvapDeltaTemp(0.0); { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -3512,9 +3512,9 @@ namespace PlantChillers { this->CWCompNum); { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -3589,7 +3589,7 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -3601,7 +3601,7 @@ namespace PlantChillers { } else { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -5379,9 +5379,9 @@ namespace PlantChillers { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -5402,9 +5402,9 @@ namespace PlantChillers { this->CWCompNum); { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } @@ -5468,7 +5468,7 @@ namespace PlantChillers { } else { // No subcooling in this case.No recalculation required.Still need to check chiller low temp limit { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -5480,7 +5480,7 @@ namespace PlantChillers { } else { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -6703,7 +6703,7 @@ namespace PlantChillers { { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -6715,7 +6715,7 @@ namespace PlantChillers { } else { TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) @@ -6923,10 +6923,10 @@ namespace PlantChillers { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = std::abs(DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint); - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { EvapDeltaTemp = std::abs(DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi); } @@ -6948,9 +6948,9 @@ namespace PlantChillers { this->CWCompNum); { auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } } diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index fe28b24bda0..f2a7d8aeb4c 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -1480,7 +1480,7 @@ CurrentModuleObject, PlantOpSchemeName); // check that setpoint node has valid setpoint managers or EMS { auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if (Node(PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPoint == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { @@ -1516,7 +1516,7 @@ CurrentModuleObject, PlantOpSchemeName); } } } - } else if (SELECT_CASE_var == DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == CoolingOp) { if (Node(PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointHi == SensedNodeFlagValue) { @@ -2928,9 +2928,9 @@ CurrentModuleObject, PlantOpSchemeName); { auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPt = Node(SetPtNode).TempSetPoint; - } else if (SELECT_CASE_var == DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if (PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == CoolingOp) { TempSetPt = Node(SetPtNode).TempSetPointHi; } else if (PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == HeatingOp) { diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc index ec13e75ad9d..416de1540a6 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -1000,10 +1000,10 @@ namespace PlantHeatExchangerFluidToFluid { } else { // don't rely on sizing, use loop setpoints // loop supply side - if (DataPlant::PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == DataPlant::SingleSetPoint) { + if (DataPlant::PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(this->SupplySideLoop.inletNodeNum).Temp = DataLoopNode::Node(DataPlant::PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPoint; - } else if (DataPlant::PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == DataPlant::DualSetPointDeadBand) { + } else if (DataPlant::PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { DataLoopNode::Node(this->SupplySideLoop.inletNodeNum).Temp = (DataLoopNode::Node(DataPlant::PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPointHi + DataLoopNode::Node(DataPlant::PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPointLo) / @@ -1015,10 +1015,10 @@ namespace PlantHeatExchangerFluidToFluid { DataLoopNode::Node(this->DemandSideLoop.inletNodeNum).Temp = DataSizing::PlantSizData(PltSizNumDmdSide).ExitTemp; } else { // don't rely on sizing, use loop setpoints // loop demand side - if (DataPlant::PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == DataPlant::SingleSetPoint) { + if (DataPlant::PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(this->DemandSideLoop.inletNodeNum).Temp = DataLoopNode::Node(DataPlant::PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPoint; - } else if (DataPlant::PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == DataPlant::DualSetPointDeadBand) { + } else if (DataPlant::PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { DataLoopNode::Node(this->DemandSideLoop.inletNodeNum).Temp = (DataLoopNode::Node(DataPlant::PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPointHi + DataLoopNode::Node(DataPlant::PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPointLo) / diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index fbb802f7ed1..0b05f62321d 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -125,14 +125,14 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { auto &thisLoadLoopSide = thisLoadPlantLoop.LoopSide(this->loadSideLocation.loopSideNum); auto &thisLoadBranch = thisLoadLoopSide.Branch(this->loadSideLocation.branchNum); auto &thisLoadComp = thisLoadBranch.Comp(this->loadSideLocation.compNum); - if (thisLoadPlantLoop.LoopDemandCalcScheme == DataPlant::SingleSetPoint) { + if (thisLoadPlantLoop.LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if (thisLoadComp.CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) { // there will be a valid set-point on outlet return DataLoopNode::Node(this->loadSideNodes.outlet).TempSetPoint; } else { // use plant loop overall set-point return DataLoopNode::Node(thisLoadPlantLoop.TempSetPointNodeNum).TempSetPoint; } - } else if (thisLoadPlantLoop.LoopDemandCalcScheme == DataPlant::DualSetPointDeadBand) { + } else if (thisLoadPlantLoop.LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if (thisLoadComp.CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) { // there will be a valid set-point on outlet return DataLoopNode::Node(this->loadSideNodes.outlet).TempSetPointHi; diff --git a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc index b7141abb419..69c5f204f25 100644 --- a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc @@ -346,7 +346,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_EvaporativelyCooled_Calculate) Real64 MyLoad(-18000.0); openOutputFiles(*state); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::SingleSetPoint; + DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; DataLoopNode::Node(thisEIRChiller.EvapOutletNodeNum).TempSetPoint = 6.67; DataLoopNode::Node(thisEIRChiller.EvapInletNodeNum).Temp = 16.0; // init and size diff --git a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc index 632e5b87a6e..bc204a256f5 100644 --- a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc +++ b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc @@ -127,7 +127,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Sequential) { auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); - DataPlant::PlantLoop(1).LoadDistribution = DataPlant::SequentialLoading; + DataPlant::PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Sequential; // Loop demand 550W DistributePlantLoadTest::ResetLoads(); @@ -293,7 +293,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Uniform) { auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); - DataPlant::PlantLoop(1).LoadDistribution = DataPlant::UniformLoading; + DataPlant::PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Uniform; // Start with 5 components DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; @@ -410,7 +410,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Optimal) { auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); - DataPlant::PlantLoop(1).LoadDistribution = DataPlant::OptimalLoading; + DataPlant::PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Optimal; // Start with 5 components and smaller component 4 DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; @@ -541,7 +541,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_UniformPLR) { auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); - DataPlant::PlantLoop(1).LoadDistribution = DataPlant::UniformPLRLoading; + DataPlant::PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::UniformPLR; // Start with 5 components and smaller component 4 DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; @@ -664,7 +664,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_SequentialUniformPLR) { auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); - DataPlant::PlantLoop(1).LoadDistribution = DataPlant::SequentialUniformPLRLoading; + DataPlant::PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::SequentialUniformPLR; // Start with 5 components and smaller component 4 DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 5f355c209d3..7425ecbf5a1 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -1197,7 +1197,7 @@ TEST_F(EnergyPlusFixture, CoolingOutletSetpointWorker) PLHPPlantLoadSideLoop.TempSetPointNodeNum = 5; // set up the plant setpoint conditions and test for single setpoint operation - PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::SingleSetPoint; + PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.outlet).TempSetPoint = 3.141; DataLoopNode::Node(5).TempSetPoint = 2.718; @@ -1206,7 +1206,7 @@ TEST_F(EnergyPlusFixture, CoolingOutletSetpointWorker) EXPECT_NEAR(2.718, thisCoolingPLHP->getLoadSideOutletSetPointTemp(*state), 0.001); // test for dual setpoint operation - PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::DualSetPointDeadBand; + PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.outlet).TempSetPointHi = 6.282; DataLoopNode::Node(5).TempSetPointHi = 5.436; @@ -1378,7 +1378,7 @@ TEST_F(EnergyPlusFixture, OnInitLoopEquipTopologyErrorCases) DataPlant::TotNumLoops = 2; DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::SingleSetPoint; + DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; @@ -1388,7 +1388,7 @@ TEST_F(EnergyPlusFixture, OnInitLoopEquipTopologyErrorCases) DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopDemandCalcScheme = DataPlant::SingleSetPoint; + DataPlant::PlantLoop(2).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; @@ -1496,7 +1496,7 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_WaterSource) DataPlant::TotNumLoops = 2; DataPlant::PlantLoop.allocate(2); DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::SingleSetPoint; + DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; @@ -1630,7 +1630,7 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_WaterSource) DataPlant::TotNumLoops = 2; DataPlant::PlantLoop.allocate(2); DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::SingleSetPoint; + DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; @@ -1859,7 +1859,7 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_AirSource) DataPlant::TotNumLoops = 1; DataPlant::PlantLoop.allocate(1); DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::SingleSetPoint; + DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; @@ -1976,7 +1976,7 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_AirSource) DataPlant::TotNumLoops = 1; DataPlant::PlantLoop.allocate(1); DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::SingleSetPoint; + DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; @@ -2689,14 +2689,14 @@ TEST_F(EnergyPlusFixture, Test_DoPhysics) PLHPPlantLoadSideLoop.TempSetPointNodeNum = 5; // set up the plant setpoint conditions and test for single setpoint operation - PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::SingleSetPoint; + PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.outlet).TempSetPoint = 3.141; DataLoopNode::Node(5).TempSetPoint = 2.718; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CoolingRBOpSchemeType; // test for dual setpoint operation - PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::DualSetPointDeadBand; + PLHPPlantLoadSideLoop.LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.outlet).TempSetPointHi = 6.282; DataLoopNode::Node(5).TempSetPointHi = 5.436; @@ -2747,7 +2747,7 @@ TEST_F(EnergyPlusFixture, CoolingMetering) DataPlant::TotNumLoops = 2; DataPlant::PlantLoop.allocate(2); DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::SingleSetPoint; + DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; @@ -2847,7 +2847,7 @@ TEST_F(EnergyPlusFixture, HeatingMetering) DataPlant::TotNumLoops = 2; DataPlant::PlantLoop.allocate(2); DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::SingleSetPoint; + DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; diff --git a/tst/EnergyPlus/unit/PlantUtilities.unit.cc b/tst/EnergyPlus/unit/PlantUtilities.unit.cc index 6b945da5355..721dda2ea18 100644 --- a/tst/EnergyPlus/unit/PlantUtilities.unit.cc +++ b/tst/EnergyPlus/unit/PlantUtilities.unit.cc @@ -268,19 +268,19 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) // the first time we call each criteria check, we should just get an index back and it should trigger the connected loop connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_MassFlowRate, criteriaValue1); + connectedLoopSideNum, DataPlant::iCriteriaType::MassFlowRate, criteriaValue1); EXPECT_EQ(1, criteriaCheckIndex1); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_Temperature, criteriaValue2); + connectedLoopSideNum, DataPlant::iCriteriaType::Temperature, criteriaValue2); EXPECT_EQ(2, criteriaCheckIndex2); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_HeatTransferRate, criteriaValue3); + connectedLoopSideNum, DataPlant::iCriteriaType::HeatTransferRate, criteriaValue3); EXPECT_EQ(3, criteriaCheckIndex3); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); @@ -290,54 +290,54 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) criteriaValue1 = 2.718; connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_MassFlowRate, criteriaValue1); + connectedLoopSideNum, DataPlant::iCriteriaType::MassFlowRate, criteriaValue1); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); criteriaValue2 = 2.718; connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_Temperature, criteriaValue2); + connectedLoopSideNum, DataPlant::iCriteriaType::Temperature, criteriaValue2); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); criteriaValue3 = 2.718; connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_HeatTransferRate, criteriaValue3); + connectedLoopSideNum, DataPlant::iCriteriaType::HeatTransferRate, criteriaValue3); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); // call it with the same nonzero value here, and it should *not* trigger the sim flag connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_MassFlowRate, criteriaValue1); + connectedLoopSideNum, DataPlant::iCriteriaType::MassFlowRate, criteriaValue1); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_Temperature, criteriaValue2); + connectedLoopSideNum, DataPlant::iCriteriaType::Temperature, criteriaValue2); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_HeatTransferRate, criteriaValue3); + connectedLoopSideNum, DataPlant::iCriteriaType::HeatTransferRate, criteriaValue3); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); // call it with a tiny (within tolerance) change and it should still not trigger it criteriaValue1 += DataPlant::CriteriaDelta_MassFlowRate / 2.0; connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_MassFlowRate, criteriaValue1); + connectedLoopSideNum, DataPlant::iCriteriaType::MassFlowRate, criteriaValue1); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); criteriaValue2 += DataPlant::CriteriaDelta_Temperature / 2.0; connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_Temperature, criteriaValue2); + connectedLoopSideNum, DataPlant::iCriteriaType::Temperature, criteriaValue2); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); criteriaValue3 += DataPlant::CriteriaDelta_HeatTransferRate / 2.0; connectedLoopSide.SimLoopSideNeeded = false; PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, - connectedLoopSideNum, DataPlant::CriteriaType_HeatTransferRate, criteriaValue3); + connectedLoopSideNum, DataPlant::iCriteriaType::HeatTransferRate, criteriaValue3); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); } From f28ed32322bff369d0666f9eb7983faf5715d828 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 5 Jan 2021 05:53:44 -0700 Subject: [PATCH 05/17] move common pipe and flow lock int consts to enums --- src/EnergyPlus/BoilerSteam.cc | 2 +- src/EnergyPlus/Boilers.cc | 2 +- src/EnergyPlus/ChillerAbsorption.cc | 4 +- src/EnergyPlus/ChillerElectricEIR.cc | 20 ++++--- src/EnergyPlus/ChillerExhaustAbsorption.cc | 25 ++------ src/EnergyPlus/ChillerGasAbsorption.cc | 45 ++------------ src/EnergyPlus/ChillerIndirectAbsorption.cc | 2 +- src/EnergyPlus/ChillerReformulatedEIR.cc | 18 +++--- src/EnergyPlus/CondenserLoopTowers.cc | 10 ++-- src/EnergyPlus/EvaporativeFluidCoolers.cc | 7 ++- src/EnergyPlus/FanCoilUnits.cc | 8 +-- src/EnergyPlus/FluidCoolers.cc | 6 +- src/EnergyPlus/HVACControllers.cc | 3 +- src/EnergyPlus/HVACInterfaceManager.cc | 38 ++++++------ src/EnergyPlus/HVACInterfaceManager.hh | 18 ++++-- src/EnergyPlus/HVACManager.cc | 6 +- src/EnergyPlus/IceThermalStorage.cc | 6 +- src/EnergyPlus/Plant/DataPlant.cc | 20 ------- src/EnergyPlus/Plant/DataPlant.hh | 21 +------ src/EnergyPlus/Plant/Enums.hh | 12 ++++ src/EnergyPlus/Plant/Loop.hh | 18 +++--- src/EnergyPlus/Plant/LoopSide.cc | 34 +++++------ src/EnergyPlus/Plant/LoopSide.hh | 23 ++++---- src/EnergyPlus/Plant/PlantManager.cc | 26 ++++----- src/EnergyPlus/PlantCentralGSHP.cc | 4 +- src/EnergyPlus/PlantChillers.cc | 16 ++--- src/EnergyPlus/PlantLoadProfile.cc | 2 - src/EnergyPlus/PlantPressureSystem.cc | 3 +- src/EnergyPlus/PlantUtilities.cc | 12 ++-- src/EnergyPlus/PlantUtilities.hh | 2 +- src/EnergyPlus/PlantValves.cc | 4 +- src/EnergyPlus/Pumps.cc | 3 +- src/EnergyPlus/WaterThermalTanks.cc | 6 +- src/EnergyPlus/WaterThermalTanks.hh | 58 ++++++++++--------- tst/EnergyPlus/unit/ChillerAbsorption.unit.cc | 4 +- .../unit/CondenserLoopTowers.unit.cc | 2 +- .../unit/EvaporativeFluidCoolers.unit.cc | 2 +- tst/EnergyPlus/unit/FanCoilUnits.unit.cc | 24 ++++---- tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc | 2 +- .../unit/PlantLoopHeatPumpEIR.unit.cc | 28 ++++----- tst/EnergyPlus/unit/WaterCoils.unit.cc | 4 +- 41 files changed, 243 insertions(+), 307 deletions(-) diff --git a/src/EnergyPlus/BoilerSteam.cc b/src/EnergyPlus/BoilerSteam.cc index 66c1fc8b182..f5d84f1cd42 100644 --- a/src/EnergyPlus/BoilerSteam.cc +++ b/src/EnergyPlus/BoilerSteam.cc @@ -622,7 +622,7 @@ namespace BoilerSteam { CpWater = FluidProperties::GetSatSpecificHeatRefrig( state, fluidNameSteam, DataLoopNode::Node(this->BoilerInletNodeNum).Temp, 0.0, this->FluidIndex, RoutineName); - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0) { // TODO: Components shouldn't check FlowLock + if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { // TODO: Components shouldn't check FlowLock // Calculate the flow for the boiler { diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index 9886b00bfc9..f1358822805 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -760,7 +760,7 @@ namespace EnergyPlus::Boilers { // Initialize the delta temperature to zero Real64 BoilerDeltaTemp; // C - boiler inlet to outlet temperature difference, set in all necessary code paths so no initialization required - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0) { + if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { // Either set the flow to the Constant value or calculate the flow for the variable volume if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { // Then find the flow rate and outlet temp diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index c378f6b1d9f..4fbd60777da 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -1406,7 +1406,7 @@ namespace EnergyPlus::ChillerAbsorption { // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 0) { + if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = std::abs(MyLoad); // limit by max capacity @@ -1649,7 +1649,7 @@ namespace EnergyPlus::ChillerAbsorption { DataLoopNode::Node(this->GeneratorInletNodeNum).Temp, DataPlant::PlantLoop(GenLoopSideNum).FluidIndex, RoutineName); - if (DataPlant::PlantLoop(this->GenLoopNum).LoopSide(this->GenLoopSideNum).FlowLock == 0) { + if (DataPlant::PlantLoop(this->GenLoopNum).LoopSide(this->GenLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { GenMassFlowRate = this->GenMassFlowRateMax; } else { // LeavingSetpointModulated diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index ba520f3a852..482e6d8295d 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -1618,7 +1618,7 @@ namespace ChillerElectricEIR { // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { if (this->EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 1) { + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { @@ -1803,7 +1803,8 @@ namespace ChillerElectricEIR { this->ChillerCapFT = CurveManager::CurveValue(state, this->ChillerCapFTIndex, EvapOutletTempSetPoint, AvgCondSinkTemp); if (this->ChillerCapFT < 0) { - if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != 0 && + if (this->ChillerCapFTError < 1 && + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); @@ -1814,7 +1815,8 @@ namespace ChillerElectricEIR { EvapOutletTempSetPoint, condInletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { + } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\": Chiller Capacity as a Function of Temperature curve output is negative warning continues...", @@ -2095,7 +2097,8 @@ namespace ChillerElectricEIR { this->ChillerEIRFT = CurveManager::CurveValue(state, this->ChillerEIRFTIndex, this->EvapOutletTemp, AvgCondSinkTemp); if (this->ChillerEIRFT < 0.0) { - if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != 0 && + if (this->ChillerEIRFTError < 1 && + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); @@ -2105,7 +2108,8 @@ namespace ChillerElectricEIR { this->EvapOutletTemp, condInletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { + } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\": Chiller EIR as a Function of Temperature curve output is negative warning continues...", @@ -2118,14 +2122,16 @@ namespace ChillerElectricEIR { this->ChillerEIRFPLR = CurveManager::CurveValue(state, this->ChillerEIRFPLRIndex, PartLoadRat); if (this->ChillerEIRFPLR < 0.0) { - if (this->ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != 0 && + if (this->ChillerEIRFPLRError < 1 && + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); ShowContinueError(state, format(" Chiller EIR as a function of PLR curve output is negative ({:.3R}).", this->ChillerEIRFPLR)); ShowContinueError(state, format(" Negative value occurs using a part-load ratio of {:.3R}.", PartLoadRat)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { + } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\": Chiller EIR as a function of PLR curve output is negative warning continues...", diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index 8a8b22bd7c7..dd5d23536a2 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -1475,7 +1475,7 @@ namespace ChillerExhaustAbsorption { 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 + if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components this->PossibleSubcooling = false; lCoolingLoad = std::abs(MyLoad); if (ChillDeltaTemp != 0.0) { @@ -1497,7 +1497,7 @@ namespace ChillerExhaustAbsorption { this->DeltaTempCoolErrCount); } lChillSupplyTemp = ChillSupplySetPointTemp; - } else if (SELECT_CASE_var == 1) { // mass flow rates may not be changed by loop components + } else if (SELECT_CASE_var == DataPlant::iFlowLock::Locked) { // mass flow rates may not be changed by loop components lChillWaterMassFlowRate = DataLoopNode::Node(lChillReturnNodeNum).MassFlowRate; if (this->PossibleSubcooling) { lCoolingLoad = std::abs(MyLoad); @@ -1818,7 +1818,7 @@ namespace ChillerExhaustAbsorption { // supply temperature { 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 + if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components lHeatingLoad = std::abs(MyLoad); if (HeatDeltaTemp != 0) { lHotWaterMassFlowRate = std::abs(lHeatingLoad / (Cp_HW * HeatDeltaTemp)); @@ -1838,26 +1838,9 @@ namespace ChillerExhaustAbsorption { this->DeltaTempHeatErrCount); } lHotWaterSupplyTemp = HeatSupplySetPointTemp; - } else if (SELECT_CASE_var == 1) { // mass flow rates may not be changed by loop components + } else if (SELECT_CASE_var == DataPlant::iFlowLock::Locked) { // mass flow rates may not be changed by loop components lHotWaterSupplyTemp = HeatSupplySetPointTemp; lHeatingLoad = std::abs(lHotWaterMassFlowRate * Cp_HW * HeatDeltaTemp); - - // DSU this "2" is not a real state for flowLock - } else if (SELECT_CASE_var == - 2) { // chiller is underloaded and mass flow rates has changed to a small amount and Tout drops below Setpoint - - // MJW 07MAR01 Borrow logic from steam absorption module - // 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 < DataBranchAirLoopPlant::MassFlowTolerance) { - HeatDeltaTemp = 0.0; - } else { - HeatDeltaTemp = std::abs(MyLoad) / (Cp_HW * lHotWaterMassFlowRate); - } - lHotWaterSupplyTemp = lHotWaterReturnTemp + HeatDeltaTemp; - - lHeatingLoad = std::abs(lHotWaterMassFlowRate * Cp_HW * HeatDeltaTemp); } } diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index b0e8e54204e..306d0a370a2 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -1445,7 +1445,7 @@ namespace ChillerGasAbsorption { 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 + if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components this->PossibleSubcooling = false; lCoolingLoad = std::abs(MyLoad); if (ChillDeltaTemp != 0.0) { @@ -1468,7 +1468,7 @@ namespace ChillerGasAbsorption { this->DeltaTempCoolErrCount); } lChillSupplyTemp = ChillSupplySetPointTemp; - } else if (SELECT_CASE_var == 1) { // mass flow rates may not be changed by loop components + } else if (SELECT_CASE_var == DataPlant::iFlowLock::Locked) { // mass flow rates may not be changed by loop components lChillWaterMassFlowRate = DataLoopNode::Node(lChillReturnNodeNum).MassFlowRate; if (this->PossibleSubcooling) { lCoolingLoad = std::abs(MyLoad); @@ -1733,7 +1733,7 @@ namespace ChillerGasAbsorption { // supply temperature { 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 + if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components lHeatingLoad = std::abs(MyLoad); if (HeatDeltaTemp != 0) { lHotWaterMassFlowRate = std::abs(lHeatingLoad / (Cp_HW * HeatDeltaTemp)); @@ -1753,46 +1753,9 @@ namespace ChillerGasAbsorption { this->DeltaTempHeatErrCount); } lHotWaterSupplyTemp = HeatSupplySetPointTemp; - } else if (SELECT_CASE_var == 1) { // mass flow rates may not be changed by loop components + } else if (SELECT_CASE_var == DataPlant::iFlowLock::Locked) { // mass flow rates may not be changed by loop components lHotWaterSupplyTemp = HeatSupplySetPointTemp; lHeatingLoad = std::abs(lHotWaterMassFlowRate * Cp_HW * HeatDeltaTemp); - - // DSU this "2" is not a real state for flowLock - } else if (SELECT_CASE_var == - 2) { // chiller is underloaded and mass flow rates has changed to a small amount and Tout drops below Setpoint - - // DSU? this component model needs a lot of work, does not honor limits, incomplete ... - - // MJW Not sure what to do with this now - // Must make adjustment to supply temperature since load is greater than available capacity - // this also affects the available capacity itself since it is a function of supply temperature - // Since these curves are generally fairly flat just use an estimate (done above) and correction - // approach instead of iterating to a solution. - // MJW 07MAR01 Logic seems wrong here, because of misunderstanding of what "overload" means - // "overload" means the chiller is overcooling the branch. See SUBROUTINE DistributeLoad - // IF (lChillWaterMassFlowRate > MassFlowTol) THEN - // ChillDeltaTemp = MyLoad / (CPCW(lChillReturnTemp) * lChillWaterMassFlowRate) - // lChillSupplyTemp = lChillReturnTemp - ChillDeltaTemp - // lAvailableCoolingCapacity = lNomCoolingCap * CurveValue(lCoolCapFTCurve,lChillSupplyTemp,calcCondTemp) - // ELSE - // ErrCount = ErrCount + 1 - // IF (ErrCount < 10) THEN - // CALL ShowWarningError(state, 'GasAbsorberModel:lChillWaterMassFlowRate near 0 in available capacity calculation') - // END IF - // END IF - - // MJW 07MAR01 Borrow logic from steam absorption module - // 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 < DataBranchAirLoopPlant::MassFlowTolerance) { - HeatDeltaTemp = 0.0; - } else { - HeatDeltaTemp = std::abs(MyLoad) / (Cp_HW * lHotWaterMassFlowRate); - } - lHotWaterSupplyTemp = lHotWaterReturnTemp + HeatDeltaTemp; - - lHeatingLoad = std::abs(lHotWaterMassFlowRate * Cp_HW * HeatDeltaTemp); } } diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index 4bb80b59cf7..3080edeab2d 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -1654,7 +1654,7 @@ namespace ChillerIndirectAbsorption { // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 0) { + if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = std::abs(MyLoad); diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 1084ac93102..f9b80406c2b 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -1851,7 +1851,7 @@ namespace ChillerReformulatedEIR { // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { if (this->EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 1) { + DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { @@ -2017,7 +2017,7 @@ namespace ChillerReformulatedEIR { 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).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = !(DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType); @@ -2312,7 +2312,7 @@ namespace ChillerReformulatedEIR { int BranchNum = this->CWBranchNum; int CompNum = this->CWCompNum; - if (FirstIteration || state.dataGlobal->WarmupFlag || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; + if (FirstIteration || state.dataGlobal->WarmupFlag || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // Minimum evaporator leaving temperature allowed by CAPFT curve [C] Real64 CAPFTXTmin = this->ChillerCAPFTXTempMin; @@ -2552,7 +2552,7 @@ namespace ChillerReformulatedEIR { this->ChillerCapFT = CurveManager::CurveValue(state, this->ChillerCapFTIndex, EvapOutletTempSetPoint, this->CondOutletTemp); if (this->ChillerCapFT < 0) { - if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { + if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); ShowContinueError(state, @@ -2562,7 +2562,7 @@ namespace ChillerReformulatedEIR { EvapOutletTempSetPoint, this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { + } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": Chiller Capacity as a Function of Temperature curve output is negative warning continues...", @@ -2575,7 +2575,7 @@ namespace ChillerReformulatedEIR { this->ChillerEIRFT = CurveManager::CurveValue(state, this->ChillerEIRFTIndex, this->EvapOutletTemp, this->CondOutletTemp); if (this->ChillerEIRFT < 0.0) { - if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { + if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); ShowContinueError( @@ -2585,7 +2585,7 @@ namespace ChillerReformulatedEIR { this->EvapOutletTemp, this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { + } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": Chiller EIR as a Function of Temperature curve output is negative warning continues...", @@ -2620,7 +2620,7 @@ namespace ChillerReformulatedEIR { } if (this->ChillerEIRFPLR < 0.0) { - if (this->ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { + if (this->ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); ShowContinueError(state, @@ -2631,7 +2631,7 @@ namespace ChillerReformulatedEIR { this->ChillerPartLoadRatio, this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != 0 && !state.dataGlobal->WarmupFlag) { + } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": Chiller EIR as a function of PLR curve output is negative warning continues...", diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 7519e2d51f4..c0bfc3db02b 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -4399,7 +4399,7 @@ namespace CondenserLoopTowers { } // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0) return; // TODO: WTF + if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // TODO: WTF // MassFlowTolerance is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { CalcBasinHeaterPower(state, @@ -4642,7 +4642,7 @@ namespace CondenserLoopTowers { Real64 Ta = TempSetPoint - this->AirWetBulb; // Do not RETURN here if flow rate is less than MassFlowTolerance. Check basin heater and then RETURN. - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0) return; // TODO: WTF + if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // TODO: WTF // MassFlowTolerance is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { CalcBasinHeaterPower(state, @@ -5911,7 +5911,9 @@ namespace CondenserLoopTowers { // set node information DataLoopNode::Node(this->WaterOutletNodeNum).Temp = this->OutletWaterTemp; - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0 || state.dataGlobal->WarmupFlag) return; + if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || + state.dataGlobal->WarmupFlag) + return; // Check flow rate through tower and compare to design flow rate, show warning if greater than Design * Mulitplier if (DataLoopNode::Node(this->WaterOutletNodeNum).MassFlowRate > this->DesWaterMassFlowRate * this->TowerMassFlowRateMultiplier) { @@ -6000,7 +6002,7 @@ namespace CondenserLoopTowers { } else { this->InletWaterTemp = DataLoopNode::Node(this->WaterInletNodeNum).Temp; this->FanEnergy = this->FanPower * ReportingConstant; - this->AirFlowRatio = this->airFlowRateRatio; // TODO: Remove __ version + this->AirFlowRatio = this->airFlowRateRatio; this->WaterAmountUsed = this->WaterUsage * ReportingConstant; this->BasinHeaterConsumption = this->BasinHeaterPower * ReportingConstant; } diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index f3e0383d9de..7088878011a 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -1973,7 +1973,7 @@ namespace EvaporativeFluidCoolers { // MassFlowTol is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || - DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0) + DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; if (inletWaterTemp > TempSetPoint) { @@ -2149,7 +2149,7 @@ namespace EvaporativeFluidCoolers { // MassFlowTol is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || - DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0) + DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; if (this->InletWaterTemp > TempSetPoint) { @@ -2471,7 +2471,8 @@ namespace EvaporativeFluidCoolers { DataLoopNode::Node(this->WaterOutletNode).Temp = this->OutletWaterTemp; - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(LoopSideNum).FlowLock == 0 || state.dataGlobal->WarmupFlag) return; + if (DataPlant::PlantLoop(this->LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || state.dataGlobal->WarmupFlag) + return; // Check flow rate through evaporative fluid cooler and compare to design flow rate, // show warning if greater than Design * Mulitplier diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 31132515a05..634dd87ec8a 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -2333,7 +2333,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).CoolCoilLoopSide, FanCoil(FanCoilNum).CoolCoilBranchNum, FanCoil(FanCoilNum).CoolCoilCompNum); - if (PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide).FlowLock == FlowLocked) { + if (PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { ColdFlowLocked = true; // check for flow lock } if (FanCoil(FanCoilNum).HCoilType_Num == HCoil_Water) { @@ -2345,7 +2345,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).HeatCoilLoopSide, FanCoil(FanCoilNum).HeatCoilBranchNum, FanCoil(FanCoilNum).HeatCoilCompNum); - if (PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide).FlowLock == FlowLocked) { + if (PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { HotFlowLocked = true; // save locked flow } } @@ -2702,7 +2702,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).CoolCoilLoopSide, FanCoil(FanCoilNum).CoolCoilBranchNum, FanCoil(FanCoilNum).CoolCoilCompNum); - if (PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide).FlowLock == FlowLocked) { + if (PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { ColdFlowLocked = true; // check for flow lock } if (FanCoil(FanCoilNum).HCoilType_Num == HCoil_Water) { @@ -2714,7 +2714,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).HeatCoilLoopSide, FanCoil(FanCoilNum).HeatCoilBranchNum, FanCoil(FanCoilNum).HeatCoilCompNum); - if (PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide).FlowLock == FlowLocked) { + if (PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { HotFlowLocked = true; // save locked flow } } diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index 84cff3fdf25..39b5b4f0e63 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -1594,7 +1594,7 @@ namespace FluidCoolers { // MassFlowTol is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || - DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0) + DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // set local variable for fluid cooler @@ -1772,7 +1772,9 @@ namespace FluidCoolers { auto &waterOutletNode = this->WaterOutletNodeNum; DataLoopNode::Node(waterOutletNode).Temp = this->OutletWaterTemp; - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0 || state.dataGlobal->WarmupFlag) return; + if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || + state.dataGlobal->WarmupFlag) + return; // Check flow rate through fluid cooler and compare to design flow rate, show warning if greater than Design * Mulitplier if (DataLoopNode::Node(waterOutletNode).MassFlowRate > this->DesWaterMassFlowRate * this->FluidCoolerMassFlowRateMultiplier) { diff --git a/src/EnergyPlus/HVACControllers.cc b/src/EnergyPlus/HVACControllers.cc index 31afe1fd406..73aff1bd603 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -301,7 +301,6 @@ namespace HVACControllers { // Using/Aliasing using namespace DataSystemVariables; - using DataPlant::FlowLocked; using DataPlant::PlantLoop; // Locals @@ -370,7 +369,7 @@ namespace HVACControllers { if (PlantLoop(ControllerProps(ControlNum).ActuatedNodePlantLoopNum) .LoopSide(ControllerProps(ControlNum).ActuatedNodePlantLoopSide) - .FlowLock == FlowLocked) { + .FlowLock == DataPlant::iFlowLock::Locked) { // plant is rigid so controller cannot change anything. // Update the current Controller to the outlet nodes UpdateController(state, ControlNum); diff --git a/src/EnergyPlus/HVACInterfaceManager.cc b/src/EnergyPlus/HVACInterfaceManager.cc index fdfc5d59217..e5736c9730f 100644 --- a/src/EnergyPlus/HVACInterfaceManager.cc +++ b/src/EnergyPlus/HVACInterfaceManager.cc @@ -398,7 +398,7 @@ namespace HVACInterfaceManager { int const ThisLoopSideOutletNode, // Node number for the inlet of the side that needs the outlet node data int const OtherLoopSideInletNode, // Node number for the outlet of the side of the loop just simulated bool &OutOfToleranceFlag, // True when the other side of the loop need to be (re)simulated - int const CommonPipeType) + DataPlant::iCommonPipeType const CommonPipeType) { // SUBROUTINE INFORMATION: @@ -476,12 +476,12 @@ namespace HVACInterfaceManager { // update the temperatures and flow rates auto &flow_demand_to_supply_tol(convergence.PlantFlowDemandToSupplyTolValue); auto &flow_supply_to_demand_tol(convergence.PlantFlowSupplyToDemandTolValue); - if (CommonPipeType == 1 || CommonPipeType == 2) { + if (CommonPipeType == DataPlant::iCommonPipeType::Single || CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { // update the temperature UpdateCommonPipe(state, LoopNum, ThisLoopSideNum, CommonPipeType, MixedOutletTemp); Node(OtherLoopSideInletNode).Temp = MixedOutletTemp; TankOutletTemp = MixedOutletTemp; - if (ThisLoopSideNum == DemandSide) { + if (ThisLoopSideNum == DataPlant::DemandSide) { rshift1(flow_demand_to_supply_tol); flow_demand_to_supply_tol(1) = std::abs(OldOtherLoopSideInletMdot - Node(OtherLoopSideInletNode).MassFlowRate); if (flow_demand_to_supply_tol(1) > DataConvergParams::PlantFlowRateToler) { @@ -505,7 +505,7 @@ namespace HVACInterfaceManager { // update the temperature Node(OtherLoopSideInletNode).Temp = TankOutletTemp; // Set the flow tolerance array - if (ThisLoopSideNum == DemandSide) { + if (ThisLoopSideNum == DataPlant::DemandSide) { rshift1(flow_demand_to_supply_tol); flow_demand_to_supply_tol(1) = std::abs(Node(ThisLoopSideOutletNode).MassFlowRate - Node(OtherLoopSideInletNode).MassFlowRate); if (flow_demand_to_supply_tol(1) > DataConvergParams::PlantFlowRateToler) { @@ -536,7 +536,7 @@ namespace HVACInterfaceManager { } // temperature - if (ThisLoopSideNum == DemandSide) { + if (ThisLoopSideNum == DataPlant::DemandSide) { auto &temp_demand_to_supply_tol(convergence.PlantTempDemandToSupplyTolValue); rshift1(temp_demand_to_supply_tol); temp_demand_to_supply_tol(1) = std::abs(OldTankOutletTemp - Node(OtherLoopSideInletNode).Temp); @@ -553,7 +553,7 @@ namespace HVACInterfaceManager { } // Set out of tolerance flags - if (ThisLoopSideNum == DemandSide) { + if (ThisLoopSideNum == DataPlant::DemandSide) { if (convergence.PlantMassFlowNotConverged || convergence.PlantTempNotConverged) { OutOfToleranceFlag = true; } @@ -726,7 +726,11 @@ namespace HVACInterfaceManager { TankOutletTemp = TankAverageTemp; } - void UpdateCommonPipe(EnergyPlusData &state, int const LoopNum, int const TankInletLoopSide, int const CommonPipeType, Real64 &MixedOutletTemp) + void UpdateCommonPipe(EnergyPlusData &state, + int const LoopNum, + int const TankInletLoopSide, + DataPlant::iCommonPipeType const CommonPipeType, + Real64 &MixedOutletTemp) { // SUBROUTINE INFORMATION: @@ -760,8 +764,6 @@ namespace HVACInterfaceManager { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; - using DataPlant::CommonPipe_Single; - using DataPlant::CommonPipe_TwoWay; using DataPlant::DemandSide; using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; @@ -806,7 +808,7 @@ namespace HVACInterfaceManager { TankInletTemp = Node(TankInletNode).Temp; - if (TankInletLoopSide == DemandSide) { + if (TankInletLoopSide == DataPlant::DemandSide) { // for common pipe loops, assume 75% of plant loop volume is on the demand side FracTotLoopMass = 0.25; } else { @@ -868,10 +870,10 @@ namespace HVACInterfaceManager { } } // Common Pipe Simulation - if (CommonPipeType == CommonPipe_Single) { + if (CommonPipeType == DataPlant::iCommonPipeType::Single) { ManageSingleCommonPipe(state, LoopNum, TankOutletLoopSide, TankAverageTemp, MixedOutletTemp); // 2-way (controlled) common pipe simulation - } else if (CommonPipeType == CommonPipe_TwoWay) { + } else if (CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { ManageTwoWayCommonPipe(state, LoopNum, TankOutletLoopSide, TankAverageTemp); MixedOutletTemp = Node(TankOutletNode).Temp; @@ -1330,11 +1332,11 @@ namespace HVACInterfaceManager { { auto const SELECT_CASE_var(PlantLoop(CurLoopNum).CommonPipeType); - if (SELECT_CASE_var == CommonPipe_No) { - PlantCommonPipe(CurLoopNum).CommonPipeType = CommonPipe_No; + if (SELECT_CASE_var == DataPlant::iCommonPipeType::No) { + PlantCommonPipe(CurLoopNum).CommonPipeType = DataPlant::iCommonPipeType::No; - } else if (SELECT_CASE_var == CommonPipe_Single) { // Uncontrolled ('single') common pipe - PlantCommonPipe(CurLoopNum).CommonPipeType = CommonPipe_Single; + } else if (SELECT_CASE_var == DataPlant::iCommonPipeType::Single) { // Uncontrolled ('single') common pipe + PlantCommonPipe(CurLoopNum).CommonPipeType = DataPlant::iCommonPipeType::Single; SetupOutputVariable(state, "Plant Common Pipe Mass Flow Rate", OutputProcessor::Unit::kg_s, PlantCommonPipe(CurLoopNum).Flow, @@ -1362,8 +1364,8 @@ namespace HVACInterfaceManager { ShowContinueError(state, "The primary/supply side will operate as if constant speed, and the simulation continues"); } - } else if (SELECT_CASE_var == CommonPipe_TwoWay) { // Controlled ('two-way') common pipe - PlantCommonPipe(CurLoopNum).CommonPipeType = CommonPipe_TwoWay; + } else if (SELECT_CASE_var == DataPlant::iCommonPipeType::TwoWay) { // Controlled ('two-way') common pipe + PlantCommonPipe(CurLoopNum).CommonPipeType = DataPlant::iCommonPipeType::TwoWay; SetupOutputVariable(state, "Plant Common Pipe Primary Mass Flow Rate", OutputProcessor::Unit::kg_s, PlantCommonPipe(CurLoopNum).PriCPLegFlow, diff --git a/src/EnergyPlus/HVACInterfaceManager.hh b/src/EnergyPlus/HVACInterfaceManager.hh index a18df647b6c..3ad9b7070e0 100644 --- a/src/EnergyPlus/HVACInterfaceManager.hh +++ b/src/EnergyPlus/HVACInterfaceManager.hh @@ -55,6 +55,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -87,7 +88,7 @@ namespace HVACInterfaceManager { struct CommonPipeData { // Members - int CommonPipeType; // type of common pipe used if any + DataPlant::iCommonPipeType CommonPipeType; // type of common pipe used if any int SupplySideInletPumpType; int DemandSideInletPumpType; // Following report variables are used in uncontrolled common pipe @@ -111,9 +112,10 @@ namespace HVACInterfaceManager { // Default Constructor CommonPipeData() - : CommonPipeType(0), SupplySideInletPumpType(FlowTypeNotSet), DemandSideInletPumpType(FlowTypeNotSet), FlowDir(0), Flow(0.0), Temp(0.0), - SecCPLegFlow(0.0), PriCPLegFlow(0.0), SecToPriFlow(0.0), PriToSecFlow(0.0), PriInTemp(0.0), PriOutTemp(0.0), SecInTemp(0.0), - SecOutTemp(0.0), PriInletSetPoint(0.0), SecInletSetPoint(0.0), PriInletControlled(false), SecInletControlled(false), PriFlowRequest(0.0) + : CommonPipeType(DataPlant::iCommonPipeType::No), SupplySideInletPumpType(FlowTypeNotSet), DemandSideInletPumpType(FlowTypeNotSet), + FlowDir(0), Flow(0.0), Temp(0.0), SecCPLegFlow(0.0), PriCPLegFlow(0.0), SecToPriFlow(0.0), PriToSecFlow(0.0), PriInTemp(0.0), + PriOutTemp(0.0), SecInTemp(0.0), SecOutTemp(0.0), PriInletSetPoint(0.0), SecInletSetPoint(0.0), PriInletControlled(false), + SecInletControlled(false), PriFlowRequest(0.0) { } }; @@ -139,13 +141,17 @@ namespace HVACInterfaceManager { int const ThisLoopSideOutletNode, // Node number for the inlet of the side that needs the outlet node data int const OtherLoopSideInletNode, // Node number for the outlet of the side of the loop just simulated bool &OutOfToleranceFlag, // True when the other side of the loop need to be (re)simulated - int const CommonPipeType); + DataPlant::iCommonPipeType const CommonPipeType); //*************** void UpdateHalfLoopInletTemp(EnergyPlusData &state, int const LoopNum, int const TankInletLoopSide, Real64 &TankOutletTemp); - void UpdateCommonPipe(EnergyPlusData &state, int const LoopNum, int const TankInletLoopSide, int const CommonPipeType, Real64 &MixedOutletTemp); + void UpdateCommonPipe(EnergyPlusData &state, + int const LoopNum, + int const TankInletLoopSide, + DataPlant::iCommonPipeType const CommonPipeType, + Real64 &MixedOutletTemp); void ManageSingleCommonPipe(EnergyPlusData &state, int const LoopNum, // plant loop number diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index 304e7f765ff..2b79eaf5d3b 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -1750,8 +1750,6 @@ namespace HVACManager { // Using/Aliasing using AirflowNetworkBalanceManager::ManageAirflowNetworkBalance; - using DataPlant::FlowLocked; - using DataPlant::FlowUnlocked; using NonZoneEquipmentManager::ManageNonZoneEquipment; using PlantManager::ManagePlantLoops; using PlantUtilities::AnyPlantLoopSidesNeedSim; @@ -1776,9 +1774,9 @@ namespace HVACManager { // This requires that the plant flow resolver carefully set the min/max avail limits on // air side components to ensure they request within bounds. if (LockPlantFlows) { - SetAllFlowLocks(FlowLocked); + SetAllFlowLocks(DataPlant::iFlowLock::Locked); } else { - SetAllFlowLocks(FlowUnlocked); + SetAllFlowLocks(DataPlant::iFlowLock::Unlocked); } ResetAllPlantInterConnectFlags(); diff --git a/src/EnergyPlus/IceThermalStorage.cc b/src/EnergyPlus/IceThermalStorage.cc index ac70ac7a6f1..276c9fc1f89 100644 --- a/src/EnergyPlus/IceThermalStorage.cc +++ b/src/EnergyPlus/IceThermalStorage.cc @@ -370,7 +370,7 @@ namespace IceThermalStorage { this->MassFlowRate = DataLoopNode::Node(NodeNumIn).MassFlowRate; // if two-way common pipe and no mass flow and tank is not full, then use design flow rate - if ((DataPlant::PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::CommonPipe_TwoWay) && + if ((DataPlant::PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && (std::abs(this->MassFlowRate) < DataBranchAirLoopPlant::MassFlowTolerance) && (this->IceFracRemaining < TankChargeToler)) { this->MassFlowRate = this->DesignMassFlowRate; } @@ -1207,7 +1207,7 @@ namespace IceThermalStorage { this->PlantBranchNum, this->PlantCompNum); - if ((DataPlant::PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::CommonPipe_TwoWay) && + if ((DataPlant::PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && (this->PlantLoopSideNum == DataPlant::SupplySide)) { // up flow priority of other components on the same branch as the Ice tank for (CompNum = 1; @@ -1266,7 +1266,7 @@ namespace IceThermalStorage { this->LoopSideNum, this->BranchNum, this->CompNum); - if ((DataPlant::PlantLoop(this->LoopNum).CommonPipeType == DataPlant::CommonPipe_TwoWay) && + if ((DataPlant::PlantLoop(this->LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && (this->LoopSideNum == DataPlant::SupplySide)) { // up flow priority of other components on the same branch as the Ice tank for (int compNum = 1; diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index f03c78e6085..5728cb7899f 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -62,30 +62,10 @@ namespace EnergyPlus::DataPlant { using DataLoopNode::NodeID; using DataLoopNode::SensedNodeFlagValue; - // and the low to calculate loop demand - // Parameters for loop setpoint reference - int const Air(1); - int const Ground(2); - - // Parameters for common pipe - int const CommonPipe_No(0); - int const CommonPipe_Single(1); - int const CommonPipe_TwoWay(2); - - // Parameters for loop side location - int const DemandSupply_No(0); - int const DemandSide(1); - int const SupplySide(2); - // Parameters for tolerance Real64 const LoopDemandTol(0.1); // minimum significant loop cooling or heating demand Real64 const DeltaTempTol(0.0001); // minimum significant loop temperature difference - // Parameters for FlowLock standardization - int const FlowPumpQuery(-1); // Used to ask the pumps for their min/max avail based on no constraints - int const FlowUnlocked(0); // components request flow - int const FlowLocked(1); // components take their inlet flow - // Pressure Routine Call Enumeration int const PressureCall_Init(-1); int const PressureCall_Calc(-2); diff --git a/src/EnergyPlus/Plant/DataPlant.hh b/src/EnergyPlus/Plant/DataPlant.hh index e69e7a038f2..36fcd23eb13 100644 --- a/src/EnergyPlus/Plant/DataPlant.hh +++ b/src/EnergyPlus/Plant/DataPlant.hh @@ -80,30 +80,15 @@ namespace DataPlant { constexpr Real64 CriteriaDelta_Temperature(0.010); constexpr Real64 CriteriaDelta_HeatTransferRate(0.100); - // and the low to calculate loop demand - // Parameters for loop setpoint reference - extern int const Air; - extern int const Ground; - - // Parameters for common pipe - extern int const CommonPipe_No; - extern int const CommonPipe_Single; - extern int const CommonPipe_TwoWay; - // Parameters for loop side location - extern int const DemandSupply_No; - extern int const DemandSide; - extern int const SupplySide; + constexpr int DemandSupply_No(0); + constexpr int DemandSide(1); + constexpr int SupplySide(2); // Parameters for tolerance extern Real64 const LoopDemandTol; // minimum significant loop cooling or heating demand extern Real64 const DeltaTempTol; // minimum significant loop temperature difference - // Parameters for FlowLock standardization - extern int const FlowPumpQuery; // Used to ask the pumps for their min/max avail based on no constraints - extern int const FlowUnlocked; // components request flow - extern int const FlowLocked; // components take their inlet flow - // Pressure Routine Call Enumeration extern int const PressureCall_Init; extern int const PressureCall_Calc; diff --git a/src/EnergyPlus/Plant/Enums.hh b/src/EnergyPlus/Plant/Enums.hh index 02b9ea70d7f..d37e073b8be 100644 --- a/src/EnergyPlus/Plant/Enums.hh +++ b/src/EnergyPlus/Plant/Enums.hh @@ -148,6 +148,18 @@ namespace EnergyPlus::DataPlant { DualSetPointDeadBand, // Uses a dual temp setpoint with a deadband between the high }; + enum class iCommonPipeType { + No, + Single, + TwoWay, + }; + + enum class iFlowLock { + PumpQuery, // Used to ask the pumps for their min/max avail based on no constraints + Unlocked, // components request flow + Locked, // components take their inlet flow + }; + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/Plant/Loop.hh b/src/EnergyPlus/Plant/Loop.hh index 1539cb7b833..ad68300d7b5 100644 --- a/src/EnergyPlus/Plant/Loop.hh +++ b/src/EnergyPlus/Plant/Loop.hh @@ -99,7 +99,7 @@ namespace DataPlant { int PlantSizNum; // index to corresponding plant sizing data array DataPlant::iLoopDemandCalcScheme LoopDemandCalcScheme; // Load distribution scheme 1 SingleSetPoint, // 2 DualSetPointwithDeadBand - int CommonPipeType; + DataPlant::iCommonPipeType CommonPipeType; int EconPlantSideSensedNodeNum; int EconCondSideSensedNodeNum; int EconPlacement; @@ -130,14 +130,14 @@ namespace DataPlant { : FluidType(0), FluidIndex(1), // default to water MFErrIndex(0), MFErrIndex1(0), MFErrIndex2(0), TempSetPointNodeNum(0), MaxBranch(0), MinTemp(0.0), MaxTemp(0.0), MinTempErrIndex(0), MaxTempErrIndex(0), MinVolFlowRate(0.0), MaxVolFlowRate(0.0), MaxVolFlowRateWasAutoSized(false), MinMassFlowRate(0.0), - MaxMassFlowRate(0.0), Volume(0.0), VolumeWasAutoSized(false), // true if Volume was set to autocalculate - CirculationTime(2.0), Mass(0.0), EMSCtrl(false), EMSValue(0.0), NumOpSchemes(0), - LoadDistribution(DataPlant::iLoadingScheme::Unassigned), PlantSizNum(0), - LoopDemandCalcScheme(DataPlant::iLoopDemandCalcScheme::Unassigned), CommonPipeType(0), EconPlantSideSensedNodeNum(0), - EconCondSideSensedNodeNum(0), EconPlacement(0), EconBranch(0), EconComp(0), EconControlTempDiff(0.0), LoopHasConnectionComp(false), - TypeOfLoop(LoopType::Unassigned), PressureSimType(1), HasPressureComponents(false), PressureDrop(0.0), UsePressureForPumpCalcs(false), - PressureEffectiveK(0.0), CoolingDemand(0.0), HeatingDemand(0.0), DemandNotDispatched(0.0), UnmetDemand(0.0), BypassFrac(0.0), - InletNodeFlowrate(0.0), InletNodeTemperature(0.0), OutletNodeFlowrate(0.0), OutletNodeTemperature(0.0), LastLoopSideSimulated(0) + MaxMassFlowRate(0.0), Volume(0.0), VolumeWasAutoSized(false), CirculationTime(2.0), Mass(0.0), EMSCtrl(false), EMSValue(0.0), + NumOpSchemes(0), LoadDistribution(DataPlant::iLoadingScheme::Unassigned), PlantSizNum(0), + LoopDemandCalcScheme(DataPlant::iLoopDemandCalcScheme::Unassigned), CommonPipeType(DataPlant::iCommonPipeType::No), + EconPlantSideSensedNodeNum(0), EconCondSideSensedNodeNum(0), EconPlacement(0), EconBranch(0), EconComp(0), EconControlTempDiff(0.0), + LoopHasConnectionComp(false), TypeOfLoop(LoopType::Unassigned), PressureSimType(1), HasPressureComponents(false), PressureDrop(0.0), + UsePressureForPumpCalcs(false), PressureEffectiveK(0.0), CoolingDemand(0.0), HeatingDemand(0.0), DemandNotDispatched(0.0), + UnmetDemand(0.0), BypassFrac(0.0), InletNodeFlowrate(0.0), InletNodeTemperature(0.0), OutletNodeFlowrate(0.0), + OutletNodeTemperature(0.0), LastLoopSideSimulated(0) { } diff --git a/src/EnergyPlus/Plant/LoopSide.cc b/src/EnergyPlus/Plant/LoopSide.cc index dc300535651..5fac3adfe7a 100644 --- a/src/EnergyPlus/Plant/LoopSide.cc +++ b/src/EnergyPlus/Plant/LoopSide.cc @@ -680,7 +680,7 @@ namespace DataPlant { // then the "other side" demand needs to include getting the flow through the common pipe to the same setpoint // as the flow going through the actual supply side if (this->hasConstSpeedBranchPumps && this->myLoopSideNum == 2 && - thisPlantLoop.CommonPipeType != DataPlant::CommonPipe_No) { + thisPlantLoop.CommonPipeType != DataPlant::iCommonPipeType::No) { const int OtherSide = 3 - this->myLoopSideNum; const int otherSideOutletNodeNum = thisPlantLoop.LoopSide(OtherSide).NodeNumOut; Real64 commonPipeFlow = DataLoopNode::Node(otherSideOutletNodeNum).MassFlowRate - ThisLoopSideFlow; @@ -937,7 +937,7 @@ namespace DataPlant { } } else { // handle pumps differently if ((BranchCounter == 1) && (LoopSideCounter == DataPlant::SupplySide) && - (loop.CommonPipeType == DataPlant::CommonPipe_TwoWay)) { + (loop.CommonPipeType == DataPlant::iCommonPipeType::TwoWay)) { // special primary side flow request for two way common pipe int const CompIndex = component.CompNum; { @@ -965,7 +965,7 @@ namespace DataPlant { } } else if ((BranchCounter == 1) && (LoopSideCounter == DataPlant::SupplySide) && - (loop.CommonPipeType == DataPlant::CommonPipe_Single)) { + (loop.CommonPipeType == DataPlant::iCommonPipeType::Single)) { int const CompIndex = component.CompNum; { auto const SELECT_CASE_var(component.TypeOf_Num); @@ -1002,7 +1002,7 @@ namespace DataPlant { ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax); } else if (loop.CommonPipeType != - DataPlant::CommonPipe_No) { // common pipe and constant branch pumps + DataPlant::iCommonPipeType::No) { // common pipe and constant branch pumps ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax); } @@ -1023,7 +1023,7 @@ namespace DataPlant { max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax / this_pump.NumPumpsInBank); } else if (loop.CommonPipeType != - DataPlant::CommonPipe_No) { // common pipe and constant branch pumps + DataPlant::iCommonPipeType::No) { // common pipe and constant branch pumps ThisBranchFlowRequestNeedIfOn = max(ThisBranchFlowRequestNeedIfOn, this_pump.MassFlowRateMax / this_pump.NumPumpsInBank); @@ -1091,7 +1091,7 @@ namespace DataPlant { this_loop_side.FlowRequest = this_loop_side.flowRequestFinal; other_loop_side.FlowRequest = other_loop_side.flowRequestFinal; - if (loop.CommonPipeType == DataPlant::CommonPipe_No) { + if (loop.CommonPipeType == DataPlant::iCommonPipeType::No) { // we may or may not have a pump on this side, but the flow request is the larger of the two side's final if ((!this_loop_side.hasConstSpeedBranchPumps) && (!other_loop_side.hasConstSpeedBranchPumps)) { LoopFlow = max(this_loop_side.flowRequestFinal, other_loop_side.flowRequestFinal); @@ -1179,9 +1179,9 @@ namespace DataPlant { } } } - } else if (loop.CommonPipeType == DataPlant::CommonPipe_TwoWay) { + } else if (loop.CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { LoopFlow = this_loop_side.flowRequestFinal; - } else if (loop.CommonPipeType == DataPlant::CommonPipe_Single) { + } else if (loop.CommonPipeType == DataPlant::iCommonPipeType::Single) { LoopFlow = this_loop_side.flowRequestFinal; } @@ -1237,7 +1237,7 @@ namespace DataPlant { // We can now make a first pass through the component simulation, requesting flow as necessary. // Normal "supply side" components will set a mass flow rate on their outlet node to request flow, // while "Demand side" components will set a a mass flow request on their inlet node to request flow. - this->FlowLock = DataPlant::FlowUnlocked; + this->FlowLock = DataPlant::iFlowLock::Unlocked; this->SimulateAllLoopSideBranches(state, ThisLoopSideFlow, FirstHVACIteration, LoopShutDownFlag); // DSU? discussion/comments about loop solver/flow resolver interaction @@ -1274,7 +1274,7 @@ namespace DataPlant { // flag, and resimulate. During this simulation each component will still use the // SetFlowRequest routine, but this routine will also set the outlet flow rate // equal to the inlet flow rate, according to flowlock logic. - this->FlowLock = DataPlant::FlowLocked; + this->FlowLock = DataPlant::iFlowLock::Locked; this->SimulateAllLoopSideBranches(state, ThisLoopSideFlow, FirstHVACIteration, LoopShutDownFlag); } @@ -1790,7 +1790,7 @@ namespace DataPlant { } //~ CompCounter components_end:; - if (this->FlowLock == DataPlant::FlowLocked) { + if (this->FlowLock == DataPlant::iFlowLock::Locked) { PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall_Calc, this->myLoopSideNum, BranchCounter); } @@ -1866,7 +1866,7 @@ namespace DataPlant { components2_end:; //~ If we are locked, go ahead and simulate the pressure components on this branch - if (this->FlowLock == DataPlant::FlowLocked) { + if (this->FlowLock == DataPlant::iFlowLock::Locked) { PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall_Calc, this->myLoopSideNum, BranchCounter); } @@ -1917,7 +1917,7 @@ namespace DataPlant { } //~ CompCounter - if (this->FlowLock == DataPlant::FlowLocked) { + if (this->FlowLock == DataPlant::iFlowLock::Locked) { PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall_Calc, this->myLoopSideNum, BranchCounter); } @@ -1955,8 +1955,6 @@ namespace DataPlant { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::FlowLocked; - using DataPlant::FlowUnlocked; using DataPlant::LoadRangeBasedMax; using DataPlant::LoadRangeBasedMin; using DataPlant::PlantLoop; @@ -1974,7 +1972,7 @@ namespace DataPlant { int const InletNode(this_comp.NodeNumIn); int const OutletNode(this_comp.NodeNumOut); - if (this->FlowLock == FlowUnlocked) { + if (this->FlowLock == DataPlant::iFlowLock::Unlocked) { // For unlocked flow, use the inlet request -- !DSU? for now { @@ -1988,7 +1986,7 @@ namespace DataPlant { } } - } else if (this->FlowLock == FlowLocked) { + } else if (this->FlowLock == DataPlant::iFlowLock::Locked) { // For locked flow just use the mass flow rate { @@ -2146,7 +2144,7 @@ namespace DataPlant { e.CurrentMinAvail = 0.0; e.CurrentMaxAvail = 0.0; } - this->FlowLock = DataPlant::FlowPumpQuery; + this->FlowLock = DataPlant::iFlowLock::PumpQuery; //~ Simulate pumps this->SimulateAllLoopSidePumps(state); diff --git a/src/EnergyPlus/Plant/LoopSide.hh b/src/EnergyPlus/Plant/LoopSide.hh index a179c5a152a..9828226243a 100644 --- a/src/EnergyPlus/Plant/LoopSide.hh +++ b/src/EnergyPlus/Plant/LoopSide.hh @@ -101,9 +101,9 @@ namespace DataPlant { Real64 EMSValue; bool FlowRestrictionFlag; // Max available flow at the outlet of the half loop // is less than max available flow at inlet - int FlowLock; // DSU + DataPlant::iFlowLock FlowLock; int TotalConnected; // total number of other loops connected to this loop side - Array1D Connected; // DSU Other loops connected to this Loop side + Array1D Connected; // Other loops connected to this Loop side Array1D Branch; // Branch data SplitterData Splitter; // Data for splitter on branch (if any) MixerData Mixer; // Data for splitter on branch (if any) @@ -149,15 +149,16 @@ namespace DataPlant { OncePerTimeStepOperations(true), TimeElapsed(0.0), FlowRequest(0.0), FlowRequestTemperature(0.0), TempSetPoint(DataLoopNode::SensedNodeFlagValue), TempSetPointHi(DataLoopNode::SensedNodeFlagValue), TempSetPointLo(DataLoopNode::SensedNodeFlagValue), TempInterfaceTankOutlet(0.0), LastTempInterfaceTankOutlet(0.0), TotalBranches(0), - NodeNumIn(0), NodeNumOut(0), TotalPumps(0), - BranchPumpsExist(false), TotalPumpHeat(0.0), BypassExists(false), InletNodeSetPt(false), OutletNodeSetPt(false), EMSCtrl(false), EMSValue(0.0), - FlowRestrictionFlag(false), FlowLock(0), TotalConnected(0), HasPressureComponents(false), HasParallelPressComps(false), - PressureDrop(0.0), PressureEffectiveK(0.0), errCount_LoadWasntDist(0), errIndex_LoadWasntDist(0), errCount_LoadRemains(0), - errIndex_LoadRemains(0), LoopSideInlet_TankTemp(0.0), LoopSideInlet_MdotCpDeltaT(0.0), LoopSideInlet_McpDTdt(0.0), - LoopSideInlet_CapExcessStorageTime(0.0), LoopSideInlet_CapExcessStorageTimeReport(0.0), LoopSideInlet_TotalTime(0.0), - InletNode(0.0, 0.0), OutletNode(0.0, 0.0), flowRequestNeedIfOn(0.0), flowRequestNeedAndTurnOn(0.0), flowRequestFinal(0.0), - hasConstSpeedBranchPumps(false), InitialDemandToLoopSetPoint(0.0), CurrentAlterationsToDemand(0.0), UpdatedDemandToLoopSetPoint(0.0), - LoadToLoopSetPointThatWasntMet(0.0), InitialDemandToLoopSetPointSAVED(0.0), refrigIndex(0), LoopSetPtDemandAtInlet(0.0), ThisSideLoadAlterations(0.0), myLoopNum(0), myLoopSideNum(0), myOtherLoopSideNum(0) + NodeNumIn(0), NodeNumOut(0), TotalPumps(0), BranchPumpsExist(false), TotalPumpHeat(0.0), BypassExists(false), InletNodeSetPt(false), + OutletNodeSetPt(false), EMSCtrl(false), EMSValue(0.0), FlowRestrictionFlag(false), FlowLock(DataPlant::iFlowLock::Unlocked), + TotalConnected(0), HasPressureComponents(false), HasParallelPressComps(false), PressureDrop(0.0), PressureEffectiveK(0.0), + errCount_LoadWasntDist(0), errIndex_LoadWasntDist(0), errCount_LoadRemains(0), errIndex_LoadRemains(0), LoopSideInlet_TankTemp(0.0), + LoopSideInlet_MdotCpDeltaT(0.0), LoopSideInlet_McpDTdt(0.0), LoopSideInlet_CapExcessStorageTime(0.0), + LoopSideInlet_CapExcessStorageTimeReport(0.0), LoopSideInlet_TotalTime(0.0), InletNode(0.0, 0.0), OutletNode(0.0, 0.0), + flowRequestNeedIfOn(0.0), flowRequestNeedAndTurnOn(0.0), flowRequestFinal(0.0), hasConstSpeedBranchPumps(false), + InitialDemandToLoopSetPoint(0.0), CurrentAlterationsToDemand(0.0), UpdatedDemandToLoopSetPoint(0.0), + LoadToLoopSetPointThatWasntMet(0.0), InitialDemandToLoopSetPointSAVED(0.0), refrigIndex(0), LoopSetPtDemandAtInlet(0.0), + ThisSideLoadAlterations(0.0), myLoopNum(0), myLoopSideNum(0), myOtherLoopSideNum(0) { } diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index 9fb9d1bb069..cfab24750cf 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -203,8 +203,8 @@ namespace EnergyPlus { int CurntMinPlantSubIterations; if (std::any_of(PlantLoop.begin(), PlantLoop.end(), [](DataPlant::PlantLoopData const &e) { - return (e.CommonPipeType == DataPlant::CommonPipe_Single) || - (e.CommonPipeType == DataPlant::CommonPipe_TwoWay); + return (e.CommonPipeType == DataPlant::iCommonPipeType::Single) || + (e.CommonPipeType == DataPlant::iCommonPipeType::TwoWay); })) { CurntMinPlantSubIterations = max(7, state.dataConvergeParams->MinPlantSubIterations); } else { @@ -542,11 +542,11 @@ namespace EnergyPlus { // When Commonpipe is allowed in condenser loop modify this code. Sankar 06/29/2009 if (this_loop.TypeOfLoop == LoopType::Plant) { if (UtilityRoutines::SameString(Alpha(17), "CommonPipe")) { - this_loop.CommonPipeType = CommonPipe_Single; + this_loop.CommonPipeType = DataPlant::iCommonPipeType::Single; } else if (UtilityRoutines::SameString(Alpha(17), "TwoWayCommonPipe")) { - this_loop.CommonPipeType = CommonPipe_TwoWay; + this_loop.CommonPipeType = DataPlant::iCommonPipeType::TwoWay; } else if (UtilityRoutines::SameString(Alpha(17), "None") || lAlphaFieldBlanks(17)) { - this_loop.CommonPipeType = CommonPipe_No; + this_loop.CommonPipeType = DataPlant::iCommonPipeType::No; } else { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid choice."); ShowContinueError(state, "Invalid " + cAlphaFieldNames(17) + "=\"" + Alpha(17) + "\"."); @@ -554,10 +554,10 @@ namespace EnergyPlus { ErrorsFound = true; } } else if (this_loop.TypeOfLoop == LoopType::Condenser) { - this_loop.CommonPipeType = CommonPipe_No; + this_loop.CommonPipeType = DataPlant::iCommonPipeType::No; } - if (this_loop.CommonPipeType == CommonPipe_TwoWay) { + if (this_loop.CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { if (this_demand_side.InletNodeSetPt && this_supply_side.InletNodeSetPt) { ShowSevereError(state, RoutineName + CurrentModuleObject + "=\"" + Alpha(1) + "\", Invalid condition."); @@ -1633,12 +1633,12 @@ namespace EnergyPlus { // a nice little spot to report out bad pump/common-pipe configurations bool const ThisSideHasPumps = (plantLoop.LoopSide(1).TotalPumps > 0); bool const OtherSideHasPumps = (plantLoop.LoopSide(2).TotalPumps > 0); - if ((plantLoop.CommonPipeType != CommonPipe_No) && (!ThisSideHasPumps || !OtherSideHasPumps)) { + if ((plantLoop.CommonPipeType != DataPlant::iCommonPipeType::No) && (!ThisSideHasPumps || !OtherSideHasPumps)) { ShowSevereError(state, "Input Error: Common Pipe configurations must have pumps on both sides of loop"); ShowContinueError(state, "Occurs on plant loop name =\"" + plantLoop.Name + "\""); ShowContinueError(state, "Make sure both demand and supply sides have a pump"); ErrorsFound = true; - } else if ((plantLoop.CommonPipeType == CommonPipe_No) && ThisSideHasPumps && OtherSideHasPumps) { + } else if ((plantLoop.CommonPipeType == DataPlant::iCommonPipeType::No) && ThisSideHasPumps && OtherSideHasPumps) { ShowSevereError(state, "Input Error: Pumps on both loop sides must utilize a common pipe"); ShowContinueError(state, "Occurs on plant loop name =\"" + plantLoop.Name + "\""); ShowContinueError(state, "Add common pipe or remove one loop side pump"); @@ -2176,7 +2176,7 @@ namespace EnergyPlus { //***************************************************************** if (!PlantFirstSizeCompleted) { - SetAllFlowLocks(FlowUnlocked); + SetAllFlowLocks(DataPlant::iFlowLock::Unlocked); FinishSizingFlag = false; PlantFirstSizesOkayToFinalize = false; // set global flag for when it ready to store final sizes PlantFirstSizesOkayToReport = false; @@ -2475,7 +2475,7 @@ namespace EnergyPlus { } } - if ((PlantLoop(LoopNum).CommonPipeType == CommonPipe_TwoWay) && (LoopSideNum == DemandSide) && + if ((PlantLoop(LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && (LoopSideNum == DemandSide) && (PlantLoop(LoopNum).LoopSide( DemandSide).InletNodeSetPt)) { // get a second setpoint for secondaryLoop // if the plant loop is two common pipe configured for temperature control on secondary side inlet, then @@ -2505,7 +2505,7 @@ namespace EnergyPlus { e.PumpHeatToFluid = 0.0; PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowRequest = 0.0; PlantLoop(LoopNum).LoopSide(LoopSideNum).TimeElapsed = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = 0; + PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = DataPlant::iFlowLock::Unlocked; PlantLoop(LoopNum).LoopSide(LoopSideNum).InletNode.TemperatureHistory = 0.0; PlantLoop(LoopNum).LoopSide(LoopSideNum).InletNode.MassFlowRateHistory = 0.0; PlantLoop(LoopNum).LoopSide(LoopSideNum).OutletNode.TemperatureHistory = 0.0; @@ -2653,7 +2653,7 @@ namespace EnergyPlus { } // update demand side loop setpoint in plant data structure - if (PlantLoop(LoopNum).CommonPipeType == CommonPipe_TwoWay) { // get a second setpoint for secondaryLoop + if (PlantLoop(LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { // get a second setpoint for secondaryLoop // if the plant loop is two common pipe configured for temperature control on secondary side inlet, then // we want to initialize the demand side of the loop using that setpoint if (PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index 70509981c2b..45e80983582 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -2719,7 +2719,7 @@ namespace PlantCentralGSHP { CurCoolingLoad = std::abs(MyLoad); this->WrapperCoolingLoad = CurCoolingLoad; // Set actual mass flow rate at the nodes when it's locked - if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 1) { + if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { CHWInletMassFlowRate = DataLoopNode::Node(this->CHWInletNodeNum).MassFlowRate; } if (CHWInletMassFlowRate == 0.0) GLHEInletMassFlowRate = 0.0; @@ -2733,7 +2733,7 @@ namespace PlantCentralGSHP { CurHeatingLoad = MyLoad; this->WrapperHeatingLoad = CurHeatingLoad; // Set actual mass flow rate at the nodes when it's locked - if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 1) { + if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { HWInletMassFlowRate = DataLoopNode::Node(this->HWInletNodeNum).MassFlowRate; } if (HWInletMassFlowRate == 0.0) GLHEInletMassFlowRate = 0.0; diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index 247eafef384..bb28f751033 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -1353,7 +1353,7 @@ namespace PlantChillers { if (MyLoad >= 0.0 || !RunFlag) { // call for zero flow before leaving if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 1) { + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -1542,7 +1542,7 @@ namespace PlantChillers { // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 0) { + if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = !(DataPlant::PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWLoopSideNum) @@ -3283,7 +3283,7 @@ namespace PlantChillers { // If Chiller load is 0 or chiller is not running then leave the subroutine. if (MyLoad >= 0.0 || !RunFlag) { if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 1) { + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -3450,7 +3450,7 @@ namespace PlantChillers { // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 0) { + if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = AvailChillerCap * OperPartLoadRat; Real64 FRAC; @@ -5185,7 +5185,7 @@ namespace PlantChillers { // flow resolver will not shut down the branch if (MyLoad >= 0.0 || !RunFlag) { if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 1) { + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -5344,7 +5344,7 @@ namespace PlantChillers { RoutineName); // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 0) { + if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = AvailChillerCap * OperPartLoadRat; Real64 FRAC; @@ -6752,7 +6752,7 @@ namespace PlantChillers { // 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 (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 1) { + DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -6891,7 +6891,7 @@ namespace PlantChillers { DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == 0) { + if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = std::abs(MyLoad); this->Power = std::abs(MyLoad) / COP; diff --git a/src/EnergyPlus/PlantLoadProfile.cc b/src/EnergyPlus/PlantLoadProfile.cc index c6d26356901..9741b283ae0 100644 --- a/src/EnergyPlus/PlantLoadProfile.cc +++ b/src/EnergyPlus/PlantLoadProfile.cc @@ -228,8 +228,6 @@ namespace PlantLoadProfile { if (state.dataGlobal->BeginEnvrnFlag && this->Init) { // Clear node initial conditions - // DSU? can we centralize these temperature inits - // Node(InletNode)%Temp = 0.0 Node(OutletNode).Temp = 0.0; FluidDensityInit = diff --git a/src/EnergyPlus/PlantPressureSystem.cc b/src/EnergyPlus/PlantPressureSystem.cc index fdb4c3c0585..b694cf296f7 100644 --- a/src/EnergyPlus/PlantPressureSystem.cc +++ b/src/EnergyPlus/PlantPressureSystem.cc @@ -171,7 +171,6 @@ namespace EnergyPlus::PlantPressureSystem { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::CommonPipe_No; using DataPlant::DemandSide; using DataPlant::PlantLoop; using DataPlant::Press_NoPressure; @@ -348,7 +347,7 @@ namespace EnergyPlus::PlantPressureSystem { // Before we leave, override any settings in case we are doing common pipe simulation if (loop.HasPressureComponents) { // We need to make sure we aren't doing an invalid configuration here - if (loop.CommonPipeType != CommonPipe_No) { + if (loop.CommonPipeType != DataPlant::iCommonPipeType::No) { // There is a common pipe! if (!CommonPipeErrorEncountered) { ShowSevereError(state, "Invalid pressure simulation configuration for Plant Loop=" + loop.Name); diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index 0f5772d1565..0435fd9fe78 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -278,7 +278,7 @@ namespace PlantUtilities { } // Set loop flow rate - if (loop_side.FlowLock == DataPlant::FlowUnlocked) { + if (loop_side.FlowLock == DataPlant::iFlowLock::Unlocked) { if (DataPlant::PlantLoop(LoopNum).MaxVolFlowRate == DataSizing::AutoSize) { // still haven't sized the plant loop DataLoopNode::Node(OutletNode).MassFlowRate = CompFlow; DataLoopNode::Node(InletNode).MassFlowRate = DataLoopNode::Node(OutletNode).MassFlowRate; @@ -357,7 +357,7 @@ namespace PlantUtilities { DataLoopNode::Node(InletNode).MassFlowRate = DataLoopNode::Node(OutletNode).MassFlowRate; } } - } else if (loop_side.FlowLock == DataPlant::FlowLocked) { + } else if (loop_side.FlowLock == DataPlant::iFlowLock::Locked) { DataLoopNode::Node(OutletNode).MassFlowRate = DataLoopNode::Node(InletNode).MassFlowRate; CompFlow = DataLoopNode::Node(OutletNode).MassFlowRate; } else { @@ -411,7 +411,7 @@ namespace PlantUtilities { a_node.MassFlowRateRequest = CompFlow; if (LoopNum > 0 && LoopSideNum > 0 && (!ResetMode)) { if ((MdotOldRequest > 0.0) && (CompFlow > 0.0)) { // sure that not coming back from a no flow reset - if ((std::abs(MdotOldRequest - a_node.MassFlowRateRequest) > DataBranchAirLoopPlant::MassFlowTolerance) && (loop_side.FlowLock == DataPlant::FlowUnlocked)) { + if ((std::abs(MdotOldRequest - a_node.MassFlowRateRequest) > DataBranchAirLoopPlant::MassFlowTolerance) && (loop_side.FlowLock == DataPlant::iFlowLock::Unlocked)) { loop_side.SimLoopSideNeeded = true; } } @@ -420,7 +420,7 @@ namespace PlantUtilities { if (LoopNum > 0 && LoopSideNum > 0) { auto const &branch(loop_side.Branch(BranchNum)); - if (loop_side.FlowLock == DataPlant::FlowUnlocked) { + if (loop_side.FlowLock == DataPlant::iFlowLock::Unlocked) { if (DataPlant::PlantLoop(LoopNum).MaxVolFlowRate == DataSizing::AutoSize) { // still haven't sized the plant loop a_node.MassFlowRate = CompFlow; } else { // bound the flow by Min/Max available across entire branch @@ -469,7 +469,7 @@ namespace PlantUtilities { } } - } else if (loop_side.FlowLock == DataPlant::FlowLocked) { + } else if (loop_side.FlowLock == DataPlant::iFlowLock::Locked) { CompFlow = a_node.MassFlowRate; // do not change requested flow rate either @@ -900,7 +900,7 @@ namespace PlantUtilities { } } - void SetAllFlowLocks(int const Value) + void SetAllFlowLocks(DataPlant::iFlowLock const Value) { // SUBROUTINE INFORMATION: diff --git a/src/EnergyPlus/PlantUtilities.hh b/src/EnergyPlus/PlantUtilities.hh index 9dfd1c3fcfe..544c7461d95 100644 --- a/src/EnergyPlus/PlantUtilities.hh +++ b/src/EnergyPlus/PlantUtilities.hh @@ -103,7 +103,7 @@ namespace PlantUtilities { void CheckForRunawayPlantTemps(EnergyPlusData &state, int const LoopNum, int const LoopSideNum); - void SetAllFlowLocks(int const Value); + void SetAllFlowLocks(DataPlant::iFlowLock const Value); void ResetAllPlantInterConnectFlags(); diff --git a/src/EnergyPlus/PlantValves.cc b/src/EnergyPlus/PlantValves.cc index 78524be3280..a39828a73fc 100644 --- a/src/EnergyPlus/PlantValves.cc +++ b/src/EnergyPlus/PlantValves.cc @@ -447,7 +447,7 @@ namespace PlantValves { if (state.dataGlobal->KickOffSimulation) return; - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 0) { + if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { Tin = this->InletTemp; Tset = this->SetPointTemp; Ts2 = this->Stream2SourceTemp; @@ -461,7 +461,7 @@ namespace PlantValves { this->FlowDivFract = 1.0; } } - } else if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == 1) { // don't recalc diversion, just reuse current flows + } else if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { // don't recalc diversion, just reuse current flows if (this->MixedMassFlowRate > 0.0) { this->FlowDivFract = Node(this->PltOutletNodeNum).MassFlowRate / this->MixedMassFlowRate; } else { diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index d99d97195d7..8651e0711ca 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -199,7 +199,6 @@ namespace Pumps { // the necessary loop and the PumpRunning has been correctly set. // Using/Aliasing - using DataPlant::FlowPumpQuery; using DataPlant::PlantLoop; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -247,7 +246,7 @@ namespace Pumps { InitializePumps(state, PumpNum); // If all we need is to set outlet min/max avail, then just do it and get out. Also, we only do min/max avail on flow query - if (PlantLoop(LoopNum).LoopSide(PumpEquip(PumpNum).LoopSideNum).FlowLock == FlowPumpQuery) { + if (PlantLoop(LoopNum).LoopSide(PumpEquip(PumpNum).LoopSideNum).FlowLock == DataPlant::iFlowLock::PumpQuery) { SetupPumpMinMaxFlows(state, LoopNum, PumpNum); return; } diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 110120f62c4..02c28df4b88 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -304,7 +304,7 @@ namespace WaterThermalTanks { if (this->UseSide.loopNum > 0 && this->UseSide.loopSideNum > 0 && !state.dataGlobal->KickOffSimulation) { this->UseCurrentFlowLock = DataPlant::PlantLoop(this->UseSide.loopNum).LoopSide(this->UseSide.loopSideNum).FlowLock; } else { - this->UseCurrentFlowLock = 1; + this->UseCurrentFlowLock = DataPlant::iFlowLock::Locked; } this->initialize(state, FirstHVACIteration); // Plant connected water heaters may have a desuperheater heating coil attached @@ -394,7 +394,7 @@ namespace WaterThermalTanks { if (Tank.UseSide.loopNum > 0 && Tank.UseSide.loopSideNum > 0 && !state.dataGlobal->KickOffSimulation) { Tank.UseCurrentFlowLock = DataPlant::PlantLoop(Tank.UseSide.loopNum).LoopSide(Tank.UseSide.loopSideNum).FlowLock; } else { - Tank.UseCurrentFlowLock = 1; + Tank.UseCurrentFlowLock = DataPlant::iFlowLock::Locked; } Tank.initialize(state, FirstHVACIteration); @@ -9991,7 +9991,7 @@ namespace WaterThermalTanks { } else if (PlantLoopSide == DataPlant::SupplySide) { // If FlowLock is False (0), the tank sets the plant loop mdot // If FlowLock is True (1), the new resolved plant loop mdot is used - if (this->UseCurrentFlowLock == 0) { + if (this->UseCurrentFlowLock == DataPlant::iFlowLock::Unlocked) { CurrentMode = PassingFlowThru; if ((this->UseSideLoadRequested > 0.0) && (WaterThermalTankSide == SideEnum::Use)) { CurrentMode = MaybeRequestingFlow; diff --git a/src/EnergyPlus/WaterThermalTanks.hh b/src/EnergyPlus/WaterThermalTanks.hh index e457cc696a0..c422f988e24 100644 --- a/src/EnergyPlus/WaterThermalTanks.hh +++ b/src/EnergyPlus/WaterThermalTanks.hh @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -440,7 +441,7 @@ namespace WaterThermalTanks { Real64 OnCycParaLoad; // Rate for on-cycle parasitic load (W) std::string OnCycParaFuelType; // Fuel type for on-cycle parasitic load Real64 OnCycParaFracToTank; // Fraction of on-cycle parasitic energy ending up in tank (W) - int UseCurrentFlowLock; // current flow lock setting on use side + DataPlant::iFlowLock UseCurrentFlowLock; // current flow lock setting on use side int UseInletNode; // Inlet node on the use side; colder water returning to a hottank Real64 UseInletTemp; // Use side inlet temperature (C) int UseOutletNode; // Outlet node on the use side; hot tank water @@ -606,33 +607,34 @@ namespace WaterThermalTanks { OnCycLossCoeff(0.0), OnCycLossFracToZone(0.0), Mode(0), SavedMode(0), ControlType(ControlTypeEnum::Cycle), MaxCapacity(0.0), MaxCapacityWasAutoSized(false), MinCapacity(0.0), Efficiency(0.0), PLFCurve(0), SetPointTempSchedule(0), SetPointTemp(0.0), DeadBandDeltaTemp(0.0), TankTempLimit(0.0), IgnitionDelay(0.0), OffCycParaLoad(0.0), OffCycParaFracToTank(0.0), OnCycParaLoad(0.0), - OnCycParaFracToTank(0.0), UseCurrentFlowLock(0), UseInletNode(0), UseInletTemp(0.0), UseOutletNode(0), UseOutletTemp(0.0), - UseMassFlowRate(0.0), UseEffectiveness(0.0), PlantUseMassFlowRateMax(0.0), SavedUseOutletTemp(0.0), UseDesignVolFlowRate(0.0), - UseDesignVolFlowRateWasAutoSized(false), UseBranchControlType(DataBranchAirLoopPlant::ControlTypeEnum::Passive), UseSidePlantSizNum(0), UseSideSeries(true), UseSideAvailSchedNum(0), - UseSideLoadRequested(0.0), SourceInletNode(0), SourceInletTemp(0.0), SourceOutletNode(0), SourceOutletTemp(0.0), - SourceMassFlowRate(0.0), SourceEffectiveness(0.0), PlantSourceMassFlowRateMax(0.0), SavedSourceOutletTemp(0.0), - SourceDesignVolFlowRate(0.0), SourceDesignVolFlowRateWasAutoSized(false), SourceBranchControlType(DataBranchAirLoopPlant::ControlTypeEnum::Passive), SourceSidePlantSizNum(0), - SourceSideSeries(true), SourceSideAvailSchedNum(0), SourceSideControlMode(SourceSideEnum::IndirectHeatAltSetpoint), - SourceSideAltSetpointSchedNum(0), SizingRecoveryTime(0.0), MassFlowRateMax(0.0), VolFlowRateMin(0.0), MassFlowRateMin(0.0), - FlowRateSchedule(0), UseInletTempSchedule(0), TankTemp(0.0), SavedTankTemp(0.0), TankTempAvg(0.0), Height(0.0), - HeightWasAutoSized(false), Perimeter(0.0), Shape(TankShapeEnum::VertCylinder), HeaterHeight1(0.0), HeaterNode1(0), HeaterOn1(false), - SavedHeaterOn1(false), HeaterHeight2(0.0), HeaterNode2(0), HeaterOn2(false), SavedHeaterOn2(false), AdditionalCond(0.0), - SetPointTemp2(0.0), SetPointTempSchedule2(0), DeadBandDeltaTemp2(0.0), MaxCapacity2(0.0), OffCycParaHeight(0.0), OnCycParaHeight(0.0), - SkinLossCoeff(0.0), SkinLossFracToZone(0.0), OffCycFlueLossCoeff(0.0), OffCycFlueLossFracToZone(0.0), UseInletHeight(0.0), - UseOutletHeight(0.0), UseOutletHeightWasAutoSized(false), SourceInletHeight(0.0), SourceInletHeightWasAutoSized(false), - SourceOutletHeight(0.0), UseInletStratNode(0), UseOutletStratNode(0), SourceInletStratNode(0), SourceOutletStratNode(0), - InletMode(InletModeEnum::Fixed), InversionMixingRate(0.0), Nodes(0), VolFlowRate(0.0), VolumeConsumed(0.0), UnmetRate(0.0), - LossRate(0.0), FlueLossRate(0.0), UseRate(0.0), TotalDemandRate(0.0), SourceRate(0.0), HeaterRate(0.0), HeaterRate1(0.0), - HeaterRate2(0.0), FuelRate(0.0), FuelRate1(0.0), FuelRate2(0.0), VentRate(0.0), OffCycParaFuelRate(0.0), OffCycParaRateToTank(0.0), - OnCycParaFuelRate(0.0), OnCycParaRateToTank(0.0), NetHeatTransferRate(0.0), CycleOnCount(0), CycleOnCount1(0), CycleOnCount2(0), - RuntimeFraction(0.0), RuntimeFraction1(0.0), RuntimeFraction2(0.0), PartLoadRatio(0.0), UnmetEnergy(0.0), LossEnergy(0.0), - FlueLossEnergy(0.0), UseEnergy(0.0), TotalDemandEnergy(0.0), SourceEnergy(0.0), HeaterEnergy(0.0), HeaterEnergy1(0.0), - HeaterEnergy2(0.0), FuelEnergy(0.0), FuelEnergy1(0.0), FuelEnergy2(0.0), VentEnergy(0.0), OffCycParaFuelEnergy(0.0), - OffCycParaEnergyToTank(0.0), OnCycParaFuelEnergy(0.0), OnCycParaEnergyToTank(0.0), NetHeatTransferEnergy(0.0), FirstRecoveryDone(false), - FirstRecoveryFuel(0.0), HeatPumpNum(0), DesuperheaterNum(0), ShowSetPointWarning(true), MaxCycleErrorIndex(0), FreezingErrorIndex(0), - FluidIndex(0), MyOneTimeFlagWH(true), MyTwoTimeFlagWH(true), MyEnvrnFlag(true), WarmupFlag(false), SetLoopIndexFlag(true), - AlreadyReported(false), AlreadyRated(false), MyHPSizeFlag(true), CheckWTTEquipName(true), myOneTimeInitFlag(true), scanPlantLoopsFlag(true), - callerLoopNum(0), waterIndex(1) + OnCycParaFracToTank(0.0), UseCurrentFlowLock(DataPlant::iFlowLock::Unlocked), UseInletNode(0), UseInletTemp(0.0), UseOutletNode(0), + UseOutletTemp(0.0), UseMassFlowRate(0.0), UseEffectiveness(0.0), PlantUseMassFlowRateMax(0.0), SavedUseOutletTemp(0.0), + UseDesignVolFlowRate(0.0), UseDesignVolFlowRateWasAutoSized(false), + UseBranchControlType(DataBranchAirLoopPlant::ControlTypeEnum::Passive), UseSidePlantSizNum(0), UseSideSeries(true), + UseSideAvailSchedNum(0), UseSideLoadRequested(0.0), SourceInletNode(0), SourceInletTemp(0.0), SourceOutletNode(0), + SourceOutletTemp(0.0), SourceMassFlowRate(0.0), SourceEffectiveness(0.0), PlantSourceMassFlowRateMax(0.0), SavedSourceOutletTemp(0.0), + SourceDesignVolFlowRate(0.0), SourceDesignVolFlowRateWasAutoSized(false), + SourceBranchControlType(DataBranchAirLoopPlant::ControlTypeEnum::Passive), SourceSidePlantSizNum(0), SourceSideSeries(true), + SourceSideAvailSchedNum(0), SourceSideControlMode(SourceSideEnum::IndirectHeatAltSetpoint), SourceSideAltSetpointSchedNum(0), + SizingRecoveryTime(0.0), MassFlowRateMax(0.0), VolFlowRateMin(0.0), MassFlowRateMin(0.0), FlowRateSchedule(0), UseInletTempSchedule(0), + TankTemp(0.0), SavedTankTemp(0.0), TankTempAvg(0.0), Height(0.0), HeightWasAutoSized(false), Perimeter(0.0), + Shape(TankShapeEnum::VertCylinder), HeaterHeight1(0.0), HeaterNode1(0), HeaterOn1(false), SavedHeaterOn1(false), HeaterHeight2(0.0), + HeaterNode2(0), HeaterOn2(false), SavedHeaterOn2(false), AdditionalCond(0.0), SetPointTemp2(0.0), SetPointTempSchedule2(0), + DeadBandDeltaTemp2(0.0), MaxCapacity2(0.0), OffCycParaHeight(0.0), OnCycParaHeight(0.0), SkinLossCoeff(0.0), SkinLossFracToZone(0.0), + OffCycFlueLossCoeff(0.0), OffCycFlueLossFracToZone(0.0), UseInletHeight(0.0), UseOutletHeight(0.0), UseOutletHeightWasAutoSized(false), + SourceInletHeight(0.0), SourceInletHeightWasAutoSized(false), SourceOutletHeight(0.0), UseInletStratNode(0), UseOutletStratNode(0), + SourceInletStratNode(0), SourceOutletStratNode(0), InletMode(InletModeEnum::Fixed), InversionMixingRate(0.0), Nodes(0), + VolFlowRate(0.0), VolumeConsumed(0.0), UnmetRate(0.0), LossRate(0.0), FlueLossRate(0.0), UseRate(0.0), TotalDemandRate(0.0), + SourceRate(0.0), HeaterRate(0.0), HeaterRate1(0.0), HeaterRate2(0.0), FuelRate(0.0), FuelRate1(0.0), FuelRate2(0.0), VentRate(0.0), + OffCycParaFuelRate(0.0), OffCycParaRateToTank(0.0), OnCycParaFuelRate(0.0), OnCycParaRateToTank(0.0), NetHeatTransferRate(0.0), + CycleOnCount(0), CycleOnCount1(0), CycleOnCount2(0), RuntimeFraction(0.0), RuntimeFraction1(0.0), RuntimeFraction2(0.0), + PartLoadRatio(0.0), UnmetEnergy(0.0), LossEnergy(0.0), FlueLossEnergy(0.0), UseEnergy(0.0), TotalDemandEnergy(0.0), SourceEnergy(0.0), + HeaterEnergy(0.0), HeaterEnergy1(0.0), HeaterEnergy2(0.0), FuelEnergy(0.0), FuelEnergy1(0.0), FuelEnergy2(0.0), VentEnergy(0.0), + OffCycParaFuelEnergy(0.0), OffCycParaEnergyToTank(0.0), OnCycParaFuelEnergy(0.0), OnCycParaEnergyToTank(0.0), + NetHeatTransferEnergy(0.0), FirstRecoveryDone(false), FirstRecoveryFuel(0.0), HeatPumpNum(0), DesuperheaterNum(0), + ShowSetPointWarning(true), MaxCycleErrorIndex(0), FreezingErrorIndex(0), FluidIndex(0), MyOneTimeFlagWH(true), MyTwoTimeFlagWH(true), + MyEnvrnFlag(true), WarmupFlag(false), SetLoopIndexFlag(true), AlreadyReported(false), AlreadyRated(false), MyHPSizeFlag(true), + CheckWTTEquipName(true), myOneTimeInitFlag(true), scanPlantLoopsFlag(true), callerLoopNum(0), waterIndex(1) { } diff --git a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc index 6fce16c550b..1578141d562 100644 --- a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc @@ -1812,11 +1812,11 @@ TEST_F(EnergyPlusFixture, ChillerAbsorption_Calc) // lock the evap flow at test condition specified int LoopNum = thisChiller.CWLoopNum; int LoopSideNum = thisChiller.CWLoopSideNum; - PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = 1; + PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = DataPlant::iFlowLock::Locked; // calc generator flow int GenLoopNum = thisChiller.GenLoopNum; int GenLoopSideNum = thisChiller.GenLoopSideNum; - PlantLoop(GenLoopNum).LoopSide(GenLoopSideNum).FlowLock = 0; + PlantLoop(GenLoopNum).LoopSide(GenLoopSideNum).FlowLock = DataPlant::iFlowLock::Unlocked; // run CalcBLASTAbsorberModel thisChiller.EquipFlowCtrl = EquipFlowCtrl; thisChiller.calculate(*state, AbsChillEvapLoad, AbsChillRunFlag); diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index d2fda2f784e..8e69e94f2fb 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -3939,7 +3939,7 @@ TEST_F(EnergyPlusFixture, VSCoolingTowers_WaterOutletTempTest) Real64 WaterFlowRateRatio = 0.75; Real64 AirWetBulbTemp = state->dataEnvrn->OutWetBulbTemp; - DataPlant::PlantLoop(VSTower.LoopNum).LoopSide(VSTower.LoopSideNum).FlowLock = 1; + DataPlant::PlantLoop(VSTower.LoopNum).LoopSide(VSTower.LoopSideNum).FlowLock = DataPlant::iFlowLock::Locked; DataPlant::PlantLoop(VSTower.LoopNum).LoopSide(VSTower.LoopSideNum).TempSetPoint = 30.0; VSTower.WaterMassFlowRate = VSTower.DesWaterMassFlowRate * WaterFlowRateRatio; diff --git a/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc b/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc index 7f5fb2c82ce..e80717c096b 100644 --- a/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc +++ b/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc @@ -132,7 +132,7 @@ TEST_F(EvapFluidCoolersFixture, EvapFluidCoolerSpecs_getDesignCapacitiesTest) DataLoopNode::Node(1).MassFlowRateMaxAvail = 0.05; DataPlant::PlantLoop.allocate(1); DataPlant::PlantLoop(1).LoopSide.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).FlowLock = DataPlant::FlowLocked; + DataPlant::PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).MyLoad = 1.0; diff --git a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc index 661a3783395..b88d05baa74 100644 --- a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc +++ b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc @@ -1004,7 +1004,7 @@ namespace EnergyPlus { PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - PlantLoop(2).LoopSide(1).FlowLock = 0; + PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; PlantLoop(1).Name = "HotWaterLoop"; PlantLoop(1).FluidName = "HotWater"; @@ -1014,7 +1014,7 @@ namespace EnergyPlus { PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - PlantLoop(1).LoopSide(1).FlowLock = 0; + PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; FanCoil(1).CoolCoilLoopNum = 2; FanCoil(1).HeatCoilLoopNum = 1; @@ -1059,7 +1059,7 @@ namespace EnergyPlus { // expect inlet and outlet node air mass flow rates are equal EXPECT_EQ(Node(FanCoil(1).AirInNode).MassFlowRate, Node(FanCoil(1).AirOutNode).MassFlowRate); FirstHVACIteration = false; - PlantLoop(1).LoopSide(1).FlowLock = 1; + PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; Node(FanCoil(1).HeatCoilFluidInletNode).MassFlowRate = 0.2; // Simulate with flow lock on and locked flow > demand flow; bypass extra flow Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); @@ -1076,7 +1076,7 @@ namespace EnergyPlus { // normal heating, no flow lock, heating capacity exceeded QZnReq = 5000.0; ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = 5000.00; - PlantLoop(1).LoopSide(1).FlowLock = 0; + PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); EXPECT_NEAR(4420.0, QUnitOut, 5.0); // expect inlet and outlet node air mass flow rates are equal @@ -1085,7 +1085,7 @@ namespace EnergyPlus { // Coil Off Capacity Test #1 - low heating load, no flow lock, setting QUnitOutNoHC when flow lock = 0 QZnReq = 80.0; ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = 80.00; - PlantLoop(1).LoopSide(1).FlowLock = 0; + PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); // FC hits the 80 W target load EXPECT_NEAR(80.0, QUnitOut, 1.0); @@ -1096,7 +1096,7 @@ namespace EnergyPlus { EXPECT_EQ(Node(FanCoil(1).AirInNode).MassFlowRate, Node(FanCoil(1).AirOutNode).MassFlowRate); // Coil Off Capacity Test #2 - lock plant flow after previous call - PlantLoop(1).LoopSide(1).FlowLock = 1; + PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; Node(OAMixer(1).RetNode).Temp = 25.0; // change inlet air condition so off capacity will change to see if QUnitOutNoHC remains fixed Node(OAMixer(1).RetNode).Enthalpy = 39000; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); @@ -1110,7 +1110,7 @@ namespace EnergyPlus { EXPECT_EQ(Node(FanCoil(1).AirInNode).MassFlowRate, Node(FanCoil(1).AirOutNode).MassFlowRate); // Coil Off Capacity Test #3 - unlock plant flow to ensure that water flow rate would have been different had flow not been locked - PlantLoop(1).LoopSide(1).FlowLock = 0; + PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); // FC hits the 80 W target load EXPECT_NEAR(80.0, QUnitOut, 1.0); @@ -1367,7 +1367,7 @@ namespace EnergyPlus { PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - PlantLoop(1).LoopSide(1).FlowLock = 0; + PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; FanCoil(1).CoolCoilLoopNum = 1; FanCoil(1).HeatCoilLoopNum = 0; @@ -1702,7 +1702,7 @@ namespace EnergyPlus { PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - PlantLoop(2).LoopSide(1).FlowLock = 0; + PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; PlantLoop(1).Name = "HotWaterLoop"; PlantLoop(1).FluidName = "HotWater"; @@ -1712,7 +1712,7 @@ namespace EnergyPlus { PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - PlantLoop(1).LoopSide(1).FlowLock = 0; + PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; FanCoil(1).CoolCoilLoopNum = 2; FanCoil(1).HeatCoilLoopNum = 1; @@ -1757,7 +1757,7 @@ namespace EnergyPlus { EXPECT_EQ(Node(FanCoil(1).AirInNode).MassFlowRate, Node(FanCoil(1).AirOutNode).MassFlowRate); FirstHVACIteration = false; - PlantLoop(2).LoopSide(1).FlowLock = 1; + PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; Node(FanCoil(1).CoolCoilFluidInletNode).MassFlowRate = 0.2; // cooling simulation with flow lock on and locked flow > flow that meets load; bypass extra flow Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); @@ -1776,7 +1776,7 @@ namespace EnergyPlus { // normal cooling, no flow lock, cooling capacity exceeded QZnReq = -5000.0; ZoneSysEnergyDemand(1).RemainingOutputReqToCoolSP = -5000.00; - PlantLoop(2).LoopSide(1).FlowLock = 0; + PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); EXPECT_NEAR(-4420.0, QUnitOut, 5.0); // expect inlet and outlet node air mass flow rates are equal diff --git a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc index 90b2fba9175..3453c5a6220 100644 --- a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc +++ b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc @@ -1748,7 +1748,7 @@ TEST_F(EnergyPlusFixture, Beam_sizeandSimulateOneZone) bool FirstHVACIteration = true; // PlantManager::InitializeLoops( FirstHVACIteration ); - PlantUtilities::SetAllFlowLocks(DataPlant::FlowUnlocked); + PlantUtilities::SetAllFlowLocks(DataPlant::iFlowLock::Unlocked); // first run with a sensible cooling load of 5000 W and cold supply air DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = -5000.0; DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = -4000.0; diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 7425ecbf5a1..a0c012d016f 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -1299,7 +1299,7 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.2, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag off, load side flow locked - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = true; + DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.24; DataLoopNode::Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRateMinAvail = 0.0; thisCoolingPLHP->running = false; @@ -1308,8 +1308,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on load side - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = true; - DataPlant::PlantLoop(2).LoopSide(1).FlowLock = true; + DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + DataPlant::PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; DataLoopNode::Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.2; thisCoolingPLHP->running = true; @@ -1318,8 +1318,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.2, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on source side - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = true; - DataPlant::PlantLoop(2).LoopSide(1).FlowLock = true; + DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + DataPlant::PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.2; DataLoopNode::Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; @@ -1328,8 +1328,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on both sides - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = true; - DataPlant::PlantLoop(2).LoopSide(1).FlowLock = true; + DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + DataPlant::PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; DataLoopNode::Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; @@ -1338,8 +1338,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at nonzero both - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = true; - DataPlant::PlantLoop(2).LoopSide(1).FlowLock = true; + DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + DataPlant::PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.14; DataLoopNode::Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.13; thisCoolingPLHP->running = true; @@ -2234,7 +2234,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag off, load side flow locked - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = true; + DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.24; thisCoolingPLHP->running = false; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2242,7 +2242,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on load side - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = true; + DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2250,7 +2250,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on source side - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = true; + DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.2; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2258,7 +2258,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(1.29, thisCoolingPLHP->sourceSideMassFlowRate, 0.1); // call with run flag ON, flow locked at zero on both sides - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = true; + DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2266,7 +2266,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at nonzero both - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = true; + DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.14; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 13d9b444fa4..43e80fdec87 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -1720,7 +1720,7 @@ TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - PlantLoop(2).LoopSide(1).FlowLock = 0; + PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; PlantLoop(1).Name = "HotWaterLoop"; PlantLoop(1).FluidName = "HotWater"; @@ -1730,7 +1730,7 @@ TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - PlantLoop(1).LoopSide(1).FlowLock = 0; + PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; FanCoil(1).CoolCoilLoopNum = 2; FanCoil(1).HeatCoilLoopNum = 1; From 49e16c737fc7ae877ab18acf4f62d1290a0e4445 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 5 Jan 2021 10:00:23 -0700 Subject: [PATCH 06/17] cleaning up DataPlant pressure info --- src/EnergyPlus/PipeHeatTransfer.cc | 9 +++-- src/EnergyPlus/Plant/DataPlant.cc | 26 +++--------- src/EnergyPlus/Plant/DataPlant.hh | 19 +++------ src/EnergyPlus/Plant/Enums.hh | 57 ++++++++++++++++++--------- src/EnergyPlus/Plant/Loop.hh | 10 ++--- src/EnergyPlus/Plant/LoopSide.cc | 10 ++--- src/EnergyPlus/Plant/PlantManager.cc | 41 +++++++++---------- src/EnergyPlus/PlantPressureSystem.cc | 27 ++++++------- src/EnergyPlus/PlantPressureSystem.hh | 10 ++--- src/EnergyPlus/PlantUtilities.cc | 8 ++-- src/EnergyPlus/Pumps.cc | 10 ++--- 11 files changed, 112 insertions(+), 115 deletions(-) diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index 90accd1675e..b62d4524923 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -1443,10 +1443,13 @@ namespace EnergyPlus::PipeHeatTransfer { Node(state.dataPipeHT->nsvOutletNodeNum).MassFlowRateMaxAvail = Node(state.dataPipeHT->nsvInletNodeNum).MassFlowRateMaxAvail; Node(state.dataPipeHT->nsvOutletNodeNum).Quality = Node(state.dataPipeHT->nsvInletNodeNum).Quality; // Only pass pressure if we aren't doing a pressure simulation - if (PlantLoop(this->LoopNum).PressureSimType > 1) { - // Don't do anything - } else { + switch (PlantLoop(this->LoopNum).PressureSimType) { + case DataPlant::iPressSimType::NoPressure: Node(state.dataPipeHT->nsvOutletNodeNum).Press = Node(state.dataPipeHT->nsvInletNodeNum).Press; + break; + default: + // Don't do anything + break; } Node(state.dataPipeHT->nsvOutletNodeNum).Enthalpy = Node(state.dataPipeHT->nsvInletNodeNum).Enthalpy; Node(state.dataPipeHT->nsvOutletNodeNum).HumRat = Node(state.dataPipeHT->nsvInletNodeNum).HumRat; diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index 5728cb7899f..258c2a41995 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -58,26 +58,12 @@ namespace EnergyPlus::DataPlant { // This data-only module contains the structures for various parts of the Plant and // Condenser Loops. - // Using/Aliasing - using DataLoopNode::NodeID; - using DataLoopNode::SensedNodeFlagValue; - - // Parameters for tolerance - Real64 const LoopDemandTol(0.1); // minimum significant loop cooling or heating demand - Real64 const DeltaTempTol(0.0001); // minimum significant loop temperature difference - - // Pressure Routine Call Enumeration - int const PressureCall_Init(-1); - int const PressureCall_Calc(-2); - int const PressureCall_Update(-3); - - // Pressure Simulation Types - int const Press_NoPressure(1); // Nothing for that particular loop - int const Press_PumpPowerCorrection(2); // Only updating the pump power - int const Press_FlowCorrection(3); // Update pump flow rate based on pump curve - int const Press_FlowSimulation(4); // Full pressure network simulation - - Array1D_string const PressureSimType(4, {"NONE", "PUMPPOWERCORRECTION", "LOOPFLOWCORRECTION", "PRESSURESIMULATION"}); + std::map cPressureSimType { + {DataPlant::iPressSimType::NoPressure, "NONE"}, + {DataPlant::iPressSimType::PumpPowerCorrection, "PUMPPOWERCORRECTION"}, + {DataPlant::iPressSimType::FlowCorrection, "LOOPFLOWCORRECTION"}, + {DataPlant::iPressSimType::FlowSimulation, "PRESSURESIMULATION"}, + }; // Parameters for Component/Equipment Types (ref: TypeOf in CompData) int const NumSimPlantEquipTypes(96); diff --git a/src/EnergyPlus/Plant/DataPlant.hh b/src/EnergyPlus/Plant/DataPlant.hh index 36fcd23eb13..605375c7f53 100644 --- a/src/EnergyPlus/Plant/DataPlant.hh +++ b/src/EnergyPlus/Plant/DataPlant.hh @@ -86,20 +86,11 @@ namespace DataPlant { constexpr int SupplySide(2); // Parameters for tolerance - extern Real64 const LoopDemandTol; // minimum significant loop cooling or heating demand - extern Real64 const DeltaTempTol; // minimum significant loop temperature difference - - // Pressure Routine Call Enumeration - extern int const PressureCall_Init; - extern int const PressureCall_Calc; - extern int const PressureCall_Update; - - // Pressure Simulation Types - extern int const Press_NoPressure; // Nothing for that particular loop - extern int const Press_PumpPowerCorrection; // Only updating the pump power - extern int const Press_FlowCorrection; // Update pump flow rate based on pump curve - extern int const Press_FlowSimulation; // Full pressure network simulation - extern Array1D_string const PressureSimType; + constexpr Real64 LoopDemandTol(0.1); // minimum significant loop cooling or heating demand + constexpr Real64 DeltaTempTol(0.0001); // minimum significant loop temperature difference + + extern std::map cPressureSimType; + // Parameters for Component/Equipment Types (ref: TypeOf in CompData) extern int const NumSimPlantEquipTypes; extern Array1D_string const SimPlantEquipTypes; diff --git a/src/EnergyPlus/Plant/Enums.hh b/src/EnergyPlus/Plant/Enums.hh index d37e073b8be..283f844e5eb 100644 --- a/src/EnergyPlus/Plant/Enums.hh +++ b/src/EnergyPlus/Plant/Enums.hh @@ -103,13 +103,14 @@ namespace EnergyPlus::DataPlant { int const HowMet_ByNominalCapFreeCoolCntrl(56); // HowMet_ByNominalCap with free cool shutdown int const HowMet_ByNominalCapLowOutLimitFreeCoolCntrl(57); // HowMet_ByNominalCapLowOutLimit with free cool shutdown - enum class iLoadingScheme { + enum class iLoadingScheme + { Unassigned, - Optimal, // Optimal Load Distribution Scheme - Sequential, // Sequential Load Distribution Scheme - Uniform, // Uniform Load Distribution Scheme - UniformPLR, // Uniform PLR Load Distribution Scheme - SequentialUniformPLR, // Sequential Uniform PLR Load Distribution Scheme + Optimal, // Optimal Load Distribution Scheme + Sequential, // Sequential Load Distribution Scheme + Uniform, // Uniform Load Distribution Scheme + UniformPLR, // Uniform PLR Load Distribution Scheme + SequentialUniformPLR, // Sequential Uniform PLR Load Distribution Scheme }; enum class FlowMode @@ -129,37 +130,57 @@ namespace EnergyPlus::DataPlant { }; // SimFlagCriteriaTypes for use in performing interconnect re-sim checks - enum class iCriteriaType { + enum class iCriteriaType + { MassFlowRate, Temperature, HeatTransferRate, }; - enum class iFreeCoolControlMode { + enum class iFreeCoolControlMode + { Unassigned, - WetBulb, // HeatExchanger:Hydronic model control type mode, outdoor wetbulb sensor - DryBulb, // HeatExchanger:Hydronic model control type mode, outdoor drybulb sensor - Loop, // HeatExchanger:Hydronic model control type mode, loop setpoint sensor + WetBulb, // HeatExchanger:Hydronic model control type mode, outdoor wetbulb sensor + DryBulb, // HeatExchanger:Hydronic model control type mode, outdoor drybulb sensor + Loop, // HeatExchanger:Hydronic model control type mode, loop setpoint sensor }; - enum class iLoopDemandCalcScheme { + enum class iLoopDemandCalcScheme + { Unassigned, SingleSetPoint, // Uses a single temp setpoint to calculate loop demand DualSetPointDeadBand, // Uses a dual temp setpoint with a deadband between the high }; - enum class iCommonPipeType { + enum class iCommonPipeType + { No, Single, TwoWay, }; - enum class iFlowLock { - PumpQuery, // Used to ask the pumps for their min/max avail based on no constraints - Unlocked, // components request flow - Locked, // components take their inlet flow + enum class iFlowLock + { + PumpQuery, // Used to ask the pumps for their min/max avail based on no constraints + Unlocked, // components request flow + Locked, // components take their inlet flow + }; + + enum class iPressureCall + { + Init, + Calc, + Update, + }; + + enum class iPressSimType + { + NoPressure, // Nothing for that particular loop + PumpPowerCorrection, // Only updating the pump power + FlowCorrection, // Update pump flow rate based on pump curve + FlowSimulation, // Full pressure network simulation }; -} // namespace EnergyPlus + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/Plant/Loop.hh b/src/EnergyPlus/Plant/Loop.hh index ad68300d7b5..c968506942d 100644 --- a/src/EnergyPlus/Plant/Loop.hh +++ b/src/EnergyPlus/Plant/Loop.hh @@ -108,7 +108,7 @@ namespace DataPlant { Real64 EconControlTempDiff; bool LoopHasConnectionComp; LoopType TypeOfLoop; - int PressureSimType; + DataPlant::iPressSimType PressureSimType; bool HasPressureComponents; Real64 PressureDrop; bool UsePressureForPumpCalcs; @@ -134,10 +134,10 @@ namespace DataPlant { NumOpSchemes(0), LoadDistribution(DataPlant::iLoadingScheme::Unassigned), PlantSizNum(0), LoopDemandCalcScheme(DataPlant::iLoopDemandCalcScheme::Unassigned), CommonPipeType(DataPlant::iCommonPipeType::No), EconPlantSideSensedNodeNum(0), EconCondSideSensedNodeNum(0), EconPlacement(0), EconBranch(0), EconComp(0), EconControlTempDiff(0.0), - LoopHasConnectionComp(false), TypeOfLoop(LoopType::Unassigned), PressureSimType(1), HasPressureComponents(false), PressureDrop(0.0), - UsePressureForPumpCalcs(false), PressureEffectiveK(0.0), CoolingDemand(0.0), HeatingDemand(0.0), DemandNotDispatched(0.0), - UnmetDemand(0.0), BypassFrac(0.0), InletNodeFlowrate(0.0), InletNodeTemperature(0.0), OutletNodeFlowrate(0.0), - OutletNodeTemperature(0.0), LastLoopSideSimulated(0) + LoopHasConnectionComp(false), TypeOfLoop(LoopType::Unassigned), PressureSimType(DataPlant::iPressSimType::NoPressure), + HasPressureComponents(false), PressureDrop(0.0), UsePressureForPumpCalcs(false), PressureEffectiveK(0.0), CoolingDemand(0.0), + HeatingDemand(0.0), DemandNotDispatched(0.0), UnmetDemand(0.0), BypassFrac(0.0), InletNodeFlowrate(0.0), InletNodeTemperature(0.0), + OutletNodeFlowrate(0.0), OutletNodeTemperature(0.0), LastLoopSideSimulated(0) { } diff --git a/src/EnergyPlus/Plant/LoopSide.cc b/src/EnergyPlus/Plant/LoopSide.cc index 5fac3adfe7a..f61880e4c90 100644 --- a/src/EnergyPlus/Plant/LoopSide.cc +++ b/src/EnergyPlus/Plant/LoopSide.cc @@ -122,7 +122,7 @@ namespace DataPlant { // Do pressure system initialize if this is the demand side (therefore once per whole loop) if (this->myLoopSideNum == DataPlant::DemandSide) { - PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall_Init); + PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::iPressureCall::Init); } // Turn on any previously disabled branches due to constant speed branch pump issue @@ -153,7 +153,7 @@ namespace DataPlant { } else { // LoopSide == SupplySide // Update pressure drop reporting, calculate total loop pressure drop for use elsewhere - PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall_Update); + PlantPressureSystem::SimPressureDropSystem(state, this->myLoopNum, FirstHVACIteration, DataPlant::iPressureCall::Update); // Pass the loop information via the HVAC interface manager (only the flow) HVACInterfaceManager::UpdatePlantLoopInterface(state, this->myLoopNum, @@ -1792,7 +1792,7 @@ namespace DataPlant { if (this->FlowLock == DataPlant::iFlowLock::Locked) { PlantPressureSystem::SimPressureDropSystem(state, - this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall_Calc, this->myLoopSideNum, BranchCounter); + this->myLoopNum, FirstHVACIteration, DataPlant::iPressureCall::Calc, this->myLoopSideNum, BranchCounter); } } //~ BranchCounter @@ -1868,7 +1868,7 @@ namespace DataPlant { //~ If we are locked, go ahead and simulate the pressure components on this branch if (this->FlowLock == DataPlant::iFlowLock::Locked) { PlantPressureSystem::SimPressureDropSystem(state, - this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall_Calc, this->myLoopSideNum, BranchCounter); + this->myLoopNum, FirstHVACIteration, DataPlant::iPressureCall::Calc, this->myLoopSideNum, BranchCounter); } } //~ BranchCounter @@ -1919,7 +1919,7 @@ namespace DataPlant { if (this->FlowLock == DataPlant::iFlowLock::Locked) { PlantPressureSystem::SimPressureDropSystem(state, - this->myLoopNum, FirstHVACIteration, DataPlant::PressureCall_Calc, this->myLoopSideNum, BranchCounter); + this->myLoopNum, FirstHVACIteration, DataPlant::iPressureCall::Calc, this->myLoopSideNum, BranchCounter); } } //~ BranchCounter diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index cfab24750cf..9245a0dd119 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -120,9 +120,7 @@ #include #include -namespace EnergyPlus { - - namespace PlantManager { +namespace EnergyPlus::PlantManager { // MODULE INFORMATION: // AUTHOR Sankaranarayanan K P, Rich Liesen @@ -321,7 +319,6 @@ namespace EnergyPlus { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int LoopNum; // DO loop counter for loops - int PressSimLoop; // DO loop counter for pressure simulation type 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 @@ -592,20 +589,26 @@ namespace EnergyPlus { MatchedPressureString = false; // Check all types - for (PressSimLoop = 1; PressSimLoop <= 4; ++PressSimLoop) { - if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), PressureSimType(PressSimLoop))) { - this_loop.PressureSimType = PressSimLoop; - MatchedPressureString = true; - break; - } + if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), cPressureSimType.at(DataPlant::iPressSimType::NoPressure))) { + this_loop.PressureSimType = DataPlant::iPressSimType::NoPressure; + MatchedPressureString = true; + } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), cPressureSimType.at(DataPlant::iPressSimType::PumpPowerCorrection))) { + this_loop.PressureSimType = DataPlant::iPressSimType::PumpPowerCorrection; + MatchedPressureString = true; + } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), cPressureSimType.at(DataPlant::iPressSimType::FlowSimulation))) { + this_loop.PressureSimType = DataPlant::iPressSimType::FlowSimulation; + MatchedPressureString = true; + } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), cPressureSimType.at(DataPlant::iPressSimType::FlowCorrection))) { + this_loop.PressureSimType = DataPlant::iPressSimType::FlowCorrection; + MatchedPressureString = true; } // If we found a match, check to make sure it is one of the valid // ones for this phase of pressure implementation if (MatchedPressureString) { - if ((this_loop.PressureSimType == Press_NoPressure) || - (this_loop.PressureSimType == Press_PumpPowerCorrection) || - (this_loop.PressureSimType == Press_FlowCorrection)) { + if ((this_loop.PressureSimType == DataPlant::iPressSimType::NoPressure) || + (this_loop.PressureSimType == DataPlant::iPressSimType::PumpPowerCorrection) || + (this_loop.PressureSimType == DataPlant::iPressSimType::FlowCorrection)) { // We are OK here, move on } else { // We have an erroneous input, alert user @@ -614,9 +617,9 @@ namespace EnergyPlus { ShowContinueError(state, "Invalid " + cAlphaFieldNames(PressSimAlphaIndex) + "=\"" + Alpha(PressSimAlphaIndex) + "\"."); ShowContinueError(state, "Currently only options are: "); - ShowContinueError(state, " - " + PressureSimType(Press_NoPressure)); - ShowContinueError(state, " - " + PressureSimType(Press_PumpPowerCorrection)); - ShowContinueError(state, " - " + PressureSimType(Press_FlowCorrection)); + ShowContinueError(state, " - " + cPressureSimType.at(DataPlant::iPressSimType::NoPressure)); + ShowContinueError(state, " - " + cPressureSimType.at(DataPlant::iPressSimType::PumpPowerCorrection)); + ShowContinueError(state, " - " + cPressureSimType.at(DataPlant::iPressSimType::FlowCorrection)); ErrorsFound = true; } } @@ -624,7 +627,7 @@ namespace EnergyPlus { // if we made it this far and didn't get a match, check for blank if (!MatchedPressureString) { if (Alpha(PressSimAlphaIndex).empty()) { - this_loop.PressureSimType = Press_NoPressure; + this_loop.PressureSimType = DataPlant::iPressSimType::NoPressure; break; } } @@ -4343,6 +4346,4 @@ namespace EnergyPlus { } } - } // namespace PlantManager - -} // namespace EnergyPlus + } // namespace EnergyPlus diff --git a/src/EnergyPlus/PlantPressureSystem.cc b/src/EnergyPlus/PlantPressureSystem.cc index b694cf296f7..dd668fe2fc3 100644 --- a/src/EnergyPlus/PlantPressureSystem.cc +++ b/src/EnergyPlus/PlantPressureSystem.cc @@ -109,11 +109,11 @@ namespace EnergyPlus::PlantPressureSystem { } void SimPressureDropSystem(EnergyPlusData &state, - int const LoopNum, // Plant Loop to update pressure information - bool const FirstHVACIteration, // System flag - int const CallType, // Enumerated call type - Optional_int_const LoopSideNum, // Loop side num for specific branch simulation - Optional_int_const BranchNum // Branch num for specific branch simulation + int const LoopNum, // Plant Loop to update pressure information + bool const FirstHVACIteration, // System flag + DataPlant::iPressureCall const CallType, // Enumerated call type + Optional_int_const LoopSideNum, // Loop side num for specific branch simulation + Optional_int_const BranchNum // Branch num for specific branch simulation ) { @@ -132,23 +132,19 @@ namespace EnergyPlus::PlantPressureSystem { // Using/Aliasing using DataPlant::PlantLoop; - using DataPlant::Press_NoPressure; - using DataPlant::PressureCall_Calc; - using DataPlant::PressureCall_Init; - using DataPlant::PressureCall_Update; // Exit out of any calculation routines if we don't do pressure simulation for this loop - if ((PlantLoop(LoopNum).PressureSimType == Press_NoPressure) && ((CallType == PressureCall_Calc) || (CallType == PressureCall_Update))) + if ((PlantLoop(LoopNum).PressureSimType == DataPlant::iPressSimType::NoPressure) && ((CallType == DataPlant::iPressureCall::Calc) || (CallType == DataPlant::iPressureCall::Update))) return; // Pass to another routine based on calling flag { auto const SELECT_CASE_var(CallType); - if (SELECT_CASE_var == PressureCall_Init) { + if (SELECT_CASE_var == DataPlant::iPressureCall::Init) { InitPressureDrop(state, LoopNum, FirstHVACIteration); - } else if (SELECT_CASE_var == PressureCall_Calc) { + } else if (SELECT_CASE_var == DataPlant::iPressureCall::Calc) { BranchPressureDrop(state, LoopNum, LoopSideNum, BranchNum); // Autodesk:OPTIONAL LoopSideNum, BranchNum used without PRESENT check - } else if (SELECT_CASE_var == PressureCall_Update) { + } else if (SELECT_CASE_var == DataPlant::iPressureCall::Update) { UpdatePressureDrop(state, LoopNum); } else { // Calling routines should only use the three possible keywords here @@ -173,7 +169,6 @@ namespace EnergyPlus::PlantPressureSystem { using DataLoopNode::Node; using DataPlant::DemandSide; using DataPlant::PlantLoop; - using DataPlant::Press_NoPressure; using DataPlant::SupplySide; static Array1D_bool LoopInit; @@ -300,13 +295,13 @@ namespace EnergyPlus::PlantPressureSystem { if (ErrorsFound) ShowFatalError(state, "Preceding errors cause program termination"); // Also issue one time warning if there is a mismatch between plant loop simulation type and whether objects were entered - if (loop.HasPressureComponents && (loop.PressureSimType == Press_NoPressure)) { + if (loop.HasPressureComponents && (loop.PressureSimType == DataPlant::iPressSimType::NoPressure)) { // Then we found pressure components on the branches, but the plant loop said it didn't want to do pressure simulation ShowWarningError(state, "Error for pressure simulation on plant loop: " + loop.Name); ShowContinueError(state, "Plant loop contains pressure simulation components on the branches,"); ShowContinueError(state, " yet in the PlantLoop object, there is no pressure simulation specified."); ShowContinueError(state, "Simulation continues, ignoring pressure simulation data."); - } else if ((!loop.HasPressureComponents) && (loop.PressureSimType != Press_NoPressure)) { + } else if ((!loop.HasPressureComponents) && (loop.PressureSimType != DataPlant::iPressSimType::NoPressure)) { // Then we don't have any pressure components on the branches, yet the plant loop wants to do some sort of pressure simulation ShowWarningError(state, "Error for pressure simulation on plant loop: " + loop.Name); ShowContinueError(state, "Plant loop is requesting a pressure simulation,"); diff --git a/src/EnergyPlus/PlantPressureSystem.hh b/src/EnergyPlus/PlantPressureSystem.hh index 3154d19fbc4..8f7e1591720 100644 --- a/src/EnergyPlus/PlantPressureSystem.hh +++ b/src/EnergyPlus/PlantPressureSystem.hh @@ -66,11 +66,11 @@ namespace PlantPressureSystem { void clear_state(); void SimPressureDropSystem(EnergyPlusData &state, - int const LoopNum, // Plant Loop to update pressure information - bool const FirstHVACIteration, // System flag - int const CallType, // Enumerated call type - Optional_int_const LoopSideNum = _, // Loop side num for specific branch simulation - Optional_int_const BranchNum = _ // Branch num for specific branch simulation + int const LoopNum, // Plant Loop to update pressure information + bool const FirstHVACIteration, // System flag + DataPlant::iPressureCall const CallType, // Enumerated call type + Optional_int_const LoopSideNum = _, // Loop side num for specific branch simulation + Optional_int_const BranchNum = _ // Branch num for specific branch simulation ); void InitPressureDrop(EnergyPlusData &state, int const LoopNum, bool const FirstHVACIteration); diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index 0435fd9fe78..4899040ca45 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -1548,10 +1548,12 @@ namespace PlantUtilities { // Only pass pressure if we aren't doing a pressure simulation if (present(LoopNum)) { - if (PlantLoop(LoopNum).PressureSimType > 1) { - // Don't do anything - } else { + switch (PlantLoop(LoopNum).PressureSimType) { + case DataPlant::iPressSimType::NoPressure: Node(OutletNodeNum).Press = Node(InletNodeNum).Press; + default: + // Don't do anything + break; } } } diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index 8651e0711ca..4d19a80ef21 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -1561,7 +1561,6 @@ namespace Pumps { // Using/Aliasing using DataPlant::PlantAvailMgr; using DataPlant::PlantLoop; - using DataPlant::Press_FlowCorrection; using FluidProperties::GetDensityGlycol; using PlantPressureSystem::ResolveLoopFlowVsPressure; using PlantUtilities::BoundValueToWithinTwoValues; @@ -1643,7 +1642,7 @@ namespace Pumps { PumpEquip(PumpNum).RotSpeed = PumpSchedRPM / 60.0; // Resolve the new mass flow rate based on current pressure characteristics if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == Press_FlowCorrection && + PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { PumpMassFlowRate = ResolveLoopFlowVsPressure(state, @@ -1662,7 +1661,7 @@ namespace Pumps { } else if (SELECT_CASE_var1 == ControlTypeVFD::VFDAutomatic) { if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == Press_FlowCorrection && + PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { GetRequiredMassFlowRate(state, @@ -1691,7 +1690,7 @@ namespace Pumps { // Override (lock down flow) for pressure drop if applicable if (PumpEquip(PumpNum).LoopNum > 0) { if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == Press_FlowCorrection && + PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { PumpMassFlowRate = ResolveLoopFlowVsPressure(state, PumpEquip(PumpNum).LoopNum, @@ -2396,7 +2395,6 @@ namespace Pumps { // Using/Aliasing using DataLoopNode::Node; using DataPlant::PlantLoop; - using DataPlant::Press_FlowCorrection; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -2422,7 +2420,7 @@ namespace Pumps { // Calculate maximum and minimum mass flow rate associated with maximun and minimum RPM if (PumpEquip(PumpNum).LoopNum > 0) { if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == Press_FlowCorrection && + PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { PumpEquip(PumpNum).PumpMassFlowRateMaxRPM = ResolveLoopFlowVsPressure(state, PumpEquip(PumpNum).LoopNum, InletNodeMassFlowRate, From f74dc387f7fb41b9dca089a8730c7048733ec6c7 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 5 Jan 2021 16:37:11 -0700 Subject: [PATCH 07/17] more DataPlant moved to state, PlantLoop to state --- src/EnergyPlus/AirLoopHVACDOAS.cc | 12 +- .../CoolingWaterDesAirOutletTempSizing.cc | 8 +- .../Autosizing/CoolingWaterflowSizing.cc | 20 +- .../HeatingWaterDesCoilLoadUsedForUASizing.cc | 24 +- .../Autosizing/HeatingWaterflowSizing.cc | 20 +- .../Autosizing/WaterHeatingCapacitySizing.cc | 16 +- src/EnergyPlus/BaseboardRadiator.cc | 31 +- src/EnergyPlus/BoilerSteam.cc | 33 +- src/EnergyPlus/BoilerSteam.hh | 3 +- src/EnergyPlus/Boilers.cc | 41 +- src/EnergyPlus/Boilers.hh | 3 +- src/EnergyPlus/CTElectricGenerator.cc | 8 +- src/EnergyPlus/ChilledCeilingPanelSimple.cc | 21 +- src/EnergyPlus/ChillerAbsorption.cc | 117 ++-- src/EnergyPlus/ChillerAbsorption.hh | 2 +- src/EnergyPlus/ChillerElectricEIR.cc | 120 ++-- src/EnergyPlus/ChillerElectricEIR.hh | 2 +- src/EnergyPlus/ChillerExhaustAbsorption.cc | 76 +- src/EnergyPlus/ChillerGasAbsorption.cc | 76 +- src/EnergyPlus/ChillerIndirectAbsorption.cc | 109 +-- src/EnergyPlus/ChillerIndirectAbsorption.hh | 2 +- src/EnergyPlus/ChillerReformulatedEIR.cc | 124 ++-- src/EnergyPlus/ChillerReformulatedEIR.hh | 2 +- src/EnergyPlus/CondenserLoopTowers.cc | 206 +++--- src/EnergyPlus/DesiccantDehumidifiers.cc | 13 +- src/EnergyPlus/ElectricPowerServiceManager.cc | 2 +- src/EnergyPlus/EvaporativeFluidCoolers.cc | 105 +-- src/EnergyPlus/FanCoilUnits.cc | 40 +- src/EnergyPlus/FluidCoolers.cc | 86 +-- src/EnergyPlus/FuelCellElectricGenerator.cc | 14 +- src/EnergyPlus/FuelCellElectricGenerator.hh | 2 +- src/EnergyPlus/Furnaces.cc | 25 +- src/EnergyPlus/GroundHeatExchangers.cc | 56 +- src/EnergyPlus/HVACControllers.cc | 10 +- src/EnergyPlus/HVACCooledBeam.cc | 35 +- src/EnergyPlus/HVACFourPipeBeam.cc | 29 +- src/EnergyPlus/HVACInterfaceManager.cc | 130 ++-- src/EnergyPlus/HVACManager.cc | 153 ++-- src/EnergyPlus/HVACMultiSpeedHeatPump.cc | 38 +- src/EnergyPlus/HVACSingleDuctInduc.cc | 38 +- src/EnergyPlus/HVACSizingSimulationManager.cc | 13 +- src/EnergyPlus/HVACUnitaryBypassVAV.cc | 12 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 36 +- src/EnergyPlus/HWBaseboardRadiator.cc | 45 +- src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc | 22 +- src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc | 23 +- src/EnergyPlus/HeatPumpWaterToWaterSimple.cc | 91 ++- src/EnergyPlus/ICEngineElectricGenerator.cc | 8 +- src/EnergyPlus/IceThermalStorage.cc | 62 +- src/EnergyPlus/IceThermalStorage.hh | 8 +- src/EnergyPlus/LowTempRadiantSystem.cc | 86 ++- src/EnergyPlus/MicroCHPElectricGenerator.cc | 22 +- .../MicroturbineElectricGenerator.cc | 10 +- src/EnergyPlus/OutdoorAirUnit.cc | 20 +- src/EnergyPlus/OutsideEnergySources.cc | 32 +- src/EnergyPlus/PackagedTerminalHeatPump.cc | 23 +- src/EnergyPlus/PackagedThermalStorageCoil.cc | 21 +- .../PhotovoltaicThermalCollectors.cc | 16 +- .../PhotovoltaicThermalCollectors.hh | 2 +- src/EnergyPlus/PipeHeatTransfer.cc | 13 +- src/EnergyPlus/Pipes.cc | 4 +- src/EnergyPlus/Plant/DataPlant.cc | 101 --- src/EnergyPlus/Plant/DataPlant.hh | 235 ++++--- src/EnergyPlus/Plant/LoopSide.cc | 37 +- src/EnergyPlus/Plant/LoopSide.hh | 6 +- src/EnergyPlus/Plant/PlantManager.cc | 657 +++++++++--------- src/EnergyPlus/Plant/PlantManager.hh | 2 +- src/EnergyPlus/PlantCentralGSHP.cc | 84 +-- src/EnergyPlus/PlantChillers.cc | 356 +++++----- src/EnergyPlus/PlantChillers.hh | 9 +- .../PlantComponentTemperatureSources.cc | 14 +- src/EnergyPlus/PlantCondLoopOperation.cc | 614 ++++++++-------- src/EnergyPlus/PlantCondLoopOperation.hh | 14 +- .../PlantHeatExchangerFluidToFluid.cc | 84 +-- src/EnergyPlus/PlantLoadProfile.cc | 9 +- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 38 +- src/EnergyPlus/PlantPipingSystemsManager.cc | 20 +- src/EnergyPlus/PlantPressureSystem.cc | 123 ++-- src/EnergyPlus/PlantPressureSystem.hh | 6 +- src/EnergyPlus/PlantUtilities.cc | 283 ++++---- src/EnergyPlus/PlantUtilities.hh | 28 +- src/EnergyPlus/PlantValves.cc | 8 +- src/EnergyPlus/PondGroundHeatExchanger.cc | 24 +- src/EnergyPlus/PoweredInductionUnits.cc | 20 +- src/EnergyPlus/Pumps.cc | 92 ++- src/EnergyPlus/RefrigeratedCase.cc | 86 +-- src/EnergyPlus/RefrigeratedCase.hh | 4 +- src/EnergyPlus/ReportCoilSelection.cc | 38 +- src/EnergyPlus/SetPointManager.cc | 108 +-- src/EnergyPlus/SimulationManager.cc | 174 ++--- src/EnergyPlus/SingleDuct.cc | 16 +- src/EnergyPlus/SizingAnalysisObjects.cc | 40 +- src/EnergyPlus/SolarCollectors.cc | 16 +- src/EnergyPlus/StandardRatings.cc | 5 +- src/EnergyPlus/SteamBaseboardRadiator.cc | 13 +- src/EnergyPlus/SteamCoils.cc | 5 +- src/EnergyPlus/SurfaceGroundHeatExchanger.cc | 18 +- src/EnergyPlus/SwimmingPool.cc | 4 +- src/EnergyPlus/UnitHeater.cc | 18 +- src/EnergyPlus/UnitVentilator.cc | 30 +- src/EnergyPlus/UnitarySystem.cc | 52 +- src/EnergyPlus/UserDefinedComponents.cc | 60 +- src/EnergyPlus/VariableSpeedCoils.cc | 44 +- src/EnergyPlus/VentilatedSlab.cc | 26 +- src/EnergyPlus/WaterCoils.cc | 60 +- src/EnergyPlus/WaterThermalTanks.cc | 142 ++-- src/EnergyPlus/WaterToAirHeatPump.cc | 24 +- src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 32 +- src/EnergyPlus/WaterUse.cc | 10 +- src/EnergyPlus/WaterUse.hh | 2 +- .../unit/AirTerminalSingleDuctMixer.unit.cc | 24 +- .../Autosizing/CoolingCapacitySizing.unit.cc | 2 +- ...CoolingWaterDesAirOutletTempSizing.unit.cc | 2 +- .../Autosizing/CoolingWaterflowSizing.unit.cc | 2 +- .../Autosizing/HeatingCapacitySizing.unit.cc | 2 +- ...ingWaterDesCoilLoadUsedForUASizing.unit.cc | 2 +- .../Autosizing/HeatingWaterflowSizing.unit.cc | 4 +- .../WaterHeatingCapacitySizing.unit.cc | 2 +- .../WaterHeatingCoilUASizing.unit.cc | 4 +- tst/EnergyPlus/unit/BaseboardRadiator.unit.cc | 8 +- tst/EnergyPlus/unit/BoilerHotWater.unit.cc | 52 +- tst/EnergyPlus/unit/BoilerSteam.unit.cc | 26 +- tst/EnergyPlus/unit/ChillerAbsorption.unit.cc | 4 +- .../unit/ChillerConstantCOP.unit.cc | 48 +- tst/EnergyPlus/unit/ChillerElectric.unit.cc | 96 +-- .../unit/ChillerElectricEIR.unit.cc | 76 +- .../unit/CondenserLoopTowers.unit.cc | 10 +- tst/EnergyPlus/unit/DataPlant.unit.cc | 88 +-- tst/EnergyPlus/unit/EMSManager.unit.cc | 92 +-- .../unit/EvaporativeFluidCoolers.unit.cc | 20 +- tst/EnergyPlus/unit/FanCoilUnits.unit.cc | 394 +++++------ tst/EnergyPlus/unit/FluidCoolers.unit.cc | 4 +- tst/EnergyPlus/unit/Furnaces.unit.cc | 32 +- .../unit/GroundHeatExchangers.unit.cc | 6 +- tst/EnergyPlus/unit/HVACControllers.unit.cc | 48 +- tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc | 2 +- .../unit/HVACInterfaceManager.unit.cc | 36 +- .../unit/HVACMultiSpeedHeatPump.unit.cc | 6 +- .../unit/HVACSizingSimulationManager.unit.cc | 56 +- .../unit/HVACVariableRefrigerantFlow.unit.cc | 68 +- .../unit/HWBaseboardRadiator.unit.cc | 44 +- .../unit/LowTempRadiantSystem.unit.cc | 70 +- .../unit/MicroCHPElectricGenerator.unit.cc | 22 +- tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc | 48 +- .../unit/PackagedTerminalHeatPump.unit.cc | 42 +- tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc | 30 +- tst/EnergyPlus/unit/PlantChillers.unit.cc | 20 +- .../PlantComponentTemperatureSources.unit.cc | 26 +- .../unit/PlantCondLoopOperation.unit.cc | 74 +- .../PlantHeatExchangerFluidToFluid.unit.cc | 106 +-- .../unit/PlantLoopHeatPumpEIR.unit.cc | 626 ++++++++--------- tst/EnergyPlus/unit/PlantManager.unit.cc | 22 +- .../unit/PlantPipingSystemsManager.unit.cc | 26 +- tst/EnergyPlus/unit/PlantUtilities.unit.cc | 204 +++--- .../unit/ReportCoilSelection.unit.cc | 86 +-- tst/EnergyPlus/unit/SZVAVModel.unit.cc | 10 +- tst/EnergyPlus/unit/SetPointManager.unit.cc | 94 +-- .../unit/SizeWaterHeatingCoil.unit.cc | 154 ++-- .../unit/SizingAnalysisObjects.unit.cc | 26 +- tst/EnergyPlus/unit/SwimmingPool.unit.cc | 78 +-- tst/EnergyPlus/unit/UnitHeater.unit.cc | 34 +- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 252 +++---- tst/EnergyPlus/unit/WaterCoils.unit.cc | 250 +++---- tst/EnergyPlus/unit/WaterThermalTanks.unit.cc | 11 +- .../unit/WaterToAirHeatPump.unit.cc | 36 +- .../unit/WaterToAirHeatPumpSimple.unit.cc | 36 +- 166 files changed, 4894 insertions(+), 5061 deletions(-) diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index 2145e73e492..c4446ac1a57 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -814,9 +814,9 @@ namespace AirLoopHVACDOAS { WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_HeatCoilNum); Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", CompName, ErrorsFound); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); PlantUtilities::InitComponentNodes(0.0, CoilMaxVolFlowRate * rho, @@ -831,9 +831,9 @@ namespace AirLoopHVACDOAS { WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum); Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water", CompName, ErrorsFound); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); PlantUtilities::InitComponentNodes(0.0, CoilMaxVolFlowRate * rho, @@ -848,9 +848,9 @@ namespace AirLoopHVACDOAS { WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum); Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water:DetailedGeometry", CompName, ErrorsFound); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); PlantUtilities::InitComponentNodes(0.0, CoilMaxVolFlowRate * rho, diff --git a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc index 7d7f96bb745..ef0c9777e6b 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc @@ -67,14 +67,14 @@ Real64 CoolingWaterDesAirOutletTempSizer::size(EnergyPlusData &state, Real64 _or } else { if (this->termUnitIU) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 DesCoilLoad = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizCoolDeltaT * Cp * rho; Real64 T1Out = diff --git a/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc index 7066a8e4f12..9a92abbf6ff 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc @@ -86,17 +86,17 @@ Real64 CoolingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, // add fan heat to coil load DesCoilLoad += BaseSizerWithFanHeatInputs::calcFanDesHeatGain(DesVolFlow); if (DesCoilLoad >= DataHVACGlobals::SmallLoad) { - if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)DataPlant::PlantLoop.size() && + if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)state.dataPlnt->PlantLoop.size() && this->dataWaterCoilSizCoolDeltaT > 0.0) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = DesCoilLoad / (CoilDesWaterDeltaT * Cp * rho); } else { @@ -119,16 +119,16 @@ Real64 CoolingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, } else { if (this->curOASysNum > 0) CoilDesWaterDeltaT *= 0.5; if (this->dataCapacityUsedForSizing >= DataHVACGlobals::SmallLoad) { - if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)DataPlant::PlantLoop.size() && CoilDesWaterDeltaT > 0.0) { + if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)state.dataPlnt->PlantLoop.size() && CoilDesWaterDeltaT > 0.0) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = this->dataCapacityUsedForSizing / (CoilDesWaterDeltaT * Cp * rho); } else { diff --git a/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc b/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc index 118a30cee27..c1d224e0c14 100644 --- a/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc @@ -71,40 +71,40 @@ Real64 HeatingWaterDesCoilLoadUsedForUASizer::size(EnergyPlusData &state, Real64 } else { if (this->termUnitSingDuct && (this->curTermUnitSizingNum > 0)) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho; coilSelectionReportObj->setCoilReheatMultiplier(state, this->compName, this->compType, 1.0); } else if ((this->termUnitPIU || this->termUnitIU) && (this->curTermUnitSizingNum > 0)) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho * this->termUnitSizing(this->curTermUnitSizingNum).ReheatLoadMult; } else if (this->zoneEqFanCoil || this->zoneEqUnitHeater) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho; coilSelectionReportObj->setCoilReheatMultiplier(state, this->compName, this->compType, 1.0); diff --git a/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc b/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc index a55320897b6..785e5380e56 100644 --- a/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc @@ -91,17 +91,17 @@ Real64 HeatingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, Real64 CoilOutHumRat = this->finalZoneSizing(this->curZoneEqNum).HeatDesHumRat; Real64 DesCoilLoad = Psychrometrics::PsyCpAirFnW(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); if (DesCoilLoad >= DataHVACGlobals::SmallLoad) { - if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)DataPlant::PlantLoop.size() && + if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)state.dataPlnt->PlantLoop.size() && this->dataWaterCoilSizHeatDeltaT > 0.0) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = DesCoilLoad / (this->dataWaterCoilSizHeatDeltaT * Cp * rho); } else { @@ -121,17 +121,17 @@ Real64 HeatingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, this->autoSizedValue = _originalValue; } else { if (this->dataCapacityUsedForSizing >= DataHVACGlobals::SmallLoad) { - if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)DataPlant::PlantLoop.size() && + if (this->dataWaterLoopNum > 0 && this->dataWaterLoopNum <= (int)state.dataPlnt->PlantLoop.size() && this->dataWaterCoilSizHeatDeltaT > 0.0) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); this->autoSizedValue = this->dataCapacityUsedForSizing / (this->dataWaterCoilSizHeatDeltaT * Cp * rho); } else { diff --git a/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc b/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc index b5abd849d37..c3c6096fcdb 100644 --- a/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc @@ -73,27 +73,27 @@ Real64 WaterHeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalVa if ((this->termUnitSingDuct || this->termUnitPIU || this->termUnitIU) && (this->curTermUnitSizingNum > 0)) { DesMassFlow = this->termUnitSizing(this->curTermUnitSizingNum).MaxHWVolFlow; Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); NominalCapacityDes = DesMassFlow * this->dataWaterCoilSizHeatDeltaT * Cp * rho; } else if (this->zoneEqFanCoil || this->zoneEqUnitHeater) { DesMassFlow = this->zoneEqSizing(this->curZoneEqNum).MaxHWVolFlow; Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->dataWaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->dataWaterLoopNum).FluidIndex, this->callingRoutine); NominalCapacityDes = DesMassFlow * this->dataWaterCoilSizHeatDeltaT * Cp * rho; // if coil is part of a zonal unit, calc coil load to get hot water flow rate diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index cfa674f35f0..c5dea9e9451 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -96,7 +96,6 @@ namespace BaseboardRadiator { // Using/Aliasing using DataHVACGlobals::SmallLoad; - using DataPlant::PlantLoop; using DataPlant::TypeOf_Baseboard_Conv_Water; // Use statements for access to subroutines in other modules @@ -542,7 +541,7 @@ namespace BaseboardRadiator { if (baseboard->Baseboard(BaseboardNum).ZonePtr <= 0) baseboard->Baseboard(BaseboardNum).ZonePtr = ZoneEquipConfig(ControlledZoneNumSub).ActualZoneNum; - if (baseboard->Baseboard(BaseboardNum).SetLoopIndexFlag && allocated(PlantLoop)) { + if (baseboard->Baseboard(BaseboardNum).SetLoopIndexFlag && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject(state, baseboard->Baseboard(BaseboardNum).EquipID, @@ -583,9 +582,9 @@ namespace BaseboardRadiator { if (state.dataGlobal->BeginEnvrnFlag && baseboard->Baseboard(BaseboardNum).MyEnvrnFlag && !baseboard->Baseboard(BaseboardNum).SetLoopIndexFlag) { WaterInletNode = baseboard->Baseboard(BaseboardNum).WaterInletNode; rho = GetDensityGlycol(state, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); baseboard->Baseboard(BaseboardNum).WaterMassFlowRateMax = rho * baseboard->Baseboard(BaseboardNum).WaterVolFlowRateMax; InitComponentNodes(0.0, @@ -598,9 +597,9 @@ namespace BaseboardRadiator { baseboard->Baseboard(BaseboardNum).CompNum); Node(WaterInletNode).Temp = DataGlobalConstants::HWInitConvTemp; Cp = GetSpecificHeatGlycol(state, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, Node(WaterInletNode).Temp, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); Node(WaterInletNode).Enthalpy = Cp * Node(WaterInletNode).Temp; Node(WaterInletNode).Quality = 0.0; @@ -688,7 +687,7 @@ namespace BaseboardRadiator { auto &baseboard = state.dataBaseboardRadiator; // find the appropriate heating Plant Sizing object - PltSizHeatNum = PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).PlantSizNum; + PltSizHeatNum = state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).PlantSizNum; if (PltSizHeatNum > 0) { @@ -758,14 +757,14 @@ namespace BaseboardRadiator { if (DesCoilLoad >= SmallLoad) { Cp = GetSpecificHeatGlycol(state, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); rho = GetDensityGlycol(state, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); WaterVolFlowRateMaxDes = DesCoilLoad / (PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); } else { @@ -826,9 +825,9 @@ namespace BaseboardRadiator { baseboard->Baseboard(BaseboardNum).AirInletHumRat = FinalZoneSizing(CurZoneEqNum).ZoneHumRatAtHeatPeak; WaterInletNode = baseboard->Baseboard(BaseboardNum).WaterInletNode; rho = GetDensityGlycol(state, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); Node(WaterInletNode).MassFlowRate = rho * baseboard->Baseboard(BaseboardNum).WaterVolFlowRateMax; @@ -1066,9 +1065,9 @@ namespace BaseboardRadiator { AirInletTemp = baseboard->Baseboard(BaseboardNum).AirInletTemp; CpWater = GetSpecificHeatGlycol(state, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidName, WaterInletTemp, - PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(baseboard->Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); CpAir = PsyCpAirFnW(baseboard->Baseboard(BaseboardNum).AirInletHumRat); @@ -1162,7 +1161,7 @@ namespace BaseboardRadiator { WaterInletNode = baseboard->Baseboard(BaseboardNum).WaterInletNode; WaterOutletNode = baseboard->Baseboard(BaseboardNum).WaterOutletNode; - SafeCopyPlantNode(WaterInletNode, WaterOutletNode); + SafeCopyPlantNode(state, WaterInletNode, WaterOutletNode); // Set the outlet air nodes of the Baseboard // Set the outlet water nodes for the Coil Node(WaterOutletNode).Temp = baseboard->Baseboard(BaseboardNum).WaterOutletTemp; diff --git a/src/EnergyPlus/BoilerSteam.cc b/src/EnergyPlus/BoilerSteam.cc index f5d84f1cd42..0070eef46a6 100644 --- a/src/EnergyPlus/BoilerSteam.cc +++ b/src/EnergyPlus/BoilerSteam.cc @@ -113,9 +113,9 @@ namespace BoilerSteam { EnergyPlusData &state, [[maybe_unused]] const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) { this->initialize(state); - auto &sim_component(DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum)); + auto &sim_component(state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum)); this->calculate(state, CurLoad, RunFlag, sim_component.FlowCtrl); - this->update(CurLoad, RunFlag, FirstHVACIteration); + this->update(state, CurLoad, RunFlag, FirstHVACIteration); } void @@ -409,13 +409,13 @@ namespace BoilerSteam { // fix for clumsy old input that worked because loop setpoint was spread. // could be removed with transition, testing , model change, period of being obsolete. { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(BoilerOutletNode).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { DataLoopNode::Node(BoilerOutletNode).TempSetPointLo = - DataLoopNode::Node(DataPlant::PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPointLo; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPointLo; } } } @@ -477,7 +477,7 @@ namespace BoilerSteam { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: bool ErrorsFound(false); // If errors detected in input Real64 tmpNomCap = this->NomCap; - int PltSizNum = DataPlant::PlantLoop(this->LoopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->LoopNum).PlantSizNum; if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { @@ -581,7 +581,7 @@ namespace BoilerSteam { this->BoilerMassFlowRate = 0.0; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -622,11 +622,11 @@ namespace BoilerSteam { CpWater = FluidProperties::GetSatSpecificHeatRefrig( state, fluidNameSteam, DataLoopNode::Node(this->BoilerInletNodeNum).Temp, 0.0, this->FluidIndex, RoutineName); - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { // TODO: Components shouldn't check FlowLock + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { // TODO: Components shouldn't check FlowLock // Calculate the flow for the boiler { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { BoilerDeltaTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint - DataLoopNode::Node(this->BoilerInletNodeNum).Temp; } else { // DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand @@ -657,7 +657,7 @@ namespace BoilerSteam { this->BoilerMassFlowRate = DataLoopNode::Node(this->BoilerInletNodeNum).MassFlowRate; // Assume that it can meet the setpoint { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { BoilerDeltaTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint - DataLoopNode::Node(this->BoilerInletNodeNum).Temp; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -668,7 +668,7 @@ namespace BoilerSteam { // If boiler outlet temp is already greater than setpoint than it does not need to operate this iteration if (BoilerDeltaTemp < 0.0) { { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -685,7 +685,7 @@ namespace BoilerSteam { } else { { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -708,7 +708,7 @@ namespace BoilerSteam { // Reset later , here just for calculating latent heat { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->BoilerOutletTemp = DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -783,7 +783,8 @@ namespace BoilerSteam { // Beginning of Record Keeping subroutines for the BOILER:SIMPLE Module - void BoilerSpecs::update(Real64 const MyLoad, // boiler operating load + void BoilerSpecs::update(EnergyPlusData &state, + Real64 const MyLoad, // boiler operating load bool const RunFlag, // boiler on when TRUE [[maybe_unused]] bool const FirstHVACIteration // TRUE if First iteration of simulation ) @@ -803,7 +804,7 @@ namespace BoilerSteam { if (MyLoad <= 0.0 || !RunFlag) { // set node temperatures - PlantUtilities::SafeCopyPlantNode(BoilerInletNode, BoilerOutletNode); + PlantUtilities::SafeCopyPlantNode(state, BoilerInletNode, BoilerOutletNode); DataLoopNode::Node(BoilerOutletNode).Temp = DataLoopNode::Node(BoilerInletNode).Temp; this->BoilerOutletTemp = DataLoopNode::Node(BoilerInletNode).Temp; this->BoilerLoad = 0.0; @@ -816,7 +817,7 @@ namespace BoilerSteam { } else { // set node temperatures - PlantUtilities::SafeCopyPlantNode(BoilerInletNode, BoilerOutletNode); + PlantUtilities::SafeCopyPlantNode(state, BoilerInletNode, BoilerOutletNode); DataLoopNode::Node(BoilerOutletNode).Temp = this->BoilerOutletTemp; DataLoopNode::Node(BoilerInletNode).Press = this->BoilerPressCheck; //??? DataLoopNode::Node(BoilerOutletNode).Press = DataLoopNode::Node(BoilerInletNode).Press; diff --git a/src/EnergyPlus/BoilerSteam.hh b/src/EnergyPlus/BoilerSteam.hh index 0ec9b1bdf99..32881ffd3ef 100644 --- a/src/EnergyPlus/BoilerSteam.hh +++ b/src/EnergyPlus/BoilerSteam.hh @@ -136,7 +136,8 @@ namespace BoilerSteam { DataBranchAirLoopPlant::ControlTypeEnum EquipFlowCtrl // Flow control mode for the equipment ); - void update(Real64 MyLoad, // boiler operating load + void update(EnergyPlusData &state, + Real64 MyLoad, // boiler operating load bool RunFlag, // boiler on when TRUE bool FirstHVACIteration // TRUE if First iteration of simulation ); diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index f1358822805..1e118370940 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -118,10 +118,10 @@ namespace EnergyPlus::Boilers { Real64 &CurLoad, bool const RunFlag) { - auto &sim_component(DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum)); + auto &sim_component(state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum)); this->InitBoiler(state); this->CalcBoilerModel(state, CurLoad, RunFlag, sim_component.FlowCtrl); - this->UpdateBoilerRecords(CurLoad, RunFlag); + this->UpdateBoilerRecords(state, CurLoad, RunFlag); } void BoilerSpecs::getDesignCapacities([[maybe_unused]] EnergyPlusData &state, @@ -448,7 +448,7 @@ namespace EnergyPlus::Boilers { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || (this->FlowMode == DataPlant::FlowMode::Constant)) { // reset flow priority - DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } @@ -458,9 +458,9 @@ namespace EnergyPlus::Boilers { if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { // if ( ! PlantFirstSizeCompleted ) SizeBoiler( BoilerNum ); Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->DesMassFlowRate = this->VolFlowRate * rho; @@ -516,12 +516,12 @@ namespace EnergyPlus::Boilers { if ((this->FlowMode == DataPlant::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. - if (DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPoint; } else { // DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand DataLoopNode::Node(this->BoilerOutletNodeNum).TempSetPointLo = - DataLoopNode::Node(DataPlant::PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPointLo; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->LoopNum).TempSetPointNodeNum).TempSetPointLo; } } } @@ -553,20 +553,20 @@ namespace EnergyPlus::Boilers { Real64 tmpNomCap = this->NomCap; // local nominal capacity cooling power Real64 tmpBoilerVolFlowRate = this->VolFlowRate; // local boiler design volume flow rate - int const PltSizNum = DataPlant::PlantLoop(this->LoopNum).PlantSizNum; // Plant Sizing index corresponding to CurLoopNum + int const PltSizNum = state.dataPlnt->PlantLoop(this->LoopNum).PlantSizNum; // Plant Sizing index corresponding to CurLoopNum if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * this->SizFac * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate; } else { @@ -726,9 +726,9 @@ namespace EnergyPlus::Boilers { Real64 const BoilerMassFlowRateMax = this->DesMassFlowRate; // Max Design Boiler Mass Flow Rate converted from Volume Flow Rate Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataLoopNode::Node(BoilerInletNode).Temp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // If the specified load is 0.0 or the boiler should not run then we leave this subroutine. Before leaving @@ -760,7 +760,7 @@ namespace EnergyPlus::Boilers { // Initialize the delta temperature to zero Real64 BoilerDeltaTemp; // C - boiler inlet to outlet temperature difference, set in all necessary code paths so no initialization required - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { // Either set the flow to the Constant value or calculate the flow for the variable volume if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { // Then find the flow rate and outlet temp @@ -779,7 +779,7 @@ namespace EnergyPlus::Boilers { // Calculate the Delta Temp from the inlet temp to the boiler outlet setpoint // Then find the flow rate and outlet temp - if (DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { BoilerDeltaTemp = DataLoopNode::Node(BoilerOutletNode).TempSetPoint - DataLoopNode::Node(BoilerInletNode).Temp; } else { // DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand BoilerDeltaTemp = DataLoopNode::Node(BoilerOutletNode).TempSetPointLo - DataLoopNode::Node(BoilerInletNode).Temp; @@ -910,7 +910,8 @@ namespace EnergyPlus::Boilers { if (this->BoilerLoad > 0.0) this->ParasiticElecPower = this->ParasiticElecLoad * this->BoilerPLR; } - void BoilerSpecs::UpdateBoilerRecords(Real64 const MyLoad, // boiler operating load + void BoilerSpecs::UpdateBoilerRecords(EnergyPlusData &state, + Real64 const MyLoad, // boiler operating load bool const RunFlag // boiler on when TRUE ) { @@ -926,7 +927,7 @@ namespace EnergyPlus::Boilers { int const BoilerOutletNode = this->BoilerOutletNodeNum; if (MyLoad <= 0 || !RunFlag) { - PlantUtilities::SafeCopyPlantNode(BoilerInletNode, BoilerOutletNode); + PlantUtilities::SafeCopyPlantNode(state, BoilerInletNode, BoilerOutletNode); DataLoopNode::Node(BoilerOutletNode).Temp = DataLoopNode::Node(BoilerInletNode).Temp; this->BoilerOutletTemp = DataLoopNode::Node(BoilerInletNode).Temp; this->BoilerLoad = 0.0; @@ -935,7 +936,7 @@ namespace EnergyPlus::Boilers { this->BoilerPLR = 0.0; this->BoilerEff = 0.0; } else { - PlantUtilities::SafeCopyPlantNode(BoilerInletNode, BoilerOutletNode); + PlantUtilities::SafeCopyPlantNode(state, BoilerInletNode, BoilerOutletNode); DataLoopNode::Node(BoilerOutletNode).Temp = this->BoilerOutletTemp; } diff --git a/src/EnergyPlus/Boilers.hh b/src/EnergyPlus/Boilers.hh index 1fcd6a0da08..0df2ee9b039 100644 --- a/src/EnergyPlus/Boilers.hh +++ b/src/EnergyPlus/Boilers.hh @@ -172,7 +172,8 @@ namespace Boilers { DataBranchAirLoopPlant::ControlTypeEnum EquipFlowCtrl // Flow control mode for the equipment ); - void UpdateBoilerRecords(Real64 MyLoad, // boiler operating load + void UpdateBoilerRecords(EnergyPlusData &state, + Real64 MyLoad, // boiler operating load bool RunFlag // boiler on when TRUE ); diff --git a/src/EnergyPlus/CTElectricGenerator.cc b/src/EnergyPlus/CTElectricGenerator.cc index 4b666a48d1f..f743005ff16 100644 --- a/src/EnergyPlus/CTElectricGenerator.cc +++ b/src/EnergyPlus/CTElectricGenerator.cc @@ -474,7 +474,7 @@ namespace CTElectricGenerator { heatRecInTemp = DataLoopNode::Node(heatRecInNode).Temp; heatRecCp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, heatRecInTemp, DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, heatRecInTemp, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); if (FirstHVACIteration && RunFlag) { heatRecMdot = this->DesignHeatRecMassFlowRate; } else { @@ -667,7 +667,7 @@ namespace CTElectricGenerator { bool errFlag; - if (this->MyPlantScanFlag && allocated(DataPlant::PlantLoop) && this->HeatRecActive) { + if (this->MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop) && this->HeatRecActive) { errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, @@ -700,9 +700,9 @@ namespace CTElectricGenerator { // size mass flow rate Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HRLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; diff --git a/src/EnergyPlus/ChilledCeilingPanelSimple.cc b/src/EnergyPlus/ChilledCeilingPanelSimple.cc index 7c3a85cbacf..be13414ce70 100644 --- a/src/EnergyPlus/ChilledCeilingPanelSimple.cc +++ b/src/EnergyPlus/ChilledCeilingPanelSimple.cc @@ -714,7 +714,6 @@ namespace CoolingPanelSimple { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::PlantLoop; using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::ZoneEquipConfig; using DataZoneEquipment::ZoneEquipInputsFilled; @@ -776,7 +775,7 @@ namespace CoolingPanelSimple { } if (state.dataChilledCeilingPanelSimple->SetLoopIndexFlag(CoolingPanelNum)) { - if (allocated(PlantLoop)) { + if (allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject(state, ThisCP.EquipID, ThisCP.EquipType, ThisCP.LoopNum, ThisCP.LoopSideNum, ThisCP.BranchNum, ThisCP.CompNum, errFlag, _, _, _, _, _); @@ -796,7 +795,7 @@ namespace CoolingPanelSimple { // set design mass flow rates if (ThisCP.WaterInletNode > 0) { rho = GetDensityGlycol( - state, PlantLoop(ThisCP.LoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(ThisCP.LoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, state.dataPlnt->PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); ThisCP.WaterMassFlowRateMax = rho * ThisCP.WaterVolFlowRateMax; InitComponentNodes(0.0, ThisCP.WaterMassFlowRateMax, @@ -814,7 +813,7 @@ namespace CoolingPanelSimple { if (state.dataGlobal->BeginEnvrnFlag && MyEnvrnFlag(CoolingPanelNum)) { // Initialize - rho = GetDensityGlycol(state, PlantLoop(ThisCP.LoopNum).FluidName, DataGlobalConstants::InitConvTemp, PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(ThisCP.LoopNum).FluidName, DataGlobalConstants::InitConvTemp, state.dataPlnt->PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); ThisCP.WaterMassFlowRateMax = rho * ThisCP.WaterVolFlowRateMax; @@ -829,7 +828,7 @@ namespace CoolingPanelSimple { ThisInNode.Temp = 7.0; - Cp = GetSpecificHeatGlycol(state, PlantLoop(ThisCP.LoopNum).FluidName, ThisInNode.Temp, PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(ThisCP.LoopNum).FluidName, ThisInNode.Temp, state.dataPlnt->PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); ThisInNode.Enthalpy = Cp * ThisInNode.Temp; ThisInNode.Quality = 0.0; @@ -888,7 +887,6 @@ namespace CoolingPanelSimple { using DataHVACGlobals::AutoCalculateSizing; using DataHVACGlobals::CoolingCapacitySizing; using DataHVACGlobals::SmallLoad; - using DataPlant::PlantLoop; using DataSizing::AutoSize; using DataSizing::AutoVsHardSizingThreshold; using DataSizing::CapacityPerFloorArea; @@ -1037,8 +1035,8 @@ namespace CoolingPanelSimple { PltSizCoolNum = MyPlantSizingIndex(state, CompType, ThisCP.EquipID, ThisCP.WaterInletNode, ThisCP.WaterOutletNode, ErrorsFound); if (PltSizCoolNum > 0) { if (DesCoilLoad >= SmallLoad) { - rho = GetDensityGlycol(state, PlantLoop(ThisCP.LoopNum).FluidName, 5., PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(state, PlantLoop(ThisCP.LoopNum).FluidName, 5.0, PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(ThisCP.LoopNum).FluidName, 5., state.dataPlnt->PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(ThisCP.LoopNum).FluidName, 5.0, state.dataPlnt->PlantLoop(ThisCP.LoopNum).FluidIndex, RoutineName); WaterVolFlowMaxCoolDes = DesCoilLoad / (PlantSizData(PltSizCoolNum).DeltaT * Cp * rho); } else { WaterVolFlowMaxCoolDes = 0.0; @@ -1179,7 +1177,6 @@ namespace CoolingPanelSimple { using DataHeatBalFanSys::ZoneAirHumRat; using DataHVACGlobals::SmallLoad; using DataLoopNode::Node; - using DataPlant::PlantLoop; using DataZoneEnergyDemands::CurDeadBandOrSetback; using DataZoneEnergyDemands::ZoneSysEnergyDemand; using FluidProperties::GetSpecificHeatGlycol; @@ -1308,7 +1305,7 @@ namespace CoolingPanelSimple { if (QZnReq < -SmallLoad && !CurDeadBandOrSetback(ZoneNum) && (CoolingPanelOn)) { - Cp = GetSpecificHeatGlycol(state, PlantLoop(this->LoopNum).FluidName, waterInletTemp, PlantLoop(this->LoopNum).FluidIndex, RoutineName); + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, waterInletTemp, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // Find the actual load: this parameter modifies what the response of the system should be. For total load control, the system tries // to meet the QZnReq. For convective load control, the convective output of the device equals QZnReq which means that the load on @@ -1390,7 +1387,7 @@ namespace CoolingPanelSimple { if (CoolingPanelOn) { // Now simulate the system... - Cp = GetSpecificHeatGlycol(state, PlantLoop(this->LoopNum).FluidName, waterInletTemp, PlantLoop(this->LoopNum).FluidIndex, RoutineName); + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, waterInletTemp, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Effectiveness = 1.0 - exp(-this->UA / (waterMassFlowRate * Cp)); if (Effectiveness <= 0.0) { Effectiveness = 0.0; @@ -1524,7 +1521,7 @@ namespace CoolingPanelSimple { auto &ThisOutNode(Node(WaterOutletNode)); // Set the outlet water nodes for the panel - SafeCopyPlantNode(WaterInletNode, WaterOutletNode); + SafeCopyPlantNode(state, WaterInletNode, WaterOutletNode); ThisOutNode.Temp = ThisCP.WaterOutletTemp; ThisOutNode.Enthalpy = ThisCP.WaterOutletEnthalpy; ThisInNode.MassFlowRate = ThisCP.WaterMassFlowRate; diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index 4fbd60777da..312e3514785 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -131,7 +131,7 @@ namespace EnergyPlus::ChillerAbsorption { void BLASTAbsorberSpecs::simulate(EnergyPlusData &state, const PlantLocation &calledFromLocation, bool FirstHVACIteration, Real64 &CurLoad, bool RunFlag) { - this->EquipFlowCtrl = DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).Comp(calledFromLocation.compNum).FlowCtrl; + this->EquipFlowCtrl = state.dataPlnt->PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).Comp(calledFromLocation.compNum).FlowCtrl; if (calledFromLocation.loopNum == this->CWLoopNum) { // called from dominant chilled water connection loop side @@ -139,7 +139,7 @@ namespace EnergyPlus::ChillerAbsorption { // Calculate Load this->initialize(state, RunFlag, CurLoad); this->calculate(state, CurLoad, RunFlag); - this->updateRecords(CurLoad, RunFlag); + this->updateRecords(state, CurLoad, RunFlag); } else if (calledFromLocation.loopNum == this->CDLoopNum) { // Called from non-dominant condenser water connection loop side @@ -157,7 +157,8 @@ namespace EnergyPlus::ChillerAbsorption { } else if (calledFromLocation.loopNum == this->GenLoopNum) { // Called from non-dominant generator hot water or steam connection loop side - PlantUtilities::UpdateAbsorberChillerComponentGeneratorSide(calledFromLocation.loopNum, + PlantUtilities::UpdateAbsorberChillerComponentGeneratorSide(state, + calledFromLocation.loopNum, calledFromLocation.loopSideNum, DataPlant::TypeOf_Chiller_Absorption, this->GeneratorInletNodeNum, @@ -636,7 +637,7 @@ namespace EnergyPlus::ChillerAbsorption { _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_Absorption, true); } if (this->GeneratorInletNodeNum > 0) { @@ -653,13 +654,13 @@ namespace EnergyPlus::ChillerAbsorption { _, this->GeneratorInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->GenLoopNum, this->GenCompNum, DataPlant::TypeOf_Chiller_Absorption, true); } // Fill in connection data if ((this->CondInletNodeNum > 0) && (this->GeneratorInletNodeNum > 0)) { - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CDLoopNum, this->CDLoopSideNum, this->GenLoopNum, this->GenCompNum, DataPlant::TypeOf_Chiller_Absorption, false); } if (errFlag) { @@ -667,12 +668,12 @@ namespace EnergyPlus::ChillerAbsorption { } if (this->FlowMode == DataPlant::FlowMode::Constant) { - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; if ((DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && @@ -705,9 +706,9 @@ namespace EnergyPlus::ChillerAbsorption { this->ModulatedFlowSetToLoop = true; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } @@ -717,9 +718,9 @@ namespace EnergyPlus::ChillerAbsorption { if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->EvapMassFlowRateMax = this->EvapVolFlowRate * rho; @@ -734,9 +735,9 @@ namespace EnergyPlus::ChillerAbsorption { this->CWCompNum); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondMassFlowRateMax = rho * this->CondVolFlowRate; @@ -755,9 +756,9 @@ namespace EnergyPlus::ChillerAbsorption { if (this->GenHeatSourceType == DataLoopNode::NodeType_Water) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); this->GenMassFlowRateMax = rho * this->GeneratorVolFlowRate; @@ -810,9 +811,9 @@ namespace EnergyPlus::ChillerAbsorption { // 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(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } Real64 mdotEvap; // local fluid mass flow rate thru evaporator @@ -893,8 +894,8 @@ namespace EnergyPlus::ChillerAbsorption { Real64 tmpGeneratorVolFlowRate = this->GeneratorVolFlowRate; // find the appropriate Plant Sizing object - int PltSizNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; - int PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; + int PltSizCondNum = state.dataPlnt->PlantLoop(this->CDLoopNum).PlantSizNum; if (this->GenHeatSourceType == DataLoopNode::NodeType_Steam) { if (this->GeneratorInletNodeNum > 0 && this->GeneratorOutletNodeNum > 0) { @@ -924,15 +925,15 @@ namespace EnergyPlus::ChillerAbsorption { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::TimeStepSys) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; if (!this->NomCapWasAutoSized) tmpNomCap = this->NomCap; @@ -1090,15 +1091,15 @@ namespace EnergyPlus::ChillerAbsorption { // QCondenser = QEvaporator + QGenerator + PumpingPower Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + SteamInputRatNom + tmpNomPumpPower / tmpNomCap) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); @@ -1168,15 +1169,15 @@ namespace EnergyPlus::ChillerAbsorption { if (this->EvapVolFlowRate >= DataHVACGlobals::TimeStepSys && tmpNomCap > 0.0) { if (this->GenHeatSourceType == DataLoopNode::NodeType_Water) { Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataSizing::PlantSizData(PltSizHeatingNum).ExitTemp, - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); Real64 SteamDeltaT = max(0.5, DataSizing::PlantSizData(PltSizHeatingNum).DeltaT); Real64 RhoWater = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, (DataSizing::PlantSizData(PltSizHeatingNum).ExitTemp - SteamDeltaT), - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); tmpGeneratorVolFlowRate = (this->NomCap * SteamInputRatNom) / (CpWater * SteamDeltaT * RhoWater); if (!this->GeneratorVolFlowRateWasAutoSized) tmpGeneratorVolFlowRate = this->GeneratorVolFlowRate; @@ -1321,14 +1322,14 @@ namespace EnergyPlus::ChillerAbsorption { } else if (this->GenHeatSourceType == DataLoopNode::NodeType_Water) { if (DataPlant::PlantFirstSizesOkayToFinalize) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); this->GeneratorDeltaTemp = (SteamInputRatNom * this->NomCap) / (Cp * rho * this->GeneratorVolFlowRate); @@ -1386,9 +1387,9 @@ namespace EnergyPlus::ChillerAbsorption { Real64 TempEvapOut = DataLoopNode::Node(this->EvapOutletNodeNum).Temp; Real64 CpFluid = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataLoopNode::Node(this->EvapInletNodeNum).Temp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); // If there is a fault of Chiller SWT Sensor @@ -1406,7 +1407,7 @@ namespace EnergyPlus::ChillerAbsorption { // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = std::abs(MyLoad); // limit by max capacity @@ -1426,7 +1427,7 @@ namespace EnergyPlus::ChillerAbsorption { } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1450,7 +1451,7 @@ namespace EnergyPlus::ChillerAbsorption { this->CWBranchNum, this->CWCompNum); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1499,10 +1500,10 @@ namespace EnergyPlus::ChillerAbsorption { Real64 TempEvapOutSetPoint(0.0); // C - evaporator outlet temperature setpoint { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -1510,11 +1511,11 @@ namespace EnergyPlus::ChillerAbsorption { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -1522,7 +1523,7 @@ namespace EnergyPlus::ChillerAbsorption { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } else { assert(false); @@ -1624,9 +1625,9 @@ namespace EnergyPlus::ChillerAbsorption { this->QCondenser = this->QEvaporator + this->QGenerator + this->PumpingPower; CpFluid = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataLoopNode::Node(this->CondInletNodeNum).Temp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { @@ -1645,11 +1646,11 @@ namespace EnergyPlus::ChillerAbsorption { Real64 GenMassFlowRate; // Hot water plant is used for the generator CpFluid = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataLoopNode::Node(this->GeneratorInletNodeNum).Temp, - DataPlant::PlantLoop(GenLoopSideNum).FluidIndex, + state.dataPlnt->PlantLoop(GenLoopSideNum).FluidIndex, RoutineName); - if (DataPlant::PlantLoop(this->GenLoopNum).LoopSide(this->GenLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->GenLoopNum).LoopSide(this->GenLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { GenMassFlowRate = this->GenMassFlowRateMax; } else { // LeavingSetpointModulated @@ -1730,7 +1731,7 @@ namespace EnergyPlus::ChillerAbsorption { this->PumpingEnergy = this->PumpingPower * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour; } - void BLASTAbsorberSpecs::updateRecords(Real64 MyLoad, bool RunFlag) + void BLASTAbsorberSpecs::updateRecords(EnergyPlusData &state, Real64 MyLoad, bool RunFlag) { // SUBROUTINE INFORMATION: // AUTHOR: Dan Fisher @@ -1741,8 +1742,8 @@ namespace EnergyPlus::ChillerAbsorption { if (MyLoad >= 0 || !RunFlag) { // set node conditions - PlantUtilities::SafeCopyPlantNode(this->EvapInletNodeNum, this->EvapOutletNodeNum); - PlantUtilities::SafeCopyPlantNode(this->CondInletNodeNum, this->CondOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->EvapInletNodeNum, this->EvapOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->CondInletNodeNum, this->CondOutletNodeNum); this->Report.PumpingPower = 0.0; this->Report.QEvap = 0.0; @@ -1762,13 +1763,13 @@ namespace EnergyPlus::ChillerAbsorption { this->Report.ActualCOP = 0.0; if (this->GeneratorInletNodeNum > 0) { - PlantUtilities::SafeCopyPlantNode(this->GeneratorInletNodeNum, this->GeneratorOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->GeneratorInletNodeNum, this->GeneratorOutletNodeNum); } } else { // set node conditions - PlantUtilities::SafeCopyPlantNode(this->EvapInletNodeNum, this->EvapOutletNodeNum); - PlantUtilities::SafeCopyPlantNode(this->CondInletNodeNum, this->CondOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->EvapInletNodeNum, this->EvapOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->CondInletNodeNum, this->CondOutletNodeNum); DataLoopNode::Node(this->EvapOutletNodeNum).Temp = this->EvapOutletTemp; DataLoopNode::Node(this->CondOutletNodeNum).Temp = this->CondOutletTemp; @@ -1794,7 +1795,7 @@ namespace EnergyPlus::ChillerAbsorption { } if (this->GeneratorInletNodeNum > 0) { - PlantUtilities::SafeCopyPlantNode(this->GeneratorInletNodeNum, this->GeneratorOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->GeneratorInletNodeNum, this->GeneratorOutletNodeNum); DataLoopNode::Node(this->GeneratorOutletNodeNum).Temp = this->GenOutletTemp; } } diff --git a/src/EnergyPlus/ChillerAbsorption.hh b/src/EnergyPlus/ChillerAbsorption.hh index 22f6180a091..9350461b9da 100644 --- a/src/EnergyPlus/ChillerAbsorption.hh +++ b/src/EnergyPlus/ChillerAbsorption.hh @@ -214,7 +214,7 @@ namespace ChillerAbsorption { void calculate(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag); - void updateRecords(Real64 MyLoad, bool RunFlag); + void updateRecords(EnergyPlusData &state, Real64 MyLoad, bool RunFlag); }; void GetBLASTAbsorberInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 482e6d8295d..3a7804a6f43 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -149,7 +149,7 @@ namespace ChillerElectricEIR { if (calledFromLocation.loopNum == this->CWLoopNum) { this->initialize(state, RunFlag, CurLoad); this->calculate(state, CurLoad, RunFlag); - this->update(CurLoad, RunFlag); + this->update(state, CurLoad, RunFlag); } else if (calledFromLocation.loopNum == this->CDLoopNum) { PlantUtilities::UpdateChillerComponentCondenserSide(state, @@ -969,7 +969,7 @@ namespace ChillerElectricEIR { _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ElectricEIR, true); } if (this->HeatRecActive) { @@ -986,12 +986,12 @@ namespace ChillerElectricEIR { _, this->HeatRecInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricEIR, true); } if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricEIR, false); } @@ -1001,13 +1001,13 @@ namespace ChillerElectricEIR { if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->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) && @@ -1039,22 +1039,22 @@ namespace ChillerElectricEIR { } this->ModulatedFlowSetToLoop = true; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } this->oneTimeFlag = false; } - this->EquipFlowCtrl = DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; + this->EquipFlowCtrl = state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->EvapMassFlowRateMax = this->EvapVolFlowRate * rho; @@ -1071,9 +1071,9 @@ namespace ChillerElectricEIR { if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempRefCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondMassFlowRateMax = rho * this->CondVolFlowRate; PlantUtilities::InitComponentNodes(0.0, @@ -1104,9 +1104,9 @@ namespace ChillerElectricEIR { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HRLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; @@ -1124,7 +1124,7 @@ namespace ChillerElectricEIR { if (this->HeatRecSetPointNodeNum > 0) { Real64 THeatRecSetPoint(0.0); // tests set point node for proper set point value { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1140,7 +1140,7 @@ namespace ChillerElectricEIR { ShowContinueError(state, " A temperature setpoint is needed at the heat recovery leaving temperature setpoint node " "specified, use a SetpointManager"); ShowContinueError(state, " The overall loop setpoint will be assumed for heat recovery. The simulation continues ..."); - this->HeatRecSetPointNodeNum = DataPlant::PlantLoop(this->HRLoopNum).TempSetPointNodeNum; + this->HeatRecSetPointNodeNum = state.dataPlnt->PlantLoop(this->HRLoopNum).TempSetPointNodeNum; this->HRSPErrDone = true; } } else { @@ -1155,7 +1155,7 @@ namespace ChillerElectricEIR { "specified, use a SetpointManager to establish a setpoint"); ShowContinueError(state, " or use an EMS actuator to establish a setpoint at this node "); ShowContinueError(state, " The overall loop setpoint will be assumed for heat recovery. The simulation continues ..."); - this->HeatRecSetPointNodeNum = DataPlant::PlantLoop(this->HRLoopNum).TempSetPointNodeNum; + this->HeatRecSetPointNodeNum = state.dataPlnt->PlantLoop(this->HRLoopNum).TempSetPointNodeNum; this->HRSPErrDone = true; } } @@ -1174,9 +1174,9 @@ namespace ChillerElectricEIR { // 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(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } Real64 mdot; @@ -1244,11 +1244,11 @@ namespace ChillerElectricEIR { Real64 tmpCondVolFlowRate = this->CondVolFlowRate; if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; + PltSizCondNum = state.dataPlnt->PlantLoop(this->CDLoopNum).PlantSizNum; } // find the appropriate Plant Sizing object - int PltSizNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { @@ -1312,15 +1312,15 @@ namespace ChillerElectricEIR { if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate; } else { @@ -1375,14 +1375,14 @@ namespace ChillerElectricEIR { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempRefCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + (1.0 / this->RefCOP) * this->CompPowerToCondenserFrac) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); @@ -1618,11 +1618,11 @@ namespace ChillerElectricEIR { // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { if (this->EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == + if (state.dataPlnt->PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; } @@ -1713,7 +1713,7 @@ namespace ChillerElectricEIR { this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->CWLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum, @@ -1739,10 +1739,10 @@ namespace ChillerElectricEIR { } { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -1751,11 +1751,11 @@ namespace ChillerElectricEIR { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else { // use plant loop overall setpoint - EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -1764,7 +1764,7 @@ namespace ChillerElectricEIR { // there will be a valid setpoint on outlet EvapOutletTempSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { // use plant loop overall setpoint - EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } else { assert(false); @@ -1804,7 +1804,7 @@ namespace ChillerElectricEIR { if (this->ChillerCapFT < 0) { if (this->ChillerCapFTError < 1 && - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); @@ -1815,7 +1815,7 @@ namespace ChillerElectricEIR { EvapOutletTempSetPoint, condInletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + } else if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + @@ -1831,18 +1831,18 @@ namespace ChillerElectricEIR { Real64 AvailChillerCap = ChillerRefCap * this->ChillerCapFT; // Only perform this check for temperature setpoint control - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).CurOpSchemeType == + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) { // Calculate water side load Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataLoopNode::Node(this->EvapInletNodeNum).Temp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempLoad = this->EvapMassFlowRate * Cp * (DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint); @@ -1870,12 +1870,12 @@ namespace ChillerElectricEIR { } Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataLoopNode::Node(this->EvapInletNodeNum).Temp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).CurOpSchemeType == + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType) { this->PossibleSubcooling = false; } else { @@ -1909,7 +1909,7 @@ namespace ChillerElectricEIR { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1935,7 +1935,7 @@ namespace ChillerElectricEIR { this->CWCompNum); // Should we recalculate this with the corrected setpoint? { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -2098,7 +2098,7 @@ namespace ChillerElectricEIR { this->ChillerEIRFT = CurveManager::CurveValue(state, this->ChillerEIRFTIndex, this->EvapOutletTemp, AvgCondSinkTemp); if (this->ChillerEIRFT < 0.0) { if (this->ChillerEIRFTError < 1 && - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); @@ -2108,7 +2108,7 @@ namespace ChillerElectricEIR { this->EvapOutletTemp, condInletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + } else if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + @@ -2123,14 +2123,14 @@ namespace ChillerElectricEIR { this->ChillerEIRFPLR = CurveManager::CurveValue(state, this->ChillerEIRFPLRIndex, PartLoadRat); if (this->ChillerEIRFPLR < 0.0) { if (this->ChillerEIRFPLRError < 1 && - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowWarningError(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + "\":"); ShowContinueError(state, format(" Chiller EIR as a function of PLR curve output is negative ({:.3R}).", this->ChillerEIRFPLR)); ShowContinueError(state, format(" Negative value occurs using a part-load ratio of {:.3R}.", PartLoadRat)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && + } else if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:EIR \"" + this->Name + @@ -2151,7 +2151,7 @@ namespace ChillerElectricEIR { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine if (this->HeatRecActive) this->calcHeatRecovery(state, this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovered); Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, condInletTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / Cp + condInletTemp; } else { @@ -2218,9 +2218,9 @@ namespace ChillerElectricEIR { Real64 HeatRecMassFlowRate = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; Real64 CpHeatRec = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, heatRecInletTemp, DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, heatRecInletTemp, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); Real64 CpCond = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, condInletTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); // Before we modify the QCondenser, the total or original value is transferred to QTot Real64 QTotal = QCond; @@ -2238,7 +2238,7 @@ namespace ChillerElectricEIR { } else { // use new algorithm to meet setpoint Real64 THeatRecSetPoint(0.0); // local value for heat recovery leaving setpoint [C] { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; @@ -2275,7 +2275,7 @@ namespace ChillerElectricEIR { } } - void ElectricEIRChillerSpecs::update(Real64 const MyLoad, bool const RunFlag) + void ElectricEIRChillerSpecs::update(EnergyPlusData &state, Real64 const MyLoad, bool const RunFlag) { // SUBROUTINE INFORMATION: @@ -2323,7 +2323,7 @@ namespace ChillerElectricEIR { if (this->HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); this->QHeatRecovered = 0.0; this->EnergyHeatRecovery = 0.0; @@ -2378,7 +2378,7 @@ namespace ChillerElectricEIR { if (this->HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); this->EnergyHeatRecovery = this->QHeatRecovered * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour; DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp = this->HeatRecOutletTemp; this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; diff --git a/src/EnergyPlus/ChillerElectricEIR.hh b/src/EnergyPlus/ChillerElectricEIR.hh index ef68c25dfad..1fc896a73c6 100644 --- a/src/EnergyPlus/ChillerElectricEIR.hh +++ b/src/EnergyPlus/ChillerElectricEIR.hh @@ -252,7 +252,7 @@ namespace ChillerElectricEIR { Real64 &QHeatRec // Amount of heat recovered [W] ); - void update(Real64 MyLoad, bool RunFlag); + void update(EnergyPlusData &state, Real64 MyLoad, bool RunFlag); }; void GetElectricEIRChillerInput(EnergyPlusData &state); diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index dd5d23536a2..3c73dfc9ffe 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -136,7 +136,7 @@ namespace ChillerExhaustAbsorption { // 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; + state.dataPlnt->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 @@ -176,7 +176,7 @@ namespace ChillerExhaustAbsorption { // 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; + state.dataPlnt->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 @@ -210,7 +210,7 @@ namespace ChillerExhaustAbsorption { // 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; + state.dataPlnt->PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn; if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller this->size(state); // only call from chilled water loop @@ -705,13 +705,13 @@ namespace ChillerExhaustAbsorption { if (errFlag) { ShowFatalError(state, "InitExhaustAbsorber: Program terminated due to previous condition(s)."); } - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->HWLoopNum, this->HWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); } - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::TypeOf_Chiller_ExhFiredAbsorption, true); // check if outlet node of chilled water side has a setpoint. @@ -742,9 +742,9 @@ namespace ChillerExhaustAbsorption { } this->ChillSetPointSetToLoop = true; DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } // check if outlet node of hot water side has a setpoint. if ((DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && @@ -774,9 +774,9 @@ namespace ChillerExhaustAbsorption { } this->HeatSetPointSetToLoop = true; DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPointLo = - DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } this->plantScanInit = false; } @@ -792,9 +792,9 @@ namespace ChillerExhaustAbsorption { // init max available condenser water flow rate if (this->CDLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp); @@ -813,9 +813,9 @@ namespace ChillerExhaustAbsorption { if (this->HWLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp); @@ -833,9 +833,9 @@ namespace ChillerExhaustAbsorption { if (this->CWLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp); @@ -862,16 +862,16 @@ namespace ChillerExhaustAbsorption { // fill from plant if needed if (this->ChillSetPointSetToLoop) { DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } if (this->HeatSetPointSetToLoop) { DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPointLo = - DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } if ((this->isWaterCooled) && ((this->InHeatingMode) || (this->InCoolingMode)) && (!this->plantScanInit)) { @@ -930,22 +930,22 @@ namespace ChillerExhaustAbsorption { tmpHeatRecVolFlowRate = this->HeatVolFlowRate; int PltSizCondNum = 0; // Plant Sizing index for condenser loop - if (this->isWaterCooled) PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; + if (this->isWaterCooled) PltSizCondNum = state.dataPlnt->PlantLoop(this->CDLoopNum).PlantSizNum; - int PltSizHeatNum = DataPlant::PlantLoop(this->HWLoopNum).PlantSizNum; - int PltSizCoolNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; + int PltSizHeatNum = state.dataPlnt->PlantLoop(this->HWLoopNum).PlantSizNum; + int PltSizCoolNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; if (PltSizCoolNum > 0) { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizCoolNum).DeltaT * DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * this->SizFac; @@ -1155,14 +1155,14 @@ namespace ChillerExhaustAbsorption { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondReturn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondReturn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + this->ThermalEnergyCoolRatio) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); if (!this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = this->CondVolFlowRate; @@ -1376,7 +1376,7 @@ namespace ChillerExhaustAbsorption { lChillWaterMassFlowRate = DataLoopNode::Node(lChillReturnNodeNum).MassFlowRate; lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1391,10 +1391,10 @@ namespace ChillerExhaustAbsorption { lExhaustAirHumRat = DataLoopNode::Node(lExhaustAirInletNodeNum).HumRat; Cp_CW = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, lChillReturnTemp, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, lChillReturnTemp, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); if (this->CDLoopNum > 0) { Cp_CD = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, lChillReturnTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, lChillReturnTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } // If no loop demand or Absorber OFF, return @@ -1474,7 +1474,7 @@ namespace ChillerExhaustAbsorption { LoopNum = this->CWLoopNum; LoopSideNum = this->CWLoopSideNum; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components this->PossibleSubcooling = false; lCoolingLoad = std::abs(MyLoad); @@ -1774,7 +1774,7 @@ namespace ChillerExhaustAbsorption { LoopSideNum = this->HWLoopSideNum; Cp_HW = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); lCoolElectricPower = this->CoolElectricPower; lCoolThermalEnergyUseRate = this->CoolThermalEnergyUseRate; @@ -1784,7 +1784,7 @@ namespace ChillerExhaustAbsorption { lHotWaterReturnTemp = DataLoopNode::Node(lHeatReturnNodeNum).Temp; lHotWaterMassFlowRate = DataLoopNode::Node(lHeatReturnNodeNum).MassFlowRate; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { HeatSupplySetPointTemp = DataLoopNode::Node(lHeatSupplyNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1817,7 +1817,7 @@ namespace ChillerExhaustAbsorption { // cooling load taken by the chiller, and // supply temperature { - auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components lHeatingLoad = std::abs(MyLoad); if (HeatDeltaTemp != 0) { diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index 306d0a370a2..d84877dd96c 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -135,7 +135,7 @@ namespace ChillerGasAbsorption { // 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; + state.dataPlnt->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 @@ -177,7 +177,7 @@ namespace ChillerGasAbsorption { { // 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; + state.dataPlnt->PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn; if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller MinLoad = this->NomCoolingCap * this->MinPartLoadRat; @@ -210,7 +210,7 @@ namespace ChillerGasAbsorption { // 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; + state.dataPlnt->PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).NodeNumIn; if (BranchInletNodeNum == this->ChillReturnNodeNum) { // Operate as chiller this->size(state); // only call from chilled water loop @@ -698,13 +698,13 @@ namespace ChillerGasAbsorption { if (errFlag) { ShowFatalError(state, "InitGasAbsorber: Program terminated due to previous condition(s)."); } - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_DFAbsorption, true); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->HWLoopNum, this->HWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_DFAbsorption, true); } - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::TypeOf_Chiller_DFAbsorption, true); // check if outlet node of chilled water side has a setpoint. @@ -735,9 +735,9 @@ namespace ChillerGasAbsorption { } this->ChillSetPointSetToLoop = true; DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } // check if outlet node of hot water side has a setpoint. if ((DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && @@ -767,9 +767,9 @@ namespace ChillerGasAbsorption { } this->HeatSetPointSetToLoop = true; DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPointLo = - DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } this->plantScanFlag = false; } @@ -785,9 +785,9 @@ namespace ChillerGasAbsorption { // init max available condenser water flow rate if (this->CDLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp); @@ -806,9 +806,9 @@ namespace ChillerGasAbsorption { if (this->HWLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp); @@ -826,9 +826,9 @@ namespace ChillerGasAbsorption { if (this->CWLoopNum > 0) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); } else { rho = Psychrometrics::RhoH2O(DataGlobalConstants::InitConvTemp); @@ -855,16 +855,16 @@ namespace ChillerGasAbsorption { // fill from plant if needed if (this->ChillSetPointSetToLoop) { DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->ChillSupplyNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } if (this->HeatSetPointSetToLoop) { DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->HeatSupplyNodeNum).TempSetPointLo = - DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPointLo; } if ((this->isWaterCooled) && ((this->InHeatingMode) || (this->InCoolingMode)) && (!this->plantScanFlag)) { @@ -923,21 +923,21 @@ namespace ChillerGasAbsorption { // Commenting this could cause diffs - HeatRecVolFlowRateUser = 0.0; int PltSizCondNum = 0; // Plant Sizing index for condenser loop - if (this->isWaterCooled) PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; - int PltSizHeatNum = DataPlant::PlantLoop(this->HWLoopNum).PlantSizNum; - int PltSizCoolNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; + if (this->isWaterCooled) PltSizCondNum = state.dataPlnt->PlantLoop(this->CDLoopNum).PlantSizNum; + int PltSizHeatNum = state.dataPlnt->PlantLoop(this->HWLoopNum).PlantSizNum; + int PltSizCoolNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; if (PltSizCoolNum > 0) { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizCoolNum).DeltaT * DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate * this->SizFac; @@ -1146,14 +1146,14 @@ namespace ChillerGasAbsorption { if (DataSizing::PlantSizData(PltSizCoolNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondReturn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondReturn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + this->FuelCoolRatio) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); if (!this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = this->CondVolFlowRate; @@ -1348,7 +1348,7 @@ namespace ChillerGasAbsorption { lCondReturnTemp = DataLoopNode::Node(lCondReturnNodeNum).Temp; // Commenting this could be cause of diffs - lCondWaterMassFlowRate = DataLoopNode::Node(lCondReturnNodeNum).MassFlowRate; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { ChillSupplySetPointTemp = DataLoopNode::Node(lChillSupplyNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1360,11 +1360,11 @@ namespace ChillerGasAbsorption { ChillDeltaTemp = std::abs(lChillReturnTemp - ChillSupplySetPointTemp); Cp_CW = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, lChillReturnTemp, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, lChillReturnTemp, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Cp_CD = 0; // putting this here as a dummy initialization to hush the compiler warning, in real runs this value should never be used if (this->CDLoopNum > 0) { Cp_CD = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, lChillReturnTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, lChillReturnTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } // If no loop demand or Absorber OFF, return @@ -1444,7 +1444,7 @@ namespace ChillerGasAbsorption { LoopNum = this->CWLoopNum; LoopSideNum = this->CWLoopSideNum; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components this->PossibleSubcooling = false; lCoolingLoad = std::abs(MyLoad); @@ -1688,7 +1688,7 @@ namespace ChillerGasAbsorption { LoopSideNum = this->HWLoopSideNum; Cp_HW = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); lCoolElectricPower = this->CoolElectricPower; lCoolFuelUseRate = this->CoolFuelUseRate; @@ -1698,7 +1698,7 @@ namespace ChillerGasAbsorption { lHotWaterReturnTemp = DataLoopNode::Node(lHeatReturnNodeNum).Temp; lHotWaterMassFlowRate = DataLoopNode::Node(lHeatReturnNodeNum).MassFlowRate; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { HeatSupplySetPointTemp = DataLoopNode::Node(lHeatSupplyNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1732,7 +1732,7 @@ namespace ChillerGasAbsorption { // cooling load taken by the chiller, and // supply temperature { - auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock); if (SELECT_CASE_var == DataPlant::iFlowLock::Unlocked) { // mass flow rates may be changed by loop components lHeatingLoad = std::abs(MyLoad); if (HeatDeltaTemp != 0) { diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index 3080edeab2d..3877a0d01de 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -135,7 +135,7 @@ namespace ChillerIndirectAbsorption { this->initialize(state, RunFlag, CurLoad); this->calculate(state, CurLoad, RunFlag); - this->updateRecords(CurLoad, RunFlag); + this->updateRecords(state, CurLoad, RunFlag); } else if (calledFromLocation.loopNum == this->CDLoopNum) { // Called from non-dominant condenser water connection loop side @@ -153,7 +153,8 @@ namespace ChillerIndirectAbsorption { } else if (calledFromLocation.loopNum == this->GenLoopNum) { // Called from non-dominant generator hot water or steam connection loop side - PlantUtilities::UpdateAbsorberChillerComponentGeneratorSide(calledFromLocation.loopNum, + PlantUtilities::UpdateAbsorberChillerComponentGeneratorSide(state, + calledFromLocation.loopNum, calledFromLocation.loopSideNum, DataPlant::TypeOf_Chiller_Indirect_Absorption, this->GeneratorInletNodeNum, @@ -730,7 +731,7 @@ namespace ChillerIndirectAbsorption { _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_Indirect_Absorption, true); if (this->GeneratorInletNodeNum > 0) { @@ -747,12 +748,12 @@ namespace ChillerIndirectAbsorption { _, this->GeneratorInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->GenLoopNum, this->GenCompNum, DataPlant::TypeOf_Chiller_Indirect_Absorption, true); } if ((this->CondInletNodeNum > 0) && (this->GeneratorInletNodeNum > 0)) { - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CDLoopNum, this->CDLoopSideNum, this->GenLoopNum, this->GenCompNum, DataPlant::TypeOf_Chiller_Indirect_Absorption, false); } if (errFlag) { @@ -761,13 +762,13 @@ namespace ChillerIndirectAbsorption { if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; if ((DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && @@ -800,24 +801,24 @@ namespace ChillerIndirectAbsorption { this->ModulatedFlowSetToLoop = true; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } this->MyOneTimeFlag = false; } - this->EquipFlowCtrl = DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; + this->EquipFlowCtrl = state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; // Initialize Supply Side Variables if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->EvapMassFlowRateMax = this->EvapVolFlowRate * rho; @@ -832,9 +833,9 @@ namespace ChillerIndirectAbsorption { this->CWCompNum); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondMassFlowRateMax = rho * this->CondVolFlowRate; @@ -855,9 +856,9 @@ namespace ChillerIndirectAbsorption { if (this->GenHeatSourceType == DataLoopNode::NodeType_Water) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); this->GenMassFlowRateMax = rho * this->GeneratorVolFlowRate; @@ -890,9 +891,9 @@ namespace ChillerIndirectAbsorption { // 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(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } Real64 mdotEvap; // local fluid mass flow rate thru evaporator @@ -976,7 +977,7 @@ namespace ChillerIndirectAbsorption { } // find the appropriate Plant Sizing object - int PltSizNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; // IF (IndirectAbsorber(ChillNum)%CondVolFlowRate == AutoSize) THEN if (PltSizNum > 0) { @@ -1012,15 +1013,15 @@ namespace ChillerIndirectAbsorption { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; if (!this->NomCapWasAutoSized) tmpNomCap = this->NomCap; @@ -1194,15 +1195,15 @@ namespace ChillerIndirectAbsorption { // QCondenser = QEvaporator + QGenerator + PumpingPower Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + SteamInputRatNom + tmpNomPumpPower / tmpNomCap) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); @@ -1283,16 +1284,16 @@ namespace ChillerIndirectAbsorption { if (this->EvapVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { if (this->GenHeatSourceType == DataLoopNode::NodeType_Water) { Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataSizing::PlantSizData(PltSizHeatingNum).ExitTemp, - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); Real64 SteamDeltaT = max(0.5, DataSizing::PlantSizData(PltSizHeatingNum).DeltaT); Real64 RhoWater = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, (DataSizing::PlantSizData(PltSizHeatingNum).ExitTemp - SteamDeltaT), - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); tmpGeneratorVolFlowRate = (tmpNomCap * SteamInputRatNom) / (CpWater * SteamDeltaT * RhoWater); if (!this->GeneratorVolFlowRateWasAutoSized) tmpGeneratorVolFlowRate = this->GeneratorVolFlowRate; @@ -1460,14 +1461,14 @@ namespace ChillerIndirectAbsorption { this->GeneratorDeltaTemp = max(0.5, DataSizing::PlantSizData(PltSizHeatingNum).DeltaT); } else if (this->GenHeatSourceType == DataLoopNode::NodeType_Water) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataSizing::PlantSizData(PltSizHeatingNum).ExitTemp, - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); if (DataPlant::PlantFirstSizesOkayToFinalize) { this->GeneratorDeltaTemp = (SteamInputRatNom * this->NomCap) / (CpWater * rho * this->GeneratorVolFlowRate); @@ -1602,7 +1603,7 @@ namespace ChillerIndirectAbsorption { Real64 TempLowLimitEout = this->TempLowLimitEvapOut; Real64 CpFluid = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, EvapInletTemp, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, EvapInletTemp, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); // If there is a fault of Chiller SWT Sensor if (this->FaultyChillerSWTFlag && (!state.dataGlobal->WarmupFlag) && (!state.dataGlobal->DoingSizing) && (!state.dataGlobal->KickOffSimulation)) { @@ -1654,7 +1655,7 @@ namespace ChillerIndirectAbsorption { // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = std::abs(MyLoad); @@ -1672,7 +1673,7 @@ namespace ChillerIndirectAbsorption { } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1696,7 +1697,7 @@ namespace ChillerIndirectAbsorption { this->CWBranchNum, this->CWCompNum); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1742,10 +1743,10 @@ namespace ChillerIndirectAbsorption { this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; } else { { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -1753,11 +1754,11 @@ namespace ChillerIndirectAbsorption { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -1765,7 +1766,7 @@ namespace ChillerIndirectAbsorption { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } else { assert(false); @@ -1897,7 +1898,7 @@ namespace ChillerIndirectAbsorption { this->QCondenser = this->QEvaporator + this->QGenerator + this->PumpingPower; CpFluid = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, CondInletTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / CpFluid + CondInletTemp; @@ -1914,9 +1915,9 @@ namespace ChillerIndirectAbsorption { if (this->GenHeatSourceType == DataLoopNode::NodeType_Water) { CpFluid = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->GenLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataLoopNode::Node(this->GeneratorInletNodeNum).Temp, - DataPlant::PlantLoop(this->GenLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); if ((this->FlowMode == DataPlant::FlowMode::Constant) || (this->FlowMode == DataPlant::FlowMode::NotModulated)) { this->GenMassFlowRate = this->GenMassFlowRateMax; @@ -2059,7 +2060,7 @@ namespace ChillerIndirectAbsorption { // Enthalpy (H) } - void IndirectAbsorberSpecs::updateRecords(Real64 MyLoad, bool RunFlag) + void IndirectAbsorberSpecs::updateRecords(EnergyPlusData &state, Real64 MyLoad, bool RunFlag) { // SUBROUTINE INFORMATION: // AUTHOR: R. Raustad (FSEC) @@ -2072,8 +2073,8 @@ namespace ChillerIndirectAbsorption { if (MyLoad >= 0 || !RunFlag) { // set node temperature - PlantUtilities::SafeCopyPlantNode(this->EvapInletNodeNum, this->EvapOutletNodeNum); - PlantUtilities::SafeCopyPlantNode(this->CondInletNodeNum, CondOutletNode); + PlantUtilities::SafeCopyPlantNode(state, this->EvapInletNodeNum, this->EvapOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->CondInletNodeNum, CondOutletNode); this->Report.PumpingPower = 0.0; this->Report.QEvap = 0.0; @@ -2096,13 +2097,13 @@ namespace ChillerIndirectAbsorption { this->Report.ChillerCyclingFrac = 0.0; if (this->GeneratorInletNodeNum > 0) { - PlantUtilities::SafeCopyPlantNode(this->GeneratorInletNodeNum, this->GeneratorOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->GeneratorInletNodeNum, this->GeneratorOutletNodeNum); } } else { // set node temperatures - PlantUtilities::SafeCopyPlantNode(this->EvapInletNodeNum, this->EvapOutletNodeNum); - PlantUtilities::SafeCopyPlantNode(this->CondInletNodeNum, CondOutletNode); + PlantUtilities::SafeCopyPlantNode(state, this->EvapInletNodeNum, this->EvapOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->CondInletNodeNum, CondOutletNode); DataLoopNode::Node(this->EvapOutletNodeNum).Temp = this->EvapOutletTemp; DataLoopNode::Node(CondOutletNode).Temp = this->CondOutletTemp; @@ -2131,7 +2132,7 @@ namespace ChillerIndirectAbsorption { } if (this->GeneratorInletNodeNum > 0) { - PlantUtilities::SafeCopyPlantNode(this->GeneratorInletNodeNum, this->GeneratorOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->GeneratorInletNodeNum, this->GeneratorOutletNodeNum); DataLoopNode::Node(this->GeneratorOutletNodeNum).Temp = this->GenOutletTemp; } } diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.hh b/src/EnergyPlus/ChillerIndirectAbsorption.hh index bb7797d9158..bd8fb708618 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.hh +++ b/src/EnergyPlus/ChillerIndirectAbsorption.hh @@ -230,7 +230,7 @@ namespace ChillerIndirectAbsorption { void sizeChiller(EnergyPlusData &state); - void updateRecords(Real64 MyLoad, bool RunFlag); + void updateRecords(EnergyPlusData &state, Real64 MyLoad, bool RunFlag); void calculate(EnergyPlusData &state, Real64 MyLoad, bool RunFlag); }; diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index f9b80406c2b..2d997b22430 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -186,7 +186,7 @@ namespace ChillerReformulatedEIR { if (calledFromLocation.loopNum == this->CWLoopNum) { this->initialize(state, RunFlag, CurLoad); this->control(state, CurLoad, RunFlag, FirstHVACIteration); - this->update(CurLoad, RunFlag); + this->update(state, CurLoad, RunFlag); } else if (calledFromLocation.loopNum == this->CDLoopNum) { int LoopSide = this->CDLoopSideNum; PlantUtilities::UpdateChillerComponentCondenserSide(state, @@ -777,7 +777,7 @@ namespace ChillerReformulatedEIR { _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, true); } if (this->HeatRecActive) { @@ -794,12 +794,12 @@ namespace ChillerReformulatedEIR { _, this->HeatRecInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, true); } if ((this->CondenserType != DataPlant::CondenserType::AirCooled) && (this->HeatRecActive)) { - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, DataPlant::TypeOf_Chiller_ElectricReformEIR, false); } @@ -809,13 +809,13 @@ namespace ChillerReformulatedEIR { if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->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) && @@ -847,23 +847,23 @@ namespace ChillerReformulatedEIR { } this->ModulatedFlowSetToLoop = true; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } this->MyInitFlag = false; } this->EquipFlowCtrl = - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->EvapMassFlowRateMax = this->EvapVolFlowRate * rho; @@ -880,9 +880,9 @@ namespace ChillerReformulatedEIR { if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempRefCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondMassFlowRateMax = rho * this->CondVolFlowRate; PlantUtilities::InitComponentNodes(0.0, @@ -911,9 +911,9 @@ namespace ChillerReformulatedEIR { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HRLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; PlantUtilities::InitComponentNodes(0.0, @@ -938,9 +938,9 @@ namespace ChillerReformulatedEIR { // 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(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } Real64 mdot; @@ -1020,11 +1020,11 @@ namespace ChillerReformulatedEIR { int PltSizCondNum(0); // Plant Sizing index for condenser loop if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; + PltSizCondNum = state.dataPlnt->PlantLoop(this->CDLoopNum).PlantSizNum; } // find the appropriate Plant Sizing object - int PltSizNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { @@ -1102,14 +1102,14 @@ namespace ChillerReformulatedEIR { SizingCondOutletTemp = this->TempRefCondOut; } Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 RefCapFT = CurveManager::CurveValue(state, this->ChillerCapFTIndex, SizingEvapOutletTemp, SizingCondOutletTemp); tmpNomCap = (Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate) / RefCapFT; @@ -1166,14 +1166,14 @@ namespace ChillerReformulatedEIR { if (PltSizCondNum > 0 && PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempRefCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + (1.0 / this->RefCOP) * this->CompPowerToCondenserFrac) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); @@ -1404,10 +1404,10 @@ namespace ChillerReformulatedEIR { // Initialize condenser reference inlet temperature (not a user input) Real64 Density = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, this->TempRefCondOut, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempRefCondOut, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 SpecificHeat = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, this->TempRefCondOut, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempRefCondOut, state.dataPlnt->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; @@ -1645,9 +1645,9 @@ namespace ChillerReformulatedEIR { Real64 HeatRecMassFlowRate = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; Real64 CpHeatRec = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, heatRecInletTemp, DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, heatRecInletTemp, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); Real64 CpCond = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, condInletTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); // Before we modify the QCondenser, the total or original value is transferred to QTot Real64 QTotal = QCond; @@ -1666,7 +1666,7 @@ namespace ChillerReformulatedEIR { Real64 THeatRecSetPoint(0.0); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1701,7 +1701,7 @@ namespace ChillerReformulatedEIR { } } - void ReformulatedEIRChillerSpecs::update(Real64 const MyLoad, bool const RunFlag) + void ReformulatedEIRChillerSpecs::update(EnergyPlusData &state, Real64 const MyLoad, bool const RunFlag) { // SUBROUTINE INFORMATION: // AUTHOR: Lixing Gu, FSEC @@ -1733,7 +1733,7 @@ namespace ChillerReformulatedEIR { if (this->HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); this->QHeatRecovery = 0.0; this->EnergyHeatRecovery = 0.0; this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; @@ -1762,7 +1762,7 @@ namespace ChillerReformulatedEIR { if (this->HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); this->EnergyHeatRecovery = this->QHeatRecovery * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour; DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp = this->HeatRecOutletTemp; this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; @@ -1851,11 +1851,11 @@ namespace ChillerReformulatedEIR { // flow resolver will not shut down the branch if (MyLoad >= 0 || !RunFlag) { if (this->EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == + if (state.dataPlnt->PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; } @@ -1899,7 +1899,7 @@ namespace ChillerReformulatedEIR { this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->CWLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum, @@ -1914,26 +1914,26 @@ namespace ChillerReformulatedEIR { Real64 FRAC = 1.0; Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] { - auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == + (state.dataPlnt->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; } else { // use plant loop overall setpoint - EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == + (state.dataPlnt->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; } else { // use plant loop overall setpoint - EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; } } else { assert(false); @@ -1984,9 +1984,9 @@ namespace ChillerReformulatedEIR { // Calculate water side load Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataLoopNode::Node(this->EvapInletNodeNum).Temp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 TempLoad; // actual load to be met by chiller. This value is compared to MyLoad @@ -2017,8 +2017,8 @@ namespace ChillerReformulatedEIR { 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 == DataPlant::iFlowLock::Unlocked) { - this->PossibleSubcooling = !(DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == + if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + this->PossibleSubcooling = !(state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == DataPlant::CompSetPtBasedSchemeType); Real64 EvapDeltaTemp(0.0); // Evaporator temperature difference [C] @@ -2044,7 +2044,7 @@ namespace ChillerReformulatedEIR { this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { { - auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; @@ -2071,7 +2071,7 @@ namespace ChillerReformulatedEIR { this->CWCompNum); // Should we recalculate this with the corrected setpoint? { - auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -2289,7 +2289,7 @@ namespace ChillerReformulatedEIR { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine if (this->HeatRecActive) this->calcHeatRecovery(state, this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovery); Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, condInletTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / Cp + condInletTemp; } else { ShowSevereError(state, "ControlReformEIRChillerModel: Condenser flow = 0, for ElecReformEIRChiller=" + this->Name); @@ -2312,7 +2312,7 @@ namespace ChillerReformulatedEIR { int BranchNum = this->CWBranchNum; int CompNum = this->CWCompNum; - if (FirstIteration || state.dataGlobal->WarmupFlag || DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; + if (FirstIteration || state.dataGlobal->WarmupFlag || state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // Minimum evaporator leaving temperature allowed by CAPFT curve [C] Real64 CAPFTXTmin = this->ChillerCAPFTXTempMin; @@ -2523,26 +2523,26 @@ namespace ChillerReformulatedEIR { Real64 EvapOutletTempSetPoint(0.0); // Evaporator outlet temperature setpoint [C] { - auto const SELECT_CASE_var(DataPlant::PlantLoop(PlantLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == + (state.dataPlnt->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; } else { // use plant loop overall setpoint - EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType == + (state.dataPlnt->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; } else { // use plant loop overall setpoint - EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; + EvapOutletTempSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(PlantLoopNum).TempSetPointNodeNum).TempSetPointHi; } } else { assert(false); @@ -2552,7 +2552,7 @@ namespace ChillerReformulatedEIR { this->ChillerCapFT = CurveManager::CurveValue(state, this->ChillerCapFTIndex, EvapOutletTempSetPoint, this->CondOutletTemp); if (this->ChillerCapFT < 0) { - if (this->ChillerCapFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { + if (this->ChillerCapFTError < 1 && state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); ShowContinueError(state, @@ -2562,7 +2562,7 @@ namespace ChillerReformulatedEIR { EvapOutletTempSetPoint, this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { + } else if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerCapFTError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": Chiller Capacity as a Function of Temperature curve output is negative warning continues...", @@ -2575,7 +2575,7 @@ namespace ChillerReformulatedEIR { this->ChillerEIRFT = CurveManager::CurveValue(state, this->ChillerEIRFTIndex, this->EvapOutletTemp, this->CondOutletTemp); if (this->ChillerEIRFT < 0.0) { - if (this->ChillerEIRFTError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { + if (this->ChillerEIRFTError < 1 && state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); ShowContinueError( @@ -2585,7 +2585,7 @@ namespace ChillerReformulatedEIR { this->EvapOutletTemp, this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { + } else if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFTError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\": Chiller EIR as a Function of Temperature curve output is negative warning continues...", @@ -2620,7 +2620,7 @@ namespace ChillerReformulatedEIR { } if (this->ChillerEIRFPLR < 0.0) { - if (this->ChillerEIRFPLRError < 1 && DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { + if (this->ChillerEIRFPLRError < 1 && state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowWarningError(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->Name + "\":"); ShowContinueError(state, @@ -2631,7 +2631,7 @@ namespace ChillerReformulatedEIR { this->ChillerPartLoadRatio, this->CondOutletTemp)); ShowContinueErrorTimeStamp(state, " Resetting curve output to zero and continuing simulation."); - } else if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { + } else if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).FlowLock != DataPlant::iFlowLock::Unlocked && !state.dataGlobal->WarmupFlag) { ++this->ChillerEIRFPLRError; ShowRecurringWarningErrorAtEnd(state, "CHILLER:ELECTRIC:REFORMULATEDEIR \"" + this->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 29c7c017bb9..ebfebcd54ae 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.hh +++ b/src/EnergyPlus/ChillerReformulatedEIR.hh @@ -273,7 +273,7 @@ namespace ChillerReformulatedEIR { void calcHeatRecovery(EnergyPlusData &state, Real64 &QCond, Real64 CondMassFlow, Real64 condInletTemp, Real64 &QHeatRec); - void update(Real64 MyLoad, bool RunFlag); + void update(EnergyPlusData &state, Real64 MyLoad, bool RunFlag); void checkMinMaxCurveBoundaries(EnergyPlusData &state, bool FirstIteration); diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index c0bfc3db02b..3514724743c 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -1874,9 +1874,9 @@ namespace CondenserLoopTowers { if (this->envrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->DesWaterMassFlowRate = this->DesignWaterFlowRate * rho; @@ -1912,7 +1912,7 @@ namespace CondenserLoopTowers { this->AirWetBulb = state.dataEnvrn->OutWetBulbTemp; } - this->WaterMassFlowRate = PlantUtilities::RegulateCondenserCompFlowReqOp( + this->WaterMassFlowRate = PlantUtilities::RegulateCondenserCompFlowReqOp(state, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, this->DesWaterMassFlowRate * this->TowerMassFlowRateMultiplier); PlantUtilities::SetComponentFlowRate(state, this->WaterMassFlowRate, @@ -2218,7 +2218,7 @@ namespace CondenserLoopTowers { Real64 tmpLowSpeedAirFlowRate = this->LowSpeedAirFlowRate; // Find the appropriate Plant Sizing object - int PltSizCondNum = DataPlant::PlantLoop(this->LoopNum).PlantSizNum; + int PltSizCondNum = state.dataPlnt->PlantLoop(this->LoopNum).PlantSizNum; if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd || this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { if (this->TowerInletCondsAutoSize) { @@ -2284,14 +2284,14 @@ namespace CondenserLoopTowers { if (this->PerformanceInputMethod_Num == PIM::UFactor && (!this->HighSpeedTowerUAWasAutoSized)) { if (PltSizCondNum > 0) { Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * this->DesignWaterFlowRate * DesTowerWaterDeltaT; this->TowerNominalCapacity = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; @@ -2301,9 +2301,9 @@ namespace CondenserLoopTowers { Real64 AssumedExitTemp = DesTowerExitWaterTemp; Real64 const rho = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, AssumedExitTemp, DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, AssumedExitTemp, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, AssumedExitTemp, DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, AssumedExitTemp, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * this->DesignWaterFlowRate * AssumedDeltaT; this->TowerNominalCapacity = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; @@ -2376,14 +2376,14 @@ namespace CondenserLoopTowers { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * tmpDesignWaterFlowRate * DesTowerWaterDeltaT; tmpHighSpeedFanPower = 0.0105 * DesTowerLoad; @@ -2448,14 +2448,14 @@ namespace CondenserLoopTowers { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * tmpDesignWaterFlowRate * DesTowerWaterDeltaT; // This conditional statement is to trap when the user specified condenser/tower water design setpoint @@ -2534,14 +2534,14 @@ namespace CondenserLoopTowers { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * tmpDesignWaterFlowRate * DesTowerWaterDeltaT; // This conditional statement is to trap when the user specified condenser/tower water design setpoint @@ -2642,14 +2642,14 @@ namespace CondenserLoopTowers { // nominal capacity doesn't include compressor heat; predefined factor was 1.25 W heat rejection per W of delivered cooling but now is // a user input Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, 29.44, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, 29.44, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp DesTowerLoad = this->TowerNominalCapacity * this->HeatRejectCapNomCapSizingRatio; @@ -2781,14 +2781,14 @@ namespace CondenserLoopTowers { // nominal capacity doesn't include compressor heat; predefined factor was 1.25 W heat rejection per W of evap cooling but now is a // user input Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, 29.44, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, 29.44, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp DesTowerLoad = this->TowerLowSpeedNomCap * this->HeatRejectCapNomCapSizingRatio; Par(1) = DesTowerLoad; @@ -2862,14 +2862,14 @@ namespace CondenserLoopTowers { // nominal capacity doesn't include compressor heat; predefined factor was 1.25 W heat rejection per W of evap cooling but now user // input Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, 29.44, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, 29.44, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp DesTowerLoad = this->TowerFreeConvNomCap * this->HeatRejectCapNomCapSizingRatio; Par(1) = DesTowerLoad; @@ -2997,14 +2997,14 @@ namespace CondenserLoopTowers { } Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, (this->DesignInletWB + this->DesignApproach + this->DesignRange), - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, (this->DesignInletWB + this->DesignApproach + this->DesignRange), - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->TowerNominalCapacity = ((rho * tmpDesignWaterFlowRate) * Cp * this->DesignRange); @@ -3124,7 +3124,7 @@ namespace CondenserLoopTowers { // for warning message reporting purpose only // Find the appropriate Plant Sizing object - int PltSizCondNum = DataPlant::PlantLoop(this->LoopNum).PlantSizNum; + int PltSizCondNum = state.dataPlnt->PlantLoop(this->LoopNum).PlantSizNum; Real64 tmpNomTowerCap = this->TowerNominalCapacity; Real64 tmpDesignWaterFlowRate = this->DesignWaterFlowRate; @@ -3184,14 +3184,14 @@ namespace CondenserLoopTowers { if (PltSizCondNum > 0) { // get nominal capacity from PlantSizData(PltSizCondNum)%DeltaT and PlantSizData(PltSizCondNum)%DesVolFlowRate if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT * this->SizFac; tmpNomTowerCap = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; @@ -3202,14 +3202,14 @@ namespace CondenserLoopTowers { if (!this->TowerInletCondsAutoSize) { // can use design data entered into tower object if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * this->DesignWaterFlowRate * DesTowerWaterDeltaT * this->SizFac; tmpNomTowerCap = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; @@ -3429,23 +3429,23 @@ namespace CondenserLoopTowers { if (DataPlant::PlantFirstSizesOkayToFinalize) { if (PltSizCondNum > 0) { // user has a plant sizing object Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->WaterTemp = DesTowerInletWaterTemp; } else { // probably no plant sizing object Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->WaterTemp = DesTowerInletWaterTemp; // 35.0; // design condition } rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // full speed fan tower UA @@ -3569,14 +3569,14 @@ namespace CondenserLoopTowers { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT * this->SizFac; tmpNomTowerCap = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; @@ -3609,14 +3609,14 @@ namespace CondenserLoopTowers { if (!this->TowerInletCondsAutoSize) { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * this->DesignWaterFlowRate * DesTowerWaterDeltaT * this->SizFac; tmpNomTowerCap = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; @@ -3701,14 +3701,14 @@ namespace CondenserLoopTowers { // now calcuate UA values from nominal capacities and flow rates if (DataPlant::PlantFirstSizesOkayToFinalize) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // full speed fan tower UA Par(1) = tmpNomTowerCap * this->HeatRejectCapNomCapSizingRatio; @@ -3804,14 +3804,14 @@ namespace CondenserLoopTowers { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT; tmpNomTowerCap = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; @@ -3869,14 +3869,14 @@ namespace CondenserLoopTowers { } else { // UA and Air flow rate given, so find Nominal Cap from running model rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DesTowerExitWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->WaterTemp = DesTowerInletWaterTemp; @@ -4055,18 +4055,18 @@ namespace CondenserLoopTowers { // water temperature setpoint Real64 TempSetPoint = 0.0; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if (this->SetpointIsOnOutlet) { TempSetPoint = DataLoopNode::Node(this->WaterOutletNodeNum).TempSetPoint; } else { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if (this->SetpointIsOnOutlet) { TempSetPoint = DataLoopNode::Node(this->WaterOutletNodeNum).TempSetPointHi; } else { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } } @@ -4268,9 +4268,9 @@ namespace CondenserLoopTowers { this->FanCyclingRatio = FanModeFrac; // Should this be water inlet node num????? Real64 const CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataLoopNode::Node(this->WaterInletNodeNum).Temp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->Qactual = this->WaterMassFlowRate * CpWater * (DataLoopNode::Node(this->WaterInletNodeNum).Temp - this->OutletWaterTemp); @@ -4357,18 +4357,18 @@ namespace CondenserLoopTowers { // water temperature setpoint Real64 TempSetPoint = 0.0; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if (this->SetpointIsOnOutlet) { TempSetPoint = DataLoopNode::Node(this->WaterOutletNodeNum).TempSetPoint; } else { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if (this->SetpointIsOnOutlet) { TempSetPoint = DataLoopNode::Node(this->WaterOutletNodeNum).TempSetPointHi; } else { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } } @@ -4399,7 +4399,7 @@ namespace CondenserLoopTowers { } // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // TODO: WTF + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // TODO: WTF // MassFlowTolerance is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { CalcBasinHeaterPower(state, @@ -4508,9 +4508,9 @@ namespace CondenserLoopTowers { this->SpeedSelected = SpeedSel; Real64 const CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataLoopNode::Node(this->WaterInletNodeNum).Temp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->Qactual = this->WaterMassFlowRate * CpWater * (DataLoopNode::Node(this->WaterInletNodeNum).Temp - this->OutletWaterTemp); this->airFlowRateRatio = (AirFlowRate * this->NumCell) / this->HighSpeedAirFlowRate; @@ -4617,11 +4617,11 @@ namespace CondenserLoopTowers { // water temperature setpoint Real64 TempSetPoint(0.0); // Outlet water temperature setpoint (C) { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } else { assert(false); } @@ -4642,7 +4642,7 @@ namespace CondenserLoopTowers { Real64 Ta = TempSetPoint - this->AirWetBulb; // Do not RETURN here if flow rate is less than MassFlowTolerance. Check basin heater and then RETURN. - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // TODO: WTF + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // TODO: WTF // MassFlowTolerance is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { CalcBasinHeaterPower(state, @@ -4662,9 +4662,9 @@ namespace CondenserLoopTowers { IncrNumCellFlag = false; // Initialize inlet node water properties Real64 const WaterDensity = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataLoopNode::Node(this->WaterInletNodeNum).Temp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 const WaterFlowRateRatio = WaterMassFlowRatePerCell / (WaterDensity * this->CalibratedWaterFlowRate / this->NumCell); @@ -4790,9 +4790,9 @@ namespace CondenserLoopTowers { } // IF(OutletWaterTempON .LT. TempSetPoint) ie if tower should not run at full capacity Real64 const CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataLoopNode::Node(this->WaterInletNodeNum).Temp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->Qactual = this->WaterMassFlowRate * CpWater * (DataLoopNode::Node(this->WaterInletNodeNum).Temp - this->OutletWaterTemp); @@ -4878,9 +4878,9 @@ namespace CondenserLoopTowers { int SolFla(0); // Flag of solver Real64 const CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataLoopNode::Node(this->WaterInletNodeNum).Temp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->Qactual = 0.0; this->FanPower = 0.0; @@ -5189,9 +5189,9 @@ namespace CondenserLoopTowers { Real64 AirMassFlowRate = AirFlowRate * AirDensity; // Mass flow rate of air [kg/s] Real64 CpAir = Psychrometrics::PsyCpAirFnW(this->AirHumRat); // Heat capacity of air [J/kg/K] Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, this->WaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // Heat capacity of water [J/kg/K] Real64 InletAirEnthalpy = Psychrometrics::PsyHFnTdbRhPb(state, this->AirWetBulb, 1.0, this->AirPress); // Enthalpy of entering moist air [J/kg] @@ -5320,11 +5320,11 @@ namespace CondenserLoopTowers { } else if (SolFla == -2) { // decide if should run at max flow Real64 TempSetPoint(0.0); // local temporary for loop setpoint { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } else { assert(false); } @@ -5805,7 +5805,7 @@ namespace CondenserLoopTowers { // Amount of water evaporated, get density water at air temp or 4 C if too cold Real64 const rho = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, max(TairAvg, 4.0), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, max(TairAvg, 4.0), state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); EvapVdot = (AirMassFlowRate * (OutSpecificHumRat - InSpecificHumRat)) / rho; // [m3/s] if (EvapVdot < 0.0) EvapVdot = 0.0; @@ -5815,7 +5815,7 @@ namespace CondenserLoopTowers { } else if (this->EvapLossMode == EvapLoss::UserFactor) { Real64 const rho = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, AverageWaterTemp, DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, AverageWaterTemp, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); EvapVdot = this->UserEvapLossFactor * (this->InletWaterTemp - this->OutletWaterTemp) * (this->WaterMassFlowRate / rho); if (EvapVdot < 0.0) EvapVdot = 0.0; @@ -5911,7 +5911,7 @@ namespace CondenserLoopTowers { // set node information DataLoopNode::Node(this->WaterOutletNodeNum).Temp = this->OutletWaterTemp; - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || state.dataGlobal->WarmupFlag) return; @@ -5936,7 +5936,7 @@ namespace CondenserLoopTowers { } // Check if OutletWaterTemp is below the minimum condenser loop temp and warn user - Real64 const LoopMinTemp = DataPlant::PlantLoop(this->LoopNum).MinTemp; + Real64 const LoopMinTemp = state.dataPlnt->PlantLoop(this->LoopNum).MinTemp; if (this->OutletWaterTemp < LoopMinTemp && this->WaterMassFlowRate > 0.0) { ++this->OutletWaterTempErrorCount; strip(CharErrOut); diff --git a/src/EnergyPlus/DesiccantDehumidifiers.cc b/src/EnergyPlus/DesiccantDehumidifiers.cc index 7eae796dd10..d69b74cc74b 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -1722,7 +1722,6 @@ namespace DesiccantDehumidifiers { using Psychrometrics::PsyRhoAirFnPbTdbW; using SteamCoils::SimulateSteamCoilComponents; auto &GetCoilMaxSteamFlowRate(SteamCoils::GetCoilMaxSteamFlowRate); - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterSimpleHeating; using DataSizing::AutoSize; @@ -1763,7 +1762,7 @@ namespace DesiccantDehumidifiers { MyPlantScanFlag = true; } - if (MyPlantScanFlag(DesicDehumNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(DesicDehumNum) && allocated(state.dataPlnt->PlantLoop)) { if ((DesicDehum(DesicDehumNum).RegenCoilType_Num == Coil_HeatingWater) || (DesicDehum(DesicDehumNum).RegenCoilType_Num == Coil_HeatingSteam)) { if (DesicDehum(DesicDehumNum).RegenCoilType_Num == Coil_HeatingWater) { @@ -1790,9 +1789,9 @@ namespace DesiccantDehumidifiers { GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", DesicDehum(DesicDehumNum).RegenCoilName, ErrorFlag); if (DesicDehum(DesicDehumNum).MaxCoilFluidFlow > 0.0) { FluidDensity = GetDensityGlycol(state, - PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidIndex, initCBVAV); DesicDehum(DesicDehumNum).MaxCoilFluidFlow *= FluidDensity; } @@ -1828,7 +1827,7 @@ namespace DesiccantDehumidifiers { } // fill outlet node for regenartion hot water or steam heating coil - DesicDehum(DesicDehumNum).CoilOutletNode = PlantLoop(DesicDehum(DesicDehumNum).LoopNum) + DesicDehum(DesicDehumNum).CoilOutletNode = state.dataPlnt->PlantLoop(DesicDehum(DesicDehumNum).LoopNum) .LoopSide(DesicDehum(DesicDehumNum).LoopSide) .Branch(DesicDehum(DesicDehumNum).BranchNum) .Comp(DesicDehum(DesicDehumNum).CompNum) @@ -1915,9 +1914,9 @@ namespace DesiccantDehumidifiers { } if (CoilMaxVolFlowRate != AutoSize) { FluidDensity = GetDensityGlycol(state, - PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(DesicDehum(DesicDehumNum).LoopNum).FluidIndex, RoutineName); DesicDehum(DesicDehumNum).MaxCoilFluidFlow = CoilMaxVolFlowRate * FluidDensity; } diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index 605a6e4dc53..22c8aa5d385 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -1959,7 +1959,7 @@ Real64 ElectPowerLoadCenter::calcLoadCenterThermalLoad(EnergyPlusData &state) Real64 thermalLoad = 0.0; for (auto &g : elecGenCntrlObj) { if (g->plantInfoFound) { - thermalLoad += DataPlant::PlantLoop(g->cogenLocation.loopNum) + thermalLoad += state.dataPlnt->PlantLoop(g->cogenLocation.loopNum) .LoopSide(g->cogenLocation.loopSideNum) .Branch(g->cogenLocation.branchNum) .Comp(g->cogenLocation.compNum) diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 7088878011a..140c0c88352 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -1053,7 +1053,7 @@ namespace EvaporativeFluidCoolers { this->setupOutputVars(state); - this->FluidIndex = DataPlant::PlantLoop(DataSizing::CurLoopNum).FluidIndex; + this->FluidIndex = state.dataPlnt->PlantLoop(DataSizing::CurLoopNum).FluidIndex; std::string FluidName = FluidProperties::GetGlycolNameByIndex(this->FluidIndex); if (UtilityRoutines::SameString(this->PerformanceInputMethod, "STANDARDDESIGNCAPACITY")) { @@ -1062,7 +1062,7 @@ namespace EvaporativeFluidCoolers { ShowSevereError(state, DataIPShortCuts::cCurrentModuleObject + " = \"" + this->Name + R"(". StandardDesignCapacity performance input method is only valid for fluid type = "Water".)"); ShowContinueError(state, "Currently, Fluid Type = " + FluidName + - " in CondenserLoop = " + DataPlant::PlantLoop(DataSizing::CurLoopNum).Name); + " in CondenserLoop = " + state.dataPlnt->PlantLoop(DataSizing::CurLoopNum).Name); ErrorsFound = true; } } @@ -1118,9 +1118,9 @@ namespace EvaporativeFluidCoolers { if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->DesWaterMassFlowRate = this->DesignWaterFlowRate * rho; PlantUtilities::InitComponentNodes(0.0, @@ -1155,13 +1155,14 @@ namespace EvaporativeFluidCoolers { } this->WaterMassFlowRate = - PlantUtilities::RegulateCondenserCompFlowReqOp(this->LoopNum, + PlantUtilities::RegulateCondenserCompFlowReqOp(state, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, this->DesWaterMassFlowRate * this->EvapFluidCoolerMassFlowRateMultiplier); - PlantUtilities::SetComponentFlowRate(state, this->WaterMassFlowRate, + PlantUtilities::SetComponentFlowRate(state, + this->WaterMassFlowRate, this->WaterInletNodeNum, this->WaterOutletNodeNum, this->LoopNum, @@ -1210,7 +1211,7 @@ namespace EvaporativeFluidCoolers { Real64 tmpHighSpeedFanPower = this->HighSpeedFanPower; Real64 tmpHighSpeedAirFlowRate = this->HighSpeedAirFlowRate; - int PltSizCondNum = DataPlant::PlantLoop(this->LoopNum).PlantSizNum; + int PltSizCondNum = state.dataPlnt->PlantLoop(this->LoopNum).PlantSizNum; if (this->DesignWaterFlowRateWasAutoSized && this->PerformanceInputMethod_Num != PIM::StandardDesignCapacity) { if (PltSizCondNum > 0) { @@ -1263,14 +1264,14 @@ namespace EvaporativeFluidCoolers { if (this->PerformanceInputMethod_Num == PIM::UFactor && !this->HighSpeedEvapFluidCoolerUAWasAutoSized) { if (PltSizCondNum > 0) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataSizing::PlantSizData(PltSizCondNum).ExitTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesEvapFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; this->HighSpeedStandardDesignCapacity = DesEvapFluidCoolerLoad / this->HeatRejectCapNomCapSizingRatio; @@ -1334,14 +1335,14 @@ namespace EvaporativeFluidCoolers { } else if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataSizing::PlantSizData(PltSizCondNum).ExitTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesEvapFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; tmpHighSpeedFanPower = 0.0105 * DesEvapFluidCoolerLoad; @@ -1433,14 +1434,14 @@ namespace EvaporativeFluidCoolers { ShowFatalError(state, "Review and revise design input values as appropriate."); } Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataSizing::PlantSizData(PltSizCondNum).ExitTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesEvapFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; Par(1) = DesEvapFluidCoolerLoad; @@ -1549,12 +1550,12 @@ namespace EvaporativeFluidCoolers { // Standard Design Capacity doesn't include compressor heat; // predefined factor was 1.25 W heat rejection per W of delivered cooling, now a user input with 1.25 default Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, 35.0, DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, 35.0, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesEvapFluidCoolerLoad = this->HighSpeedStandardDesignCapacity * this->HeatRejectCapNomCapSizingRatio; Par(1) = DesEvapFluidCoolerLoad; Par(2) = rho * this->DesignWaterFlowRate; // Design water mass flow rate @@ -1616,14 +1617,14 @@ namespace EvaporativeFluidCoolers { if (this->PerformanceInputMethod_Num == PIM::UserSpecifiedDesignCapacity) { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, this->DesignEnteringWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesEvapFluidCoolerLoad = this->HighSpeedUserSpecifiedDesignCapacity; Par(1) = DesEvapFluidCoolerLoad; @@ -1760,14 +1761,14 @@ namespace EvaporativeFluidCoolers { // Standard design capacity doesn't include compressor heat; // predefined factor was 1.25 W heat rejection per W of delivered cooling, now user input with default 1.25 Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, this->DesignEnteringWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesEvapFluidCoolerLoad = this->LowSpeedStandardDesignCapacity * this->HeatRejectCapNomCapSizingRatio; Par(1) = DesEvapFluidCoolerLoad; @@ -1813,14 +1814,14 @@ namespace EvaporativeFluidCoolers { if (this->PerformanceInputMethod_Num == PIM::UserSpecifiedDesignCapacity && this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow && this->LowSpeedUserSpecifiedDesignCapacity > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, this->DesignEnteringWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesEvapFluidCoolerLoad = this->LowSpeedUserSpecifiedDesignCapacity; Par(1) = DesEvapFluidCoolerLoad; @@ -1959,11 +1960,11 @@ namespace EvaporativeFluidCoolers { this->OutletWaterTemp = inletWaterTemp; AirFlowRate = 0.0; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } @@ -1973,7 +1974,7 @@ namespace EvaporativeFluidCoolers { // MassFlowTol is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || - DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; if (inletWaterTemp > TempSetPoint) { @@ -2066,9 +2067,9 @@ namespace EvaporativeFluidCoolers { // Should this be water inlet node num????? CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataLoopNode::Node(this->WaterInletNode).Temp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->Qactual = this->WaterMassFlowRate * CpWater * (DataLoopNode::Node(this->WaterInletNode).Temp - this->OutletWaterTemp); this->AirFlowRateRatio = AirFlowRate / this->HighSpeedAirFlowRate; @@ -2139,17 +2140,17 @@ namespace EvaporativeFluidCoolers { Real64 AirFlowRate = 0.0; Real64 TempSetPoint = 0.0; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } // MassFlowTol is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || - DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; if (this->InletWaterTemp > TempSetPoint) { @@ -2189,9 +2190,9 @@ namespace EvaporativeFluidCoolers { // Should this be water inlet node num?? Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataLoopNode::Node(this->WaterInletNode).Temp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->Qactual = this->WaterMassFlowRate * CpWater * (DataLoopNode::Node(this->WaterInletNode).Temp - this->OutletWaterTemp); this->AirFlowRateRatio = AirFlowRate / this->HighSpeedAirFlowRate; @@ -2245,7 +2246,7 @@ namespace EvaporativeFluidCoolers { Real64 AirMassFlowRate = AirFlowRate * AirDensity; Real64 CpAir = Psychrometrics::PsyCpAirFnW(this->inletConds.AirHumRat); Real64 CpWater = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, this->InletWaterTemp, DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, this->InletWaterTemp, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 InletAirEnthalpy = Psychrometrics::PsyHFnTdbRhPb(state, InletAirWetBulb, 1.0, this->inletConds.AirPress); // initialize exiting wet bulb temperature before iterating on final solution @@ -2378,7 +2379,7 @@ namespace EvaporativeFluidCoolers { // Amount of water evaporated Real64 rho = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, TairAvg, DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, TairAvg, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->EvaporationVdot = (AirMassFlowRate * (OutSpecificHumRat - InSpecificHumRat)) / rho; // [m3/s] if (this->EvaporationVdot < 0.0) this->EvaporationVdot = 0.0; } else { @@ -2387,7 +2388,7 @@ namespace EvaporativeFluidCoolers { } else if (this->EvapLossMode == EvapLoss::ByUserFactor) { Real64 rho = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, AverageWaterTemp, DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, AverageWaterTemp, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->EvaporationVdot = this->UserEvapLossFactor * (this->InletWaterTemp - this->OutletWaterTemp) * (this->WaterMassFlowRate / rho); if (this->EvaporationVdot < 0.0) this->EvaporationVdot = 0.0; } else { @@ -2471,7 +2472,7 @@ namespace EvaporativeFluidCoolers { DataLoopNode::Node(this->WaterOutletNode).Temp = this->OutletWaterTemp; - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || state.dataGlobal->WarmupFlag) + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || state.dataGlobal->WarmupFlag) return; // Check flow rate through evaporative fluid cooler and compare to design flow rate, @@ -2495,8 +2496,8 @@ namespace EvaporativeFluidCoolers { } // Check if OutletWaterTemp is below the minimum condenser loop temp and warn user - Real64 LoopMinTemp = DataPlant::PlantLoop(this->LoopNum).MinTemp; - Real64 TempDifference = DataPlant::PlantLoop(this->LoopNum).MinTemp - this->OutletWaterTemp; + Real64 LoopMinTemp = state.dataPlnt->PlantLoop(this->LoopNum).MinTemp; + Real64 TempDifference = state.dataPlnt->PlantLoop(this->LoopNum).MinTemp - this->OutletWaterTemp; if (TempDifference > TempAllowance && this->WaterMassFlowRate > 0.0) { ++this->OutletWaterTempErrorCount; if (this->OutletWaterTempErrorCount < 2) { diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 634dd87ec8a..1db0ff9e911 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -1107,7 +1107,6 @@ namespace FanCoilUnits { // Using/Aliasing using DataHVACGlobals::ZoneComp; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilWaterCooling; using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; using DataZoneEquipment::CheckZoneEquipmentList; @@ -1160,7 +1159,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).AvailStatus = ZoneComp(FanCoil4Pipe_Num).ZoneCompAvailMgrs(FanCoilNum).AvailStatus; } - if (MyPlantScanFlag(FanCoilNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(FanCoilNum) && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; if (FanCoil(FanCoilNum).HCoilType_Num == HCoil_Water) { ScanPlantLoopsForObject(state, @@ -1182,7 +1181,7 @@ namespace FanCoilUnits { ShowFatalError(state, "InitFanCoilUnits: Program terminated for previous conditions."); } - FanCoil(FanCoilNum).HeatCoilFluidOutletNodeNum = PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum) + FanCoil(FanCoilNum).HeatCoilFluidOutletNodeNum = state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum) .LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide) .Branch(FanCoil(FanCoilNum).HeatCoilBranchNum) .Comp(FanCoil(FanCoilNum).HeatCoilCompNum) @@ -1213,7 +1212,7 @@ namespace FanCoilUnits { ShowContinueError(state, "Reference Unit=\"" + FanCoil(FanCoilNum).Name + "\", type=" + FanCoil(FanCoilNum).UnitType); ShowFatalError(state, "InitFanCoilUnits: Program terminated for previous conditions."); } - FanCoil(FanCoilNum).CoolCoilFluidOutletNodeNum = PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum) + FanCoil(FanCoilNum).CoolCoilFluidOutletNodeNum = state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum) .LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide) .Branch(FanCoil(FanCoilNum).CoolCoilBranchNum) .Comp(FanCoil(FanCoilNum).CoolCoilCompNum) @@ -1255,18 +1254,18 @@ namespace FanCoilUnits { if (FanCoil(FanCoilNum).HCoilType_Num == HCoil_Water) { rho = GetDensityGlycol(state, - PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidName, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidIndex, RoutineName); FanCoil(FanCoilNum).MaxHeatCoilFluidFlow = rho * FanCoil(FanCoilNum).MaxHotWaterVolFlow; FanCoil(FanCoilNum).MinHotWaterFlow = rho * FanCoil(FanCoilNum).MinHotWaterVolFlow; } rho = GetDensityGlycol(state, - PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidName, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidIndex, RoutineName); FanCoil(FanCoilNum).MaxCoolCoilFluidFlow = rho * FanCoil(FanCoilNum).MaxColdWaterVolFlow; FanCoil(FanCoilNum).MinColdWaterFlow = rho * FanCoil(FanCoilNum).MinColdWaterVolFlow; @@ -1382,7 +1381,6 @@ namespace FanCoilUnits { using DataHVACGlobals::CoolingCapacitySizing; using DataHVACGlobals::HeatingAirflowSizing; using DataHVACGlobals::HeatingCapacitySizing; - using DataPlant::PlantLoop; using Fans::GetFanDesignVolumeFlowRate; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -1869,14 +1867,14 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).DesHeatingLoad = DesCoilLoad; if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(state, - PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidName, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidIndex, RoutineNameNoSpace); Cp = GetSpecificHeatGlycol(state, - PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidName, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).FluidIndex, RoutineNameNoSpace); MaxHotWaterVolFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); @@ -2042,14 +2040,14 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).DesCoolingLoad = DesCoilLoad; if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(state, - PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidName, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidName, 5., - PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidIndex, RoutineNameNoSpace); Cp = GetSpecificHeatGlycol(state, - PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidName, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidName, 5., - PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).FluidIndex, RoutineNameNoSpace); MaxColdWaterVolFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); } else { @@ -2333,7 +2331,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).CoolCoilLoopSide, FanCoil(FanCoilNum).CoolCoilBranchNum, FanCoil(FanCoilNum).CoolCoilCompNum); - if (PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { + if (state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { ColdFlowLocked = true; // check for flow lock } if (FanCoil(FanCoilNum).HCoilType_Num == HCoil_Water) { @@ -2345,7 +2343,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).HeatCoilLoopSide, FanCoil(FanCoilNum).HeatCoilBranchNum, FanCoil(FanCoilNum).HeatCoilCompNum); - if (PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { + if (state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { HotFlowLocked = true; // save locked flow } } @@ -2702,7 +2700,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).CoolCoilLoopSide, FanCoil(FanCoilNum).CoolCoilBranchNum, FanCoil(FanCoilNum).CoolCoilCompNum); - if (PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { + if (state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).CoolCoilLoopNum).LoopSide(FanCoil(FanCoilNum).CoolCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { ColdFlowLocked = true; // check for flow lock } if (FanCoil(FanCoilNum).HCoilType_Num == HCoil_Water) { @@ -2714,7 +2712,7 @@ namespace FanCoilUnits { FanCoil(FanCoilNum).HeatCoilLoopSide, FanCoil(FanCoilNum).HeatCoilBranchNum, FanCoil(FanCoilNum).HeatCoilCompNum); - if (PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { + if (state.dataPlnt->PlantLoop(FanCoil(FanCoilNum).HeatCoilLoopNum).LoopSide(FanCoil(FanCoilNum).HeatCoilLoopSide).FlowLock == DataPlant::iFlowLock::Locked) { HotFlowLocked = true; // save locked flow } } diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index 39b5b4f0e63..53ad8d109c9 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -735,9 +735,9 @@ namespace FluidCoolers { if (this->beginEnvrnInit && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->DesWaterMassFlowRate = this->DesignWaterFlowRate * rho; PlantUtilities::InitComponentNodes(0.0, @@ -770,7 +770,7 @@ namespace FluidCoolers { this->AirWetBulb = state.dataEnvrn->OutWetBulbTemp; } - this->WaterMassFlowRate = PlantUtilities::RegulateCondenserCompFlowReqOp( + this->WaterMassFlowRate = PlantUtilities::RegulateCondenserCompFlowReqOp(state, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, this->DesWaterMassFlowRate * this->FluidCoolerMassFlowRateMultiplier); PlantUtilities::SetComponentFlowRate(state, this->WaterMassFlowRate, @@ -827,7 +827,7 @@ namespace FluidCoolers { Real64 tmpDesignWaterFlowRate = this->DesignWaterFlowRate; Real64 tmpHighSpeedAirFlowRate = this->HighSpeedAirFlowRate; // Find the appropriate Plant Sizing object - int PltSizCondNum = DataPlant::PlantLoop(this->LoopNum).PlantSizNum; + int PltSizCondNum = state.dataPlnt->PlantLoop(this->LoopNum).PlantSizNum; if (this->DesignWaterFlowRateWasAutoSized) { if (PltSizCondNum > 0) { @@ -875,14 +875,14 @@ namespace FluidCoolers { if (this->PerformanceInputMethod_Num == PerfInputMethod::U_FACTOR && this->HighSpeedFluidCoolerUAWasAutoSized) { if (PltSizCondNum > 0) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataSizing::PlantSizData(PltSizCondNum).ExitTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; if (DataPlant::PlantFirstSizesOkayToFinalize) this->FluidCoolerNominalCapacity = DesFluidCoolerLoad; @@ -919,14 +919,14 @@ namespace FluidCoolers { ShowFatalError(state, "Review and revise design input values as appropriate."); } rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataSizing::PlantSizData(PltSizCondNum).ExitTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; tmpHighSpeedFanPower = 0.0105 * DesFluidCoolerLoad; @@ -993,14 +993,14 @@ namespace FluidCoolers { ShowFatalError(state, "Review and revise design input values as appropriate."); } rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataSizing::PlantSizData(PltSizCondNum).ExitTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; tmpHighSpeedAirFlowRate = DesFluidCoolerLoad / (this->DesignEnteringWaterTemp - this->DesignEnteringAirTemp) * 4.0; @@ -1059,14 +1059,14 @@ namespace FluidCoolers { ShowFatalError(state, "Review and revise design input values as appropriate."); } rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataSizing::PlantSizData(PltSizCondNum).ExitTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; Par(1) = DesFluidCoolerLoad; @@ -1167,14 +1167,14 @@ namespace FluidCoolers { if (this->PerformanceInputMethod_Num == PerfInputMethod::NOMINAL_CAPACITY) { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, this->DesignEnteringWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesFluidCoolerLoad = this->FluidCoolerNominalCapacity; Par(1) = DesFluidCoolerLoad; @@ -1319,14 +1319,14 @@ namespace FluidCoolers { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow && this->FluidCoolerLowSpeedNomCap > 0.0) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, this->DesignEnteringWaterTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesFluidCoolerLoad = this->FluidCoolerLowSpeedNomCap; Par(1) = DesFluidCoolerLoad; @@ -1478,11 +1478,11 @@ namespace FluidCoolers { this->FanPower = 0.0; this->OutletWaterTemp = DataLoopNode::Node(waterInletNode).Temp; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } @@ -1516,9 +1516,9 @@ namespace FluidCoolers { this->FanPower = FanPowerOn; } Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataLoopNode::Node(waterInletNode).Temp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->Qactual = this->WaterMassFlowRate * CpWater * (DataLoopNode::Node(waterInletNode).Temp - this->OutletWaterTemp); } @@ -1584,17 +1584,17 @@ namespace FluidCoolers { this->FanPower = 0.0; this->OutletWaterTemp = DataLoopNode::Node(waterInletNode).Temp; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - TempSetPoint = DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; + TempSetPoint = state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).TempSetPointHi; } } // MassFlowTol is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || - DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) return; // set local variable for fluid cooler @@ -1642,9 +1642,9 @@ namespace FluidCoolers { } } Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataLoopNode::Node(waterInletNode).Temp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->Qactual = this->WaterMassFlowRate * CpWater * (DataLoopNode::Node(waterInletNode).Temp - this->OutletWaterTemp); } @@ -1684,9 +1684,9 @@ namespace FluidCoolers { Real64 AirMassFlowRate = AirFlowRate * AirDensity; Real64 CpAir = Psychrometrics::PsyCpAirFnW(SimpleFluidCooler(FluidCoolerNum).AirHumRat); Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(SimpleFluidCooler(FluidCoolerNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(SimpleFluidCooler(FluidCoolerNum).LoopNum).FluidName, _InletWaterTemp, - DataPlant::PlantLoop(SimpleFluidCooler(FluidCoolerNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(SimpleFluidCooler(FluidCoolerNum).LoopNum).FluidIndex, RoutineName); // Calculate mass flow rates @@ -1772,7 +1772,7 @@ namespace FluidCoolers { auto &waterOutletNode = this->WaterOutletNodeNum; DataLoopNode::Node(waterOutletNode).Temp = this->OutletWaterTemp; - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked || state.dataGlobal->WarmupFlag) return; @@ -1796,7 +1796,7 @@ namespace FluidCoolers { } // Check if OutletWaterTemp is below the minimum condenser loop temp and warn user - LoopMinTemp = DataPlant::PlantLoop(this->LoopNum).MinTemp; + LoopMinTemp = state.dataPlnt->PlantLoop(this->LoopNum).MinTemp; if (this->OutletWaterTemp < LoopMinTemp && this->WaterMassFlowRate > 0.0) { ++this->OutletWaterTempErrorCount; diff --git a/src/EnergyPlus/FuelCellElectricGenerator.cc b/src/EnergyPlus/FuelCellElectricGenerator.cc index d98c96217de..02bd5bc713f 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.cc +++ b/src/EnergyPlus/FuelCellElectricGenerator.cc @@ -171,7 +171,7 @@ namespace FuelCellElectricGenerator { this->initialize(state); this->CalcFuelCellGeneratorModel(state, RunFlag, MyLoad, FirstHVACIteration); - this->CalcUpdateHeatRecovery(FirstHVACIteration); + this->CalcUpdateHeatRecovery(state, FirstHVACIteration); this->UpdateFuelCellGeneratorRecords(state); } @@ -2901,7 +2901,7 @@ namespace FuelCellElectricGenerator { this->ExhaustHX.THXexh = TprodGasIn - this->ExhaustHX.qHX / (NdotGas * CpProdGasMol * 1000.0); Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, TwaterIn, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, TwaterIn, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); if (this->ExhaustHX.WaterMassFlowRate * Cp <= 0.0) { this->ExhaustHX.WaterOutletTemp = TwaterIn; @@ -3172,7 +3172,7 @@ namespace FuelCellElectricGenerator { static std::string const RoutineName("InitFuelCellGenerators"); - if (this->MyPlantScanFlag_Init && allocated(DataPlant::PlantLoop)) { + if (this->MyPlantScanFlag_Init && allocated(state.dataPlnt->PlantLoop)) { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, @@ -3255,9 +3255,9 @@ namespace FuelCellElectricGenerator { this->Inverter.QairIntake = 0.0; Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGenerators::InitHRTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->ExhaustHX.WaterMassFlowRateDesign = this->ExhaustHX.WaterVolumeFlowMax * rho; @@ -3407,7 +3407,7 @@ namespace FuelCellElectricGenerator { } // over number of Fuel cells } - void FCDataStruct::CalcUpdateHeatRecovery([[maybe_unused]] bool const FirstHVACIteration) + void FCDataStruct::CalcUpdateHeatRecovery(EnergyPlusData &state, [[maybe_unused]] bool const FirstHVACIteration) { // SUBROUTINE INFORMATION: @@ -3421,7 +3421,7 @@ namespace FuelCellElectricGenerator { // now update water outlet node Changing to Kg/s! - PlantUtilities::SafeCopyPlantNode(this->ExhaustHX.WaterInNode, this->ExhaustHX.WaterOutNode); + PlantUtilities::SafeCopyPlantNode(state, this->ExhaustHX.WaterInNode, this->ExhaustHX.WaterOutNode); DataLoopNode::Node(this->ExhaustHX.WaterOutNode).Temp = this->ExhaustHX.WaterOutletTemp; DataLoopNode::Node(this->ExhaustHX.WaterOutNode).Enthalpy = this->ExhaustHX.WaterOutletEnthalpy; diff --git a/src/EnergyPlus/FuelCellElectricGenerator.hh b/src/EnergyPlus/FuelCellElectricGenerator.hh index 62758ac5716..918646cf050 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.hh +++ b/src/EnergyPlus/FuelCellElectricGenerator.hh @@ -590,7 +590,7 @@ namespace FuelCellElectricGenerator { void CalcFuelCellGeneratorModel(EnergyPlusData &state, bool RunFlag, Real64 MyLoad, bool FirstHVACIteration); - void CalcUpdateHeatRecovery(bool FirstHVACIteration); + void CalcUpdateHeatRecovery(EnergyPlusData &state, bool FirstHVACIteration); void ManageElectStorInteractions(EnergyPlusData &state, Real64 Pdemand, diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index f651ac4b289..7a325120fb1 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -4803,7 +4803,6 @@ namespace Furnaces { // Using/Aliasing using DataHeatBalance::Zone; using DataHeatBalFanSys::TempControlType; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterSimpleHeating; using DataSizing::AutoSize; @@ -4976,7 +4975,7 @@ namespace Furnaces { } // Scan hot water and steam heating coil plant components for one time initializations - if (MyPlantScanFlag(FurnaceNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(FurnaceNum) && allocated(state.dataPlnt->PlantLoop)) { if ((Furnace(FurnaceNum).HeatingCoilType_Num == Coil_HeatingWater) || (Furnace(FurnaceNum).HeatingCoilType_Num == Coil_HeatingSteam)) { if (Furnace(FurnaceNum).HeatingCoilType_Num == Coil_HeatingWater) { @@ -5002,9 +5001,9 @@ namespace Furnaces { GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", Furnace(FurnaceNum).HeatingCoilName, ErrorsFound); if (Furnace(FurnaceNum).MaxHeatCoilFluidFlow > 0.0) { rho = GetDensityGlycol(state, - PlantLoop(Furnace(FurnaceNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(Furnace(FurnaceNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(Furnace(FurnaceNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(Furnace(FurnaceNum).LoopNum).FluidIndex, RoutineName); Furnace(FurnaceNum).MaxHeatCoilFluidFlow *= rho; } @@ -5035,7 +5034,7 @@ namespace Furnaces { } } // fill outlet node for coil - Furnace(FurnaceNum).CoilOutletNode = PlantLoop(Furnace(FurnaceNum).LoopNum) + Furnace(FurnaceNum).CoilOutletNode = state.dataPlnt->PlantLoop(Furnace(FurnaceNum).LoopNum) .LoopSide(Furnace(FurnaceNum).LoopSide) .Branch(Furnace(FurnaceNum).BranchNum) .Comp(Furnace(FurnaceNum).CompNum) @@ -5049,7 +5048,7 @@ namespace Furnaces { } // Scan Supplemental hot water and steam heating coil plant components for one time initializations - if (MySuppCoilPlantScanFlag(FurnaceNum) && allocated(PlantLoop)) { + if (MySuppCoilPlantScanFlag(FurnaceNum) && allocated(state.dataPlnt->PlantLoop)) { if ((Furnace(FurnaceNum).SuppHeatCoilType_Num == Coil_HeatingWater) || (Furnace(FurnaceNum).SuppHeatCoilType_Num == Coil_HeatingSteam)) { if (Furnace(FurnaceNum).SuppHeatCoilType_Num == Coil_HeatingWater) { @@ -5074,9 +5073,9 @@ namespace Furnaces { GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", Furnace(FurnaceNum).SuppHeatCoilName, ErrorsFound); if (Furnace(FurnaceNum).MaxSuppCoilFluidFlow > 0.0) { rho = GetDensityGlycol(state, - PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidName, + state.dataPlnt->PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidIndex, + state.dataPlnt->PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidIndex, RoutineName); Furnace(FurnaceNum).MaxSuppCoilFluidFlow *= rho; } @@ -5106,7 +5105,7 @@ namespace Furnaces { } } // fill outlet node for coil - Furnace(FurnaceNum).SuppCoilOutletNode = PlantLoop(Furnace(FurnaceNum).LoopNumSupp) + Furnace(FurnaceNum).SuppCoilOutletNode = state.dataPlnt->PlantLoop(Furnace(FurnaceNum).LoopNumSupp) .LoopSide(Furnace(FurnaceNum).LoopSideSupp) .Branch(Furnace(FurnaceNum).BranchNumSupp) .Comp(Furnace(FurnaceNum).CompNumSupp) @@ -5147,9 +5146,9 @@ namespace Furnaces { SimulateWaterCoilComponents(state, Furnace(FurnaceNum).HeatingCoilName, FirstHVACIteration, Furnace(FurnaceNum).HeatingCoilIndex); CoilMaxVolFlowRate = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", Furnace(FurnaceNum).HeatingCoilName, ErrorsFound); if (CoilMaxVolFlowRate != AutoSize) { - rho = GetDensityGlycol(state, PlantLoop(Furnace(FurnaceNum).LoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(Furnace(FurnaceNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(Furnace(FurnaceNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(Furnace(FurnaceNum).LoopNum).FluidIndex, RoutineName); Furnace(FurnaceNum).MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * rho; } @@ -5188,9 +5187,9 @@ namespace Furnaces { CoilMaxVolFlowRate = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", Furnace(FurnaceNum).SuppHeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != AutoSize) { rho = GetDensityGlycol(state, - PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidName, + state.dataPlnt->PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidIndex, + state.dataPlnt->PlantLoop(Furnace(FurnaceNum).LoopNumSupp).FluidIndex, RoutineName); Furnace(FurnaceNum).MaxSuppCoilFluidFlow = CoilMaxVolFlowRate * rho; } diff --git a/src/EnergyPlus/GroundHeatExchangers.cc b/src/EnergyPlus/GroundHeatExchangers.cc index 0a2e0778ac0..53cdab8bf7f 100644 --- a/src/EnergyPlus/GroundHeatExchangers.cc +++ b/src/EnergyPlus/GroundHeatExchangers.cc @@ -655,7 +655,6 @@ namespace GroundHeatExchangers { void GLHEVert::calcShortTimestepGFunctions(EnergyPlusData &state) { - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -730,8 +729,8 @@ namespace GroundHeatExchangers { Real64 bh_equivalent_resistance_convection = bhResistance - bh_equivalent_resistance_tube_grout; Real64 initial_temperature = inletTemp; - Real64 cpFluid_init = GetSpecificHeatGlycol(state, PlantLoop(loopNum).FluidName, initial_temperature, PlantLoop(loopNum).FluidIndex, RoutineName); - Real64 fluidDensity_init = GetDensityGlycol(state, PlantLoop(loopNum).FluidName, initial_temperature, PlantLoop(loopNum).FluidIndex, RoutineName); + Real64 cpFluid_init = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, initial_temperature, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); + Real64 fluidDensity_init = GetDensityGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, initial_temperature, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); // initialize the fluid cells for (int i = 0; i < num_fluid_cells; ++i) { @@ -1727,7 +1726,6 @@ namespace GroundHeatExchangers { // for Vertical Ground Loop Heat Exchangers.' ASHRAE Transactions. 105(2): 475-485. // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -1775,8 +1773,8 @@ namespace GroundHeatExchangers { inletTemp = Node(inletNodeNum).Temp; - cpFluid = GetSpecificHeatGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); - fluidDensity = GetDensityGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); + cpFluid = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); + fluidDensity = GetDensityGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); kGroundFactor = 2.0 * DataGlobalConstants::Pi * soil.k; @@ -2015,7 +2013,6 @@ namespace GroundHeatExchangers { // Updates the outlet node and check for out of bounds temperatures // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -2028,16 +2025,16 @@ namespace GroundHeatExchangers { Real64 const deltaTempLimit(100.0); // temp limit for warnings Real64 GLHEdeltaTemp; // ABS(Outlet temp -inlet temp) - SafeCopyPlantNode(inletNodeNum, outletNodeNum); + SafeCopyPlantNode(state, inletNodeNum, outletNodeNum); Node(outletNodeNum).Temp = outletTemp; Node(outletNodeNum).Enthalpy = - outletTemp * GetSpecificHeatGlycol(state, PlantLoop(loopNum).FluidName, outletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); + outletTemp * GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, outletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); GLHEdeltaTemp = std::abs(outletTemp - inletTemp); if (GLHEdeltaTemp > deltaTempLimit && this->numErrorCalls < numVerticalGLHEs && !state.dataGlobal->WarmupFlag) { - fluidDensity = GetDensityGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); + fluidDensity = GetDensityGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); designMassFlow = designFlow * fluidDensity; ShowWarningError(state, "Check GLHE design inputs & g-functions for consistency"); ShowContinueError(state, "For GroundHeatExchanger: " + name + "GLHE delta Temp > 100C."); @@ -2897,8 +2894,7 @@ namespace GroundHeatExchangers { // Eq: 3-67 - using DataPlant::PlantLoop; - using FluidProperties::GetSpecificHeatGlycol; + using FluidProperties::GetSpecificHeatGlycol; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("calcBHResistance"); @@ -2906,7 +2902,7 @@ namespace GroundHeatExchangers { if (massFlowRate <= 0.0) { return 0; } else { - Real64 const cpFluid = GetSpecificHeatGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); + Real64 const cpFluid = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); return calcBHAverageResistance(state) + 1 / (3 * calcBHTotalInternalResistance(state)) * pow_2(bhLength / (massFlowRate * cpFluid)); } } @@ -2932,8 +2928,7 @@ namespace GroundHeatExchangers { // Gneilinski, V. 1976. 'New equations for heat and mass transfer in turbulent pipe and channel flow.' // International Chemical Engineering 16(1976), pp. 359-368. - using DataPlant::PlantLoop; - using FluidProperties::GetConductivityGlycol; + using FluidProperties::GetConductivityGlycol; using FluidProperties::GetSpecificHeatGlycol; using FluidProperties::GetViscosityGlycol; @@ -2943,9 +2938,9 @@ namespace GroundHeatExchangers { // Get fluid props inletTemp = Node(inletNodeNum).Temp; - Real64 const cpFluid = GetSpecificHeatGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); - Real64 const kFluid = GetConductivityGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); - Real64 const fluidViscosity = GetViscosityGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); + Real64 const cpFluid = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); + Real64 const kFluid = GetConductivityGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); + Real64 const fluidViscosity = GetViscosityGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); // Smoothing fit limits Real64 const lower_limit = 2000; @@ -3033,8 +3028,7 @@ namespace GroundHeatExchangers { // outer tube wall. // Using/Aliasing - using DataPlant::PlantLoop; - using FluidProperties::GetConductivityGlycol; + using FluidProperties::GetConductivityGlycol; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using FluidProperties::GetViscosityGlycol; @@ -3063,10 +3057,10 @@ namespace GroundHeatExchangers { Real64 laminarNusseltNo(4.364); Real64 turbulentNusseltNo; - cpFluid = GetSpecificHeatGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); - kFluid = GetConductivityGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); - fluidDensity = GetDensityGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); - fluidViscosity = GetViscosityGlycol(state, PlantLoop(loopNum).FluidName, inletTemp, PlantLoop(loopNum).FluidIndex, RoutineName); + cpFluid = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); + kFluid = GetConductivityGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); + fluidDensity = GetDensityGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); + fluidViscosity = GetViscosityGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); // calculate mass flow rate singleSlinkyMassFlowRate = massFlowRate / numTrenches; @@ -3287,8 +3281,7 @@ namespace GroundHeatExchangers { // na // Using/Aliasing - using DataPlant::PlantLoop; - using DataPlant::TypeOf_GrndHtExchgSystem; + using DataPlant::TypeOf_GrndHtExchgSystem; using FluidProperties::GetDensityGlycol; using PlantUtilities::InitComponentNodes; using PlantUtilities::RegulateCondenserCompFlowReqOp; @@ -3328,7 +3321,7 @@ namespace GroundHeatExchangers { myEnvrnFlag = false; - fluidDensity = GetDensityGlycol(state, PlantLoop(loopNum).FluidName, 20.0, PlantLoop(loopNum).FluidIndex, RoutineName); + fluidDensity = GetDensityGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, 20.0, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); designMassFlow = designFlow * fluidDensity; InitComponentNodes(0.0, designMassFlow, inletNodeNum, outletNodeNum, loopNum, loopSideNum, branchNum, compNum); @@ -3366,7 +3359,7 @@ namespace GroundHeatExchangers { tempGround /= 5; - massFlowRate = RegulateCondenserCompFlowReqOp(loopNum, loopSideNum, branchNum, compNum, designMassFlow); + massFlowRate = RegulateCondenserCompFlowReqOp(state, loopNum, loopSideNum, branchNum, compNum, designMassFlow); SetComponentFlowRate(state, massFlowRate, inletNodeNum, outletNodeNum, loopNum, loopSideNum, branchNum, compNum); @@ -3394,8 +3387,7 @@ namespace GroundHeatExchangers { // na // Using/Aliasing - using DataPlant::PlantLoop; - using DataPlant::TypeOf_GrndHtExchgSlinky; + using DataPlant::TypeOf_GrndHtExchgSlinky; using FluidProperties::GetDensityGlycol; using PlantUtilities::InitComponentNodes; using PlantUtilities::RegulateCondenserCompFlowReqOp; @@ -3437,7 +3429,7 @@ namespace GroundHeatExchangers { myEnvrnFlag = false; - fluidDensity = GetDensityGlycol(state, PlantLoop(loopNum).FluidName, 20.0, PlantLoop(loopNum).FluidIndex, RoutineName); + fluidDensity = GetDensityGlycol(state, state.dataPlnt->PlantLoop(loopNum).FluidName, 20.0, state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); designMassFlow = designFlow * fluidDensity; InitComponentNodes(0.0, designMassFlow, inletNodeNum, outletNodeNum, loopNum, loopSideNum, branchNum, compNum); @@ -3459,7 +3451,7 @@ namespace GroundHeatExchangers { tempGround = this->groundTempModel->getGroundTempAtTimeInSeconds(state, coilDepth, CurTime); - massFlowRate = RegulateCondenserCompFlowReqOp(loopNum, loopSideNum, branchNum, compNum, designMassFlow); + massFlowRate = RegulateCondenserCompFlowReqOp(state, loopNum, loopSideNum, branchNum, compNum, designMassFlow); SetComponentFlowRate(state, massFlowRate, inletNodeNum, outletNodeNum, loopNum, loopSideNum, branchNum, compNum); diff --git a/src/EnergyPlus/HVACControllers.cc b/src/EnergyPlus/HVACControllers.cc index 73aff1bd603..6b4743576dd 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -301,7 +301,6 @@ namespace HVACControllers { // Using/Aliasing using namespace DataSystemVariables; - using DataPlant::PlantLoop; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -367,7 +366,7 @@ namespace HVACControllers { // detect if plant is locked and flow cannot change if (ControllerProps(ControlNum).ActuatedNodePlantLoopNum > 0) { - if (PlantLoop(ControllerProps(ControlNum).ActuatedNodePlantLoopNum) + if (state.dataPlnt->PlantLoop(ControllerProps(ControlNum).ActuatedNodePlantLoopNum) .LoopSide(ControllerProps(ControlNum).ActuatedNodePlantLoopSide) .FlowLock == DataPlant::iFlowLock::Locked) { // plant is rigid so controller cannot change anything. @@ -931,7 +930,6 @@ namespace HVACControllers { // Uses the status flags to trigger events. using DataHVACGlobals::DoSetPointTest; - using DataPlant::PlantLoop; using EMSManager::CheckIfNodeSetPointManagedByEMS; using FaultsManager::FaultsCoilSATSensor; using FluidProperties::GetDensityGlycol; @@ -1117,7 +1115,7 @@ namespace HVACControllers { InitControllerSetPointCheckFlag = false; } - if (allocated(PlantLoop) && MyPlantIndexsFlag(ControlNum)) { + if (allocated(state.dataPlnt->PlantLoop) && MyPlantIndexsFlag(ControlNum)) { ScanPlantLoopsForNodeNum(state, ControllerProps(ControlNum).ControllerName, ControllerProps(ControlNum).ActuatedNode, @@ -1179,9 +1177,9 @@ namespace HVACControllers { if (state.dataGlobal->BeginEnvrnFlag && MyEnvrnFlag(ControlNum)) { rho = GetDensityGlycol(state, - PlantLoop(ControllerProps(ControlNum).ActuatedNodePlantLoopNum).FluidName, + state.dataPlnt->PlantLoop(ControllerProps(ControlNum).ActuatedNodePlantLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(ControllerProps(ControlNum).ActuatedNodePlantLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(ControllerProps(ControlNum).ActuatedNodePlantLoopNum).FluidIndex, RoutineName); ControllerProps(ControlNum).MinActuated = rho * ControllerProps(ControlNum).MinVolFlowActuated; diff --git a/src/EnergyPlus/HVACCooledBeam.cc b/src/EnergyPlus/HVACCooledBeam.cc index a995c2915c2..2986d47a6ff 100644 --- a/src/EnergyPlus/HVACCooledBeam.cc +++ b/src/EnergyPlus/HVACCooledBeam.cc @@ -517,7 +517,6 @@ namespace HVACCooledBeam { // Uses the status flags to trigger initializations. // Using/Aliasing - using DataPlant::PlantLoop; using DataPlant::TypeOf_CooledBeamAirTerminal; using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::ZoneEquipInputsFilled; @@ -542,7 +541,7 @@ namespace HVACCooledBeam { CurrentModuleObject = "AirTerminal:SingleDuct:ConstantVolume:CooledBeam"; - if (CoolBeam(CBNum).PlantLoopScanFlag && allocated(PlantLoop)) { + if (CoolBeam(CBNum).PlantLoopScanFlag && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject(state, CoolBeam(CBNum).Name, @@ -581,9 +580,9 @@ namespace HVACCooledBeam { InWaterNode = CoolBeam(CBNum).CWInNode; OutWaterNode = CoolBeam(CBNum).CWOutNode; - rho = GetDensityGlycol(state, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); CoolBeam(CBNum).MaxCoolWaterMassFlow = rho * CoolBeam(CBNum).MaxCoolWaterVolFlow; InitComponentNodes(0.0, @@ -687,7 +686,6 @@ namespace HVACCooledBeam { // Using/Aliasing using namespace DataSizing; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::MyPlantSizingIndex; @@ -775,15 +773,15 @@ namespace HVACCooledBeam { } rho = GetDensityGlycol(state, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); CoolBeam(CBNum).MaxCoolWaterVolFlow = @@ -810,9 +808,9 @@ namespace HVACCooledBeam { if (CoolBeam(CBNum).NumBeams == AutoSize) { rho = GetDensityGlycol(state, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); NumBeams = int(CoolBeam(CBNum).MaxCoolWaterVolFlow * rho / NomMassFlowPerBeam) + 1; @@ -828,15 +826,15 @@ namespace HVACCooledBeam { if (PltSizCoolNum > 0) { rho = GetDensityGlycol(state, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); DesCoilLoad = CoolBeam(CBNum).MaxCoolWaterVolFlow * (CoolBeam(CBNum).DesOutletWaterTemp - CoolBeam(CBNum).DesInletWaterTemp) * Cp * rho; @@ -1077,7 +1075,6 @@ namespace HVACCooledBeam { // na // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::SetComponentFlowRate; @@ -1128,9 +1125,9 @@ namespace HVACCooledBeam { TWIn = CoolBeam(CBNum).TWIn; Cp = - GetSpecificHeatGlycol(state, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, TWIn, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); + GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, TWIn, state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); - rho = GetDensityGlycol(state, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, TWIn, PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidName, TWIn, state.dataPlnt->PlantLoop(CoolBeam(CBNum).CWLoopNum).FluidIndex, RoutineName); TWOut = TWIn + 2.0; ZTemp = Node(ZoneNode).Temp; @@ -1277,7 +1274,7 @@ namespace HVACCooledBeam { // Set the outlet water nodes for the unit // Node(WaterOutletNode)%MassFlowRate = CoolBeam(CBNum)%CoolWaterMassFlow - SafeCopyPlantNode(WaterInletNode, WaterOutletNode); + SafeCopyPlantNode(state, WaterInletNode, WaterOutletNode); Node(WaterOutletNode).Temp = CoolBeam(CBNum).TWOut; Node(WaterOutletNode).Enthalpy = CoolBeam(CBNum).EnthWaterOut; diff --git a/src/EnergyPlus/HVACFourPipeBeam.cc b/src/EnergyPlus/HVACFourPipeBeam.cc index 9a00f4f661d..576bf29606f 100644 --- a/src/EnergyPlus/HVACFourPipeBeam.cc +++ b/src/EnergyPlus/HVACFourPipeBeam.cc @@ -524,7 +524,6 @@ namespace FourPipeBeam { // Using using DataLoopNode::Node; - using DataPlant::PlantLoop; using DataPlant::TypeOf_FourPipeBeamAirTerminal; using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::ZoneEquipInputsFilled; @@ -537,7 +536,7 @@ namespace FourPipeBeam { bool errFlag = false; - if (this->plantLoopScanFlag && allocated(PlantLoop)) { + if (this->plantLoopScanFlag && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; if (this->beamCoolingPresent) { ScanPlantLoopsForObject(state, @@ -724,7 +723,6 @@ namespace FourPipeBeam { // Using using namespace DataSizing; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::MyPlantSizingIndex; @@ -948,9 +946,9 @@ namespace FourPipeBeam { if (this->beamCoolingPresent) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->cWLocation.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->cWLocation.loopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->cWLocation.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->cWLocation.loopNum).FluidIndex, routineName); this->mDotNormRatedCW = this->vDotNormRatedCW * rho; this->mDotDesignCW = this->vDotDesignCW * rho; @@ -965,9 +963,9 @@ namespace FourPipeBeam { } if (this->beamHeatingPresent) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->hWLocation.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->hWLocation.loopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->hWLocation.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->hWLocation.loopNum).FluidIndex, routineName); this->mDotNormRatedHW = this->vDotNormRatedHW * rho; this->mDotDesignHW = this->vDotDesignHW * rho; @@ -1023,9 +1021,9 @@ namespace FourPipeBeam { if (this->vDotDesignCWWasAutosized) { this->vDotDesignCW = this->vDotNormRatedCW * this->totBeamLength; rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->cWLocation.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->cWLocation.loopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->cWLocation.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->cWLocation.loopNum).FluidIndex, routineName); this->mDotNormRatedCW = this->vDotNormRatedCW * rho; this->mDotCW = this->vDotDesignCW * rho; @@ -1043,9 +1041,9 @@ namespace FourPipeBeam { if (vDotDesignHWWasAutosized) { this->vDotDesignHW = this->vDotNormRatedHW * this->totBeamLength; rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->hWLocation.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->hWLocation.loopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->hWLocation.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->hWLocation.loopNum).FluidIndex, routineName); this->mDotNormRatedHW = this->vDotNormRatedHW * rho; this->mDotHW = this->vDotDesignHW * rho; @@ -1268,7 +1266,6 @@ namespace FourPipeBeam { { // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::SetComponentFlowRate; @@ -1315,7 +1312,7 @@ namespace FourPipeBeam { ((this->mDotSystemAir / this->totBeamLength) / this->mDotNormRatedPrimAir)); this->qDotBeamCooling = -1.0 * this->qDotNormRatedCooling * fModCoolDeltaT * fModCoolAirMdot * fModCoolCWMdot * this->totBeamLength; cp = GetSpecificHeatGlycol(state, - PlantLoop(this->cWLocation.loopNum).FluidName, this->cWTempIn, PlantLoop(this->cWLocation.loopNum).FluidIndex, routineName); + state.dataPlnt->PlantLoop(this->cWLocation.loopNum).FluidName, this->cWTempIn, state.dataPlnt->PlantLoop(this->cWLocation.loopNum).FluidIndex, routineName); if (this->mDotCW > 0.0) { this->cWTempOut = this->cWTempIn - (this->qDotBeamCooling / (this->mDotCW * cp)); } else { @@ -1364,7 +1361,7 @@ namespace FourPipeBeam { ((this->mDotSystemAir / this->totBeamLength) / this->mDotNormRatedPrimAir)); this->qDotBeamHeating = this->qDotNormRatedHeating * fModHeatDeltaT * fModHeatAirMdot * fModHeatHWMdot * this->totBeamLength; cp = GetSpecificHeatGlycol(state, - PlantLoop(this->hWLocation.loopNum).FluidName, this->hWTempIn, PlantLoop(this->hWLocation.loopNum).FluidIndex, routineName); + state.dataPlnt->PlantLoop(this->hWLocation.loopNum).FluidName, this->hWTempIn, state.dataPlnt->PlantLoop(this->hWLocation.loopNum).FluidIndex, routineName); if (this->mDotHW > 0.0) { this->hWTempOut = this->hWTempIn - (this->qDotBeamHeating / (this->mDotHW * cp)); } else { @@ -1459,11 +1456,11 @@ namespace FourPipeBeam { // Set the outlet water nodes for the unit if (this->beamCoolingPresent) { - SafeCopyPlantNode(this->cWInNodeNum, this->cWOutNodeNum); + SafeCopyPlantNode(state, this->cWInNodeNum, this->cWOutNodeNum); DataLoopNode::Node(this->cWOutNodeNum).Temp = this->cWTempOut; } if (this->beamHeatingPresent) { - SafeCopyPlantNode(this->hWInNodeNum, this->hWOutNodeNum); + SafeCopyPlantNode(state, this->hWInNodeNum, this->hWOutNodeNum); DataLoopNode::Node(this->hWOutNodeNum).Temp = this->hWTempOut; } } diff --git a/src/EnergyPlus/HVACInterfaceManager.cc b/src/EnergyPlus/HVACInterfaceManager.cc index e5736c9730f..2c3dc16ee8b 100644 --- a/src/EnergyPlus/HVACInterfaceManager.cc +++ b/src/EnergyPlus/HVACInterfaceManager.cc @@ -429,7 +429,6 @@ namespace HVACInterfaceManager { // Using/Aliasing using DataLoopNode::Node; using DataPlant::DemandSide; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; // Locals @@ -461,14 +460,14 @@ namespace HVACInterfaceManager { convergence.PlantTempNotConverged = false; // set the LoopSide inlet node - ThisLoopSideInletNode = PlantLoop(LoopNum).LoopSide(ThisLoopSideNum).NodeNumIn; + ThisLoopSideInletNode = state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSideNum).NodeNumIn; // save the inlet node temp for DeltaEnergy check OldOtherLoopSideInletMdot = Node(OtherLoopSideInletNode).MassFlowRate; OldTankOutletTemp = Node(OtherLoopSideInletNode).Temp; // calculate the specific heat - Cp = GetSpecificHeatGlycol(state, PlantLoop(LoopNum).FluidName, OldTankOutletTemp, PlantLoop(LoopNum).FluidIndex, RoutineName); + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, OldTankOutletTemp, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); // update the enthalpy Node(OtherLoopSideInletNode).Enthalpy = Cp * Node(OtherLoopSideInletNode).Temp; @@ -527,7 +526,7 @@ namespace HVACInterfaceManager { // update Quality. DSU? Note: This update assumes that STEAM cannot be used with common pipes. Node(OtherLoopSideInletNode).Quality = Node(ThisLoopSideOutletNode).Quality; // pressure update DSU? Note: This update assumes that PRESSURE SIMULATION cannot be used with common pipes. - if (PlantLoop(LoopNum).HasPressureComponents) { + if (state.dataPlnt->PlantLoop(LoopNum).HasPressureComponents) { // Don't update pressure, let the pressure simulation handle pressures } else { // Do update pressure! @@ -600,7 +599,6 @@ namespace HVACInterfaceManager { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; // Locals @@ -636,23 +634,23 @@ namespace HVACInterfaceManager { // find tank inlet and outlet nodes TankOutletLoopSide = 3 - TankInletLoopSide; - TankInletNode = PlantLoop(LoopNum).LoopSide(TankInletLoopSide).NodeNumOut; - TankOutletNode = PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).NodeNumIn; + TankInletNode = state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankInletLoopSide).NodeNumOut; + TankOutletNode = state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).NodeNumIn; TankInletTemp = Node(TankInletNode).Temp; // This needs to be based on time to deal with system downstepping and repeated timesteps TimeElapsed = (state.dataGlobal->HourOfDay - 1) + state.dataGlobal->TimeStep * state.dataGlobal->TimeStepZone + SysTimeElapsed; - if (PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TimeElapsed != TimeElapsed) { - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LastTempInterfaceTankOutlet = - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TempInterfaceTankOutlet; - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TimeElapsed = TimeElapsed; + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TimeElapsed != TimeElapsed) { + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LastTempInterfaceTankOutlet = + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TempInterfaceTankOutlet; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TimeElapsed = TimeElapsed; } - LastTankOutletTemp = PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LastTempInterfaceTankOutlet; + LastTankOutletTemp = state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LastTempInterfaceTankOutlet; // calculate the specific heat for the capacitance calculation - Cp = GetSpecificHeatGlycol(state, PlantLoop(LoopNum).FluidName, LastTankOutletTemp, PlantLoop(LoopNum).FluidIndex, RoutineName); + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, LastTankOutletTemp, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); // set the fraction of loop mass assigned to each half loop outlet capacitance ('tank') calculation // calculate new loop inlet temperature. The calculation is a simple 'tank' (thermal capacitance) calculation that includes: @@ -665,8 +663,8 @@ namespace HVACInterfaceManager { TimeStepSeconds = TimeStepSys * DataGlobalConstants::SecInHour; MassFlowRate = Node(TankInletNode).MassFlowRate; - PumpHeat = PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TotalPumpHeat; - ThisTankMass = FracTotLoopMass * PlantLoop(LoopNum).Mass; + PumpHeat = state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TotalPumpHeat; + ThisTankMass = FracTotLoopMass * state.dataPlnt->PlantLoop(LoopNum).Mass; if (ThisTankMass <= 0.0) { // no mass, no plant loop volume if (MassFlowRate > 0.0) { @@ -703,25 +701,25 @@ namespace HVACInterfaceManager { } // update last tank outlet temperature - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TempInterfaceTankOutlet = TankFinalTemp; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TempInterfaceTankOutlet = TankFinalTemp; // update heat trasport and heat storage rates - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_MdotCpDeltaT = (TankInletTemp - TankFinalTemp) * Cp * MassFlowRate; - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_McpDTdt = + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_MdotCpDeltaT = (TankInletTemp - TankFinalTemp) * Cp * MassFlowRate; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_McpDTdt = (ThisTankMass * Cp * (TankFinalTemp - LastTankOutletTemp)) / TimeStepSeconds; // Determine excessive storage - if (PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_MdotCpDeltaT < - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_McpDTdt) { - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_CapExcessStorageTimeReport = TimeStepSys; - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_CapExcessStorageTime += TimeStepSys; + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_MdotCpDeltaT < + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_McpDTdt) { + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_CapExcessStorageTimeReport = TimeStepSys; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_CapExcessStorageTime += TimeStepSys; } else { - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_CapExcessStorageTimeReport = 0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_CapExcessStorageTimeReport = 0; } - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_TotalTime += TimeStepSys; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_TotalTime += TimeStepSys; // update report variable - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_TankTemp = TankAverageTemp; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_TankTemp = TankAverageTemp; TankOutletTemp = TankAverageTemp; } @@ -765,7 +763,6 @@ namespace HVACInterfaceManager { using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; using DataPlant::DemandSide; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; // Locals @@ -803,8 +800,8 @@ namespace HVACInterfaceManager { // find tank inlet and outlet nodes TankOutletLoopSide = 3 - TankInletLoopSide; - TankInletNode = PlantLoop(LoopNum).LoopSide(TankInletLoopSide).NodeNumOut; - TankOutletNode = PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).NodeNumIn; + TankInletNode = state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankInletLoopSide).NodeNumOut; + TankOutletNode = state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).NodeNumIn; TankInletTemp = Node(TankInletNode).Temp; @@ -817,16 +814,16 @@ namespace HVACInterfaceManager { // This needs to be based on time to deal with system downstepping and repeated timesteps TimeElapsed = (state.dataGlobal->HourOfDay - 1) + state.dataGlobal->TimeStep * state.dataGlobal->TimeStepZone + SysTimeElapsed; - if (PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TimeElapsed != TimeElapsed) { - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LastTempInterfaceTankOutlet = - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TempInterfaceTankOutlet; - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TimeElapsed = TimeElapsed; + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TimeElapsed != TimeElapsed) { + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LastTempInterfaceTankOutlet = + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TempInterfaceTankOutlet; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TimeElapsed = TimeElapsed; } - LastTankOutletTemp = PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LastTempInterfaceTankOutlet; + LastTankOutletTemp = state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LastTempInterfaceTankOutlet; // calculate the specific heat for the capacitance calculation - Cp = GetSpecificHeatGlycol(state, PlantLoop(LoopNum).FluidName, LastTankOutletTemp, PlantLoop(LoopNum).FluidIndex, RoutineName); + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, LastTankOutletTemp, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); // set the fraction of loop mass assigned to each half loop outlet capacitance ('tank') calculation @@ -842,8 +839,8 @@ namespace HVACInterfaceManager { // The pump heat source is swapped around here compared to no common pipe (so pump heat sort stays on its own side). TimeStepSeconds = TimeStepSys * DataGlobalConstants::SecInHour; MassFlowRate = Node(TankInletNode).MassFlowRate; - PumpHeat = PlantLoop(LoopNum).LoopSide(TankInletLoopSide).TotalPumpHeat; - ThisTankMass = FracTotLoopMass * PlantLoop(LoopNum).Mass; + PumpHeat = state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankInletLoopSide).TotalPumpHeat; + ThisTankMass = FracTotLoopMass * state.dataPlnt->PlantLoop(LoopNum).Mass; if (ThisTankMass <= 0.0) { // no mass, no plant loop volume if (MassFlowRate > 0.0) { @@ -879,9 +876,9 @@ namespace HVACInterfaceManager { MixedOutletTemp = Node(TankOutletNode).Temp; } - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TempInterfaceTankOutlet = TankFinalTemp; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).TempInterfaceTankOutlet = TankFinalTemp; - PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_TankTemp = TankAverageTemp; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(TankOutletLoopSide).LoopSideInlet_TankTemp = TankAverageTemp; } void ManageSingleCommonPipe(EnergyPlusData &state, @@ -945,10 +942,10 @@ namespace HVACInterfaceManager { } // fill local node indexes - NodeNumPriIn = PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn; - NodeNumPriOut = PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumOut; - NodeNumSecIn = PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn; - NodeNumSecOut = PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumOut; + NodeNumPriIn = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn; + NodeNumPriOut = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumOut; + NodeNumSecIn = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn; + NodeNumSecOut = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumOut; if (MyEnvrnFlag(LoopNum) && state.dataGlobal->BeginEnvrnFlag) { PlantCommonPipe(LoopNum).Flow = 0.0; @@ -966,10 +963,10 @@ namespace HVACInterfaceManager { if (LoopSide == SupplySide) { TempSecOutTankOut = TankOutletTemp; - TempPriOutTankOut = PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TankTemp; + TempPriOutTankOut = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TankTemp; } else { TempPriOutTankOut = TankOutletTemp; - TempSecOutTankOut = PlantLoop(LoopNum).LoopSide(SupplySide).LoopSideInlet_TankTemp; + TempSecOutTankOut = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).LoopSideInlet_TankTemp; } // first do mass balances and find common pipe flow rate and direction @@ -1050,7 +1047,6 @@ namespace HVACInterfaceManager { using DataLoopNode::Node; using DataPlant::DeltaTempTol; using DataPlant::DemandSide; - using DataPlant::PlantLoop; using DataPlant::SupplySide; using DataPlant::TotNumLoops; using PlantUtilities::SetActuatedBranchFlowRate; @@ -1106,10 +1102,10 @@ namespace HVACInterfaceManager { } // fill local node indexes - NodeNumPriIn = PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn; - NodeNumPriOut = PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumOut; - NodeNumSecIn = PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn; - NodeNumSecOut = PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumOut; + NodeNumPriIn = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn; + NodeNumPriOut = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumOut; + NodeNumSecIn = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn; + NodeNumSecOut = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumOut; // begin environment inits if (MyEnvrnFlag(LoopNum) && state.dataGlobal->BeginEnvrnFlag) { @@ -1139,10 +1135,10 @@ namespace HVACInterfaceManager { if (LoopSide == SupplySide) { TempSecOutTankOut = TankOutletTemp; - TempPriOutTankOut = PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TankTemp; + TempPriOutTankOut = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TankTemp; } else { TempPriOutTankOut = TankOutletTemp; - TempSecOutTankOut = PlantLoop(LoopNum).LoopSide(SupplySide).LoopSideInlet_TankTemp; + TempSecOutTankOut = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).LoopSideInlet_TankTemp; } // determine current case @@ -1150,17 +1146,17 @@ namespace HVACInterfaceManager { // commonpipe control point is the inlet of one of the half loops CurCallingCase = 0; if (LoopSide == SupplySide) { // update primary inlet - if (PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt && !PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt && !state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { CurCallingCase = SupplyLedPrimaryInletUpdate; - } else if (!PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt && PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { + } else if (!state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt && state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { CurCallingCase = DemandLedPrimaryInletUpdate; } } else { // update secondary inlet - if (PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt && !PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt && !state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { CurCallingCase = SupplyLedSecondaryInletUpdate; - } else if (!PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt && PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { + } else if (!state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt && state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { CurCallingCase = DemandLedSecondaryInletUpdate; } } @@ -1327,11 +1323,11 @@ namespace HVACInterfaceManager { for (CurLoopNum = 1; CurLoopNum <= TotNumLoops; ++CurLoopNum) { // reference to easily lookup the first item once - auto &first_demand_component_typenum(PlantLoop(CurLoopNum).LoopSide(DemandSide).Branch(1).Comp(1).TypeOf_Num); - auto &first_supply_component_typenum(PlantLoop(CurLoopNum).LoopSide(SupplySide).Branch(1).Comp(1).TypeOf_Num); + auto &first_demand_component_typenum(state.dataPlnt->PlantLoop(CurLoopNum).LoopSide(DemandSide).Branch(1).Comp(1).TypeOf_Num); + auto &first_supply_component_typenum(state.dataPlnt->PlantLoop(CurLoopNum).LoopSide(SupplySide).Branch(1).Comp(1).TypeOf_Num); { - auto const SELECT_CASE_var(PlantLoop(CurLoopNum).CommonPipeType); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(CurLoopNum).CommonPipeType); if (SELECT_CASE_var == DataPlant::iCommonPipeType::No) { PlantCommonPipe(CurLoopNum).CommonPipeType = DataPlant::iCommonPipeType::No; @@ -1342,24 +1338,24 @@ namespace HVACInterfaceManager { PlantCommonPipe(CurLoopNum).Flow, "System", "Average", - PlantLoop(CurLoopNum).Name); + state.dataPlnt->PlantLoop(CurLoopNum).Name); SetupOutputVariable(state, "Plant Common Pipe Temperature", OutputProcessor::Unit::C, PlantCommonPipe(CurLoopNum).Temp, "System", "Average", - PlantLoop(CurLoopNum).Name); + state.dataPlnt->PlantLoop(CurLoopNum).Name); SetupOutputVariable(state, "Plant Common Pipe Flow Direction Status", OutputProcessor::Unit::None, PlantCommonPipe(CurLoopNum).FlowDir, "System", "Average", - PlantLoop(CurLoopNum).Name); + state.dataPlnt->PlantLoop(CurLoopNum).Name); if (first_supply_component_typenum == TypeOf_PumpVariableSpeed) { // If/when the model supports variable-pumping primary, this can be removed. ShowWarningError(state, "SetupCommonPipes: detected variable speed pump on supply inlet of CommonPipe plant loop"); - ShowContinueError(state, "Occurs on plant loop name = " + PlantLoop(CurLoopNum).Name); + ShowContinueError(state, "Occurs on plant loop name = " + state.dataPlnt->PlantLoop(CurLoopNum).Name); ShowContinueError(state, "The common pipe model does not support varying the flow rate on the primary/supply side"); ShowContinueError(state, "The primary/supply side will operate as if constant speed, and the simulation continues"); } @@ -1371,25 +1367,25 @@ namespace HVACInterfaceManager { PlantCommonPipe(CurLoopNum).PriCPLegFlow, "System", "Average", - PlantLoop(CurLoopNum).Name); + state.dataPlnt->PlantLoop(CurLoopNum).Name); SetupOutputVariable(state, "Plant Common Pipe Secondary Mass Flow Rate", OutputProcessor::Unit::kg_s, PlantCommonPipe(CurLoopNum).SecCPLegFlow, "System", "Average", - PlantLoop(CurLoopNum).Name); + state.dataPlnt->PlantLoop(CurLoopNum).Name); SetupOutputVariable(state, "Plant Common Pipe Primary to Secondary Mass Flow Rate", OutputProcessor::Unit::kg_s, PlantCommonPipe(CurLoopNum).PriToSecFlow, "System", "Average", - PlantLoop(CurLoopNum).Name); + state.dataPlnt->PlantLoop(CurLoopNum).Name); SetupOutputVariable(state, "Plant Common Pipe Secondary to Primary Mass Flow Rate", OutputProcessor::Unit::kg_s, PlantCommonPipe(CurLoopNum).SecToPriFlow, "System", "Average", - PlantLoop(CurLoopNum).Name); + state.dataPlnt->PlantLoop(CurLoopNum).Name); // check type of pump on supply side inlet if (first_supply_component_typenum == TypeOf_PumpConstantSpeed) { @@ -1398,7 +1394,7 @@ namespace HVACInterfaceManager { PlantCommonPipe(CurLoopNum).SupplySideInletPumpType = VariableFlow; // If/when the model supports variable-pumping primary, this can be removed. ShowWarningError(state, "SetupCommonPipes: detected variable speed pump on supply inlet of TwoWayCommonPipe plant loop"); - ShowContinueError(state, "Occurs on plant loop name = " + PlantLoop(CurLoopNum).Name); + ShowContinueError(state, "Occurs on plant loop name = " + state.dataPlnt->PlantLoop(CurLoopNum).Name); ShowContinueError(state, "The common pipe model does not support varying the flow rate on the primary/supply side"); ShowContinueError(state, "The primary/supply side will operate as if constant speed, and the simulation continues"); } diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index 2b79eaf5d3b..b27b312e03e 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -655,7 +655,6 @@ namespace HVACManager { using DataPlant::ConvergenceHistoryARR; using DataPlant::DemandSide; using DataPlant::NumConvergenceHistoryTerms; - using DataPlant::PlantLoop; using DataPlant::PlantManageHalfLoopCalls; using DataPlant::PlantManageSubIterations; using DataPlant::square_sum_ConvergenceHistoryARR; @@ -760,7 +759,7 @@ namespace HVACManager { HVACManageIteration = 0; PlantManageSubIterations = 0; PlantManageHalfLoopCalls = 0; - SetAllPlantSimFlagsToValue(true); + SetAllPlantSimFlagsToValue(state, true); if (!SimHVACIterSetup) { SetupOutputVariable(state, "HVAC System Solver Iteration Count", OutputProcessor::Unit::None, HVACManageIteration, "HVAC", "Sum", "SimHVAC"); SetupOutputVariable(state, "Air System Solver Iteration Count", OutputProcessor::Unit::None, RepIterAir, "HVAC", "Sum", "SimHVAC"); @@ -794,7 +793,7 @@ namespace HVACManager { "Plant Solver Half Loop Calls Count", OutputProcessor::Unit::None, PlantManageHalfLoopCalls, "HVAC", "Sum", "SimHVAC"); for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { // init plant sizing numbers in main plant data structure - InitOneTimePlantSizingInfo(LoopNum); + InitOneTimePlantSizingInfo(state, LoopNum); } } SimHVACIterSetup = true; @@ -846,7 +845,7 @@ namespace HVACManager { // simulation has converged for this system time step. SimPlantLoopsFlag = true; - SetAllPlantSimFlagsToValue(true); // set so loop to simulate at least once on non-first hvac + SetAllPlantSimFlagsToValue(state, true); // set so loop to simulate at least once on non-first hvac FirstHVACIteration = false; @@ -888,7 +887,7 @@ namespace HVACManager { } } if (state.dataGlobal->AnyPlantInModel) { - if (AnyPlantSplitterMixerLacksContinuity()) { + if (AnyPlantSplitterMixerLacksContinuity(state)) { // rerun systems in a "Final flow lock/last iteration" mode // now call for one second to last plant simulation SimAirLoopsFlag = false; @@ -1331,7 +1330,7 @@ namespace HVACManager { for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { if (state.dataConvergeParams->PlantConvergence(LoopNum).PlantMassFlowNotConverged) { - ShowContinueError(state, "Plant System Named = " + PlantLoop(LoopNum).Name + " did not converge for mass flow rate"); + ShowContinueError(state, "Plant System Named = " + state.dataPlnt->PlantLoop(LoopNum).Name + " did not converge for mass flow rate"); ShowContinueError(state, "Check values should be zero. Most Recent values listed first."); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= DataConvergParams::ConvergLogStackDepth; ++StackDepth) { @@ -1345,42 +1344,42 @@ namespace HVACManager { ShowContinueError(state, "Supply-to-Demand interface mass flow rate check value iteration history trace: " + HistoryTrace); // now work with history logs for mass flow to detect issues - for (ThisLoopSide = 1; ThisLoopSide <= isize(PlantLoop(LoopNum).LoopSide); ++ThisLoopSide) { + for (ThisLoopSide = 1; ThisLoopSide <= isize(state.dataPlnt->PlantLoop(LoopNum).LoopSide); ++ThisLoopSide) { // loop side inlet node FoundOscillationByDuplicate = false; MonotonicDecreaseFound = false; MonotonicIncreaseFound = false; AvgValue = - sum(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory) / double(NumConvergenceHistoryTerms); - if (std::abs(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(1) - AvgValue) > + sum(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory) / double(NumConvergenceHistoryTerms); + if (std::abs(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(1) - AvgValue) > DataConvergParams::PlantFlowRateOscillationToler) { FoundOscillationByDuplicate = false; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (std::abs(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(1) - - PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth)) < + if (std::abs(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(1) - + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth)) < DataConvergParams::PlantFlowRateOscillationToler) { FoundOscillationByDuplicate = true; ShowContinueError( state, format("Node named {} shows oscillating flow rates across iterations with a repeated value of {:.7R}", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, - PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(1))); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(1))); break; } } } if (!FoundOscillationByDuplicate) { SlopeMdot = - (sum_ConvergenceHistoryARR * sum(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory) - + (sum_ConvergenceHistoryARR * sum(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory) - double(NumConvergenceHistoryTerms) * - sum((ConvergenceHistoryARR * PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory))) / + sum((ConvergenceHistoryARR * state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory))) / (square_sum_ConvergenceHistoryARR - double(NumConvergenceHistoryTerms) * sum_square_ConvergenceHistoryARR); if (std::abs(SlopeMdot) > DataConvergParams::PlantFlowRateSlopeToler) { if (SlopeMdot < 0.0) { // check for monotonic decrease MonotonicDecreaseFound = true; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth - 1) > - PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth)) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth - 1) > + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth)) { MonotonicDecreaseFound = false; break; } @@ -1389,14 +1388,14 @@ namespace HVACManager { ShowContinueError(state, format("Node named {} shows monotonically decreasing mass flow rate with a trend " "rate across iterations of {:.7R} [kg/s/iteration]", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, SlopeMdot)); } } else { // check for monotonic incrase MonotonicIncreaseFound = true; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth - 1) < - PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth)) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth - 1) < + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth)) { MonotonicIncreaseFound = false; break; } @@ -1405,7 +1404,7 @@ namespace HVACManager { ShowContinueError(state, format("Node named {} shows monotonically increasing mass flow rate with a trend " "rate across iterations of {:.7R} [kg/s/iteration]", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, SlopeMdot)); } } @@ -1416,9 +1415,9 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { HistoryTrace += - format("{:.7R},", PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth)); + format("{:.7R},", state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.MassFlowRateHistory(StackDepth)); } - ShowContinueError(state, "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + + ShowContinueError(state, "Node named " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + " mass flow rate [kg/s] iteration history trace (most recent first): " + HistoryTrace); } // need to report trace // end of inlet node @@ -1427,38 +1426,38 @@ namespace HVACManager { FoundOscillationByDuplicate = false; MonotonicDecreaseFound = false; MonotonicIncreaseFound = false; - AvgValue = sum(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory) / + AvgValue = sum(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory) / double(NumConvergenceHistoryTerms); - if (std::abs(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(1) - AvgValue) > + if (std::abs(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(1) - AvgValue) > DataConvergParams::PlantFlowRateOscillationToler) { FoundOscillationByDuplicate = false; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (std::abs(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(1) - - PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth)) < + if (std::abs(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(1) - + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth)) < DataConvergParams::PlantFlowRateOscillationToler) { FoundOscillationByDuplicate = true; ShowContinueError( state, format("Node named {} shows oscillating flow rates across iterations with a repeated value of {:.7R}", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, - PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(1))); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(1))); break; } } } if (!FoundOscillationByDuplicate) { SlopeMdot = - (sum_ConvergenceHistoryARR * sum(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory) - + (sum_ConvergenceHistoryARR * sum(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory) - double(NumConvergenceHistoryTerms) * sum((ConvergenceHistoryARR * - PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory))) / + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory))) / (square_sum_ConvergenceHistoryARR - double(NumConvergenceHistoryTerms) * sum_square_ConvergenceHistoryARR); if (std::abs(SlopeMdot) > DataConvergParams::PlantFlowRateSlopeToler) { if (SlopeMdot < 0.0) { // check for monotonic decrease MonotonicDecreaseFound = true; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth - 1) > - PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth)) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth - 1) > + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth)) { MonotonicDecreaseFound = false; break; } @@ -1467,14 +1466,14 @@ namespace HVACManager { ShowContinueError(state, format("Node named {} shows monotonically decreasing mass flow rate with a trend " "rate across iterations of {:.7R} [kg/s/iteration]", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, SlopeMdot)); } } else { // check for monotonic incrase MonotonicIncreaseFound = true; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth - 1) < - PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth)) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth - 1) < + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth)) { MonotonicIncreaseFound = false; break; } @@ -1483,7 +1482,7 @@ namespace HVACManager { ShowContinueError(state, format("Node named {} shows monotonically increasing mass flow rate with a trend " "rate across iterations of {:.7R} [kg/s/iteration]", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, SlopeMdot)); } } @@ -1494,9 +1493,9 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { HistoryTrace += - format("{:.7R},", PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth)); + format("{:.7R},", state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.MassFlowRateHistory(StackDepth)); } - ShowContinueError(state, "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + + ShowContinueError(state, "Node named " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + " mass flow rate [kg/s] iteration history trace (most recent first): " + HistoryTrace); } // need to report trace // end of Outlet node @@ -1506,7 +1505,7 @@ namespace HVACManager { } // mass flow not converged if (state.dataConvergeParams->PlantConvergence(LoopNum).PlantTempNotConverged) { - ShowContinueError(state, "Plant System Named = " + PlantLoop(LoopNum).Name + " did not converge for temperature"); + ShowContinueError(state, "Plant System Named = " + state.dataPlnt->PlantLoop(LoopNum).Name + " did not converge for temperature"); ShowContinueError(state, "Check values should be zero. Most Recent values listed first."); HistoryTrace = ""; for (StackDepth = 1; StackDepth <= DataConvergParams::ConvergLogStackDepth; ++StackDepth) { @@ -1520,43 +1519,43 @@ namespace HVACManager { ShowContinueError(state, "Supply-to-Demand interface temperature check value iteration history trace: " + HistoryTrace); // now work with history logs for mass flow to detect issues - for (ThisLoopSide = 1; ThisLoopSide <= isize(PlantLoop(LoopNum).LoopSide); ++ThisLoopSide) { + for (ThisLoopSide = 1; ThisLoopSide <= isize(state.dataPlnt->PlantLoop(LoopNum).LoopSide); ++ThisLoopSide) { // loop side inlet node FoundOscillationByDuplicate = false; MonotonicDecreaseFound = false; MonotonicIncreaseFound = false; AvgValue = - sum(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory) / double(NumConvergenceHistoryTerms); - if (std::abs(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(1) - AvgValue) > + sum(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory) / double(NumConvergenceHistoryTerms); + if (std::abs(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(1) - AvgValue) > DataConvergParams::PlantTemperatureOscillationToler) { FoundOscillationByDuplicate = false; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (std::abs(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(1) - - PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth)) < + if (std::abs(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(1) - + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth)) < DataConvergParams::PlantTemperatureOscillationToler) { FoundOscillationByDuplicate = true; ShowContinueError( state, format( "Node named {} shows oscillating temperatures across iterations with a repeated value of {:.5R}", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, - PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(1))); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(1))); break; } } } if (!FoundOscillationByDuplicate) { SlopeTemps = - (sum_ConvergenceHistoryARR * sum(PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory) - + (sum_ConvergenceHistoryARR * sum(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory) - double(NumConvergenceHistoryTerms) * - sum((ConvergenceHistoryARR * PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory))) / + sum((ConvergenceHistoryARR * state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory))) / (square_sum_ConvergenceHistoryARR - double(NumConvergenceHistoryTerms) * sum_square_ConvergenceHistoryARR); if (std::abs(SlopeTemps) > DataConvergParams::PlantTemperatureSlopeToler) { if (SlopeTemps < 0.0) { // check for monotic decrease MonotonicDecreaseFound = true; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth - 1) > - PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth)) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth - 1) > + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth)) { MonotonicDecreaseFound = false; break; } @@ -1565,14 +1564,14 @@ namespace HVACManager { ShowContinueError(state, format("Node named {} shows monotonically decreasing temperatures with a trend " "rate across iterations of {:.5R} [C/iteration]", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, SlopeTemps)); } } else { // check for monotic incrase MonotonicIncreaseFound = true; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth - 1) < - PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth)) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth - 1) < + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth)) { MonotonicIncreaseFound = false; break; } @@ -1581,7 +1580,7 @@ namespace HVACManager { ShowContinueError(state, format("Node named {} shows monotonically increasing temperatures with a trend " "rate across iterations of {:.5R} [C/iteration]", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn, SlopeTemps)); } } @@ -1592,9 +1591,9 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { HistoryTrace += - format("{:.5R},", PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth)); + format("{:.5R},", state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).InletNode.TemperatureHistory(StackDepth)); } - ShowContinueError(state, "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + + ShowContinueError(state, "Node named " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameIn + " temperature [C] iteration history trace (most recent first): " + HistoryTrace); } // need to report trace // end of inlet node @@ -1604,37 +1603,37 @@ namespace HVACManager { MonotonicDecreaseFound = false; MonotonicIncreaseFound = false; AvgValue = - sum(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory) / double(NumConvergenceHistoryTerms); - if (std::abs(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(1) - AvgValue) > + sum(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory) / double(NumConvergenceHistoryTerms); + if (std::abs(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(1) - AvgValue) > DataConvergParams::PlantTemperatureOscillationToler) { FoundOscillationByDuplicate = false; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (std::abs(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(1) - - PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth)) < + if (std::abs(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(1) - + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth)) < DataConvergParams::PlantTemperatureOscillationToler) { FoundOscillationByDuplicate = true; ShowContinueError( state, format( "Node named {} shows oscillating temperatures across iterations with a repeated value of {:.5R}", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, - PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(1))); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(1))); break; } } } if (!FoundOscillationByDuplicate) { SlopeTemps = - (sum_ConvergenceHistoryARR * sum(PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory) - + (sum_ConvergenceHistoryARR * sum(state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory) - double(NumConvergenceHistoryTerms) * - sum((ConvergenceHistoryARR * PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory))) / + sum((ConvergenceHistoryARR * state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory))) / (square_sum_ConvergenceHistoryARR - double(NumConvergenceHistoryTerms) * sum_square_ConvergenceHistoryARR); if (std::abs(SlopeTemps) > DataConvergParams::PlantFlowRateSlopeToler) { if (SlopeTemps < 0.0) { // check for monotic decrease MonotonicDecreaseFound = true; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth - 1) > - PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth)) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth - 1) > + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth)) { MonotonicDecreaseFound = false; break; } @@ -1643,14 +1642,14 @@ namespace HVACManager { ShowContinueError(state, format("Node named {} shows monotonically decreasing temperatures with a trend " "rate across iterations of {:.5R} [C/iteration]", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, SlopeTemps)); } } else { // check for monotic incrase MonotonicIncreaseFound = true; for (StackDepth = 2; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { - if (PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth - 1) < - PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth)) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth - 1) < + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth)) { MonotonicIncreaseFound = false; break; } @@ -1659,7 +1658,7 @@ namespace HVACManager { ShowContinueError(state, format("Node named {} shows monotonically increasing temperatures with a trend " "rate across iterations of {:.5R} [C/iteration]", - PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut, SlopeTemps)); } } @@ -1670,9 +1669,9 @@ namespace HVACManager { HistoryTrace = ""; for (StackDepth = 1; StackDepth <= NumConvergenceHistoryTerms; ++StackDepth) { HistoryTrace += - format("{:.5R},", PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth)); + format("{:.5R},", state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).OutletNode.TemperatureHistory(StackDepth)); } - ShowContinueError(state, "Node named " + PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + + ShowContinueError(state, "Node named " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(ThisLoopSide).NodeNameOut + " temperature [C] iteration history trace (most recent first): " + HistoryTrace); } // need to report trace // end of Outlet node @@ -1774,11 +1773,11 @@ namespace HVACManager { // This requires that the plant flow resolver carefully set the min/max avail limits on // air side components to ensure they request within bounds. if (LockPlantFlows) { - SetAllFlowLocks(DataPlant::iFlowLock::Locked); + SetAllFlowLocks(state, DataPlant::iFlowLock::Locked); } else { - SetAllFlowLocks(DataPlant::iFlowLock::Unlocked); + SetAllFlowLocks(state, DataPlant::iFlowLock::Unlocked); } - ResetAllPlantInterConnectFlags(); + ResetAllPlantInterConnectFlags(state); if (state.dataGlobal->BeginEnvrnFlag && MyEnvrnFlag2) { // Following comment is incorrect! (LKL) Even the first time through this does more than read in data. @@ -1874,7 +1873,7 @@ namespace HVACManager { if (!SimPlantLoops) { // check to see if any air side component may have requested plant resim - if (AnyPlantLoopSidesNeedSim()) { + if (AnyPlantLoopSidesNeedSim(state)) { SimPlantLoops = true; } } diff --git a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc index b24d1c51b9d..bcf0accd4a8 100644 --- a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc +++ b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc @@ -1779,7 +1779,6 @@ namespace HVACMultiSpeedHeatPump { // temperatures float in the deadband, additional iterations are required to converge on mass flow rate. // Using/Aliasing - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterSimpleHeating; using DataPlant::TypeOf_MultiSpeedHeatPumpRecovery; @@ -1849,7 +1848,7 @@ namespace HVACMultiSpeedHeatPump { ++AirLoopPass; if (AirLoopPass > 2) AirLoopPass = 1; - if (MSHeatPump(MSHeatPumpNum).MyPlantScantFlag && allocated(PlantLoop)) { + if (MSHeatPump(MSHeatPumpNum).MyPlantScantFlag && allocated(state.dataPlnt->PlantLoop)) { if (MSHeatPump(MSHeatPumpNum).HeatRecActive) { errFlag = false; ScanPlantLoopsForObject(state, @@ -1896,15 +1895,15 @@ namespace HVACMultiSpeedHeatPump { if (MSHeatPump(MSHeatPumpNum).MaxCoilFluidFlow > 0.0) { rho = GetDensityGlycol(state, - PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidIndex, RoutineName); MSHeatPump(MSHeatPumpNum).MaxCoilFluidFlow = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).HeatCoilName, ErrorsFound) * rho; } // fill outlet node for coil - MSHeatPump(MSHeatPumpNum).CoilOutletNode = PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum) + MSHeatPump(MSHeatPumpNum).CoilOutletNode = state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum) .LoopSide(MSHeatPump(MSHeatPumpNum).LoopSide) .Branch(MSHeatPump(MSHeatPumpNum).BranchNum) .Comp(MSHeatPump(MSHeatPumpNum).CompNum) @@ -1938,7 +1937,7 @@ namespace HVACMultiSpeedHeatPump { } // fill outlet node for coil - MSHeatPump(MSHeatPumpNum).CoilOutletNode = PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum) + MSHeatPump(MSHeatPumpNum).CoilOutletNode = state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum) .LoopSide(MSHeatPump(MSHeatPumpNum).LoopSide) .Branch(MSHeatPump(MSHeatPumpNum).BranchNum) .Comp(MSHeatPump(MSHeatPumpNum).CompNum) @@ -1967,15 +1966,15 @@ namespace HVACMultiSpeedHeatPump { GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound); if (MSHeatPump(MSHeatPumpNum).MaxSuppCoilFluidFlow > 0.0) { - rho = GetDensityGlycol(state, PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidIndex, RoutineName); MSHeatPump(MSHeatPumpNum).MaxSuppCoilFluidFlow = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound) * rho; } // fill outlet node for coil - MSHeatPump(MSHeatPumpNum).SuppCoilOutletNode = PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum) + MSHeatPump(MSHeatPumpNum).SuppCoilOutletNode = state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum) .LoopSide(MSHeatPump(MSHeatPumpNum).SuppLoopSide) .Branch(MSHeatPump(MSHeatPumpNum).SuppBranchNum) .Comp(MSHeatPump(MSHeatPumpNum).SuppCompNum) @@ -2008,7 +2007,7 @@ namespace HVACMultiSpeedHeatPump { } // fill outlet node for coil - MSHeatPump(MSHeatPumpNum).SuppCoilOutletNode = PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum) + MSHeatPump(MSHeatPumpNum).SuppCoilOutletNode = state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum) .LoopSide(MSHeatPump(MSHeatPumpNum).SuppLoopSide) .Branch(MSHeatPump(MSHeatPumpNum).SuppBranchNum) .Comp(MSHeatPump(MSHeatPumpNum).SuppCompNum) @@ -2122,9 +2121,9 @@ namespace HVACMultiSpeedHeatPump { if ((MSHeatPump(MSHeatPumpNum).HeatRecActive) && (!MSHeatPump(MSHeatPumpNum).MyPlantScantFlag)) { rho = GetDensityGlycol(state, - PlantLoop(MSHeatPump(MSHeatPumpNum).HRLoopNum).FluidName, + state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).HRLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(MSHeatPump(MSHeatPumpNum).HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).HRLoopNum).FluidIndex, RoutineName); MSHeatPump(MSHeatPumpNum).DesignHeatRecMassFlowRate = MSHeatPump(MSHeatPumpNum).DesignHeatRecFlowRate * rho; @@ -2147,9 +2146,9 @@ namespace HVACMultiSpeedHeatPump { CoilMaxVolFlowRate = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).HeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != AutoSize) { rho = GetDensityGlycol(state, - PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).LoopNum).FluidIndex, RoutineName); MSHeatPump(MSHeatPumpNum).MaxCoilFluidFlow = CoilMaxVolFlowRate * rho; } @@ -2197,9 +2196,9 @@ namespace HVACMultiSpeedHeatPump { CoilMaxVolFlowRate = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", MSHeatPump(MSHeatPumpNum).SuppHeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != AutoSize) { rho = GetDensityGlycol(state, - PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidName, + state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).SuppLoopNum).FluidIndex, RoutineName); MSHeatPump(MSHeatPumpNum).MaxSuppCoilFluidFlow = CoilMaxVolFlowRate * rho; } @@ -4121,7 +4120,6 @@ namespace HVACMultiSpeedHeatPump { // Using/Aliasing using DataHVACGlobals::MSHPWasteHeat; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::SafeCopyPlantNode; @@ -4157,9 +4155,9 @@ namespace HVACMultiSpeedHeatPump { if (HeatRecMassFlowRate > 0.0) { - CpHeatRec = GetSpecificHeatGlycol(state, PlantLoop(MSHeatPump(MSHeatPumpNum).HRLoopNum).FluidName, + CpHeatRec = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).HRLoopNum).FluidName, HeatRecInletTemp, - PlantLoop(MSHeatPump(MSHeatPumpNum).HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(MSHeatPump(MSHeatPumpNum).HRLoopNum).FluidIndex, RoutineName); HeatRecOutletTemp = QHeatRec / (HeatRecMassFlowRate * CpHeatRec) + HeatRecInletTemp; @@ -4172,7 +4170,7 @@ namespace HVACMultiSpeedHeatPump { QHeatRec = 0.0; } - SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); + SafeCopyPlantNode(state, HeatRecInNode, HeatRecOutNode); // changed outputs Node(HeatRecOutNode).Temp = HeatRecOutletTemp; diff --git a/src/EnergyPlus/HVACSingleDuctInduc.cc b/src/EnergyPlus/HVACSingleDuctInduc.cc index e8a9db3681c..d6884c50331 100644 --- a/src/EnergyPlus/HVACSingleDuctInduc.cc +++ b/src/EnergyPlus/HVACSingleDuctInduc.cc @@ -507,7 +507,6 @@ namespace HVACSingleDuctInduc { // Uses the status flags to trigger initializations. // Using/Aliasing - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilWaterCooling; using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; using DataPlant::TypeOf_CoilWaterSimpleHeating; @@ -550,7 +549,7 @@ namespace HVACSingleDuctInduc { MyOneTimeFlag = false; } - if (MyPlantScanFlag(IUNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(IUNum) && allocated(state.dataPlnt->PlantLoop)) { if (IndUnit(IUNum).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) { errFlag = false; ScanPlantLoopsForObject(state, @@ -652,14 +651,14 @@ namespace HVACSingleDuctInduc { if (HotConNode > 0 && !MyPlantScanFlag(IUNum)) { rho = GetDensityGlycol(state, - PlantLoop(IndUnit(IUNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(IndUnit(IUNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(IndUnit(IUNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(IndUnit(IUNum).HWLoopNum).FluidIndex, RoutineName); IndUnit(IUNum).MaxHotWaterFlow = rho * IndUnit(IUNum).MaxVolHotWaterFlow; IndUnit(IUNum).MinHotWaterFlow = rho * IndUnit(IUNum).MinVolHotWaterFlow; // get component outlet node from plant structure - HWOutletNode = PlantLoop(IndUnit(IUNum).HWLoopNum) + HWOutletNode = state.dataPlnt->PlantLoop(IndUnit(IUNum).HWLoopNum) .LoopSide(IndUnit(IUNum).HWLoopSide) .Branch(IndUnit(IUNum).HWBranchNum) .Comp(IndUnit(IUNum).HWCompNum) @@ -677,14 +676,14 @@ namespace HVACSingleDuctInduc { ColdConNode = IndUnit(IUNum).CWControlNode; if (ColdConNode > 0) { rho = GetDensityGlycol(state, - PlantLoop(IndUnit(IUNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(IndUnit(IUNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(IndUnit(IUNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(IndUnit(IUNum).CWLoopNum).FluidIndex, RoutineName); IndUnit(IUNum).MaxColdWaterFlow = rho * IndUnit(IUNum).MaxVolColdWaterFlow; IndUnit(IUNum).MinColdWaterFlow = rho * IndUnit(IUNum).MinVolColdWaterFlow; - CWOutletNode = PlantLoop(IndUnit(IUNum).CWLoopNum) + CWOutletNode = state.dataPlnt->PlantLoop(IndUnit(IUNum).CWLoopNum) .LoopSide(IndUnit(IUNum).CWLoopSide) .Branch(IndUnit(IUNum).CWBranchNum) .Comp(IndUnit(IUNum).CWCompNum) @@ -757,7 +756,6 @@ namespace HVACSingleDuctInduc { // Using/Aliasing using namespace DataSizing; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -895,15 +893,15 @@ namespace HVACSingleDuctInduc { (ZoneSizThermSetPtLo(CurZoneEqNum) - TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInTempTU); } IndUnit(IUNum).DesHeatingLoad = DesCoilLoad; - Cp = GetSpecificHeatGlycol(state, PlantLoop(IndUnit(IUNum).HWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(IndUnit(IUNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(IndUnit(IUNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(IndUnit(IUNum).HWLoopNum).FluidIndex, RoutineName); rho = GetDensityGlycol(state, - PlantLoop(IndUnit(IUNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(IndUnit(IUNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(IndUnit(IUNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(IndUnit(IUNum).HWLoopNum).FluidIndex, RoutineName); MaxVolHotWaterFlowDes = DesCoilLoad / (PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); @@ -1001,10 +999,10 @@ namespace HVACSingleDuctInduc { } IndUnit(IUNum).DesCoolingLoad = DesCoilLoad; Cp = GetSpecificHeatGlycol( - state, PlantLoop(IndUnit(IUNum).CWLoopNum).FluidName, 5.0, PlantLoop(IndUnit(IUNum).CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(IndUnit(IUNum).CWLoopNum).FluidName, 5.0, state.dataPlnt->PlantLoop(IndUnit(IUNum).CWLoopNum).FluidIndex, RoutineName); rho = GetDensityGlycol( - state, PlantLoop(IndUnit(IUNum).CWLoopNum).FluidName, 5.0, PlantLoop(IndUnit(IUNum).CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(IndUnit(IUNum).CWLoopNum).FluidName, 5.0, state.dataPlnt->PlantLoop(IndUnit(IUNum).CWLoopNum).FluidIndex, RoutineName); MaxVolColdWaterFlowDes = DesCoilLoad / (PlantSizData(PltSizCoolNum).DeltaT * Cp * rho); MaxVolColdWaterFlowDes = max(MaxVolColdWaterFlowDes, 0.0); @@ -1104,7 +1102,6 @@ namespace HVACSingleDuctInduc { // Using/Aliasing using namespace DataZoneEnergyDemands; - using DataPlant::PlantLoop; using General::SolveRoot; using PlantUtilities::SetComponentFlowRate; @@ -1156,13 +1153,13 @@ namespace HVACSingleDuctInduc { SecNode = IndUnit(IUNum).SecAirInNode; OutletNode = IndUnit(IUNum).OutAirNode; HotControlNode = IndUnit(IUNum).HWControlNode; - HWOutletNode = PlantLoop(IndUnit(IUNum).HWLoopNum) + HWOutletNode = state.dataPlnt->PlantLoop(IndUnit(IUNum).HWLoopNum) .LoopSide(IndUnit(IUNum).HWLoopSide) .Branch(IndUnit(IUNum).HWBranchNum) .Comp(IndUnit(IUNum).HWCompNum) .NodeNumOut; ColdControlNode = IndUnit(IUNum).CWControlNode; - CWOutletNode = PlantLoop(IndUnit(IUNum).CWLoopNum) + CWOutletNode = state.dataPlnt->PlantLoop(IndUnit(IUNum).CWLoopNum) .LoopSide(IndUnit(IUNum).CWLoopSide) .Branch(IndUnit(IUNum).CWBranchNum) .Comp(IndUnit(IUNum).CWCompNum) @@ -1365,7 +1362,6 @@ namespace HVACSingleDuctInduc { // na // Using/Aliasing - using DataPlant::PlantLoop; using MixerComponent::SimAirMixer; using PlantUtilities::SetComponentFlowRate; using WaterCoils::SimulateWaterCoilComponents; @@ -1405,14 +1401,14 @@ namespace HVACSingleDuctInduc { SecAirMassFlow = InducRat * PriAirMassFlow; TotAirMassFlow = PriAirMassFlow + SecAirMassFlow; HotControlNode = IndUnit(IUNum).HWControlNode; - HWOutletNode = PlantLoop(IndUnit(IUNum).HWLoopNum) + HWOutletNode = state.dataPlnt->PlantLoop(IndUnit(IUNum).HWLoopNum) .LoopSide(IndUnit(IUNum).HWLoopSide) .Branch(IndUnit(IUNum).HWBranchNum) .Comp(IndUnit(IUNum).HWCompNum) .NodeNumOut; ColdControlNode = IndUnit(IUNum).CWControlNode; - CWOutletNode = PlantLoop(IndUnit(IUNum).CWLoopNum) + CWOutletNode = state.dataPlnt->PlantLoop(IndUnit(IUNum).CWLoopNum) .LoopSide(IndUnit(IUNum).CWLoopSide) .Branch(IndUnit(IUNum).CWBranchNum) .Comp(IndUnit(IUNum).CWCompNum) diff --git a/src/EnergyPlus/HVACSizingSimulationManager.cc b/src/EnergyPlus/HVACSizingSimulationManager.cc index 5c3a199bf26..8cc4b9db533 100644 --- a/src/EnergyPlus/HVACSizingSimulationManager.cc +++ b/src/EnergyPlus/HVACSizingSimulationManager.cc @@ -92,7 +92,6 @@ void HVACSizingSimulationManager::DetermineSizingAnalysesNeeded(EnergyPlusData & void HVACSizingSimulationManager::CreateNewCoincidentPlantAnalysisObject(EnergyPlusData &state, std::string const &PlantLoopName, int const PlantSizingIndex) { - using DataPlant::PlantLoop; using DataPlant::SupplySide; using DataPlant::TotNumLoops; using namespace FluidProperties; @@ -103,16 +102,16 @@ void HVACSizingSimulationManager::CreateNewCoincidentPlantAnalysisObject(EnergyP // find plant loop number for (int i = 1; i <= TotNumLoops; ++i) { - if (PlantLoopName == PlantLoop(i).Name) { // found it + if (PlantLoopName == state.dataPlnt->PlantLoop(i).Name) { // found it density = GetDensityGlycol( - state, PlantLoop(i).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(i).FluidIndex, "createNewCoincidentPlantAnalysisObject"); + state, state.dataPlnt->PlantLoop(i).FluidName, DataGlobalConstants::CWInitConvTemp, state.dataPlnt->PlantLoop(i).FluidIndex, "createNewCoincidentPlantAnalysisObject"); cp = GetSpecificHeatGlycol( - state, PlantLoop(i).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(i).FluidIndex, "createNewCoincidentPlantAnalysisObject"); + state, state.dataPlnt->PlantLoop(i).FluidName, DataGlobalConstants::CWInitConvTemp, state.dataPlnt->PlantLoop(i).FluidIndex, "createNewCoincidentPlantAnalysisObject"); plantCoincAnalyObjs.emplace_back(PlantLoopName, i, - PlantLoop(i).LoopSide(SupplySide).NodeNumIn, + state.dataPlnt->PlantLoop(i).LoopSide(SupplySide).NodeNumIn, density, cp, PlantSizData(PlantSizingIndex).NumTimeStepsInAvg, @@ -135,9 +134,9 @@ void HVACSizingSimulationManager::SetupSizingAnalyses(EnergyPlusData &state) P.supplyInletNodeFlow_LogIndex = sizingLogger.SetupVariableSizingLog(state, Node(P.supplySideInletNodeNum).MassFlowRate, P.numTimeStepsInAvg); P.supplyInletNodeTemp_LogIndex = sizingLogger.SetupVariableSizingLog(state, Node(P.supplySideInletNodeNum).Temp, P.numTimeStepsInAvg); if (PlantSizData(P.plantSizingIndex).LoopType == HeatingLoop || PlantSizData(P.plantSizingIndex).LoopType == SteamLoop) { - P.loopDemand_LogIndex = sizingLogger.SetupVariableSizingLog(state, DataPlant::PlantLoop(P.plantLoopIndex).HeatingDemand, P.numTimeStepsInAvg); + P.loopDemand_LogIndex = sizingLogger.SetupVariableSizingLog(state, state.dataPlnt->PlantLoop(P.plantLoopIndex).HeatingDemand, P.numTimeStepsInAvg); } else if (PlantSizData(P.plantSizingIndex).LoopType == CoolingLoop || PlantSizData(P.plantSizingIndex).LoopType == CondenserLoop) { - P.loopDemand_LogIndex = sizingLogger.SetupVariableSizingLog(state, DataPlant::PlantLoop(P.plantLoopIndex).CoolingDemand, P.numTimeStepsInAvg); + P.loopDemand_LogIndex = sizingLogger.SetupVariableSizingLog(state, state.dataPlnt->PlantLoop(P.plantLoopIndex).CoolingDemand, P.numTimeStepsInAvg); } } } diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index 0e8ed11c28d..9b10ab2f13f 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -1468,7 +1468,7 @@ namespace HVACUnitaryBypassVAV { // state.dataAirLoop->AirLoopControlInfo(AirLoopNum).Simple = true; } - if (MyPlantScanFlag(CBVAVNum) && allocated(DataPlant::PlantLoop)) { + if (MyPlantScanFlag(CBVAVNum) && allocated(state.dataPlnt->PlantLoop)) { if ((CBVAV(CBVAVNum).HeatCoilType_Num == DataHVACGlobals::Coil_HeatingWater) || (CBVAV(CBVAVNum).HeatCoilType_Num == DataHVACGlobals::Coil_HeatingSteam)) { if (CBVAV(CBVAVNum).HeatCoilType_Num == DataHVACGlobals::Coil_HeatingWater) { @@ -1496,9 +1496,9 @@ namespace HVACUnitaryBypassVAV { if (CBVAV(CBVAVNum).MaxHeatCoilFluidFlow > 0.0) { Real64 FluidDensity = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidIndex, RoutineName); CBVAV(CBVAVNum).MaxHeatCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", CBVAV(CBVAVNum).HeatCoilName, ErrorsFound) * FluidDensity; @@ -1536,7 +1536,7 @@ namespace HVACUnitaryBypassVAV { } // fill outlet node for heating coil - CBVAV(CBVAVNum).CoilOutletNode = DataPlant::PlantLoop(CBVAV(CBVAVNum).LoopNum) + CBVAV(CBVAVNum).CoilOutletNode = state.dataPlnt->PlantLoop(CBVAV(CBVAVNum).LoopNum) .LoopSide(CBVAV(CBVAVNum).LoopSide) .Branch(CBVAV(CBVAVNum).BranchNum) .Comp(CBVAV(CBVAVNum).CompNum) @@ -1606,9 +1606,9 @@ namespace HVACUnitaryBypassVAV { } if (CoilMaxVolFlowRate != DataSizing::AutoSize) { Real64 FluidDensity = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CBVAV(CBVAVNum).LoopNum).FluidIndex, RoutineName); CBVAV(CBVAVNum).MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * FluidDensity; } diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index d31b095afea..db0c652477d 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -1218,9 +1218,9 @@ namespace EnergyPlus::HVACVariableRefrigerantFlow { state.dataHVACVarRefFlow->VRF(VRFCond).WaterCondenserMassFlow = DataLoopNode::Node(state.dataHVACVarRefFlow->VRF(VRFCond).CondenserNodeNum).MassFlowRate; CpCond = GetSpecificHeatGlycol(state, - PlantLoop(state.dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidName, state.dataHVACVarRefFlow->VRF(VRFCond).CondenserInletTemp, - PlantLoop(state.dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); if (CondWaterMassFlow > 0.0) { CondOutletTemp = state.dataHVACVarRefFlow->VRF(VRFCond).QCondenser / (CondWaterMassFlow * CpCond) + CondInletTemp; @@ -5293,7 +5293,7 @@ namespace EnergyPlus::HVACVariableRefrigerantFlow { state.dataHVACVarRefFlow->VRFTU(VRFTUNum).AvailStatus = DataHVACGlobals::ZoneComp(VRFTerminalUnit_Num).ZoneCompAvailMgrs(VRFTUNum).AvailStatus; } - if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MySuppCoilPlantScanFlag && allocated(PlantLoop)) { + if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MySuppCoilPlantScanFlag && allocated(state.dataPlnt->PlantLoop)) { if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilType_Num == DataHVACGlobals::Coil_HeatingWater) { // hot water supplemental heating coil errFlag = false; @@ -5325,15 +5325,15 @@ namespace EnergyPlus::HVACVariableRefrigerantFlow { if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow > 0.0) { rho = GetDensityGlycol(state, - PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidIndex, RoutineName); state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow * rho; } // fill fluid outlet node for hot water coil SuppHeatCoilFluidOutletNode - state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidOutletNode = PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum) + state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidOutletNode = state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum) .LoopSide(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopSide) .Branch(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilBranchNum) .Comp(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilCompNum) @@ -5368,7 +5368,7 @@ namespace EnergyPlus::HVACVariableRefrigerantFlow { } // fill fluid outlet node for steam coil SuppHeatCoilFluidOutletNode - state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidOutletNode = PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum) + state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidOutletNode = state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum) .LoopSide(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopSide) .Branch(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilBranchNum) .Comp(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilCompNum) @@ -6056,9 +6056,9 @@ namespace EnergyPlus::HVACVariableRefrigerantFlow { if (state.dataHVACVarRefFlow->VRF(VRFCond).CondenserType == DataHVACGlobals::WaterCooled) { rho = GetDensityGlycol(state, - PlantLoop(state.dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(state.dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); state.dataHVACVarRefFlow->VRF(VRFCond).WaterCondenserDesignMassFlow = state.dataHVACVarRefFlow->VRF(VRFCond).WaterCondVolFlowRate * rho; @@ -6088,9 +6088,9 @@ namespace EnergyPlus::HVACVariableRefrigerantFlow { WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { rho = GetDensityGlycol(state, - PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilLoopNum).FluidIndex, RoutineName); state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow = CoilMaxVolFlowRate * rho; } @@ -8310,18 +8310,18 @@ namespace EnergyPlus::HVACVariableRefrigerantFlow { PltSizCondNum = 0; if (this->WaterCondVolFlowRate == DataSizing::AutoSize) { - if (this->SourceLoopNum > 0) PltSizCondNum = PlantLoop(this->SourceLoopNum).PlantSizNum; + if (this->SourceLoopNum > 0) PltSizCondNum = state.dataPlnt->PlantLoop(this->SourceLoopNum).PlantSizNum; if (PltSizCondNum > 0) { rho = FluidProperties::GetDensityGlycol(state, - PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataSizing::PlantSizData(PltSizCondNum).ExitTemp, - PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); Cp = FluidProperties::GetSpecificHeatGlycol(state, - PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataSizing::PlantSizData(PltSizCondNum).ExitTemp, - PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = max(this->CoolingCapacity, this->HeatingCapacity) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); @@ -8334,9 +8334,9 @@ namespace EnergyPlus::HVACVariableRefrigerantFlow { } rho = FluidProperties::GetDensityGlycol(state, - PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->WaterCondenserDesignMassFlow = this->WaterCondVolFlowRate * rho; PlantUtilities::InitComponentNodes(0.0, diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index d3552e726cf..46e95943203 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -117,7 +117,6 @@ namespace HWBaseboardRadiator { using DataHVACGlobals::SmallLoad; using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; - using DataPlant::PlantLoop; using DataPlant::TypeOf_Baseboard_Rad_Conv_Water; using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::ZoneEquipConfig; @@ -827,7 +826,7 @@ namespace HWBaseboardRadiator { } if (SetLoopIndexFlag(BaseboardNum)) { - if (allocated(PlantLoop)) { + if (allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject(state, HWBaseboard(BaseboardNum).EquipID, @@ -862,9 +861,9 @@ namespace HWBaseboardRadiator { WaterInletNode = HWBaseboard(BaseboardNum).WaterInletNode; rho = GetDensityGlycol(state, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); HWBaseboard(BaseboardNum).WaterMassFlowRateMax = rho * HWBaseboard(BaseboardNum).WaterVolFlowRateMax; @@ -881,9 +880,9 @@ namespace HWBaseboardRadiator { Node(WaterInletNode).Temp = 60.0; Cp = GetSpecificHeatGlycol(state, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, Node(WaterInletNode).Temp, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); Node(WaterInletNode).Enthalpy = Cp * Node(WaterInletNode).Temp; @@ -1075,7 +1074,7 @@ namespace HWBaseboardRadiator { } // find the appropriate heating Plant Sizing object - PltSizHeatNum = PlantLoop(HWBaseboard(BaseboardNum).LoopNum).PlantSizNum; + PltSizHeatNum = state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).PlantSizNum; if (PltSizHeatNum > 0) { if (CurZoneEqNum > 0) { @@ -1095,14 +1094,14 @@ namespace HWBaseboardRadiator { DesCoilLoad = RatedCapacityDes; if (DesCoilLoad >= SmallLoad) { Cp = GetSpecificHeatGlycol(state, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); rho = GetDensityGlycol(state, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); WaterVolFlowRateMaxDes = DesCoilLoad / (PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); } else { @@ -1148,9 +1147,9 @@ namespace HWBaseboardRadiator { } else if (HWBaseboard(BaseboardNum).RatedCapacity == AutoSize || HWBaseboard(BaseboardNum).RatedCapacity == 0.0) { DesCoilLoad = RatedCapacityDes; rho = GetDensityGlycol(state, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineNameFull); WaterMassFlowRateStd = HWBaseboard(BaseboardNum).WaterVolFlowRateMax * rho; } @@ -1160,9 +1159,9 @@ namespace HWBaseboardRadiator { // m_dot = 0.0062 + 2.75e-05*q AirMassFlowRate = Constant + Coeff * DesCoilLoad; Cp = GetSpecificHeatGlycol(state, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, HWBaseboard(BaseboardNum).WaterTempAvg, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); WaterInletTempStd = (DesCoilLoad / (2.0 * WaterMassFlowRateStd * Cp)) + HWBaseboard(BaseboardNum).WaterTempAvg; WaterOutletTempStd = std::abs((2.0 * HWBaseboard(BaseboardNum).WaterTempAvg) - WaterInletTempStd); @@ -1217,9 +1216,9 @@ namespace HWBaseboardRadiator { // m_dot = 0.0062 + 2.75e-05*q AirMassFlowRate = Constant + Coeff * DesCoilLoad; Cp = GetSpecificHeatGlycol(state, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, HWBaseboard(BaseboardNum).WaterTempAvg, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); WaterInletTempStd = (DesCoilLoad / (2.0 * WaterMassFlowRateStd * Cp)) + HWBaseboard(BaseboardNum).WaterTempAvg; WaterOutletTempStd = std::abs((2.0 * HWBaseboard(BaseboardNum).WaterTempAvg) - WaterInletTempStd); @@ -1345,9 +1344,9 @@ namespace HWBaseboardRadiator { AirMassFlowRate = HWBaseboard(BaseboardNum).AirMassFlowRateStd * (WaterMassFlowRate / HWBaseboard(BaseboardNum).WaterMassFlowRateMax); CapacitanceAir = PsyCpAirFnW(HWBaseboard(BaseboardNum).AirInletHumRat) * AirMassFlowRate; Cp = GetSpecificHeatGlycol(state, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, WaterInletTemp, - PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); CapacitanceWater = Cp * WaterMassFlowRate; @@ -1501,7 +1500,7 @@ namespace HWBaseboardRadiator { // Set the outlet air nodes of the Baseboard // Set the outlet water nodes for the Coil - SafeCopyPlantNode(WaterInletNode, WaterOutletNode); + SafeCopyPlantNode(state, WaterInletNode, WaterOutletNode); Node(WaterOutletNode).Temp = HWBaseboard(BaseboardNum).WaterOutletTemp; Node(WaterOutletNode).Enthalpy = HWBaseboard(BaseboardNum).WaterOutletEnthalpy; } @@ -1842,7 +1841,7 @@ namespace HWBaseboardRadiator { return; } - PullCompInterconnectTrigger(HWBaseboard(BaseboardNum).LoopNum, + PullCompInterconnectTrigger(state, HWBaseboard(BaseboardNum).LoopNum, HWBaseboard(BaseboardNum).LoopSideNum, HWBaseboard(BaseboardNum).BranchNum, HWBaseboard(BaseboardNum).CompNum, @@ -1852,7 +1851,7 @@ namespace HWBaseboardRadiator { DataPlant::iCriteriaType::HeatTransferRate, HWBaseboard(BaseboardNum).Power); - PullCompInterconnectTrigger(HWBaseboard(BaseboardNum).LoopNum, + PullCompInterconnectTrigger(state, HWBaseboard(BaseboardNum).LoopNum, HWBaseboard(BaseboardNum).LoopSideNum, HWBaseboard(BaseboardNum).BranchNum, HWBaseboard(BaseboardNum).CompNum, @@ -1862,7 +1861,7 @@ namespace HWBaseboardRadiator { DataPlant::iCriteriaType::MassFlowRate, HWBaseboard(BaseboardNum).WaterMassFlowRate); - PullCompInterconnectTrigger(HWBaseboard(BaseboardNum).LoopNum, + PullCompInterconnectTrigger(state, HWBaseboard(BaseboardNum).LoopNum, HWBaseboard(BaseboardNum).LoopSideNum, HWBaseboard(BaseboardNum).BranchNum, HWBaseboard(BaseboardNum).CompNum, diff --git a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc index 0bcfaa8629d..0c286ca470a 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc @@ -196,7 +196,7 @@ namespace HeatPumpWaterToWaterCOOLING { ShowFatalError(state, "InitGshp: Program terminated due to previous condition(s)."); } - PlantUtilities::InterConnectTwoPlantLoopSides(this->LoadLoopNum, + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->LoadLoopNum, this->LoadLoopSideNum, this->SourceLoopNum, this->SourceLoopSideNum, @@ -526,9 +526,9 @@ namespace HeatPumpWaterToWaterCOOLING { this->beginEnvironFlag = false; Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoadLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); this->LoadSideDesignMassFlow = this->LoadSideVolFlowRate * rho; @@ -542,9 +542,9 @@ namespace HeatPumpWaterToWaterCOOLING { this->LoadCompNum); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->SourceSideDesignMassFlow = this->SourceSideVolFlowRate * rho; @@ -665,7 +665,7 @@ namespace HeatPumpWaterToWaterCOOLING { this->SourceLoopSideNum, this->SourceBranchNum, this->SourceCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->LoadLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, this->LoadCompNum, @@ -724,7 +724,7 @@ namespace HeatPumpWaterToWaterCOOLING { this->SourceLoopSideNum, this->SourceBranchNum, this->SourceCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->LoadLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, this->LoadCompNum, @@ -742,7 +742,7 @@ namespace HeatPumpWaterToWaterCOOLING { this->SourceSideWaterOutletTemp = SourceSideWaterInletTemp; return; } - PlantUtilities::PullCompInterconnectTrigger(this->LoadLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, this->LoadCompNum, @@ -761,13 +761,13 @@ namespace HeatPumpWaterToWaterCOOLING { IterationCount = 0; CpSourceSide = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, this->SourceSideWaterInletTemp, - DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); CpLoadSide = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->LoadLoopNum).FluidName, this->LoadSideWaterInletTemp, DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, this->LoadSideWaterInletTemp, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); // Determine effectiveness of Load Side LoadSideEffect = 1.0 - std::exp(-this->LoadSideUACoeff / (CpLoadSide * this->LoadSideWaterMassFlowRate)); diff --git a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc index 81beefeb197..73cb2690d0e 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc @@ -200,7 +200,7 @@ namespace HeatPumpWaterToWaterHEATING { ShowFatalError(state, "InitGshp: Program terminated due to previous condition(s)."); } - PlantUtilities::InterConnectTwoPlantLoopSides(this->LoadLoopNum, + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->LoadLoopNum, this->LoadLoopSideNum, this->SourceLoopNum, this->SourceLoopSideNum, @@ -496,9 +496,9 @@ namespace HeatPumpWaterToWaterHEATING { this->beginEnvironFlag = false; Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoadLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); this->LoadSideDesignMassFlow = this->LoadSideVolFlowRate * rho; @@ -512,9 +512,9 @@ namespace HeatPumpWaterToWaterHEATING { this->LoadCompNum); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->SourceSideDesignMassFlow = this->SourceSideVolFlowRate * rho; @@ -555,7 +555,6 @@ namespace HeatPumpWaterToWaterHEATING { // Using/Aliasing using DataHVACGlobals::SysTimeElapsed; using namespace FluidProperties; - using DataPlant::PlantLoop; using PlantUtilities::SetComponentFlowRate; @@ -621,7 +620,7 @@ namespace HeatPumpWaterToWaterHEATING { this->SourceLoopSideNum, this->SourceBranchNum, this->SourceCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->LoadLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, this->LoadCompNum, @@ -671,7 +670,7 @@ namespace HeatPumpWaterToWaterHEATING { this->SourceLoopSideNum, this->SourceBranchNum, this->SourceCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->LoadLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, this->LoadCompNum, @@ -684,7 +683,7 @@ namespace HeatPumpWaterToWaterHEATING { this->SourceSideWaterOutletTemp = this->SourceSideWaterInletTemp; return; } - PlantUtilities::PullCompInterconnectTrigger(this->LoadLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, this->LoadCompNum, @@ -702,13 +701,13 @@ namespace HeatPumpWaterToWaterHEATING { int IterationCount = 0; Real64 CpSourceSide = GetSpecificHeatGlycol(state, - PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, this->SourceSideWaterInletTemp, - PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); Real64 CpLoadSide = GetSpecificHeatGlycol( - state, PlantLoop(this->LoadLoopNum).FluidName, this->LoadSideWaterInletTemp, PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, this->LoadSideWaterInletTemp, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); // Determine effectiveness of Source Side (the Evaporator in heating mode) Real64 SourceSideEffect = 1.0 - std::exp(-this->SourceSideUACoeff / (CpSourceSide * this->SourceSideWaterMassFlowRate)); diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc index 20eecc4bb08..19a219ad76e 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -677,7 +677,6 @@ namespace HeatPumpWaterToWaterSimple { // Using/Aliasing using DataHVACGlobals::SysTimeElapsed; - using DataPlant::PlantLoop; using DataPlant::TypeOf_HPWaterEFCooling; using DataPlant::TypeOf_HPWaterEFHeating; using FluidProperties::GetDensityGlycol; @@ -735,7 +734,7 @@ namespace HeatPumpWaterToWaterSimple { _); if (!errFlag) { - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->LoadLoopNum, this->LoadLoopSideNum, this->SourceLoopNum, this->SourceLoopSideNum, this->WWHPPlantTypeOfNum, true); } @@ -765,17 +764,17 @@ namespace HeatPumpWaterToWaterSimple { if (this->WWHPPlantTypeOfNum == TypeOf_HPWaterEFHeating) { rho = GetDensityGlycol( - state, PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); this->LoadSideDesignMassFlow = this->RatedLoadVolFlowHeat * rho; rho = GetDensityGlycol( - state, PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->SourceSideDesignMassFlow = this->RatedSourceVolFlowHeat * rho; } else if (this->WWHPPlantTypeOfNum == TypeOf_HPWaterEFCooling) { rho = GetDensityGlycol( - state, PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); this->LoadSideDesignMassFlow = this->RatedLoadVolFlowCool * rho; rho = GetDensityGlycol( - state, PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); this->SourceSideDesignMassFlow = this->RatedSourceVolFlowCool * rho; } @@ -846,7 +845,7 @@ namespace HeatPumpWaterToWaterSimple { this->SourceLoopSideNum, this->SourceBranchNum, this->SourceCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->LoadLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, this->LoadCompNum, @@ -896,7 +895,7 @@ namespace HeatPumpWaterToWaterSimple { this->SourceLoopSideNum, this->SourceBranchNum, this->SourceCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->LoadLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, this->LoadCompNum, @@ -907,7 +906,7 @@ namespace HeatPumpWaterToWaterSimple { this->reportSourceSideMassFlowRate); return; } - PlantUtilities::PullCompInterconnectTrigger(this->LoadLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->LoadLoopNum, this->LoadLoopSideNum, this->LoadBranchNum, this->LoadCompNum, @@ -956,7 +955,7 @@ namespace HeatPumpWaterToWaterSimple { this->ratedPowerHeatWasAutoSized = GSHP(this->companionIndex).ratedPowerHeatWasAutoSized; } - int pltLoadSizNum = DataPlant::PlantLoop(this->LoadLoopNum).PlantSizNum; + int pltLoadSizNum = state.dataPlnt->PlantLoop(this->LoadLoopNum).PlantSizNum; if (pltLoadSizNum > 0) { if (DataSizing::PlantSizData(pltLoadSizNum).DesVolFlowRate > DataHVACGlobals::SmallWaterVolFlow) { tmpLoadSideVolFlowRate = DataSizing::PlantSizData(pltLoadSizNum).DesVolFlowRate * this->sizFac; @@ -967,27 +966,27 @@ namespace HeatPumpWaterToWaterSimple { this->RatedLoadVolFlowCool = tmpLoadSideVolFlowRate; } Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoadLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoadLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); tmpCoolingCap = Cp * rho * DataSizing::PlantSizData(pltLoadSizNum).DeltaT * tmpLoadSideVolFlowRate; } else if (this->companionIdentified && this->RatedLoadVolFlowHeat > 0.0) { tmpLoadSideVolFlowRate = this->RatedLoadVolFlowHeat; Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoadLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoadLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); tmpCoolingCap = Cp * rho * DataSizing::PlantSizData(pltLoadSizNum).DeltaT * tmpLoadSideVolFlowRate; } else { @@ -1139,17 +1138,17 @@ namespace HeatPumpWaterToWaterSimple { } } if (!this->ratedLoadVolFlowCoolWasAutoSized) tmpLoadSideVolFlowRate = this->RatedLoadVolFlowCool; - int pltSourceSizNum = DataPlant::PlantLoop(this->SourceLoopNum).PlantSizNum; + int pltSourceSizNum = state.dataPlnt->PlantLoop(this->SourceLoopNum).PlantSizNum; if (pltSourceSizNum > 0) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); tmpSourceSideVolFlowRate = tmpCoolingCap * (1.0 + (1.0 / this->refCOP)) / (DataSizing::PlantSizData(pltSourceSizNum).DeltaT * Cp * rho); } else { @@ -1292,7 +1291,7 @@ namespace HeatPumpWaterToWaterSimple { this->ratedPowerCoolWasAutoSized = GSHP(this->companionIndex).ratedPowerCoolWasAutoSized; } - int pltLoadSizNum = DataPlant::PlantLoop(this->LoadLoopNum).PlantSizNum; + int pltLoadSizNum = state.dataPlnt->PlantLoop(this->LoadLoopNum).PlantSizNum; if (pltLoadSizNum > 0) { if (DataSizing::PlantSizData(pltLoadSizNum).DesVolFlowRate > DataHVACGlobals::SmallWaterVolFlow) { tmpLoadSideVolFlowRate = DataSizing::PlantSizData(pltLoadSizNum).DesVolFlowRate * this->sizFac; @@ -1304,27 +1303,27 @@ namespace HeatPumpWaterToWaterSimple { this->RatedLoadVolFlowHeat = tmpLoadSideVolFlowRate; } Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoadLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoadLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); tmpHeatingCap = Cp * rho * DataSizing::PlantSizData(pltLoadSizNum).DeltaT * tmpLoadSideVolFlowRate; } else if (this->companionIdentified && this->RatedLoadVolFlowCool > 0.0) { tmpLoadSideVolFlowRate = this->RatedLoadVolFlowCool; Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoadLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoadLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->LoadLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); tmpHeatingCap = Cp * rho * DataSizing::PlantSizData(pltLoadSizNum).DeltaT * tmpLoadSideVolFlowRate; } else { @@ -1475,17 +1474,17 @@ namespace HeatPumpWaterToWaterSimple { } } if (!this->ratedLoadVolFlowHeatWasAutoSized) tmpLoadSideVolFlowRate = this->RatedLoadVolFlowHeat; - int pltSourceSizNum = DataPlant::PlantLoop(this->SourceLoopNum).PlantSizNum; + int pltSourceSizNum = state.dataPlnt->PlantLoop(this->SourceLoopNum).PlantSizNum; if (pltSourceSizNum > 0) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->SourceLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->SourceLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); tmpSourceSideVolFlowRate = tmpHeatingCap * (1.0 - (1.0 / this->refCOP)) / (DataSizing::PlantSizData(pltSourceSizNum).DeltaT * Cp * rho); } else { @@ -1621,7 +1620,6 @@ namespace HeatPumpWaterToWaterSimple { // Using/Aliasing using DataHVACGlobals::TimeStepSys; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -1694,10 +1692,10 @@ namespace HeatPumpWaterToWaterSimple { } rhoLoadSide = - GetDensityGlycol(state, PlantLoop(this->LoadLoopNum).FluidName, LoadSideInletTemp, PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); + GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, LoadSideInletTemp, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); rhoSourceSide = - GetDensityGlycol(state, PlantLoop(this->SourceLoopNum).FluidName, SourceSideInletTemp, PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); + GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, SourceSideInletTemp, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); func1 = ((LoadSideInletTemp + CelsiustoKelvin) / Tref); func2 = ((SourceSideInletTemp + CelsiustoKelvin) / Tref); @@ -1765,10 +1763,10 @@ namespace HeatPumpWaterToWaterSimple { } CpLoadSide = - GetSpecificHeatGlycol(state, PlantLoop(this->LoadLoopNum).FluidName, LoadSideInletTemp, PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); + GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, LoadSideInletTemp, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); CpSourceSide = GetSpecificHeatGlycol( - state, PlantLoop(this->SourceLoopNum).FluidName, SourceSideInletTemp, PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, SourceSideInletTemp, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); LoadSideOutletTemp = LoadSideInletTemp - QLoad / (LoadSideMassFlowRate * CpLoadSide); SourceSideOutletTemp = SourceSideInletTemp + QSource / (SourceSideMassFlowRate * CpSourceSide); @@ -1803,7 +1801,6 @@ namespace HeatPumpWaterToWaterSimple { // Using/Aliasing using DataHVACGlobals::TimeStepSys; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -1874,10 +1871,10 @@ namespace HeatPumpWaterToWaterSimple { return; } rhoLoadSide = - GetDensityGlycol(state, PlantLoop(this->LoadLoopNum).FluidName, LoadSideInletTemp, PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); + GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, LoadSideInletTemp, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); rhoSourceSide = - GetDensityGlycol(state, PlantLoop(this->SourceLoopNum).FluidName, SourceSideInletTemp, PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); + GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, SourceSideInletTemp, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); func1 = ((LoadSideInletTemp + CelsiustoKelvin) / Tref); func2 = ((SourceSideInletTemp + CelsiustoKelvin) / Tref); @@ -1944,10 +1941,10 @@ namespace HeatPumpWaterToWaterSimple { } CpLoadSide = - GetSpecificHeatGlycol(state, PlantLoop(this->LoadLoopNum).FluidName, LoadSideInletTemp, PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); + GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidName, LoadSideInletTemp, state.dataPlnt->PlantLoop(this->LoadLoopNum).FluidIndex, RoutineName); CpSourceSide = GetSpecificHeatGlycol( - state, PlantLoop(this->SourceLoopNum).FluidName, SourceSideInletTemp, PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidName, SourceSideInletTemp, state.dataPlnt->PlantLoop(this->SourceLoopNum).FluidIndex, RoutineName); LoadSideOutletTemp = LoadSideInletTemp + QLoad / (LoadSideMassFlowRate * CpLoadSide); SourceSideOutletTemp = SourceSideInletTemp - QSource / (SourceSideMassFlowRate * CpSourceSide); diff --git a/src/EnergyPlus/ICEngineElectricGenerator.cc b/src/EnergyPlus/ICEngineElectricGenerator.cc index 98ef8498f72..ffe0eefd687 100644 --- a/src/EnergyPlus/ICEngineElectricGenerator.cc +++ b/src/EnergyPlus/ICEngineElectricGenerator.cc @@ -673,7 +673,7 @@ namespace ICEngineElectricGenerator { Real64 HeatRecInTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; Real64 HeatRecCp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, HeatRecInTemp, DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, HeatRecInTemp, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); // Don't divide by zero - Note This also results in no heat recovery when // design Mdot for Heat Recovery - Specified on Chiller Input - is zero @@ -738,7 +738,7 @@ namespace ICEngineElectricGenerator { this->myFlag = false; } - if (this->MyPlantScanFlag && allocated(DataPlant::PlantLoop) && this->HeatRecActive) { + if (this->MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop) && this->HeatRecActive) { errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, @@ -764,9 +764,9 @@ namespace ICEngineElectricGenerator { // size mass flow rate Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HRLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; diff --git a/src/EnergyPlus/IceThermalStorage.cc b/src/EnergyPlus/IceThermalStorage.cc index 276c9fc1f89..a3cd7a79b80 100644 --- a/src/EnergyPlus/IceThermalStorage.cc +++ b/src/EnergyPlus/IceThermalStorage.cc @@ -188,7 +188,7 @@ namespace IceThermalStorage { std::string const RoutineName("SimpleIceStorageData::simulate"); // this was happening in PlantLoopEquip before - auto &thisComp(DataPlant::PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).Comp(calledFromLocation.compNum)); + auto &thisComp(state.dataPlnt->PlantLoop(calledFromLocation.loopNum).LoopSide(calledFromLocation.loopSideNum).Branch(calledFromLocation.branchNum).Comp(calledFromLocation.compNum)); // If component setpoint based control is active for this equipment // then reset CurLoad to original EquipDemand. @@ -232,7 +232,7 @@ namespace IceThermalStorage { Real64 TempSetPt(0.0); Real64 TempIn = DataLoopNode::Node(this->PltInletNodeNum).Temp; { - auto const SELECT_CASE_var1(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var1(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPt = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -244,7 +244,7 @@ namespace IceThermalStorage { Real64 DemandMdot = this->DesignMassFlowRate; Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, TempIn, DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, TempIn, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 MyLoad2 = (DemandMdot * Cp * (TempIn - TempSetPt)); MyLoad = MyLoad2; @@ -266,7 +266,7 @@ namespace IceThermalStorage { Real64 MaxCap; Real64 MinCap; Real64 OptCap; - this->CalcIceStorageCapacity(MaxCap, MinCap, OptCap); + this->CalcIceStorageCapacity(state, MaxCap, MinCap, OptCap); this->CalcIceStorageCharge(state); //***** Discharging Process for ITS ***************************************** @@ -277,12 +277,12 @@ namespace IceThermalStorage { Real64 MaxCap; Real64 MinCap; Real64 OptCap; - this->CalcIceStorageCapacity(MaxCap, MinCap, OptCap); + this->CalcIceStorageCapacity(state, MaxCap, MinCap, OptCap); this->CalcIceStorageDischarge(state, MyLoad, RunFlag, MaxCap); } // Based on input of U value, deciding Dormant/Charge/Discharge process // Update Node properties: mdot and Temperature - this->UpdateNode(MyLoad2, RunFlag); + this->UpdateNode(state, MyLoad2, RunFlag); // Update report variables. this->RecordOutput(MyLoad2, RunFlag); @@ -308,7 +308,7 @@ namespace IceThermalStorage { this->SimDetailedIceStorage(state); // Simulate detailed ice storage - this->UpdateDetailedIceStorage(); // Update detailed ice storage + this->UpdateDetailedIceStorage(state); // Update detailed ice storage this->ReportDetailedIceStorage(); // Report detailed ice storage } @@ -353,7 +353,7 @@ namespace IceThermalStorage { Real64 TempIn = DataLoopNode::Node(NodeNumIn).Temp; // Inlet temperature to component (from plant loop) [C] Real64 TempSetPt(0.0); // Setpoint temperature defined by loop controls [C] { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->PlantLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->PlantLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPt = DataLoopNode::Node(NodeNumOut).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -370,14 +370,14 @@ namespace IceThermalStorage { this->MassFlowRate = DataLoopNode::Node(NodeNumIn).MassFlowRate; // if two-way common pipe and no mass flow and tank is not full, then use design flow rate - if ((DataPlant::PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && + if ((state.dataPlnt->PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && (std::abs(this->MassFlowRate) < DataBranchAirLoopPlant::MassFlowTolerance) && (this->IceFracRemaining < TankChargeToler)) { this->MassFlowRate = this->DesignMassFlowRate; } // Calculate the current load on the ice storage unit Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->PlantLoopNum).FluidName, TempIn, DataPlant::PlantLoop(this->PlantLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->PlantLoopNum).FluidName, TempIn, state.dataPlnt->PlantLoop(this->PlantLoopNum).FluidIndex, RoutineName); // Estimated load on the ice storage unit [W] Real64 LocalLoad = this->MassFlowRate * Cp * (TempIn - TempSetPt); @@ -1196,7 +1196,7 @@ namespace IceThermalStorage { this->TankOutletTemp = 0.0; this->DischargeIterErrors = 0; this->ChargeIterErrors = 0; - this->DesignMassFlowRate = DataPlant::PlantLoop(this->PlantLoopNum).MaxMassFlowRate; + this->DesignMassFlowRate = state.dataPlnt->PlantLoop(this->PlantLoopNum).MaxMassFlowRate; // no design flow rates for model, assume min is zero and max is plant loop's max PlantUtilities::InitComponentNodes(0.0, this->DesignMassFlowRate, @@ -1207,13 +1207,13 @@ namespace IceThermalStorage { this->PlantBranchNum, this->PlantCompNum); - if ((DataPlant::PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && + if ((state.dataPlnt->PlantLoop(this->PlantLoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && (this->PlantLoopSideNum == DataPlant::SupplySide)) { // up flow priority of other components on the same branch as the Ice tank for (CompNum = 1; - CompNum <= DataPlant::PlantLoop(this->PlantLoopNum).LoopSide(DataPlant::SupplySide).Branch(this->PlantBranchNum).TotalComponents; + CompNum <= state.dataPlnt->PlantLoop(this->PlantLoopNum).LoopSide(DataPlant::SupplySide).Branch(this->PlantBranchNum).TotalComponents; ++CompNum) { - DataPlant::PlantLoop(this->PlantLoopNum).LoopSide(DataPlant::SupplySide).Branch(this->PlantBranchNum).Comp(CompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->PlantLoopNum).LoopSide(DataPlant::SupplySide).Branch(this->PlantBranchNum).Comp(CompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyAndTurnsLoopOn; } } @@ -1256,7 +1256,7 @@ namespace IceThermalStorage { } if (state.dataGlobal->BeginEnvrnFlag && this->MyEnvrnFlag2) { - this->DesignMassFlowRate = DataPlant::PlantLoop(this->LoopNum).MaxMassFlowRate; + this->DesignMassFlowRate = state.dataPlnt->PlantLoop(this->LoopNum).MaxMassFlowRate; // no design flow rates for model, assume min is zero and max is plant loop's max PlantUtilities::InitComponentNodes(0.0, this->DesignMassFlowRate, @@ -1266,13 +1266,13 @@ namespace IceThermalStorage { this->LoopSideNum, this->BranchNum, this->CompNum); - if ((DataPlant::PlantLoop(this->LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && + if ((state.dataPlnt->PlantLoop(this->LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && (this->LoopSideNum == DataPlant::SupplySide)) { // up flow priority of other components on the same branch as the Ice tank for (int compNum = 1; - compNum <= DataPlant::PlantLoop(this->LoopNum).LoopSide(DataPlant::SupplySide).Branch(this->BranchNum).TotalComponents; + compNum <= state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(DataPlant::SupplySide).Branch(this->BranchNum).TotalComponents; ++compNum) { - DataPlant::PlantLoop(this->LoopNum).LoopSide(DataPlant::SupplySide).Branch(this->BranchNum).Comp(compNum).FlowPriority = + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(DataPlant::SupplySide).Branch(this->BranchNum).Comp(compNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyAndTurnsLoopOn; } } @@ -1295,7 +1295,7 @@ namespace IceThermalStorage { //****************************************************************************** - void SimpleIceStorageData::CalcIceStorageCapacity(Real64 &MaxCap, Real64 &MinCap, Real64 &OptCap) + void SimpleIceStorageData::CalcIceStorageCapacity(EnergyPlusData &state, Real64 &MaxCap, Real64 &MinCap, Real64 &OptCap) { //------------------------------------------------------------------------ // FIRST PROCESS (MyLoad = 0.0 as IN) @@ -1323,7 +1323,7 @@ namespace IceThermalStorage { // with UAIceDisCh(function of XCurIceFrac), ITSInletTemp and ITSOutletTemp(=Node(OutletNodeNum)%TempSetPoint by E+[C]) // QiceMin is REAL(r64) ITS capacity. Real64 QiceMin; - this->CalcQiceDischageMax(QiceMin); + this->CalcQiceDischageMax(state,QiceMin); // At the first call of ITS model, MyLoad is 0. After that proper MyLoad will be provided by E+. // Therefore, Umin is decided between input U and ITS REAL(r64) capacity. @@ -1355,7 +1355,7 @@ namespace IceThermalStorage { this->ITSInletTemp = DataLoopNode::Node(this->PltInletNodeNum).Temp; //[C] this->ITSOutletTemp = this->ITSInletTemp; //[C] { - auto const SELECT_CASE_var1(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var1(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->ITSOutletSetPointTemp = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1384,7 +1384,7 @@ namespace IceThermalStorage { this->ITSInletTemp = DataLoopNode::Node(this->PltInletNodeNum).Temp; //[C] this->ITSOutletTemp = this->ITSInletTemp; //[C] { - auto const SELECT_CASE_var1(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var1(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->ITSOutletSetPointTemp = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1532,7 +1532,7 @@ namespace IceThermalStorage { this->ITSCoolingEnergy = 0.0; { - auto const SELECT_CASE_var1(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var1(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->ITSOutletSetPointTemp = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var1 == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1560,9 +1560,9 @@ namespace IceThermalStorage { int loopNum = this->LoopNum; Real64 CpFluid = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(loopNum).FluidName, + state.dataPlnt->PlantLoop(loopNum).FluidName, DataLoopNode::Node(this->PltInletNodeNum).Temp, - DataPlant::PlantLoop(loopNum).FluidIndex, + state.dataPlnt->PlantLoop(loopNum).FluidIndex, RoutineName); // Calculate Umyload based on MyLoad from E+ @@ -1614,7 +1614,7 @@ namespace IceThermalStorage { this->ITSCoolingEnergy = this->ITSCoolingRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour; } - void SimpleIceStorageData::CalcQiceDischageMax(Real64 &QiceMin) + void SimpleIceStorageData::CalcQiceDischageMax(EnergyPlusData &state, Real64 &QiceMin) { // Qice is minimized when ITSInletTemp and ITSOutletTemp is almost same due to LMTD method. @@ -1623,7 +1623,7 @@ namespace IceThermalStorage { Real64 ITSInletTemp_loc = DataLoopNode::Node(this->PltInletNodeNum).Temp; Real64 ITSOutletTemp_loc = 0.0; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { ITSOutletTemp_loc = DataLoopNode::Node(this->PltOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1753,14 +1753,14 @@ namespace IceThermalStorage { return (Temp - 32.0) * 5.0 / 9.0; } - void SimpleIceStorageData::UpdateNode(Real64 const myLoad, bool const RunFlag) + void SimpleIceStorageData::UpdateNode(EnergyPlusData &state, Real64 const myLoad, bool const RunFlag) { // SUBROUTINE INFORMATION: // AUTHOR: Dan Fisher // DATE WRITTEN: October 1998 // Update Node Inlet & Outlet MassFlowRat - PlantUtilities::SafeCopyPlantNode(this->PltInletNodeNum, this->PltOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->PltInletNodeNum, this->PltOutletNodeNum); if (myLoad == 0 || !RunFlag) { // Update Outlet Conditions so that same as Inlet, so component can be bypassed if necessary DataLoopNode::Node(this->PltOutletNodeNum).Temp = DataLoopNode::Node(this->PltInletNodeNum).Temp; @@ -1841,7 +1841,7 @@ namespace IceThermalStorage { } } - void DetailedIceStorageData::UpdateDetailedIceStorage() + void DetailedIceStorageData::UpdateDetailedIceStorage(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -1862,7 +1862,7 @@ namespace IceThermalStorage { int InNodeNum = this->PlantInNodeNum; int OutNodeNum = this->PlantOutNodeNum; - PlantUtilities::SafeCopyPlantNode(InNodeNum, OutNodeNum); + PlantUtilities::SafeCopyPlantNode(state, InNodeNum, OutNodeNum); DataLoopNode::Node(OutNodeNum).Temp = this->OutletTemp; } diff --git a/src/EnergyPlus/IceThermalStorage.hh b/src/EnergyPlus/IceThermalStorage.hh index 34be334b812..35a83238bc7 100644 --- a/src/EnergyPlus/IceThermalStorage.hh +++ b/src/EnergyPlus/IceThermalStorage.hh @@ -162,11 +162,11 @@ namespace IceThermalStorage { void CalcIceStorageDormant(EnergyPlusData &state); - void CalcIceStorageCapacity(Real64 &MaxCap, Real64 &MinCap, Real64 &OptCap); + void CalcIceStorageCapacity(EnergyPlusData &state, Real64 &MaxCap, Real64 &MinCap, Real64 &OptCap); void CalcIceStorageDischarge(EnergyPlusData &state, Real64 myLoad, bool RunFlag, Real64 MaxCap); - void CalcQiceDischageMax(Real64 &QiceMin); + void CalcQiceDischageMax(EnergyPlusData &state, Real64 &QiceMin); void CalcIceStorageCharge(EnergyPlusData &state); @@ -176,7 +176,7 @@ namespace IceThermalStorage { void CalcUAIce(Real64 XCurIceFrac_loc, Real64 &UAIceCh_loc, Real64 &UAIceDisCh_loc, Real64 &HLoss_loc); - void UpdateNode(Real64 myLoad, bool RunFlag); + void UpdateNode(EnergyPlusData &state, Real64 myLoad, bool RunFlag); void RecordOutput(Real64 myLoad, bool RunFlag); @@ -261,7 +261,7 @@ namespace IceThermalStorage { void SimDetailedIceStorage(EnergyPlusData &state); - void UpdateDetailedIceStorage(); + void UpdateDetailedIceStorage(EnergyPlusData &state); void ReportDetailedIceStorage(); diff --git a/src/EnergyPlus/LowTempRadiantSystem.cc b/src/EnergyPlus/LowTempRadiantSystem.cc index 68d67568235..23eae65c1e5 100644 --- a/src/EnergyPlus/LowTempRadiantSystem.cc +++ b/src/EnergyPlus/LowTempRadiantSystem.cc @@ -1709,7 +1709,6 @@ namespace LowTempRadiantSystem { // DATE WRITTEN November 2000 // Using/Aliasing - using DataPlant::PlantLoop; using DataPlant::TypeOf_LowTempRadiant_ConstFlow; using DataPlant::TypeOf_LowTempRadiant_VarFlow; using DataSizing::AutoSize; @@ -1824,7 +1823,7 @@ namespace LowTempRadiantSystem { } if (SystemType == LowTempRadiantSystem::SystemType::HydronicSystem) { - if (MyPlantScanFlagHydr(RadSysNum) && allocated(PlantLoop)) { + if (MyPlantScanFlagHydr(RadSysNum) && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; if (HydrRadSys(RadSysNum).HotWaterInNode > 0) { ScanPlantLoopsForObject(state, @@ -1869,7 +1868,7 @@ namespace LowTempRadiantSystem { } if (SystemType == LowTempRadiantSystem::SystemType::ConstantFlowSystem) { - if (MyPlantScanFlagCFlo(RadSysNum) && allocated(PlantLoop)) { + if (MyPlantScanFlagCFlo(RadSysNum) && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; if (CFloRadSys(RadSysNum).HotWaterInNode > 0) { ScanPlantLoopsForObject(state, @@ -1959,9 +1958,9 @@ namespace LowTempRadiantSystem { // set design mass flow rates if (HydrRadSys(RadSysNum).HotWaterInNode > 0) { rho = GetDensityGlycol(state, - PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, RoutineName); HydrRadSys(RadSysNum).WaterFlowMaxHeat = rho * HydrRadSys(RadSysNum).WaterVolFlowMaxHeat; InitComponentNodes(0.0, @@ -1975,9 +1974,9 @@ namespace LowTempRadiantSystem { } if (HydrRadSys(RadSysNum).ColdWaterInNode > 0) { rho = GetDensityGlycol(state, - PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, RoutineName); HydrRadSys(RadSysNum).WaterFlowMaxCool = rho * HydrRadSys(RadSysNum).WaterVolFlowMaxCool; InitComponentNodes(0.0, @@ -2000,9 +1999,9 @@ namespace LowTempRadiantSystem { // set design mass flow rates if (CFloRadSys(RadSysNum).HotWaterInNode > 0) { rho = GetDensityGlycol(state, - PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, RoutineName); CFloRadSys(RadSysNum).HotDesignWaterMassFlowRate = rho * CFloRadSys(RadSysNum).WaterVolFlowMax; InitComponentNodes(0.0, @@ -2016,9 +2015,9 @@ namespace LowTempRadiantSystem { } if (CFloRadSys(RadSysNum).ColdWaterInNode > 0) { rho = GetDensityGlycol(state, - PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, RoutineName); CFloRadSys(RadSysNum).ColdDesignWaterMassFlowRate = rho * CFloRadSys(RadSysNum).WaterVolFlowMax; InitComponentNodes(0.0, @@ -2430,7 +2429,6 @@ namespace LowTempRadiantSystem { using DataHVACGlobals::AutoCalculateSizing; using DataHVACGlobals::CoolingCapacitySizing; using DataHVACGlobals::HeatingCapacitySizing; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -2678,14 +2676,14 @@ namespace LowTempRadiantSystem { if (PltSizHeatNum > 0) { if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(state, - PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, - PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, RoutineName); WaterVolFlowMaxHeatDes = DesCoilLoad / (PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); } else { @@ -2838,14 +2836,14 @@ namespace LowTempRadiantSystem { if (PltSizCoolNum > 0) { if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(state, - PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, - PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, RoutineName); WaterVolFlowMaxCoolDes = DesCoilLoad / (PlantSizData(PltSizCoolNum).DeltaT * Cp * rho); } else { @@ -2987,14 +2985,14 @@ namespace LowTempRadiantSystem { if (PltSizHeatNum > 0) { if (FinalZoneSizing(CurZoneEqNum).NonAirSysDesHeatLoad >= SmallLoad) { rho = GetDensityGlycol(state, - PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, "SizeLowTempRadiantSystem"); Cp = GetSpecificHeatGlycol(state, - PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, "SizeLowTempRadiantSystem"); WaterVolFlowMaxHeatDes = FinalZoneSizing(CurZoneEqNum).NonAirSysDesHeatLoad / (PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); @@ -3020,14 +3018,14 @@ namespace LowTempRadiantSystem { if (PltSizCoolNum > 0) { if (FinalZoneSizing(CurZoneEqNum).NonAirSysDesCoolLoad >= SmallLoad) { rho = GetDensityGlycol(state, - PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, "SizeLowTempRadiantSystem"); Cp = GetSpecificHeatGlycol(state, - PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, "SizeLowTempRadiantSystem"); WaterVolFlowMaxCoolDes = FinalZoneSizing(CurZoneEqNum).NonAirSysDesCoolLoad / (PlantSizData(PltSizCoolNum).DeltaT * Cp * rho); @@ -5039,7 +5037,6 @@ namespace LowTempRadiantSystem { // Using/Aliasing using DataHeatBalance::Zone; using DataLoopNode::Node; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::SafeCopyPlantNode; using PlantUtilities::SetComponentFlowRate; @@ -5071,18 +5068,18 @@ namespace LowTempRadiantSystem { waterMassFlow = Node(waterInletNode).MassFlowRate; cpWater = GetSpecificHeatGlycol( - state, PlantLoop(this->HWLoopNum).FluidName, Node(waterInletNode).Temp, PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, Node(waterInletNode).Temp, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); if (this->OperatingMode == HeatingMode) { if ((cpWater > 0.0) && (waterMassFlow > 0.0)) { - SafeCopyPlantNode(waterInletNode, waterOutletNode); + SafeCopyPlantNode(state, waterInletNode, waterOutletNode); Node(waterOutletNode).Temp = Node(waterInletNode).Temp - TotalHeatSource / waterMassFlow / cpWater; } else { - SafeCopyPlantNode(waterInletNode, waterOutletNode); + SafeCopyPlantNode(state, waterInletNode, waterOutletNode); } } else { // CoolingMode or not on - SafeCopyPlantNode(waterInletNode, waterOutletNode); + SafeCopyPlantNode(state, waterInletNode, waterOutletNode); } this->checkForOutOfRangeTemperatureResult(state, Node(waterOutletNode).Temp, Node(waterInletNode).Temp); @@ -5095,18 +5092,18 @@ namespace LowTempRadiantSystem { waterMassFlow = Node(waterInletNode).MassFlowRate; cpWater = GetSpecificHeatGlycol( - state, PlantLoop(this->CWLoopNum).FluidName, Node(waterInletNode).Temp, PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, Node(waterInletNode).Temp, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); if (this->OperatingMode == CoolingMode) { if ((cpWater > 0.0) && (waterMassFlow > 0.0)) { - SafeCopyPlantNode(waterInletNode, waterOutletNode); + SafeCopyPlantNode(state, waterInletNode, waterOutletNode); Node(waterOutletNode).Temp = Node(waterInletNode).Temp - TotalHeatSource / waterMassFlow / cpWater; } else { - SafeCopyPlantNode(waterInletNode, waterOutletNode); + SafeCopyPlantNode(state, waterInletNode, waterOutletNode); } } else { // HeatingMode or not on - SafeCopyPlantNode(waterInletNode, waterOutletNode); + SafeCopyPlantNode(state, waterInletNode, waterOutletNode); } this->checkForOutOfRangeTemperatureResult(state, Node(waterOutletNode).Temp, Node(waterInletNode).Temp); @@ -5119,7 +5116,6 @@ namespace LowTempRadiantSystem { // Using/Aliasing using DataHeatBalance::Zone; using DataLoopNode::Node; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::SafeCopyPlantNode; using PlantUtilities::SetComponentFlowRate; @@ -5138,7 +5134,7 @@ namespace LowTempRadiantSystem { waterInletNode = this->HotWaterInNode; waterOutletNode = this->HotWaterOutNode; - SafeCopyPlantNode(waterInletNode, waterOutletNode); + SafeCopyPlantNode(state, waterInletNode, waterOutletNode); if (this->OperatingMode == HeatingMode) { @@ -5163,7 +5159,7 @@ namespace LowTempRadiantSystem { waterInletNode = this->ColdWaterInNode; waterOutletNode = this->ColdWaterOutNode; - SafeCopyPlantNode(waterInletNode, waterOutletNode); + SafeCopyPlantNode(state, waterInletNode, waterOutletNode); if (this->OperatingMode == CoolingMode) { @@ -5340,7 +5336,6 @@ namespace LowTempRadiantSystem { // Code based loosely on code from IBLAST program (research version) // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; // Return value @@ -5412,10 +5407,10 @@ namespace LowTempRadiantSystem { auto const SELECT_CASE_var1(this->OperatingMode); if (SELECT_CASE_var1 == HeatingMode) { CpWater = - GetSpecificHeatGlycol(state, PlantLoop(this->HWLoopNum).FluidName, Temperature, PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); + GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, Temperature, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); } else if (SELECT_CASE_var1 == CoolingMode) { CpWater = - GetSpecificHeatGlycol(state, PlantLoop(this->CWLoopNum).FluidName, Temperature, PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, Temperature, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); } else { assert(false); } @@ -5654,7 +5649,6 @@ namespace LowTempRadiantSystem { using DataHeatBalance::Zone; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; - using DataPlant::PlantLoop; using DataSurfaces::Surface; using FluidProperties::GetSpecificHeatGlycol; @@ -5680,7 +5674,7 @@ namespace LowTempRadiantSystem { if (this->OperatingMode == HeatingMode) { cpFluid = GetSpecificHeatGlycol( - state, PlantLoop(this->HWLoopNum).FluidName, Node(this->HotWaterInNode).Temp, PlantLoop(this->HWLoopNum).FluidIndex, routineName); + state, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, Node(this->HotWaterInNode).Temp, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, routineName); this->HeatPower = totalRadSysPower; if (this->PumpMassFlowRate > 0.0) { @@ -5691,7 +5685,7 @@ namespace LowTempRadiantSystem { } else if (this->OperatingMode == CoolingMode) { cpFluid = GetSpecificHeatGlycol( - state, PlantLoop(this->CWLoopNum).FluidName, Node(this->ColdWaterInNode).Temp, PlantLoop(this->CWLoopNum).FluidIndex, routineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, Node(this->ColdWaterInNode).Temp, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, routineName); this->CoolPower = -totalRadSysPower; this->PumpInletTemp = this->WaterInletTemp - (this->PumpHeattoFluid / (this->PumpMassFlowRate * cpFluid)); diff --git a/src/EnergyPlus/MicroCHPElectricGenerator.cc b/src/EnergyPlus/MicroCHPElectricGenerator.cc index 49bb984dce7..1ad9dd22be7 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.cc +++ b/src/EnergyPlus/MicroCHPElectricGenerator.cc @@ -563,9 +563,9 @@ namespace MicroCHPElectricGenerator { constexpr auto RoutineName("MicroCHPDataStruct::onInitLoopEquip"); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataLoopNode::Node(this->PlantInletNodeID).Temp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); if (this->A42Model.InternalFlowControl) { // got a curve this->PlantMassFlowRateMax = 2.0 * CurveManager::CurveValue(state, @@ -573,9 +573,9 @@ namespace MicroCHPElectricGenerator { this->A42Model.MaxElecPower, DataLoopNode::Node(this->PlantInletNodeID).Temp); } else if (this->CWLoopSideNum == DataPlant::SupplySide) { - if (DataPlant::PlantLoop(this->CWLoopNum).MaxMassFlowRate > 0.0) { - this->PlantMassFlowRateMax = DataPlant::PlantLoop(this->CWLoopNum).MaxMassFlowRate; - } else if (DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum > 0) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).MaxMassFlowRate > 0.0) { + this->PlantMassFlowRateMax = state.dataPlnt->PlantLoop(this->CWLoopNum).MaxMassFlowRate; + } else if (state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum > 0) { this->PlantMassFlowRateMax = DataSizing::PlantSizData(this->CWLoopNum).DesVolFlowRate * rho; } else { this->PlantMassFlowRateMax = 2.0; @@ -613,7 +613,7 @@ namespace MicroCHPElectricGenerator { this->myFlag = false; } - if (this->MyPlantScanFlag && allocated(DataPlant::PlantLoop)) { + if (this->MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, @@ -636,7 +636,7 @@ namespace MicroCHPElectricGenerator { if (!this->A42Model.InternalFlowControl) { // IF this is on the supply side and not internal flow control then reset flow priority to lower if (this->CWLoopSideNum == DataPlant::SupplySide) { - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_TakesWhatGets; } } @@ -1102,7 +1102,7 @@ namespace MicroCHPElectricGenerator { TcwOut, this->A42Model.MCeng, this->A42Model.UAhx, this->A42Model.UAskin, thisAmbientTemp, Qgenss, this->A42Model.TengLast, dt); Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, TcwIn, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, TcwIn, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); TcwOut = FuncDetermineCoolantWaterExitTemp( TcwIn, this->A42Model.MCcw, this->A42Model.UAhx, MdotCW * Cp, Teng, this->A42Model.TempCWOutLast, dt); @@ -1307,12 +1307,12 @@ namespace MicroCHPElectricGenerator { constexpr auto RoutineName("CalcUpdateHeatRecovery"); - PlantUtilities::SafeCopyPlantNode(this->PlantInletNodeID, this->PlantOutletNodeID); + PlantUtilities::SafeCopyPlantNode(state, this->PlantInletNodeID, this->PlantOutletNodeID); DataLoopNode::Node(this->PlantOutletNodeID).Temp = this->A42Model.TcwOut; Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, this->A42Model.TcwIn, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, this->A42Model.TcwIn, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); DataLoopNode::Node(this->PlantOutletNodeID).Enthalpy = this->A42Model.TcwOut * Cp; } @@ -1344,7 +1344,7 @@ namespace MicroCHPElectricGenerator { this->A42Model.QdotHX = this->A42Model.UAhx * (this->A42Model.Teng - this->A42Model.TcwOut); // heat recovered rate (W) Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, this->A42Model.TcwIn, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, this->A42Model.TcwIn, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->A42Model.QdotHR = this->PlantMassFlowRate * Cp * (this->A42Model.TcwOut - this->A42Model.TcwIn); this->A42Model.TotalHeatEnergyRec = diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index 90f85a495e9..0dbb7e8a817 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -934,7 +934,7 @@ namespace MicroturbineElectricGenerator { this->myFlag = false; } - if (this->MyPlantScanFlag && allocated(DataPlant::PlantLoop) && this->HeatRecActive) { + if (this->MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop) && this->HeatRecActive) { errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, @@ -960,9 +960,9 @@ namespace MicroturbineElectricGenerator { // size mass flow rate Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HRLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->RefHeatRecVolFlowRate; @@ -1134,7 +1134,7 @@ namespace MicroturbineElectricGenerator { if (this->HeatRecActive) { HeatRecInTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; HeatRecCp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, HeatRecInTemp, DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, HeatRecInTemp, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); heatRecMdot = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; } else { HeatRecInTemp = 0.0; @@ -1459,7 +1459,7 @@ namespace MicroturbineElectricGenerator { // Calculate heat recovery rate modifier curve output (function of water [volumetric] flow rate) if (this->HeatRecRateFWaterFlowCurveNum > 0) { Real64 rho = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, HeatRecInTemp, DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, HeatRecInTemp, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); // Heat recovery fluid flow rate (m3/s) Real64 HeatRecVolFlowRate = heatRecMdot / rho; diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index 348083cd93c..a83ad84e04a 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -1052,7 +1052,6 @@ namespace OutdoorAirUnit { using DataHVACGlobals::ZoneCompTurnFansOff; using DataHVACGlobals::ZoneCompTurnFansOn; using DataLoopNode::Node; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterCooling; using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; @@ -1127,7 +1126,7 @@ namespace OutdoorAirUnit { OutAirUnit(OAUnitNum).AvailStatus = ZoneComp(OutdoorAirUnit_Num).ZoneCompAvailMgrs(OAUnitNum).AvailStatus; } - if (MyPlantScanFlag(OAUnitNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(OAUnitNum) && allocated(state.dataPlnt->PlantLoop)) { for (compLoop = 1; compLoop <= OutAirUnit(OAUnitNum).NumComponents; ++compLoop) { if ((OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilWaterCooling) || (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilWaterDetailedFlatCooling) || @@ -1213,9 +1212,9 @@ namespace OutdoorAirUnit { (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilWaterDetailedFlatCooling)) { OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentType, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentName, errFlag); - rho = GetDensityGlycol(state, PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, RoutineName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow; OutAirUnit(OAUnitNum).OAEquip(compLoop).MinWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MinVolWaterFlow; @@ -1232,9 +1231,9 @@ namespace OutdoorAirUnit { if (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilWaterSimpleHeating) { OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentType, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentName, errFlag); - rho = GetDensityGlycol(state, PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, RoutineName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow; OutAirUnit(OAUnitNum).OAEquip(compLoop).MinWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MinVolWaterFlow; @@ -1250,10 +1249,10 @@ namespace OutdoorAirUnit { if (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == TypeOf_CoilSteamAirHeating) { OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = GetCoilMaxSteamFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentIndex, errFlag); - Real64 rho = GetSatDensityRefrig(state, PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, + Real64 rho = GetSatDensityRefrig(state, state.dataPlnt->PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, DataGlobalConstants::SteamInitConvTemp, 1.0, - PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, RoutineName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow; OutAirUnit(OAUnitNum).OAEquip(compLoop).MinWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MinVolWaterFlow; @@ -1269,9 +1268,9 @@ namespace OutdoorAirUnit { if (OutAirUnit(OAUnitNum).OAEquip(compLoop).CoilPlantTypeOfNum == WaterCoil_CoolingHXAsst) { OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentType, OutAirUnit(OAUnitNum).OAEquip(compLoop).ComponentName, errFlag); - rho = GetDensityGlycol(state, PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(OutAirUnit(OAUnitNum).OAEquip(compLoop).LoopNum).FluidIndex, RoutineName); OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MaxVolWaterFlow; OutAirUnit(OAUnitNum).OAEquip(compLoop).MinWaterMassFlow = rho * OutAirUnit(OAUnitNum).OAEquip(compLoop).MinVolWaterFlow; @@ -1384,7 +1383,6 @@ namespace OutdoorAirUnit { // Using/Aliasing using namespace DataSizing; using DataHVACGlobals::cFanTypes; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterCooling; using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; diff --git a/src/EnergyPlus/OutsideEnergySources.cc b/src/EnergyPlus/OutsideEnergySources.cc index 7028073b917..d8a171bff65 100644 --- a/src/EnergyPlus/OutsideEnergySources.cc +++ b/src/EnergyPlus/OutsideEnergySources.cc @@ -321,12 +321,12 @@ namespace OutsideEnergySources { ShowFatalError(state, "InitSimVars: Program terminated due to previous condition(s)."); } // set limits on outlet node temps to plant loop limits - DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).MinOutletTemp = - DataPlant::PlantLoop(this->LoopNum).MinTemp; - DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).MaxOutletTemp = - DataPlant::PlantLoop(this->LoopNum).MaxTemp; + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).MinOutletTemp = + state.dataPlnt->PlantLoop(this->LoopNum).MinTemp; + state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).Branch(this->BranchNum).Comp(this->CompNum).MaxOutletTemp = + state.dataPlnt->PlantLoop(this->LoopNum).MaxTemp; // Register design flow rate for inlet node (helps to autosize comp setpoint op scheme flows - PlantUtilities::RegisterPlantCompDesignFlow(this->InletNodeNum, DataPlant::PlantLoop(this->LoopNum).MaxVolFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(this->InletNodeNum, state.dataPlnt->PlantLoop(this->LoopNum).MaxVolFlowRate); this->OneTimeInitFlag = false; @@ -369,8 +369,8 @@ namespace OutsideEnergySources { // begin environment inits if (state.dataGlobal->BeginEnvrnFlag && this->BeginEnvrnInitFlag) { // component model has not design flow rates, using data for overall plant loop - PlantUtilities::InitComponentNodes(DataPlant::PlantLoop(this->LoopNum).MinMassFlowRate, - DataPlant::PlantLoop(this->LoopNum).MaxMassFlowRate, + PlantUtilities::InitComponentNodes(state.dataPlnt->PlantLoop(this->LoopNum).MinMassFlowRate, + state.dataPlnt->PlantLoop(this->LoopNum).MaxMassFlowRate, this->InletNodeNum, this->OutletNodeNum, this->LoopNum, @@ -383,7 +383,7 @@ namespace OutsideEnergySources { Real64 TempPlantMassFlow(0.0); if (std::abs(MyLoad) > 0.0) { - TempPlantMassFlow = DataPlant::PlantLoop(this->LoopNum).MaxMassFlowRate; + TempPlantMassFlow = state.dataPlnt->PlantLoop(this->LoopNum).MaxMassFlowRate; } // get actual mass flow to use, hold in MassFlowRate variable @@ -416,17 +416,17 @@ namespace OutsideEnergySources { typeName = "Heating"; } - int const PltSizNum = DataPlant::PlantLoop(this->LoopNum).PlantSizNum; + int const PltSizNum = state.dataPlnt->PlantLoop(this->LoopNum).PlantSizNum; if (PltSizNum > 0) { Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, "SizeDistrict" + typeName); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, "SizeDistrict" + typeName); Real64 const NomCapDes = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate; if (DataPlant::PlantFirstSizesOkayToFinalize) { @@ -489,11 +489,11 @@ namespace OutsideEnergySources { // set inlet and outlet nodes int const LoopNum = this->LoopNum; - Real64 const LoopMinTemp = DataPlant::PlantLoop(LoopNum).MinTemp; - Real64 const LoopMaxTemp = DataPlant::PlantLoop(LoopNum).MaxTemp; + Real64 const LoopMinTemp = state.dataPlnt->PlantLoop(LoopNum).MinTemp; + Real64 const LoopMaxTemp = state.dataPlnt->PlantLoop(LoopNum).MaxTemp; Real64 const Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(LoopNum).FluidName, this->InletTemp, DataPlant::PlantLoop(LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(LoopNum).FluidName, this->InletTemp, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); // apply power limit from input Real64 CapFraction = ScheduleManager::GetCurrentScheduleValue(state, this->CapFractionSchedNum); diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.cc b/src/EnergyPlus/PackagedTerminalHeatPump.cc index d4857197a9f..29f1af5373e 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -3772,7 +3772,6 @@ namespace PackagedTerminalHeatPump { auto &GetCoilMaxSteamFlowRate(SteamCoils::GetCoilMaxSteamFlowRate); auto &GetSteamCoilCapacity(SteamCoils::GetCoilCapacity); using DataHeatBalFanSys::TempControlType; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterSimpleHeating; using DataZoneEquipment::ZoneEquipConfig; @@ -3857,7 +3856,7 @@ namespace PackagedTerminalHeatPump { PTUnit(PTUnitNum).AvailStatus = ZoneComp(PTUnit(PTUnitNum).ZoneEquipType).ZoneCompAvailMgrs(PTObjectIndex).AvailStatus; } - if (MyPlantScanFlag(PTUnitNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(PTUnitNum) && allocated(state.dataPlnt->PlantLoop)) { if ((PTUnit(PTUnitNum).ACHeatCoilType_Num == Coil_HeatingWater) || (PTUnit(PTUnitNum).ACHeatCoilType_Num == Coil_HeatingSteam)) { if (PTUnit(PTUnitNum).ACHeatCoilType_Num == Coil_HeatingWater) { @@ -3885,9 +3884,9 @@ namespace PackagedTerminalHeatPump { if (PTUnit(PTUnitNum).MaxHeatCoilFluidFlow > 0.0) { rho = GetDensityGlycol(state, - PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidName, + state.dataPlnt->PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidIndex, RoutineName); PTUnit(PTUnitNum).MaxHeatCoilFluidFlow = @@ -3926,7 +3925,7 @@ namespace PackagedTerminalHeatPump { } // fill outlet node for coil - PTUnit(PTUnitNum).PlantCoilOutletNode = PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum) + PTUnit(PTUnitNum).PlantCoilOutletNode = state.dataPlnt->PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum) .LoopSide(PTUnit(PTUnitNum).HeatCoilLoopSide) .Branch(PTUnit(PTUnitNum).HeatCoilBranchNum) .Comp(PTUnit(PTUnitNum).HeatCoilCompNum) @@ -3958,9 +3957,9 @@ namespace PackagedTerminalHeatPump { GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", PTUnit(PTUnitNum).SuppHeatCoilName, ErrorsFound); if (PTUnit(PTUnitNum).MaxSuppCoilFluidFlow > 0.0) { - rho = GetDensityGlycol(state, PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidIndex, RoutineName); PTUnit(PTUnitNum).MaxSuppCoilFluidFlow = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", PTUnit(PTUnitNum).SuppHeatCoilName, ErrorsFound) * rho; @@ -3992,7 +3991,7 @@ namespace PackagedTerminalHeatPump { } } // fill outlet node for coil - PTUnit(PTUnitNum).PlantCoilOutletNode = PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum) + PTUnit(PTUnitNum).PlantCoilOutletNode = state.dataPlnt->PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum) .LoopSide(PTUnit(PTUnitNum).SuppCoilLoopSide) .Branch(PTUnit(PTUnitNum).SuppCoilBranchNum) .Comp(PTUnit(PTUnitNum).SuppCoilCompNum) @@ -4326,9 +4325,9 @@ namespace PackagedTerminalHeatPump { SimulateWaterCoilComponents(state, PTUnit(PTUnitNum).ACHeatCoilName, FirstHVACIteration, PTUnit(PTUnitNum).ACHeatCoilIndex); CoilMaxVolFlowRate = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", PTUnit(PTUnitNum).ACHeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != AutoSize) { - rho = GetDensityGlycol(state, PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(PTUnit(PTUnitNum).HeatCoilLoopNum).FluidIndex, RoutineNameSpace); PTUnit(PTUnitNum).MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * rho; } @@ -4364,9 +4363,9 @@ namespace PackagedTerminalHeatPump { SimulateWaterCoilComponents(state, PTUnit(PTUnitNum).SuppHeatCoilName, FirstHVACIteration, PTUnit(PTUnitNum).SuppHeatCoilIndex); CoilMaxVolFlowRate = GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", PTUnit(PTUnitNum).SuppHeatCoilName, ErrorsFound); if (CoilMaxVolFlowRate != AutoSize) { - rho = GetDensityGlycol(state, PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(PTUnit(PTUnitNum).SuppCoilLoopNum).FluidIndex, RoutineNameSpace); PTUnit(PTUnitNum).MaxSuppCoilFluidFlow = CoilMaxVolFlowRate * rho; } diff --git a/src/EnergyPlus/PackagedThermalStorageCoil.cc b/src/EnergyPlus/PackagedThermalStorageCoil.cc index caaa281e6b0..3b7908f6560 100644 --- a/src/EnergyPlus/PackagedThermalStorageCoil.cc +++ b/src/EnergyPlus/PackagedThermalStorageCoil.cc @@ -1829,7 +1829,6 @@ namespace PackagedThermalStorageCoil { // na // Using/Aliasing - using DataPlant::PlantLoop; using DataPlant::TypeOf_PackagedTESCoolingCoil; using PlantUtilities::ScanPlantLoopsForObject; @@ -1887,18 +1886,18 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).TESPlantBranchNum = brnum; TESCoil(TESCoilNum).TESPlantCompNum = cpnum; - if ((PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumIn != TESCoil(TESCoilNum).TESPlantInletNodeNum) || - (PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumOut != TESCoil(TESCoilNum).TESPlantOutletNodeNum)) { + if ((state.dataPlnt->PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumIn != TESCoil(TESCoilNum).TESPlantInletNodeNum) || + (state.dataPlnt->PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumOut != TESCoil(TESCoilNum).TESPlantOutletNodeNum)) { ShowSevereError(state, "InitTESCoil: Coil:Cooling:DX:SingleSpeed:ThermalStorage =\"" + TESCoil(TESCoilNum).Name + "\", non-matching plant nodes."); ShowContinueError(state, "...in Branch=\"" + - PlantLoop(TESCoil(TESCoilNum).TESPlantLoopNum) + state.dataPlnt->PlantLoop(TESCoil(TESCoilNum).TESPlantLoopNum) .LoopSide(TESCoil(TESCoilNum).TESPlantLoopSideNum) .Branch(TESCoil(TESCoilNum).TESPlantBranchNum) .Name + "\", Component referenced with:"); - ShowContinueError(state, "...Inlet Node=\"" + NodeID(PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumIn)); - ShowContinueError(state, "...Outlet Node=\"" + NodeID(PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumOut)); + ShowContinueError(state, "...Inlet Node=\"" + NodeID(state.dataPlnt->PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumIn)); + ShowContinueError(state, "...Outlet Node=\"" + NodeID(state.dataPlnt->PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumOut)); ShowContinueError(state, "...TES Inlet Node=\"" + NodeID(TESCoil(TESCoilNum).TESPlantInletNodeNum)); ShowContinueError(state, "...TES Outlet Node=\"" + NodeID(TESCoil(TESCoilNum).TESPlantOutletNodeNum)); errFlag = true; @@ -4527,7 +4526,6 @@ namespace PackagedThermalStorageCoil { // Using/Aliasing using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using WaterThermalTanks::WaterThermalTankData; @@ -4608,9 +4606,9 @@ namespace PackagedThermalStorageCoil { TESCoil(TESCoilNum).FluidTankTempFinal = NewTankTemp; if (TESCoil(TESCoilNum).TESPlantConnectionAvailable) { - CpPlantConnection = GetSpecificHeatGlycol(state, PlantLoop(TESCoil(TESCoilNum).TESPlantLoopNum).FluidName, + CpPlantConnection = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(TESCoil(TESCoilNum).TESPlantLoopNum).FluidName, Node(TESCoil(TESCoilNum).TESPlantInletNodeNum).Temp, - PlantLoop(TESCoil(TESCoilNum).TESPlantLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(TESCoil(TESCoilNum).TESPlantLoopNum).FluidIndex, calcTESIceStorageTank); TESCoil(TESCoilNum).QdotPlant = Node(TESCoil(TESCoilNum).TESPlantInletNodeNum).MassFlowRate * CpPlantConnection * @@ -4663,7 +4661,6 @@ namespace PackagedThermalStorageCoil { // Using/Aliasing using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; // Locals @@ -4694,9 +4691,9 @@ namespace PackagedThermalStorageCoil { // update plant connection (if any) if (TESCoil(TESCoilNum).TESPlantConnectionAvailable) { - Cp = GetSpecificHeatGlycol(state, PlantLoop(TESCoil(TESCoilNum).TESPlantLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(TESCoil(TESCoilNum).TESPlantLoopNum).FluidName, Node(TESCoil(TESCoilNum).TESPlantInletNodeNum).Temp, - PlantLoop(TESCoil(TESCoilNum).TESPlantLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(TESCoil(TESCoilNum).TESPlantLoopNum).FluidIndex, RoutineName); TESCoil(TESCoilNum).QdotPlant = Node(TESCoil(TESCoilNum).TESPlantInletNodeNum).MassFlowRate * Cp * diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index ef7d4cc6900..10d0c417efb 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -155,7 +155,7 @@ namespace PhotovoltaicThermalCollectors { this->initialize(state, FirstHVACIteration); this->control(); this->calculate(state); - this->update(); + this->update(state); } void GetPVTcollectorsInput(EnergyPlusData &state) @@ -470,7 +470,7 @@ namespace PhotovoltaicThermalCollectors { } if (this->SetLoopIndexFlag) { - if (allocated(DataPlant::PlantLoop) && (this->PlantInletNodeNum > 0)) { + if (allocated(state.dataPlnt->PlantLoop) && (this->PlantInletNodeNum > 0)) { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, @@ -578,9 +578,9 @@ namespace PhotovoltaicThermalCollectors { if (SELECT_CASE_var == WorkingFluidEnum::LIQUID) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->WLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->WLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->WLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->WLoopNum).FluidIndex, RoutineName); this->MaxMassFlowRate = this->DesignVolFlowRate * rho; @@ -658,10 +658,10 @@ namespace PhotovoltaicThermalCollectors { if (this->WorkingFluidType == WorkingFluidEnum::LIQUID) { if (!allocated(DataSizing::PlantSizData)) return; - if (!allocated(DataPlant::PlantLoop)) return; + if (!allocated(state.dataPlnt->PlantLoop)) return; if (this->WLoopNum > 0) { - PltSizNum = DataPlant::PlantLoop(this->WLoopNum).PlantSizNum; + PltSizNum = state.dataPlnt->PlantLoop(this->WLoopNum).PlantSizNum; } if (this->WLoopSideNum == DataPlant::SupplySide) { if (PltSizNum > 0) { @@ -1031,7 +1031,7 @@ namespace PhotovoltaicThermalCollectors { } } - void PVTCollectorStruct::update() + void PVTCollectorStruct::update(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -1049,7 +1049,7 @@ namespace PhotovoltaicThermalCollectors { InletNode = this->PlantInletNodeNum; OutletNode = this->PlantOutletNodeNum; - PlantUtilities::SafeCopyPlantNode(InletNode, OutletNode); + PlantUtilities::SafeCopyPlantNode(state, InletNode, OutletNode); DataLoopNode::Node(OutletNode).Temp = this->Report.ToutletWorkFluid; } else if (SELECT_CASE_var == WorkingFluidEnum::AIR) { diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.hh b/src/EnergyPlus/PhotovoltaicThermalCollectors.hh index 86e4808c39e..4d48c0ca722 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.hh +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.hh @@ -178,7 +178,7 @@ namespace PhotovoltaicThermalCollectors { void calculate(EnergyPlusData &state); - void update(); + void update(EnergyPlusData &state); }; extern Array1D PVT; diff --git a/src/EnergyPlus/PipeHeatTransfer.cc b/src/EnergyPlus/PipeHeatTransfer.cc index b62d4524923..c72ce52d195 100644 --- a/src/EnergyPlus/PipeHeatTransfer.cc +++ b/src/EnergyPlus/PipeHeatTransfer.cc @@ -788,7 +788,6 @@ namespace EnergyPlus::PipeHeatTransfer { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::ScanPlantLoopsForObject; @@ -978,8 +977,8 @@ namespace EnergyPlus::PipeHeatTransfer { // Thus, this is called at the beginning of every time step once. this->FluidSpecHeat = - GetSpecificHeatGlycol(state, PlantLoop(this->LoopNum).FluidName, state.dataPipeHT->nsvInletTemp, PlantLoop(this->LoopNum).FluidIndex, RoutineName); - this->FluidDensity = GetDensityGlycol(state, PlantLoop(this->LoopNum).FluidName, state.dataPipeHT->nsvInletTemp, PlantLoop(this->LoopNum).FluidIndex, RoutineName); + GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, state.dataPipeHT->nsvInletTemp, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); + this->FluidDensity = GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, state.dataPipeHT->nsvInletTemp, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // At this point, for all Pipe:Interior objects we should zero out the energy and rate arrays this->FluidHeatLossRate = 0.0; @@ -1415,7 +1414,6 @@ namespace EnergyPlus::PipeHeatTransfer { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::PlantLoop; // SUBROUTINE ARGUMENT DEFINITIONS: // INTEGER, INTENT(IN) :: PipeHTNum ! Index for the surface @@ -1443,7 +1441,7 @@ namespace EnergyPlus::PipeHeatTransfer { Node(state.dataPipeHT->nsvOutletNodeNum).MassFlowRateMaxAvail = Node(state.dataPipeHT->nsvInletNodeNum).MassFlowRateMaxAvail; Node(state.dataPipeHT->nsvOutletNodeNum).Quality = Node(state.dataPipeHT->nsvInletNodeNum).Quality; // Only pass pressure if we aren't doing a pressure simulation - switch (PlantLoop(this->LoopNum).PressureSimType) { + switch (state.dataPlnt->PlantLoop(this->LoopNum).PressureSimType) { case DataPlant::iPressSimType::NoPressure: Node(state.dataPipeHT->nsvOutletNodeNum).Press = Node(state.dataPipeHT->nsvInletNodeNum).Press; break; @@ -1573,7 +1571,6 @@ namespace EnergyPlus::PipeHeatTransfer { // Code based loosely on code from IBLAST program (research version) // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetConductivityGlycol; using FluidProperties::GetViscosityGlycol; @@ -1647,8 +1644,8 @@ namespace EnergyPlus::PipeHeatTransfer { } // look up conductivity and viscosity - Kactual = GetConductivityGlycol(state, PlantLoop(LoopNum).FluidName, this->FluidTemp(0), PlantLoop(LoopNum).FluidIndex, RoutineName); // W/m-K - MUactual = GetViscosityGlycol(state, PlantLoop(LoopNum).FluidName, this->FluidTemp(0), PlantLoop(LoopNum).FluidIndex, RoutineName) / + Kactual = GetConductivityGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, this->FluidTemp(0), state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); // W/m-K + MUactual = GetViscosityGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, this->FluidTemp(0), state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName) / 1000.0; // Note fluid properties routine returns mPa-s, we need Pa-s // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) - as RadiantSysLowTemp diff --git a/src/EnergyPlus/Pipes.cc b/src/EnergyPlus/Pipes.cc index 43b3b73698d..6d6ba8307da 100644 --- a/src/EnergyPlus/Pipes.cc +++ b/src/EnergyPlus/Pipes.cc @@ -127,7 +127,7 @@ namespace Pipes { if (state.dataGlobal->BeginEnvrnFlag && this->EnvrnFlag) { PlantUtilities::InitComponentNodes(0.0, - DataPlant::PlantLoop(this->LoopNum).MaxMassFlowRate, + state.dataPlnt->PlantLoop(this->LoopNum).MaxMassFlowRate, this->InletNodeNum, this->OutletNodeNum, this->LoopNum, @@ -139,7 +139,7 @@ namespace Pipes { if (!state.dataGlobal->BeginEnvrnFlag) this->EnvrnFlag = true; - PlantUtilities::SafeCopyPlantNode(this->InletNodeNum, this->OutletNodeNum, this->LoopNum); + PlantUtilities::SafeCopyPlantNode(state, this->InletNodeNum, this->OutletNodeNum, this->LoopNum); } void GetPipeInput(EnergyPlusData &state) diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index 258c2a41995..04555164fce 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -66,7 +66,6 @@ namespace EnergyPlus::DataPlant { }; // Parameters for Component/Equipment Types (ref: TypeOf in CompData) - int const NumSimPlantEquipTypes(96); Array1D_string const SimPlantEquipTypes(NumSimPlantEquipTypes, {"BOILER:HOTWATER", "BOILER:STEAM", @@ -278,104 +277,6 @@ namespace EnergyPlus::DataPlant { LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both}); - int const TypeOf_Other(-1); - int const TypeOf_Boiler_Simple(1); - int const TypeOf_Boiler_Steam(2); - int const TypeOf_Chiller_Absorption(3); // older BLAST absorption chiller - int const TypeOf_Chiller_Indirect_Absorption(4); // revised absorption chiller - int const TypeOf_Chiller_CombTurbine(5); - int const TypeOf_Chiller_ConstCOP(6); - int const TypeOf_Chiller_DFAbsorption(7); - int const TypeOf_Chiller_Electric(8); // basic BLAST Chiller - int const TypeOf_Chiller_ElectricEIR(9); - int const TypeOf_Chiller_ElectricReformEIR(10); - int const TypeOf_Chiller_EngineDriven(11); - int const TypeOf_CoolingTower_SingleSpd(12); - int const TypeOf_CoolingTower_TwoSpd(13); - int const TypeOf_CoolingTower_VarSpd(14); - int const TypeOf_Generator_FCExhaust(15); - int const TypeOf_HeatPumpWtrHeaterPumped(16); - int const TypeOf_HPWaterEFCooling(17); - int const TypeOf_HPWaterEFHeating(18); - int const TypeOf_HPWaterPECooling(19); - int const TypeOf_HPWaterPEHeating(20); - int const TypeOf_Pipe(21); - int const TypeOf_PipeSteam(22); - int const TypeOf_PipeExterior(23); - int const TypeOf_PipeInterior(24); - int const TypeOf_PipeUnderground(25); - int const TypeOf_PurchChilledWater(26); - int const TypeOf_PurchHotWater(27); - int const TypeOf_TS_IceDetailed(28); - int const TypeOf_TS_IceSimple(29); - int const TypeOf_ValveTempering(30); - int const TypeOf_WtrHeaterMixed(31); - int const TypeOf_WtrHeaterStratified(32); - int const TypeOf_PumpVariableSpeed(33); - int const TypeOf_PumpConstantSpeed(34); - int const TypeOf_PumpCondensate(35); - int const TypeOf_PumpBankVariableSpeed(36); - int const TypeOf_PumpBankConstantSpeed(37); - int const TypeOf_WaterUseConnection(38); - int const TypeOf_CoilWaterCooling(39); // demand side component - int const TypeOf_CoilWaterDetailedFlatCooling(40); // demand side component - int const TypeOf_CoilWaterSimpleHeating(41); // demand side component - int const TypeOf_CoilSteamAirHeating(42); // demand side component - int const TypeOf_SolarCollectorFlatPlate(43); // demand side component - int const TypeOf_PlantLoadProfile(44); // demand side component - int const TypeOf_GrndHtExchgSystem(45); - int const TypeOf_GrndHtExchgSurface(46); - int const TypeOf_GrndHtExchgPond(47); - int const TypeOf_Generator_MicroTurbine(48); // newer FSEC turbine - int const TypeOf_Generator_ICEngine(49); - int const TypeOf_Generator_CTurbine(50); // older BLAST turbine - int const TypeOf_Generator_MicroCHP(51); - int const TypeOf_Generator_FCStackCooler(52); - int const TypeOf_FluidCooler_SingleSpd(53); - int const TypeOf_FluidCooler_TwoSpd(54); - int const TypeOf_EvapFluidCooler_SingleSpd(55); - int const TypeOf_EvapFluidCooler_TwoSpd(56); - int const TypeOf_ChilledWaterTankMixed(57); - int const TypeOf_ChilledWaterTankStratified(58); - int const TypeOf_PVTSolarCollectorFlatPlate(59); - int const TypeOf_Baseboard_Conv_Water(60); - int const TypeOf_Baseboard_Rad_Conv_Steam(61); - int const TypeOf_Baseboard_Rad_Conv_Water(62); - int const TypeOf_LowTempRadiant_VarFlow(63); - int const TypeOf_LowTempRadiant_ConstFlow(64); - int const TypeOf_CooledBeamAirTerminal(65); - int const TypeOf_CoilWAHPHeatingEquationFit(66); - int const TypeOf_CoilWAHPCoolingEquationFit(67); - int const TypeOf_CoilWAHPHeatingParamEst(68); - int const TypeOf_CoilWAHPCoolingParamEst(69); - int const TypeOf_RefrigSystemWaterCondenser(70); - int const TypeOf_RefrigerationWaterCoolRack(71); - int const TypeOf_MultiSpeedHeatPumpRecovery(72); - int const TypeOf_Chiller_ExhFiredAbsorption(73); - int const TypeOf_PipingSystemPipeCircuit(74); - int const TypeOf_SolarCollectorICS(75); - int const TypeOf_CoilVSWAHPHeatingEquationFit(76); - int const TypeOf_CoilVSWAHPCoolingEquationFit(77); - int const TypeOf_PlantComponentUserDefined(78); - int const TypeOf_CoilUserDefined(79); - int const TypeOf_ZoneHVACAirUserDefined(80); - int const TypeOf_AirTerminalUserDefined(81); - int const TypeOf_HeatPumpVRF(82); - int const TypeOf_GrndHtExchgHorizTrench(83); - int const TypeOf_FluidToFluidPlantHtExchg(84); - int const TypeOf_WaterSource(85); - int const TypeOf_CentralGroundSourceHeatPump(86); - int const TypeOf_UnitarySysRecovery(87); - int const TypeOf_PackagedTESCoolingCoil(88); - int const TypeOf_CoolingTower_VarSpdMerkel(89); - int const TypeOf_SwimmingPool_Indoor(90); - int const TypeOf_GrndHtExchgSlinky(91); - int const TypeOf_HeatPumpWtrHeaterWrapped(92); - int const TypeOf_FourPipeBeamAirTerminal(93); - int const TypeOf_CoolingPanel_Simple(94); - int const TypeOf_HeatPumpEIRCooling(95); - int const TypeOf_HeatPumpEIRHeating(96); - Array1D const ConvergenceHistoryARR(DataPlant::NumConvergenceHistoryTerms, {0.0, -1.0, -2.0, -3.0, -4.0}); Real64 const sum_ConvergenceHistoryARR(sum(ConvergenceHistoryARR)); Real64 const square_sum_ConvergenceHistoryARR(pow_2(sum_ConvergenceHistoryARR)); @@ -394,7 +295,6 @@ namespace EnergyPlus::DataPlant { int PlantManageHalfLoopCalls(0); // tracks number of half loop calls // Object Data - Array1D PlantLoop; Array1D PlantAvailMgr; Array1D VentRepPlantSupplySide; Array1D VentRepPlantDemandSide; @@ -416,7 +316,6 @@ namespace EnergyPlus::DataPlant { AnyEMSPlantOpSchemesInModel = false; PlantManageSubIterations = 0; PlantManageHalfLoopCalls = 0; - PlantLoop.deallocate(); PlantAvailMgr.deallocate(); VentRepPlantSupplySide.deallocate(); VentRepPlantDemandSide.deallocate(); diff --git a/src/EnergyPlus/Plant/DataPlant.hh b/src/EnergyPlus/Plant/DataPlant.hh index 605375c7f53..56101a0f54c 100644 --- a/src/EnergyPlus/Plant/DataPlant.hh +++ b/src/EnergyPlus/Plant/DataPlant.hh @@ -92,110 +92,108 @@ namespace DataPlant { extern std::map cPressureSimType; // Parameters for Component/Equipment Types (ref: TypeOf in CompData) - extern int const NumSimPlantEquipTypes; + constexpr int NumSimPlantEquipTypes(96); extern Array1D_string const SimPlantEquipTypes; - extern Array1D_string const ccSimPlantEquipTypes; - extern Array1D const ValidLoopEquipTypes; - extern int const TypeOf_Other; - extern int const TypeOf_Boiler_Simple; - extern int const TypeOf_Boiler_Steam; - extern int const TypeOf_Chiller_Absorption; // older BLAST absorption chiller - extern int const TypeOf_Chiller_Indirect_Absorption; // revised absorption chiller - extern int const TypeOf_Chiller_CombTurbine; - extern int const TypeOf_Chiller_ConstCOP; - extern int const TypeOf_Chiller_DFAbsorption; - extern int const TypeOf_Chiller_Electric; // basic BLAST Chiller - extern int const TypeOf_Chiller_ElectricEIR; - extern int const TypeOf_Chiller_ElectricReformEIR; - extern int const TypeOf_Chiller_EngineDriven; - extern int const TypeOf_CoolingTower_SingleSpd; - extern int const TypeOf_CoolingTower_TwoSpd; - extern int const TypeOf_CoolingTower_VarSpd; - extern int const TypeOf_Generator_FCExhaust; - extern int const TypeOf_HeatPumpWtrHeaterPumped; - extern int const TypeOf_HeatPumpWtrHeaterWrapped; - extern int const TypeOf_HPWaterEFCooling; - extern int const TypeOf_HPWaterEFHeating; - extern int const TypeOf_HPWaterPECooling; - extern int const TypeOf_HPWaterPEHeating; - extern int const TypeOf_Pipe; - extern int const TypeOf_PipeSteam; - extern int const TypeOf_PipeExterior; - extern int const TypeOf_PipeInterior; - extern int const TypeOf_PipeUnderground; - extern int const TypeOf_PurchChilledWater; - extern int const TypeOf_PurchHotWater; - extern int const TypeOf_TS_IceDetailed; - extern int const TypeOf_TS_IceSimple; - extern int const TypeOf_ValveTempering; - extern int const TypeOf_WtrHeaterMixed; - extern int const TypeOf_WtrHeaterStratified; - extern int const TypeOf_PumpVariableSpeed; - extern int const TypeOf_PumpConstantSpeed; - extern int const TypeOf_PumpCondensate; - extern int const TypeOf_PumpBankVariableSpeed; - extern int const TypeOf_PumpBankConstantSpeed; - extern int const TypeOf_WaterUseConnection; - extern int const TypeOf_CoilWaterCooling; // demand side component - extern int const TypeOf_CoilWaterDetailedFlatCooling; // demand side component - extern int const TypeOf_CoilWaterSimpleHeating; // demand side component - extern int const TypeOf_CoilSteamAirHeating; // demand side component - extern int const TypeOf_SolarCollectorFlatPlate; // demand side component - extern int const TypeOf_PlantLoadProfile; // demand side component - extern int const TypeOf_GrndHtExchgSystem; - extern int const TypeOf_GrndHtExchgSurface; - extern int const TypeOf_GrndHtExchgPond; - extern int const TypeOf_Generator_MicroTurbine; // newer FSEC turbine - extern int const TypeOf_Generator_ICEngine; - extern int const TypeOf_Generator_CTurbine; // older BLAST turbine - extern int const TypeOf_Generator_MicroCHP; - extern int const TypeOf_Generator_FCStackCooler; - extern int const TypeOf_FluidCooler_SingleSpd; - extern int const TypeOf_FluidCooler_TwoSpd; - extern int const TypeOf_EvapFluidCooler_SingleSpd; - extern int const TypeOf_EvapFluidCooler_TwoSpd; - extern int const TypeOf_ChilledWaterTankMixed; - extern int const TypeOf_ChilledWaterTankStratified; - extern int const TypeOf_PVTSolarCollectorFlatPlate; - extern int const TypeOf_Baseboard_Conv_Water; - extern int const TypeOf_Baseboard_Rad_Conv_Steam; - extern int const TypeOf_Baseboard_Rad_Conv_Water; - extern int const TypeOf_CoolingPanel_Simple; - extern int const TypeOf_LowTempRadiant_VarFlow; - extern int const TypeOf_LowTempRadiant_ConstFlow; - extern int const TypeOf_CooledBeamAirTerminal; - extern int const TypeOf_CoilWAHPHeatingEquationFit; - extern int const TypeOf_CoilWAHPCoolingEquationFit; - extern int const TypeOf_CoilWAHPHeatingParamEst; - extern int const TypeOf_CoilWAHPCoolingParamEst; - extern int const TypeOf_RefrigSystemWaterCondenser; - extern int const TypeOf_RefrigerationWaterCoolRack; - extern int const TypeOf_MultiSpeedHeatPumpRecovery; - extern int const TypeOf_Chiller_ExhFiredAbsorption; - extern int const TypeOf_PipingSystemPipeCircuit; - extern int const TypeOf_SolarCollectorICS; - extern int const TypeOf_CoilVSWAHPHeatingEquationFit; - extern int const TypeOf_CoilVSWAHPCoolingEquationFit; - extern int const TypeOf_PlantComponentUserDefined; - extern int const TypeOf_CoilUserDefined; - extern int const TypeOf_ZoneHVACAirUserDefined; - extern int const TypeOf_AirTerminalUserDefined; - extern int const TypeOf_HeatPumpVRF; - extern int const TypeOf_GrndHtExchgHorizTrench; - extern int const TypeOf_FluidToFluidPlantHtExchg; - extern int const TypeOf_WaterSource; - extern int const TypeOf_CentralGroundSourceHeatPump; - extern int const TypeOf_UnitarySysRecovery; - extern int const TypeOf_PackagedTESCoolingCoil; - extern int const TypeOf_CoolingTower_VarSpdMerkel; - extern int const TypeOf_SwimmingPool_Indoor; - extern int const TypeOf_GrndHtExchgSlinky; - extern int const TypeOf_FourPipeBeamAirTerminal; - extern int const TypeOf_HeatPumpEIRCooling; - extern int const TypeOf_HeatPumpEIRHeating; + constexpr int TypeOf_Other(-1); + constexpr int TypeOf_Boiler_Simple(1); + constexpr int TypeOf_Boiler_Steam(2); + constexpr int TypeOf_Chiller_Absorption(3); // older BLAST absorption chiller + constexpr int TypeOf_Chiller_Indirect_Absorption(4); // revised absorption chiller + constexpr int TypeOf_Chiller_CombTurbine(5); + constexpr int TypeOf_Chiller_ConstCOP(6); + constexpr int TypeOf_Chiller_DFAbsorption(7); + constexpr int TypeOf_Chiller_Electric(8); // basic BLAST Chiller + constexpr int TypeOf_Chiller_ElectricEIR(9); + constexpr int TypeOf_Chiller_ElectricReformEIR(10); + constexpr int TypeOf_Chiller_EngineDriven(11); + constexpr int TypeOf_CoolingTower_SingleSpd(12); + constexpr int TypeOf_CoolingTower_TwoSpd(13); + constexpr int TypeOf_CoolingTower_VarSpd(14); + constexpr int TypeOf_Generator_FCExhaust(15); + constexpr int TypeOf_HeatPumpWtrHeaterPumped(16); + constexpr int TypeOf_HPWaterEFCooling(17); + constexpr int TypeOf_HPWaterEFHeating(18); + constexpr int TypeOf_HPWaterPECooling(19); + constexpr int TypeOf_HPWaterPEHeating(20); + constexpr int TypeOf_Pipe(21); + constexpr int TypeOf_PipeSteam(22); + constexpr int TypeOf_PipeExterior(23); + constexpr int TypeOf_PipeInterior(24); + constexpr int TypeOf_PipeUnderground(25); + constexpr int TypeOf_PurchChilledWater(26); + constexpr int TypeOf_PurchHotWater(27); + constexpr int TypeOf_TS_IceDetailed(28); + constexpr int TypeOf_TS_IceSimple(29); + constexpr int TypeOf_ValveTempering(30); + constexpr int TypeOf_WtrHeaterMixed(31); + constexpr int TypeOf_WtrHeaterStratified(32); + constexpr int TypeOf_PumpVariableSpeed(33); + constexpr int TypeOf_PumpConstantSpeed(34); + constexpr int TypeOf_PumpCondensate(35); + constexpr int TypeOf_PumpBankVariableSpeed(36); + constexpr int TypeOf_PumpBankConstantSpeed(37); + constexpr int TypeOf_WaterUseConnection(38); + constexpr int TypeOf_CoilWaterCooling(39); // demand side component + constexpr int TypeOf_CoilWaterDetailedFlatCooling(40); // demand side component + constexpr int TypeOf_CoilWaterSimpleHeating(41); // demand side component + constexpr int TypeOf_CoilSteamAirHeating(42); // demand side component + constexpr int TypeOf_SolarCollectorFlatPlate(43); // demand side component + constexpr int TypeOf_PlantLoadProfile(44); // demand side component + constexpr int TypeOf_GrndHtExchgSystem(45); + constexpr int TypeOf_GrndHtExchgSurface(46); + constexpr int TypeOf_GrndHtExchgPond(47); + constexpr int TypeOf_Generator_MicroTurbine(48); // newer FSEC turbine + constexpr int TypeOf_Generator_ICEngine(49); + constexpr int TypeOf_Generator_CTurbine(50); // older BLAST turbine + constexpr int TypeOf_Generator_MicroCHP(51); + constexpr int TypeOf_Generator_FCStackCooler(52); + constexpr int TypeOf_FluidCooler_SingleSpd(53); + constexpr int TypeOf_FluidCooler_TwoSpd(54); + constexpr int TypeOf_EvapFluidCooler_SingleSpd(55); + constexpr int TypeOf_EvapFluidCooler_TwoSpd(56); + constexpr int TypeOf_ChilledWaterTankMixed(57); + constexpr int TypeOf_ChilledWaterTankStratified(58); + constexpr int TypeOf_PVTSolarCollectorFlatPlate(59); + constexpr int TypeOf_Baseboard_Conv_Water(60); + constexpr int TypeOf_Baseboard_Rad_Conv_Steam(61); + constexpr int TypeOf_Baseboard_Rad_Conv_Water(62); + constexpr int TypeOf_LowTempRadiant_VarFlow(63); + constexpr int TypeOf_LowTempRadiant_ConstFlow(64); + constexpr int TypeOf_CooledBeamAirTerminal(65); + constexpr int TypeOf_CoilWAHPHeatingEquationFit(66); + constexpr int TypeOf_CoilWAHPCoolingEquationFit(67); + constexpr int TypeOf_CoilWAHPHeatingParamEst(68); + constexpr int TypeOf_CoilWAHPCoolingParamEst(69); + constexpr int TypeOf_RefrigSystemWaterCondenser(70); + constexpr int TypeOf_RefrigerationWaterCoolRack(71); + constexpr int TypeOf_MultiSpeedHeatPumpRecovery(72); + constexpr int TypeOf_Chiller_ExhFiredAbsorption(73); + constexpr int TypeOf_PipingSystemPipeCircuit(74); + constexpr int TypeOf_SolarCollectorICS(75); + constexpr int TypeOf_CoilVSWAHPHeatingEquationFit(76); + constexpr int TypeOf_CoilVSWAHPCoolingEquationFit(77); + constexpr int TypeOf_PlantComponentUserDefined(78); + constexpr int TypeOf_CoilUserDefined(79); + constexpr int TypeOf_ZoneHVACAirUserDefined(80); + constexpr int TypeOf_AirTerminalUserDefined(81); + constexpr int TypeOf_HeatPumpVRF(82); + constexpr int TypeOf_GrndHtExchgHorizTrench(83); + constexpr int TypeOf_FluidToFluidPlantHtExchg(84); + constexpr int TypeOf_WaterSource(85); + constexpr int TypeOf_CentralGroundSourceHeatPump(86); + constexpr int TypeOf_UnitarySysRecovery(87); + constexpr int TypeOf_PackagedTESCoolingCoil(88); + constexpr int TypeOf_CoolingTower_VarSpdMerkel(89); + constexpr int TypeOf_SwimmingPool_Indoor(90); + constexpr int TypeOf_GrndHtExchgSlinky(91); + constexpr int TypeOf_HeatPumpWtrHeaterWrapped(92); + constexpr int TypeOf_FourPipeBeamAirTerminal(93); + constexpr int TypeOf_CoolingPanel_Simple(94); + constexpr int TypeOf_HeatPumpEIRCooling(95); + constexpr int TypeOf_HeatPumpEIRHeating(96); extern Array1D const ConvergenceHistoryARR; extern Real64 const sum_ConvergenceHistoryARR; @@ -218,7 +216,6 @@ namespace DataPlant { // Enum classes // Object Data - extern Array1D PlantLoop; extern Array1D PlantAvailMgr; extern Array1D VentRepPlantSupplySide; extern Array1D VentRepPlantDemandSide; @@ -234,9 +231,43 @@ namespace DataPlant { struct DataPlantData : BaseGlobalStruct { +// int TotNumLoops = 0; // number of plant and condenser loops +// int TotNumHalfLoops = 0; // number of half loops (2 * TotNumLoops) +// bool PlantFirstSizeCompleted = false; +// bool PlantFirstSizesOkayToFinalize = false; // true if plant sizing is finishing and can save results +// bool PlantReSizingCompleted = false; +// bool PlantFirstSizesOkayToReport = false; +// bool PlantFinalSizesOkayToReport = false; +// bool AnyEMSPlantOpSchemesInModel = false; +// int PlantManageSubIterations = 0; // tracks plant iterations to characterize solver +// int PlantManageHalfLoopCalls = 0; // tracks number of half loop calls + Array1D PlantLoop; +// Array1D PlantAvailMgr; +// Array1D VentRepPlantSupplySide; +// Array1D VentRepPlantDemandSide; +// Array1D VentRepCondSupplySide; +// Array1D VentRepCondDemandSide; +// Array1D PlantCallingOrderInfo; + void clear_state() override { - +// this->TotNumLoops = 0; +// this->TotNumHalfLoops = 0; +// this->PlantFirstSizeCompleted = false; +// this->PlantFirstSizesOkayToFinalize = false; +// this->PlantReSizingCompleted = false; +// this->PlantFirstSizesOkayToReport = false; +// this->PlantFinalSizesOkayToReport = false; +// this->AnyEMSPlantOpSchemesInModel = false; +// this->PlantManageSubIterations = 0; +// this->PlantManageHalfLoopCalls = 0; + this->PlantLoop.deallocate(); +// this->PlantAvailMgr.deallocate(); +// this->VentRepPlantSupplySide.deallocate(); +// this->VentRepPlantDemandSide.deallocate(); +// this->VentRepCondSupplySide.deallocate(); +// this->VentRepCondDemandSide.deallocate(); +// this->PlantCallingOrderInfo.deallocate(); } }; diff --git a/src/EnergyPlus/Plant/LoopSide.cc b/src/EnergyPlus/Plant/LoopSide.cc index f61880e4c90..fad6a4b12cb 100644 --- a/src/EnergyPlus/Plant/LoopSide.cc +++ b/src/EnergyPlus/Plant/LoopSide.cc @@ -93,7 +93,7 @@ namespace DataPlant { // the flow resolver and locking those flows down. Available components are then re-simulated using the // corrected flow rates. - auto &thisPlantLoop = DataPlant::PlantLoop(this->myLoopNum); + auto &thisPlantLoop = state.dataPlnt->PlantLoop(this->myLoopNum); int ThisSideInletNode = this->NodeNumIn; this->InitialDemandToLoopSetPoint = 0.0; @@ -164,9 +164,9 @@ namespace DataPlant { thisPlantLoop.CommonPipeType); // Update the loop outlet node conditions - DataPlant::PlantLoop(this->myLoopNum).CheckLoopExitNode(state, FirstHVACIteration); // TODO: This is a loop level check, move out + state.dataPlnt->PlantLoop(this->myLoopNum).CheckLoopExitNode(state, FirstHVACIteration); // TODO: This is a loop level check, move out - DataPlant::PlantLoop(this->myLoopNum).UpdateLoopSideReportVars(state, this->InitialDemandToLoopSetPointSAVED, + state.dataPlnt->PlantLoop(this->myLoopNum).UpdateLoopSideReportVars(state, this->InitialDemandToLoopSetPointSAVED, this->LoadToLoopSetPointThatWasntMet); } @@ -589,9 +589,9 @@ namespace DataPlant { this->SimulateLoopSideBranchGroup(state, 1, 1, ThisLoopSideFlow, FirstHVACIteration, LoopShutDownFlag); break; case ParallelBranchSet: - this->UpdatePlantSplitter(); + this->UpdatePlantSplitter(state); this->SimulateLoopSideBranchGroup(state, 2, this->TotalBranches - 1, ThisLoopSideFlow, FirstHVACIteration, LoopShutDownFlag); - this->UpdatePlantMixer(); + this->UpdatePlantMixer(state); break; case OutletBranch: this->SimulateLoopSideBranchGroup(state, this->TotalBranches, this->TotalBranches, ThisLoopSideFlow, FirstHVACIteration, LoopShutDownFlag); @@ -673,7 +673,7 @@ namespace DataPlant { Real64 SumMdotTimesTemp = 0.0; Real64 SumMdot = 0.0; - auto &thisPlantLoop = DataPlant::PlantLoop(this->myLoopNum); + auto &thisPlantLoop = state.dataPlnt->PlantLoop(this->myLoopNum); // We will place one specialized case in here for common pipe simulations. // If we are doing a common pipe simulation, and there is greater other-side flow than this side, @@ -848,7 +848,7 @@ namespace DataPlant { return this->EvaluateLoopSetPointLoad(state, 1, 1, ThisLoopSideFlow); } - Real64 HalfLoopData::SetupLoopFlowRequest(int const OtherSide) { + Real64 HalfLoopData::SetupLoopFlowRequest(EnergyPlusData &state, int const OtherSide) { // FUNCTION INFORMATION: // AUTHOR: Dan Fisher, Edwin Lee @@ -870,7 +870,7 @@ namespace DataPlant { Real64 LoopFlow = 0.0; // Once all flow requests are evaluated, this is the desired flow on this side // reference - auto &loop(DataPlant::PlantLoop(this->myLoopNum)); + auto &loop(state.dataPlnt->PlantLoop(this->myLoopNum)); //~ First we need to set up the flow requests on each LoopSide for (int LoopSideCounter = DataPlant::DemandSide; @@ -1218,7 +1218,7 @@ namespace DataPlant { bool LoopShutDownFlag = false; // First thing is to setup mass flow request information - Real64 ThisLoopSideFlowRequest = this->SetupLoopFlowRequest(OtherSide); + Real64 ThisLoopSideFlowRequest = this->SetupLoopFlowRequest(state, OtherSide); // Now we know what the loop would "like" to run at, let's see the pump // operation range (min/max avail) to see whether it is possible this time around @@ -1758,7 +1758,7 @@ namespace DataPlant { if (this->myLoopSideNum == DataPlant::SupplySide) { int const curCompOpSchemePtr = this_comp.CurCompLevelOpNum; int const OpSchemePtr = this_comp.OpScheme(curCompOpSchemePtr).OpSchemePtr; - DataPlant::PlantLoop(this->myLoopNum).OpScheme(OpSchemePtr).EMSIntVarLoopDemandRate = InitialDemandToLoopSetPoint; + state.dataPlnt->PlantLoop(this->myLoopNum).OpScheme(OpSchemePtr).EMSIntVarLoopDemandRate = InitialDemandToLoopSetPoint; } PlantCondLoopOperation::ManagePlantLoadDistribution(state, this->myLoopNum, @@ -1957,7 +1957,6 @@ namespace DataPlant { using DataLoopNode::Node; using DataPlant::LoadRangeBasedMax; using DataPlant::LoadRangeBasedMin; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; // SUBROUTINE PARAMETER DEFINITIONS: @@ -2010,7 +2009,7 @@ namespace DataPlant { Real64 const OutletTemp(Node(OutletNode).Temp); Real64 const AverageTemp((InletTemp + OutletTemp) / 2.0); Real64 const ComponentCp( - GetSpecificHeatGlycol(state, PlantLoop(this->myLoopNum).FluidName, AverageTemp, PlantLoop(this->myLoopNum).FluidIndex, RoutineName)); + GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->myLoopNum).FluidName, AverageTemp, state.dataPlnt->PlantLoop(this->myLoopNum).FluidIndex, RoutineName)); // Calculate the load altered by this component Real64 const LoadAlteration(ComponentMassFlowRate * ComponentCp * (OutletTemp - InletTemp)); @@ -2029,7 +2028,7 @@ namespace DataPlant { // MODIFIED na // RE-ENGINEERED na - auto &loop(DataPlant::PlantLoop(SpecificPumpLocation.loopNum)); + auto &loop(state.dataPlnt->PlantLoop(SpecificPumpLocation.loopNum)); auto &loop_side(loop.LoopSide(SpecificPumpLocation.loopSideNum)); auto &loop_side_branch(loop_side.Branch(SpecificPumpLocation.branchNum)); auto &comp(loop_side_branch.Comp(SpecificPumpLocation.compNum)); @@ -2081,7 +2080,7 @@ namespace DataPlant { PumpLoopSideNum = SpecificPumpLocation().loopSideNum; int const PumpBranchNum = SpecificPumpLocation().branchNum; int const PumpCompNum = SpecificPumpLocation().compNum; - PumpIndexStart = DataPlant::PlantLoop(PumpLoopNum).LoopSide(PumpLoopSideNum).Branch(PumpBranchNum).Comp( + PumpIndexStart = state.dataPlnt->PlantLoop(PumpLoopNum).LoopSide(PumpLoopSideNum).Branch(PumpBranchNum).Comp( PumpCompNum).IndexInLoopSidePumps; PumpIndexEnd = PumpIndexStart; } else { @@ -2100,7 +2099,7 @@ namespace DataPlant { } //~ Now loop through all the pumps and simulate them, keeping track of their status - auto &loop_side(DataPlant::PlantLoop(PumpLoopNum).LoopSide(PumpLoopSideNum)); + auto &loop_side(state.dataPlnt->PlantLoop(PumpLoopNum).LoopSide(PumpLoopSideNum)); auto &loop_side_branch(loop_side.Branch); for (int PumpCounter = PumpIndexStart; PumpCounter <= PumpIndexEnd; ++PumpCounter) { @@ -2177,7 +2176,7 @@ namespace DataPlant { return ThisLoopSideFlow; } - void HalfLoopData::UpdatePlantMixer() + void HalfLoopData::UpdatePlantMixer(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -2234,7 +2233,7 @@ namespace DataPlant { DataLoopNode::Node(MixerOutletNode).MassFlowRate = MixerOutletMassFlow; DataLoopNode::Node(MixerOutletNode).Temp = MixerOutletTemp; - if (DataPlant::PlantLoop(this->myLoopNum).HasPressureComponents) { + if (state.dataPlnt->PlantLoop(this->myLoopNum).HasPressureComponents) { // Don't update pressure, let pressure system handle this... } else { // Go ahead and update! @@ -2252,7 +2251,7 @@ namespace DataPlant { max(MixerOutletMassFlowMinAvail, DataLoopNode::Node(SplitterInNode).MassFlowRateMinAvail); } - void HalfLoopData::UpdatePlantSplitter() + void HalfLoopData::UpdatePlantSplitter(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -2278,7 +2277,7 @@ namespace DataPlant { DataLoopNode::Node(SplitterOutletNode).Temp = DataLoopNode::Node(SplitterInletNode).Temp; DataLoopNode::Node(SplitterOutletNode).TempMin = DataLoopNode::Node(SplitterInletNode).TempMin; DataLoopNode::Node(SplitterOutletNode).TempMax = DataLoopNode::Node(SplitterInletNode).TempMax; - if (DataPlant::PlantLoop(this->myLoopNum).HasPressureComponents) { + if (state.dataPlnt->PlantLoop(this->myLoopNum).HasPressureComponents) { // Don't update pressure, let pressure system handle this... } else { // Go ahead and update! diff --git a/src/EnergyPlus/Plant/LoopSide.hh b/src/EnergyPlus/Plant/LoopSide.hh index 9828226243a..1e4f2f0a575 100644 --- a/src/EnergyPlus/Plant/LoopSide.hh +++ b/src/EnergyPlus/Plant/LoopSide.hh @@ -174,9 +174,9 @@ namespace DataPlant { bool FirstHVACIteration, bool &LoopShutDownFlag); - void UpdatePlantSplitter(); + void UpdatePlantSplitter(EnergyPlusData &state); - void UpdatePlantMixer(); + void UpdatePlantMixer(EnergyPlusData &state); void TurnOnAllLoopSideBranches(); @@ -186,7 +186,7 @@ namespace DataPlant { Real64 CalcOtherSideDemand(EnergyPlusData &state, Real64 ThisLoopSideFlow); - Real64 SetupLoopFlowRequest(int OtherSide); + Real64 SetupLoopFlowRequest(EnergyPlusData &state, int OtherSide); Real64 EvaluateLoopSetPointLoad(EnergyPlusData &state, int FirstBranchNum, diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index 9245a0dd119..ade6b8ee127 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -200,7 +200,7 @@ namespace EnergyPlus::PlantManager { int HalfLoopNum; int CurntMinPlantSubIterations; - if (std::any_of(PlantLoop.begin(), PlantLoop.end(), [](DataPlant::PlantLoopData const &e) { + if (std::any_of(state.dataPlnt->PlantLoop.begin(), state.dataPlnt->PlantLoop.end(), [](DataPlant::PlantLoopData const &e) { return (e.CommonPipeType == DataPlant::iCommonPipeType::Single) || (e.CommonPipeType == DataPlant::iCommonPipeType::TwoWay); })) { @@ -225,7 +225,7 @@ namespace EnergyPlus::PlantManager { LoopSide = PlantCallingOrderInfo(HalfLoopNum).LoopSide; OtherSide = 3 - LoopSide; // will give us 1 if LoopSide is 2, or 2 if LoopSide is 1 - auto &this_loop(PlantLoop(LoopNum)); + auto &this_loop(state.dataPlnt->PlantLoop(LoopNum)); auto &this_loop_side(this_loop.LoopSide(LoopSide)); auto &other_loop_side(this_loop.LoopSide(OtherSide)); @@ -257,7 +257,7 @@ namespace EnergyPlus::PlantManager { SimPlantLoops = false; for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { for (LoopSideNum = 1; LoopSideNum <= 2; ++LoopSideNum) { - if (PlantLoop(LoopNum).LoopSide(LoopSideNum).SimLoopSideNeeded) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).SimLoopSideNeeded) { SimPlantLoops = true; goto LoopLevel_exit; } @@ -274,7 +274,7 @@ namespace EnergyPlus::PlantManager { // could set SimAirLoops, SimElecCircuits, SimZoneEquipment flags for now for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { for (LoopSide = DemandSide; LoopSide <= SupplySide; ++LoopSide) { - auto &this_loop_side(PlantLoop(LoopNum).LoopSide(LoopSide)); + auto &this_loop_side(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide)); if (this_loop_side.SimAirLoopsNeeded) SimAirLoops = true; if (this_loop_side.SimZoneEquipNeeded) SimZoneEquipment = true; // IF (this_loop_side.SimNonZoneEquipNeeded) SimNonZoneEquipment = .TRUE. @@ -283,7 +283,7 @@ namespace EnergyPlus::PlantManager { } // Also log the convergence history of all loopsides once complete - LogPlantConvergencePoints(FirstHVACIteration); + LogPlantConvergencePoints(state, FirstHVACIteration); } void GetPlantLoopData(EnergyPlusData &state) { @@ -343,7 +343,7 @@ namespace EnergyPlus::PlantManager { TotNumLoops = NumPlantLoops + NumCondLoops; if (TotNumLoops > 0) { - PlantLoop.allocate(TotNumLoops); + state.dataPlnt->PlantLoop.allocate(TotNumLoops); state.dataConvergeParams->PlantConvergence.allocate(TotNumLoops); if (!allocated(PlantAvailMgr)) { PlantAvailMgr.allocate(TotNumLoops); @@ -357,7 +357,7 @@ namespace EnergyPlus::PlantManager { Num = 0.0; // set up some references - auto &this_loop(PlantLoop(LoopNum)); + auto &this_loop(state.dataPlnt->PlantLoop(LoopNum)); this_loop.LoopSide.allocate(2); auto &this_demand_side(this_loop.LoopSide(1)); auto &this_supply_side(this_loop.LoopSide(2)); @@ -731,7 +731,7 @@ namespace EnergyPlus::PlantManager { PlantAvailMgr(LoopNum).AvailStatus, "Plant", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); } } @@ -801,7 +801,7 @@ namespace EnergyPlus::PlantManager { HalfLoopNum = 0; for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - auto &plantLoop = PlantLoop(LoopNum); + auto &plantLoop = state.dataPlnt->PlantLoop(LoopNum); plantLoop.LoopHasConnectionComp = false; for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { @@ -859,10 +859,10 @@ namespace EnergyPlus::PlantManager { branch.Comp.allocate(branch.TotalComponents); - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).TotalComponents; ++CompNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).TotalComponents; ++CompNum) { // set up some references auto &this_comp_type(CompTypes(CompNum)); - auto &this_comp(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); + auto &this_comp(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); this_comp.CurOpSchemeType = UnknownStatusOpSchemeType; this_comp.TypeOf = this_comp_type; @@ -916,7 +916,7 @@ namespace EnergyPlus::PlantManager { ShowContinueError(state, "Component Type =" + this_comp_type); } this_comp.CurOpSchemeType = PumpOpSchemeType; - if (BranchNum == 1 || BranchNum == PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches) { + if (BranchNum == 1 || BranchNum == state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches) { ASeriesBranchHasPump = true; } else { AParallelBranchHasPump = true; @@ -926,9 +926,9 @@ namespace EnergyPlus::PlantManager { p.BranchNum = BranchNum; p.CompNum = CompNum; p.PumpOutletNode = OutletNodeNumbers(CompNum); - DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).BranchPumpsExist = AParallelBranchHasPump; - DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).Pumps.push_back(p); - DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalPumps++; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).BranchPumpsExist = AParallelBranchHasPump; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Pumps.push_back(p); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalPumps++; } else if (UtilityRoutines::SameString(this_comp_type, "WaterHeater:Mixed")) { this_comp.TypeOf_Num = TypeOf_WtrHeaterMixed; if (LoopSideNum == DemandSide) { @@ -1431,7 +1431,7 @@ namespace EnergyPlus::PlantManager { if (ASeriesBranchHasPump && AParallelBranchHasPump) { ShowSevereError(state, "Current version does not support Loop pumps and branch pumps together"); - ShowContinueError(state, "Occurs in loop " + PlantLoop(LoopNum).Name); + ShowContinueError(state, "Occurs in loop " + state.dataPlnt->PlantLoop(LoopNum).Name); ErrorsFound = true; } @@ -1674,7 +1674,7 @@ namespace EnergyPlus::PlantManager { for (LoopNum = 1; LoopNum <= NumPlantLoops; ++LoopNum) { // set up references for this loop - auto &this_plant_loop(PlantLoop(LoopNum)); + auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); auto &this_plant_supply(this_plant_loop.LoopSide(SupplySide)); auto &this_vent_plant_supply(VentRepPlantSupplySide(LoopNum)); auto &this_plant_demand(this_plant_loop.LoopSide(DemandSide)); @@ -1692,7 +1692,7 @@ namespace EnergyPlus::PlantManager { for (BranchNum = 1; BranchNum <= this_vent_plant_supply.TotalBranches; ++BranchNum) { - auto &this_plant_supply_branch(PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum)); + auto &this_plant_supply_branch(state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum)); auto &this_vent_plant_supply_branch(VentRepPlantSupplySide(LoopNum).Branch(BranchNum)); this_vent_plant_supply_branch.Name = this_plant_supply_branch.Name; @@ -1708,7 +1708,7 @@ namespace EnergyPlus::PlantManager { CompNum <= VentRepPlantSupplySide(LoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { auto &this_plant_supply_comp( - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum)); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum)); auto &this_vent_plant_supply_comp( VentRepPlantSupplySide(LoopNum).Branch(BranchNum).Comp(CompNum)); @@ -1735,7 +1735,7 @@ namespace EnergyPlus::PlantManager { for (BranchNum = 1; BranchNum <= this_vent_plant_demand.TotalBranches; ++BranchNum) { - auto &this_plant_demand_branch(PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum)); + auto &this_plant_demand_branch(state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum)); auto &this_vent_plant_demand_branch(VentRepPlantDemandSide(LoopNum).Branch(BranchNum)); this_vent_plant_demand_branch.Name = this_plant_demand_branch.Name; @@ -1750,7 +1750,7 @@ namespace EnergyPlus::PlantManager { for (CompNum = 1; CompNum <= this_vent_plant_demand_branch.TotalComponents; ++CompNum) { auto &this_plant_demand_comp( - PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum)); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum)); auto &this_vent_plant_demand_comp( VentRepPlantDemandSide(LoopNum).Branch(BranchNum).Comp(CompNum)); @@ -1775,7 +1775,7 @@ namespace EnergyPlus::PlantManager { LoopNumInArray = LoopNum + NumPlantLoops; // set up references for this loop - auto &this_cond_loop(PlantLoop(LoopNumInArray)); + auto &this_cond_loop(state.dataPlnt->PlantLoop(LoopNumInArray)); auto &this_cond_supply(this_cond_loop.LoopSide(SupplySide)); auto &this_vent_cond_supply(VentRepCondSupplySide(LoopNum)); auto &this_cond_demand(this_cond_loop.LoopSide(DemandSide)); @@ -1878,7 +1878,6 @@ namespace EnergyPlus::PlantManager { // Using/Aliasing using DataPlant::DemandOpSchemeType; using DataPlant::DemandSide; - using DataPlant::PlantLoop; using DataPlant::SupplySide; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -1892,7 +1891,7 @@ namespace EnergyPlus::PlantManager { // FLOW: MaxBranches = 0; - for (auto &loop : PlantLoop) { + for (auto &loop : state.dataPlnt->PlantLoop) { MaxBranches = max(MaxBranches, loop.LoopSide(DemandSide).TotalBranches); MaxBranches = max(MaxBranches, loop.LoopSide(SupplySide).TotalBranches); loop.MaxBranch = MaxBranches; @@ -1908,7 +1907,7 @@ namespace EnergyPlus::PlantManager { } for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - auto &loop = PlantLoop(LoopNum); + auto &loop = state.dataPlnt->PlantLoop(LoopNum); if (LoopNum <= NumPlantLoops) { CurrentModuleObject = "Plant Loop"; } else { @@ -1920,57 +1919,57 @@ namespace EnergyPlus::PlantManager { loop.CoolingDemand, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Supply Side Heating Demand Rate", OutputProcessor::Unit::W, loop.HeatingDemand, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Supply Side Inlet Mass Flow Rate", OutputProcessor::Unit::kg_s, loop.InletNodeFlowrate, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Supply Side Inlet Temperature", OutputProcessor::Unit::C, loop.InletNodeTemperature, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Supply Side Outlet Temperature", OutputProcessor::Unit::C, loop.OutletNodeTemperature, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Supply Side Not Distributed Demand Rate", OutputProcessor::Unit::W, loop.DemandNotDispatched, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Supply Side Unmet Demand Rate", OutputProcessor::Unit::W, loop.UnmetDemand, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Debug Plant Loop Bypass Fraction", OutputProcessor::Unit::None, loop.BypassFrac, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Debug Plant Last Simulated Loop Side", OutputProcessor::Unit::None, loop.LastLoopSideSimulated, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); } // setup more variables inside plant data structure @@ -1979,68 +1978,68 @@ namespace EnergyPlus::PlantManager { for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { SetupOutputVariable(state, "Plant Demand Side Lumped Capacitance Temperature", OutputProcessor::Unit::C, - PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TankTemp, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TankTemp, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Supply Side Lumped Capacitance Temperature", OutputProcessor::Unit::C, - PlantLoop(LoopNum).LoopSide(SupplySide).LoopSideInlet_TankTemp, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).LoopSideInlet_TankTemp, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Demand Side Lumped Capacitance Heat Transport Rate", OutputProcessor::Unit::W, - PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_MdotCpDeltaT, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_MdotCpDeltaT, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Supply Side Lumped Capacitance Heat Transport Rate", OutputProcessor::Unit::W, - PlantLoop(LoopNum).LoopSide(SupplySide).LoopSideInlet_MdotCpDeltaT, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).LoopSideInlet_MdotCpDeltaT, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Demand Side Lumped Capacitance Heat Storage Rate", OutputProcessor::Unit::W, - PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_McpDTdt, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_McpDTdt, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Supply Side Lumped Capacitance Heat Storage Rate", OutputProcessor::Unit::W, - PlantLoop(LoopNum).LoopSide(SupplySide).LoopSideInlet_McpDTdt, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).LoopSideInlet_McpDTdt, "System", "Average", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Demand Side Lumped Capacitance Excessive Storage Time", OutputProcessor::Unit::hr, - PlantLoop(LoopNum).LoopSide( + state.dataPlnt->PlantLoop(LoopNum).LoopSide( DemandSide).LoopSideInlet_CapExcessStorageTimeReport, "System", "Sum", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); SetupOutputVariable(state, "Plant Supply Side Lumped Capacitance Excessive Storage Time", OutputProcessor::Unit::hr, - PlantLoop(LoopNum).LoopSide( + state.dataPlnt->PlantLoop(LoopNum).LoopSide( SupplySide).LoopSideInlet_CapExcessStorageTimeReport, "System", "Sum", - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( BranchNum).TotalComponents; ++CompNum) { - if (PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).CurOpSchemeType != DemandOpSchemeType) { SetupOutputVariable(state, "Plant Component Distributed Demand Rate", OutputProcessor::Unit::W, - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).MyLoad, "System", "Average", - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).Name); } } @@ -2051,17 +2050,17 @@ namespace EnergyPlus::PlantManager { // now traverse plant loops and set fluid type index in all nodes on the loop for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - FluidIndex = PlantLoop(LoopNum).FluidIndex; + FluidIndex = state.dataPlnt->PlantLoop(LoopNum).FluidIndex; for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn).FluidIndex = FluidIndex; - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).FluidIndex = FluidIndex; + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn).FluidIndex = FluidIndex; + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).FluidIndex = FluidIndex; for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( BranchNum).TotalComponents; ++CompNum) { - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).NodeNumIn).FluidIndex = FluidIndex; - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).NodeNumOut).FluidIndex = FluidIndex; } } @@ -2143,13 +2142,13 @@ namespace EnergyPlus::PlantManager { // check for missing setpoints for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - SensedNode = PlantLoop(LoopNum).TempSetPointNodeNum; + SensedNode = state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum; if (SensedNode > 0) { if (Node(SensedNode).TempSetPoint == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, "PlantManager: No Setpoint Manager Defined for Node=" + NodeID(SensedNode) + - " in PlantLoop=" + PlantLoop(LoopNum).Name); + " in PlantLoop=" + state.dataPlnt->PlantLoop(LoopNum).Name); ShowContinueError(state, "Add Temperature Setpoint Manager with Control Variable = \"Temperature\" for this PlantLoop."); SetPointErrorFlag = true; @@ -2159,7 +2158,7 @@ namespace EnergyPlus::PlantManager { if (SetPointErrorFlag) { ShowSevereError(state, "PlantManager: No Setpoint Manager Defined for Node=" + NodeID(SensedNode) + - " in PlantLoop=" + PlantLoop(LoopNum).Name); + " in PlantLoop=" + state.dataPlnt->PlantLoop(LoopNum).Name); ShowContinueError(state, "Add Temperature Setpoint Manager with Control Variable = \"Temperature\" for this PlantLoop."); ShowContinueError(state, @@ -2179,7 +2178,7 @@ namespace EnergyPlus::PlantManager { //***************************************************************** if (!PlantFirstSizeCompleted) { - SetAllFlowLocks(DataPlant::iFlowLock::Unlocked); + SetAllFlowLocks(state, DataPlant::iFlowLock::Unlocked); FinishSizingFlag = false; PlantFirstSizesOkayToFinalize = false; // set global flag for when it ready to store final sizes PlantFirstSizesOkayToReport = false; @@ -2196,10 +2195,10 @@ namespace EnergyPlus::PlantManager { CurLoopNum = LoopNum; for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( BranchNum).TotalComponents; ++CompNum) { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).simulate(state, FirstHVACIteration, InitLoopEquip, GetCompSizFac); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).simulate(state, FirstHVACIteration, InitLoopEquip, GetCompSizFac); } //-CompNum } //-BranchNum } @@ -2243,12 +2242,12 @@ namespace EnergyPlus::PlantManager { SizePlantLoop(state, LoopNum, FinishSizingFlag); } // pumps are special so call them directly - PlantLoop(LoopNum).LoopSide(LoopSideNum).SimulateAllLoopSidePumps(state); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).SimulateAllLoopSidePumps(state); for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( BranchNum).TotalComponents; ++CompNum) { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).simulate(state, FirstHVACIteration, InitLoopEquip, GetCompSizFac); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).simulate(state, FirstHVACIteration, InitLoopEquip, GetCompSizFac); } //-CompNum } //-BranchNum // if ( PlantLoop( LoopNum ).PlantSizNum > 0 ) PlantSizData( PlantLoop( LoopNum ).PlantSizNum @@ -2275,10 +2274,10 @@ namespace EnergyPlus::PlantManager { CurLoopNum = LoopNum; for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( BranchNum).TotalComponents; ++CompNum) { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).simulate(state, FirstHVACIteration, InitLoopEquip, GetCompSizFac); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).simulate(state, FirstHVACIteration, InitLoopEquip, GetCompSizFac); } //-CompNum } //-BranchNum } @@ -2298,14 +2297,14 @@ namespace EnergyPlus::PlantManager { CurLoopNum = LoopNum; for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( BranchNum).TotalComponents; ++CompNum) { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).simulate(state, FirstHVACIteration, InitLoopEquip, GetCompSizFac); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).simulate(state, FirstHVACIteration, InitLoopEquip, GetCompSizFac); } //-CompNum } //-BranchNum // pumps are special so call them directly - PlantLoop(LoopNum).LoopSide(LoopSideNum).SimulateAllLoopSidePumps(state); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).SimulateAllLoopSidePumps(state); } PlantReSizingCompleted = true; @@ -2322,24 +2321,24 @@ namespace EnergyPlus::PlantManager { for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { // check if setpoints being placed on node properly - if (PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - if (Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi == SensedNodeFlagValue) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + if (Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, "Plant Loop: missing high temperature setpoint for dual setpoint deadband demand scheme"); ShowContinueError(state, - "Node Referenced =" + NodeID(PlantLoop(LoopNum).TempSetPointNodeNum)); + "Node Referenced =" + NodeID(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum)); ShowContinueError(state, "Use a SetpointManager:Scheduled:DualSetpoint to establish appropriate setpoints"); SetPointErrorFlag = true; } else { - CheckIfNodeSetPointManagedByEMS(state, PlantLoop(LoopNum).TempSetPointNodeNum, + CheckIfNodeSetPointManagedByEMS(state, state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum, EMSManager::SPControlType::iTemperatureMaxSetPoint, SetPointErrorFlag); if (SetPointErrorFlag) { ShowSevereError(state, "Plant Loop: missing high temperature setpoint for dual setpoint deadband demand scheme"); ShowContinueError(state, - "Node Referenced =" + NodeID(PlantLoop(LoopNum).TempSetPointNodeNum)); + "Node Referenced =" + NodeID(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum)); ShowContinueError(state, "Use a SetpointManager:Scheduled:DualSetpoint to establish appropriate setpoints"); ShowContinueError(state, "Or add EMS Actuator for Temperature Maximum Setpoint"); @@ -2347,23 +2346,23 @@ namespace EnergyPlus::PlantManager { } // SetPointErrorFlag } // Not EMS } // Node TSPhi = Sensed - if (Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointLo == SensedNodeFlagValue) { + if (Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointLo == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, "Plant Loop: missing low temperature setpoint for dual setpoint deadband demand scheme"); ShowContinueError(state, - "Node Referenced =" + NodeID(PlantLoop(LoopNum).TempSetPointNodeNum)); + "Node Referenced =" + NodeID(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum)); ShowContinueError(state, "Use a SetpointManager:Scheduled:DualSetpoint to establish appropriate setpoints"); SetPointErrorFlag = true; } else { - CheckIfNodeSetPointManagedByEMS(state, PlantLoop(LoopNum).TempSetPointNodeNum, + CheckIfNodeSetPointManagedByEMS(state, state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum, EMSManager::SPControlType::iTemperatureMinSetPoint, SetPointErrorFlag); if (SetPointErrorFlag) { ShowSevereError(state, "Plant Loop: missing low temperature setpoint for dual setpoint deadband demand scheme"); ShowContinueError(state, - "Node Referenced =" + NodeID(PlantLoop(LoopNum).TempSetPointNodeNum)); + "Node Referenced =" + NodeID(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum)); ShowContinueError(state, "Use a SetpointManager:Scheduled:DualSetpoint to establish appropriate setpoints"); ShowContinueError(state, "Or add EMS Actuator for Temperature Minimum Setpoint"); @@ -2381,13 +2380,13 @@ namespace EnergyPlus::PlantManager { for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( BranchNum).TotalComponents; ++CompNum) { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).MyLoad = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).MyLoad = 0.0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).FreeCoolCntrlShutDown = false; - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).Available = false; } } @@ -2465,30 +2464,30 @@ namespace EnergyPlus::PlantManager { for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - LoopSetPointTemp = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPoint; + LoopSetPointTemp = Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { // Get the range of setpoints - LoopSetPointTemperatureHi = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi; - LoopSetPointTemperatureLo = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointLo; + LoopSetPointTemperatureHi = Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi; + LoopSetPointTemperatureLo = Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointLo; LoopSetPointTemp = (LoopSetPointTemperatureLo + LoopSetPointTemperatureHi) / 2.0; } } - if ((PlantLoop(LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && (LoopSideNum == DemandSide) && - (PlantLoop(LoopNum).LoopSide( + if ((state.dataPlnt->PlantLoop(LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) && (LoopSideNum == DemandSide) && + (state.dataPlnt->PlantLoop(LoopNum).LoopSide( DemandSide).InletNodeSetPt)) { // get a second setpoint for secondaryLoop // if the plant loop is two common pipe configured for temperature control on secondary side inlet, then // we want to initialize the demand side of the loop using that setpoint - LoopSetPointTemp = Node(PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn).TempSetPoint; + LoopSetPointTemp = Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn).TempSetPoint; } // Check the Loop Setpoint and make sure it is bounded by the Loop Max and Min - LoopMaxTemp = PlantLoop(LoopNum).MaxTemp; - LoopMinTemp = PlantLoop(LoopNum).MinTemp; + LoopMaxTemp = state.dataPlnt->PlantLoop(LoopNum).MaxTemp; + LoopMinTemp = state.dataPlnt->PlantLoop(LoopNum).MinTemp; // trap for -999 and set to average of limits if so if (LoopSetPointTemp == SensedNodeFlagValue) { @@ -2499,43 +2498,43 @@ namespace EnergyPlus::PlantManager { LoopSetPointTemp = max(LoopMinTemp, LoopSetPointTemp); // Initialize the capacitance model at the tank interface, and other loop side values - PlantLoop(LoopNum).LoopSide(LoopSideNum).TempInterfaceTankOutlet = LoopSetPointTemp; - PlantLoop(LoopNum).LoopSide(LoopSideNum).LastTempInterfaceTankOutlet = LoopSetPointTemp; - PlantLoop(LoopNum).LoopSide(LoopSideNum).LoopSideInlet_TankTemp = LoopSetPointTemp; - PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalPumpHeat = 0.0; - if (allocated(PlantLoop(LoopNum).LoopSide(LoopSideNum).Pumps)) - for (auto &e : PlantLoop(LoopNum).LoopSide(LoopSideNum).Pumps) + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TempInterfaceTankOutlet = LoopSetPointTemp; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).LastTempInterfaceTankOutlet = LoopSetPointTemp; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).LoopSideInlet_TankTemp = LoopSetPointTemp; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalPumpHeat = 0.0; + if (allocated(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Pumps)) + for (auto &e : state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Pumps) e.PumpHeatToFluid = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowRequest = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).TimeElapsed = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = DataPlant::iFlowLock::Unlocked; - PlantLoop(LoopNum).LoopSide(LoopSideNum).InletNode.TemperatureHistory = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).InletNode.MassFlowRateHistory = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).OutletNode.TemperatureHistory = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).OutletNode.MassFlowRateHistory = 0.0; - - if (PlantLoop(LoopNum).FluidType != NodeType_Steam) { - Cp = GetSpecificHeatGlycol(state, PlantLoop(LoopNum).FluidName, LoopSetPointTemp, - PlantLoop(LoopNum).FluidIndex, RoutineNameAlt); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowRequest = 0.0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TimeElapsed = 0.0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = DataPlant::iFlowLock::Unlocked; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).InletNode.TemperatureHistory = 0.0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).InletNode.MassFlowRateHistory = 0.0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).OutletNode.TemperatureHistory = 0.0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).OutletNode.MassFlowRateHistory = 0.0; + + if (state.dataPlnt->PlantLoop(LoopNum).FluidType != NodeType_Steam) { + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, LoopSetPointTemp, + state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineNameAlt); StartEnthalpy = Cp * LoopSetPointTemp; } // Use Min/Max flow rates to initialize loop - if (PlantLoop(LoopNum).FluidType == NodeType_Water) { - rho = GetDensityGlycol(state, PlantLoop(LoopNum).FluidName, LoopSetPointTemp, - PlantLoop(LoopNum).FluidIndex, RoutineNameAlt); + if (state.dataPlnt->PlantLoop(LoopNum).FluidType == NodeType_Water) { + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, LoopSetPointTemp, + state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineNameAlt); - LoopMaxMassFlowRate = PlantLoop(LoopNum).MaxVolFlowRate * rho; - LoopMinMassFlowRate = PlantLoop(LoopNum).MinVolFlowRate * rho; + LoopMaxMassFlowRate = state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate * rho; + LoopMinMassFlowRate = state.dataPlnt->PlantLoop(LoopNum).MinVolFlowRate * rho; } // use saturated liquid of steam at the loop setpoint temp as the starting enthalpy for a water loop - if (PlantLoop(LoopNum).FluidType == NodeType_Steam) { + if (state.dataPlnt->PlantLoop(LoopNum).FluidType == NodeType_Steam) { SteamTemp = 100.0; SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, SteamTemp, 1.0, - PlantLoop(LoopNum).FluidIndex, RoutineName); - LoopMaxMassFlowRate = PlantLoop(LoopNum).MaxVolFlowRate * SteamDensity; + state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); + LoopMaxMassFlowRate = state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate * SteamDensity; StartEnthalpy = GetSatEnthalpyRefrig(state, fluidNameSteam, LoopSetPointTemp, 0.0, - PlantLoop(LoopNum).FluidIndex, RoutineName); - LoopMinMassFlowRate = PlantLoop(LoopNum).MinVolFlowRate * SteamDensity; + state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); + LoopMinMassFlowRate = state.dataPlnt->PlantLoop(LoopNum).MinVolFlowRate * SteamDensity; } LoopMaxMassFlowRate = max(0.0, LoopMaxMassFlowRate); @@ -2543,14 +2542,14 @@ namespace EnergyPlus::PlantManager { // Initial all loop nodes by initializing all component inlet and outlet nodes for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( BranchNum).TotalComponents; ++CompNum) { - ComponentInlet = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + ComponentInlet = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).NodeNumIn; - ComponentOutlet = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + ComponentOutlet = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).NodeNumOut; - BranchInlet = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumIn; + BranchInlet = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumIn; Node(ComponentInlet).Temp = LoopSetPointTemp; Node(ComponentInlet).TempMin = LoopMinTemp; @@ -2558,12 +2557,12 @@ namespace EnergyPlus::PlantManager { Node(ComponentInlet).TempLastTimestep = LoopSetPointTemp; Node(ComponentInlet).MassFlowRate = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).MyLoad = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).MyLoad = 0.0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).Available = false; - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).FreeCoolCntrlShutDown = false; - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).RequestedMassFlow = 0.0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).RequestedMassFlow = 0.0; if (Node(ComponentInlet).MassFlowRateMin > 0.0) { Node(ComponentInlet).MassFlowRateMinAvail = Node(ComponentInlet).MassFlowRateMin; @@ -2604,7 +2603,7 @@ namespace EnergyPlus::PlantManager { } // BRANCH LOOP } // LOOPSIDE } // PLANT LOOP - for (auto &loop : PlantLoop) { + for (auto &loop : state.dataPlnt->PlantLoop) { loop.CoolingDemand = 0.0; loop.HeatingDemand = 0.0; loop.DemandNotDispatched = 0.0; @@ -2630,48 +2629,48 @@ namespace EnergyPlus::PlantManager { // Node(LoopIn)%MassFlowRateSetPoint = LoopMaxMassFlowRate !DSU? this is suspect, may not be set? // UPDATE LOOP TEMPERATURE SETPOINTS - LoopSetPointTemp = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPoint; + LoopSetPointTemp = Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPoint; // Check the Loop Setpoint and make sure it is bounded by the Loop Max and Min - LoopMaxTemp = PlantLoop(LoopNum).MaxTemp; - LoopMinTemp = PlantLoop(LoopNum).MinTemp; + LoopMaxTemp = state.dataPlnt->PlantLoop(LoopNum).MaxTemp; + LoopMinTemp = state.dataPlnt->PlantLoop(LoopNum).MinTemp; // Check it against the loop temperature limits LoopSetPointTemp = min(LoopMaxTemp, LoopSetPointTemp); LoopSetPointTemp = max(LoopMinTemp, LoopSetPointTemp); // Update supply side loop setpoint in plant data structure - PlantLoop(LoopNum).LoopSide(SupplySide).TempSetPoint = LoopSetPointTemp; - PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPoint = LoopSetPointTemp; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).TempSetPoint = LoopSetPointTemp; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPoint = LoopSetPointTemp; // Update supply side hi-lo setpoints for dual SP control - if (PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - LoopSetPointTempHi = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi; - LoopSetPointTempLo = Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointLo; + if (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + LoopSetPointTempHi = Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointHi; + LoopSetPointTempLo = Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPointLo; LoopSetPointTempHi = min(LoopMaxTemp, LoopSetPointTempHi); LoopSetPointTempHi = max(LoopMinTemp, LoopSetPointTempHi); LoopSetPointTempLo = min(LoopMaxTemp, LoopSetPointTempLo); LoopSetPointTempLo = max(LoopMinTemp, LoopSetPointTempLo); - PlantLoop(LoopNum).LoopSide(SupplySide).TempSetPointHi = LoopSetPointTempHi; - PlantLoop(LoopNum).LoopSide(SupplySide).TempSetPointLo = LoopSetPointTempLo; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).TempSetPointHi = LoopSetPointTempHi; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).TempSetPointLo = LoopSetPointTempLo; } // update demand side loop setpoint in plant data structure - if (PlantLoop(LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { // get a second setpoint for secondaryLoop + if (state.dataPlnt->PlantLoop(LoopNum).CommonPipeType == DataPlant::iCommonPipeType::TwoWay) { // get a second setpoint for secondaryLoop // if the plant loop is two common pipe configured for temperature control on secondary side inlet, then // we want to initialize the demand side of the loop using that setpoint - if (PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { SecondaryLoopSetPointTemp = Node( - PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn).TempSetPoint; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn).TempSetPoint; SecondaryLoopSetPointTemp = min(LoopMaxTemp, SecondaryLoopSetPointTemp); SecondaryLoopSetPointTemp = max(LoopMinTemp, SecondaryLoopSetPointTemp); - PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPoint = SecondaryLoopSetPointTemp; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPoint = SecondaryLoopSetPointTemp; // Since Dual setpoint not explicitly available for demand side, we can't do the // bounding check on hi/lo setpoint. IF we did we would over-write // the SensedNodeFlagValue of -999 for no dual setpoint case. - PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointHi = Node( - PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn).TempSetPointHi; - PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointLo = Node( - PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn).TempSetPointLo; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointHi = Node( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn).TempSetPointHi; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointLo = Node( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn).TempSetPointLo; } // initialize common pipe flows to zero. @@ -2682,21 +2681,21 @@ namespace EnergyPlus::PlantManager { PlantCommonPipe(LoopNum).SecCPLegFlow = 0.0; } } else { // no secondary loop, so use supply side loop SP on demand side too. - PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPoint = LoopSetPointTemp; - if (PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointHi = LoopSetPointTempHi; - PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointLo = LoopSetPointTempLo; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPoint = LoopSetPointTemp; + if (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointHi = LoopSetPointTempHi; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TempSetPointLo = LoopSetPointTempLo; } } for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch( BranchNum).TotalComponents; ++CompNum) { - ComponentInlet = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + ComponentInlet = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).NodeNumIn; - ComponentOutlet = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( + ComponentOutlet = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp( CompNum).NodeNumOut; // reinit to node hardware limits @@ -2711,9 +2710,9 @@ namespace EnergyPlus::PlantManager { } } - for (OpNum = 1; OpNum <= PlantLoop(LoopNum).NumOpSchemes; ++OpNum) { + for (OpNum = 1; OpNum <= state.dataPlnt->PlantLoop(LoopNum).NumOpSchemes; ++OpNum) { // If the operating scheme is scheduled "OFF", go to next scheme - PlantLoop(LoopNum).OpScheme(OpNum).Available = GetCurrentScheduleValue(state, PlantLoop(LoopNum).OpScheme(OpNum).SchedPtr) > 0.0; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpNum).Available = GetCurrentScheduleValue(state, state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpNum).SchedPtr) > 0.0; } } } @@ -2797,27 +2796,27 @@ namespace EnergyPlus::PlantManager { } if (TotNumLoops <= 0) return; - if (!(allocated(PlantLoop))) return; + if (!(allocated(state.dataPlnt->PlantLoop))) return; for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { numLoopSides = 2; for (SideNum = 1; SideNum <= numLoopSides; ++SideNum) { - if (!(PlantLoop(LoopNum).LoopSide(SideNum).Splitter.Exists)) continue; + if (!(state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Splitter.Exists)) continue; for (ParalBranchNum = 1; - ParalBranchNum <= PlantLoop(LoopNum).LoopSide(SideNum).Splitter.TotalOutletNodes; + ParalBranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Splitter.TotalOutletNodes; ++ParalBranchNum) { - BranchNum = PlantLoop(LoopNum).LoopSide(SideNum).Splitter.BranchNumOut(ParalBranchNum); - if (PlantLoop(LoopNum).LoopSide(SideNum).Branch( + BranchNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Splitter.BranchNumOut(ParalBranchNum); + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch( BranchNum).IsBypass) { // we know there is a bypass // check that there is at least one 'Active' control type in parallel with bypass branch ActiveCntrlfound = false; for (ParalBranchNum2 = 1; - ParalBranchNum2 <= PlantLoop(LoopNum).LoopSide(SideNum).Splitter.TotalOutletNodes; + ParalBranchNum2 <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Splitter.TotalOutletNodes; ++ParalBranchNum2) { - BranchNum2 = PlantLoop(LoopNum).LoopSide(SideNum).Splitter.BranchNumOut( + BranchNum2 = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Splitter.BranchNumOut( ParalBranchNum2); - if (PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum2).ControlType == + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum2).ControlType == DataBranchAirLoopPlant::ControlTypeEnum::Active) { ActiveCntrlfound = true; } @@ -2825,12 +2824,12 @@ namespace EnergyPlus::PlantManager { if (!(ActiveCntrlfound)) { ShowWarningError(state, "Check control types on branches between splitter and mixer in PlantLoop=" + - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); ShowContinueError(state, "Found a BYPASS branch with no ACTIVE branch in parallel with it"); ShowContinueError(state, "In certain (but not all) situations, this can cause problems; please verify your inputs"); ShowContinueError(state, "Bypass branch named: " + - PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Name); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Name); } } // bypass present @@ -2845,12 +2844,12 @@ namespace EnergyPlus::PlantManager { // COIL:STEAM:AIRHEATING // SOLAR COLLECTOR:FLAT PLATE // PLANT LOAD PROFILE - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(SideNum).Branch( + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch( BranchNum).TotalComponents; ++CompNum) { ShouldBeACTIVE = false; { auto const SELECT_CASE_var( - PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Comp( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Comp( CompNum).TypeOf_Num); if (SELECT_CASE_var == TypeOf_WtrHeaterMixed) { @@ -2879,12 +2878,12 @@ namespace EnergyPlus::PlantManager { if (ShouldBeACTIVE) { { auto const SELECT_CASE_var( - PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).ControlType); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).ControlType); if (SELECT_CASE_var == DataBranchAirLoopPlant::ControlTypeEnum::Unknown) { ShowWarningError(state, "Found potential problem with Control Type for Branch named: " + - PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Name); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Name); ShowContinueError(state, "This branch should (probably) be ACTIVE but has control type unknown"); } else if (SELECT_CASE_var == DataBranchAirLoopPlant::ControlTypeEnum::Active) { @@ -2892,7 +2891,7 @@ namespace EnergyPlus::PlantManager { } else if (SELECT_CASE_var == DataBranchAirLoopPlant::ControlTypeEnum::Passive) { ShowWarningError(state, "Found potential problem with Control Type for Branch named: " + - PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Name); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Name); ShowContinueError(state, "This branch should (probably) be ACTIVE but has control type PASSIVE"); } else if (SELECT_CASE_var == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { @@ -2900,7 +2899,7 @@ namespace EnergyPlus::PlantManager { } else if (SELECT_CASE_var == DataBranchAirLoopPlant::ControlTypeEnum::Bypass) { ShowWarningError(state, "Found potential problem with Control Type for Branch named: " + - PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Name); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Branch(BranchNum).Name); ShowContinueError(state, "This branch should (probably) be ACTIVE but has control type Bypass"); } @@ -2912,10 +2911,10 @@ namespace EnergyPlus::PlantManager { } // splitter outlet nodes // check to see if bypass exists in demand side. If not warn error of possible flow problems - if (!PlantLoop(LoopNum).LoopSide(SideNum).BypassExists) { + if (!state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).BypassExists) { if (SideNum == DemandSide) { ShowWarningError(state, "There is no BYPASS component in the demand-side of PlantLoop =" + - PlantLoop(LoopNum).Name); + state.dataPlnt->PlantLoop(LoopNum).Name); ShowContinueError(state, "You may be able to fix the fatal error above by adding a demand-side BYPASS PIPE."); } @@ -2924,7 +2923,7 @@ namespace EnergyPlus::PlantManager { } // plant loops } - void InitOneTimePlantSizingInfo(int const LoopNum) // loop being initialized for sizing + void InitOneTimePlantSizingInfo(EnergyPlusData &state, int const LoopNum) // loop being initialized for sizing { // SUBROUTINE INFORMATION: @@ -2962,12 +2961,12 @@ namespace EnergyPlus::PlantManager { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int PlantSizNum(0); // index of Plant Sizing data for this loop - if (PlantLoop(LoopNum).PlantSizNum == 0) { + if (state.dataPlnt->PlantLoop(LoopNum).PlantSizNum == 0) { if (NumPltSizInput > 0) { - PlantSizNum = UtilityRoutines::FindItemInList(PlantLoop(LoopNum).Name, PlantSizData, + PlantSizNum = UtilityRoutines::FindItemInList(state.dataPlnt->PlantLoop(LoopNum).Name, PlantSizData, &PlantSizingData::PlantLoopName); if (PlantSizNum > 0) { - PlantLoop(LoopNum).PlantSizNum = PlantSizNum; + state.dataPlnt->PlantLoop(LoopNum).PlantSizNum = PlantSizNum; } } } @@ -3016,41 +3015,41 @@ namespace EnergyPlus::PlantManager { Real64 FluidDensity(0.0); // local value from glycol routine bool Finalize(OkayToFinish); - if (PlantLoop(LoopNum).PlantSizNum > 0) { - PlantSizNum = PlantLoop(LoopNum).PlantSizNum; + if (state.dataPlnt->PlantLoop(LoopNum).PlantSizNum > 0) { + PlantSizNum = state.dataPlnt->PlantLoop(LoopNum).PlantSizNum; // PlantSizData(PlantSizNum)%DesVolFlowRate = 0.0D0 ! DSU2 } else { if (NumPltSizInput > 0) { - PlantSizNum = UtilityRoutines::FindItemInList(PlantLoop(LoopNum).Name, PlantSizData, + PlantSizNum = UtilityRoutines::FindItemInList(state.dataPlnt->PlantLoop(LoopNum).Name, PlantSizData, &PlantSizingData::PlantLoopName); } } - PlantLoop(LoopNum).PlantSizNum = PlantSizNum; + state.dataPlnt->PlantLoop(LoopNum).PlantSizNum = PlantSizNum; // calculate a loop sizing factor and a branch sizing factor. Note that components without a sizing factor // are assigned sizing factors of zero in this calculation if (PlantSizNum > 0) { if (GetCompSizFac) { for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { BranchSizFac = 0.0; - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).PumpSizFac = 1.0; - if (PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn == - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).NodeNumIn) + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).PumpSizFac = 1.0; + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn == + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).NodeNumIn) continue; - if (PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumOut == - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).NodeNumOut) + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumOut == + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).NodeNumOut) continue; - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(SupplySide).Branch( + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch( BranchNum).TotalComponents; ++CompNum) { - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).simulate(state, true, localInitLoopEquip, GetCompSizFac); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).simulate(state, true, localInitLoopEquip, GetCompSizFac); BranchSizFac = max(BranchSizFac, - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp( + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp( CompNum).SizFac); } LoopSizFac += BranchSizFac; MaxSizFac = max(MaxSizFac, BranchSizFac); if (BranchSizFac > 0.0) { - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).PumpSizFac = BranchSizFac; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).PumpSizFac = BranchSizFac; ++NumBrSizFac; } } @@ -3067,14 +3066,14 @@ namespace EnergyPlus::PlantManager { PlantSizData(PlantSizNum).PlantSizFac = PlantSizFac; // might deprecate this next bit in favor of simpler storage in PlantSizData structure for (BranchNum = 1; - BranchNum <= PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { - if (PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn == - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).NodeNumIn) { - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).PumpSizFac = PlantSizFac; + BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn == + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).NodeNumIn) { + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).PumpSizFac = PlantSizFac; } - if (PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumOut == - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).NodeNumOut) { - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).PumpSizFac = PlantSizFac; + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumOut == + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).NodeNumOut) { + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).PumpSizFac = PlantSizFac; } } @@ -3091,10 +3090,10 @@ namespace EnergyPlus::PlantManager { // sum up contributions from CompDesWaterFlow, demand side size request (non-coincident) PlantSizData(PlantSizNum).DesVolFlowRate = 0.0; // init for summation - for (BranchNum = 1; BranchNum <= PlantLoop(LoopNum).LoopSide(DemandSide).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(DemandSide).Branch( + for (BranchNum = 1; BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch( BranchNum).TotalComponents; ++CompNum) { - SupNodeNum = PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).NodeNumIn; + SupNodeNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).NodeNumIn; for (WaterCompNum = 1; WaterCompNum <= SaveNumPlantComps; ++WaterCompNum) { if (SupNodeNum == CompDesWaterFlow(WaterCompNum).SupNode) { PlantSizData(PlantSizNum).DesVolFlowRate += CompDesWaterFlow( @@ -3104,53 +3103,53 @@ namespace EnergyPlus::PlantManager { } } - if (!PlantLoop(LoopNum).MaxVolFlowRateWasAutoSized && (PlantLoop(LoopNum).MaxVolFlowRate > 0.0)) { + if (!state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRateWasAutoSized && (state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate > 0.0)) { // if the user puts in a large throwaway value for hard max plant loop size, they may not want this affecting anything else. // but if they put in a smaller value, then it should cap the design size, so use hard value if it is smaller than non-coincident // result PlantSizData(PlantSizNum).DesVolFlowRate = std::min(PlantSizData(PlantSizNum).DesVolFlowRate, - PlantLoop(LoopNum).MaxVolFlowRate); + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate); } } - if (PlantLoop(LoopNum).MaxVolFlowRateWasAutoSized) { + if (state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRateWasAutoSized) { if ((PlantSizNum > 0)) { if (PlantSizData(PlantSizNum).DesVolFlowRate >= SmallWaterVolFlow) { - PlantLoop(LoopNum).MaxVolFlowRate = + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate = PlantSizData(PlantSizNum).DesVolFlowRate * PlantSizData(PlantSizNum).PlantSizFac; } else { - PlantLoop(LoopNum).MaxVolFlowRate = 0.0; + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate = 0.0; if (PlantFinalSizesOkayToReport) { ShowWarningError( state, format("SizePlantLoop: Calculated Plant Sizing Design Volume Flow Rate=[{:.2R}] is too small. Set to 0.0", PlantSizData(PlantSizNum).DesVolFlowRate)); - ShowContinueError(state, "..occurs for PlantLoop=" + PlantLoop(LoopNum).Name); + ShowContinueError(state, "..occurs for PlantLoop=" + state.dataPlnt->PlantLoop(LoopNum).Name); } } if (Finalize) { if (PlantFinalSizesOkayToReport) { - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { BaseSizer::reportSizerOutput(state, - "PlantLoop", PlantLoop(LoopNum).Name, "Maximum Loop Flow Rate [m3/s]", - PlantLoop(LoopNum).MaxVolFlowRate); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { + "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Maximum Loop Flow Rate [m3/s]", + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate); + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { BaseSizer::reportSizerOutput(state, - "CondenserLoop", PlantLoop(LoopNum).Name, "Maximum Loop Flow Rate [m3/s]", - PlantLoop(LoopNum).MaxVolFlowRate); + "CondenserLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Maximum Loop Flow Rate [m3/s]", + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate); } } if (PlantFirstSizesOkayToReport) { - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { BaseSizer::reportSizerOutput(state, - "PlantLoop", PlantLoop(LoopNum).Name, "Initial Maximum Loop Flow Rate [m3/s]", - PlantLoop(LoopNum).MaxVolFlowRate); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { + "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Initial Maximum Loop Flow Rate [m3/s]", + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate); + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { BaseSizer::reportSizerOutput(state, - "CondenserLoop", PlantLoop(LoopNum).Name, - "Initial Maximum Loop Flow Rate [m3/s]", PlantLoop(LoopNum).MaxVolFlowRate); + "CondenserLoop", state.dataPlnt->PlantLoop(LoopNum).Name, + "Initial Maximum Loop Flow Rate [m3/s]", state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate); } } } @@ -3158,55 +3157,55 @@ namespace EnergyPlus::PlantManager { } else { if (PlantFirstSizesOkayToFinalize) { ShowFatalError(state, "Autosizing of plant loop requires a loop Sizing:Plant object"); - ShowContinueError(state, "Occurs in PlantLoop object=" + PlantLoop(LoopNum).Name); + ShowContinueError(state, "Occurs in PlantLoop object=" + state.dataPlnt->PlantLoop(LoopNum).Name); ErrorsFound = true; } } } // Small loop mass no longer introduces instability. Checks and warnings removed by SJR 20 July 2007. - if (PlantLoop(LoopNum).VolumeWasAutoSized) { + if (state.dataPlnt->PlantLoop(LoopNum).VolumeWasAutoSized) { // There is no stability requirement (mass can be zero), autosizing is based on loop circulation time. // Note this calculation also appears in PlantManager::ResizePlantLoopLevelSizes and SizingAnalysisObjects::ResolveDesignFlowRate - PlantLoop(LoopNum).Volume = - PlantLoop(LoopNum).MaxVolFlowRate * PlantLoop(LoopNum).CirculationTime * 60.0; + state.dataPlnt->PlantLoop(LoopNum).Volume = + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate * state.dataPlnt->PlantLoop(LoopNum).CirculationTime * 60.0; if (PlantFinalSizesOkayToReport) { - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { // condenser loop vs plant loop breakout needed. - BaseSizer::reportSizerOutput(state, "PlantLoop", PlantLoop(LoopNum).Name, "Plant Loop Volume [m3]", - PlantLoop(LoopNum).Volume); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { - BaseSizer::reportSizerOutput(state, "CondenserLoop", PlantLoop(LoopNum).Name, "Condenser Loop Volume [m3]", - PlantLoop(LoopNum).Volume); + BaseSizer::reportSizerOutput(state, "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Plant Loop Volume [m3]", + state.dataPlnt->PlantLoop(LoopNum).Volume); + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { + BaseSizer::reportSizerOutput(state, "CondenserLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Condenser Loop Volume [m3]", + state.dataPlnt->PlantLoop(LoopNum).Volume); } } if (PlantFirstSizesOkayToReport) { - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { // condenser loop vs plant loop breakout needed. - BaseSizer::reportSizerOutput(state, "PlantLoop", PlantLoop(LoopNum).Name, "Initial Plant Loop Volume [m3]", - PlantLoop(LoopNum).Volume); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { - BaseSizer::reportSizerOutput(state, "CondenserLoop", PlantLoop(LoopNum).Name, - "Initial Condenser Loop Volume [m3]", PlantLoop(LoopNum).Volume); + BaseSizer::reportSizerOutput(state, "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Initial Plant Loop Volume [m3]", + state.dataPlnt->PlantLoop(LoopNum).Volume); + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { + BaseSizer::reportSizerOutput(state, "CondenserLoop", state.dataPlnt->PlantLoop(LoopNum).Name, + "Initial Condenser Loop Volume [m3]", state.dataPlnt->PlantLoop(LoopNum).Volume); } } } // should now have plant volume, calculate plant volume's mass for fluid type - if (PlantLoop(LoopNum).FluidType == NodeType_Water) { - FluidDensity = GetDensityGlycol(state, PlantLoop(LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - PlantLoop(LoopNum).FluidIndex, RoutineName); - } else if (PlantLoop(LoopNum).FluidType == NodeType_Steam) { - FluidDensity = GetSatDensityRefrig(state, fluidNameSteam, 100.0, 1.0, PlantLoop(LoopNum).FluidIndex, + if (state.dataPlnt->PlantLoop(LoopNum).FluidType == NodeType_Water) { + FluidDensity = GetDensityGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, DataGlobalConstants::InitConvTemp, + state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); + } else if (state.dataPlnt->PlantLoop(LoopNum).FluidType == NodeType_Steam) { + FluidDensity = GetSatDensityRefrig(state, fluidNameSteam, 100.0, 1.0, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); } else { assert(false); } - PlantLoop(LoopNum).Mass = PlantLoop(LoopNum).Volume * FluidDensity; + state.dataPlnt->PlantLoop(LoopNum).Mass = state.dataPlnt->PlantLoop(LoopNum).Volume * FluidDensity; - PlantLoop(LoopNum).MaxMassFlowRate = PlantLoop(LoopNum).MaxVolFlowRate * FluidDensity; - PlantLoop(LoopNum).MinMassFlowRate = PlantLoop(LoopNum).MinVolFlowRate * FluidDensity; + state.dataPlnt->PlantLoop(LoopNum).MaxMassFlowRate = state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate * FluidDensity; + state.dataPlnt->PlantLoop(LoopNum).MinMassFlowRate = state.dataPlnt->PlantLoop(LoopNum).MinVolFlowRate * FluidDensity; if (ErrorsFound) { ShowFatalError(state, "Preceding sizing errors cause program termination"); @@ -3230,9 +3229,7 @@ namespace EnergyPlus::PlantManager { // Using/Aliasing using namespace DataSizing; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; - ; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("ResizePlantLoop"); @@ -3249,13 +3246,13 @@ namespace EnergyPlus::PlantManager { Real64 PlantSizeFac = 0.0; - PlantSizNum = PlantLoop(LoopNum).PlantSizNum; + PlantSizNum = state.dataPlnt->PlantLoop(LoopNum).PlantSizNum; // fill PlantSizFac from data structure - for (BranchNum = 1; BranchNum <= PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { - if (PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn == - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).NodeNumIn) { - PlantSizeFac = PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).PumpSizFac; + for (BranchNum = 1; BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn == + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).NodeNumIn) { + PlantSizeFac = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).PumpSizFac; break; } } @@ -3264,10 +3261,10 @@ namespace EnergyPlus::PlantManager { // so refresh sum of registered flows (they may have changed) PlantSizData(PlantSizNum).DesVolFlowRate = 0.0; // init for summation - for (BranchNum = 1; BranchNum <= PlantLoop(LoopNum).LoopSide(DemandSide).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(DemandSide).Branch( + for (BranchNum = 1; BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch( BranchNum).TotalComponents; ++CompNum) { - SupNodeNum = PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).NodeNumIn; + SupNodeNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).NodeNumIn; for (WaterCompNum = 1; WaterCompNum <= SaveNumPlantComps; ++WaterCompNum) { if (SupNodeNum == CompDesWaterFlow(WaterCompNum).SupNode) { PlantSizData(PlantSizNum).DesVolFlowRate += CompDesWaterFlow( @@ -3278,66 +3275,66 @@ namespace EnergyPlus::PlantManager { } } - if (PlantLoop(LoopNum).MaxVolFlowRateWasAutoSized) { + if (state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRateWasAutoSized) { if ((PlantSizNum > 0)) { if (PlantSizData(PlantSizNum).DesVolFlowRate >= SmallWaterVolFlow) { - PlantLoop(LoopNum).MaxVolFlowRate = PlantSizData(PlantSizNum).DesVolFlowRate * PlantSizeFac; + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate = PlantSizData(PlantSizNum).DesVolFlowRate * PlantSizeFac; } else { - PlantLoop(LoopNum).MaxVolFlowRate = 0.0; + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate = 0.0; if (PlantFinalSizesOkayToReport) { ShowWarningError( state, format("SizePlantLoop: Calculated Plant Sizing Design Volume Flow Rate=[{:.2R}] is too small. Set to 0.0", PlantSizData(PlantSizNum).DesVolFlowRate)); - ShowContinueError(state, "..occurs for PlantLoop=" + PlantLoop(LoopNum).Name); + ShowContinueError(state, "..occurs for PlantLoop=" + state.dataPlnt->PlantLoop(LoopNum).Name); } } if (PlantFinalSizesOkayToReport) { - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { - BaseSizer::reportSizerOutput(state, "PlantLoop", PlantLoop(LoopNum).Name, "Maximum Loop Flow Rate [m3/s]", - PlantLoop(LoopNum).MaxVolFlowRate); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + BaseSizer::reportSizerOutput(state, "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Maximum Loop Flow Rate [m3/s]", + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate); + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { BaseSizer::reportSizerOutput(state, - "CondenserLoop", PlantLoop(LoopNum).Name, "Maximum Loop Flow Rate [m3/s]", - PlantLoop(LoopNum).MaxVolFlowRate); + "CondenserLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Maximum Loop Flow Rate [m3/s]", + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate); } } } } // Small loop mass no longer introduces instability. Checks and warnings removed by SJR 20 July 2007. - if (PlantLoop(LoopNum).VolumeWasAutoSized) { + if (state.dataPlnt->PlantLoop(LoopNum).VolumeWasAutoSized) { // There is no stability requirement (mass can be zero), autosizing is based on loop circulation time. // Note this calculation also appears in PlantManager::SizePlantLoop and SizingAnalysisObjects::ResolveDesignFlowRate - PlantLoop(LoopNum).Volume = - PlantLoop(LoopNum).MaxVolFlowRate * PlantLoop(LoopNum).CirculationTime * 60.0; - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + state.dataPlnt->PlantLoop(LoopNum).Volume = + state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate * state.dataPlnt->PlantLoop(LoopNum).CirculationTime * 60.0; + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { // condenser loop vs plant loop breakout needed. - BaseSizer::reportSizerOutput(state, "PlantLoop", PlantLoop(LoopNum).Name, "Plant Loop Volume [m3]", - PlantLoop(LoopNum).Volume); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { - BaseSizer::reportSizerOutput(state, "CondenserLoop", PlantLoop(LoopNum).Name, "Condenser Loop Volume [m3]", - PlantLoop(LoopNum).Volume); + BaseSizer::reportSizerOutput(state, "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Plant Loop Volume [m3]", + state.dataPlnt->PlantLoop(LoopNum).Volume); + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { + BaseSizer::reportSizerOutput(state, "CondenserLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Condenser Loop Volume [m3]", + state.dataPlnt->PlantLoop(LoopNum).Volume); } } // should now have plant volume, calculate plant volume's mass for fluid type - if (PlantLoop(LoopNum).FluidType == NodeType_Water) { - FluidDensity = GetDensityGlycol(state, PlantLoop(LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - PlantLoop(LoopNum).FluidIndex, RoutineName); - } else if (PlantLoop(LoopNum).FluidType == NodeType_Steam) { - FluidDensity = GetSatDensityRefrig(state, fluidNameSteam, 100.0, 1.0, PlantLoop(LoopNum).FluidIndex, + if (state.dataPlnt->PlantLoop(LoopNum).FluidType == NodeType_Water) { + FluidDensity = GetDensityGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, DataGlobalConstants::InitConvTemp, + state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); + } else if (state.dataPlnt->PlantLoop(LoopNum).FluidType == NodeType_Steam) { + FluidDensity = GetSatDensityRefrig(state, fluidNameSteam, 100.0, 1.0, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); } else { assert(false); } - PlantLoop(LoopNum).Mass = PlantLoop(LoopNum).Volume * FluidDensity; + state.dataPlnt->PlantLoop(LoopNum).Mass = state.dataPlnt->PlantLoop(LoopNum).Volume * FluidDensity; - PlantLoop(LoopNum).MaxMassFlowRate = PlantLoop(LoopNum).MaxVolFlowRate * FluidDensity; - PlantLoop(LoopNum).MinMassFlowRate = PlantLoop(LoopNum).MinVolFlowRate * FluidDensity; + state.dataPlnt->PlantLoop(LoopNum).MaxMassFlowRate = state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate * FluidDensity; + state.dataPlnt->PlantLoop(LoopNum).MinMassFlowRate = state.dataPlnt->PlantLoop(LoopNum).MinVolFlowRate * FluidDensity; if (ErrorsFound) { ShowFatalError(state, "Preceding sizing errors cause program termination"); @@ -3475,14 +3472,14 @@ namespace EnergyPlus::PlantManager { LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; - if (allocated(PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected)) { + if (allocated(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected)) { for (ConnctNum = 1; - ConnctNum <= isize(PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected); ++ConnctNum) { - OtherLoopNum = PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected(ConnctNum).LoopNum; - OtherLoopSideNum = PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected(ConnctNum).LoopSideNum; + ConnctNum <= isize(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected); ++ConnctNum) { + OtherLoopNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected(ConnctNum).LoopNum; + OtherLoopSideNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected(ConnctNum).LoopSideNum; OtherLoopCallingIndex = FindLoopSideInCallingOrder(OtherLoopNum, OtherLoopSideNum); - thisLoopPutsDemandOnAnother = PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected( + thisLoopPutsDemandOnAnother = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected( ConnctNum).LoopDemandsOnRemote; if (thisLoopPutsDemandOnAnother) { // make sure this loop side is called before the other loop side if (OtherLoopCallingIndex < HalfLoopNum) { // rearrange @@ -3606,27 +3603,27 @@ namespace EnergyPlus::PlantManager { int NumCount; // first set component level control type (obsoletes one input in field set for Branch ) - if (allocated(PlantLoop)) { - NumCount = size(PlantLoop); + if (allocated(state.dataPlnt->PlantLoop)) { + NumCount = size(state.dataPlnt->PlantLoop); } else { NumCount = 0; } for (LoopCtr = 1; LoopCtr <= NumCount; ++LoopCtr) { for (LoopSideCtr = DemandSide; LoopSideCtr <= SupplySide; ++LoopSideCtr) { - for (BranchCtr = 1; BranchCtr <= PlantLoop(LoopCtr).LoopSide(LoopSideCtr).TotalBranches; ++BranchCtr) { + for (BranchCtr = 1; BranchCtr <= state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).TotalBranches; ++BranchCtr) { BranchIsInSplitterMixer = false; // test if this branch is inside a splitter/mixer - if (PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Splitter.Exists) { - if ((BranchCtr > 1) && (BranchCtr < PlantLoop(LoopCtr).LoopSide(LoopSideCtr).TotalBranches)) { + if (state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Splitter.Exists) { + if ((BranchCtr > 1) && (BranchCtr < state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).TotalBranches)) { BranchIsInSplitterMixer = true; } } - NumComponentsOnBranch = PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).TotalComponents; + NumComponentsOnBranch = state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).TotalComponents; - for (CompCtr = 1; CompCtr <= isize(PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).Comp); ++CompCtr) { + for (CompCtr = 1; CompCtr <= isize(state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).Comp); ++CompCtr) { - auto &this_component(PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).Comp(CompCtr)); + auto &this_component(state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).Comp(CompCtr)); { auto const SELECT_CASE_var(this_component.TypeOf_Num); @@ -4206,39 +4203,39 @@ namespace EnergyPlus::PlantManager { // now set up branch control types based on components. - if (allocated(PlantLoop)) { - NumCount = size(PlantLoop); + if (allocated(state.dataPlnt->PlantLoop)) { + NumCount = size(state.dataPlnt->PlantLoop); } else { NumCount = 0; } for (LoopCtr = 1; LoopCtr <= NumCount; ++LoopCtr) { // SIZE(PlantLoop) for (LoopSideCtr = DemandSide; LoopSideCtr <= SupplySide; ++LoopSideCtr) { for (BranchCtr = 1; - BranchCtr <= PlantLoop(LoopCtr).LoopSide(LoopSideCtr).TotalBranches; ++BranchCtr) { + BranchCtr <= state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).TotalBranches; ++BranchCtr) { ActiveCount = 0; BypassCount = 0; - for (CompCtr = 1; CompCtr <= isize(PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( + for (CompCtr = 1; CompCtr <= isize(state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( BranchCtr).Comp); ++CompCtr) { - ComponentFlowCtrl = PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).Comp( + ComponentFlowCtrl = state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).Comp( CompCtr).FlowCtrl; { auto const SELECT_CASE_var(ComponentFlowCtrl); if (SELECT_CASE_var == DataBranchAirLoopPlant::ControlTypeEnum::Unknown) { - PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( + state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( BranchCtr).ControlType = DataBranchAirLoopPlant::ControlTypeEnum::Passive; } else if (SELECT_CASE_var == DataBranchAirLoopPlant::ControlTypeEnum::Active) { ++ActiveCount; if (ActiveCount > 1) { // assume multiple active components in series means branch is SeriesActive - PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( + state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( BranchCtr).ControlType = DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive; // assume all components on branch are to be SeriesActive as well - for (auto &e : PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).Comp) + for (auto &e : state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).Comp) e.FlowCtrl = DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive; } else { - PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( + state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( BranchCtr).ControlType = DataBranchAirLoopPlant::ControlTypeEnum::Active; } @@ -4246,9 +4243,9 @@ namespace EnergyPlus::PlantManager { ShowSevereError(state, "An active component is on the same branch as a pipe situated between splitter/mixer"); ShowContinueError(state, "Occurs in Branch=" + - PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( + state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( BranchCtr).Name); - ShowContinueError(state, "Occurs in Plant Loop=" + PlantLoop(LoopCtr).Name); + ShowContinueError(state, "Occurs in Plant Loop=" + state.dataPlnt->PlantLoop(LoopCtr).Name); ShowContinueError(state, "SetupBranchControlTypes: and the simulation continues"); // DSU3 note not sure why this is so bad. heat transfer pipe might be a good reason to allow this? // this used to fatal in older PlantFlowResolver. @@ -4258,18 +4255,18 @@ namespace EnergyPlus::PlantManager { } else if (SELECT_CASE_var == DataBranchAirLoopPlant::ControlTypeEnum::Bypass) { ++BypassCount; - PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( + state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( BranchCtr).ControlType = DataBranchAirLoopPlant::ControlTypeEnum::Bypass; - PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).IsBypass = true; - PlantLoop(LoopCtr).LoopSide(LoopSideCtr).BypassExists = true; + state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch(BranchCtr).IsBypass = true; + state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).BypassExists = true; if (CompCtr > 1) { ShowSevereError(state, "A pipe used as a bypass should not be in series with another component"); ShowContinueError(state, "Occurs in Branch = " + - PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( + state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( BranchCtr).Name); - ShowContinueError(state, "Occurs in PlantLoop = " + PlantLoop(LoopCtr).Name); + ShowContinueError(state, "Occurs in PlantLoop = " + state.dataPlnt->PlantLoop(LoopCtr).Name); ShowFatalError(state, "SetupBranchControlTypes: preceding condition causes termination."); } @@ -4281,7 +4278,7 @@ namespace EnergyPlus::PlantManager { if (BypassCount > 0) { } else { - PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( + state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).Branch( BranchCtr).ControlType = DataBranchAirLoopPlant::ControlTypeEnum::Passive; } } @@ -4325,7 +4322,7 @@ namespace EnergyPlus::PlantManager { state.dataGlobal->AnyPlantInModel = true; } else { state.dataGlobal->AnyPlantInModel = false; - PlantLoop.allocate(0); + state.dataPlnt->PlantLoop.allocate(0); } } @@ -4333,14 +4330,14 @@ namespace EnergyPlus::PlantManager { int LoopNum; for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { // Warning if the excess storage time is more than half of the total time - if (PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_CapExcessStorageTime > - PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TotalTime / 2) { - ShowWarningError(state, "Plant Loop: " + PlantLoop(LoopNum).Name + + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_CapExcessStorageTime > + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TotalTime / 2) { + ShowWarningError(state, "Plant Loop: " + state.dataPlnt->PlantLoop(LoopNum).Name + " Demand Side is storing excess heat the majority of the time."); } - if (PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_CapExcessStorageTime > - PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TotalTime / 2) { - ShowWarningError(state, "Plant Loop: " + PlantLoop(LoopNum).Name + + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_CapExcessStorageTime > + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TotalTime / 2) { + ShowWarningError(state, "Plant Loop: " + state.dataPlnt->PlantLoop(LoopNum).Name + " Supply Side is storing excess heat the majority of the time."); } } diff --git a/src/EnergyPlus/Plant/PlantManager.hh b/src/EnergyPlus/Plant/PlantManager.hh index 0d3bf9e5c2e..73f6d89e2cb 100644 --- a/src/EnergyPlus/Plant/PlantManager.hh +++ b/src/EnergyPlus/Plant/PlantManager.hh @@ -99,7 +99,7 @@ namespace PlantManager { void CheckPlantOnAbort(EnergyPlusData &state); - void InitOneTimePlantSizingInfo(int LoopNum); // loop being initialized for sizing + void InitOneTimePlantSizingInfo(EnergyPlusData &state, int LoopNum); // loop being initialized for sizing void SizePlantLoop(EnergyPlusData &state, int LoopNum, // Supply side loop being simulated bool OkayToFinish); diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index 45e80983582..d4b88dbe0d3 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -260,10 +260,10 @@ namespace PlantCentralGSHP { ErrorsFound = false; // find the appropriate Plant Sizing object - int PltSizNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; // if ( Wrapper( WrapperNum ).ChillerHeater( NumChillerHeater ).CondVolFlowRate == AutoSize ) { - int PltSizCondNum = DataPlant::PlantLoop(this->GLHELoopNum).PlantSizNum; + int PltSizCondNum = state.dataPlnt->PlantLoop(this->GLHELoopNum).PlantSizNum; //} Real64 tmpNomCap = this->ChillerHeater(NumChillerHeater).RefCapCooling; @@ -349,14 +349,14 @@ namespace PlantCentralGSHP { // each individual chiller heater module is sized to be capable of supporting the total load on the wrapper if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpEvapVolFlowRate > 0.0) { - Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * tmpEvapVolFlowRate; if (!this->ChillerHeater(NumChillerHeater).RefCapCoolingWasAutoSized) @@ -442,14 +442,14 @@ namespace PlantCentralGSHP { // each individual chiller heater module is sized to be capable of supporting the total load on the wrapper if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->GLHELoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->GLHELoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->GLHELoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GLHELoopNum).FluidIndex, RoutineName); // TODO: JM 2018-12-06 I wonder why Cp isn't calculated at the same temp as rho... - Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->GLHELoopNum).FluidName, + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->GLHELoopNum).FluidName, this->ChillerHeater(NumChillerHeater).TempRefCondInCooling, - DataPlant::PlantLoop(this->GLHELoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GLHELoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * @@ -1492,22 +1492,22 @@ namespace PlantCentralGSHP { this->GLHEInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->GLHELoopNum, this->GLHELoopSideNum, DataPlant::TypeOf_CentralGroundSourceHeatPump, true); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->HWLoopNum, this->HWLoopSideNum, this->GLHELoopNum, this->GLHELoopSideNum, DataPlant::TypeOf_CentralGroundSourceHeatPump, true); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->HWLoopNum, this->HWLoopSideNum, DataPlant::TypeOf_CentralGroundSourceHeatPump, true); if (this->VariableFlowCH) { // Reset flow priority if (LoopNum == this->CWLoopNum) { - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } else if (LoopNum == this->HWLoopNum) { - DataPlant::PlantLoop(this->HWLoopNum).LoopSide(this->HWLoopSideNum).Branch(this->HWBranchNum).Comp(this->HWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->HWLoopNum).LoopSide(this->HWLoopSideNum).Branch(this->HWBranchNum).Comp(this->HWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } @@ -1539,7 +1539,7 @@ namespace PlantCentralGSHP { } this->CoolSetPointSetToLoop = true; DataLoopNode::Node(this->CHWOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } if (DataLoopNode::Node(this->HWOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) { @@ -1569,7 +1569,7 @@ namespace PlantCentralGSHP { } this->HeatSetPointSetToLoop = true; DataLoopNode::Node(this->HWOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; } } this->MyWrapperFlag = false; @@ -1590,9 +1590,9 @@ namespace PlantCentralGSHP { } Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->CHWMassFlowRateMax = this->CHWVolFlowRate * rho; @@ -1651,12 +1651,12 @@ namespace PlantCentralGSHP { if (this->CoolSetPointSetToLoop) { // IF (CurCoolingLoad > 0.0d0) THEN DataLoopNode::Node(this->CHWOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } // IF (CurHeatingLoad > 0.0d0) THEN if (this->HeatSetPointSetToLoop) { DataLoopNode::Node(this->HWOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; // ENDIF } @@ -1834,14 +1834,14 @@ namespace PlantCentralGSHP { // Calculate density ratios to adjust mass flow rates from initialized ones // Hot water temperature is known, but evaporator mass flow rates will be adjusted in the following "Do" loop Real64 InitDensity = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 EvapDensity = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, EvapInletTemp, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, EvapInletTemp, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 CondDensity = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, CondInletTemp, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); // Calculate density ratios to adjust mass flow rates from initialized ones @@ -1956,10 +1956,10 @@ namespace PlantCentralGSHP { // Calculate the specific heat of chilled water Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, EvapInletTemp, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, EvapInletTemp, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); // Calculate cooling load this chiller should meet and the other chillers are demanded - EvapOutletTempSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + EvapOutletTempSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; // Minimum capacity of the evaporator Real64 EvaporatorCapMin = @@ -2086,9 +2086,9 @@ namespace PlantCentralGSHP { } if (CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { - Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->GLHELoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->GLHELoopNum).FluidName, CondInletTemp, - DataPlant::PlantLoop(this->GLHELoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->GLHELoopNum).FluidIndex, RoutineNameElecEIRChiller); CondOutletTemp = QCondenser / CondMassFlowRate / Cp + CondInletTemp; } else { @@ -2262,14 +2262,14 @@ namespace PlantCentralGSHP { // Calculate density ratios to adjust mass flow rates from initialized ones // Hot water temperature is known, but condenser mass flow rates will be adjusted in the following "Do" loop Real64 InitDensity = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 EvapDensity = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, EvapInletTemp, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, EvapInletTemp, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 CondDensity = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->CWLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, CondInletTemp, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); // Calculate density ratios to adjust mass flow rates from initialized ones Real64 HWDensityRatio = CondDensity / InitDensity; @@ -2356,9 +2356,9 @@ namespace PlantCentralGSHP { // Mode 4 uses all data from the chilled water loop due to no heating demand if (this->SimulClgDominant || CurrentMode == 3) { CurrentMode = 3; - Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->HWLoopNum).FluidName, + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, CondInletTemp, - DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); QCondenser = this->ChillerHeater(ChillerHeaterNum).Report.QCondSimul; @@ -2416,7 +2416,7 @@ namespace PlantCentralGSHP { ShowContinueError(state, format("Chiller condensor temperature for curve fit are not decided, defalt value= cond_leaving ({:.3R}).", ChillerCapFT)); - CondTempforCurve = DataLoopNode::Node(DataPlant::PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; + CondTempforCurve = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; } Real64 MinPartLoadRat; // Min allowed operating fraction of full load @@ -2468,9 +2468,9 @@ namespace PlantCentralGSHP { PartLoadRat = 0.0; } - Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->HWLoopNum).FluidName, + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, this->ChillerHeater(ChillerHeaterNum).EvapInletNode.Temp, - DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); // Calculate evaporator heat transfer @@ -2553,9 +2553,9 @@ namespace PlantCentralGSHP { // Set load this chiller heater should meet and temperatures given QCondenser = min(HeatingLoadToMeet, QCondenser); - Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->HWLoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, CondInletTemp, - DataPlant::PlantLoop(this->HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineNameElecEIRChiller); // Calculate temperatures for constant flow and mass flow rate for variable flow @@ -2719,7 +2719,7 @@ namespace PlantCentralGSHP { CurCoolingLoad = std::abs(MyLoad); this->WrapperCoolingLoad = CurCoolingLoad; // Set actual mass flow rate at the nodes when it's locked - if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { CHWInletMassFlowRate = DataLoopNode::Node(this->CHWInletNodeNum).MassFlowRate; } if (CHWInletMassFlowRate == 0.0) GLHEInletMassFlowRate = 0.0; @@ -2733,7 +2733,7 @@ namespace PlantCentralGSHP { CurHeatingLoad = MyLoad; this->WrapperHeatingLoad = CurHeatingLoad; // Set actual mass flow rate at the nodes when it's locked - if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { HWInletMassFlowRate = DataLoopNode::Node(this->HWInletNodeNum).MassFlowRate; } if (HWInletMassFlowRate == 0.0) GLHEInletMassFlowRate = 0.0; diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index bb28f751033..b3f01c9d862 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -679,9 +679,9 @@ namespace PlantChillers { { if (calledFromLocation.loopNum == this->CWLoopNum) { // chilled water loop this->initialize(state, RunFlag, CurLoad); - auto &sim_component(DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum)); + auto &sim_component(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum)); this->calculate(state, CurLoad, RunFlag, sim_component.FlowCtrl); - this->update(CurLoad, RunFlag); + this->update(state, CurLoad, RunFlag); } else if (calledFromLocation.loopNum == this->CDLoopNum) { // condenser loop PlantUtilities::UpdateChillerComponentCondenserSide(state, this->CDLoopNum, this->CDLoopSideNum, @@ -756,7 +756,7 @@ namespace PlantChillers { _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); } if (this->HeatRecActive) { @@ -773,13 +773,13 @@ namespace PlantChillers { _, this->HeatRecInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); } if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); } @@ -789,13 +789,13 @@ namespace PlantChillers { if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; // check if setpoint on outlet node @@ -828,13 +828,13 @@ namespace PlantChillers { } this->ModulatedFlowSetToLoop = true; { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } } @@ -845,9 +845,9 @@ namespace PlantChillers { if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->EvapMassFlowRateMax = rho * this->EvapVolFlowRate; @@ -866,9 +866,9 @@ namespace PlantChillers { DataLoopNode::Node(this->CondInletNodeNum).Temp = this->TempDesCondIn; // DSU? old behavior, still want? rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondMassFlowRateMax = rho * this->CondVolFlowRate; @@ -899,9 +899,9 @@ namespace PlantChillers { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HRLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; @@ -918,7 +918,7 @@ namespace PlantChillers { if (this->HeatRecSetPointNodeNum > 0) { Real64 THeatRecSetPoint(0.0); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -932,7 +932,7 @@ namespace PlantChillers { ShowContinueError(state, " A temperature setpoint is needed at the heat recovery leaving temperature setpoint node " "specified, use a SetpointManager"); ShowContinueError(state, " The overall loop setpoint will be assumed for heat recovery. The simulation continues ..."); - this->HeatRecSetPointNodeNum = DataPlant::PlantLoop(this->HRLoopNum).TempSetPointNodeNum; + this->HeatRecSetPointNodeNum = state.dataPlnt->PlantLoop(this->HRLoopNum).TempSetPointNodeNum; this->HRSPErrDone = true; } } else { @@ -947,7 +947,7 @@ namespace PlantChillers { "specified, use a SetpointManager to establish a setpoint"); ShowContinueError(state, " or use an EMS actuator to establish a setpoint at this node "); ShowContinueError(state, " The overall loop setpoint will be assumed for heat recovery. The simulation continues ..."); - this->HeatRecSetPointNodeNum = DataPlant::PlantLoop(this->HRLoopNum).TempSetPointNodeNum; + this->HeatRecSetPointNodeNum = state.dataPlnt->PlantLoop(this->HRLoopNum).TempSetPointNodeNum; this->HRSPErrDone = true; } } @@ -966,13 +966,13 @@ namespace PlantChillers { // fix for clumsy old input that worked because loop setpoint was spread. // could be removed with transition, testing , model change, period of being obsolete. { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } } @@ -1038,23 +1038,23 @@ namespace PlantChillers { bool ErrorsFound(false); // If errors detected in input if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; + PltSizCondNum = state.dataPlnt->PlantLoop(this->CDLoopNum).PlantSizNum; } - int PltSizNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; Real64 tmpNomCap = this->NomCap; if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; } else { @@ -1166,14 +1166,14 @@ namespace PlantChillers { if (PltSizCondNum > 0 && PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + 1.0 / this->COP) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); } else { @@ -1353,7 +1353,7 @@ namespace PlantChillers { if (MyLoad >= 0.0 || !RunFlag) { // call for zero flow before leaving if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -1366,7 +1366,7 @@ namespace PlantChillers { this->CWCompNum); } if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == + if (state.dataPlnt->PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; } else { @@ -1401,7 +1401,7 @@ namespace PlantChillers { this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->CWLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum, @@ -1535,15 +1535,15 @@ namespace PlantChillers { } Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataLoopNode::Node(this->EvapInletNodeNum).Temp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { - this->PossibleSubcooling = !(DataPlant::PlantLoop(this->CWLoopNum) + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + this->PossibleSubcooling = !(state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWLoopSideNum) .Comp(this->CWCompNum) @@ -1585,7 +1585,7 @@ namespace PlantChillers { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint Real64 EvapDeltaTemp(0.0); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1609,7 +1609,7 @@ namespace PlantChillers { this->CWBranchNum, this->CWCompNum); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -1682,10 +1682,10 @@ namespace PlantChillers { Real64 TempEvapOutSetPoint(0.0); // C - evaporator outlet temperature setpoint { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWLoopSideNum) .Comp(this->CWCompNum) @@ -1693,11 +1693,11 @@ namespace PlantChillers { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWLoopSideNum) .Comp(this->CWCompNum) @@ -1705,7 +1705,7 @@ namespace PlantChillers { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } } @@ -1809,7 +1809,7 @@ namespace PlantChillers { // If Heat Recovery specified for this vapor compression chiller, then Qcondenser will be adjusted by this subroutine if (this->HeatRecActive) this->calcHeatRecovery(state, this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovered); Real64 CpCond = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, condInletTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / CpCond + condInletTemp; } else { ShowSevereError(state, "CalcElectricChillerModel: Condenser flow = 0, for ElectricChiller=" + this->Name); @@ -1887,7 +1887,7 @@ namespace PlantChillers { static std::string const RoutineName("ChillerHeatRecovery"); // setup initial state - PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); this->QHeatRecovery = 0.0; this->EnergyHeatRecovery = 0.0; @@ -1896,12 +1896,12 @@ namespace PlantChillers { Real64 HeatRecMassFlowRate = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; Real64 CpHeatRec = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, this->HeatRecInletTemp, DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, this->HeatRecInletTemp, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); Real64 CpCond; if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { CpCond = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, condInletTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); } else { CpCond = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->CondInletNodeNum).HumRat); } @@ -1922,7 +1922,7 @@ namespace PlantChillers { } else { // use new algorithm to meet setpoint Real64 THeatRecSetPoint(0.0); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->HRLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { THeatRecSetPoint = DataLoopNode::Node(this->HeatRecSetPointNodeNum).TempSetPoint; @@ -1961,7 +1961,7 @@ namespace PlantChillers { this->ChillerCondAvgTemp = this->AvgCondSinkTemp; } - void ElectricChillerSpecs::update(Real64 const MyLoad, bool const RunFlag) + void ElectricChillerSpecs::update(EnergyPlusData &state, Real64 const MyLoad, bool const RunFlag) { // SUBROUTINE INFORMATION: // AUTHOR: Dan Fisher / Brandon Anderson @@ -1990,7 +1990,7 @@ namespace PlantChillers { if (this->HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; this->HeatRecOutletTemp = DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp; this->HeatRecMdot = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; @@ -2044,9 +2044,9 @@ namespace PlantChillers { { if (calledFromLocation.loopNum == this->CWLoopNum) { // chilled water loop this->initialize(state, RunFlag, CurLoad); - auto &sim_component(DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum)); + auto &sim_component(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum)); this->calculate(state, CurLoad, RunFlag, sim_component.FlowCtrl); - this->update(CurLoad, RunFlag); + this->update(state, CurLoad, RunFlag); } else if (calledFromLocation.loopNum == this->CDLoopNum) { // condenser loop PlantUtilities::UpdateChillerComponentCondenserSide(state, this->CDLoopNum, this->CDLoopSideNum, @@ -2704,7 +2704,7 @@ namespace PlantChillers { _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); } if (this->HeatRecActive) { @@ -2721,13 +2721,13 @@ namespace PlantChillers { _, this->HeatRecInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); } if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); } if (errFlag) { @@ -2736,13 +2736,13 @@ namespace PlantChillers { if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->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) && @@ -2774,9 +2774,9 @@ namespace PlantChillers { } this->ModulatedFlowSetToLoop = true; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } @@ -2787,9 +2787,9 @@ namespace PlantChillers { if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->EvapMassFlowRateMax = rho * this->EvapVolFlowRate; @@ -2809,9 +2809,9 @@ namespace PlantChillers { DataLoopNode::Node(this->CondInletNodeNum).Temp = this->TempDesCondIn; rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondMassFlowRateMax = rho * this->CondVolFlowRate; @@ -2840,9 +2840,9 @@ namespace PlantChillers { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HRLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; @@ -2867,9 +2867,9 @@ namespace PlantChillers { // 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(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } Real64 mdot; @@ -2939,22 +2939,22 @@ namespace PlantChillers { Real64 tmpCondVolFlowRate = this->CondVolFlowRate; if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; + PltSizCondNum = state.dataPlnt->PlantLoop(this->CDLoopNum).PlantSizNum; } - int PltSizNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; } else { @@ -3063,15 +3063,15 @@ namespace PlantChillers { if (PltSizCondNum > 0 && PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + 1.0 / this->COP) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); } else { @@ -3283,7 +3283,7 @@ namespace PlantChillers { // If Chiller load is 0 or chiller is not running then leave the subroutine. if (MyLoad >= 0.0 || !RunFlag) { if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -3298,7 +3298,7 @@ namespace PlantChillers { } if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == + if (state.dataPlnt->PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; } else { @@ -3368,7 +3368,7 @@ namespace PlantChillers { this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->CWLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum, @@ -3443,14 +3443,14 @@ namespace PlantChillers { } Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataLoopNode::Node(this->EvapInletNodeNum).Temp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = AvailChillerCap * OperPartLoadRat; Real64 FRAC; @@ -3488,7 +3488,7 @@ namespace PlantChillers { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint Real64 EvapDeltaTemp(0.0); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -3511,7 +3511,7 @@ namespace PlantChillers { this->CWBranchNum, this->CWCompNum); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -3588,10 +3588,10 @@ namespace PlantChillers { Real64 TempEvapOutSetPoint(0.0); // C - evaporator outlet temperature setpoint { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -3599,11 +3599,11 @@ namespace PlantChillers { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -3611,7 +3611,7 @@ namespace PlantChillers { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } } @@ -3715,9 +3715,9 @@ namespace PlantChillers { if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { Real64 CpCond = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->CondInletTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / CpCond + this->CondInletTemp; } else { @@ -3868,7 +3868,7 @@ namespace PlantChillers { this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; Real64 cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->HRLoopNum).FluidName, this->HeatRecInletTemp, DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, this->HeatRecInletTemp, state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); // Don't divide by zero - Note This also results in no heat recovery when // design Mdot for Heat Recovery - Specified on Chiller Input - is zero @@ -3899,7 +3899,7 @@ namespace PlantChillers { } } - void EngineDrivenChillerSpecs::update(Real64 const MyLoad, bool const RunFlag) + void EngineDrivenChillerSpecs::update(EnergyPlusData &state, Real64 const MyLoad, bool const RunFlag) { // SUBROUTINE INFORMATION: // AUTHOR: Dan Fisher / Brandon Anderson @@ -3952,7 +3952,7 @@ namespace PlantChillers { // Update the Heat Recovery outlet if (this->HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->HeatRecInletNodeNum, this->HeatRecOutletNodeNum); DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp = this->HeatRecOutletTemp; } } @@ -3977,9 +3977,9 @@ namespace PlantChillers { { if (calledFromLocation.loopNum == this->CWLoopNum) { // chilled water loop this->initialize(state, RunFlag, CurLoad); - auto &sim_component(DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum)); + auto &sim_component(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum)); this->calculate(state, CurLoad, RunFlag, sim_component.FlowCtrl); - this->update(CurLoad, RunFlag); + this->update(state, CurLoad, RunFlag); } else if (calledFromLocation.loopNum == this->CDLoopNum) { // condenser loop PlantUtilities::UpdateChillerComponentCondenserSide(state, this->CDLoopNum, this->CDLoopSideNum, @@ -4573,7 +4573,7 @@ namespace PlantChillers { _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); } if (this->HeatRecActive) { @@ -4590,13 +4590,13 @@ namespace PlantChillers { _, this->HeatRecInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, true); } if (this->CondenserType != DataPlant::CondenserType::AirCooled && this->CondenserType != DataPlant::CondenserType::EvapCooled && this->HeatRecActive) { - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CDLoopNum, this->CDLoopSideNum, this->HRLoopNum, this->HRLoopSideNum, this->plantTypeOfNum, false); } if (errFlag) { @@ -4605,13 +4605,13 @@ namespace PlantChillers { if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; // check if setpoint on outlet node @@ -4644,9 +4644,9 @@ namespace PlantChillers { } this->ModulatedFlowSetToLoop = true; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } this->MyFlag = false; @@ -4655,9 +4655,9 @@ namespace PlantChillers { if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->EvapMassFlowRateMax = rho * this->EvapVolFlowRate; @@ -4676,9 +4676,9 @@ namespace PlantChillers { DataLoopNode::Node(this->CondInletNodeNum).Temp = this->TempDesCondIn; rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondMassFlowRateMax = rho * this->CondVolFlowRate; @@ -4707,9 +4707,9 @@ namespace PlantChillers { if (this->HeatRecActive) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->HRLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineName); this->DesignHeatRecMassFlowRate = rho * this->DesignHeatRecVolFlowRate; @@ -4734,9 +4734,9 @@ namespace PlantChillers { // 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(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } Real64 mdot; @@ -4806,22 +4806,22 @@ namespace PlantChillers { int PltSizCondNum(0); // Plant Sizing index for condenser loop if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; + PltSizCondNum = state.dataPlnt->PlantLoop(this->CDLoopNum).PlantSizNum; } - int PltSizNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; } else { @@ -4932,14 +4932,14 @@ namespace PlantChillers { if (PltSizCondNum > 0 && PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, this->TempDesCondIn, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + 1.0 / this->COP) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); } else { @@ -5185,7 +5185,7 @@ namespace PlantChillers { // flow resolver will not shut down the branch if (MyLoad >= 0.0 || !RunFlag) { if (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -5199,7 +5199,7 @@ namespace PlantChillers { this->CWCompNum); } if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == + if (state.dataPlnt->PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; } else { @@ -5269,7 +5269,7 @@ namespace PlantChillers { this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->CWLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum, @@ -5338,13 +5338,13 @@ namespace PlantChillers { } Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataLoopNode::Node(this->EvapInletNodeNum).Temp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); // If FlowLock is True, the new resolved mdot is used to update Power, QEvap, Qcond, and // condenser side outlet temperature. - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = AvailChillerCap * OperPartLoadRat; Real64 FRAC; @@ -5378,7 +5378,7 @@ namespace PlantChillers { } else if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -5401,7 +5401,7 @@ namespace PlantChillers { this->CWBranchNum, this->CWCompNum); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -5467,10 +5467,10 @@ namespace PlantChillers { this->EvapOutletTemp = DataLoopNode::Node(this->EvapInletNodeNum).Temp - EvapDeltaTemp; } else { // No subcooling in this case.No recalculation required.Still need to check chiller low temp limit { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -5478,11 +5478,11 @@ namespace PlantChillers { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -5490,7 +5490,7 @@ namespace PlantChillers { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } } @@ -5594,7 +5594,7 @@ namespace PlantChillers { if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { Real64 CpCond = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, condInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, condInletTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / CpCond + condInletTemp; } else { ShowSevereError(state, "CalcGasTurbineChillerModel: Condenser flow = 0, for GasTurbineChiller=" + this->Name); @@ -5670,9 +5670,9 @@ namespace PlantChillers { heatRecMdot = DataLoopNode::Node(this->HeatRecInletNodeNum).MassFlowRate; this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; Real64 HeatRecCp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->HRLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidName, this->HeatRecInletTemp, - DataPlant::PlantLoop(this->HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HRLoopNum).FluidIndex, RoutineNameHeatRecovery); // Don't divide by zero @@ -5750,7 +5750,7 @@ namespace PlantChillers { } } - void GTChillerSpecs::update(Real64 const MyLoad, bool const RunFlag) + void GTChillerSpecs::update(EnergyPlusData &state, Real64 const MyLoad, bool const RunFlag) { // SUBROUTINE INFORMATION: // AUTHOR: Dan Fisher / Brandon Anderson @@ -5764,7 +5764,7 @@ namespace PlantChillers { DataLoopNode::Node(this->CondOutletNodeNum).Temp = DataLoopNode::Node(this->CondInletNodeNum).Temp; if (this->HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(this->HeatRecOutletNodeNum, this->HeatRecInletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->HeatRecOutletNodeNum, this->HeatRecInletNodeNum); this->HeatRecInletTemp = DataLoopNode::Node(this->HeatRecInletNodeNum).Temp; this->HeatRecOutletTemp = DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp; } @@ -5799,7 +5799,7 @@ namespace PlantChillers { DataLoopNode::Node(this->CondOutletNodeNum).Temp = this->CondOutletTemp; if (this->HeatRecActive) { - PlantUtilities::SafeCopyPlantNode(this->HeatRecOutletNodeNum, this->HeatRecInletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->HeatRecOutletNodeNum, this->HeatRecInletNodeNum); DataLoopNode::Node(this->HeatRecOutletNodeNum).Temp = this->HeatRecOutletTemp; } @@ -5844,7 +5844,7 @@ namespace PlantChillers { { if (calledFromLocation.loopNum == this->CWLoopNum) { this->initialize(state, RunFlag, CurLoad); - auto &sim_component(DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum)); + auto &sim_component(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum)); this->calculate(state, CurLoad, RunFlag, sim_component.FlowCtrl); this->update(CurLoad, RunFlag); } else if (calledFromLocation.loopNum == this->CDLoopNum) { @@ -6278,7 +6278,7 @@ namespace PlantChillers { _, this->CondInletNodeNum, _); - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->CWLoopNum, this->CWLoopSideNum, this->CDLoopNum, this->CDLoopSideNum, this->plantTypeOfNum, true); } @@ -6287,13 +6287,13 @@ namespace PlantChillers { } if (this->FlowMode == DataPlant::FlowMode::Constant) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; } if (this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) { // reset flow priority - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowPriority = DataPlant::LoopFlowStatus_NeedyIfLoopOn; // check if setpoint on outlet node @@ -6326,9 +6326,9 @@ namespace PlantChillers { } this->ModulatedFlowSetToLoop = true; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } this->MyFlag = false; @@ -6338,9 +6338,9 @@ namespace PlantChillers { if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); this->EvapMassFlowRateMax = this->EvapVolFlowRate * rho; PlantUtilities::InitComponentNodes(0.0, @@ -6358,9 +6358,9 @@ namespace PlantChillers { DataLoopNode::Node(this->CondInletNodeNum).Temp = TempDesCondIn; rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CDLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); this->CondMassFlowRateMax = rho * this->CondVolFlowRate; @@ -6396,9 +6396,9 @@ namespace PlantChillers { // 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(this->EvapOutletNodeNum).TempSetPoint = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi = - DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } Real64 mdot; @@ -6459,22 +6459,22 @@ namespace PlantChillers { tmpCondVolFlowRate = this->CondVolFlowRate; if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - PltSizCondNum = DataPlant::PlantLoop(this->CDLoopNum).PlantSizNum; + PltSizCondNum = state.dataPlnt->PlantLoop(this->CDLoopNum).PlantSizNum; } - int PltSizNum = DataPlant::PlantLoop(this->CWLoopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->CWLoopNum).PlantSizNum; if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); tmpNomCap = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * this->SizFac; } else { @@ -6587,9 +6587,9 @@ namespace PlantChillers { if (PltSizCondNum > 0 && PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow && tmpNomCap > 0.0) { Real64 rho = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, 29.44, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, 29.44, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, 29.44, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, 29.44, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); tmpCondVolFlowRate = tmpNomCap * (1.0 + 1.0 / this->COP) / (DataSizing::PlantSizData(PltSizCondNum).DeltaT * Cp * rho); } else { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; @@ -6702,10 +6702,10 @@ namespace PlantChillers { } { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -6713,11 +6713,11 @@ namespace PlantChillers { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { if ((this->FlowMode == DataPlant::FlowMode::LeavingSetpointModulated) || - (DataPlant::PlantLoop(this->CWLoopNum) + (state.dataPlnt->PlantLoop(this->CWLoopNum) .LoopSide(this->CWLoopSideNum) .Branch(this->CWBranchNum) .Comp(this->CWCompNum) @@ -6725,7 +6725,7 @@ namespace PlantChillers { (DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi != DataLoopNode::SensedNodeFlagValue)) { TempEvapOutSetPoint = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPointHi; } else { - TempEvapOutSetPoint = DataLoopNode::Node(DataPlant::PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; + TempEvapOutSetPoint = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->CWLoopNum).TempSetPointNodeNum).TempSetPointHi; } } } @@ -6752,7 +6752,7 @@ namespace PlantChillers { // 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 (EquipFlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive || - DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { + state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { this->EvapMassFlowRate = DataLoopNode::Node(this->EvapInletNodeNum).MassFlowRate; } else { this->EvapMassFlowRate = 0.0; @@ -6765,7 +6765,7 @@ namespace PlantChillers { this->CWCompNum); } if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - if (DataPlant::PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == + if (state.dataPlnt->PlantLoop(this->CDLoopNum).LoopSide(this->CDLoopSideNum).Branch(this->CDBranchNum).Comp(this->CDCompNum).FlowCtrl == DataBranchAirLoopPlant::ControlTypeEnum::SeriesActive) { this->CondMassFlowRate = DataLoopNode::Node(this->CondInletNodeNum).MassFlowRate; } else { @@ -6869,7 +6869,7 @@ namespace PlantChillers { this->CDLoopSideNum, this->CDBranchNum, this->CDCompNum); - PlantUtilities::PullCompInterconnectTrigger(this->CWLoopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->CWLoopNum, this->CWLoopSideNum, this->CWBranchNum, this->CWCompNum, @@ -6886,12 +6886,12 @@ namespace PlantChillers { // condenser side outlet temperature. Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->CWLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, DataLoopNode::Node(this->EvapInletNodeNum).Temp, - DataPlant::PlantLoop(this->CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CWLoopNum).FluidIndex, RoutineName); - if (DataPlant::PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { this->PossibleSubcooling = false; this->QEvaporator = std::abs(MyLoad); this->Power = std::abs(MyLoad) / COP; @@ -6922,7 +6922,7 @@ namespace PlantChillers { // Calculate the Delta Temp from the inlet temp to the chiller outlet setpoint { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { EvapDeltaTemp = std::abs(DataLoopNode::Node(this->EvapInletNodeNum).Temp - DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint); @@ -6947,7 +6947,7 @@ namespace PlantChillers { this->CWBranchNum, this->CWCompNum); { - auto const SELECT_CASE_var(DataPlant::PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(this->CWLoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { this->EvapOutletTemp = DataLoopNode::Node(this->EvapOutletNodeNum).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -7100,7 +7100,7 @@ namespace PlantChillers { if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { CpCond = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->CDLoopNum).FluidName, CondInletTemp, DataPlant::PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidName, CondInletTemp, state.dataPlnt->PlantLoop(this->CDLoopNum).FluidIndex, RoutineName); if (this->CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { this->CondOutletTemp = this->QCondenser / this->CondMassFlowRate / CpCond + CondInletTemp; } else { diff --git a/src/EnergyPlus/PlantChillers.hh b/src/EnergyPlus/PlantChillers.hh index 478691921f3..264938b7d87 100644 --- a/src/EnergyPlus/PlantChillers.hh +++ b/src/EnergyPlus/PlantChillers.hh @@ -252,7 +252,8 @@ namespace PlantChillers { DataBranchAirLoopPlant::ControlTypeEnum EquipFlowCtrl // Flow control mode for the equipment ); - void update(Real64 MyLoad, // current load + void update(EnergyPlusData &state, + Real64 MyLoad, // current load bool RunFlag // TRUE if chiller operating ); @@ -356,7 +357,8 @@ namespace PlantChillers { Real64 &HeatRecRatio // Max Heat recovery ratio ); - void update(Real64 MyLoad, // current load + void update(EnergyPlusData &state, + Real64 MyLoad, // current load bool RunFlag // TRUE if chiller operating ); }; @@ -445,7 +447,8 @@ namespace PlantChillers { DataBranchAirLoopPlant::ControlTypeEnum EquipFlowCtrl // Flow control mode for the equipment ); - void update(Real64 MyLoad, // current load + void update(EnergyPlusData &state, + Real64 MyLoad, // current load bool RunFlag // TRUE if chiller operating ); }; diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.cc b/src/EnergyPlus/PlantComponentTemperatureSources.cc index b34d3abd243..cf8c1ad07c8 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.cc +++ b/src/EnergyPlus/PlantComponentTemperatureSources.cc @@ -172,9 +172,9 @@ namespace PlantComponentTemperatureSources { if (this->MyEnvironFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->Location.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->Location.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->Location.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Location.loopNum).FluidIndex, RoutineName); this->MassFlowRateMax = this->DesVolFlowRate * rho; PlantUtilities::InitComponentNodes(0.0, @@ -201,9 +201,9 @@ namespace PlantComponentTemperatureSources { // Calculate specific heat Real64 cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->Location.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->Location.loopNum).FluidName, this->BoundaryTemp, - DataPlant::PlantLoop(this->Location.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Location.loopNum).FluidIndex, RoutineName); // Calculate deltaT @@ -300,7 +300,7 @@ namespace PlantComponentTemperatureSources { bool ErrorsFound(false); // If errors detected in input Real64 DesVolFlowRateUser(0.0); // Hardsized design volume flow rate for reporting Real64 tmpVolFlowRate = this->DesVolFlowRate; - int PltSizNum = DataPlant::PlantLoop(this->Location.loopNum).PlantSizNum; + int PltSizNum = state.dataPlnt->PlantLoop(this->Location.loopNum).PlantSizNum; if (PltSizNum > 0) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { @@ -380,9 +380,9 @@ namespace PlantComponentTemperatureSources { if (this->MassFlowRate > 0.0) { this->OutletTemp = this->BoundaryTemp; Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->Location.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->Location.loopNum).FluidName, this->BoundaryTemp, - DataPlant::PlantLoop(this->Location.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Location.loopNum).FluidIndex, RoutineName); this->HeatRate = this->MassFlowRate * Cp * (this->OutletTemp - this->InletTemp); this->HeatEnergy = this->HeatRate * DataHVACGlobals::TimeStepSys * DataGlobalConstants::SecInHour; diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index f2a7d8aeb4c..1a76468fc77 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -218,18 +218,18 @@ namespace EnergyPlus::PlantCondLoopOperation { // Shut down equipment and return if so instructed by LoopShutDownFlag if (LoopShutDownFlag) { - TurnOffLoopEquipment(LoopNum); + TurnOffLoopEquipment(state, LoopNum); return; } // Return if there are no loop operation schemes available - if (!std::any_of(PlantLoop(LoopNum).OpScheme.begin(), PlantLoop(LoopNum).OpScheme.end(), [](DataPlant::OperationData const &e) { + if (!std::any_of(state.dataPlnt->PlantLoop(LoopNum).OpScheme.begin(), state.dataPlnt->PlantLoop(LoopNum).OpScheme.end(), [](DataPlant::OperationData const &e) { return e.Available; })) return; // set up references - auto &loop_side(PlantLoop(LoopNum).LoopSide(LoopSideNum)); + auto &loop_side(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum)); auto &this_component(loop_side.Branch(BranchNum).Comp(CompNum)); // Implement EMS control commands @@ -243,10 +243,10 @@ namespace EnergyPlus::PlantCondLoopOperation { // set local variables from data structure NumEquipLists = this_component.OpScheme(CurCompLevelOpNum).NumEquipLists; CurSchemePtr = this_component.OpScheme(CurCompLevelOpNum).OpSchemePtr; - CurSchemeType = PlantLoop(LoopNum).OpScheme(CurSchemePtr).OpSchemeType; + CurSchemeType = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).OpSchemeType; // another reference - auto &this_op_scheme(PlantLoop(LoopNum).OpScheme(CurSchemePtr)); + auto &this_op_scheme(state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr)); // Load the 'range variable' according to the type of control scheme specified if ((CurSchemeType == UncontrolledOpSchemeType) || (CurSchemeType == CompSetPtBasedSchemeType)) { @@ -285,7 +285,7 @@ namespace EnergyPlus::PlantCondLoopOperation { RangeVariable = FindRangeVariable(state, LoopNum, CurSchemePtr, CurSchemeType); } else { // No controls specified. This is a fatal error - ShowFatalError(state, "Invalid Operation Scheme Type Requested=" + PlantLoop(LoopNum).OpScheme(CurSchemePtr).TypeOf + + ShowFatalError(state, "Invalid Operation Scheme Type Requested=" + state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).TypeOf + ", in ManagePlantLoadDistribution"); } @@ -298,10 +298,10 @@ namespace EnergyPlus::PlantCondLoopOperation { } else if (CurSchemeType == CompSetPtBasedSchemeType) { // check for EMS Control - TurnOnPlantLoopPipes(LoopNum, LoopSideNum); + TurnOnPlantLoopPipes(state, LoopNum, LoopSideNum); FindCompSPLoad(state, LoopNum, LoopSideNum, BranchNum, CompNum, CurCompLevelOpNum); } else if (CurSchemeType == EMSOpSchemeType) { - TurnOnPlantLoopPipes(LoopNum, LoopSideNum); + TurnOnPlantLoopPipes(state, LoopNum, LoopSideNum); DistributeUserDefinedPlantLoad( state, LoopNum, LoopSideNum, BranchNum, CompNum, CurCompLevelOpNum, CurSchemePtr, LoopDemand, RemLoopDemand); } else { // it's a range based control type with multiple equipment lists @@ -342,7 +342,7 @@ namespace EnergyPlus::PlantCondLoopOperation { } } if (this_op_scheme.EquipList(ListPtr).NumComps > 0) { - TurnOnPlantLoopPipes(LoopNum, LoopSideNum); + TurnOnPlantLoopPipes(state, LoopNum, LoopSideNum); DistributePlantLoad(state, LoopNum, LoopSideNum, CurSchemePtr, ListPtr, LoopDemand, RemLoopDemand); LoadDistributionWasPerformed = true; } @@ -395,7 +395,7 @@ namespace EnergyPlus::PlantCondLoopOperation { ErrorsFound = false; - if (!allocated(PlantLoop)) { + if (!allocated(state.dataPlnt->PlantLoop)) { GetInputOK = false; return; } else { @@ -419,7 +419,7 @@ namespace EnergyPlus::PlantCondLoopOperation { // Load the Plant data structure for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - PlantOpSchemeName = PlantLoop(LoopNum).OperationScheme; + PlantOpSchemeName = state.dataPlnt->PlantLoop(LoopNum).OperationScheme; if (LoopNum <= NumPlantLoops) { CurrentModuleObject = "PlantEquipmentOperationSchemes"; PlantLoopObject = "PlantLoop"; @@ -442,43 +442,43 @@ CurrentModuleObject, PlantOpSchemeName); lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - PlantLoop(LoopNum).NumOpSchemes = (NumAlphas - 1) / 3; - if (PlantLoop(LoopNum).NumOpSchemes > 0) { - PlantLoop(LoopNum).OpScheme.allocate(PlantLoop(LoopNum).NumOpSchemes); - for (Num = 1; Num <= PlantLoop(LoopNum).NumOpSchemes; ++Num) { - PlantLoop(LoopNum).OpScheme(Num).TypeOf = cAlphaArgs(Num * 3 - 1); + state.dataPlnt->PlantLoop(LoopNum).NumOpSchemes = (NumAlphas - 1) / 3; + if (state.dataPlnt->PlantLoop(LoopNum).NumOpSchemes > 0) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme.allocate(state.dataPlnt->PlantLoop(LoopNum).NumOpSchemes); + for (Num = 1; Num <= state.dataPlnt->PlantLoop(LoopNum).NumOpSchemes; ++Num) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).TypeOf = cAlphaArgs(Num * 3 - 1); { - auto const plantLoopOperation(PlantLoop(LoopNum).OpScheme(Num).TypeOf); + auto const plantLoopOperation(state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).TypeOf); if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:COOLINGLOAD") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = CoolingRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = CoolingRBOpSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:HEATINGLOAD") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = HeatingRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = HeatingRBOpSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:COMPONENTSETPOINT") { //* Temp Based Control - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = CompSetPtBasedSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = CompSetPtBasedSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:THERMALENERGYSTORAGE") { //* Simple TES Control - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = CompSetPtBasedSchemeType; // set this to component based as it will be converted to this } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:USERDEFINED") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = EMSOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = EMSOpSchemeType; AnyEMSPlantOpSchemesInModel = true; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORDRYBULB") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DryBulbRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DryBulbRBOpSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORWETBULB") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = WetBulbRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = WetBulbRBOpSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORDEWPOINT") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DewPointRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DewPointRBOpSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORRELATIVEHUMIDITY") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = RelHumRBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = RelHumRBOpSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORDRYBULBDIFFERENCE") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DryBulbTDBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DryBulbTDBOpSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORWETBULBDIFFERENCE") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = WetBulbTDBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = WetBulbTDBOpSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORDEWPOINTDIFFERENCE") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DewPointTDBOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DewPointTDBOpSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:UNCONTROLLED") { - PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = UncontrolledOpSchemeType; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = UncontrolledOpSchemeType; } else { // invalid op scheme type for plant loop ShowSevereError(state, RoutineName + "Invalid " + cAlphaFieldNames(Num * 3 - 1) + '=' + cAlphaArgs(Num * 3 - 1) + ", entered in " + CurrentModuleObject + '=' + cAlphaArgs(1)); @@ -486,10 +486,10 @@ CurrentModuleObject, PlantOpSchemeName); } } - PlantLoop(LoopNum).OpScheme(Num).Name = cAlphaArgs(Num * 3); - PlantLoop(LoopNum).OpScheme(Num).Sched = cAlphaArgs(Num * 3 + 1); - PlantLoop(LoopNum).OpScheme(Num).SchedPtr = GetScheduleIndex(state, PlantLoop(LoopNum).OpScheme(Num).Sched); - if (PlantLoop(LoopNum).OpScheme(Num).SchedPtr == 0) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Name = cAlphaArgs(Num * 3); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Sched = cAlphaArgs(Num * 3 + 1); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).SchedPtr = GetScheduleIndex(state, state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).Sched); + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).SchedPtr == 0) { ShowSevereError(state, RoutineName + "Invalid " + cAlphaFieldNames(Num * 3 + 1) + " = \"" + cAlphaArgs(Num * 3 + 1) + "\", entered in " + CurrentModuleObject + "= \"" + cAlphaArgs(1) + "\"."); ErrorsFound = true; @@ -501,7 +501,7 @@ CurrentModuleObject, PlantOpSchemeName); ErrorsFound = true; } } else { - ShowSevereError(state, RoutineName + PlantLoopObject + '=' + PlantLoop(LoopNum).Name + " is expecting"); + ShowSevereError(state, RoutineName + PlantLoopObject + '=' + state.dataPlnt->PlantLoop(LoopNum).Name + " is expecting"); ShowContinueError(state, CurrentModuleObject + '=' + PlantOpSchemeName + ", but not found."); ErrorsFound = true; } @@ -675,10 +675,10 @@ CurrentModuleObject, PlantOpSchemeName); // extend number of equipment lists to include one for each CSPBO NumSchemeLists += CSPBO + TESSPBO + NumUserDefOpSchemes; for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - for (SchemeNum = 1; SchemeNum <= PlantLoop(LoopNum).NumOpSchemes; ++SchemeNum) { + for (SchemeNum = 1; SchemeNum <= state.dataPlnt->PlantLoop(LoopNum).NumOpSchemes; ++SchemeNum) { { - auto const plantLoopOperation(PlantLoop(LoopNum).OpScheme(SchemeNum).TypeOf); + auto const plantLoopOperation(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).TypeOf); if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:COOLINGLOAD") { CurrentModuleObject = "PlantEquipmentOperation:CoolingLoad"; @@ -743,8 +743,8 @@ CurrentModuleObject, PlantOpSchemeName); // At this point, switch the thermal energy storage controls to setpoint based controls as all of the // internally generated setpoints and schedules have been generated and this can now be handled like // the long form setpoint based control. - if (PlantLoop(LoopNum).OpScheme(SchemeNum).TypeOf == "PLANTEQUIPMENTOPERATION:THERMALENERGYSTORAGE") { - PlantLoop(LoopNum).OpScheme(SchemeNum).TypeOf = "PLANTEQUIPMENTOPERATION:COMPONENTSETPOINT"; + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).TypeOf == "PLANTEQUIPMENTOPERATION:THERMALENERGYSTORAGE") { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).TypeOf = "PLANTEQUIPMENTOPERATION:COMPONENTSETPOINT"; } } } @@ -819,44 +819,44 @@ CurrentModuleObject, PlantOpSchemeName); lAlphaBlanks.dimension(NumAlphas, true); lNumericBlanks.dimension(NumNums, true); - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { LoopOpSchemeObj = "PlantEquipmentOperationSchemes"; - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { LoopOpSchemeObj = "CondenserEquipmentOperationSchemes"; } if (NumSchemes > 0) { for (Num = 1; Num <= NumSchemes; ++Num) { inputProcessor->getObjectItem(state, CurrentModuleObject, Num, AlphArray, NumAlphas, NumArray, NumNums, IOStat); - if (UtilityRoutines::SameString(PlantLoop(LoopNum).OpScheme(SchemeNum).Name, AlphArray(1))) break; + if (UtilityRoutines::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, AlphArray(1))) break; if (Num == NumSchemes) { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + - " = \"" + PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; SchemeNameFound = false; } } if (SchemeNameFound) { - PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists = (NumAlphas - 1); - if (PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists <= 0) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists = (NumAlphas - 1); + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists <= 0) { ShowSevereError(state, CurrentModuleObject + " = \"" + AlphArray(1) + "\", specified without equipment list."); ErrorsFound = true; } else { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList.allocate(PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists); - NumEquipLists = PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList.allocate(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists); + NumEquipLists = state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists; if (NumNums <= 0) { // Uncontrolled OpScheme type ListNum = NumEquipLists; // NumEquipLists is always 1 for Uncontrolled OpScheme type - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name = AlphArray(2); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name = AlphArray(2); LoadEquipList(state, LoopNum, SchemeNum, ListNum, ErrorsFound); } else { // Range based OpScheme type for (ListNum = 1; ListNum <= NumEquipLists; ++ListNum) { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit = NumArray(ListNum * 2 - 1); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit = NumArray(ListNum * 2); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name = AlphArray(ListNum + 1); - if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit < 0.0) { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit = NumArray(ListNum * 2 - 1); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit = NumArray(ListNum * 2); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name = AlphArray(ListNum + 1); + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit < 0.0) { + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", found a negative value for an upper limit in " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } @@ -867,28 +867,28 @@ CurrentModuleObject, PlantOpSchemeName); plantLoopOperation == "PlantEquipmentOperation:HeatingLoad" || plantLoopOperation == "PlantEquipmentOperation:OutdoorrelativeHumidity") { // these should not be less than zero - if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit < 0.0) { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit < 0.0) { + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", found a negative value for a lower limit in " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } } else { // others should not be less than -70 - if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit < -70.0) { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit < -70.0) { + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", found too low of a value for a lower limit in " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } } } - if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit > - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit) { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit > + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit) { + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", found a lower limit that is higher than an upper limit in " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } @@ -896,17 +896,17 @@ CurrentModuleObject, PlantOpSchemeName); } // now run through lists again and check that range limits do not overlap each other for (ListNum = 1; ListNum <= NumEquipLists; ++ListNum) { - OuterListNumLowerLimit = PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit; - OuterListNumUpperLimit = PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit; + OuterListNumLowerLimit = state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit; + OuterListNumUpperLimit = state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit; for (InnerListNum = 1; InnerListNum <= NumEquipLists; ++InnerListNum) { if (InnerListNum == ListNum) continue; // don't check against self. - InnerListNumLowerLimit = PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(InnerListNum).RangeLowerLimit; - InnerListNumUpperLimit = PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(InnerListNum).RangeUpperLimit; + InnerListNumLowerLimit = state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(InnerListNum).RangeLowerLimit; + InnerListNumUpperLimit = state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(InnerListNum).RangeUpperLimit; // Check if inner list has a lower limit that is between an outer's lower and upper limit if (InnerListNumLowerLimit > OuterListNumLowerLimit && InnerListNumLowerLimit < OuterListNumUpperLimit) { - ShowWarningError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + + ShowWarningError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", detected overlapping ranges in " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ShowContinueError(state, format("Range # {} Lower limit = {:.1R} lies within the Range # {} ({:.1R} to {:.1R}).", InnerListNum, @@ -918,9 +918,9 @@ CurrentModuleObject, PlantOpSchemeName); } // Check if inner list has an upper limit that is between an outer's lower and upper limit if (InnerListNumUpperLimit > OuterListNumLowerLimit && InnerListNumUpperLimit < OuterListNumUpperLimit) { - ShowWarningError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + + ShowWarningError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", detected overlapping ranges in " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ShowContinueError(state, format("Range # {} Upper limit = {:.1R} lies within Range # {} ({:.1R} to {:.1R}).", InnerListNum, @@ -936,8 +936,8 @@ CurrentModuleObject, PlantOpSchemeName); } } } else { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + " = \"" + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } @@ -1011,33 +1011,33 @@ CurrentModuleObject, PlantOpSchemeName); lAlphaBlanks.dimension(NumAlphas, true); lNumericBlanks.dimension(NumNums, true); - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { LoopOpSchemeObj = "PlantEquipmentOperationSchemes"; - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { LoopOpSchemeObj = "CondenserEquipmentOperationSchemes"; } if (NumSchemes > 0) { for (Num = 1; Num <= NumSchemes; ++Num) { inputProcessor->getObjectItem(state, CurrentModuleObject, Num, AlphArray, NumAlphas, NumArray, NumNums, IOStat); - if (UtilityRoutines::SameString(PlantLoop(LoopNum).OpScheme(SchemeNum).Name, AlphArray(1))) break; + if (UtilityRoutines::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, AlphArray(1))) break; if (Num == NumSchemes) { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + - " = \"" + PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; SchemeNameFound = false; } } if (SchemeNameFound) { - PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists = (NumAlphas - 2); - if (PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists <= 0) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists = (NumAlphas - 2); + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists <= 0) { ShowSevereError(state, CurrentModuleObject + " = \"" + AlphArray(1) + "\", specified without equipment list."); ErrorsFound = true; } else { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList.allocate(PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists); - NumEquipLists = PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists; - PlantLoop(LoopNum).OpScheme(SchemeNum).ReferenceNodeName = AlphArray(2); - PlantLoop(LoopNum).OpScheme(SchemeNum).ReferenceNodeNumber = GetOnlySingleNode(state, + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList.allocate(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists); + NumEquipLists = state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).ReferenceNodeName = AlphArray(2); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).ReferenceNodeNumber = GetOnlySingleNode(state, AlphArray(2), ErrorsFound, CurrentModuleObject, @@ -1048,14 +1048,14 @@ CurrentModuleObject, PlantOpSchemeName); ObjectIsNotParent); // For DO Loop below -- Check for lower limit > upper limit.(invalid) for (ListNum = 1; ListNum <= NumEquipLists; ++ListNum) { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit = NumArray(ListNum * 2 - 1); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit = NumArray(ListNum * 2); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name = AlphArray(ListNum + 2); - if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit > - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit) { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit = NumArray(ListNum * 2 - 1); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit = NumArray(ListNum * 2); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name = AlphArray(ListNum + 2); + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeLowerLimit > + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).RangeUpperLimit) { + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", found a lower limit that is higher than an upper limit in " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } LoadEquipList(state, LoopNum, SchemeNum, ListNum, ErrorsFound); @@ -1063,8 +1063,8 @@ CurrentModuleObject, PlantOpSchemeName); } } } else { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + " = \"" + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } @@ -1234,7 +1234,7 @@ CurrentModuleObject, PlantOpSchemeName); FoundIntendedList = false; // find name in set of possible list for (Num = 1; Num <= TotNumLists; ++Num) { - if (UtilityRoutines::SameString(PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name, EquipListsNameList(Num))) { + if (UtilityRoutines::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name, EquipListsNameList(Num))) { FoundIntendedList = true; // get object item for real this time { @@ -1257,13 +1257,13 @@ CurrentModuleObject, PlantOpSchemeName); lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).NumComps = (NumAlphas - 1) / 2; - if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).NumComps > 0) { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Comp.allocate( - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).NumComps); - for (MachineNum = 1; MachineNum <= PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).NumComps; ++MachineNum) { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Comp(MachineNum).TypeOf = cAlphaArgs(MachineNum * 2); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Comp(MachineNum).Name = cAlphaArgs(MachineNum * 2 + 1); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).NumComps = (NumAlphas - 1) / 2; + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).NumComps > 0) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Comp.allocate( + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).NumComps); + for (MachineNum = 1; MachineNum <= state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).NumComps; ++MachineNum) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Comp(MachineNum).TypeOf = cAlphaArgs(MachineNum * 2); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Comp(MachineNum).Name = cAlphaArgs(MachineNum * 2 + 1); } // MachineList } } @@ -1271,7 +1271,7 @@ CurrentModuleObject, PlantOpSchemeName); if (!FoundIntendedList) { ShowSevereError(state, "LoadEquipList: Failed to find PlantEquipmentList or CondenserEquipmentList object named = " + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(ListNum).Name); ErrorsFound = true; } } @@ -1332,28 +1332,28 @@ CurrentModuleObject, PlantOpSchemeName); SchemeNameFound = true; - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { LoopOpSchemeObj = "PlantEquipmentOperationSchemes"; - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { LoopOpSchemeObj = "CondenserEquipmentOperationSchemes"; } if (NumSchemes > 0) { for (int Num = 1; Num <= NumSchemes; ++Num) { inputProcessor->getObjectItem(state, CurrentModuleObject, Num, cAlphaArgs, NumAlphas, rNumericArgs, NumNums, IOStat); - if (UtilityRoutines::SameString(PlantLoop(LoopNum).OpScheme(SchemeNum).Name, cAlphaArgs(1))) break; + if (UtilityRoutines::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, cAlphaArgs(1))) break; if (Num == NumSchemes) { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + - " = \"" + PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; SchemeNameFound = false; } } if (SchemeNameFound) { // why only one equip list assumed here? because component setpoint managers have their own lists contained. - PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists = 1; - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList.allocate(1); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps = (NumAlphas - 1) / 5; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists = 1; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList.allocate(1); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps = (NumAlphas - 1) / 5; if (CurrentModuleObject == "PlantEquipmentOperation:ThermalEnergyStorage") { // Read all of the additional parameters for ice storage control scheme and error check various parameters @@ -1361,23 +1361,23 @@ CurrentModuleObject, PlantOpSchemeName); OnPeakSchedPtr = GetScheduleIndex(state, OnPeakSchedName); if (OnPeakSchedPtr == 0) { ShowSevereError(state, "Could not find On Peak Schedule " + OnPeakSchedName + " in " + CurrentModuleObject + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } ChargeSchedName = cAlphaArgs(3); ChargeSchedPtr = GetScheduleIndex(state, ChargeSchedName); if (ChargeSchedPtr == 0) { ShowSevereError(state, "Could not find Charging Availability Schedule " + ChargeSchedName + " in " + CurrentModuleObject + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } NonChargCHWTemp = rNumericArgs(1); OffPeakCHWTemp = rNumericArgs(2); } - if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps > 0) { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp.allocate(PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps); - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps; ++CompNum) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps > 0) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp.allocate(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps); + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps; ++CompNum) { if (CurrentModuleObject == "PlantEquipmentOperation:ComponentSetPoint") { CompNumA = CompNum * 5; CompNumN = CompNum; @@ -1385,10 +1385,10 @@ CurrentModuleObject, PlantOpSchemeName); CompNumA = CompNum * 5 + 2; CompNumN = CompNum + 2; } - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).TypeOf = cAlphaArgs(CompNumA - 3); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name = cAlphaArgs(CompNumA - 2); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).DemandNodeName = cAlphaArgs(CompNumA - 1); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).DemandNodeNum = GetOnlySingleNode(state, cAlphaArgs(CompNumA - 1), + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).TypeOf = cAlphaArgs(CompNumA - 3); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name = cAlphaArgs(CompNumA - 2); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).DemandNodeName = cAlphaArgs(CompNumA - 1); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).DemandNodeNum = GetOnlySingleNode(state, cAlphaArgs(CompNumA - 1), ErrorsFound, CurrentModuleObject, cAlphaArgs(1), @@ -1396,8 +1396,8 @@ CurrentModuleObject, PlantOpSchemeName); NodeConnectionType_Sensor, 1, ObjectIsNotParent); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName = cAlphaArgs(CompNumA); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum = + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName = cAlphaArgs(CompNumA); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum = GetOnlySingleNode(state, cAlphaArgs(CompNumA), ErrorsFound, CurrentModuleObject, @@ -1406,22 +1406,22 @@ CurrentModuleObject, PlantOpSchemeName); NodeConnectionType_Sensor, 1, ObjectIsNotParent); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointFlowRate = rNumericArgs(CompNumN); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointFlowRate = rNumericArgs(CompNumN); if (rNumericArgs(CompNumN) == AutoSize) { int Num = 1; for (; Num <= SaveNumPlantComps; ++Num) { CompInNode = CompDesWaterFlow(Num).SupNode; CompFlowRate = CompDesWaterFlow(Num).DesVolFlowRate; - if (CompInNode == PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).DemandNodeNum) { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointFlowRate = CompFlowRate; + if (CompInNode == state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).DemandNodeNum) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointFlowRate = CompFlowRate; } else { // call error...Demand node must be component inlet node for autosizing } } BaseSizer::reportSizerOutput(state, CurrentModuleObject, - PlantLoop(LoopNum).OpScheme(SchemeNum).Name, + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, format("Design Water Flow Rate [m3/s] Equipment # {}", Num), CompFlowRate); } @@ -1429,16 +1429,16 @@ CurrentModuleObject, PlantOpSchemeName); { auto const controlType(cAlphaArgs(CompNumA + 1)); if (controlType == "COOLING") { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = CoolingOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = CoolingOp; } else if (controlType == "HEATING") { if (CurrentModuleObject == "PlantEquipmentOperation:ThermalEnergyStorage") { ShowSevereError(state, "Equipment Operation Mode cannot be HEATING for any equipment found in " + cAlphaArgs(1) + " in thermal energy storage control"); ErrorsFound = true; } - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = HeatingOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = HeatingOp; } else if (controlType == "DUAL") { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = DualOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = DualOp; } } @@ -1459,11 +1459,11 @@ CurrentModuleObject, PlantOpSchemeName); CurrentModuleObject + "='" + cAlphaArgs(1) + "'."); ShowContinueError(state, "Equipment Operation Mode can only be 'DUAL' for " + cAlphaArgs(CompNumA - 3) + " objects."); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = DualOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = DualOp; } // This block forces CompOpType to be either Cooling if explicitly provided, all other cases = Dual - CompOpType = (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum) - 1; + CompOpType = (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum) - 1; if ((CompOpType < 1) || (CompOpType > 2)) CompOpType = 2; // for each component, a new scheduled setpoint manager needs to be defined to internally generate the more @@ -1474,23 +1474,23 @@ CurrentModuleObject, PlantOpSchemeName); NonChargCHWTemp, OffPeakCHWTemp, CompOpType, - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum); } // check that setpoint node has valid setpoint managers or EMS { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { - if (Node(PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPoint == + if (Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPoint == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, "Missing temperature setpoint for " + CurrentModuleObject + " named " + cAlphaArgs(1)); ShowContinueError(state, "A temperature setpoint is needed at the node named " + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { - ShowContinueError(state, "PlantLoop=\"" + PlantLoop(LoopNum).Name + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + ShowContinueError(state, "PlantLoop=\"" + state.dataPlnt->PlantLoop(LoopNum).Name + "\", Plant Loop Demand Calculation Scheme=SingleSetpoint"); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops } ShowContinueError(state, " Use a setpoint manager to place a single temperature setpoint on the node"); ErrorsFound = true; @@ -1498,17 +1498,17 @@ CurrentModuleObject, PlantOpSchemeName); // need call to EMS to check node NodeEMSSetPointMissing = false; CheckIfNodeSetPointManagedByEMS(state, - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum, + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum, EMSManager::SPControlType::iTemperatureSetPoint, NodeEMSSetPointMissing); if (NodeEMSSetPointMissing) { ShowSevereError(state, "Missing temperature setpoint for " + CurrentModuleObject + " named " + cAlphaArgs(1)); ShowContinueError(state, "A temperature setpoint is needed at the node named " + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { - ShowContinueError(state, "PlantLoop=\"" + PlantLoop(LoopNum).Name + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + ShowContinueError(state, "PlantLoop=\"" + state.dataPlnt->PlantLoop(LoopNum).Name + "\", Plant Loop Demand Calculation Scheme=SingleSetpoint"); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops } ShowContinueError(state, " Use a setpoint manager or EMS actuator to place a single temperature setpoint on node"); @@ -1517,18 +1517,18 @@ CurrentModuleObject, PlantOpSchemeName); } } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == CoolingOp) { - if (Node(PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointHi == + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == CoolingOp) { + if (Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointHi == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, "Missing temperature high setpoint for " + CurrentModuleObject + " named " + cAlphaArgs(1)); ShowContinueError(state, "A temperature high setpoint is needed at the node named " + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { - ShowContinueError(state, "PlantLoop=\"" + PlantLoop(LoopNum).Name + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + ShowContinueError(state, "PlantLoop=\"" + state.dataPlnt->PlantLoop(LoopNum).Name + "\", Plant Loop Demand Calculation Scheme=DualSetpointDeadband"); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops } ShowContinueError(state, " Use a setpoint manager to place a dual temperature setpoint on the node"); ErrorsFound = true; @@ -1536,18 +1536,18 @@ CurrentModuleObject, PlantOpSchemeName); // need call to EMS to check node NodeEMSSetPointMissing = false; CheckIfNodeSetPointManagedByEMS(state, - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum, + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum, EMSManager::SPControlType::iTemperatureMaxSetPoint, NodeEMSSetPointMissing); if (NodeEMSSetPointMissing) { ShowSevereError(state, "Missing high temperature setpoint for " + CurrentModuleObject + " named " + cAlphaArgs(1)); ShowContinueError(state, "A high temperature setpoint is needed at the node named " + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { - ShowContinueError(state, "PlantLoop=\"" + PlantLoop(LoopNum).Name + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + ShowContinueError(state, "PlantLoop=\"" + state.dataPlnt->PlantLoop(LoopNum).Name + "\", Plant Loop Demand Calculation Scheme=DualSetpointDeadband"); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops } ShowContinueError(state, " Use a setpoint manager or EMS actuator to place a dual or high temperature setpoint on node"); @@ -1555,18 +1555,18 @@ CurrentModuleObject, PlantOpSchemeName); } } } - } else if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == HeatingOp) { - if (Node(PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointLo == + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == HeatingOp) { + if (Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointLo == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, "Missing temperature low setpoint for " + CurrentModuleObject + " named " + cAlphaArgs(1)); ShowContinueError(state, "A temperature low setpoint is needed at the node named " + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { - ShowContinueError(state, "PlantLoop=\"" + PlantLoop(LoopNum).Name + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + ShowContinueError(state, "PlantLoop=\"" + state.dataPlnt->PlantLoop(LoopNum).Name + "\", Plant Loop Demand Calculation Scheme=DualSetpointDeadband"); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops } ShowContinueError(state, " Use a setpoint manager to place a dual temperature setpoint on the node"); ErrorsFound = true; @@ -1574,22 +1574,22 @@ CurrentModuleObject, PlantOpSchemeName); // need call to EMS to check node NodeEMSSetPointMissing = false; CheckIfNodeSetPointManagedByEMS(state, - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum, + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum, EMSManager::SPControlType::iTemperatureMinSetPoint, NodeEMSSetPointMissing); CheckIfNodeSetPointManagedByEMS(state, - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum, + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum, EMSManager::SPControlType::iTemperatureMaxSetPoint, NodeEMSSetPointMissing); if (NodeEMSSetPointMissing) { ShowSevereError(state, "Missing low temperature setpoint for " + CurrentModuleObject + " named " + cAlphaArgs(1)); ShowContinueError(state, "A low temperature setpoint is needed at the node named " + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { - ShowContinueError(state, "PlantLoop=\"" + PlantLoop(LoopNum).Name + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + ShowContinueError(state, "PlantLoop=\"" + state.dataPlnt->PlantLoop(LoopNum).Name + "\", Plant Loop Demand Calculation Scheme=DualSetpointDeadband"); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops } ShowContinueError(state, " Use a setpoint manager or EMS actuator to place a dual or low temperature setpoint on node"); @@ -1597,20 +1597,20 @@ CurrentModuleObject, PlantOpSchemeName); } } } - } else if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == DualOp) { - if ((Node(PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointHi == + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == DualOp) { + if ((Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointHi == SensedNodeFlagValue) || - (Node(PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointLo == + (Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointLo == SensedNodeFlagValue)) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, "Missing temperature dual setpoints for " + CurrentModuleObject + " named " + cAlphaArgs(1)); ShowContinueError(state, "A dual temperaturesetpoint is needed at the node named " + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { - ShowContinueError(state, "PlantLoop=\"" + PlantLoop(LoopNum).Name + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + ShowContinueError(state, "PlantLoop=\"" + state.dataPlnt->PlantLoop(LoopNum).Name + "\", Plant Loop Demand Calculation Scheme=DualSetpointDeadband"); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops } ShowContinueError(state, " Use a setpoint manager to place a dual temperature setpoint on the node"); ErrorsFound = true; @@ -1618,18 +1618,18 @@ CurrentModuleObject, PlantOpSchemeName); // need call to EMS to check node NodeEMSSetPointMissing = false; CheckIfNodeSetPointManagedByEMS(state, - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum, + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum, EMSManager::SPControlType::iTemperatureMinSetPoint, NodeEMSSetPointMissing); if (NodeEMSSetPointMissing) { ShowSevereError(state, "Missing dual temperature setpoint for " + CurrentModuleObject + " named " + cAlphaArgs(1)); ShowContinueError(state, "A dual temperature setpoint is needed at the node named " + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { - ShowContinueError(state, "PlantLoop=\"" + PlantLoop(LoopNum).Name + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeName); + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + ShowContinueError(state, "PlantLoop=\"" + state.dataPlnt->PlantLoop(LoopNum).Name + "\", Plant Loop Demand Calculation Scheme=DualSetpointDeadband"); - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { // not applicable to Condenser loops } ShowContinueError(state, " Use a setpoint manager or EMS actuator to place a dual temperature setpoint on node"); @@ -1647,8 +1647,8 @@ CurrentModuleObject, PlantOpSchemeName); } } } else { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + " = \"" + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } } @@ -1688,9 +1688,9 @@ CurrentModuleObject, PlantOpSchemeName); SchemeNameFound = true; - if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { + if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { LoopOpSchemeObj = "PlantEquipmentOperationSchemes"; - } else if (PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { + } else if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Condenser) { LoopOpSchemeObj = "CondenserEquipmentOperationSchemes"; } @@ -1709,48 +1709,48 @@ CurrentModuleObject, PlantOpSchemeName); lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - if (UtilityRoutines::SameString(PlantLoop(LoopNum).OpScheme(SchemeNum).Name, cAlphaArgs(1))) break; // found the correct one + if (UtilityRoutines::SameString(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, cAlphaArgs(1))) break; // found the correct one if (Num == NumSchemes) { // did not find it - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + - " = \"" + PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; SchemeNameFound = false; } } if (SchemeNameFound) { - PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists = 1; - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList.allocate(1); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).NumEquipLists = 1; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList.allocate(1); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps = (NumAlphas - 3) / 2; - if (PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps > 0) { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp.allocate(PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps); - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps; ++CompNum) { - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).TypeOf = cAlphaArgs(CompNum * 2 + 2); - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name = cAlphaArgs(CompNum * 2 + 3); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps = (NumAlphas - 3) / 2; + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps > 0) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp.allocate(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps); + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).NumComps; ++CompNum) { + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).TypeOf = cAlphaArgs(CompNum * 2 + 2); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name = cAlphaArgs(CompNum * 2 + 3); // Setup EMS actuators for machines' MyLoad. SetupEMSActuator(state, "Plant Equipment Operation", - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + ':' + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name, + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + ':' + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name, "Distributed Load Rate", "[W]", lDummy, - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).EMSActuatorDispatchedLoadValue); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).EMSActuatorDispatchedLoadValue); // TODO: I think this should be a sensor really SetupEMSInternalVariable(state, "Component Remaining Current Demand Rate", - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + ':' + - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name, + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + ':' + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name, "[W]", - PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).EMSIntVarRemainingLoadValue); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).EMSIntVarRemainingLoadValue); } } StackMngrNum = UtilityRoutines::FindItemInList(cAlphaArgs(2), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it - PlantLoop(LoopNum).OpScheme(SchemeNum).ErlSimProgramMngr = StackMngrNum; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).ErlSimProgramMngr = StackMngrNum; } else { - PlantLoop(LoopNum).OpScheme(SchemeNum).simPluginLocation = + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).simPluginLocation = state.dataPluginManager->pluginManager->getLocationOfUserDefinedPlugin(state, cAlphaArgs(2)); - if (PlantLoop(LoopNum).OpScheme(SchemeNum).simPluginLocation == -1) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).simPluginLocation == -1) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(2) + '=' + cAlphaArgs(2)); ShowContinueError(state, "Entered in " + CurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, "Not found as either an EMS Program Manager or a Python Plugin instance."); @@ -1760,11 +1760,11 @@ CurrentModuleObject, PlantOpSchemeName); if (!lAlphaFieldBlanks(3)) { StackMngrNum = UtilityRoutines::FindItemInList(cAlphaArgs(3), state.dataRuntimeLang->EMSProgramCallManager); if (StackMngrNum > 0) { // found it - PlantLoop(LoopNum).OpScheme(SchemeNum).ErlInitProgramMngr = StackMngrNum; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).ErlInitProgramMngr = StackMngrNum; } else { - PlantLoop(LoopNum).OpScheme(SchemeNum).initPluginLocation = + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).initPluginLocation = state.dataPluginManager->pluginManager->getLocationOfUserDefinedPlugin(state, cAlphaArgs(3)); - if (PlantLoop(LoopNum).OpScheme(SchemeNum).initPluginLocation == -1) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).initPluginLocation == -1) { ShowSevereError(state, "Invalid " + cAlphaFieldNames(3) + '=' + cAlphaArgs(3)); ShowContinueError(state, "Entered in " + CurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, "Not found as either an EMS Program Manager or a Python Plugin instance."); @@ -1775,14 +1775,14 @@ CurrentModuleObject, PlantOpSchemeName); // setup internal variable for Supply Side Current Demand Rate [W] SetupEMSInternalVariable(state, "Supply Side Current Demand Rate", - PlantLoop(LoopNum).OpScheme(SchemeNum).Name, + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name, "[W]", - PlantLoop(LoopNum).OpScheme(SchemeNum).EMSIntVarLoopDemandRate); + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EMSIntVarLoopDemandRate); } } else { - ShowSevereError(state, LoopOpSchemeObj + " = \"" + PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + " = \"" + - PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); + ShowSevereError(state, LoopOpSchemeObj + " = \"" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme + "\", could not find " + CurrentModuleObject + " = \"" + + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).Name + "\"."); ErrorsFound = true; } } @@ -1864,7 +1864,7 @@ CurrentModuleObject, PlantOpSchemeName); // first loop over main operation scheme data and finish filling out indexes to plant topology for the components in the lists for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - auto &this_plant_loop(PlantLoop(LoopNum)); + auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1, OpNum_end = this_plant_loop.NumOpSchemes; OpNum <= OpNum_end; ++OpNum) { auto &this_op_scheme(this_plant_loop.OpScheme(OpNum)); for (int ListNum = 1, ListNum_end = this_op_scheme.NumEquipLists; ListNum <= ListNum_end; ++ListNum) { @@ -1928,7 +1928,7 @@ CurrentModuleObject, PlantOpSchemeName); // second loop, fill op schemes info at each component. for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - auto &this_plant_loop(PlantLoop(LoopNum)); + auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1, OpNum_end = this_plant_loop.NumOpSchemes; OpNum <= OpNum_end; ++OpNum) { auto &this_op_scheme(this_plant_loop.OpScheme(OpNum)); for (int ListNum = 1, ListNum_end = this_op_scheme.NumEquipLists; ListNum <= ListNum_end; ++ListNum) { @@ -1940,7 +1940,7 @@ CurrentModuleObject, PlantOpSchemeName); LoopSideNum = this_equip.LoopSideNumPtr; BranchNum = this_equip.BranchNumPtr; CompNum = this_equip.CompNumPtr; - auto &dummy_loop_equip(PlantLoop(DummyLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); + auto &dummy_loop_equip(state.dataPlnt->PlantLoop(DummyLoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); if (dummy_loop_equip.NumOpSchemes == 0) { // first op scheme for this component, allocate OpScheme and its EquipList to size 1 @@ -1992,7 +1992,7 @@ CurrentModuleObject, PlantOpSchemeName); // check the pointers to see if a single component is attached to more than one type of control scheme for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - auto const &this_plant_loop(PlantLoop(LoopNum)); + auto const &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { auto const &this_loop_side(this_plant_loop.LoopSide(LoopSideNum)); for (int BranchNum = 1, BranchNum_end = this_loop_side.TotalBranches; BranchNum <= BranchNum_end; ++BranchNum) { @@ -2026,7 +2026,7 @@ CurrentModuleObject, PlantOpSchemeName); // fill out information on which equipment list is the "last" meaning it has the highest upper limit for load range for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - auto &this_plant_loop(PlantLoop(LoopNum)); + auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1, OpNum_end = this_plant_loop.NumOpSchemes; OpNum <= OpNum_end; ++OpNum) { auto &this_op_scheme(this_plant_loop.OpScheme(OpNum)); // skip non-load based op schemes @@ -2048,7 +2048,7 @@ CurrentModuleObject, PlantOpSchemeName); if (AnyEMSPlantOpSchemesInModel) { // Execute any Initialization EMS program calling managers for User-Defined operation. for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - auto &this_plant_loop(PlantLoop(LoopNum)); + auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1, OpNum_end = this_plant_loop.NumOpSchemes; OpNum <= OpNum_end; ++OpNum) { auto &this_op_scheme(this_plant_loop.OpScheme(OpNum)); if (this_op_scheme.OpSchemeType == EMSOpSchemeType) { @@ -2070,7 +2070,7 @@ CurrentModuleObject, PlantOpSchemeName); // FIRST HVAC INITS if (FirstHVACIteration) { for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { - auto &this_plant_loop(PlantLoop(LoopNum)); + auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { auto &this_loop_side(this_plant_loop.LoopSide(LoopSideNum)); for (int BranchNum = 1, BranchNum_end = this_loop_side.TotalBranches; BranchNum <= BranchNum_end; ++BranchNum) { @@ -2095,7 +2095,7 @@ CurrentModuleObject, PlantOpSchemeName); // Update the OpScheme schedules for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { FoundScheme = false; - auto &this_loop(PlantLoop(LoopNum)); + auto &this_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1; OpNum <= this_loop.NumOpSchemes; ++OpNum) { auto &this_op_scheme(this_loop.OpScheme(OpNum)); if (GetCurrentScheduleValue(state, this_op_scheme.SchedPtr) > 0.0) { @@ -2118,7 +2118,7 @@ CurrentModuleObject, PlantOpSchemeName); CompPtr = this_list_component.CompNumPtr; // then set up a reference to the component on the plant data structure - auto &this_loop_component(PlantLoop(LoopPtr).LoopSide(LoopSidePtr).Branch(BranchPtr).Comp(CompPtr)); + auto &this_loop_component(state.dataPlnt->PlantLoop(LoopPtr).LoopSide(LoopSidePtr).Branch(BranchPtr).Comp(CompPtr)); if (this_loop_component.CurOpSchemeType != PumpOpSchemeType) { this_loop_component.CurOpSchemeType = this_op_scheme.OpSchemeType; @@ -2214,7 +2214,7 @@ CurrentModuleObject, PlantOpSchemeName); int NumCompsOnList; // start with some references - auto &this_loop(PlantLoop(LoopNum)); + auto &this_loop(state.dataPlnt->PlantLoop(LoopNum)); auto &this_loopside(this_loop.LoopSide(LoopSideNum)); auto &this_equiplist(this_loop.OpScheme(CurSchemePtr).EquipList(ListPtr)); @@ -2267,9 +2267,9 @@ CurrentModuleObject, PlantOpSchemeName); ChangeInLoad = std::abs(RemLoopDemand); } - AdjustChangeInLoadForLastStageUpperRangeLimit(LoopNum, CurSchemePtr, ListPtr, ChangeInLoad); + AdjustChangeInLoadForLastStageUpperRangeLimit(state, LoopNum, CurSchemePtr, ListPtr, ChangeInLoad); - AdjustChangeInLoadByEMSControls(LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); + AdjustChangeInLoadByEMSControls(state, LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); AdjustChangeInLoadByHowServed(state, LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); @@ -2348,9 +2348,9 @@ CurrentModuleObject, PlantOpSchemeName); ChangeInLoad = std::abs(RemLoopDemand); } - AdjustChangeInLoadForLastStageUpperRangeLimit(LoopNum, CurSchemePtr, ListPtr, ChangeInLoad); + AdjustChangeInLoadForLastStageUpperRangeLimit(state, LoopNum, CurSchemePtr, ListPtr, ChangeInLoad); - AdjustChangeInLoadByEMSControls(LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); + AdjustChangeInLoadByEMSControls(state, LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); AdjustChangeInLoadByHowServed(state, LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); @@ -2398,9 +2398,9 @@ CurrentModuleObject, PlantOpSchemeName); ChangeInLoad = std::abs(RemLoopDemand); } - AdjustChangeInLoadForLastStageUpperRangeLimit(LoopNum, CurSchemePtr, ListPtr, ChangeInLoad); + AdjustChangeInLoadForLastStageUpperRangeLimit(state, LoopNum, CurSchemePtr, ListPtr, ChangeInLoad); - AdjustChangeInLoadByEMSControls(LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); + AdjustChangeInLoadByEMSControls(state, LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); AdjustChangeInLoadByHowServed(state, LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); ChangeInLoad = max(0.0, ChangeInLoad); @@ -2492,7 +2492,7 @@ CurrentModuleObject, PlantOpSchemeName); if (PlantCapacity > 0.0) { PlantPLR = min(1.0, std::abs(RemLoopDemand) / PlantCapacity); } else { - ShowWarningError(state, "Zero available plant capacity for Plant Loop = " + PlantLoop(LoopNum).Name); + ShowWarningError(state, "Zero available plant capacity for Plant Loop = " + state.dataPlnt->PlantLoop(LoopNum).Name); } // Distribute load to each machine @@ -2517,9 +2517,9 @@ CurrentModuleObject, PlantOpSchemeName); ChangeInLoad = std::abs(RemLoopDemand); } - AdjustChangeInLoadForLastStageUpperRangeLimit(LoopNum, CurSchemePtr, ListPtr, ChangeInLoad); + AdjustChangeInLoadForLastStageUpperRangeLimit(state, LoopNum, CurSchemePtr, ListPtr, ChangeInLoad); - AdjustChangeInLoadByEMSControls(LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); + AdjustChangeInLoadByEMSControls(state, LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); AdjustChangeInLoadByHowServed(state, LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); @@ -2574,7 +2574,7 @@ CurrentModuleObject, PlantOpSchemeName); if (PlantCapacity > 0.0) { PlantPLR = min(1.0, std::abs(RemLoopDemand) / PlantCapacity); } else { - ShowWarningError(state, "Zero available plant capacity for Plant Loop = " + PlantLoop(LoopNum).Name); + ShowWarningError(state, "Zero available plant capacity for Plant Loop = " + state.dataPlnt->PlantLoop(LoopNum).Name); } // Distribute load to each machine @@ -2599,9 +2599,9 @@ CurrentModuleObject, PlantOpSchemeName); ChangeInLoad = std::abs(RemLoopDemand); } - AdjustChangeInLoadForLastStageUpperRangeLimit(LoopNum, CurSchemePtr, ListPtr, ChangeInLoad); + AdjustChangeInLoadForLastStageUpperRangeLimit(state, LoopNum, CurSchemePtr, ListPtr, ChangeInLoad); - AdjustChangeInLoadByEMSControls(LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); + AdjustChangeInLoadByEMSControls(state, LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); AdjustChangeInLoadByHowServed(state, LoopNum, LoopSideNum, BranchNum, CompNum, ChangeInLoad); @@ -2636,8 +2636,9 @@ CurrentModuleObject, PlantOpSchemeName); } } - void AdjustChangeInLoadForLastStageUpperRangeLimit(int const LoopNum, // component topology - int const CurOpSchemePtr, // currect active operation scheme + void AdjustChangeInLoadForLastStageUpperRangeLimit(EnergyPlusData &state, + int const LoopNum, // component topology + int const CurOpSchemePtr, // current active operation scheme int const CurEquipListPtr, // current equipment list Real64 &ChangeInLoad // positive magnitude of load change ) @@ -2676,9 +2677,9 @@ CurrentModuleObject, PlantOpSchemeName); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 RangeHiLimit; - if (PlantLoop(LoopNum).OpScheme(CurOpSchemePtr).EquipListNumForLastStage == CurEquipListPtr) { // at final last stage + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurOpSchemePtr).EquipListNumForLastStage == CurEquipListPtr) { // at final last stage - RangeHiLimit = PlantLoop(LoopNum).OpScheme(CurOpSchemePtr).EquipList(CurEquipListPtr).RangeUpperLimit; + RangeHiLimit = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurOpSchemePtr).EquipList(CurEquipListPtr).RangeUpperLimit; ChangeInLoad = min(ChangeInLoad, RangeHiLimit); } } @@ -2736,7 +2737,7 @@ CurrentModuleObject, PlantOpSchemeName); static Real64 QdotTmp(0.0); static int ControlNodeNum(0); - auto &this_component(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); + auto &this_component(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); // start of bad band-aid, need a general and comprehensive approach for determining current capacity of all kinds of equipment // Need to truncate the load down in case outlet temperature will hit a lower/upper limit @@ -2750,7 +2751,7 @@ CurrentModuleObject, PlantOpSchemeName); CurMassFlowRate = Node(this_component.NodeNumIn).MassFlowRate; ToutLowLimit = this_component.MinOutletTemp; Tinlet = Node(this_component.NodeNumIn).Temp; - CurSpecHeat = GetSpecificHeatGlycol(state, PlantLoop(LoopNum).FluidName, Tinlet, PlantLoop(LoopNum).FluidIndex, RoutineName); + CurSpecHeat = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, Tinlet, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); QdotTmp = CurMassFlowRate * CurSpecHeat * (Tinlet - ToutLowLimit); // !- Don't correct if Q is zero, as this could indicate a component which this hasn't been implemented or not yet turned on @@ -2818,7 +2819,7 @@ CurrentModuleObject, PlantOpSchemeName); CurMassFlowRate = Node(this_component.NodeNumIn).MassFlowRate; ToutLowLimit = this_component.MinOutletTemp; Tinlet = Node(this_component.NodeNumIn).Temp; - CurSpecHeat = GetSpecificHeatGlycol(state, PlantLoop(LoopNum).FluidName, Tinlet, PlantLoop(LoopNum).FluidIndex, RoutineName); + CurSpecHeat = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, Tinlet, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); QdotTmp = CurMassFlowRate * CurSpecHeat * (Tinlet - ToutLowLimit); // !- Don't correct if Q is zero, as this could indicate a component which this hasn't been implemented or not yet turned @@ -2833,7 +2834,7 @@ CurrentModuleObject, PlantOpSchemeName); CurMassFlowRate = Node(this_component.NodeNumIn).MassFlowRate; ToutHiLimit = this_component.MaxOutletTemp; Tinlet = Node(this_component.NodeNumIn).Temp; - CurSpecHeat = GetSpecificHeatGlycol(state, PlantLoop(LoopNum).FluidName, Tinlet, PlantLoop(LoopNum).FluidIndex, RoutineName); + CurSpecHeat = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, Tinlet, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); QdotTmp = CurMassFlowRate * CurSpecHeat * (ToutHiLimit - Tinlet); if (CurMassFlowRate > 0.0) { @@ -2897,7 +2898,7 @@ CurrentModuleObject, PlantOpSchemeName); Real64 CurrentDemandForCoolingOp; Real64 CurrentDemandForHeatingOp; - auto &this_component(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); + auto &this_component(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); // find the pointer to the 'PlantLoop()%OpScheme()'...data structure NumEquipLists = this_component.OpScheme(OpNum).NumEquipLists; @@ -2913,29 +2914,29 @@ CurrentModuleObject, PlantOpSchemeName); CompMinLoad = this_component.MinLoad; CompMaxLoad = this_component.MaxLoad; CompOptLoad = this_component.OptLoad; - DemandNode = PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).DemandNodeNum; - SetPtNode = PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).SetPointNodeNum; + DemandNode = state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).DemandNodeNum; + SetPtNode = state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).SetPointNodeNum; TempIn = Node(DemandNode).Temp; - rho = GetDensityGlycol(state, PlantLoop(LoopNum).FluidName, TempIn, PlantLoop(LoopNum).FluidIndex, RoutineName); + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, TempIn, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); - DemandMdot = PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).SetPointFlowRate * rho; + DemandMdot = state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).SetPointFlowRate * rho; // DSU? DemandMDot is a constant design flow rate, next based on actual current flow rate for accurate current demand? ActualMdot = Node(DemandNode).MassFlowRate; - CurSpecHeat = GetSpecificHeatGlycol(state, PlantLoop(LoopNum).FluidName, TempIn, PlantLoop(LoopNum).FluidIndex, RoutineName); + CurSpecHeat = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, TempIn, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); if ((ActualMdot > 0.0) && (ActualMdot != DemandMdot)) { DemandMdot = ActualMdot; } { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPt = Node(SetPtNode).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - if (PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == CoolingOp) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == CoolingOp) { TempSetPt = Node(SetPtNode).TempSetPointHi; - } else if (PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == HeatingOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == HeatingOp) { TempSetPt = Node(SetPtNode).TempSetPointLo; - } else if (PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == DualOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == DualOp) { CurrentDemandForCoolingOp = DemandMdot * CurSpecHeat * (Node(SetPtNode).TempSetPointHi - TempIn); CurrentDemandForHeatingOp = DemandMdot * CurSpecHeat * (Node(SetPtNode).TempSetPointLo - TempIn); if ((CurrentDemandForCoolingOp < 0.0) && (CurrentDemandForHeatingOp <= 0.0)) { // cooling @@ -2965,7 +2966,7 @@ CurrentModuleObject, PlantOpSchemeName); this_component.EquipDemand = CompDemand; // set MyLoad and runflag - if (PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == CoolingOp) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == CoolingOp) { if (CompDemand < (-LoopDemandTol)) { this_component.ON = true; this_component.MyLoad = CompDemand; @@ -2973,7 +2974,7 @@ CurrentModuleObject, PlantOpSchemeName); this_component.ON = false; this_component.MyLoad = 0.0; } - } else if (PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == HeatingOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == HeatingOp) { if (CompDemand > LoopDemandTol) { this_component.ON = true; this_component.MyLoad = CompDemand; @@ -2981,7 +2982,7 @@ CurrentModuleObject, PlantOpSchemeName); this_component.ON = false; this_component.MyLoad = 0.0; } - } else if (PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == DualOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == DualOp) { if (CompDemand > LoopDemandTol || CompDemand < (-LoopDemandTol)) { this_component.ON = true; this_component.MyLoad = CompDemand; @@ -3051,26 +3052,26 @@ CurrentModuleObject, PlantOpSchemeName); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CompPtr; - auto &this_component(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); + auto &this_component(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum)); // ListPtr = PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%Comp(CompNum)%OpScheme(CurCompLevelOpNum)%EquipList(1)%ListPtr CompPtr = this_component.OpScheme(CurCompLevelOpNum).EquipList(1).CompPtr; // fill internal variable - PlantLoop(LoopNum).OpScheme(CurSchemePtr).EquipList(1).Comp(CompPtr).EMSIntVarRemainingLoadValue = LoopDemand; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).EquipList(1).Comp(CompPtr).EMSIntVarRemainingLoadValue = LoopDemand; // Call EMS program(s) - if (PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr > 0) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr > 0) { bool anyEMSRan; - ManageEMS(state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr); - } else if (PlantLoop(LoopNum).OpScheme(CurSchemePtr).simPluginLocation > -1) { - state.dataPluginManager->pluginManager->runSingleUserDefinedPlugin(state, PlantLoop(LoopNum).OpScheme(CurSchemePtr).simPluginLocation); + ManageEMS(state, EMSManager::EMSCallFrom::UserDefinedComponentModel, anyEMSRan, state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).ErlSimProgramMngr); + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).simPluginLocation > -1) { + state.dataPluginManager->pluginManager->runSingleUserDefinedPlugin(state, state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).simPluginLocation); } // move actuated value to MyLoad - this_component.MyLoad = PlantLoop(LoopNum).OpScheme(CurSchemePtr).EquipList(1).Comp(CompPtr).EMSActuatorDispatchedLoadValue; - this_component.EquipDemand = PlantLoop(LoopNum).OpScheme(CurSchemePtr).EquipList(1).Comp(CompPtr).EMSActuatorDispatchedLoadValue; + this_component.MyLoad = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).EquipList(1).Comp(CompPtr).EMSActuatorDispatchedLoadValue; + this_component.EquipDemand = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).EquipList(1).Comp(CompPtr).EMSActuatorDispatchedLoadValue; if (std::abs(this_component.MyLoad) > LoopDemandTol) { this_component.ON = true; @@ -3119,15 +3120,15 @@ CurrentModuleObject, PlantOpSchemeName); Real64 NodeTemperature; if (CurSchemeType == DryBulbTDBOpSchemeType) { // drybulb temp based controls - ReferenceNodeNum = PlantLoop(LoopNum).OpScheme(CurSchemePtr).ReferenceNodeNumber; + ReferenceNodeNum = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).ReferenceNodeNumber; NodeTemperature = Node(ReferenceNodeNum).Temp; FindRangeVariable = NodeTemperature - state.dataEnvrn->OutDryBulbTemp; } else if (CurSchemeType == WetBulbTDBOpSchemeType) { // wetbulb temp based controls - ReferenceNodeNum = PlantLoop(LoopNum).OpScheme(CurSchemePtr).ReferenceNodeNumber; + ReferenceNodeNum = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).ReferenceNodeNumber; NodeTemperature = Node(ReferenceNodeNum).Temp; FindRangeVariable = NodeTemperature - state.dataEnvrn->OutWetBulbTemp; } else if (CurSchemeType == DewPointTDBOpSchemeType) { // dewpoint temp based controls - ReferenceNodeNum = PlantLoop(LoopNum).OpScheme(CurSchemePtr).ReferenceNodeNumber; + ReferenceNodeNum = state.dataPlnt->PlantLoop(LoopNum).OpScheme(CurSchemePtr).ReferenceNodeNumber; NodeTemperature = Node(ReferenceNodeNum).Temp; FindRangeVariable = NodeTemperature - state.dataEnvrn->OutDewPointTemp; } else { @@ -3142,7 +3143,7 @@ CurrentModuleObject, PlantOpSchemeName); // Begin Plant Loop ON/OFF Utility Subroutines //****************************************************************************** - void TurnOnPlantLoopPipes(int const LoopNum, int const LoopSideNum) + void TurnOnPlantLoopPipes(EnergyPlusData &state, int const LoopNum, int const LoopSideNum) { // SUBROUTINE INFORMATION: // AUTHOR Dan Fisher @@ -3173,13 +3174,13 @@ CurrentModuleObject, PlantOpSchemeName); int MachineOnLoopNum; int Num; - for (Num = 1; Num <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++Num) { - for (MachineOnLoopNum = 1; MachineOnLoopNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).TotalComponents; ++MachineOnLoopNum) { + for (Num = 1; Num <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++Num) { + for (MachineOnLoopNum = 1; MachineOnLoopNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).TotalComponents; ++MachineOnLoopNum) { { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnLoopNum).TypeOf_Num); + auto const SELECT_CASE_var(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnLoopNum).TypeOf_Num); if ((SELECT_CASE_var == TypeOf_Pipe) || (SELECT_CASE_var == TypeOf_PipeInterior) || (SELECT_CASE_var == TypeOf_PipeExterior) || (SELECT_CASE_var == TypeOf_PipeUnderground)) { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnLoopNum).ON = true; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnLoopNum).ON = true; } else { // Don't do anything } @@ -3188,7 +3189,7 @@ CurrentModuleObject, PlantOpSchemeName); } } - void TurnOffLoopEquipment(int const LoopNum) + void TurnOffLoopEquipment(EnergyPlusData &state, int const LoopNum) { // SUBROUTINE INFORMATION: // AUTHOR D.E. Fisher @@ -3219,20 +3220,20 @@ CurrentModuleObject, PlantOpSchemeName); int Num; for (LoopSideNum = 1; LoopSideNum <= 2; ++LoopSideNum) { - for (Num = 1; Num <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++Num) { - for (MachineOnBranch = 1; MachineOnBranch <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).TotalComponents; + for (Num = 1; Num <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++Num) { + for (MachineOnBranch = 1; MachineOnBranch <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).TotalComponents; ++MachineOnBranch) { // Sankar Non Integrated Economizer - if (!PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).isPump()) { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).ON = false; - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).MyLoad = 0.0; + if (!state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).isPump()) { + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).ON = false; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).MyLoad = 0.0; } } } } } - void TurnOffLoopSideEquipment(int const LoopNum, int const LoopSideNum) + void TurnOffLoopSideEquipment(EnergyPlusData &state, int const LoopNum, int const LoopSideNum) { // SUBROUTINE INFORMATION: // AUTHOR D.E. Fisher @@ -3261,12 +3262,12 @@ CurrentModuleObject, PlantOpSchemeName); int MachineOnBranch; int Num; - for (Num = 1; Num <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++Num) { - for (MachineOnBranch = 1; MachineOnBranch <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).TotalComponents; ++MachineOnBranch) { + for (Num = 1; Num <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++Num) { + for (MachineOnBranch = 1; MachineOnBranch <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).TotalComponents; ++MachineOnBranch) { // Sankar Non Integrated Economizer - if (!PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).isPump()) { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).ON = false; - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).MyLoad = 0.0; + if (!state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).isPump()) { + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).ON = false; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(Num).Comp(MachineOnBranch).MyLoad = 0.0; } } } @@ -3306,64 +3307,64 @@ CurrentModuleObject, PlantOpSchemeName); for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { ActuatorName = "Plant Loop Overall"; - UniqueIDName = PlantLoop(LoopNum).Name; + UniqueIDName = state.dataPlnt->PlantLoop(LoopNum).Name; ActuatorType = "On/Off Supervisory"; - SetupEMSActuator(state, ActuatorName, UniqueIDName, ActuatorType, Units, PlantLoop(LoopNum).EMSCtrl, PlantLoop(LoopNum).EMSValue); + SetupEMSActuator(state, ActuatorName, UniqueIDName, ActuatorType, Units, state.dataPlnt->PlantLoop(LoopNum).EMSCtrl, state.dataPlnt->PlantLoop(LoopNum).EMSValue); ActuatorName = "Supply Side Half Loop"; - UniqueIDName = PlantLoop(LoopNum).Name; + UniqueIDName = state.dataPlnt->PlantLoop(LoopNum).Name; ActuatorType = "On/Off Supervisory"; SetupEMSActuator(state, ActuatorName, UniqueIDName, ActuatorType, Units, - PlantLoop(LoopNum).LoopSide(SupplySide).EMSCtrl, - PlantLoop(LoopNum).LoopSide(SupplySide).EMSValue); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).EMSCtrl, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).EMSValue); ActuatorName = "Demand Side Half Loop"; - UniqueIDName = PlantLoop(LoopNum).Name; + UniqueIDName = state.dataPlnt->PlantLoop(LoopNum).Name; ActuatorType = "On/Off Supervisory"; SetupEMSActuator(state, ActuatorName, UniqueIDName, ActuatorType, Units, - PlantLoop(LoopNum).LoopSide(DemandSide).EMSCtrl, - PlantLoop(LoopNum).LoopSide(DemandSide).EMSValue); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).EMSCtrl, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).EMSValue); for (LoopSideNum = 1; LoopSideNum <= 2; ++LoopSideNum) { - for (BranchNum = 1; BranchNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { + for (BranchNum = 1; BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { if (LoopSideNum == SupplySide) { ActuatorName = "Supply Side Branch"; - UniqueIDName = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Name; + UniqueIDName = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Name; ActuatorType = "On/Off Supervisory"; SetupEMSActuator(state, ActuatorName, UniqueIDName, ActuatorType, Units, - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).EMSCtrlOverrideOn, - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).EMSCtrlOverrideValue); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).EMSCtrlOverrideOn, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).EMSCtrlOverrideValue); } else if (LoopSideNum == DemandSide) { ActuatorName = "Demand Side Branch"; - UniqueIDName = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Name; + UniqueIDName = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Name; ActuatorType = "On/Off Supervisory"; SetupEMSActuator(state, ActuatorName, UniqueIDName, ActuatorType, Units, - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).EMSCtrlOverrideOn, - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).EMSCtrlOverrideValue); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).EMSCtrlOverrideOn, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).EMSCtrlOverrideValue); } - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).TotalComponents; ++CompNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).TotalComponents; ++CompNum) { ActuatorName = "Plant Component " + - ccSimPlantEquipTypes(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).TypeOf_Num); - UniqueIDName = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).Name; + ccSimPlantEquipTypes(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).TypeOf_Num); + UniqueIDName = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).Name; ActuatorType = "On/Off Supervisory"; SetupEMSActuator(state, ActuatorName, UniqueIDName, ActuatorType, "[fraction]", - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).EMSLoadOverrideOn, - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).EMSLoadOverrideValue); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).EMSLoadOverrideOn, + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).EMSLoadOverrideValue); } } } @@ -3418,7 +3419,7 @@ CurrentModuleObject, PlantOpSchemeName); // MODULE VARIABLE DECLARATIONS: // set up some nice references to avoid lookups - auto &this_loop(PlantLoop(LoopNum)); + auto &this_loop(state.dataPlnt->PlantLoop(LoopNum)); auto &this_loopside(this_loop.LoopSide(LoopSideNum)); auto &this_comp(this_loopside.Branch(BranchNum).Comp(CompNum)); @@ -3426,7 +3427,7 @@ CurrentModuleObject, PlantOpSchemeName); if (this_loop.EMSCtrl) { if (this_loop.EMSValue <= 0.0) { LoopShutDownFlag = true; - TurnOffLoopEquipment(LoopNum); + TurnOffLoopEquipment(state, LoopNum); return; } else { LoopShutDownFlag = false; @@ -3438,7 +3439,7 @@ CurrentModuleObject, PlantOpSchemeName); // Half-loop control if (this_loopside.EMSCtrl) { if (this_loopside.EMSValue <= 0.0) { - TurnOffLoopSideEquipment(LoopNum, LoopSideNum); + TurnOffLoopSideEquipment(state, LoopNum, LoopSideNum); return; } else { // do nothing: can't turn all LoopSide equip. ON with loop switch @@ -3489,7 +3490,8 @@ CurrentModuleObject, PlantOpSchemeName); } // EMSFlag } - void AdjustChangeInLoadByEMSControls(int const LoopNum, + void AdjustChangeInLoadByEMSControls(EnergyPlusData &state, + int const LoopNum, int const LoopSideNum, int const BranchNum, int const CompNum, @@ -3533,7 +3535,7 @@ CurrentModuleObject, PlantOpSchemeName); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // set up some nice references to avoid lookups - auto &this_loopside(PlantLoop(LoopNum).LoopSide(LoopSideNum)); + auto &this_loopside(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum)); auto &this_branch(this_loopside.Branch(BranchNum)); auto &this_comp(this_branch.Comp(CompNum)); diff --git a/src/EnergyPlus/PlantCondLoopOperation.hh b/src/EnergyPlus/PlantCondLoopOperation.hh index 9776bb0a6cd..69e458ac7a4 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.hh +++ b/src/EnergyPlus/PlantCondLoopOperation.hh @@ -162,8 +162,9 @@ namespace PlantCondLoopOperation { Real64 const LoopDemand, Real64 &RemLoopDemand); - void AdjustChangeInLoadForLastStageUpperRangeLimit(int const LoopNum, // component topology - int const CurOpSchemePtr, // currect active operation scheme + void AdjustChangeInLoadForLastStageUpperRangeLimit(EnergyPlusData &state, + int const LoopNum, // component topology + int const CurOpSchemePtr, // current active operation scheme int const CurEquipListPtr, // current equipment list Real64 &ChangeInLoad // positive magnitude of load change ); @@ -210,11 +211,11 @@ namespace PlantCondLoopOperation { // Begin Plant Loop ON/OFF Utility Subroutines //****************************************************************************** - void TurnOnPlantLoopPipes(int const LoopNum, int const LoopSideNum); + void TurnOnPlantLoopPipes(EnergyPlusData &state, int const LoopNum, int const LoopSideNum); - void TurnOffLoopEquipment(int const LoopNum); + void TurnOffLoopEquipment(EnergyPlusData &state, int const LoopNum); - void TurnOffLoopSideEquipment(int const LoopNum, int const LoopSideNum); + void TurnOffLoopSideEquipment(EnergyPlusData &state, int const LoopNum, int const LoopSideNum); // End Plant Loop ON/OFF Utility Subroutines //****************************************************************************** @@ -226,7 +227,8 @@ namespace PlantCondLoopOperation { void ActivateEMSControls(EnergyPlusData &state, int const LoopNum, int const LoopSideNum, int const BranchNum, int const CompNum, bool &LoopShutDownFlag); - void AdjustChangeInLoadByEMSControls(int const LoopNum, + void AdjustChangeInLoadByEMSControls(EnergyPlusData &state, + int const LoopNum, int const LoopSideNum, int const BranchNum, int const CompNum, diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc index 416de1540a6..d01d0ac7be6 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -684,7 +684,7 @@ namespace PlantHeatExchangerFluidToFluid { errFlag = true; } else { - PlantUtilities::InterConnectTwoPlantLoopSides(this->SupplySideLoop.loopNum, + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->SupplySideLoop.loopNum, this->SupplySideLoop.loopSideNum, this->DemandSideLoop.loopNum, this->DemandSideLoop.loopSideNum, @@ -717,13 +717,13 @@ namespace PlantHeatExchangerFluidToFluid { { auto const SELECT_CASE_var( - DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed); + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed); if (SELECT_CASE_var == DataPlant::HowMet_ByNominalCap) { - DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed = + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed = DataPlant::HowMet_ByNominalCapFreeCoolCntrl; } else if (SELECT_CASE_var == DataPlant::HowMet_ByNominalCapLowOutLimit) { - DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed = + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).HowLoadServed = DataPlant::HowMet_ByNominalCapLowOutLimitFreeCoolCntrl; } } @@ -731,15 +731,15 @@ namespace PlantHeatExchangerFluidToFluid { { auto const SELECT_CASE_var(this->ControlSignalTemp); if (SELECT_CASE_var == WetBulbTemperature) { - DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = DataPlant::iFreeCoolControlMode::WetBulb; } else if (SELECT_CASE_var == DryBulbTemperature) { - DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = DataPlant::iFreeCoolControlMode::DryBulb; } else if (SELECT_CASE_var == LoopTemperature) { - DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMode = DataPlant::iFreeCoolControlMode::Loop; - DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlNodeNum = + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlNodeNum = this->OtherCompDemandSideLoop.inletNodeNum; } } @@ -786,9 +786,9 @@ namespace PlantHeatExchangerFluidToFluid { if (state.dataGlobal->BeginEnvrnFlag && this->MyEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->DemandSideLoop.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->DemandSideLoop.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).FluidIndex, RoutineNameNoColon); this->DemandSideLoop.MassFlowRateMax = rho * this->DemandSideLoop.DesignVolumeFlowRate; PlantUtilities::InitComponentNodes(this->DemandSideLoop.MassFlowRateMin, @@ -801,9 +801,9 @@ namespace PlantHeatExchangerFluidToFluid { this->DemandSideLoop.compNum); rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineNameNoColon); this->SupplySideLoop.MassFlowRateMax = rho * this->SupplySideLoop.DesignVolumeFlowRate; PlantUtilities::InitComponentNodes(this->SupplySideLoop.MassFlowRateMin, @@ -830,7 +830,7 @@ namespace PlantHeatExchangerFluidToFluid { int BranchNum = this->OtherCompSupplySideLoop.branchNum; int LoopCompNum = this->OtherCompSupplySideLoop.compNum; - DataPlant::PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMinCntrlTemp = + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(LoopSideNum).Branch(BranchNum).Comp(LoopCompNum).FreeCoolCntrlMinCntrlTemp = DataLoopNode::Node(this->SetPointNodeNum).TempSetPoint - this->TempControlTol; // issue #5626, include control tolerance } } @@ -856,8 +856,8 @@ namespace PlantHeatExchangerFluidToFluid { static std::string const RoutineName("SizeFluidHeatExchanger"); // first deal with Loop Supply Side - int PltSizNumSupSide = DataPlant::PlantLoop(this->SupplySideLoop.loopNum).PlantSizNum; - int PltSizNumDmdSide = DataPlant::PlantLoop(this->DemandSideLoop.loopNum).PlantSizNum; + int PltSizNumSupSide = state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).PlantSizNum; + int PltSizNumDmdSide = state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).PlantSizNum; Real64 tmpSupSideDesignVolFlowRate = this->SupplySideLoop.DesignVolumeFlowRate; if (this->SupplySideLoop.DesignVolumeFlowRateWasAutoSized) { if (PltSizNumSupSide > 0) { @@ -942,15 +942,15 @@ namespace PlantHeatExchangerFluidToFluid { if (tmpSupSideDesignVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineName); Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineName); Real64 tmpDesCap = Cp * rho * tmpDeltaTSupLoop * tmpSupSideDesignVolFlowRate; @@ -1000,13 +1000,13 @@ namespace PlantHeatExchangerFluidToFluid { } else { // don't rely on sizing, use loop setpoints // loop supply side - if (DataPlant::PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(this->SupplySideLoop.inletNodeNum).Temp = - DataLoopNode::Node(DataPlant::PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPoint; - } else if (DataPlant::PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPoint; + } else if (state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { DataLoopNode::Node(this->SupplySideLoop.inletNodeNum).Temp = - (DataLoopNode::Node(DataPlant::PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPointHi + - DataLoopNode::Node(DataPlant::PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPointLo) / + (DataLoopNode::Node(state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPointHi + + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).TempSetPointNodeNum).TempSetPointLo) / 2.0; } } @@ -1015,27 +1015,27 @@ namespace PlantHeatExchangerFluidToFluid { DataLoopNode::Node(this->DemandSideLoop.inletNodeNum).Temp = DataSizing::PlantSizData(PltSizNumDmdSide).ExitTemp; } else { // don't rely on sizing, use loop setpoints // loop demand side - if (DataPlant::PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { + if (state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { DataLoopNode::Node(this->DemandSideLoop.inletNodeNum).Temp = - DataLoopNode::Node(DataPlant::PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPoint; - } else if (DataPlant::PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPoint; + } else if (state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { DataLoopNode::Node(this->DemandSideLoop.inletNodeNum).Temp = - (DataLoopNode::Node(DataPlant::PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPointHi + - DataLoopNode::Node(DataPlant::PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPointLo) / + (DataLoopNode::Node(state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPointHi + + DataLoopNode::Node(state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).TempSetPointNodeNum).TempSetPointLo) / 2.0; } } Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineName); Real64 SupSideMdot = this->SupplySideLoop.DesignVolumeFlowRate * rho; rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->DemandSideLoop.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->DemandSideLoop.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).FluidIndex, RoutineName); Real64 DmdSideMdot = this->DemandSideLoop.DesignVolumeFlowRate * rho; @@ -1136,9 +1136,9 @@ namespace PlantHeatExchangerFluidToFluid { if (mdotSupSide > DataBranchAirLoopPlant::MassFlowTolerance) { // if supply side loop has massflow, request demand side flow Real64 cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidName, this->SupplySideLoop.InletTemp, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineName); Real64 TargetLeavingTemp = this->SupplySideLoop.InletTemp - std::abs(MyLoad) / (cp * mdotSupSide); @@ -1191,9 +1191,9 @@ namespace PlantHeatExchangerFluidToFluid { this->SupplySideLoop.compNum); if (mdotSupSide > DataBranchAirLoopPlant::MassFlowTolerance) { Real64 cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidName, this->SupplySideLoop.InletTemp, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineName); Real64 TargetLeavingTemp = this->SupplySideLoop.InletTemp + std::abs(MyLoad) / (cp * mdotSupSide); @@ -1802,7 +1802,7 @@ namespace PlantHeatExchangerFluidToFluid { Real64 SetPointTemp = DataLoopNode::Node(this->SetPointNodeNum).TempSetPoint; Real64 DeltaTCooling = SetPointTemp - ControlSignalValue; // obtain shut down state - bool ChillerShutDown = DataPlant::PlantLoop(this->OtherCompSupplySideLoop.loopNum) + bool ChillerShutDown = state.dataPlnt->PlantLoop(this->OtherCompSupplySideLoop.loopNum) .LoopSide(this->OtherCompSupplySideLoop.loopSideNum) .Branch(this->OtherCompSupplySideLoop.branchNum) .Comp(this->OtherCompSupplySideLoop.compNum) @@ -1902,16 +1902,16 @@ namespace PlantHeatExchangerFluidToFluid { // specific heat of fluid entering from supply side loop at inlet temp Real64 SupSideLoopInletCp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidName, SupSideLoopInletTemp, - DataPlant::PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SupplySideLoop.loopNum).FluidIndex, RoutineName); // specific heat of fluid entering from demand side loop at inlet temp Real64 DmdSideLoopInletCp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->DemandSideLoop.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).FluidName, DmdSideLoopInletTemp, - DataPlant::PlantLoop(this->DemandSideLoop.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).FluidIndex, RoutineName); Real64 SupSideCapRate = SupSideMdot * SupSideLoopInletCp; diff --git a/src/EnergyPlus/PlantLoadProfile.cc b/src/EnergyPlus/PlantLoadProfile.cc index 9741b283ae0..7f602600bf6 100644 --- a/src/EnergyPlus/PlantLoadProfile.cc +++ b/src/EnergyPlus/PlantLoadProfile.cc @@ -88,7 +88,6 @@ namespace PlantLoadProfile { // manager (see NonZoneEquipmentManager.cc). // Using/Aliasing - using DataPlant::PlantLoop; using DataPlant::TypeOf_PlantLoadProfile; using PlantUtilities::InitComponentNodes; using PlantUtilities::ScanPlantLoopsForObject; @@ -160,7 +159,7 @@ namespace PlantLoadProfile { if (this->MassFlowRate > 0.0) { Real64 Cp = - GetSpecificHeatGlycol(state, PlantLoop(this->WLoopNum).FluidName, this->InletTemp, PlantLoop(this->WLoopNum).FluidIndex, RoutineName); + GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->WLoopNum).FluidName, this->InletTemp, state.dataPlnt->PlantLoop(this->WLoopNum).FluidIndex, RoutineName); DeltaTemp = this->Power / (this->MassFlowRate * Cp); } else { this->Power = 0.0; @@ -209,7 +208,7 @@ namespace PlantLoadProfile { // Do the one time initializations if (this->SetLoopIndexFlag) { - if (allocated(PlantLoop)) { + if (allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject(state, this->Name, this->TypeNum, this->WLoopNum, this->WLoopSideNum, this->WLoopBranchNum, this->WLoopCompNum, errFlag, _, _, _, _, _); @@ -231,7 +230,7 @@ namespace PlantLoadProfile { Node(OutletNode).Temp = 0.0; FluidDensityInit = - GetDensityGlycol(state, PlantLoop(this->WLoopNum).FluidName, DataGlobalConstants::InitConvTemp, PlantLoop(this->WLoopNum).FluidIndex, RoutineName); + GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->WLoopNum).FluidName, DataGlobalConstants::InitConvTemp, state.dataPlnt->PlantLoop(this->WLoopNum).FluidIndex, RoutineName); Real64 MaxFlowMultiplier = GetScheduleMaxValue(state, this->FlowRateFracSchedule); @@ -258,7 +257,7 @@ namespace PlantLoadProfile { if (this->EMSOverridePower) this->Power = this->EMSPowerValue; - FluidDensityInit = GetDensityGlycol(state, PlantLoop(this->WLoopNum).FluidName, this->InletTemp, PlantLoop(this->WLoopNum).FluidIndex, RoutineName); + FluidDensityInit = GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->WLoopNum).FluidName, this->InletTemp, state.dataPlnt->PlantLoop(this->WLoopNum).FluidIndex, RoutineName); // Get the scheduled mass flow rate this->VolFlowRate = this->PeakVolFlowRate * GetCurrentScheduleValue(state, this->FlowRateFracSchedule); diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index 0b05f62321d..b515f3a228c 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -121,7 +121,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { Real64 EIRPlantLoopHeatPump::getLoadSideOutletSetPointTemp(EnergyPlusData &state) const { - auto &thisLoadPlantLoop = DataPlant::PlantLoop(this->loadSideLocation.loopNum); + auto &thisLoadPlantLoop = state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum); auto &thisLoadLoopSide = thisLoadPlantLoop.LoopSide(this->loadSideLocation.loopSideNum); auto &thisLoadBranch = thisLoadLoopSide.Branch(this->loadSideLocation.branchNum); auto &thisLoadComp = thisLoadBranch.Comp(this->loadSideLocation.compNum); @@ -179,7 +179,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { this->sourceSideLocation.loopSideNum, this->sourceSideLocation.branchNum, this->sourceSideLocation.compNum); - PlantUtilities::PullCompInterconnectTrigger(this->loadSideLocation.loopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->loadSideLocation.loopNum, this->loadSideLocation.loopSideNum, this->loadSideLocation.branchNum, this->loadSideLocation.compNum, @@ -227,7 +227,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { this->sourceSideLocation.branchNum, this->sourceSideLocation.compNum); } - PlantUtilities::PullCompInterconnectTrigger(this->loadSideLocation.loopNum, + PlantUtilities::PullCompInterconnectTrigger(state, this->loadSideLocation.loopNum, this->loadSideLocation.loopSideNum, this->loadSideLocation.branchNum, this->loadSideLocation.compNum, @@ -305,7 +305,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { } // evaluate the actual current operating load side heat transfer rate - auto &thisLoadPlantLoop = DataPlant::PlantLoop(this->loadSideLocation.loopNum); + auto &thisLoadPlantLoop = state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum); Real64 CpLoad = FluidProperties::GetSpecificHeatGlycol( state, thisLoadPlantLoop.FluidName, DataLoopNode::Node(this->loadSideNodes.inlet).Temp, thisLoadPlantLoop.FluidIndex, "PLHPEIR::simulate()"); this->loadSideHeatTransfer = availableCapacity * partLoadRatio; @@ -466,7 +466,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { errFlag = true; } else { - PlantUtilities::InterConnectTwoPlantLoopSides(this->loadSideLocation.loopNum, + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->loadSideLocation.loopNum, this->loadSideLocation.loopSideNum, this->sourceSideLocation.loopNum, this->sourceSideLocation.loopSideNum, @@ -485,9 +485,9 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { if (state.dataGlobal->BeginEnvrnFlag && this->envrnInit && DataPlant::PlantFirstSizesOkayToFinalize) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidIndex, routineName); this->loadSideDesignMassFlowRate = rho * this->loadSideDesignVolFlowRate; PlantUtilities::InitComponentNodes(0.0, @@ -501,9 +501,9 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { if (this->waterSource) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->sourceSideLocation.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->sourceSideLocation.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->sourceSideLocation.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->sourceSideLocation.loopNum).FluidIndex, routineName); this->sourceSideDesignMassFlowRate = rho * this->sourceSideDesignVolFlowRate; PlantUtilities::InitComponentNodes(0.0, @@ -567,17 +567,17 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { } Real64 const rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidName, loadSideInitTemp, - DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidIndex, "EIRPlantLoopHeatPump::size()"); Real64 const Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidName, loadSideInitTemp, - DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidIndex, "EIRPlantLoopHeatPump::size()"); - int pltLoadSizNum = DataPlant::PlantLoop(this->loadSideLocation.loopNum).PlantSizNum; + int pltLoadSizNum = state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).PlantSizNum; if (pltLoadSizNum > 0) { // this first IF block is really just about calculating the local tmpCapacity and tmpLoadVolFlow values // these represent what the unit would size those to, whether it is doing auto-sizing or not @@ -746,14 +746,14 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { } Real64 const rhoSrc = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidName, sourceSideInitTemp, - DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidIndex, "EIRPlantLoopHeatPump::size()"); Real64 const CpSrc = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidName, sourceSideInitTemp, - DataPlant::PlantLoop(this->loadSideLocation.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidIndex, "EIRPlantLoopHeatPump::size()"); // To start we need to override the calculated load side flow @@ -761,7 +761,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { if (!this->loadSideDesignVolFlowRateWasAutoSized) tmpLoadVolFlow = this->loadSideDesignVolFlowRate; // calculate an auto-sized value for source design flow regardless of whether it was auto-sized or not - int plantSourceSizingIndex = DataPlant::PlantLoop(this->sourceSideLocation.loopNum).PlantSizNum; + int plantSourceSizingIndex = state.dataPlnt->PlantLoop(this->sourceSideLocation.loopNum).PlantSizNum; if (plantSourceSizingIndex > 0) { // to get the source flow, we first must calculate the required heat impact on the source side // First the definition of COP: COP = Qload/Power, therefore Power = Qload/COP diff --git a/src/EnergyPlus/PlantPipingSystemsManager.cc b/src/EnergyPlus/PlantPipingSystemsManager.cc index f2bedb1f53b..a69a7ca44c6 100644 --- a/src/EnergyPlus/PlantPipingSystemsManager.cc +++ b/src/EnergyPlus/PlantPipingSystemsManager.cc @@ -2159,9 +2159,9 @@ namespace EnergyPlus { // Once we find ourselves on the plant loop, we can do other things Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(thisCircuit->LoopNum).FluidName, + state.dataPlnt->PlantLoop(thisCircuit->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(thisCircuit->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(thisCircuit->LoopNum).FluidIndex, RoutineName); thisCircuit->DesignMassFlowRate = thisCircuit->DesignVolumeFlowRate * rho; thisCircuit->NeedToFindOnPlantLoop = false; @@ -5802,26 +5802,26 @@ namespace EnergyPlus { // retrieve fluid properties based on the circuit inlet temperature -- which varies during the simulation // but need to verify the value of inlet temperature during warm up, etc. FluidCp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(thisCircuit->LoopNum).FluidName, + state.dataPlnt->PlantLoop(thisCircuit->LoopNum).FluidName, thisCircuit->InletTemperature, - DataPlant::PlantLoop(thisCircuit->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(thisCircuit->LoopNum).FluidIndex, RoutineName); FluidDensity = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(thisCircuit->LoopNum).FluidName, + state.dataPlnt->PlantLoop(thisCircuit->LoopNum).FluidName, thisCircuit->InletTemperature, - DataPlant::PlantLoop(thisCircuit->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(thisCircuit->LoopNum).FluidIndex, RoutineName); FluidConductivity = FluidProperties::GetConductivityGlycol( state, - DataPlant::PlantLoop(thisCircuit->LoopNum).FluidName, + state.dataPlnt->PlantLoop(thisCircuit->LoopNum).FluidName, thisCircuit->InletTemperature, - DataPlant::PlantLoop(thisCircuit->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(thisCircuit->LoopNum).FluidIndex, RoutineName); FluidViscosity = FluidProperties::GetViscosityGlycol( state, - DataPlant::PlantLoop(thisCircuit->LoopNum).FluidName, + state.dataPlnt->PlantLoop(thisCircuit->LoopNum).FluidName, thisCircuit->InletTemperature, - DataPlant::PlantLoop(thisCircuit->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(thisCircuit->LoopNum).FluidIndex, RoutineName); // Doesn't anyone care about poor Ludwig Prandtl? diff --git a/src/EnergyPlus/PlantPressureSystem.cc b/src/EnergyPlus/PlantPressureSystem.cc index dd668fe2fc3..1d36b35e235 100644 --- a/src/EnergyPlus/PlantPressureSystem.cc +++ b/src/EnergyPlus/PlantPressureSystem.cc @@ -131,10 +131,9 @@ namespace EnergyPlus::PlantPressureSystem { // Standard EnergyPlus methodology // Using/Aliasing - using DataPlant::PlantLoop; // Exit out of any calculation routines if we don't do pressure simulation for this loop - if ((PlantLoop(LoopNum).PressureSimType == DataPlant::iPressSimType::NoPressure) && ((CallType == DataPlant::iPressureCall::Calc) || (CallType == DataPlant::iPressureCall::Update))) + if ((state.dataPlnt->PlantLoop(LoopNum).PressureSimType == DataPlant::iPressSimType::NoPressure) && ((CallType == DataPlant::iPressureCall::Calc) || (CallType == DataPlant::iPressureCall::Update))) return; // Pass to another routine based on calling flag @@ -168,7 +167,6 @@ namespace EnergyPlus::PlantPressureSystem { // Using/Aliasing using DataLoopNode::Node; using DataPlant::DemandSide; - using DataPlant::PlantLoop; using DataPlant::SupplySide; static Array1D_bool LoopInit; @@ -181,12 +179,12 @@ namespace EnergyPlus::PlantPressureSystem { if (InitPressureDropOneTimeInit) { // First allocate the initialization array to each plant loop - LoopInit.allocate(size(PlantLoop)); + LoopInit.allocate(size(state.dataPlnt->PlantLoop)); LoopInit = true; InitPressureDropOneTimeInit = false; } - auto &loop(PlantLoop(LoopNum)); + auto &loop(state.dataPlnt->PlantLoop(LoopNum)); // CurrentModuleObject='Curve:Functional:PressureDrop' if (LoopInit(LoopNum)) { @@ -378,7 +376,6 @@ namespace EnergyPlus::PlantPressureSystem { using CurveManager::CurveValue; using CurveManager::PressureCurveValue; using DataLoopNode::Node; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetViscosityGlycol; @@ -398,17 +395,17 @@ namespace EnergyPlus::PlantPressureSystem { static int ErrorCounter(0); // For proper error handling // Exit early if need be - if (!PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).HasPressureComponents) { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureDrop = 0.0; - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK = 0.0; + if (!state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).HasPressureComponents) { + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureDrop = 0.0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK = 0.0; return; } // Get data from data structure - FluidIndex = PlantLoop(LoopNum).FluidIndex; - InletNodeNum = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumIn; - pressureCurveType = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureCurveType; - PressureCurveIndex = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureCurveIndex; + FluidIndex = state.dataPlnt->PlantLoop(LoopNum).FluidIndex; + InletNodeNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumIn; + pressureCurveType = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureCurveType; + PressureCurveIndex = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureCurveIndex; // Get nodal conditions NodeMassFlow = Node(InletNodeNum).MassFlowRate; @@ -433,7 +430,7 @@ namespace EnergyPlus::PlantPressureSystem { ++ErrorCounter; if (ErrorCounter == 1) { ShowSevereError(state, "Plant pressure simulation encountered a branch which contains invalid branch pressure curve type."); - ShowContinueError(state, "Occurs for branch: " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Name); + ShowContinueError(state, "Occurs for branch: " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Name); ShowContinueError(state, "This error will be issued only once, although other branches may encounter the same problem"); ShowContinueError(state, "For now, pressure drop on this branch will be set to zero."); ShowContinueError(state, "Verify all pressure inputs and pressure drop output variables to ensure proper simulation"); @@ -442,13 +439,13 @@ namespace EnergyPlus::PlantPressureSystem { } // Log this pressure in the data structure to be handled by the update routine later - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureDrop = BranchDeltaPress; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureDrop = BranchDeltaPress; // Update the effective K-value for this branch if (NodeMassFlow > 0.0) { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK = BranchDeltaPress / pow_2(NodeMassFlow); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK = BranchDeltaPress / pow_2(NodeMassFlow); } else { - PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK = 0.0; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK = 0.0; } } @@ -473,7 +470,6 @@ namespace EnergyPlus::PlantPressureSystem { // Using/Aliasing using DataLoopNode::Node; using DataPlant::DemandSide; - using DataPlant::PlantLoop; using DataPlant::SupplySide; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -494,7 +490,7 @@ namespace EnergyPlus::PlantPressureSystem { Real64 TempVal_SumOfOneByRootK; // Exit if not needed - if (!PlantLoop(LoopNum).HasPressureComponents) return; + if (!state.dataPlnt->PlantLoop(LoopNum).HasPressureComponents) return; // Now go through and update the pressure drops as needed FoundAPumpOnBranch = false; @@ -503,7 +499,7 @@ namespace EnergyPlus::PlantPressureSystem { // Loop through all branches on this loop side LoopSidePressureDrop = 0.0; - NumBranches = size(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch); + NumBranches = size(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch); // Split here based on a single branch loop or a splitter/mixer configuration if (NumBranches == 1) { // Just do the single branch @@ -525,8 +521,8 @@ namespace EnergyPlus::PlantPressureSystem { //*******************! //***MIXER SIMULATION***! - MixerPressure = Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumIn).Press; - PassPressureAcrossMixer(LoopNum, LoopSideNum, MixerPressure, NumBranches); + MixerPressure = Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumIn).Press; + PassPressureAcrossMixer(state, LoopNum, LoopSideNum, MixerPressure, NumBranches); //**********************! //***PARALLEL BRANCHES***! @@ -544,7 +540,7 @@ namespace EnergyPlus::PlantPressureSystem { LoopNum, LoopSideNum, BranchNum, ParallelBranchPressureDrops(ParallelBranchCounter), FoundAPumpOnBranch); // Store the branch inlet pressure so we can pass it properly across the splitter ParallelBranchInletPressures(ParallelBranchCounter) = - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumIn).Press; + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumIn).Press; } // Now take max inlet pressure to pass across splitter and max branch pressure for bookkeeping @@ -576,7 +572,7 @@ namespace EnergyPlus::PlantPressureSystem { if (!FoundAPumpOnBranch) { //***SPLITTER SIMULATION***! - PassPressureAcrossSplitter(LoopNum, LoopSideNum, SplitterInletPressure); + PassPressureAcrossSplitter(state, LoopNum, LoopSideNum, SplitterInletPressure); //*************************! //***INLET BRANCH***! @@ -588,17 +584,17 @@ namespace EnergyPlus::PlantPressureSystem { //***PLANT INTERFACE***! if (LoopSideNum == DemandSide) { - PassPressureAcrossInterface(LoopNum); + PassPressureAcrossInterface(state, LoopNum); } //*********************! } } - PlantLoop(LoopNum).LoopSide(LoopSideNum).PressureDrop = LoopSidePressureDrop; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).PressureDrop = LoopSidePressureDrop; } // LoopSides on this loop - PlantLoop(LoopNum).PressureDrop = LoopPressureDrop; + state.dataPlnt->PlantLoop(LoopNum).PressureDrop = LoopPressureDrop; // Now do effective K value calculations EffectiveLoopKValue = 0.0; @@ -608,18 +604,18 @@ namespace EnergyPlus::PlantPressureSystem { EffectiveLoopSideKValue = 0.0; // Always take the first branch K, it may be the only branch on this half loop - EffectiveLoopSideKValue += PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(1).PressureEffectiveK; + EffectiveLoopSideKValue += state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(1).PressureEffectiveK; // If there is only one branch then move to the other loop side - if (size(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch) == 1) continue; + if (size(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch) == 1) continue; // Add parallel branches if necessary by adding them as SUM(1/(sqrt(K_i))) TempVal_SumOfOneByRootK = 0.0; - for (BranchNum = 2; BranchNum <= isize(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch) - 1; ++BranchNum) { + for (BranchNum = 2; BranchNum <= isize(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch) - 1; ++BranchNum) { // Only add this branch if the K value is non-zero - if (PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK > 0.0) { - TempVal_SumOfOneByRootK += (1.0 / std::sqrt(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK)); + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK > 0.0) { + TempVal_SumOfOneByRootK += (1.0 / std::sqrt(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK)); } } @@ -627,18 +623,18 @@ namespace EnergyPlus::PlantPressureSystem { if (TempVal_SumOfOneByRootK > 0.0) EffectiveLoopSideKValue += (1.0 / pow_2(TempVal_SumOfOneByRootK)); // Always take the last branch K, it will be in series - BranchNum = size(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch); - EffectiveLoopSideKValue += PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK; + BranchNum = size(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch); + EffectiveLoopSideKValue += state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureEffectiveK; // Assign this loop side's K-value - PlantLoop(LoopNum).LoopSide(LoopSideNum).PressureEffectiveK = EffectiveLoopSideKValue; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).PressureEffectiveK = EffectiveLoopSideKValue; // Keep adding the overall loop K-value EffectiveLoopKValue += EffectiveLoopSideKValue; } // Assign this loop's K-value - PlantLoop(LoopNum).PressureEffectiveK = EffectiveLoopKValue; + state.dataPlnt->PlantLoop(LoopNum).PressureEffectiveK = EffectiveLoopKValue; } void DistributePressureOnBranch(EnergyPlusData &state, int const LoopNum, int const LoopSideNum, int const BranchNum, Real64 &BranchPressureDrop, bool &PumpFound) @@ -661,7 +657,6 @@ namespace EnergyPlus::PlantPressureSystem { // Using/Aliasing using DataLoopNode::Node; using DataPlant::DemandSide; - using DataPlant::PlantLoop; using DataPlant::SupplySide; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -672,22 +667,22 @@ namespace EnergyPlus::PlantPressureSystem { // Initialize TempBranchPressureDrop = 0.0; BranchPressureDrop = 0.0; - NumCompsOnBranch = size(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp); + NumCompsOnBranch = size(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp); // Retrieve temporary branch pressure drop - if (PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).HasPressureComponents) { - TempBranchPressureDrop = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureDrop; + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).HasPressureComponents) { + TempBranchPressureDrop = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).PressureDrop; } // If the last component on the branch is the pump, then check if a pressure drop is detected and set the flag and leave - if (PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(NumCompsOnBranch).isPump()) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(NumCompsOnBranch).isPump()) { PumpFound = true; if (TempBranchPressureDrop != 0.0) { - ShowSevereError(state, "Error in plant pressure simulation for plant loop: " + PlantLoop(LoopNum).Name); + ShowSevereError(state, "Error in plant pressure simulation for plant loop: " + state.dataPlnt->PlantLoop(LoopNum).Name); if (LoopNum == DemandSide) { - ShowContinueError(state, "Occurs for demand side, branch: " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Name); + ShowContinueError(state, "Occurs for demand side, branch: " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Name); } else if (LoopNum == SupplySide) { - ShowContinueError(state, "Occurs for supply side, branch: " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Name); + ShowContinueError(state, "Occurs for supply side, branch: " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Name); } ShowContinueError(state, "Branch contains only a single pump component, yet also a pressure drop component."); ShowContinueError(state, "Either add a second component to this branch after the pump, or move pressure drop data."); @@ -697,14 +692,14 @@ namespace EnergyPlus::PlantPressureSystem { } // Assign official branch pressure drop - if (PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).HasPressureComponents) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).HasPressureComponents) { BranchPressureDrop = TempBranchPressureDrop; } // Otherwise update the inlet node of the last component on the branch with this corrected pressure // This essentially sets all the pressure drop on the branch to be accounted for on the last component - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(NumCompsOnBranch).NodeNumIn).Press = - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(NumCompsOnBranch).NodeNumOut).Press + BranchPressureDrop; + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(NumCompsOnBranch).NodeNumIn).Press = + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(NumCompsOnBranch).NodeNumOut).Press + BranchPressureDrop; // Then Smear any internal nodes with this new node pressure by working backward through // all but the last component, and passing node pressure upstream @@ -712,19 +707,19 @@ namespace EnergyPlus::PlantPressureSystem { for (CompNum = NumCompsOnBranch - 1; CompNum >= 1; --CompNum) { // If this component is a pump, stop passing pressure upstream, and set flag to true for calling routine - if (PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).isPump()) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).isPump()) { PumpFound = true; break; } // Otherwise just pass pressure upstream and move on - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).NodeNumIn).Press = - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).NodeNumOut).Press; + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).NodeNumIn).Press = + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).NodeNumOut).Press; } } } - void PassPressureAcrossMixer(int const LoopNum, int const LoopSideNum, Real64 &MixerPressure, int const NumBranchesOnLoopSide) + void PassPressureAcrossMixer(EnergyPlusData &state, int const LoopNum, int const LoopSideNum, Real64 &MixerPressure, int const NumBranchesOnLoopSide) { // SUBROUTINE INFORMATION: @@ -743,17 +738,16 @@ namespace EnergyPlus::PlantPressureSystem { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::PlantLoop; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int BranchNum; for (BranchNum = 2; BranchNum <= NumBranchesOnLoopSide - 1; ++BranchNum) { - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumOut).Press = MixerPressure; + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumOut).Press = MixerPressure; } } - void PassPressureAcrossSplitter(int const LoopNum, int const LoopSideNum, Real64 &SplitterInletPressure) + void PassPressureAcrossSplitter(EnergyPlusData &state, int const LoopNum, int const LoopSideNum, Real64 &SplitterInletPressure) { // SUBROUTINE INFORMATION: @@ -772,17 +766,16 @@ namespace EnergyPlus::PlantPressureSystem { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::PlantLoop; // SUBROUTINE PARAMETER DEFINITIONS: int const InletBranchNum(1); - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(InletBranchNum).NodeNumOut).Press = SplitterInletPressure; + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(InletBranchNum).NodeNumOut).Press = SplitterInletPressure; } //=================================================================================================! - void PassPressureAcrossInterface(int const LoopNum) + void PassPressureAcrossInterface(EnergyPlusData &state, int const LoopNum) { // SUBROUTINE INFORMATION: @@ -802,15 +795,14 @@ namespace EnergyPlus::PlantPressureSystem { // Using/Aliasing using DataLoopNode::Node; using DataPlant::DemandSide; - using DataPlant::PlantLoop; using DataPlant::SupplySide; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int DemandInletNodeNum; int SupplyOutletNodeNum; - DemandInletNodeNum = PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn; - SupplyOutletNodeNum = PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumOut; + DemandInletNodeNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).NodeNumIn; + SupplyOutletNodeNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumOut; Node(SupplyOutletNodeNum).Press = Node(DemandInletNodeNum).Press; } @@ -847,7 +839,6 @@ namespace EnergyPlus::PlantPressureSystem { // Using/Aliasing using CurveManager::CurveValue; using DataLoopNode::Node; - using DataPlant::PlantLoop; using DataPlant::SupplySide; using FluidProperties::GetDensityGlycol; using FluidProperties::GetViscosityGlycol; @@ -882,12 +873,12 @@ namespace EnergyPlus::PlantPressureSystem { Real64 DampingFactor; // Get loop level data - FluidIndex = PlantLoop(LoopNum).FluidIndex; - LoopEffectiveK = PlantLoop(LoopNum).PressureEffectiveK; + FluidIndex = state.dataPlnt->PlantLoop(LoopNum).FluidIndex; + LoopEffectiveK = state.dataPlnt->PlantLoop(LoopNum).PressureEffectiveK; SystemPressureDrop = LoopEffectiveK * pow_2(SystemMassFlow); // Read data off the node data structure - NodeTemperature = Node(PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn).Temp; + NodeTemperature = Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).NodeNumIn).Temp; NodeDensity = GetDensityGlycol(state, std::string(), NodeTemperature, FluidIndex, RoutineName); // Store the passed in (requested, design) flow to the local value for performing iterations @@ -898,7 +889,7 @@ namespace EnergyPlus::PlantPressureSystem { ++ZeroKWarningCounter; if (ZeroKWarningCounter == 1) { ShowWarningError(state, "Pump pressure-flow resolution attempted, but invalid loop conditions encountered."); - ShowContinueError(state, "Loop being calculated: " + PlantLoop(LoopNum).Name); + ShowContinueError(state, "Loop being calculated: " + state.dataPlnt->PlantLoop(LoopNum).Name); ShowContinueError(state, "An invalid pressure/flow condition existed which resulted in the approximation of"); ShowContinueError(state, "the pressure coefficient K to be zero. The pressure simulation will use the requested (design)"); ShowContinueError(state, "pump flow in order to proceed with the simulation. This warning is only issued once."); @@ -967,7 +958,7 @@ namespace EnergyPlus::PlantPressureSystem { ++MaxIterWarningCounter; if (MaxIterWarningCounter == 1) { ShowWarningError(state, "Pump pressure-flow resolution attempted, but iteration loop did not converge."); - ShowContinueError(state, "Loop being calculated: " + PlantLoop(LoopNum).Name); + ShowContinueError(state, "Loop being calculated: " + state.dataPlnt->PlantLoop(LoopNum).Name); ShowContinueError(state, "A mismatch between the pump curve entered and the pressure drop components"); ShowContinueError(state, "on the loop may be the cause. The pressure simulation will use the requested (design)"); ShowContinueError(state, "pump flow in order to proceed with the simulation. This warning is only issued once."); diff --git a/src/EnergyPlus/PlantPressureSystem.hh b/src/EnergyPlus/PlantPressureSystem.hh index 8f7e1591720..92636406abc 100644 --- a/src/EnergyPlus/PlantPressureSystem.hh +++ b/src/EnergyPlus/PlantPressureSystem.hh @@ -85,11 +85,11 @@ namespace PlantPressureSystem { void DistributePressureOnBranch(EnergyPlusData &state, int const LoopNum, int const LoopSideNum, int const BranchNum, Real64 &BranchPressureDrop, bool &PumpFound); - void PassPressureAcrossMixer(int const LoopNum, int const LoopSideNum, Real64 &MixerPressure, int const NumBranchesOnLoopSide); + void PassPressureAcrossMixer(EnergyPlusData &state, int const LoopNum, int const LoopSideNum, Real64 &MixerPressure, int const NumBranchesOnLoopSide); - void PassPressureAcrossSplitter(int const LoopNum, int const LoopSideNum, Real64 &SplitterInletPressure); + void PassPressureAcrossSplitter(EnergyPlusData &state, int const LoopNum, int const LoopSideNum, Real64 &SplitterInletPressure); - void PassPressureAcrossInterface(int const LoopNum); + void PassPressureAcrossInterface(EnergyPlusData &state, int const LoopNum); Real64 ResolveLoopFlowVsPressure(EnergyPlusData &state, int const LoopNum, // - Index of which plant/condenser loop is being simulated diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index 4899040ca45..e862f5d1cf3 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -244,7 +244,7 @@ namespace PlantUtilities { } Real64 const MdotOldRequest = DataLoopNode::Node(InletNode).MassFlowRateRequest; - auto &loop_side(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum)); + auto &loop_side(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum)); auto &comp(loop_side.Branch(BranchIndex).Comp(CompIndex)); if (comp.CurOpSchemeType == DataPlant::DemandOpSchemeType) { @@ -279,7 +279,7 @@ namespace PlantUtilities { // Set loop flow rate if (loop_side.FlowLock == DataPlant::iFlowLock::Unlocked) { - if (DataPlant::PlantLoop(LoopNum).MaxVolFlowRate == DataSizing::AutoSize) { // still haven't sized the plant loop + if (state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate == DataSizing::AutoSize) { // still haven't sized the plant loop DataLoopNode::Node(OutletNode).MassFlowRate = CompFlow; DataLoopNode::Node(InletNode).MassFlowRate = DataLoopNode::Node(OutletNode).MassFlowRate; } else { // bound the flow by Min/Max available and hardware limits @@ -404,7 +404,7 @@ namespace PlantUtilities { return; } - auto &loop_side(DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum)); + auto &loop_side(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum)); // store original flow Real64 const MdotOldRequest = a_node.MassFlowRateRequest; @@ -421,7 +421,7 @@ namespace PlantUtilities { if (LoopNum > 0 && LoopSideNum > 0) { auto const &branch(loop_side.Branch(BranchNum)); if (loop_side.FlowLock == DataPlant::iFlowLock::Unlocked) { - if (DataPlant::PlantLoop(LoopNum).MaxVolFlowRate == DataSizing::AutoSize) { // still haven't sized the plant loop + if (state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate == DataSizing::AutoSize) { // still haven't sized the plant loop a_node.MassFlowRate = CompFlow; } else { // bound the flow by Min/Max available across entire branch @@ -502,7 +502,7 @@ namespace PlantUtilities { } Real64 RegulateCondenserCompFlowReqOp( - int const LoopNum, int const LoopSideNum, int const BranchNum, int const CompNum, Real64 const TentativeFlowRequest) + EnergyPlusData &state, int const LoopNum, int const LoopSideNum, int const BranchNum, int const CompNum, Real64 const TentativeFlowRequest) { // FUNCTION INFORMATION: @@ -531,7 +531,6 @@ namespace PlantUtilities { using DataPlant::CompSetPtBasedSchemeType; using DataPlant::CoolingRBOpSchemeType; using DataPlant::HeatingRBOpSchemeType; - using DataPlant::PlantLoop; // Return value Real64 FlowVal; @@ -544,9 +543,9 @@ namespace PlantUtilities { bool CompRunFlag; int CompOpScheme; - CompCurLoad = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).MyLoad; - CompRunFlag = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).ON; - CompOpScheme = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType; + CompCurLoad = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).MyLoad; + CompRunFlag = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).ON; + CompOpScheme = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).Comp(CompNum).CurOpSchemeType; if (CompRunFlag) { @@ -574,7 +573,7 @@ namespace PlantUtilities { return FlowVal; } - bool AnyPlantSplitterMixerLacksContinuity() + bool AnyPlantSplitterMixerLacksContinuity(EnergyPlusData &state) { // FUNCTION INFORMATION: @@ -587,14 +586,14 @@ namespace PlantUtilities { // Similar to CheckPlantMixerSplitterConsistency, but used to decide if plant needs to iterate again for (int LoopNum = 1; LoopNum <= DataPlant::TotNumLoops; ++LoopNum) { for (int LoopSide = DataPlant::DemandSide; LoopSide <= DataPlant::SupplySide; ++LoopSide) { - if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSide).Splitter.Exists) { - int const SplitterInletNode = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSide).Splitter.NodeNumIn; + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Splitter.Exists) { + int const SplitterInletNode = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Splitter.NodeNumIn; // loop across branch outlet nodes and check mass continuity - int const NumSplitterOutlets = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSide).Splitter.TotalOutletNodes; + int const NumSplitterOutlets = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Splitter.TotalOutletNodes; Real64 SumOutletFlow = 0.0; for (int OutletNum = 1; OutletNum <= NumSplitterOutlets; ++OutletNum) { - int const BranchNum = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSide).Splitter.BranchNumOut(OutletNum); - int const LastNodeOnBranch = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSide).Branch(BranchNum).NodeNumOut; + int const BranchNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Splitter.BranchNumOut(OutletNum); + int const LastNodeOnBranch = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Branch(BranchNum).NodeNumOut; SumOutletFlow += DataLoopNode::Node(LastNodeOnBranch).MassFlowRate; } Real64 const AbsDifference = std::abs(DataLoopNode::Node(SplitterInletNode).MassFlowRate - SumOutletFlow); @@ -627,7 +626,6 @@ namespace PlantUtilities { using DataLoopNode::Node; using DataPlant::CriteriaDelta_MassFlowRate; using DataPlant::DemandSide; - using DataPlant::PlantLoop; using DataPlant::SupplySide; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -640,28 +638,28 @@ namespace PlantUtilities { int BranchNum; int LastNodeOnBranch; - if (!PlantLoop(LoopNum).LoopHasConnectionComp) { - if (!state.dataGlobal->DoingSizing && !state.dataGlobal->WarmupFlag && PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Exists && !FirstHVACIteration) { + if (!state.dataPlnt->PlantLoop(LoopNum).LoopHasConnectionComp) { + if (!state.dataGlobal->DoingSizing && !state.dataGlobal->WarmupFlag && state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Exists && !FirstHVACIteration) { // Find mixer outlet node number - MixerOutletNode = PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.NodeNumOut; + MixerOutletNode = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.NodeNumOut; // Find splitter inlet node number - SplitterInletNode = PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.NodeNumIn; + SplitterInletNode = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.NodeNumIn; AbsDifference = std::abs(Node(SplitterInletNode).MassFlowRate - Node(MixerOutletNode).MassFlowRate); if (AbsDifference > DataBranchAirLoopPlant::MassFlowTolerance) { - if (PlantLoop(LoopNum).MFErrIndex1 == 0) { + if (state.dataPlnt->PlantLoop(LoopNum).MFErrIndex1 == 0) { ShowSevereMessage(state, "Plant flows do not resolve -- splitter inlet flow does not match mixer outlet flow "); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "PlantLoop name= " + PlantLoop(LoopNum).Name); - ShowContinueError(state, "Plant Connector:Mixer name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Name); + ShowContinueError(state, "PlantLoop name= " + state.dataPlnt->PlantLoop(LoopNum).Name); + ShowContinueError(state, "Plant Connector:Mixer name= " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Name); ShowContinueError(state, format("Mixer outlet mass flow rate= {:.6R} {{kg/s}}", Node(MixerOutletNode).MassFlowRate)); - ShowContinueError(state, "Plant Connector:Splitter name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.Name); + ShowContinueError(state, "Plant Connector:Splitter name= " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.Name); ShowContinueError(state, format("Splitter inlet mass flow rate= {:.6R} {{kg/s}}", Node(SplitterInletNode).MassFlowRate)); ShowContinueError(state, format("Difference in two mass flow rates= {:.6R} {{kg/s}}", AbsDifference)); } - ShowRecurringSevereErrorAtEnd(state, "Plant Flows (Loop=" + PlantLoop(LoopNum).Name + + ShowRecurringSevereErrorAtEnd(state, "Plant Flows (Loop=" + state.dataPlnt->PlantLoop(LoopNum).Name + ") splitter inlet flow not match mixer outlet flow", - PlantLoop(LoopNum).MFErrIndex1, + state.dataPlnt->PlantLoop(LoopNum).MFErrIndex1, AbsDifference, AbsDifference, _, @@ -670,10 +668,10 @@ namespace PlantUtilities { if (AbsDifference > DataBranchAirLoopPlant::MassFlowTolerance * 10.0) { ShowSevereError(state, "Plant flows do not resolve -- splitter inlet flow does not match mixer outlet flow "); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "PlantLoop name= " + PlantLoop(LoopNum).Name); - ShowContinueError(state, "Plant Connector:Mixer name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Name); + ShowContinueError(state, "PlantLoop name= " + state.dataPlnt->PlantLoop(LoopNum).Name); + ShowContinueError(state, "Plant Connector:Mixer name= " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Name); ShowContinueError(state, format("Mixer outlet mass flow rate= {:.6R} {{kg/s}}", Node(MixerOutletNode).MassFlowRate)); - ShowContinueError(state, "Plant Connector:Splitter name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.Name); + ShowContinueError(state, "Plant Connector:Splitter name= " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.Name); ShowContinueError(state, format("Splitter inlet mass flow rate= {:.6R} {{kg/s}}", Node(SplitterInletNode).MassFlowRate)); ShowContinueError(state, format("Difference in two mass flow rates= {:.6R} {{kg/s}}", AbsDifference)); ShowFatalError(state, "CheckPlantMixerSplitterConsistency: Simulation terminated because of problems in plant flow resolver"); @@ -683,31 +681,31 @@ namespace PlantUtilities { // now check inside s/m to see if there are problems // loop across branch outlet nodes and check mass continuity - NumSplitterOutlets = PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.TotalOutletNodes; + NumSplitterOutlets = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.TotalOutletNodes; SumOutletFlow = 0.0; // SumInletFlow = 0.0; for (OutletNum = 1; OutletNum <= NumSplitterOutlets; ++OutletNum) { - BranchNum = PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.BranchNumOut(OutletNum); - LastNodeOnBranch = PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumOut; + BranchNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.BranchNumOut(OutletNum); + LastNodeOnBranch = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Branch(BranchNum).NodeNumOut; SumOutletFlow += Node(LastNodeOnBranch).MassFlowRate; // FirstNodeOnBranch= PlantLoop(LoopNum)%LoopSide(LoopSideNum)%Branch(BranchNum)%NodeNumIn // SumInletFlow = SumInletFlow + Node(FirstNodeOnBranch)%MassFlowRate } AbsDifference = std::abs(Node(SplitterInletNode).MassFlowRate - SumOutletFlow); if (AbsDifference > CriteriaDelta_MassFlowRate) { - if (PlantLoop(LoopNum).MFErrIndex2 == 0) { + if (state.dataPlnt->PlantLoop(LoopNum).MFErrIndex2 == 0) { ShowSevereMessage(state, "Plant flows do not resolve -- splitter inlet flow does not match branch outlet flows"); ShowContinueErrorTimeStamp(state, ""); - ShowContinueError(state, "PlantLoop name= " + PlantLoop(LoopNum).Name); - ShowContinueError(state, "Plant Connector:Mixer name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Name); + ShowContinueError(state, "PlantLoop name= " + state.dataPlnt->PlantLoop(LoopNum).Name); + ShowContinueError(state, "Plant Connector:Mixer name= " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Mixer.Name); ShowContinueError(state, format("Sum of Branch outlet mass flow rates= {:.6R} {{kg/s}}", SumOutletFlow)); - ShowContinueError(state, "Plant Connector:Splitter name= " + PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.Name); + ShowContinueError(state, "Plant Connector:Splitter name= " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Splitter.Name); ShowContinueError(state, format("Splitter inlet mass flow rate= {:.6R} {{kg/s}}", Node(SplitterInletNode).MassFlowRate)); ShowContinueError(state, format("Difference in two mass flow rates= {:.6R} {{kg/s}}", AbsDifference)); } - ShowRecurringSevereErrorAtEnd(state, "Plant Flows (Loop=" + PlantLoop(LoopNum).Name + + ShowRecurringSevereErrorAtEnd(state, "Plant Flows (Loop=" + state.dataPlnt->PlantLoop(LoopNum).Name + ") splitter inlet flow does not match branch outlet flows", - PlantLoop(LoopNum).MFErrIndex2, + state.dataPlnt->PlantLoop(LoopNum).MFErrIndex2, AbsDifference, AbsDifference, _, @@ -743,7 +741,6 @@ namespace PlantUtilities { using DataLoopNode::Node; using DataLoopNode::NodeID; using DataPlant::DemandSide; - using DataPlant::PlantLoop; using DataPlant::SupplySide; // Locals @@ -775,28 +772,28 @@ namespace PlantUtilities { Real64 LoopSupplySideDispatchedCapacity; makefatalerror = false; - if (Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp > (PlantLoop(LoopNum).MaxTemp + OverShootOffset)) { + if (Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp > (state.dataPlnt->PlantLoop(LoopNum).MaxTemp + OverShootOffset)) { // first stage, throw recurring warning that plant loop is getting out of control - ShowRecurringWarningErrorAtEnd(state, "Plant loop exceeding upper temperature limit, PlantLoop=\"" + PlantLoop(LoopNum).Name + "\"", - PlantLoop(LoopNum).MaxTempErrIndex, - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp); + ShowRecurringWarningErrorAtEnd(state, "Plant loop exceeding upper temperature limit, PlantLoop=\"" + state.dataPlnt->PlantLoop(LoopNum).Name + "\"", + state.dataPlnt->PlantLoop(LoopNum).MaxTempErrIndex, + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp); - if (Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp > (PlantLoop(LoopNum).MaxTemp + FatalOverShootOffset)) { + if (Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp > (state.dataPlnt->PlantLoop(LoopNum).MaxTemp + FatalOverShootOffset)) { hotcold = "hot"; makefatalerror = true; } } - if (Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp < (PlantLoop(LoopNum).MinTemp - UnderShootOffset)) { + if (Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp < (state.dataPlnt->PlantLoop(LoopNum).MinTemp - UnderShootOffset)) { // first stage, throw recurring warning that plant loop is getting out of control - ShowRecurringWarningErrorAtEnd(state, "Plant loop falling below lower temperature limit, PlantLoop=\"" + PlantLoop(LoopNum).Name + "\"", - PlantLoop(LoopNum).MinTempErrIndex, + ShowRecurringWarningErrorAtEnd(state, "Plant loop falling below lower temperature limit, PlantLoop=\"" + state.dataPlnt->PlantLoop(LoopNum).Name + "\"", + state.dataPlnt->PlantLoop(LoopNum).MinTempErrIndex, _, - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp); + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp); - if (Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp < (PlantLoop(LoopNum).MinTemp - FatalUnderShootOffset)) { + if (Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp < (state.dataPlnt->PlantLoop(LoopNum).MinTemp - FatalUnderShootOffset)) { hotcold = "cold"; makefatalerror = true; } @@ -812,25 +809,25 @@ namespace PlantUtilities { } else { DemandSupply = "Unknown"; } - ShowContinueError(state, "PlantLoop Name (" + DemandSupply + "Side)= " + PlantLoop(LoopNum).Name); + ShowContinueError(state, "PlantLoop Name (" + DemandSupply + "Side)= " + state.dataPlnt->PlantLoop(LoopNum).Name); ShowContinueError(state, - format("PlantLoop Setpoint Temperature={:.1R} {{C}}", Node(PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPoint)); - if (PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt) { + format("PlantLoop Setpoint Temperature={:.1R} {{C}}", Node(state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum).TempSetPoint)); + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).InletNodeSetPt) { ShowContinueError(state, "PlantLoop Inlet Node (SupplySide) has a Setpoint."); } else { ShowContinueError(state, "PlantLoop Inlet Node (SupplySide) does not have a Setpoint."); } - if (PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).InletNodeSetPt) { ShowContinueError(state, "PlantLoop Inlet Node (DemandSide) has a Setpoint."); } else { ShowContinueError(state, "PlantLoop Inlet Node (DemandSide) does not have a Setpoint."); } - if (PlantLoop(LoopNum).LoopSide(SupplySide).OutletNodeSetPt) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).OutletNodeSetPt) { ShowContinueError(state, "PlantLoop Outlet Node (SupplySide) has a Setpoint."); } else { ShowContinueError(state, "PlantLoop Outlet Node (SupplySide) does not have a Setpoint."); } - if (PlantLoop(LoopNum).LoopSide(DemandSide).OutletNodeSetPt) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).OutletNodeSetPt) { ShowContinueError(state, "PlantLoop Outlet Node (DemandSide) has a Setpoint."); } else { ShowContinueError(state, "PlantLoop Outlet Node (DemandSide) does not have a Setpoint."); @@ -838,38 +835,38 @@ namespace PlantUtilities { ShowContinueError(state, format("PlantLoop Outlet Node ({}Side) \"{}\" has temperature={:.1R} {{C}}", DemandSupply, - NodeID(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut), - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp)); + NodeID(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut), + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).Temp)); ShowContinueError(state, format("PlantLoop Inlet Node ({}Side) \"{}\" has temperature={:.1R} {{C}}", DemandSupply, - NodeID(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn), - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn).Temp)); - ShowContinueError(state, format("PlantLoop Minimum Temperature={:.1R} {{C}}", PlantLoop(LoopNum).MinTemp)); - ShowContinueError(state, format("PlantLoop Maximum Temperature={:.1R} {{C}}", PlantLoop(LoopNum).MaxTemp)); + NodeID(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn), + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn).Temp)); + ShowContinueError(state, format("PlantLoop Minimum Temperature={:.1R} {{C}}", state.dataPlnt->PlantLoop(LoopNum).MinTemp)); + ShowContinueError(state, format("PlantLoop Maximum Temperature={:.1R} {{C}}", state.dataPlnt->PlantLoop(LoopNum).MaxTemp)); ShowContinueError(state, - format("PlantLoop Flow Request (SupplySide)={:.1R} {{kg/s}}", PlantLoop(LoopNum).LoopSide(SupplySide).FlowRequest)); + format("PlantLoop Flow Request (SupplySide)={:.1R} {{kg/s}}", state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).FlowRequest)); ShowContinueError(state, - format("PlantLoop Flow Request (DemandSide)={:.1R} {{kg/s}}", PlantLoop(LoopNum).LoopSide(DemandSide).FlowRequest)); + format("PlantLoop Flow Request (DemandSide)={:.1R} {{kg/s}}", state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).FlowRequest)); ShowContinueError(state, format("PlantLoop Node ({}Side) \"{}\" has mass flow rate ={:.1R} {{kg/s}}", DemandSupply, - NodeID(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut), - Node(PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).MassFlowRate)); - ShowContinueError(state, format("PlantLoop PumpHeat (SupplySide)={:.1R} {{W}}", PlantLoop(LoopNum).LoopSide(SupplySide).TotalPumpHeat)); - ShowContinueError(state, format("PlantLoop PumpHeat (DemandSide)={:.1R} {{W}}", PlantLoop(LoopNum).LoopSide(DemandSide).TotalPumpHeat)); - ShowContinueError(state, format("PlantLoop Cooling Demand={:.1R} {{W}}", PlantLoop(LoopNum).CoolingDemand)); - ShowContinueError(state, format("PlantLoop Heating Demand={:.1R} {{W}}", PlantLoop(LoopNum).HeatingDemand)); - ShowContinueError(state, format("PlantLoop Demand not Dispatched={:.1R} {{W}}", PlantLoop(LoopNum).DemandNotDispatched)); - ShowContinueError(state, format("PlantLoop Unmet Demand={:.1R} {{W}}", PlantLoop(LoopNum).UnmetDemand)); + NodeID(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut), + Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumOut).MassFlowRate)); + ShowContinueError(state, format("PlantLoop PumpHeat (SupplySide)={:.1R} {{W}}", state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).TotalPumpHeat)); + ShowContinueError(state, format("PlantLoop PumpHeat (DemandSide)={:.1R} {{W}}", state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TotalPumpHeat)); + ShowContinueError(state, format("PlantLoop Cooling Demand={:.1R} {{W}}", state.dataPlnt->PlantLoop(LoopNum).CoolingDemand)); + ShowContinueError(state, format("PlantLoop Heating Demand={:.1R} {{W}}", state.dataPlnt->PlantLoop(LoopNum).HeatingDemand)); + ShowContinueError(state, format("PlantLoop Demand not Dispatched={:.1R} {{W}}", state.dataPlnt->PlantLoop(LoopNum).DemandNotDispatched)); + ShowContinueError(state, format("PlantLoop Unmet Demand={:.1R} {{W}}", state.dataPlnt->PlantLoop(LoopNum).UnmetDemand)); LoopCapacity = 0.0; DispatchedCapacity = 0.0; for (LSN = DemandSide; LSN <= SupplySide; ++LSN) { - for (BrN = 1; BrN <= PlantLoop(LoopNum).LoopSide(LSN).TotalBranches; ++BrN) { - for (CpN = 1; CpN <= PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).TotalComponents; ++CpN) { - LoopCapacity += PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).Comp(CpN).MaxLoad; - DispatchedCapacity += std::abs(PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).Comp(CpN).MyLoad); + for (BrN = 1; BrN <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LSN).TotalBranches; ++BrN) { + for (CpN = 1; CpN <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).TotalComponents; ++CpN) { + LoopCapacity += state.dataPlnt->PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).Comp(CpN).MaxLoad; + DispatchedCapacity += std::abs(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).Comp(CpN).MyLoad); } } if (LSN == DemandSide) { @@ -883,7 +880,7 @@ namespace PlantUtilities { ShowContinueError(state, format("PlantLoop Capacity={:.1R} {{W}}", LoopCapacity)); ShowContinueError(state, format("PlantLoop Capacity (SupplySide)={:.1R} {{W}}", LoopSupplySideCapacity)); ShowContinueError(state, format("PlantLoop Capacity (DemandSide)={:.1R} {{W}}", LoopDemandSideCapacity)); - ShowContinueError(state, "PlantLoop Operation Scheme=" + PlantLoop(LoopNum).OperationScheme); + ShowContinueError(state, "PlantLoop Operation Scheme=" + state.dataPlnt->PlantLoop(LoopNum).OperationScheme); ShowContinueError(state, format("PlantLoop Operation Dispatched Load = {:.1R} {{W}}", DispatchedCapacity)); ShowContinueError(state, format("PlantLoop Operation Dispatched Load (SupplySide)= {:.1R} {{W}}", LoopSupplySideDispatchedCapacity)); ShowContinueError(state, format("PlantLoop Operation Dispatched Load (DemandSide)= {:.1R} {{W}}", LoopDemandSideDispatchedCapacity)); @@ -900,7 +897,7 @@ namespace PlantUtilities { } } - void SetAllFlowLocks(DataPlant::iFlowLock const Value) + void SetAllFlowLocks(EnergyPlusData &state, DataPlant::iFlowLock const Value) { // SUBROUTINE INFORMATION: @@ -915,13 +912,13 @@ namespace PlantUtilities { // in order to provide the same behavior through phase I of the demand side rewrite // Eventually this routine may be employed again to quickly initialize all loops once phase III is complete for (int LoopNum = 1; LoopNum <= DataPlant::TotNumLoops; ++LoopNum) { - for (int LoopSideNum = 1; LoopSideNum <= isize(DataPlant::PlantLoop(LoopNum).LoopSide); ++LoopSideNum) { - DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = Value; + for (int LoopSideNum = 1; LoopSideNum <= isize(state.dataPlnt->PlantLoop(LoopNum).LoopSide); ++LoopSideNum) { + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = Value; } } } - void ResetAllPlantInterConnectFlags() + void ResetAllPlantInterConnectFlags(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -934,7 +931,7 @@ namespace PlantUtilities { // This subroutine will reset all interconnected (air, zone, etc.) sim flags for both loopsides of all loops for (int LoopNum = 1; LoopNum <= DataPlant::TotNumLoops; ++LoopNum) { - for (auto &e : DataPlant::PlantLoop(LoopNum).LoopSide) { + for (auto &e : state.dataPlnt->PlantLoop(LoopNum).LoopSide) { e.SimAirLoopsNeeded = false; e.SimZoneEquipNeeded = false; e.SimNonZoneEquipNeeded = false; @@ -943,7 +940,8 @@ namespace PlantUtilities { } } - void PullCompInterconnectTrigger(int const LoopNum, // component's loop index + void PullCompInterconnectTrigger(EnergyPlusData &state, + int const LoopNum, // component's loop index int const LoopSide, // component's loop side number int const BranchNum, // Component's branch number int const CompNum, // Component's comp number @@ -983,7 +981,6 @@ namespace PlantUtilities { using DataPlant::CriteriaDelta_HeatTransferRate; using DataPlant::CriteriaDelta_MassFlowRate; using DataPlant::CriteriaDelta_Temperature; - using DataPlant::PlantLoop; CriteriaData CurCriteria; // for convenience @@ -1001,7 +998,7 @@ namespace PlantUtilities { // Since this was the first pass, it is safe to assume something has changed! // Therefore we'll set the sim flag to true - PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; + state.dataPlnt->PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; // Make sure we return the proper value of index UniqueCriteriaCheckIndex = CurrentNumChecksStored; @@ -1025,17 +1022,17 @@ namespace PlantUtilities { auto const SELECT_CASE_var(CriteriaType); if (SELECT_CASE_var == DataPlant::iCriteriaType::MassFlowRate) { if (std::abs(CurCriteria.ThisCriteriaCheckValue - CriteriaValue) > CriteriaDelta_MassFlowRate) { - PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; + state.dataPlnt->PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; } } else if (SELECT_CASE_var == DataPlant::iCriteriaType::Temperature) { if (std::abs(CurCriteria.ThisCriteriaCheckValue - CriteriaValue) > CriteriaDelta_Temperature) { - PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; + state.dataPlnt->PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; } } else if (SELECT_CASE_var == DataPlant::iCriteriaType::HeatTransferRate) { if (std::abs(CurCriteria.ThisCriteriaCheckValue - CriteriaValue) > CriteriaDelta_HeatTransferRate) { - PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; + state.dataPlnt->PlantLoop(ConnectedLoopNum).LoopSide(ConnectedLoopSide).SimLoopSideNeeded = true; } } else { @@ -1078,7 +1075,6 @@ namespace PlantUtilities { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; // SUBROUTINE PARAMETER DEFINITIONS: @@ -1113,26 +1109,26 @@ namespace PlantUtilities { // use current mass flow rate and inlet temp from Node and recalculate outlet temp if (Node(InletNodeNum).MassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // update node outlet conditions - Cp = GetSpecificHeatGlycol(state, PlantLoop(LoopNum).FluidName, ModelInletTemp, PlantLoop(LoopNum).FluidIndex, RoutineName); + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, ModelInletTemp, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); Node(OutletNodeNum).Temp = Node(InletNodeNum).Temp + ModelCondenserHeatRate / (Node(InletNodeNum).MassFlowRate * Cp); } // set sim flag for this loop - PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = true; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = true; // set sim flag on connected loops to true because this side changed - if (PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected > 0) { - for (ConnectLoopNum = 1; ConnectLoopNum <= PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected; ++ConnectLoopNum) { - if (PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopDemandsOnRemote) { - OtherLoopNum = PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopNum; - OtherLoopSide = PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopSideNum; - PlantLoop(OtherLoopNum).LoopSide(OtherLoopSide).SimLoopSideNeeded = true; + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected > 0) { + for (ConnectLoopNum = 1; ConnectLoopNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected; ++ConnectLoopNum) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopDemandsOnRemote) { + OtherLoopNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopNum; + OtherLoopSide = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopSideNum; + state.dataPlnt->PlantLoop(OtherLoopNum).LoopSide(OtherLoopSide).SimLoopSideNeeded = true; } } } } else { // nothing changed so turn off sim flag - PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = false; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = false; } } @@ -1165,7 +1161,6 @@ namespace PlantUtilities { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; // SUBROUTINE PARAMETER DEFINITIONS: @@ -1199,30 +1194,31 @@ namespace PlantUtilities { // use current mass flow rate and inlet temp from Node and recalculate outlet temp if (Node(InletNodeNum).MassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // update node outlet conditions - Cp = GetSpecificHeatGlycol(state, PlantLoop(LoopNum).FluidName, ModelInletTemp, PlantLoop(LoopNum).FluidIndex, RoutineName); + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(LoopNum).FluidName, ModelInletTemp, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName); Node(OutletNodeNum).Temp = Node(InletNodeNum).Temp + ModelRecoveryHeatRate / (Node(InletNodeNum).MassFlowRate * Cp); } // set sim flag for this loop - PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = true; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = true; // set sim flag on connected loops to true because this side changed - if (PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected > 0) { - for (ConnectLoopNum = 1; ConnectLoopNum <= PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected; ++ConnectLoopNum) { - if (PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopDemandsOnRemote) { - OtherLoopNum = PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopNum; - OtherLoopSide = PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopSideNum; - PlantLoop(OtherLoopNum).LoopSide(OtherLoopSide).SimLoopSideNeeded = true; + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected > 0) { + for (ConnectLoopNum = 1; ConnectLoopNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected; ++ConnectLoopNum) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopDemandsOnRemote) { + OtherLoopNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopNum; + OtherLoopSide = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopSideNum; + state.dataPlnt->PlantLoop(OtherLoopNum).LoopSide(OtherLoopSide).SimLoopSideNeeded = true; } } } } else { // nothing changed so turn off sim flag - PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = false; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = false; } } - void UpdateAbsorberChillerComponentGeneratorSide(int const LoopNum, // component's loop index + void UpdateAbsorberChillerComponentGeneratorSide(EnergyPlusData &state, + int const LoopNum, // component's loop index int const LoopSide, // component's loop side number [[maybe_unused]] int const TypeOfNum, // Component's type index int const InletNodeNum, // Component's inlet node pointer @@ -1249,7 +1245,6 @@ namespace PlantUtilities { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::PlantLoop; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: bool DidAnythingChange(false); // set to true if conditions changed @@ -1280,25 +1275,26 @@ namespace PlantUtilities { if (DidAnythingChange || FirstHVACIteration) { // set sim flag for this loop - PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = true; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = true; // set sim flag on connected loops to true because this side changed - if (PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected > 0) { - for (ConnectLoopNum = 1; ConnectLoopNum <= PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected; ++ConnectLoopNum) { - if (PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopDemandsOnRemote) { - OtherLoopNum = PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopNum; - OtherLoopSide = PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopSideNum; - PlantLoop(OtherLoopNum).LoopSide(OtherLoopSide).SimLoopSideNeeded = true; + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected > 0) { + for (ConnectLoopNum = 1; ConnectLoopNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).TotalConnected; ++ConnectLoopNum) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopDemandsOnRemote) { + OtherLoopNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopNum; + OtherLoopSide = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Connected(ConnectLoopNum).LoopSideNum; + state.dataPlnt->PlantLoop(OtherLoopNum).LoopSide(OtherLoopSide).SimLoopSideNeeded = true; } } } } else { // nothing changed so turn off sim flag - PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = false; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = false; } } - void InterConnectTwoPlantLoopSides(int const Loop1Num, + void InterConnectTwoPlantLoopSides(EnergyPlusData &state, + int const Loop1Num, int const Loop1LoopSideNum, int const Loop2Num, int const Loop2LoopSideNum, @@ -1317,7 +1313,6 @@ namespace PlantUtilities { // Using/Aliasing using DataPlant::ConnectedLoopData; - using DataPlant::PlantLoop; if (Loop1Num == 0 || Loop1LoopSideNum == 0 || Loop2Num == 0 || Loop2LoopSideNum == 0) { return; // Associated ScanPlantLoopsForObject couldn't find the component in the the plant loop structure... @@ -1327,7 +1322,7 @@ namespace PlantUtilities { int TotalConnected; - auto &loop_side_1(PlantLoop(Loop1Num).LoopSide(Loop1LoopSideNum)); + auto &loop_side_1(state.dataPlnt->PlantLoop(Loop1Num).LoopSide(Loop1LoopSideNum)); auto &connected_1(loop_side_1.Connected); if (allocated(connected_1)) { TotalConnected = ++loop_side_1.TotalConnected; @@ -1341,7 +1336,7 @@ namespace PlantUtilities { connected_1(TotalConnected).ConnectorTypeOf_Num = PlantComponentTypeOfNum; connected_1(TotalConnected).LoopDemandsOnRemote = Loop1DemandsOnLoop2; - auto &loop_side_2(PlantLoop(Loop2Num).LoopSide(Loop2LoopSideNum)); + auto &loop_side_2(state.dataPlnt->PlantLoop(Loop2Num).LoopSide(Loop2LoopSideNum)); auto &connected_2(loop_side_2.Connected); if (allocated(connected_2)) { TotalConnected = ++loop_side_2.TotalConnected; @@ -1502,7 +1497,8 @@ namespace PlantUtilities { } } - void SafeCopyPlantNode(int const InletNodeNum, + void SafeCopyPlantNode(EnergyPlusData &state, + int const InletNodeNum, int const OutletNodeNum, Optional_int_const LoopNum, [[maybe_unused]] Optional OutletTemp // set on outlet node if present and water. @@ -1525,7 +1521,6 @@ namespace PlantUtilities { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::PlantLoop; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Node(OutletNodeNum).FluidType = Node(InletNodeNum).FluidType; @@ -1548,7 +1543,7 @@ namespace PlantUtilities { // Only pass pressure if we aren't doing a pressure simulation if (present(LoopNum)) { - switch (PlantLoop(LoopNum).PressureSimType) { + switch (state.dataPlnt->PlantLoop(LoopNum).PressureSimType) { case DataPlant::iPressSimType::NoPressure: Node(OutletNodeNum).Press = Node(InletNodeNum).Press; default: @@ -1678,7 +1673,7 @@ namespace PlantUtilities { a(a.l()) = a_l; } - void LogPlantConvergencePoints(bool const FirstHVACIteration) + void LogPlantConvergencePoints(EnergyPlusData &state, bool const FirstHVACIteration) { // SUBROUTINE INFORMATION: @@ -1696,8 +1691,8 @@ namespace PlantUtilities { // Pick up the LoopSide inlet and outlet temp and flow rate // Store this in the history array of each node using EOSHIFT - for (int ThisLoopNum = 1; ThisLoopNum <= isize(DataPlant::PlantLoop); ++ThisLoopNum) { - auto &loop(DataPlant::PlantLoop(ThisLoopNum)); + for (int ThisLoopNum = 1; ThisLoopNum <= isize(state.dataPlnt->PlantLoop); ++ThisLoopNum) { + auto &loop(state.dataPlnt->PlantLoop(ThisLoopNum)); for (int ThisLoopSide = 1; ThisLoopSide <= isize(loop.LoopSide); ++ThisLoopSide) { auto &loop_side(loop.LoopSide(ThisLoopSide)); @@ -1780,7 +1775,7 @@ namespace PlantUtilities { } for (LoopCtr = StartingLoopNum; LoopCtr <= EndingLoopNum; ++LoopCtr) { - auto &this_loop(DataPlant::PlantLoop(LoopCtr)); + auto &this_loop(state.dataPlnt->PlantLoop(LoopCtr)); for (LoopSideCtr = 1; LoopSideCtr <= 2; ++LoopSideCtr) { auto &this_loop_side(this_loop.LoopSide(LoopSideCtr)); for (BranchCtr = 1; BranchCtr <= this_loop_side.TotalBranches; ++BranchCtr) { @@ -1831,7 +1826,7 @@ namespace PlantUtilities { AuditBranches(state, true, DataPlant::ccSimPlantEquipTypes(CompType), CompName); } else { ShowSevereError(state, "Plant Component " + DataPlant::ccSimPlantEquipTypes(CompType) + " called \"" + CompName + - "\" was not found on plant loop=\"" + DataPlant::PlantLoop(SingleLoopSearch).Name + "\"."); + "\" was not found on plant loop=\"" + state.dataPlnt->PlantLoop(SingleLoopSearch).Name + "\"."); } if (present(InletNodeNumber)) { if (FoundCompName) { @@ -1839,7 +1834,7 @@ namespace PlantUtilities { } } if (present(SingleLoopSearch)) { - ShowContinueError(state, "Look at Operation Scheme=\"" + DataPlant::PlantLoop(SingleLoopSearch).OperationScheme + "\"."); + ShowContinueError(state, "Look at Operation Scheme=\"" + state.dataPlnt->PlantLoop(SingleLoopSearch).OperationScheme + "\"."); ShowContinueError(state, "Look at Branches and Components on the Loop."); ShowBranchesOnLoop(state, SingleLoopSearch); } @@ -1894,7 +1889,7 @@ namespace PlantUtilities { FoundNode = false; for (LoopCtr = 1; LoopCtr <= DataPlant::TotNumLoops; ++LoopCtr) { - auto &this_loop(DataPlant::PlantLoop(LoopCtr)); + auto &this_loop(state.dataPlnt->PlantLoop(LoopCtr)); for (LoopSideCtr = 1; LoopSideCtr <= 2; ++LoopSideCtr) { auto &this_loop_side(this_loop.LoopSide(LoopSideCtr)); for (BranchCtr = 1; BranchCtr <= this_loop_side.TotalBranches; ++BranchCtr) { @@ -1937,7 +1932,7 @@ namespace PlantUtilities { } } - bool AnyPlantLoopSidesNeedSim() + bool AnyPlantLoopSidesNeedSim(EnergyPlusData &state) { // FUNCTION INFORMATION: @@ -1980,7 +1975,7 @@ namespace PlantUtilities { // Then check if there are any for (LoopCtr = 1; LoopCtr <= DataPlant::TotNumLoops; ++LoopCtr) { for (LoopSideCtr = 1; LoopSideCtr <= 2; ++LoopSideCtr) { - if (DataPlant::PlantLoop(LoopCtr).LoopSide(LoopSideCtr).SimLoopSideNeeded) { + if (state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).SimLoopSideNeeded) { AnyPlantLoopSidesNeedSim = true; return AnyPlantLoopSidesNeedSim; } @@ -1990,7 +1985,7 @@ namespace PlantUtilities { return AnyPlantLoopSidesNeedSim; } - void SetAllPlantSimFlagsToValue(bool const Value) + void SetAllPlantSimFlagsToValue(EnergyPlusData &state, bool const Value) { // SUBROUTINE INFORMATION: @@ -2011,7 +2006,7 @@ namespace PlantUtilities { // Loop over all loops for (LoopCtr = 1; LoopCtr <= DataPlant::TotNumLoops; ++LoopCtr) { - auto &this_loop(DataPlant::PlantLoop(LoopCtr)); + auto &this_loop(state.dataPlnt->PlantLoop(LoopCtr)); this_loop.LoopSide(DataPlant::DemandSide).SimLoopSideNeeded = Value; this_loop.LoopSide(DataPlant::SupplySide).SimLoopSideNeeded = Value; } @@ -2045,12 +2040,12 @@ namespace PlantUtilities { DemandSupply = "Unknown"; } ShowContinueError(state, DemandSupply + " Branches:"); - for (BrN = 1; BrN <= DataPlant::PlantLoop(LoopNum).LoopSide(LSN).TotalBranches; ++BrN) { - ShowContinueError(state, " " + DataPlant::PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).Name); + for (BrN = 1; BrN <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LSN).TotalBranches; ++BrN) { + ShowContinueError(state, " " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).Name); ShowContinueError(state, " Components on Branch:"); - for (CpN = 1; CpN <= DataPlant::PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).TotalComponents; ++CpN) { - ShowContinueError(state, " " + DataPlant::PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).Comp(CpN).TypeOf + ':' + - DataPlant::PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).Comp(CpN).Name); + for (CpN = 1; CpN <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).TotalComponents; ++CpN) { + ShowContinueError(state, " " + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).Comp(CpN).TypeOf + ':' + + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LSN).Branch(BrN).Comp(CpN).Name); } } } @@ -2116,11 +2111,11 @@ namespace PlantUtilities { if (MyPltLoopNum > 0) { if (NumPltSizInput > 0) { - MyPltSizNum = UtilityRoutines::FindItemInList(DataPlant::PlantLoop(MyPltLoopNum).Name, PlantSizData, &PlantSizingData::PlantLoopName); + MyPltSizNum = UtilityRoutines::FindItemInList(state.dataPlnt->PlantLoop(MyPltLoopNum).Name, PlantSizData, &PlantSizingData::PlantLoopName); } if (MyPltSizNum == 0) { if (PrintErrorFlag) { - ShowSevereError(state, "MyPlantSizingIndex: Could not find " + DataPlant::PlantLoop(MyPltLoopNum).Name + " in Sizing:Plant objects."); + ShowSevereError(state, "MyPlantSizingIndex: Could not find " + state.dataPlnt->PlantLoop(MyPltLoopNum).Name + " in Sizing:Plant objects."); ShowContinueError(state, "...reference Component Type=\"" + CompType + "\", Name=\"" + CompName + "\"."); } ErrorsFound = true; @@ -2135,7 +2130,7 @@ namespace PlantUtilities { return MyPltSizNum; } - bool verifyTwoNodeNumsOnSamePlantLoop(int const nodeIndexA, int const nodeIndexB) + bool verifyTwoNodeNumsOnSamePlantLoop(EnergyPlusData &state, int const nodeIndexA, int const nodeIndexB) { // this function simply searches across plant loops looking for node numbers // it returns true if the two nodes are found to be on the same loop @@ -2144,7 +2139,7 @@ namespace PlantUtilities { int matchedIndexA = 0; int matchedIndexB = 0; for (int loopNum = 1; loopNum <= DataPlant::TotNumLoops; loopNum++) { - for (auto &loopSide : DataPlant::PlantLoop(loopNum).LoopSide) { + for (auto &loopSide : state.dataPlnt->PlantLoop(loopNum).LoopSide) { for (auto &branch : loopSide.Branch) { for (auto &comp : branch.Comp) { if (comp.NodeNumIn == nodeIndexA || comp.NodeNumOut == nodeIndexA) { diff --git a/src/EnergyPlus/PlantUtilities.hh b/src/EnergyPlus/PlantUtilities.hh index 544c7461d95..3f1d78bcd24 100644 --- a/src/EnergyPlus/PlantUtilities.hh +++ b/src/EnergyPlus/PlantUtilities.hh @@ -94,20 +94,21 @@ namespace PlantUtilities { ); Real64 RegulateCondenserCompFlowReqOp( - int const LoopNum, int const LoopSideNum, int const BranchNum, int const CompNum, Real64 const TentativeFlowRequest); + EnergyPlusData &state, int const LoopNum, int const LoopSideNum, int const BranchNum, int const CompNum, Real64 const TentativeFlowRequest); - bool AnyPlantSplitterMixerLacksContinuity(); + bool AnyPlantSplitterMixerLacksContinuity(EnergyPlusData &state); void CheckPlantMixerSplitterConsistency(EnergyPlusData &state, int const LoopNum, int const LoopSideNum, bool const FirstHVACIteration); void CheckForRunawayPlantTemps(EnergyPlusData &state, int const LoopNum, int const LoopSideNum); - void SetAllFlowLocks(DataPlant::iFlowLock const Value); + void SetAllFlowLocks(EnergyPlusData &state, DataPlant::iFlowLock const Value); - void ResetAllPlantInterConnectFlags(); + void ResetAllPlantInterConnectFlags(EnergyPlusData &state); - void PullCompInterconnectTrigger(int const LoopNum, // component's loop index + void PullCompInterconnectTrigger(EnergyPlusData &state, + int const LoopNum, // component's loop index int const LoopSide, // component's loop side number int const BranchNum, // Component's branch number int const CompNum, // Component's comp number @@ -142,7 +143,8 @@ namespace PlantUtilities { Real64 const ModelMassFlowRate, // model's condenser water mass flow rate (kg/s) bool const FirstHVACIteration); - void UpdateAbsorberChillerComponentGeneratorSide(int const LoopNum, // component's loop index + void UpdateAbsorberChillerComponentGeneratorSide(EnergyPlusData &state, + int const LoopNum, // component's loop index int const LoopSide, // component's loop side number int const TypeOfNum, // Component's type index int const InletNodeNum, // Component's inlet node pointer @@ -152,7 +154,8 @@ namespace PlantUtilities { Real64 const ModelMassFlowRate, // model's generator mass flow rate (kg/s) bool const FirstHVACIteration); - void InterConnectTwoPlantLoopSides(int const Loop1Num, + void InterConnectTwoPlantLoopSides(EnergyPlusData &state, + int const Loop1Num, int const Loop1LoopSideNum, int const Loop2Num, int const Loop2LoopSideNum, @@ -165,7 +168,8 @@ namespace PlantUtilities { Real64 const DesPlantFlow // the component's design fluid volume flow rate [m3/s] ); - void SafeCopyPlantNode(int const InletNodeNum, + void SafeCopyPlantNode(EnergyPlusData &state, + int const InletNodeNum, int const OutletNodeNum, Optional_int_const LoopNum = _, Optional OutletTemp = _ // set on outlet node if present and water. @@ -179,7 +183,7 @@ namespace PlantUtilities { bool IntegerIsWithinTwoValues(int const ValueToCheck, int const LowerBound, int const UpperBound); - void LogPlantConvergencePoints(bool const FirstHVACIteration); + void LogPlantConvergencePoints(EnergyPlusData &state, bool const FirstHVACIteration); void ScanPlantLoopsForObject(EnergyPlusData &state, std::string const &CompName, @@ -203,9 +207,9 @@ namespace PlantUtilities { int &BranchNum, Optional_int CompNum = _); - bool AnyPlantLoopSidesNeedSim(); + bool AnyPlantLoopSidesNeedSim(EnergyPlusData &state); - void SetAllPlantSimFlagsToValue(bool const Value); + void SetAllPlantSimFlagsToValue(EnergyPlusData &state, bool const Value); void ShowBranchesOnLoop(EnergyPlusData &state, int const LoopNum); // Loop number of loop @@ -217,7 +221,7 @@ namespace PlantUtilities { Optional_bool_const SupressErrors = _ // used for WSHP's where condenser loop may not be on a plant loop ); - bool verifyTwoNodeNumsOnSamePlantLoop(int const nodeIndexA, int const nodeIndexB); + bool verifyTwoNodeNumsOnSamePlantLoop(EnergyPlusData &state, int const nodeIndexA, int const nodeIndexB); } // namespace PlantUtilities diff --git a/src/EnergyPlus/PlantValves.cc b/src/EnergyPlus/PlantValves.cc index a39828a73fc..c6c6b21eb32 100644 --- a/src/EnergyPlus/PlantValves.cc +++ b/src/EnergyPlus/PlantValves.cc @@ -111,7 +111,7 @@ namespace PlantValves { { this->initialize(state); this->calculate(state); - PlantUtilities::SafeCopyPlantNode(this->PltInletNodeNum, this->PltOutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->PltInletNodeNum, this->PltOutletNodeNum); Real64 mdot = this->MixedMassFlowRate * this->FlowDivFract; if (this->LoopNum > 0) { PlantUtilities::SetComponentFlowRate(state, @@ -280,7 +280,7 @@ namespace PlantValves { IsBranchActive = false; // . A) find indexes of PlantLoop, Half loop, and Branch by searching CompData - for (auto & thisPlantLoop : DataPlant::PlantLoop) { + for (auto & thisPlantLoop : state.dataPlnt->PlantLoop) { for (auto & thisLoopSide : thisPlantLoop.LoopSide) { int branchCtr = 0; for (auto & thisBranch : thisLoopSide.Branch) { @@ -447,7 +447,7 @@ namespace PlantValves { if (state.dataGlobal->KickOffSimulation) return; - if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { + if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Unlocked) { Tin = this->InletTemp; Tset = this->SetPointTemp; Ts2 = this->Stream2SourceTemp; @@ -461,7 +461,7 @@ namespace PlantValves { this->FlowDivFract = 1.0; } } - } else if (DataPlant::PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { // don't recalc diversion, just reuse current flows + } else if (state.dataPlnt->PlantLoop(this->LoopNum).LoopSide(this->LoopSideNum).FlowLock == DataPlant::iFlowLock::Locked) { // don't recalc diversion, just reuse current flows if (this->MixedMassFlowRate > 0.0) { this->FlowDivFract = Node(this->PltOutletNodeNum).MassFlowRate / this->MixedMassFlowRate; } else { diff --git a/src/EnergyPlus/PondGroundHeatExchanger.cc b/src/EnergyPlus/PondGroundHeatExchanger.cc index 35fc1763048..8cb792029fa 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -425,14 +425,14 @@ namespace PondGroundHeatExchanger { ShowFatalError(state, "InitPondGroundHeatExchanger: Program terminated due to previous condition(s)."); } Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataPrecisionGlobals::constant_zero, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataPrecisionGlobals::constant_zero, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->DesignMassFlowRate = DataGlobalConstants::Pi / 4.0 * pow_2(this->TubeInDiameter) * DesignVelocity * rho * this->NumCircuits; this->DesignCapacity = this->DesignMassFlowRate * Cp * 10.0; // assume 10C delta T? @@ -461,7 +461,7 @@ namespace PondGroundHeatExchanger { this->PondTemp = this->BulkTemperature; // Hypothetical design flow rate - Real64 DesignFlow = PlantUtilities::RegulateCondenserCompFlowReqOp( + Real64 DesignFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(state, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, this->DesignMassFlowRate); PlantUtilities::SetComponentFlowRate(state, @@ -608,7 +608,7 @@ namespace PondGroundHeatExchanger { // specific heat from fluid prop routines Real64 SpecHeat = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, max(this->InletTemp, 0.0), DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, max(this->InletTemp, 0.0), state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // heat transfer with fluid - heat exchanger analogy. // convective flux @@ -748,11 +748,11 @@ namespace PondGroundHeatExchanger { // evaluate properties at pipe fluid temperature for given pipe fluid Real64 SpecificHeat = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, InsideTemperature, DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, InsideTemperature, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Conductivity = FluidProperties::GetConductivityGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, InsideTemperature, DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, InsideTemperature, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); Real64 Viscosity = FluidProperties::GetViscosityGlycol( - state, DataPlant::PlantLoop(this->LoopNum).FluidName, InsideTemperature, DataPlant::PlantLoop(this->LoopNum).FluidIndex, CalledFrom); + state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, InsideTemperature, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) Real64 ReynoldsNum = 4.0 * massFlowRate / (DataGlobalConstants::Pi * Viscosity * this->TubeInDiameter * this->NumCircuits); @@ -865,11 +865,11 @@ namespace PondGroundHeatExchanger { // Calculate the water side outlet conditions and set the // appropriate conditions on the correct HVAC node. Real64 CpFluid = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(this->LoopNum).FluidName, + state.dataPlnt->PlantLoop(this->LoopNum).FluidName, this->InletTemp, - DataPlant::PlantLoop(this->LoopNum).FluidIndex, RoutineName); + state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); - PlantUtilities::SafeCopyPlantNode(InletNodeNum, OutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, InletNodeNum, OutletNodeNum); // update outlet temp if ((CpFluid > 0.0) && (this->MassFlowRate > 0.0)) { diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index 24ef6449522..f8eea3b6e9f 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -765,7 +765,6 @@ namespace PoweredInductionUnits { // Uses the status flags to trigger initializations. // Using/Aliasing - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterSimpleHeating; using DataZoneEquipment::CheckZoneEquipmentList; @@ -803,7 +802,7 @@ namespace PoweredInductionUnits { MyOneTimeFlag = false; } - if (MyPlantScanFlag(PIUNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(PIUNum) && allocated(state.dataPlnt->PlantLoop)) { if ((PIU(PIUNum).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) || (PIU(PIUNum).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating)) { errFlag = false; ScanPlantLoopsForObject(state, @@ -822,7 +821,7 @@ namespace PoweredInductionUnits { if (errFlag) { ShowFatalError(state, "InitPIU: Program terminated due to previous condition(s)."); } - PIU(PIUNum).HotCoilOutNodeNum = PlantLoop(PIU(PIUNum).HWLoopNum) + PIU(PIUNum).HotCoilOutNodeNum = state.dataPlnt->PlantLoop(PIU(PIUNum).HWLoopNum) .LoopSide(PIU(PIUNum).HWLoopSide) .Branch(PIU(PIUNum).HWBranchNum) .Comp(PIU(PIUNum).HWCompNum) @@ -853,9 +852,9 @@ namespace PoweredInductionUnits { if (HotConNode > 0) { // plant upgrade note? why no separate handling of steam coil? add it ? rho = GetDensityGlycol(state, - PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(PIU(PIUNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(PIU(PIUNum).HWLoopNum).FluidIndex, RoutineName); PIU(PIUNum).MaxHotWaterFlow = rho * PIU(PIUNum).MaxVolHotWaterFlow; @@ -993,8 +992,6 @@ namespace PoweredInductionUnits { using WaterCoils::GetCoilWaterInletNode; using WaterCoils::GetCoilWaterOutletNode; using WaterCoils::SetCoilDesFlow; - // USE BranchInputManager, ONLY: MyPlantSizingIndex - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -1326,14 +1323,14 @@ namespace PoweredInductionUnits { DesCoilLoad = PsyCpAirFnW(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); rho = GetDensityGlycol(state, - PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(PIU(PIUNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(PIU(PIUNum).HWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(state, - PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, + state.dataPlnt->PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(PIU(PIUNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(PIU(PIUNum).HWLoopNum).FluidIndex, RoutineName); MaxVolHotWaterFlowDes = DesCoilLoad / (PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); @@ -1519,7 +1516,6 @@ namespace PoweredInductionUnits { // Using/Aliasing using namespace DataZoneEnergyDemands; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using HeatingCoils::SimulateHeatingCoilComponents; diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index 4d19a80ef21..7fc888aab38 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -198,11 +198,6 @@ namespace Pumps { // result of this subroutine is that the pump has been simulated for // the necessary loop and the PumpRunning has been correctly set. - // Using/Aliasing - using DataPlant::PlantLoop; - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int PumpNum; // Pump index within PumpEquip derived type // Get input from IDF one time @@ -246,7 +241,7 @@ namespace Pumps { InitializePumps(state, PumpNum); // If all we need is to set outlet min/max avail, then just do it and get out. Also, we only do min/max avail on flow query - if (PlantLoop(LoopNum).LoopSide(PumpEquip(PumpNum).LoopSideNum).FlowLock == DataPlant::iFlowLock::PumpQuery) { + if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(PumpEquip(PumpNum).LoopSideNum).FlowLock == DataPlant::iFlowLock::PumpQuery) { SetupPumpMinMaxFlows(state, LoopNum, PumpNum); return; } @@ -1284,7 +1279,6 @@ namespace Pumps { // Using/Aliasing using DataPlant::LoopFlowStatus_NeedyAndTurnsLoopOn; - using DataPlant::PlantLoop; using DataPlant::PlantReSizingCompleted; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; @@ -1341,13 +1335,13 @@ namespace Pumps { brnum = PumpEquip(PumpNum).BranchNum; cpnum = PumpEquip(PumpNum).CompNum; if (plloopnum > 0 && lsnum > 0 && brnum > 0 && cpnum > 0) { - if (PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumIn != InletNode || - PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumOut != OutletNode) { + if (state.dataPlnt->PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumIn != InletNode || + state.dataPlnt->PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumOut != OutletNode) { ShowSevereError(state, "InitializePumps: " + cPumpTypes(PumpEquip(PumpNum).PumpType) + "=\"" + PumpEquip(PumpNum).Name + "\", non-matching nodes."); - ShowContinueError(state, "...in Branch=\"" + PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Name + "\", Component referenced with:"); - ShowContinueError(state, "...Inlet Node=\"" + NodeID(PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumIn)); - ShowContinueError(state, "...Outlet Node=\"" + NodeID(PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumOut)); + ShowContinueError(state, "...in Branch=\"" + state.dataPlnt->PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Name + "\", Component referenced with:"); + ShowContinueError(state, "...Inlet Node=\"" + NodeID(state.dataPlnt->PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumIn)); + ShowContinueError(state, "...Outlet Node=\"" + NodeID(state.dataPlnt->PlantLoop(plloopnum).LoopSide(lsnum).Branch(brnum).Comp(cpnum).NodeNumOut)); ShowContinueError(state, "...Pump Inlet Node=\"" + NodeID(InletNode)); ShowContinueError(state, "...Pump Outlet Node=\"" + NodeID(OutletNode)); errFlag = true; @@ -1361,7 +1355,7 @@ namespace Pumps { if (errFlag) { ShowFatalError(state, "InitializePumps: Program terminated due to previous condition(s)."); } - PlantLoop(PumpEquip(PumpNum).LoopNum) + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum) .LoopSide(PumpEquip(PumpNum).LoopSideNum) .Branch(PumpEquip(PumpNum).BranchNum) .Comp(PumpEquip(PumpNum).CompNum) @@ -1432,7 +1426,7 @@ namespace Pumps { if (PumpEquip(PumpNum).PumpControl == PumpControlType::Continuous) { // reset flow priority appropriately (default was for Intermittent) - PlantLoop(PumpEquip(PumpNum).LoopNum) + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum) .LoopSide(PumpEquip(PumpNum).LoopSideNum) .Branch(PumpEquip(PumpNum).BranchNum) .Comp(PumpEquip(PumpNum).CompNum) @@ -1480,9 +1474,9 @@ namespace Pumps { } else { TempWaterDensity = GetDensityGlycol(state, - PlantLoop(PumpEquip(PumpNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - PlantLoop(PumpEquip(PumpNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).FluidIndex, RoutineName); mdotMax = PumpEquip(PumpNum).NomVolFlowRate * TempWaterDensity; // mdotMin = PumpEquip(PumpNum)%MinVolFlowRate * TempWaterDensity @@ -1560,7 +1554,6 @@ namespace Pumps { // Using/Aliasing using DataPlant::PlantAvailMgr; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using PlantPressureSystem::ResolveLoopFlowVsPressure; using PlantUtilities::BoundValueToWithinTwoValues; @@ -1641,9 +1634,9 @@ namespace Pumps { // Convert the RPM to rot/sec for calculation routine PumpEquip(PumpNum).RotSpeed = PumpSchedRPM / 60.0; // Resolve the new mass flow rate based on current pressure characteristics - if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { + if (state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { PumpMassFlowRate = ResolveLoopFlowVsPressure(state, PumpEquip(PumpNum).LoopNum, @@ -1660,9 +1653,9 @@ namespace Pumps { } else if (SELECT_CASE_var1 == ControlTypeVFD::VFDAutomatic) { - if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { + if (state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { GetRequiredMassFlowRate(state, LoopNum, @@ -1689,9 +1682,9 @@ namespace Pumps { // Override (lock down flow) for pressure drop if applicable if (PumpEquip(PumpNum).LoopNum > 0) { - if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { + if (state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { PumpMassFlowRate = ResolveLoopFlowVsPressure(state, PumpEquip(PumpNum).LoopNum, Node(PumpEquip(PumpNum).InletNodeNum).MassFlowRate, @@ -1752,7 +1745,6 @@ namespace Pumps { // Energy Calculations, ASHRAE, 1993, pp2-10 to 2-15 // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -1818,7 +1810,7 @@ namespace Pumps { if ((PumpEquip(PumpNum).PumpType == Pump_VarSpeed) || (PumpEquip(PumpNum).PumpType == PumpBank_VarSpeed) || (PumpEquip(PumpNum).PumpType == Pump_Cond)) { - if (PlantLoop(PumpEquip(PumpNum).LoopNum) + if (state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum) .LoopSide(PumpEquip(PumpNum).LoopSideNum) .Branch(PumpEquip(PumpNum).BranchNum) .Comp(PumpEquip(PumpNum).CompNum) @@ -1841,7 +1833,7 @@ namespace Pumps { // Get RPM value for reporting as output // RPM is calculated using pump affinity laws for rotation speed - if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && PumpEquip(PumpNum).HasVFD) { + if (state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && PumpEquip(PumpNum).HasVFD) { RotSpeed_Min = GetCurrentScheduleValue(state, PumpEquip(PumpNum).VFD.MinRPMSchedIndex); RotSpeed_Max = GetCurrentScheduleValue(state, PumpEquip(PumpNum).VFD.MaxRPMSchedIndex); if (PumpEquip(PumpNum).PumpMassFlowRateMaxRPM < DataBranchAirLoopPlant::MassFlowTolerance || PumpEquip(PumpNum).PumpMassFlowRateMinRPM < DataBranchAirLoopPlant::MassFlowTolerance) { @@ -1896,7 +1888,7 @@ namespace Pumps { // density used for volumetric flow calculations LoopDensity = GetDensityGlycol( - state, PlantLoop(PumpEquip(PumpNum).LoopNum).FluidName, Node(InletNode).Temp, PlantLoop(PumpEquip(PumpNum).LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).FluidName, Node(InletNode).Temp, state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).FluidIndex, RoutineName); //****************************! //***** CALCULATE POWER (1) **! @@ -1954,7 +1946,7 @@ namespace Pumps { // simulation conditions (flow rate and pressure drop) along with knowledge about pump impeller and motor efficiencies // Thus we will override the power that was calculated based on nominal values with the corrected pressure-based power if (PumpEquip(PumpNum).LoopNum > 0) { - if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs) { + if (state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs) { TotalEffic = PumpEquip(PumpNum).PumpEffic * PumpEquip(PumpNum).MotorEffic; // Efficiency errors are caught previously, but it doesn't hurt to add another catch before dividing by zero!!! if (TotalEffic == 0.0) { @@ -1962,7 +1954,7 @@ namespace Pumps { ShowContinueError(state, "Check efficiency inputs for this pump component."); ShowFatalError(state, "Errors in plant calculation would result in divide-by-zero cause program termination."); } - Power = VolFlowRate * PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop / TotalEffic; + Power = VolFlowRate * state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop / TotalEffic; } } @@ -2024,7 +2016,6 @@ namespace Pumps { // Using/Aliasing using DataPlant::PlantFinalSizesOkayToReport; using DataPlant::PlantFirstSizesOkayToReport; - using DataPlant::PlantLoop; using DataSizing::PlantSizData; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; @@ -2059,9 +2050,9 @@ namespace Pumps { // Calculate density at InitConvTemp once here, to remove RhoH2O calls littered throughout if (PumpEquip(PumpNum).LoopNum > 0) { TempWaterDensity = GetDensityGlycol(state, - PlantLoop(PumpEquip(PumpNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - PlantLoop(PumpEquip(PumpNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).FluidIndex, RoutineName); } else { TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, DummyWaterIndex, RoutineName); @@ -2075,7 +2066,7 @@ namespace Pumps { ErrorsFound = false; if (PumpEquip(PumpNum).LoopNum > 0) { - PlantSizNum = PlantLoop(PumpEquip(PumpNum).LoopNum).PlantSizNum; + PlantSizNum = state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).PlantSizNum; } // use pump sizing factor stored in plant sizing data structure if (PlantSizNum > 0) { @@ -2084,15 +2075,15 @@ namespace Pumps { // might be able to remove this next block if (PumpEquip(PumpNum).LoopNum > 0) { for (Side = 1; Side <= 2; ++Side) { - for (BranchNum = 1; BranchNum <= PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).Branch(BranchNum).TotalComponents; + for (BranchNum = 1; BranchNum <= state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).Branch(BranchNum).TotalComponents; ++CompNum) { if (PumpEquip(PumpNum).InletNodeNum == - PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).Branch(BranchNum).Comp(CompNum).NodeNumIn && + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).Branch(BranchNum).Comp(CompNum).NodeNumIn && PumpEquip(PumpNum).OutletNodeNum == - PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).Branch(BranchNum).Comp(CompNum).NodeNumOut) { - if (PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).Branch(BranchNum).PumpSizFac > 0.0) { - PumpSizFac = PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).Branch(BranchNum).PumpSizFac; + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).Branch(BranchNum).Comp(CompNum).NodeNumOut) { + if (state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).Branch(BranchNum).PumpSizFac > 0.0) { + PumpSizFac = state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(Side).Branch(BranchNum).PumpSizFac; } else { PumpSizFac = 1.0; } @@ -2109,7 +2100,7 @@ namespace Pumps { if (PlantSizNum > 0) { if (PlantSizData(PlantSizNum).DesVolFlowRate >= SmallWaterVolFlow) { - if (!PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(PumpEquip(PumpNum).LoopSideNum).BranchPumpsExist) { + if (!state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(PumpEquip(PumpNum).LoopSideNum).BranchPumpsExist) { // size pump to full flow of plant loop if (PumpEquip(PumpNum).PumpType == Pump_Cond) { TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, DummyWaterIndex, RoutineName); @@ -2122,7 +2113,7 @@ namespace Pumps { } else { // Distribute sizes evenly across all branch pumps DesVolFlowRatePerBranch = PlantSizData(PlantSizNum).DesVolFlowRate / - PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(PumpEquip(PumpNum).LoopSideNum).TotalPumps; + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).LoopSide(PumpEquip(PumpNum).LoopSideNum).TotalPumps; if (PumpEquip(PumpNum).PumpType == Pump_Cond) { TempWaterDensity = GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, DummyWaterIndex, RoutineName); SteamDensity = GetSatDensityRefrig(state, fluidNameSteam, StartTemp, 1.0, PumpEquip(PumpNum).FluidIndex, RoutineNameSizePumps); @@ -2394,7 +2385,6 @@ namespace Pumps { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -2419,9 +2409,9 @@ namespace Pumps { // Calculate maximum and minimum mass flow rate associated with maximun and minimum RPM if (PumpEquip(PumpNum).LoopNum > 0) { - if (PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && - PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { + if (state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).UsePressureForPumpCalcs && + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).PressureSimType == DataPlant::iPressSimType::FlowCorrection && + state.dataPlnt->PlantLoop(PumpEquip(PumpNum).LoopNum).PressureDrop > 0.0) { PumpEquip(PumpNum).PumpMassFlowRateMaxRPM = ResolveLoopFlowVsPressure(state, PumpEquip(PumpNum).LoopNum, InletNodeMassFlowRate, PumpEquip(PumpNum).PressureCurve_Index, @@ -2446,9 +2436,9 @@ namespace Pumps { // Calculate maximum and minimum mass flow rate associated with operating pressure range if (PumpEquip(PumpNum).LoopNum > 0) { - if (PlantLoop(LoopNum).PressureEffectiveK > 0.0) { - PumpMassFlowRateMaxPress = std::sqrt(MaxPress / PlantLoop(LoopNum).PressureEffectiveK); - PumpMassFlowRateMinPress = std::sqrt(MinPress / PlantLoop(LoopNum).PressureEffectiveK); + if (state.dataPlnt->PlantLoop(LoopNum).PressureEffectiveK > 0.0) { + PumpMassFlowRateMaxPress = std::sqrt(MaxPress / state.dataPlnt->PlantLoop(LoopNum).PressureEffectiveK); + PumpMassFlowRateMinPress = std::sqrt(MinPress / state.dataPlnt->PlantLoop(LoopNum).PressureEffectiveK); } } diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index 5a7f5387856..603d2429992 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -9080,7 +9080,7 @@ namespace EnergyPlus::RefrigeratedCase { auto &Condenser(state.dataRefrigCase->Condenser); // initialize plant topology information, if applicable - if (state.dataRefrigCase->MyReferPlantScanFlag && allocated(DataPlant::PlantLoop)) { + if (state.dataRefrigCase->MyReferPlantScanFlag && allocated(state.dataPlnt->PlantLoop)) { for (int RefCondLoop = 1; RefCondLoop <= DataHeatBalance::NumRefrigCondensers; ++RefCondLoop) { if (Condenser(RefCondLoop).CondenserType != DataHeatBalance::RefrigCondenserTypeWater) continue; @@ -9103,9 +9103,9 @@ namespace EnergyPlus::RefrigeratedCase { } Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(Condenser(RefCondLoop).PlantLoopNum).FluidName, + state.dataPlnt->PlantLoop(Condenser(RefCondLoop).PlantLoopNum).FluidName, 20.0, - DataPlant::PlantLoop(Condenser(RefCondLoop).PlantLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(Condenser(RefCondLoop).PlantLoopNum).FluidIndex, RoutineName); if (Condenser(RefCondLoop).FlowType == iCndsrFlowType::ConstantFlow) { @@ -9137,9 +9137,9 @@ namespace EnergyPlus::RefrigeratedCase { } Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(RefrigRack(RefCompRackLoop).PlantLoopNum).FluidName, + state.dataPlnt->PlantLoop(RefrigRack(RefCompRackLoop).PlantLoopNum).FluidName, 20.0, - DataPlant::PlantLoop(RefrigRack(RefCompRackLoop).PlantLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(RefrigRack(RefCompRackLoop).PlantLoopNum).FluidIndex, RoutineName); if (RefrigRack(RefCompRackLoop).FlowType == iCndsrFlowType::ConstantFlow) { @@ -9162,9 +9162,9 @@ namespace EnergyPlus::RefrigeratedCase { if (Condenser(RefCondLoop).CondenserType != DataHeatBalance::RefrigCondenserTypeWater) continue; Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(Condenser(RefCondLoop).PlantLoopNum).FluidName, + state.dataPlnt->PlantLoop(Condenser(RefCondLoop).PlantLoopNum).FluidName, 20.0, - DataPlant::PlantLoop(Condenser(RefCondLoop).PlantLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(Condenser(RefCondLoop).PlantLoopNum).FluidIndex, RoutineName); if (Condenser(RefCondLoop).FlowType == iCndsrFlowType::ConstantFlow) { @@ -9186,9 +9186,9 @@ namespace EnergyPlus::RefrigeratedCase { if (RefrigRack(RefCompRackLoop).CondenserType != DataHeatBalance::RefrigCondenserTypeWater) continue; Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(RefrigRack(RefCompRackLoop).PlantLoopNum).FluidName, + state.dataPlnt->PlantLoop(RefrigRack(RefCompRackLoop).PlantLoopNum).FluidName, 20.0, - DataPlant::PlantLoop(RefrigRack(RefCompRackLoop).PlantLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(RefrigRack(RefCompRackLoop).PlantLoopNum).FluidIndex, RoutineName); if (RefrigRack(RefCompRackLoop).FlowType == iCndsrFlowType::ConstantFlow) { @@ -10057,10 +10057,16 @@ namespace EnergyPlus::RefrigeratedCase { // Make demand request on first HVAC iteration // get cooling fluid properties - Real64 rho = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(PlantLoopIndex).FluidName, this->InletTemp, DataPlant::PlantLoop(PlantLoopIndex).FluidIndex, RoutineName); - Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(PlantLoopIndex).FluidName, this->InletTemp, DataPlant::PlantLoop(PlantLoopIndex).FluidIndex, RoutineName); + Real64 rho = FluidProperties::GetDensityGlycol(state, + state.dataPlnt->PlantLoop(PlantLoopIndex).FluidName, + this->InletTemp, + state.dataPlnt->PlantLoop(PlantLoopIndex).FluidIndex, + RoutineName); + Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, + state.dataPlnt->PlantLoop(PlantLoopIndex).FluidName, + this->InletTemp, + state.dataPlnt->PlantLoop(PlantLoopIndex).FluidIndex, + RoutineName); if (this->FlowType == iCndsrFlowType::VariableFlow && state.dataRefrigCase->TotalCondenserHeat > 0.0) { @@ -10069,16 +10075,17 @@ namespace EnergyPlus::RefrigeratedCase { if (this->OutletTemp == this->InletTemp) { if (this->HighInletWarnIndex == 0) { - ShowSevereError(state, ErrIntro + ", \"" + this->Name + - "\" : has inlet water temp equal to desired outlet temp. Excessive flow resulting. "); + ShowSevereError( + state, ErrIntro + ", \"" + this->Name + "\" : has inlet water temp equal to desired outlet temp. Excessive flow resulting. "); ShowContinueError(state, "cooling water is not cold enough to reach desired outlet temperature"); } - ShowRecurringWarningErrorAtEnd(state, ErrIntro + ", \"" + this->Name + + ShowRecurringWarningErrorAtEnd(state, + ErrIntro + ", \"" + this->Name + "\" : has inlet water temp equal to desired outlet temp.... continues. ", this->HighInletWarnIndex); this->VolFlowRate = 9999.0; this->MassFlowRate = this->VolFlowRate * rho; - } else { + } else { Real64 DeltaT = this->OutletTemp - this->InletTemp; this->MassFlowRate = state.dataRefrigCase->TotalCondenserHeat / Cp / DeltaT; // Check for maximum flow in the component @@ -10088,11 +10095,11 @@ namespace EnergyPlus::RefrigeratedCase { ShowContinueError(state, "Requested condenser water mass flow rate greater than maximum allowed value. "); ShowContinueError(state, "Flow reset to maximum value."); } // HighFlowWarnIndex - ShowRecurringWarningErrorAtEnd(state, ErrIntro + this->Name + " - Flow rate higher than maximum allowed ... continues", - this->HighFlowWarnIndex); + ShowRecurringWarningErrorAtEnd( + state, ErrIntro + this->Name + " - Flow rate higher than maximum allowed ... continues", this->HighFlowWarnIndex); // END IF this->MassFlowRate = this->MassFlowRateMax; - } + } } // compare outlet T to inlet T } else if (this->FlowType == iCndsrFlowType::ConstantFlow && state.dataRefrigCase->TotalCondenserHeat > 0.0) { @@ -10105,8 +10112,8 @@ namespace EnergyPlus::RefrigeratedCase { } // on flow type // check against plant, might get changed. - PlantUtilities::SetComponentFlowRate(state, - this->MassFlowRate, PlantInletNode, PlantOutletNode, PlantLoopIndex, PlantLoopSideIndex, PlantBranchIndex, PlantCompIndex); + PlantUtilities::SetComponentFlowRate( + state, this->MassFlowRate, PlantInletNode, PlantOutletNode, PlantLoopIndex, PlantLoopSideIndex, PlantBranchIndex, PlantCompIndex); this->VolFlowRate = this->MassFlowRate / rho; @@ -10116,25 +10123,26 @@ namespace EnergyPlus::RefrigeratedCase { this->OutletTemp = this->InletTemp; if ((state.dataRefrigCase->TotalCondenserHeat > 0.0) && (!FirstHVACIteration)) { - ShowRecurringWarningErrorAtEnd(state, + ShowRecurringWarningErrorAtEnd( + state, TypeName + this->Name + "Water-cooled condenser has no cooling water flow. Heat is not being rejected from compressor rack condenser.", this->NoFlowWarnIndex); } - } + } // Check outlet water temp for max value if (this->OutletTemp > this->OutletTempMax) { if (this->HighTempWarnIndex == 0) { ShowWarningMessage(state, TypeName + this->Name); - ShowContinueError(state, - "Water-cooled condenser outlet temp higher than maximum allowed temp. Check flow rates and/or temperature setpoints."); - } - ShowRecurringWarningErrorAtEnd(state, ErrIntro + this->Name + " - Condenser outlet temp higher than maximum allowed ... continues", - this->HighTempWarnIndex); - } + ShowContinueError( + state, "Water-cooled condenser outlet temp higher than maximum allowed temp. Check flow rates and/or temperature setpoints."); + } + ShowRecurringWarningErrorAtEnd( + state, ErrIntro + this->Name + " - Condenser outlet temp higher than maximum allowed ... continues", this->HighTempWarnIndex); + } - this->UpdateCondenser(); - } + this->UpdateCondenser(state); + } PlantComponent *RefrigRackData::factory(EnergyPlusData &state, std::string const &objectName) { @@ -10217,9 +10225,9 @@ namespace EnergyPlus::RefrigeratedCase { // get cooling fluid properties Real64 rho = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(PlantLoopIndex).FluidName, this->InletTemp, DataPlant::PlantLoop(PlantLoopIndex).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(PlantLoopIndex).FluidName, this->InletTemp, state.dataPlnt->PlantLoop(PlantLoopIndex).FluidIndex, RoutineName); Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(PlantLoopIndex).FluidName, this->InletTemp, DataPlant::PlantLoop(PlantLoopIndex).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(PlantLoopIndex).FluidName, this->InletTemp, state.dataPlnt->PlantLoop(PlantLoopIndex).FluidIndex, RoutineName); if (this->FlowType == iCndsrFlowType::VariableFlow && state.dataRefrigCase->TotalCondenserHeat > 0.0) { this->OutletTemp = ScheduleManager::GetCurrentScheduleValue(state, this->OutletTempSchedPtr); @@ -10293,10 +10301,10 @@ namespace EnergyPlus::RefrigeratedCase { state, ErrIntro + this->Name + " - Condenser outlet temp higher than maximum allowed ... continues", HighTempWarnIndex); } - this->UpdateCondenser(); + this->UpdateCondenser(state); } - void RefrigCondenserData::UpdateCondenser() + void RefrigCondenserData::UpdateCondenser(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -10309,13 +10317,13 @@ namespace EnergyPlus::RefrigeratedCase { // Updates the node variables with local variables. // Pass all variables from inlet to outlet node - PlantUtilities::SafeCopyPlantNode(this->InletNode, this->OutletNode); + PlantUtilities::SafeCopyPlantNode(state, this->InletNode, this->OutletNode); // Set outlet node variables that are possibly changed DataLoopNode::Node(this->OutletNode).Temp = this->OutletTemp; } - void RefrigRackData::UpdateCondenser() + void RefrigRackData::UpdateCondenser(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -10328,7 +10336,7 @@ namespace EnergyPlus::RefrigeratedCase { // Updates the node variables with local variables. // Pass all variables from inlet to outlet node - PlantUtilities::SafeCopyPlantNode(this->InletNode, this->OutletNode); + PlantUtilities::SafeCopyPlantNode(state, this->InletNode, this->OutletNode); // Set outlet node variables that are possibly changed DataLoopNode::Node(this->OutletNode).Temp = this->OutletTemp; diff --git a/src/EnergyPlus/RefrigeratedCase.hh b/src/EnergyPlus/RefrigeratedCase.hh index b9a1a0116bf..b7d2ed2db58 100644 --- a/src/EnergyPlus/RefrigeratedCase.hh +++ b/src/EnergyPlus/RefrigeratedCase.hh @@ -555,7 +555,7 @@ namespace RefrigeratedCase { ActualEvapPumpPower = 0.0; } - void UpdateCondenser(); + void UpdateCondenser(EnergyPlusData &state); void CalcRackSystem(EnergyPlusData &state); @@ -1056,7 +1056,7 @@ namespace RefrigeratedCase { TotalHeatRecoveredEnergy = 0.0; } - void UpdateCondenser(); + void UpdateCondenser(EnergyPlusData &state); static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName); diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index 63ca3a6cb3a..bd12dcea72c 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -727,34 +727,34 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) if (c->waterLoopNum > 0 && c->pltSizNum > 0) { - c->plantLoopName = DataPlant::PlantLoop(c->waterLoopNum).Name; + c->plantLoopName = state.dataPlnt->PlantLoop(c->waterLoopNum).Name; if (DataSizing::PlantSizData(c->pltSizNum).LoopType != DataSizing::SteamLoop) { c->rhoFluid = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(c->waterLoopNum).FluidName, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::doFinalProcessingOfCoilData"); c->cpFluid = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(c->waterLoopNum).FluidName, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::doFinalProcessingOfCoilData"); } else { // steam loop c->rhoFluid = FluidProperties::GetSatDensityRefrig(state, - DataPlant::PlantLoop(c->waterLoopNum).FluidName, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName, 100.0, 1.0, - DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::doFinalProcessingOfCoilData"); c->cpFluid = FluidProperties::GetSatSpecificHeatRefrig(state, - DataPlant::PlantLoop(c->waterLoopNum).FluidName, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName, 100.0, 0.0, - DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::doFinalProcessingOfCoilData"); } - c->plantDesMaxMassFlowRate = DataPlant::PlantLoop(c->waterLoopNum).MaxMassFlowRate; + c->plantDesMaxMassFlowRate = state.dataPlnt->PlantLoop(c->waterLoopNum).MaxMassFlowRate; if (c->plantDesMaxMassFlowRate > 0.0 && c->coilDesWaterMassFlow > 0.0) { c->coilFlowPrcntPlantFlow = (c->coilDesWaterMassFlow / c->plantDesMaxMassFlowRate) * 100.0; // convert to percentage. } @@ -1013,34 +1013,34 @@ void ReportCoilSelection::setCoilWaterFlowPltSizNum(EnergyPlusData &state, c->pltSizNum = plantSizNum; c->waterLoopNum = plantLoopNum; if (c->waterLoopNum > 0) { - c->plantLoopName = DataPlant::PlantLoop(c->waterLoopNum).Name; + c->plantLoopName = state.dataPlnt->PlantLoop(c->waterLoopNum).Name; } if (c->waterLoopNum > 0 && c->pltSizNum > 0) { if (DataSizing::PlantSizData(c->pltSizNum).LoopType != DataSizing::SteamLoop) { c->rhoFluid = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(c->waterLoopNum).FluidName, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::setCoilWaterFlow"); c->cpFluid = FluidProperties::GetSpecificHeatGlycol(state, - DataPlant::PlantLoop(c->waterLoopNum).FluidName, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::setCoilWaterFlow"); } else { // steam loop c->rhoFluid = FluidProperties::GetSatDensityRefrig(state, - DataPlant::PlantLoop(c->waterLoopNum).FluidName, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName, 100.0, 1.0, - DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::setCoilWaterFlow"); c->cpFluid = FluidProperties::GetSatSpecificHeatRefrig(state, - DataPlant::PlantLoop(c->waterLoopNum).FluidName, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidName, 100.0, 0.0, - DataPlant::PlantLoop(c->waterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(c->waterLoopNum).FluidIndex, "ReportCoilSelection::setCoilWaterFlow"); } } diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 94530e02151..c125b68bdab 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -4191,43 +4191,43 @@ namespace EnergyPlus::SetPointManager { for (LoopNum = 1; LoopNum <= NumCondLoops + NumPlantLoops; ++LoopNum) { // Begin demand side loops ... When condenser is added becomes NumLoops for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - if (PlantLoop(LoopNum).TempSetPointNodeNum == state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex)) { - for (BranchNum = 1; BranchNum <= PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).TotalComponents; + if (state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum == state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex)) { + for (BranchNum = 1; BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).TotalComponents; ++CompNum) { // Check if cooling tower is single speed and generate and error - TypeOf_Num = PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; + TypeOf_Num = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; if (TypeOf_Num == TypeOf_CoolingTower_SingleSpd) { ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->CondEntSetPtMgr(SetPtMgrNum).Name + "\", invalid tower found"); ShowContinueError(state, "Found SingleSpeed Cooling Tower, Cooling Tower=" + - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).Name); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).Name); ShowContinueError(state, "SingleSpeed cooling towers cannot be used with this setpoint manager."); ErrorsFound = true; } } } // Scan all attached chillers in the condenser loop index found to find the chiller index - for (BranchNum = 1; BranchNum <= PlantLoop(LoopNum).LoopSide(DemandSide).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).TotalComponents; + for (BranchNum = 1; BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).TotalComponents; ++CompNum) { - TypeOf_Num = PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; + TypeOf_Num = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; if (TypeOf_Num == TypeOf_Chiller_Absorption || TypeOf_Num == TypeOf_Chiller_Indirect_Absorption || TypeOf_Num == TypeOf_Chiller_CombTurbine || TypeOf_Num == TypeOf_Chiller_ConstCOP || TypeOf_Num == TypeOf_Chiller_Electric || TypeOf_Num == TypeOf_Chiller_ElectricEIR || TypeOf_Num == TypeOf_Chiller_DFAbsorption || TypeOf_Num == TypeOf_Chiller_ElectricReformEIR || TypeOf_Num == TypeOf_Chiller_EngineDriven) { // Scan the supply side to find the chiller index and branch index on plantloop - TypeNum = PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; + TypeNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; for (LoopNum2 = 1; LoopNum2 <= NumCondLoops + NumPlantLoops; ++LoopNum2) { for (BranchNumPlantSide = 1; - BranchNumPlantSide <= PlantLoop(LoopNum2).LoopSide(SupplySide).TotalBranches; + BranchNumPlantSide <= state.dataPlnt->PlantLoop(LoopNum2).LoopSide(SupplySide).TotalBranches; ++BranchNumPlantSide) { for (CompNumPlantSide = 1; CompNumPlantSide <= - PlantLoop(LoopNum2).LoopSide(SupplySide).Branch(BranchNumPlantSide).TotalComponents; + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(SupplySide).Branch(BranchNumPlantSide).TotalComponents; ++CompNumPlantSide) { - if (PlantLoop(LoopNum2) + if (state.dataPlnt->PlantLoop(LoopNum2) .LoopSide(SupplySide) .Branch(BranchNumPlantSide) .Comp(CompNumPlantSide) @@ -4259,17 +4259,17 @@ namespace EnergyPlus::SetPointManager { for (LoopNum = 1; LoopNum <= NumCondLoops + NumPlantLoops; ++LoopNum) { // Begin demand side loops ... When condenser is added becomes NumLoops for (CtrlNodeIndex = 1; CtrlNodeIndex <= state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++CtrlNodeIndex) { - if (PlantLoop(LoopNum).TempSetPointNodeNum == state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex)) { - for (BranchNum = 1; BranchNum <= PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).TotalComponents; + if (state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum == state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).CtrlNodes(CtrlNodeIndex)) { + for (BranchNum = 1; BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).TotalComponents; ++CompNum) { // Check if cooling tower is single speed and generate and error - TypeOf_Num = PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; + TypeOf_Num = state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; if (TypeOf_Num == TypeOf_CoolingTower_SingleSpd) { ShowSevereError(state, cSetPointManagerType + "=\"" + state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).Name + "\", invalid cooling tower found"); ShowContinueError(state, "Found Single Speed Cooling Tower, Cooling Tower=" + - PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).Name); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum).Name); ShowContinueError(state, "SingleSpeed cooling towers cannot be used with this setpoint manager on each loop"); ErrorsFound = true; } else if (TypeOf_Num == TypeOf_CoolingTower_TwoSpd || TypeOf_Num == TypeOf_CoolingTower_VarSpd) { @@ -4285,26 +4285,26 @@ namespace EnergyPlus::SetPointManager { } } // Scan all attached chillers in the condenser loop index found to find the chiller index - for (BranchNum = 1; BranchNum <= PlantLoop(LoopNum).LoopSide(DemandSide).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).TotalComponents; + for (BranchNum = 1; BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).TotalComponents; ++CompNum) { - TypeOf_Num = PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; + TypeOf_Num = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; if (TypeOf_Num == TypeOf_Chiller_Absorption || TypeOf_Num == TypeOf_Chiller_Indirect_Absorption || TypeOf_Num == TypeOf_Chiller_CombTurbine || TypeOf_Num == TypeOf_Chiller_ConstCOP || TypeOf_Num == TypeOf_Chiller_Electric || TypeOf_Num == TypeOf_Chiller_ElectricEIR || TypeOf_Num == TypeOf_Chiller_DFAbsorption || TypeOf_Num == TypeOf_Chiller_ElectricReformEIR || TypeOf_Num == TypeOf_Chiller_EngineDriven) { // Scan the supply side to find the chiller index and branch index on plantloop - TypeNum = PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; + TypeNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).TypeOf_Num; for (LoopNum2 = 1; LoopNum2 <= NumCondLoops + NumPlantLoops; ++LoopNum2) { for (BranchNumPlantSide = 1; - BranchNumPlantSide <= PlantLoop(LoopNum2).LoopSide(SupplySide).TotalBranches; + BranchNumPlantSide <= state.dataPlnt->PlantLoop(LoopNum2).LoopSide(SupplySide).TotalBranches; ++BranchNumPlantSide) { for (CompNumPlantSide = 1; CompNumPlantSide <= - PlantLoop(LoopNum2).LoopSide(SupplySide).Branch(BranchNumPlantSide).TotalComponents; + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(SupplySide).Branch(BranchNumPlantSide).TotalComponents; ++CompNumPlantSide) { - TypeOf_Num = PlantLoop(LoopNum2) + TypeOf_Num = state.dataPlnt->PlantLoop(LoopNum2) .LoopSide(SupplySide) .Branch(BranchNumPlantSide) .Comp(CompNumPlantSide) @@ -4315,13 +4315,13 @@ namespace EnergyPlus::SetPointManager { state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).ChillerIndexPlantSide = CompNumPlantSide; state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).BranchIndexPlantSide = BranchNumPlantSide; // Scan the pump on the chilled water loop - for (BranchNum2 = 1; BranchNum2 <= PlantLoop(LoopNum2).LoopSide(SupplySide).TotalBranches; + for (BranchNum2 = 1; BranchNum2 <= state.dataPlnt->PlantLoop(LoopNum2).LoopSide(SupplySide).TotalBranches; ++BranchNum2) { for (CompNum2 = 1; CompNum2 <= - PlantLoop(LoopNum2).LoopSide(SupplySide).Branch(BranchNum2).TotalComponents; + state.dataPlnt->PlantLoop(LoopNum2).LoopSide(SupplySide).Branch(BranchNum2).TotalComponents; ++CompNum2) { - TypeOf_Num = PlantLoop(LoopNum2) + TypeOf_Num = state.dataPlnt->PlantLoop(LoopNum2) .LoopSide(SupplySide) .Branch(BranchNum2) .Comp(CompNum2) @@ -4342,7 +4342,7 @@ namespace EnergyPlus::SetPointManager { "\", too many chillers found"); ShowContinueError(state, "only one chiller can be used with this setpoint manager on each loop"); ShowContinueError(state, "Found more than one chiller, chiller =" + - PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).Name); + state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum).Name); ErrorsFound = true; } state.dataSetPointManager->IdealCondEntSetPtMgr(SetPtMgrNum).TypeNum = TypeNum; @@ -6988,25 +6988,25 @@ namespace EnergyPlus::SetPointManager { BranchIndexDemandSide = this->BranchIndexDemandSide; // If chiller is on - CurLoad = std::abs(PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).MyLoad); + CurLoad = std::abs(state.dataPlnt->PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).MyLoad); if (CurLoad > 0) { if (TypeNum == TypeOf_Chiller_Absorption || TypeNum == TypeOf_Chiller_CombTurbine || TypeNum == TypeOf_Chiller_Electric || TypeNum == TypeOf_Chiller_ElectricReformEIR || TypeNum == TypeOf_Chiller_EngineDriven) { TempDesCondIn = - PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).TempDesCondIn; + state.dataPlnt->PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).TempDesCondIn; state.dataSetPointManager->DCESPMCondInletTemp = - Node(PlantLoop(LoopIndexDemandSide).LoopSide(DemandSide).Branch(BranchIndexDemandSide).Comp(ChillerIndexDemandSide).NodeNumIn) + Node(state.dataPlnt->PlantLoop(LoopIndexDemandSide).LoopSide(DemandSide).Branch(BranchIndexDemandSide).Comp(ChillerIndexDemandSide).NodeNumIn) .Temp; state.dataSetPointManager->DCESPMEvapOutletTemp = - Node(PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).NodeNumOut).Temp; + Node(state.dataPlnt->PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).NodeNumOut).Temp; TempEvapOutDesign = - PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).TempDesEvapOut; + state.dataPlnt->PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).TempDesEvapOut; state.dataSetPointManager->DCESPMDesignClgCapacity_Watts = - PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).MaxLoad; - state.dataSetPointManager->DCESPMCurrentLoad_Watts = PlantLoop(LoopIndexPlantSide).CoolingDemand; + state.dataPlnt->PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).MaxLoad; + state.dataSetPointManager->DCESPMCurrentLoad_Watts = state.dataPlnt->PlantLoop(LoopIndexPlantSide).CoolingDemand; } else if (TypeNum == TypeOf_Chiller_Indirect_Absorption || TypeNum == TypeOf_Chiller_DFAbsorption) { TempDesCondIn = - PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).TempDesCondIn; + state.dataPlnt->PlantLoop(LoopIndexPlantSide).LoopSide(SupplySide).Branch(BranchIndexPlantSide).Comp(ChillerIndexPlantSide).TempDesCondIn; TempEvapOutDesign = 6.666; } else { TempDesCondIn = 25.0; @@ -7145,7 +7145,7 @@ namespace EnergyPlus::SetPointManager { // If chiller is on CurLoad = std::abs( - PlantLoop(this->LoopIndexPlantSide).LoopSide(SupplySide).Branch(this->BranchIndexPlantSide).Comp(this->ChillerIndexPlantSide).MyLoad); + state.dataPlnt->PlantLoop(this->LoopIndexPlantSide).LoopSide(SupplySide).Branch(this->BranchIndexPlantSide).Comp(this->ChillerIndexPlantSide).MyLoad); if (CurLoad > 0) { @@ -7153,7 +7153,7 @@ namespace EnergyPlus::SetPointManager { if (this->TypeNum == TypeOf_Chiller_Absorption || this->TypeNum == TypeOf_Chiller_CombTurbine || this->TypeNum == TypeOf_Chiller_Electric || this->TypeNum == TypeOf_Chiller_ElectricReformEIR || this->TypeNum == TypeOf_Chiller_EngineDriven) { - EvapOutletTemp = Node(PlantLoop(this->LoopIndexPlantSide) + EvapOutletTemp = Node(state.dataPlnt->PlantLoop(this->LoopIndexPlantSide) .LoopSide(SupplySide) .Branch(this->BranchIndexPlantSide) .Comp(this->ChillerIndexPlantSide) @@ -7303,12 +7303,12 @@ namespace EnergyPlus::SetPointManager { int fluidIndex = 1; if (this->plantLoopIndex == 0) { for (int plantIndex = 1; plantIndex <= DataPlant::TotNumLoops; plantIndex++) { - if (this->supplyNodeIndex == DataPlant::PlantLoop(plantIndex).LoopSide(2).NodeNumOut) { + if (this->supplyNodeIndex == state.dataPlnt->PlantLoop(plantIndex).LoopSide(2).NodeNumOut) { this->plantLoopIndex = plantIndex; - this->plantSetpointNodeIndex = DataPlant::PlantLoop(plantIndex).TempSetPointNodeNum; - fluidIndex = DataPlant::PlantLoop(plantIndex).FluidIndex; + this->plantSetpointNodeIndex = state.dataPlnt->PlantLoop(plantIndex).TempSetPointNodeNum; + fluidIndex = state.dataPlnt->PlantLoop(plantIndex).FluidIndex; // now that we've found the plant populated, let's verify that the nodes match - if (!PlantUtilities::verifyTwoNodeNumsOnSamePlantLoop(this->supplyNodeIndex, this->returnNodeIndex)) { + if (!PlantUtilities::verifyTwoNodeNumsOnSamePlantLoop(state, this->supplyNodeIndex, this->returnNodeIndex)) { ShowSevereError(state, "Node problem for SetpointManager:ReturnTemperature:ChilledWater."); ShowContinueError(state, "Return and Supply nodes were not found on the same plant loop. Verify node names."); ShowFatalError(state, "Simulation aborts due to setpoint node problem"); @@ -7408,12 +7408,12 @@ namespace EnergyPlus::SetPointManager { int fluidIndex = 1; if (this->plantLoopIndex == 0) { for (int plantIndex = 1; plantIndex <= DataPlant::TotNumLoops; plantIndex++) { - if (this->supplyNodeIndex == DataPlant::PlantLoop(plantIndex).LoopSide(2).NodeNumOut) { + if (this->supplyNodeIndex == state.dataPlnt->PlantLoop(plantIndex).LoopSide(2).NodeNumOut) { this->plantLoopIndex = plantIndex; - this->plantSetpointNodeIndex = DataPlant::PlantLoop(plantIndex).TempSetPointNodeNum; - fluidIndex = DataPlant::PlantLoop(plantIndex).FluidIndex; + this->plantSetpointNodeIndex = state.dataPlnt->PlantLoop(plantIndex).TempSetPointNodeNum; + fluidIndex = state.dataPlnt->PlantLoop(plantIndex).FluidIndex; // now that we've found the plant populated, let's verify that the nodes match - if (!PlantUtilities::verifyTwoNodeNumsOnSamePlantLoop(this->supplyNodeIndex, this->returnNodeIndex)) { + if (!PlantUtilities::verifyTwoNodeNumsOnSamePlantLoop(state, this->supplyNodeIndex, this->returnNodeIndex)) { ShowSevereError(state, "Node problem for SetpointManager:ReturnTemperature:HotWater."); ShowContinueError(state, "Return and Supply nodes were not found on the same plant loop. Verify node names."); ShowFatalError(state, "Simulation aborts due to setpoint node problem"); @@ -7512,8 +7512,8 @@ namespace EnergyPlus::SetPointManager { int CondPumpBranchNum(this->CondPumpBranchNum); // Condenser water pump branch number int CondPumpNum(this->CondPumpNum); // Condenser pump number - TypeOfComp = PlantLoop(ChillerLoopNum).LoopSide(SupplySide).Branch(ChillerBranchNum).Comp(ChillerNum).TypeOf; - NameOfComp = PlantLoop(ChillerLoopNum).LoopSide(SupplySide).Branch(ChillerBranchNum).Comp(ChillerNum).Name; + TypeOfComp = state.dataPlnt->PlantLoop(ChillerLoopNum).LoopSide(SupplySide).Branch(ChillerBranchNum).Comp(ChillerNum).TypeOf; + NameOfComp = state.dataPlnt->PlantLoop(ChillerLoopNum).LoopSide(SupplySide).Branch(ChillerBranchNum).Comp(ChillerNum).Name; NumVariables = GetNumMeteredVariables(state, TypeOfComp, NameOfComp); VarIndexes.allocate(NumVariables); VarTypes.allocate(NumVariables); @@ -7532,8 +7532,8 @@ namespace EnergyPlus::SetPointManager { this->ChllrVarType = VarTypes(1); this->ChllrVarIndex = VarIndexes(1); - TypeOfComp = PlantLoop(ChillerLoopNum).LoopSide(SupplySide).Branch(ChilledPumpBranchNum).Comp(ChilledPumpNum).TypeOf; - NameOfComp = PlantLoop(ChillerLoopNum).LoopSide(SupplySide).Branch(ChilledPumpBranchNum).Comp(ChilledPumpNum).Name; + TypeOfComp = state.dataPlnt->PlantLoop(ChillerLoopNum).LoopSide(SupplySide).Branch(ChilledPumpBranchNum).Comp(ChilledPumpNum).TypeOf; + NameOfComp = state.dataPlnt->PlantLoop(ChillerLoopNum).LoopSide(SupplySide).Branch(ChilledPumpBranchNum).Comp(ChilledPumpNum).Name; NumVariables = GetNumMeteredVariables(state, TypeOfComp, NameOfComp); VarIndexes.allocate(NumVariables); VarTypes.allocate(NumVariables); @@ -7554,8 +7554,8 @@ namespace EnergyPlus::SetPointManager { this->ChlPumpVarIndex = VarIndexes(1); for (int i = 1; i <= this->numTowers; i++) { - TypeOfComp = PlantLoop(TowerLoopNum).LoopSide(SupplySide).Branch(this->CondTowerBranchNum(i)).Comp(this->TowerNum(i)).TypeOf; - NameOfComp = PlantLoop(TowerLoopNum).LoopSide(SupplySide).Branch(this->CondTowerBranchNum(i)).Comp(this->TowerNum(i)).Name; + TypeOfComp = state.dataPlnt->PlantLoop(TowerLoopNum).LoopSide(SupplySide).Branch(this->CondTowerBranchNum(i)).Comp(this->TowerNum(i)).TypeOf; + NameOfComp = state.dataPlnt->PlantLoop(TowerLoopNum).LoopSide(SupplySide).Branch(this->CondTowerBranchNum(i)).Comp(this->TowerNum(i)).Name; NumVariables = GetNumMeteredVariables(state, TypeOfComp, NameOfComp); VarIndexes.allocate(NumVariables); VarTypes.allocate(NumVariables); @@ -7577,8 +7577,8 @@ namespace EnergyPlus::SetPointManager { this->ClTowerVarIndex.push_back(VarIndexes(1)); } - TypeOfComp = PlantLoop(TowerLoopNum).LoopSide(SupplySide).Branch(CondPumpBranchNum).Comp(CondPumpNum).TypeOf; - NameOfComp = PlantLoop(TowerLoopNum).LoopSide(SupplySide).Branch(CondPumpBranchNum).Comp(CondPumpNum).Name; + TypeOfComp = state.dataPlnt->PlantLoop(TowerLoopNum).LoopSide(SupplySide).Branch(CondPumpBranchNum).Comp(CondPumpNum).TypeOf; + NameOfComp = state.dataPlnt->PlantLoop(TowerLoopNum).LoopSide(SupplySide).Branch(CondPumpBranchNum).Comp(CondPumpNum).Name; NumVariables = GetNumMeteredVariables(state, TypeOfComp, NameOfComp); VarIndexes.allocate(NumVariables); VarTypes.allocate(NumVariables); diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 37c5aa4b31d..273fc0eac4c 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -2389,110 +2389,110 @@ namespace SimulationManager { print(state.files.bnd, " Plant Loop,{},{},{},{},{},{}\n", - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).Name, LoopString, - PlantLoop(Count).LoopSide(LoopSideNum).NodeNameIn, - PlantLoop(Count).LoopSide(LoopSideNum).NodeNameOut, - PlantLoop(Count).LoopSide(LoopSideNum).BranchList, - PlantLoop(Count).LoopSide(LoopSideNum).ConnectList); + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).NodeNameIn, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).NodeNameOut, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).BranchList, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).ConnectList); // Plant Supply Side Splitter - if (PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Exists) { + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Exists) { print(state.files.bnd, " Plant Loop Connector,Splitter,{},{},{},{}\n", - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name, - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name, + state.dataPlnt->PlantLoop(Count).Name, LoopString, - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.TotalOutletNodes); - for (int Count1 = 1; Count1 <= PlantLoop(Count).LoopSide(LoopSideNum).Splitter.TotalOutletNodes; ++Count1) { + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.TotalOutletNodes); + for (int Count1 = 1; Count1 <= state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.TotalOutletNodes; ++Count1) { print(state.files.bnd, " Plant Loop Connector Branches,{},Splitter,{},", Count1, - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name); + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name); - if (PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumIn <= 0) { + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumIn <= 0) { print(state.files.bnd, "{},\n", errstring); } else { print(state.files.bnd, "{},", - PlantLoop(Count).LoopSide(LoopSideNum).Branch(PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumIn).Name); + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Branch(state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumIn).Name); } - if (PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumOut(Count1) <= 0) { - print(state.files.bnd, "{},{},{}\n", errstring, PlantLoop(Count).Name, LoopString); + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumOut(Count1) <= 0) { + print(state.files.bnd, "{},{},{}\n", errstring, state.dataPlnt->PlantLoop(Count).Name, LoopString); } else { print(state.files.bnd, "{},{},{}\n", - PlantLoop(Count) + state.dataPlnt->PlantLoop(Count) .LoopSide(LoopSideNum) - .Branch(PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumOut(Count1)) + .Branch(state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumOut(Count1)) .Name, - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).Name, LoopString); } print(state.files.bnd, " Plant Loop Connector Nodes, {},Splitter,{},{},{},{},{}\n", Count1, - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name, - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.NodeNameIn, - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.NodeNameOut(Count1), - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.NodeNameIn, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.NodeNameOut(Count1), + state.dataPlnt->PlantLoop(Count).Name, LoopString); } } // Plant Supply Side Mixer - if (PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Exists) { + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Exists) { print(state.files.bnd, " Plant Loop Connector,Mixer,{},{},{},{}\n", - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name, - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name, + state.dataPlnt->PlantLoop(Count).Name, LoopString, - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.TotalInletNodes); //',Supply,'// & + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.TotalInletNodes); //',Supply,'// & - for (int Count1 = 1; Count1 <= PlantLoop(Count).LoopSide(LoopSideNum).Mixer.TotalInletNodes; ++Count1) { + for (int Count1 = 1; Count1 <= state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.TotalInletNodes; ++Count1) { print(state.files.bnd, " Plant Loop Connector Branches,{},Mixer,{},", Count1, - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name); - if (PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumIn(Count1) <= 0) { + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name); + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumIn(Count1) <= 0) { print(state.files.bnd, "{},", errstring); } else { print( state.files.bnd, "{},", - PlantLoop(Count).LoopSide(LoopSideNum).Branch(PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumIn(Count1)).Name); + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Branch(state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumIn(Count1)).Name); } - if (PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumOut <= 0) { - print(state.files.bnd, "{},{},Supply\n", errstring, PlantLoop(Count).Name); + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumOut <= 0) { + print(state.files.bnd, "{},{},Supply\n", errstring, state.dataPlnt->PlantLoop(Count).Name); } else { print(state.files.bnd, "{},{},{}\n", - PlantLoop(Count).LoopSide(LoopSideNum).Branch(PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumOut).Name, - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Branch(state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumOut).Name, + state.dataPlnt->PlantLoop(Count).Name, LoopString); } print(state.files.bnd, " Plant Loop Connector Nodes, {},Mixer,{},{},{},{},{}\n", Count1, - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name, - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.NodeNameIn(Count1), - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.NodeNameOut, - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.NodeNameIn(Count1), + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.NodeNameOut, + state.dataPlnt->PlantLoop(Count).Name, LoopString); } } } print(state.files.bnd, " Plant Loop Supply Connection,{},{},{}\n", - PlantLoop(Count).Name, - PlantLoop(Count).LoopSide(SupplySide).NodeNameOut, - PlantLoop(Count).LoopSide(DemandSide).NodeNameIn); + state.dataPlnt->PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(SupplySide).NodeNameOut, + state.dataPlnt->PlantLoop(Count).LoopSide(DemandSide).NodeNameIn); print(state.files.bnd, " Plant Loop Return Connection,{},{},{}\n", - PlantLoop(Count).Name, - PlantLoop(Count).LoopSide(DemandSide).NodeNameOut, - PlantLoop(Count).LoopSide(SupplySide).NodeNameIn); + state.dataPlnt->PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(DemandSide).NodeNameOut, + state.dataPlnt->PlantLoop(Count).LoopSide(SupplySide).NodeNameIn); } // Plant Demand Side Loop @@ -2537,65 +2537,65 @@ namespace SimulationManager { print(state.files.bnd, " Plant Loop,{},{},{},{},{},{}\n", - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).Name, LoopString, - PlantLoop(Count).LoopSide(LoopSideNum).NodeNameIn, - PlantLoop(Count).LoopSide(LoopSideNum).NodeNameOut, - PlantLoop(Count).LoopSide(LoopSideNum).BranchList, - PlantLoop(Count).LoopSide(LoopSideNum).ConnectList); + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).NodeNameIn, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).NodeNameOut, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).BranchList, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).ConnectList); // Plant Supply Side Splitter - if (PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Exists) { + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Exists) { print(state.files.bnd, " Plant Loop Connector,Splitter,{},{},{},{}\n", - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name, - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name, + state.dataPlnt->PlantLoop(Count).Name, LoopString, - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.TotalOutletNodes); - for (int Count1 = 1; Count1 <= PlantLoop(Count).LoopSide(LoopSideNum).Splitter.TotalOutletNodes; ++Count1) { + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.TotalOutletNodes); + for (int Count1 = 1; Count1 <= state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.TotalOutletNodes; ++Count1) { print(state.files.bnd, " Plant Loop Connector Branches,{},Splitter,{},", Count1, - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name); + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name); - if (PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumIn <= 0) { + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumIn <= 0) { print(state.files.bnd, "{},", errstring); } else { print(state.files.bnd, "{},", - PlantLoop(Count).LoopSide(LoopSideNum).Branch(PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumIn).Name); + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Branch(state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumIn).Name); } - if (PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumOut(Count1) <= 0) { - print(state.files.bnd, "{},{},{}\n", errstring, PlantLoop(Count).Name, LoopString); + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumOut(Count1) <= 0) { + print(state.files.bnd, "{},{},{}\n", errstring, state.dataPlnt->PlantLoop(Count).Name, LoopString); } else { print(state.files.bnd, "{},{},{}\n", - PlantLoop(Count) + state.dataPlnt->PlantLoop(Count) .LoopSide(LoopSideNum) - .Branch(PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumOut(Count1)) + .Branch(state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.BranchNumOut(Count1)) .Name, - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).Name, LoopString); } print(state.files.bnd, " Plant Loop Connector Nodes, {},Splitter,{},{},{},{},{}\n", Count1, - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name, - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.NodeNameIn, - PlantLoop(Count).LoopSide(LoopSideNum).Splitter.NodeNameOut(Count1), - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.NodeNameIn, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Splitter.NodeNameOut(Count1), + state.dataPlnt->PlantLoop(Count).Name, LoopString); } } // Plant Supply Side Mixer - if (PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Exists) { - const auto totalInletNodes = PlantLoop(Count).LoopSide(LoopSideNum).Mixer.TotalInletNodes; + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Exists) { + const auto totalInletNodes = state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.TotalInletNodes; print(state.files.bnd, " Plant Loop Connector,Mixer,{},{},{},{}\n", - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name, - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name, + state.dataPlnt->PlantLoop(Count).Name, LoopString, totalInletNodes); //',Supply,'// & @@ -2603,46 +2603,46 @@ namespace SimulationManager { print(state.files.bnd, " Plant Loop Connector Branches,{},Mixer,{},", Count1, - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name); + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name); - if (PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumIn(Count1) <= 0) { + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumIn(Count1) <= 0) { print(state.files.bnd, "{},", errstring); } else { print( state.files.bnd, "{},", - PlantLoop(Count).LoopSide(LoopSideNum).Branch(PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumIn(Count1)).Name); + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Branch(state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumIn(Count1)).Name); } - if (PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumOut <= 0) { - print(state.files.bnd, "{},{},{}\n", errstring, PlantLoop(Count).Name, LoopString); + if (state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumOut <= 0) { + print(state.files.bnd, "{},{},{}\n", errstring, state.dataPlnt->PlantLoop(Count).Name, LoopString); } else { print(state.files.bnd, "{},{},{}\n", - PlantLoop(Count).LoopSide(LoopSideNum).Branch(PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumOut).Name, - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Branch(state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.BranchNumOut).Name, + state.dataPlnt->PlantLoop(Count).Name, LoopString); } print(state.files.bnd, " Plant Loop Connector Nodes, {},Mixer,{},{},{},{},{}\n", Count1, - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name, - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.NodeNameIn(Count1), - PlantLoop(Count).LoopSide(LoopSideNum).Mixer.NodeNameOut, - PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.Name, + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.NodeNameIn(Count1), + state.dataPlnt->PlantLoop(Count).LoopSide(LoopSideNum).Mixer.NodeNameOut, + state.dataPlnt->PlantLoop(Count).Name, LoopString); } } } print(state.files.bnd, " Plant Loop Supply Connection,{},{},{}\n", - PlantLoop(Count).Name, - PlantLoop(Count).LoopSide(SupplySide).NodeNameOut, - PlantLoop(Count).LoopSide(DemandSide).NodeNameIn); + state.dataPlnt->PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(SupplySide).NodeNameOut, + state.dataPlnt->PlantLoop(Count).LoopSide(DemandSide).NodeNameIn); print(state.files.bnd, " Plant Loop Return Connection,{},{},{}\n", - PlantLoop(Count).Name, - PlantLoop(Count).LoopSide(DemandSide).NodeNameOut, - PlantLoop(Count).LoopSide(SupplySide).NodeNameIn); + state.dataPlnt->PlantLoop(Count).Name, + state.dataPlnt->PlantLoop(Count).LoopSide(DemandSide).NodeNameOut, + state.dataPlnt->PlantLoop(Count).LoopSide(SupplySide).NodeNameIn); } // Plant Demand Side Loop diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 8a53dedf482..01554410fe1 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -2004,7 +2004,6 @@ namespace EnergyPlus::SingleDuct { // Uses the status flags to trigger events. // Using/Aliasing - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterSimpleHeating; using DataZoneEquipment::CheckZoneEquipmentList; @@ -2048,7 +2047,7 @@ namespace EnergyPlus::SingleDuct { state.dataSingleDuct->InitSysFlag = false; } - if (this->PlantLoopScanFlag && allocated(PlantLoop)) { + if (this->PlantLoopScanFlag && allocated(state.dataPlnt->PlantLoop)) { if ((this->ReheatComp_PlantType == TypeOf_CoilWaterSimpleHeating) || (this->ReheatComp_PlantType == TypeOf_CoilSteamAirHeating)) { // setup plant topology indices for plant fed heating coils errFlag = false; @@ -2072,7 +2071,7 @@ namespace EnergyPlus::SingleDuct { } this->ReheatCoilOutletNode = - PlantLoop(this->HWLoopNum).LoopSide(this->HWLoopSide).Branch(this->HWBranchIndex).Comp(this->HWCompIndex).NodeNumOut; + state.dataPlnt->PlantLoop(this->HWLoopNum).LoopSide(this->HWLoopSide).Branch(this->HWBranchIndex).Comp(this->HWCompIndex).NodeNumOut; this->PlantLoopScanFlag = false; } else { @@ -2138,7 +2137,7 @@ namespace EnergyPlus::SingleDuct { if (this->HWLoopNum > 0 && this->ReheatComp_Num != HeatingCoilType::SteamAirHeating) { // protect early calls before plant is setup rho = GetDensityGlycol( - state, PlantLoop(this->HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); } else { rho = 1000.0; } @@ -2362,7 +2361,6 @@ namespace EnergyPlus::SingleDuct { // Using/Aliasing using DataHeatBalance::Zone; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -2977,14 +2975,14 @@ namespace EnergyPlus::SingleDuct { DesCoilLoad = DesZoneHeatLoad + PsyCpAirFnW(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); if (DesCoilLoad >= SmallLoad) { - rho = GetDensityGlycol(state, PlantLoop(this->HWLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(this->HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(state, PlantLoop(this->HWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(this->HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HWLoopNum).FluidIndex, RoutineName); MaxReheatWaterVolFlowDes = DesCoilLoad / (PlantSizData(PltSizHeatNum).DeltaT * Cp * rho); diff --git a/src/EnergyPlus/SizingAnalysisObjects.cc b/src/EnergyPlus/SizingAnalysisObjects.cc index 760f39096ae..7021b959b7b 100644 --- a/src/EnergyPlus/SizingAnalysisObjects.cc +++ b/src/EnergyPlus/SizingAnalysisObjects.cc @@ -502,7 +502,7 @@ void PlantCoinicidentAnalysis::ResolveDesignFlowRate(EnergyPlusData& state, int sizingFac = GlobalCoolSizingFactor; } else if (PlantSizData(plantSizingIndex).SizingFactorOption == LoopComponentSizingFactorMode) { // multiplier used for pumps, often 1.0, from component level sizing fractions - sizingFac = PlantLoop(plantLoopIndex).LoopSide(SupplySide).Branch(1).PumpSizFac; + sizingFac = state.dataPlnt->PlantLoop(plantLoopIndex).LoopSide(SupplySide).Branch(1).PumpSizFac; } newAdjustedMassFlowRate = newFoundMassFlowRate * sizingFac; // apply overall heating or cooling sizing factor @@ -527,14 +527,14 @@ void PlantCoinicidentAnalysis::ResolveDesignFlowRate(EnergyPlusData& state, int // set new size values for rest of simulation PlantSizData(plantSizingIndex).DesVolFlowRate = newVolDesignFlowRate; - if (PlantLoop(plantLoopIndex).MaxVolFlowRateWasAutoSized) { - PlantLoop(plantLoopIndex).MaxVolFlowRate = newVolDesignFlowRate; - PlantLoop(plantLoopIndex).MaxMassFlowRate = newAdjustedMassFlowRate; + if (state.dataPlnt->PlantLoop(plantLoopIndex).MaxVolFlowRateWasAutoSized) { + state.dataPlnt->PlantLoop(plantLoopIndex).MaxVolFlowRate = newVolDesignFlowRate; + state.dataPlnt->PlantLoop(plantLoopIndex).MaxMassFlowRate = newAdjustedMassFlowRate; } - if (PlantLoop(plantLoopIndex).VolumeWasAutoSized) { + if (state.dataPlnt->PlantLoop(plantLoopIndex).VolumeWasAutoSized) { // Note this calculation also appears in PlantManager::SizePlantLoop and PlantManager::ResizePlantLoopLevelSizes - PlantLoop(plantLoopIndex).Volume = PlantLoop(plantLoopIndex).MaxVolFlowRate * PlantLoop(plantLoopIndex).CirculationTime * 60.0; - PlantLoop(plantLoopIndex).Mass = PlantLoop(plantLoopIndex).Volume * densityForSizing; + state.dataPlnt->PlantLoop(plantLoopIndex).Volume = state.dataPlnt->PlantLoop(plantLoopIndex).MaxVolFlowRate * state.dataPlnt->PlantLoop(plantLoopIndex).CirculationTime * 60.0; + state.dataPlnt->PlantLoop(plantLoopIndex).Mass = state.dataPlnt->PlantLoop(plantLoopIndex).Volume * densityForSizing; } } @@ -576,43 +576,43 @@ void PlantCoinicidentAnalysis::ResolveDesignFlowRate(EnergyPlusData& state, int // report to sizing summary table called Plant Loop Coincident Design Fluid Flow Rates - PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizPrevVdot, PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, previousVolDesignFlowRate, 6); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizMeasVdot, PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, newFoundVolFlowRate, 6); - PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizCalcVdot, PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, newVolDesignFlowRate, 6); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizPrevVdot, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, previousVolDesignFlowRate, 6); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizMeasVdot, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, newFoundVolFlowRate, 6); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizCalcVdot, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, newVolDesignFlowRate, 6); if (setNewSizes) { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizCoincYesNo, PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, "Yes"); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizCoincYesNo, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, "Yes"); } else { - PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizCoincYesNo, PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, "No"); + PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizCoincYesNo, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, "No"); } if (!nullStampProblem) { if (!changedByDemand && !CheckTimeStampForNull(newFoundMassFlowRateTimeStamp)) { // bug fix #5665 if (newFoundMassFlowRateTimeStamp.envrnNum > 0) { // protect against invalid index PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizDesDay, - PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, + state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, state.dataWeatherManager->Environment(newFoundMassFlowRateTimeStamp.envrnNum).Title); } PreDefTableEntry(state, - state.dataOutRptPredefined->pdchPlantSizPkTimeDayOfSim, PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, newFoundMassFlowRateTimeStamp.dayOfSim); + state.dataOutRptPredefined->pdchPlantSizPkTimeDayOfSim, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, newFoundMassFlowRateTimeStamp.dayOfSim); PreDefTableEntry(state, - state.dataOutRptPredefined->pdchPlantSizPkTimeHour, PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, newFoundMassFlowRateTimeStamp.hourOfDay - 1); + state.dataOutRptPredefined->pdchPlantSizPkTimeHour, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, newFoundMassFlowRateTimeStamp.hourOfDay - 1); PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizPkTimeMin, - PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, + state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, newFoundMassFlowRateTimeStamp.stepStartMinute, 0); } else if (changedByDemand && !CheckTimeStampForNull(NewFoundMaxDemandTimeStamp)) { // bug fix #5665 if (NewFoundMaxDemandTimeStamp.envrnNum > 0) { // protect against invalid index PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSizDesDay, - PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, + state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, state.dataWeatherManager->Environment(NewFoundMaxDemandTimeStamp.envrnNum).Title); } PreDefTableEntry(state, - state.dataOutRptPredefined->pdchPlantSizPkTimeDayOfSim, PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, NewFoundMaxDemandTimeStamp.dayOfSim); + state.dataOutRptPredefined->pdchPlantSizPkTimeDayOfSim, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, NewFoundMaxDemandTimeStamp.dayOfSim); PreDefTableEntry(state, - state.dataOutRptPredefined->pdchPlantSizPkTimeHour, PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, NewFoundMaxDemandTimeStamp.hourOfDay - 1); + state.dataOutRptPredefined->pdchPlantSizPkTimeHour, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, NewFoundMaxDemandTimeStamp.hourOfDay - 1); PreDefTableEntry(state, - state.dataOutRptPredefined->pdchPlantSizPkTimeMin, PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, NewFoundMaxDemandTimeStamp.stepStartMinute, 0); + state.dataOutRptPredefined->pdchPlantSizPkTimeMin, state.dataPlnt->PlantLoop(plantLoopIndex).Name + " Sizing Pass " + chIteration, NewFoundMaxDemandTimeStamp.stepStartMinute, 0); } } } diff --git a/src/EnergyPlus/SolarCollectors.cc b/src/EnergyPlus/SolarCollectors.cc index 72f999cde9c..133a6601b70 100644 --- a/src/EnergyPlus/SolarCollectors.cc +++ b/src/EnergyPlus/SolarCollectors.cc @@ -782,7 +782,7 @@ namespace SolarCollectors { } if (this->SetLoopIndexFlag) { - if (allocated(DataPlant::PlantLoop)) { + if (allocated(state.dataPlnt->PlantLoop)) { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, this->TypeNum, this->WLoopNum, this->WLoopSideNum, this->WLoopBranchNum, this->WLoopCompNum, errFlag, _, _, _, _, _); @@ -802,9 +802,9 @@ namespace SolarCollectors { // Clear node initial conditions if (this->VolFlowRateMax > 0) { Real64 rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->WLoopNum).FluidName, + state.dataPlnt->PlantLoop(this->WLoopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->WLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->WLoopNum).FluidIndex, RoutineName); this->MassFlowRateMax = this->VolFlowRateMax * rho; @@ -988,7 +988,7 @@ namespace SolarCollectors { // Specific heat of collector fluid (J/kg-K) Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->WLoopNum).FluidName, inletTemp, DataPlant::PlantLoop(this->WLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->WLoopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(this->WLoopNum).FluidIndex, RoutineName); // Gross area of collector (m2) Real64 area = DataSurfaces::Surface(SurfNum).Area; @@ -1260,11 +1260,11 @@ namespace SolarCollectors { // Specific heat of collector fluid (J/kg-K) Real64 Cpw = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->WLoopNum).FluidName, inletTemp, DataPlant::PlantLoop(this->WLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->WLoopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(this->WLoopNum).FluidIndex, RoutineName); // density of collector fluid (kg/m3) Real64 Rhow = FluidProperties::GetDensityGlycol( - state, DataPlant::PlantLoop(this->WLoopNum).FluidName, inletTemp, DataPlant::PlantLoop(this->WLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->WLoopNum).FluidName, inletTemp, state.dataPlnt->PlantLoop(this->WLoopNum).FluidIndex, RoutineName); // calculate heat transfer coefficients and covers temperature: this->CalcHeatTransCoeffAndCoverTemp(state); @@ -1967,11 +1967,11 @@ namespace SolarCollectors { static std::string const RoutineName("UpdateSolarCollector"); - PlantUtilities::SafeCopyPlantNode(this->InletNode, this->OutletNode); + PlantUtilities::SafeCopyPlantNode(state, this->InletNode, this->OutletNode); // Set outlet node variables that are possibly changed DataLoopNode::Node(this->OutletNode).Temp = this->OutletTemp; Real64 Cp = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->WLoopNum).FluidName, this->OutletTemp, DataPlant::PlantLoop(this->WLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(this->WLoopNum).FluidName, this->OutletTemp, state.dataPlnt->PlantLoop(this->WLoopNum).FluidIndex, RoutineName); DataLoopNode::Node(this->OutletNode).Enthalpy = Cp * DataLoopNode::Node(this->OutletNode).Temp; } diff --git a/src/EnergyPlus/StandardRatings.cc b/src/EnergyPlus/StandardRatings.cc index 24c63d9267f..56617f9750c 100644 --- a/src/EnergyPlus/StandardRatings.cc +++ b/src/EnergyPlus/StandardRatings.cc @@ -256,7 +256,6 @@ namespace StandardRatings { // Using/Aliasing using CurveManager::CurveValue; using CurveManager::GetCurveName; - using DataPlant::PlantLoop; using DataPlant::TypeOf_Chiller_ElectricEIR; using DataPlant::TypeOf_Chiller_ElectricReformEIR; using FluidProperties::GetDensityGlycol; @@ -383,10 +382,10 @@ namespace StandardRatings { } else if (SELECT_CASE_var == TypeOf_Chiller_ElectricReformEIR) { Cp = GetSpecificHeatGlycol( - state, PlantLoop(CondLoopNum).FluidName, EnteringWaterTempReduced, PlantLoop(CondLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(CondLoopNum).FluidName, EnteringWaterTempReduced, state.dataPlnt->PlantLoop(CondLoopNum).FluidIndex, RoutineName); Rho = - GetDensityGlycol(state, PlantLoop(CondLoopNum).FluidName, EnteringWaterTempReduced, PlantLoop(CondLoopNum).FluidIndex, RoutineName); + GetDensityGlycol(state, state.dataPlnt->PlantLoop(CondLoopNum).FluidName, EnteringWaterTempReduced, state.dataPlnt->PlantLoop(CondLoopNum).FluidIndex, RoutineName); Par(1) = EnteringWaterTempReduced; Par(2) = EvapOutletTemp; diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index 0d776289d60..fabf30e8e01 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -111,7 +111,6 @@ namespace SteamBaseboardRadiator { using DataLoopNode::NodeConnectionType_Outlet; using DataLoopNode::NodeType_Steam; using DataLoopNode::ObjectIsNotParent; - using DataPlant::PlantLoop; using DataPlant::TypeOf_Baseboard_Rad_Conv_Steam; using DataZoneEquipment::CheckZoneEquipmentList; using DataZoneEquipment::ZoneEquipConfig; @@ -765,7 +764,7 @@ namespace SteamBaseboardRadiator { } if (state.dataSteamBaseboardRadiator->SetLoopIndexFlag(BaseboardNum)) { - if (allocated(PlantLoop)) { + if (allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).EquipID, @@ -921,7 +920,7 @@ namespace SteamBaseboardRadiator { int CapSizingMethod(0); // capacity sizing methods (HeatingDesignCapacity, CapacityPerFloorArea, and FractionOfAutosizedHeatingCapacity ) // Find the appropriate steam plant sizing object - PltSizSteamNum = PlantLoop(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum).PlantSizNum; + PltSizSteamNum = state.dataPlnt->PlantLoop(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum).PlantSizNum; // PltSizSteamNum = MyPlantSizingIndex('Coil:Heating:Steam', SteamBaseboard(BaseboardNum)%EquipID, & // SteamBaseboard(BaseboardNum)%SteamInletNode, & // SteamBaseboard(BaseboardNum)%SteamOutletNode, ErrorsFound) @@ -1209,7 +1208,7 @@ namespace SteamBaseboardRadiator { // Set the outlet air nodes of the Baseboard // Set the outlet water nodes for the Coil - SafeCopyPlantNode(SteamInletNode, SteamOutletNode); + SafeCopyPlantNode(state, SteamInletNode, SteamOutletNode); Node(SteamOutletNode).Temp = state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamOutletTemp; Node(SteamOutletNode).Enthalpy = state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamOutletEnthalpy; } @@ -1492,7 +1491,7 @@ namespace SteamBaseboardRadiator { return; } - PullCompInterconnectTrigger(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, + PullCompInterconnectTrigger(state, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopSideNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).BranchNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).CompNum, @@ -1502,7 +1501,7 @@ namespace SteamBaseboardRadiator { DataPlant::iCriteriaType::HeatTransferRate, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).Power); - PullCompInterconnectTrigger(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, + PullCompInterconnectTrigger(state, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopSideNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).BranchNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).CompNum, @@ -1512,7 +1511,7 @@ namespace SteamBaseboardRadiator { DataPlant::iCriteriaType::MassFlowRate, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).SteamMassFlowRate); - PullCompInterconnectTrigger(state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, + PullCompInterconnectTrigger(state, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).LoopSideNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).BranchNum, state.dataSteamBaseboardRadiator->SteamBaseboard(BaseboardNum).CompNum, diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index f652c4e1069..c6d065a2f41 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -99,7 +99,6 @@ namespace SteamCoils { using namespace DataHVACGlobals; using namespace Psychrometrics; using namespace FluidProperties; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::ScanPlantLoopsForObject; @@ -474,7 +473,7 @@ namespace SteamCoils { state.dataSteamCoils->MyOneTimeFlag = false; } - if (MyPlantScanFlag(CoilNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(CoilNum) && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataSteamCoils->SteamCoil(CoilNum).Name, @@ -1416,7 +1415,7 @@ namespace SteamCoils { Node(AirOutletNode).HumRat = state.dataSteamCoils->SteamCoil(CoilNum).OutletAirHumRat; Node(AirOutletNode).Enthalpy = state.dataSteamCoils->SteamCoil(CoilNum).OutletAirEnthalpy; - SafeCopyPlantNode(SteamInletNode, SteamOutletNode); + SafeCopyPlantNode(state, SteamInletNode, SteamOutletNode); // Set the outlet Steam nodes for the Coil // Node(SteamOutletNode)%MassFlowRate = SteamCoil(CoilNum)%OutletSteamMassFlowRate diff --git a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc index 9752ef64ec5..6f00f6f33ec 100644 --- a/src/EnergyPlus/SurfaceGroundHeatExchanger.cc +++ b/src/EnergyPlus/SurfaceGroundHeatExchanger.cc @@ -416,7 +416,6 @@ namespace SurfaceGroundHeatExchanger { using namespace DataEnvironment; using DataHeatBalance::TotConstructs; using DataLoopNode::Node; - using DataPlant::PlantLoop; using DataPlant::TypeOf_GrndHtExchgSurface; using FluidProperties::GetDensityGlycol; using PlantUtilities::InitComponentNodes; @@ -448,7 +447,7 @@ namespace SurfaceGroundHeatExchanger { if (errFlag) { ShowFatalError(state, "InitSurfaceGroundHeatExchanger: Program terminated due to previous condition(s)."); } - rho = GetDensityGlycol(state, PlantLoop(this->LoopNum).FluidName, DataPrecisionGlobals::constant_zero, PlantLoop(this->LoopNum).FluidIndex, RoutineName); + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataPrecisionGlobals::constant_zero, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); this->DesignMassFlowRate = DataGlobalConstants::Pi / 4.0 * pow_2(this->TubeDiameter) * DesignVelocity * rho * this->TubeCircuits; InitComponentNodes(0.0, this->DesignMassFlowRate, @@ -535,7 +534,7 @@ namespace SurfaceGroundHeatExchanger { // If loop operation is controlled by an environmental variable (DBtemp, WBtemp, etc) // then shut branch down when equipment is not scheduled to run. - DesignFlow = RegulateCondenserCompFlowReqOp(this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, this->DesignMassFlowRate); + DesignFlow = RegulateCondenserCompFlowReqOp(state, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum, this->DesignMassFlowRate); SetComponentFlowRate(state, DesignFlow, this->InletNodeNum, this->OutletNodeNum, this->LoopNum, this->LoopSideNum, this->BranchNum, this->CompNum); @@ -587,7 +586,6 @@ namespace SurfaceGroundHeatExchanger { // Using/Aliasing using DataLoopNode::Node; using namespace DataEnvironment; - using DataPlant::PlantLoop; Real64 const SurfFluxTol(0.001); // tolerance on the surface fluxes Real64 const SrcFluxTol(0.001); // tolerance on the source flux @@ -1051,7 +1049,6 @@ namespace SurfaceGroundHeatExchanger { // Code based loosely on code from IBLAST program (research version) // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; // Return value @@ -1119,7 +1116,7 @@ namespace SurfaceGroundHeatExchanger { } // arguments are glycol name, temperature, and concentration if (Temperature < 0.0) { // check if fluid is water and would be freezing - if (PlantLoop(this->LoopNum).FluidIndex == WaterIndex) { + if (state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex == WaterIndex) { if (this->FrozenErrIndex1 == 0) { ShowWarningMessage( state, @@ -1138,7 +1135,7 @@ namespace SurfaceGroundHeatExchanger { this->InletTemp = max(this->InletTemp, 0.0); } } - CpWater = GetSpecificHeatGlycol(state, PlantLoop(this->LoopNum).FluidName, Temperature, PlantLoop(this->LoopNum).FluidIndex, RoutineName); + CpWater = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, Temperature, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) ReD = 4.0 * WaterMassFlow / (DataGlobalConstants::Pi * MUactual * this->TubeDiameter * this->TubeCircuits); @@ -1321,7 +1318,6 @@ namespace SurfaceGroundHeatExchanger { using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::SafeCopyPlantNode; @@ -1351,7 +1347,7 @@ namespace SurfaceGroundHeatExchanger { // Calculate the water side outlet conditions and set the // appropriate conditions on the correct HVAC node. - if (PlantLoop(this->LoopNum).FluidName == "WATER") { + if (state.dataPlnt->PlantLoop(this->LoopNum).FluidName == "WATER") { if (InletTemp < 0.0) { ShowRecurringWarningErrorAtEnd(state, "UpdateSurfaceGroundHeatExchngr: Water is frozen in Surf HX=" + this->Name, this->FrozenErrIndex2, this->InletTemp, this->InletTemp); @@ -1359,9 +1355,9 @@ namespace SurfaceGroundHeatExchanger { this->InletTemp = max(this->InletTemp, 0.0); } - CpFluid = GetSpecificHeatGlycol(state, PlantLoop(this->LoopNum).FluidName, this->InletTemp, PlantLoop(this->LoopNum).FluidIndex, RoutineName); + CpFluid = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, this->InletTemp, state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, RoutineName); - SafeCopyPlantNode(this->InletNodeNum, this->OutletNodeNum); + SafeCopyPlantNode(state, this->InletNodeNum, this->OutletNodeNum); // check for flow if ((CpFluid > 0.0) && (state.dataSurfaceGroundHeatExchangers->FlowRate > 0.0)) { Node(this->OutletNodeNum).Temp = this->InletTemp - this->SurfaceArea * state.dataSurfaceGroundHeatExchangers->SourceFlux / (state.dataSurfaceGroundHeatExchangers->FlowRate * CpFluid); diff --git a/src/EnergyPlus/SwimmingPool.cc b/src/EnergyPlus/SwimmingPool.cc index 80730788e1d..58ba20f323e 100644 --- a/src/EnergyPlus/SwimmingPool.cc +++ b/src/EnergyPlus/SwimmingPool.cc @@ -702,7 +702,7 @@ namespace SwimmingPool { bool errFlag; static std::string const RoutineName("InitSwimmingPoolPlantLoopIndex"); - if (MyPlantScanFlagPool && allocated(DataPlant::PlantLoop)) { + if (MyPlantScanFlagPool && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; if (this->WaterInletNode > 0) { PlantUtilities::ScanPlantLoopsForObject(state, @@ -924,7 +924,7 @@ namespace SwimmingPool { int WaterInletNode = this->WaterInletNode; // inlet node number int WaterOutletNode = this->WaterOutletNode; // outlet node number - PlantUtilities::SafeCopyPlantNode(WaterInletNode, WaterOutletNode); + PlantUtilities::SafeCopyPlantNode(state, WaterInletNode, WaterOutletNode); Real64 WaterMassFlow = DataLoopNode::Node(WaterInletNode).MassFlowRate; // water mass flow rate if (WaterMassFlow > 0.0) DataLoopNode::Node(WaterOutletNode).Temp = this->PoolWaterTemp; diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index 12df105636a..de40e5df081 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -694,7 +694,6 @@ namespace UnitHeater { using DataHVACGlobals::ZoneComp; using DataHVACGlobals::ZoneCompTurnFansOff; using DataHVACGlobals::ZoneCompTurnFansOn; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterSimpleHeating; using DataZoneEquipment::CheckZoneEquipmentList; @@ -748,7 +747,7 @@ namespace UnitHeater { state.dataUnitHeaters->UnitHeat(UnitHeatNum).AvailStatus = ZoneComp(UnitHeater_Num).ZoneCompAvailMgrs(UnitHeatNum).AvailStatus; } - if (MyPlantScanFlag(UnitHeatNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(UnitHeatNum) && allocated(state.dataPlnt->PlantLoop)) { if ((state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) || (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating)) { errFlag = false; @@ -770,7 +769,7 @@ namespace UnitHeater { ShowFatalError(state, "InitUnitHeater: Program terminated due to previous condition(s)."); } - state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotCoilOutNodeNum = PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum) + state.dataUnitHeaters->UnitHeat(UnitHeatNum).HotCoilOutNodeNum = state.dataPlnt->PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum) .LoopSide(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopSide) .Branch(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWBranchNum) .Comp(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWCompNum) @@ -814,9 +813,9 @@ namespace UnitHeater { Node(InNode).MassFlowRateMin = 0.0; if (state.dataUnitHeaters->UnitHeat(UnitHeatNum).HCoilType == state.dataUnitHeaters->WaterHeatingCoil) { - rho = GetDensityGlycol(state, PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, RoutineName); state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxHotWaterFlow = rho * state.dataUnitHeaters->UnitHeat(UnitHeatNum).MaxVolHotWaterFlow; @@ -931,7 +930,6 @@ namespace UnitHeater { using DataHeatBalance::Zone; using DataHVACGlobals::HeatingAirflowSizing; using DataHVACGlobals::HeatingCapacitySizing; - using DataPlant::PlantLoop; using PlantUtilities::MyPlantSizingIndex; using Psychrometrics::CPHW; @@ -1174,13 +1172,13 @@ namespace UnitHeater { } if (DesCoilLoad >= SmallLoad) { - rho = GetDensityGlycol(state, PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, RoutineName); MaxVolHotWaterFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); } else { diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index 4369c647ddd..4fc1a4fced2 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -1226,7 +1226,6 @@ namespace UnitVentilator { using DataHVACGlobals::ZoneComp; using DataHVACGlobals::ZoneCompTurnFansOff; using DataHVACGlobals::ZoneCompTurnFansOn; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterCooling; using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; @@ -1284,7 +1283,7 @@ namespace UnitVentilator { state.dataUnitVentilators->UnitVent(UnitVentNum).AvailStatus = ZoneComp(UnitVentilator_Num).ZoneCompAvailMgrs(UnitVentNum).AvailStatus; } - if (MyPlantScanFlag(UnitVentNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(UnitVentNum) && allocated(state.dataPlnt->PlantLoop)) { if ((state.dataUnitVentilators->UnitVent(UnitVentNum).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) || (state.dataUnitVentilators->UnitVent(UnitVentNum).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating)) { errFlag = false; @@ -1306,7 +1305,7 @@ namespace UnitVentilator { ShowFatalError(state, "InitUnitVentilator: Program terminated due to previous condition(s)."); } - state.dataUnitVentilators->UnitVent(UnitVentNum).HotCoilOutNodeNum = PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum) + state.dataUnitVentilators->UnitVent(UnitVentNum).HotCoilOutNodeNum = state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum) .LoopSide(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopSide) .Branch(state.dataUnitVentilators->UnitVent(UnitVentNum).HWBranchNum) .Comp(state.dataUnitVentilators->UnitVent(UnitVentNum).HWCompNum) @@ -1333,7 +1332,7 @@ namespace UnitVentilator { ShowFatalError(state, "InitUnitVentilator: Program terminated due to previous condition(s)."); } - state.dataUnitVentilators->UnitVent(UnitVentNum).ColdCoilOutNodeNum = PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum) + state.dataUnitVentilators->UnitVent(UnitVentNum).ColdCoilOutNodeNum = state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum) .LoopSide(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopSide) .Branch(state.dataUnitVentilators->UnitVent(UnitVentNum).CWBranchNum) .Comp(state.dataUnitVentilators->UnitVent(UnitVentNum).CWCompNum) @@ -1397,9 +1396,9 @@ namespace UnitVentilator { if (state.dataUnitVentilators->UnitVent(UnitVentNum).HCoilType == state.dataUnitVentilators->Heating_WaterCoilType) { - rho = GetDensityGlycol(state, PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidIndex, RoutineName); state.dataUnitVentilators->UnitVent(UnitVentNum).MaxHotWaterFlow = rho * state.dataUnitVentilators->UnitVent(UnitVentNum).MaxVolHotWaterFlow; @@ -1433,7 +1432,7 @@ namespace UnitVentilator { if (state.dataUnitVentilators->UnitVent(UnitVentNum).CCoilPresent) { // Only initialize these if a cooling coil is actually present rho = GetDensityGlycol( - state, PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidName, 5.0, PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidName, 5.0, state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidIndex, RoutineName); state.dataUnitVentilators->UnitVent(UnitVentNum).MaxColdWaterFlow = rho * state.dataUnitVentilators->UnitVent(UnitVentNum).MaxVolColdWaterFlow; state.dataUnitVentilators->UnitVent(UnitVentNum).MinColdWaterFlow = rho * state.dataUnitVentilators->UnitVent(UnitVentNum).MinVolColdWaterFlow; @@ -1562,7 +1561,6 @@ namespace UnitVentilator { using DataHVACGlobals::CoolingCapacitySizing; using DataHVACGlobals::HeatingAirflowSizing; using DataHVACGlobals::HeatingCapacitySizing; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -2150,13 +2148,13 @@ namespace UnitVentilator { sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); DesHeatingLoad = sizerHeatingCapacity.size(state, TempSize, errorsFound); } - rho = GetDensityGlycol(state, PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).HWLoopNum).FluidIndex, RoutineName); MaxVolHotWaterFlowDes = DesHeatingLoad / (WaterCoilSizDeltaT * Cp * rho); @@ -2406,13 +2404,13 @@ namespace UnitVentilator { sizerCoolingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); DesCoolingLoad = sizerCoolingCapacity.size(state, TempSize, ErrorsFound); } - rho = GetDensityGlycol(state, PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidName, 5., - PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidName, 5., - PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataUnitVentilators->UnitVent(UnitVentNum).CWLoopNum).FluidIndex, RoutineName); MaxVolColdWaterFlowDes = DesCoolingLoad / (WaterCoilSizDeltaT * Cp * rho); diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 8e3a352beac..fa6d62853be 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -583,7 +583,7 @@ namespace UnitarySystems { } // Scan hot water and steam heating coil plant components for one time initializations - if (this->m_MyPlantScanFlag && allocated(DataPlant::PlantLoop)) { + if (this->m_MyPlantScanFlag && allocated(state.dataPlnt->PlantLoop)) { if (this->m_HeatRecActive) { state.dataUnitarySystems->initUnitarySystemsErrFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, @@ -650,14 +650,14 @@ namespace UnitarySystems { this->MaxCoolCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, CoolingCoilType, CoolingCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); if (this->MaxCoolCoilFluidFlow > 0.0) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CoolCoilLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CoolCoilLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CoolCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CoolCoilLoopNum).FluidIndex, routineName); this->MaxCoolCoilFluidFlow *= rho; } // fill outlet node for coil - this->CoolCoilFluidOutletNodeNum = DataPlant::PlantLoop(this->CoolCoilLoopNum) + this->CoolCoilFluidOutletNodeNum = state.dataPlnt->PlantLoop(this->CoolCoilLoopNum) .LoopSide(this->CoolCoilLoopSide) .Branch(this->CoolCoilBranchNum) .Comp(this->CoolCoilCompNum) @@ -700,9 +700,9 @@ namespace UnitarySystems { WaterCoils::GetCoilMaxWaterFlowRate(state, HeatingCoilType, this->m_HeatingCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); if (this->MaxHeatCoilFluidFlow > 0.0) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->HeatCoilLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HeatCoilLoopNum).FluidIndex, routineName); this->MaxHeatCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, HeatingCoilType, this->m_HeatingCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound) * rho; @@ -717,7 +717,7 @@ namespace UnitarySystems { } } // fill outlet node for coil - this->HeatCoilFluidOutletNodeNum = DataPlant::PlantLoop(this->HeatCoilLoopNum) + this->HeatCoilFluidOutletNodeNum = state.dataPlnt->PlantLoop(this->HeatCoilLoopNum) .LoopSide(this->HeatCoilLoopSide) .Branch(this->HeatCoilBranchNum) .Comp(this->HeatCoilCompNum) @@ -731,7 +731,7 @@ namespace UnitarySystems { } // Scan Supplemental hot water and steam heating coil plant components for one time initializations - if (this->m_MySuppCoilPlantScanFlag && allocated(DataPlant::PlantLoop)) { + if (this->m_MySuppCoilPlantScanFlag && allocated(state.dataPlnt->PlantLoop)) { if (this->m_SuppHeatCoilType_Num == DataHVACGlobals::Coil_HeatingWater) { state.dataUnitarySystems->initUnitarySystemsErrFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, @@ -759,15 +759,15 @@ namespace UnitarySystems { WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); if (this->m_MaxSuppCoilFluidFlow > 0.0) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->m_SuppCoilLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->m_SuppCoilLoopNum).FluidIndex, routineName); this->m_MaxSuppCoilFluidFlow = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound) * rho; } // fill outlet node for coil - this->m_SuppCoilFluidOutletNodeNum = DataPlant::PlantLoop(this->m_SuppCoilLoopNum) + this->m_SuppCoilFluidOutletNodeNum = state.dataPlnt->PlantLoop(this->m_SuppCoilLoopNum) .LoopSide(this->m_SuppCoilLoopSide) .Branch(this->m_SuppCoilBranchNum) .Comp(this->m_SuppCoilCompNum) @@ -800,7 +800,7 @@ namespace UnitarySystems { } // fill outlet node for coil - this->m_SuppCoilFluidOutletNodeNum = DataPlant::PlantLoop(this->m_SuppCoilLoopNum) + this->m_SuppCoilFluidOutletNodeNum = state.dataPlnt->PlantLoop(this->m_SuppCoilLoopNum) .LoopSide(this->m_SuppCoilLoopSide) .Branch(this->m_SuppCoilBranchNum) .Comp(this->m_SuppCoilCompNum) @@ -831,9 +831,9 @@ namespace UnitarySystems { if ((this->m_HeatRecActive) && (!this->m_MyPlantScanFlag)) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->m_HRLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->m_HRLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - DataPlant::PlantLoop(this->m_HRLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->m_HRLoopNum).FluidIndex, routineName); this->m_DesignHeatRecMassFlowRate = this->m_DesignHRWaterVolumeFlow * rho; @@ -862,9 +862,9 @@ namespace UnitarySystems { Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, CoolingCoilType, this->m_CoolingCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->CoolCoilLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CoolCoilLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->CoolCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->CoolCoilLoopNum).FluidIndex, routineName); this->MaxCoolCoilFluidFlow = CoilMaxVolFlowRate * rho; } @@ -888,9 +888,9 @@ namespace UnitarySystems { Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_HeatingCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->HeatCoilLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HeatCoilLoopNum).FluidIndex, routineName); this->MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * rho; } @@ -930,9 +930,9 @@ namespace UnitarySystems { Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_SuppHeatCoilName, state.dataUnitarySystems->initUnitarySystemsErrorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->m_SuppCoilLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->m_SuppCoilLoopNum).FluidIndex, routineName); this->m_MaxSuppCoilFluidFlow = CoilMaxVolFlowRate * rho; } @@ -9470,9 +9470,9 @@ namespace UnitarySystems { WaterCoils::SimulateWaterCoilComponents(state, this->m_HeatingCoilName, FirstHVACIteration, this->m_HeatingCoilIndex); Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_HeatingCoilName, errorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->HeatCoilLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->HeatCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->HeatCoilLoopNum).FluidIndex, routineName); this->MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * rho; } @@ -9511,9 +9511,9 @@ namespace UnitarySystems { WaterCoils::SimulateWaterCoilComponents(state, this->m_SuppHeatCoilName, FirstHVACIteration, this->m_SuppHeatCoilIndex); Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_SuppHeatCoilName, errorsFound); if (CoilMaxVolFlowRate != DataSizing::AutoSize) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->m_SuppCoilLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(this->m_SuppCoilLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->m_SuppCoilLoopNum).FluidIndex, routineName); this->m_MaxSuppCoilFluidFlow = CoilMaxVolFlowRate * rho; } @@ -14117,7 +14117,7 @@ namespace UnitarySystems { if (HeatRecMassFlowRate > 0.0) { Real64 CpHeatRec = FluidProperties::GetSpecificHeatGlycol( - state, DataPlant::PlantLoop(this->m_HRLoopNum).FluidName, HeatRecInletTemp, DataPlant::PlantLoop(this->m_HRLoopNum).FluidIndex, routineName); + state, state.dataPlnt->PlantLoop(this->m_HRLoopNum).FluidName, HeatRecInletTemp, state.dataPlnt->PlantLoop(this->m_HRLoopNum).FluidIndex, routineName); HeatRecOutletTemp = QHeatRec / (HeatRecMassFlowRate * CpHeatRec) + HeatRecInletTemp; // coil model should be handling max outlet water temp (via limit to heat transfer) since heat rejection needs to be accounted for by the @@ -14131,7 +14131,7 @@ namespace UnitarySystems { QHeatRec = 0.0; } - PlantUtilities::SafeCopyPlantNode(HeatRecInNode, HeatRecOutNode); + PlantUtilities::SafeCopyPlantNode(state, HeatRecInNode, HeatRecOutNode); DataLoopNode::Node(HeatRecOutNode).Temp = HeatRecOutletTemp; diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index ac962d4a2cc..9ce0901c57d 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -2093,14 +2093,14 @@ namespace UserDefinedComponents { } // set user input for flow priority - DataPlant::PlantLoop(this->Loop(ConnectionNum).LoopNum) + state.dataPlnt->PlantLoop(this->Loop(ConnectionNum).LoopNum) .LoopSide(this->Loop(ConnectionNum).LoopSideNum) .Branch(this->Loop(ConnectionNum).BranchNum) .Comp(this->Loop(ConnectionNum).CompNum) .FlowPriority = this->Loop(ConnectionNum).FlowPriority; // set user input for how loads served - DataPlant::PlantLoop(this->Loop(ConnectionNum).LoopNum) + state.dataPlnt->PlantLoop(this->Loop(ConnectionNum).LoopNum) .LoopSide(this->Loop(ConnectionNum).LoopSideNum) .Branch(this->Loop(ConnectionNum).BranchNum) .Comp(this->Loop(ConnectionNum).CompNum) @@ -2114,13 +2114,13 @@ namespace UserDefinedComponents { // fill internal variable targets this->Loop(LoopNum).MyLoad = MyLoad; - this->Loop(LoopNum).InletRho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->Loop(LoopNum).LoopNum).FluidName, + this->Loop(LoopNum).InletRho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->Loop(LoopNum).LoopNum).FluidName, DataLoopNode::Node(this->Loop(LoopNum).InletNodeNum).Temp, - DataPlant::PlantLoop(this->Loop(LoopNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Loop(LoopNum).LoopNum).FluidIndex, RoutineName); - this->Loop(LoopNum).InletCp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->Loop(LoopNum).LoopNum).FluidName, + this->Loop(LoopNum).InletCp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->Loop(LoopNum).LoopNum).FluidName, DataLoopNode::Node(this->Loop(LoopNum).InletNodeNum).Temp, - DataPlant::PlantLoop(this->Loop(LoopNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Loop(LoopNum).LoopNum).FluidIndex, RoutineName); this->Loop(LoopNum).InletMassFlowRate = DataLoopNode::Node(this->Loop(LoopNum).InletNodeNum).MassFlowRate; this->Loop(LoopNum).InletTemp = DataLoopNode::Node(this->Loop(LoopNum).InletNodeNum).Temp; @@ -2163,14 +2163,14 @@ namespace UserDefinedComponents { ShowFatalError(state, "InitPlantUserComponent: Program terminated due to previous condition(s)."); } // set user input for flow priority - DataPlant::PlantLoop(this->Loop.LoopNum) + state.dataPlnt->PlantLoop(this->Loop.LoopNum) .LoopSide(this->Loop.LoopSideNum) .Branch(this->Loop.BranchNum) .Comp(this->Loop.CompNum) .FlowPriority = this->Loop.FlowPriority; // set user input for how loads served - DataPlant::PlantLoop(this->Loop.LoopNum) + state.dataPlnt->PlantLoop(this->Loop.LoopNum) .LoopSide(this->Loop.LoopSideNum) .Branch(this->Loop.BranchNum) .Comp(this->Loop.CompNum) @@ -2193,13 +2193,13 @@ namespace UserDefinedComponents { } if (this->PlantIsConnected) { - this->Loop.InletRho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->Loop.LoopNum).FluidName, + this->Loop.InletRho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->Loop.LoopNum).FluidName, DataLoopNode::Node(this->Loop.InletNodeNum).Temp, - DataPlant::PlantLoop(this->Loop.LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Loop.LoopNum).FluidIndex, RoutineName); - this->Loop.InletCp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->Loop.LoopNum).FluidName, + this->Loop.InletCp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->Loop.LoopNum).FluidName, DataLoopNode::Node(this->Loop.InletNodeNum).Temp, - DataPlant::PlantLoop(this->Loop.LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Loop.LoopNum).FluidIndex, RoutineName); this->Loop.InletTemp = DataLoopNode::Node(this->Loop.InletNodeNum).Temp; this->Loop.InletMassFlowRate = DataLoopNode::Node(this->Loop.InletNodeNum).MassFlowRate; @@ -2240,14 +2240,14 @@ namespace UserDefinedComponents { ShowFatalError(state, "InitPlantUserComponent: Program terminated due to previous condition(s)."); } // set user input for flow priority - DataPlant::PlantLoop(this->Loop(loop).LoopNum) + state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum) .LoopSide(this->Loop(loop).LoopSideNum) .Branch(this->Loop(loop).BranchNum) .Comp(this->Loop(loop).CompNum) .FlowPriority = this->Loop(loop).FlowPriority; // set user input for how loads served - DataPlant::PlantLoop(this->Loop(loop).LoopNum) + state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum) .LoopSide(this->Loop(loop).LoopSideNum) .Branch(this->Loop(loop).BranchNum) .Comp(this->Loop(loop).CompNum) @@ -2282,13 +2282,13 @@ namespace UserDefinedComponents { if (this->NumPlantConnections > 0) { for (int loop = 1; loop <= this->NumPlantConnections; ++loop) { - this->Loop(loop).InletRho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->Loop(loop).LoopNum).FluidName, + this->Loop(loop).InletRho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum).FluidName, DataLoopNode::Node(this->Loop(loop).InletNodeNum).Temp, - DataPlant::PlantLoop(this->Loop(loop).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum).FluidIndex, RoutineName); - this->Loop(loop).InletCp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->Loop(loop).LoopNum).FluidName, + this->Loop(loop).InletCp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum).FluidName, DataLoopNode::Node(this->Loop(loop).InletNodeNum).Temp, - DataPlant::PlantLoop(this->Loop(loop).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum).FluidIndex, RoutineName); this->Loop(loop).InletTemp = DataLoopNode::Node(this->Loop(loop).InletNodeNum).Temp; this->Loop(loop).InletMassFlowRate = DataLoopNode::Node(this->Loop(loop).InletNodeNum).MassFlowRate; @@ -2327,14 +2327,14 @@ namespace UserDefinedComponents { ShowFatalError(state, "InitPlantUserComponent: Program terminated due to previous condition(s)."); } // set user input for flow priority - DataPlant::PlantLoop(this->Loop(loop).LoopNum) + state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum) .LoopSide(this->Loop(loop).LoopSideNum) .Branch(this->Loop(loop).BranchNum) .Comp(this->Loop(loop).CompNum) .FlowPriority = this->Loop(loop).FlowPriority; // set user input for how loads served - DataPlant::PlantLoop(this->Loop(loop).LoopNum) + state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum) .LoopSide(this->Loop(loop).LoopSideNum) .Branch(this->Loop(loop).BranchNum) .Comp(this->Loop(loop).CompNum) @@ -2369,13 +2369,13 @@ namespace UserDefinedComponents { if (this->NumPlantConnections > 0) { for (int loop = 1; loop <= this->NumPlantConnections; ++loop) { - this->Loop(loop).InletRho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->Loop(loop).LoopNum).FluidName, + this->Loop(loop).InletRho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum).FluidName, DataLoopNode::Node(this->Loop(loop).InletNodeNum).Temp, - DataPlant::PlantLoop(this->Loop(loop).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum).FluidIndex, RoutineName); - this->Loop(loop).InletCp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->Loop(loop).LoopNum).FluidName, + this->Loop(loop).InletCp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum).FluidName, DataLoopNode::Node(this->Loop(loop).InletNodeNum).Temp, - DataPlant::PlantLoop(this->Loop(loop).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->Loop(loop).LoopNum).FluidIndex, RoutineName); this->Loop(loop).InletTemp = DataLoopNode::Node(this->Loop(loop).InletNodeNum).Temp; this->Loop(loop).InletMassFlowRate = DataLoopNode::Node(this->Loop(loop).InletNodeNum).MassFlowRate; @@ -2398,7 +2398,7 @@ namespace UserDefinedComponents { // METHODOLOGY EMPLOYED: // copy actuated values to structures elsewhere in program. - PlantUtilities::SafeCopyPlantNode(this->Loop(LoopNum).InletNodeNum, this->Loop(LoopNum).OutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->Loop(LoopNum).InletNodeNum, this->Loop(LoopNum).OutletNodeNum); // unload Actuators to node data structure @@ -2429,7 +2429,7 @@ namespace UserDefinedComponents { } if (this->Loop(LoopNum).HowLoadServed == DataPlant::HowMet_ByNominalCapLowOutLimit) { - DataPlant::PlantLoop(this->Loop(LoopNum).LoopNum) + state.dataPlnt->PlantLoop(this->Loop(LoopNum).LoopNum) .LoopSide(this->Loop(LoopNum).LoopSideNum) .Branch(this->Loop(LoopNum).BranchNum) .Comp(this->Loop(LoopNum).CompNum) @@ -2437,7 +2437,7 @@ namespace UserDefinedComponents { } if (this->Loop(LoopNum).HowLoadServed == DataPlant::HowMet_ByNominalCapHiOutLimit) { - DataPlant::PlantLoop(this->Loop(LoopNum).LoopNum) + state.dataPlnt->PlantLoop(this->Loop(LoopNum).LoopNum) .LoopSide(this->Loop(LoopNum).LoopSideNum) .Branch(this->Loop(LoopNum).BranchNum) .Comp(this->Loop(LoopNum).CompNum) @@ -2481,7 +2481,7 @@ namespace UserDefinedComponents { this->Loop.LoopSideNum, this->Loop.BranchNum, this->Loop.CompNum); - PlantUtilities::SafeCopyPlantNode(this->Loop.InletNodeNum, this->Loop.OutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->Loop.InletNodeNum, this->Loop.OutletNodeNum); // unload Actuators to node data structure DataLoopNode::Node(this->Loop.OutletNodeNum).Temp = this->Loop.OutletTemp; } @@ -2532,7 +2532,7 @@ namespace UserDefinedComponents { this->Loop(loop).LoopSideNum, this->Loop(loop).BranchNum, this->Loop(loop).CompNum); - PlantUtilities::SafeCopyPlantNode(this->Loop(loop).InletNodeNum, this->Loop(loop).OutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->Loop(loop).InletNodeNum, this->Loop(loop).OutletNodeNum); // unload Actuators to node data structure DataLoopNode::Node(this->Loop(loop).OutletNodeNum).Temp = this->Loop(loop).OutletTemp; } @@ -2580,7 +2580,7 @@ namespace UserDefinedComponents { this->Loop(loop).LoopSideNum, this->Loop(loop).BranchNum, this->Loop(loop).CompNum); - PlantUtilities::SafeCopyPlantNode(this->Loop(loop).InletNodeNum, this->Loop(loop).OutletNodeNum); + PlantUtilities::SafeCopyPlantNode(state, this->Loop(loop).InletNodeNum, this->Loop(loop).OutletNodeNum); // unload Actuators to node data structure DataLoopNode::Node(this->Loop(loop).OutletNodeNum).Temp = this->Loop(loop).OutletTemp; } diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index 8a1eecb824b..3141314165f 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -3049,7 +3049,6 @@ namespace VariableSpeedCoils { // Uses the status flags to trigger initializations. // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -3120,7 +3119,7 @@ namespace VariableSpeedCoils { // water source if ((state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) || (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_HeatingWaterToAirHPVSEquationFit)) { // fix coil type - if (MyPlantScanFlag(DXCoilNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(DXCoilNum) && allocated(state.dataPlnt->PlantLoop)) { // switch from coil type numbers in DataHVACGlobals, to coil type numbers in plant. int plantTypeOfNum(0); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) { @@ -3238,9 +3237,9 @@ namespace VariableSpeedCoils { DataHVACGlobals::Coil_CoolingWaterToAirHPVSEquationFit) { // need to set water info for WSHP state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp = state.dataVariableSpeedCoils->RatedInletWaterTemp; // 85 F cooling mode - Real64 CpSource = GetSpecificHeatGlycol(state, PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + Real64 CpSource = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, state.dataVariableSpeedCoils->SourceSideInletTemp, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineName); state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp * CpSource; } @@ -3344,9 +3343,9 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterMassFlowRate = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).MSRatedWaterMassFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).NumOfSpeeds); state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp = state.dataVariableSpeedCoils->RatedInletWaterTempHeat; // 21.11C or 70F, heating mode Real64 CpSource = GetSpecificHeatGlycol(state, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, state.dataVariableSpeedCoils->SourceSideInletTemp, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineName); state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp * CpSource; } @@ -3477,14 +3476,14 @@ namespace VariableSpeedCoils { WaterInletNode = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).WaterInletNodeNum; rho = GetDensityGlycol(state, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameSimpleWatertoAirHP); Cp = GetSpecificHeatGlycol(state, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameSimpleWatertoAirHP); // state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum)%DesignWaterMassFlowRate= & @@ -3663,7 +3662,6 @@ namespace VariableSpeedCoils { using namespace Psychrometrics; using DataHVACGlobals::SmallAirVolFlow; using DataHVACGlobals::SmallLoad; - using DataPlant::PlantLoop; using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -4385,14 +4383,14 @@ namespace VariableSpeedCoils { false); if (PltSizNum > 0) { - rho = GetDensityGlycol(state, PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, PlantSizData(PltSizNum).ExitTemp, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameAlt); cp = GetSpecificHeatGlycol(state, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, PlantSizData(PltSizNum).ExitTemp, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameAlt); if (state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).CoolHeatType == "HEATING") { @@ -4531,9 +4529,9 @@ namespace VariableSpeedCoils { rhoW = rho; } else { rhoW = GetDensityGlycol(state, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, RatedSourceTempCool, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineName); } @@ -4942,7 +4940,6 @@ namespace VariableSpeedCoils { using CurveManager::CurveValue; using DataHVACGlobals::DXElecCoolingPower; using DataHVACGlobals::TimeStepSys; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; @@ -5119,9 +5116,9 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->SourceSideInletTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp; state.dataVariableSpeedCoils->SourceSideInletEnth = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy; CpSource = GetSpecificHeatGlycol(state, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, state.dataVariableSpeedCoils->SourceSideInletTemp, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameSourceSideInletTemp); } @@ -6154,7 +6151,6 @@ namespace VariableSpeedCoils { using CurveManager::CurveValue; using DataHVACGlobals::DXElecHeatingPower; using DataHVACGlobals::TimeStepSys; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; @@ -6262,9 +6258,9 @@ namespace VariableSpeedCoils { state.dataVariableSpeedCoils->SourceSideInletTemp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterTemp; state.dataVariableSpeedCoils->SourceSideInletEnth = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).InletWaterEnthalpy; CpSource = GetSpecificHeatGlycol(state, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidName, state.dataVariableSpeedCoils->SourceSideInletTemp, - PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).LoopNum).FluidIndex, RoutineNameSourceSideInletTemp); } @@ -7193,7 +7189,7 @@ namespace VariableSpeedCoils { // Set the water outlet node of the WatertoAirHPSimple // Set the water outlet nodes for properties that just pass through & not used if (WaterInletNode != 0 && WaterOutletNode != 0) { - SafeCopyPlantNode(WaterInletNode, WaterOutletNode); + SafeCopyPlantNode(state, WaterInletNode, WaterOutletNode); Node(WaterOutletNode).Temp = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterTemp; Node(WaterOutletNode).Enthalpy = state.dataVariableSpeedCoils->VarSpeedCoil(DXCoilNum).OutletWaterEnthalpy; } diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index d266e50e0e1..cb8d79b7bfe 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -1292,7 +1292,6 @@ namespace VentilatedSlab { using DataHeatBalFanSys::ZoneAirHumRat; using DataHVACGlobals::ZoneComp; using DataLoopNode::Node; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilSteamAirHeating; using DataPlant::TypeOf_CoilWaterCooling; using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; @@ -1379,7 +1378,7 @@ namespace VentilatedSlab { state.dataVentilatedSlab->VentSlab(Item).AvailStatus = ZoneComp(VentilatedSlab_Num).ZoneCompAvailMgrs(Item).AvailStatus; } - if (MyPlantScanFlag(Item) && allocated(PlantLoop)) { + if (MyPlantScanFlag(Item) && allocated(state.dataPlnt->PlantLoop)) { if ((state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating) || (state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilSteamAirHeating)) { errFlag = false; @@ -1401,7 +1400,7 @@ namespace VentilatedSlab { ShowFatalError(state, "InitVentilatedSlab: Program terminated due to previous condition(s)."); } - state.dataVentilatedSlab->VentSlab(Item).HotCoilOutNodeNum = PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum) + state.dataVentilatedSlab->VentSlab(Item).HotCoilOutNodeNum = state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum) .LoopSide(state.dataVentilatedSlab->VentSlab(Item).HWLoopSide) .Branch(state.dataVentilatedSlab->VentSlab(Item).HWBranchNum) .Comp(state.dataVentilatedSlab->VentSlab(Item).HWCompNum) @@ -1422,7 +1421,7 @@ namespace VentilatedSlab { ShowContinueError(state, "Reference Unit=\"" + state.dataVentilatedSlab->VentSlab(Item).Name + "\", type=ZoneHVAC:VentilatedSlab"); ShowFatalError(state, "InitVentilatedSlab: Program terminated due to previous condition(s)."); } - state.dataVentilatedSlab->VentSlab(Item).ColdCoilOutNodeNum = PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum) + state.dataVentilatedSlab->VentSlab(Item).ColdCoilOutNodeNum = state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum) .LoopSide(state.dataVentilatedSlab->VentSlab(Item).CWLoopSide) .Branch(state.dataVentilatedSlab->VentSlab(Item).CWBranchNum) .Comp(state.dataVentilatedSlab->VentSlab(Item).CWCompNum) @@ -1505,7 +1504,7 @@ namespace VentilatedSlab { if (state.dataVentilatedSlab->VentSlab(Item).HCoil_PlantTypeNum == TypeOf_CoilWaterSimpleHeating && !MyPlantScanFlag(Item)) { rho = GetDensityGlycol( - state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); state.dataVentilatedSlab->VentSlab(Item).MaxHotWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MaxVolHotWaterFlow; state.dataVentilatedSlab->VentSlab(Item).MinHotWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MinVolHotWaterFlow; @@ -1540,9 +1539,9 @@ namespace VentilatedSlab { // Only initialize these if a cooling coil is actually present if ((state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterCooling) || (state.dataVentilatedSlab->VentSlab(Item).CCoil_PlantTypeNum == TypeOf_CoilWaterDetailedFlatCooling)) { - rho = GetDensityGlycol(state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, DataGlobalConstants::CWInitConvTemp, - PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); state.dataVentilatedSlab->VentSlab(Item).MaxColdWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MaxVolColdWaterFlow; state.dataVentilatedSlab->VentSlab(Item).MinColdWaterFlow = rho * state.dataVentilatedSlab->VentSlab(Item).MinVolColdWaterFlow; @@ -1646,7 +1645,6 @@ namespace VentilatedSlab { using DataHVACGlobals::CoolingCapacitySizing; using DataHVACGlobals::HeatingAirflowSizing; using DataHVACGlobals::HeatingCapacitySizing; - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; @@ -2045,13 +2043,13 @@ namespace VentilatedSlab { sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); DesCoilLoad = sizerHeatingCapacity.size(state, TempSize, ErrorsFound); } - rho = GetDensityGlycol(state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).HWLoopNum).FluidIndex, RoutineName); MaxVolHotWaterFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); } else { @@ -2295,9 +2293,9 @@ namespace VentilatedSlab { DesCoilLoad = sizerCoolingCapacity.size(state, TempSize, ErrorsFound); } rho = GetDensityGlycol( - state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, 5., PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, 5., state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol( - state, PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, 5., PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidName, 5., state.dataPlnt->PlantLoop(state.dataVentilatedSlab->VentSlab(Item).CWLoopNum).FluidIndex, RoutineName); MaxVolColdWaterFlowDes = DesCoilLoad / (WaterCoilSizDeltaT * Cp * rho); } else { MaxVolColdWaterFlowDes = 0.0; diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index d6dcb9dfd6d..3bc94a6b6cb 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -124,7 +124,6 @@ namespace WaterCoils { using namespace DataLoopNode; using namespace DataHVACGlobals; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilWaterCooling; using DataPlant::TypeOf_CoilWaterDetailedFlatCooling; using DataPlant::TypeOf_CoilWaterSimpleHeating; @@ -1040,7 +1039,7 @@ namespace WaterCoils { } } - if (PlantLoopScanFlag(CoilNum) && allocated(PlantLoop)) { + if (PlantLoopScanFlag(CoilNum) && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataWaterCoils->WaterCoil(CoilNum).Name, @@ -1070,9 +1069,9 @@ namespace WaterCoils { // Do the Begin Environment initializations if (state.dataGlobal->BeginEnvrnFlag && MyEnvrnFlag(CoilNum)) { rho = GetDensityGlycol(state, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, DataGlobalConstants::InitConvTemp, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); // Initialize all report variables to a known state at beginning of simulation state.dataWaterCoils->WaterCoil(CoilNum).TotWaterHeatingCoilEnergy = 0.0; @@ -1094,9 +1093,9 @@ namespace WaterCoils { Node(WaterInletNode).Temp = 5.0; Cp = GetSpecificHeatGlycol(state, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, Node(WaterInletNode).Temp, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); Node(WaterInletNode).Enthalpy = Cp * Node(WaterInletNode).Temp; @@ -1109,9 +1108,9 @@ namespace WaterCoils { Node(WaterInletNode).Temp = 60.0; Cp = GetSpecificHeatGlycol(state, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, Node(WaterInletNode).Temp, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); Node(WaterInletNode).Enthalpy = Cp * Node(WaterInletNode).Temp; @@ -1326,9 +1325,9 @@ namespace WaterCoils { // Enthalpy of Water at Intlet design conditions Cp = GetSpecificHeatGlycol(state, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); DesOutletWaterTemp = state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp + @@ -1556,9 +1555,9 @@ namespace WaterCoils { CapacitanceAir = state.dataWaterCoils->WaterCoil(CoilNum).InletAirMassFlowRate * PsyCpAirFnW(state.dataWaterCoils->WaterCoil(CoilNum).InletAirHumRat); Cp = GetSpecificHeatGlycol(state, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, state.dataWaterCoils->WaterCoil(CoilNum).InletWaterTemp, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); CapacitanceWater = state.dataWaterCoils->WaterCoil(CoilNum).InletWaterMassFlowRate * Cp; @@ -1735,9 +1734,9 @@ namespace WaterCoils { state.dataWaterCoils->WaterCoil(CoilNum).InletWaterMassFlowRate = state.dataWaterCoils->WaterCoil(CoilNum).MaxWaterMassFlowRate; state.dataWaterCoils->WaterCoil(CoilNum).InletWaterTemp = state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp; Real64 cp = GetSpecificHeatGlycol(state, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, state.dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, "InitWaterCoil"); state.dataWaterCoils->WaterCoil(CoilNum).InletWaterEnthalpy = cp * state.dataWaterCoils->WaterCoil(CoilNum).InletWaterTemp; @@ -2465,12 +2464,12 @@ namespace WaterCoils { DataPltSizHeatNum = PltSizHeatNum; DataWaterLoopNum = state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum; rho = GetDensityGlycol(state, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol( - state, PlantLoop(DataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(DataWaterLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(DataWaterLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, state.dataPlnt->PlantLoop(DataWaterLoopNum).FluidIndex, RoutineName); if (state.dataWaterCoils->WaterCoil(CoilNum).DesTotWaterCoilLoad > 0.0) { NomCapUserInp = true; } else if (CurSysNum > 0 && CurSysNum <= DataHVACGlobals::NumPrimaryAirSys) { @@ -2830,9 +2829,9 @@ namespace WaterCoils { if (WaterMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // If the coil is operating CapacitanceAir = PsyCpAirFnW(Win) * AirMassFlow; - Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, TempWaterIn, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); CapacitanceWater = Cp * WaterMassFlowRate; CapacitanceMin = min(CapacitanceAir, CapacitanceWater); @@ -3121,9 +3120,9 @@ namespace WaterCoils { // Ratio of secondary (fin) to total (secondary plus primary) surface areas FinToTotSurfAreaRatio = state.dataWaterCoils->WaterCoil(CoilNum).FinSurfArea / state.dataWaterCoils->WaterCoil(CoilNum).TotCoilOutsideSurfArea; // known water and air flow parameters: - rho = GetDensityGlycol(state, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, TempWaterIn, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); // water flow velocity - assuming number of water circuits = NumOfTubesPerRow TubeWaterVel = WaterMassFlowRate * 4.0 / @@ -3237,9 +3236,9 @@ namespace WaterCoils { // dry coil outside thermal resistance = [1/UA] (dry coil) CoilToAirThermResistDrySurf = 1.0 / (state.dataWaterCoils->WaterCoil(CoilNum).TotCoilOutsideSurfArea * AirSideDrySurfFilmCoef * DryCoilEfficiency); // definitions made to simplify some of the expressions used below - Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, TempWaterIn, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); ScaledWaterSpecHeat = WaterMassFlowRate * Cp * ConvK / AirMassFlow; DryCoilCoeff1 = 1.0 / (AirMassFlow * MoistAirSpecificHeat) - 1.0 / (WaterMassFlowRate * Cp * ConvK); @@ -3866,7 +3865,7 @@ namespace WaterCoils { CapacitanceAir = AirMassFlow * PsyCpAirFnW(state.dataWaterCoils->WaterCoil(CoilNum).InletAirHumRat); // Water Capacity Rate Cp = GetSpecificHeatGlycol( - state, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, WaterTempIn, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, WaterTempIn, state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); CapacitanceWater = WaterMassFlowRate * Cp; @@ -4007,7 +4006,7 @@ namespace WaterCoils { UACoilTotalEnth = 1.0 / (IntermediateCpSat * WaterSideResist + AirSideResist * PsyCpAirFnW(0.0)); CapacityRateAirWet = AirMassFlow; Cp = GetSpecificHeatGlycol( - state, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, WaterTempIn, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, WaterTempIn, state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); CapacityRateWaterWet = WaterMassFlowRate * (Cp / IntermediateCpSat); CoilOutletStreamCondition(state, CoilNum, CapacityRateAirWet, @@ -4804,7 +4803,7 @@ namespace WaterCoils { Tavg = (state.dataWaterCoils->WaterCoil(CoilNum).InletAirTemp - state.dataWaterCoils->WaterCoil(CoilNum).OutletAirTemp) / 2.0; RhoWater = GetDensityGlycol( - state, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, Tavg, PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, Tavg, state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); // CR9155 Remove specific humidity calculations SpecHumIn = state.dataWaterCoils->WaterCoil(CoilNum).InletAirHumRat; SpecHumOut = state.dataWaterCoils->WaterCoil(CoilNum).OutletAirHumRat; @@ -6484,7 +6483,6 @@ namespace WaterCoils { using DataHVACGlobals::SimZoneEquipmentFlag; using DataLoopNode::Node; using DataPlant::ccSimPlantEquipTypes; - using DataPlant::PlantLoop; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -6551,13 +6549,13 @@ namespace WaterCoils { if (DidAnythingChange) { // set sim flag for this loop - PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = true; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = true; // set sim flags for air side users of coils SimAirLoopsFlag = true; SimZoneEquipmentFlag = true; } else { // nothing changed so turn off sim flag - PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = false; + state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).SimLoopSideNeeded = false; } } @@ -6732,9 +6730,9 @@ namespace WaterCoils { if (WaterMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { // if the coil is operating CapacitanceAir = PsyCpAirFnW(Win) * AirMassFlow; Cp = GetSpecificHeatGlycol(state, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidName, TempWaterIn, - PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterCoils->WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); CapacitanceWater = Cp * WaterMassFlowRate; CapacitanceMin = min(CapacitanceAir, CapacitanceWater); diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 02c28df4b88..6eea80ef9a3 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -302,7 +302,7 @@ namespace WaterThermalTanks { } this->UseSideLoadRequested = std::abs(CurLoad); if (this->UseSide.loopNum > 0 && this->UseSide.loopSideNum > 0 && !state.dataGlobal->KickOffSimulation) { - this->UseCurrentFlowLock = DataPlant::PlantLoop(this->UseSide.loopNum).LoopSide(this->UseSide.loopSideNum).FlowLock; + this->UseCurrentFlowLock = state.dataPlnt->PlantLoop(this->UseSide.loopNum).LoopSide(this->UseSide.loopSideNum).FlowLock; } else { this->UseCurrentFlowLock = DataPlant::iFlowLock::Locked; } @@ -392,7 +392,7 @@ namespace WaterThermalTanks { } Tank.UseSideLoadRequested = std::abs(CurLoad); if (Tank.UseSide.loopNum > 0 && Tank.UseSide.loopSideNum > 0 && !state.dataGlobal->KickOffSimulation) { - Tank.UseCurrentFlowLock = DataPlant::PlantLoop(Tank.UseSide.loopNum).LoopSide(Tank.UseSide.loopSideNum).FlowLock; + Tank.UseCurrentFlowLock = state.dataPlnt->PlantLoop(Tank.UseSide.loopNum).LoopSide(Tank.UseSide.loopSideNum).FlowLock; } else { Tank.UseCurrentFlowLock = DataPlant::iFlowLock::Locked; } @@ -5190,11 +5190,11 @@ namespace WaterThermalTanks { int NumNodes = this->Nodes; this->Node.allocate(NumNodes); Real64 rho; - if ((this->UseSide.loopNum > 0) && allocated(DataPlant::PlantLoop)) { + if ((this->UseSide.loopNum > 0) && allocated(state.dataPlnt->PlantLoop)) { rho = FluidProperties::GetDensityGlycol(state, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, this->FluidIndex, RoutineName); @@ -5404,7 +5404,7 @@ namespace WaterThermalTanks { static std::string const GetWaterThermalTankInput("GetWaterThermalTankInput"); static std::string const SizeTankForDemand("SizeTankForDemandSide"); - if (this->scanPlantLoopsFlag && allocated(DataPlant::PlantLoop)) { + if (this->scanPlantLoopsFlag && allocated(state.dataPlnt->PlantLoop)) { if ((this->UseInletNode > 0) && (this->HeatPumpNum == 0)) { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, @@ -5461,7 +5461,7 @@ namespace WaterThermalTanks { this->SourceInletNode, _); if (this->UseInletNode > 0) { - PlantUtilities::InterConnectTwoPlantLoopSides( + PlantUtilities::InterConnectTwoPlantLoopSides(state, this->UseSide.loopNum, this->UseSide.loopSideNum, this->SrcSide.loopNum, this->SrcSide.loopSideNum, this->TypeNum, true); } if (errFlag) { @@ -5471,40 +5471,40 @@ namespace WaterThermalTanks { this->scanPlantLoopsFlag = false; } - if (this->SetLoopIndexFlag && allocated(DataPlant::PlantLoop)) { + if (this->SetLoopIndexFlag && allocated(state.dataPlnt->PlantLoop)) { if ((this->UseInletNode > 0) && (this->HeatPumpNum == 0)) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, GetWaterThermalTankInput); this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; this->Mass = this->Volume * rho; - this->UseSidePlantSizNum = DataPlant::PlantLoop(this->UseSide.loopNum).PlantSizNum; + this->UseSidePlantSizNum = state.dataPlnt->PlantLoop(this->UseSide.loopNum).PlantSizNum; if ((this->UseDesignVolFlowRateWasAutoSized) && (this->UseSidePlantSizNum == 0)) { ShowSevereError(state, "InitWaterThermalTank: Did not find Sizing:Plant object for use side of plant thermal tank = " + this->Name); ShowFatalError(state, "InitWaterThermalTank: Program terminated due to previous condition(s)."); } } if ((this->UseInletNode > 0) && (this->HeatPumpNum > 0)) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, GetWaterThermalTankInput); this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; this->Mass = this->Volume * rho; - this->UseSidePlantSizNum = DataPlant::PlantLoop(this->UseSide.loopNum).PlantSizNum; + this->UseSidePlantSizNum = state.dataPlnt->PlantLoop(this->UseSide.loopNum).PlantSizNum; if ((this->UseDesignVolFlowRateWasAutoSized) && (this->UseSidePlantSizNum == 0)) { ShowSevereError(state, "InitWaterThermalTank: Did not find Sizing:Plant object for use side of plant thermal tank = " + this->Name); ShowFatalError(state, "InitWaterThermalTank: Program terminated due to previous condition(s)."); } } if ((this->SourceInletNode > 0) && (this->DesuperheaterNum == 0) && (this->HeatPumpNum == 0)) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidIndex, GetWaterThermalTankInput); this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; - this->SourceSidePlantSizNum = DataPlant::PlantLoop(this->SrcSide.loopNum).PlantSizNum; + this->SourceSidePlantSizNum = state.dataPlnt->PlantLoop(this->SrcSide.loopNum).PlantSizNum; if ((this->SourceDesignVolFlowRateWasAutoSized) && (this->SourceSidePlantSizNum == 0)) { ShowSevereError(state, "InitWaterThermalTank: Did not find Sizing:Plant object for source side of plant thermal tank = " + this->Name); ShowFatalError(state, "InitWaterThermalTank: Program terminated due to previous condition(s)."); @@ -5561,9 +5561,9 @@ namespace WaterThermalTanks { // Clear node initial conditions if (this->UseInletNode > 0 && this->UseOutletNode > 0) { DataLoopNode::Node(this->UseInletNode).Temp = 0.0; - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, GetWaterThermalTankInput); this->MassFlowRateMin = this->VolFlowRateMin * rho; this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; @@ -5580,7 +5580,7 @@ namespace WaterThermalTanks { this->SavedUseOutletTemp = 0.0; this->Mass = this->Volume * rho; - this->UseBranchControlType = DataPlant::PlantLoop(this->UseSide.loopNum) + this->UseBranchControlType = state.dataPlnt->PlantLoop(this->UseSide.loopNum) .LoopSide(this->UseSide.loopSideNum) .Branch(this->UseSide.branchNum) .Comp(this->UseSide.compNum) @@ -5588,9 +5588,9 @@ namespace WaterThermalTanks { } if ((this->SourceInletNode > 0) && (this->DesuperheaterNum == 0) && (this->HeatPumpNum == 0)) { - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidIndex, GetWaterThermalTankInput); this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; PlantUtilities::InitComponentNodes(0.0, @@ -5606,7 +5606,7 @@ namespace WaterThermalTanks { this->SourceMassFlowRate = 0.0; this->SavedSourceOutletTemp = 0.0; - this->SourceBranchControlType = DataPlant::PlantLoop(this->SrcSide.loopNum) + this->SourceBranchControlType = state.dataPlnt->PlantLoop(this->SrcSide.loopNum) .LoopSide(this->SrcSide.loopSideNum) .Branch(this->SrcSide.branchNum) .Comp(this->SrcSide.compNum) @@ -6241,9 +6241,9 @@ namespace WaterThermalTanks { Real64 rho; if (this->UseSide.loopNum > 0) { - rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, TankTemp_loc, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, TankTemp_loc, this->waterIndex, RoutineName); @@ -6253,9 +6253,9 @@ namespace WaterThermalTanks { Real64 Cp; if (this->UseSide.loopNum > 0) { - Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, TankTemp_loc, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { Cp = FluidProperties::GetSpecificHeatGlycol(state, fluidNameWater, TankTemp_loc, this->waterIndex, RoutineName); @@ -7143,9 +7143,9 @@ namespace WaterThermalTanks { // Specific Heat of water (J/kg K) const Real64 Cp = [&] { if (this->UseSide.loopNum > 0) { - return FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + return FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, this->TankTemp, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { return FluidProperties::GetSpecificHeatGlycol(state, fluidNameWater, this->TankTemp, this->waterIndex, RoutineName); @@ -10148,7 +10148,7 @@ namespace WaterThermalTanks { bool ErrorsFound = false; - if (allocated(DataPlant::PlantLoop) && this->UseSide.loopNum > 0) { + if (allocated(state.dataPlnt->PlantLoop) && this->UseSide.loopNum > 0) { // check plant structure for useful data. @@ -10157,33 +10157,33 @@ namespace WaterThermalTanks { if ((this->UseDesignVolFlowRateWasAutoSized) && (this->UseSidePlantSizNum == 0)) { ShowSevereError(state, "Water heater = " + this->Name + " for autosizing Use side flow rate, did not find Sizing:Plant object " + - DataPlant::PlantLoop(PlantLoopNum).Name); + state.dataPlnt->PlantLoop(PlantLoopNum).Name); ErrorsFound = true; } // Is this wh Use side plumbed in series (default) or are there other branches in parallel? - if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Splitter.Exists) { - if (any_eq(DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Splitter.NodeNumOut, + if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Splitter.Exists) { + if (any_eq(state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Splitter.NodeNumOut, this->UseInletNode)) { // this wh is on the splitter - if (DataPlant::PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Splitter.TotalOutletNodes > 1) { + if (state.dataPlnt->PlantLoop(PlantLoopNum).LoopSide(LoopSideNum).Splitter.TotalOutletNodes > 1) { this->UseSideSeries = false; } } } } - if (allocated(DataPlant::PlantLoop) && this->SrcSide.loopNum > 0) { + if (allocated(state.dataPlnt->PlantLoop) && this->SrcSide.loopNum > 0) { // was user's input correct for plant loop name? if ((this->SourceDesignVolFlowRateWasAutoSized) && (this->SourceSidePlantSizNum == 0) && (this->DesuperheaterNum == 0) && (this->HeatPumpNum == 0)) { ShowSevereError(state, "Water heater = " + this->Name + "for autosizing Source side flow rate, did not find Sizing:Plant object " + - DataPlant::PlantLoop(this->SrcSide.loopNum).Name); + state.dataPlnt->PlantLoop(this->SrcSide.loopNum).Name); ErrorsFound = true; } // Is this wh Source side plumbed in series (default) or are there other branches in parallel? - if (DataPlant::PlantLoop(this->SrcSide.loopNum).LoopSide(this->SrcSide.loopSideNum).Splitter.Exists) { - if (any_eq(DataPlant::PlantLoop(this->SrcSide.loopNum).LoopSide(this->SrcSide.loopSideNum).Splitter.NodeNumOut, + if (state.dataPlnt->PlantLoop(this->SrcSide.loopNum).LoopSide(this->SrcSide.loopSideNum).Splitter.Exists) { + if (any_eq(state.dataPlnt->PlantLoop(this->SrcSide.loopNum).LoopSide(this->SrcSide.loopSideNum).Splitter.NodeNumOut, this->SourceInletNode)) { // this wh is on the splitter - if (DataPlant::PlantLoop(this->SrcSide.loopNum).LoopSide(this->SrcSide.loopSideNum).Splitter.TotalOutletNodes > 1) { + if (state.dataPlnt->PlantLoop(this->SrcSide.loopNum).LoopSide(this->SrcSide.loopSideNum).Splitter.TotalOutletNodes > 1) { this->SourceSideSeries = false; } } @@ -10257,9 +10257,9 @@ namespace WaterThermalTanks { PlantUtilities::RegisterPlantCompDesignFlow(this->UseInletNode, tmpUseDesignVolFlowRate); } - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); if (DataPlant::PlantFirstSizesOkayToFinalize) { this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; @@ -10274,9 +10274,9 @@ namespace WaterThermalTanks { PlantUtilities::RegisterPlantCompDesignFlow(this->UseInletNode, this->UseDesignVolFlowRate); Real64 rho; if (this->UseSide.loopNum > 0) { - rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, this->waterIndex, RoutineName); @@ -10318,9 +10318,9 @@ namespace WaterThermalTanks { } else { PlantUtilities::RegisterPlantCompDesignFlow(this->SourceInletNode, tmpSourceDesignVolFlowRate); } - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); if (DataPlant::PlantFirstSizesOkayToFinalize) { this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; @@ -10336,9 +10336,9 @@ namespace WaterThermalTanks { PlantUtilities::RegisterPlantCompDesignFlow(this->SourceInletNode, this->SourceDesignVolFlowRate); Real64 rho; if (this->SrcSide.loopNum > 0) { - rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); } else { rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, this->waterIndex, RoutineName); @@ -10548,13 +10548,13 @@ namespace WaterThermalTanks { Real64 rho; Real64 Cp; if (this->UseSide.loopNum > 0) { - rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, ((Tfinish + Tstart) / 2.0), - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); - Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, ((Tfinish + Tstart) / 2.0), - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), this->waterIndex, RoutineName); @@ -10591,13 +10591,13 @@ namespace WaterThermalTanks { Real64 rho; Real64 Cp; if (this->UseSide.loopNum > 0) { - rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, ((Tfinish + Tstart) / 2.0), - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); - Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, ((Tfinish + Tstart) / 2.0), - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), this->waterIndex, RoutineName); @@ -10632,13 +10632,13 @@ namespace WaterThermalTanks { Real64 rho; Real64 Cp; if (this->UseSide.loopNum > 0) { - rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, ((Tfinish + Tstart) / 2.0), - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); - Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, ((Tfinish + Tstart) / 2.0), - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), this->waterIndex, RoutineName); @@ -10739,13 +10739,13 @@ namespace WaterThermalTanks { Real64 rho; Real64 Cp; if (this->SrcSide.loopNum > 0) { - rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidName, ((Tfinish + Tstart) / 2.0), - DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); - Cp = FluidProperties::GetSpecificHeatGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidName, ((Tfinish + Tstart) / 2.0), - DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); } else { rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, ((Tfinish + Tstart) / 2.0), this->waterIndex, RoutineName); @@ -10909,9 +10909,9 @@ namespace WaterThermalTanks { } else { PlantUtilities::RegisterPlantCompDesignFlow(this->UseInletNode, tmpUseDesignVolFlowRate); } - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); if (DataPlant::PlantFirstSizesOkayToFinalize) { this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; @@ -10928,9 +10928,9 @@ namespace WaterThermalTanks { PlantUtilities::RegisterPlantCompDesignFlow(this->UseInletNode, this->UseDesignVolFlowRate); Real64 rho; if (this->UseSide.loopNum > 0) { - rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->UseSide.loopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->UseSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); } else { rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, this->waterIndex, RoutineName); @@ -10993,9 +10993,9 @@ namespace WaterThermalTanks { } else { PlantUtilities::RegisterPlantCompDesignFlow(this->SourceInletNode, tmpSourceDesignVolFlowRate); } - Real64 rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, + Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); if (DataPlant::PlantFirstSizesOkayToFinalize) { this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; @@ -11012,9 +11012,9 @@ namespace WaterThermalTanks { PlantUtilities::RegisterPlantCompDesignFlow(this->SourceInletNode, this->SourceDesignVolFlowRate); Real64 rho; if (this->SrcSide.loopNum > 0) { - rho = FluidProperties::GetDensityGlycol(state, DataPlant::PlantLoop(this->SrcSide.loopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidName, DataGlobalConstants::InitConvTemp, - DataPlant::PlantLoop(this->SrcSide.loopNum).FluidIndex, + state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); } else { rho = FluidProperties::GetDensityGlycol(state, fluidNameWater, DataGlobalConstants::InitConvTemp, this->waterIndex, RoutineName); diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index fe1ee04325b..5ed00080ca8 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -99,7 +99,6 @@ namespace WaterToAirHeatPump { using DataHVACGlobals::ContFanCycCoil; using DataHVACGlobals::CycFanCycCoil; using DataHVACGlobals::TimeStepSys; - using DataPlant::PlantLoop; using DataPlant::TypeOf_CoilWAHPCoolingParamEst; using DataPlant::TypeOf_CoilWAHPHeatingParamEst; @@ -796,7 +795,6 @@ namespace WaterToAirHeatPump { // Uses the status flags to trigger initializations. // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::InitComponentNodes; @@ -836,7 +834,7 @@ namespace WaterToAirHeatPump { state.dataWaterToAirHeatPump->MyOneTimeFlag = false; } - if (MyPlantScanFlag(HPNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(HPNum) && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name, @@ -852,7 +850,7 @@ namespace WaterToAirHeatPump { _, _); - if (PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName == "WATER") { + if (state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName == "WATER") { if (state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).SourceSideUACoeff < DataGlobalConstants::rTinyValue) { ShowSevereError(state, "Input problem for water to air heat pump, \"" + state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name + "\"."); ShowContinueError(state, " Source side UA value is less than tolerance, likely zero or blank."); @@ -910,16 +908,16 @@ namespace WaterToAirHeatPump { // The rest of the one time initializations rho = GetDensityGlycol( - state, PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName, DataGlobalConstants::InitConvTemp, PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName, DataGlobalConstants::InitConvTemp, state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol( - state, PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName, DataGlobalConstants::InitConvTemp, PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); + state, state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName, DataGlobalConstants::InitConvTemp, state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).DesignWaterMassFlowRate = rho * state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).DesignWaterVolFlowRate; state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).MaxONOFFCyclesperHour = MaxONOFFCyclesperHour; state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).HPTimeConstant = HPTimeConstant; state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).FanDelayTime = FanDelayTime; - PlantOutletNode = PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum) + PlantOutletNode = state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum) .LoopSide(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopSide) .Branch(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).BranchNum) .Comp(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).CompNum) @@ -1055,7 +1053,6 @@ namespace WaterToAirHeatPump { // Using/Aliasing using namespace FluidProperties; - using DataPlant::PlantLoop; using General::SolveRoot; using Psychrometrics::PsyCpAirFnW; @@ -1235,8 +1232,8 @@ namespace WaterToAirHeatPump { SourceSideInletTemp = state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).InletWaterTemp; SourceSideWaterInletEnth = state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).InletWaterEnthalpy; - SourceSideFluidName = PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName; - SourceSideFluidIndex = PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex; + SourceSideFluidName = state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName; + SourceSideFluidIndex = state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex; SourceSideMassFlowRate = state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).InletWaterMassFlowRate; SourceSideVolFlowRate = SourceSideMassFlowRate / GetDensityGlycol(state, SourceSideFluidName, SourceSideInletTemp, SourceSideFluidIndex, RoutineNameSourceSideInletTemp); @@ -1728,7 +1725,6 @@ namespace WaterToAirHeatPump { using Psychrometrics::PsyTdbFnHW; using Psychrometrics::PsyWFnTdbH; // USE DataZoneEnergyDemands - using DataPlant::PlantLoop; using General::SolveRoot; @@ -1865,8 +1861,8 @@ namespace WaterToAirHeatPump { SourceSideInletTemp = state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).InletWaterTemp; SourceSideWaterInletEnth = state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).InletWaterEnthalpy; - SourceSideFluidName = PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName; - SourceSideFluidIndex = PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex; + SourceSideFluidName = state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidName; + SourceSideFluidIndex = state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum).FluidIndex; SourceSideMassFlowRate = state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).InletWaterMassFlowRate; SourceSideVolFlowRate = state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).InletWaterMassFlowRate / GetDensityGlycol(state, SourceSideFluidName, SourceSideInletTemp, SourceSideFluidIndex, RoutineNameSourceSideInletTemp); @@ -2238,7 +2234,7 @@ namespace WaterToAirHeatPump { Node(AirOutletNode).Enthalpy = state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).OutletAirEnthalpy; // Set the outlet nodes for properties that just pass through & not used - SafeCopyPlantNode(WaterInletNode, WaterOutletNode); + SafeCopyPlantNode(state, WaterInletNode, WaterOutletNode); // Set the outlet water nodes for the heat pump Node(WaterOutletNode).Temp = state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).OutletWaterTemp; Node(WaterOutletNode).Enthalpy = state.dataWaterToAirHeatPump->WatertoAirHP(HPNum).OutletWaterEnthalpy; diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index 9c37d741355..dcee8ab8ce3 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -784,7 +784,6 @@ namespace WaterToAirHeatPumpSimple { // REFERENCES: // Using/Aliasing - using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::InitComponentNodes; @@ -828,7 +827,7 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->MyOneTimeFlag = false; } - if (MyPlantScanFlag(HPNum) && allocated(PlantLoop)) { + if (MyPlantScanFlag(HPNum) && allocated(state.dataPlnt->PlantLoop)) { errFlag = false; ScanPlantLoopsForObject(state, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name, @@ -937,13 +936,13 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RunFrac = 0.0; state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).PartLoadRatio = 0.0; - rho = GetDensityGlycol(state, PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, DataGlobalConstants::InitConvTemp, - PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineName); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).DesignWaterMassFlowRate = rho * state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedWaterVolFlowRate; @@ -1098,7 +1097,6 @@ namespace WaterToAirHeatPumpSimple { using namespace Psychrometrics; using DataHVACGlobals::SmallAirVolFlow; using DataHVACGlobals::SmallLoad; - using DataPlant::PlantLoop; using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::RegisterPlantCompDesignFlow; @@ -1978,13 +1976,13 @@ namespace WaterToAirHeatPumpSimple { // END IF if (PltSizNum > 0) { - rho = GetDensityGlycol(state, PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, + rho = GetDensityGlycol(state, state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, PlantSizData(PltSizNum).ExitTemp, - PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineNameAlt); - Cp = GetSpecificHeatGlycol(state, PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, + Cp = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, PlantSizData(PltSizNum).ExitTemp, - PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineNameAlt); if (state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WatertoAirHPType == "HEATING") { @@ -2092,7 +2090,6 @@ namespace WaterToAirHeatPumpSimple { // Using/Aliasing using DataHVACGlobals::DXElecCoolingPower; using DataHVACGlobals::TimeStepSys; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::SetComponentFlowRate; using Psychrometrics::PsyCpAirFnW; @@ -2211,9 +2208,9 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->SourceSideMassFlowRate = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterMassFlowRate; state.dataWaterToAirHeatPumpSimple->SourceSideInletTemp = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).InletWaterTemp; state.dataWaterToAirHeatPumpSimple->SourceSideInletEnth = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).InletWaterEnthalpy; - CpWater = GetSpecificHeatGlycol(state, PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, + CpWater = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, state.dataWaterToAirHeatPumpSimple->SourceSideInletTemp, - PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineNameSourceSideInletTemp); // Check for flows, do not perform simulation if no flow in load side or source side. @@ -2444,7 +2441,6 @@ namespace WaterToAirHeatPumpSimple { // Using/Aliasing using DataHVACGlobals::DXElecHeatingPower; using DataHVACGlobals::TimeStepSys; - using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::SetComponentFlowRate; using Psychrometrics::PsyCpAirFnW; @@ -2521,9 +2517,9 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->SourceSideMassFlowRate = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterMassFlowRate; state.dataWaterToAirHeatPumpSimple->SourceSideInletTemp = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).InletWaterTemp; state.dataWaterToAirHeatPumpSimple->SourceSideInletEnth = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).InletWaterEnthalpy; - CpWater = GetSpecificHeatGlycol(state, PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, + CpWater = GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidName, state.dataWaterToAirHeatPumpSimple->SourceSideInletTemp, - PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, + state.dataPlnt->PlantLoop(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex, RoutineNameSourceSideInletTemp); // Check for flows, do not perform simulation if no flow in load side or source side. @@ -2726,7 +2722,7 @@ namespace WaterToAirHeatPumpSimple { // Set the water outlet node of the WatertoAirHPSimple // Set the water outlet nodes for properties that just pass through & not used - SafeCopyPlantNode(WaterInletNode, WaterOutletNode); + SafeCopyPlantNode(state, WaterInletNode, WaterOutletNode); Node(WaterOutletNode).Temp = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).OutletWaterTemp; Node(WaterOutletNode).Enthalpy = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).OutletWaterEnthalpy; diff --git a/src/EnergyPlus/WaterUse.cc b/src/EnergyPlus/WaterUse.cc index e314d0ba5a6..39d2d1bd7f4 100644 --- a/src/EnergyPlus/WaterUse.cc +++ b/src/EnergyPlus/WaterUse.cc @@ -177,7 +177,7 @@ namespace WaterUse { } // WHILE - state.dataWaterUse->WaterConnections(WaterConnNum).UpdateWaterConnections(); + state.dataWaterUse->WaterConnections(WaterConnNum).UpdateWaterConnections(state); state.dataWaterUse->WaterConnections(WaterConnNum).ReportWaterUse(state); } // WaterConnNum @@ -270,7 +270,7 @@ namespace WaterUse { } } // WHILE - this->UpdateWaterConnections(); + this->UpdateWaterConnections(state); this->ReportWaterUse(state); } @@ -975,7 +975,7 @@ namespace WaterUse { this->setupMyOutputVars = false; } - if (this->plantScanFlag && allocated(DataPlant::PlantLoop) && !this->StandAlone) { + if (this->plantScanFlag && allocated(state.dataPlnt->PlantLoop) && !this->StandAlone) { bool errFlag = false; PlantUtilities::ScanPlantLoopsForObject(state, this->Name, @@ -1270,7 +1270,7 @@ namespace WaterUse { } } - void WaterConnectionsType::UpdateWaterConnections() + void WaterConnectionsType::UpdateWaterConnections(EnergyPlusData &state) { // SUBROUTINE INFORMATION: @@ -1284,7 +1284,7 @@ namespace WaterUse { if (this->InletNode > 0 && this->OutletNode > 0) { // Pass all variables from inlet to outlet node - PlantUtilities::SafeCopyPlantNode(this->InletNode, this->OutletNode, this->PlantLoopNum); + PlantUtilities::SafeCopyPlantNode(state, this->InletNode, this->OutletNode, this->PlantLoopNum); // Set outlet node variables that are possibly changed DataLoopNode::Node(this->OutletNode).Temp = this->ReturnTemp; diff --git a/src/EnergyPlus/WaterUse.hh b/src/EnergyPlus/WaterUse.hh index 7274ac0535c..0fd1bc5ef0a 100644 --- a/src/EnergyPlus/WaterUse.hh +++ b/src/EnergyPlus/WaterUse.hh @@ -237,7 +237,7 @@ namespace WaterUse { void CalcConnectionsHeatRecovery(EnergyPlusData &state); - void UpdateWaterConnections(); + void UpdateWaterConnections(EnergyPlusData &state); void ReportWaterUse(EnergyPlusData &state); diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc index 25400407867..b71f8d20874 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc @@ -7561,7 +7561,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) EXPECT_EQ("FCU HEATING COIL", thisFanCoil.HCoilName); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); NumPltSizInput = 2; PlantSizData.allocate(NumPltSizInput); // chilled water coil @@ -7581,17 +7581,17 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) HWCoil.WaterLoopBranchNum = 1; HWCoil.WaterLoopCompNum = 1; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } // chilled water plant loop - auto &CWLoop(PlantLoop(2)); + auto &CWLoop(state->dataPlnt->PlantLoop(2)); CWLoop.Name = "ChilledWaterLoop"; CWLoop.FluidName = "Water"; CWLoop.FluidIndex = 1; @@ -7608,7 +7608,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) CWLoopSizingData.DeltaT = 5.6; DataPlant::PlantFirstSizesOkayToFinalize = true; // hot water plant loop - auto &HWLoop(PlantLoop(1)); + auto &HWLoop(state->dataPlnt->PlantLoop(1)); HWLoop.Name = "HotWaterLoop"; HWLoop.FluidName = "Water"; HWLoop.FluidIndex = 1; @@ -7992,7 +7992,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) EXPECT_EQ(state->dataSystemAvailabilityManager->SysAvailMgr_NightCycle, thisAvaiManager.MgrType); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); NumPltSizInput = 2; PlantSizData.allocate(NumPltSizInput); // chilled water coil @@ -8012,17 +8012,17 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) HWCoil.WaterLoopBranchNum = 1; HWCoil.WaterLoopCompNum = 1; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } // chilled water plant loop - auto &CWLoop(PlantLoop(2)); + auto &CWLoop(state->dataPlnt->PlantLoop(2)); CWLoop.Name = "ChilledWaterLoop"; CWLoop.FluidName = "Water"; CWLoop.FluidIndex = 1; @@ -8039,7 +8039,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) CWLoopSizingData.DeltaT = 5.6; DataPlant::PlantFirstSizesOkayToFinalize = true; // hot water plant loop - auto &HWLoop(PlantLoop(1)); + auto &HWLoop(state->dataPlnt->PlantLoop(1)); HWLoop.Name = "HotWaterLoop"; HWLoop.FluidName = "Water"; HWLoop.FluidIndex = 1; diff --git a/tst/EnergyPlus/unit/Autosizing/CoolingCapacitySizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/CoolingCapacitySizing.unit.cc index ca85078c745..8139afb3c29 100644 --- a/tst/EnergyPlus/unit/Autosizing/CoolingCapacitySizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/CoolingCapacitySizing.unit.cc @@ -158,7 +158,7 @@ TEST_F(AutoSizingFixture, CoolingCapacitySizingGauntlet) DataSizing::ZoneEqSizing(1).ATMixerCoolPriDryBulb = 20.0; DataSizing::ZoneEqSizing(1).ATMixerCoolPriHumRat = 0.007; - DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); DataSizing::DataWaterLoopNum = 1; DataSizing::DataWaterCoilSizHeatDeltaT = 5.0; diff --git a/tst/EnergyPlus/unit/Autosizing/CoolingWaterDesAirOutletTempSizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/CoolingWaterDesAirOutletTempSizing.unit.cc index 3c726e4ee05..83cd2636160 100644 --- a/tst/EnergyPlus/unit/Autosizing/CoolingWaterDesAirOutletTempSizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/CoolingWaterDesAirOutletTempSizing.unit.cc @@ -116,7 +116,7 @@ TEST_F(AutoSizingFixture, CoolingWaterDesAirOutletTempSizingGauntlet) // now allocate sizing arrays for testing autosized field EnergyPlus::DataSizing::FinalZoneSizing.allocate(1); EnergyPlus::DataSizing::ZoneEqSizing.allocate(1); - EnergyPlus::DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); EnergyPlus::DataSizing::PlantSizData.allocate(1); EnergyPlus::DataSizing::PlantSizData(1).ExitTemp = 7.0; EnergyPlus::DataSizing::DataPltSizCoolNum = 1; diff --git a/tst/EnergyPlus/unit/Autosizing/CoolingWaterflowSizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/CoolingWaterflowSizing.unit.cc index cf8acee7849..0af308bf4e2 100644 --- a/tst/EnergyPlus/unit/Autosizing/CoolingWaterflowSizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/CoolingWaterflowSizing.unit.cc @@ -94,7 +94,7 @@ TEST_F(AutoSizingFixture, CoolingWaterflowSizingGauntlet) // Test #2 - Zone Equipment, no autosizing, has input data DataSizing::DataWaterLoopNum = 1; - DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); DataSizing::DataWaterCoilSizCoolDeltaT = 10.0; sizer.initializeWithinEP(*this->state, DataHVACGlobals::cAllCoilTypes(DataHVACGlobals::Coil_CoolingWater), "MyWaterCoil", printFlag, routineName); sizedValue = sizer.size(*this->state, inputValue, errorsFound); diff --git a/tst/EnergyPlus/unit/Autosizing/HeatingCapacitySizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/HeatingCapacitySizing.unit.cc index e8eedb89116..e47196a0cac 100644 --- a/tst/EnergyPlus/unit/Autosizing/HeatingCapacitySizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/HeatingCapacitySizing.unit.cc @@ -164,7 +164,7 @@ TEST_F(AutoSizingFixture, HeatingCapacitySizingGauntlet) DataSizing::ZoneEqSizing(1).ATMixerHeatPriDryBulb = 20.0; DataSizing::ZoneEqSizing(1).ATMixerHeatPriHumRat = 0.007; - DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); DataSizing::DataWaterLoopNum = 1; DataSizing::DataWaterCoilSizHeatDeltaT = 5.0; diff --git a/tst/EnergyPlus/unit/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.unit.cc index 1f66a25f1cf..f0877a5c1fd 100644 --- a/tst/EnergyPlus/unit/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.unit.cc @@ -131,7 +131,7 @@ TEST_F(AutoSizingFixture, HeatingWaterDesCoilLoadUsedForUASizingGauntlet) EnergyPlus::DataSizing::ZoneEqSizing(1).MaxHWVolFlow = 0.0002; EnergyPlus::DataSizing::ZoneEqSizing(1).ATMixerHeatPriDryBulb = 28.0; EnergyPlus::DataSizing::ZoneEqSizing(1).ATMixerHeatPriHumRat = 0.0045; - EnergyPlus::DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); DataSizing::DataWaterLoopNum = 1; DataSizing::DataWaterCoilSizHeatDeltaT = 5.0; DataSizing::DataWaterFlowUsedForSizing = 0.0002; diff --git a/tst/EnergyPlus/unit/Autosizing/HeatingWaterflowSizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/HeatingWaterflowSizing.unit.cc index e67a50d5e90..ef23805f7c6 100644 --- a/tst/EnergyPlus/unit/Autosizing/HeatingWaterflowSizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/HeatingWaterflowSizing.unit.cc @@ -261,8 +261,8 @@ TEST_F(AutoSizingFixture, HeatingWaterflowSizingGauntlet) DataSizing::ZoneEqUnitHeater = false; DataSizing::DataWaterLoopNum = 1; DataSizing::DataWaterCoilSizHeatDeltaT = 10.0; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).FluidName = "Water"; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).FluidName = "Water"; // start with an auto-sized value as the user input inputValue = EnergyPlus::DataSizing::AutoSize; // do sizing diff --git a/tst/EnergyPlus/unit/Autosizing/WaterHeatingCapacitySizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/WaterHeatingCapacitySizing.unit.cc index faa02a74726..dd32bb8469f 100644 --- a/tst/EnergyPlus/unit/Autosizing/WaterHeatingCapacitySizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/WaterHeatingCapacitySizing.unit.cc @@ -130,7 +130,7 @@ TEST_F(AutoSizingFixture, WaterHeatingCapacitySizingGauntlet) EnergyPlus::DataSizing::ZoneEqSizing(1).MaxHWVolFlow = 0.0002; EnergyPlus::DataSizing::ZoneEqSizing(1).ATMixerHeatPriDryBulb = 28.0; EnergyPlus::DataSizing::ZoneEqSizing(1).ATMixerHeatPriHumRat = 0.0045; - EnergyPlus::DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); DataSizing::DataWaterLoopNum = 1; DataSizing::DataWaterCoilSizHeatDeltaT = 5.0; diff --git a/tst/EnergyPlus/unit/Autosizing/WaterHeatingCoilUASizing.unit.cc b/tst/EnergyPlus/unit/Autosizing/WaterHeatingCoilUASizing.unit.cc index 56af85d266e..ff225b02a13 100644 --- a/tst/EnergyPlus/unit/Autosizing/WaterHeatingCoilUASizing.unit.cc +++ b/tst/EnergyPlus/unit/Autosizing/WaterHeatingCoilUASizing.unit.cc @@ -134,8 +134,8 @@ TEST_F(AutoSizingFixture, WaterHeatingCoilUASizingGauntlet) EnergyPlus::DataSizing::ZoneEqSizing.allocate(1); DataSizing::PlantSizData.allocate(1); DataSizing::PlantSizData(1).ExitTemp = 60.0; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).FluidIndex = 1; DataSizing::ZoneSizingRunDone = true; diff --git a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc index ea86775dbfe..d1fb75aca3f 100644 --- a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc @@ -367,21 +367,21 @@ TEST_F(EnergyPlusFixture, BaseboardConvWater_SizingTest) ZoneSizingInput(3).ZoneNum = 3; int TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); PlantSizData.allocate(TotNumLoops); PlantSizData(1).DeltaT = 10.0; // unit test results are based on a low HW temp at 40 C. Baseboard does not have the capacity to meet the zone load. PlantSizData(1).ExitTemp = 40.0; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.PlantSizNum = 1; loop.FluidName = "WATER"; loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } diff --git a/tst/EnergyPlus/unit/BoilerHotWater.unit.cc b/tst/EnergyPlus/unit/BoilerHotWater.unit.cc index 04c3d4e049c..ea8c5666b2f 100644 --- a/tst/EnergyPlus/unit/BoilerHotWater.unit.cc +++ b/tst/EnergyPlus/unit/BoilerHotWater.unit.cc @@ -81,12 +81,12 @@ TEST_F(EnergyPlusFixture, Boiler_HotWaterSizingTest) state->dataBoilers->Boiler(1).VolFlowRate = 1.0; state->dataBoilers->Boiler(1).VolFlowRateWasAutoSized = false; - DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); DataSizing::PlantSizData.allocate(1); // Hot Water Loop - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; DataSizing::PlantSizData(1).DesVolFlowRate = 1.0; DataSizing::PlantSizData(1).DeltaT = 10.0; DataPlant::PlantFirstSizesOkayToFinalize = true; @@ -111,7 +111,7 @@ TEST_F(EnergyPlusFixture, Boiler_HotWaterSizingTest) // clear state->dataBoilers->Boiler.deallocate(); DataSizing::PlantSizData.deallocate(); - DataPlant::PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); } TEST_F(EnergyPlusFixture, Boiler_HotWaterAutoSizeTempTest) { @@ -126,26 +126,26 @@ TEST_F(EnergyPlusFixture, Boiler_HotWaterAutoSizeTempTest) state->dataBoilers->Boiler(1).VolFlowRate = DataSizing::AutoSize; state->dataBoilers->Boiler(1).VolFlowRateWasAutoSized = true; - DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); DataSizing::PlantSizData.allocate(1); // Hot Water Loop - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; DataSizing::PlantSizData(1).DesVolFlowRate = 1.0; DataSizing::PlantSizData(1).DeltaT = 10.0; DataPlant::PlantFirstSizesOkayToFinalize = true; // calculate nominal capacity at 60.0 C hot water temperature Real64 rho = FluidProperties::GetDensityGlycol(*state, - DataPlant::PlantLoop(state->dataBoilers->Boiler(1).LoopNum).FluidName, + state->dataPlnt->PlantLoop(state->dataBoilers->Boiler(1).LoopNum).FluidName, 60.0, - DataPlant::PlantLoop(state->dataBoilers->Boiler(1).LoopNum).FluidIndex, + state->dataPlnt->PlantLoop(state->dataBoilers->Boiler(1).LoopNum).FluidIndex, "Boiler_HotWaterAutoSizeTempTest"); Real64 Cp = FluidProperties::GetSpecificHeatGlycol(*state, - DataPlant::PlantLoop(state->dataBoilers->Boiler(1).LoopNum).FluidName, + state->dataPlnt->PlantLoop(state->dataBoilers->Boiler(1).LoopNum).FluidName, 60.0, - DataPlant::PlantLoop(state->dataBoilers->Boiler(1).LoopNum).FluidIndex, + state->dataPlnt->PlantLoop(state->dataBoilers->Boiler(1).LoopNum).FluidIndex, "Boiler_HotWaterAutoSizeTempTest"); Real64 NomCapBoilerExpected = rho * PlantSizData(1).DesVolFlowRate * Cp * PlantSizData(1).DeltaT * state->dataBoilers->Boiler(1).SizFac; @@ -237,14 +237,14 @@ TEST_F(EnergyPlusFixture, Boiler_HotWater_BoilerEfficiency) EXPECT_TRUE(process_idf(idf_objects, false)); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -252,15 +252,15 @@ TEST_F(EnergyPlusFixture, Boiler_HotWater_BoilerEfficiency) GetBoilerInput(*state); auto &thisBoiler = state->dataBoilers->Boiler(1); - DataPlant::PlantLoop(1).Name = "HotWaterLoop"; - DataPlant::PlantLoop(1).FluidName = "HotWater"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisBoiler.Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Boiler_Simple; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisBoiler.BoilerInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisBoiler.BoilerOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisBoiler.Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Boiler_Simple; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisBoiler.BoilerInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisBoiler.BoilerOutletNodeNum; DataSizing::PlantSizData.allocate(1); DataSizing::PlantSizData(1).DesVolFlowRate = 0.1; diff --git a/tst/EnergyPlus/unit/BoilerSteam.unit.cc b/tst/EnergyPlus/unit/BoilerSteam.unit.cc index 1a34ea0af34..a579ddf7c86 100644 --- a/tst/EnergyPlus/unit/BoilerSteam.unit.cc +++ b/tst/EnergyPlus/unit/BoilerSteam.unit.cc @@ -148,14 +148,14 @@ TEST_F(EnergyPlusFixture, BoilerSteam_BoilerEfficiency) EXPECT_TRUE(process_idf(idf_objects, false)); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -163,15 +163,15 @@ TEST_F(EnergyPlusFixture, BoilerSteam_BoilerEfficiency) GetBoilerInput(*state); auto &thisBoiler = state->dataBoilerSteam->Boiler(state->dataBoilerSteam->numBoilers); - DataPlant::PlantLoop(1).Name = "SteamLoop"; - DataPlant::PlantLoop(1).FluidName = "Steam"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidName = "STEAM"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisBoiler.Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Boiler_Steam; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisBoiler.BoilerInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisBoiler.BoilerOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "SteamLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "Steam"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidName = "STEAM"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisBoiler.Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Boiler_Steam; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisBoiler.BoilerInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisBoiler.BoilerOutletNodeNum; DataSizing::PlantSizData.allocate(1); DataSizing::PlantSizData(1).DesVolFlowRate = 0.1; diff --git a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc index 1578141d562..d2dd84b4fbd 100644 --- a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc @@ -1812,11 +1812,11 @@ TEST_F(EnergyPlusFixture, ChillerAbsorption_Calc) // lock the evap flow at test condition specified int LoopNum = thisChiller.CWLoopNum; int LoopSideNum = thisChiller.CWLoopSideNum; - PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = DataPlant::iFlowLock::Locked; // calc generator flow int GenLoopNum = thisChiller.GenLoopNum; int GenLoopSideNum = thisChiller.GenLoopSideNum; - PlantLoop(GenLoopNum).LoopSide(GenLoopSideNum).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(GenLoopNum).LoopSide(GenLoopSideNum).FlowLock = DataPlant::iFlowLock::Unlocked; // run CalcBLASTAbsorberModel thisChiller.EquipFlowCtrl = EquipFlowCtrl; thisChiller.calculate(*state, AbsChillEvapLoad, AbsChillRunFlag); diff --git a/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc b/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc index 8a78ad31120..9fabf128043 100644 --- a/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc +++ b/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc @@ -96,15 +96,15 @@ TEST_F(EnergyPlusFixture, ChillerConstantCOP_WaterCooled_Autosize) EXPECT_TRUE(process_idf(idf_objects, false)); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -113,25 +113,25 @@ TEST_F(EnergyPlusFixture, ChillerConstantCOP_WaterCooled_Autosize) auto &thisChiller = state->dataPlantChillers->ConstCOPChiller(1); - DataPlant::PlantLoop(1).Name = "ChilledWaterLoop"; - DataPlant::PlantLoop(1).FluidName = "ChilledWater"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisChiller.Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ConstCOP; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisChiller.EvapInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisChiller.EvapOutletNodeNum; - - DataPlant::PlantLoop(2).Name = "CondenserWaterLoop"; - DataPlant::PlantLoop(2).FluidName = "CondenserWater"; - DataPlant::PlantLoop(2).FluidIndex = 1; - DataPlant::PlantLoop(2).PlantSizNum = 2; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = thisChiller.Name; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ConstCOP; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisChiller.CondInletNodeNum; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisChiller.CondOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisChiller.Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ConstCOP; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisChiller.EvapInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisChiller.EvapOutletNodeNum; + + state->dataPlnt->PlantLoop(2).Name = "CondenserWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "CondenserWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).PlantSizNum = 2; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = thisChiller.Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ConstCOP; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisChiller.CondInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisChiller.CondOutletNodeNum; DataSizing::PlantSizData.allocate(2); DataSizing::PlantSizData(1).DesVolFlowRate = 0.001; diff --git a/tst/EnergyPlus/unit/ChillerElectric.unit.cc b/tst/EnergyPlus/unit/ChillerElectric.unit.cc index 2fd4117dc5a..55731f485b6 100644 --- a/tst/EnergyPlus/unit/ChillerElectric.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectric.unit.cc @@ -108,40 +108,40 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Autosize) EXPECT_TRUE(process_idf(idf_objects, false)); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } ElectricChillerSpecs::getInput(*state); - DataPlant::PlantLoop(1).Name = "ChilledWaterLoop"; - DataPlant::PlantLoop(1).FluidName = "ChilledWater"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).EvapInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).EvapOutletNodeNum; - - DataPlant::PlantLoop(2).Name = "CondenserWaterLoop"; - DataPlant::PlantLoop(2).FluidName = "CondenserWater"; - DataPlant::PlantLoop(2).FluidIndex = 1; - DataPlant::PlantLoop(2).PlantSizNum = 2; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).CondInletNodeNum; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).CondOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).EvapInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).EvapOutletNodeNum; + + state->dataPlnt->PlantLoop(2).Name = "CondenserWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "CondenserWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).PlantSizNum = 2; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).CondInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).CondOutletNodeNum; DataSizing::PlantSizData.allocate(2); DataSizing::PlantSizData(1).DesVolFlowRate = 0.001; @@ -235,40 +235,40 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Simulate) EXPECT_TRUE(process_idf(idf_objects, false)); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } ElectricChillerSpecs::getInput(*state); - DataPlant::PlantLoop(1).Name = "ChilledWaterLoop"; - DataPlant::PlantLoop(1).FluidName = "ChilledWater"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).EvapInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).EvapOutletNodeNum; - - DataPlant::PlantLoop(2).Name = "CondenserWaterLoop"; - DataPlant::PlantLoop(2).FluidName = "CondenserWater"; - DataPlant::PlantLoop(2).FluidIndex = 1; - DataPlant::PlantLoop(2).PlantSizNum = 2; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).CondInletNodeNum; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).CondOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).EvapInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).EvapOutletNodeNum; + + state->dataPlnt->PlantLoop(2).Name = "CondenserWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "CondenserWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).PlantSizNum = 2; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataPlantChillers->ElectricChiller(1).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_Electric; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataPlantChillers->ElectricChiller(1).CondInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataPlantChillers->ElectricChiller(1).CondOutletNodeNum; DataSizing::PlantSizData.allocate(2); DataSizing::PlantSizData(1).DesVolFlowRate = 0.001; diff --git a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc index 69c5f204f25..ed969865f7c 100644 --- a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc @@ -81,7 +81,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_TestOutletNodeConditions) Node(thisEIR.EvapInletNodeNum).Temp = 18.0; Node(thisEIR.CondInletNodeNum).Temp = 35.0; - thisEIR.update(-2000, true); + thisEIR.update(*state, -2000, true); EXPECT_EQ(18, thisEIR.EvapOutletTemp); EXPECT_EQ(35, thisEIR.CondOutletTemp); @@ -107,18 +107,18 @@ TEST_F(EnergyPlusFixture, ElectricEIRChiller_HeatRecoveryAutosizeTest) thisEIR.RefCap = 10000; thisEIR.RefCOP = 3.0; - DataPlant::PlantLoop.allocate(2); + state->dataPlnt->PlantLoop.allocate(2); DataSizing::PlantSizData.allocate(2); // chilled water loop - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; DataSizing::PlantSizData(1).DesVolFlowRate = 1.0; DataSizing::PlantSizData(1).DeltaT = 5.0; // condenser water loop - DataPlant::PlantLoop(2).PlantSizNum = 2; - DataPlant::PlantLoop(2).FluidIndex = 1; - DataPlant::PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).PlantSizNum = 2; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; DataSizing::PlantSizData(2).DesVolFlowRate = 1.0; DataSizing::PlantSizData(2).DeltaT = 5.0; @@ -130,7 +130,7 @@ TEST_F(EnergyPlusFixture, ElectricEIRChiller_HeatRecoveryAutosizeTest) EXPECT_NEAR(thisEIR.DesignHeatRecVolFlowRate, 0.5, 0.00001); DataSizing::PlantSizData.deallocate(); - DataPlant::PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); } TEST_F(EnergyPlusFixture, ChillerElectricEIR_AirCooledChiller) @@ -192,15 +192,15 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_AirCooledChiller) EXPECT_TRUE(process_idf(idf_objects, false)); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -208,15 +208,15 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_AirCooledChiller) GetElectricEIRChillerInput(*state); auto &thisEIR = state->dataChillerElectricEIR->ElectricEIRChiller(1); - DataPlant::PlantLoop(1).Name = "ChilledWaterLoop"; - DataPlant::PlantLoop(1).FluidName = "ChilledWater"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisEIR.Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ElectricEIR; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisEIR.EvapInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisEIR.EvapOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisEIR.Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ElectricEIR; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisEIR.EvapInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisEIR.EvapOutletNodeNum; DataSizing::PlantSizData.allocate(1); DataSizing::PlantSizData(1).DesVolFlowRate = 0.001; @@ -299,15 +299,15 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_EvaporativelyCooled_Calculate) Psychrometrics::InitializePsychRoutines(); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -315,15 +315,15 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_EvaporativelyCooled_Calculate) GetElectricEIRChillerInput(*state); auto &thisEIRChiller = state->dataChillerElectricEIR->ElectricEIRChiller(1); - DataPlant::PlantLoop(1).Name = "ChilledWaterLoop"; - DataPlant::PlantLoop(1).FluidName = "ChilledWater"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisEIRChiller.Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ElectricEIR; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisEIRChiller.EvapInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisEIRChiller.EvapOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = thisEIRChiller.Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Chiller_ElectricEIR; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = thisEIRChiller.EvapInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = thisEIRChiller.EvapOutletNodeNum; DataSizing::PlantSizData.allocate(1); DataSizing::PlantSizData(1).DesVolFlowRate = 0.001; @@ -346,7 +346,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_EvaporativelyCooled_Calculate) Real64 MyLoad(-18000.0); openOutputFiles(*state); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; DataLoopNode::Node(thisEIRChiller.EvapOutletNodeNum).TempSetPoint = 6.67; DataLoopNode::Node(thisEIRChiller.EvapInletNodeNum).Temp = 16.0; // init and size diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index 8e69e94f2fb..cbddc0efc8b 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -3043,7 +3043,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUser_SizingError_Sizing PlantManager::GetPlantLoopData(*state); PlantManager::GetPlantInput(*state); SizingManager::GetPlantSizingInput(*state); - PlantManager::InitOneTimePlantSizingInfo(1); + PlantManager::InitOneTimePlantSizingInfo(*state, 1); PlantManager::SizePlantLoop(*state, 1, true); PlantManager::InitLoopEquip = true; @@ -3435,7 +3435,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUser_SizingError_UserSp PlantManager::GetPlantLoopData(*state); PlantManager::GetPlantInput(*state); SizingManager::GetPlantSizingInput(*state); - PlantManager::InitOneTimePlantSizingInfo(1); + PlantManager::InitOneTimePlantSizingInfo(*state, 1); PlantManager::SizePlantLoop(*state, 1, true); PlantManager::InitLoopEquip = true; @@ -3909,7 +3909,7 @@ TEST_F(EnergyPlusFixture, VSCoolingTowers_WaterOutletTempTest) PlantManager::GetPlantLoopData(*state); PlantManager::GetPlantInput(*state); SizingManager::GetPlantSizingInput(*state); - PlantManager::InitOneTimePlantSizingInfo(1); + PlantManager::InitOneTimePlantSizingInfo(*state, 1); PlantManager::SizePlantLoop(*state, 1, true); PlantManager::InitLoopEquip = true; @@ -3939,8 +3939,8 @@ TEST_F(EnergyPlusFixture, VSCoolingTowers_WaterOutletTempTest) Real64 WaterFlowRateRatio = 0.75; Real64 AirWetBulbTemp = state->dataEnvrn->OutWetBulbTemp; - DataPlant::PlantLoop(VSTower.LoopNum).LoopSide(VSTower.LoopSideNum).FlowLock = DataPlant::iFlowLock::Locked; - DataPlant::PlantLoop(VSTower.LoopNum).LoopSide(VSTower.LoopSideNum).TempSetPoint = 30.0; + state->dataPlnt->PlantLoop(VSTower.LoopNum).LoopSide(VSTower.LoopSideNum).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(VSTower.LoopNum).LoopSide(VSTower.LoopSideNum).TempSetPoint = 30.0; VSTower.WaterMassFlowRate = VSTower.DesWaterMassFlowRate * WaterFlowRateRatio; VSTower.calculateVariableSpeedTower(*state); diff --git a/tst/EnergyPlus/unit/DataPlant.unit.cc b/tst/EnergyPlus/unit/DataPlant.unit.cc index 5c426058b85..0aa0d92a779 100644 --- a/tst/EnergyPlus/unit/DataPlant.unit.cc +++ b/tst/EnergyPlus/unit/DataPlant.unit.cc @@ -65,73 +65,73 @@ using namespace ObjexxFCL; TEST_F(EnergyPlusFixture, DataPlant_AnyPlantLoopSidesNeedSim) { TotNumLoops = 3; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); } - EXPECT_TRUE(PlantUtilities::AnyPlantLoopSidesNeedSim()); // SimLoopSideNeeded is set to true in default ctor - PlantUtilities::SetAllPlantSimFlagsToValue(false); // Set all SimLoopSideNeeded to false - EXPECT_FALSE(PlantUtilities::AnyPlantLoopSidesNeedSim()); + EXPECT_TRUE(PlantUtilities::AnyPlantLoopSidesNeedSim(*state)); // SimLoopSideNeeded is set to true in default ctor + PlantUtilities::SetAllPlantSimFlagsToValue(*state, false); // Set all SimLoopSideNeeded to false + EXPECT_FALSE(PlantUtilities::AnyPlantLoopSidesNeedSim(*state)); } TEST_F(EnergyPlusFixture, DataPlant_verifyTwoNodeNumsOnSamePlantLoop) { // not using the DataPlantTest base class because of how specific this one is and that one is very general - if (PlantLoop.allocated()) PlantLoop.deallocate(); + if (state->dataPlnt->PlantLoop.allocated()) state->dataPlnt->PlantLoop.deallocate(); TotNumLoops = 2; - PlantLoop.allocate(2); - PlantLoop(1).LoopSide.allocate(2); - PlantLoop(1).LoopSide(1).Branch.allocate(1); - PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - PlantLoop(1).LoopSide(2).Branch.allocate(1); - PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - PlantLoop(2).LoopSide.allocate(2); - PlantLoop(2).LoopSide(1).Branch.allocate(1); - PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - PlantLoop(2).LoopSide(2).Branch.allocate(1); - PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); // initialize all node numbers to zero - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; - PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 0; - PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumOut = 0; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; - PlantLoop(2).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 0; - PlantLoop(2).LoopSide(2).Branch(1).Comp(1).NodeNumOut = 0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 0; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumOut = 0; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 0; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1).NodeNumOut = 0; // specify the node numbers of interest int const nodeNumA = 1; int const nodeNumB = 2; // first test, expected pass - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; - PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 2; - EXPECT_TRUE(PlantUtilities::verifyTwoNodeNumsOnSamePlantLoop(nodeNumA, nodeNumB)); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 2; + EXPECT_TRUE(PlantUtilities::verifyTwoNodeNumsOnSamePlantLoop(*state, nodeNumA, nodeNumB)); // reset node numbers - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; - PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 0; // second test, expected false - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 2; - EXPECT_FALSE(PlantUtilities::verifyTwoNodeNumsOnSamePlantLoop(nodeNumA, nodeNumB)); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 2; + EXPECT_FALSE(PlantUtilities::verifyTwoNodeNumsOnSamePlantLoop(*state, nodeNumA, nodeNumB)); TotNumLoops = 0; - PlantLoop(1).LoopSide(1).Branch(1).Comp.deallocate(); - PlantLoop(1).LoopSide(1).Branch.deallocate(); - PlantLoop(1).LoopSide(2).Branch(1).Comp.deallocate(); - PlantLoop(1).LoopSide(2).Branch.deallocate(); - PlantLoop(1).LoopSide.deallocate(); - PlantLoop(2).LoopSide(1).Branch(1).Comp.deallocate(); - PlantLoop(2).LoopSide(1).Branch.deallocate(); - PlantLoop(2).LoopSide(2).Branch(1).Comp.deallocate(); - PlantLoop(2).LoopSide(2).Branch.deallocate(); - PlantLoop(2).LoopSide.deallocate(); - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.deallocate(); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.deallocate(); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.deallocate(); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.deallocate(); + state->dataPlnt->PlantLoop(1).LoopSide.deallocate(); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.deallocate(); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.deallocate(); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.deallocate(); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch.deallocate(); + state->dataPlnt->PlantLoop(2).LoopSide.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); } diff --git a/tst/EnergyPlus/unit/EMSManager.unit.cc b/tst/EnergyPlus/unit/EMSManager.unit.cc index e61fde171ec..8d9447df9fd 100644 --- a/tst/EnergyPlus/unit/EMSManager.unit.cc +++ b/tst/EnergyPlus/unit/EMSManager.unit.cc @@ -241,29 +241,29 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo // set up plant loop DataPlant::TotNumLoops = 1; - PlantLoop.allocate(1); - PlantLoop(1).Name = "MyPlant"; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).Name = "MyPlant"; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } // create 2 components on a single branch to simulate water flow control for entire branch - PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 2; - PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(2); - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 41; // Coil:Heating:Water - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "Zone1FanCoilHeatingCoil"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 2; - PlantLoop(1).LoopSide(1).Branch(1).Comp(2).TypeOf_Num = 21; // Pipe:Adiabatic - PlantLoop(1).LoopSide(1).Branch(1).Comp(2).Name = "Pipe"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumIn = 2; - PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumOut = 3; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 41; // Coil:Heating:Water + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "Zone1FanCoilHeatingCoil"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).TypeOf_Num = 21; // Pipe:Adiabatic + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).Name = "Pipe"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumIn = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumOut = 3; PlantCondLoopOperation::SetupPlantEMSActuators(*state); // set flow, max and maxavail on the nodes @@ -287,13 +287,13 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // set dummy EMS value - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should be zero'd on this call since EMS 0's values on begin environment (whether EMS program runs on this call or not) EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); - EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); - EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); + EXPECT_FALSE(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); + EXPECT_NEAR(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); // expect node data to represent full flow // SetActuatedBranchFlowRate(*state, CompFlow, ActuatedNode, LoopNum, LoopSideNum, BranchNum, ResetMode ) @@ -317,13 +317,13 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo EXPECT_EQ(Node(3).MassFlowRateRequest, NodeMdot); // set dummy EMS value - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should remain on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); - EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); - EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 1.0, 0.000001); + EXPECT_FALSE(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); + EXPECT_NEAR(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 1.0, 0.000001); SetActuatedBranchFlowRate(*state, NodeMdot, 1, 1, 1, 1, false); EXPECT_EQ(Node(1).MassFlowRate, NodeMdot); EXPECT_EQ(Node(1).MassFlowRateMax, NodeMdot); @@ -347,8 +347,8 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo // override flag should also be true EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); - EXPECT_TRUE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); - EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); + EXPECT_TRUE(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); + EXPECT_NEAR(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); // expect node data to represent no flow. Request is also 0's in this function. Max and MaxAvail are not changed SetActuatedBranchFlowRate(*state, NodeMdot, 1, 1, 1, 1, false); @@ -405,29 +405,29 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate // set up plant loop DataPlant::TotNumLoops = 1; - PlantLoop.allocate(1); - PlantLoop(1).Name = "MyPlant"; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).Name = "MyPlant"; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } // create 2 components on a single branch to simulate water flow control for entire branch - PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 2; - PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(2); - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 41; // Coil:Heating:Water - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "Zone1FanCoilHeatingCoil"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 2; - PlantLoop(1).LoopSide(1).Branch(1).Comp(2).TypeOf_Num = 21; // Pipe:Adiabatic - PlantLoop(1).LoopSide(1).Branch(1).Comp(2).Name = "Pipe"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumIn = 2; - PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumOut = 3; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 41; // Coil:Heating:Water + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "Zone1FanCoilHeatingCoil"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).TypeOf_Num = 21; // Pipe:Adiabatic + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).Name = "Pipe"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumIn = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(2).NodeNumOut = 3; PlantCondLoopOperation::SetupPlantEMSActuators(*state); // set flow, max and maxavail on the nodes @@ -450,13 +450,13 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate // set up EMS EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::SetupSimulation, anyRan, ObjexxFCL::Optional_int_const()); // set dummy EMS value - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should be zero'd on this call since EMS 0's values on begin environment (whether EMS program runs on this call or not) EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::BeginNewEnvironment, anyRan, ObjexxFCL::Optional_int_const()); - EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); - EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); + EXPECT_FALSE(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); + EXPECT_NEAR(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); // expect node data to represent full flow // SetComponentFlowRate(*state, CompFlow, InletNode, OutletNode, LoopNum, LoopSideNum, BranchIndex, CompIndex ) @@ -480,13 +480,13 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate EXPECT_EQ(Node(3).MassFlowRateRequest, NodeMdot); // set dummy EMS value - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue = 1.0; // dummy value set above should remain on this call since EMS calling manager uses BeginTimestepBeforePredictor as the calling point EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::BeginNewEnvironmentAfterWarmUp, anyRan, ObjexxFCL::Optional_int_const()); - EXPECT_FALSE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); - EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 1.0, 0.000001); + EXPECT_FALSE(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); + EXPECT_NEAR(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 1.0, 0.000001); // expect node data to represent full flow SetComponentFlowRate(*state, NodeMdot, 1, 2, 1, 1, 1, 1); @@ -512,8 +512,8 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate // override flag should also be true EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); - EXPECT_TRUE(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); - EXPECT_NEAR(PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); + EXPECT_TRUE(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideOn); + EXPECT_NEAR(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).EMSLoadOverrideValue, 0.0, 0.000001); Real64 tempNodeMdot(NodeMdot); // expect node data to represent no flow. Max, MaxAvail, and Request are not changed diff --git a/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc b/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc index e80717c096b..3de0747c265 100644 --- a/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc +++ b/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc @@ -130,25 +130,25 @@ TEST_F(EvapFluidCoolersFixture, EvapFluidCoolerSpecs_getDesignCapacitiesTest) DataLoopNode::Node(1).MassFlowRateMin = 0.0; DataLoopNode::Node(1).MassFlowRateMax = 0.05; DataLoopNode::Node(1).MassFlowRateMaxAvail = 0.05; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).MyLoad = 1.0; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).ON = false; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).CurOpSchemeType = 0; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).MyLoad = 1.0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).ON = false; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).CurOpSchemeType = 0; thisEFC.DesignWaterFlowRateWasAutoSized = false; thisEFC.LowSpeedAirFlowRateWasAutoSized = false; thisEFC.HighSpeedEvapFluidCoolerUAWasAutoSized = false; thisEFC.PerformanceInputMethod_Num = PIM::UFactor; - DataPlant::PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; DataPlant::PlantFinalSizesOkayToReport = false; DataSizing::SaveNumPlantComps = 0; thisEFC.DesignWaterFlowRate = 0.001; DataSizing::PlantSizData.allocate(1); DataSizing::PlantSizData(1).DeltaT = 5.0; - DataPlant::PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; DataSizing::PlantSizData(1).ExitTemp = 20.0; // Now set the specific data for the actual test diff --git a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc index b88d05baa74..fb5d4da5ef1 100644 --- a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc +++ b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc @@ -275,7 +275,7 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -342,12 +342,12 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -362,21 +362,21 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(2).Name = "ChilledWaterLoop"; - PlantLoop(2).FluidName = "ChilledWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; - - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; + + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; CoolingLoad = false; HeatingLoad = true; @@ -412,7 +412,7 @@ namespace EnergyPlus { state->dataGlobal->DoingSizing = false; - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); ZoneSysEnergyDemand.deallocate(); FanCoil.deallocate(); Node.deallocate(); @@ -588,7 +588,7 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -656,12 +656,12 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -676,21 +676,21 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(2).Name = "ChilledWaterLoop"; - PlantLoop(2).FluidName = "ChilledWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; - - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; + + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; HeatingLoad = false; CoolingLoad = true; @@ -725,7 +725,7 @@ namespace EnergyPlus { EXPECT_EQ(Node(FanCoil(1).AirInNode).MassFlowRate, Node(FanCoil(1).AirOutNode).MassFlowRate); state->dataGlobal->DoingSizing = false; - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); ZoneSysEnergyDemand.deallocate(); FanCoil.deallocate(); Node.deallocate(); @@ -899,7 +899,7 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -973,12 +973,12 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -996,25 +996,25 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(2).Name = "ChilledWaterLoop"; - PlantLoop(2).FluidName = "ChilledWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; - - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(2).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; FanCoil(1).CoolCoilLoopNum = 2; FanCoil(1).HeatCoilLoopNum = 1; @@ -1059,7 +1059,7 @@ namespace EnergyPlus { // expect inlet and outlet node air mass flow rates are equal EXPECT_EQ(Node(FanCoil(1).AirInNode).MassFlowRate, Node(FanCoil(1).AirOutNode).MassFlowRate); FirstHVACIteration = false; - PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; Node(FanCoil(1).HeatCoilFluidInletNode).MassFlowRate = 0.2; // Simulate with flow lock on and locked flow > demand flow; bypass extra flow Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); @@ -1076,7 +1076,7 @@ namespace EnergyPlus { // normal heating, no flow lock, heating capacity exceeded QZnReq = 5000.0; ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = 5000.00; - PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); EXPECT_NEAR(4420.0, QUnitOut, 5.0); // expect inlet and outlet node air mass flow rates are equal @@ -1085,7 +1085,7 @@ namespace EnergyPlus { // Coil Off Capacity Test #1 - low heating load, no flow lock, setting QUnitOutNoHC when flow lock = 0 QZnReq = 80.0; ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = 80.00; - PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); // FC hits the 80 W target load EXPECT_NEAR(80.0, QUnitOut, 1.0); @@ -1096,7 +1096,7 @@ namespace EnergyPlus { EXPECT_EQ(Node(FanCoil(1).AirInNode).MassFlowRate, Node(FanCoil(1).AirOutNode).MassFlowRate); // Coil Off Capacity Test #2 - lock plant flow after previous call - PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; Node(OAMixer(1).RetNode).Temp = 25.0; // change inlet air condition so off capacity will change to see if QUnitOutNoHC remains fixed Node(OAMixer(1).RetNode).Enthalpy = 39000; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); @@ -1110,7 +1110,7 @@ namespace EnergyPlus { EXPECT_EQ(Node(FanCoil(1).AirInNode).MassFlowRate, Node(FanCoil(1).AirOutNode).MassFlowRate); // Coil Off Capacity Test #3 - unlock plant flow to ensure that water flow rate would have been different had flow not been locked - PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); // FC hits the 80 W target load EXPECT_NEAR(80.0, QUnitOut, 1.0); @@ -1277,7 +1277,7 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:ELECTRIC", FanCoil(1).HCoilType); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -1341,12 +1341,12 @@ namespace EnergyPlus { Node(state->dataWaterCoils->WaterCoil(1).AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -1359,15 +1359,15 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(1).Name = "ChilledWaterLoop"; - PlantLoop(1).FluidName = "ChilledWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; FanCoil(1).CoolCoilLoopNum = 1; FanCoil(1).HeatCoilLoopNum = 0; @@ -1420,7 +1420,7 @@ namespace EnergyPlus { EXPECT_EQ(Node(FanCoil(1).AirInNode).MassFlowRate, Node(FanCoil(1).AirOutNode).MassFlowRate); state->dataGlobal->DoingSizing = false; - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); ZoneSysEnergyDemand.deallocate(); FanCoil.deallocate(); Node.deallocate(); @@ -1596,7 +1596,7 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -1671,12 +1671,12 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -1694,25 +1694,25 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(2).Name = "ChilledWaterLoop"; - PlantLoop(2).FluidName = "ChilledWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; - - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(2).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; FanCoil(1).CoolCoilLoopNum = 2; FanCoil(1).HeatCoilLoopNum = 1; @@ -1757,7 +1757,7 @@ namespace EnergyPlus { EXPECT_EQ(Node(FanCoil(1).AirInNode).MassFlowRate, Node(FanCoil(1).AirOutNode).MassFlowRate); FirstHVACIteration = false; - PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; Node(FanCoil(1).CoolCoilFluidInletNode).MassFlowRate = 0.2; // cooling simulation with flow lock on and locked flow > flow that meets load; bypass extra flow Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); @@ -1776,7 +1776,7 @@ namespace EnergyPlus { // normal cooling, no flow lock, cooling capacity exceeded QZnReq = -5000.0; ZoneSysEnergyDemand(1).RemainingOutputReqToCoolSP = -5000.00; - PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; Sim4PipeFanCoil(*state, FanCoilNum, ZoneNum, ControlledZoneNum, FirstHVACIteration, QUnitOut, LatOutputProvided); EXPECT_NEAR(-4420.0, QUnitOut, 5.0); // expect inlet and outlet node air mass flow rates are equal @@ -1952,7 +1952,7 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -2020,12 +2020,12 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -2040,23 +2040,23 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(2).Name = "ChilledWaterLoop"; - PlantLoop(2).FluidName = "ChilledWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(2).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; + + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; CoolingLoad = false; HeatingLoad = true; @@ -2174,7 +2174,7 @@ namespace EnergyPlus { state->dataGlobal->DoingSizing = false; - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); ZoneSysEnergyDemand.deallocate(); FanCoil.deallocate(); Node.deallocate(); @@ -2281,14 +2281,14 @@ namespace EnergyPlus { GetFanInput(*state); GetFanCoilUnits(*state); - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -2303,23 +2303,23 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(2).Name = "ChilledWaterLoop"; - PlantLoop(2).FluidName = "ChilledWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(2).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; + + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; bool CoolingLoad = true; bool HeatingLoad = false; @@ -2662,7 +2662,7 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -2729,12 +2729,12 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -2749,23 +2749,23 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(2).Name = "ChilledWaterLoop"; - PlantLoop(2).FluidName = "ChilledWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(2).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; + + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; CoolingLoad = false; HeatingLoad = true; @@ -3082,7 +3082,7 @@ namespace EnergyPlus { EXPECT_EQ(DataHVACGlobals::FanType_SystemModelObject, thisFanCoil.FanType_Num); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -3149,17 +3149,17 @@ namespace EnergyPlus { HWCoil.WaterLoopCompNum = 1; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } // chilled water plant loop - auto &CWLoop(PlantLoop(2)); + auto &CWLoop(state->dataPlnt->PlantLoop(2)); CWLoop.Name = "ChilledWaterLoop"; CWLoop.FluidName = "ChilledWater"; CWLoop.FluidIndex = 1; @@ -3169,7 +3169,7 @@ namespace EnergyPlus { CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumIn = CWCoil.WaterInletNodeNum; CWLoop.LoopSide(1).Branch(1).Comp(1).NodeNumOut = CWCoil.WaterOutletNodeNum; // hot water plant loop - auto &HWLoop(PlantLoop(1)); + auto &HWLoop(state->dataPlnt->PlantLoop(1)); HWLoop.Name = "HotWaterLoop"; HWLoop.FluidName = "HotWater"; HWLoop.FluidIndex = 1; @@ -3481,7 +3481,7 @@ namespace EnergyPlus { EXPECT_EQ(DataHVACGlobals::FanType_SystemModelObject, thisFanCoil.FanType_Num); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; ColdWaterMassFlowRate = 1.0; @@ -3530,17 +3530,17 @@ namespace EnergyPlus { Node(eHCoil.AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } // chilled water plant loop - auto &CWLoop(PlantLoop(1)); + auto &CWLoop(state->dataPlnt->PlantLoop(1)); CWLoop.Name = "ChilledWaterLoop"; CWLoop.FluidName = "ChilledWater"; CWLoop.FluidIndex = 1; @@ -3848,7 +3848,7 @@ namespace EnergyPlus { EXPECT_EQ(DataHVACGlobals::FanType_SystemModelObject, thisFanCoil.FanType_Num); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; ColdWaterMassFlowRate = 1.0; @@ -3897,17 +3897,17 @@ namespace EnergyPlus { Node(eHCoil.AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } // chilled water plant loop - auto &CWLoop(PlantLoop(1)); + auto &CWLoop(state->dataPlnt->PlantLoop(1)); CWLoop.Name = "ChilledWaterLoop"; CWLoop.FluidName = "ChilledWater"; CWLoop.FluidIndex = 1; @@ -4215,7 +4215,7 @@ namespace EnergyPlus { EXPECT_EQ(DataHVACGlobals::FanType_SystemModelObject, thisFanCoil.FanType_Num); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; ColdWaterMassFlowRate = 1.0; @@ -4264,17 +4264,17 @@ namespace EnergyPlus { Node(eHCoil.AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } // chilled water plant loop - auto &CWLoop(PlantLoop(1)); + auto &CWLoop(state->dataPlnt->PlantLoop(1)); CWLoop.Name = "ChilledWaterLoop"; CWLoop.FluidName = "ChilledWater"; CWLoop.FluidIndex = 1; @@ -4536,7 +4536,7 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; ColdWaterMassFlowRate = 1.0; @@ -4576,17 +4576,17 @@ namespace EnergyPlus { Node(eHCoil.AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } // chilled water plant loop - auto &CWLoop(PlantLoop(1)); + auto &CWLoop(state->dataPlnt->PlantLoop(1)); CWLoop.Name = "ChilledWaterLoop"; CWLoop.FluidName = "ChilledWater"; CWLoop.FluidIndex = 1; diff --git a/tst/EnergyPlus/unit/FluidCoolers.unit.cc b/tst/EnergyPlus/unit/FluidCoolers.unit.cc index 750f1763407..3afd74b1b25 100644 --- a/tst/EnergyPlus/unit/FluidCoolers.unit.cc +++ b/tst/EnergyPlus/unit/FluidCoolers.unit.cc @@ -347,10 +347,10 @@ TEST_F(EnergyPlusFixture, SizeFunctionTestWhenPlantSizingIndexIsZero) auto &thisFluidCooler = FluidCoolers::SimpleFluidCooler(FluidCoolerNum); - DataPlant::PlantLoop.allocate(FluidCoolerNum); + state->dataPlnt->PlantLoop.allocate(FluidCoolerNum); SimpleFluidCooler.allocate(FluidCoolerNum); SimpleFluidCooler(FluidCoolerNum).LoopNum = 1; - DataPlant::PlantLoop(FluidCoolerNum).PlantSizNum = 0; + state->dataPlnt->PlantLoop(FluidCoolerNum).PlantSizNum = 0; EXPECT_FALSE(thisFluidCooler.HighSpeedFanPowerWasAutoSized); EXPECT_FALSE(thisFluidCooler.HighSpeedAirFlowRateWasAutoSized); diff --git a/tst/EnergyPlus/unit/Furnaces.unit.cc b/tst/EnergyPlus/unit/Furnaces.unit.cc index beb7ef78a08..8ea7e6185e3 100644 --- a/tst/EnergyPlus/unit/Furnaces.unit.cc +++ b/tst/EnergyPlus/unit/Furnaces.unit.cc @@ -292,30 +292,30 @@ TEST_F(EnergyPlusFixture, SetVSHPAirFlowTest_VSFurnaceFlowTest) // set up plant loop DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for ( int loopindex = 1; loopindex <= DataPlant::TotNumLoops; ++loopindex ) { - auto &loop(DataPlant::PlantLoop(loopindex)); + auto &loop(state->dataPlnt->PlantLoop(loopindex)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(loopindex).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(loopindex).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(loopindex).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(loopindex).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 2; loopsidebranch.Comp.allocate(2); } - DataPlant::PlantLoop(1).Name = "Hot Water Loop"; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).FluidIndex = 1; - - DataPlant::PlantLoop(2).Name = "Chilled Water Loop"; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).FluidIndex = 1; - - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPCoolingEquationFit; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATERCOOLINGCOIL"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPHeatingEquationFit; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "WATERHEATINGCOIL"; + state->dataPlnt->PlantLoop(1).Name = "Hot Water Loop"; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + + state->dataPlnt->PlantLoop(2).Name = "Chilled Water Loop"; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPCoolingEquationFit; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATERCOOLINGCOIL"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPHeatingEquationFit; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "WATERHEATINGCOIL"; DataHeatBalance::HeatReclaimSimple_WAHPCoil.allocate(2); diff --git a/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc b/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc index d9ae2174f90..8b1c637c9e4 100644 --- a/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc +++ b/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc @@ -183,11 +183,11 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_Slinky_CalcHXResistance) // Initializations GLHESlinky thisGLHE; - PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); thisGLHE.loopNum = 1; - PlantLoop(thisGLHE.loopNum).FluidName = "WATER"; - PlantLoop(thisGLHE.loopNum).FluidIndex = 1; + state->dataPlnt->PlantLoop(thisGLHE.loopNum).FluidName = "WATER"; + state->dataPlnt->PlantLoop(thisGLHE.loopNum).FluidIndex = 1; thisGLHE.inletTemp = 5.0; thisGLHE.massFlowRate = 0.01; diff --git a/tst/EnergyPlus/unit/HVACControllers.unit.cc b/tst/EnergyPlus/unit/HVACControllers.unit.cc index c4513b61833..a1b9c778b30 100644 --- a/tst/EnergyPlus/unit/HVACControllers.unit.cc +++ b/tst/EnergyPlus/unit/HVACControllers.unit.cc @@ -255,17 +255,17 @@ TEST_F(EnergyPlusFixture, HVACControllers_TestTempAndHumidityRatioCtrlVarType) state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp.allocate(1); state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).Name = "CHILLED WATER COIL"; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).CompType_Num = 5; // state->dataWaterCoils->WaterCoil_Cooling - DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 39; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 2; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 3; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "CHILLED WATER COIL"; + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 39; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 3; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "CHILLED WATER COIL"; bool SimZoneEquipment(false); SimAirServingZones::SimAirLoops(*state, true, SimZoneEquipment); @@ -963,21 +963,21 @@ TEST_F(EnergyPlusFixture, HVACControllers_MaxFlowZero) state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp.allocate(1); state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).Name = "CHILLED WATER COIL"; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).CompType_Num = 5; // WaterCoil_Cooling - DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop(1).Name = "CHW LOOP"; - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 39; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 2; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 3; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "CHILLED WATER COIL"; + state->dataPlnt->PlantLoop(1).Name = "CHW LOOP"; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = 39; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 3; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "CHILLED WATER COIL"; DataSizing::NumPltSizInput = 1; DataSizing::PlantSizData.allocate(1); diff --git a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc index 3453c5a6220..95f7955fcd7 100644 --- a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc +++ b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc @@ -1748,7 +1748,7 @@ TEST_F(EnergyPlusFixture, Beam_sizeandSimulateOneZone) bool FirstHVACIteration = true; // PlantManager::InitializeLoops( FirstHVACIteration ); - PlantUtilities::SetAllFlowLocks(DataPlant::iFlowLock::Unlocked); + PlantUtilities::SetAllFlowLocks(*state, DataPlant::iFlowLock::Unlocked); // first run with a sensible cooling load of 5000 W and cold supply air DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputRequired = -5000.0; DataZoneEnergyDemands::ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = -4000.0; diff --git a/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc b/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc index e2878dec8dc..defc3cea698 100644 --- a/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc @@ -70,19 +70,19 @@ TEST_F(EnergyPlusFixture, ExcessiveHeatStorage_Test) Real64 TankOutletTemp; TimeStepSys = 1; TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int i = 1; i <= TotNumLoops; ++i) { - auto &loop(PlantLoop(i)); + auto &loop(state->dataPlnt->PlantLoop(i)); loop.LoopSide.allocate(2); } // Set Up PlantLoop Variables - PlantLoop(1).Mass = 50; - PlantLoop(1).FluidName = "Water"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).LoopSide(1).NodeNumOut = 1; - PlantLoop(1).LoopSide(1).NodeNumIn = 1; - PlantLoop(1).LoopSide(2).LastTempInterfaceTankOutlet = 80; - PlantLoop(1).LoopSide(2).TotalPumpHeat = 500; + state->dataPlnt->PlantLoop(1).Mass = 50; + state->dataPlnt->PlantLoop(1).FluidName = "Water"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).NodeNumOut = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).LastTempInterfaceTankOutlet = 80; + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalPumpHeat = 500; DataLoopNode::Node.allocate(TotNumLoops); DataLoopNode::Node(1).Temp = 100; DataLoopNode::Node(1).MassFlowRate = 10; @@ -90,19 +90,19 @@ TEST_F(EnergyPlusFixture, ExcessiveHeatStorage_Test) // LoopSideInlet_MdotCpDeltaT should be < LoopSideInlet_McpDTdt // Therefore CapExcessStorageTime AND TotalTime will increase by 1 timestep UpdateHalfLoopInletTemp(*state, 1, 1, TankOutletTemp); - EXPECT_NEAR(-500, PlantLoop(1).LoopSide(2).LoopSideInlet_MdotCpDeltaT, 0.001); - EXPECT_NEAR(2928.82, PlantLoop(1).LoopSide(2).LoopSideInlet_McpDTdt, 0.001); - EXPECT_EQ(1, PlantLoop(1).LoopSide(2).LoopSideInlet_CapExcessStorageTime); - EXPECT_EQ(1, PlantLoop(1).LoopSide(2).LoopSideInlet_TotalTime); + EXPECT_NEAR(-500, state->dataPlnt->PlantLoop(1).LoopSide(2).LoopSideInlet_MdotCpDeltaT, 0.001); + EXPECT_NEAR(2928.82, state->dataPlnt->PlantLoop(1).LoopSide(2).LoopSideInlet_McpDTdt, 0.001); + EXPECT_EQ(1, state->dataPlnt->PlantLoop(1).LoopSide(2).LoopSideInlet_CapExcessStorageTime); + EXPECT_EQ(1, state->dataPlnt->PlantLoop(1).LoopSide(2).LoopSideInlet_TotalTime); - PlantLoop(1).LoopSide(2).LastTempInterfaceTankOutlet = 120; // random + state->dataPlnt->PlantLoop(1).LoopSide(2).LastTempInterfaceTankOutlet = 120; // random // LoopSideInlet_MdotCpDeltaT should be > LoopSideInlet_McpDTdt // Therefore TotalTime will increase by 1 more timestep, but CapExcessStorageTime will NOT increase UpdateHalfLoopInletTemp(*state, 1, 1, TankOutletTemp); - EXPECT_NEAR(-500, PlantLoop(1).LoopSide(2).LoopSideInlet_MdotCpDeltaT, .001); - EXPECT_NEAR(-588.264, PlantLoop(1).LoopSide(2).LoopSideInlet_McpDTdt, .001); - EXPECT_EQ(1, PlantLoop(1).LoopSide(2).LoopSideInlet_CapExcessStorageTime); - EXPECT_EQ(2, PlantLoop(1).LoopSide(2).LoopSideInlet_TotalTime); + EXPECT_NEAR(-500, state->dataPlnt->PlantLoop(1).LoopSide(2).LoopSideInlet_MdotCpDeltaT, .001); + EXPECT_NEAR(-588.264, state->dataPlnt->PlantLoop(1).LoopSide(2).LoopSideInlet_McpDTdt, .001); + EXPECT_EQ(1, state->dataPlnt->PlantLoop(1).LoopSide(2).LoopSideInlet_CapExcessStorageTime); + EXPECT_EQ(2, state->dataPlnt->PlantLoop(1).LoopSide(2).LoopSideInlet_TotalTime); } } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc index 16355942a6b..0012779c037 100644 --- a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc @@ -1416,9 +1416,9 @@ TEST_F(EnergyPlusFixture, HVACMultiSpeedHeatPump_HeatRecoveryTest) DataLoopNode::Node(HeatRecInNode).Temp = 50.0; DataHVACGlobals::MSHPWasteHeat = 1000.0; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; DataLoopNode::Node(HeatRecInNode).MassFlowRate = 0.0; // test heat recovery result with 0 water flow rate HVACMultiSpeedHeatPump::MSHPHeatRecovery(*state, 1); diff --git a/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc b/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc index 98bf07ca7c4..f4199573c32 100644 --- a/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc +++ b/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc @@ -104,19 +104,19 @@ class HVACSizingSimulationManagerTest : public EnergyPlusFixture // set up a plant loop TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); } - PlantLoop(1).Name = "Test Plant Loop 1"; - PlantLoop(1).MaxVolFlowRateWasAutoSized = true; - PlantLoop(1).MaxVolFlowRate = 0.002; - PlantLoop(1).MaxMassFlowRate = 2.0; - PlantLoop(1).VolumeWasAutoSized = true; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).LoopSide(SupplySide).NodeNumIn = 1; + state->dataPlnt->PlantLoop(1).Name = "Test Plant Loop 1"; + state->dataPlnt->PlantLoop(1).MaxVolFlowRateWasAutoSized = true; + state->dataPlnt->PlantLoop(1).MaxVolFlowRate = 0.002; + state->dataPlnt->PlantLoop(1).MaxMassFlowRate = 2.0; + state->dataPlnt->PlantLoop(1).VolumeWasAutoSized = true; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).LoopSide(SupplySide).NodeNumIn = 1; SetPredefinedTables(*state); @@ -200,7 +200,7 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) Node(1).MassFlowRate = state->dataGlobal->HourOfDay * 0.1; Node(1).Temp = 10.0; - PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; + state->dataPlnt->PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(*state); } state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += (*state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep) * 60.0; @@ -224,7 +224,7 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) Node(1).MassFlowRate = state->dataGlobal->HourOfDay * 0.1; Node(1).Temp = 10.0; - PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; + state->dataPlnt->PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(*state); } @@ -250,7 +250,7 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) Node(1).MassFlowRate = state->dataGlobal->HourOfDay * 0.1; Node(1).Temp = 10.0; - PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; + state->dataPlnt->PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(*state); } state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += (*state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep) * 60.0; @@ -276,7 +276,7 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) Node(1).MassFlowRate = state->dataGlobal->HourOfDay * 0.1; Node(1).Temp = 10.0; - PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; + state->dataPlnt->PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(*state); } state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += (*state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep) * 60.0; @@ -288,9 +288,9 @@ TEST_F(HVACSizingSimulationManagerTest, WeatherFileDaysTest3) testSizeSimManagerObj.PostProcessLogs(); // check plant resizing - EXPECT_DOUBLE_EQ(2.0, PlantLoop(1).MaxMassFlowRate); // original size + EXPECT_DOUBLE_EQ(2.0, state->dataPlnt->PlantLoop(1).MaxMassFlowRate); // original size testSizeSimManagerObj.ProcessCoincidentPlantSizeAdjustments(*state, 1); - EXPECT_DOUBLE_EQ(2.4, PlantLoop(1).MaxMassFlowRate); // resize check + EXPECT_DOUBLE_EQ(2.4, state->dataPlnt->PlantLoop(1).MaxMassFlowRate); // resize check // check that the data are as expected in the logs // first timestep @@ -393,7 +393,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) Node(1).MassFlowRate = state->dataGlobal->HourOfDay * 0.1; Node(1).Temp = 10.0; - PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; + state->dataPlnt->PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(*state); } state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).CurMinute += (*state->dataOutputProcessor->TimeValue.at(OutputProcessor::TimeStepType::TimeStepZone).TimeStep) * 60.0; @@ -416,7 +416,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) Node(1).MassFlowRate = state->dataGlobal->HourOfDay * 0.1; Node(1).Temp = 10.0; - PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; + state->dataPlnt->PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(*state); } @@ -428,9 +428,9 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep3) testSizeSimManagerObj.PostProcessLogs(); // check plant resizing - EXPECT_DOUBLE_EQ(2.0, PlantLoop(1).MaxMassFlowRate); // original size + EXPECT_DOUBLE_EQ(2.0, state->dataPlnt->PlantLoop(1).MaxMassFlowRate); // original size testSizeSimManagerObj.ProcessCoincidentPlantSizeAdjustments(*state, 1); - EXPECT_DOUBLE_EQ(2.4, PlantLoop(1).MaxMassFlowRate); // resize check + EXPECT_DOUBLE_EQ(2.4, state->dataPlnt->PlantLoop(1).MaxMassFlowRate); // resize check // check that the data are as expected in the logs // first timestep @@ -526,7 +526,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) Node(1).MassFlowRate = state->dataGlobal->HourOfDay * 0.1; Node(1).Temp = 10.0; - PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; + state->dataPlnt->PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(*state); } // E+ doesn't really update zone step data until system steps are done @@ -551,7 +551,7 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) Node(1).MassFlowRate = state->dataGlobal->HourOfDay * 0.1; Node(1).Temp = 10.0; - PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; + state->dataPlnt->PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(*state); } @@ -562,9 +562,9 @@ TEST_F(HVACSizingSimulationManagerTest, TopDownTestSysTimestep1) testSizeSimManagerObj.PostProcessLogs(); - EXPECT_DOUBLE_EQ(2.0, PlantLoop(1).MaxMassFlowRate); // original size + EXPECT_DOUBLE_EQ(2.0, state->dataPlnt->PlantLoop(1).MaxMassFlowRate); // original size testSizeSimManagerObj.ProcessCoincidentPlantSizeAdjustments(*state, 1); - EXPECT_DOUBLE_EQ(2.4, PlantLoop(1).MaxMassFlowRate); // resize check + EXPECT_DOUBLE_EQ(2.4, state->dataPlnt->PlantLoop(1).MaxMassFlowRate); // resize check } TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) @@ -613,7 +613,7 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) Node(1).MassFlowRate = state->dataGlobal->HourOfDay * 0.1; Node(1).Temp = 10.0; - PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; + state->dataPlnt->PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(*state); } // E+ doesn't really update zone step data until system steps are done @@ -640,7 +640,7 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) Node(1).MassFlowRate = state->dataGlobal->HourOfDay * 0.1; Node(1).Temp = 10.0; - PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; + state->dataPlnt->PlantLoop(1).HeatingDemand = state->dataGlobal->HourOfDay * 10.0; testSizeSimManagerObj.sizingLogger.UpdateSizingLogValuesSystemStep(*state); } @@ -651,9 +651,9 @@ TEST_F(HVACSizingSimulationManagerTest, VarySysTimesteps) testSizeSimManagerObj.PostProcessLogs(); - EXPECT_DOUBLE_EQ(2.0, PlantLoop(1).MaxMassFlowRate); // original size + EXPECT_DOUBLE_EQ(2.0, state->dataPlnt->PlantLoop(1).MaxMassFlowRate); // original size testSizeSimManagerObj.ProcessCoincidentPlantSizeAdjustments(*state, 1); - EXPECT_DOUBLE_EQ(2.4, PlantLoop(1).MaxMassFlowRate); // resize check + EXPECT_DOUBLE_EQ(2.4, state->dataPlnt->PlantLoop(1).MaxMassFlowRate); // resize check testSizeSimManagerObj.ProcessCoincidentPlantSizeAdjustments(*state, 1); diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 60c2e314210..0debf19ff0e 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -318,28 +318,28 @@ class AirLoopFixture : public EnergyPlusFixture // set up plant loop for water equipment DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); DataSizing::PlantSizData.allocate(DataPlant::TotNumLoops); // int NumPltSizInput = DataPlant::TotNumLoops; DataSizing::NumPltSizInput = 2; for (int loopindex = 1; loopindex <= DataPlant::TotNumLoops; ++loopindex) { - auto &loop(DataPlant::PlantLoop(loopindex)); + auto &loop(state->dataPlnt->PlantLoop(loopindex)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(loopindex).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(loopindex).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(loopindex).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(loopindex).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 2; loopsidebranch.Comp.allocate(2); } - DataPlant::PlantLoop(1).Name = "Hot Water Loop"; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "Hot Water Loop"; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(2).Name = "Chilled Water Loop"; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).Name = "Chilled Water Loop"; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; DataSizing::PlantSizData(1).PlantLoopName = "Hot Water Loop"; DataSizing::PlantSizData(1).ExitTemp = 80.0; @@ -5599,7 +5599,7 @@ TEST_F(EnergyPlusFixture, VRFTest_SysCurve_WaterCooled) DataSizing::FinalZoneSizing(CurZoneEqNum).CoolDesHumRat = 0.009297628698818194; // humrat at 12.77777 C db / 12.6 C wb SizingManager::GetPlantSizingInput(*state); - PlantManager::InitOneTimePlantSizingInfo(1); + PlantManager::InitOneTimePlantSizingInfo(*state, 1); PlantManager::SizePlantLoop(*state, 1, true); PlantManager::InitLoopEquip = true; // call air-side VRF @@ -5659,15 +5659,15 @@ TEST_F(EnergyPlusFixture, VRFTest_SysCurve_WaterCooled) EXPECT_NEAR(SysOutputProvided, ZoneSysEnergyDemand(CurZoneNum).RemainingOutputReqToCoolSP, 1.0); rho = GetDensityGlycol(*state, - PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidName, PlantSizData(1).ExitTemp, PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); + state->dataPlnt->PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidName, PlantSizData(1).ExitTemp, state->dataPlnt->PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); Cp = GetSpecificHeatGlycol(*state, - PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidName, PlantSizData(1).ExitTemp, PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); + state->dataPlnt->PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidName, PlantSizData(1).ExitTemp, state->dataPlnt->PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); CondVolFlowRate = max(state->dataHVACVarRefFlow->VRF(VRFCond).CoolingCapacity, state->dataHVACVarRefFlow->VRF(VRFCond).HeatingCapacity) / (PlantSizData(1).DeltaT * Cp * rho); EXPECT_DOUBLE_EQ(CondVolFlowRate, state->dataHVACVarRefFlow->VRF(VRFCond).WaterCondVolFlowRate); rho = GetDensityGlycol(*state, - PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidName, DataGlobalConstants::InitConvTemp, PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); + state->dataPlnt->PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidName, DataGlobalConstants::InitConvTemp, state->dataPlnt->PlantLoop(state->dataHVACVarRefFlow->VRF(VRFCond).SourceLoopNum).FluidIndex, RoutineName); EXPECT_DOUBLE_EQ(state->dataHVACVarRefFlow->VRF(VRFCond).WaterCondenserDesignMassFlow, (state->dataHVACVarRefFlow->VRF(VRFCond).WaterCondVolFlowRate * rho)); // set zone load to heating @@ -8104,24 +8104,24 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilWater) // set up plant loop TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(CoilNum).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(CoilNum).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; state->dataWaterCoils->CheckEquipName.dimension(state->dataWaterCoils->NumWaterCoils, true); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(CoilNum); @@ -8220,24 +8220,24 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilSteam) PlantSizData(NumPltSizInput).PlantLoopName = "SteamLoop"; // set up plant loop TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "SteamLoop"; - PlantLoop(1).FluidName = "STEAM"; - PlantLoop(1).FluidIndex = state->dataSteamCoils->SteamIndex; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataSteamCoils->SteamCoil(CoilNum).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilSteamAirHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataSteamCoils->SteamCoil(CoilNum).SteamInletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "SteamLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "STEAM"; + state->dataPlnt->PlantLoop(1).FluidIndex = state->dataSteamCoils->SteamIndex; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataSteamCoils->SteamCoil(CoilNum).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilSteamAirHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataSteamCoils->SteamCoil(CoilNum).SteamInletNodeNum; state->dataGlobal->SysSizingCalc = true; state->dataGlobal->BeginEnvrnFlag = true; diff --git a/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc index 820d5efce2d..eb73b86ac29 100644 --- a/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc @@ -84,7 +84,7 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_CalcHWBaseboard) HWBaseboard.allocate(1); ZoneSysEnergyDemand.allocate(1); CurDeadBandOrSetback.allocate(1); - PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); QBBRadSource.allocate(1); Node(1).MassFlowRate = 0.40; @@ -101,9 +101,9 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_CalcHWBaseboard) HWBaseboard(1).SchedPtr = -1; HWBaseboard(1).LoopNum = 1; HWBaseboard(1).UA = 370; - PlantLoop(1).FluidName = "Water"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidType = 2; + state->dataPlnt->PlantLoop(1).FluidName = "Water"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidType = 2; QBBRadSource(1) = 0.0; CalcHWBaseboard(*state, BBNum, LoadMet); @@ -117,7 +117,7 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_CalcHWBaseboard) HWBaseboard.deallocate(); ZoneSysEnergyDemand.deallocate(); CurDeadBandOrSetback.deallocate(); - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); QBBRadSource.deallocate(); } @@ -133,7 +133,7 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_HWBaseboardWaterFlowResetTest) HWBaseboard.allocate(1); ZoneSysEnergyDemand.allocate(1); CurDeadBandOrSetback.allocate(1); - PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); QBBRadSource.allocate(1); CurDeadBandOrSetback(1) = false; @@ -153,9 +153,9 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_HWBaseboardWaterFlowResetTest) HWBaseboard(1).LoopSideNum = 1; HWBaseboard(1).BranchNum = 1; HWBaseboard(1).UA = 400.0; - PlantLoop(1).FluidName = "Water"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidType = 2; + state->dataPlnt->PlantLoop(1).FluidName = "Water"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidType = 2; QBBRadSource(1) = 0.0; Node(HWBaseboard(1).WaterInletNode).MassFlowRate = 0.2; @@ -164,25 +164,25 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_HWBaseboardWaterFlowResetTest) Node(HWBaseboard(1).WaterOutletNode).MassFlowRateMax = 0.4; TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(1); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = HWBaseboard(1).EquipID; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = HWBaseboard(1).EquipType; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HWBaseboard(1).WaterInletNode; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = HWBaseboard(1).WaterOutletNode; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = HWBaseboard(1).EquipID; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = HWBaseboard(1).EquipType; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HWBaseboard(1).WaterInletNode; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = HWBaseboard(1).WaterOutletNode; // zero zone load case, so zero LoadMet must be returned CalcHWBaseboard(*state, BBNum, LoadMet); @@ -199,6 +199,6 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_HWBaseboardWaterFlowResetTest) HWBaseboard.deallocate(); ZoneSysEnergyDemand.deallocate(); CurDeadBandOrSetback.deallocate(); - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); QBBRadSource.deallocate(); } diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index 3abf6c0a866..a3fb550d5f0 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -134,27 +134,27 @@ class LowTempRadiantSystemTest : public EnergyPlusFixture CFloRadSys(RadSysNum).NumCircuits.allocate(1); // set up plant loop TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); PlantSizData.allocate(TotNumLoops); NumPltSizInput = TotNumLoops; for (int loopindex = 1; loopindex <= TotNumLoops; ++loopindex) { - auto &loop(PlantLoop(loopindex)); + auto &loop(state->dataPlnt->PlantLoop(loopindex)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(loopindex).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(loopindex).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(loopindex).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(loopindex).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "Hot Water Loop"; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "Hot Water Loop"; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; - PlantLoop(2).Name = "Chilled Water Loop"; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).Name = "Chilled Water Loop"; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; PlantSizData(1).PlantLoopName = "Hot Water Loop"; PlantSizData(1).ExitTemp = 80.0; @@ -218,12 +218,12 @@ TEST_F(LowTempRadiantSystemTest, SizeLowTempRadiantVariableFlow) HydrRadSys(RadSysNum).HotWaterInNode = 1; HydrRadSys(RadSysNum).HotWaterOutNode = 2; HydrRadSys(RadSysNum).HWLoopNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HydrRadSys(RadSysNum).HotWaterInNode; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HydrRadSys(RadSysNum).HotWaterInNode; HydrRadSys(RadSysNum).ColdWaterInNode = 3; HydrRadSys(RadSysNum).ColdWaterOutNode = 4; HydrRadSys(RadSysNum).CWLoopNum = 2; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HydrRadSys(RadSysNum).ColdWaterInNode; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HydrRadSys(RadSysNum).ColdWaterInNode; // Hydronic - HeatingDesignCapacity/CoolingDesignCapacity method HydrRadSys(RadSysNum).WaterVolFlowMaxHeat = AutoSize; @@ -307,12 +307,12 @@ TEST_F(LowTempRadiantSystemTest, SizeCapacityLowTempRadiantVariableFlow) HydrRadSys(RadSysNum).HotWaterInNode = 1; HydrRadSys(RadSysNum).HotWaterOutNode = 2; HydrRadSys(RadSysNum).HWLoopNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HydrRadSys(RadSysNum).HotWaterInNode; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HydrRadSys(RadSysNum).HotWaterInNode; HydrRadSys(RadSysNum).ColdWaterInNode = 3; HydrRadSys(RadSysNum).ColdWaterOutNode = 4; HydrRadSys(RadSysNum).CWLoopNum = 2; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HydrRadSys(RadSysNum).ColdWaterInNode; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = HydrRadSys(RadSysNum).ColdWaterInNode; // Hydronic - HeatingDesignCapacity/CoolingDesignCapacity Autosize Method HydrRadSys(RadSysNum).HeatingCapMethod = HeatingDesignCapacity; @@ -379,12 +379,12 @@ TEST_F(LowTempRadiantSystemTest, SizeLowTempRadiantConstantFlow) CFloRadSys(RadSysNum).HotWaterInNode = 1; CFloRadSys(RadSysNum).HotWaterOutNode = 2; CFloRadSys(RadSysNum).HWLoopNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = CFloRadSys(RadSysNum).HotWaterInNode; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = CFloRadSys(RadSysNum).HotWaterInNode; CFloRadSys(RadSysNum).ColdWaterInNode = 3; CFloRadSys(RadSysNum).ColdWaterOutNode = 4; CFloRadSys(RadSysNum).CWLoopNum = 2; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = CFloRadSys(RadSysNum).ColdWaterInNode; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = CFloRadSys(RadSysNum).ColdWaterInNode; // Hydronic - Hot water volume flow rate autosize CFloRadSys(RadSysNum).ColdWaterInNode = 0; @@ -1188,23 +1188,23 @@ TEST_F(LowTempRadiantSystemTest, AutosizeLowTempRadiantVariableFlowTest) FinalZoneSizing(DataSizing::CurZoneEqNum).NonAirSysDesCoolLoad = 10000.0; CoolingCapacity = FinalZoneSizing(DataSizing::CurZoneEqNum).NonAirSysDesCoolLoad * HydrRadSys(RadSysNum).ScaledCoolingCapacity; // hot water flow rate sizing calculation - Density = GetDensityGlycol(*state, PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, + Density = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, 60.0, - PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, + state->dataPlnt->PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, "AutosizeLowTempRadiantVariableFlowTest"); - Cp = GetSpecificHeatGlycol(*state, PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidName, 60.0, - PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, + state->dataPlnt->PlantLoop(HydrRadSys(RadSysNum).HWLoopNum).FluidIndex, "AutosizeLowTempRadiantVariableFlowTest"); HotWaterFlowRate = HeatingCapacity / (PlantSizData(1).DeltaT * Cp * Density); // chilled water flow rate sizing calculation - Density = GetDensityGlycol(*state, PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, + Density = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, 5.05, - PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, + state->dataPlnt->PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, "AutosizeLowTempRadiantVariableFlowTest"); - Cp = GetSpecificHeatGlycol(*state, PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidName, 5.05, - PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, + state->dataPlnt->PlantLoop(HydrRadSys(RadSysNum).CWLoopNum).FluidIndex, "AutosizeLowTempRadiantVariableFlowTest"); ChilledWaterFlowRate = CoolingCapacity / (PlantSizData(2).DeltaT * Cp * Density); // tuble length sizing calculation @@ -1755,12 +1755,12 @@ TEST_F(LowTempRadiantSystemTest, LowTempRadConFlowSystemAutoSizeTempTest) CFloRadSys(RadSysNum).HotWaterInNode = 1; CFloRadSys(RadSysNum).HotWaterOutNode = 2; CFloRadSys(RadSysNum).HWLoopNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = CFloRadSys(RadSysNum).HotWaterInNode; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = CFloRadSys(RadSysNum).HotWaterInNode; CFloRadSys(RadSysNum).ColdWaterInNode = 3; CFloRadSys(RadSysNum).ColdWaterOutNode = 4; CFloRadSys(RadSysNum).CWLoopNum = 2; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = CFloRadSys(RadSysNum).ColdWaterInNode; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = CFloRadSys(RadSysNum).ColdWaterInNode; CFloRadSys(RadSysNum).SurfacePtr.allocate(1); CFloRadSys(RadSysNum).SurfacePtr(1) = 1; @@ -1778,13 +1778,13 @@ TEST_F(LowTempRadiantSystemTest, LowTempRadConFlowSystemAutoSizeTempTest) FinalZoneSizing(CurZoneEqNum).NonAirSysDesCoolLoad = 1000.0; // hot water volume flow rate sizing calculation - Density = GetDensityGlycol(*state, PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, + Density = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, 60.0, - PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, + state->dataPlnt->PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, "LowTempRadConFlowSystemAutoSizeTempTest"); - Cp = GetSpecificHeatGlycol(*state, PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidName, 60.0, - PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, + state->dataPlnt->PlantLoop(CFloRadSys(RadSysNum).HWLoopNum).FluidIndex, "LowTempRadConFlowSystemAutoSizeTempTest"); Real64 HeatingLoad = FinalZoneSizing(1).NonAirSysDesHeatLoad; Real64 DesHotWaterVolFlowRate = HeatingLoad / (PlantSizData(1).DeltaT * Density * Cp); @@ -1801,13 +1801,13 @@ TEST_F(LowTempRadiantSystemTest, LowTempRadConFlowSystemAutoSizeTempTest) CFloRadSys(RadSysNum).WaterVolFlowMax = AutoSize; // chilled water volume flow rate sizing calculation - Density = GetDensityGlycol(*state, PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, + Density = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, 5.05, - PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, + state->dataPlnt->PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, "LowTempRadConFlowSystemAutoSizeTempTest"); - Cp = GetSpecificHeatGlycol(*state, PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidName, 5.05, - PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, + state->dataPlnt->PlantLoop(CFloRadSys(RadSysNum).CWLoopNum).FluidIndex, "LowTempRadConFlowSystemAutoSizeTempTest"); Real64 CoolingLoad = FinalZoneSizing(CurZoneEqNum).NonAirSysDesCoolLoad; Real64 DesChilledWaterVolFlowRate = CoolingLoad / (PlantSizData(2).DeltaT * Density * Cp); @@ -1838,7 +1838,7 @@ TEST_F(LowTempRadiantSystemTest, LowTempRadCalcRadSysHXEffectTermTest) NumCircs = 1; TubeLength = 10.0; TubeDiameter = 0.05; - PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; HydrRadSys(RadSysNum).TubeLength = TubeLength; HydrRadSys(RadSysNum).TubeDiameterInner = TubeDiameter; HydrRadSys(RadSysNum).FluidToSlabHeatTransfer = FluidToSlabHeatTransferTypes::ConvectionOnly; diff --git a/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc b/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc index dbd5cb719b0..2b3a4ab8ad9 100644 --- a/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc +++ b/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc @@ -276,19 +276,19 @@ TEST_F(EnergyPlusFixture, MicroCHPTest_InitGeneratorDynamics) ASSERT_TRUE(process_idf(idf_objects)); DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 2; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(2).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(2).Comp.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(2).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(2).Comp.allocate(1); - DataPlant::PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; - auto &MicroCHP1(DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1)); - auto &MicroCHP2(DataPlant::PlantLoop(1).LoopSide(1).Branch(2).Comp(1)); + auto &MicroCHP1(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1)); + auto &MicroCHP2(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(2).Comp(1)); MicroCHP1.TypeOf = "GENERATOR:MICROCHP"; MicroCHP1.TypeOf_Num = DataPlant::TypeOf_Generator_MicroCHP; MicroCHP1.Name = "MICROCOGEN1"; diff --git a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc index a9d27020550..4c0265a24f9 100644 --- a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc +++ b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc @@ -578,17 +578,17 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_WaterCoolingCoilAutoSizeTest) EXPECT_EQ(TypeOf_CoilWaterCooling, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).CoilPlantTypeOfNum); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); DataSizing::NumPltSizInput = 1; PlantSizData.allocate(DataSizing::NumPltSizInput); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -598,13 +598,13 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_WaterCoolingCoilAutoSizeTest) state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(1).Name = "ChilledWaterLoop"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_CoilWaterCooling; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; PlantSizData(1).PlantLoopName = "ChilledWaterLoop"; PlantSizData(1).ExitTemp = 6.7; @@ -672,8 +672,8 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_WaterCoolingCoilAutoSizeTest) Real64 DesWaterCoolingCoilLoad = DesAirMassFlow * (EnthalpyAirIn - EnthalpyAirOut) + FanCoolLoad; Real64 CoilDesWaterDeltaT = PlantSizData(1).DeltaT; - Real64 Cp = GetSpecificHeatGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(1).FluidIndex, " "); - Real64 rho = GetDensityGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(1).FluidIndex, " "); + Real64 Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, " "); + Real64 rho = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, " "); Real64 DesCoolingCoilWaterVolFlowRate = DesWaterCoolingCoilLoad / (CoilDesWaterDeltaT * Cp * rho); // check water coil water flow rate calc EXPECT_EQ(DesWaterCoolingCoilLoad, state->dataWaterCoils->WaterCoil(1).DesWaterCoolingCoilRate); @@ -884,17 +884,17 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_SteamHeatingCoilAutoSizeTest) EXPECT_EQ(TypeOf_CoilSteamAirHeating, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).CoilPlantTypeOfNum); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); DataSizing::NumPltSizInput = 1; PlantSizData.allocate(DataSizing::NumPltSizInput); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -904,13 +904,13 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_SteamHeatingCoilAutoSizeTest) state->dataSteamCoils->SteamCoil(1).BranchNum = 1; state->dataSteamCoils->SteamCoil(1).CompNum = 1; - PlantLoop(1).Name = "SteamLoop"; - PlantLoop(1).FluidIndex = 0; - PlantLoop(1).FluidName = "STEAM"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataSteamCoils->SteamCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_CoilSteamAirHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataSteamCoils->SteamCoil(1).SteamInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataSteamCoils->SteamCoil(1).SteamOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "SteamLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 0; + state->dataPlnt->PlantLoop(1).FluidName = "STEAM"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataSteamCoils->SteamCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_CoilSteamAirHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataSteamCoils->SteamCoil(1).SteamInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataSteamCoils->SteamCoil(1).SteamOutletNodeNum; PlantSizData(1).PlantLoopName = "SteamLoop"; PlantSizData(1).ExitTemp = 100.0; diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index f99fc577bf6..05636f8de4d 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -449,35 +449,35 @@ TEST_F(EnergyPlusFixture, PackagedTerminalHP_VSCoils_Sizing) GetPTUnit(*state); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(2).Name = "ChilledWaterLoop"; - PlantLoop(2).FluidName = "ChilledWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataVariableSpeedCoils->VarSpeedCoil(1).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilVSWAHPCoolingEquationFit; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataVariableSpeedCoils->VarSpeedCoil(1).WaterInletNodeNum; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataVariableSpeedCoils->VarSpeedCoil(1).WaterOutletNodeNum; - - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataVariableSpeedCoils->VarSpeedCoil(2).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilVSWAHPHeatingEquationFit; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataVariableSpeedCoils->VarSpeedCoil(2).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataVariableSpeedCoils->VarSpeedCoil(2).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(2).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataVariableSpeedCoils->VarSpeedCoil(1).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilVSWAHPCoolingEquationFit; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataVariableSpeedCoils->VarSpeedCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataVariableSpeedCoils->VarSpeedCoil(1).WaterOutletNodeNum; + + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataVariableSpeedCoils->VarSpeedCoil(2).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilVSWAHPHeatingEquationFit; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataVariableSpeedCoils->VarSpeedCoil(2).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataVariableSpeedCoils->VarSpeedCoil(2).WaterOutletNodeNum; DataSizing::CurZoneEqNum = 1; DataSizing::ZoneSizingRunDone = true; diff --git a/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc b/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc index c7ac8b3cfa1..4ef0353f55e 100644 --- a/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc +++ b/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc @@ -113,14 +113,14 @@ TEST_F(EnergyPlusFixture, ChillerHeater_Autosize) // De-allocate temporary arrays (happens in GetInput too...) PlantCentralGSHP::ChillerHeater.deallocate(); - DataPlant::PlantLoop.allocate(2); + state->dataPlnt->PlantLoop.allocate(2); DataSizing::PlantSizData.allocate(2); // Chilled Water Loop int PltSizNum = 1; - DataPlant::PlantLoop(PltSizNum).PlantSizNum = 1; - DataPlant::PlantLoop(PltSizNum).FluidIndex = 1; - DataPlant::PlantLoop(PltSizNum).FluidName = "WATER"; + state->dataPlnt->PlantLoop(PltSizNum).PlantSizNum = 1; + state->dataPlnt->PlantLoop(PltSizNum).FluidIndex = 1; + state->dataPlnt->PlantLoop(PltSizNum).FluidName = "WATER"; DataSizing::PlantSizData(PltSizNum).DesVolFlowRate = 1.0; DataSizing::PlantSizData(PltSizNum).DeltaT = 10.0; DataSizing::PlantSizData(PltSizNum).LoopType = DataSizing::CoolingLoop; @@ -129,9 +129,9 @@ TEST_F(EnergyPlusFixture, ChillerHeater_Autosize) // Condenser Loop int PltSizCondNum = 2; - DataPlant::PlantLoop(PltSizCondNum).PlantSizNum = PltSizCondNum; - DataPlant::PlantLoop(PltSizCondNum).FluidIndex = 1; - DataPlant::PlantLoop(PltSizCondNum).FluidName = "WATER"; + state->dataPlnt->PlantLoop(PltSizCondNum).PlantSizNum = PltSizCondNum; + state->dataPlnt->PlantLoop(PltSizCondNum).FluidIndex = 1; + state->dataPlnt->PlantLoop(PltSizCondNum).FluidName = "WATER"; // DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate = 1.5; DataSizing::PlantSizData(PltSizCondNum).DeltaT = 5.6; DataSizing::PlantSizData(PltSizCondNum).LoopType = DataSizing::CondenserLoop; @@ -139,24 +139,24 @@ TEST_F(EnergyPlusFixture, ChillerHeater_Autosize) PlantCentralGSHP::Wrapper(1).GLHELoopNum = PltSizCondNum; // Calculate expected values - Real64 rho_evap = FluidProperties::GetDensityGlycol(*state, DataPlant::PlantLoop(PltSizNum).FluidName, + Real64 rho_evap = FluidProperties::GetDensityGlycol(*state, state->dataPlnt->PlantLoop(PltSizNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(PltSizNum).FluidIndex, + state->dataPlnt->PlantLoop(PltSizNum).FluidIndex, "ChillerHeater_Autosize_TEST"); - Real64 Cp_evap = FluidProperties::GetSpecificHeatGlycol(*state, DataPlant::PlantLoop(PltSizNum).FluidName, + Real64 Cp_evap = FluidProperties::GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(PltSizNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(PltSizNum).FluidIndex, + state->dataPlnt->PlantLoop(PltSizNum).FluidIndex, "ChillerHeater_Autosize_TEST"); - Real64 rho_cond = FluidProperties::GetDensityGlycol(*state, DataPlant::PlantLoop(PltSizCondNum).FluidName, + Real64 rho_cond = FluidProperties::GetDensityGlycol(*state, state->dataPlnt->PlantLoop(PltSizCondNum).FluidName, DataGlobalConstants::CWInitConvTemp, - DataPlant::PlantLoop(PltSizCondNum).FluidIndex, + state->dataPlnt->PlantLoop(PltSizCondNum).FluidIndex, "ChillerHeater_Autosize_TEST"); - Real64 Cp_cond = FluidProperties::GetSpecificHeatGlycol(*state, DataPlant::PlantLoop(PltSizCondNum).FluidName, + Real64 Cp_cond = FluidProperties::GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(PltSizCondNum).FluidName, PlantCentralGSHP::Wrapper(1).ChillerHeater(1).TempRefCondInCooling, - DataPlant::PlantLoop(PltSizCondNum).FluidIndex, + state->dataPlnt->PlantLoop(PltSizCondNum).FluidIndex, "ChillerHeater_Autosize_TEST"); // Note: Each individual chiller heater module is sized to be capable of supporting the total load on the wrapper diff --git a/tst/EnergyPlus/unit/PlantChillers.unit.cc b/tst/EnergyPlus/unit/PlantChillers.unit.cc index c2207937100..715d17aa3d9 100644 --- a/tst/EnergyPlus/unit/PlantChillers.unit.cc +++ b/tst/EnergyPlus/unit/PlantChillers.unit.cc @@ -79,11 +79,11 @@ TEST_F(EnergyPlusFixture, GTChiller_HeatRecoveryAutosizeTest) state->dataPlantChillers->GTChiller(1).COP = 3.0; state->dataPlantChillers->GTChiller(1).engineCapacityScalar = 1.0; - DataPlant::PlantLoop.allocate(2); + state->dataPlnt->PlantLoop.allocate(2); DataSizing::PlantSizData.allocate(1); - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; DataSizing::PlantSizData(1).DesVolFlowRate = 1.0; DataSizing::PlantSizData(1).DeltaT = 5.0; DataPlant::PlantFirstSizesOkayToFinalize = true; @@ -95,7 +95,7 @@ TEST_F(EnergyPlusFixture, GTChiller_HeatRecoveryAutosizeTest) state->dataPlantChillers->GTChiller.deallocate(); DataSizing::PlantSizData.deallocate(); - DataPlant::PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); } TEST_F(EnergyPlusFixture, EngineDrivenChiller_HeatRecoveryAutosizeTest) @@ -115,11 +115,11 @@ TEST_F(EnergyPlusFixture, EngineDrivenChiller_HeatRecoveryAutosizeTest) state->dataPlantChillers->EngineDrivenChiller(1).NomCap = 10000; state->dataPlantChillers->EngineDrivenChiller(1).COP = 3.0; - DataPlant::PlantLoop.allocate(2); + state->dataPlnt->PlantLoop.allocate(2); DataSizing::PlantSizData.allocate(1); - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; DataSizing::PlantSizData(1).DesVolFlowRate = 1.0; DataSizing::PlantSizData(1).DeltaT = 5.0; DataPlant::PlantFirstSizesOkayToFinalize = true; @@ -131,7 +131,7 @@ TEST_F(EnergyPlusFixture, EngineDrivenChiller_HeatRecoveryAutosizeTest) state->dataPlantChillers->EngineDrivenChiller.deallocate(); DataSizing::PlantSizData.deallocate(); - DataPlant::PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); } TEST_F(EnergyPlusFixture, EngineDrivenChiller_Fueltype) diff --git a/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc b/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc index 33d5915463c..be275692563 100644 --- a/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc +++ b/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc @@ -74,19 +74,19 @@ TEST_F(EnergyPlusFixture, TestPlantComponentTemperatureSource) // Setup the plant itself manually DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_WaterSource; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Name = "FLUIDSOURCE"; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_WaterSource; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Name = "FLUIDSOURCE"; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 1; // define the INOUT variables that are passed back Real64 myLoad = 0.0; diff --git a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc index bc204a256f5..1ced672093c 100644 --- a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc +++ b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc @@ -81,19 +81,19 @@ class DistributePlantLoadTest : public EnergyPlusFixture // unit test for plant equipment list load distribution // set up one plantloop side with 1 branches, 12 components // using 12 components here to test going beyond the old idd limit of 10 pieces of equipment - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).OpScheme.allocate(1); - DataPlant::PlantLoop(1).OpScheme(1).EquipList.allocate(1); - auto &thisEquipList(DataPlant::PlantLoop(1).OpScheme(1).EquipList(1)); + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).OpScheme.allocate(1); + state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList.allocate(1); + auto &thisEquipList(state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1)); thisEquipList.NumComps = 12; thisEquipList.Comp.allocate(thisEquipList.NumComps); - DataPlant::PlantLoop(1).LoopSide.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(thisEquipList.NumComps); - auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(thisEquipList.NumComps); + auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - for (int compNum = 1; compNum <= DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps; ++compNum) { + for (int compNum = 1; compNum <= state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps; ++compNum) { // set up equipment list data thisEquipList.Comp(compNum).CompNumPtr = compNum; @@ -111,8 +111,8 @@ class DistributePlantLoadTest : public EnergyPlusFixture virtual void ResetLoads() { // reset loads - auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); - for (int compNum = 1; compNum <= DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps; ++compNum) { + auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); + for (int compNum = 1; compNum <= state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps; ++compNum) { thisBranch.Comp(compNum).MyLoad = 0.0; } } @@ -125,9 +125,9 @@ class DistributePlantLoadTest : public EnergyPlusFixture TEST_F(DistributePlantLoadTest, DistributePlantLoad_Sequential) { - auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); + auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - DataPlant::PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Sequential; + state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Sequential; // Loop demand 550W DistributePlantLoadTest::ResetLoads(); @@ -218,7 +218,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Sequential) //Duplicate tests from engineering reference examples for Sequential - DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 2; + state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 2; thisBranch.Comp(1).MaxLoad = 40.0; thisBranch.Comp(1).MinLoad = 0.2 * 40.0; thisBranch.Comp(1).OptLoad = 0.6 * 40.0; @@ -291,12 +291,12 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Sequential) TEST_F(DistributePlantLoadTest, DistributePlantLoad_Uniform) { - auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); + auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - DataPlant::PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Uniform; + state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Uniform; // Start with 5 components - DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; + state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; // Loop demand 550W DistributePlantLoadTest::ResetLoads(); @@ -342,7 +342,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Uniform) EXPECT_EQ(remainingLoopDemand, 0.0); //Duplicate tests from engineering reference examples - DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 2; + state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 2; thisBranch.Comp(1).MaxLoad = 40.0; thisBranch.Comp(1).MinLoad = 0.2 * 40.0; thisBranch.Comp(1).OptLoad = 0.6 * 40.0; @@ -408,12 +408,12 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Uniform) TEST_F(DistributePlantLoadTest, DistributePlantLoad_Optimal) { - auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); + auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - DataPlant::PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Optimal; + state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::Optimal; // Start with 5 components and smaller component 4 - DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; + state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; thisBranch.Comp(4).Available = true; thisBranch.Comp(4).OptLoad = 45.0; thisBranch.Comp(4).MaxLoad = 50.0; @@ -463,7 +463,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Optimal) EXPECT_EQ(remainingLoopDemand, 0.0); //Duplicate tests from engineering reference examples - DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 2; + state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 2; thisBranch.Comp(1).MaxLoad = 40.0; thisBranch.Comp(1).MinLoad = 0.2 * 40.0; thisBranch.Comp(1).OptLoad = 0.6 * 40.0; @@ -539,12 +539,12 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_Optimal) TEST_F(DistributePlantLoadTest, DistributePlantLoad_UniformPLR) { - auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); + auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - DataPlant::PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::UniformPLR; + state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::UniformPLR; // Start with 5 components and smaller component 4 - DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; + state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; thisBranch.Comp(4).Available = true; thisBranch.Comp(4).OptLoad = 45.0; thisBranch.Comp(4).MaxLoad = 50.0; @@ -596,7 +596,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_UniformPLR) EXPECT_EQ(remainingLoopDemand, 0.0); //Duplicate tests from engineering reference examples - DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 2; + state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 2; thisBranch.Comp(1).MaxLoad = 40.0; thisBranch.Comp(1).MinLoad = 0.2 * 40.0; thisBranch.Comp(1).OptLoad = 0.6 * 40.0; @@ -662,12 +662,12 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_UniformPLR) TEST_F(DistributePlantLoadTest, DistributePlantLoad_SequentialUniformPLR) { - auto &thisBranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); + auto &thisBranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); - DataPlant::PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::SequentialUniformPLR; + state->dataPlnt->PlantLoop(1).LoadDistribution = DataPlant::iLoadingScheme::SequentialUniformPLR; // Start with 5 components and smaller component 4 - DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; + state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 5; thisBranch.Comp(4).Available = true; thisBranch.Comp(4).OptLoad = 45.0; thisBranch.Comp(4).MaxLoad = 50.0; @@ -719,7 +719,7 @@ TEST_F(DistributePlantLoadTest, DistributePlantLoad_SequentialUniformPLR) EXPECT_EQ(remainingLoopDemand, 0.0); //Duplicate tests from engineering reference examples - DataPlant::PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 2; + state->dataPlnt->PlantLoop(1).OpScheme(1).EquipList(1).NumComps = 2; thisBranch.Comp(1).MaxLoad = 40.0; thisBranch.Comp(1).MinLoad = 0.2 * 40.0; thisBranch.Comp(1).OptLoad = 0.6 * 40.0; @@ -837,10 +837,10 @@ TEST_F(EnergyPlusFixture, ThermalEnergyStorageWithIceForceDualOp) { // Setup the plant itself manually DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); - DataPlant::PlantLoop(1).OpScheme.allocate(1); - DataPlant::PlantLoop(1).OpScheme(1).Name = "TEST PLANTOP SCHEME"; + state->dataPlnt->PlantLoop(1).OpScheme.allocate(1); + state->dataPlnt->PlantLoop(1).OpScheme(1).Name = "TEST PLANTOP SCHEME"; state->dataSetPointManager->NumAllSetPtMgrs = 0; state->dataSetPointManager->NumSchTESSetPtMgrs = 0; @@ -864,19 +864,19 @@ TEST_F(EnergyPlusFixture, ThermalEnergyStorageWithIceForceDualOp) { // Might as well check that the Chiller is also Ok { int CompNum = 1; - std::string compName = DataPlant::PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name; + std::string compName = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name; EXPECT_EQ(compName, "CHILLER"); - int CtrlTypeNum = DataPlant::PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum; + int CtrlTypeNum = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum; EXPECT_EQ(CtrlTypeNum, PlantCondLoopOperation::CoolingOp); } { int CompNum = 2; - std::string compName = DataPlant::PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name; + std::string compName = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name; // Ensure we have the right component (the TES tank) EXPECT_EQ(compName, "ICE THERMAL STORAGE"); - int CtrlTypeNum = DataPlant::PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum; + int CtrlTypeNum = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum; // Could just test this, but want to improve reporting // EXPECT_EQ(CtrlTypeNum, PlantCondLoopOperation::DualOp); diff --git a/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc b/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc index 2e06ef47b8f..800e9c6991c 100644 --- a/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc +++ b/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc @@ -2308,36 +2308,36 @@ TEST_F(EnergyPlusFixture, PlantHXControlWithFirstHVACIteration) // setup two plant loops, need for SetComponenetFlowRate DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - DataPlant::PlantLoop(1).Name = "HX supply side loop "; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = PlantHeatExchangerFluidToFluid::FluidHX(1).Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = PlantHeatExchangerFluidToFluid::FluidHX(1).SupplySideLoop.inletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "HX supply side loop "; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = PlantHeatExchangerFluidToFluid::FluidHX(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = PlantHeatExchangerFluidToFluid::FluidHX(1).SupplySideLoop.inletNodeNum; PlantHeatExchangerFluidToFluid::FluidHX(1).SupplySideLoop.loopNum = 1; PlantHeatExchangerFluidToFluid::FluidHX(1).SupplySideLoop.loopSideNum = 1; PlantHeatExchangerFluidToFluid::FluidHX(1).SupplySideLoop.branchNum = 1; PlantHeatExchangerFluidToFluid::FluidHX(1).SupplySideLoop.compNum = 1; - DataPlant::PlantLoop(2).Name = "HX demand side loop "; - DataPlant::PlantLoop(2).FluidIndex = 1; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = PlantHeatExchangerFluidToFluid::FluidHX(1).Name; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = PlantHeatExchangerFluidToFluid::FluidHX(1).DemandSideLoop.inletNodeNum; + state->dataPlnt->PlantLoop(2).Name = "HX demand side loop "; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = PlantHeatExchangerFluidToFluid::FluidHX(1).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = PlantHeatExchangerFluidToFluid::FluidHX(1).DemandSideLoop.inletNodeNum; PlantHeatExchangerFluidToFluid::FluidHX(1).DemandSideLoop.loopNum = 2; PlantHeatExchangerFluidToFluid::FluidHX(1).DemandSideLoop.loopSideNum = 1; PlantHeatExchangerFluidToFluid::FluidHX(1).DemandSideLoop.branchNum = 1; @@ -2410,48 +2410,48 @@ TEST_F(EnergyPlusFixture, PlantHXControl_CoolingSetpointOnOffWithComponentOverri // setup two plant loops, need for SetComponenetFlowRate DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); } // loop 1 is like a chilled water loop, supply side of HX, two branches on supply side - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 2; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(2); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(2).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(2).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(2).Comp(1).NodeNumIn = 5; + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 2; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(2).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(2).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(2).Comp(1).NodeNumIn = 5; // loop 2 is like a condenser loop, demand side of HX - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); - - DataPlant::PlantLoop(1).Name = "HX supply side loop "; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Name = PlantHeatExchangerFluidToFluid::FluidHX(1).Name; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = PlantHeatExchangerFluidToFluid::FluidHX(1).SupplySideLoop.inletNodeNum; - - DataPlant::PlantLoop(2).Name = "HX demand side loop "; - DataPlant::PlantLoop(2).FluidIndex = 1; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = PlantHeatExchangerFluidToFluid::FluidHX(1).Name; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = PlantHeatExchangerFluidToFluid::FluidHX(1).DemandSideLoop.inletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); + + state->dataPlnt->PlantLoop(1).Name = "HX supply side loop "; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Name = PlantHeatExchangerFluidToFluid::FluidHX(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = PlantHeatExchangerFluidToFluid::FluidHX(1).SupplySideLoop.inletNodeNum; + + state->dataPlnt->PlantLoop(2).Name = "HX demand side loop "; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = PlantHeatExchangerFluidToFluid::FluidHX(1).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_FluidToFluidPlantHtExchg; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = PlantHeatExchangerFluidToFluid::FluidHX(1).DemandSideLoop.inletNodeNum; PlantHeatExchangerFluidToFluid::FluidHX(1).DemandSideLoop.MassFlowRateMax = 2.0; PlantHeatExchangerFluidToFluid::FluidHX(1).ControlSignalTemp = PlantHeatExchangerFluidToFluid::DryBulbTemperature; @@ -2463,7 +2463,7 @@ TEST_F(EnergyPlusFixture, PlantHXControl_CoolingSetpointOnOffWithComponentOverri PlantHeatExchangerFluidToFluid::NumberOfPlantFluidHXs = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(2).Comp(1).HowLoadServed = DataPlant::HowMet_ByNominalCap; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(2).Comp(1).HowLoadServed = DataPlant::HowMet_ByNominalCap; state->dataEnvrn->OutDryBulbTemp = 9.0; PlantHeatExchangerFluidToFluid::FluidHX(1).TempControlTol = 0.0; DataLoopNode::Node(3).TempSetPoint = 11.0; @@ -2472,7 +2472,7 @@ TEST_F(EnergyPlusFixture, PlantHXControl_CoolingSetpointOnOffWithComponentOverri PlantHeatExchangerFluidToFluid::FluidHX(1).initialize(*state); // check value in FreeCoolCntrlMinCntrlTemp - EXPECT_NEAR(DataPlant::PlantLoop(1).LoopSide(2).Branch(2).Comp(1).FreeCoolCntrlMinCntrlTemp, 11.0, 0.001); + EXPECT_NEAR(state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(2).Comp(1).FreeCoolCntrlMinCntrlTemp, 11.0, 0.001); // change the tolerance and check the result, issue 5626 fix subtracts tolerance PlantHeatExchangerFluidToFluid::FluidHX(1).TempControlTol = 1.5; diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index a0c012d016f..34d8a85cd88 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -430,21 +430,21 @@ TEST_F(EnergyPlusFixture, Initialization) // set up the plant loops // first the load side DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(2); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; // then the source side - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSourceComp = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; // the init call expects a "from" calling point @@ -559,25 +559,25 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_WaterSou // We'll set up two plant loops: a load and a source loop DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 2; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(2); - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 2; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(2); - DataPlant::PlantLoop(2).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 2; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 2; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); Real64 const plantSizingLoadVolFlow = 0.01; Real64 const plantSizingLoadDeltaT = 1.0; @@ -588,10 +588,10 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_WaterSou DataSizing::PlantSizData(2).DesVolFlowRate = 0.030; DataSizing::PlantSizData(2).DeltaT = 1.0; - auto &loop1supplyComponent1 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - auto &loop2demandComponent1 = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - auto &loop1supplyComponent2 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(2); - auto &loop2demandComponent2 = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(2); + auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + auto &loop2demandComponent1 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + auto &loop1supplyComponent2 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(2); + auto &loop2demandComponent2 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2); loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; loop2demandComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; @@ -625,8 +625,8 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_WaterSou DataPlant::PlantFirstSizesOkayToFinalize = true; // assign the plant sizing data - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(2).PlantSizNum = 2; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(2).PlantSizNum = 2; // The load side should be what is imposed by the plant sizing data for the design flow rate. // The source side should be calculated based on the COP, which was set at 1.0 for convenience. @@ -746,27 +746,27 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyHardsizedHeatingWithCompanion) // We'll set up two plant loops: a load and a source loop DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 2; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(2); - DataPlant::PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 2; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(2); - DataPlant::PlantLoop(2).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(2).PlantSizNum = 2; + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 2; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(2); + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 2; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).PlantSizNum = 2; DataSizing::PlantSizData.allocate(2); DataSizing::PlantSizData(1).DesVolFlowRate = 0.020; @@ -774,10 +774,10 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyHardsizedHeatingWithCompanion) DataSizing::PlantSizData(2).DesVolFlowRate = 0.030; DataSizing::PlantSizData(2).DeltaT = 1.0; - auto &loop1supplyComponent1 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - auto &loop2demandComponent1 = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - auto &loop1supplyComponent2 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(2); - auto &loop2demandComponent2 = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(2); + auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + auto &loop2demandComponent1 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + auto &loop1supplyComponent2 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(2); + auto &loop2demandComponent2 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2); loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; loop2demandComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; @@ -883,30 +883,30 @@ TEST_F(EnergyPlusFixture, TestSizing_WithCompanionNoPlantSizing) // We'll set up two plant loops: a load and a source loop DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 2; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(2); - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 2; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(2); - DataPlant::PlantLoop(2).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); - - auto &loop1supplyComponent1 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - auto &loop2demandComponent1 = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); - auto &loop1supplyComponent2 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(2); - auto &loop2demandComponent2 = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(2); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 2; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 2; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); + + auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + auto &loop2demandComponent1 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + auto &loop1supplyComponent2 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(2); + auto &loop2demandComponent2 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2); loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; loop2demandComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; @@ -994,28 +994,28 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingError) // We'll set up two plant loops: a load and a source loop DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); - - auto &loop1supplyComponent1 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - auto &loop2demandComponent1 = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); + + auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + auto &loop2demandComponent1 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; loop2demandComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; @@ -1083,28 +1083,28 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingHardSized) // We'll set up two plant loops: a load and a source loop DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); - - auto &loop1supplyComponent1 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - auto &loop2demandComponent1 = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); + + auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + auto &loop2demandComponent1 = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; loop2demandComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; @@ -1165,14 +1165,14 @@ TEST_F(EnergyPlusFixture, CoolingOutletSetpointWorker) // set up the plant loops // first the load side DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - auto &PLHPPlantLoadSideLoop = DataPlant::PlantLoop(1); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(1); + auto &PLHPPlantLoadSideLoop = state->dataPlnt->PlantLoop(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; // call the factory with a valid name to trigger reading inputs @@ -1244,21 +1244,21 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) // set up the plant loops // first the load side DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(2); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; // then the source side - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSourceComp = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; // the init call expects a "from" calling point @@ -1299,7 +1299,7 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.2, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag off, load side flow locked - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.24; DataLoopNode::Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRateMinAvail = 0.0; thisCoolingPLHP->running = false; @@ -1308,8 +1308,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on load side - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; - DataPlant::PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; DataLoopNode::Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.2; thisCoolingPLHP->running = true; @@ -1318,8 +1318,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.2, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on source side - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; - DataPlant::PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.2; DataLoopNode::Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; @@ -1328,8 +1328,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on both sides - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; - DataPlant::PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; DataLoopNode::Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; @@ -1338,8 +1338,8 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at nonzero both - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; - DataPlant::PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.14; DataLoopNode::Node(thisCoolingPLHP->sourceSideNodes.inlet).MassFlowRate = 0.13; thisCoolingPLHP->running = true; @@ -1376,31 +1376,31 @@ TEST_F(EnergyPlusFixture, OnInitLoopEquipTopologyErrorCases) // set up a couple simple plant loops with one branch per loop-side and one component per branch DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantSupplySideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - auto &PLHPPlantDemandSideComp = DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1); - auto &extraPLHPPlantSupplySideComp = DataPlant::PlantLoop(2).LoopSide(2).Branch(1).Comp(1); - auto &extraPLHPPlantDemandSideComp = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantSupplySideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + auto &PLHPPlantDemandSideComp = state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1); + auto &extraPLHPPlantSupplySideComp = state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1); + auto &extraPLHPPlantDemandSideComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); PLHPPlantSupplySideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; PLHPPlantDemandSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; extraPLHPPlantSupplySideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; @@ -1494,23 +1494,23 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_WaterSource) // set up the plant loops // first the load side DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(2); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; // then the source side - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSourceComp = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; // the init call expects a "from" calling point @@ -1556,10 +1556,10 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_WaterSource) EXPECT_NEAR(thisCoolingPLHP->sourceSideInletTemp, thisCoolingPLHP->sourceSideOutletTemp, 0.001); // call from source side location, firsthvac, no load, not running, connected loop should be triggered to resimulate - DataPlant::PlantLoop(1).LoopSide(2).SimLoopSideNeeded = false; - DataPlant::PlantLoop(2).LoopSide(1).SimLoopSideNeeded = false; + state->dataPlnt->PlantLoop(1).LoopSide(2).SimLoopSideNeeded = false; + state->dataPlnt->PlantLoop(2).LoopSide(1).SimLoopSideNeeded = false; thisCoolingPLHP->simulate(*state, mySourceLocation, firstHVAC, curLoad, runFlag); - EXPECT_TRUE(DataPlant::PlantLoop(2).LoopSide(1).SimLoopSideNeeded); + EXPECT_TRUE(state->dataPlnt->PlantLoop(2).LoopSide(1).SimLoopSideNeeded); // now we can call it again from the load side, but this time there is load (still firsthvac, unit can meet load) { @@ -1628,23 +1628,23 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_WaterSource) // set up the plant loops // first the load side DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(2); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; // then the source side - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSourceComp = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; // the init call expects a "from" calling point @@ -1857,14 +1857,14 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_AirSource) // set up the plant loops // first the load side DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; @@ -1974,14 +1974,14 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_AirSource) // set up the plant loops // first the load side DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; @@ -2190,13 +2190,13 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) // set up the plant loops // first the load side DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; // the init call expects a "from" calling point @@ -2234,7 +2234,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag off, load side flow locked - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.24; thisCoolingPLHP->running = false; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2242,7 +2242,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on load side - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2250,7 +2250,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at zero on source side - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.2; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2258,7 +2258,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(1.29, thisCoolingPLHP->sourceSideMassFlowRate, 0.1); // call with run flag ON, flow locked at zero on both sides - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.0; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2266,7 +2266,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) EXPECT_NEAR(0.0, thisCoolingPLHP->sourceSideMassFlowRate, 0.001); // call with run flag ON, flow locked at nonzero both - DataPlant::PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; + state->dataPlnt->PlantLoop(1).LoopSide(2).FlowLock = DataPlant::iFlowLock::Locked; DataLoopNode::Node(thisCoolingPLHP->loadSideNodes.inlet).MassFlowRate = 0.14; thisCoolingPLHP->running = true; thisCoolingPLHP->setOperatingFlowRatesASHP(*state); @@ -2332,16 +2332,16 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_AirSourc // We'll set up two plant loops: a load and a source loop DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 2; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(2); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 2; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(2); Real64 const plantSizingLoadVolFlow = 0.01; Real64 const plantSizingLoadDeltaT = 1.0; @@ -2356,8 +2356,8 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_AirSourc DataSizing::PlantSizData(2).DesVolFlowRate = 0.03; DataSizing::PlantSizData(2).DeltaT = 1.0; - auto &loop1supplyComponent1 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - auto &loop1supplyComponent2 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(2); + auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + auto &loop1supplyComponent2 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(2); loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; loop1supplyComponent2.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; @@ -2384,7 +2384,7 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_AirSourc DataPlant::PlantFirstSizesOkayToFinalize = true; // assign the plant sizing data - DataPlant::PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; Real64 expectedLoadCp = 4197.93; Real64 expectedLoadRho = 999.898; @@ -2496,16 +2496,16 @@ TEST_F(EnergyPlusFixture, TestSizing_HardsizedFlowAutosizedCoolingWithCompanion_ // We'll set up two plant loops: a load and a source loop DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 2; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(2); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 2; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(2); Real64 const plantSizingLoadVolFlow = 0.01; Real64 const plantSizingLoadDeltaT = 1.0; @@ -2516,8 +2516,8 @@ TEST_F(EnergyPlusFixture, TestSizing_HardsizedFlowAutosizedCoolingWithCompanion_ DataSizing::PlantSizData(2).DesVolFlowRate = 0.03; DataSizing::PlantSizData(2).DeltaT = 1.0; - auto &loop1supplyComponent1 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); - auto &loop1supplyComponent2 = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(2); + auto &loop1supplyComponent1 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + auto &loop1supplyComponent2 = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(2); loop1supplyComponent1.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; loop1supplyComponent2.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; @@ -2544,7 +2544,7 @@ TEST_F(EnergyPlusFixture, TestSizing_HardsizedFlowAutosizedCoolingWithCompanion_ DataPlant::PlantFirstSizesOkayToFinalize = true; // assign the plant sizing data - DataPlant::PlantLoop(1).PlantSizNum = 1; + state->dataPlnt->PlantLoop(1).PlantSizNum = 1; Real64 expectedLoadCp = 4197.93; Real64 expectedLoadRho = 999.898; @@ -2648,23 +2648,23 @@ TEST_F(EnergyPlusFixture, Test_DoPhysics) // set up the plant loops // first the load side DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(2); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideLoop = DataPlant::PlantLoop(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideLoop = state->dataPlnt->PlantLoop(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; // then the source side - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSourceComp = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; // call the factory with a valid name to trigger reading inputs @@ -2745,23 +2745,23 @@ TEST_F(EnergyPlusFixture, CoolingMetering) // set up the plant loops // first the load side DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(2); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; // then the source side - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSourceComp = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRCooling; // the init call expects a "from" calling point @@ -2845,23 +2845,23 @@ TEST_F(EnergyPlusFixture, HeatingMetering) // set up the plant loops // first the load side DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(2); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSideComp = DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSideComp = state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1); PLHPPlantLoadSideComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; PLHPPlantLoadSideComp.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; // then the source side - DataPlant::PlantLoop(2).LoopSide.allocate(2); - DataPlant::PlantLoop(2).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - auto &PLHPPlantLoadSourceComp = DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + auto &PLHPPlantLoadSourceComp = state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1); PLHPPlantLoadSourceComp.TypeOf_Num = DataPlant::TypeOf_HeatPumpEIRHeating; // the init call expects a "from" calling point diff --git a/tst/EnergyPlus/unit/PlantManager.unit.cc b/tst/EnergyPlus/unit/PlantManager.unit.cc index e08884b13c6..1224259d97a 100644 --- a/tst/EnergyPlus/unit/PlantManager.unit.cc +++ b/tst/EnergyPlus/unit/PlantManager.unit.cc @@ -51,19 +51,15 @@ #include // ObjexxFCL Headers -#include #include -#include + // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include -#include +#include #include #include #include #include -#include -#include namespace EnergyPlus { namespace PlantManager { @@ -76,15 +72,15 @@ namespace PlantManager { TEST_F(EnergyPlusFixture, PlantManager_SizePlantLoopTest) { - PlantLoop.allocate(1); - PlantLoop(1).VolumeWasAutoSized = true; - PlantLoop(1).MaxVolFlowRate = 5; - PlantLoop(1).CirculationTime = 2; - PlantLoop(1).FluidType = NodeType_Water; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).VolumeWasAutoSized = true; + state->dataPlnt->PlantLoop(1).MaxVolFlowRate = 5; + state->dataPlnt->PlantLoop(1).CirculationTime = 2; + state->dataPlnt->PlantLoop(1).FluidType = NodeType_Water; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; SizePlantLoop(*state, 1, true); int TestVolume = 600; - EXPECT_EQ(TestVolume, PlantLoop(1).Volume); + EXPECT_EQ(TestVolume, state->dataPlnt->PlantLoop(1).Volume); } TEST_F(EnergyPlusFixture, PlantManager_TwoWayCommonPipeSetPointManagerTest) diff --git a/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc b/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc index fea70be69ea..b0acec0275c 100644 --- a/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc +++ b/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc @@ -1704,19 +1704,19 @@ TEST_F(EnergyPlusFixture, PipingSystemFullSimulation) { // Setup the plant itself manually DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_PipingSystemPipeCircuit; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Name = "MY PIPE CIRCUIT"; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_PipingSystemPipeCircuit; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).Name = "MY PIPE CIRCUIT"; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 1; // Dummy surface DataSurfaces::TotSurfaces = 1; diff --git a/tst/EnergyPlus/unit/PlantUtilities.unit.cc b/tst/EnergyPlus/unit/PlantUtilities.unit.cc index 721dda2ea18..9610e027715 100644 --- a/tst/EnergyPlus/unit/PlantUtilities.unit.cc +++ b/tst/EnergyPlus/unit/PlantUtilities.unit.cc @@ -92,11 +92,11 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) { // This test captures all code paths through the RegulateCondenserCompFlowReqOp function // We only need a single component to check here - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - auto &thisComponent = DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1); + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + auto &thisComponent = state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1); Real64 flowRequest = 3.14; Real64 returnedFlow; @@ -106,49 +106,49 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) thisComponent.CurOpSchemeType = DataPlant::HeatingRBOpSchemeType; // meaningful load thisComponent.MyLoad = 0.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = 1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = -1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.CurOpSchemeType = DataPlant::CoolingRBOpSchemeType; // meaningful load thisComponent.MyLoad = 0.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = 1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = -1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; // meaningful load thisComponent.MyLoad = 0.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = 1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = -1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.CurOpSchemeType = DataPlant::UncontrolledOpSchemeType; // NOT meaningful load thisComponent.MyLoad = 0.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = 1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = -1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); // if the component's ON flag is true, then it needs to make decisions @@ -157,49 +157,49 @@ TEST_F(EnergyPlusFixture, TestRegulateCondenserCompFlowReqOp) thisComponent.CurOpSchemeType = DataPlant::HeatingRBOpSchemeType; // meaningful load thisComponent.MyLoad = 0.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = 1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); thisComponent.MyLoad = -1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); thisComponent.CurOpSchemeType = DataPlant::CoolingRBOpSchemeType; // meaningful load thisComponent.MyLoad = 0.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = 1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); thisComponent.MyLoad = -1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); thisComponent.CurOpSchemeType = DataPlant::CompSetPtBasedSchemeType; // meaningful load thisComponent.MyLoad = 0.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(0.0, returnedFlow, 0.00001); thisComponent.MyLoad = 1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); thisComponent.MyLoad = -1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); thisComponent.CurOpSchemeType = DataPlant::UncontrolledOpSchemeType; // NOT meaningful load thisComponent.MyLoad = 0.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); thisComponent.MyLoad = 1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); thisComponent.MyLoad = -1000.0; - returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(1, 1, 1, 1, flowRequest); + returnedFlow = PlantUtilities::RegulateCondenserCompFlowReqOp(*state, 1, 1, 1, 1, flowRequest); EXPECT_NEAR(flowRequest, returnedFlow, 0.00001); } @@ -209,18 +209,18 @@ TEST_F(EnergyPlusFixture, TestAnyPlantSplitterMixerLacksContinuity) // We need to set up a two sided plant loop, we'll have one side not have a splitter for convenience DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).Splitter.Exists = false; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(2); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).NodeNumOut = 2; - DataPlant::PlantLoop(1).LoopSide(2).Branch(2).NodeNumOut = 3; - DataPlant::PlantLoop(1).LoopSide(2).Splitter.Exists = true; - DataPlant::PlantLoop(1).LoopSide(2).Splitter.NodeNumIn = 1; - DataPlant::PlantLoop(1).LoopSide(2).Splitter.TotalOutletNodes = 2; - DataPlant::PlantLoop(1).LoopSide(2).Splitter.BranchNumOut.allocate(2); - DataPlant::PlantLoop(1).LoopSide(2).Splitter.BranchNumOut(1) = 1; - DataPlant::PlantLoop(1).LoopSide(2).Splitter.BranchNumOut(2) = 2; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).Splitter.Exists = false; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).NodeNumOut = 2; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(2).NodeNumOut = 3; + state->dataPlnt->PlantLoop(1).LoopSide(2).Splitter.Exists = true; + state->dataPlnt->PlantLoop(1).LoopSide(2).Splitter.NodeNumIn = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Splitter.TotalOutletNodes = 2; + state->dataPlnt->PlantLoop(1).LoopSide(2).Splitter.BranchNumOut.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(2).Splitter.BranchNumOut(1) = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Splitter.BranchNumOut(2) = 2; DataLoopNode::Node.allocate(3); @@ -228,25 +228,25 @@ TEST_F(EnergyPlusFixture, TestAnyPlantSplitterMixerLacksContinuity) DataLoopNode::Node(1).MassFlowRate = 3.0; DataLoopNode::Node(2).MassFlowRate = 1.0; DataLoopNode::Node(3).MassFlowRate = 2.0; - EXPECT_FALSE(PlantUtilities::AnyPlantSplitterMixerLacksContinuity()); + EXPECT_FALSE(PlantUtilities::AnyPlantSplitterMixerLacksContinuity(*state)); // case 2: inlet flow > outlet flow DataLoopNode::Node(1).MassFlowRate = 4.0; DataLoopNode::Node(2).MassFlowRate = 1.0; DataLoopNode::Node(3).MassFlowRate = 2.0; - EXPECT_TRUE(PlantUtilities::AnyPlantSplitterMixerLacksContinuity()); + EXPECT_TRUE(PlantUtilities::AnyPlantSplitterMixerLacksContinuity(*state)); // case 3: inlet flow < outlet flow DataLoopNode::Node(1).MassFlowRate = 1.0; DataLoopNode::Node(2).MassFlowRate = 2.0; DataLoopNode::Node(3).MassFlowRate = 3.0; - EXPECT_TRUE(PlantUtilities::AnyPlantSplitterMixerLacksContinuity()); + EXPECT_TRUE(PlantUtilities::AnyPlantSplitterMixerLacksContinuity(*state)); // case 4: all zero flow DataLoopNode::Node(1).MassFlowRate = 0.0; DataLoopNode::Node(2).MassFlowRate = 0.0; DataLoopNode::Node(3).MassFlowRate = 0.0; - EXPECT_FALSE(PlantUtilities::AnyPlantSplitterMixerLacksContinuity()); + EXPECT_FALSE(PlantUtilities::AnyPlantSplitterMixerLacksContinuity(*state)); } TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) @@ -260,26 +260,26 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) int criteriaCheckIndex1 = 0, criteriaCheckIndex2 = 0, criteriaCheckIndex3 = 0; Real64 criteriaValue1 = 0.0, criteriaValue2 = 0.0, criteriaValue3 = 0.0; - DataPlant::PlantLoop.allocate(2); - DataPlant::PlantLoop(1).LoopSide.allocate(1); - DataPlant::PlantLoop(2).LoopSide.allocate(1); - auto &connectedLoopSide = DataPlant::PlantLoop(2).LoopSide(1); + state->dataPlnt->PlantLoop.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(1); + auto &connectedLoopSide = state->dataPlnt->PlantLoop(2).LoopSide(1); // the first time we call each criteria check, we should just get an index back and it should trigger the connected loop connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::MassFlowRate, criteriaValue1); EXPECT_EQ(1, criteriaCheckIndex1); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::Temperature, criteriaValue2); EXPECT_EQ(2, criteriaCheckIndex2); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::HeatTransferRate, criteriaValue3); EXPECT_EQ(3, criteriaCheckIndex3); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); @@ -289,54 +289,54 @@ TEST_F(EnergyPlusFixture, TestPullCompInterconnectTrigger) // call it with a nonzero value here, and it should trigger the sim flag criteriaValue1 = 2.718; connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::MassFlowRate, criteriaValue1); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); criteriaValue2 = 2.718; connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::Temperature, criteriaValue2); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); criteriaValue3 = 2.718; connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::HeatTransferRate, criteriaValue3); EXPECT_TRUE(connectedLoopSide.SimLoopSideNeeded); // call it with the same nonzero value here, and it should *not* trigger the sim flag connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::MassFlowRate, criteriaValue1); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::Temperature, criteriaValue2); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::HeatTransferRate, criteriaValue3); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); // call it with a tiny (within tolerance) change and it should still not trigger it criteriaValue1 += DataPlant::CriteriaDelta_MassFlowRate / 2.0; connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex1, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::MassFlowRate, criteriaValue1); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); criteriaValue2 += DataPlant::CriteriaDelta_Temperature / 2.0; connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex2, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::Temperature, criteriaValue2); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); criteriaValue3 += DataPlant::CriteriaDelta_HeatTransferRate / 2.0; connectedLoopSide.SimLoopSideNeeded = false; - PlantUtilities::PullCompInterconnectTrigger(thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, + PlantUtilities::PullCompInterconnectTrigger(*state, thisLoopNum, thisLoopSideNum, thisBranchNum, thisCompNum, criteriaCheckIndex3, connectedLoopNum, connectedLoopSideNum, DataPlant::iCriteriaType::HeatTransferRate, criteriaValue3); EXPECT_FALSE(connectedLoopSide.SimLoopSideNeeded); } @@ -362,97 +362,97 @@ TEST_F(EnergyPlusFixture, TestCheckPlantConvergence) // For this case, we need a single plant loop and loop side // We will leverage the LogPlantConvergencePoints function to manage the history terms // That function is nice because it is very tightly contained, so we don't have to set up a lot of global state - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(1); DataLoopNode::Node.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).NodeNumIn = 1; - DataPlant::PlantLoop(1).LoopSide(1).NodeNumOut = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).NodeNumOut = 2; auto &inNode = DataLoopNode::Node(1); auto &outNode = DataLoopNode::Node(2); Real64 const roomTemp = 25.0; Real64 const nonZeroFlow = 3.14; // History terms should be allocated to 5 zeros - EXPECT_EQ(5u, DataPlant::PlantLoop(1).LoopSide(1).InletNode.TemperatureHistory.size()); - EXPECT_EQ(5u, DataPlant::PlantLoop(1).LoopSide(1).OutletNode.TemperatureHistory.size()); - EXPECT_EQ(5u, DataPlant::PlantLoop(1).LoopSide(1).InletNode.MassFlowRateHistory.size()); - EXPECT_EQ(5u, DataPlant::PlantLoop(1).LoopSide(1).OutletNode.MassFlowRateHistory.size()); - EXPECT_NEAR(0.0, sum(DataPlant::PlantLoop(1).LoopSide(1).InletNode.TemperatureHistory), 0.001); - EXPECT_NEAR(0.0, sum(DataPlant::PlantLoop(1).LoopSide(1).OutletNode.TemperatureHistory), 0.001); - EXPECT_NEAR(0.0, sum(DataPlant::PlantLoop(1).LoopSide(1).InletNode.MassFlowRateHistory), 0.001); - EXPECT_NEAR(0.0, sum(DataPlant::PlantLoop(1).LoopSide(1).OutletNode.MassFlowRateHistory), 0.001); + EXPECT_EQ(5u, state->dataPlnt->PlantLoop(1).LoopSide(1).InletNode.TemperatureHistory.size()); + EXPECT_EQ(5u, state->dataPlnt->PlantLoop(1).LoopSide(1).OutletNode.TemperatureHistory.size()); + EXPECT_EQ(5u, state->dataPlnt->PlantLoop(1).LoopSide(1).InletNode.MassFlowRateHistory.size()); + EXPECT_EQ(5u, state->dataPlnt->PlantLoop(1).LoopSide(1).OutletNode.MassFlowRateHistory.size()); + EXPECT_NEAR(0.0, sum(state->dataPlnt->PlantLoop(1).LoopSide(1).InletNode.TemperatureHistory), 0.001); + EXPECT_NEAR(0.0, sum(state->dataPlnt->PlantLoop(1).LoopSide(1).OutletNode.TemperatureHistory), 0.001); + EXPECT_NEAR(0.0, sum(state->dataPlnt->PlantLoop(1).LoopSide(1).InletNode.MassFlowRateHistory), 0.001); + EXPECT_NEAR(0.0, sum(state->dataPlnt->PlantLoop(1).LoopSide(1).OutletNode.MassFlowRateHistory), 0.001); // If we check the plant convergence right now with first hvac true, it should require a resimulation - EXPECT_FALSE(DataPlant::PlantLoop(1).LoopSide(1).CheckPlantConvergence(true)); + EXPECT_FALSE(state->dataPlnt->PlantLoop(1).LoopSide(1).CheckPlantConvergence(true)); // But if we check it with first hvac false, everything should be stable and pass - EXPECT_TRUE(DataPlant::PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); + EXPECT_TRUE(state->dataPlnt->PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); // Now let's introduce a disturbance by changing the inlet node temperature and logging it inNode.Temp = roomTemp; - PlantUtilities::LogPlantConvergencePoints(false); + PlantUtilities::LogPlantConvergencePoints(*state, false); // We expect it to be false here since the temperature changed - EXPECT_FALSE(DataPlant::PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); + EXPECT_FALSE(state->dataPlnt->PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); // But if we run it 4 more times and let the value propagate, we expect it to be stable and pass // Need to call it 5 times total to fully initialize the history for (int i = 1; i < 5; ++i) { - PlantUtilities::LogPlantConvergencePoints(false); + PlantUtilities::LogPlantConvergencePoints(*state, false); } - EXPECT_TRUE(DataPlant::PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); + EXPECT_TRUE(state->dataPlnt->PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); // Repeat this for the outlet node temperature outNode.Temp = roomTemp; - PlantUtilities::LogPlantConvergencePoints(false); + PlantUtilities::LogPlantConvergencePoints(*state, false); // We expect it to be false here since the temperature changed - EXPECT_FALSE(DataPlant::PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); + EXPECT_FALSE(state->dataPlnt->PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); // But if we run it 4 more times and let the value propagate, we expect it to be stable and pass // Need to call it 5 times total to fully initialize the history for (int i = 1; i < 5; ++i) { - PlantUtilities::LogPlantConvergencePoints(false); + PlantUtilities::LogPlantConvergencePoints(*state, false); } - EXPECT_TRUE(DataPlant::PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); + EXPECT_TRUE(state->dataPlnt->PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); // Repeat this for the inlet node mass flow rate inNode.MassFlowRate = nonZeroFlow; - PlantUtilities::LogPlantConvergencePoints(false); + PlantUtilities::LogPlantConvergencePoints(*state, false); // We expect it to be false here since the temperature changed - EXPECT_FALSE(DataPlant::PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); + EXPECT_FALSE(state->dataPlnt->PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); // But if we run it 4 more times and let the value propagate, we expect it to be stable and pass // Need to call it 5 times total to fully initialize the history for (int i = 1; i < 5; ++i) { - PlantUtilities::LogPlantConvergencePoints(false); + PlantUtilities::LogPlantConvergencePoints(*state, false); } - EXPECT_TRUE(DataPlant::PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); + EXPECT_TRUE(state->dataPlnt->PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); // And finally the outlet node mass flow rate outNode.MassFlowRate = nonZeroFlow; - PlantUtilities::LogPlantConvergencePoints(false); + PlantUtilities::LogPlantConvergencePoints(*state, false); // We expect it to be false here since the temperature changed - EXPECT_FALSE(DataPlant::PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); + EXPECT_FALSE(state->dataPlnt->PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); // But if we run it 4 more times and let the value propagate, we expect it to be stable and pass // Need to call it 5 times total to fully initialize the history for (int i = 1; i < 5; ++i) { - PlantUtilities::LogPlantConvergencePoints(false); + PlantUtilities::LogPlantConvergencePoints(*state, false); } - EXPECT_TRUE(DataPlant::PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); + EXPECT_TRUE(state->dataPlnt->PlantLoop(1).LoopSide(1).CheckPlantConvergence(false)); } TEST_F(EnergyPlusFixture, TestScanPlantLoopsErrorFlagReturnType) { // test out some stuff on the scan plant loops function, for now just verifying errFlag is passed by reference DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); DataLoopNode::Node.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).NodeNumIn = 1; - DataPlant::PlantLoop(1).LoopSide(1).NodeNumOut = 2; - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "comp_name"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Boiler_Simple; - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 0; // just skip the supply side search + state->dataPlnt->PlantLoop(1).LoopSide(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).NodeNumOut = 2; + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "comp_name"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_Boiler_Simple; + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 0; // just skip the supply side search int loopNum = 0, loopSideNum = 0, branchNum = 0, compNum = 0; bool errorFlag = false; diff --git a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc index 8f951d73be5..1f82e817589 100644 --- a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc +++ b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc @@ -82,25 +82,25 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) int chWOutletNodeNum = 15; EnergyPlus::DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).Name = "Chilled Water Loop"; - DataPlant::PlantLoop(1).FluidName = "Water"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).MaxMassFlowRate = 0.1; - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = chWInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumOut = chWOutletNodeNum; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).Name = "Chilled Water Loop"; + state->dataPlnt->PlantLoop(1).FluidName = "Water"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).MaxMassFlowRate = 0.1; + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = chWInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumOut = chWOutletNodeNum; Real64 airVdot(0.052); // air flow rate in m3/s bool isAutoSized(false); // true if autosized @@ -118,7 +118,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) coilSelectionReportObj->setCoilWaterFlowNodeNums(*state, coil1Name, coil1Type, waterVdot, isAutoSized, chWInletNodeNum, chWOutletNodeNum, loopNum); EXPECT_EQ(-999, c1->pltSizNum); EXPECT_EQ(loopNum, c1->waterLoopNum); - EXPECT_EQ(DataPlant::PlantLoop(1).Name, c1->plantLoopName); + EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c1->plantLoopName); EXPECT_EQ(-999, c1->rhoFluid); EXPECT_EQ(-999, c1->cpFluid); EXPECT_EQ(-999, c1->coilDesWaterMassFlow); @@ -135,7 +135,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) auto &c2(coilSelectionReportObj->coilSelectionDataObjs[1]); EXPECT_EQ(-999, c2->pltSizNum); EXPECT_EQ(loopNum, c2->waterLoopNum); - EXPECT_EQ(DataPlant::PlantLoop(1).Name, c2->plantLoopName); + EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c2->plantLoopName); EXPECT_EQ(-999, c2->rhoFluid); EXPECT_EQ(-999, c2->cpFluid); EXPECT_EQ(-999, c2->coilDesWaterMassFlow); @@ -150,7 +150,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) auto &c1b(coilSelectionReportObj->coilSelectionDataObjs[0]); EXPECT_EQ(1, c1b->pltSizNum); EXPECT_EQ(loopNum, c1b->waterLoopNum); - EXPECT_EQ(DataPlant::PlantLoop(1).Name, c1b->plantLoopName); + EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c1b->plantLoopName); EXPECT_NEAR(999.9, c1b->rhoFluid, 0.1); EXPECT_NEAR(4197.9, c1b->cpFluid, 0.1); Real64 expFlow = waterVdot * c1b->rhoFluid; @@ -233,25 +233,25 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) int wOutletNodeNum = 15; EnergyPlus::DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).Name = "Steam Loop"; - DataPlant::PlantLoop(1).FluidName = "Steam"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).MaxMassFlowRate = 0.1; - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).TotalBranches = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = wInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumOut = wOutletNodeNum; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).Name = "Steam Loop"; + state->dataPlnt->PlantLoop(1).FluidName = "Steam"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).MaxMassFlowRate = 0.1; + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = wInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumOut = wOutletNodeNum; Real64 airVdot(0.052); // air flow rate in m3/s bool isAutoSized(false); // true if autosized @@ -269,7 +269,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) coilSelectionReportObj->setCoilWaterFlowNodeNums(*state, coil1Name, coil1Type, waterVdot, isAutoSized, wInletNodeNum, wOutletNodeNum, loopNum); EXPECT_EQ(-999, c1->pltSizNum); EXPECT_EQ(loopNum, c1->waterLoopNum); - EXPECT_EQ(DataPlant::PlantLoop(1).Name, c1->plantLoopName); + EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c1->plantLoopName); EXPECT_EQ(-999, c1->rhoFluid); EXPECT_EQ(-999, c1->cpFluid); EXPECT_EQ(-999, c1->coilDesWaterMassFlow); @@ -285,7 +285,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) auto &c1b(coilSelectionReportObj->coilSelectionDataObjs[0]); EXPECT_EQ(1, c1b->pltSizNum); EXPECT_EQ(loopNum, c1b->waterLoopNum); - EXPECT_EQ(DataPlant::PlantLoop(1).Name, c1b->plantLoopName); + EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c1b->plantLoopName); EXPECT_NEAR(0.6, c1b->rhoFluid, 0.01); EXPECT_NEAR(4216.0, c1b->cpFluid, 0.1); Real64 expFlow = waterVdot * c1b->rhoFluid; diff --git a/tst/EnergyPlus/unit/SZVAVModel.unit.cc b/tst/EnergyPlus/unit/SZVAVModel.unit.cc index 4a5c3987bd3..690af6d3921 100644 --- a/tst/EnergyPlus/unit/SZVAVModel.unit.cc +++ b/tst/EnergyPlus/unit/SZVAVModel.unit.cc @@ -572,7 +572,7 @@ TEST_F(EnergyPlusFixture, SZVAV_FanCoilUnit_Testing) EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; ColdWaterMassFlowRate = 1.0; @@ -612,17 +612,17 @@ TEST_F(EnergyPlusFixture, SZVAV_FanCoilUnit_Testing) DataLoopNode::Node(eHCoil.AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } // chilled water plant loop - auto &CWLoop(PlantLoop(1)); + auto &CWLoop(state->dataPlnt->PlantLoop(1)); CWLoop.Name = "ChilledWaterLoop"; CWLoop.FluidName = "ChilledWater"; CWLoop.FluidIndex = 1; diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 7c8fba86007..9cc570168e9 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -92,19 +92,19 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterChWSetPointManager) // Set up the required plant loop data DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(2).NodeNumIn = 1; // Supply inlet, return - DataPlant::PlantLoop(1).LoopSide(2).NodeNumOut = 2; // Supply outlet, supply - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumOut = 2; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(2).NodeNumIn = 1; // Supply inlet, return + state->dataPlnt->PlantLoop(1).LoopSide(2).NodeNumOut = 2; // Supply outlet, supply + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumOut = 2; // Set up the required node data DataLoopNode::Node.allocate(2); @@ -163,7 +163,7 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterChWSetPointManager) DataLoopNode::Node(1).Temp = 11; DataLoopNode::Node(2).Temp = 7; DataLoopNode::Node(2).MassFlowRate = 1.0; - DataPlant::PlantLoop(1).LoopSide(2).NodeNumOut = 5; // Supply outlet, supply + state->dataPlnt->PlantLoop(1).LoopSide(2).NodeNumOut = 5; // Supply outlet, supply mySPM.plantLoopIndex = 0; mySPM.calculate(*state, DataLoopNode::Node(1), DataLoopNode::Node(2)); // this time it shouldn't detect which plant it was found on @@ -173,8 +173,8 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterChWSetPointManager) // tear down DataLoopNode::Node.deallocate(); - DataPlant::PlantLoop(1).LoopSide.deallocate(); - DataPlant::PlantLoop.deallocate(); + state->dataPlnt->PlantLoop(1).LoopSide.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); } TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterHWSetPointManager) @@ -182,19 +182,19 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterHWSetPointManager) // Set up the required plant loop data DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(1); - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).LoopSide.allocate(2); - DataPlant::PlantLoop(1).LoopSide(2).NodeNumIn = 1; // Supply inlet, return - DataPlant::PlantLoop(1).LoopSide(2).NodeNumOut = 2; // Supply outlet, supply - DataPlant::PlantLoop(1).LoopSide(1).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch.allocate(1); - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 1; - DataPlant::PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumOut = 2; + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(2).NodeNumIn = 1; // Supply inlet, return + state->dataPlnt->PlantLoop(1).LoopSide(2).NodeNumOut = 2; // Supply outlet, supply + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 0; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 0; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp(1).NodeNumOut = 2; // Set up the required node data DataLoopNode::Node.allocate(2); @@ -248,7 +248,7 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterHWSetPointManager) // this code simply defaults to getting a fluid index of 1 (water) if it can't find a matching plant DataLoopNode::Node(1).Temp = 56; DataLoopNode::Node(2).MassFlowRate = 1.0; - DataPlant::PlantLoop(1).LoopSide(2).NodeNumOut = 5; // Supply outlet, supply + state->dataPlnt->PlantLoop(1).LoopSide(2).NodeNumOut = 5; // Supply outlet, supply mySPM.plantLoopIndex = 0; mySPM.calculate(*state, DataLoopNode::Node(1), DataLoopNode::Node(2)); // this time it shouldn't detect which plant it was found on @@ -258,8 +258,8 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterHWSetPointManager) // tear down DataLoopNode::Node.deallocate(); - DataPlant::PlantLoop(1).LoopSide.deallocate(); - DataPlant::PlantLoop.deallocate(); + state->dataPlnt->PlantLoop(1).LoopSide.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); } TEST_F(EnergyPlusFixture, SetPointManager_DefineCondEntSetPointManager) @@ -357,23 +357,23 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineCondEntSetPointManager) // Set up ChW loop manually, way too much input to do that here in idf, all I care about is the DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(2); + state->dataPlnt->PlantLoop.allocate(2); - DataPlant::PlantLoop(chwLoopIndex).LoopSide.allocate(2); - DataPlant::PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch.allocate(1); - DataPlant::PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp.allocate(1); - DataPlant::PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp(chillerCompIndex).NodeNumOut = evapOutletNodeNum; + state->dataPlnt->PlantLoop(chwLoopIndex).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch.allocate(1); + state->dataPlnt->PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp.allocate(1); + state->dataPlnt->PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp(chillerCompIndex).NodeNumOut = evapOutletNodeNum; Real64 const designCondenserEnteringTemp = 20; - DataPlant::PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp(chillerCompIndex).TempDesCondIn = + state->dataPlnt->PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp(chillerCompIndex).TempDesCondIn = designCondenserEnteringTemp; - DataPlant::PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp(chillerCompIndex).TempDesEvapOut = 5; - DataPlant::PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp(chillerCompIndex).MaxLoad = 5000; + state->dataPlnt->PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp(chillerCompIndex).TempDesEvapOut = 5; + state->dataPlnt->PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp(chillerCompIndex).MaxLoad = 5000; - DataPlant::PlantLoop(condLoopIndex).LoopSide.allocate(2); - DataPlant::PlantLoop(condLoopIndex).LoopSide(demandSide).Branch.allocate(1); - DataPlant::PlantLoop(condLoopIndex).LoopSide(demandSide).Branch(chillerBranchCW).Comp.allocate(1); - DataPlant::PlantLoop(condLoopIndex).LoopSide(demandSide).Branch(chillerBranchCW).Comp(chillerCompIndex).NodeNumIn = condInletNodeNum; - DataPlant::PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp(chillerCompIndex).MyLoad = 1000; + state->dataPlnt->PlantLoop(condLoopIndex).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(condLoopIndex).LoopSide(demandSide).Branch.allocate(1); + state->dataPlnt->PlantLoop(condLoopIndex).LoopSide(demandSide).Branch(chillerBranchCW).Comp.allocate(1); + state->dataPlnt->PlantLoop(condLoopIndex).LoopSide(demandSide).Branch(chillerBranchCW).Comp(chillerCompIndex).NodeNumIn = condInletNodeNum; + state->dataPlnt->PlantLoop(chwLoopIndex).LoopSide(supplySide).Branch(chillerBranchChW).Comp(chillerCompIndex).MyLoad = 1000; DataLoopNode::Node.allocate(2); DataLoopNode::Node(evapOutletNodeNum).Temp = 7; @@ -393,14 +393,14 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineCondEntSetPointManager) thisSPM.TypeNum = DataPlant::TypeOf_Chiller_Electric; // switch: Weighted ratio > 9 && etc... - DataPlant::PlantLoop(1).CoolingDemand = 4700; + state->dataPlnt->PlantLoop(1).CoolingDemand = 4700; // Now call and check thisSPM.calculate(*state); EXPECT_NEAR(designCondenserEnteringTemp + 1.0, thisSPM.SetPt, 0.001); // switch: Weighted ratio < 9 || etc... - DataPlant::PlantLoop(1).CoolingDemand = 4000; + state->dataPlnt->PlantLoop(1).CoolingDemand = 4000; // switch: OAWB>MinWb && DesignWB>MinDesignWB && CurLift>MinLift state->dataEnvrn->OutWetBulbTemp = 40; diff --git a/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc b/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc index 5c5b007ae3d..573634144fb 100644 --- a/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc +++ b/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc @@ -230,18 +230,18 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils1) TermUnitSizing.allocate(1); ZoneEqSizing.allocate(1); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); PlantSizData.allocate(1); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); NumPltSizInput = 1; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -264,14 +264,14 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils1) state->dataWaterCoils->WaterCoil(1).WaterLoopSide = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; state->dataSingleDuct->sd_airterminal(1).HWLoopSide = 1; state->dataSingleDuct->sd_airterminal(1).HWBranchIndex = 1; @@ -330,7 +330,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils1) TermUnitSizing.deallocate(); state->dataSingleDuct->sd_airterminal.deallocate(); ZoneEqSizing.deallocate(); - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); PlantSizData.deallocate(); state->dataWaterCoils->MySizeFlag.deallocate(); state->dataWaterCoils->MyUAAndFlowCalcFlag.deallocate(); @@ -468,18 +468,18 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils2) TermUnitSizing.allocate(1); ZoneEqSizing.allocate(1); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); PlantSizData.allocate(1); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); NumPltSizInput = 1; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -502,14 +502,14 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils2) state->dataWaterCoils->WaterCoil(1).WaterLoopSide = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; state->dataSingleDuct->sd_airterminal(1).HWLoopSide = 1; state->dataSingleDuct->sd_airterminal(1).HWBranchIndex = 1; @@ -568,7 +568,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils2) TermUnitSizing.deallocate(); state->dataSingleDuct->sd_airterminal.deallocate(); ZoneEqSizing.deallocate(); - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); PlantSizData.deallocate(); state->dataWaterCoils->MySizeFlag.deallocate(); state->dataWaterCoils->MyUAAndFlowCalcFlag.deallocate(); @@ -705,18 +705,18 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils3) TermUnitSizing.allocate(1); ZoneEqSizing.allocate(1); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); PlantSizData.allocate(1); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); NumPltSizInput = 1; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -739,14 +739,14 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils3) state->dataWaterCoils->WaterCoil(1).WaterLoopSide = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; state->dataSingleDuct->sd_airterminal(1).HWLoopSide = 1; state->dataSingleDuct->sd_airterminal(1).HWBranchIndex = 1; @@ -804,7 +804,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils3) TermUnitSizing.deallocate(); state->dataSingleDuct->sd_airterminal.deallocate(); ZoneEqSizing.deallocate(); - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); PlantSizData.deallocate(); state->dataWaterCoils->MySizeFlag.deallocate(); state->dataWaterCoils->MyUAAndFlowCalcFlag.deallocate(); @@ -942,18 +942,18 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils4) TermUnitSizing.allocate(1); ZoneEqSizing.allocate(1); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); PlantSizData.allocate(1); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); NumPltSizInput = 1; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -976,14 +976,14 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils4) state->dataWaterCoils->WaterCoil(1).WaterLoopSide = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; state->dataSingleDuct->sd_airterminal(1).HWLoopSide = 1; state->dataSingleDuct->sd_airterminal(1).HWBranchIndex = 1; @@ -1041,7 +1041,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils4) TermUnitSizing.deallocate(); state->dataSingleDuct->sd_airterminal.deallocate(); ZoneEqSizing.deallocate(); - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); PlantSizData.deallocate(); state->dataWaterCoils->MySizeFlag.deallocate(); state->dataWaterCoils->MyUAAndFlowCalcFlag.deallocate(); @@ -1143,18 +1143,18 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils5) state->dataAirSystemsData->PrimaryAirSystems.allocate(1); state->dataAirLoop->AirLoopControlInfo.allocate(1); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); PlantSizData.allocate(1); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); NumPltSizInput = 1; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -1171,14 +1171,14 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils5) state->dataWaterCoils->WaterCoil(1).WaterLoopSide = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; PlantSizData(1).DeltaT = 11.0; PlantSizData(1).ExitTemp = 82; PlantSizData(1).PlantLoopName = "HotWaterLoop"; @@ -1206,7 +1206,7 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils5) Node.deallocate(); Zone.deallocate(); - PlantLoop.deallocate(); + state->dataPlnt->PlantLoop.deallocate(); PlantSizData.deallocate(); state->dataWaterCoils->MySizeFlag.deallocate(); state->dataWaterCoils->MyUAAndFlowCalcFlag.deallocate(); @@ -1355,16 +1355,16 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils6) TermUnitSizing.allocate(1); TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -1387,14 +1387,14 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils6) state->dataWaterCoils->WaterCoil(1).WaterLoopSide = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; state->dataSingleDuct->sd_airterminal(1).HWLoopNum = 1; state->dataSingleDuct->sd_airterminal(1).HWLoopSide = 1; state->dataSingleDuct->sd_airterminal(1).HWBranchIndex = 1; diff --git a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc index 37a3f959e85..b041cc58e38 100644 --- a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc +++ b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc @@ -120,16 +120,16 @@ class SizingAnalysisObjectsTest : public EnergyPlusFixture PlantSizData(1).DeltaT = 10; TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); } - PlantLoop(1).Name = "Test Plant Loop 1"; - PlantLoop(1).MaxVolFlowRateWasAutoSized = true; - PlantLoop(1).MaxVolFlowRate = 0.002; - PlantLoop(1).MaxMassFlowRate = 2.0; - PlantLoop(1).VolumeWasAutoSized = true; + state->dataPlnt->PlantLoop(1).Name = "Test Plant Loop 1"; + state->dataPlnt->PlantLoop(1).MaxVolFlowRateWasAutoSized = true; + state->dataPlnt->PlantLoop(1).MaxVolFlowRate = 0.002; + state->dataPlnt->PlantLoop(1).MaxMassFlowRate = 2.0; + state->dataPlnt->PlantLoop(1).VolumeWasAutoSized = true; SetPredefinedTables(*state); @@ -360,12 +360,12 @@ TEST_F(SizingAnalysisObjectsTest, PlantCoincidentAnalyObjTest) TestAnalysisObj.peakDemandMassFlow = 1.5; TestAnalysisObj.peakDemandReturnTemp = 10.0; - EXPECT_DOUBLE_EQ(0.002, PlantLoop(1).MaxVolFlowRate); // m3/s + EXPECT_DOUBLE_EQ(0.002, state->dataPlnt->PlantLoop(1).MaxVolFlowRate); // m3/s TestAnalysisObj.ResolveDesignFlowRate(*state, 1); - EXPECT_DOUBLE_EQ(0.0015, PlantLoop(1).MaxVolFlowRate); // m3/s - EXPECT_DOUBLE_EQ(1.5, PlantLoop(1).MaxMassFlowRate); // m3/s + EXPECT_DOUBLE_EQ(0.0015, state->dataPlnt->PlantLoop(1).MaxVolFlowRate); // m3/s + EXPECT_DOUBLE_EQ(1.5, state->dataPlnt->PlantLoop(1).MaxMassFlowRate); // m3/s EXPECT_TRUE(TestAnalysisObj.anotherIterationDesired); } @@ -516,11 +516,11 @@ TEST_F(SizingAnalysisObjectsTest, PlantCoincidentAnalyObjTestNullMassFlowRateTim TestAnalysisObj.peakDemandMassFlow = 1.5; TestAnalysisObj.peakDemandReturnTemp = 10.0; - EXPECT_DOUBLE_EQ(0.002, PlantLoop(1).MaxVolFlowRate); // m3/s + EXPECT_DOUBLE_EQ(0.002, state->dataPlnt->PlantLoop(1).MaxVolFlowRate); // m3/s TestAnalysisObj.ResolveDesignFlowRate(*state, 1); - EXPECT_NEAR(0.00015, PlantLoop(1).MaxVolFlowRate, 0.00001); // m3/s - EXPECT_NEAR(0.15, PlantLoop(1).MaxMassFlowRate, 0.001); // m3/s + EXPECT_NEAR(0.00015, state->dataPlnt->PlantLoop(1).MaxVolFlowRate, 0.00001); // m3/s + EXPECT_NEAR(0.15, state->dataPlnt->PlantLoop(1).MaxMassFlowRate, 0.001); // m3/s EXPECT_TRUE(TestAnalysisObj.anotherIterationDesired); } diff --git a/tst/EnergyPlus/unit/SwimmingPool.unit.cc b/tst/EnergyPlus/unit/SwimmingPool.unit.cc index e0ea40ee2db..8bb9297ff31 100644 --- a/tst/EnergyPlus/unit/SwimmingPool.unit.cc +++ b/tst/EnergyPlus/unit/SwimmingPool.unit.cc @@ -142,32 +142,32 @@ TEST_F(EnergyPlusFixture, SwimmingPool_InitSwimmingPoolPlantLoopIndex) state->dataSwimmingPools->Pool(2).Name = "SecondPool"; state->dataSwimmingPools->Pool(1).WaterInletNode = 1; state->dataSwimmingPools->Pool(2).WaterInletNode = 11; - PlantLoop.allocate(TotNumLoops); - PlantLoop(1).LoopSide.allocate(2); - PlantLoop(2).LoopSide.allocate(2); - PlantLoop(1).LoopSide(1).Branch.allocate(1); - PlantLoop(1).LoopSide(2).Branch.allocate(1); - PlantLoop(2).LoopSide(1).Branch.allocate(1); - PlantLoop(2).LoopSide(2).Branch.allocate(1); - PlantLoop(1).LoopSide(1).TotalBranches = 1; - PlantLoop(1).LoopSide(2).TotalBranches = 1; - PlantLoop(2).LoopSide(1).TotalBranches = 1; - PlantLoop(2).LoopSide(2).TotalBranches = 1; - PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; - PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); - PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); - PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_SwimmingPool_Indoor; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "FirstPool"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; - PlantLoop(2).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = TypeOf_SwimmingPool_Indoor; - PlantLoop(2).LoopSide(2).Branch(1).Comp(1).Name = "SecondPool"; - PlantLoop(2).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 11; + state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_SwimmingPool_Indoor; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "FirstPool"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1).TypeOf_Num = TypeOf_SwimmingPool_Indoor; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1).Name = "SecondPool"; + state->dataPlnt->PlantLoop(2).LoopSide(2).Branch(1).Comp(1).NodeNumIn = 11; // Test 1 @@ -211,19 +211,19 @@ TEST_F(EnergyPlusFixture, SwimmingPool_InitSwimmingPoolPlantNodeFlow) state->dataSwimmingPools->Pool(1).HWBranchNum = 1; state->dataSwimmingPools->Pool(1).HWCompNum = 1; - PlantLoop.allocate(TotNumLoops); - PlantLoop(1).LoopSide.allocate(2); - PlantLoop(1).LoopSide(1).Branch.allocate(1); - PlantLoop(1).LoopSide(2).Branch.allocate(1); - PlantLoop(1).LoopSide(1).TotalBranches = 1; - PlantLoop(1).LoopSide(2).TotalBranches = 1; - PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; - PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); - PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_SwimmingPool_Indoor; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "FirstPool"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; + state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).TotalComponents = 1; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = TypeOf_SwimmingPool_Indoor; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "FirstPool"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 1; DataLoopNode::Node.allocate(2); diff --git a/tst/EnergyPlus/unit/UnitHeater.unit.cc b/tst/EnergyPlus/unit/UnitHeater.unit.cc index 7908936a494..920d542914b 100644 --- a/tst/EnergyPlus/unit/UnitHeater.unit.cc +++ b/tst/EnergyPlus/unit/UnitHeater.unit.cc @@ -1140,13 +1140,13 @@ TEST_F(EnergyPlusFixture, UnitHeater_HWHeatingCoilUAAutoSizingTest) EXPECT_FALSE(ErrorsFound); HWMaxVolFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate; - HWDensity = GetDensityGlycol(*state, PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, + HWDensity = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, + state->dataPlnt->PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, "xxx"); - CpHW = GetSpecificHeatGlycol(*state, PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, + CpHW = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, - PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, + state->dataPlnt->PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, "xxx"); HWPlantDeltaTDesign = PlantSizData(PltSizHeatNum).DeltaT; // calculate hot water coil design capacity @@ -1306,27 +1306,27 @@ TEST_F(EnergyPlusFixture, UnitHeater_SimUnitHeaterTest) DataSizing::CurZoneEqNum = 1; TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; ZoneSysEnergyDemand.allocate(1); ZoneSysEnergyDemand(1).RemainingOutputReqToHeatSP = 2000.0; @@ -1371,7 +1371,7 @@ TEST_F(EnergyPlusFixture, UnitHeater_SimUnitHeaterTest) // verify the heat rate delivered by the hot water heating coil HWMassFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).InletWaterMassFlowRate; CpHW = GetSpecificHeatGlycol(*state, - PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, 60.0, PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, "UnitTest"); + state->dataPlnt->PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidName, 60.0, state->dataPlnt->PlantLoop(state->dataUnitHeaters->UnitHeat(UnitHeatNum).HWLoopNum).FluidIndex, "UnitTest"); HWCoilHeatingRate = HWMassFlowRate * CpHW * (Node(WCWaterInletNode).Temp - Node(WCWaterOutletNode).Temp); EXPECT_NEAR(HWCoilHeatingRate, state->dataWaterCoils->WaterCoil(CoilNum).TotWaterHeatingCoilRate, ConvTol); } diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 0ce126f7600..c57d65495fb 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -195,28 +195,28 @@ class ZoneUnitarySysTest : public EnergyPlusFixture // set up plant loop DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); DataSizing::PlantSizData.allocate(DataPlant::TotNumLoops); // int NumPltSizInput = DataPlant::TotNumLoops; DataSizing::NumPltSizInput = 2; for (int loopindex = 1; loopindex <= DataPlant::TotNumLoops; ++loopindex) { - auto &loop(DataPlant::PlantLoop(loopindex)); + auto &loop(state->dataPlnt->PlantLoop(loopindex)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(loopindex).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(loopindex).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(loopindex).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(loopindex).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 2; loopsidebranch.Comp.allocate(2); } - DataPlant::PlantLoop(1).Name = "Hot Water Loop"; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "Hot Water Loop"; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(2).Name = "Chilled Water Loop"; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).Name = "Chilled Water Loop"; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; DataSizing::PlantSizData(1).PlantLoopName = "Hot Water Loop"; DataSizing::PlantSizData(1).ExitTemp = 80.0; @@ -259,7 +259,7 @@ class AirloopUnitarySysTest : public EnergyPlusFixture state->dataWaterCoils->WaterCoilNumericFields(i).FieldNames.allocate(17); // max N fields for water coil } DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); DataSizing::PlantSizData.allocate(2); DataSizing::ZoneEqSizing.allocate(2); DataSizing::UnitarySysEqSizing.allocate(2); @@ -289,7 +289,7 @@ class AirloopUnitarySysTest : public EnergyPlusFixture // state->dataWaterCoils->NumWaterCoils = 0; // state->dataWaterCoils->WaterCoil.clear(); // state->dataWaterCoils->WaterCoilNumericFields.clear(); - DataPlant::PlantLoop.clear(); + state->dataPlnt->PlantLoop.clear(); DataSizing::PlantSizData.clear(); DataSizing::ZoneEqSizing.clear(); DataSizing::UnitarySysEqSizing.clear(); @@ -327,26 +327,26 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) // set up plant loop for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - DataPlant::PlantLoop(1).Name = "ColdWaterLoop"; - DataPlant::PlantLoop(1).FluidName = "FluidWaterLoop"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).FluidIndex = 1; - - DataPlant::PlantLoop(2).Name = "HotWaterLoop"; - DataPlant::PlantLoop(2).FluidName = "FluidWaterLoop"; - DataPlant::PlantLoop(2).FluidIndex = 1; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "ColdWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + + state->dataPlnt->PlantLoop(2).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; // set up sizing data DataSizing::FinalSysSizing(1).MixTempAtCoolPeak = 20.0; @@ -382,7 +382,7 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) state->dataWaterCoils->WaterCoil(CoilNum).WaterOutletNodeNum = 2; state->dataWaterCoils->WaterCoil(CoilNum).AirInletNodeNum = 3; state->dataWaterCoils->WaterCoil(CoilNum).AirOutletNodeNum = 4; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; DataSizing::CurZoneEqNum = 0; DataSizing::CurSysNum = 1; @@ -393,8 +393,8 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) DataSizing::PlantSizData(1).ExitTemp = 5.7; DataSizing::PlantSizData(1).DeltaT = 5.0; DataSizing::FinalSysSizing(1).MassFlowAtCoolPeak = DataSizing::FinalSysSizing(1).DesMainVolFlow * state->dataEnvrn->StdRhoAir; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType_Num; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(CoilNum).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType_Num; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(CoilNum).Name; DataSizing::DataWaterLoopNum = 1; FluidProperties::NumOfGlycols = 1; @@ -441,9 +441,9 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = DataSizing::AutoSize; state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = DataSizing::AutoSize; state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = DataSizing::AutoSize; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType_Num; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(CoilNum).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType_Num; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(CoilNum).Name; DataSizing::DataWaterLoopNum = 2; DataSizing::PlantSizData(2).DeltaT = 5.0; @@ -3065,20 +3065,20 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_WaterCoilSPControl) EXPECT_EQ(thisSys->m_MaxHeatAirVolFlow, 1.6); EXPECT_EQ(thisSys->m_MaxNoCoolHeatAirVolFlow, 0.8); - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATER COOLING COIL"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 10; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 11; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATER COOLING COIL"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 10; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 11; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "WATER HEATING COIL"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 4; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 5; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "WATER HEATING COIL"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 4; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 5; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(2).Name = "SUPP WATER HEATING COIL"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(2).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(2).NodeNumIn = 8; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(2).NodeNumOut = 9; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2).Name = "SUPP WATER HEATING COIL"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2).NodeNumIn = 8; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(2).NodeNumOut = 9; OutputReportPredefined::SetPredefinedTables(*state); @@ -3430,10 +3430,10 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_WaterCoilSPControl_Latent) auto coolingCoilWaterInletNodeIndex = UtilityRoutines::FindItemInList("CHWINLETNODE", DataLoopNode::NodeID); // was Node 10 auto coolingCoilWaterOutletNodeIndex = UtilityRoutines::FindItemInList("CHWOUTLETNODE", DataLoopNode::NodeID); // was Node 10 - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATER COOLING COIL"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = coolingCoilWaterInletNodeIndex; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = coolingCoilWaterOutletNodeIndex; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATER COOLING COIL"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = coolingCoilWaterInletNodeIndex; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = coolingCoilWaterOutletNodeIndex; OutputReportPredefined::SetPredefinedTables(*state); @@ -4137,7 +4137,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryHeatingSystem) state->dataUnitarySystems->numUnitarySystems = 1; DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); thisSys.m_MultiOrVarSpeedHeatCoil = true; thisSys.m_MultiOrVarSpeedCoolCoil = true; DataLoopNode::Node.allocate(10); @@ -4231,22 +4231,22 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryHeatingSystem) DataLoopNode::Node(state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum).MassFlowRateMaxAvail = HotWaterMassFlowRate; for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - DataPlant::PlantLoop(1).Name = "WaterLoop"; - DataPlant::PlantLoop(1).FluidName = "FluidWaterLoop"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "WaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; thisSys.m_HeatingCoilIndex = 1; thisSys.m_HeatingCoilName = state->dataWaterCoils->WaterCoil(1).Name; @@ -4276,7 +4276,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryCoolingSystem) state->dataUnitarySystems->numUnitarySystems = 1; DataPlant::TotNumLoops = 1; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = 1.20; @@ -4383,22 +4383,22 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryCoolingSystem) DataLoopNode::Node(state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum).MassFlowRateMaxAvail = ColdWaterMassFlowRate; for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - DataPlant::PlantLoop(1).Name = "WaterLoop"; - DataPlant::PlantLoop(1).FluidName = "FluidWaterLoop"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "WaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; thisSys.m_CoolingCoilIndex = 1; thisSys.m_CoolingCoilName = state->dataWaterCoils->WaterCoil(1).Name; @@ -7796,32 +7796,32 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_WaterToAirHeatPump) DataZoneEquipment::ZoneEquipList(1).EquipIndex(1) = 1; // initialize equipment index for ZoneHVAC DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - DataPlant::PlantLoop(1).Name = "ChilledWaterLoop"; - DataPlant::PlantLoop(1).FluidName = "FluidWaterLoop"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "SYS 1 HEAT PUMP COOLING MODE"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPCoolingEquationFit; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 6; - - DataPlant::PlantLoop(2).Name = "HotWaterLoop"; - DataPlant::PlantLoop(2).FluidName = "FluidWaterLoop"; - DataPlant::PlantLoop(2).FluidIndex = 1; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "SYS 1 HEAT PUMP HEATING MODE"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPHeatingEquationFit; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 9; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "SYS 1 HEAT PUMP COOLING MODE"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPCoolingEquationFit; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 6; + + state->dataPlnt->PlantLoop(2).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "SYS 1 HEAT PUMP HEATING MODE"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWAHPHeatingEquationFit; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 9; std::string compName = "UNITARY SYSTEM MODEL"; int compTypeOfNum = DataHVACGlobals::UnitarySys_AnyCoilType; @@ -8130,34 +8130,34 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) DataZoneEquipment::ZoneEquipList(1).EquipIndex(1) = 1; // initialize equipment index for ZoneHVAC DataPlant::TotNumLoops = 2; - DataPlant::PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { - auto &loop(DataPlant::PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(DataPlant::PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(DataPlant::PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - DataPlant::PlantLoop(1).Name = "ChilledWaterLoop"; - DataPlant::PlantLoop(1).FluidName = "FluidWaterLoop"; - DataPlant::PlantLoop(1).FluidIndex = 1; - DataPlant::PlantLoop(1).FluidName = "WATER"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATER COOLING COIL"; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 9; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 10; - - DataPlant::PlantLoop(2).Name = "HotWaterLoop"; - DataPlant::PlantLoop(2).FluidName = "FluidWaterLoop"; - DataPlant::PlantLoop(2).FluidIndex = 1; - DataPlant::PlantLoop(2).FluidName = "WATER"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "WATER HEATING COIL"; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 6; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 7; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = "WATER COOLING COIL"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 9; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 10; + + state->dataPlnt->PlantLoop(2).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = "WATER HEATING COIL"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 6; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = 7; std::string compName = "UNITARY SYSTEM MODEL"; int compTypeOfNum = DataHVACGlobals::UnitarySys_AnyCoilType; @@ -11901,15 +11901,15 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_FractionOfAutoSizedCoolingValueTes DataSizing::ZoneSizingRunDone = true; // DataSizing::NumPltSizInput = 2; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; // check user specified values before overriding during sizing Real64 userspecifiedFractionOfAutoSizedCoolingFlowRateValue = thisSys->m_MaxNoCoolHeatAirVolFlow; @@ -12042,15 +12042,15 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_FlowPerCoolingCapacityTest) OutputReportPredefined::SetPredefinedTables(*state); DataSizing::ZoneSizingRunDone = true; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - DataPlant::PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterSimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; - DataPlant::PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = DataPlant::TypeOf_CoilWaterCooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; // check user specified values before overriding during sizing Real64 userspecifiedFlowPerCoolingCapacityValue = thisSys->m_MaxNoCoolHeatAirVolFlow; diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 43e80fdec87..4016f7d6f1c 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -140,7 +140,7 @@ class WaterCoilsTest : public EnergyPlusFixture state->dataWaterCoils->WaterCoilNumericFields.allocate(state->dataWaterCoils->NumWaterCoils); state->dataWaterCoils->WaterCoilNumericFields(state->dataWaterCoils->NumWaterCoils).FieldNames.allocate(17); // max N fields for water coil TotNumLoops = 1; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); PlantSizData.allocate(1); ZoneEqSizing.allocate(1); UnitarySysEqSizing.allocate(1); @@ -168,7 +168,7 @@ class WaterCoilsTest : public EnergyPlusFixture // state->dataWaterCoils->NumWaterCoils = 0; // state->dataWaterCoils->WaterCoil.clear(); // state->dataWaterCoils->WaterCoilNumericFields.clear(); - PlantLoop.clear(); + state->dataPlnt->PlantLoop.clear(); PlantSizData.clear(); ZoneEqSizing.clear(); UnitarySysEqSizing.clear(); @@ -198,20 +198,20 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) // set up plant loop for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "WaterLoop"; - PlantLoop(1).FluidName = "FluidWaterLoop"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "WaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; // set up sizing data FinalSysSizing(1).MixTempAtCoolPeak = 20.0; @@ -238,7 +238,7 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(3) = "Maximum Flow Rate"; state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; CurZoneEqNum = 0; CurSysNum = 1; @@ -434,20 +434,20 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) // set up plant loop for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "FluidWaterLoop"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; // set up sizing data FinalSysSizing(1).DesMainVolFlow = 1.00; @@ -478,7 +478,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; CurZoneEqNum = 0; CurSysNum = 1; @@ -512,8 +512,8 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (10.0 * Cp * rho); // check heating coil design water flow rate @@ -586,20 +586,20 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) // set up plant loop for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "FluidWaterLoop"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; // set up sizing data FinalSysSizing(1).DesMainVolFlow = 1.00; @@ -630,7 +630,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; CurZoneEqNum = 0; CurSysNum = 1; @@ -664,8 +664,8 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (10.0 * Cp * rho); // check heating coil design water flow rate @@ -742,20 +742,20 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) // set up plant loop for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "FluidWaterLoop"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; // set up sizing data FinalSysSizing(1).DesMainVolFlow = 1.00; @@ -786,7 +786,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; CurZoneEqNum = 0; CurSysNum = 1; @@ -821,8 +821,8 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (10.0 * Cp * rho); // check heating coil design water flow rate @@ -857,20 +857,20 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) // set up plant loop for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "WaterLoop"; - PlantLoop(1).FluidName = "FluidWaterLoop"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "WaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; // set up sizing data FinalSysSizing(1).MixTempAtCoolPeak = 20.0; @@ -902,7 +902,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(1) = "Design Water Flow Rate"; state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; CurZoneEqNum = 0; CurSysNum = 1; @@ -934,8 +934,8 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate / (state->dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp * Cp * rho); // check cooling coil design water flow rate @@ -958,20 +958,20 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) // set up plant loop for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "WaterLoop"; - PlantLoop(1).FluidName = "FluidWaterLoop"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "WaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; // set up sizing data FinalSysSizing(1).MixTempAtCoolPeak = 20.0; @@ -1019,7 +1019,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(1) = "Design Water Flow Rate"; state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; CurZoneEqNum = 0; CurSysNum = 1; @@ -1049,8 +1049,8 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate / (6.67 * Cp * rho); // check cooling coil design water flow rate EXPECT_DOUBLE_EQ(DesWaterFlowRate, state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); @@ -1071,20 +1071,20 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) // set up plant loop for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "WaterLoop"; - PlantLoop(1).FluidName = "FluidWaterLoop"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "WaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; // set up sizing data FinalSysSizing(1).MixTempAtCoolPeak = 20.0; @@ -1139,10 +1139,10 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) state->dataWaterCoils->WaterCoil(1).WaterLoopSide = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_DetFlatFinCooling; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_DetFlatFinCooling; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; CurZoneEqNum = 0; CurSysNum = 1; @@ -1174,8 +1174,8 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::CWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate / (6.67 * Cp * rho); // check cooling coil design water flow rate EXPECT_DOUBLE_EQ(DesWaterFlowRate, state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); @@ -1254,20 +1254,20 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) // set up plant loop for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "WaterLoop"; - PlantLoop(1).FluidName = "FluidWaterLoop"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "WaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; // set up sizing data FinalSysSizing(1).DesMainVolFlow = 1.00; @@ -1297,7 +1297,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; CurZoneEqNum = 0; CurSysNum = 1; @@ -1329,8 +1329,8 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) Real64 rho = 0; Real64 DesWaterFlowRate = 0; - Cp = GetSpecificHeatGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(*state, PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, DataGlobalConstants::HWInitConvTemp, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (11.0 * Cp * rho); // check heating coil design water flow rate @@ -1352,20 +1352,20 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) // set up plant loop for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(1).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(1).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "FluidWaterLoop"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "FluidWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; // set up sizing data FinalSysSizing(1).DesMainVolFlow = 1.00; @@ -1396,7 +1396,7 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; CurZoneEqNum = 0; CurSysNum = 1; @@ -1431,8 +1431,8 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) Real64 DesWaterFlowRate(0.0); // now size heating coil hot water flow rate at 60.0C - Cp = GetSpecificHeatGlycol(*state, PlantLoop(1).FluidName, 60.0, PlantLoop(1).FluidIndex, "Unit Test"); - rho = GetDensityGlycol(*state, PlantLoop(1).FluidName, 60.0, PlantLoop(1).FluidIndex, "Unit Test"); + Cp = GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, 60.0, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); + rho = GetDensityGlycol(*state, state->dataPlnt->PlantLoop(1).FluidName, 60.0, state->dataPlnt->PlantLoop(1).FluidIndex, "Unit Test"); DesWaterFlowRate = DesCoilHeatingLoad / (PlantSizData(1).DeltaT * Cp * rho); // check heating coil design water flow rate calculated here and sizing results are identical @@ -1614,7 +1614,7 @@ TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -1689,12 +1689,12 @@ TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } @@ -1712,25 +1712,25 @@ TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) state->dataWaterCoils->WaterCoil(1).WaterLoopBranchNum = 1; state->dataWaterCoils->WaterCoil(1).WaterLoopCompNum = 1; - PlantLoop(2).Name = "ChilledWaterLoop"; - PlantLoop(2).FluidName = "ChilledWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; - PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; - - PlantLoop(1).Name = "HotWaterLoop"; - PlantLoop(1).FluidName = "HotWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; - PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + state->dataPlnt->PlantLoop(2).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(2).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_Cooling; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(2).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(2).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; + + state->dataPlnt->PlantLoop(1).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterCoils->WaterCoil_SimpleHeating; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumOut = state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).FlowLock = DataPlant::iFlowLock::Unlocked; FanCoil(1).CoolCoilLoopNum = 2; FanCoil(1).HeatCoilLoopNum = 1; diff --git a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc index ccc9ec4a4e7..105d44f1fb2 100644 --- a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc +++ b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc @@ -2456,7 +2456,6 @@ TEST_F(EnergyPlusFixture, StratifiedTank_GSHP_DesuperheaterSourceHeat) using DataHVACGlobals::SysTimeElapsed; using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; - using DataPlant::PlantLoop; std::string const idf_objects = delimited_string({ "Schedule:Constant, Hot Water Demand Schedule, , 1.0;", @@ -2635,11 +2634,11 @@ TEST_F(EnergyPlusFixture, StratifiedTank_GSHP_DesuperheaterSourceHeat) Node(3).MassFlowRate = 0.05; // Plant loop must be initialized state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum = 1; - PlantLoop.allocate(LoopNum); - PlantLoop(state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex = 1; - PlantLoop(LoopNum).LoopSide.allocate(DemandSide); - PlantLoop(LoopNum).LoopSide.allocate(SupplySide); - auto &SupplySideloop(PlantLoop(LoopNum).LoopSide(SupplySide)); + state->dataPlnt->PlantLoop.allocate(LoopNum); + state->dataPlnt->PlantLoop(state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum).FluidIndex = 1; + state->dataPlnt->PlantLoop(LoopNum).LoopSide.allocate(DemandSide); + state->dataPlnt->PlantLoop(LoopNum).LoopSide.allocate(SupplySide); + auto &SupplySideloop(state->dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide)); SupplySideloop.TotalBranches = 1; SupplySideloop.Branch.allocate(BranchNum); auto &CoilBranch(SupplySideloop.Branch(BranchNum)); diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc index 9c35624cff8..7b7727bfe54 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc @@ -208,26 +208,26 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpTest_SimWaterToAir) DataLoopNode::Node(state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).AirInletNodeNum).Enthalpy = 43970.75; TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "ChilledWaterLoop"; - PlantLoop(1).FluidName = "ChilledWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WaterInletNodeNum; bool InitFlag(true); Real64 MaxONOFFCyclesperHour(4.0); @@ -256,13 +256,13 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpTest_SimWaterToAir) HPNum = 2; state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).LoopNum = 2; - PlantLoop(2).Name = "HotWaterLoop"; - PlantLoop(2).FluidName = "HotWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WAHPPlantTypeOfNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WaterInletNodeNum; DataLoopNode::Node(state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WaterInletNodeNum).Temp = 35.0; DataLoopNode::Node(state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).WaterInletNodeNum).Enthalpy = 43950.0; diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc index 5334014e345..84364f511f0 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc @@ -224,26 +224,26 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimple_TestWaterFlowControl) DataLoopNode::Node(state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).AirInletNodeNum).Enthalpy = 43970.75; TotNumLoops = 2; - PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(TotNumLoops); for (int l = 1; l <= TotNumLoops; ++l) { - auto &loop(PlantLoop(l)); + auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); - auto &loopside(PlantLoop(l).LoopSide(1)); + auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); loopside.TotalBranches = 1; loopside.Branch.allocate(1); - auto &loopsidebranch(PlantLoop(l).LoopSide(1).Branch(1)); + auto &loopsidebranch(state->dataPlnt->PlantLoop(l).LoopSide(1).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); } - PlantLoop(1).Name = "ChilledWaterLoop"; - PlantLoop(1).FluidName = "ChilledWater"; - PlantLoop(1).FluidIndex = 1; - PlantLoop(1).FluidName = "WATER"; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum; - PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).Name = "ChilledWaterLoop"; + state->dataPlnt->PlantLoop(1).FluidName = "ChilledWater"; + state->dataPlnt->PlantLoop(1).FluidIndex = 1; + state->dataPlnt->PlantLoop(1).FluidName = "WATER"; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum; + state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum; int CompOp(1); int CyclingScheme(1); @@ -312,13 +312,13 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimple_TestWaterFlowControl) HPNum = 2; state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).LoopNum = 2; - PlantLoop(2).Name = "HotWaterLoop"; - PlantLoop(2).FluidName = "HotWater"; - PlantLoop(2).FluidIndex = 1; - PlantLoop(2).FluidName = "WATER"; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum; - PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum; + state->dataPlnt->PlantLoop(2).Name = "HotWaterLoop"; + state->dataPlnt->PlantLoop(2).FluidName = "HotWater"; + state->dataPlnt->PlantLoop(2).FluidIndex = 1; + state->dataPlnt->PlantLoop(2).FluidName = "WATER"; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).Name = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).TypeOf_Num = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantTypeOfNum; + state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum; DataLoopNode::Node(state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum).Temp = 35.0; DataLoopNode::Node(state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum).Enthalpy = 43950.0; From a5ac3622b9b95eb9213cb8ff8a271a3f7f860391 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 6 Jan 2021 09:36:42 -0700 Subject: [PATCH 08/17] moving DataPlant to state, unit tests header cleanups --- src/EnergyPlus/BoilerSteam.cc | 16 +- src/EnergyPlus/Boilers.cc | 28 +- src/EnergyPlus/ChillerAbsorption.cc | 74 ++-- src/EnergyPlus/ChillerElectricEIR.cc | 50 +-- src/EnergyPlus/ChillerExhaustAbsorption.cc | 52 +-- src/EnergyPlus/ChillerGasAbsorption.cc | 52 +-- src/EnergyPlus/ChillerIndirectAbsorption.cc | 78 ++--- src/EnergyPlus/ChillerReformulatedEIR.cc | 48 +-- src/EnergyPlus/CondenserLoopTowers.cc | 322 +++++++++--------- src/EnergyPlus/ElectricPowerServiceManager.cc | 2 +- src/EnergyPlus/EvaporativeFluidCoolers.cc | 126 +++---- src/EnergyPlus/FluidCoolers.cc | 144 ++++---- src/EnergyPlus/HVACInterfaceManager.cc | 9 +- src/EnergyPlus/HVACManager.cc | 21 +- src/EnergyPlus/HVACSizingSimulationManager.cc | 3 +- src/EnergyPlus/HeatPumpWaterToWaterSimple.cc | 96 +++--- src/EnergyPlus/MicroCHPElectricGenerator.cc | 2 +- src/EnergyPlus/OutsideEnergySources.cc | 12 +- .../PhotovoltaicThermalCollectors.cc | 10 +- src/EnergyPlus/Plant/DataPlant.cc | 22 -- src/EnergyPlus/Plant/DataPlant.hh | 55 ++- src/EnergyPlus/Plant/PlantManager.cc | 140 ++++---- src/EnergyPlus/Plant/PlantManager.hh | 4 +- src/EnergyPlus/PlantCentralGSHP.cc | 42 +-- src/EnergyPlus/PlantChillers.cc | 192 +++++------ .../PlantComponentTemperatureSources.cc | 14 +- src/EnergyPlus/PlantCondLoopOperation.cc | 24 +- .../PlantHeatExchangerFluidToFluid.cc | 34 +- src/EnergyPlus/PlantLoopHeatPumpEIR.cc | 42 +-- src/EnergyPlus/PlantUtilities.cc | 34 +- src/EnergyPlus/Pumps.cc | 23 +- src/EnergyPlus/SetPointManager.cc | 4 +- src/EnergyPlus/SimulationManager.cc | 2 +- src/EnergyPlus/WaterThermalTanks.cc | 146 ++++---- tst/EnergyPlus/unit/AdvancedAFN.unit.cc | 4 +- tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc | 2 +- .../unit/AirTerminalSingleDuct.unit.cc | 3 - ...alSingleDuctConstantVolumeNoReheat.unit.cc | 6 +- .../unit/AirTerminalSingleDuctMixer.unit.cc | 21 +- .../AirTerminalSingleDuctPIUReheat.unit.cc | 4 - .../unit/AirflowNetworkBalanceManager.unit.cc | 5 +- .../AirflowNetworkSimulationControl.unit.cc | 3 - .../unit/AirflowNetworkSolver.unit.cc | 6 +- tst/EnergyPlus/unit/BaseboardRadiator.unit.cc | 6 +- tst/EnergyPlus/unit/BoilerHotWater.unit.cc | 20 +- tst/EnergyPlus/unit/BoilerSteam.unit.cc | 16 +- .../unit/BranchInputManager.unit.cc | 2 +- .../unit/BranchNodeConnections.unit.cc | 3 +- .../unit/ChilledCeilingPanelSimple.unit.cc | 5 +- tst/EnergyPlus/unit/ChillerAbsorption.unit.cc | 4 +- .../unit/ChillerConstantCOP.unit.cc | 19 +- tst/EnergyPlus/unit/ChillerElectric.unit.cc | 33 +- .../unit/ChillerElectricEIR.unit.cc | 32 +- .../unit/ChillerExhaustAbsorption.unit.cc | 1 - .../unit/ChillerGasAbsorption.unit.cc | 1 - .../unit/ChillerIndirectAbsorption.unit.cc | 5 +- .../unit/CondenserLoopTowers.unit.cc | 4 +- .../unit/ConstructionInternalSource.unit.cc | 2 +- .../unit/ConvectionCoefficients.unit.cc | 4 +- tst/EnergyPlus/unit/CrossVentMgr.unit.cc | 6 +- tst/EnergyPlus/unit/CurveManager.unit.cc | 4 +- tst/EnergyPlus/unit/DElightManager.unit.cc | 6 +- .../unit/DOASEffectOnZoneSizing.unit.cc | 4 +- tst/EnergyPlus/unit/DXCoils.unit.cc | 2 +- tst/EnergyPlus/unit/DataEnvironment.unit.cc | 2 +- .../unit/DataGlobalConstants.unit.cc | 2 +- tst/EnergyPlus/unit/DataHeatBalance.unit.cc | 2 +- tst/EnergyPlus/unit/DataPlant.unit.cc | 13 +- tst/EnergyPlus/unit/DataSizing.unit.cc | 2 +- tst/EnergyPlus/unit/DataSurfaces.unit.cc | 2 +- .../unit/DataSystemVariables.unit.cc | 1 - tst/EnergyPlus/unit/DataZoneEquipment.unit.cc | 3 +- tst/EnergyPlus/unit/Datasets.unit.cc | 4 +- .../unit/DaylightingManager.unit.cc | 2 +- tst/EnergyPlus/unit/DemandResponse.unit.cc | 2 +- .../unit/DesiccantDehumidifiers.unit.cc | 4 +- .../unit/DisplacementVentMgr.unit.cc | 3 +- tst/EnergyPlus/unit/DualDuct.unit.cc | 3 +- tst/EnergyPlus/unit/EMSManager.unit.cc | 8 +- tst/EnergyPlus/unit/EarthTube.unit.cc | 3 +- .../unit/EconomicLifeCycleCost.unit.cc | 4 +- tst/EnergyPlus/unit/EconomicTariff.unit.cc | 4 +- .../unit/ElectricBaseboardRadiator.unit.cc | 7 +- .../unit/ElectricPowerServiceManager.unit.cc | 7 +- .../unit/EvaporativeCoolers.unit.cc | 2 +- .../unit/EvaporativeFluidCoolers.unit.cc | 8 +- tst/EnergyPlus/unit/ExteriorEnergyUse.unit.cc | 2 +- tst/EnergyPlus/unit/FanCoilUnits.unit.cc | 85 +++-- tst/EnergyPlus/unit/Fans.unit.cc | 4 +- tst/EnergyPlus/unit/FaultsManager.unit.cc | 8 +- tst/EnergyPlus/unit/FileSystem.unit.cc | 8 +- ...teDifferenceGroundTemperatureModel.unit.cc | 10 +- .../unit/Fixtures/InputProcessorFixture.hh | 1 + tst/EnergyPlus/unit/FluidCoolers.unit.cc | 4 +- tst/EnergyPlus/unit/FluidProperties.unit.cc | 3 +- .../unit/FuelCellElectricGenerator.unit.cc | 3 +- tst/EnergyPlus/unit/Furnaces.unit.cc | 9 +- tst/EnergyPlus/unit/General.unit.cc | 11 +- tst/EnergyPlus/unit/GeneralRoutines.unit.cc | 2 +- .../unit/GroundHeatExchangers.unit.cc | 22 +- tst/EnergyPlus/unit/HVACControllers.unit.cc | 12 +- tst/EnergyPlus/unit/HVACDXSystem.unit.cc | 8 +- tst/EnergyPlus/unit/HVACFan.unit.cc | 4 +- tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc | 2 +- .../unit/HVACHXAssistedCoolingCoil.unit.cc | 4 +- .../unit/HVACInterfaceManager.unit.cc | 12 +- tst/EnergyPlus/unit/HVACManager.unit.cc | 3 +- .../unit/HVACMultiSpeedHeatPump.unit.cc | 7 +- .../unit/HVACSizingSimulationManager.unit.cc | 11 +- tst/EnergyPlus/unit/HVACStandaloneERV.unit.cc | 2 +- .../unit/HVACUnitaryBypassVAV.unit.cc | 2 +- .../unit/HVACVariableRefrigerantFlow.unit.cc | 22 +- .../unit/HWBaseboardRadiator.unit.cc | 14 +- .../unit/HeatBalFiniteDiffManager.unit.cc | 3 +- .../unit/HeatBalanceAirManager.unit.cc | 3 +- .../unit/HeatBalanceIntRadExchange.unit.cc | 3 +- .../unit/HeatBalanceKivaManager.unit.cc | 4 +- .../unit/HeatBalanceManager.unit.cc | 7 +- .../unit/HeatBalanceMovableInsulation.unit.cc | 2 +- .../unit/HeatBalanceSurfaceManager.unit.cc | 4 +- .../unit/HeatPumpWaterToWaterSimple.unit.cc | 2 +- tst/EnergyPlus/unit/HeatRecovery.unit.cc | 4 +- tst/EnergyPlus/unit/HeatingCoils.unit.cc | 17 +- .../unit/HighTempRadiantSystem.unit.cc | 4 +- tst/EnergyPlus/unit/Humidifiers.unit.cc | 4 +- tst/EnergyPlus/unit/HybridModel.unit.cc | 6 +- .../unit/ICEngineElectricGenerator.unit.cc | 3 +- tst/EnergyPlus/unit/ICSCollector.unit.cc | 6 +- tst/EnergyPlus/unit/IceThermalStorage.unit.cc | 6 +- tst/EnergyPlus/unit/InputProcessor.unit.cc | 5 +- .../unit/IntegratedHeatPump.unit.cc | 2 +- tst/EnergyPlus/unit/InternalHeatGains.unit.cc | 5 +- ...udaAchenbachGroundTemperatureModel.unit.cc | 1 - .../unit/LowTempRadiantSystem.unit.cc | 30 +- .../unit/MicroCHPElectricGenerator.unit.cc | 5 +- .../MicroturbineElectricGenerator.unit.cc | 5 +- tst/EnergyPlus/unit/MixedAir.unit.cc | 7 +- tst/EnergyPlus/unit/MixerComponent.unit.cc | 3 +- .../unit/MoistureBalanceEMPD.unit.cc | 7 +- tst/EnergyPlus/unit/NodeInputManager.unit.cc | 2 +- .../unit/OASystemHWPreheatCoil.unit.cc | 3 +- tst/EnergyPlus/unit/OutAirNodeManager.unit.cc | 8 +- tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc | 14 +- tst/EnergyPlus/unit/OutputProcessor.unit.cc | 5 +- tst/EnergyPlus/unit/OutputReportData.unit.cc | 4 +- .../unit/OutputReportTabular.unit.cc | 2 +- .../unit/OutputReportTabularAnnual.unit.cc | 7 +- tst/EnergyPlus/unit/OutputReports.unit.cc | 4 +- tst/EnergyPlus/unit/PVWatts.unit.cc | 5 +- .../unit/PackagedTerminalHeatPump.unit.cc | 19 +- tst/EnergyPlus/unit/Photovoltaics.unit.cc | 5 +- tst/EnergyPlus/unit/PierceSurface.unit.cc | 7 +- tst/EnergyPlus/unit/Pipes.unit.cc | 4 +- tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc | 9 +- tst/EnergyPlus/unit/PlantChillers.unit.cc | 11 +- .../PlantComponentTemperatureSources.unit.cc | 6 +- .../unit/PlantCondLoopOperation.unit.cc | 11 +- .../PlantHeatExchangerFluidToFluid.unit.cc | 15 +- .../unit/PlantLoopHeatPumpEIR.unit.cc | 122 ++++--- .../unit/PlantPipingSystemsManager.unit.cc | 7 +- tst/EnergyPlus/unit/PlantUtilities.unit.cc | 10 +- tst/EnergyPlus/unit/PluginManager.unit.cc | 3 +- .../unit/PoweredInductionUnits.unit.cc | 4 +- tst/EnergyPlus/unit/Psychrometrics.unit.cc | 3 +- tst/EnergyPlus/unit/Pumps.unit.cc | 5 +- .../unit/PurchasedAirManager.unit.cc | 6 +- .../unit/ReportCoilSelection.unit.cc | 11 +- tst/EnergyPlus/unit/ResultsFramework.unit.cc | 2 +- .../unit/RoomAirModelUserTempPattern.unit.cc | 3 +- .../unit/RoomAirflowNetwork.unit.cc | 5 +- tst/EnergyPlus/unit/RootFinder.unit.cc | 7 +- tst/EnergyPlus/unit/RunPeriod.unit.cc | 5 +- .../unit/RuntimeLanguageProcessor.unit.cc | 2 +- tst/EnergyPlus/unit/SQLite.unit.cc | 4 +- tst/EnergyPlus/unit/SZVAVModel.unit.cc | 8 +- tst/EnergyPlus/unit/ScheduleManager.unit.cc | 4 +- tst/EnergyPlus/unit/SecondaryDXCoils.unit.cc | 7 +- tst/EnergyPlus/unit/SetPointManager.unit.cc | 11 +- .../unit/SimAirServingZones.unit.cc | 10 +- tst/EnergyPlus/unit/SimulationManager.unit.cc | 12 +- tst/EnergyPlus/unit/SingleDuct.unit.cc | 4 +- ...eBuildingSurfaceGroundTemperatures.unit.cc | 1 - .../unit/SiteDeepGroundTemperatures.unit.cc | 1 - ...teFCFactorMethodGroundTemperatures.unit.cc | 1 - .../SiteShallowGroundTemperatures.unit.cc | 1 - .../unit/SizeWaterHeatingCoil.unit.cc | 44 ++- .../unit/SizingAnalysisObjects.unit.cc | 11 +- tst/EnergyPlus/unit/SizingManager.unit.cc | 3 +- tst/EnergyPlus/unit/SolarShading.unit.cc | 5 +- .../unit/SortAndStringUtilities.unit.cc | 5 +- tst/EnergyPlus/unit/StandardRatings.unit.cc | 2 +- tst/EnergyPlus/unit/StringUtilities.unit.cc | 3 +- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 7 +- tst/EnergyPlus/unit/SurfaceOctree.unit.cc | 5 +- tst/EnergyPlus/unit/SwimmingPool.unit.cc | 15 +- .../unit/SystemAvailabilityManager.unit.cc | 4 +- tst/EnergyPlus/unit/SystemReports.unit.cc | 5 +- tst/EnergyPlus/unit/ThermalChimney.unit.cc | 2 +- tst/EnergyPlus/unit/ThermalComfort.unit.cc | 2 +- .../unit/TranspiredCollector.unit.cc | 1 - tst/EnergyPlus/unit/UnitHeater.unit.cc | 8 +- tst/EnergyPlus/unit/UnitVentilator.unit.cc | 6 +- .../unit/UnitaryHybridAirConditioner.unit.cc | 6 +- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 44 ++- tst/EnergyPlus/unit/UtilityRoutines.unit.cc | 3 +- tst/EnergyPlus/unit/VAVDefMinMaxFlow.unit.cc | 2 - .../unit/VariableSpeedCoils.unit.cc | 6 +- tst/EnergyPlus/unit/Vectors.unit.cc | 1 - tst/EnergyPlus/unit/VentilatedSlab.unit.cc | 3 - tst/EnergyPlus/unit/WaterCoils.unit.cc | 38 +-- tst/EnergyPlus/unit/WaterManager.unit.cc | 5 +- tst/EnergyPlus/unit/WaterThermalTanks.unit.cc | 5 +- .../unit/WaterToAirHeatPump.unit.cc | 8 +- .../unit/WaterToAirHeatPumpSimple.unit.cc | 6 +- tst/EnergyPlus/unit/WeatherManager.unit.cc | 3 +- tst/EnergyPlus/unit/WinCalcEngine.unit.cc | 7 +- tst/EnergyPlus/unit/WindowAC.unit.cc | 4 +- .../unit/WindowEquivalentLayer.unit.cc | 10 +- .../WindowLayerEffectiveMultipliers.unit.cc | 3 +- tst/EnergyPlus/unit/WindowManager.unit.cc | 2 +- .../unit/XingGroundTemperatureModel.unit.cc | 3 +- .../ZoneContaminantPredictorCorrector.unit.cc | 6 +- .../unit/ZoneHVACEvaporativeCooler.unit.cc | 3 +- tst/EnergyPlus/unit/ZonePlenum.unit.cc | 1 - .../unit/ZoneTempPredictorCorrector.unit.cc | 2 +- 225 files changed, 1565 insertions(+), 1801 deletions(-) diff --git a/src/EnergyPlus/BoilerSteam.cc b/src/EnergyPlus/BoilerSteam.cc index 0070eef46a6..6f3f0544bd5 100644 --- a/src/EnergyPlus/BoilerSteam.cc +++ b/src/EnergyPlus/BoilerSteam.cc @@ -339,7 +339,7 @@ namespace BoilerSteam { int BoilerInletNode = this->BoilerInletNodeNum; int BoilerOutletNode = this->BoilerOutletNodeNum; - if (state.dataGlobal->BeginEnvrnFlag && this->myEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (state.dataGlobal->BeginEnvrnFlag && this->myEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 EnthSteamOutDry = FluidProperties::GetSatEnthalpyRefrig(state, fluidNameSteam, this->TempUpLimitBoilerOut, 1.0, this->FluidIndex, RoutineName); @@ -493,19 +493,19 @@ namespace BoilerSteam { } else { if (this->NomCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCapWasAutoSized) { this->NomCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Boiler:Steam", this->Name, "Design Size Nominal Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Boiler:Steam", this->Name, "Initial Design Size Nominal Capacity [W]", tmpNomCap); } } else { // Hard-sized with sizing data if (this->NomCap > 0.0 && tmpNomCap > 0.0) { Real64 NomCapUser = this->NomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Boiler:Steam", this->Name, "Design Size Nominal Capacity [W]", @@ -526,17 +526,17 @@ namespace BoilerSteam { } } } else { - if (this->NomCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->NomCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Boiler nominal capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Boiler:Steam object=" + this->Name); ErrorsFound = true; } - if (!this->NomCapWasAutoSized && this->NomCap > 0.0 && DataPlant::PlantFinalSizesOkayToReport) { + if (!this->NomCapWasAutoSized && this->NomCap > 0.0 && state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Boiler:Steam", this->Name, "User-Specified Nominal Capacity [W]", this->NomCap); } } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->Name, "Boiler:Steam"); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomEff, this->Name, this->NomEffic); diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index 1e118370940..71849e3eee8 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -455,7 +455,7 @@ namespace EnergyPlus::Boilers { this->MyFlag = false; } - if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { // if ( ! PlantFirstSizeCompleted ) SizeBoiler( BoilerNum ); Real64 const rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, @@ -572,19 +572,19 @@ namespace EnergyPlus::Boilers { } else { if (this->NomCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCapWasAutoSized) { this->NomCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Boiler:HotWater", this->Name, "Design Size Nominal Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Boiler:HotWater", this->Name, "Initial Design Size Nominal Capacity [W]", tmpNomCap); } } else { // Hard-sized with sizing data if (this->NomCap > 0.0 && tmpNomCap > 0.0) { Real64 const NomCapUser = this->NomCap; // Hardsized nominal capacity for reporting - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Boiler:HotWater", this->Name, "Design Size Nominal Capacity [W]", @@ -605,12 +605,12 @@ namespace EnergyPlus::Boilers { } } } else { - if (this->NomCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->NomCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Boiler nominal capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Boiler object=" + this->Name); ErrorsFound = true; } - if (!this->NomCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->NomCap > 0.0)) { // Hard-sized with no sizing data + if (!this->NomCapWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->NomCap > 0.0)) { // Hard-sized with no sizing data BaseSizer::reportSizerOutput(state, "Boiler:HotWater", this->Name, "User-Specified Nominal Capacity [W]", this->NomCap); } } @@ -621,21 +621,21 @@ namespace EnergyPlus::Boilers { } else { if (this->VolFlowRateWasAutoSized) tmpBoilerVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->VolFlowRateWasAutoSized) { this->VolFlowRate = tmpBoilerVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Boiler:HotWater", this->Name, "Design Size Design Water Flow Rate [m3/s]", tmpBoilerVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Boiler:HotWater", this->Name, "Initial Design Size Design Water Flow Rate [m3/s]", tmpBoilerVolFlowRate); } } else { if (this->VolFlowRate > 0.0 && tmpBoilerVolFlowRate > 0.0) { Real64 VolFlowRateUser = this->VolFlowRate; // Hardsized volume flow for reporting - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Boiler:HotWater", this->Name, "Design Size Design Water Flow Rate [m3/s]", @@ -658,12 +658,12 @@ namespace EnergyPlus::Boilers { } } } else { - if (this->VolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->VolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Boiler design flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Boiler object=" + this->Name); ErrorsFound = true; } - if (!this->VolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && + if (!this->VolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->VolFlowRate > 0.0)) { // Hard-sized with no sizing data BaseSizer::reportSizerOutput(state, "Boiler:HotWater", this->Name, "User-Specified Design Water Flow Rate [m3/s]", this->VolFlowRate); } @@ -671,7 +671,7 @@ namespace EnergyPlus::Boilers { PlantUtilities::RegisterPlantCompDesignFlow(this->BoilerInletNodeNum, tmpBoilerVolFlowRate); - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report std::string const equipName = this->Name; OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, equipName, "Boiler:HotWater"); diff --git a/src/EnergyPlus/ChillerAbsorption.cc b/src/EnergyPlus/ChillerAbsorption.cc index 312e3514785..b57531d8236 100644 --- a/src/EnergyPlus/ChillerAbsorption.cc +++ b/src/EnergyPlus/ChillerAbsorption.cc @@ -715,7 +715,7 @@ namespace EnergyPlus::ChillerAbsorption { this->MyOneTimeFlag = false; } - if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, @@ -940,19 +940,19 @@ namespace EnergyPlus::ChillerAbsorption { } else { if (this->NomCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCapWasAutoSized) { this->NomCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Nominal Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Initial Design Size Nominal Capacity [W]", tmpNomCap); } } else { if (this->NomCap > 0.0 && tmpNomCap > 0.0) { Real64 NomCapUser = this->NomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Nominal Capacity [W]", @@ -974,12 +974,12 @@ namespace EnergyPlus::ChillerAbsorption { } } } else { - if (this->NomCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->NomCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Absorption Chiller nominal capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Chiller:Absorption object=" + this->Name); ErrorsFound = true; } - if (!this->NomCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && this->NomCap > 0.0) { + if (!this->NomCapWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && this->NomCap > 0.0) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "User-Specified Nominal Capacity [W]", this->NomCap); } } @@ -987,14 +987,14 @@ namespace EnergyPlus::ChillerAbsorption { // local nominal pump power Real64 tmpNomPumpPower = 0.0045 * this->NomCap; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { // the DOE-2 EIR for single stage absorption chiller if (this->NomPumpPowerWasAutoSized) { this->NomPumpPower = tmpNomPumpPower; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Nominal Pumping Power [W]", tmpNomPumpPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Initial Design Size Nominal Pumping Power [W]", tmpNomPumpPower); } @@ -1003,7 +1003,7 @@ namespace EnergyPlus::ChillerAbsorption { // Hardsized nominal pump power for reporting Real64 NomPumpPowerUser = this->NomPumpPower; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Nominal Pumping Power [W]", @@ -1032,14 +1032,14 @@ namespace EnergyPlus::ChillerAbsorption { } else { if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->EvapVolFlowRateWasAutoSized) { this->EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Initial Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } @@ -1047,7 +1047,7 @@ namespace EnergyPlus::ChillerAbsorption { if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { // Hardsized evaporator volume flow rate for reporting Real64 EvapVolFlowRateUser = this->EvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", @@ -1073,12 +1073,12 @@ namespace EnergyPlus::ChillerAbsorption { } } } else { - if (this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Absorption Chiller evap flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in CHILLER:ABSORPTION object=" + this->Name); ErrorsFound = true; } - if (!this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && this->EvapVolFlowRate > 0.0) { + if (!this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && this->EvapVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "User-Specified Design Chilled Water Flow Rate [m3/s]", this->EvapVolFlowRate); } @@ -1108,14 +1108,14 @@ namespace EnergyPlus::ChillerAbsorption { } else { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->CondVolFlowRateWasAutoSized) { this->CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Initial Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } @@ -1123,7 +1123,7 @@ namespace EnergyPlus::ChillerAbsorption { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { // Hardsized condenser flow rate for reporting Real64 CondVolFlowRateUser = this->CondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", @@ -1149,13 +1149,13 @@ namespace EnergyPlus::ChillerAbsorption { } } } else { - if (this->CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Absorption Chiller condenser flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object"); ShowContinueError(state, "Occurs in CHILLER:ABSORPTION object=" + this->Name); ErrorsFound = true; } - if (!this->CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize && (this->CondVolFlowRate > 0.0)) { + if (!this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize && (this->CondVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "User-Specified Design Condenser Water Flow Rate [m3/s]", this->CondVolFlowRate); } @@ -1181,14 +1181,14 @@ namespace EnergyPlus::ChillerAbsorption { RoutineName); tmpGeneratorVolFlowRate = (this->NomCap * SteamInputRatNom) / (CpWater * SteamDeltaT * RhoWater); if (!this->GeneratorVolFlowRateWasAutoSized) tmpGeneratorVolFlowRate = this->GeneratorVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->GeneratorVolFlowRateWasAutoSized) { this->GeneratorVolFlowRate = tmpGeneratorVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Design Generator Fluid Flow Rate [m3/s]", tmpGeneratorVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Iniital Design Size Design Generator Fluid Flow Rate [m3/s]", @@ -1198,7 +1198,7 @@ namespace EnergyPlus::ChillerAbsorption { if (this->GeneratorVolFlowRate > 0.0 && tmpGeneratorVolFlowRate > 0.0) { // Hardsized generator flow rate for reporting Real64 GeneratorVolFlowRateUser = this->GeneratorVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Design Generator Fluid Flow Rate [m3/s]", @@ -1241,15 +1241,15 @@ namespace EnergyPlus::ChillerAbsorption { tmpGeneratorVolFlowRate = this->SteamMassFlowRate / SteamDensity; if (!this->GeneratorVolFlowRateWasAutoSized) tmpGeneratorVolFlowRate = this->GeneratorVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->GeneratorVolFlowRateWasAutoSized) { this->GeneratorVolFlowRate = tmpGeneratorVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Design Generator Fluid Flow Rate [m3/s]", tmpGeneratorVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Initial Design Size Design Generator Fluid Flow Rate [m3/s]", @@ -1259,7 +1259,7 @@ namespace EnergyPlus::ChillerAbsorption { if (this->GeneratorVolFlowRate > 0.0 && tmpGeneratorVolFlowRate > 0.0) { // Hardsized generator flow rate for reporting Real64 GeneratorVolFlowRateUser = this->GeneratorVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "Design Size Design Generator Fluid Flow Rate [m3/s]", @@ -1288,7 +1288,7 @@ namespace EnergyPlus::ChillerAbsorption { } } else { if (this->GeneratorVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->GeneratorVolFlowRate = 0.0; } else { tmpGeneratorVolFlowRate = 0.0; @@ -1296,21 +1296,21 @@ namespace EnergyPlus::ChillerAbsorption { } } } else { - if (this->GeneratorVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->GeneratorVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Absorption Chiller generator flow rate requires a loop Sizing:Plant object."); ShowContinueError(state, " For steam loops, use a steam Sizing:Plant object."); ShowContinueError(state, " For hot water loops, use a heating Sizing:Plant object."); ShowContinueError(state, "Occurs in Chiller:Absorption object=" + this->Name); ErrorsFound = true; } - if (!this->GeneratorVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->GeneratorVolFlowRate > 0.0)) { + if (!this->GeneratorVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->GeneratorVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, moduleObjectType, this->Name, "User-Specified Design Generator Fluid Flow Rate [m3/s]", this->GeneratorVolFlowRate); } } // save the design steam or hot water volumetric flow rate for use by the steam or hot water loop sizing algorithms - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { PlantUtilities::RegisterPlantCompDesignFlow(this->GeneratorInletNodeNum, this->GeneratorVolFlowRate); } else { PlantUtilities::RegisterPlantCompDesignFlow(this->GeneratorInletNodeNum, tmpGeneratorVolFlowRate); @@ -1320,7 +1320,7 @@ namespace EnergyPlus::ChillerAbsorption { if (PltSizHeatingNum > 0 && this->GenHeatSourceType == DataLoopNode::NodeType_Water) { this->GeneratorDeltaTemp = max(0.5, DataSizing::PlantSizData(PltSizHeatingNum).DeltaT); } else if (this->GenHeatSourceType == DataLoopNode::NodeType_Water) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { Real64 Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->GenLoopNum).FluidName, DataGlobalConstants::HWInitConvTemp, @@ -1341,7 +1341,7 @@ namespace EnergyPlus::ChillerAbsorption { ShowFatalError(state, "Preceding sizing errors cause program termination"); } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report std::string equipName = this->Name; OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, equipName, moduleObjectType); diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 3a7804a6f43..b7a6b8474b4 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -1049,7 +1049,7 @@ namespace ChillerElectricEIR { this->EquipFlowCtrl = state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; - if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, @@ -1256,21 +1256,21 @@ namespace ChillerElectricEIR { } else { if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->EvapVolFlowRateWasAutoSized) { this->EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", 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) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", @@ -1296,12 +1296,12 @@ namespace ChillerElectricEIR { } } } else { - if (this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Electric Chiller evap flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Electric Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { + if (!this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "User-Specified Reference Chilled Water Flow Rate [m3/s]", this->EvapVolFlowRate); } @@ -1326,20 +1326,20 @@ namespace ChillerElectricEIR { } else { tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->RefCapWasAutoSized) { this->RefCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "Design Size Reference Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "Initial Design Size Reference Capacity [W]", tmpNomCap); } } else { // Hard-sized with sizing data if (this->RefCap > 0.0 && tmpNomCap > 0.0) { Real64 RefCapUser = this->RefCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "Design Size Reference Capacity [W]", @@ -1361,12 +1361,12 @@ namespace ChillerElectricEIR { } } } else { - if (this->RefCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->RefCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Electric Chiller reference capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Electric Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->RefCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->RefCap > 0.0)) { // Hard-sized with no sizing data + if (!this->RefCapWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->RefCap > 0.0)) { // Hard-sized with no sizing data BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "User-Specified Reference Capacity [W]", this->RefCap); } } @@ -1390,21 +1390,21 @@ namespace ChillerElectricEIR { } else { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->CondVolFlowRateWasAutoSized) { this->CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "Design Size Reference Condenser Fluid Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "Initial Design Size Reference Condenser Fluid Flow Rate [m3/s]", tmpCondVolFlowRate); } } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { Real64 CondVolFlowRateUser = this->CondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "Design Size Reference Condenser Fluid Flow Rate [m3/s]", @@ -1432,13 +1432,13 @@ namespace ChillerElectricEIR { } else { if (this->CondenserType == DataPlant::CondenserType::WaterCooled) { - if (this->CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Electric EIR Chiller condenser fluid flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Electric EIR Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { + if (!this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "User-Specified Reference Condenser Fluid Flow Rate [m3/s]", this->CondVolFlowRate); } @@ -1446,7 +1446,7 @@ namespace ChillerElectricEIR { } else { // Auto size condenser air flow to Total Capacity * 0.000114 m3/s/w (850 cfm/ton) - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { std::string CompType = DataPlant::ccSimPlantEquipTypes(DataPlant::TypeOf_Chiller_ElectricEIR); DataSizing::DataConstantUsedForSizing = this->RefCap; DataSizing::DataFractionUsedForSizing = 0.000114; @@ -1470,13 +1470,13 @@ namespace ChillerElectricEIR { Real64 tempHeatRecVolFlowRate = tmpCondVolFlowRate * this->HeatRecCapacityFraction; if (this->DesignHeatRecVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->DesignHeatRecVolFlowRate = tempHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "Design Size Heat Recovery Water Flow Rate [m3/s]", tempHeatRecVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, "Intial Design Size Heat Recovery Water Flow Rate [m3/s]", tempHeatRecVolFlowRate); } @@ -1484,7 +1484,7 @@ namespace ChillerElectricEIR { } else { if (this->DesignHeatRecVolFlowRate > 0.0 && tempHeatRecVolFlowRate > 0.0) { Real64 nomHeatRecVolFlowRateUser = this->DesignHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:EIR", this->Name, @@ -1517,7 +1517,7 @@ namespace ChillerElectricEIR { PlantUtilities::RegisterPlantCompDesignFlow(this->HeatRecInletNodeNum, tempHeatRecVolFlowRate); } // Heat recovery active - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->IPLVFlag) { Real64 IPLV; StandardRatings::CalcChillerIPLV(state, diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index 3c73dfc9ffe..d9b0d80ccaa 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -786,7 +786,7 @@ namespace ChillerExhaustAbsorption { HeatInletNode = this->HeatReturnNodeNum; HeatOutletNode = this->HeatSupplyNodeNum; - if (this->envrnInit && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->envrnInit && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { if (this->isWaterCooled) { // init max available condenser water flow rate @@ -953,21 +953,21 @@ namespace ChillerExhaustAbsorption { } else { if (this->NomCoolingCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCoolingCapWasAutoSized) { this->NomCoolingCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Design Size Nominal Cooling Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "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) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Design Size Nominal Cooling Capacity [W]", @@ -990,14 +990,14 @@ namespace ChillerExhaustAbsorption { } } else { if (this->NomCoolingCapWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowContinueError(state, "Autosizing of Exhaust Fired Absorption Chiller nominal cooling capacity requires"); ShowContinueError(state, "a cooling loop Sizing:Plant object."); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->NomCoolingCap > 0.0) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:DoubleEffect", this->Name, "User-Specified Nominal Capacity [W]", this->NomCoolingCap); @@ -1014,16 +1014,16 @@ namespace ChillerExhaustAbsorption { } else { if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->EvapVolFlowRateWasAutoSized) { this->EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Initial Design Size Design Chilled Water Flow Rate [m3/s]", @@ -1032,7 +1032,7 @@ namespace ChillerExhaustAbsorption { } else { if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { EvapVolFlowRateUser = this->EvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", @@ -1059,14 +1059,14 @@ namespace ChillerExhaustAbsorption { } } else { if (this->EvapVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowContinueError(state, "Autosizing of Exhaust Fired Absorption Chiller evap flow rate requires"); ShowContinueError(state, "a cooling loop Sizing:Plant object."); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->EvapVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, @@ -1087,16 +1087,16 @@ namespace ChillerExhaustAbsorption { } else { if (this->HeatVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->HeatVolFlowRateWasAutoSized) { this->HeatVolFlowRate = tmpHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Design Size Design Hot Water Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Initial Design Size Design Hot Water Flow Rate [m3/s]", @@ -1105,7 +1105,7 @@ namespace ChillerExhaustAbsorption { } else { if (this->HeatVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { HeatRecVolFlowRateUser = this->HeatVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Design Size Design Hot Water Flow Rate [m3/s]", @@ -1131,14 +1131,14 @@ namespace ChillerExhaustAbsorption { } } else { if (this->HeatVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowContinueError(state, "Autosizing of Exhaust Fired Absorption Chiller hot water flow rate requires"); ShowContinueError(state, "a heating loop Sizing:Plant object."); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->HeatVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, @@ -1170,16 +1170,16 @@ namespace ChillerExhaustAbsorption { } else { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->CondVolFlowRateWasAutoSized) { this->CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Initial Design Size Design Condenser Water Flow Rate [m3/s]", @@ -1188,7 +1188,7 @@ namespace ChillerExhaustAbsorption { } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { CondVolFlowRateUser = this->CondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", @@ -1215,14 +1215,14 @@ namespace ChillerExhaustAbsorption { } } else { if (this->CondVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"" + this->Name + "\", autosize error."); ShowSevereError(state, "Autosizing of Exhaust Fired Absorption Chiller condenser flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object."); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->CondVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DoubleEffect", this->Name, @@ -1240,7 +1240,7 @@ namespace ChillerExhaustAbsorption { ShowFatalError(state, "Preceding sizing errors cause program termination"); } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report equipName = this->Name; OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, equipName, "ChillerHeater:Absorption:DoubleEffect"); diff --git a/src/EnergyPlus/ChillerGasAbsorption.cc b/src/EnergyPlus/ChillerGasAbsorption.cc index d84877dd96c..e46bba86193 100644 --- a/src/EnergyPlus/ChillerGasAbsorption.cc +++ b/src/EnergyPlus/ChillerGasAbsorption.cc @@ -779,7 +779,7 @@ namespace ChillerGasAbsorption { HeatInletNode = this->HeatReturnNodeNum; HeatOutletNode = this->HeatSupplyNodeNum; - if (this->envrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->envrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { if (this->isWaterCooled) { // init max available condenser water flow rate @@ -945,21 +945,21 @@ namespace ChillerGasAbsorption { } else { if (this->NomCoolingCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCoolingCapWasAutoSized) { this->NomCoolingCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Design Size Nominal Cooling Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", 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) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Design Size Nominal Cooling Capacity [W]", @@ -982,14 +982,14 @@ namespace ChillerGasAbsorption { } } else { if (this->NomCoolingCapWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "SizeGasAbsorber: ChillerHeater:Absorption:DirectFired=\"" + this->Name + "\", autosize error."); ShowContinueError(state, "Autosizing of Direct Fired Absorption Chiller nominal cooling capacity requires"); ShowContinueError(state, "a cooling loop Sizing:Plant object."); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->NomCoolingCap > 0.0) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "User-Specified Nominal Capacity [W]", this->NomCoolingCap); @@ -1005,16 +1005,16 @@ namespace ChillerGasAbsorption { } else { if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->EvapVolFlowRateWasAutoSized) { this->EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Initial Design Size Design Chilled Water Flow Rate [m3/s]", @@ -1023,7 +1023,7 @@ namespace ChillerGasAbsorption { } else { if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { EvapVolFlowRateUser = this->EvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", @@ -1050,14 +1050,14 @@ namespace ChillerGasAbsorption { } } else { if (this->EvapVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "SizeGasAbsorber: ChillerHeater:Absorption:DirectFired=\"" + this->Name + "\", autosize error."); ShowContinueError(state, "Autosizing of Direct Fired Absorption Chiller evap flow rate requires"); ShowContinueError(state, "a cooling loop Sizing:Plant object."); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->EvapVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, @@ -1078,16 +1078,16 @@ namespace ChillerGasAbsorption { } else { if (this->HeatVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->HeatVolFlowRateWasAutoSized) { this->HeatVolFlowRate = tmpHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Design Size Design Hot Water Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Initial Design Size Design Hot Water Flow Rate [m3/s]", @@ -1096,7 +1096,7 @@ namespace ChillerGasAbsorption { } else { if (this->HeatVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { HeatRecVolFlowRateUser = this->HeatVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Design Size Design Hot Water Flow Rate [m3/s]", @@ -1122,14 +1122,14 @@ namespace ChillerGasAbsorption { } } else { if (this->HeatVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "SizeGasAbsorber: ChillerHeater:Absorption:DirectFired=\"" + this->Name + "\", autosize error."); ShowContinueError(state, "Autosizing of Direct Fired Absorption Chiller hot water flow rate requires"); ShowContinueError(state, "a heating loop Sizing:Plant object."); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->HeatVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, @@ -1162,16 +1162,16 @@ namespace ChillerGasAbsorption { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; // IF (PlantFirstSizesOkayToFinalize) GasAbsorber(ChillNum)%CondVolFlowRate = tmpCondVolFlowRate } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->CondVolFlowRateWasAutoSized) { this->CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Initial Design Size Design Condenser Water Flow Rate [m3/s]", @@ -1180,7 +1180,7 @@ namespace ChillerGasAbsorption { } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { CondVolFlowRateUser = this->CondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", @@ -1207,14 +1207,14 @@ namespace ChillerGasAbsorption { } } else { if (this->CondVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "SizeGasAbsorber: ChillerHeater:Absorption:DirectFired=\"" + this->Name + "\", autosize error."); ShowContinueError(state, "Autosizing of Direct Fired Absorption Chiller condenser flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object."); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->CondVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "ChillerHeater:Absorption:DirectFired", this->Name, @@ -1232,7 +1232,7 @@ namespace ChillerGasAbsorption { ShowFatalError(state, "Preceding sizing errors cause program termination"); } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report equipName = this->Name; OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, equipName, "ChillerHeater:Absorption:DirectFired"); diff --git a/src/EnergyPlus/ChillerIndirectAbsorption.cc b/src/EnergyPlus/ChillerIndirectAbsorption.cc index 3877a0d01de..f85daca395b 100644 --- a/src/EnergyPlus/ChillerIndirectAbsorption.cc +++ b/src/EnergyPlus/ChillerIndirectAbsorption.cc @@ -813,7 +813,7 @@ namespace ChillerIndirectAbsorption { this->EquipFlowCtrl = state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; // Initialize Supply Side Variables - if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, @@ -1028,21 +1028,21 @@ namespace ChillerIndirectAbsorption { } else { if (this->NomCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCapWasAutoSized) { this->NomCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Nominal Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Initial Design Size Nominal Capacity [W]", tmpNomCap); } } else { if (this->NomCap > 0.0 && tmpNomCap > 0.0) { Real64 NomCapUser = this->NomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Nominal Capacity [W]", @@ -1065,13 +1065,13 @@ namespace ChillerIndirectAbsorption { } } else { if (this->NomCapWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Absorption Chiller nominal capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Chiller:Absorption:Indirect object=" + this->Name); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->NomCap > 0.0) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "User-Specified Nominal Capacity [W]", this->NomCap); @@ -1082,22 +1082,22 @@ namespace ChillerIndirectAbsorption { // local nominal pump power Real64 tmpNomPumpPower = 0.0045 * tmpNomCap; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { // the DOE-2 EIR for single stage absorption chiller if (this->NomPumpPowerWasAutoSized) { this->NomPumpPower = tmpNomPumpPower; // 0.0045d0 * IndirectAbsorber(ChillNum)%NomCap - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Nominal Pumping Power [W]", tmpNomPumpPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Initial Design Size Nominal Pumping Power [W]", tmpNomPumpPower); } } else { if (this->NomPumpPower > 0.0 && tmpNomPumpPower > 0.0) { Real64 NomPumpPowerUser = this->NomPumpPower; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Nominal Pumping Power [W]", @@ -1126,14 +1126,14 @@ namespace ChillerIndirectAbsorption { } else { if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->EvapVolFlowRateWasAutoSized) { this->EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Initial Design Size Design Chilled Water Flow Rate [m3/s]", @@ -1142,7 +1142,7 @@ namespace ChillerIndirectAbsorption { } else { if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { Real64 EvapVolFlowRateUser = this->EvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", @@ -1169,13 +1169,13 @@ namespace ChillerIndirectAbsorption { } } else { if (this->EvapVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Absorption Chiller evap flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Chiller:Absorption:Indirect object=" + this->Name); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->EvapVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "User-Specified Design Chilled Water Flow Rate [m3/s]", this->EvapVolFlowRate); @@ -1184,7 +1184,7 @@ namespace ChillerIndirectAbsorption { } } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { PlantUtilities::RegisterPlantCompDesignFlow(this->EvapInletNodeNum, this->EvapVolFlowRate); } else { PlantUtilities::RegisterPlantCompDesignFlow(this->EvapInletNodeNum, tmpEvapVolFlowRate); @@ -1211,14 +1211,14 @@ namespace ChillerIndirectAbsorption { } else { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->CondVolFlowRateWasAutoSized) { this->CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Initial Design Size Design Condenser Water Flow Rate [m3/s]", @@ -1227,7 +1227,7 @@ namespace ChillerIndirectAbsorption { } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { Real64 CondVolFlowRateUser = this->CondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", @@ -1254,14 +1254,14 @@ namespace ChillerIndirectAbsorption { } } else { if (this->CondVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Absorption Chiller condenser flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Chiller:Absorption:Indirect object=" + this->Name); ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->CondVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, @@ -1273,7 +1273,7 @@ namespace ChillerIndirectAbsorption { } // save the design condenser water volumetric flow rate for use by the condenser water loop sizing algorithms - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { PlantUtilities::RegisterPlantCompDesignFlow(this->CondInletNodeNum, this->CondVolFlowRate); } else { PlantUtilities::RegisterPlantCompDesignFlow(this->CondInletNodeNum, tmpCondVolFlowRate); @@ -1297,16 +1297,16 @@ namespace ChillerIndirectAbsorption { RoutineName); tmpGeneratorVolFlowRate = (tmpNomCap * SteamInputRatNom) / (CpWater * SteamDeltaT * RhoWater); if (!this->GeneratorVolFlowRateWasAutoSized) tmpGeneratorVolFlowRate = this->GeneratorVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->GeneratorVolFlowRateWasAutoSized) { this->GeneratorVolFlowRate = tmpGeneratorVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Design Generator Fluid Flow Rate [m3/s]", tmpGeneratorVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Initial Design Size Design Generator Fluid Flow Rate [m3/s]", @@ -1315,7 +1315,7 @@ namespace ChillerIndirectAbsorption { } else { if (this->GeneratorVolFlowRate > 0.0 && tmpGeneratorVolFlowRate > 0.0) { Real64 GeneratorVolFlowRateUser = this->GeneratorVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Design Generator Fluid Flow Rate [m3/s]", @@ -1374,16 +1374,16 @@ namespace ChillerIndirectAbsorption { // calculate the steam volumetric flow rate tmpGeneratorVolFlowRate = SteamMassFlowRate / SteamDensity; if (!this->GeneratorVolFlowRateWasAutoSized) tmpGeneratorVolFlowRate = this->GeneratorVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->GeneratorVolFlowRateWasAutoSized) { this->GeneratorVolFlowRate = tmpGeneratorVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Design Generator Fluid Flow Rate [m3/s]", tmpGeneratorVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Initial Design Size Design Generator Fluid Flow Rate [m3/s]", @@ -1392,7 +1392,7 @@ namespace ChillerIndirectAbsorption { } else { if (this->GeneratorVolFlowRate > 0.0 && tmpGeneratorVolFlowRate > 0.0) { Real64 GeneratorVolFlowRateUser = this->GeneratorVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, "Design Size Design Generator Fluid Flow Rate [m3/s]", @@ -1421,7 +1421,7 @@ namespace ChillerIndirectAbsorption { } } else { if (this->GeneratorVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->GeneratorVolFlowRate = 0.0; } else { tmpGeneratorVolFlowRate = 0.0; @@ -1430,7 +1430,7 @@ namespace ChillerIndirectAbsorption { } } else { if (this->GeneratorVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Absorption Chiller generator flow rate requires a loop Sizing:Plant object."); ShowContinueError(state, " For steam loops, use a steam Sizing:Plant object."); ShowContinueError(state, " For hot water loops, use a heating Sizing:Plant object."); @@ -1438,7 +1438,7 @@ namespace ChillerIndirectAbsorption { ErrorsFound = true; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->GeneratorVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "Chiller:Absorption:Indirect", this->Name, @@ -1450,7 +1450,7 @@ namespace ChillerIndirectAbsorption { } // save the design steam or hot water volumetric flow rate for use by the steam or hot water loop sizing algorithms - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { PlantUtilities::RegisterPlantCompDesignFlow(this->GeneratorInletNodeNum, this->GeneratorVolFlowRate); } else { PlantUtilities::RegisterPlantCompDesignFlow(this->GeneratorInletNodeNum, tmpGeneratorVolFlowRate); @@ -1470,7 +1470,7 @@ namespace ChillerIndirectAbsorption { DataSizing::PlantSizData(PltSizHeatingNum).ExitTemp, state.dataPlnt->PlantLoop(this->GenLoopNum).FluidIndex, RoutineName); - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->GeneratorDeltaTemp = (SteamInputRatNom * this->NomCap) / (CpWater * rho * this->GeneratorVolFlowRate); } } @@ -1480,7 +1480,7 @@ namespace ChillerIndirectAbsorption { ShowFatalError(state, "Preceding sizing errors cause program termination"); } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report std::string equipName = this->Name; OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, equipName, "Chiller:Absorption:Indirect"); diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 2d997b22430..a9b52dca2ee 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -858,7 +858,7 @@ namespace ChillerReformulatedEIR { this->EquipFlowCtrl = state.dataPlnt->PlantLoop(this->CWLoopNum).LoopSide(this->CWLoopSideNum).Branch(this->CWBranchNum).Comp(this->CWCompNum).FlowCtrl; - if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, @@ -1032,16 +1032,16 @@ namespace ChillerReformulatedEIR { } else { if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->EvapVolFlowRateWasAutoSized) { this->EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Initial Design Size Reference Chilled Water Flow Rate [m3/s]", @@ -1050,7 +1050,7 @@ namespace ChillerReformulatedEIR { } else { // Hard-size with sizing data if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { Real64 EvapVolFlowRateUser = this->EvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", @@ -1076,12 +1076,12 @@ namespace ChillerReformulatedEIR { } } } else { - if (this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Reformulated Electric Chiller evap flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Reformulated Electric Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && + if (!this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { // Hard-size with sizing data BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "User-Specified Reference Chilled Water Flow Rate [m3/s]", this->EvapVolFlowRate); @@ -1116,21 +1116,21 @@ namespace ChillerReformulatedEIR { } else { if (this->RefCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->RefCapWasAutoSized) { this->RefCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Design Size Reference Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "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) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Design Size Reference Capacity [W]", @@ -1152,12 +1152,12 @@ namespace ChillerReformulatedEIR { } } } else { - if (this->RefCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->RefCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Reformulated Electric Chiller reference capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Reformulated Electric Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->RefCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->RefCap > 0.0)) { + if (!this->RefCapWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->RefCap > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "User-Specified Reference Capacity [W]", this->RefCap); } @@ -1182,16 +1182,16 @@ namespace ChillerReformulatedEIR { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; // IF (DataPlant::PlantFirstSizesOkayToFinalize) ElecReformEIRChiller(EIRChillNum)%CondVolFlowRate = tmpCondVolFlowRate } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->CondVolFlowRateWasAutoSized) { this->CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Design Size Reference Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Initial Design Size Reference Condenser Water Flow Rate [m3/s]", @@ -1200,7 +1200,7 @@ namespace ChillerReformulatedEIR { } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { Real64 CondVolFlowRateUser = this->CondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Design Size Reference Condenser Water Flow Rate [m3/s]", @@ -1226,13 +1226,13 @@ namespace ChillerReformulatedEIR { } } } else { - if (this->CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Reformulated Electric EIR Chiller condenser flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Reformulated Electric EIR Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { + if (!this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "User-Specified Reference Condenser Water Flow Rate [m3/s]", @@ -1246,16 +1246,16 @@ namespace ChillerReformulatedEIR { if (this->HeatRecActive) { Real64 tmpHeatRecVolFlowRate = tmpCondVolFlowRate * this->HeatRecCapacityFraction; if (!this->DesignHeatRecVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = this->DesignHeatRecVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->DesignHeatRecVolFlowRateWasAutoSized) { this->DesignHeatRecVolFlowRate = tmpHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Initial Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", @@ -1264,7 +1264,7 @@ namespace ChillerReformulatedEIR { } else { if (this->DesignHeatRecVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { Real64 DesignHeatRecVolFlowRateUser = this->DesignHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric:ReformulatedEIR", this->Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", @@ -1295,7 +1295,7 @@ namespace ChillerReformulatedEIR { } std::string equipName; // Name of chiller - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->MySizeFlag) { Real64 IPLV; StandardRatings::CalcChillerIPLV(state, diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 3514724743c..da46f2982f7 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -1871,7 +1871,7 @@ namespace CondenserLoopTowers { } // Begin environment initializations - if (this->envrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->envrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 const rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, @@ -2314,20 +2314,20 @@ namespace CondenserLoopTowers { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { tmpDesignWaterFlowRate = DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * this->SizFac; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; } else { tmpDesignWaterFlowRate = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { ShowSevereError(state, "Autosizing error for cooling tower object = " + this->Name); ShowFatalError(state, "Autosizing of cooling tower condenser flow rate requires a loop Sizing:Plant object."); } @@ -2339,24 +2339,24 @@ namespace CondenserLoopTowers { this->DesignWaterFlowRate = 5.382e-8 * this->TowerNominalCapacity; tmpDesignWaterFlowRate = this->DesignWaterFlowRate; if (UtilityRoutines::SameString(this->TowerType, "CoolingTower:SingleSpeed")) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Water Flow Rate based on tower nominal capacity [m3/s]", this->DesignWaterFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Water Flow Rate based on tower nominal capacity [m3/s]", this->DesignWaterFlowRate); } } else if (UtilityRoutines::SameString(this->TowerType, "CoolingTower:TwoSpeed")) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Water Flow Rate based on tower high-speed nominal capacity [m3/s]", this->DesignWaterFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Water Flow Rate based on tower high-speed nominal capacity [m3/s]", @@ -2387,32 +2387,32 @@ namespace CondenserLoopTowers { RoutineName); DesTowerLoad = rho * Cp * tmpDesignWaterFlowRate * DesTowerWaterDeltaT; tmpHighSpeedFanPower = 0.0105 * DesTowerLoad; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } else { tmpHighSpeedFanPower = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } } else { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { ShowSevereError(state, "Autosizing of cooling tower fan power requires a loop Sizing:Plant object."); ShowFatalError(state, " Occurs in cooling tower object= " + this->Name); } } } if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd || this->TowerType_Num == DataPlant::TypeOf_CoolingTower_VarSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); } } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); } @@ -2422,22 +2422,22 @@ namespace CondenserLoopTowers { if (this->HighSpeedAirFlowRateWasAutoSized) { // Plant Sizing Object is not required to AUTOSIZE this field since its simply a multiple of another field. tmpHighSpeedAirFlowRate = tmpHighSpeedFanPower * 0.5 * (101325.0 / state.dataEnvrn->StdBaroPress) / 190.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd || this->TowerType_Num == DataPlant::TypeOf_CoolingTower_VarSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); } @@ -2502,30 +2502,30 @@ namespace CondenserLoopTowers { ShowFatalError(state, "Autosizing of cooling tower UA failed for tower " + this->Name); } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedTowerUA = UA; } this->TowerNominalCapacity = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedTowerUA = 0.0; } } if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); } } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); } @@ -2606,30 +2606,30 @@ namespace CondenserLoopTowers { ShowFatalError(state, "Autosizing of cooling tower UA failed for tower " + this->Name); } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedTowerUA = UA; } this->TowerNominalCapacity = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedTowerUA = 0.0; } } if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); } } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); } @@ -2674,29 +2674,29 @@ namespace CondenserLoopTowers { ShowSevereError(state, "Bad starting values for UA"); ShowFatalError(state, "Autosizing of cooling tower UA failed for tower " + this->Name); } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedTowerUA = UA; } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedTowerUA = 0.0; } } if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedTowerUA); } } else if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedTowerUA); } @@ -2705,14 +2705,14 @@ namespace CondenserLoopTowers { if (this->LowSpeedAirFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedAirFlowRate = this->LowSpeedAirFlowRateSizingFactor * this->HighSpeedAirFlowRate; tmpLowSpeedAirFlowRate = this->LowSpeedAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Low Fan Speed Air Flow Rate [m3/s]", this->LowSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Low Fan Speed Air Flow Rate [m3/s]", this->LowSpeedAirFlowRate); } @@ -2722,25 +2722,25 @@ namespace CondenserLoopTowers { } if (this->LowSpeedFanPowerWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedFanPower = this->LowSpeedFanPowerSizingFactor * this->HighSpeedFanPower; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Fan Power at Low Fan Speed [W]", this->LowSpeedFanPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Fan Power at Low Fan Speed [W]", this->LowSpeedFanPower); } } } - if (this->LowSpeedTowerUAWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->LowSpeedTowerUAWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedTowerUA = this->LowSpeedTowerUASizingFactor * this->HighSpeedTowerUA; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at Low Fan Speed [W/K]", this->LowSpeedTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Low Fan Speed [W/K]", this->LowSpeedTowerUA); } @@ -2748,26 +2748,26 @@ namespace CondenserLoopTowers { if (this->PerformanceInputMethod_Num == PIM::NominalCapacity) { if (this->TowerLowSpeedNomCapWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerLowSpeedNomCap = this->TowerLowSpeedNomCapSizingFactor * this->TowerNominalCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Low Speed Nominal Capacity [W]", this->TowerLowSpeedNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Low Speed Nominal Capacity [W]", this->TowerLowSpeedNomCap); } } } if (this->TowerFreeConvNomCapWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerFreeConvNomCap = this->TowerFreeConvNomCapSizingFactor * this->TowerNominalCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); } @@ -2812,17 +2812,17 @@ namespace CondenserLoopTowers { ShowSevereError(state, "Bad starting values for UA"); ShowFatalError(state, "Autosizing of cooling tower UA failed for tower " + this->Name); } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedTowerUA = UA; } } else { this->LowSpeedTowerUA = 0.0; } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Low Fan Speed U-Factor Times Area Value [W/K]", this->LowSpeedTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Low Fan Speed U-Factor Times Area Value [W/K]", this->LowSpeedTowerUA); } @@ -2830,13 +2830,13 @@ namespace CondenserLoopTowers { if (this->FreeConvAirFlowRateWasAutoSized) { this->FreeConvAirFlowRate = this->FreeConvAirFlowRateSizingFactor * tmpHighSpeedAirFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FreeConvAirFlowRate = this->FreeConvAirFlowRateSizingFactor * this->HighSpeedAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); } @@ -2844,13 +2844,13 @@ namespace CondenserLoopTowers { } if (this->FreeConvTowerUAWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FreeConvTowerUA = this->FreeConvTowerUASizingFactor * this->HighSpeedTowerUA; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Free Convection U-Factor Times Area Value [W/K]", this->FreeConvTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Free Convection U-Factor Times Area Value [W/K]", this->FreeConvTowerUA); } @@ -2913,17 +2913,17 @@ namespace CondenserLoopTowers { } ShowFatalError(state, "Autosizing of cooling tower UA failed for tower " + this->Name); } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FreeConvTowerUA = UA; } } else { this->FreeConvTowerUA = 0.0; } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); } @@ -3008,36 +3008,36 @@ namespace CondenserLoopTowers { RoutineName); this->TowerNominalCapacity = ((rho * tmpDesignWaterFlowRate) * Cp * this->DesignRange); - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); } this->FreeConvAirFlowRate = this->MinimumVSAirFlowFrac * this->HighSpeedAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Air Flow Rate in free convection regime [m3/s]", this->FreeConvAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Air Flow Rate in free convection regime [m3/s]", this->FreeConvAirFlowRate); } this->TowerFreeConvNomCap = this->TowerNominalCapacity * this->FreeConvectionCapacityFraction; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Tower capacity in free convection regime at design conditions [W]", this->TowerFreeConvNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Tower capacity in free convection regime at design conditions [W]", this->TowerFreeConvNomCap); } } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->Name, this->TowerType); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, this->Name, this->TowerNominalCapacity); @@ -3045,7 +3045,7 @@ namespace CondenserLoopTowers { // input error checking bool ErrorsFound = false; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->TowerType_Num == DataPlant::TypeOf_CoolingTower_SingleSpd) { if (this->DesignWaterFlowRate > 0.0) { if (this->FreeConvAirFlowRate >= this->HighSpeedAirFlowRate) { @@ -3217,19 +3217,19 @@ namespace CondenserLoopTowers { if (this->TowerNominalCapacityWasAutoSized) tmpNomTowerCap = 0.0; } } else { // do not have enough data to size. - if (DataPlant::PlantFirstSizesOkayToFinalize && this->TowerNominalCapacityWasAutoSized) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize && this->TowerNominalCapacityWasAutoSized) { ShowSevereError(state, "Autosizing error for cooling tower object = " + this->Name); ShowFatalError(state, "Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object."); } } } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->TowerNominalCapacityWasAutoSized) { this->TowerNominalCapacity = tmpNomTowerCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Nominal Capacity [W]", tmpNomTowerCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Nominal Capacity [W]", this->TowerNominalCapacity); } @@ -3237,7 +3237,7 @@ namespace CondenserLoopTowers { if (this->TowerNominalCapacity > 0.0 && tmpNomTowerCap > 0.0) { Real64 NomCapUser(0.0); NomCapUser = this->TowerNominalCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Nominal Capacity [W]", @@ -3260,14 +3260,14 @@ namespace CondenserLoopTowers { } tmpTowerFreeConvNomCap = tmpNomTowerCap * this->TowerFreeConvNomCapSizingFactor; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->TowerFreeConvNomCapWasAutoSized) { this->TowerFreeConvNomCap = tmpTowerFreeConvNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); } @@ -3275,7 +3275,7 @@ namespace CondenserLoopTowers { if (this->TowerFreeConvNomCap > 0.0 && tmpTowerFreeConvNomCap > 0.0) { Real64 NomCapUser(0.0); NomCapUser = this->TowerFreeConvNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Free Convection Nominal Capacity [W]", @@ -3300,16 +3300,16 @@ namespace CondenserLoopTowers { } tmpDesignWaterFlowRate = tmpNomTowerCap * this->DesignWaterFlowPerUnitNomCap; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->DesignWaterFlowRateWasAutoSized) { // for nominal cap input method, get design water flow rate from nominal cap and scalable sizing factor this->DesignWaterFlowRate = tmpDesignWaterFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } @@ -3318,7 +3318,7 @@ namespace CondenserLoopTowers { if (this->DesignWaterFlowRate > 0.0 && tmpDesignWaterFlowRate > 0.0) { Real64 NomDesWaterFlowUser(0.0); NomDesWaterFlowUser = this->DesignWaterFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Water Flow Rate [m3/s]", @@ -3348,21 +3348,21 @@ namespace CondenserLoopTowers { } else { tmpDesignAirFlowRate = tmpNomTowerCap * this->DesignAirFlowPerUnitNomCap; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->HighSpeedAirFlowRateWasAutoSized) { this->HighSpeedAirFlowRate = tmpDesignAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } } else { // Hard-sized with sizing data Real64 DesignAirFlowRateUser(0.0); DesignAirFlowRateUser = this->HighSpeedAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Air Flow Rate [m3/s]", @@ -3385,21 +3385,21 @@ namespace CondenserLoopTowers { } tmpFreeConvAirFlowRate = tmpDesignAirFlowRate * this->FreeConvAirFlowRateSizingFactor; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->FreeConvAirFlowRateWasAutoSized) { this->FreeConvAirFlowRate = tmpFreeConvAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); } } else { // Hard-sized with sizing data Real64 FreeConvAirFlowUser(0.0); FreeConvAirFlowUser = this->FreeConvAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Free Convection Regime Air Flow Rate [m3/s]", @@ -3426,7 +3426,7 @@ namespace CondenserLoopTowers { } // now calcuate UA values from nominal capacities and flow rates - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (PltSizCondNum > 0) { // user has a plant sizing object Cp = FluidProperties::GetSpecificHeatGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, @@ -3471,11 +3471,11 @@ namespace CondenserLoopTowers { ShowFatalError(state, "Autosizing of cooling tower UA failed for tower " + this->Name); } this->HighSpeedTowerUA = UA; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", this->HighSpeedTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", this->HighSpeedTowerUA); } @@ -3503,11 +3503,11 @@ namespace CondenserLoopTowers { ShowFatalError(state, "Autosizing of cooling tower UA failed for free convection tower " + this->Name); } this->FreeConvTowerUA = UA; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", @@ -3522,13 +3522,13 @@ namespace CondenserLoopTowers { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { tmpDesignWaterFlowRate = DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * this->SizFac; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->DesignWaterFlowRate = tmpDesignWaterFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } @@ -3540,13 +3540,13 @@ namespace CondenserLoopTowers { } else { if (!this->TowerInletCondsAutoSize) { if (this->DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->DesignWaterFlowRate = tmpDesignWaterFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } @@ -3555,7 +3555,7 @@ namespace CondenserLoopTowers { tmpDesignWaterFlowRate = 0.0; } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing error for cooling tower object = " + this->Name); ShowFatalError(state, "Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object."); } @@ -3580,26 +3580,26 @@ namespace CondenserLoopTowers { RoutineName); DesTowerLoad = rho * Cp * DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT * this->SizFac; tmpNomTowerCap = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); } } } else { tmpNomTowerCap = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); } @@ -3620,33 +3620,33 @@ namespace CondenserLoopTowers { RoutineName); DesTowerLoad = rho * Cp * this->DesignWaterFlowRate * DesTowerWaterDeltaT * this->SizFac; tmpNomTowerCap = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); } } } else { tmpNomTowerCap = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); } } } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing error for cooling tower object = " + this->Name); ShowFatalError(state, "Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object."); } @@ -3654,13 +3654,13 @@ namespace CondenserLoopTowers { } if (this->TowerFreeConvNomCapWasAutoSized) { tmpTowerFreeConvNomCap = tmpNomTowerCap * this->TowerFreeConvNomCapSizingFactor; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerFreeConvNomCap = tmpTowerFreeConvNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); } @@ -3672,13 +3672,13 @@ namespace CondenserLoopTowers { } else { tmpDesignAirFlowRate = tmpNomTowerCap * this->DesignAirFlowPerUnitNomCap; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedAirFlowRate = tmpDesignAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } @@ -3686,20 +3686,20 @@ namespace CondenserLoopTowers { } if (this->FreeConvAirFlowRateWasAutoSized) { tmpFreeConvAirFlowRate = tmpDesignAirFlowRate * this->FreeConvAirFlowRateSizingFactor; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FreeConvAirFlowRate = tmpFreeConvAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); } } } // now calcuate UA values from nominal capacities and flow rates - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, DataGlobalConstants::InitConvTemp, @@ -3733,11 +3733,11 @@ namespace CondenserLoopTowers { ShowFatalError(state, "Autosizing of cooling tower UA failed for tower " + this->Name); } this->HighSpeedTowerUA = UA; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", this->HighSpeedTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", @@ -3766,11 +3766,11 @@ namespace CondenserLoopTowers { ShowFatalError(state, "Autosizing of cooling tower UA failed for free convection tower " + this->Name); } this->LowSpeedTowerUA = UA; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", @@ -3781,15 +3781,15 @@ namespace CondenserLoopTowers { } else { // full speed UA given if (this->FreeConvTowerUAWasAutoSized) { // determine from scalable sizing factor - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FreeConvTowerUA = this->HighSpeedTowerUA * this->FreeConvTowerUASizingFactor; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", this->FreeConvTowerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", @@ -3815,26 +3815,26 @@ namespace CondenserLoopTowers { RoutineName); DesTowerLoad = rho * Cp * DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT; tmpNomTowerCap = DesTowerLoad / this->HeatRejectCapNomCapSizingRatio; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); } } } else { tmpNomTowerCap = rho = Cp = 0.0; // rho and Cp added: Used below - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); } @@ -3843,7 +3843,7 @@ namespace CondenserLoopTowers { } else { tmpNomTowerCap = 0.0; // Suppress uninitialized warnings - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing error for cooling tower object = " + this->Name); ShowFatalError(state, "Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object."); } @@ -3854,13 +3854,13 @@ namespace CondenserLoopTowers { } else { tmpDesignAirFlowRate = tmpNomTowerCap * this->DesignAirFlowPerUnitNomCap; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedAirFlowRate = tmpDesignAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } @@ -3888,12 +3888,12 @@ namespace CondenserLoopTowers { this->calculateSimpleTowerOutletTemp(state, rho * tmpDesignWaterFlowRate, this->HighSpeedAirFlowRate, this->HighSpeedTowerUA); tmpNomTowerCap = Cp * rho * tmpDesignWaterFlowRate * (this->WaterTemp - OutWaterTemp); tmpNomTowerCap /= this->HeatRejectCapNomCapSizingRatio; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerNominalCapacity = tmpNomTowerCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Nominal Capacity [W]", this->TowerNominalCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Nominal Capacity [W]", this->TowerNominalCapacity); } @@ -3903,13 +3903,13 @@ namespace CondenserLoopTowers { if (this->FreeConvAirFlowRateWasAutoSized) { tmpFreeConvAirFlowRate = tmpDesignAirFlowRate * this->FreeConvAirFlowRateSizingFactor; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FreeConvAirFlowRate = tmpFreeConvAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Free Convection Regime Air Flow Rate [m3/s]", this->FreeConvAirFlowRate); } @@ -3919,13 +3919,13 @@ namespace CondenserLoopTowers { OutWaterTemp = this->calculateSimpleTowerOutletTemp(state, rho * tmpDesignWaterFlowRate, tmpFreeConvAirFlowRate, this->FreeConvTowerUA); tmpTowerFreeConvNomCap = Cp * rho * tmpDesignWaterFlowRate * (this->WaterTemp - OutWaterTemp); tmpTowerFreeConvNomCap /= this->HeatRejectCapNomCapSizingRatio; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->TowerFreeConvNomCap = tmpTowerFreeConvNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Free Convection Nominal Capacity [W]", this->TowerFreeConvNomCap); } @@ -3934,20 +3934,20 @@ namespace CondenserLoopTowers { } tmpHighSpeedFanPower = tmpNomTowerCap * this->DesignFanPowerPerUnitNomCap; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->HighSpeedFanPowerWasAutoSized) { this->HighSpeedFanPower = tmpHighSpeedFanPower; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Fan Power [W]", this->HighSpeedFanPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Initial Design Fan Power [W]", this->HighSpeedFanPower); } } else { // Hard-sized with sizing data Real64 HighSpeedFanPowerUser(0.0); HighSpeedFanPowerUser = this->HighSpeedAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->TowerType, this->Name, "Design Fan Power [W]", diff --git a/src/EnergyPlus/ElectricPowerServiceManager.cc b/src/EnergyPlus/ElectricPowerServiceManager.cc index 22c8aa5d385..c19ef17d67f 100644 --- a/src/EnergyPlus/ElectricPowerServiceManager.cc +++ b/src/EnergyPlus/ElectricPowerServiceManager.cc @@ -2175,7 +2175,7 @@ void GeneratorController::simGeneratorGetPowerOutput(EnergyPlusData &state, // simulate dynamic_cast (thisMCHP)->InitMicroCHPNoNormalizeGenerators(state); - if (!DataPlant::PlantFirstSizeCompleted) break; + if (!state.dataPlnt->PlantFirstSizeCompleted) break; dynamic_cast (thisMCHP)->CalcMicroCHPNoNormalizeGeneratorModel(state, runFlag, diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 140c0c88352..6ec2afb5308 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -1115,7 +1115,7 @@ namespace EvaporativeFluidCoolers { } // Begin environment initializations - if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, @@ -1217,24 +1217,24 @@ namespace EvaporativeFluidCoolers { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { tmpDesignWaterFlowRate = DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * this->SizFac; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; } else { tmpDesignWaterFlowRate = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing error for evaporative fluid cooler object = " + this->Name); ShowFatalError(state, "Autosizing of evaporative fluid cooler condenser flow rate requires a loop Sizing:Plant object."); } @@ -1283,16 +1283,16 @@ namespace EvaporativeFluidCoolers { if (this->PerformanceInputMethod_Num == PIM::StandardDesignCapacity) { // Design water flow rate is assumed to be 3 gpm per ton (SI equivalent 5.382E-8 m3/s per watt) tmpDesignWaterFlowRate = 5.382e-8 * this->HighSpeedStandardDesignCapacity; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->DesignWaterFlowRate = tmpDesignWaterFlowRate; if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "Design Water Flow Rate based on evaporative fluid cooler Standard Design Capacity [m3/s]", this->DesignWaterFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, @@ -1300,14 +1300,14 @@ namespace EvaporativeFluidCoolers { this->DesignWaterFlowRate); } } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "Design Water Flow Rate based on evaporative fluid cooler high-speed Standard Design Capacity [m3/s]", this->DesignWaterFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, @@ -1324,14 +1324,14 @@ namespace EvaporativeFluidCoolers { // We assume the nominal fan power is 0.0105 times the design load if (this->PerformanceInputMethod_Num == PIM::StandardDesignCapacity) { tmpHighSpeedFanPower = 0.0105 * this->HighSpeedStandardDesignCapacity; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } else if (this->PerformanceInputMethod_Num == PIM::UserSpecifiedDesignCapacity) { tmpHighSpeedFanPower = 0.0105 * this->HighSpeedUserSpecifiedDesignCapacity; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } else { if (DesEvapFluidCoolerLoad > 0) { tmpHighSpeedFanPower = 0.0105 * DesEvapFluidCoolerLoad; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } else if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { Real64 rho = FluidProperties::GetDensityGlycol(state, @@ -1346,34 +1346,34 @@ namespace EvaporativeFluidCoolers { CalledFrom); DesEvapFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; tmpHighSpeedFanPower = 0.0105 * DesEvapFluidCoolerLoad; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } else { tmpHighSpeedFanPower = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of evaporative fluid cooler fan power requires a loop Sizing:Plant object."); ShowFatalError(state, " Occurs in evaporative fluid cooler object= " + this->Name); } } } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "Initial Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); } } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "Initial Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); } @@ -1385,24 +1385,24 @@ namespace EvaporativeFluidCoolers { // Plant Sizing Object is not required to AUTOSIZE this field since its simply a multiple of another field. tmpHighSpeedAirFlowRate = tmpHighSpeedFanPower * 0.5 * (101325.0 / state.dataEnvrn->StdBaroPress) / 190.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "Initial Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); } @@ -1413,7 +1413,7 @@ namespace EvaporativeFluidCoolers { auto boundUAResidualFunc = std::bind(&EvapFluidCoolerSpecs::SimpleEvapFluidCoolerUAResidual, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3); - if (this->HighSpeedEvapFluidCoolerUAWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize && + if (this->HighSpeedEvapFluidCoolerUAWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize && this->PerformanceInputMethod_Num == PIM::UFactor) { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { @@ -1503,33 +1503,33 @@ namespace EvaporativeFluidCoolers { state, format("Calculated water outlet temperature at high UA [C](UA = {:.2R} W/C) = {:.2R}", UA1, OutWaterTempAtUA1)); ShowFatalError(state, "Autosizing of Evaporative Fluid Cooler UA failed for Evaporative Fluid Cooler = " + this->Name); } - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedEvapFluidCoolerUA = UA; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedEvapFluidCoolerUA = UA; this->HighSpeedStandardDesignCapacity = DesEvapFluidCoolerLoad / this->HeatRejectCapNomCapSizingRatio; } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedEvapFluidCoolerUA = 0.0; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedEvapFluidCoolerUA = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedEvapFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedEvapFluidCoolerUA); } } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedEvapFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", @@ -1538,7 +1538,7 @@ namespace EvaporativeFluidCoolers { } } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing error for evaporative fluid cooler object = " + this->Name); ShowFatalError(state, "Autosizing of evaporative fluid cooler UA requires a loop Sizing:Plant object."); } @@ -1583,28 +1583,28 @@ namespace EvaporativeFluidCoolers { } else { this->HighSpeedEvapFluidCoolerUA = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedEvapFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedEvapFluidCoolerUA); } } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedEvapFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", @@ -1689,28 +1689,28 @@ namespace EvaporativeFluidCoolers { } else { this->HighSpeedEvapFluidCoolerUA = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_SingleSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedEvapFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_SingleSpeed, this->Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", this->HighSpeedEvapFluidCoolerUA); } } else if (this->TypeOf_Num == DataPlant::TypeOf_EvapFluidCooler_TwoSpd) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "U-Factor Times Area Value at High Fan Speed [W/C]", this->HighSpeedEvapFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cEvapFluidCooler_TwoSpeed, this->Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", @@ -1720,35 +1720,35 @@ namespace EvaporativeFluidCoolers { } } - if (this->LowSpeedAirFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->LowSpeedAirFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedAirFlowRate = this->LowSpeedAirFlowRateSizingFactor * this->HighSpeedAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "Air Flow Rate at Low Fan Speed [m3/s]", this->LowSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "Initial Air Flow Rate at Low Fan Speed [m3/s]", this->LowSpeedAirFlowRate); } } - if (this->LowSpeedFanPowerWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->LowSpeedFanPowerWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedFanPower = this->LowSpeedFanPowerSizingFactor * this->HighSpeedFanPower; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "Fan Power at Low Fan Speed [W]", this->LowSpeedFanPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "Initial Fan Power at Low Fan Speed [W]", this->LowSpeedFanPower); } } - if (this->LowSpeedEvapFluidCoolerUAWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->LowSpeedEvapFluidCoolerUAWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedEvapFluidCoolerUA = this->LowSpeedEvapFluidCoolerUASizingFactor * this->HighSpeedEvapFluidCoolerUA; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "U-Factor Times Area Value at Low Fan Speed [W/C]", this->LowSpeedEvapFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "Initial U-Factor Times Area Value at Low Fan Speed [W/C]", @@ -1797,12 +1797,12 @@ namespace EvaporativeFluidCoolers { } else { this->LowSpeedEvapFluidCoolerUA = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "U-Factor Times Area Value at Low Fan Speed [W/C]", this->LowSpeedEvapFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "Initial U-Factor Times Area Value at Low Fan Speed [W/C]", @@ -1870,12 +1870,12 @@ namespace EvaporativeFluidCoolers { } else { this->LowSpeedEvapFluidCoolerUA = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "U-Factor Times Area Value at Low Fan Speed [W/C]", this->LowSpeedEvapFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->EvapFluidCoolerType, this->Name, "Initial U-Factor Times Area Value at Low Fan Speed [W/C]", @@ -1884,7 +1884,7 @@ namespace EvaporativeFluidCoolers { } } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report std::string equipName = this->Name; OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, equipName, this->EvapFluidCoolerType); diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index 53ad8d109c9..d60b040e00b 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -732,7 +732,7 @@ namespace FluidCoolers { } // Begin environment initializations - if (this->beginEnvrnInit && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->beginEnvrnInit && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 const rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->LoopNum).FluidName, @@ -833,29 +833,29 @@ namespace FluidCoolers { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { tmpDesignWaterFlowRate = DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; } else { tmpDesignWaterFlowRate = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DesignWaterFlowRate = tmpDesignWaterFlowRate; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Design Water Flow Rate [m3/s]", this->DesignWaterFlowRate); } } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing error for fluid cooler object = " + this->Name); ShowFatalError(state, "Autosizing of fluid cooler condenser flow rate requires a loop Sizing:Plant object."); } } // This conditional statement is to trap when the user specified Condenser/Fluid Cooler water design setpoint // temperature is less than design inlet air dry bulb temperature - if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && DataPlant::PlantFirstSizesOkayToFinalize) { + if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Error when autosizing the UA value for fluid cooler = " + this->Name + '.'); ShowContinueError(state, format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb temperature " @@ -885,9 +885,9 @@ namespace FluidCoolers { state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, CalledFrom); DesFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->FluidCoolerNominalCapacity = DesFluidCoolerLoad; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->FluidCoolerNominalCapacity = DesFluidCoolerLoad; } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) this->FluidCoolerNominalCapacity = 0.0; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->FluidCoolerNominalCapacity = 0.0; } } @@ -895,17 +895,17 @@ namespace FluidCoolers { // We assume the nominal fan power is 0.0105 times the design load if (this->PerformanceInputMethod_Num == PerfInputMethod::NOMINAL_CAPACITY) { tmpHighSpeedFanPower = 0.0105 * this->FluidCoolerNominalCapacity; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } else { if (DesFluidCoolerLoad > 0.0) { tmpHighSpeedFanPower = 0.0105 * DesFluidCoolerLoad; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } else if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { // This conditional statement is to trap when the user specified Condenser/Fluid Cooler water design setpoint // temperature is less than design inlet air dry bulb temperature if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && - DataPlant::PlantFirstSizesOkayToFinalize) { + state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Error when autosizing the UA value for fluid cooler = " + this->Name + '.'); ShowContinueError(state, format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb " @@ -930,35 +930,35 @@ namespace FluidCoolers { CalledFrom); DesFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; tmpHighSpeedFanPower = 0.0105 * DesFluidCoolerLoad; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } else { tmpHighSpeedFanPower = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFanPower = tmpHighSpeedFanPower; } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of fluid cooler fan power requires a loop Sizing:Plant object."); ShowFatalError(state, " Occurs in fluid cooler object = " + this->Name); } } } if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_SingleSpd) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Fan Power at Design Air Flow Rate [W]", this->HighSpeedFanPower); } } } else if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Fan Power at High Fan Speed [W]", this->HighSpeedFanPower); } @@ -969,17 +969,17 @@ namespace FluidCoolers { if (this->HighSpeedAirFlowRateWasAutoSized) { if (this->PerformanceInputMethod_Num == PerfInputMethod::NOMINAL_CAPACITY) { tmpHighSpeedAirFlowRate = this->FluidCoolerNominalCapacity / (this->DesignEnteringWaterTemp - this->DesignEnteringAirTemp) * 4.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; } else { if (DesFluidCoolerLoad > 0.0) { tmpHighSpeedAirFlowRate = DesFluidCoolerLoad / (this->DesignEnteringWaterTemp - this->DesignEnteringAirTemp) * 4.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; } else if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { // This conditional statement is to trap when the user specified Condenser/Fluid Cooler water design setpoint // temperature is less than design inlet air dry bulb temperature if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && - DataPlant::PlantFirstSizesOkayToFinalize) { + state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Error when autosizing the UA value for fluid cooler = " + this->Name + '.'); ShowContinueError(state, format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb " @@ -1004,35 +1004,35 @@ namespace FluidCoolers { CalledFrom); DesFluidCoolerLoad = rho * Cp * tmpDesignWaterFlowRate * DataSizing::PlantSizData(PltSizCondNum).DeltaT; tmpHighSpeedAirFlowRate = DesFluidCoolerLoad / (this->DesignEnteringWaterTemp - this->DesignEnteringAirTemp) * 4.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; } else { tmpHighSpeedAirFlowRate = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of fluid cooler air flow rate requires a loop Sizing:Plant object"); ShowFatalError(state, " Occurs in fluid cooler object = " + this->Name); } } } if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_SingleSpd) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Design Air Flow Rate [m3/s]", this->HighSpeedAirFlowRate); } } } else if (this->FluidCoolerType == "FluidCooler:TwoSpeed") { - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Air Flow Rate at High Fan Speed [m3/s]", this->HighSpeedAirFlowRate); } @@ -1040,12 +1040,12 @@ namespace FluidCoolers { } } - if (this->HighSpeedFluidCoolerUAWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->HighSpeedFluidCoolerUAWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (PltSizCondNum > 0) { if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { // This conditional statement is to trap when the user specified Condenser/Fluid Cooler water design setpoint // temperature is less than design inlet air dry bulb temperature - if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && DataPlant::PlantFirstSizesOkayToFinalize) { + if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= this->DesignEnteringAirTemp && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Error when autosizing the UA value for fluid cooler = " + this->Name + '.'); ShowContinueError(state, format("Design Loop Exit Temperature ({:.2R} C) must be greater than design entering air dry-bulb " @@ -1121,21 +1121,21 @@ namespace FluidCoolers { ShowFatalError(state, "Autosizing of Fluid Cooler UA failed for fluid cooler = " + this->Name); } tmpHighSpeedEvapFluidCoolerUA = UA; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFluidCoolerUA = tmpHighSpeedEvapFluidCoolerUA; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFluidCoolerUA = tmpHighSpeedEvapFluidCoolerUA; this->FluidCoolerNominalCapacity = DesFluidCoolerLoad; } else { tmpHighSpeedEvapFluidCoolerUA = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFluidCoolerUA = tmpHighSpeedEvapFluidCoolerUA; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFluidCoolerUA = tmpHighSpeedEvapFluidCoolerUA; } if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_SingleSpd) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "U-factor Times Area Value at Design Air Flow Rate [W/K]", this->HighSpeedFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial U-factor Times Area Value at Design Air Flow Rate [W/K]", @@ -1143,12 +1143,12 @@ namespace FluidCoolers { } } } else if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "U-factor Times Area Value at High Fan Speed [W/K]", this->HighSpeedFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial U-factor Times Area Value at High Fan Speed [W/K]", @@ -1157,7 +1157,7 @@ namespace FluidCoolers { } } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing error for fluid cooler object = " + this->Name); ShowFatalError(state, "Autosizing of fluid cooler UA requires a loop Sizing:Plant object."); } @@ -1233,19 +1233,19 @@ namespace FluidCoolers { ShowFatalError(state, "Autosizing of Fluid Cooler UA failed for fluid cooler = " + this->Name); } } - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFluidCoolerUA = UA; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFluidCoolerUA = UA; } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) this->HighSpeedFluidCoolerUA = 0.0; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->HighSpeedFluidCoolerUA = 0.0; } if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_SingleSpd) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Fluid cooler UA value at design air flow rate based on nominal capacity input [W/K]", this->HighSpeedFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Fluid cooler UA value at design air flow rate based on nominal capacity input [W/K]", @@ -1253,14 +1253,14 @@ namespace FluidCoolers { } } } else if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Fluid cooler UA value at high fan speed based on nominal capacity input [W/K]", this->HighSpeedFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Fluid cooler UA value at high fan speed based on nominal capacity input [W/K]", @@ -1270,34 +1270,34 @@ namespace FluidCoolers { } } - if (this->LowSpeedAirFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->LowSpeedAirFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedAirFlowRate = this->LowSpeedAirFlowRateSizingFactor * this->HighSpeedAirFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Air Flow Rate at Low Fan Speed [m3/s]", this->LowSpeedAirFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Air Flow Rate at Low Fan Speed [m3/s]", this->LowSpeedAirFlowRate); } } - if (this->LowSpeedFanPowerWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->LowSpeedFanPowerWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedFanPower = this->LowSpeedFanPowerSizingFactor * this->HighSpeedFanPower; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Fan Power at Low Fan Speed [W]", this->LowSpeedFanPower); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Fan Power at Low Fan Speed [W]", this->LowSpeedFanPower); } } - if (this->LowSpeedFluidCoolerUAWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->LowSpeedFluidCoolerUAWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->LowSpeedFluidCoolerUA = this->LowSpeedFluidCoolerUASizingFactor * this->HighSpeedFluidCoolerUA; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "U-factor Times Area Value at Low Fan Speed [W/K]", this->LowSpeedFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial U-factor Times Area Value at Low Fan Speed [W/K]", this->LowSpeedFluidCoolerUA); } @@ -1305,13 +1305,13 @@ namespace FluidCoolers { if (this->PerformanceInputMethod_Num == PerfInputMethod::NOMINAL_CAPACITY && this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd) { - if (this->FluidCoolerLowSpeedNomCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->FluidCoolerLowSpeedNomCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->FluidCoolerLowSpeedNomCap = this->FluidCoolerLowSpeedNomCapSizingFactor * this->FluidCoolerNominalCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Low Fan Speed Nominal Capacity [W]", this->FluidCoolerLowSpeedNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial Low Fan Speed Nominal Capacity [W]", this->FluidCoolerLowSpeedNomCap); } @@ -1378,16 +1378,16 @@ namespace FluidCoolers { ShowContinueError(state, format("Calculated water outlet temp at high UA [C](UA = {:.2R} W/C) = {:.2R}", UA1, OutWaterTempAtUA1)); ShowFatalError(state, "Autosizing of Fluid Cooler UA failed for fluid cooler = " + this->Name); } - if (DataPlant::PlantFirstSizesOkayToFinalize) this->LowSpeedFluidCoolerUA = UA; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->LowSpeedFluidCoolerUA = UA; } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) this->LowSpeedFluidCoolerUA = 0.0; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->LowSpeedFluidCoolerUA = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "U-factor Times Area Value at Low Fan Speed [W/C]", this->LowSpeedFluidCoolerUA); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->FluidCoolerType, this->Name, "Initial U-factor Times Area Value at Low Fan Speed [W/C]", this->LowSpeedFluidCoolerUA); } @@ -1396,14 +1396,14 @@ namespace FluidCoolers { ErrorsFound = false; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report equipName = this->Name; OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, equipName, this->FluidCoolerType); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, equipName, this->FluidCoolerNominalCapacity); } - if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->FluidCoolerType_Num == DataPlant::TypeOf_FluidCooler_TwoSpd && state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->DesignWaterFlowRate > 0.0) { if (this->HighSpeedAirFlowRate <= this->LowSpeedAirFlowRate) { ShowSevereError(state, "FluidCooler:TwoSpeed \"" + this->Name + diff --git a/src/EnergyPlus/HVACInterfaceManager.cc b/src/EnergyPlus/HVACInterfaceManager.cc index 2c3dc16ee8b..f2f879577d9 100644 --- a/src/EnergyPlus/HVACInterfaceManager.cc +++ b/src/EnergyPlus/HVACInterfaceManager.cc @@ -937,7 +937,7 @@ namespace HVACInterfaceManager { // One time call to set up report variables and set common pipe 'type' flag if (OneTimeData) { if (!CommonPipeSetupFinished) SetupCommonPipes(state); - MyEnvrnFlag.dimension(TotNumLoops, true); + MyEnvrnFlag.dimension(state.dataPlnt->TotNumLoops, true); OneTimeData = false; } @@ -1048,7 +1048,6 @@ namespace HVACInterfaceManager { using DataPlant::DeltaTempTol; using DataPlant::DemandSide; using DataPlant::SupplySide; - using DataPlant::TotNumLoops; using PlantUtilities::SetActuatedBranchFlowRate; // Locals @@ -1097,7 +1096,7 @@ namespace HVACInterfaceManager { // one time setups if (OneTimeData) { if (!CommonPipeSetupFinished) SetupCommonPipes(state); - MyEnvrnFlag.dimension(TotNumLoops, true); + MyEnvrnFlag.dimension(state.dataPlnt->TotNumLoops, true); OneTimeData = false; } @@ -1318,9 +1317,9 @@ namespace HVACInterfaceManager { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int CurLoopNum; // local do loop counter - PlantCommonPipe.allocate(TotNumLoops); + PlantCommonPipe.allocate(state.dataPlnt->TotNumLoops); - for (CurLoopNum = 1; CurLoopNum <= TotNumLoops; ++CurLoopNum) { + for (CurLoopNum = 1; CurLoopNum <= state.dataPlnt->TotNumLoops; ++CurLoopNum) { // reference to easily lookup the first item once auto &first_demand_component_typenum(state.dataPlnt->PlantLoop(CurLoopNum).LoopSide(DemandSide).Branch(1).Comp(1).TypeOf_Num); diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index b27b312e03e..0d57bb1dad7 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -655,13 +655,10 @@ namespace HVACManager { using DataPlant::ConvergenceHistoryARR; using DataPlant::DemandSide; using DataPlant::NumConvergenceHistoryTerms; - using DataPlant::PlantManageHalfLoopCalls; - using DataPlant::PlantManageSubIterations; using DataPlant::square_sum_ConvergenceHistoryARR; using DataPlant::sum_ConvergenceHistoryARR; using DataPlant::sum_square_ConvergenceHistoryARR; using DataPlant::SupplySide; - using DataPlant::TotNumLoops; using EMSManager::ManageEMS; using General::CreateSysTimeIntervalString; @@ -757,8 +754,8 @@ namespace HVACManager { // The plant loop 'get inputs' and initialization are also done here in order to allow plant loop connected components // simulated by managers other than the plant manager to run correctly. HVACManageIteration = 0; - PlantManageSubIterations = 0; - PlantManageHalfLoopCalls = 0; + state.dataPlnt->PlantManageSubIterations = 0; + state.dataPlnt->PlantManageHalfLoopCalls = 0; SetAllPlantSimFlagsToValue(state, true); if (!SimHVACIterSetup) { SetupOutputVariable(state, "HVAC System Solver Iteration Count", OutputProcessor::Unit::None, HVACManageIteration, "HVAC", "Sum", "SimHVAC"); @@ -778,7 +775,7 @@ namespace HVACManager { ManageSetPoints(state); // need to call this before getting plant loop data so setpoint checks can complete okay GetPlantLoopData(state); GetPlantInput(state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(state); SetupBranchControlTypes(state); // new routine to do away with input for branch control type // CALL CheckPlantLoopData SetupReports(state); @@ -786,12 +783,12 @@ namespace HVACManager { SetupPlantEMSActuators(state); } - if (TotNumLoops > 0) { + if (state.dataPlnt->TotNumLoops > 0) { SetupOutputVariable(state, - "Plant Solver Sub Iteration Count", OutputProcessor::Unit::None, PlantManageSubIterations, "HVAC", "Sum", "SimHVAC"); + "Plant Solver Sub Iteration Count", OutputProcessor::Unit::None, state.dataPlnt->PlantManageSubIterations, "HVAC", "Sum", "SimHVAC"); SetupOutputVariable(state, - "Plant Solver Half Loop Calls Count", OutputProcessor::Unit::None, PlantManageHalfLoopCalls, "HVAC", "Sum", "SimHVAC"); - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + "Plant Solver Half Loop Calls Count", OutputProcessor::Unit::None, state.dataPlnt->PlantManageHalfLoopCalls, "HVAC", "Sum", "SimHVAC"); + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { // init plant sizing numbers in main plant data structure InitOneTimePlantSizingInfo(state, LoopNum); } @@ -947,7 +944,7 @@ namespace HVACManager { } // DSU Test plant loop for errors - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (LoopSide = DemandSide; LoopSide <= SupplySide; ++LoopSide) { CheckPlantMixerSplitterConsistency(state, LoopNum, LoopSide, FirstHVACIteration); CheckForRunawayPlantTemps(state, LoopNum, LoopSide); @@ -1327,7 +1324,7 @@ namespace HVACManager { } // loop over zone inlet nodes } // loop over zones - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { if (state.dataConvergeParams->PlantConvergence(LoopNum).PlantMassFlowNotConverged) { ShowContinueError(state, "Plant System Named = " + state.dataPlnt->PlantLoop(LoopNum).Name + " did not converge for mass flow rate"); diff --git a/src/EnergyPlus/HVACSizingSimulationManager.cc b/src/EnergyPlus/HVACSizingSimulationManager.cc index 8cc4b9db533..081b842ed7b 100644 --- a/src/EnergyPlus/HVACSizingSimulationManager.cc +++ b/src/EnergyPlus/HVACSizingSimulationManager.cc @@ -93,7 +93,6 @@ void HVACSizingSimulationManager::DetermineSizingAnalysesNeeded(EnergyPlusData & void HVACSizingSimulationManager::CreateNewCoincidentPlantAnalysisObject(EnergyPlusData &state, std::string const &PlantLoopName, int const PlantSizingIndex) { using DataPlant::SupplySide; - using DataPlant::TotNumLoops; using namespace FluidProperties; using DataSizing::PlantSizData; @@ -101,7 +100,7 @@ void HVACSizingSimulationManager::CreateNewCoincidentPlantAnalysisObject(EnergyP Real64 cp; // find plant loop number - for (int i = 1; i <= TotNumLoops; ++i) { + for (int i = 1; i <= state.dataPlnt->TotNumLoops; ++i) { if (PlantLoopName == state.dataPlnt->PlantLoop(i).Name) { // found it density = GetDensityGlycol( diff --git a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc index 19a219ad76e..ad81d711bce 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc +++ b/src/EnergyPlus/HeatPumpWaterToWaterSimple.cc @@ -993,21 +993,21 @@ namespace HeatPumpWaterToWaterSimple { if (this->ratedCapCoolWasAutoSized) tmpCoolingCap = 0.0; if (this->ratedLoadVolFlowCoolWasAutoSized) tmpLoadSideVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->ratedCapCoolWasAutoSized) { this->RatedCapCool = tmpCoolingCap; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Design Size Nominal Capacity [W]", tmpCoolingCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Initial Design Size Nominal Capacity [W]", tmpCoolingCap); } } else { if (this->RatedCapCool > 0.0 && tmpCoolingCap > 0.0) { Real64 nomCoolingCapUser = this->RatedCapCool; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, @@ -1037,13 +1037,13 @@ namespace HeatPumpWaterToWaterSimple { } if (this->ratedLoadVolFlowCoolWasAutoSized) { this->RatedLoadVolFlowCool = tmpLoadSideVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Design Size Load Side Volume Flow Rate [m3/s]", tmpLoadSideVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Initial Design Size Load Side Volume Flow Rate [m3/s]", @@ -1052,7 +1052,7 @@ namespace HeatPumpWaterToWaterSimple { } else { if (this->RatedLoadVolFlowCool > 0.0 && tmpLoadSideVolFlowRate > 0.0) { Real64 nomLoadSideVolFlowUser = this->RatedLoadVolFlowCool; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, @@ -1090,15 +1090,15 @@ namespace HeatPumpWaterToWaterSimple { if (this->ratedLoadVolFlowHeatWasAutoSized && this->RatedLoadVolFlowHeat > 0.0) { // fill load side flow rate size from companion coil tmpLoadSideVolFlowRate = this->RatedLoadVolFlowHeat; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->RatedLoadVolFlowCool = tmpLoadSideVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Design Size Load Side Volume Flow Rate [m3/s]", tmpLoadSideVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Initial Design Size Load Side Volume Flow Rate [m3/s]", @@ -1108,31 +1108,31 @@ namespace HeatPumpWaterToWaterSimple { } if (this->ratedCapHeatWasAutoSized && this->RatedCapHeat > 0.0) { tmpCoolingCap = this->RatedCapHeat; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->RatedCapCool = tmpCoolingCap; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Design Size Nominal Capacity [W]", tmpCoolingCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Initial Design Size Nominal Capacity [W]", tmpCoolingCap); } } } } else { // no companion heatpump, no plant sizing object - if ((this->ratedLoadVolFlowCoolWasAutoSized || this->ratedCapCoolWasAutoSized) && DataPlant::PlantFirstSizesOkayToFinalize) { + if ((this->ratedLoadVolFlowCoolWasAutoSized || this->ratedCapCoolWasAutoSized) && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Water to Water Heat Pump requires a loop Sizing:Plant object."); ShowContinueError(state, "Occurs in HeatPump:WaterToWater:EquationFit:Cooling object = " + this->Name); errorsFound = true; } } - if (!this->ratedLoadVolFlowCoolWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (!this->ratedLoadVolFlowCoolWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "User-Specified Load Side Flow Rate [m3/s]", this->RatedLoadVolFlowCool); } - if (!this->ratedCapCoolWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (!this->ratedCapCoolWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "User-Specified Nominal Capacity [W]", this->RatedCapCool); } @@ -1157,13 +1157,13 @@ namespace HeatPumpWaterToWaterSimple { if (this->ratedSourceVolFlowCoolWasAutoSized) { this->RatedSourceVolFlowCool = tmpSourceSideVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Design Size Source Side Volume Flow Rate [m3/s]", tmpSourceSideVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Initial Design Size Source Side Volume Flow Rate [m3/s]", @@ -1172,7 +1172,7 @@ namespace HeatPumpWaterToWaterSimple { } else { if (this->RatedSourceVolFlowCool > 0.0 && tmpSourceSideVolFlowRate > 0.0) { Real64 nomSourceSideVolFlowUser = this->RatedSourceVolFlowCool; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, @@ -1207,18 +1207,18 @@ namespace HeatPumpWaterToWaterSimple { if (this->ratedPowerCoolWasAutoSized) { tmpPowerDraw = tmpCoolingCap / this->refCOP; this->RatedPowerCool = tmpPowerDraw; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Design Size Cooling Power Consumption [W]", tmpPowerDraw); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, "Initial Design Size Cooling Power Consumption [W]", tmpPowerDraw); } } else { if (this->RatedPowerCool > 0.0 && tmpPowerDraw > 0.0) { Real64 nomPowerDrawUser = this->RatedPowerCool; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Cooling", this->Name, @@ -1252,14 +1252,14 @@ namespace HeatPumpWaterToWaterSimple { // count PlantUtilities::RegisterPlantCompDesignFlow(this->SourceSideInletNodeNum, tmpSourceSideVolFlowRate * 0.5); - if (DataPlant::PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myCoolingSizesReported) { // create predefined report OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->Name, "HeatPump:WaterToWater:EquationFit:Cooling"); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomEff, this->Name, this->refCOP); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, this->Name, this->RatedCapCool); } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { this->myCoolingSizesReported = true; } @@ -1330,21 +1330,21 @@ namespace HeatPumpWaterToWaterSimple { if (this->ratedCapHeatWasAutoSized) tmpHeatingCap = 0.0; if (this->ratedLoadVolFlowHeatWasAutoSized) tmpLoadSideVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->ratedCapHeatWasAutoSized) { this->RatedCapHeat = tmpHeatingCap; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Design Size Nominal Capacity [W]", tmpHeatingCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Initial Design Size Nominal Capacity [W]", tmpHeatingCap); } } else { if (this->RatedCapHeat > 0.0 && tmpHeatingCap > 0.0) { Real64 nomHeatingCapUser = this->RatedCapHeat; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, @@ -1373,13 +1373,13 @@ namespace HeatPumpWaterToWaterSimple { } if (this->ratedLoadVolFlowHeatWasAutoSized) { this->RatedLoadVolFlowHeat = tmpLoadSideVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Design Size Load Side Volume Flow Rate [m3/s]", tmpLoadSideVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Initial Design Size Load Side Volume Flow Rate [m3/s]", @@ -1388,7 +1388,7 @@ namespace HeatPumpWaterToWaterSimple { } else { if (this->RatedLoadVolFlowHeat > 0.0 && tmpLoadSideVolFlowRate > 0.0) { Real64 nomLoadSideVolFlowUser = this->RatedLoadVolFlowHeat; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, @@ -1425,15 +1425,15 @@ namespace HeatPumpWaterToWaterSimple { if (this->ratedLoadVolFlowHeatWasAutoSized && this->RatedLoadVolFlowCool > 0.0) { // fill load side flow rate size from companion coil tmpLoadSideVolFlowRate = this->RatedLoadVolFlowCool; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->RatedLoadVolFlowHeat = tmpLoadSideVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Design Size Load Side Volume Flow Rate [m3/s]", tmpLoadSideVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Initial Design Size Load Side Volume Flow Rate [m3/s]", @@ -1443,13 +1443,13 @@ namespace HeatPumpWaterToWaterSimple { } if (this->ratedCapHeatWasAutoSized && this->RatedCapCool > 0.0) { tmpHeatingCap = this->RatedCapCool; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->RatedCapHeat = tmpHeatingCap; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Design Size Nominal Capacity [W]", tmpHeatingCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Initial Design Size Nominal Capacity [W]", tmpHeatingCap); } @@ -1457,18 +1457,18 @@ namespace HeatPumpWaterToWaterSimple { } } else { // no companion heatpump, no plant sizing object - if ((this->ratedLoadVolFlowHeatWasAutoSized || this->ratedCapHeatWasAutoSized) && DataPlant::PlantFirstSizesOkayToFinalize) { + if ((this->ratedLoadVolFlowHeatWasAutoSized || this->ratedCapHeatWasAutoSized) && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Water to Water Heat Pump requires a loop Sizing:Plant object."); ShowContinueError(state, "Occurs in HeatPump:WaterToWater:EquationFit:Heating object = " + this->Name); errorsFound = true; } } - if (!this->ratedLoadVolFlowHeatWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (!this->ratedLoadVolFlowHeatWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "User-Specified Load Side Flow Rate [m3/s]", this->RatedLoadVolFlowHeat); } - if (!this->ratedCapHeatWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (!this->ratedCapHeatWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "User-Specified Nominal Capacity [W]", this->RatedCapHeat); } @@ -1492,13 +1492,13 @@ namespace HeatPumpWaterToWaterSimple { } if (this->ratedSourceVolFlowHeatWasAutoSized) { this->RatedSourceVolFlowHeat = tmpSourceSideVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Design Size Source Side Volume Flow Rate [m3/s]", tmpSourceSideVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Initial Design Size Source Side Volume Flow Rate [m3/s]", @@ -1507,7 +1507,7 @@ namespace HeatPumpWaterToWaterSimple { } else { if (this->RatedSourceVolFlowHeat > 0.0 && tmpSourceSideVolFlowRate > 0.0) { Real64 nomSourceSideVolFlowUser = this->RatedSourceVolFlowHeat; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, @@ -1542,18 +1542,18 @@ namespace HeatPumpWaterToWaterSimple { if (this->ratedPowerHeatWasAutoSized) { tmpPowerDraw = tmpHeatingCap / this->refCOP; this->RatedPowerHeat = tmpPowerDraw; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Design Size Heating Power Consumption [W]", tmpPowerDraw); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, "Initial Design Size Heating Power Consumption [W]", tmpPowerDraw); } } else { if (this->RatedPowerHeat > 0.0 && tmpPowerDraw > 0.0) { Real64 nomPowerDrawUser = this->RatedPowerHeat; - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "HeatPump:WaterToWater:EquationFit:Heating", this->Name, @@ -1586,14 +1586,14 @@ namespace HeatPumpWaterToWaterSimple { // register half of source side flow to avoid double counting PlantUtilities::RegisterPlantCompDesignFlow(this->SourceSideInletNodeNum, tmpSourceSideVolFlowRate * 0.5); - if (DataPlant::PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->myHeatingSizesReported) { // create predefined report OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->Name, "HeatPump:WaterToWater:EquationFit:Heating"); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomEff, this->Name, this->refCOP); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, this->Name, this->RatedCapHeat); } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { this->myHeatingSizesReported = true; } diff --git a/src/EnergyPlus/MicroCHPElectricGenerator.cc b/src/EnergyPlus/MicroCHPElectricGenerator.cc index 1ad9dd22be7..cec3795e801 100644 --- a/src/EnergyPlus/MicroCHPElectricGenerator.cc +++ b/src/EnergyPlus/MicroCHPElectricGenerator.cc @@ -644,7 +644,7 @@ namespace MicroCHPElectricGenerator { this->MyPlantScanFlag = false; } - if (!state.dataGlobal->SysSizingCalc && this->MySizeFlag && !this->MyPlantScanFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (!state.dataGlobal->SysSizingCalc && this->MySizeFlag && !this->MyPlantScanFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { this->MySizeFlag = false; } diff --git a/src/EnergyPlus/OutsideEnergySources.cc b/src/EnergyPlus/OutsideEnergySources.cc index d8a171bff65..ce8b13d29bd 100644 --- a/src/EnergyPlus/OutsideEnergySources.cc +++ b/src/EnergyPlus/OutsideEnergySources.cc @@ -429,19 +429,19 @@ namespace OutsideEnergySources { state.dataPlnt->PlantLoop(this->LoopNum).FluidIndex, "SizeDistrict" + typeName); Real64 const NomCapDes = Cp * rho * DataSizing::PlantSizData(PltSizNum).DeltaT * DataSizing::PlantSizData(PltSizNum).DesVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCapWasAutoSized) { this->NomCap = NomCapDes; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "District" + typeName, this->Name, "Design Size Nominal Capacity [W]", NomCapDes); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "District" + typeName, this->Name, "Initial Design Size Nominal Capacity [W]", NomCapDes); } } else { // Hard-size with sizing data if (this->NomCap > 0.0 && NomCapDes > 0.0) { Real64 const NomCapUser = this->NomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "District" + typeName, this->Name, "Design Size Nominal Capacity [W]", @@ -462,12 +462,12 @@ namespace OutsideEnergySources { } } } else { - if (this->NomCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->NomCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of District " + typeName + " nominal capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in District" + typeName + " object=" + this->Name); ErrorsFound = true; } - if (!this->NomCapWasAutoSized && this->NomCap > 0.0 && DataPlant::PlantFinalSizesOkayToReport) { + if (!this->NomCapWasAutoSized && this->NomCap > 0.0 && state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "District" + typeName, this->Name, "User-Specified Nominal Capacity [W]", this->NomCap); } } diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 10d0c417efb..348c9f4ac78 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -672,13 +672,13 @@ namespace PhotovoltaicThermalCollectors { } } else { if (this->DesignVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of PVT solar collector design flow rate requires a Sizing:Plant object"); ShowContinueError(state, "Occurs in PVT object=" + this->Name); ErrorsFound = true; } } else { // Hardsized - if (DataPlant::PlantFinalSizesOkayToReport && this->DesignVolFlowRate > 0.0) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && this->DesignVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "SolarCollector:FlatPlate:PhotovoltaicThermal", this->Name, "User-Specified Design Flow Rate [m3/s]", @@ -691,11 +691,11 @@ namespace PhotovoltaicThermalCollectors { } if (this->DesignVolFlowRateWasAutoSized) { this->DesignVolFlowRate = DesignVolFlowRateDes; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "SolarCollector:FlatPlate:PhotovoltaicThermal", this->Name, "Design Size Design Flow Rate [m3/s]", DesignVolFlowRateDes); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "SolarCollector:FlatPlate:PhotovoltaicThermal", this->Name, "Initial Design Size Design Flow Rate [m3/s]", @@ -704,7 +704,7 @@ namespace PhotovoltaicThermalCollectors { PlantUtilities::RegisterPlantCompDesignFlow(this->PlantInletNodeNum, this->DesignVolFlowRate); } else { // Hardsized with sizing data - if (this->DesignVolFlowRate > 0.0 && DesignVolFlowRateDes > 0.0 && DataPlant::PlantFinalSizesOkayToReport) { + if (this->DesignVolFlowRate > 0.0 && DesignVolFlowRateDes > 0.0 && state.dataPlnt->PlantFinalSizesOkayToReport) { Real64 DesignVolFlowRateUser = this->DesignVolFlowRate; BaseSizer::reportSizerOutput(state, "SolarCollector:FlatPlate:PhotovoltaicThermal", this->Name, diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index 04555164fce..8463f026451 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -282,18 +282,6 @@ namespace EnergyPlus::DataPlant { Real64 const square_sum_ConvergenceHistoryARR(pow_2(sum_ConvergenceHistoryARR)); Real64 const sum_square_ConvergenceHistoryARR(sum(pow(ConvergenceHistoryARR, 2))); - int TotNumLoops(0); // number of plant and condenser loops - int TotNumHalfLoops(0); // number of half loops (2 * TotNumLoops) - bool PlantFirstSizeCompleted(false); - bool PlantFirstSizesOkayToFinalize(false); // true if plant sizing is finishing and can save results - bool PlantReSizingCompleted(false); - bool PlantFirstSizesOkayToReport(false); - bool PlantFinalSizesOkayToReport(false); - bool AnyEMSPlantOpSchemesInModel(false); - - int PlantManageSubIterations(0); // tracks plant iterations to characterize solver - int PlantManageHalfLoopCalls(0); // tracks number of half loop calls - // Object Data Array1D PlantAvailMgr; Array1D VentRepPlantSupplySide; @@ -306,16 +294,6 @@ namespace EnergyPlus::DataPlant { // Needed for unit tests, should not be normally called. void clear_state() { - TotNumLoops = 0; - TotNumHalfLoops = 0; - PlantFirstSizeCompleted = false; - PlantFirstSizesOkayToFinalize = false; - PlantReSizingCompleted = false; - PlantFirstSizesOkayToReport = false; - PlantFinalSizesOkayToReport = false; - AnyEMSPlantOpSchemesInModel = false; - PlantManageSubIterations = 0; - PlantManageHalfLoopCalls = 0; PlantAvailMgr.deallocate(); VentRepPlantSupplySide.deallocate(); VentRepPlantDemandSide.deallocate(); diff --git a/src/EnergyPlus/Plant/DataPlant.hh b/src/EnergyPlus/Plant/DataPlant.hh index 56101a0f54c..d4862a75118 100644 --- a/src/EnergyPlus/Plant/DataPlant.hh +++ b/src/EnergyPlus/Plant/DataPlant.hh @@ -200,21 +200,6 @@ namespace DataPlant { extern Real64 const square_sum_ConvergenceHistoryARR; extern Real64 const sum_square_ConvergenceHistoryARR; - extern int TotNumLoops; // number of plant and condenser loops - extern int TotNumHalfLoops; // number of half loops (2 * TotNumLoops) - extern bool PlantFirstSizeCompleted; // true if first-pass sizing is still going on and not finished - extern bool PlantFirstSizesOkayToFinalize; // true if first-pass plant sizing is finish and can save results for simulation - extern bool PlantFirstSizesOkayToReport; // true if initial first pass size can be reported - extern bool PlantFinalSizesOkayToReport; // true if plant sizing is really all done and final results reported - extern bool PlantReSizingCompleted; - - extern bool AnyEMSPlantOpSchemesInModel; - - extern int PlantManageSubIterations; // tracks plant iterations to characterize solver - extern int PlantManageHalfLoopCalls; // tracks number of half loop calls - - // Enum classes - // Object Data extern Array1D PlantAvailMgr; extern Array1D VentRepPlantSupplySide; @@ -231,16 +216,16 @@ namespace DataPlant { struct DataPlantData : BaseGlobalStruct { -// int TotNumLoops = 0; // number of plant and condenser loops -// int TotNumHalfLoops = 0; // number of half loops (2 * TotNumLoops) -// bool PlantFirstSizeCompleted = false; -// bool PlantFirstSizesOkayToFinalize = false; // true if plant sizing is finishing and can save results -// bool PlantReSizingCompleted = false; -// bool PlantFirstSizesOkayToReport = false; -// bool PlantFinalSizesOkayToReport = false; -// bool AnyEMSPlantOpSchemesInModel = false; -// int PlantManageSubIterations = 0; // tracks plant iterations to characterize solver -// int PlantManageHalfLoopCalls = 0; // tracks number of half loop calls + int TotNumLoops = 0; // number of plant and condenser loops + int TotNumHalfLoops = 0; // number of half loops (2 * TotNumLoops) + bool PlantFirstSizeCompleted = false; + bool PlantFirstSizesOkayToFinalize = false; // true if plant sizing is finishing and can save results + bool PlantReSizingCompleted = false; + bool PlantFirstSizesOkayToReport = false; + bool PlantFinalSizesOkayToReport = false; + bool AnyEMSPlantOpSchemesInModel = false; + int PlantManageSubIterations = 0; // tracks plant iterations to characterize solver + int PlantManageHalfLoopCalls = 0; // tracks number of half loop calls Array1D PlantLoop; // Array1D PlantAvailMgr; // Array1D VentRepPlantSupplySide; @@ -251,16 +236,16 @@ struct DataPlantData : BaseGlobalStruct { void clear_state() override { -// this->TotNumLoops = 0; -// this->TotNumHalfLoops = 0; -// this->PlantFirstSizeCompleted = false; -// this->PlantFirstSizesOkayToFinalize = false; -// this->PlantReSizingCompleted = false; -// this->PlantFirstSizesOkayToReport = false; -// this->PlantFinalSizesOkayToReport = false; -// this->AnyEMSPlantOpSchemesInModel = false; -// this->PlantManageSubIterations = 0; -// this->PlantManageHalfLoopCalls = 0; + this->TotNumLoops = 0; + this->TotNumHalfLoops = 0; + this->PlantFirstSizeCompleted = false; + this->PlantFirstSizesOkayToFinalize = false; + this->PlantReSizingCompleted = false; + this->PlantFirstSizesOkayToReport = false; + this->PlantFinalSizesOkayToReport = false; + this->AnyEMSPlantOpSchemesInModel = false; + this->PlantManageSubIterations = 0; + this->PlantManageHalfLoopCalls = 0; this->PlantLoop.deallocate(); // this->PlantAvailMgr.deallocate(); // this->VentRepPlantSupplySide.deallocate(); diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index ade6b8ee127..f19f187a8f4 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -68,7 +68,6 @@ #include #include #include -#include #include #include #include @@ -209,7 +208,7 @@ namespace EnergyPlus::PlantManager { CurntMinPlantSubIterations = state.dataConvergeParams->MinPlantSubIterations; } - if (TotNumLoops <= 0) { // quick return if no plant in model + if (state.dataPlnt->TotNumLoops <= 0) { // quick return if no plant in model SimPlantLoops = false; return; } @@ -219,7 +218,7 @@ namespace EnergyPlus::PlantManager { while ((SimPlantLoops) && (IterPlant <= state.dataConvergeParams->MaxPlantSubIterations)) { // go through half loops in predetermined calling order - for (HalfLoopNum = 1; HalfLoopNum <= TotNumHalfLoops; ++HalfLoopNum) { + for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; LoopSide = PlantCallingOrderInfo(HalfLoopNum).LoopSide; @@ -248,14 +247,14 @@ namespace EnergyPlus::PlantManager { // Update the report variable this_loop.LastLoopSideSimulated = LoopSide; - ++PlantManageHalfLoopCalls; + ++state.dataPlnt->PlantManageHalfLoopCalls; } } // half loop based calling order... // decide new status for SimPlantLoops flag SimPlantLoops = false; - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (LoopSideNum = 1; LoopSideNum <= 2; ++LoopSideNum) { if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).SimLoopSideNeeded) { SimPlantLoops = true; @@ -267,12 +266,12 @@ namespace EnergyPlus::PlantManager { ++IterPlant; // Increment the iteration counter if (IterPlant < CurntMinPlantSubIterations) SimPlantLoops = true; - ++PlantManageSubIterations; // these are summed across all half loops for reporting + ++state.dataPlnt->PlantManageSubIterations; // these are summed across all half loops for reporting } // while // add check for non-plant system sim flag updates // could set SimAirLoops, SimElecCircuits, SimZoneEquipment flags for now - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (LoopSide = DemandSide; LoopSide <= SupplySide; ++LoopSide) { auto &this_loop_side(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide)); if (this_loop_side.SimAirLoopsNeeded) SimAirLoops = true; @@ -340,19 +339,19 @@ namespace EnergyPlus::PlantManager { CurrentModuleObject); // Get the number of primary plant loops CurrentModuleObject = "CondenserLoop"; NumCondLoops = inputProcessor->getNumObjectsFound(state, CurrentModuleObject); // Get the number of Condenser loops - TotNumLoops = NumPlantLoops + NumCondLoops; + state.dataPlnt->TotNumLoops = NumPlantLoops + NumCondLoops; - if (TotNumLoops > 0) { - state.dataPlnt->PlantLoop.allocate(TotNumLoops); - state.dataConvergeParams->PlantConvergence.allocate(TotNumLoops); + if (state.dataPlnt->TotNumLoops > 0) { + state.dataPlnt->PlantLoop.allocate(state.dataPlnt->TotNumLoops); + state.dataConvergeParams->PlantConvergence.allocate(state.dataPlnt->TotNumLoops); if (!allocated(PlantAvailMgr)) { - PlantAvailMgr.allocate(TotNumLoops); + PlantAvailMgr.allocate(state.dataPlnt->TotNumLoops); } } else { return; } - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { Alpha = ""; Num = 0.0; @@ -646,7 +645,7 @@ namespace EnergyPlus::PlantManager { ErrFound = false; if (this_loop.TypeOfLoop == LoopType::Plant) { - GetPlantAvailabilityManager(state, Alpha(15), LoopNum, TotNumLoops, ErrFound); + GetPlantAvailabilityManager(state, Alpha(15), LoopNum, state.dataPlnt->TotNumLoops, ErrFound); } if (ErrFound) { @@ -723,7 +722,7 @@ namespace EnergyPlus::PlantManager { // set up loop status (set by system availability managers) report variables // Condenser loop does not have availability manager yet. Once implemented, move the setup output variable to // outside the IF statement. - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { SetupOutputVariable(state, "Plant System Cycle On Off Status", @@ -800,7 +799,7 @@ namespace EnergyPlus::PlantManager { MaxNumAlphas = max(MaxNumAlphas, NumAlphas); HalfLoopNum = 0; - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { auto &plantLoop = state.dataPlnt->PlantLoop(LoopNum); plantLoop.LoopHasConnectionComp = false; @@ -1906,7 +1905,7 @@ namespace EnergyPlus::PlantManager { loop.OutletNodeFlowrate = 0.0; } - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { auto &loop = state.dataPlnt->PlantLoop(LoopNum); if (LoopNum <= NumPlantLoops) { CurrentModuleObject = "Plant Loop"; @@ -1975,7 +1974,7 @@ namespace EnergyPlus::PlantManager { // setup more variables inside plant data structure // CurrentModuleObject='Plant/Condenser Loop(Advanced)' if (state.dataGlobal->DisplayAdvancedReportVariables) { - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { SetupOutputVariable(state, "Plant Demand Side Lumped Capacitance Temperature", OutputProcessor::Unit::C, state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TankTemp, @@ -2049,7 +2048,7 @@ namespace EnergyPlus::PlantManager { } // now traverse plant loops and set fluid type index in all nodes on the loop - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { FluidIndex = state.dataPlnt->PlantLoop(LoopNum).FluidIndex; for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { Node(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).NodeNumIn).FluidIndex = FluidIndex; @@ -2089,7 +2088,6 @@ namespace EnergyPlus::PlantManager { using namespace DataSizing; using DataHVACGlobals::NumCondLoops; using DataHVACGlobals::NumPlantLoops; - using DataPlant::PlantFirstSizesOkayToReport; using EMSManager::CheckIfNodeSetPointManagedByEMS; using PlantUtilities::SetAllFlowLocks; @@ -2113,7 +2111,7 @@ namespace EnergyPlus::PlantManager { int passNum; if (!allocated(PlantLoopSetPointInitFlag)) { - PlantLoopSetPointInitFlag.allocate(TotNumLoops); + PlantLoopSetPointInitFlag.allocate(state.dataPlnt->TotNumLoops); } // Initialize the setpoints for Load range based schemes only as determined by the init flag @@ -2140,7 +2138,7 @@ namespace EnergyPlus::PlantManager { if (MySetPointCheckFlag && DoSetPointTest) { // check for missing setpoints - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { SensedNode = state.dataPlnt->PlantLoop(LoopNum).TempSetPointNodeNum; if (SensedNode > 0) { @@ -2176,20 +2174,20 @@ namespace EnergyPlus::PlantManager { //***************************************************************** // First Pass PUMP AND SIZING INIT //***************************************************************** - if (!PlantFirstSizeCompleted) { + if (!state.dataPlnt->PlantFirstSizeCompleted) { SetAllFlowLocks(state, DataPlant::iFlowLock::Unlocked); FinishSizingFlag = false; - PlantFirstSizesOkayToFinalize = false; // set global flag for when it ready to store final sizes - PlantFirstSizesOkayToReport = false; - PlantFinalSizesOkayToReport = false; + state.dataPlnt->PlantFirstSizesOkayToFinalize = false; // set global flag for when it ready to store final sizes + state.dataPlnt->PlantFirstSizesOkayToReport = false; + state.dataPlnt->PlantFinalSizesOkayToReport = false; GetCompSizFac = true; for (passNum = 1; passNum <= 4; ++passNum) { // begin while loop to iterate over the next calls sequentially InitLoopEquip = true; // Step 2, call component models it using PlantCallingOrderInfo for sizing - for (HalfLoopNum = 1; HalfLoopNum <= TotNumHalfLoops; ++HalfLoopNum) { + for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; CurLoopNum = LoopNum; @@ -2210,7 +2208,7 @@ namespace EnergyPlus::PlantManager { // Step 4: Simulate plant loop components so their design flows are included - for (HalfLoopNum = 1; HalfLoopNum <= TotNumHalfLoops; ++HalfLoopNum) { + for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; @@ -2223,17 +2221,17 @@ namespace EnergyPlus::PlantManager { } // iterative passes thru sizing related routines. end while? // Step 5 now one more time for the final - for (HalfLoopNum = 1; HalfLoopNum <= TotNumHalfLoops; ++HalfLoopNum) { + for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { if (state.dataGlobal->DoHVACSizingSimulation) { - PlantFirstSizesOkayToFinalize = true; + state.dataPlnt->PlantFirstSizesOkayToFinalize = true; FinishSizingFlag = true; - PlantFirstSizesOkayToReport = true; - PlantFinalSizesOkayToReport = false; + state.dataPlnt->PlantFirstSizesOkayToReport = true; + state.dataPlnt->PlantFinalSizesOkayToReport = false; } else { - PlantFirstSizesOkayToFinalize = true; + state.dataPlnt->PlantFirstSizesOkayToFinalize = true; FinishSizingFlag = true; - PlantFirstSizesOkayToReport = false; - PlantFinalSizesOkayToReport = true; + state.dataPlnt->PlantFirstSizesOkayToReport = false; + state.dataPlnt->PlantFinalSizesOkayToReport = true; } LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; @@ -2254,8 +2252,8 @@ namespace EnergyPlus::PlantManager { //).VolFlowSizingDone = true; } - PlantFirstSizeCompleted = true; - PlantFirstSizesOkayToReport = false; + state.dataPlnt->PlantFirstSizeCompleted = true; + state.dataPlnt->PlantFirstSizesOkayToReport = false; } //***************************************************************** // END First Pass SIZING INIT @@ -2263,12 +2261,12 @@ namespace EnergyPlus::PlantManager { //***************************************************************** // BEGIN Resizing Pass for HVAC Sizing Simultion Adjustments //***************************************************************** - if (state.dataGlobal->RedoSizesHVACSimulation && !PlantReSizingCompleted) { + if (state.dataGlobal->RedoSizesHVACSimulation && !state.dataPlnt->PlantReSizingCompleted) { // cycle through plant equipment calling with InitLoopEquip true InitLoopEquip = true; GetCompSizFac = false; - for (HalfLoopNum = 1; HalfLoopNum <= TotNumHalfLoops; ++HalfLoopNum) { + for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; CurLoopNum = LoopNum; @@ -2283,15 +2281,15 @@ namespace EnergyPlus::PlantManager { } // reset loop level - PlantFinalSizesOkayToReport = true; - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + state.dataPlnt->PlantFinalSizesOkayToReport = true; + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { ResizePlantLoopLevelSizes(state, LoopNum); } InitLoopEquip = true; // now call everything again to reporting turned on - for (HalfLoopNum = 1; HalfLoopNum <= TotNumHalfLoops; ++HalfLoopNum) { + for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; CurLoopNum = LoopNum; @@ -2307,8 +2305,8 @@ namespace EnergyPlus::PlantManager { state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).SimulateAllLoopSidePumps(state); } - PlantReSizingCompleted = true; - PlantFinalSizesOkayToReport = false; + state.dataPlnt->PlantReSizingCompleted = true; + state.dataPlnt->PlantFinalSizesOkayToReport = false; } //***************************************************************** // END Resizing Pass for HVAC Sizing Simultion Adjustments @@ -2318,7 +2316,7 @@ namespace EnergyPlus::PlantManager { //***************************************************************** if (SupplyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag) { - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { // check if setpoints being placed on node properly if (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { @@ -2377,7 +2375,7 @@ namespace EnergyPlus::PlantManager { // Any per-environment load distribution init should be OK here // Just clear away any trailing MyLoad for now... // This could likely be moved into InitLoadDistribution also... - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { for (BranchNum = 1; BranchNum <= state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).TotalBranches; ++BranchNum) { @@ -2460,7 +2458,7 @@ namespace EnergyPlus::PlantManager { if (MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag) { - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { { @@ -2624,7 +2622,7 @@ namespace EnergyPlus::PlantManager { if (!state.dataGlobal->BeginEnvrnFlag) MyEnvrnFlag = true; // FirstHVACiteration inits - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { // UPDATE LOOP FLOW SETPOINT // Node(LoopIn)%MassFlowRateSetPoint = LoopMaxMassFlowRate !DSU? this is suspect, may not be set? // UPDATE LOOP TEMPERATURE SETPOINTS @@ -2795,10 +2793,10 @@ namespace EnergyPlus::PlantManager { return; } - if (TotNumLoops <= 0) return; + if (state.dataPlnt->TotNumLoops <= 0) return; if (!(allocated(state.dataPlnt->PlantLoop))) return; - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { numLoopSides = 2; for (SideNum = 1; SideNum <= numLoopSides; ++SideNum) { if (!(state.dataPlnt->PlantLoop(LoopNum).LoopSide(SideNum).Splitter.Exists)) continue; @@ -3121,7 +3119,7 @@ namespace EnergyPlus::PlantManager { PlantSizData(PlantSizNum).DesVolFlowRate * PlantSizData(PlantSizNum).PlantSizFac; } else { state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate = 0.0; - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { ShowWarningError( state, format("SizePlantLoop: Calculated Plant Sizing Design Volume Flow Rate=[{:.2R}] is too small. Set to 0.0", @@ -3130,7 +3128,7 @@ namespace EnergyPlus::PlantManager { } } if (Finalize) { - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { BaseSizer::reportSizerOutput(state, "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Maximum Loop Flow Rate [m3/s]", @@ -3141,7 +3139,7 @@ namespace EnergyPlus::PlantManager { state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate); } } - if (PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { BaseSizer::reportSizerOutput(state, "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Initial Maximum Loop Flow Rate [m3/s]", @@ -3155,7 +3153,7 @@ namespace EnergyPlus::PlantManager { } } else { - if (PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowFatalError(state, "Autosizing of plant loop requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in PlantLoop object=" + state.dataPlnt->PlantLoop(LoopNum).Name); ErrorsFound = true; @@ -3169,7 +3167,7 @@ namespace EnergyPlus::PlantManager { // Note this calculation also appears in PlantManager::ResizePlantLoopLevelSizes and SizingAnalysisObjects::ResolveDesignFlowRate state.dataPlnt->PlantLoop(LoopNum).Volume = state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate * state.dataPlnt->PlantLoop(LoopNum).CirculationTime * 60.0; - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { // condenser loop vs plant loop breakout needed. BaseSizer::reportSizerOutput(state, "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Plant Loop Volume [m3]", @@ -3179,7 +3177,7 @@ namespace EnergyPlus::PlantManager { state.dataPlnt->PlantLoop(LoopNum).Volume); } } - if (PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { // condenser loop vs plant loop breakout needed. BaseSizer::reportSizerOutput(state, "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Initial Plant Loop Volume [m3]", @@ -3283,7 +3281,7 @@ namespace EnergyPlus::PlantManager { state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate = PlantSizData(PlantSizNum).DesVolFlowRate * PlantSizeFac; } else { state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate = 0.0; - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { ShowWarningError( state, format("SizePlantLoop: Calculated Plant Sizing Design Volume Flow Rate=[{:.2R}] is too small. Set to 0.0", @@ -3291,7 +3289,7 @@ namespace EnergyPlus::PlantManager { ShowContinueError(state, "..occurs for PlantLoop=" + state.dataPlnt->PlantLoop(LoopNum).Name); } } - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (state.dataPlnt->PlantLoop(LoopNum).TypeOfLoop == LoopType::Plant) { BaseSizer::reportSizerOutput(state, "PlantLoop", state.dataPlnt->PlantLoop(LoopNum).Name, "Maximum Loop Flow Rate [m3/s]", state.dataPlnt->PlantLoop(LoopNum).MaxVolFlowRate); @@ -3341,7 +3339,7 @@ namespace EnergyPlus::PlantManager { } } - void SetupInitialPlantCallingOrder() { + void SetupInitialPlantCallingOrder(EnergyPlusData &state) { // SUBROUTINE INFORMATION: // AUTHOR Brent Griffith @@ -3383,13 +3381,13 @@ namespace EnergyPlus::PlantManager { int OrderIndex; // local int I; // local loop - TotNumHalfLoops = 2 * TotNumLoops; + state.dataPlnt->TotNumHalfLoops = 2 * state.dataPlnt->TotNumLoops; - if (TotNumHalfLoops <= 0) return; + if (state.dataPlnt->TotNumHalfLoops <= 0) return; // first allocate to total number of plant half loops - if (!allocated(PlantCallingOrderInfo)) PlantCallingOrderInfo.allocate(TotNumHalfLoops); + if (!allocated(PlantCallingOrderInfo)) PlantCallingOrderInfo.allocate(state.dataPlnt->TotNumHalfLoops); // set plant loop demand sides for (I = 1; I <= NumPlantLoops; ++I) { @@ -3467,7 +3465,7 @@ namespace EnergyPlus::PlantManager { bool thisLoopPutsDemandOnAnother; int ConnctNum; - for (HalfLoopNum = 1; HalfLoopNum <= TotNumHalfLoops; ++HalfLoopNum) { + for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; @@ -3477,13 +3475,13 @@ namespace EnergyPlus::PlantManager { ConnctNum <= isize(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected); ++ConnctNum) { OtherLoopNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected(ConnctNum).LoopNum; OtherLoopSideNum = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected(ConnctNum).LoopSideNum; - OtherLoopCallingIndex = FindLoopSideInCallingOrder(OtherLoopNum, OtherLoopSideNum); + OtherLoopCallingIndex = FindLoopSideInCallingOrder(state, OtherLoopNum, OtherLoopSideNum); thisLoopPutsDemandOnAnother = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected( ConnctNum).LoopDemandsOnRemote; if (thisLoopPutsDemandOnAnother) { // make sure this loop side is called before the other loop side if (OtherLoopCallingIndex < HalfLoopNum) { // rearrange - newCallingIndex = min(HalfLoopNum + 1, TotNumHalfLoops); + newCallingIndex = min(HalfLoopNum + 1, state.dataPlnt->TotNumHalfLoops); ShiftPlantLoopSideCallingOrder(state, OtherLoopCallingIndex, newCallingIndex); } @@ -3493,19 +3491,19 @@ namespace EnergyPlus::PlantManager { if (OtherLoopSideNum == SupplySide) { // if this is a supplyside, don't push it before its own demand side - OtherLoopDemandSideCallingIndex = FindLoopSideInCallingOrder(OtherLoopNum, + OtherLoopDemandSideCallingIndex = FindLoopSideInCallingOrder(state, OtherLoopNum, DemandSide); if (OtherLoopDemandSideCallingIndex < HalfLoopNum) { // good to go newCallingIndex = min(OtherLoopDemandSideCallingIndex + 1, - TotNumHalfLoops); // put it right after its demand side + state.dataPlnt->TotNumHalfLoops); // put it right after its demand side ShiftPlantLoopSideCallingOrder(state, OtherLoopCallingIndex, newCallingIndex); } else { // move both sides of other loop before this, keeping demand side in front NewOtherDemandSideCallingIndex = max(HalfLoopNum, 1); ShiftPlantLoopSideCallingOrder(state, OtherLoopDemandSideCallingIndex, NewOtherDemandSideCallingIndex); // get fresh pointer after it has changed in previous call - OtherLoopCallingIndex = FindLoopSideInCallingOrder(OtherLoopNum, + OtherLoopCallingIndex = FindLoopSideInCallingOrder(state, OtherLoopNum, OtherLoopSideNum); newCallingIndex = NewOtherDemandSideCallingIndex + 1; ShiftPlantLoopSideCallingOrder(state, OtherLoopCallingIndex, newCallingIndex); @@ -3520,7 +3518,7 @@ namespace EnergyPlus::PlantManager { } } - int FindLoopSideInCallingOrder(int const LoopNum, int const LoopSide) { + int FindLoopSideInCallingOrder(EnergyPlusData &state, int const LoopNum, int const LoopSide) { // FUNCTION INFORMATION: // AUTHOR B. Griffith @@ -3560,7 +3558,7 @@ namespace EnergyPlus::PlantManager { CallingIndex = 0; - for (HalfLoopNum = 1; HalfLoopNum <= TotNumHalfLoops; ++HalfLoopNum) { + for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { if ((LoopNum == PlantCallingOrderInfo(HalfLoopNum).LoopIndex) && (LoopSide == PlantCallingOrderInfo(HalfLoopNum).LoopSide)) { @@ -4328,7 +4326,7 @@ namespace EnergyPlus::PlantManager { void CheckOngoingPlantWarnings(EnergyPlusData &state) { int LoopNum; - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { // Warning if the excess storage time is more than half of the total time if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_CapExcessStorageTime > state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).LoopSideInlet_TotalTime / 2) { diff --git a/src/EnergyPlus/Plant/PlantManager.hh b/src/EnergyPlus/Plant/PlantManager.hh index 73f6d89e2cb..2d9d3b82d3a 100644 --- a/src/EnergyPlus/Plant/PlantManager.hh +++ b/src/EnergyPlus/Plant/PlantManager.hh @@ -106,11 +106,11 @@ namespace PlantManager { void ResizePlantLoopLevelSizes(EnergyPlusData &state, int LoopNum); - void SetupInitialPlantCallingOrder(); + void SetupInitialPlantCallingOrder(EnergyPlusData &state); void RevisePlantCallingOrder(EnergyPlusData &state); - int FindLoopSideInCallingOrder(int LoopNum, int LoopSide); + int FindLoopSideInCallingOrder(EnergyPlusData &state, int LoopNum, int LoopSide); void SetupBranchControlTypes(EnergyPlusData &state); diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index d4b88dbe0d3..43279cd395d 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -282,16 +282,16 @@ namespace PlantCentralGSHP { if (this->ChillerHeater(NumChillerHeater).EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; this->ChillerHeater(NumChillerHeater).tmpEvapVolFlowRate = tmpEvapVolFlowRate; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->ChillerHeater(NumChillerHeater).EvapVolFlowRateWasAutoSized) { this->ChillerHeater(NumChillerHeater).EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport && !this->mySizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->mySizesReported) { BaseSizer::reportSizerOutput(state, "ChillerHeaterPerformance:Electric:EIR", this->ChillerHeater(NumChillerHeater).Name, "Design Size Reference Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeaterPerformance:Electric:EIR", this->ChillerHeater(NumChillerHeater).Name, "Initial Design Size Reference Chilled Water Flow Rate [m3/s]", @@ -299,7 +299,7 @@ namespace PlantCentralGSHP { } } else { if (this->ChillerHeater(NumChillerHeater).EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0 && - DataPlant::PlantFinalSizesOkayToReport && !this->mySizesReported) { + state.dataPlnt->PlantFinalSizesOkayToReport && !this->mySizesReported) { // Hardsized evaporator design volume flow rate for reporting Real64 EvapVolFlowRateUser = this->ChillerHeater(NumChillerHeater).EvapVolFlowRate; @@ -329,13 +329,13 @@ namespace PlantCentralGSHP { } } else { if (this->ChillerHeater(NumChillerHeater).EvapVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of CGSHP Chiller Heater evap flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in CGSHP Chiller Heater Performance object=" + this->ChillerHeater(NumChillerHeater).Name); ErrorsFound = true; } } else { - if (this->ChillerHeater(NumChillerHeater).EvapVolFlowRate > 0.0 && DataPlant::PlantFinalSizesOkayToReport && + if (this->ChillerHeater(NumChillerHeater).EvapVolFlowRate > 0.0 && state.dataPlnt->PlantFinalSizesOkayToReport && !this->mySizesReported) { BaseSizer::reportSizerOutput(state, "ChillerHeaterPerformance:Electric:EIR", this->ChillerHeater(NumChillerHeater).Name, @@ -364,7 +364,7 @@ namespace PlantCentralGSHP { } else { if (this->ChillerHeater(NumChillerHeater).RefCapCoolingWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->ChillerHeater(NumChillerHeater).RefCapCoolingWasAutoSized) { this->ChillerHeater(NumChillerHeater).RefCapCooling = tmpNomCap; @@ -380,13 +380,13 @@ namespace PlantCentralGSHP { this->ChillerHeater(NumChillerHeater).RefCOPClgHtg = this->ChillerHeater(NumChillerHeater).RefCapClgHtg / this->ChillerHeater(NumChillerHeater).RefPowerClgHtg; - if (DataPlant::PlantFinalSizesOkayToReport && !this->mySizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->mySizesReported) { BaseSizer::reportSizerOutput(state, "ChillerHeaterPerformance:Electric:EIR", this->ChillerHeater(NumChillerHeater).Name, "Design Size Reference Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeaterPerformance:Electric:EIR", this->ChillerHeater(NumChillerHeater).Name, "Initial Design Size Reference Capacity [W]", @@ -394,7 +394,7 @@ namespace PlantCentralGSHP { } } else { if (this->ChillerHeater(NumChillerHeater).RefCapCooling > 0.0 && tmpNomCap > 0.0 && - DataPlant::PlantFinalSizesOkayToReport && !this->mySizesReported) { + state.dataPlnt->PlantFinalSizesOkayToReport && !this->mySizesReported) { // Hardsized nominal capacity cooling power for reporting Real64 NomCapUser = this->ChillerHeater(NumChillerHeater).RefCapCooling; @@ -420,7 +420,7 @@ namespace PlantCentralGSHP { } } else { if (this->ChillerHeater(NumChillerHeater).RefCapCoolingWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Size ChillerHeaterPerformance:Electric:EIR=\"" + this->ChillerHeater(NumChillerHeater).Name + "\", autosize error."); ShowContinueError(state, "Autosizing of CGSHP Chiller Heater reference capacity requires"); @@ -428,7 +428,7 @@ namespace PlantCentralGSHP { ErrorsFound = true; } } else { - if (this->ChillerHeater(NumChillerHeater).RefCapCooling > 0.0 && DataPlant::PlantFinalSizesOkayToReport && + if (this->ChillerHeater(NumChillerHeater).RefCapCooling > 0.0 && state.dataPlnt->PlantFinalSizesOkayToReport && !this->mySizesReported) { BaseSizer::reportSizerOutput(state, "ChillerHeaterPerformance:Electric:EIR", this->ChillerHeater(NumChillerHeater).Name, @@ -463,16 +463,16 @@ namespace PlantCentralGSHP { if (this->ChillerHeater(NumChillerHeater).CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; this->ChillerHeater(NumChillerHeater).tmpCondVolFlowRate = tmpCondVolFlowRate; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->ChillerHeater(NumChillerHeater).CondVolFlowRateWasAutoSized) { this->ChillerHeater(NumChillerHeater).CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport && !this->mySizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->mySizesReported) { BaseSizer::reportSizerOutput(state, "ChillerHeaterPerformance:Electric:EIR", this->ChillerHeater(NumChillerHeater).Name, "Design Size Reference Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "ChillerHeaterPerformance:Electric:EIR", this->ChillerHeater(NumChillerHeater).Name, "Initial Design Size Reference Condenser Water Flow Rate [m3/s]", @@ -480,7 +480,7 @@ namespace PlantCentralGSHP { } } else { if (this->ChillerHeater(NumChillerHeater).CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0 && - DataPlant::PlantFinalSizesOkayToReport && !this->mySizesReported) { + state.dataPlnt->PlantFinalSizesOkayToReport && !this->mySizesReported) { // Hardsized condenser design volume flow rate for reporting Real64 CondVolFlowRateUser = this->ChillerHeater(NumChillerHeater).CondVolFlowRate; @@ -510,7 +510,7 @@ namespace PlantCentralGSHP { } } else { if (this->ChillerHeater(NumChillerHeater).CondVolFlowRateWasAutoSized) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Size ChillerHeaterPerformance:Electric:EIR=\"" + this->ChillerHeater(NumChillerHeater).Name + "\", autosize error."); ShowContinueError(state, "Autosizing of CGSHP Chiller Heater condenser flow rate requires"); @@ -518,7 +518,7 @@ namespace PlantCentralGSHP { ErrorsFound = true; } } else { - if (this->ChillerHeater(NumChillerHeater).CondVolFlowRate > 0.0 && DataPlant::PlantFinalSizesOkayToReport && + if (this->ChillerHeater(NumChillerHeater).CondVolFlowRate > 0.0 && state.dataPlnt->PlantFinalSizesOkayToReport && !this->mySizesReported) { BaseSizer::reportSizerOutput(state, "ChillerHeaterPerformance:Electric:EIR", this->ChillerHeater(NumChillerHeater).Name, @@ -528,7 +528,7 @@ namespace PlantCentralGSHP { } } - if (DataPlant::PlantFinalSizesOkayToReport && !this->mySizesReported) { + if (state.dataPlnt->PlantFinalSizesOkayToReport && !this->mySizesReported) { // create predefined report std::string equipName = this->ChillerHeater(NumChillerHeater).Name; OutputReportPredefined::PreDefTableEntry(state, @@ -559,7 +559,7 @@ namespace PlantCentralGSHP { // save the reference condenser water volumetric flow rate for use by the condenser water loop sizing algorithms PlantUtilities::RegisterPlantCompDesignFlow(this->GLHEInletNodeNum, TotalCondVolFlowRate); - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { this->mySizesReported = true; } @@ -1575,7 +1575,7 @@ namespace PlantCentralGSHP { this->MyWrapperFlag = false; } - if (this->MyWrapperEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyWrapperEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { if (this->ControlMode == SmartMixing) { diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index b3f01c9d862..906a436f437 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -842,7 +842,7 @@ namespace PlantChillers { this->MyFlag = false; } - if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, @@ -1060,18 +1060,18 @@ namespace PlantChillers { } else { if (this->NomCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCapWasAutoSized) { this->NomCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Design Size Nominal Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Initial Design Size Nominal Capacity [W]", tmpNomCap); } } else { if (this->NomCap > 0.0 && tmpNomCap > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Design Size Nominal Capacity [W]", @@ -1093,12 +1093,12 @@ namespace PlantChillers { } } } else { - if (this->NomCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->NomCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Electric Chiller nominal capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Electric Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->NomCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->NomCap > 0.0)) { + if (!this->NomCapWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->NomCap > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "User-Specified Nominal Capacity [W]", this->NomCap); } } @@ -1110,20 +1110,20 @@ namespace PlantChillers { } else { if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->EvapVolFlowRateWasAutoSized) { this->EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Initial Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } } else { if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", @@ -1149,12 +1149,12 @@ namespace PlantChillers { } } } else { - if (this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Electric Chiller evap flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Electric Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { + if (!this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "User-Specified Design Chilled Water Flow Rate [m3/s]", this->EvapVolFlowRate); } @@ -1179,20 +1179,20 @@ namespace PlantChillers { } else { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->CondVolFlowRateWasAutoSized) { this->CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Initial Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", @@ -1218,13 +1218,13 @@ namespace PlantChillers { } } } else { - if (this->CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Electric Chiller condenser flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Electric Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { + if (!this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "User-Specified Design Condenser Water Flow Rate [m3/s]", this->CondVolFlowRate); } @@ -1241,20 +1241,20 @@ namespace PlantChillers { if (this->HeatRecActive) { Real64 tmpHeatRecVolFlowRate = this->CondVolFlowRate * this->HeatRecCapacityFraction; if (!this->DesignHeatRecVolFlowRateWasAutoSized) tmpHeatRecVolFlowRate = this->DesignHeatRecVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->DesignHeatRecVolFlowRateWasAutoSized) { this->DesignHeatRecVolFlowRate = tmpHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Initial Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } } else { if (this->DesignHeatRecVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:Electric", this->Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", @@ -1284,7 +1284,7 @@ namespace PlantChillers { PlantUtilities::RegisterPlantCompDesignFlow(this->HeatRecInletNodeNum, tmpHeatRecVolFlowRate); } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->Name, "Chiller:Electric"); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomEff, this->Name, this->COP); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, this->Name, this->NomCap); @@ -2784,7 +2784,7 @@ namespace PlantChillers { } // Initialize critical Demand Side Variables - if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, @@ -2960,18 +2960,18 @@ namespace PlantChillers { } else { if (this->NomCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCapWasAutoSized) { this->NomCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Design Size Nominal Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Initial Design Size Nominal Capacity [W]", tmpNomCap); } } else { if (this->NomCap > 0.0 && tmpNomCap > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Design Size Nominal Capacity [W]", @@ -2993,12 +2993,12 @@ namespace PlantChillers { } } } else { - if (this->NomCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->NomCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Engine Driven Chiller nominal capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Engine Driven Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->NomCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->NomCap > 0.0)) { + if (!this->NomCapWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->NomCap > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "User-Specified Nominal Capacity [W]", this->NomCap); } } @@ -3009,19 +3009,19 @@ namespace PlantChillers { } else { if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->EvapVolFlowRateWasAutoSized) { this->EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Initial Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } } else { if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", @@ -3047,12 +3047,12 @@ namespace PlantChillers { } } } else { - if (this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Engine Driven Chiller evap flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Engine Driven Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { + if (!this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "User-Specified Design Chilled Water Flow Rate [m3/s]", this->EvapVolFlowRate); } @@ -3077,20 +3077,20 @@ namespace PlantChillers { } else { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->CondVolFlowRateWasAutoSized) { this->CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Initial Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", @@ -3116,13 +3116,13 @@ namespace PlantChillers { } } } else { - if (this->CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of EngineDriven Chiller condenser flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object"); ShowContinueError(state, "Occurs in EngineDriven Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { + if (!this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "User-Specified Design Condenser Water Flow Rate [m3/s]", this->CondVolFlowRate); } @@ -3136,14 +3136,14 @@ namespace PlantChillers { // autosize support for heat recovery flow rate. if (this->HeatRecActive) { Real64 tmpHeatRecVolFlowRate = tmpCondVolFlowRate * this->HeatRecCapacityFraction; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->DesignHeatRecVolFlowRateWasAutoSized) { this->DesignHeatRecVolFlowRate = tmpHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, "Initial Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", @@ -3152,7 +3152,7 @@ namespace PlantChillers { } else { if (this->DesignHeatRecVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { Real64 DesignHeatRecVolFlowRateUser = this->DesignHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "Chiller:EngineDriven", this->Name, @@ -3190,7 +3190,7 @@ namespace PlantChillers { PlantUtilities::RegisterPlantCompDesignFlow(this->HeatRecInletNodeNum, tmpHeatRecVolFlowRate); } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->Name, "Chiller:EngineDriven"); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomEff, this->Name, this->COP); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, this->Name, this->NomCap); @@ -4652,7 +4652,7 @@ namespace PlantChillers { this->MyFlag = false; } - if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, @@ -4827,18 +4827,18 @@ namespace PlantChillers { } else { if (this->NomCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCapWasAutoSized) { this->NomCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Design Size Nominal Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Initial Design Size Nominal Capacity [W]", tmpNomCap); } } else { if (this->NomCap > 0.0 && tmpNomCap > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Design Size Nominal Capacity [W]", @@ -4860,12 +4860,12 @@ namespace PlantChillers { } } } else { - if (this->NomCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->NomCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Gas Turbine Chiller nominal capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Gas Turbine Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->NomCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->NomCap > 0.0)) { + if (!this->NomCapWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->NomCap > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "User-Specified Design Size Nominal Capacity [W]", this->NomCap); } @@ -4877,20 +4877,20 @@ namespace PlantChillers { } else { if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->EvapVolFlowRateWasAutoSized) { this->EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Design size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Initial Design size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } } else { if (this->EvapVolFlowRate > 0.0 && tmpEvapVolFlowRate > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Design size Design Chilled Water Flow Rate [m3/s]", @@ -4916,12 +4916,12 @@ namespace PlantChillers { } } } else { - if (this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Gas Turbine Chiller evap flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Gas Turbine Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { + if (!this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "User-Specified Design Chilled Water Flow Rate [m3/s]", this->EvapVolFlowRate); } @@ -4945,14 +4945,14 @@ namespace PlantChillers { } else { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->CondVolFlowRateWasAutoSized) { this->CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Initial Design Size Design Condenser Water Flow Rate [m3/s]", @@ -4960,7 +4960,7 @@ namespace PlantChillers { } } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", @@ -4986,13 +4986,13 @@ namespace PlantChillers { } } } else { - if (this->CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Gas Turbine Chiller condenser flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Gas Turbine Chiller object=" + this->Name); ErrorsFound = true; } - if (!this->CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { + if (!this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "User-Specified Design Condenser Water Flow Rate [m3/s]", this->CondVolFlowRate); } @@ -5002,20 +5002,20 @@ namespace PlantChillers { PlantUtilities::RegisterPlantCompDesignFlow(this->CondInletNodeNum, tmpCondVolFlowRate); Real64 GTEngineCapacityDes = this->NomCap / (this->engineCapacityScalar * this->COP); - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->GTEngineCapacityWasAutoSized) { this->GTEngineCapacity = GTEngineCapacityDes; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Design Size Gas Turbine Engine Capacity [W]", GTEngineCapacityDes); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Initial Design Size Gas Turbine Engine Capacity [W]", GTEngineCapacityDes); } } else { if (this->GTEngineCapacity > 0.0 && GTEngineCapacityDes > 0.0) { - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Design Size Gas Turbine Engine Capacity [W]", @@ -5041,16 +5041,16 @@ namespace PlantChillers { // autosize support for heat recovery flow rate. if (this->HeatRecActive) { Real64 tmpHeatRecVolFlowRate = this->CondVolFlowRate * this->HeatRecCapacityFraction; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->DesignHeatRecVolFlowRateWasAutoSized) { this->DesignHeatRecVolFlowRate = tmpHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", tmpHeatRecVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, "Initial Design Size Design Heat Recovery Fluid Flow Rate [m3/s]", @@ -5059,7 +5059,7 @@ namespace PlantChillers { } else { if (this->DesignHeatRecVolFlowRate > 0.0 && tmpHeatRecVolFlowRate > 0.0) { Real64 DesignHeatRecVolFlowRateUser = this->DesignHeatRecVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, "Chiller:CombustionTurbine", this->Name, @@ -5097,7 +5097,7 @@ namespace PlantChillers { PlantUtilities::RegisterPlantCompDesignFlow(this->HeatRecInletNodeNum, tmpHeatRecVolFlowRate); } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->Name, "Chiller:CombustionTurbine"); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomEff, this->Name, this->COP); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, this->Name, this->NomCap); @@ -6335,7 +6335,7 @@ namespace PlantChillers { } // Initialize critical Demand Side Variables at the beginning of each environment - if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->CWLoopNum).FluidName, @@ -6480,19 +6480,19 @@ namespace PlantChillers { } else { if (this->NomCapWasAutoSized) tmpNomCap = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->NomCapWasAutoSized) { this->NomCap = tmpNomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "Design Size Nominal Capacity [W]", tmpNomCap); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "Initial Design Size Nominal Capacity [W]", tmpNomCap); } } else { // Hard-size with sizing data if (this->NomCap > 0.0 && tmpNomCap > 0.0) { NomCapUser = this->NomCap; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "Design Size Nominal Capacity [W]", @@ -6514,12 +6514,12 @@ namespace PlantChillers { } } } else { - if (this->NomCapWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->NomCapWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Constant COP Chiller nominal capacity requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Chiller:ConstantCOP object=" + this->Name); ErrorsFound = true; } - if (!this->NomCapWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->NomCap > 0.0)) { + if (!this->NomCapWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->NomCap > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "User-Specified Nominal Capacity [W]", this->NomCap); } } @@ -6530,21 +6530,21 @@ namespace PlantChillers { } else { if (this->EvapVolFlowRateWasAutoSized) tmpEvapVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->EvapVolFlowRateWasAutoSized) { this->EvapVolFlowRate = tmpEvapVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", tmpEvapVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", 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) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "Design Size Design Chilled Water Flow Rate [m3/s]", @@ -6570,12 +6570,12 @@ namespace PlantChillers { } } } else { - if (this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Constant COP Chiller evap flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Chiller:ConstantCOP object=" + this->Name); ErrorsFound = true; } - if (!this->EvapVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { + if (!this->EvapVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->EvapVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "User-Specified Design Chilled Water Flow Rate [m3/s]", this->EvapVolFlowRate); } @@ -6594,21 +6594,21 @@ namespace PlantChillers { } else { if (this->CondVolFlowRateWasAutoSized) tmpCondVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->CondVolFlowRateWasAutoSized) { this->CondVolFlowRate = tmpCondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "Initial Design Size Design Condenser Water Flow Rate [m3/s]", tmpCondVolFlowRate); } } else { if (this->CondVolFlowRate > 0.0 && tmpCondVolFlowRate > 0.0) { Real64 CondVolFlowRateUser = this->CondVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "Design Size Design Condenser Water Flow Rate [m3/s]", @@ -6634,13 +6634,13 @@ namespace PlantChillers { } } } else { - if (this->CondVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of Constant COP Chiller condenser flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object"); ShowContinueError(state, "Occurs in Chiller:ConstantCOP object=" + this->Name); ErrorsFound = true; } - if (!this->CondVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { + if (!this->CondVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport && (this->CondVolFlowRate > 0.0)) { BaseSizer::reportSizerOutput(state, "Chiller:ConstantCOP", this->Name, "User-Specified Design Condenser Water Flow Rate [m3/s]", this->CondVolFlowRate); } @@ -6656,7 +6656,7 @@ namespace PlantChillers { } // create predefined report - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->Name, "Chiller:ConstantCOP"); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomEff, this->Name, this->COP); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, this->Name, this->NomCap); diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.cc b/src/EnergyPlus/PlantComponentTemperatureSources.cc index cf8c1ad07c8..ef89d8c913b 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.cc +++ b/src/EnergyPlus/PlantComponentTemperatureSources.cc @@ -169,7 +169,7 @@ namespace PlantComponentTemperatureSources { } // Initialize critical Demand Side Variables at the beginning of each environment - if (this->MyEnvironFlag && state.dataGlobal->BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (this->MyEnvironFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->Location.loopNum).FluidName, @@ -309,21 +309,21 @@ namespace PlantComponentTemperatureSources { } else { if (this->DesVolFlowRateWasAutoSized) tmpVolFlowRate = 0.0; } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->DesVolFlowRateWasAutoSized) { this->DesVolFlowRate = tmpVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "PlantComponent:TemperatureSource", this->Name, "Design Size Design Fluid Flow Rate [m3/s]", tmpVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "PlantComponent:TemperatureSource", this->Name, "Initial Design Size Design Fluid Flow Rate [m3/s]", tmpVolFlowRate); } } else { if (this->DesVolFlowRate > 0.0 && tmpVolFlowRate > 0.0) { DesVolFlowRateUser = this->DesVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "PlantComponent:TemperatureSource", this->Name, "Design Size Design Fluid Flow Rate [m3/s]", @@ -346,12 +346,12 @@ namespace PlantComponentTemperatureSources { } } } else { - if (this->DesVolFlowRateWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->DesVolFlowRateWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "Autosizing of plant component temperature source flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in PlantComponent:TemperatureSource object=" + this->Name); ErrorsFound = true; } - if (!this->DesVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport) { + if (!this->DesVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport) { if (this->DesVolFlowRate > 0.0) { BaseSizer::reportSizerOutput(state, "PlantComponent:TemperatureSource", this->Name, "User-Specified Design Fluid Flow Rate [m3/s]", this->DesVolFlowRate); diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 1a76468fc77..cb96a240e71 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -418,7 +418,7 @@ namespace EnergyPlus::PlantCondLoopOperation { } // Load the Plant data structure - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { PlantOpSchemeName = state.dataPlnt->PlantLoop(LoopNum).OperationScheme; if (LoopNum <= NumPlantLoops) { CurrentModuleObject = "PlantEquipmentOperationSchemes"; @@ -462,7 +462,7 @@ CurrentModuleObject, PlantOpSchemeName); CompSetPtBasedSchemeType; // set this to component based as it will be converted to this } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:USERDEFINED") { state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = EMSOpSchemeType; - AnyEMSPlantOpSchemesInModel = true; + state.dataPlnt->AnyEMSPlantOpSchemesInModel = true; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORDRYBULB") { state.dataPlnt->PlantLoop(LoopNum).OpScheme(Num).OpSchemeType = DryBulbRBOpSchemeType; } else if (plantLoopOperation == "PLANTEQUIPMENTOPERATION:OUTDOORWETBULB") { @@ -674,7 +674,7 @@ CurrentModuleObject, PlantOpSchemeName); // extend number of equipment lists to include one for each CSPBO NumSchemeLists += CSPBO + TESSPBO + NumUserDefOpSchemes; - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (SchemeNum = 1; SchemeNum <= state.dataPlnt->PlantLoop(LoopNum).NumOpSchemes; ++SchemeNum) { { @@ -1863,7 +1863,7 @@ CurrentModuleObject, PlantOpSchemeName); // and the same component in the PlantLoop.LoopSide.Branch.Comp() data structure // first loop over main operation scheme data and finish filling out indexes to plant topology for the components in the lists - for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (int LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1, OpNum_end = this_plant_loop.NumOpSchemes; OpNum <= OpNum_end; ++OpNum) { auto &this_op_scheme(this_plant_loop.OpScheme(OpNum)); @@ -1927,7 +1927,7 @@ CurrentModuleObject, PlantOpSchemeName); } // loop // second loop, fill op schemes info at each component. - for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (int LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1, OpNum_end = this_plant_loop.NumOpSchemes; OpNum <= OpNum_end; ++OpNum) { auto &this_op_scheme(this_plant_loop.OpScheme(OpNum)); @@ -1991,7 +1991,7 @@ CurrentModuleObject, PlantOpSchemeName); } // loop // check the pointers to see if a single component is attached to more than one type of control scheme - for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (int LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { auto const &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { auto const &this_loop_side(this_plant_loop.LoopSide(LoopSideNum)); @@ -2025,7 +2025,7 @@ CurrentModuleObject, PlantOpSchemeName); } // fill out information on which equipment list is the "last" meaning it has the highest upper limit for load range - for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (int LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1, OpNum_end = this_plant_loop.NumOpSchemes; OpNum <= OpNum_end; ++OpNum) { auto &this_op_scheme(this_plant_loop.OpScheme(OpNum)); @@ -2046,8 +2046,8 @@ CurrentModuleObject, PlantOpSchemeName); InitLoadDistributionOneTimeFlag = false; } - if (AnyEMSPlantOpSchemesInModel) { // Execute any Initialization EMS program calling managers for User-Defined operation. - for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + if (state.dataPlnt->AnyEMSPlantOpSchemesInModel) { // Execute any Initialization EMS program calling managers for User-Defined operation. + for (int LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1, OpNum_end = this_plant_loop.NumOpSchemes; OpNum <= OpNum_end; ++OpNum) { auto &this_op_scheme(this_plant_loop.OpScheme(OpNum)); @@ -2069,7 +2069,7 @@ CurrentModuleObject, PlantOpSchemeName); // FIRST HVAC INITS if (FirstHVACIteration) { - for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (int LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { auto &this_loop_side(this_plant_loop.LoopSide(LoopSideNum)); @@ -2093,7 +2093,7 @@ CurrentModuleObject, PlantOpSchemeName); } } // Update the OpScheme schedules - for (int LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (int LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { FoundScheme = false; auto &this_loop(state.dataPlnt->PlantLoop(LoopNum)); for (int OpNum = 1; OpNum <= this_loop.NumOpSchemes; ++OpNum) { @@ -3305,7 +3305,7 @@ CurrentModuleObject, PlantOpSchemeName); int BranchNum; int CompNum; - for (LoopNum = 1; LoopNum <= TotNumLoops; ++LoopNum) { + for (LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { ActuatorName = "Plant Loop Overall"; UniqueIDName = state.dataPlnt->PlantLoop(LoopNum).Name; ActuatorType = "On/Off Supervisory"; diff --git a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc index d01d0ac7be6..23128b83f43 100644 --- a/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc +++ b/src/EnergyPlus/PlantHeatExchangerFluidToFluid.cc @@ -783,7 +783,7 @@ namespace PlantHeatExchangerFluidToFluid { this->MyFlag = false; } // plant setup - if (state.dataGlobal->BeginEnvrnFlag && this->MyEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (state.dataGlobal->BeginEnvrnFlag && this->MyEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->DemandSideLoop.loopNum).FluidName, @@ -863,25 +863,25 @@ namespace PlantHeatExchangerFluidToFluid { if (PltSizNumSupSide > 0) { if (DataSizing::PlantSizData(PltSizNumSupSide).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { tmpSupSideDesignVolFlowRate = DataSizing::PlantSizData(PltSizNumSupSide).DesVolFlowRate * this->SizingFactor; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->SupplySideLoop.DesignVolumeFlowRate = tmpSupSideDesignVolFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->SupplySideLoop.DesignVolumeFlowRate = tmpSupSideDesignVolFlowRate; } else { tmpSupSideDesignVolFlowRate = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->SupplySideLoop.DesignVolumeFlowRate = tmpSupSideDesignVolFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->SupplySideLoop.DesignVolumeFlowRate = tmpSupSideDesignVolFlowRate; } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatExchanger:FluidToFluid", this->Name, "Loop Supply Side Design Fluid Flow Rate [m3/s]", this->SupplySideLoop.DesignVolumeFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatExchanger:FluidToFluid", this->Name, "Initial Loop Supply Side Design Fluid Flow Rate [m3/s]", this->SupplySideLoop.DesignVolumeFlowRate); } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "SizeFluidHeatExchanger: Autosizing of requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in heat exchanger object=" + this->Name); } @@ -894,18 +894,18 @@ namespace PlantHeatExchangerFluidToFluid { if (this->DemandSideLoop.DesignVolumeFlowRateWasAutoSized) { if (tmpSupSideDesignVolFlowRate > DataHVACGlobals::SmallWaterVolFlow) { tmpDmdSideDesignVolFlowRate = tmpSupSideDesignVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->DemandSideLoop.DesignVolumeFlowRate = tmpDmdSideDesignVolFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DemandSideLoop.DesignVolumeFlowRate = tmpDmdSideDesignVolFlowRate; } else { tmpDmdSideDesignVolFlowRate = 0.0; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->DemandSideLoop.DesignVolumeFlowRate = tmpDmdSideDesignVolFlowRate; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->DemandSideLoop.DesignVolumeFlowRate = tmpDmdSideDesignVolFlowRate; } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatExchanger:FluidToFluid", this->Name, "Loop Demand Side Design Fluid Flow Rate [m3/s]", this->DemandSideLoop.DesignVolumeFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatExchanger:FluidToFluid", this->Name, "Initial Loop Demand Side Design Fluid Flow Rate [m3/s]", @@ -954,11 +954,11 @@ namespace PlantHeatExchangerFluidToFluid { RoutineName); Real64 tmpDesCap = Cp * rho * tmpDeltaTSupLoop * tmpSupSideDesignVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) this->UA = tmpDesCap / tmpDeltaTloopToLoop; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->UA = tmpDesCap / tmpDeltaTloopToLoop; } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) this->UA = 0.0; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->UA = 0.0; } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatExchanger:FluidToFluid", this->Name, "Heat Exchanger U-Factor Times Area Value [W/C]", this->UA); BaseSizer::reportSizerOutput(state, "HeatExchanger:FluidToFluid", @@ -966,7 +966,7 @@ namespace PlantHeatExchangerFluidToFluid { "Loop-to-loop Temperature Difference Used to Size Heat Exchanger U-Factor Times Area Value [C]", tmpDeltaTloopToLoop); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, "HeatExchanger:FluidToFluid", this->Name, "Initial Heat Exchanger U-Factor Times Area Value [W/C]", this->UA); BaseSizer::reportSizerOutput(state, @@ -976,7 +976,7 @@ namespace PlantHeatExchangerFluidToFluid { tmpDeltaTloopToLoop); } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "SizeFluidHeatExchanger: Autosizing of heat Exchanger UA requires a loop Sizing:Plant objects for both loops"); ShowContinueError(state, "Occurs in heat exchanger object=" + this->Name); } @@ -984,7 +984,7 @@ namespace PlantHeatExchangerFluidToFluid { } // size capacities for load range based op schemes - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (PltSizNumSupSide > 0) { { @@ -1042,7 +1042,7 @@ namespace PlantHeatExchangerFluidToFluid { this->calculate(state, SupSideMdot, DmdSideMdot); this->SupplySideLoop.MaxLoad = std::abs(this->HeatTransferRate); } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->Name, "HeatExchanger:FluidToFluid"); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomCap, this->Name, this->SupplySideLoop.MaxLoad); } diff --git a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc index b515f3a228c..69f6cabcf2c 100644 --- a/src/EnergyPlus/PlantLoopHeatPumpEIR.cc +++ b/src/EnergyPlus/PlantLoopHeatPumpEIR.cc @@ -483,7 +483,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { this->oneTimeInit = false; } // plant setup - if (state.dataGlobal->BeginEnvrnFlag && this->envrnInit && DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataGlobal->BeginEnvrnFlag && this->envrnInit && state.dataPlnt->PlantFirstSizesOkayToFinalize) { Real64 rho = FluidProperties::GetDensityGlycol(state, state.dataPlnt->PlantLoop(this->loadSideLocation.loopNum).FluidName, DataGlobalConstants::InitConvTemp, @@ -596,15 +596,15 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { if (this->loadSideDesignVolFlowRateWasAutoSized) tmpLoadVolFlow = 0.0; } // now we actually need to store and report out the values - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { // handle the auto-sizable reference capacity if (this->referenceCapacityWasAutoSized) { // if auto-sized, we just need to store the sized value and then report out the capacity when plant is ready this->referenceCapacity = tmpCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "Design Size Nominal Capacity [W]", tmpCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "Initial Design Size Nominal Capacity [W]", tmpCapacity); } } else { @@ -612,7 +612,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { if (this->referenceCapacity > 0.0 && tmpCapacity > 0.0) { // then the capacity was hard-sized to a good value and the tmpCapacity was calculated to a good value too Real64 hardSizedCapacity = this->referenceCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, typeName, this->name, @@ -641,16 +641,16 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { // now handle the auto-sizable load side flow rate if (this->loadSideDesignVolFlowRateWasAutoSized) { this->loadSideDesignVolFlowRate = tmpLoadVolFlow; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "Design Size Load Side Volume Flow Rate [m3/s]", tmpLoadVolFlow); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "Initial Design Size Load Side Volume Flow Rate [m3/s]", tmpLoadVolFlow); } } else { if (this->loadSideDesignVolFlowRate > 0.0 && tmpLoadVolFlow > 0.0) { Real64 hardSizedLoadSideFlow = this->loadSideDesignVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, typeName, this->name, @@ -685,12 +685,12 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { if (this->companionHeatPumpCoil->loadSideDesignVolFlowRateWasAutoSized && this->companionHeatPumpCoil->loadSideDesignVolFlowRate > 0.0) { tmpLoadVolFlow = this->companionHeatPumpCoil->loadSideDesignVolFlowRate; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->loadSideDesignVolFlowRate = tmpLoadVolFlow; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "Design Size Load Side Volume Flow Rate [m3/s]", tmpLoadVolFlow); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "Initial Design Size Load Side Volume Flow Rate [m3/s]", tmpLoadVolFlow); } @@ -698,12 +698,12 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { } if (this->companionHeatPumpCoil->referenceCapacityWasAutoSized && this->companionHeatPumpCoil->referenceCapacity > 0.0) { tmpCapacity = this->companionHeatPumpCoil->referenceCapacity; - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->referenceCapacity = tmpCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "Design Size Nominal Capacity [W]", tmpCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "Initial Design Size Nominal Capacity [W]", tmpCapacity); } } @@ -711,16 +711,16 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { } else { // no companion coil, and no plant sizing, so can't do anything if ((this->loadSideDesignVolFlowRateWasAutoSized || this->referenceCapacityWasAutoSized) && - DataPlant::PlantFirstSizesOkayToFinalize) { + state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, "EIRPlantLoopHeatPump::size(): Autosizing requires a loop Sizing:Plant object."); ShowContinueError(state, "Occurs in HeatPump:PlantLoop:EquationFit:Cooling object = " + this->name); errorsFound = true; } } - if (!this->loadSideDesignVolFlowRateWasAutoSized && DataPlant::PlantFinalSizesOkayToReport) { + if (!this->loadSideDesignVolFlowRateWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "User-Specified Load Side Flow Rate [m3/s]", this->loadSideDesignVolFlowRate); } - if (!this->referenceCapacityWasAutoSized && DataPlant::PlantFinalSizesOkayToReport) { + if (!this->referenceCapacityWasAutoSized && state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "User-Specified Nominal Capacity [W]", this->referenceCapacity); } } @@ -778,17 +778,17 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { } if (this->sourceSideDesignVolFlowRateWasAutoSized) { this->sourceSideDesignVolFlowRate = tmpSourceVolFlow; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "Design Size Source Side Volume Flow Rate [m3/s]", tmpSourceVolFlow); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, typeName, this->name, "Initial Design Size Source Side Volume Flow Rate [m3/s]", tmpSourceVolFlow); } } else { // source design flow was hard-sized if (this->sourceSideDesignVolFlowRate > 0.0 && tmpSourceVolFlow > 0.0) { Real64 const hardSizedSourceSideFlow = this->sourceSideDesignVolFlowRate; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { if (state.dataGlobal->DoPlantSizing) { BaseSizer::reportSizerOutput(state, typeName, this->name, @@ -823,7 +823,7 @@ namespace EnergyPlus::EIRPlantLoopHeatPumps { PlantUtilities::RegisterPlantCompDesignFlow(this->loadSideNodes.inlet, tmpLoadVolFlow); PlantUtilities::RegisterPlantCompDesignFlow(this->sourceSideNodes.inlet, tmpSourceVolFlow / 0.5); - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { // create predefined report OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechType, this->name, typeName); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMechNomEff, this->name, this->referenceCOP); diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index e862f5d1cf3..26cd8ad62a4 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -266,7 +266,7 @@ namespace PlantUtilities { if (DataLoopNode::Node(InletNode).MassFlowRateMax >= 0.0) { DataLoopNode::Node(OutletNode).MassFlowRateMaxAvail = min(DataLoopNode::Node(InletNode).MassFlowRateMaxAvail, DataLoopNode::Node(InletNode).MassFlowRateMax); } else { - if (!state.dataGlobal->SysSizingCalc && DataPlant::PlantFirstSizesOkayToFinalize) { + if (!state.dataGlobal->SysSizingCalc && state.dataPlnt->PlantFirstSizesOkayToFinalize) { // throw error for developers, need to change a component model to set hardware limits on inlet if (!DataLoopNode::Node(InletNode).plantNodeErrorMsgIssued) { ShowSevereError(state, "SetComponentFlowRate: check component model implementation for component with inlet node named=" + @@ -584,7 +584,7 @@ namespace PlantUtilities { // PURPOSE OF THIS FUNCTION: // Similar to CheckPlantMixerSplitterConsistency, but used to decide if plant needs to iterate again - for (int LoopNum = 1; LoopNum <= DataPlant::TotNumLoops; ++LoopNum) { + for (int LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (int LoopSide = DataPlant::DemandSide; LoopSide <= DataPlant::SupplySide; ++LoopSide) { if (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Splitter.Exists) { int const SplitterInletNode = state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSide).Splitter.NodeNumIn; @@ -911,7 +911,7 @@ namespace PlantUtilities { // Initially this routine is used as a quick replacement for the FlowLock=0 and FlowLock=1 statements // in order to provide the same behavior through phase I of the demand side rewrite // Eventually this routine may be employed again to quickly initialize all loops once phase III is complete - for (int LoopNum = 1; LoopNum <= DataPlant::TotNumLoops; ++LoopNum) { + for (int LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (int LoopSideNum = 1; LoopSideNum <= isize(state.dataPlnt->PlantLoop(LoopNum).LoopSide); ++LoopSideNum) { state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock = Value; } @@ -930,7 +930,7 @@ namespace PlantUtilities { // PURPOSE OF THIS SUBROUTINE: // This subroutine will reset all interconnected (air, zone, etc.) sim flags for both loopsides of all loops - for (int LoopNum = 1; LoopNum <= DataPlant::TotNumLoops; ++LoopNum) { + for (int LoopNum = 1; LoopNum <= state.dataPlnt->TotNumLoops; ++LoopNum) { for (auto &e : state.dataPlnt->PlantLoop(LoopNum).LoopSide) { e.SimAirLoopsNeeded = false; e.SimZoneEquipNeeded = false; @@ -1386,28 +1386,28 @@ namespace PlantUtilities { if (OldIndex == NewIndex) { // do nothing, no shift needed. - } else if ((OldIndex == 1) && (NewIndex > OldIndex) && (NewIndex < TotNumHalfLoops)) { + } else if ((OldIndex == 1) && (NewIndex > OldIndex) && (NewIndex < state.dataPlnt->TotNumHalfLoops)) { // example was: 1 2 3 4 5 6 7 8 (with OI = 1, NI = 5) // example shifted: 2 3 4 5 1 6 7 8 PlantCallingOrderInfo({1, NewIndex - 1}) = TempPlantCallingOrderInfo({2, NewIndex}); PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; - PlantCallingOrderInfo({NewIndex + 1, TotNumHalfLoops}) = TempPlantCallingOrderInfo({NewIndex + 1, TotNumHalfLoops}); + PlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}); - } else if ((OldIndex == 1) && (NewIndex > OldIndex) && (NewIndex == TotNumHalfLoops)) { + } else if ((OldIndex == 1) && (NewIndex > OldIndex) && (NewIndex == state.dataPlnt->TotNumHalfLoops)) { // example was: 1 2 3 4 5 6 7 8 (with OI = 1, NI = 8) // example shifted: 2 3 4 5 6 7 8 1 PlantCallingOrderInfo({1, NewIndex - 1}) = TempPlantCallingOrderInfo({2, NewIndex}); PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; - } else if ((OldIndex > 1) && (NewIndex > OldIndex) && (NewIndex < TotNumHalfLoops)) { + } else if ((OldIndex > 1) && (NewIndex > OldIndex) && (NewIndex < state.dataPlnt->TotNumHalfLoops)) { // example was: 1 2 3 4 5 6 7 8 (with OI = 3, NI = 6) // example shifted: 1 2 4 5 6 3 7 8 PlantCallingOrderInfo({1, OldIndex - 1}) = TempPlantCallingOrderInfo({1, OldIndex - 1}); PlantCallingOrderInfo({OldIndex, NewIndex - 1}) = TempPlantCallingOrderInfo({OldIndex + 1, NewIndex}); PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; - PlantCallingOrderInfo({NewIndex + 1, TotNumHalfLoops}) = TempPlantCallingOrderInfo({NewIndex + 1, TotNumHalfLoops}); - } else if ((OldIndex > 1) && (NewIndex > OldIndex) && (NewIndex == TotNumHalfLoops)) { + PlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}); + } else if ((OldIndex > 1) && (NewIndex > OldIndex) && (NewIndex == state.dataPlnt->TotNumHalfLoops)) { // example was: 1 2 3 4 5 6 7 8 (with OI = 3, NI = 8) // example shifted: 1 2 4 5 6 7 8 3 PlantCallingOrderInfo({1, OldIndex - 1}) = TempPlantCallingOrderInfo({1, OldIndex - 1}); @@ -1418,7 +1418,7 @@ namespace PlantUtilities { // example shifted: 3 1 2 4 5 6 7 8 PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; PlantCallingOrderInfo({NewIndex + 1, OldIndex}) = TempPlantCallingOrderInfo({1, OldIndex - 1}); - PlantCallingOrderInfo({OldIndex + 1, TotNumHalfLoops}) = TempPlantCallingOrderInfo({OldIndex + 1, TotNumHalfLoops}); + PlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}); } else if ((OldIndex > 1) && (NewIndex < OldIndex) && (NewIndex > 1)) { // example was: 1 2 3 4 5 6 7 8 (with OI = 3, NI = 2) @@ -1426,7 +1426,7 @@ namespace PlantUtilities { PlantCallingOrderInfo({1, NewIndex - 1}) = TempPlantCallingOrderInfo({1, NewIndex - 1}); PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; PlantCallingOrderInfo({NewIndex + 1, OldIndex}) = TempPlantCallingOrderInfo({NewIndex, NewIndex + (OldIndex - NewIndex) - 1}); - PlantCallingOrderInfo({OldIndex + 1, TotNumHalfLoops}) = TempPlantCallingOrderInfo({OldIndex + 1, TotNumHalfLoops}); + PlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}); } else { ShowSevereError(state, "ShiftPlantLoopSideCallingOrder: developer error notice, caught unexpected logical case in " @@ -1768,7 +1768,7 @@ namespace PlantUtilities { FoundComponent = false; FoundCompName = false; StartingLoopNum = 1; - EndingLoopNum = DataPlant::TotNumLoops; + EndingLoopNum = state.dataPlnt->TotNumLoops; if (present(SingleLoopSearch)) { StartingLoopNum = SingleLoopSearch; EndingLoopNum = SingleLoopSearch; @@ -1888,7 +1888,7 @@ namespace PlantUtilities { } FoundNode = false; - for (LoopCtr = 1; LoopCtr <= DataPlant::TotNumLoops; ++LoopCtr) { + for (LoopCtr = 1; LoopCtr <= state.dataPlnt->TotNumLoops; ++LoopCtr) { auto &this_loop(state.dataPlnt->PlantLoop(LoopCtr)); for (LoopSideCtr = 1; LoopSideCtr <= 2; ++LoopSideCtr) { auto &this_loop_side(this_loop.LoopSide(LoopSideCtr)); @@ -1973,7 +1973,7 @@ namespace PlantUtilities { AnyPlantLoopSidesNeedSim = false; // Then check if there are any - for (LoopCtr = 1; LoopCtr <= DataPlant::TotNumLoops; ++LoopCtr) { + for (LoopCtr = 1; LoopCtr <= state.dataPlnt->TotNumLoops; ++LoopCtr) { for (LoopSideCtr = 1; LoopSideCtr <= 2; ++LoopSideCtr) { if (state.dataPlnt->PlantLoop(LoopCtr).LoopSide(LoopSideCtr).SimLoopSideNeeded) { AnyPlantLoopSidesNeedSim = true; @@ -2005,7 +2005,7 @@ namespace PlantUtilities { int LoopCtr; // Loop over all loops - for (LoopCtr = 1; LoopCtr <= DataPlant::TotNumLoops; ++LoopCtr) { + for (LoopCtr = 1; LoopCtr <= state.dataPlnt->TotNumLoops; ++LoopCtr) { auto &this_loop(state.dataPlnt->PlantLoop(LoopCtr)); this_loop.LoopSide(DataPlant::DemandSide).SimLoopSideNeeded = Value; this_loop.LoopSide(DataPlant::SupplySide).SimLoopSideNeeded = Value; @@ -2138,7 +2138,7 @@ namespace PlantUtilities { // because this is a nested loop, there's no reason it should be called except in one-time fashion int matchedIndexA = 0; int matchedIndexB = 0; - for (int loopNum = 1; loopNum <= DataPlant::TotNumLoops; loopNum++) { + for (int loopNum = 1; loopNum <= state.dataPlnt->TotNumLoops; loopNum++) { for (auto &loopSide : state.dataPlnt->PlantLoop(loopNum).LoopSide) { for (auto &branch : loopSide.Branch) { for (auto &comp : branch.Comp) { diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index 7fc888aab38..d2943ec0f8a 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -1279,7 +1279,6 @@ namespace Pumps { // Using/Aliasing using DataPlant::LoopFlowStatus_NeedyAndTurnsLoopOn; - using DataPlant::PlantReSizingCompleted; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; @@ -1437,7 +1436,7 @@ namespace Pumps { } // HVAC Sizing Simulation resizing calls if needed - if (state.dataGlobal->RedoSizesHVACSimulation && !PlantReSizingCompleted) { + if (state.dataGlobal->RedoSizesHVACSimulation && !state.dataPlnt->PlantReSizingCompleted) { SizePump(state, PumpNum); } @@ -2014,8 +2013,6 @@ namespace Pumps { // na // Using/Aliasing - using DataPlant::PlantFinalSizesOkayToReport; - using DataPlant::PlantFirstSizesOkayToReport; using DataSizing::PlantSizData; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSatDensityRefrig; @@ -2125,7 +2122,7 @@ namespace Pumps { } } else { - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { PumpEquip(PumpNum).NomVolFlowRate = 0.0; ShowWarningError(state, format("SizePump: Calculated Pump Nominal Volume Flow Rate=[{:.2R}] is too small. Set to 0.0", @@ -2133,20 +2130,20 @@ namespace Pumps { ShowContinueError(state, "..occurs for Pump=" + PumpEquip(PumpNum).Name); } } - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cPumpTypes(PumpEquip(PumpNum).PumpType), PumpEquip(PumpNum).Name, "Design Flow Rate [m3/s]", PumpEquip(PumpNum).NomVolFlowRate); } - if (PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cPumpTypes(PumpEquip(PumpNum).PumpType), PumpEquip(PumpNum).Name, "Initial Design Flow Rate [m3/s]", PumpEquip(PumpNum).NomVolFlowRate); } } else { - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { ShowSevereError(state, "Autosizing of plant loop pump flow rate requires a loop Sizing:Plant object"); ShowContinueError(state, "Occurs in plant pump object=" + PumpEquip(PumpNum).Name); ErrorsFound = true; @@ -2175,11 +2172,11 @@ namespace Pumps { } else { PumpEquip(PumpNum).NomPowerUse = 0.0; } - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cPumpTypes(PumpEquip(PumpNum).PumpType), PumpEquip(PumpNum).Name, "Design Power Consumption [W]", PumpEquip(PumpNum).NomPowerUse); } - if (PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cPumpTypes(PumpEquip(PumpNum).PumpType), PumpEquip(PumpNum).Name, "Initial Design Power Consumption [W]", @@ -2189,13 +2186,13 @@ namespace Pumps { if (PumpEquip(PumpNum).minVolFlowRateWasAutosized) { PumpEquip(PumpNum).MinVolFlowRate = PumpEquip(PumpNum).NomVolFlowRate * PumpEquip(PumpNum).MinVolFlowRateFrac; - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cPumpTypes(PumpEquip(PumpNum).PumpType), PumpEquip(PumpNum).Name, "Design Minimum Flow Rate [m3/s]", PumpEquip(PumpNum).MinVolFlowRate); } - if (PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, cPumpTypes(PumpEquip(PumpNum).PumpType), PumpEquip(PumpNum).Name, "Initial Design Minimum Flow Rate [m3/s]", @@ -2203,7 +2200,7 @@ namespace Pumps { } } - if (PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { PumpDataForTable(state, PumpNum); } diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index c125b68bdab..018bbe61b3c 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -7302,7 +7302,7 @@ namespace EnergyPlus::SetPointManager { // if plant isn't initialized, assume index=1 (water) int fluidIndex = 1; if (this->plantLoopIndex == 0) { - for (int plantIndex = 1; plantIndex <= DataPlant::TotNumLoops; plantIndex++) { + for (int plantIndex = 1; plantIndex <= state.dataPlnt->TotNumLoops; plantIndex++) { if (this->supplyNodeIndex == state.dataPlnt->PlantLoop(plantIndex).LoopSide(2).NodeNumOut) { this->plantLoopIndex = plantIndex; this->plantSetpointNodeIndex = state.dataPlnt->PlantLoop(plantIndex).TempSetPointNodeNum; @@ -7407,7 +7407,7 @@ namespace EnergyPlus::SetPointManager { // if plant isn't initialized, assume index=1 (water) int fluidIndex = 1; if (this->plantLoopIndex == 0) { - for (int plantIndex = 1; plantIndex <= DataPlant::TotNumLoops; plantIndex++) { + for (int plantIndex = 1; plantIndex <= state.dataPlnt->TotNumLoops; plantIndex++) { if (this->supplyNodeIndex == state.dataPlnt->PlantLoop(plantIndex).LoopSide(2).NodeNumOut) { this->plantLoopIndex = plantIndex; this->plantSetpointNodeIndex = state.dataPlnt->PlantLoop(plantIndex).TempSetPointNodeNum; diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 273fc0eac4c..50b0760a3cd 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -2521,7 +2521,7 @@ namespace SimulationManager { "{}\n", "! ,,,"); - for (int Count = NumPlantLoops + 1; Count <= TotNumLoops; ++Count) { + for (int Count = NumPlantLoops + 1; Count <= state.dataPlnt->TotNumLoops; ++Count) { for (int LoopSideNum = DemandSide; LoopSideNum <= SupplySide; ++LoopSideNum) { // Plant Supply Side Loop // Demandside and supplyside is parametrized in DataPlant diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 6eea80ef9a3..22a3e37262f 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -175,7 +175,7 @@ namespace WaterThermalTanks { this->SizeTankForSupplySide(state); } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (!this->IsChilledWaterTank) { this->CalcStandardRatings(state); } else { @@ -5513,7 +5513,7 @@ namespace WaterThermalTanks { if (((this->SourceInletNode > 0) && (this->DesuperheaterNum > 0)) || (this->HeatPumpNum > 0)) { this->SetLoopIndexFlag = false; } - if (DataPlant::PlantFirstSizesOkayToFinalize) this->SetLoopIndexFlag = false; + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) this->SetLoopIndexFlag = false; if (this->StandAlone) { this->SizeStandAloneWaterHeater(state); this->SetLoopIndexFlag = false; @@ -5527,7 +5527,7 @@ namespace WaterThermalTanks { if (state.dataGlobal->BeginEnvrnFlag && this->MyEnvrnFlag && !this->SetLoopIndexFlag) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { if (this->ControlType == ControlTypeEnum::Cycle) { this->MinCapacity = this->MaxCapacity; @@ -5920,14 +5920,14 @@ namespace WaterThermalTanks { // (called at end of GetWaterThermalTankInputFlag) // report autosizing information here (must be done after GetWaterThermalTankInputFlag is complete) if (state.dataWaterThermalTanks->HPWaterHeater(HPNum).WaterFlowRateAutoSized && - (DataPlant::PlantFirstSizesOkayToReport || !state.dataGlobal->AnyPlantInModel || this->AlreadyRated)) { + (state.dataPlnt->PlantFirstSizesOkayToReport || !state.dataGlobal->AnyPlantInModel || this->AlreadyRated)) { BaseSizer::reportSizerOutput(state, state.dataWaterThermalTanks->HPWaterHeater(HPNum).Type, state.dataWaterThermalTanks->HPWaterHeater(HPNum).Name, "Condenser water flow rate [m3/s]", state.dataWaterThermalTanks->HPWaterHeater(HPNum).OperatingWaterFlowRate); } if (state.dataWaterThermalTanks->HPWaterHeater(HPNum).AirFlowRateAutoSized && - (DataPlant::PlantFirstSizesOkayToReport || !state.dataGlobal->AnyPlantInModel || this->AlreadyRated)) { + (state.dataPlnt->PlantFirstSizesOkayToReport || !state.dataGlobal->AnyPlantInModel || this->AlreadyRated)) { BaseSizer::reportSizerOutput(state, state.dataWaterThermalTanks->HPWaterHeater(HPNum).Type, state.dataWaterThermalTanks->HPWaterHeater(HPNum).Name, "Evaporator air flow rate [m3/s]", @@ -5939,7 +5939,7 @@ namespace WaterThermalTanks { DataSizing::ZoneEqSizing(DataSizing::CurZoneEqNum).CoolingAirFlow = true; DataSizing::ZoneEqSizing(DataSizing::CurZoneEqNum).CoolingAirVolFlow = DataSizing::DataNonZoneNonAirloopValue; } - if (DataPlant::PlantFirstSizesOkayToReport || !state.dataGlobal->AnyPlantInModel || this->AlreadyRated) this->MyHPSizeFlag = false; + if (state.dataPlnt->PlantFirstSizesOkayToReport || !state.dataGlobal->AnyPlantInModel || this->AlreadyRated) this->MyHPSizeFlag = false; } int HPAirInletNode = state.dataWaterThermalTanks->HPWaterHeater(HPNum).HeatPumpAirInletNode; @@ -6175,7 +6175,7 @@ namespace WaterThermalTanks { if (this->IsChilledWaterTank) { this->AlreadyRated = true; } else { - if (!state.dataGlobal->AnyPlantInModel || DataPlant::PlantFirstSizesOkayToReport || this->MaxCapacity > 0.0 || this->HeatPumpNum > 0) { + if (!state.dataGlobal->AnyPlantInModel || state.dataPlnt->PlantFirstSizesOkayToReport || this->MaxCapacity > 0.0 || this->HeatPumpNum > 0) { this->CalcStandardRatings(state); } } @@ -10232,26 +10232,26 @@ namespace WaterThermalTanks { if (PltSizNum > 0) { // we have a Plant Sizing Object if (this->UseSide.loopSideNum == DataPlant::SupplySide) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->UseDesignVolFlowRate = DataSizing::PlantSizData(PltSizNum).DesVolFlowRate; } else { tmpUseDesignVolFlowRate = DataSizing::PlantSizData(PltSizNum).DesVolFlowRate; } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->UseDesignVolFlowRate = 0.0; } else { tmpUseDesignVolFlowRate = 0.0; } } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Use Side Design Flow Rate [m3/s]", this->UseDesignVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Use Side Design Flow Rate [m3/s]", this->UseDesignVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { PlantUtilities::RegisterPlantCompDesignFlow(this->UseInletNode, this->UseDesignVolFlowRate); } else { PlantUtilities::RegisterPlantCompDesignFlow(this->UseInletNode, tmpUseDesignVolFlowRate); @@ -10261,7 +10261,7 @@ namespace WaterThermalTanks { DataGlobalConstants::InitConvTemp, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; } else { this->PlantUseMassFlowRateMax = tmpUseDesignVolFlowRate * rho; @@ -10293,27 +10293,27 @@ namespace WaterThermalTanks { if (PltSizNum > 0) { if (this->SrcSide.loopSideNum == DataPlant::SupplySide) { if (DataSizing::PlantSizData(PltSizNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->SourceDesignVolFlowRate = DataSizing::PlantSizData(PltSizNum).DesVolFlowRate; } else { tmpSourceDesignVolFlowRate = DataSizing::PlantSizData(PltSizNum).DesVolFlowRate; } } else { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->SourceDesignVolFlowRate = 0.0; } else { tmpSourceDesignVolFlowRate = 0.0; } } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Source Side Design Flow Rate [m3/s]", this->SourceDesignVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Source Side Design Flow Rate [m3/s]", this->SourceDesignVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { PlantUtilities::RegisterPlantCompDesignFlow(this->SourceInletNode, this->SourceDesignVolFlowRate); } else { PlantUtilities::RegisterPlantCompDesignFlow(this->SourceInletNode, tmpSourceDesignVolFlowRate); @@ -10322,7 +10322,7 @@ namespace WaterThermalTanks { DataGlobalConstants::InitConvTemp, state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; } else { this->PlantSourceMassFlowRateMax = tmpSourceDesignVolFlowRate * rho; @@ -10520,21 +10520,21 @@ namespace WaterThermalTanks { } } - if (this->VolumeWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->VolumeWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->Volume = tmpTankVolume; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Tank Volume [m3]", this->Volume); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Tank Volume [m3]", this->Volume); } } - if (this->MaxCapacityWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->MaxCapacityWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->MaxCapacity = tmpMaxCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Maximum Heater Capacity [W]", this->MaxCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Maximum Heater Capacity [W]", this->MaxCapacity); } } @@ -10565,21 +10565,21 @@ namespace WaterThermalTanks { (1.0 / DataGlobalConstants::SecInHour) * rho * Cp; // m3/hr/person | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k } - if (this->VolumeWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->VolumeWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->Volume = tmpTankVolume; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Tank Volume [m3]", this->Volume); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Tank Volume [m3]", this->Volume); } } - if (this->MaxCapacityWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->MaxCapacityWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->MaxCapacity = tmpMaxCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Maximum Heater Capacity [W]", this->MaxCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Maximum Heater Capacity [W]", this->MaxCapacity); } } @@ -10606,21 +10606,21 @@ namespace WaterThermalTanks { tmpMaxCapacity = SumFloorAreaAllZones * this->Sizing.RecoveryCapacityPerArea * (Tfinish - Tstart) * (1.0 / DataGlobalConstants::SecInHour) * rho * Cp; // m2 | m3/hr/m2 | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k } - if (this->VolumeWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->VolumeWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->Volume = tmpTankVolume; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Tank Volume [m3]", this->Volume); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Tank Volume [m3]", this->Volume); } } - if (this->MaxCapacityWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->MaxCapacityWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->MaxCapacity = tmpMaxCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Maximum Heater Capacity [W]", this->MaxCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Maximum Heater Capacity [W]", this->MaxCapacity); } } @@ -10648,21 +10648,21 @@ namespace WaterThermalTanks { (1.0 / DataGlobalConstants::SecInHour) * rho * Cp; // m3/hr/ea | delta T in K | 1 hr/ 3600 s | kg/m3 | J/Kg/k } - if (this->VolumeWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->VolumeWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->Volume = tmpTankVolume; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Tank Volume [m3]", this->Volume); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Tank Volume [m3]", this->Volume); } } - if (this->MaxCapacityWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->MaxCapacityWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->MaxCapacity = tmpMaxCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Maximum Heater Capacity [W]", this->MaxCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Maximum Heater Capacity [W]", this->MaxCapacity); } } @@ -10672,13 +10672,13 @@ namespace WaterThermalTanks { // if stratified, might set height. if ((this->VolumeWasAutoSized) && (this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) && - DataPlant::PlantFirstSizesOkayToFinalize) { // might set height + state.dataPlnt->PlantFirstSizesOkayToFinalize) { // might set height if ((this->HeightWasAutoSized) && (!this->VolumeWasAutoSized)) { this->Height = std::pow((4.0 * this->Volume * pow_2(this->Sizing.HeightAspectRatio)) / DataGlobalConstants::Pi, 0.3333333333333333); - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Tank Height [m]", this->Height); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Tank Height [m]", this->Height); } // check if DataGlobalConstants::AutoCalculate() Use outlet and source inlet are still set to autosize by earlier @@ -10725,12 +10725,12 @@ namespace WaterThermalTanks { if (SELECT_CASE_var == SizeEnum::PeakDraw) { if (this->VolumeWasAutoSized) tmpTankVolume = this->Sizing.TankDrawTime * this->UseDesignVolFlowRate * DataGlobalConstants::SecInHour; // hours | m3/s | (3600 s/1 hour) - if (this->VolumeWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->VolumeWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->Volume = tmpTankVolume; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Tank Volume [m3]", this->Volume); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Tank Volume [m3]", this->Volume); } } @@ -10759,12 +10759,12 @@ namespace WaterThermalTanks { } } - if (this->MaxCapacityWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->MaxCapacityWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->MaxCapacity = tmpMaxCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Maximum Heater Capacity [W]", this->MaxCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Maximum Heater Capacity [W]", this->MaxCapacity); } } @@ -10777,21 +10777,21 @@ namespace WaterThermalTanks { if (this->VolumeWasAutoSized) tmpTankVolume = this->Sizing.TotalSolarCollectorArea * this->Sizing.TankCapacityPerCollectorArea; if (this->MaxCapacityWasAutoSized) tmpMaxCapacity = 0.0; - if (this->VolumeWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->VolumeWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->Volume = tmpTankVolume; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Tank Volume [m3]", this->Volume); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Tank Volume [m3]", this->Volume); } } - if (this->MaxCapacityWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { + if (this->MaxCapacityWasAutoSized && state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->MaxCapacity = tmpMaxCapacity; - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Maximum Heater Capacity [W]", this->MaxCapacity); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Maximum Heater Capacity [W]", this->MaxCapacity); } } @@ -10799,13 +10799,13 @@ namespace WaterThermalTanks { } if ((this->VolumeWasAutoSized) && (this->TypeNum == DataPlant::TypeOf_WtrHeaterStratified) && - DataPlant::PlantFirstSizesOkayToFinalize) { // might set height + state.dataPlnt->PlantFirstSizesOkayToFinalize) { // might set height if ((this->HeightWasAutoSized) && (!this->VolumeWasAutoSized)) { this->Height = std::pow((4.0 * this->Volume * pow_2(this->Sizing.HeightAspectRatio)) / DataGlobalConstants::Pi, 0.3333333333333333); - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Tank Height [m]", this->Height); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Tank Height [m]", this->Height); } } @@ -10868,7 +10868,7 @@ namespace WaterThermalTanks { Real64 Tpdesign = DataSizing::PlantSizData(PltSizNum).ExitTemp; Real64 eff = this->UseEffectiveness; if ((Tpdesign >= 58.0) && (!this->IsChilledWaterTank)) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->UseDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } else { @@ -10876,7 +10876,7 @@ namespace WaterThermalTanks { std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } } else if ((Tpdesign <= 8.0) && (this->IsChilledWaterTank)) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->UseDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } else { @@ -10897,14 +10897,14 @@ namespace WaterThermalTanks { } ErrorsFound = true; } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Use Side Design Flow Rate [m3/s]", this->UseDesignVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Use Side Design Flow Rate [m3/s]", this->UseDesignVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { PlantUtilities::RegisterPlantCompDesignFlow(this->UseInletNode, this->UseDesignVolFlowRate); } else { PlantUtilities::RegisterPlantCompDesignFlow(this->UseInletNode, tmpUseDesignVolFlowRate); @@ -10913,7 +10913,7 @@ namespace WaterThermalTanks { DataGlobalConstants::InitConvTemp, state.dataPlnt->PlantLoop(this->UseSide.loopNum).FluidIndex, RoutineName); - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->PlantUseMassFlowRateMax = this->UseDesignVolFlowRate * rho; } else { this->PlantUseMassFlowRateMax = tmpUseDesignVolFlowRate * rho; @@ -10951,7 +10951,7 @@ namespace WaterThermalTanks { Real64 eff = this->SourceEffectiveness; if ((Tpdesign >= 58.0) && (!this->IsChilledWaterTank)) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->SourceDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } else { @@ -10959,7 +10959,7 @@ namespace WaterThermalTanks { std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } } else if ((Tpdesign <= 8.0) && (this->IsChilledWaterTank)) { - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->SourceDesignVolFlowRate = -1.0 * (TankVolume / (tankRecoverhours * DataGlobalConstants::SecInHour * eff)) * std::log((Tpdesign - Tfinish) / (Tpdesign - Tstart)); } else { @@ -10980,15 +10980,15 @@ namespace WaterThermalTanks { } ErrorsFound = true; } - if (DataPlant::PlantFinalSizesOkayToReport) { + if (state.dataPlnt->PlantFinalSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Source Side Design Flow Rate [m3/s]", this->SourceDesignVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToReport) { + if (state.dataPlnt->PlantFirstSizesOkayToReport) { BaseSizer::reportSizerOutput(state, this->Type, this->Name, "Initial Source Side Design Flow Rate [m3/s]", this->SourceDesignVolFlowRate); } - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { PlantUtilities::RegisterPlantCompDesignFlow(this->SourceInletNode, this->SourceDesignVolFlowRate); } else { PlantUtilities::RegisterPlantCompDesignFlow(this->SourceInletNode, tmpSourceDesignVolFlowRate); @@ -10997,7 +10997,7 @@ namespace WaterThermalTanks { DataGlobalConstants::InitConvTemp, state.dataPlnt->PlantLoop(this->SrcSide.loopNum).FluidIndex, RoutineName); - if (DataPlant::PlantFirstSizesOkayToFinalize) { + if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { this->PlantSourceMassFlowRateMax = this->SourceDesignVolFlowRate * rho; } else { this->PlantSourceMassFlowRateMax = tmpSourceDesignVolFlowRate * rho; diff --git a/tst/EnergyPlus/unit/AdvancedAFN.unit.cc b/tst/EnergyPlus/unit/AdvancedAFN.unit.cc index 46e6973fce9..157bb654622 100644 --- a/tst/EnergyPlus/unit/AdvancedAFN.unit.cc +++ b/tst/EnergyPlus/unit/AdvancedAFN.unit.cc @@ -53,11 +53,11 @@ // EnergyPlus Headers #include #include +#include #include #include #include -#include -#include + #include "Fixtures/EnergyPlusFixture.hh" using namespace EnergyPlus; diff --git a/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc b/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc index ae0e060e7bc..cf903e750ab 100644 --- a/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc +++ b/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc @@ -52,10 +52,10 @@ #include // EnergyPlus Headers -#include #include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include #include diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc index 44b327a6993..d4dbca5d9c6 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuct.unit.cc @@ -54,15 +54,12 @@ // Google Test Headers #include -// ObjexxFCL Headers - #include "Fixtures/EnergyPlusFixture.hh" #include #include #include #include #include -#include #include #include #include diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc index 9b51a8407b6..69b990ddd2b 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc @@ -58,10 +58,11 @@ #include #include #include -#include #include #include +#include #include +#include #include #include #include @@ -71,9 +72,6 @@ #include #include -#include -#include - // EnergyPlus Headers using namespace EnergyPlus::DataDefineEquip; using namespace EnergyPlus::DataEnvironment; diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc index b71f8d20874..26b0c933573 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include @@ -7560,8 +7559,8 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) EXPECT_EQ("COIL:HEATING:WATER", thisFanCoil.HCoilType); EXPECT_EQ("FCU HEATING COIL", thisFanCoil.HCoilName); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); NumPltSizInput = 2; PlantSizData.allocate(NumPltSizInput); // chilled water coil @@ -7580,7 +7579,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) HWCoil.WaterLoopSide = 1; HWCoil.WaterLoopBranchNum = 1; HWCoil.WaterLoopCompNum = 1; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -7606,7 +7605,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) CWLoopSizingData.PlantLoopName = CWLoop.Name; CWLoopSizingData.DesVolFlowRate = 1.0; CWLoopSizingData.DeltaT = 5.6; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // hot water plant loop auto &HWLoop(state->dataPlnt->PlantLoop(1)); HWLoop.Name = "HotWaterLoop"; @@ -7623,7 +7622,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimFCU_ATMInletSideTest) HWLoopSizingData.PlantLoopName = HWLoop.Name; HWLoopSizingData.DesVolFlowRate = 1.0; HWLoopSizingData.DeltaT = 10.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; state->dataGlobal->BeginEnvrnFlag = true; state->dataGlobal->DoingSizing = true; state->dataFans->LocalTurnFansOff = false; @@ -7991,8 +7990,8 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) EXPECT_EQ("NIGHTCYCLE AVAILMGR", thisAvaiManager.Name); EXPECT_EQ(state->dataSystemAvailabilityManager->SysAvailMgr_NightCycle, thisAvaiManager.MgrType); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); NumPltSizInput = 2; PlantSizData.allocate(NumPltSizInput); // chilled water coil @@ -8011,7 +8010,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) HWCoil.WaterLoopSide = 1; HWCoil.WaterLoopBranchNum = 1; HWCoil.WaterLoopCompNum = 1; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -8037,7 +8036,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) CWLoopSizingData.PlantLoopName = CWLoop.Name; CWLoopSizingData.DesVolFlowRate = 1.0; CWLoopSizingData.DeltaT = 5.6; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // hot water plant loop auto &HWLoop(state->dataPlnt->PlantLoop(1)); HWLoop.Name = "HotWaterLoop"; @@ -8054,7 +8053,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_FCU_NightCycleTest) HWLoopSizingData.PlantLoopName = HWLoop.Name; HWLoopSizingData.DesVolFlowRate = 1.0; HWLoopSizingData.DeltaT = 10.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; state->dataGlobal->BeginEnvrnFlag = true; state->dataGlobal->DoingSizing = true; state->dataFans->LocalTurnFansOff = false; diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc index a1da1b504ae..2aca1bd9681 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctPIUReheat.unit.cc @@ -50,13 +50,9 @@ // Google Test Headers #include -// ObjexxFCL Headers - #include "Fixtures/EnergyPlusFixture.hh" #include -#include #include -#include #include #include #include diff --git a/tst/EnergyPlus/unit/AirflowNetworkBalanceManager.unit.cc b/tst/EnergyPlus/unit/AirflowNetworkBalanceManager.unit.cc index be48c200e1a..4f97a940b3d 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkBalanceManager.unit.cc @@ -57,17 +57,16 @@ #include #include #include -#include +#include #include #include -#include #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/tst/EnergyPlus/unit/AirflowNetworkSimulationControl.unit.cc b/tst/EnergyPlus/unit/AirflowNetworkSimulationControl.unit.cc index 1eb9acf5772..655a0f6543a 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkSimulationControl.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkSimulationControl.unit.cc @@ -56,18 +56,15 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/AirflowNetworkSolver.unit.cc b/tst/EnergyPlus/unit/AirflowNetworkSolver.unit.cc index 33c3ef622ac..d1352d71ea6 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkSolver.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkSolver.unit.cc @@ -51,10 +51,10 @@ #include // EnergyPlus Headers -#include -#include -#include #include +#include +#include +#include #include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc index d1fb75aca3f..33c5bad401f 100644 --- a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc @@ -52,8 +52,9 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include #include +#include +#include #include #include #include @@ -64,9 +65,6 @@ #include #include -#include -#include - using namespace EnergyPlus; using namespace EnergyPlus::DataPlant; using namespace EnergyPlus::DataSizing; diff --git a/tst/EnergyPlus/unit/BoilerHotWater.unit.cc b/tst/EnergyPlus/unit/BoilerHotWater.unit.cc index ea8c5666b2f..e8acb6ae2c6 100644 --- a/tst/EnergyPlus/unit/BoilerHotWater.unit.cc +++ b/tst/EnergyPlus/unit/BoilerHotWater.unit.cc @@ -51,13 +51,13 @@ #include // EnergyPlus Headers -#include #include -#include +#include #include #include #include #include +#include #include #include "Fixtures/EnergyPlusFixture.hh" @@ -89,7 +89,7 @@ TEST_F(EnergyPlusFixture, Boiler_HotWaterSizingTest) state->dataPlnt->PlantLoop(1).FluidName = "WATER"; DataSizing::PlantSizData(1).DesVolFlowRate = 1.0; DataSizing::PlantSizData(1).DeltaT = 10.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // now call sizing routine state->dataBoilers->Boiler(1).SizeBoiler(*state); // see if boiler volume flow rate returned is hard-sized value @@ -134,7 +134,7 @@ TEST_F(EnergyPlusFixture, Boiler_HotWaterAutoSizeTempTest) state->dataPlnt->PlantLoop(1).FluidName = "WATER"; DataSizing::PlantSizData(1).DesVolFlowRate = 1.0; DataSizing::PlantSizData(1).DeltaT = 10.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // calculate nominal capacity at 60.0 C hot water temperature Real64 rho = FluidProperties::GetDensityGlycol(*state, @@ -198,7 +198,7 @@ TEST_F(EnergyPlusFixture, Boiler_HotWater_BoilerEfficiency) bool RunFlag(true); Real64 MyLoad(1000000.0); - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = 1.20; state->dataGlobal->NumOfTimeStepInHour = 1; @@ -237,8 +237,8 @@ TEST_F(EnergyPlusFixture, Boiler_HotWater_BoilerEfficiency) EXPECT_TRUE(process_idf(idf_objects, false)); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -266,9 +266,9 @@ TEST_F(EnergyPlusFixture, Boiler_HotWater_BoilerEfficiency) DataSizing::PlantSizData(1).DesVolFlowRate = 0.1; DataSizing::PlantSizData(1).DeltaT = 10; - DataPlant::PlantFirstSizesOkayToFinalize = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; thisBoiler.InitBoiler(*state); thisBoiler.SizeBoiler(*state); diff --git a/tst/EnergyPlus/unit/BoilerSteam.unit.cc b/tst/EnergyPlus/unit/BoilerSteam.unit.cc index a579ddf7c86..ef9be537643 100644 --- a/tst/EnergyPlus/unit/BoilerSteam.unit.cc +++ b/tst/EnergyPlus/unit/BoilerSteam.unit.cc @@ -52,13 +52,13 @@ // EnergyPlus Headers #include +#include #include #include #include -#include #include +#include #include -#include #include "Fixtures/EnergyPlusFixture.hh" @@ -119,7 +119,7 @@ TEST_F(EnergyPlusFixture, BoilerSteam_BoilerEfficiency) bool RunFlag(true); Real64 MyLoad(1000000.0); - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = 1.20; state->dataGlobal->NumOfTimeStepInHour = 1; @@ -148,8 +148,8 @@ TEST_F(EnergyPlusFixture, BoilerSteam_BoilerEfficiency) EXPECT_TRUE(process_idf(idf_objects, false)); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -177,9 +177,9 @@ TEST_F(EnergyPlusFixture, BoilerSteam_BoilerEfficiency) DataSizing::PlantSizData(1).DesVolFlowRate = 0.1; DataSizing::PlantSizData(1).DeltaT = 10; - DataPlant::PlantFirstSizesOkayToFinalize = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; state->dataGlobal->BeginEnvrnFlag = true; thisBoiler.initialize(*state); diff --git a/tst/EnergyPlus/unit/BranchInputManager.unit.cc b/tst/EnergyPlus/unit/BranchInputManager.unit.cc index c540f7de876..7e00b65fd3c 100644 --- a/tst/EnergyPlus/unit/BranchInputManager.unit.cc +++ b/tst/EnergyPlus/unit/BranchInputManager.unit.cc @@ -52,9 +52,9 @@ // EnergyPlus Headers #include +#include #include #include -#include using namespace EnergyPlus; using namespace BranchInputManager; diff --git a/tst/EnergyPlus/unit/BranchNodeConnections.unit.cc b/tst/EnergyPlus/unit/BranchNodeConnections.unit.cc index 0c7662cd60f..9e8646903d3 100644 --- a/tst/EnergyPlus/unit/BranchNodeConnections.unit.cc +++ b/tst/EnergyPlus/unit/BranchNodeConnections.unit.cc @@ -54,9 +54,11 @@ // ObjexxFCL Headers #include + // EnergyPlus Headers #include #include +#include #include #include #include @@ -74,7 +76,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::BranchNodeConnections; diff --git a/tst/EnergyPlus/unit/ChilledCeilingPanelSimple.unit.cc b/tst/EnergyPlus/unit/ChilledCeilingPanelSimple.unit.cc index badf9744584..57ec8deebdf 100644 --- a/tst/EnergyPlus/unit/ChilledCeilingPanelSimple.unit.cc +++ b/tst/EnergyPlus/unit/ChilledCeilingPanelSimple.unit.cc @@ -51,12 +51,13 @@ #include // EnergyPlus Headers -#include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include -#include + +#include "Fixtures/EnergyPlusFixture.hh" using namespace EnergyPlus::CoolingPanelSimple; diff --git a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc index d2dd84b4fbd..09308eb9bc7 100644 --- a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc @@ -54,12 +54,12 @@ #include // EnergyPlus Headers -#include #include +#include +#include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc b/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc index 9fabf128043..5b81ef2e8be 100644 --- a/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc +++ b/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc @@ -52,14 +52,13 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include -#include -#include #include #include +#include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::DataLoopNode; @@ -69,7 +68,7 @@ using namespace EnergyPlus::PlantChillers; TEST_F(EnergyPlusFixture, ChillerConstantCOP_WaterCooled_Autosize) { - DataPlant::TotNumLoops = 4; + state->dataPlnt->TotNumLoops = 4; state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = 1.20; state->dataGlobal->NumOfTimeStepInHour = 1; @@ -96,9 +95,9 @@ TEST_F(EnergyPlusFixture, ChillerConstantCOP_WaterCooled_Autosize) EXPECT_TRUE(process_idf(idf_objects, false)); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -140,9 +139,9 @@ TEST_F(EnergyPlusFixture, ChillerConstantCOP_WaterCooled_Autosize) DataSizing::PlantSizData(2).DesVolFlowRate = 0.001; DataSizing::PlantSizData(2).DeltaT = 5.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; bool RunFlag(true); Real64 MyLoad(-20000.0); diff --git a/tst/EnergyPlus/unit/ChillerElectric.unit.cc b/tst/EnergyPlus/unit/ChillerElectric.unit.cc index 55731f485b6..410a09e6982 100644 --- a/tst/EnergyPlus/unit/ChillerElectric.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectric.unit.cc @@ -52,14 +52,13 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include -#include -#include #include +#include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::DataLoopNode; @@ -68,7 +67,7 @@ using namespace EnergyPlus::PlantChillers; TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Autosize) { - DataPlant::TotNumLoops = 4; + state->dataPlnt->TotNumLoops = 4; state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = 1.20; state->dataGlobal->NumOfTimeStepInHour = 1; @@ -108,9 +107,9 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Autosize) EXPECT_TRUE(process_idf(idf_objects, false)); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -150,9 +149,9 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Autosize) DataSizing::PlantSizData(2).DesVolFlowRate = 0.001; DataSizing::PlantSizData(2).DeltaT = 5.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; bool RunFlag(true); Real64 MyLoad(-20000.0); @@ -194,7 +193,7 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Autosize) TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Simulate) { - DataPlant::TotNumLoops = 4; + state->dataPlnt->TotNumLoops = 4; state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = 1.20; state->dataGlobal->NumOfTimeStepInHour = 1; @@ -235,9 +234,9 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Simulate) EXPECT_TRUE(process_idf(idf_objects, false)); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -277,9 +276,9 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Simulate) DataSizing::PlantSizData(2).DesVolFlowRate = 0.001; DataSizing::PlantSizData(2).DeltaT = 5.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; bool RunFlag(true); Real64 MyLoad(-20000.0); diff --git a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc index ed969865f7c..7268bd9d37d 100644 --- a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc @@ -52,12 +52,12 @@ // EnergyPlus Headers #include +#include #include #include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" @@ -122,7 +122,7 @@ TEST_F(EnergyPlusFixture, ElectricEIRChiller_HeatRecoveryAutosizeTest) DataSizing::PlantSizData(2).DesVolFlowRate = 1.0; DataSizing::PlantSizData(2).DeltaT = 5.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // now call sizing routine thisEIR.size(*state); @@ -139,7 +139,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_AirCooledChiller) bool RunFlag(true); Real64 MyLoad(-10000.0); - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = 1.20; state->dataGlobal->NumOfTimeStepInHour = 1; @@ -192,9 +192,9 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_AirCooledChiller) EXPECT_TRUE(process_idf(idf_objects, false)); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -222,9 +222,9 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_AirCooledChiller) DataSizing::PlantSizData(1).DesVolFlowRate = 0.001; DataSizing::PlantSizData(1).DeltaT = 5.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; thisEIR.initialize(*state, RunFlag, MyLoad); thisEIR.size(*state); @@ -290,7 +290,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_EvaporativelyCooled_Calculate) EXPECT_TRUE(process_idf(idf_objects, false)); - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = 1.20; state->dataGlobal->NumOfTimeStepInHour = 1; @@ -299,9 +299,9 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_EvaporativelyCooled_Calculate) Psychrometrics::InitializePsychRoutines(); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -329,9 +329,9 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_EvaporativelyCooled_Calculate) DataSizing::PlantSizData(1).DesVolFlowRate = 0.001; DataSizing::PlantSizData(1).DeltaT = 5.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; state->dataEnvrn->OutDryBulbTemp = 29.4; state->dataEnvrn->OutWetBulbTemp = 23.0; diff --git a/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc index b2fd770e004..4b761c8ff85 100644 --- a/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerExhaustAbsorption.unit.cc @@ -53,7 +53,6 @@ // EnergyPlus Headers #include -#include #include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/ChillerGasAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerGasAbsorption.unit.cc index 2ff382b6eb0..a26841b4b57 100644 --- a/tst/EnergyPlus/unit/ChillerGasAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerGasAbsorption.unit.cc @@ -53,7 +53,6 @@ // EnergyPlus Headers #include -#include #include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/ChillerIndirectAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerIndirectAbsorption.unit.cc index 5b8bbc6ccb3..895136623c0 100644 --- a/tst/EnergyPlus/unit/ChillerIndirectAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerIndirectAbsorption.unit.cc @@ -49,12 +49,9 @@ // Google Test Headers #include -// ObjexxFCL Headers -#include + // EnergyPlus Headers #include -#include -#include #include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index cbddc0efc8b..b680526e432 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -53,6 +53,7 @@ #include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include #include @@ -66,7 +67,6 @@ #include #include #include -#include namespace EnergyPlus { @@ -3919,7 +3919,7 @@ TEST_F(EnergyPlusFixture, VSCoolingTowers_WaterOutletTempTest) CondenserLoopTowers::GetTowerInput(*state); auto &VSTower = state->dataCondenserLoopTowers->towers(1); - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; state->dataGlobal->BeginEnvrnFlag = true; // test case 1: diff --git a/tst/EnergyPlus/unit/ConstructionInternalSource.unit.cc b/tst/EnergyPlus/unit/ConstructionInternalSource.unit.cc index 2d3e335cb91..d4204d39960 100644 --- a/tst/EnergyPlus/unit/ConstructionInternalSource.unit.cc +++ b/tst/EnergyPlus/unit/ConstructionInternalSource.unit.cc @@ -52,9 +52,9 @@ // EnergyPlus Headers #include +#include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc index 9eb3c8db599..cc35a63eae6 100644 --- a/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc +++ b/tst/EnergyPlus/unit/ConvectionCoefficients.unit.cc @@ -56,8 +56,8 @@ #include #include #include +#include #include -#include #include #include #include @@ -69,8 +69,6 @@ #include #include #include -#include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc index 1d4d31e6dcf..44bf7420e91 100644 --- a/tst/EnergyPlus/unit/CrossVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/CrossVentMgr.unit.cc @@ -52,11 +52,11 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include -#include +#include #include -#include #include #include #include @@ -64,8 +64,6 @@ #include #include #include -#include -#include using namespace EnergyPlus; using namespace EnergyPlus::CrossVentMgr; diff --git a/tst/EnergyPlus/unit/CurveManager.unit.cc b/tst/EnergyPlus/unit/CurveManager.unit.cc index 84fa1e38d8b..23716773211 100644 --- a/tst/EnergyPlus/unit/CurveManager.unit.cc +++ b/tst/EnergyPlus/unit/CurveManager.unit.cc @@ -49,11 +49,11 @@ #include // EnergyPlus Headers +#include #include +#include #include #include -#include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/DElightManager.unit.cc b/tst/EnergyPlus/unit/DElightManager.unit.cc index 44e2b406bce..9247bfbb4e6 100644 --- a/tst/EnergyPlus/unit/DElightManager.unit.cc +++ b/tst/EnergyPlus/unit/DElightManager.unit.cc @@ -48,16 +48,13 @@ // Google Test Headers #include -// ObjexxFCL Headers -#include - // EnergyPlus Headers #include +#include #include #include #include #include -#include #include #include #include @@ -67,7 +64,6 @@ #include #include #include -#include // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/DOASEffectOnZoneSizing.unit.cc b/tst/EnergyPlus/unit/DOASEffectOnZoneSizing.unit.cc index 4426d90ed00..43d3c64052c 100644 --- a/tst/EnergyPlus/unit/DOASEffectOnZoneSizing.unit.cc +++ b/tst/EnergyPlus/unit/DOASEffectOnZoneSizing.unit.cc @@ -54,6 +54,7 @@ // EnergyPlus Headers #include +#include #include #include #include @@ -64,10 +65,7 @@ #include #include #include -#include -#include #include -#include using namespace EnergyPlus; using namespace ZoneEquipmentManager; diff --git a/tst/EnergyPlus/unit/DXCoils.unit.cc b/tst/EnergyPlus/unit/DXCoils.unit.cc index 57ab273ec77..6ecc8ea362d 100644 --- a/tst/EnergyPlus/unit/DXCoils.unit.cc +++ b/tst/EnergyPlus/unit/DXCoils.unit.cc @@ -56,6 +56,7 @@ #include "Fixtures/SQLiteFixture.hh" #include #include +#include #include #include #include @@ -68,7 +69,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace DXCoils; diff --git a/tst/EnergyPlus/unit/DataEnvironment.unit.cc b/tst/EnergyPlus/unit/DataEnvironment.unit.cc index 050f8d8b09a..8c389e05773 100644 --- a/tst/EnergyPlus/unit/DataEnvironment.unit.cc +++ b/tst/EnergyPlus/unit/DataEnvironment.unit.cc @@ -51,8 +51,8 @@ #include // EnergyPlus Headers -#include #include +#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc b/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc index 0e8fd6e962e..74fda965f22 100644 --- a/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc +++ b/tst/EnergyPlus/unit/DataGlobalConstants.unit.cc @@ -51,8 +51,8 @@ #include // EnergyPlus Headers -#include #include +#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/DataHeatBalance.unit.cc b/tst/EnergyPlus/unit/DataHeatBalance.unit.cc index 1831baa51b5..f540f991042 100644 --- a/tst/EnergyPlus/unit/DataHeatBalance.unit.cc +++ b/tst/EnergyPlus/unit/DataHeatBalance.unit.cc @@ -52,6 +52,7 @@ // EnergyPlus Headers #include +#include #include #include #include @@ -65,7 +66,6 @@ #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/DataPlant.unit.cc b/tst/EnergyPlus/unit/DataPlant.unit.cc index 0aa0d92a779..6217165215d 100644 --- a/tst/EnergyPlus/unit/DataPlant.unit.cc +++ b/tst/EnergyPlus/unit/DataPlant.unit.cc @@ -51,10 +51,9 @@ #include // EnergyPlus Headers +#include #include #include -#include -#include #include "Fixtures/EnergyPlusFixture.hh" @@ -64,9 +63,9 @@ using namespace ObjexxFCL; TEST_F(EnergyPlusFixture, DataPlant_AnyPlantLoopSidesNeedSim) { - TotNumLoops = 3; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + state->dataPlnt->TotNumLoops = 3; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); } @@ -81,7 +80,7 @@ TEST_F(EnergyPlusFixture, DataPlant_verifyTwoNodeNumsOnSamePlantLoop) // not using the DataPlantTest base class because of how specific this one is and that one is very general if (state->dataPlnt->PlantLoop.allocated()) state->dataPlnt->PlantLoop.deallocate(); - TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); @@ -122,7 +121,7 @@ TEST_F(EnergyPlusFixture, DataPlant_verifyTwoNodeNumsOnSamePlantLoop) state->dataPlnt->PlantLoop(2).LoopSide(1).Branch(1).Comp(1).NodeNumIn = 2; EXPECT_FALSE(PlantUtilities::verifyTwoNodeNumsOnSamePlantLoop(*state, nodeNumA, nodeNumB)); - TotNumLoops = 0; + state->dataPlnt->TotNumLoops = 0; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch(1).Comp.deallocate(); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.deallocate(); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch(1).Comp.deallocate(); diff --git a/tst/EnergyPlus/unit/DataSizing.unit.cc b/tst/EnergyPlus/unit/DataSizing.unit.cc index d2cb39668da..33838755687 100644 --- a/tst/EnergyPlus/unit/DataSizing.unit.cc +++ b/tst/EnergyPlus/unit/DataSizing.unit.cc @@ -51,8 +51,8 @@ #include // EnergyPlus Headers -#include #include +#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/DataSurfaces.unit.cc b/tst/EnergyPlus/unit/DataSurfaces.unit.cc index e0f82ffeca2..925496825d2 100644 --- a/tst/EnergyPlus/unit/DataSurfaces.unit.cc +++ b/tst/EnergyPlus/unit/DataSurfaces.unit.cc @@ -54,6 +54,7 @@ #include // EnergyPlus Headers +#include #include #include #include @@ -62,7 +63,6 @@ #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/DataSystemVariables.unit.cc b/tst/EnergyPlus/unit/DataSystemVariables.unit.cc index 26c293f44e1..29d6b77d0f5 100644 --- a/tst/EnergyPlus/unit/DataSystemVariables.unit.cc +++ b/tst/EnergyPlus/unit/DataSystemVariables.unit.cc @@ -51,7 +51,6 @@ // EnergyPlus Headers #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/DataZoneEquipment.unit.cc b/tst/EnergyPlus/unit/DataZoneEquipment.unit.cc index 32c0470dc3c..761fbdfcbf2 100644 --- a/tst/EnergyPlus/unit/DataZoneEquipment.unit.cc +++ b/tst/EnergyPlus/unit/DataZoneEquipment.unit.cc @@ -51,14 +51,13 @@ #include // EnergyPlus Headers +#include #include #include #include #include #include -#include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/Datasets.unit.cc b/tst/EnergyPlus/unit/Datasets.unit.cc index 206ead7dac7..ea8eb4d2388 100644 --- a/tst/EnergyPlus/unit/Datasets.unit.cc +++ b/tst/EnergyPlus/unit/Datasets.unit.cc @@ -55,10 +55,10 @@ #include // Fixtures, etc. -#include -#include #include "Fixtures/EnergyPlusFixture.hh" +#include #include +#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/DaylightingManager.unit.cc b/tst/EnergyPlus/unit/DaylightingManager.unit.cc index 0e0a26e0689..e9037357c7c 100644 --- a/tst/EnergyPlus/unit/DaylightingManager.unit.cc +++ b/tst/EnergyPlus/unit/DaylightingManager.unit.cc @@ -57,6 +57,7 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include @@ -72,7 +73,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::Construction; diff --git a/tst/EnergyPlus/unit/DemandResponse.unit.cc b/tst/EnergyPlus/unit/DemandResponse.unit.cc index 43075eb8fe3..b190927e186 100644 --- a/tst/EnergyPlus/unit/DemandResponse.unit.cc +++ b/tst/EnergyPlus/unit/DemandResponse.unit.cc @@ -51,10 +51,10 @@ #include #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include -#include using namespace EnergyPlus; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc index bc76c2b7a15..47176b54644 100644 --- a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc +++ b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc @@ -52,8 +52,8 @@ // EnergyPlus Headers #include +#include #include -#include #include #include #include @@ -62,14 +62,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc index 8955cacb40c..44034959b6f 100644 --- a/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc +++ b/tst/EnergyPlus/unit/DisplacementVentMgr.unit.cc @@ -52,7 +52,7 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include +#include #include #include #include @@ -60,7 +60,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::DataSurfaces; diff --git a/tst/EnergyPlus/unit/DualDuct.unit.cc b/tst/EnergyPlus/unit/DualDuct.unit.cc index 0435407238b..3b189b23eb6 100644 --- a/tst/EnergyPlus/unit/DualDuct.unit.cc +++ b/tst/EnergyPlus/unit/DualDuct.unit.cc @@ -54,9 +54,9 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include -#include #include #include #include @@ -70,7 +70,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace DualDuct; diff --git a/tst/EnergyPlus/unit/EMSManager.unit.cc b/tst/EnergyPlus/unit/EMSManager.unit.cc index 8d9447df9fd..7e69dd12800 100644 --- a/tst/EnergyPlus/unit/EMSManager.unit.cc +++ b/tst/EnergyPlus/unit/EMSManager.unit.cc @@ -240,10 +240,10 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetActuatedBranchFlo state->dataEMSMgr->FinishProcessingUserInput = true; // set up plant loop - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).Name = "MyPlant"; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -404,10 +404,10 @@ TEST_F(EnergyPlusFixture, SupervisoryControl_PlantComponent_SetComponentFlowRate state->dataEMSMgr->FinishProcessingUserInput = true; // set up plant loop - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).Name = "MyPlant"; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/EarthTube.unit.cc b/tst/EnergyPlus/unit/EarthTube.unit.cc index 8f8f56d3e8b..a04b9c14aab 100644 --- a/tst/EnergyPlus/unit/EarthTube.unit.cc +++ b/tst/EnergyPlus/unit/EarthTube.unit.cc @@ -52,11 +52,10 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include -#include -#include using namespace EnergyPlus; using namespace EnergyPlus::EarthTube; diff --git a/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc b/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc index 8d5c0d809e0..175c4222a47 100644 --- a/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc +++ b/tst/EnergyPlus/unit/EconomicLifeCycleCost.unit.cc @@ -54,10 +54,10 @@ #include // EnergyPlus Headers +#include #include -#include #include -#include +#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/EconomicTariff.unit.cc b/tst/EnergyPlus/unit/EconomicTariff.unit.cc index 98d2f59688b..4404d5e7e11 100644 --- a/tst/EnergyPlus/unit/EconomicTariff.unit.cc +++ b/tst/EnergyPlus/unit/EconomicTariff.unit.cc @@ -49,17 +49,17 @@ #include // EnergyPlus Headers +#include #include #include #include #include #include #include -#include #include +#include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/ElectricBaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/ElectricBaseboardRadiator.unit.cc index 2448b0e2deb..891bb697f69 100644 --- a/tst/EnergyPlus/unit/ElectricBaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/ElectricBaseboardRadiator.unit.cc @@ -52,17 +52,16 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include +#include #include +#include #include #include #include #include #include #include -#include - -#include -#include using namespace EnergyPlus; diff --git a/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc b/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc index 5b6a04b78f5..a23fc577112 100644 --- a/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc +++ b/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc @@ -56,18 +56,13 @@ // EnergyPlus Headers #include +#include #include #include -#include #include #include -#include #include -#include -#include #include -#include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc b/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc index 0e8e2bca1de..4a39ef18c56 100644 --- a/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc +++ b/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc @@ -52,6 +52,7 @@ // EnergyPlus Headers #include +#include #include #include #include @@ -61,7 +62,6 @@ #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc b/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc index 3de0747c265..82be5d38c3e 100644 --- a/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc +++ b/tst/EnergyPlus/unit/EvaporativeFluidCoolers.unit.cc @@ -51,17 +51,15 @@ #include // EnergyPlus Headers +#include #include #include #include -#include #include +#include #include #include #include -#include -#include - #include "Fixtures/EnergyPlusFixture.hh" @@ -143,7 +141,7 @@ TEST_F(EvapFluidCoolersFixture, EvapFluidCoolerSpecs_getDesignCapacitiesTest) thisEFC.HighSpeedEvapFluidCoolerUAWasAutoSized = false; thisEFC.PerformanceInputMethod_Num = PIM::UFactor; state->dataPlnt->PlantLoop(1).PlantSizNum = 1; - DataPlant::PlantFinalSizesOkayToReport = false; + state->dataPlnt->PlantFinalSizesOkayToReport = false; DataSizing::SaveNumPlantComps = 0; thisEFC.DesignWaterFlowRate = 0.001; DataSizing::PlantSizData.allocate(1); diff --git a/tst/EnergyPlus/unit/ExteriorEnergyUse.unit.cc b/tst/EnergyPlus/unit/ExteriorEnergyUse.unit.cc index 87a558a0c9e..529d07f4ef4 100644 --- a/tst/EnergyPlus/unit/ExteriorEnergyUse.unit.cc +++ b/tst/EnergyPlus/unit/ExteriorEnergyUse.unit.cc @@ -51,10 +51,10 @@ #include // EnergyPlus Headers +#include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc index fb5d4da5ef1..4372bc68116 100644 --- a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc +++ b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc @@ -53,8 +53,8 @@ #include // EnergyPlus Headers +#include #include -#include #include #include #include @@ -67,18 +67,15 @@ #include #include #include -#include #include +#include #include -#include #include #include #include #include #include -#include #include -#include #include "Fixtures/EnergyPlusFixture.hh" @@ -274,8 +271,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:COOLING:WATER", FanCoil(1).CCoilType); EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -341,7 +338,7 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).InletWaterMassFlowRate = HotWaterMassFlowRate; state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -587,8 +584,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:COOLING:WATER", FanCoil(1).CCoilType); EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -655,7 +652,7 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).InletWaterMassFlowRate = HotWaterMassFlowRate; state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -898,8 +895,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:COOLING:WATER", FanCoil(1).CCoilType); EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -972,7 +969,7 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).InletWaterMassFlowRate = HotWaterMassFlowRate; state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -1276,8 +1273,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:COOLING:WATER", FanCoil(1).CCoilType); EXPECT_EQ("COIL:HEATING:ELECTRIC", FanCoil(1).HCoilType); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -1340,7 +1337,7 @@ namespace EnergyPlus { Node(state->dataWaterCoils->WaterCoil(1).AirInletNodeNum).MassFlowRate = AirMassFlow; Node(state->dataWaterCoils->WaterCoil(1).AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -1595,8 +1592,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:COOLING:WATER", FanCoil(1).CCoilType); EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -1670,7 +1667,7 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).InletWaterMassFlowRate = HotWaterMassFlowRate; state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -1951,8 +1948,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:COOLING:WATER", FanCoil(1).CCoilType); EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -2019,7 +2016,7 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).InletWaterMassFlowRate = HotWaterMassFlowRate; state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -2214,7 +2211,7 @@ namespace EnergyPlus { bool FirstHVACIteration(false); bool ErrorsFound(false); Real64 QZnReq(-1000.0); - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = 1.20; state->dataWaterCoils->GetWaterCoilsInputFlag = true; @@ -2281,8 +2278,8 @@ namespace EnergyPlus { GetFanInput(*state); GetFanCoilUnits(*state); - state->dataPlnt->PlantLoop.allocate(TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -2661,8 +2658,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:COOLING:WATER", FanCoil(1).CCoilType); EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -2728,7 +2725,7 @@ namespace EnergyPlus { state->dataWaterCoils->WaterCoil(1).InletWaterMassFlowRate = HotWaterMassFlowRate; state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -3081,8 +3078,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:WATER", thisFanCoil.HCoilType); EXPECT_EQ(DataHVACGlobals::FanType_SystemModelObject, thisFanCoil.FanType_Num); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -3148,7 +3145,7 @@ namespace EnergyPlus { HWCoil.WaterLoopBranchNum = 1; HWCoil.WaterLoopCompNum = 1; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -3480,8 +3477,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); EXPECT_EQ(DataHVACGlobals::FanType_SystemModelObject, thisFanCoil.FanType_Num); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; ColdWaterMassFlowRate = 1.0; @@ -3529,7 +3526,7 @@ namespace EnergyPlus { Node(eHCoil.AirInletNodeNum).MassFlowRate = AirMassFlow; Node(eHCoil.AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -3847,8 +3844,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); EXPECT_EQ(DataHVACGlobals::FanType_SystemModelObject, thisFanCoil.FanType_Num); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; ColdWaterMassFlowRate = 1.0; @@ -3896,7 +3893,7 @@ namespace EnergyPlus { Node(eHCoil.AirInletNodeNum).MassFlowRate = AirMassFlow; Node(eHCoil.AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -4214,8 +4211,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); EXPECT_EQ(DataHVACGlobals::FanType_SystemModelObject, thisFanCoil.FanType_Num); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; ColdWaterMassFlowRate = 1.0; @@ -4263,7 +4260,7 @@ namespace EnergyPlus { Node(eHCoil.AirInletNodeNum).MassFlowRate = AirMassFlow; Node(eHCoil.AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -4535,8 +4532,8 @@ namespace EnergyPlus { EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; ColdWaterMassFlowRate = 1.0; @@ -4575,7 +4572,7 @@ namespace EnergyPlus { Node(eHCoil.AirInletNodeNum).MassFlowRate = AirMassFlow; Node(eHCoil.AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/Fans.unit.cc b/tst/EnergyPlus/unit/Fans.unit.cc index adde6e6b604..de0c156f34d 100644 --- a/tst/EnergyPlus/unit/Fans.unit.cc +++ b/tst/EnergyPlus/unit/Fans.unit.cc @@ -52,13 +52,11 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include -#include #include #include #include -#include -#include using namespace EnergyPlus; using namespace EnergyPlus::DataSizing; diff --git a/tst/EnergyPlus/unit/FaultsManager.unit.cc b/tst/EnergyPlus/unit/FaultsManager.unit.cc index e039f4f783e..44b1aec216e 100644 --- a/tst/EnergyPlus/unit/FaultsManager.unit.cc +++ b/tst/EnergyPlus/unit/FaultsManager.unit.cc @@ -52,27 +52,21 @@ #include // C++ Headers -#include #include -// ObjexxFCL Headers -#include - // EnergyPlus Headers #include +#include #include -#include #include #include #include #include #include -#include #include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/FileSystem.unit.cc b/tst/EnergyPlus/unit/FileSystem.unit.cc index e74d720240a..64747710780 100644 --- a/tst/EnergyPlus/unit/FileSystem.unit.cc +++ b/tst/EnergyPlus/unit/FileSystem.unit.cc @@ -50,13 +50,13 @@ // Google Test Headers #include -// EnergyPlus Headers -#include +// C++ Headers #include +#include + +// EnergyPlus Headers #include #include -#include - TEST(FileSystem, movefile_test) { diff --git a/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc b/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc index 1229f44e63f..ec559d11dcd 100644 --- a/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc +++ b/tst/EnergyPlus/unit/FiniteDifferenceGroundTemperatureModel.unit.cc @@ -51,16 +51,16 @@ #include // EnergyPlus Headers +#include +#include +#include #include #include +#include #include #include -#include -#include #include -#include -#include -#include +#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/Fixtures/InputProcessorFixture.hh b/tst/EnergyPlus/unit/Fixtures/InputProcessorFixture.hh index 4bf48610af2..e2a6ce6e18d 100644 --- a/tst/EnergyPlus/unit/Fixtures/InputProcessorFixture.hh +++ b/tst/EnergyPlus/unit/Fixtures/InputProcessorFixture.hh @@ -54,6 +54,7 @@ // EnergyPlus Headers #include "EnergyPlusFixture.hh" #include +#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/FluidCoolers.unit.cc b/tst/EnergyPlus/unit/FluidCoolers.unit.cc index 3afd74b1b25..4a37a0dcce9 100644 --- a/tst/EnergyPlus/unit/FluidCoolers.unit.cc +++ b/tst/EnergyPlus/unit/FluidCoolers.unit.cc @@ -53,11 +53,11 @@ #include "Fixtures/EnergyPlusFixture.hh" // EnergyPlus Headers -#include +#include #include #include +#include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::FluidCoolers; diff --git a/tst/EnergyPlus/unit/FluidProperties.unit.cc b/tst/EnergyPlus/unit/FluidProperties.unit.cc index 0a81609697c..f4764649fa5 100644 --- a/tst/EnergyPlus/unit/FluidProperties.unit.cc +++ b/tst/EnergyPlus/unit/FluidProperties.unit.cc @@ -51,10 +51,9 @@ #include // EnergyPlus Headers -#include #include +#include -#include #include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/FuelCellElectricGenerator.unit.cc b/tst/EnergyPlus/unit/FuelCellElectricGenerator.unit.cc index ad88c355d61..46e60f572b5 100644 --- a/tst/EnergyPlus/unit/FuelCellElectricGenerator.unit.cc +++ b/tst/EnergyPlus/unit/FuelCellElectricGenerator.unit.cc @@ -53,10 +53,11 @@ // C++ Headers #include #include + // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include #include +#include using namespace EnergyPlus; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/Furnaces.unit.cc b/tst/EnergyPlus/unit/Furnaces.unit.cc index 8ea7e6185e3..04c74c1b692 100644 --- a/tst/EnergyPlus/unit/Furnaces.unit.cc +++ b/tst/EnergyPlus/unit/Furnaces.unit.cc @@ -52,7 +52,7 @@ // EnergyPlus Headers #include -#include +#include #include #include #include @@ -67,7 +67,6 @@ #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" @@ -291,10 +290,10 @@ TEST_F(EnergyPlusFixture, SetVSHPAirFlowTest_VSFurnaceFlowTest) state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).CompNum = 1; // set up plant loop - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); - for ( int loopindex = 1; loopindex <= DataPlant::TotNumLoops; ++loopindex ) { + for ( int loopindex = 1; loopindex <= state->dataPlnt->TotNumLoops; ++loopindex ) { auto &loop(state->dataPlnt->PlantLoop(loopindex)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(loopindex).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/General.unit.cc b/tst/EnergyPlus/unit/General.unit.cc index 1194700f5e9..67db454bcd7 100644 --- a/tst/EnergyPlus/unit/General.unit.cc +++ b/tst/EnergyPlus/unit/General.unit.cc @@ -50,15 +50,16 @@ // Google Test Headers #include -// EnergyPlus Headers -#include +// Objexx Headers +#include +#include +// EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include -#include -#include -#include +#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/GeneralRoutines.unit.cc b/tst/EnergyPlus/unit/GeneralRoutines.unit.cc index fa02eea1f4b..2c9abd8918b 100644 --- a/tst/EnergyPlus/unit/GeneralRoutines.unit.cc +++ b/tst/EnergyPlus/unit/GeneralRoutines.unit.cc @@ -49,9 +49,9 @@ #include // EnergyPlus Headers +#include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc b/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc index 8b1c637c9e4..42e74a8d38b 100644 --- a/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc +++ b/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc @@ -52,16 +52,14 @@ // EnergyPlus Headers #include -#include #include #include #include #include +#include #include #include #include -#include -#include // Testing Headers #include "Fixtures/EnergyPlusFixture.hh" @@ -1184,7 +1182,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcGFunction_Check) ScheduleInputProcessed = true; GetPlantLoopData(*state); GetPlantInput(*state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(*state); SetupBranchControlTypes(*state); auto &thisGLHE(verticalGLHE[0]); @@ -1666,7 +1664,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calc_pipe_convection_re ScheduleInputProcessed = true; GetPlantLoopData(*state); GetPlantInput(*state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(*state); SetupBranchControlTypes(*state); auto &thisGLHE(verticalGLHE[0]); @@ -1970,7 +1968,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calc_pipe_resistance) ScheduleInputProcessed = true; GetPlantLoopData(*state); GetPlantInput(*state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(*state); SetupBranchControlTypes(*state); auto &thisGLHE(verticalGLHE[0]); @@ -2266,7 +2264,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHGroutResistance_1 ScheduleInputProcessed = true; GetPlantLoopData(*state); GetPlantInput(*state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(*state); SetupBranchControlTypes(*state); auto &thisGLHE(verticalGLHE[0]); @@ -2564,7 +2562,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHGroutResistance_2 ScheduleInputProcessed = true; GetPlantLoopData(*state); GetPlantInput(*state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(*state); SetupBranchControlTypes(*state); auto &thisGLHE(verticalGLHE[0]); @@ -2862,7 +2860,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHGroutResistance_3 ScheduleInputProcessed = true; GetPlantLoopData(*state); GetPlantInput(*state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(*state); SetupBranchControlTypes(*state); auto &thisGLHE(verticalGLHE[0]); @@ -3160,7 +3158,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHTotalInternalResi ScheduleInputProcessed = true; GetPlantLoopData(*state); GetPlantInput(*state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(*state); SetupBranchControlTypes(*state); auto &thisGLHE(verticalGLHE[0]); @@ -3458,7 +3456,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHTotalInternalResi ScheduleInputProcessed = true; GetPlantLoopData(*state); GetPlantInput(*state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(*state); SetupBranchControlTypes(*state); auto &thisGLHE(verticalGLHE[0]); @@ -3756,7 +3754,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHTotalInternalResi ScheduleInputProcessed = true; GetPlantLoopData(*state); GetPlantInput(*state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(*state); SetupBranchControlTypes(*state); auto &thisGLHE(verticalGLHE[0]); diff --git a/tst/EnergyPlus/unit/HVACControllers.unit.cc b/tst/EnergyPlus/unit/HVACControllers.unit.cc index a1b9c778b30..9effa3f770b 100644 --- a/tst/EnergyPlus/unit/HVACControllers.unit.cc +++ b/tst/EnergyPlus/unit/HVACControllers.unit.cc @@ -54,6 +54,7 @@ #include // EnergyPlus Headers +#include #include #include #include @@ -65,7 +66,6 @@ #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" @@ -256,7 +256,7 @@ TEST_F(EnergyPlusFixture, HVACControllers_TestTempAndHumidityRatioCtrlVarType) state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).Name = "CHILLED WATER COIL"; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).CompType_Num = 5; // state->dataWaterCoils->WaterCoil_Cooling state->dataPlnt->PlantLoop.allocate(1); - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); @@ -964,7 +964,7 @@ TEST_F(EnergyPlusFixture, HVACControllers_MaxFlowZero) state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).Name = "CHILLED WATER COIL"; state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).CompType_Num = 5; // WaterCoil_Cooling state->dataPlnt->PlantLoop.allocate(1); - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop(1).Name = "CHW LOOP"; state->dataPlnt->PlantLoop(1).PlantSizNum = 1; state->dataPlnt->PlantLoop(1).FluidIndex = 1; @@ -987,9 +987,9 @@ TEST_F(EnergyPlusFixture, HVACControllers_MaxFlowZero) DataSizing::PlantSizData(1).LoopType = DataSizing::CoolingLoop; DataSizing::PlantSizData(1).DesVolFlowRate = 1.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; DataSizing::UnitarySysEqSizing.allocate(1); DataSizing::UnitarySysEqSizing(1).CoolingCapacity = false; diff --git a/tst/EnergyPlus/unit/HVACDXSystem.unit.cc b/tst/EnergyPlus/unit/HVACDXSystem.unit.cc index e532f6d501a..665f2bcc546 100644 --- a/tst/EnergyPlus/unit/HVACDXSystem.unit.cc +++ b/tst/EnergyPlus/unit/HVACDXSystem.unit.cc @@ -48,17 +48,19 @@ // EnergyPlus::HVACDXSystem and VariableSpeedCoils Unit Tests // Google Test Headers +#include + +// EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include #include #include +#include #include #include -#include -#include -#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/HVACFan.unit.cc b/tst/EnergyPlus/unit/HVACFan.unit.cc index 06cef396181..03918640ef5 100644 --- a/tst/EnergyPlus/unit/HVACFan.unit.cc +++ b/tst/EnergyPlus/unit/HVACFan.unit.cc @@ -52,12 +52,12 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include #include +#include #include #include +#include #include -#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc index 95f7955fcd7..6fbd8f7130e 100644 --- a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc +++ b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc @@ -53,6 +53,7 @@ #include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include #include @@ -72,7 +73,6 @@ #include #include #include -#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc b/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc index d0e885b0871..766b7a01ed0 100644 --- a/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc +++ b/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc @@ -49,8 +49,8 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include -#include #include #include #include @@ -61,14 +61,12 @@ #include #include #include -#include #include #include #include #include #include #include -#include using namespace EnergyPlus; diff --git a/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc b/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc index defc3cea698..545e54c9fe4 100644 --- a/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc @@ -55,11 +55,11 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include -#include #include -#include +#include namespace EnergyPlus { TEST_F(EnergyPlusFixture, ExcessiveHeatStorage_Test) @@ -69,9 +69,9 @@ TEST_F(EnergyPlusFixture, ExcessiveHeatStorage_Test) using namespace DataHVACGlobals; Real64 TankOutletTemp; TimeStepSys = 1; - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); - for (int i = 1; i <= TotNumLoops; ++i) { + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int i = 1; i <= state->dataPlnt->TotNumLoops; ++i) { auto &loop(state->dataPlnt->PlantLoop(i)); loop.LoopSide.allocate(2); } @@ -83,7 +83,7 @@ TEST_F(EnergyPlusFixture, ExcessiveHeatStorage_Test) state->dataPlnt->PlantLoop(1).LoopSide(1).NodeNumIn = 1; state->dataPlnt->PlantLoop(1).LoopSide(2).LastTempInterfaceTankOutlet = 80; state->dataPlnt->PlantLoop(1).LoopSide(2).TotalPumpHeat = 500; - DataLoopNode::Node.allocate(TotNumLoops); + DataLoopNode::Node.allocate(state->dataPlnt->TotNumLoops); DataLoopNode::Node(1).Temp = 100; DataLoopNode::Node(1).MassFlowRate = 10; diff --git a/tst/EnergyPlus/unit/HVACManager.unit.cc b/tst/EnergyPlus/unit/HVACManager.unit.cc index 727efdb75e0..6a7b04fd9a3 100644 --- a/tst/EnergyPlus/unit/HVACManager.unit.cc +++ b/tst/EnergyPlus/unit/HVACManager.unit.cc @@ -53,10 +53,10 @@ #include // EnergyPlus Headers +#include #include #include #include -#include #include #include #include @@ -66,7 +66,6 @@ #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc index 0012779c037..f02ddba3f50 100644 --- a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc @@ -48,17 +48,14 @@ // EnergyPlus::MultiSpeedAirToAirHeatPump Unit Tests // Google Test Headers -#include "Fixtures/EnergyPlusFixture.hh" #include -#include - -// ObjexxFCL Headers +#include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include -#include #include #include #include diff --git a/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc b/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc index f4199573c32..40273da5943 100644 --- a/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc +++ b/tst/EnergyPlus/unit/HVACSizingSimulationManager.unit.cc @@ -53,18 +53,15 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" #include "Fixtures/SQLiteFixture.hh" -#include #include #include -#include #include #include #include #include +#include #include -#include #include -#include using namespace EnergyPlus; using namespace DataPlant; @@ -103,9 +100,9 @@ class HVACSizingSimulationManagerTest : public EnergyPlusFixture PlantSizData(NumPltSizInput).LoopType = HeatingLoop; // set up a plant loop - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); } diff --git a/tst/EnergyPlus/unit/HVACStandaloneERV.unit.cc b/tst/EnergyPlus/unit/HVACStandaloneERV.unit.cc index 8d86cd03114..9c226aa0ecc 100644 --- a/tst/EnergyPlus/unit/HVACStandaloneERV.unit.cc +++ b/tst/EnergyPlus/unit/HVACStandaloneERV.unit.cc @@ -52,6 +52,7 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -62,7 +63,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::HVACStandAloneERV; diff --git a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc index 8b35207e1e5..ab9458780ef 100644 --- a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc +++ b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc @@ -53,6 +53,7 @@ #include #include +#include #include #include #include @@ -75,7 +76,6 @@ #include #include #include -#include using namespace EnergyPlus; diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 0debf19ff0e..83898af26fd 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -89,7 +90,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace DXCoils; @@ -317,13 +317,13 @@ class AirLoopFixture : public EnergyPlusFixture state->dataAirSystemsData->PrimaryAirSystems(thisAirLoop).Branch(1).Comp(1).TypeOf = "ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW"; // set up plant loop for water equipment - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - DataSizing::PlantSizData.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + DataSizing::PlantSizData.allocate(state->dataPlnt->TotNumLoops); // int NumPltSizInput = DataPlant::TotNumLoops; DataSizing::NumPltSizInput = 2; - for (int loopindex = 1; loopindex <= DataPlant::TotNumLoops; ++loopindex) { + for (int loopindex = 1; loopindex <= state->dataPlnt->TotNumLoops; ++loopindex) { auto &loop(state->dataPlnt->PlantLoop(loopindex)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(loopindex).LoopSide(1)); @@ -8103,9 +8103,9 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilWater) PlantSizData(NumPltSizInput).DeltaT = 10.0; // loop temperature difference // set up plant loop - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -8219,9 +8219,9 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilSteam) PlantSizData.allocate(NumPltSizInput); PlantSizData(NumPltSizInput).PlantLoopName = "SteamLoop"; // set up plant loop - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc index eb73b86ac29..9e5633a58ec 100644 --- a/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc @@ -51,19 +51,17 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include +#include #include -#include #include #include #include -#include +#include #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace DataZoneEnergyDemands; using namespace ScheduleManager; @@ -163,9 +161,9 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_HWBaseboardWaterFlowResetTest) Node(HWBaseboard(1).WaterOutletNode).MassFlowRate = 0.2; Node(HWBaseboard(1).WaterOutletNode).MassFlowRateMax = 0.4; - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(1); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/HeatBalFiniteDiffManager.unit.cc b/tst/EnergyPlus/unit/HeatBalFiniteDiffManager.unit.cc index 5cc6519cd87..c29f82007b1 100644 --- a/tst/EnergyPlus/unit/HeatBalFiniteDiffManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalFiniteDiffManager.unit.cc @@ -51,12 +51,11 @@ #include // EnergyPlus Headers -#include +#include #include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc index 88703639a12..e7fef2b15f9 100644 --- a/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceAirManager.unit.cc @@ -51,11 +51,10 @@ #include // EnergyPlus Headers -#include +#include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc index 047b5c8b644..79bda762a7e 100644 --- a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc @@ -52,7 +52,7 @@ // EnergyPlus Headers #include -#include +#include #include #include #include @@ -60,7 +60,6 @@ #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc index 37a2e1c1ca0..20f74b77297 100644 --- a/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc @@ -52,12 +52,12 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include #include #include -#include #include #include #include @@ -65,8 +65,6 @@ #include #include #include -#include - namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc index db85dab027f..3c102a4ec57 100644 --- a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc @@ -52,11 +52,11 @@ // EnergyPlus Headers #include +#include #include #include #include #include -#include #include #include #include @@ -65,22 +65,17 @@ #include #include #include -#include -#include -#include #include #include #include #include #include -#include #include #include #include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc b/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc index f936226e35c..29c30a293dc 100644 --- a/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceMovableInsulation.unit.cc @@ -51,6 +51,7 @@ #include // EnergyPlus Headers +#include #include #include #include @@ -61,7 +62,6 @@ #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc index fbb98072fa8..cd8a0421f89 100644 --- a/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceSurfaceManager.unit.cc @@ -53,6 +53,7 @@ // EnergyPlus Headers #include #include +#include #include #include #include @@ -71,13 +72,12 @@ #include #include #include -#include #include +#include #include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc b/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc index 90df6a20e0e..75ce9e0b1cb 100644 --- a/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc +++ b/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc @@ -50,6 +50,7 @@ #include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include @@ -64,7 +65,6 @@ #include #include #include -#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/HeatRecovery.unit.cc b/tst/EnergyPlus/unit/HeatRecovery.unit.cc index 1c994c7aeb0..ec8090b5216 100644 --- a/tst/EnergyPlus/unit/HeatRecovery.unit.cc +++ b/tst/EnergyPlus/unit/HeatRecovery.unit.cc @@ -53,9 +53,9 @@ // EnergyPlus Headers #include "EnergyPlus/DataAirLoop.hh" #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include -#include #include #include #include @@ -69,8 +69,6 @@ #include #include #include -#include -#include using namespace EnergyPlus; using namespace DataEnvironment; diff --git a/tst/EnergyPlus/unit/HeatingCoils.unit.cc b/tst/EnergyPlus/unit/HeatingCoils.unit.cc index 0a120375baf..d3ee7170c62 100644 --- a/tst/EnergyPlus/unit/HeatingCoils.unit.cc +++ b/tst/EnergyPlus/unit/HeatingCoils.unit.cc @@ -47,19 +47,20 @@ // EnergyPlus::HeatingCoils Unit Tests -#include - // Google Test Headers -#include "Fixtures/EnergyPlusFixture.hh" +#include + +// EnergyPlus Headers +#include +#include #include +#include +#include #include #include -#include #include -#include -#include -#include -#include + +#include "Fixtures/EnergyPlusFixture.hh" namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/HighTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/HighTempRadiantSystem.unit.cc index 993908454bd..827a5ede184 100644 --- a/tst/EnergyPlus/unit/HighTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/HighTempRadiantSystem.unit.cc @@ -52,14 +52,12 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include +#include #include #include #include #include #include -#include -#include using namespace EnergyPlus; using namespace EnergyPlus::HighTempRadiantSystem; diff --git a/tst/EnergyPlus/unit/Humidifiers.unit.cc b/tst/EnergyPlus/unit/Humidifiers.unit.cc index 277cfd871d3..75e0d0e2b25 100644 --- a/tst/EnergyPlus/unit/Humidifiers.unit.cc +++ b/tst/EnergyPlus/unit/Humidifiers.unit.cc @@ -50,18 +50,16 @@ // Google Test Headers #include -// ObjexxFCL Headers - // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include #include #include #include -#include using namespace EnergyPlus::Humidifiers; using namespace EnergyPlus::DataSizing; diff --git a/tst/EnergyPlus/unit/HybridModel.unit.cc b/tst/EnergyPlus/unit/HybridModel.unit.cc index 36b7d143e2b..116fee3a071 100644 --- a/tst/EnergyPlus/unit/HybridModel.unit.cc +++ b/tst/EnergyPlus/unit/HybridModel.unit.cc @@ -54,9 +54,8 @@ // EnergyPlus Headers #include -#include +#include #include -#include #include #include #include @@ -70,13 +69,10 @@ #include #include #include -#include #include -#include #include #include #include -#include using namespace EnergyPlus; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/ICEngineElectricGenerator.unit.cc b/tst/EnergyPlus/unit/ICEngineElectricGenerator.unit.cc index fe2b31bfca3..f900003e1a2 100644 --- a/tst/EnergyPlus/unit/ICEngineElectricGenerator.unit.cc +++ b/tst/EnergyPlus/unit/ICEngineElectricGenerator.unit.cc @@ -51,10 +51,9 @@ #include // EnergyPlus Headers -#include - #include "Fixtures/EnergyPlusFixture.hh" #include +#include using namespace EnergyPlus::ICEngineElectricGenerator; diff --git a/tst/EnergyPlus/unit/ICSCollector.unit.cc b/tst/EnergyPlus/unit/ICSCollector.unit.cc index 2a8be9eaec7..ecfdcbdb82c 100644 --- a/tst/EnergyPlus/unit/ICSCollector.unit.cc +++ b/tst/EnergyPlus/unit/ICSCollector.unit.cc @@ -51,9 +51,10 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include +#include #include -#include #include #include #include @@ -61,9 +62,6 @@ #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace ObjexxFCL; using namespace EnergyPlus; using namespace EnergyPlus::ConvectionCoefficients; diff --git a/tst/EnergyPlus/unit/IceThermalStorage.unit.cc b/tst/EnergyPlus/unit/IceThermalStorage.unit.cc index e970b62f504..843c7f5df9f 100644 --- a/tst/EnergyPlus/unit/IceThermalStorage.unit.cc +++ b/tst/EnergyPlus/unit/IceThermalStorage.unit.cc @@ -53,11 +53,9 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" #include -#include -#include - -#include #include +#include +#include using namespace EnergyPlus; using namespace EnergyPlus::IceThermalStorage; diff --git a/tst/EnergyPlus/unit/InputProcessor.unit.cc b/tst/EnergyPlus/unit/InputProcessor.unit.cc index 8e9a57d56f0..d2a8ad7799b 100644 --- a/tst/EnergyPlus/unit/InputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/InputProcessor.unit.cc @@ -51,15 +51,12 @@ #include // EnergyPlus Headers -#include +#include "Fixtures/InputProcessorFixture.hh" #include #include #include #include -#include "Fixtures/InputProcessorFixture.hh" - -#include #include #include #include diff --git a/tst/EnergyPlus/unit/IntegratedHeatPump.unit.cc b/tst/EnergyPlus/unit/IntegratedHeatPump.unit.cc index 3cbbbd22b8a..84b104fbb53 100644 --- a/tst/EnergyPlus/unit/IntegratedHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/IntegratedHeatPump.unit.cc @@ -50,9 +50,9 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include -#include using namespace EnergyPlus; diff --git a/tst/EnergyPlus/unit/InternalHeatGains.unit.cc b/tst/EnergyPlus/unit/InternalHeatGains.unit.cc index c272bcd2604..efb39506928 100644 --- a/tst/EnergyPlus/unit/InternalHeatGains.unit.cc +++ b/tst/EnergyPlus/unit/InternalHeatGains.unit.cc @@ -51,8 +51,10 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include #include @@ -71,9 +73,6 @@ #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/KusudaAchenbachGroundTemperatureModel.unit.cc b/tst/EnergyPlus/unit/KusudaAchenbachGroundTemperatureModel.unit.cc index 46f862afbd7..7dba99aa829 100644 --- a/tst/EnergyPlus/unit/KusudaAchenbachGroundTemperatureModel.unit.cc +++ b/tst/EnergyPlus/unit/KusudaAchenbachGroundTemperatureModel.unit.cc @@ -53,7 +53,6 @@ // EnergyPlus Headers #include "EnergyPlus/DataIPShortCuts.hh" #include "EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.hh" -#include "EnergyPlus/GroundTemperatureModeling/KusudaAchenbachGroundTemperatureModel.hh" #include "Fixtures/EnergyPlusFixture.hh" #include diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index a3fb550d5f0..47edbf20470 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -51,22 +51,23 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include -#include -#include -#include -#include -#include -#include - +#include #include #include #include +#include +#include #include #include +#include +#include #include #include #include +#include +#include #include #include #include @@ -74,9 +75,6 @@ #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace EnergyPlus::LowTempRadiantSystem; using namespace ObjexxFCL; @@ -133,12 +131,12 @@ class LowTempRadiantSystemTest : public EnergyPlusFixture HydrRadSys(RadSysNum).NumCircuits.allocate(1); CFloRadSys(RadSysNum).NumCircuits.allocate(1); // set up plant loop - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); - PlantSizData.allocate(TotNumLoops); - NumPltSizInput = TotNumLoops; + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + PlantSizData.allocate(state->dataPlnt->TotNumLoops); + NumPltSizInput = state->dataPlnt->TotNumLoops; - for (int loopindex = 1; loopindex <= TotNumLoops; ++loopindex) { + for (int loopindex = 1; loopindex <= state->dataPlnt->TotNumLoops; ++loopindex) { auto &loop(state->dataPlnt->PlantLoop(loopindex)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(loopindex).LoopSide(1)); @@ -1127,7 +1125,7 @@ TEST_F(LowTempRadiantSystemTest, AutosizeLowTempRadiantVariableFlowTest) GetPlantSizingInput(*state); GetPlantLoopData(*state); GetPlantInput(*state); - SetupInitialPlantCallingOrder(); + SetupInitialPlantCallingOrder(*state); SetupBranchControlTypes(*state); DataSurfaces::WorldCoordSystem = true; GetSurfaceListsInputs(*state); diff --git a/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc b/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc index 2b3a4ab8ad9..bec8b0f4d95 100644 --- a/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc +++ b/tst/EnergyPlus/unit/MicroCHPElectricGenerator.unit.cc @@ -53,13 +53,14 @@ // C++ Headers #include #include + // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include #include -#include using namespace EnergyPlus; using namespace ObjexxFCL; @@ -275,7 +276,7 @@ TEST_F(EnergyPlusFixture, MicroCHPTest_InitGeneratorDynamics) }); ASSERT_TRUE(process_idf(idf_objects)); - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(2); diff --git a/tst/EnergyPlus/unit/MicroturbineElectricGenerator.unit.cc b/tst/EnergyPlus/unit/MicroturbineElectricGenerator.unit.cc index 5af64bb2e05..b3ba1adcffd 100644 --- a/tst/EnergyPlus/unit/MicroturbineElectricGenerator.unit.cc +++ b/tst/EnergyPlus/unit/MicroturbineElectricGenerator.unit.cc @@ -51,11 +51,10 @@ #include // EnergyPlus Headers -#include -#include - #include "Fixtures/EnergyPlusFixture.hh" #include +#include +#include using namespace EnergyPlus::MicroturbineElectricGenerator; diff --git a/tst/EnergyPlus/unit/MixedAir.unit.cc b/tst/EnergyPlus/unit/MixedAir.unit.cc index a449c100126..3cf9289133f 100644 --- a/tst/EnergyPlus/unit/MixedAir.unit.cc +++ b/tst/EnergyPlus/unit/MixedAir.unit.cc @@ -51,6 +51,8 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -67,14 +69,11 @@ #include #include #include +#include #include #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include -#include - using namespace EnergyPlus::MixedAir; using namespace EnergyPlus::DataContaminantBalance; using namespace EnergyPlus::DataAirLoop; diff --git a/tst/EnergyPlus/unit/MixerComponent.unit.cc b/tst/EnergyPlus/unit/MixerComponent.unit.cc index a985de4d466..f3fcb0bb988 100644 --- a/tst/EnergyPlus/unit/MixerComponent.unit.cc +++ b/tst/EnergyPlus/unit/MixerComponent.unit.cc @@ -52,9 +52,8 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include -#include #include +#include using namespace EnergyPlus; using namespace EnergyPlus::MixerComponent; diff --git a/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc b/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc index a988fc67b16..096133ebfad 100644 --- a/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc +++ b/tst/EnergyPlus/unit/MoistureBalanceEMPD.unit.cc @@ -51,25 +51,22 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include #include -#include #include #include #include #include #include -#include #include #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; TEST_F(EnergyPlusFixture, CheckEMPDCalc) diff --git a/tst/EnergyPlus/unit/NodeInputManager.unit.cc b/tst/EnergyPlus/unit/NodeInputManager.unit.cc index bbb34218dea..8682048f743 100644 --- a/tst/EnergyPlus/unit/NodeInputManager.unit.cc +++ b/tst/EnergyPlus/unit/NodeInputManager.unit.cc @@ -52,6 +52,7 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -59,7 +60,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::NodeInputManager; diff --git a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc index e5cfd020f05..41c0315fd6d 100644 --- a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc +++ b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc @@ -51,8 +51,8 @@ #include // EnergyPlus Headers - #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -62,7 +62,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/OutAirNodeManager.unit.cc b/tst/EnergyPlus/unit/OutAirNodeManager.unit.cc index c9a6f39032d..6c8ee7208e7 100644 --- a/tst/EnergyPlus/unit/OutAirNodeManager.unit.cc +++ b/tst/EnergyPlus/unit/OutAirNodeManager.unit.cc @@ -52,14 +52,12 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include -#include +#include #include +#include +#include #include #include -#include - -//#include using namespace EnergyPlus; using namespace EnergyPlus::OutAirNodeManager; diff --git a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc index 4c0265a24f9..9f908e46a6a 100644 --- a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc +++ b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc @@ -53,6 +53,7 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include @@ -75,7 +76,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::CurveManager; @@ -577,12 +577,12 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_WaterCoolingCoilAutoSizeTest) EXPECT_EQ(OutdoorAirUnit::WaterCoil_Cooling, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).ComponentType_Num); EXPECT_EQ(TypeOf_CoilWaterCooling, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).CoilPlantTypeOfNum); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); DataSizing::NumPltSizInput = 1; PlantSizData.allocate(DataSizing::NumPltSizInput); - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -883,12 +883,12 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_SteamHeatingCoilAutoSizeTest) EXPECT_EQ(OutdoorAirUnit::SteamCoil_AirHeat, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).ComponentType_Num); EXPECT_EQ(TypeOf_CoilSteamAirHeating, state->dataOutdoorAirUnit->OutAirUnit(OAUnitNum).OAEquip(1).CoilPlantTypeOfNum); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); DataSizing::NumPltSizInput = 1; PlantSizData.allocate(DataSizing::NumPltSizInput); - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index ab58e2daf3d..a24ced19ff8 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -46,12 +46,14 @@ // POSSIBILITY OF SUCH DAMAGE. // EnergyPlus::OutputProcessor Unit Tests +#include // Google Test Headers #include // EnergyPlus Headers #include "Fixtures/SQLiteFixture.hh" +#include #include #include #include @@ -64,9 +66,6 @@ #include #include -#include -#include - using namespace EnergyPlus::PurchasedAirManager; using namespace EnergyPlus::WeatherManager; using namespace EnergyPlus::OutputProcessor; diff --git a/tst/EnergyPlus/unit/OutputReportData.unit.cc b/tst/EnergyPlus/unit/OutputReportData.unit.cc index 659a5eb5037..333b5843283 100644 --- a/tst/EnergyPlus/unit/OutputReportData.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportData.unit.cc @@ -49,15 +49,17 @@ // Google Test Headers #include + // ObjexxFCL Headers #include + // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include #include -#include using namespace EnergyPlus; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index d8ecd8b3db2..c8780ff318e 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -61,6 +61,7 @@ // EnergyPlus Headers #include #include +#include #include #include #include @@ -86,7 +87,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::DataGlobalConstants; diff --git a/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc b/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc index 88919cbaf4c..f51743ec06b 100644 --- a/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabularAnnual.unit.cc @@ -51,16 +51,15 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include +#include #include #include #include #include -#include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace EnergyPlus::OutputReportTabularAnnual; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/OutputReports.unit.cc b/tst/EnergyPlus/unit/OutputReports.unit.cc index 7347a29fbc9..2fdd1729516 100644 --- a/tst/EnergyPlus/unit/OutputReports.unit.cc +++ b/tst/EnergyPlus/unit/OutputReports.unit.cc @@ -49,21 +49,21 @@ // Google Test Headers #include + // ObjexxFCL Headers #include // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include #include #include -#include using namespace EnergyPlus; using namespace ObjexxFCL; -// using namespace OutputProcessor; TEST_F(EnergyPlusFixture, OutputReports_SurfaceDetailsReport) { diff --git a/tst/EnergyPlus/unit/PVWatts.unit.cc b/tst/EnergyPlus/unit/PVWatts.unit.cc index d28de8ff610..84941aaeea9 100644 --- a/tst/EnergyPlus/unit/PVWatts.unit.cc +++ b/tst/EnergyPlus/unit/PVWatts.unit.cc @@ -52,6 +52,8 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -59,9 +61,6 @@ #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; TEST_F(EnergyPlusFixture, PVWattsGenerator_Constructor) diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index 05636f8de4d..6b35a304a18 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -48,12 +48,18 @@ // EnergyPlus::VariableSpeedCoils Unit Tests // Google Test Headers +#include + +// Objexx Headers +#include + +// EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include -#include #include #include #include @@ -64,7 +70,6 @@ #include #include #include -#include #include #include #include @@ -74,12 +79,8 @@ #include #include #include -#include #include #include -#include -#include -#include using namespace EnergyPlus; using namespace EnergyPlus::BranchInputManager; @@ -448,10 +449,10 @@ TEST_F(EnergyPlusFixture, PackagedTerminalHP_VSCoils_Sizing) GetZoneEquipmentData(*state); GetPTUnit(*state); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/Photovoltaics.unit.cc b/tst/EnergyPlus/unit/Photovoltaics.unit.cc index 46d43cbaa9c..9d95aae9293 100644 --- a/tst/EnergyPlus/unit/Photovoltaics.unit.cc +++ b/tst/EnergyPlus/unit/Photovoltaics.unit.cc @@ -51,14 +51,13 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; TEST_F(EnergyPlusFixture, PV_Sandia_AirMassAtHighZenith) diff --git a/tst/EnergyPlus/unit/PierceSurface.unit.cc b/tst/EnergyPlus/unit/PierceSurface.unit.cc index d0db7a0ff10..c3c86d36bfa 100644 --- a/tst/EnergyPlus/unit/PierceSurface.unit.cc +++ b/tst/EnergyPlus/unit/PierceSurface.unit.cc @@ -51,14 +51,9 @@ #include // EnergyPlus Headers -#include - #include "Fixtures/EnergyPlusFixture.hh" #include - -// ObjexxFCL Headers -#include -#include +#include // C++ Headers #include diff --git a/tst/EnergyPlus/unit/Pipes.unit.cc b/tst/EnergyPlus/unit/Pipes.unit.cc index 2a2231e885f..f24db2982af 100644 --- a/tst/EnergyPlus/unit/Pipes.unit.cc +++ b/tst/EnergyPlus/unit/Pipes.unit.cc @@ -51,9 +51,9 @@ #include #include "Fixtures/EnergyPlusFixture.hh" -#include -#include #include +#include +#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc b/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc index 4ef0353f55e..1a9072a0843 100644 --- a/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc +++ b/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc @@ -51,14 +51,13 @@ #include // EnergyPlus Headers -#include +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include +#include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; TEST_F(EnergyPlusFixture, ChillerHeater_Autosize) @@ -172,7 +171,7 @@ TEST_F(EnergyPlusFixture, ChillerHeater_Autosize) (rho_cond * Cp_cond * DataSizing::PlantSizData(PltSizCondNum).DeltaT); // now call sizing routine - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; PlantCentralGSHP::Wrapper(1).SizeWrapper(*state); // Careful of actually using PlantCentralGSHP::Wrapper(1).ChillerHeater(1) and not PlantCentralGSHP::ChillerHeater since this array isn't used diff --git a/tst/EnergyPlus/unit/PlantChillers.unit.cc b/tst/EnergyPlus/unit/PlantChillers.unit.cc index 715d17aa3d9..b7cef040dfd 100644 --- a/tst/EnergyPlus/unit/PlantChillers.unit.cc +++ b/tst/EnergyPlus/unit/PlantChillers.unit.cc @@ -51,12 +51,11 @@ #include // EnergyPlus Headers -#include -#include -#include - #include "Fixtures/EnergyPlusFixture.hh" #include +#include +#include +#include using namespace EnergyPlus; using namespace PlantChillers; @@ -86,7 +85,7 @@ TEST_F(EnergyPlusFixture, GTChiller_HeatRecoveryAutosizeTest) state->dataPlnt->PlantLoop(1).FluidName = "WATER"; DataSizing::PlantSizData(1).DesVolFlowRate = 1.0; DataSizing::PlantSizData(1).DeltaT = 5.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // now call sizing routine state->dataPlantChillers->GTChiller(1).size(*state); @@ -122,7 +121,7 @@ TEST_F(EnergyPlusFixture, EngineDrivenChiller_HeatRecoveryAutosizeTest) state->dataPlnt->PlantLoop(1).FluidName = "WATER"; DataSizing::PlantSizData(1).DesVolFlowRate = 1.0; DataSizing::PlantSizData(1).DeltaT = 5.0; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // now call sizing routine state->dataPlantChillers->EngineDrivenChiller(1).size(*state); diff --git a/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc b/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc index be275692563..e72c2ea9a9e 100644 --- a/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc +++ b/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc @@ -51,10 +51,10 @@ #include #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include -#include namespace EnergyPlus { @@ -73,7 +73,7 @@ TEST_F(EnergyPlusFixture, TestPlantComponentTemperatureSource) ASSERT_TRUE(process_idf(idf_objects)); // Setup the plant itself manually - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; @@ -95,7 +95,7 @@ TEST_F(EnergyPlusFixture, TestPlantComponentTemperatureSource) bool firstHVACIteration; bool runFlag = false; state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; PlantComponentTemperatureSources::GetWaterSourceInput(*state); // We can check that GetInput happened properly here diff --git a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc index 1ced672093c..1cd8ce1d925 100644 --- a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc +++ b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc @@ -51,14 +51,13 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include +#include #include +#include #include #include -#include -#include - -#include "Fixtures/EnergyPlusFixture.hh" -#include using namespace EnergyPlus; @@ -836,7 +835,7 @@ TEST_F(EnergyPlusFixture, ThermalEnergyStorageWithIceForceDualOp) { EXPECT_TRUE(process_idf(idf_objects, false)); // Setup the plant itself manually - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).OpScheme.allocate(1); diff --git a/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc b/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc index 800e9c6991c..70f62186ace 100644 --- a/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc +++ b/tst/EnergyPlus/unit/PlantHeatExchangerFluidToFluid.unit.cc @@ -50,8 +50,10 @@ // Google Test Headers #include +// EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include @@ -66,7 +68,6 @@ #include #include #include -#include namespace EnergyPlus { @@ -2307,10 +2308,10 @@ TEST_F(EnergyPlusFixture, PlantHXControlWithFirstHVACIteration) PlantHeatExchangerFluidToFluid::FluidHX(1).Name = "Test HX"; // setup two plant loops, need for SetComponenetFlowRate - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -2409,10 +2410,10 @@ TEST_F(EnergyPlusFixture, PlantHXControl_CoolingSetpointOnOffWithComponentOverri PlantHeatExchangerFluidToFluid::FluidHX(1).Name = "Test HX"; // setup two plant loops, need for SetComponenetFlowRate - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); } diff --git a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc index 34d8a85cd88..f98fec817d8 100644 --- a/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc +++ b/tst/EnergyPlus/unit/PlantLoopHeatPumpEIR.unit.cc @@ -57,15 +57,13 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" - +#include #include -#include #include #include -#include +#include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::EIRPlantLoopHeatPumps; @@ -429,7 +427,7 @@ TEST_F(EnergyPlusFixture, Initialization) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; @@ -481,7 +479,7 @@ TEST_F(EnergyPlusFixture, Initialization) // now call for initialization again, for begin environment state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; thisCoolingPLHP->onInitLoopEquip(*state, myLocation); // validate that plant sizing went ok @@ -558,8 +556,8 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_WaterSou EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); // We'll set up two plant loops: a load and a source loop - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); @@ -620,9 +618,9 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_WaterSou thisCoolingPLHP->onInitLoopEquip(*state, myCoolingLoadLocation); thisHeatingPLHP->onInitLoopEquip(*state, myHeatingLoadLocation); - DataPlant::PlantFinalSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // assign the plant sizing data state->dataPlnt->PlantLoop(1).PlantSizNum = 1; @@ -745,8 +743,8 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyHardsizedHeatingWithCompanion) EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); // We'll set up two plant loops: a load and a source loop - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); @@ -804,9 +802,9 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyHardsizedHeatingWithCompanion) // initialize so the components can find themselves on the plant thisHeatingPLHP->onInitLoopEquip(*state, myLoadLocation); - DataPlant::PlantFinalSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // The values really should just come out all as the hard-sized values, this just makes sure that function didn't // botch something up. @@ -882,8 +880,8 @@ TEST_F(EnergyPlusFixture, TestSizing_WithCompanionNoPlantSizing) EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); // We'll set up two plant loops: a load and a source loop - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); @@ -934,9 +932,9 @@ TEST_F(EnergyPlusFixture, TestSizing_WithCompanionNoPlantSizing) thisCoolingPLHP->onInitLoopEquip(*state, myCoolingLoadLocation); thisHeatingPLHP->onInitLoopEquip(*state, myHeatingLoadLocation); - DataPlant::PlantFinalSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // let's just fake that the companion coil already got autosized properly thisHeatingPLHP->loadSideDesignVolFlowRate = 0.1; @@ -993,8 +991,8 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingError) EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); // We'll set up two plant loops: a load and a source loop - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); @@ -1035,9 +1033,9 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingError) // initialize so the components can find themselves on the plant thisHeatingPLHP->onInitLoopEquip(*state, myHeatingLoadLocation); - DataPlant::PlantFinalSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // with no plant sizing available and no companion coil to size from, it should throw a fatal EXPECT_THROW(thisHeatingPLHP->sizeLoadSide(*state), std::runtime_error); @@ -1082,8 +1080,8 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingHardSized) EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); // We'll set up two plant loops: a load and a source loop - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); @@ -1124,9 +1122,9 @@ TEST_F(EnergyPlusFixture, TestSizing_NoCompanionNoPlantSizingHardSized) // initialize so the components can find themselves on the plant thisHeatingPLHP->onInitLoopEquip(*state, myHeatingLoadLocation); - DataPlant::PlantFinalSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // this should report out to the sizing output, but just the user defined stuff thisHeatingPLHP->sizeLoadSide(*state); @@ -1164,7 +1162,7 @@ TEST_F(EnergyPlusFixture, CoolingOutletSetpointWorker) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); auto &PLHPPlantLoadSideLoop = state->dataPlnt->PlantLoop(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); @@ -1243,7 +1241,7 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; @@ -1281,7 +1279,7 @@ TEST_F(EnergyPlusFixture, Initialization2_WaterSource) // call for all initialization state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; thisCoolingPLHP->onInitLoopEquip(*state, myLocation); // call with run flag off, loose limits on node min/max @@ -1375,8 +1373,8 @@ TEST_F(EnergyPlusFixture, OnInitLoopEquipTopologyErrorCases) ASSERT_TRUE(process_idf(idf_objects)); // set up a couple simple plant loops with one branch per loop-side and one component per branch - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; @@ -1420,7 +1418,7 @@ TEST_F(EnergyPlusFixture, OnInitLoopEquipTopologyErrorCases) // set a couple global flags state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // test the case where the heat pump is connected to both the supply and demand sides of the same loop PLHPPlantSupplySideComp.NodeNumIn = thisCoolingPLHP->loadSideNodes.inlet; @@ -1493,7 +1491,7 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_WaterSource) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; @@ -1534,7 +1532,7 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_WaterSource) // call for all initialization state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; thisCoolingPLHP->onInitLoopEquip(*state, myLoadLocation); // call from load side location, firsthvac, no load, not running, verify the unit doesn't have any values lingering @@ -1627,7 +1625,7 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_WaterSource) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; @@ -1667,7 +1665,7 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_WaterSource) // call for all initialization state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; thisHeatingPLHP->onInitLoopEquip(*state, myLoadLocation); // call it from the load side, but this time there is a negative (cooling) load - shouldn't try to run @@ -1856,7 +1854,7 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_AirSource) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; @@ -1886,7 +1884,7 @@ TEST_F(EnergyPlusFixture, CoolingSimulate_AirSource) // call for all initialization state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; thisCoolingPLHP->onInitLoopEquip(*state, myLoadLocation); // call from load side location, firsthvac, no load, not running, verify the unit doesn't have any values lingering @@ -1973,7 +1971,7 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_AirSource) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; @@ -2003,7 +2001,7 @@ TEST_F(EnergyPlusFixture, HeatingSimulate_AirSource) // call for all initialization state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; thisHeatingPLHP->onInitLoopEquip(*state, myLoadLocation); // call it from the load side, but this time there is a negative (cooling) load - shouldn't try to run @@ -2189,7 +2187,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; @@ -2217,7 +2215,7 @@ TEST_F(EnergyPlusFixture, Initialization2_AirSource) // call for all initialization state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; thisCoolingPLHP->onInitLoopEquip(*state, myLocation); // call with run flag off, loose limits on node min/max @@ -2331,8 +2329,8 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_AirSourc EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); // We'll set up two plant loops: a load and a source loop - DataPlant::TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); @@ -2379,9 +2377,9 @@ TEST_F(EnergyPlusFixture, TestSizing_FullyAutosizedCoolingWithCompanion_AirSourc thisCoolingPLHP->onInitLoopEquip(*state, myCoolingLoadLocation); thisHeatingPLHP->onInitLoopEquip(*state, myHeatingLoadLocation); - DataPlant::PlantFinalSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // assign the plant sizing data state->dataPlnt->PlantLoop(1).PlantSizNum = 1; @@ -2495,8 +2493,8 @@ TEST_F(EnergyPlusFixture, TestSizing_HardsizedFlowAutosizedCoolingWithCompanion_ EXPECT_EQ("HP HEATING SIDE", thisHeatingPLHP->name); // We'll set up two plant loops: a load and a source loop - DataPlant::TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); @@ -2539,9 +2537,9 @@ TEST_F(EnergyPlusFixture, TestSizing_HardsizedFlowAutosizedCoolingWithCompanion_ thisCoolingPLHP->onInitLoopEquip(*state, myCoolingLoadLocation); thisHeatingPLHP->onInitLoopEquip(*state, myHeatingLoadLocation); - DataPlant::PlantFinalSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToReport = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFinalSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToReport = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; // assign the plant sizing data state->dataPlnt->PlantLoop(1).PlantSizNum = 1; @@ -2647,7 +2645,7 @@ TEST_F(EnergyPlusFixture, Test_DoPhysics) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(2).TotalBranches = 1; @@ -2744,7 +2742,7 @@ TEST_F(EnergyPlusFixture, CoolingMetering) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; @@ -2784,7 +2782,7 @@ TEST_F(EnergyPlusFixture, CoolingMetering) // call for all initialization state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; thisCoolingPLHP->onInitLoopEquip(*state, myLoadLocation); int NumFound; @@ -2844,7 +2842,7 @@ TEST_F(EnergyPlusFixture, HeatingMetering) // set up the plant loops // first the load side - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopDemandCalcScheme = DataPlant::iLoopDemandCalcScheme::SingleSetPoint; @@ -2884,7 +2882,7 @@ TEST_F(EnergyPlusFixture, HeatingMetering) // call for all initialization state->dataGlobal->BeginEnvrnFlag = true; - DataPlant::PlantFirstSizesOkayToFinalize = true; + state->dataPlnt->PlantFirstSizesOkayToFinalize = true; thisHeatingPLHP->onInitLoopEquip(*state, myLoadLocation); int NumFound; diff --git a/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc b/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc index b0acec0275c..2395ff81a2d 100644 --- a/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc +++ b/tst/EnergyPlus/unit/PlantPipingSystemsManager.unit.cc @@ -50,6 +50,8 @@ // Google Test Headers #include +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -61,9 +63,6 @@ #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace PlantPipingSystemsManager; using DataSurfaces::Surface; @@ -1703,7 +1702,7 @@ TEST_F(EnergyPlusFixture, PipingSystemFullSimulation) { ASSERT_TRUE(process_idf(idf_objects)); // Setup the plant itself manually - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).TotalBranches = 1; diff --git a/tst/EnergyPlus/unit/PlantUtilities.unit.cc b/tst/EnergyPlus/unit/PlantUtilities.unit.cc index 9610e027715..2e892f73c14 100644 --- a/tst/EnergyPlus/unit/PlantUtilities.unit.cc +++ b/tst/EnergyPlus/unit/PlantUtilities.unit.cc @@ -50,15 +50,15 @@ // Google Test Headers #include +// ObjexxFCL Headers #include // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include +#include #include +#include #include -#include -#include using namespace EnergyPlus; using namespace EnergyPlus::PlantUtilities; @@ -208,7 +208,7 @@ TEST_F(EnergyPlusFixture, TestAnyPlantSplitterMixerLacksContinuity) // This test captures all code paths through the AnyPlantSplitterMixerLacksContinuity function // We need to set up a two sided plant loop, we'll have one side not have a splitter for convenience - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).Splitter.Exists = false; @@ -440,7 +440,7 @@ TEST_F(EnergyPlusFixture, TestCheckPlantConvergence) TEST_F(EnergyPlusFixture, TestScanPlantLoopsErrorFlagReturnType) { // test out some stuff on the scan plant loops function, for now just verifying errFlag is passed by reference - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); DataLoopNode::Node.allocate(2); diff --git a/tst/EnergyPlus/unit/PluginManager.unit.cc b/tst/EnergyPlus/unit/PluginManager.unit.cc index fe0eee6a71f..98fee092197 100644 --- a/tst/EnergyPlus/unit/PluginManager.unit.cc +++ b/tst/EnergyPlus/unit/PluginManager.unit.cc @@ -48,9 +48,10 @@ // Google Test Headers #include +// EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include #include +#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc b/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc index 790361b14e3..ad034770126 100644 --- a/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc +++ b/tst/EnergyPlus/unit/PoweredInductionUnits.unit.cc @@ -54,6 +54,7 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -68,14 +69,11 @@ #include #include #include -#include -#include #include #include #include #include #include -#include using namespace EnergyPlus; using namespace SimulationManager; diff --git a/tst/EnergyPlus/unit/Psychrometrics.unit.cc b/tst/EnergyPlus/unit/Psychrometrics.unit.cc index 30d2c8c5943..d8d3b68b13b 100644 --- a/tst/EnergyPlus/unit/Psychrometrics.unit.cc +++ b/tst/EnergyPlus/unit/Psychrometrics.unit.cc @@ -49,10 +49,9 @@ #include // EnergyPlus Headers -#include - #include "Fixtures/EnergyPlusFixture.hh" #include +#include using namespace EnergyPlus; using namespace EnergyPlus::Psychrometrics; diff --git a/tst/EnergyPlus/unit/Pumps.unit.cc b/tst/EnergyPlus/unit/Pumps.unit.cc index 6fc55a78da5..d73f35891c2 100644 --- a/tst/EnergyPlus/unit/Pumps.unit.cc +++ b/tst/EnergyPlus/unit/Pumps.unit.cc @@ -50,12 +50,13 @@ // Google Test Headers #include +// EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include +#include #include +#include #include #include -#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/PurchasedAirManager.unit.cc b/tst/EnergyPlus/unit/PurchasedAirManager.unit.cc index 2a1ea0191f3..26d993eb586 100644 --- a/tst/EnergyPlus/unit/PurchasedAirManager.unit.cc +++ b/tst/EnergyPlus/unit/PurchasedAirManager.unit.cc @@ -50,9 +50,9 @@ // Google Test Headers #include -#include "Fixtures/EnergyPlusFixture.hh" - // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -68,10 +68,8 @@ #include #include #include -#include #include #include -#include using namespace EnergyPlus; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc index 1f82e817589..2163309bd2e 100644 --- a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc +++ b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc @@ -54,22 +54,17 @@ #include "Fixtures/SQLiteFixture.hh" // EnergyPlus Headers +#include #include -#include #include #include -#include #include #include #include #include #include -#include -#include #include #include -#include -#include using namespace EnergyPlus; using namespace ObjexxFCL; @@ -81,7 +76,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) int chWInletNodeNum = 9; int chWOutletNodeNum = 15; - EnergyPlus::DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).Name = "Chilled Water Loop"; state->dataPlnt->PlantLoop(1).FluidName = "Water"; @@ -232,7 +227,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) int wInletNodeNum = 9; int wOutletNodeNum = 15; - EnergyPlus::DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).Name = "Steam Loop"; state->dataPlnt->PlantLoop(1).FluidName = "Steam"; diff --git a/tst/EnergyPlus/unit/ResultsFramework.unit.cc b/tst/EnergyPlus/unit/ResultsFramework.unit.cc index cd6eba2d097..130ddd940d4 100644 --- a/tst/EnergyPlus/unit/ResultsFramework.unit.cc +++ b/tst/EnergyPlus/unit/ResultsFramework.unit.cc @@ -51,13 +51,13 @@ #include // EnergyPlus Headers +#include #include #include #include #include #include #include -#include // Fixture #include "Fixtures/ResultsFrameworkFixture.hh" diff --git a/tst/EnergyPlus/unit/RoomAirModelUserTempPattern.unit.cc b/tst/EnergyPlus/unit/RoomAirModelUserTempPattern.unit.cc index c0dfd01e3ed..d5e3c6e503c 100644 --- a/tst/EnergyPlus/unit/RoomAirModelUserTempPattern.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirModelUserTempPattern.unit.cc @@ -52,9 +52,8 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include -#include #include +#include using namespace EnergyPlus; using namespace EnergyPlus::RoomAirModelUserTempPattern; diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 5b1e462d94b..b9a2f953216 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -51,8 +51,10 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include #include @@ -68,9 +70,6 @@ #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace DataEnvironment; using namespace EnergyPlus::DataSizing; diff --git a/tst/EnergyPlus/unit/RootFinder.unit.cc b/tst/EnergyPlus/unit/RootFinder.unit.cc index b3930cf8cad..fc4f69201ec 100644 --- a/tst/EnergyPlus/unit/RootFinder.unit.cc +++ b/tst/EnergyPlus/unit/RootFinder.unit.cc @@ -50,14 +50,11 @@ // Google Test Headers #include -// ObjexxFCL Headers - // EnergyPlus Headers -#include -#include - #include "Fixtures/EnergyPlusFixture.hh" #include +#include +#include using namespace EnergyPlus; diff --git a/tst/EnergyPlus/unit/RunPeriod.unit.cc b/tst/EnergyPlus/unit/RunPeriod.unit.cc index c83f7983d0f..d8a368f99ee 100644 --- a/tst/EnergyPlus/unit/RunPeriod.unit.cc +++ b/tst/EnergyPlus/unit/RunPeriod.unit.cc @@ -54,6 +54,8 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -62,9 +64,6 @@ #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace EnergyPlus::WeatherManager; using namespace EnergyPlus::ScheduleManager; diff --git a/tst/EnergyPlus/unit/RuntimeLanguageProcessor.unit.cc b/tst/EnergyPlus/unit/RuntimeLanguageProcessor.unit.cc index c3c3895b0e8..356b57921d4 100644 --- a/tst/EnergyPlus/unit/RuntimeLanguageProcessor.unit.cc +++ b/tst/EnergyPlus/unit/RuntimeLanguageProcessor.unit.cc @@ -52,11 +52,11 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include #include -#include using namespace EnergyPlus; diff --git a/tst/EnergyPlus/unit/SQLite.unit.cc b/tst/EnergyPlus/unit/SQLite.unit.cc index 15d1d3c254a..344c05ce05c 100644 --- a/tst/EnergyPlus/unit/SQLite.unit.cc +++ b/tst/EnergyPlus/unit/SQLite.unit.cc @@ -51,11 +51,11 @@ #include // EnergyPlus Headers +#include "Fixtures/SQLiteFixture.hh" #include +#include #include -#include "Fixtures/SQLiteFixture.hh" #include -#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/SZVAVModel.unit.cc b/tst/EnergyPlus/unit/SZVAVModel.unit.cc index 690af6d3921..01804628c83 100644 --- a/tst/EnergyPlus/unit/SZVAVModel.unit.cc +++ b/tst/EnergyPlus/unit/SZVAVModel.unit.cc @@ -51,9 +51,9 @@ #include // EnergyPlus Headers -#include #include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include @@ -571,8 +571,8 @@ TEST_F(EnergyPlusFixture, SZVAV_FanCoilUnit_Testing) EXPECT_EQ("FAN:ONOFF", thisFanCoil.FanType); EXPECT_EQ("COIL:COOLING:WATER", thisFanCoil.CCoilType); EXPECT_EQ("COIL:HEATING:ELECTRIC", thisFanCoil.HCoilType); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; ColdWaterMassFlowRate = 1.0; @@ -611,7 +611,7 @@ TEST_F(EnergyPlusFixture, SZVAV_FanCoilUnit_Testing) DataLoopNode::Node(eHCoil.AirInletNodeNum).MassFlowRate = AirMassFlow; DataLoopNode::Node(eHCoil.AirInletNodeNum).MassFlowRateMaxAvail = AirMassFlow; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/ScheduleManager.unit.cc b/tst/EnergyPlus/unit/ScheduleManager.unit.cc index 49916ced9ef..ab743298765 100644 --- a/tst/EnergyPlus/unit/ScheduleManager.unit.cc +++ b/tst/EnergyPlus/unit/ScheduleManager.unit.cc @@ -49,16 +49,18 @@ // Google Test Headers #include + // ObjexxFCL Headers #include + // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::ScheduleManager; diff --git a/tst/EnergyPlus/unit/SecondaryDXCoils.unit.cc b/tst/EnergyPlus/unit/SecondaryDXCoils.unit.cc index d2fe9dcdc43..d47244b3561 100644 --- a/tst/EnergyPlus/unit/SecondaryDXCoils.unit.cc +++ b/tst/EnergyPlus/unit/SecondaryDXCoils.unit.cc @@ -53,21 +53,18 @@ #include // C++ Headers -#include -#include #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace DXCoils; using namespace DataHVACGlobals; diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 9cc570168e9..0b11bf7b255 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -56,20 +56,18 @@ #include "Fixtures/EnergyPlusFixture.hh" // EnergyPlus Headers -#include "Fixtures/EnergyPlusFixture.hh" #include #include #include +#include #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -83,7 +81,6 @@ #include #include #include -#include using namespace EnergyPlus; @@ -91,7 +88,7 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterChWSetPointManager) { // Set up the required plant loop data - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); @@ -181,7 +178,7 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterHWSetPointManager) { // Set up the required plant loop data - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataPlnt->PlantLoop.allocate(1); state->dataPlnt->PlantLoop(1).FluidIndex = 1; state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); @@ -356,7 +353,7 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineCondEntSetPointManager) int const chillerCompIndex = 1; // Set up ChW loop manually, way too much input to do that here in idf, all I care about is the - DataPlant::TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataPlnt->PlantLoop.allocate(2); state->dataPlnt->PlantLoop(chwLoopIndex).LoopSide.allocate(2); diff --git a/tst/EnergyPlus/unit/SimAirServingZones.unit.cc b/tst/EnergyPlus/unit/SimAirServingZones.unit.cc index 09ce0a9a0b5..103967b827b 100644 --- a/tst/EnergyPlus/unit/SimAirServingZones.unit.cc +++ b/tst/EnergyPlus/unit/SimAirServingZones.unit.cc @@ -51,28 +51,22 @@ #include // C++ Headers -#include -#include #include -// ObjexxFCL Headers -#include -#include - // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include #include #include #include +#include #include #include #include #include -#include -#include using namespace EnergyPlus; using namespace DataAirSystems; diff --git a/tst/EnergyPlus/unit/SimulationManager.unit.cc b/tst/EnergyPlus/unit/SimulationManager.unit.cc index f5e4750e0e4..b04a335117d 100644 --- a/tst/EnergyPlus/unit/SimulationManager.unit.cc +++ b/tst/EnergyPlus/unit/SimulationManager.unit.cc @@ -49,15 +49,13 @@ #include // EnergyPlus Headers -#include -#include -#include +#include "Fixtures/EnergyPlusFixture.hh" +#include #include +#include #include -#include - -#include "Fixtures/EnergyPlusFixture.hh" -#include +#include +#include using namespace EnergyPlus; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/SingleDuct.unit.cc b/tst/EnergyPlus/unit/SingleDuct.unit.cc index d11c84a2a39..5b06d0a1eb7 100644 --- a/tst/EnergyPlus/unit/SingleDuct.unit.cc +++ b/tst/EnergyPlus/unit/SingleDuct.unit.cc @@ -54,6 +54,7 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -66,14 +67,11 @@ #include #include #include -#include -#include #include #include #include #include #include -#include using namespace EnergyPlus; using namespace SimulationManager; diff --git a/tst/EnergyPlus/unit/SiteBuildingSurfaceGroundTemperatures.unit.cc b/tst/EnergyPlus/unit/SiteBuildingSurfaceGroundTemperatures.unit.cc index 38b31baca51..5335a3540d2 100644 --- a/tst/EnergyPlus/unit/SiteBuildingSurfaceGroundTemperatures.unit.cc +++ b/tst/EnergyPlus/unit/SiteBuildingSurfaceGroundTemperatures.unit.cc @@ -53,7 +53,6 @@ // EnergyPlus Headers #include "EnergyPlus/DataIPShortCuts.hh" #include "EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.hh" -#include "EnergyPlus/GroundTemperatureModeling/SiteBuildingSurfaceGroundTemperatures.hh" #include "Fixtures/EnergyPlusFixture.hh" #include diff --git a/tst/EnergyPlus/unit/SiteDeepGroundTemperatures.unit.cc b/tst/EnergyPlus/unit/SiteDeepGroundTemperatures.unit.cc index 7b7ab0aeae5..f1d7f19c393 100644 --- a/tst/EnergyPlus/unit/SiteDeepGroundTemperatures.unit.cc +++ b/tst/EnergyPlus/unit/SiteDeepGroundTemperatures.unit.cc @@ -53,7 +53,6 @@ // EnergyPlus Headers #include "EnergyPlus/DataIPShortCuts.hh" #include "EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.hh" -#include "EnergyPlus/GroundTemperatureModeling/SiteDeepGroundTemperatures.hh" #include "Fixtures/EnergyPlusFixture.hh" #include diff --git a/tst/EnergyPlus/unit/SiteFCFactorMethodGroundTemperatures.unit.cc b/tst/EnergyPlus/unit/SiteFCFactorMethodGroundTemperatures.unit.cc index 4d87988aef3..c01ed3ee7d2 100644 --- a/tst/EnergyPlus/unit/SiteFCFactorMethodGroundTemperatures.unit.cc +++ b/tst/EnergyPlus/unit/SiteFCFactorMethodGroundTemperatures.unit.cc @@ -53,7 +53,6 @@ // EnergyPlus Headers #include "EnergyPlus/DataIPShortCuts.hh" #include "EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.hh" -#include "EnergyPlus/GroundTemperatureModeling/SiteFCFactorMethodGroundTemperatures.hh" #include "Fixtures/EnergyPlusFixture.hh" #include diff --git a/tst/EnergyPlus/unit/SiteShallowGroundTemperatures.unit.cc b/tst/EnergyPlus/unit/SiteShallowGroundTemperatures.unit.cc index c1f4eb1739a..34aa8aa80ce 100644 --- a/tst/EnergyPlus/unit/SiteShallowGroundTemperatures.unit.cc +++ b/tst/EnergyPlus/unit/SiteShallowGroundTemperatures.unit.cc @@ -53,7 +53,6 @@ // EnergyPlus Headers #include "EnergyPlus/DataIPShortCuts.hh" #include "EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.hh" -#include "EnergyPlus/GroundTemperatureModeling/SiteShallowGroundTemperatures.hh" #include "Fixtures/EnergyPlusFixture.hh" #include diff --git a/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc b/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc index 573634144fb..cbdd77e5e88 100644 --- a/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc +++ b/tst/EnergyPlus/unit/SizeWaterHeatingCoil.unit.cc @@ -49,10 +49,11 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include -#include #include #include #include @@ -63,19 +64,14 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace ObjexxFCL; using namespace EnergyPlus; using namespace EnergyPlus::DataHVACGlobals; @@ -229,13 +225,13 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils1) CalcFinalZoneSizing.allocate(1); TermUnitSizing.allocate(1); ZoneEqSizing.allocate(1); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); PlantSizData.allocate(1); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); NumPltSizInput = 1; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -467,13 +463,13 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils2) CalcFinalZoneSizing.allocate(1); TermUnitSizing.allocate(1); ZoneEqSizing.allocate(1); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); PlantSizData.allocate(1); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); NumPltSizInput = 1; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -704,13 +700,13 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils3) CalcFinalZoneSizing.allocate(1); TermUnitSizing.allocate(1); ZoneEqSizing.allocate(1); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); PlantSizData.allocate(1); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); NumPltSizInput = 1; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -941,13 +937,13 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils4) CalcFinalZoneSizing.allocate(1); TermUnitSizing.allocate(1); ZoneEqSizing.allocate(1); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); PlantSizData.allocate(1); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); NumPltSizInput = 1; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -1142,13 +1138,13 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils5) UnitarySysEqSizing.allocate(1); state->dataAirSystemsData->PrimaryAirSystems.allocate(1); state->dataAirLoop->AirLoopControlInfo.allocate(1); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); PlantSizData.allocate(1); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); NumPltSizInput = 1; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -1354,11 +1350,11 @@ TEST_F(EnergyPlusFixture, TestSizingRoutineForHotWaterCoils6) ASSERT_TRUE(process_idf(idf_objects)); TermUnitSizing.allocate(1); - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataWaterCoils->MySizeFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc index b041cc58e38..9ce5e222be2 100644 --- a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc +++ b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc @@ -51,7 +51,8 @@ #include // EnergyPlus Headers -#include +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -61,8 +62,6 @@ #include #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include using namespace EnergyPlus; using namespace OutputProcessor; @@ -119,9 +118,9 @@ class SizingAnalysisObjectsTest : public EnergyPlusFixture PlantSizData(1).DesVolFlowRate = 0.002; PlantSizData(1).DeltaT = 10; - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); } diff --git a/tst/EnergyPlus/unit/SizingManager.unit.cc b/tst/EnergyPlus/unit/SizingManager.unit.cc index e7b934cb80c..eda9cc39c08 100644 --- a/tst/EnergyPlus/unit/SizingManager.unit.cc +++ b/tst/EnergyPlus/unit/SizingManager.unit.cc @@ -53,6 +53,7 @@ #include "Fixtures/EnergyPlusFixture.hh" // EnergyPlus Headers +#include #include #include #include @@ -60,8 +61,6 @@ #include #include #include -#include - using namespace EnergyPlus; using namespace EnergyPlus::HeatBalanceManager; diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index e9ea4bf0f63..970110d31ed 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -51,6 +51,8 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include @@ -68,9 +70,6 @@ #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace EnergyPlus::SolarShading; using namespace EnergyPlus::DataSurfaces; diff --git a/tst/EnergyPlus/unit/SortAndStringUtilities.unit.cc b/tst/EnergyPlus/unit/SortAndStringUtilities.unit.cc index acc9cfe0d5c..eace26675cd 100644 --- a/tst/EnergyPlus/unit/SortAndStringUtilities.unit.cc +++ b/tst/EnergyPlus/unit/SortAndStringUtilities.unit.cc @@ -54,13 +54,12 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace EnergyPlus::SortAndStringUtilities; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/StandardRatings.unit.cc b/tst/EnergyPlus/unit/StandardRatings.unit.cc index 56be2531f92..b5811a43e33 100644 --- a/tst/EnergyPlus/unit/StandardRatings.unit.cc +++ b/tst/EnergyPlus/unit/StandardRatings.unit.cc @@ -55,12 +55,12 @@ #include #include #include +#include #include #include #include #include #include -#include using namespace EnergyPlus; using namespace EnergyPlus::StandardRatings; diff --git a/tst/EnergyPlus/unit/StringUtilities.unit.cc b/tst/EnergyPlus/unit/StringUtilities.unit.cc index 07f00f21009..d23e3abdf65 100644 --- a/tst/EnergyPlus/unit/StringUtilities.unit.cc +++ b/tst/EnergyPlus/unit/StringUtilities.unit.cc @@ -47,10 +47,9 @@ #include -#include - #include "Fixtures/EnergyPlusFixture.hh" #include +#include using namespace EnergyPlus; diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 9cee283f46f..1db13cf6995 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -51,20 +51,19 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include #include #include -#include #include +#include #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace EnergyPlus::DataSurfaces; using namespace EnergyPlus::DataHeatBalance; diff --git a/tst/EnergyPlus/unit/SurfaceOctree.unit.cc b/tst/EnergyPlus/unit/SurfaceOctree.unit.cc index 2348514e4f1..2eba07e13bc 100644 --- a/tst/EnergyPlus/unit/SurfaceOctree.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceOctree.unit.cc @@ -51,11 +51,10 @@ #include // EnergyPlus Headers -#include -#include - #include "Fixtures/EnergyPlusFixture.hh" #include +#include +#include // ObjexxFCL Headers #include diff --git a/tst/EnergyPlus/unit/SwimmingPool.unit.cc b/tst/EnergyPlus/unit/SwimmingPool.unit.cc index 8bb9297ff31..e4ae2b9e14a 100644 --- a/tst/EnergyPlus/unit/SwimmingPool.unit.cc +++ b/tst/EnergyPlus/unit/SwimmingPool.unit.cc @@ -51,16 +51,15 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include +#include #include -#include #include #include +#include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include - using namespace EnergyPlus; using namespace EnergyPlus::SwimmingPool; using namespace EnergyPlus::DataSurfaces; @@ -135,14 +134,14 @@ TEST_F(EnergyPlusFixture, SwimmingPool_InitSwimmingPoolPlantLoopIndex) DataPlant::clear_state(); state->dataSwimmingPools->NumSwimmingPools = 2; - TotNumLoops = 2; + state->dataPlnt->TotNumLoops = 2; state->dataSwimmingPools->Pool.allocate(state->dataSwimmingPools->NumSwimmingPools); MyPlantScanFlagPool = true; state->dataSwimmingPools->Pool(1).Name = "FirstPool"; state->dataSwimmingPools->Pool(2).Name = "SecondPool"; state->dataSwimmingPools->Pool(1).WaterInletNode = 1; state->dataSwimmingPools->Pool(2).WaterInletNode = 11; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(2).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); @@ -199,7 +198,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_InitSwimmingPoolPlantNodeFlow) DataLoopNode::clear_state(); state->dataSwimmingPools->NumSwimmingPools = 1; - TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; state->dataSwimmingPools->Pool.allocate(state->dataSwimmingPools->NumSwimmingPools); MyPlantScanFlagPool = false; @@ -211,7 +210,7 @@ TEST_F(EnergyPlusFixture, SwimmingPool_InitSwimmingPoolPlantNodeFlow) state->dataSwimmingPools->Pool(1).HWBranchNum = 1; state->dataSwimmingPools->Pool(1).HWCompNum = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataPlnt->PlantLoop(1).LoopSide.allocate(2); state->dataPlnt->PlantLoop(1).LoopSide(1).Branch.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(2).Branch.allocate(1); diff --git a/tst/EnergyPlus/unit/SystemAvailabilityManager.unit.cc b/tst/EnergyPlus/unit/SystemAvailabilityManager.unit.cc index a2c7c87f66d..16d40820686 100644 --- a/tst/EnergyPlus/unit/SystemAvailabilityManager.unit.cc +++ b/tst/EnergyPlus/unit/SystemAvailabilityManager.unit.cc @@ -54,22 +54,20 @@ #include "Fixtures/EnergyPlusFixture.hh" // EnergyPlus Headers +#include #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include #include -#include using namespace EnergyPlus; diff --git a/tst/EnergyPlus/unit/SystemReports.unit.cc b/tst/EnergyPlus/unit/SystemReports.unit.cc index 81f91288261..27341d0a640 100644 --- a/tst/EnergyPlus/unit/SystemReports.unit.cc +++ b/tst/EnergyPlus/unit/SystemReports.unit.cc @@ -51,18 +51,17 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include -#include #include #include +#include #include #include #include #include #include -#include "Fixtures/EnergyPlusFixture.hh" - using namespace EnergyPlus::SystemReports; using namespace EnergyPlus::DataGlobalConstants; using namespace EnergyPlus::DataAirSystems; diff --git a/tst/EnergyPlus/unit/ThermalChimney.unit.cc b/tst/EnergyPlus/unit/ThermalChimney.unit.cc index f3928905153..0293885c1fa 100644 --- a/tst/EnergyPlus/unit/ThermalChimney.unit.cc +++ b/tst/EnergyPlus/unit/ThermalChimney.unit.cc @@ -51,8 +51,8 @@ #include // EnergyPlus Headers -#include #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include #include diff --git a/tst/EnergyPlus/unit/ThermalComfort.unit.cc b/tst/EnergyPlus/unit/ThermalComfort.unit.cc index 5299b5fef44..f28d85b57c8 100644 --- a/tst/EnergyPlus/unit/ThermalComfort.unit.cc +++ b/tst/EnergyPlus/unit/ThermalComfort.unit.cc @@ -51,8 +51,8 @@ #include // EnergyPlus Headers -#include #include +#include #include #include #include diff --git a/tst/EnergyPlus/unit/TranspiredCollector.unit.cc b/tst/EnergyPlus/unit/TranspiredCollector.unit.cc index ee4e9f99953..5e22a028ade 100644 --- a/tst/EnergyPlus/unit/TranspiredCollector.unit.cc +++ b/tst/EnergyPlus/unit/TranspiredCollector.unit.cc @@ -56,7 +56,6 @@ // EnergyPlus Headers #include #include - #include #include #include diff --git a/tst/EnergyPlus/unit/UnitHeater.unit.cc b/tst/EnergyPlus/unit/UnitHeater.unit.cc index 920d542914b..815fbfc3d90 100644 --- a/tst/EnergyPlus/unit/UnitHeater.unit.cc +++ b/tst/EnergyPlus/unit/UnitHeater.unit.cc @@ -53,7 +53,6 @@ // EnergyPlus Headers #include #include -#include #include #include #include @@ -66,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -1305,10 +1303,10 @@ TEST_F(EnergyPlusFixture, UnitHeater_SimUnitHeaterTest) ZoneEqUnitHeater = true; DataSizing::CurZoneEqNum = 1; - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/UnitVentilator.unit.cc b/tst/EnergyPlus/unit/UnitVentilator.unit.cc index 02822125b24..1d8d3ca7514 100644 --- a/tst/EnergyPlus/unit/UnitVentilator.unit.cc +++ b/tst/EnergyPlus/unit/UnitVentilator.unit.cc @@ -49,13 +49,13 @@ // Google Test Headers #include -#include #include "Fixtures/EnergyPlusFixture.hh" -#include +#include #include -#include #include +#include +#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc b/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc index 7e1aaef771d..b559433ef78 100644 --- a/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc +++ b/tst/EnergyPlus/unit/UnitaryHybridAirConditioner.unit.cc @@ -45,14 +45,17 @@ // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. +// C++ Headers +#include + // Google Test Headers #include // EnergyPlus Headers -#include #include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include #include @@ -81,7 +84,6 @@ #include #include #include -#include using namespace EnergyPlus::MixedAir; using namespace EnergyPlus::DataContaminantBalance; diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index c57d65495fb..1ef5f178296 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -51,17 +51,15 @@ #include // EnergyPlus Headers -#include #include "Fixtures/EnergyPlusFixture.hh" #include #include #include #include +#include #include #include #include -#include -#include #include #include #include @@ -75,8 +73,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -194,13 +192,13 @@ class ZoneUnitarySysTest : public EnergyPlusFixture DataSizing::ZoneSizingRunDone = true; // set up plant loop - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - DataSizing::PlantSizData.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + DataSizing::PlantSizData.allocate(state->dataPlnt->TotNumLoops); // int NumPltSizInput = DataPlant::TotNumLoops; DataSizing::NumPltSizInput = 2; - for (int loopindex = 1; loopindex <= DataPlant::TotNumLoops; ++loopindex) { + for (int loopindex = 1; loopindex <= state->dataPlnt->TotNumLoops; ++loopindex) { auto &loop(state->dataPlnt->PlantLoop(loopindex)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(loopindex).LoopSide(1)); @@ -258,8 +256,8 @@ class AirloopUnitarySysTest : public EnergyPlusFixture for (int i = 1; i <= state->dataWaterCoils->NumWaterCoils; ++i) { state->dataWaterCoils->WaterCoilNumericFields(i).FieldNames.allocate(17); // max N fields for water coil } - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); DataSizing::PlantSizData.allocate(2); DataSizing::ZoneEqSizing.allocate(2); DataSizing::UnitarySysEqSizing.allocate(2); @@ -326,7 +324,7 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) DataSizing::CurDuctType = DataHVACGlobals::Main; // set up plant loop - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -4136,8 +4134,8 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryHeatingSystem) UnitarySys thisSys; state->dataUnitarySystems->numUnitarySystems = 1; - DataPlant::TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); thisSys.m_MultiOrVarSpeedHeatCoil = true; thisSys.m_MultiOrVarSpeedCoolCoil = true; DataLoopNode::Node.allocate(10); @@ -4230,7 +4228,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryHeatingSystem) DataLoopNode::Node(state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum).MassFlowRate = HotWaterMassFlowRate; DataLoopNode::Node(state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum).MassFlowRateMaxAvail = HotWaterMassFlowRate; - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -4275,8 +4273,8 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryCoolingSystem) UnitarySys thisSys; state->dataUnitarySystems->numUnitarySystems = 1; - DataPlant::TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = 1.20; @@ -4382,7 +4380,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryCoolingSystem) DataLoopNode::Node(state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum).MassFlowRate = ColdWaterMassFlowRate; DataLoopNode::Node(state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum).MassFlowRateMaxAvail = ColdWaterMassFlowRate; - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -7795,9 +7793,9 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_WaterToAirHeatPump) DataZoneEquipment::ZoneEquipList(1).EquipIndex.allocate(1); DataZoneEquipment::ZoneEquipList(1).EquipIndex(1) = 1; // initialize equipment index for ZoneHVAC - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); @@ -8129,9 +8127,9 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) DataZoneEquipment::ZoneEquipList(1).EquipIndex.allocate(1); DataZoneEquipment::ZoneEquipList(1).EquipIndex(1) = 1; // initialize equipment index for ZoneHVAC - DataPlant::TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(DataPlant::TotNumLoops); - for (int l = 1; l <= DataPlant::TotNumLoops; ++l) { + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/UtilityRoutines.unit.cc b/tst/EnergyPlus/unit/UtilityRoutines.unit.cc index 262040bcbc2..bca4dd0f675 100644 --- a/tst/EnergyPlus/unit/UtilityRoutines.unit.cc +++ b/tst/EnergyPlus/unit/UtilityRoutines.unit.cc @@ -54,6 +54,7 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include #include #include @@ -61,8 +62,6 @@ #include #include -#include "Fixtures/EnergyPlusFixture.hh" - using namespace EnergyPlus; using namespace ObjexxFCL; diff --git a/tst/EnergyPlus/unit/VAVDefMinMaxFlow.unit.cc b/tst/EnergyPlus/unit/VAVDefMinMaxFlow.unit.cc index 9172337f96d..d55374b9442 100644 --- a/tst/EnergyPlus/unit/VAVDefMinMaxFlow.unit.cc +++ b/tst/EnergyPlus/unit/VAVDefMinMaxFlow.unit.cc @@ -50,7 +50,6 @@ // EnergyPlus Headers #include -#include #include #include #include @@ -65,7 +64,6 @@ #include #include #include -#include #include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/VariableSpeedCoils.unit.cc b/tst/EnergyPlus/unit/VariableSpeedCoils.unit.cc index f22a2996a75..78e76c8f1c5 100644 --- a/tst/EnergyPlus/unit/VariableSpeedCoils.unit.cc +++ b/tst/EnergyPlus/unit/VariableSpeedCoils.unit.cc @@ -48,11 +48,13 @@ // EnergyPlus::VariableSpeedCoils Unit Tests // Google Test Headers -#include +#include + +// EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include #include #include -#include namespace EnergyPlus { diff --git a/tst/EnergyPlus/unit/Vectors.unit.cc b/tst/EnergyPlus/unit/Vectors.unit.cc index 609c9bb04c9..8dee37cdffb 100644 --- a/tst/EnergyPlus/unit/Vectors.unit.cc +++ b/tst/EnergyPlus/unit/Vectors.unit.cc @@ -52,7 +52,6 @@ // EnergyPlus Headers #include -#include #include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/VentilatedSlab.unit.cc b/tst/EnergyPlus/unit/VentilatedSlab.unit.cc index 706c7f08f4d..b3fced1d5a5 100644 --- a/tst/EnergyPlus/unit/VentilatedSlab.unit.cc +++ b/tst/EnergyPlus/unit/VentilatedSlab.unit.cc @@ -52,16 +52,13 @@ // EnergyPlus Headers #include -#include #include #include #include -#include #include #include #include #include -#include #include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 4016f7d6f1c..cc6f3bda5f1 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -63,17 +63,14 @@ // EnergyPlus Headers #include #include -#include #include -#include -#include -#include #include +#include +#include #include +#include #include #include -#include -#include #include #include #include @@ -82,6 +79,7 @@ #include #include #include +#include #include #include #include @@ -139,8 +137,8 @@ class WaterCoilsTest : public EnergyPlusFixture state->dataWaterCoils->WaterCoil.allocate(state->dataWaterCoils->NumWaterCoils); state->dataWaterCoils->WaterCoilNumericFields.allocate(state->dataWaterCoils->NumWaterCoils); state->dataWaterCoils->WaterCoilNumericFields(state->dataWaterCoils->NumWaterCoils).FieldNames.allocate(17); // max N fields for water coil - TotNumLoops = 1; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 1; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); PlantSizData.allocate(1); ZoneEqSizing.allocate(1); UnitarySysEqSizing.allocate(1); @@ -197,7 +195,7 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) PlantSizData(1).PlantLoopName = "WaterLoop"; // set up plant loop - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -433,7 +431,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) PlantSizData(1).DeltaT = 10.0; // set up plant loop - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -585,7 +583,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) PlantSizData(1).DeltaT = 10.0; // set up plant loop - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -741,7 +739,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) PlantSizData(1).DeltaT = 10.0; // set up plant loop - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -856,7 +854,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) PlantSizData(1).PlantLoopName = "WaterLoop"; // set up plant loop - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -957,7 +955,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) PlantSizData(1).PlantLoopName = "WaterLoop"; // set up plant loop - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -1070,7 +1068,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) PlantSizData(1).PlantLoopName = "WaterLoop"; // set up plant loop - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -1253,7 +1251,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) PlantSizData(1).PlantLoopName = "WaterLoop"; // set up plant loop - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -1351,7 +1349,7 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) PlantSizData(1).DeltaT = 10.0; // set up plant loop - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(1).LoopSide(1)); @@ -1613,8 +1611,8 @@ TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) EXPECT_EQ("COIL:COOLING:WATER", FanCoil(1).CCoilType); EXPECT_EQ("COIL:HEATING:WATER", FanCoil(1).HCoilType); - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); AirMassFlow = 0.60; MaxAirMassFlow = 0.60; @@ -1688,7 +1686,7 @@ TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) state->dataWaterCoils->WaterCoil(1).InletWaterMassFlowRate = HotWaterMassFlowRate; state->dataWaterCoils->WaterCoil(1).MaxWaterMassFlowRate = HotWaterMassFlowRate; - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/WaterManager.unit.cc b/tst/EnergyPlus/unit/WaterManager.unit.cc index d8631689152..be70a8b986e 100644 --- a/tst/EnergyPlus/unit/WaterManager.unit.cc +++ b/tst/EnergyPlus/unit/WaterManager.unit.cc @@ -51,14 +51,13 @@ // EnergyPlus Headers #include -#include -#include #include +#include #include +#include #include "Fixtures/EnergyPlusFixture.hh" - using namespace EnergyPlus; TEST_F(EnergyPlusFixture, WaterManager_NormalAnnualPrecipitation) diff --git a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc index 105d44f1fb2..77b0fa002d4 100644 --- a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc +++ b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc @@ -51,13 +51,12 @@ #include // ObjexxFCL Headers -#include #include // EnergyPlus Headers -#include #include "Fixtures/EnergyPlusFixture.hh" #include +#include #include #include #include @@ -2610,7 +2609,7 @@ TEST_F(EnergyPlusFixture, StratifiedTank_GSHP_DesuperheaterSourceHeat) state->dataEnvrn->HolidayIndex = 0; state->dataEnvrn->DayOfYear_Schedule = General::OrdinalDay(state->dataEnvrn->Month, state->dataEnvrn->DayOfMonth, 1); ScheduleManager::UpdateScheduleValues(*state); - DataPlant::TotNumLoops = 1; + state->dataPlnt->TotNumLoops = 1; int TankNum(1); int HPNum(1); int CyclingScheme(1); diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc index 7b7727bfe54..ec972f6a0ea 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPump.unit.cc @@ -57,10 +57,10 @@ #include #include #include -#include #include #include #include +#include #include #include @@ -207,10 +207,10 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpTest_SimWaterToAir) DataLoopNode::Node(state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).AirInletNodeNum).HumRat = 0.007; DataLoopNode::Node(state->dataWaterToAirHeatPump->WatertoAirHP(HPNum).AirInletNodeNum).Enthalpy = 43970.75; - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc index 84364f511f0..bac2caa7683 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc @@ -223,10 +223,10 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimple_TestWaterFlowControl) DataLoopNode::Node(state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).AirInletNodeNum).HumRat = 0.007; DataLoopNode::Node(state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).AirInletNodeNum).Enthalpy = 43970.75; - TotNumLoops = 2; - state->dataPlnt->PlantLoop.allocate(TotNumLoops); + state->dataPlnt->TotNumLoops = 2; + state->dataPlnt->PlantLoop.allocate(state->dataPlnt->TotNumLoops); - for (int l = 1; l <= TotNumLoops; ++l) { + for (int l = 1; l <= state->dataPlnt->TotNumLoops; ++l) { auto &loop(state->dataPlnt->PlantLoop(l)); loop.LoopSide.allocate(2); auto &loopside(state->dataPlnt->PlantLoop(l).LoopSide(1)); diff --git a/tst/EnergyPlus/unit/WeatherManager.unit.cc b/tst/EnergyPlus/unit/WeatherManager.unit.cc index 5f2cf5824cd..1df574d6b07 100644 --- a/tst/EnergyPlus/unit/WeatherManager.unit.cc +++ b/tst/EnergyPlus/unit/WeatherManager.unit.cc @@ -54,8 +54,8 @@ #include // EnergyPlus Headers -#include #include +#include #include #include #include @@ -66,6 +66,7 @@ #include #include +// Fixtures #include "Fixtures/EnergyPlusFixture.hh" #include "Fixtures/SQLiteFixture.hh" diff --git a/tst/EnergyPlus/unit/WinCalcEngine.unit.cc b/tst/EnergyPlus/unit/WinCalcEngine.unit.cc index 92353a7d090..be5bb6dd1a5 100644 --- a/tst/EnergyPlus/unit/WinCalcEngine.unit.cc +++ b/tst/EnergyPlus/unit/WinCalcEngine.unit.cc @@ -54,16 +54,15 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" +#include "Windows-CalcEngine/src/Common/src/FenestrationCommon.hpp" +#include #include #include #include #include #include -#include "Fixtures/EnergyPlusFixture.hh" -#include -#include "Windows-CalcEngine/src/Common/src/FenestrationCommon.hpp" - using namespace EnergyPlus; TEST_F(EnergyPlusFixture, WCEClear) diff --git a/tst/EnergyPlus/unit/WindowAC.unit.cc b/tst/EnergyPlus/unit/WindowAC.unit.cc index b59d7c79bac..cb735f0bae2 100644 --- a/tst/EnergyPlus/unit/WindowAC.unit.cc +++ b/tst/EnergyPlus/unit/WindowAC.unit.cc @@ -48,15 +48,13 @@ #include // EnergyPlus Headers -#include #include "Fixtures/EnergyPlusFixture.hh" -#include +#include #include #include #include #include #include -#include #include #include #include diff --git a/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc b/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc index 0de21234b76..85bb4b4b0e7 100644 --- a/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc +++ b/tst/EnergyPlus/unit/WindowEquivalentLayer.unit.cc @@ -57,27 +57,22 @@ #include // EnergyPlus Headers -#include #include +#include #include #include #include #include #include -#include -#include - #include #include #include #include #include - #include #include #include #include -#include #include #include #include @@ -85,7 +80,10 @@ #include #include #include +#include +#include +// Fixtures #include "Fixtures/EnergyPlusFixture.hh" using namespace EnergyPlus; diff --git a/tst/EnergyPlus/unit/WindowLayerEffectiveMultipliers.unit.cc b/tst/EnergyPlus/unit/WindowLayerEffectiveMultipliers.unit.cc index 31cb2927ae6..84200af7761 100644 --- a/tst/EnergyPlus/unit/WindowLayerEffectiveMultipliers.unit.cc +++ b/tst/EnergyPlus/unit/WindowLayerEffectiveMultipliers.unit.cc @@ -51,11 +51,10 @@ #include // EnergyPlus Headers +#include #include #include #include -#include -#include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index c920369db7c..71aa5b7e33f 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -57,10 +57,10 @@ #include // EnergyPlus Headers -#include #include #include #include +#include #include #include #include diff --git a/tst/EnergyPlus/unit/XingGroundTemperatureModel.unit.cc b/tst/EnergyPlus/unit/XingGroundTemperatureModel.unit.cc index 1415a4d0277..a7ee6a30139 100644 --- a/tst/EnergyPlus/unit/XingGroundTemperatureModel.unit.cc +++ b/tst/EnergyPlus/unit/XingGroundTemperatureModel.unit.cc @@ -52,10 +52,9 @@ // EnergyPlus Headers #include "EnergyPlus/DataIPShortCuts.hh" -#include #include "EnergyPlus/GroundTemperatureModeling/GroundTemperatureModelManager.hh" -#include "EnergyPlus/GroundTemperatureModeling/XingGroundTemperatureModel.hh" #include "Fixtures/EnergyPlusFixture.hh" +#include using namespace EnergyPlus; using namespace EnergyPlus::GroundTemperatureManager; diff --git a/tst/EnergyPlus/unit/ZoneContaminantPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneContaminantPredictorCorrector.unit.cc index af7c2a2bfc4..1c1e99cf062 100644 --- a/tst/EnergyPlus/unit/ZoneContaminantPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneContaminantPredictorCorrector.unit.cc @@ -53,11 +53,9 @@ #include "Fixtures/EnergyPlusFixture.hh" // EnergyPlus Headers -#include #include -#include +#include #include -#include #include #include #include @@ -69,10 +67,8 @@ #include #include #include -#include #include #include -#include #include #include #include diff --git a/tst/EnergyPlus/unit/ZoneHVACEvaporativeCooler.unit.cc b/tst/EnergyPlus/unit/ZoneHVACEvaporativeCooler.unit.cc index 6dcdd140969..0e836929200 100644 --- a/tst/EnergyPlus/unit/ZoneHVACEvaporativeCooler.unit.cc +++ b/tst/EnergyPlus/unit/ZoneHVACEvaporativeCooler.unit.cc @@ -51,10 +51,9 @@ #include // EnergyPlus Headers -#include #include "Fixtures/EnergyPlusFixture.hh" +#include #include -#include #include #include #include diff --git a/tst/EnergyPlus/unit/ZonePlenum.unit.cc b/tst/EnergyPlus/unit/ZonePlenum.unit.cc index 80adf6c8722..274f93c6a2b 100644 --- a/tst/EnergyPlus/unit/ZonePlenum.unit.cc +++ b/tst/EnergyPlus/unit/ZonePlenum.unit.cc @@ -54,7 +54,6 @@ #include #include #include -#include #include #include "Fixtures/EnergyPlusFixture.hh" diff --git a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc index 86af1da86f8..6e7126703b8 100644 --- a/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc +++ b/tst/EnergyPlus/unit/ZoneTempPredictorCorrector.unit.cc @@ -53,8 +53,8 @@ #include "Fixtures/EnergyPlusFixture.hh" // EnergyPlus Headers -#include #include +#include #include #include #include From c80e580cf1cb12db2382b515b209b71c4dd9ba53 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 6 Jan 2021 14:24:51 -0700 Subject: [PATCH 09/17] move remaining DataPlant over to state, fix unit tests --- src/EnergyPlus/Plant/DataPlant.cc | 20 ----- src/EnergyPlus/Plant/DataPlant.hh | 36 +++----- src/EnergyPlus/Plant/PlantManager.cc | 82 +++++++++--------- src/EnergyPlus/PlantUtilities.cc | 42 +++++----- src/EnergyPlus/Pumps.cc | 5 +- src/EnergyPlus/StateManagement.cc | 2 - src/EnergyPlus/SystemAvailabilityManager.cc | 55 ++++++------ src/EnergyPlus/SystemReports.cc | 83 ++++++++++--------- src/EnergyPlus/SystemReports.hh | 3 +- .../unit/SizingAnalysisObjects.unit.cc | 2 +- tst/EnergyPlus/unit/SolarShading.unit.cc | 5 -- tst/EnergyPlus/unit/SwimmingPool.unit.cc | 11 --- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 8 +- tst/EnergyPlus/unit/WaterCoils.unit.cc | 6 -- 14 files changed, 149 insertions(+), 211 deletions(-) diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index 8463f026451..0170cb90522 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -282,24 +282,4 @@ namespace EnergyPlus::DataPlant { Real64 const square_sum_ConvergenceHistoryARR(pow_2(sum_ConvergenceHistoryARR)); Real64 const sum_square_ConvergenceHistoryARR(sum(pow(ConvergenceHistoryARR, 2))); - // Object Data - Array1D PlantAvailMgr; - Array1D VentRepPlantSupplySide; - Array1D VentRepPlantDemandSide; - Array1D VentRepCondSupplySide; - Array1D VentRepCondDemandSide; - Array1D PlantCallingOrderInfo; - - // Clears the global data in DataPlant. - // Needed for unit tests, should not be normally called. - void clear_state() - { - PlantAvailMgr.deallocate(); - VentRepPlantSupplySide.deallocate(); - VentRepPlantDemandSide.deallocate(); - VentRepCondSupplySide.deallocate(); - VentRepCondDemandSide.deallocate(); - PlantCallingOrderInfo.deallocate(); - } - } // namespace EnergyPlus diff --git a/src/EnergyPlus/Plant/DataPlant.hh b/src/EnergyPlus/Plant/DataPlant.hh index d4862a75118..065b7fec904 100644 --- a/src/EnergyPlus/Plant/DataPlant.hh +++ b/src/EnergyPlus/Plant/DataPlant.hh @@ -200,18 +200,6 @@ namespace DataPlant { extern Real64 const square_sum_ConvergenceHistoryARR; extern Real64 const sum_square_ConvergenceHistoryARR; - // Object Data - extern Array1D PlantAvailMgr; - extern Array1D VentRepPlantSupplySide; - extern Array1D VentRepPlantDemandSide; - extern Array1D VentRepCondSupplySide; - extern Array1D VentRepCondDemandSide; - extern Array1D PlantCallingOrderInfo; - - // Clears the global data in DataPlant. - // Needed for unit tests, should not be normally called. - void clear_state(); - } // namespace DataPlant struct DataPlantData : BaseGlobalStruct { @@ -227,12 +215,12 @@ struct DataPlantData : BaseGlobalStruct { int PlantManageSubIterations = 0; // tracks plant iterations to characterize solver int PlantManageHalfLoopCalls = 0; // tracks number of half loop calls Array1D PlantLoop; -// Array1D PlantAvailMgr; -// Array1D VentRepPlantSupplySide; -// Array1D VentRepPlantDemandSide; -// Array1D VentRepCondSupplySide; -// Array1D VentRepCondDemandSide; -// Array1D PlantCallingOrderInfo; + Array1D PlantAvailMgr; + Array1D VentRepPlantSupplySide; + Array1D VentRepPlantDemandSide; + Array1D VentRepCondSupplySide; + Array1D VentRepCondDemandSide; + Array1D PlantCallingOrderInfo; void clear_state() override { @@ -247,12 +235,12 @@ struct DataPlantData : BaseGlobalStruct { this->PlantManageSubIterations = 0; this->PlantManageHalfLoopCalls = 0; this->PlantLoop.deallocate(); -// this->PlantAvailMgr.deallocate(); -// this->VentRepPlantSupplySide.deallocate(); -// this->VentRepPlantDemandSide.deallocate(); -// this->VentRepCondSupplySide.deallocate(); -// this->VentRepCondDemandSide.deallocate(); -// this->PlantCallingOrderInfo.deallocate(); + this->PlantAvailMgr.deallocate(); + this->VentRepPlantSupplySide.deallocate(); + this->VentRepPlantDemandSide.deallocate(); + this->VentRepCondSupplySide.deallocate(); + this->VentRepCondDemandSide.deallocate(); + this->PlantCallingOrderInfo.deallocate(); } }; diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index f19f187a8f4..2ea31e0ac41 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -220,8 +220,8 @@ namespace EnergyPlus::PlantManager { // go through half loops in predetermined calling order for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { - LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; - LoopSide = PlantCallingOrderInfo(HalfLoopNum).LoopSide; + LoopNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopIndex; + LoopSide = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopSide; OtherSide = 3 - LoopSide; // will give us 1 if LoopSide is 2, or 2 if LoopSide is 1 auto &this_loop(state.dataPlnt->PlantLoop(LoopNum)); @@ -344,8 +344,8 @@ namespace EnergyPlus::PlantManager { if (state.dataPlnt->TotNumLoops > 0) { state.dataPlnt->PlantLoop.allocate(state.dataPlnt->TotNumLoops); state.dataConvergeParams->PlantConvergence.allocate(state.dataPlnt->TotNumLoops); - if (!allocated(PlantAvailMgr)) { - PlantAvailMgr.allocate(state.dataPlnt->TotNumLoops); + if (!allocated(state.dataPlnt->PlantAvailMgr)) { + state.dataPlnt->PlantAvailMgr.allocate(state.dataPlnt->TotNumLoops); } } else { return; @@ -727,7 +727,7 @@ namespace EnergyPlus::PlantManager { SetupOutputVariable(state, "Plant System Cycle On Off Status", OutputProcessor::Unit::None, - PlantAvailMgr(LoopNum).AvailStatus, + state.dataPlnt->PlantAvailMgr(LoopNum).AvailStatus, "Plant", "Average", state.dataPlnt->PlantLoop(LoopNum).Name); @@ -1667,17 +1667,17 @@ namespace EnergyPlus::PlantManager { ShowFatalError(state, "GetPlantInput: Errors in getting PlantLoop Input"); } - if (NumPlantLoops > 0) VentRepPlantSupplySide.allocate(NumPlantLoops); - if (NumPlantLoops > 0) VentRepPlantDemandSide.allocate(NumPlantLoops); + if (NumPlantLoops > 0) state.dataPlnt->VentRepPlantSupplySide.allocate(NumPlantLoops); + if (NumPlantLoops > 0) state.dataPlnt->VentRepPlantDemandSide.allocate(NumPlantLoops); for (LoopNum = 1; LoopNum <= NumPlantLoops; ++LoopNum) { // set up references for this loop auto &this_plant_loop(state.dataPlnt->PlantLoop(LoopNum)); auto &this_plant_supply(this_plant_loop.LoopSide(SupplySide)); - auto &this_vent_plant_supply(VentRepPlantSupplySide(LoopNum)); + auto &this_vent_plant_supply(state.dataPlnt->VentRepPlantSupplySide(LoopNum)); auto &this_plant_demand(this_plant_loop.LoopSide(DemandSide)); - auto &this_vent_plant_demand(VentRepPlantDemandSide(LoopNum)); + auto &this_vent_plant_demand(state.dataPlnt->VentRepPlantDemandSide(LoopNum)); this_vent_plant_supply.Name = this_plant_loop.Name; this_vent_plant_supply.NodeNumIn = this_plant_supply.NodeNumIn; @@ -1692,7 +1692,7 @@ namespace EnergyPlus::PlantManager { for (BranchNum = 1; BranchNum <= this_vent_plant_supply.TotalBranches; ++BranchNum) { auto &this_plant_supply_branch(state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum)); - auto &this_vent_plant_supply_branch(VentRepPlantSupplySide(LoopNum).Branch(BranchNum)); + auto &this_vent_plant_supply_branch(state.dataPlnt->VentRepPlantSupplySide(LoopNum).Branch(BranchNum)); this_vent_plant_supply_branch.Name = this_plant_supply_branch.Name; this_vent_plant_supply_branch.NodeNumIn = this_plant_supply_branch.NodeNumIn; @@ -1704,12 +1704,12 @@ namespace EnergyPlus::PlantManager { } for (CompNum = 1; - CompNum <= VentRepPlantSupplySide(LoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { + CompNum <= state.dataPlnt->VentRepPlantSupplySide(LoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { auto &this_plant_supply_comp( state.dataPlnt->PlantLoop(LoopNum).LoopSide(SupplySide).Branch(BranchNum).Comp(CompNum)); auto &this_vent_plant_supply_comp( - VentRepPlantSupplySide(LoopNum).Branch(BranchNum).Comp(CompNum)); + state.dataPlnt->VentRepPlantSupplySide(LoopNum).Branch(BranchNum).Comp(CompNum)); this_vent_plant_supply_comp.Name = this_plant_supply_comp.Name; this_vent_plant_supply_comp.TypeOf = this_plant_supply_comp.TypeOf; @@ -1735,7 +1735,7 @@ namespace EnergyPlus::PlantManager { for (BranchNum = 1; BranchNum <= this_vent_plant_demand.TotalBranches; ++BranchNum) { auto &this_plant_demand_branch(state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum)); - auto &this_vent_plant_demand_branch(VentRepPlantDemandSide(LoopNum).Branch(BranchNum)); + auto &this_vent_plant_demand_branch(state.dataPlnt->VentRepPlantDemandSide(LoopNum).Branch(BranchNum)); this_vent_plant_demand_branch.Name = this_plant_demand_branch.Name; this_vent_plant_demand_branch.NodeNumIn = this_plant_demand_branch.NodeNumIn; @@ -1751,7 +1751,7 @@ namespace EnergyPlus::PlantManager { auto &this_plant_demand_comp( state.dataPlnt->PlantLoop(LoopNum).LoopSide(DemandSide).Branch(BranchNum).Comp(CompNum)); auto &this_vent_plant_demand_comp( - VentRepPlantDemandSide(LoopNum).Branch(BranchNum).Comp(CompNum)); + state.dataPlnt->VentRepPlantDemandSide(LoopNum).Branch(BranchNum).Comp(CompNum)); this_vent_plant_demand_comp.Name = this_plant_demand_comp.Name; this_vent_plant_demand_comp.TypeOf = this_plant_demand_comp.TypeOf; @@ -1766,8 +1766,8 @@ namespace EnergyPlus::PlantManager { } // loop over plant supply loops (ventilation report data) - if (NumCondLoops > 0) VentRepCondSupplySide.allocate(NumCondLoops); - if (NumCondLoops > 0) VentRepCondDemandSide.allocate(NumCondLoops); + if (NumCondLoops > 0) state.dataPlnt->VentRepCondSupplySide.allocate(NumCondLoops); + if (NumCondLoops > 0) state.dataPlnt->VentRepCondDemandSide.allocate(NumCondLoops); for (LoopNum = 1; LoopNum <= NumCondLoops; ++LoopNum) { @@ -1776,9 +1776,9 @@ namespace EnergyPlus::PlantManager { // set up references for this loop auto &this_cond_loop(state.dataPlnt->PlantLoop(LoopNumInArray)); auto &this_cond_supply(this_cond_loop.LoopSide(SupplySide)); - auto &this_vent_cond_supply(VentRepCondSupplySide(LoopNum)); + auto &this_vent_cond_supply(state.dataPlnt->VentRepCondSupplySide(LoopNum)); auto &this_cond_demand(this_cond_loop.LoopSide(DemandSide)); - auto &this_vent_cond_demand(VentRepCondDemandSide(LoopNum)); + auto &this_vent_cond_demand(state.dataPlnt->VentRepCondDemandSide(LoopNum)); this_vent_cond_supply.Name = this_cond_loop.Name; this_vent_cond_supply.NodeNumIn = this_cond_supply.NodeNumIn; @@ -2188,8 +2188,8 @@ namespace EnergyPlus::PlantManager { // Step 2, call component models it using PlantCallingOrderInfo for sizing for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { - LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; - LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; + LoopNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopIndex; + LoopSideNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopSide; CurLoopNum = LoopNum; for (BranchNum = 1; @@ -2210,8 +2210,8 @@ namespace EnergyPlus::PlantManager { for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { - LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; - LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; + LoopNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopIndex; + LoopSideNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopSide; CurLoopNum = LoopNum; if (LoopSideNum == SupplySide) { SizePlantLoop(state, LoopNum, FinishSizingFlag); @@ -2233,8 +2233,8 @@ namespace EnergyPlus::PlantManager { state.dataPlnt->PlantFirstSizesOkayToReport = false; state.dataPlnt->PlantFinalSizesOkayToReport = true; } - LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; - LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; + LoopNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopIndex; + LoopSideNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopSide; CurLoopNum = LoopNum; if (LoopSideNum == SupplySide) { SizePlantLoop(state, LoopNum, FinishSizingFlag); @@ -2267,8 +2267,8 @@ namespace EnergyPlus::PlantManager { InitLoopEquip = true; GetCompSizFac = false; for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { - LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; - LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; + LoopNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopIndex; + LoopSideNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopSide; CurLoopNum = LoopNum; for (BranchNum = 1; @@ -2290,8 +2290,8 @@ namespace EnergyPlus::PlantManager { // now call everything again to reporting turned on for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { - LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; - LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; + LoopNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopIndex; + LoopSideNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopSide; CurLoopNum = LoopNum; for (BranchNum = 1; @@ -3387,33 +3387,33 @@ namespace EnergyPlus::PlantManager { // first allocate to total number of plant half loops - if (!allocated(PlantCallingOrderInfo)) PlantCallingOrderInfo.allocate(state.dataPlnt->TotNumHalfLoops); + if (!allocated(state.dataPlnt->PlantCallingOrderInfo)) state.dataPlnt->PlantCallingOrderInfo.allocate(state.dataPlnt->TotNumHalfLoops); // set plant loop demand sides for (I = 1; I <= NumPlantLoops; ++I) { - PlantCallingOrderInfo(I).LoopIndex = I; - PlantCallingOrderInfo(I).LoopSide = DemandSide; + state.dataPlnt->PlantCallingOrderInfo(I).LoopIndex = I; + state.dataPlnt->PlantCallingOrderInfo(I).LoopSide = DemandSide; } // set plant loop supply sides for (I = 1; I <= NumPlantLoops; ++I) { OrderIndex = I + NumPlantLoops; - PlantCallingOrderInfo(OrderIndex).LoopIndex = I; - PlantCallingOrderInfo(OrderIndex).LoopSide = SupplySide; + state.dataPlnt->PlantCallingOrderInfo(OrderIndex).LoopIndex = I; + state.dataPlnt->PlantCallingOrderInfo(OrderIndex).LoopSide = SupplySide; } // set condenser Loop demand sides for (I = 1; I <= NumCondLoops; ++I) { OrderIndex = 2 * NumPlantLoops + I; - PlantCallingOrderInfo(OrderIndex).LoopIndex = NumPlantLoops + I; - PlantCallingOrderInfo(OrderIndex).LoopSide = DemandSide; + state.dataPlnt->PlantCallingOrderInfo(OrderIndex).LoopIndex = NumPlantLoops + I; + state.dataPlnt->PlantCallingOrderInfo(OrderIndex).LoopSide = DemandSide; } // set condenser Loop supply sides for (I = 1; I <= NumCondLoops; ++I) { OrderIndex = 2 * NumPlantLoops + NumCondLoops + I; - PlantCallingOrderInfo(OrderIndex).LoopIndex = NumPlantLoops + I; - PlantCallingOrderInfo(OrderIndex).LoopSide = SupplySide; + state.dataPlnt->PlantCallingOrderInfo(OrderIndex).LoopIndex = NumPlantLoops + I; + state.dataPlnt->PlantCallingOrderInfo(OrderIndex).LoopSide = SupplySide; } } @@ -3467,8 +3467,8 @@ namespace EnergyPlus::PlantManager { for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { - LoopNum = PlantCallingOrderInfo(HalfLoopNum).LoopIndex; - LoopSideNum = PlantCallingOrderInfo(HalfLoopNum).LoopSide; + LoopNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopIndex; + LoopSideNum = state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopSide; if (allocated(state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).Connected)) { for (ConnctNum = 1; @@ -3559,8 +3559,8 @@ namespace EnergyPlus::PlantManager { CallingIndex = 0; for (HalfLoopNum = 1; HalfLoopNum <= state.dataPlnt->TotNumHalfLoops; ++HalfLoopNum) { - if ((LoopNum == PlantCallingOrderInfo(HalfLoopNum).LoopIndex) && - (LoopSide == PlantCallingOrderInfo(HalfLoopNum).LoopSide)) { + if ((LoopNum == state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopIndex) && + (LoopSide == state.dataPlnt->PlantCallingOrderInfo(HalfLoopNum).LoopSide)) { CallingIndex = HalfLoopNum; } diff --git a/src/EnergyPlus/PlantUtilities.cc b/src/EnergyPlus/PlantUtilities.cc index 26cd8ad62a4..053a177f153 100644 --- a/src/EnergyPlus/PlantUtilities.cc +++ b/src/EnergyPlus/PlantUtilities.cc @@ -1380,9 +1380,9 @@ namespace PlantUtilities { } // store copy of prior structure - Array1D TempPlantCallingOrderInfo(PlantCallingOrderInfo); + Array1D TempPlantCallingOrderInfo(state.dataPlnt->PlantCallingOrderInfo); - RecordToMoveInPlantCallingOrderInfo = PlantCallingOrderInfo(OldIndex); + RecordToMoveInPlantCallingOrderInfo = state.dataPlnt->PlantCallingOrderInfo(OldIndex); if (OldIndex == NewIndex) { // do nothing, no shift needed. @@ -1390,43 +1390,43 @@ namespace PlantUtilities { // example was: 1 2 3 4 5 6 7 8 (with OI = 1, NI = 5) // example shifted: 2 3 4 5 1 6 7 8 - PlantCallingOrderInfo({1, NewIndex - 1}) = TempPlantCallingOrderInfo({2, NewIndex}); - PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; - PlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}); + state.dataPlnt->PlantCallingOrderInfo({1, NewIndex - 1}) = TempPlantCallingOrderInfo({2, NewIndex}); + state.dataPlnt->PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; + state.dataPlnt->PlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}); } else if ((OldIndex == 1) && (NewIndex > OldIndex) && (NewIndex == state.dataPlnt->TotNumHalfLoops)) { // example was: 1 2 3 4 5 6 7 8 (with OI = 1, NI = 8) // example shifted: 2 3 4 5 6 7 8 1 - PlantCallingOrderInfo({1, NewIndex - 1}) = TempPlantCallingOrderInfo({2, NewIndex}); - PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; + state.dataPlnt->PlantCallingOrderInfo({1, NewIndex - 1}) = TempPlantCallingOrderInfo({2, NewIndex}); + state.dataPlnt->PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; } else if ((OldIndex > 1) && (NewIndex > OldIndex) && (NewIndex < state.dataPlnt->TotNumHalfLoops)) { // example was: 1 2 3 4 5 6 7 8 (with OI = 3, NI = 6) // example shifted: 1 2 4 5 6 3 7 8 - PlantCallingOrderInfo({1, OldIndex - 1}) = TempPlantCallingOrderInfo({1, OldIndex - 1}); - PlantCallingOrderInfo({OldIndex, NewIndex - 1}) = TempPlantCallingOrderInfo({OldIndex + 1, NewIndex}); - PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; - PlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}); + state.dataPlnt->PlantCallingOrderInfo({1, OldIndex - 1}) = TempPlantCallingOrderInfo({1, OldIndex - 1}); + state.dataPlnt->PlantCallingOrderInfo({OldIndex, NewIndex - 1}) = TempPlantCallingOrderInfo({OldIndex + 1, NewIndex}); + state.dataPlnt->PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; + state.dataPlnt->PlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({NewIndex + 1, state.dataPlnt->TotNumHalfLoops}); } else if ((OldIndex > 1) && (NewIndex > OldIndex) && (NewIndex == state.dataPlnt->TotNumHalfLoops)) { // example was: 1 2 3 4 5 6 7 8 (with OI = 3, NI = 8) // example shifted: 1 2 4 5 6 7 8 3 - PlantCallingOrderInfo({1, OldIndex - 1}) = TempPlantCallingOrderInfo({1, OldIndex - 1}); - PlantCallingOrderInfo({OldIndex, NewIndex - 1}) = TempPlantCallingOrderInfo({OldIndex + 1, NewIndex}); - PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; + state.dataPlnt->PlantCallingOrderInfo({1, OldIndex - 1}) = TempPlantCallingOrderInfo({1, OldIndex - 1}); + state.dataPlnt->PlantCallingOrderInfo({OldIndex, NewIndex - 1}) = TempPlantCallingOrderInfo({OldIndex + 1, NewIndex}); + state.dataPlnt->PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; } else if ((OldIndex > 1) && (NewIndex < OldIndex) && (NewIndex == 1)) { // example was: 1 2 3 4 5 6 7 8 (with OI = 3, NI = 1) // example shifted: 3 1 2 4 5 6 7 8 - PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; - PlantCallingOrderInfo({NewIndex + 1, OldIndex}) = TempPlantCallingOrderInfo({1, OldIndex - 1}); - PlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}); + state.dataPlnt->PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; + state.dataPlnt->PlantCallingOrderInfo({NewIndex + 1, OldIndex}) = TempPlantCallingOrderInfo({1, OldIndex - 1}); + state.dataPlnt->PlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}); } else if ((OldIndex > 1) && (NewIndex < OldIndex) && (NewIndex > 1)) { // example was: 1 2 3 4 5 6 7 8 (with OI = 3, NI = 2) // example shifted: 1 3 2 4 5 6 7 8 - PlantCallingOrderInfo({1, NewIndex - 1}) = TempPlantCallingOrderInfo({1, NewIndex - 1}); - PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; - PlantCallingOrderInfo({NewIndex + 1, OldIndex}) = TempPlantCallingOrderInfo({NewIndex, NewIndex + (OldIndex - NewIndex) - 1}); - PlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}); + state.dataPlnt->PlantCallingOrderInfo({1, NewIndex - 1}) = TempPlantCallingOrderInfo({1, NewIndex - 1}); + state.dataPlnt->PlantCallingOrderInfo(NewIndex) = RecordToMoveInPlantCallingOrderInfo; + state.dataPlnt->PlantCallingOrderInfo({NewIndex + 1, OldIndex}) = TempPlantCallingOrderInfo({NewIndex, NewIndex + (OldIndex - NewIndex) - 1}); + state.dataPlnt->PlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}) = TempPlantCallingOrderInfo({OldIndex + 1, state.dataPlnt->TotNumHalfLoops}); } else { ShowSevereError(state, "ShiftPlantLoopSideCallingOrder: developer error notice, caught unexpected logical case in " diff --git a/src/EnergyPlus/Pumps.cc b/src/EnergyPlus/Pumps.cc index d2943ec0f8a..48a7c7061e8 100644 --- a/src/EnergyPlus/Pumps.cc +++ b/src/EnergyPlus/Pumps.cc @@ -1552,7 +1552,6 @@ namespace Pumps { // These values are also bounded by EMS overridable limit of max flow rate. // Using/Aliasing - using DataPlant::PlantAvailMgr; using FluidProperties::GetDensityGlycol; using PlantPressureSystem::ResolveLoopFlowVsPressure; using PlantUtilities::BoundValueToWithinTwoValues; @@ -1700,8 +1699,8 @@ namespace Pumps { } // Override pump operation based on System Availability Managers, should be done elsewhere? I suppose this should be OK though - if (allocated(PlantAvailMgr)) { - if (PlantAvailMgr(LoopNum).AvailStatus == ForceOff) { + if (allocated(state.dataPlnt->PlantAvailMgr)) { + if (state.dataPlnt->PlantAvailMgr(LoopNum).AvailStatus == ForceOff) { PumpMassFlowRateMax = 0.0; PumpMassFlowRateMin = 0.0; } diff --git a/src/EnergyPlus/StateManagement.cc b/src/EnergyPlus/StateManagement.cc index db5af491a6d..a62aba26005 100644 --- a/src/EnergyPlus/StateManagement.cc +++ b/src/EnergyPlus/StateManagement.cc @@ -144,7 +144,6 @@ #include #include #include -#include #include #include #include @@ -188,7 +187,6 @@ void EnergyPlus::clearAllStates(EnergyPlusData &state) DataMoistureBalanceEMPD::clear_state(); DataOutputs::clear_state(); DataPhotovoltaics::clear_state(); - DataPlant::clear_state(); DataReportingFlags::clear_state(); DataSizing::clear_state(); DataStringGlobals::clear_state(); diff --git a/src/EnergyPlus/SystemAvailabilityManager.cc b/src/EnergyPlus/SystemAvailabilityManager.cc index 32ab59d5ff0..d94d91874bf 100644 --- a/src/EnergyPlus/SystemAvailabilityManager.cc +++ b/src/EnergyPlus/SystemAvailabilityManager.cc @@ -204,22 +204,22 @@ namespace SystemAvailabilityManager { for (PlantNum = 1; PlantNum <= NumPlantLoops; ++PlantNum) { - PreviousStatus = PlantAvailMgr(PlantNum).AvailStatus; // Save the previous status for differential thermostat - PlantAvailMgr(PlantNum).AvailStatus = NoAction; // Initialize the availability to "take no action" + PreviousStatus = state.dataPlnt->PlantAvailMgr(PlantNum).AvailStatus; // Save the previous status for differential thermostat + state.dataPlnt->PlantAvailMgr(PlantNum).AvailStatus = NoAction; // Initialize the availability to "take no action" - for (PlantAvailMgrNum = 1; PlantAvailMgrNum <= PlantAvailMgr(PlantNum).NumAvailManagers; + for (PlantAvailMgrNum = 1; PlantAvailMgrNum <= state.dataPlnt->PlantAvailMgr(PlantNum).NumAvailManagers; ++PlantAvailMgrNum) { // loop over the avail managers in plant SimSysAvailManager(state, - PlantAvailMgr(PlantNum).AvailManagerType(PlantAvailMgrNum), - PlantAvailMgr(PlantNum).AvailManagerName(PlantAvailMgrNum), - PlantAvailMgr(PlantNum).AvailManagerNum(PlantAvailMgrNum), + state.dataPlnt->PlantAvailMgr(PlantNum).AvailManagerType(PlantAvailMgrNum), + state.dataPlnt->PlantAvailMgr(PlantNum).AvailManagerName(PlantAvailMgrNum), + state.dataPlnt->PlantAvailMgr(PlantNum).AvailManagerNum(PlantAvailMgrNum), PlantNum, PreviousStatus, AvailStatus); if (AvailStatus != NoAction) { - PlantAvailMgr(PlantNum).AvailStatus = AvailStatus; + state.dataPlnt->PlantAvailMgr(PlantNum).AvailStatus = AvailStatus; break; // First manager to do anything other than "NoAction" gets to set the availability } @@ -1340,32 +1340,32 @@ namespace SystemAvailabilityManager { state.dataSystemAvailabilityManager->GetAvailListsInput = false; } - if (!allocated(PlantAvailMgr)) { - PlantAvailMgr.allocate(NumPlantLoops); + if (!allocated(state.dataPlnt->PlantAvailMgr)) { + state.dataPlnt->PlantAvailMgr.allocate(NumPlantLoops); } Found = 0; if (state.dataSystemAvailabilityManager->NumAvailManagerLists > 0) Found = UtilityRoutines::FindItemInList(AvailabilityListName, state.dataSystemAvailabilityManager->SysAvailMgrListData); if (Found != 0) { - PlantAvailMgr(Loop).NumAvailManagers = state.dataSystemAvailabilityManager->SysAvailMgrListData(Found).NumItems; - PlantAvailMgr(Loop).AvailStatus = NoAction; - PlantAvailMgr(Loop).StartTime = 0; - PlantAvailMgr(Loop).StopTime = 0; - PlantAvailMgr(Loop).AvailManagerName.allocate(PlantAvailMgr(Loop).NumAvailManagers); - PlantAvailMgr(Loop).AvailManagerType.allocate(PlantAvailMgr(Loop).NumAvailManagers); - PlantAvailMgr(Loop).AvailManagerNum.allocate(PlantAvailMgr(Loop).NumAvailManagers); - for (Num = 1; Num <= PlantAvailMgr(Loop).NumAvailManagers; ++Num) { - PlantAvailMgr(Loop).AvailManagerName(Num) = state.dataSystemAvailabilityManager->SysAvailMgrListData(Found).AvailManagerName(Num); - PlantAvailMgr(Loop).AvailManagerNum(Num) = 0; - PlantAvailMgr(Loop).AvailManagerType(Num) = state.dataSystemAvailabilityManager->SysAvailMgrListData(Found).AvailManagerType(Num); - if (PlantAvailMgr(Loop).AvailManagerType(Num) == 0) { + state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers = state.dataSystemAvailabilityManager->SysAvailMgrListData(Found).NumItems; + state.dataPlnt->PlantAvailMgr(Loop).AvailStatus = NoAction; + state.dataPlnt->PlantAvailMgr(Loop).StartTime = 0; + state.dataPlnt->PlantAvailMgr(Loop).StopTime = 0; + state.dataPlnt->PlantAvailMgr(Loop).AvailManagerName.allocate(state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers); + state.dataPlnt->PlantAvailMgr(Loop).AvailManagerType.allocate(state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers); + state.dataPlnt->PlantAvailMgr(Loop).AvailManagerNum.allocate(state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers); + for (Num = 1; Num <= state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers; ++Num) { + state.dataPlnt->PlantAvailMgr(Loop).AvailManagerName(Num) = state.dataSystemAvailabilityManager->SysAvailMgrListData(Found).AvailManagerName(Num); + state.dataPlnt->PlantAvailMgr(Loop).AvailManagerNum(Num) = 0; + state.dataPlnt->PlantAvailMgr(Loop).AvailManagerType(Num) = state.dataSystemAvailabilityManager->SysAvailMgrListData(Found).AvailManagerType(Num); + if (state.dataPlnt->PlantAvailMgr(Loop).AvailManagerType(Num) == 0) { ShowSevereError(state, "GetPlantLoopData/GetPlantAvailabilityManager: Invalid System Availability Manager Type entered=\"" + state.dataSystemAvailabilityManager->SysAvailMgrListData(Found).cAvailManagerType(Num) + "\"."); ShowContinueError(state, "Occurs in AvailabilityManagerAssignmentList=\"" + AvailabilityListName + "\"."); ErrorsFound = true; } - if (state.dataSystemAvailabilityManager->SysAvailMgrListData(Found).AvailManagerType(Num) == state.dataSystemAvailabilityManager->SysAvailMgr_DiffThermo && Num != PlantAvailMgr(Loop).NumAvailManagers) { + if (state.dataSystemAvailabilityManager->SysAvailMgrListData(Found).AvailManagerType(Num) == state.dataSystemAvailabilityManager->SysAvailMgr_DiffThermo && Num != state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers) { ShowWarningError(state, "GetPlantLoopData/GetPlantAvailabilityManager: AvailabilityManager:DifferentialThermostat=\"" + state.dataSystemAvailabilityManager->SysAvailMgrListData(Found).AvailManagerName(Num) + "\"."); ShowContinueError(state, @@ -1387,11 +1387,11 @@ namespace SystemAvailabilityManager { ShowWarningError(state, "GetPlantLoopData/GetPlantAvailabilityManager: AvailabilityManagerAssignmentList=" + AvailabilityListName + " not found in lists. No availability will be used."); } - PlantAvailMgr(Loop).NumAvailManagers = 0; - PlantAvailMgr(Loop).AvailStatus = NoAction; - PlantAvailMgr(Loop).AvailManagerName.allocate(PlantAvailMgr(Loop).NumAvailManagers); - PlantAvailMgr(Loop).AvailManagerType.allocate(PlantAvailMgr(Loop).NumAvailManagers); - PlantAvailMgr(Loop).AvailManagerNum.allocate(PlantAvailMgr(Loop).NumAvailManagers); + state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers = 0; + state.dataPlnt->PlantAvailMgr(Loop).AvailStatus = NoAction; + state.dataPlnt->PlantAvailMgr(Loop).AvailManagerName.allocate(state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers); + state.dataPlnt->PlantAvailMgr(Loop).AvailManagerType.allocate(state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers); + state.dataPlnt->PlantAvailMgr(Loop).AvailManagerNum.allocate(state.dataPlnt->PlantAvailMgr(Loop).NumAvailManagers); } } @@ -3511,7 +3511,6 @@ namespace SystemAvailabilityManager { // Using/Aliasing using DataLoopNode::Node; - using DataPlant::PlantAvailMgr; Real64 DeltaTemp; diff --git a/src/EnergyPlus/SystemReports.cc b/src/EnergyPlus/SystemReports.cc index 80b8afa36d2..4b5647cbbdd 100644 --- a/src/EnergyPlus/SystemReports.cc +++ b/src/EnergyPlus/SystemReports.cc @@ -354,7 +354,7 @@ namespace EnergyPlus::SystemReports { CompType = ZoneEquipList(ListNum).EquipData(AirDistUnitNum).TypeOf; CompName = ZoneEquipList(ListNum).EquipData(AirDistUnitNum).Name; Idx = 0; - FindDemandSideMatch(CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); + FindDemandSideMatch(state, CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); if (MatchFound) UpdateZoneCompPtrArray(state, Idx, ListNum, AirDistUnitNum, MatchLoopType, MatchLoop, MatchBranch, MatchComp); ZoneEquipList(ListNum).EquipData(AirDistUnitNum).ZoneEqToPlantPtr = Idx; @@ -370,7 +370,7 @@ namespace EnergyPlus::SystemReports { CompType = ZoneEquipList(ListNum).EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).TypeOf; CompName = ZoneEquipList(ListNum).EquipData(AirDistUnitNum).SubEquipData(SubEquipNum).Name; Idx = 0; - FindDemandSideMatch(CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); + FindDemandSideMatch(state, CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); if (MatchFound) UpdateZoneSubCompPtrArray(state, Idx, ListNum, AirDistUnitNum, SubEquipNum, MatchLoopType, MatchLoop, MatchBranch, MatchComp); @@ -409,7 +409,7 @@ namespace EnergyPlus::SystemReports { .SubSubEquipData(SubSubEquipNum) .Name; Idx = 0; - FindDemandSideMatch(CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); + FindDemandSideMatch(state, CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); if (MatchFound) UpdateZoneSubSubCompPtrArray(state, Idx, @@ -736,13 +736,13 @@ namespace EnergyPlus::SystemReports { // 3. Find Demand Side Component Corresponding to Supply Side Component for (PlantLoopNum = 1; PlantLoopNum <= NumPlantLoops; ++PlantLoopNum) { - for (BranchNum = 1; BranchNum <= VentRepPlantSupplySide(PlantLoopNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= VentRepPlantSupplySide(PlantLoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { + for (BranchNum = 1; BranchNum <= state.dataPlnt->VentRepPlantSupplySide(PlantLoopNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->VentRepPlantSupplySide(PlantLoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { { - auto &thisVentRepComp(VentRepPlantSupplySide(PlantLoopNum).Branch(BranchNum).Comp(CompNum)); + auto &thisVentRepComp(state.dataPlnt->VentRepPlantSupplySide(PlantLoopNum).Branch(BranchNum).Comp(CompNum)); CompType = thisVentRepComp.TypeOf; CompName = thisVentRepComp.Name; - FindDemandSideMatch(CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); + FindDemandSideMatch(state, CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); thisVentRepComp.ConnectPlant.LoopType = MatchLoopType; thisVentRepComp.ConnectPlant.LoopNum = MatchLoop; thisVentRepComp.ConnectPlant.BranchNum = MatchBranch; @@ -753,13 +753,13 @@ namespace EnergyPlus::SystemReports { } for (PlantLoopNum = 1; PlantLoopNum <= NumCondLoops; ++PlantLoopNum) { - for (BranchNum = 1; BranchNum <= VentRepCondSupplySide(PlantLoopNum).TotalBranches; ++BranchNum) { - for (CompNum = 1; CompNum <= VentRepCondSupplySide(PlantLoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { + for (BranchNum = 1; BranchNum <= state.dataPlnt->VentRepCondSupplySide(PlantLoopNum).TotalBranches; ++BranchNum) { + for (CompNum = 1; CompNum <= state.dataPlnt->VentRepCondSupplySide(PlantLoopNum).Branch(BranchNum).TotalComponents; ++CompNum) { { - auto &thisVentRepComp(VentRepCondSupplySide(PlantLoopNum).Branch(BranchNum).Comp(CompNum)); + auto &thisVentRepComp(state.dataPlnt->VentRepCondSupplySide(PlantLoopNum).Branch(BranchNum).Comp(CompNum)); CompType = thisVentRepComp.TypeOf; CompName = thisVentRepComp.Name; - FindDemandSideMatch(CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); + FindDemandSideMatch(state, CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); thisVentRepComp.ConnectPlant.LoopType = MatchLoopType; thisVentRepComp.ConnectPlant.LoopNum = MatchLoop; thisVentRepComp.ConnectPlant.BranchNum = MatchBranch; @@ -998,7 +998,7 @@ namespace EnergyPlus::SystemReports { // On every iteration, load the Plant Supply Side Data and load the Plant Demand Side Data for (PlantLoopNum = 1; PlantLoopNum <= NumPlantLoops; ++PlantLoopNum) { - auto &vrpss = VentRepPlantSupplySide(PlantLoopNum); + auto &vrpss = state.dataPlnt->VentRepPlantSupplySide(PlantLoopNum); for (BranchNum = 1; BranchNum <= vrpss.TotalBranches; ++BranchNum) { auto &vrpssBranch = vrpss.Branch(BranchNum); for (CompNum = 1; CompNum <= vrpssBranch.TotalComponents; ++CompNum) { @@ -1011,7 +1011,7 @@ namespace EnergyPlus::SystemReports { } } } - auto &vrpds = VentRepPlantDemandSide(PlantLoopNum); + auto &vrpds = state.dataPlnt->VentRepPlantDemandSide(PlantLoopNum); for (BranchNum = 1; BranchNum <= vrpds.TotalBranches; ++BranchNum) { auto &vrpdsBranch = vrpds.Branch(BranchNum); for (CompNum = 1; CompNum <= vrpdsBranch.TotalComponents; ++CompNum) { @@ -1028,7 +1028,7 @@ namespace EnergyPlus::SystemReports { // On every iteration, load the Condenser Supply Side Data and load the Condenser Demand Side Data for (PlantLoopNum = 1; PlantLoopNum <= NumCondLoops; ++PlantLoopNum) { - auto &vrcss = VentRepCondSupplySide(PlantLoopNum); + auto &vrcss = state.dataPlnt->VentRepCondSupplySide(PlantLoopNum); for (BranchNum = 1; BranchNum <= vrcss.TotalBranches; ++BranchNum) { auto &vrcssBranch = vrcss.Branch(BranchNum); for (CompNum = 1; CompNum <= vrcssBranch.TotalComponents; ++CompNum) { @@ -1041,7 +1041,7 @@ namespace EnergyPlus::SystemReports { } } } - auto &vrcds = VentRepCondSupplySide(PlantLoopNum); + auto &vrcds = state.dataPlnt->VentRepCondSupplySide(PlantLoopNum); for (BranchNum = 1; BranchNum <= vrcds.TotalBranches; ++BranchNum) { auto &vrcdsBranch = vrcds.Branch(BranchNum); for (CompNum = 1; CompNum <= vrcdsBranch.TotalComponents; ++CompNum) { @@ -1140,11 +1140,11 @@ namespace EnergyPlus::SystemReports { // countloop=countloop+1 // if (countloop > 100) exit if (LoopType == 1) { - for (BranchNum = 1; BranchNum <= VentRepPlantSupplySide(LoopNum).TotalBranches; ++BranchNum) { - for (SupplySideCompNum = 1; SupplySideCompNum <= VentRepPlantSupplySide(LoopNum).Branch(BranchNum).TotalComponents; + for (BranchNum = 1; BranchNum <= state.dataPlnt->VentRepPlantSupplySide(LoopNum).TotalBranches; ++BranchNum) { + for (SupplySideCompNum = 1; SupplySideCompNum <= state.dataPlnt->VentRepPlantSupplySide(LoopNum).Branch(BranchNum).TotalComponents; ++SupplySideCompNum) { { - auto &thisVentRepComp(VentRepPlantSupplySide(LoopNum).Branch(BranchNum).Comp(SupplySideCompNum)); + auto &thisVentRepComp(state.dataPlnt->VentRepPlantSupplySide(LoopNum).Branch(BranchNum).Comp(SupplySideCompNum)); DemandSideLoopType = thisVentRepComp.ConnectPlant.LoopType; DemandSideLoopNum = thisVentRepComp.ConnectPlant.LoopNum; DemandSideBranchNum = thisVentRepComp.ConnectPlant.BranchNum; @@ -1186,11 +1186,11 @@ namespace EnergyPlus::SystemReports { } } } else if (LoopType == 2) { - for (BranchNum = 1; BranchNum <= VentRepCondSupplySide(LoopNum).TotalBranches; ++BranchNum) { - for (SupplySideCompNum = 1; SupplySideCompNum <= VentRepCondSupplySide(LoopNum).Branch(BranchNum).TotalComponents; + for (BranchNum = 1; BranchNum <= state.dataPlnt->VentRepCondSupplySide(LoopNum).TotalBranches; ++BranchNum) { + for (SupplySideCompNum = 1; SupplySideCompNum <= state.dataPlnt->VentRepCondSupplySide(LoopNum).Branch(BranchNum).TotalComponents; ++SupplySideCompNum) { { - auto &thisVentRepComp(VentRepCondSupplySide(LoopNum).Branch(BranchNum).Comp(SupplySideCompNum)); + auto &thisVentRepComp(state.dataPlnt->VentRepCondSupplySide(LoopNum).Branch(BranchNum).Comp(SupplySideCompNum)); DemandSideLoopType = thisVentRepComp.ConnectPlant.LoopType; DemandSideLoopNum = thisVentRepComp.ConnectPlant.LoopNum; DemandSideBranchNum = thisVentRepComp.ConnectPlant.BranchNum; @@ -2922,9 +2922,9 @@ namespace EnergyPlus::SystemReports { { auto const SELECT_CASE_var(LoopSideNum); if (SELECT_CASE_var == DemandSide) { - select_ThisReportData = &VentRepPlantDemandSide(PlantLoopNum); + select_ThisReportData = &state.dataPlnt->VentRepPlantDemandSide(PlantLoopNum); } else if (SELECT_CASE_var == SupplySide) { - select_ThisReportData = &VentRepPlantSupplySide(PlantLoopNum); + select_ThisReportData = &state.dataPlnt->VentRepPlantSupplySide(PlantLoopNum); } else { assert(false); } @@ -2933,9 +2933,9 @@ namespace EnergyPlus::SystemReports { { auto const SELECT_CASE_var(LoopSideNum); if (SELECT_CASE_var == DemandSide) { - select_ThisReportData = &VentRepCondDemandSide(PlantLoopNum - NumPlantLoops); + select_ThisReportData = &state.dataPlnt->VentRepCondDemandSide(PlantLoopNum - NumPlantLoops); } else if (SELECT_CASE_var == SupplySide) { - select_ThisReportData = &VentRepCondSupplySide(PlantLoopNum - NumPlantLoops); + select_ThisReportData = &state.dataPlnt->VentRepCondSupplySide(PlantLoopNum - NumPlantLoops); } else { assert(false); } @@ -3063,9 +3063,9 @@ namespace EnergyPlus::SystemReports { { auto const SELECT_CASE_var(LoopSideNum); if (SELECT_CASE_var == DemandSide) { - select_ThisReportData = &VentRepPlantDemandSide(PlantLoopNum); + select_ThisReportData = &state.dataPlnt->VentRepPlantDemandSide(PlantLoopNum); } else if (SELECT_CASE_var == SupplySide) { - select_ThisReportData = &VentRepPlantSupplySide(PlantLoopNum); + select_ThisReportData = &state.dataPlnt->VentRepPlantSupplySide(PlantLoopNum); } else { assert(false); } @@ -3074,9 +3074,9 @@ namespace EnergyPlus::SystemReports { { auto const SELECT_CASE_var(LoopSideNum); if (SELECT_CASE_var == DemandSide) { - select_ThisReportData = &VentRepCondDemandSide(PlantLoopNum - NumPlantLoops); + select_ThisReportData = &state.dataPlnt->VentRepCondDemandSide(PlantLoopNum - NumPlantLoops); } else if (SELECT_CASE_var == SupplySide) { - select_ThisReportData = &VentRepCondSupplySide(PlantLoopNum - NumPlantLoops); + select_ThisReportData = &state.dataPlnt->VentRepCondSupplySide(PlantLoopNum - NumPlantLoops); } else { assert(false); } @@ -4671,7 +4671,7 @@ namespace EnergyPlus::SystemReports { CompType = thisComp.TypeOf; CompName = thisComp.Name; Idx = 0; - FindDemandSideMatch(CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); + FindDemandSideMatch(state, CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); if (MatchFound) UpdateAirSysCompPtrArray(state, Idx, AirLoopNum, BranchNum, CompNum, MatchLoopType, MatchLoop, MatchBranch, MatchComp); thisComp.AirSysToPlantPtr = Idx; @@ -4688,7 +4688,7 @@ namespace EnergyPlus::SystemReports { CompType = thisSubComp.TypeOf; CompName = thisSubComp.Name; Idx = 0; - FindDemandSideMatch(CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); + FindDemandSideMatch(state, CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); if (MatchFound) UpdateAirSysSubCompPtrArray( state, Idx, AirLoopNum, BranchNum, CompNum, SubCompNum, MatchLoopType, MatchLoop, MatchBranch, MatchComp); @@ -4706,7 +4706,7 @@ namespace EnergyPlus::SystemReports { CompType = thisSubSubComp.TypeOf; CompName = thisSubSubComp.Name; Idx = 0; - FindDemandSideMatch(CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); + FindDemandSideMatch(state, CompType, CompName, MatchFound, MatchLoopType, MatchLoop, MatchBranch, MatchComp); if (MatchFound) UpdateAirSysSubSubCompPtrArray(state, Idx, @@ -4731,7 +4731,8 @@ namespace EnergyPlus::SystemReports { } } - void FindDemandSideMatch(std::string const &CompType, // Inlet node of the component to find the match of + void FindDemandSideMatch(EnergyPlusData &state, + std::string const &CompType, // Inlet node of the component to find the match of std::string const &CompName, // Outlet node of the component to find the match of bool &MatchFound, // Set to .TRUE. when a match is found int &MatchLoopType, // Loop number of the match @@ -4776,11 +4777,11 @@ namespace EnergyPlus::SystemReports { // record the type of loop and the loop, branch, and component numbers. if (!MatchFound) { // Go through the plant demand side loops for (PassLoopNum = 1; PassLoopNum <= NumPlantLoops; ++PassLoopNum) { - for (PassBranchNum = 1; PassBranchNum <= VentRepPlantDemandSide(PassLoopNum).TotalBranches; ++PassBranchNum) { - for (PassCompNum = 1; PassCompNum <= VentRepPlantDemandSide(PassLoopNum).Branch(PassBranchNum).TotalComponents; ++PassCompNum) { + for (PassBranchNum = 1; PassBranchNum <= state.dataPlnt->VentRepPlantDemandSide(PassLoopNum).TotalBranches; ++PassBranchNum) { + for (PassCompNum = 1; PassCompNum <= state.dataPlnt->VentRepPlantDemandSide(PassLoopNum).Branch(PassBranchNum).TotalComponents; ++PassCompNum) { if (UtilityRoutines::SameString(CompType, - VentRepPlantDemandSide(PassLoopNum).Branch(PassBranchNum).Comp(PassCompNum).TypeOf) && - UtilityRoutines::SameString(CompName, VentRepPlantDemandSide(PassLoopNum).Branch(PassBranchNum).Comp(PassCompNum).Name)) { + state.dataPlnt->VentRepPlantDemandSide(PassLoopNum).Branch(PassBranchNum).Comp(PassCompNum).TypeOf) && + UtilityRoutines::SameString(CompName, state.dataPlnt->VentRepPlantDemandSide(PassLoopNum).Branch(PassBranchNum).Comp(PassCompNum).Name)) { // Found a match on the plant demand side--increment the counter MatchFound = true; MatchLoopType = 1; @@ -4798,11 +4799,11 @@ namespace EnergyPlus::SystemReports { if (!MatchFound) { // Go through the condenser demand side loops for (PassLoopNum = 1; PassLoopNum <= NumCondLoops; ++PassLoopNum) { - for (PassBranchNum = 1; PassBranchNum <= VentRepCondDemandSide(PassLoopNum).TotalBranches; ++PassBranchNum) { - for (PassCompNum = 1; PassCompNum <= VentRepCondDemandSide(PassLoopNum).Branch(PassBranchNum).TotalComponents; ++PassCompNum) { + for (PassBranchNum = 1; PassBranchNum <= state.dataPlnt->VentRepCondDemandSide(PassLoopNum).TotalBranches; ++PassBranchNum) { + for (PassCompNum = 1; PassCompNum <= state.dataPlnt->VentRepCondDemandSide(PassLoopNum).Branch(PassBranchNum).TotalComponents; ++PassCompNum) { if (UtilityRoutines::SameString(CompType, - VentRepCondDemandSide(PassLoopNum).Branch(PassBranchNum).Comp(PassCompNum).TypeOf) && - UtilityRoutines::SameString(CompName, VentRepCondDemandSide(PassLoopNum).Branch(PassBranchNum).Comp(PassCompNum).Name)) { + state.dataPlnt->VentRepCondDemandSide(PassLoopNum).Branch(PassBranchNum).Comp(PassCompNum).TypeOf) && + UtilityRoutines::SameString(CompName, state.dataPlnt->VentRepCondDemandSide(PassLoopNum).Branch(PassBranchNum).Comp(PassCompNum).Name)) { // Found a match on the plant demand side--increment the counter MatchFound = true; MatchLoopType = 2; diff --git a/src/EnergyPlus/SystemReports.hh b/src/EnergyPlus/SystemReports.hh index 62453aa2395..0a7b2f1ea59 100644 --- a/src/EnergyPlus/SystemReports.hh +++ b/src/EnergyPlus/SystemReports.hh @@ -221,7 +221,8 @@ namespace SystemReports { int const BranchNum // counter for zone air distribution inlets ); - void FindDemandSideMatch(std::string const &CompType, // Inlet node of the component to find the match of + void FindDemandSideMatch(EnergyPlusData &state, + std::string const &CompType, // Inlet node of the component to find the match of std::string const &CompName, // Outlet node of the component to find the match of bool &MatchFound, // Set to .TRUE. when a match is found int &MatchLoopType, // Loop number of the match diff --git a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc index 9ce5e222be2..848c8cd8a35 100644 --- a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc +++ b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc @@ -472,7 +472,7 @@ TEST_F(SizingAnalysisObjectsTest, LoggingSubStep4stepPerHour) TEST_F(SizingAnalysisObjectsTest, PlantCoincidentAnalyObjTestNullMassFlowRateTimestamp) { - // similar to PlantCoincidentAnalyObjTest but excersize logic problem resolved as issue #5665 + // similar to PlantCoincidentAnalyObjTest but exercise logic problem resolved as issue #5665 std::string loopName; int loopNum; int nodeNum; diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 970110d31ed..fce41a9ce81 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -1009,8 +1009,6 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_ExternalShadingIO) ASSERT_TRUE(process_idf(idf_objects)); - state->dataSolarShading->clear_state(); - SimulationManager::GetProjectData(*state); bool FoundError = false; @@ -1087,7 +1085,6 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_ExternalShadingIO) EXPECT_DOUBLE_EQ(1, SunlitFrac(4, 9, surfNum)); surfNum = UtilityRoutines::FindItemInList("ZN001:ROOF", DataSurfaces::Surface); EXPECT_DOUBLE_EQ(0.5432, SunlitFrac(4, 9, surfNum)); - state->dataSolarShading->clear_state(); } TEST_F(EnergyPlusFixture, SolarShadingTest_DisableGroupSelfShading) @@ -1420,8 +1417,6 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_DisableGroupSelfShading) ASSERT_TRUE(process_idf(idf_objects)); - state->dataSolarShading->clear_state(); - SimulationManager::GetProjectData(*state); bool FoundError = false; diff --git a/tst/EnergyPlus/unit/SwimmingPool.unit.cc b/tst/EnergyPlus/unit/SwimmingPool.unit.cc index e4ae2b9e14a..d9e3ed44a66 100644 --- a/tst/EnergyPlus/unit/SwimmingPool.unit.cc +++ b/tst/EnergyPlus/unit/SwimmingPool.unit.cc @@ -89,9 +89,6 @@ TEST_F(EnergyPlusFixture, SwimmingPool_CalcSwimmingPoolEvap) Real64 EvapRate; // Tests for CalcSwimmingPoolEvap--Evaporate Rate Calculation for Swimming Pools - state->dataSwimmingPools->clear_state(); - DataSurfaces::clear_state(); - state->dataSwimmingPools->NumSwimmingPools = 1; state->dataSwimmingPools->Pool.allocate(1); DataSurfaces::Surface.allocate(1); @@ -130,9 +127,6 @@ TEST_F(EnergyPlusFixture, SwimmingPool_InitSwimmingPoolPlantLoopIndex) bool MyPlantScanFlagPool; // Tests for InitSwimmingPoolPlantLoopIndex - state->dataSwimmingPools->clear_state(); - DataPlant::clear_state(); - state->dataSwimmingPools->NumSwimmingPools = 2; state->dataPlnt->TotNumLoops = 2; state->dataSwimmingPools->Pool.allocate(state->dataSwimmingPools->NumSwimmingPools); @@ -193,10 +187,6 @@ TEST_F(EnergyPlusFixture, SwimmingPool_InitSwimmingPoolPlantNodeFlow) int PoolNum; // Tests for InitSwimmingPoolPlantLoopIndex - state->dataSwimmingPools->clear_state(); - DataPlant::clear_state(); - DataLoopNode::clear_state(); - state->dataSwimmingPools->NumSwimmingPools = 1; state->dataPlnt->TotNumLoops = 1; state->dataSwimmingPools->Pool.allocate(state->dataSwimmingPools->NumSwimmingPools); @@ -261,7 +251,6 @@ TEST_F(EnergyPlusFixture, SwimmingPool_ErrorCheckSetupPoolSurfaceTest) { // Tests for InitSwimmingPoolPlantLoopIndex - state->dataSwimmingPools->clear_state(); state->dataSwimmingPools->NumSwimmingPools = 1; state->dataSwimmingPools->Pool.allocate(state->dataSwimmingPools->NumSwimmingPools); DataSurfaces::Surface.allocate(1); diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 1ef5f178296..32a3e8f96d3 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -284,10 +284,6 @@ class AirloopUnitarySysTest : public EnergyPlusFixture { EnergyPlusFixture::TearDown(); // Remember to tear down the base fixture after cleaning up derived fixture! -// state->dataWaterCoils->NumWaterCoils = 0; -// state->dataWaterCoils->WaterCoil.clear(); -// state->dataWaterCoils->WaterCoilNumericFields.clear(); - state->dataPlnt->PlantLoop.clear(); DataSizing::PlantSizData.clear(); DataSizing::ZoneEqSizing.clear(); DataSizing::UnitarySysEqSizing.clear(); @@ -297,8 +293,6 @@ class AirloopUnitarySysTest : public EnergyPlusFixture DataSizing::FinalSysSizing.clear(); DataSizing::SysSizPeakDDNum.clear(); DataHVACGlobals::NumPrimaryAirSys = 0; -// state->dataAirSystemsData->PrimaryAirSystems.clear(); -// state->dataAirLoop->AirLoopControlInfo.clear(); Psychrometrics::cached_Twb.clear(); Psychrometrics::cached_Psat.clear(); DataLoopNode::Node.clear(); @@ -309,7 +303,7 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) { // Set up raw water coil sizes as coil-on-branch configuration then - // test against sizing of same water coils in UntarySystem + // test against sizing of same water coils in UnitarySystem state->dataEnvrn->OutBaroPress = 101325.0; state->dataEnvrn->StdRhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, 20.0, 0.0); diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index cc6f3bda5f1..9eb4707bcdc 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -163,10 +163,6 @@ class WaterCoilsTest : public EnergyPlusFixture { EnergyPlusFixture::TearDown(); // Remember to tear down the base fixture after cleaning up derived fixture! -// state->dataWaterCoils->NumWaterCoils = 0; -// state->dataWaterCoils->WaterCoil.clear(); -// state->dataWaterCoils->WaterCoilNumericFields.clear(); - state->dataPlnt->PlantLoop.clear(); PlantSizData.clear(); ZoneEqSizing.clear(); UnitarySysEqSizing.clear(); @@ -175,8 +171,6 @@ class WaterCoilsTest : public EnergyPlusFixture SysSizPeakDDNum.clear(); FinalSysSizing.clear(); SysSizPeakDDNum.clear(); -// state->dataAirSystemsData->PrimaryAirSystems.clear(); -// state->dataAirLoop->AirLoopControlInfo.clear(); cached_Twb.clear(); cached_Psat.clear(); } From f828e247dc1dd072019378e76fb2221fcddc28b4 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 6 Jan 2021 16:39:01 -0700 Subject: [PATCH 10/17] moving DataPlant to state --- src/EnergyPlus/Plant/DataPlant.cc | 10 --------- src/EnergyPlus/Plant/DataPlant.hh | 31 ++++++++++++++++++++++++---- src/EnergyPlus/Plant/PlantManager.cc | 14 ++++++------- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/src/EnergyPlus/Plant/DataPlant.cc b/src/EnergyPlus/Plant/DataPlant.cc index 0170cb90522..bfa3b54fa74 100644 --- a/src/EnergyPlus/Plant/DataPlant.cc +++ b/src/EnergyPlus/Plant/DataPlant.cc @@ -58,13 +58,6 @@ namespace EnergyPlus::DataPlant { // This data-only module contains the structures for various parts of the Plant and // Condenser Loops. - std::map cPressureSimType { - {DataPlant::iPressSimType::NoPressure, "NONE"}, - {DataPlant::iPressSimType::PumpPowerCorrection, "PUMPPOWERCORRECTION"}, - {DataPlant::iPressSimType::FlowCorrection, "LOOPFLOWCORRECTION"}, - {DataPlant::iPressSimType::FlowSimulation, "PRESSURESIMULATION"}, - }; - // Parameters for Component/Equipment Types (ref: TypeOf in CompData) Array1D_string const SimPlantEquipTypes(NumSimPlantEquipTypes, {"BOILER:HOTWATER", @@ -278,8 +271,5 @@ namespace EnergyPlus::DataPlant { LoopType::Both, LoopType::Both, LoopType::Both, LoopType::Plant, LoopType::Plant, LoopType::Plant, LoopType::Both, LoopType::Both}); Array1D const ConvergenceHistoryARR(DataPlant::NumConvergenceHistoryTerms, {0.0, -1.0, -2.0, -3.0, -4.0}); - Real64 const sum_ConvergenceHistoryARR(sum(ConvergenceHistoryARR)); - Real64 const square_sum_ConvergenceHistoryARR(pow_2(sum_ConvergenceHistoryARR)); - Real64 const sum_square_ConvergenceHistoryARR(sum(pow(ConvergenceHistoryARR, 2))); } // namespace EnergyPlus diff --git a/src/EnergyPlus/Plant/DataPlant.hh b/src/EnergyPlus/Plant/DataPlant.hh index 065b7fec904..46ff53ac472 100644 --- a/src/EnergyPlus/Plant/DataPlant.hh +++ b/src/EnergyPlus/Plant/DataPlant.hh @@ -48,6 +48,9 @@ #ifndef DataPlant_hh_INCLUDED #define DataPlant_hh_INCLUDED +// C++ Headers +#include + // ObjexxFCL Headers #include #include @@ -89,7 +92,22 @@ namespace DataPlant { constexpr Real64 LoopDemandTol(0.1); // minimum significant loop cooling or heating demand constexpr Real64 DeltaTempTol(0.0001); // minimum significant loop temperature difference - extern std::map cPressureSimType; + constexpr std::string_view cPressureSimType(DataPlant::iPressSimType const &d) { + switch (d) { + case DataPlant::iPressSimType::NoPressure: + return "NONE"; + case DataPlant::iPressSimType::PumpPowerCorrection: + return "PUMPPOWERCORRECTION"; + case DataPlant::iPressSimType::FlowCorrection: + return "LOOPFLOWCORRECTION"; + case DataPlant::iPressSimType::FlowSimulation: + return "PRESSURESIMULATION"; + default: + assert(false); + return ""; + } + + } // Parameters for Component/Equipment Types (ref: TypeOf in CompData) constexpr int NumSimPlantEquipTypes(96); @@ -196,9 +214,14 @@ namespace DataPlant { constexpr int TypeOf_HeatPumpEIRHeating(96); extern Array1D const ConvergenceHistoryARR; - extern Real64 const sum_ConvergenceHistoryARR; - extern Real64 const square_sum_ConvergenceHistoryARR; - extern Real64 const sum_square_ConvergenceHistoryARR; + + // These all are going to be hard coded for now, but when we move to C++20 we will have constexpr methods available to fix this + // const Real64 sum_ConvergenceHistoryARR(sum(ConvergenceHistoryARR)); + // const Real64 square_sum_ConvergenceHistoryARR(pow_2(sum_ConvergenceHistoryARR)); + // const Real64 sum_square_ConvergenceHistoryARR(sum(pow(ConvergenceHistoryARR, 2))); + constexpr Real64 sum_ConvergenceHistoryARR(-10.0); + constexpr Real64 square_sum_ConvergenceHistoryARR(100.0); + constexpr Real64 sum_square_ConvergenceHistoryARR(30.0); } // namespace DataPlant diff --git a/src/EnergyPlus/Plant/PlantManager.cc b/src/EnergyPlus/Plant/PlantManager.cc index 2ea31e0ac41..28376397028 100644 --- a/src/EnergyPlus/Plant/PlantManager.cc +++ b/src/EnergyPlus/Plant/PlantManager.cc @@ -588,16 +588,16 @@ namespace EnergyPlus::PlantManager { MatchedPressureString = false; // Check all types - if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), cPressureSimType.at(DataPlant::iPressSimType::NoPressure))) { + if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), format("{}", cPressureSimType(DataPlant::iPressSimType::NoPressure)))) { this_loop.PressureSimType = DataPlant::iPressSimType::NoPressure; MatchedPressureString = true; - } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), cPressureSimType.at(DataPlant::iPressSimType::PumpPowerCorrection))) { + } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), format("{}", cPressureSimType(DataPlant::iPressSimType::PumpPowerCorrection)))) { this_loop.PressureSimType = DataPlant::iPressSimType::PumpPowerCorrection; MatchedPressureString = true; - } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), cPressureSimType.at(DataPlant::iPressSimType::FlowSimulation))) { + } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), format("{}", cPressureSimType(DataPlant::iPressSimType::FlowSimulation)))) { this_loop.PressureSimType = DataPlant::iPressSimType::FlowSimulation; MatchedPressureString = true; - } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), cPressureSimType.at(DataPlant::iPressSimType::FlowCorrection))) { + } else if (UtilityRoutines::SameString(Alpha(PressSimAlphaIndex), format("{}", cPressureSimType(DataPlant::iPressSimType::FlowCorrection)))) { this_loop.PressureSimType = DataPlant::iPressSimType::FlowCorrection; MatchedPressureString = true; } @@ -616,9 +616,9 @@ namespace EnergyPlus::PlantManager { ShowContinueError(state, "Invalid " + cAlphaFieldNames(PressSimAlphaIndex) + "=\"" + Alpha(PressSimAlphaIndex) + "\"."); ShowContinueError(state, "Currently only options are: "); - ShowContinueError(state, " - " + cPressureSimType.at(DataPlant::iPressSimType::NoPressure)); - ShowContinueError(state, " - " + cPressureSimType.at(DataPlant::iPressSimType::PumpPowerCorrection)); - ShowContinueError(state, " - " + cPressureSimType.at(DataPlant::iPressSimType::FlowCorrection)); + ShowContinueError(state, " - " + format("{}", cPressureSimType(DataPlant::iPressSimType::NoPressure))); + ShowContinueError(state, " - " + format("{}", cPressureSimType(DataPlant::iPressSimType::PumpPowerCorrection))); + ShowContinueError(state, " - " + format("{}", cPressureSimType(DataPlant::iPressSimType::FlowCorrection))); ErrorsFound = true; } } From 392b742d7c0b7f3e78f5a1dffff1fa0f4caec8e3 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 7 Jan 2021 05:16:55 -0700 Subject: [PATCH 11/17] move PlantCentralGSHP to state --- src/EnergyPlus/PlantCentralGSHP.cc | 502 +++++++++---------- src/EnergyPlus/PlantCentralGSHP.hh | 75 +-- src/EnergyPlus/StateManagement.cc | 2 - tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc | 94 ++-- 4 files changed, 316 insertions(+), 357 deletions(-) diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index 43279cd395d..5674996631b 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -77,13 +77,7 @@ #include #include -namespace EnergyPlus { - -// Contents: -// CentralHeatPumpSystem (CGSHP) System -// ChillerHeaterPerformance:Electric:EIR - -namespace PlantCentralGSHP { +namespace EnergyPlus::PlantCentralGSHP { // MODULE INFORMATION: // AUTHOR PNNL @@ -102,53 +96,16 @@ namespace PlantCentralGSHP { // which in turn calls the electric PlantCentralGSHP model. The PlantCentralGSHP model is based on // polynomial fits of chiller/heater or heat pump performance data. - int const WaterCooled(2); - int const SmartMixing(1); - - bool getWrapperInputFlag(true); // When TRUE, calls subroutine to read input file. - - int numWrappers(0); // Number of Wrappers specified in input - int numChillerHeaters(0); // Number of Chiller/heaters specified in input - - Real64 ChillerCapFT(0.0); // Chiller/heater capacity fraction (evaluated as a function of temperature) - Real64 ChillerEIRFT(0.0); // Chiller/heater electric input ratio (EIR = 1 / COP) as a function of temperature - Real64 ChillerEIRFPLR(0.0); // Chiller/heater EIR as a function of part-load ratio (PLR) - Real64 ChillerPartLoadRatio(0.0); // Chiller/heater part-load ratio (PLR) - Real64 ChillerCyclingRatio(0.0); // Chiller/heater cycling ratio - Real64 ChillerFalseLoadRate(0.0); // Chiller/heater false load over and above the water-side load [W] - - Array1D_bool CheckEquipName; - - Array1D Wrapper; - Array1D ChillerHeater; - - void clear_state() - { - getWrapperInputFlag = true; - numWrappers = 0; - numChillerHeaters = 0; - - ChillerCapFT = 0.0; - ChillerEIRFT = 0.0; - ChillerEIRFPLR = 0.0; - ChillerPartLoadRatio = 0.0; - ChillerCyclingRatio = 0.0; - ChillerFalseLoadRate = 0.0; - - Wrapper.deallocate(); - ChillerHeater.deallocate(); - } - PlantComponent *WrapperSpecs::factory(EnergyPlusData &state, std::string const &objectName) { // Process the input data - if (getWrapperInputFlag) { + if (state.dataPlantCentralGSHP->getWrapperInputFlag) { GetWrapperInput(state); - getWrapperInputFlag = false; + state.dataPlantCentralGSHP->getWrapperInputFlag = false; } // Now look for this particular object - for (auto &thisWrapper : Wrapper) { + for (auto &thisWrapper : state.dataPlantCentralGSHP->Wrapper) { if (thisWrapper.Name == objectName) { return &thisWrapper; } @@ -172,7 +129,7 @@ namespace PlantCentralGSHP { MaxLoad = 0.0; OptLoad = 0.0; if (calledFromLocation.loopNum == this->CWLoopNum) { // Chilled water loop - if (this->ControlMode == SmartMixing) { // control mode is SmartMixing + if (this->ControlMode == iCondType::SmartMixing) { // control mode is SmartMixing for (int NumChillerHeater = 1; NumChillerHeater <= this->ChillerHeaterNums; ++NumChillerHeater) { MaxLoad += this->ChillerHeater(NumChillerHeater).RefCapCooling * this->ChillerHeater(NumChillerHeater).MaxPartLoadRatCooling; OptLoad += this->ChillerHeater(NumChillerHeater).RefCapCooling * this->ChillerHeater(NumChillerHeater).OptPartLoadRatCooling; @@ -180,7 +137,7 @@ namespace PlantCentralGSHP { } } } else if (calledFromLocation.loopNum == this->HWLoopNum) { // Hot water loop - if (this->ControlMode == SmartMixing) { // control mode is SmartMixing + if (this->ControlMode == iCondType::SmartMixing) { // control mode is SmartMixing for (int NumChillerHeater = 1; NumChillerHeater <= this->ChillerHeaterNums; ++NumChillerHeater) { MaxLoad += this->ChillerHeater(NumChillerHeater).RefCapClgHtg * this->ChillerHeater(NumChillerHeater).MaxPartLoadRatClgHtg; OptLoad += this->ChillerHeater(NumChillerHeater).RefCapClgHtg * this->ChillerHeater(NumChillerHeater).OptPartLoadRatClgHtg; @@ -254,7 +211,7 @@ namespace PlantCentralGSHP { bool ErrorsFound; // If errors detected in input // auto-size the chiller heater components - if (this->ControlMode == SmartMixing) { + if (this->ControlMode == iCondType::SmartMixing) { for (int NumChillerHeater = 1; NumChillerHeater <= this->ChillerHeaterNums; ++NumChillerHeater) { ErrorsFound = false; @@ -582,17 +539,16 @@ namespace PlantCentralGSHP { int IOStat; // IO Status when calling get input subroutine DataIPShortCuts::cCurrentModuleObject = "CentralHeatPumpSystem"; - numWrappers = inputProcessor->getNumObjectsFound(state, DataIPShortCuts::cCurrentModuleObject); + state.dataPlantCentralGSHP->numWrappers = inputProcessor->getNumObjectsFound(state, DataIPShortCuts::cCurrentModuleObject); - if (numWrappers <= 0) { + if (state.dataPlantCentralGSHP->numWrappers <= 0) { ShowSevereError(state, "No " + DataIPShortCuts::cCurrentModuleObject + " equipment specified in input file"); } - Wrapper.allocate(numWrappers); - CheckEquipName.dimension(numWrappers, true); + state.dataPlantCentralGSHP->Wrapper.allocate(state.dataPlantCentralGSHP->numWrappers); // Load arrays with electric EIR chiller data - for (int WrapperNum = 1; WrapperNum <= numWrappers; ++WrapperNum) { + for (int WrapperNum = 1; WrapperNum <= state.dataPlantCentralGSHP->numWrappers; ++WrapperNum) { inputProcessor->getObjectItem(state, DataIPShortCuts::cCurrentModuleObject, WrapperNum, @@ -606,7 +562,7 @@ namespace PlantCentralGSHP { DataIPShortCuts::cAlphaFieldNames, DataIPShortCuts::cNumericFieldNames); - Wrapper(WrapperNum).Name = DataIPShortCuts::cAlphaArgs(1); + state.dataPlantCentralGSHP->Wrapper(WrapperNum).Name = DataIPShortCuts::cAlphaArgs(1); // initialize nth chiller heater index (including identical units) for current wrapper int NumChHtrPerWrapper = 0; @@ -615,10 +571,10 @@ namespace PlantCentralGSHP { } if (DataIPShortCuts::cAlphaArgs(2) == "SMARTMIXING") { - Wrapper(WrapperNum).ControlMode = SmartMixing; + state.dataPlantCentralGSHP->Wrapper(WrapperNum).ControlMode = iCondType::SmartMixing; } - Wrapper(WrapperNum).CHWInletNodeNum = + state.dataPlantCentralGSHP->Wrapper(WrapperNum).CHWInletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(3), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, @@ -627,7 +583,7 @@ namespace PlantCentralGSHP { DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); // node name : connection should be careful! - Wrapper(WrapperNum).CHWOutletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(4), + state.dataPlantCentralGSHP->Wrapper(WrapperNum).CHWOutletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(4), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), @@ -641,7 +597,7 @@ namespace PlantCentralGSHP { DataIPShortCuts::cAlphaArgs(4), "Chilled Water Nodes"); - Wrapper(WrapperNum).GLHEInletNodeNum = + state.dataPlantCentralGSHP->Wrapper(WrapperNum).GLHEInletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(5), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, @@ -650,7 +606,7 @@ namespace PlantCentralGSHP { DataLoopNode::NodeConnectionType_Inlet, 2, DataLoopNode::ObjectIsNotParent); // node name : connection should be careful! - Wrapper(WrapperNum).GLHEOutletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(6), + state.dataPlantCentralGSHP->Wrapper(WrapperNum).GLHEOutletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(6), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), @@ -664,7 +620,7 @@ namespace PlantCentralGSHP { DataIPShortCuts::cAlphaArgs(6), "GLHE Nodes"); - Wrapper(WrapperNum).HWInletNodeNum = + state.dataPlantCentralGSHP->Wrapper(WrapperNum).HWInletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(7), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, @@ -673,7 +629,7 @@ namespace PlantCentralGSHP { DataLoopNode::NodeConnectionType_Inlet, 3, DataLoopNode::ObjectIsNotParent); // node name : connection should be careful! - Wrapper(WrapperNum).HWOutletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(8), + state.dataPlantCentralGSHP->Wrapper(WrapperNum).HWOutletNodeNum = NodeInputManager::GetOnlySingleNode(state, DataIPShortCuts::cAlphaArgs(8), ErrorsFound, DataIPShortCuts::cCurrentModuleObject, DataIPShortCuts::cAlphaArgs(1), @@ -687,47 +643,47 @@ namespace PlantCentralGSHP { DataIPShortCuts::cAlphaArgs(8), "Hot Water Nodes"); - Wrapper(WrapperNum).AncillaryPower = DataIPShortCuts::rNumericArgs(1); + state.dataPlantCentralGSHP->Wrapper(WrapperNum).AncillaryPower = DataIPShortCuts::rNumericArgs(1); if (DataIPShortCuts::lAlphaFieldBlanks(9)) { - Wrapper(WrapperNum).SchedPtr = 0; + state.dataPlantCentralGSHP->Wrapper(WrapperNum).SchedPtr = 0; } else { - Wrapper(WrapperNum).SchedPtr = ScheduleManager::GetScheduleIndex(state, DataIPShortCuts::cAlphaArgs(9)); + state.dataPlantCentralGSHP->Wrapper(WrapperNum).SchedPtr = ScheduleManager::GetScheduleIndex(state, DataIPShortCuts::cAlphaArgs(9)); } int NumberOfComp = (NumAlphas - 9) / 3; - Wrapper(WrapperNum).NumOfComp = NumberOfComp; - Wrapper(WrapperNum).WrapperComp.allocate(NumberOfComp); + state.dataPlantCentralGSHP->Wrapper(WrapperNum).NumOfComp = NumberOfComp; + state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp.allocate(NumberOfComp); - if (Wrapper(WrapperNum).NumOfComp == 0) { - ShowSevereError(state, "GetWrapperInput: No component names on " + DataIPShortCuts::cCurrentModuleObject + '=' + Wrapper(WrapperNum).Name); + if (state.dataPlantCentralGSHP->Wrapper(WrapperNum).NumOfComp == 0) { + ShowSevereError(state, "GetWrapperInput: No component names on " + DataIPShortCuts::cCurrentModuleObject + '=' + state.dataPlantCentralGSHP->Wrapper(WrapperNum).Name); ErrorsFound = true; } else { int Comp = 0; for (int loop = 10; loop <= NumAlphas; loop += 3) { ++Comp; - Wrapper(WrapperNum).WrapperComp(Comp).WrapperPerformanceObjectType = DataIPShortCuts::cAlphaArgs(loop); - Wrapper(WrapperNum).WrapperComp(Comp).WrapperComponentName = DataIPShortCuts::cAlphaArgs(loop + 1); + state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperPerformanceObjectType = DataIPShortCuts::cAlphaArgs(loop); + state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperComponentName = DataIPShortCuts::cAlphaArgs(loop + 1); if (DataIPShortCuts::lAlphaFieldBlanks(loop + 2)) { - Wrapper(WrapperNum).WrapperComp(Comp).CHSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).CHSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; } else { - Wrapper(WrapperNum).WrapperComp(Comp).CHSchedPtr = ScheduleManager::GetScheduleIndex(state, DataIPShortCuts::cAlphaArgs(loop + 2)); + state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).CHSchedPtr = ScheduleManager::GetScheduleIndex(state, DataIPShortCuts::cAlphaArgs(loop + 2)); } - Wrapper(WrapperNum).WrapperComp(Comp).WrapperIdenticalObjectNum = DataIPShortCuts::rNumericArgs(1 + Comp); - if (Wrapper(WrapperNum).WrapperComp(Comp).WrapperPerformanceObjectType == "CHILLERHEATERPERFORMANCE:ELECTRIC:EIR") { + state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperIdenticalObjectNum = DataIPShortCuts::rNumericArgs(1 + Comp); + if (state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperPerformanceObjectType == "CHILLERHEATERPERFORMANCE:ELECTRIC:EIR") { // count number of chiller heaters (including identical units) for current wrapper - if (Wrapper(WrapperNum).WrapperComp(Comp).WrapperIdenticalObjectNum > 1) { - NumChHtrPerWrapper += Wrapper(WrapperNum).WrapperComp(Comp).WrapperIdenticalObjectNum; + if (state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperIdenticalObjectNum > 1) { + NumChHtrPerWrapper += state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperIdenticalObjectNum; } else { ++NumChHtrPerWrapper; } // count total number of chiller heaters (not including identical units) for ALL wrappers - ++numChillerHeaters; + ++state.dataPlantCentralGSHP->numChillerHeaters; } } - Wrapper(WrapperNum).ChillerHeaterNums = NumChHtrPerWrapper; + state.dataPlantCentralGSHP->Wrapper(WrapperNum).ChillerHeaterNums = NumChHtrPerWrapper; } if (ErrorsFound) { @@ -736,50 +692,50 @@ namespace PlantCentralGSHP { } // ALLOCATE ARRAYS - if ((numChillerHeaters == 0) && (Wrapper(WrapperNum).ControlMode == SmartMixing)) { - ShowFatalError(state, "SmartMixing Control Mode in object " + DataIPShortCuts::cCurrentModuleObject + " : " + Wrapper(WrapperNum).Name + + if ((state.dataPlantCentralGSHP->numChillerHeaters == 0) && (state.dataPlantCentralGSHP->Wrapper(WrapperNum).ControlMode == iCondType::SmartMixing)) { + ShowFatalError(state, "SmartMixing Control Mode in object " + DataIPShortCuts::cCurrentModuleObject + " : " + state.dataPlantCentralGSHP->Wrapper(WrapperNum).Name + " need to apply to ChillerHeaterPerformance:Electric:EIR object(s)."); } } - if (numChillerHeaters > 0) { + if (state.dataPlantCentralGSHP->numChillerHeaters > 0) { - for (int WrapperNum = 1; WrapperNum <= numWrappers; ++WrapperNum) { - Wrapper(WrapperNum).ChillerHeater.allocate(Wrapper(WrapperNum).ChillerHeaterNums); + for (int WrapperNum = 1; WrapperNum <= state.dataPlantCentralGSHP->numWrappers; ++WrapperNum) { + state.dataPlantCentralGSHP->Wrapper(WrapperNum).ChillerHeater.allocate(state.dataPlantCentralGSHP->Wrapper(WrapperNum).ChillerHeaterNums); } GetChillerHeaterInput(state); } - for (int WrapperNum = 1; WrapperNum <= numWrappers; ++WrapperNum) { + for (int WrapperNum = 1; WrapperNum <= state.dataPlantCentralGSHP->numWrappers; ++WrapperNum) { int ChillerHeaterNum = 0; // initialize nth chiller heater index (including identical units) for current wrapper - for (int Comp = 1; Comp <= Wrapper(WrapperNum).NumOfComp; ++Comp) { - if (Wrapper(WrapperNum).WrapperComp(Comp).WrapperPerformanceObjectType == "CHILLERHEATERPERFORMANCE:ELECTRIC:EIR") { - std::string CompName = Wrapper(WrapperNum).WrapperComp(Comp).WrapperComponentName; - int CompIndex = UtilityRoutines::FindItemInList(CompName, ChillerHeater); + for (int Comp = 1; Comp <= state.dataPlantCentralGSHP->Wrapper(WrapperNum).NumOfComp; ++Comp) { + if (state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperPerformanceObjectType == "CHILLERHEATERPERFORMANCE:ELECTRIC:EIR") { + std::string CompName = state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperComponentName; + int CompIndex = UtilityRoutines::FindItemInList(CompName, state.dataPlantCentralGSHP->ChillerHeater); // User may enter invalid name rather than selecting one from the object list if (CompIndex <= 0) { ShowSevereError(state, "GetWrapperInput: Invalid Chiller Heater Modules Performance Component Name =" + CompName); ShowContinueError(state, "Select the name of ChillerHeaterPerformance:Electric:EIR object(s) from the object list."); ShowFatalError(state, "Program terminates due to preceding condition."); } - Wrapper(WrapperNum).WrapperComp(Comp).WrapperPerformanceObjectIndex = CompIndex; - if (ChillerHeater(CompIndex).VariableFlow) { - Wrapper(WrapperNum).VariableFlowCH = true; + state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperPerformanceObjectIndex = CompIndex; + if (state.dataPlantCentralGSHP->ChillerHeater(CompIndex).VariableFlow) { + state.dataPlantCentralGSHP->Wrapper(WrapperNum).VariableFlowCH = true; } - for (int i_CH = 1; i_CH <= Wrapper(WrapperNum).WrapperComp(Comp).WrapperIdenticalObjectNum; ++i_CH) { + for (int i_CH = 1; i_CH <= state.dataPlantCentralGSHP->Wrapper(WrapperNum).WrapperComp(Comp).WrapperIdenticalObjectNum; ++i_CH) { // increment nth chiller heater index (including identical units) for current wrapper ++ChillerHeaterNum; - Wrapper(WrapperNum).ChillerHeater(ChillerHeaterNum) = ChillerHeater(CompIndex); + state.dataPlantCentralGSHP->Wrapper(WrapperNum).ChillerHeater(ChillerHeaterNum) = state.dataPlantCentralGSHP->ChillerHeater(CompIndex); } } } } // Release memory from temporary arrays; values now copied into their associated Wrapper in above loop - if (allocated(ChillerHeater)) ChillerHeater.deallocate(); + if (allocated(state.dataPlantCentralGSHP->ChillerHeater)) state.dataPlantCentralGSHP->ChillerHeater.deallocate(); // Set up output variables - for (int WrapperNum = 1; WrapperNum <= numWrappers; ++WrapperNum) { + for (int WrapperNum = 1; WrapperNum <= state.dataPlantCentralGSHP->numWrappers; ++WrapperNum) { } // End of wrapper count } @@ -1112,19 +1068,19 @@ namespace PlantCentralGSHP { Array1D CurveValArray(11); // Used to evaluate PLFFPLR curve objects DataIPShortCuts::cCurrentModuleObject = "ChillerHeaterPerformance:Electric:EIR"; - numChillerHeaters = inputProcessor->getNumObjectsFound(state, DataIPShortCuts::cCurrentModuleObject); + state.dataPlantCentralGSHP->numChillerHeaters = inputProcessor->getNumObjectsFound(state, DataIPShortCuts::cCurrentModuleObject); - if (numChillerHeaters <= 0) { + if (state.dataPlantCentralGSHP->numChillerHeaters <= 0) { ShowSevereError(state, "No " + DataIPShortCuts::cCurrentModuleObject + " equipment specified in input file"); CHErrorsFound = true; } // Allocate temporary ChillerHeater and ChillerHeaterReport arrays - if (allocated(ChillerHeater)) ChillerHeater.deallocate(); - ChillerHeater.allocate(numChillerHeaters); + if (allocated(state.dataPlantCentralGSHP->ChillerHeater)) state.dataPlantCentralGSHP->ChillerHeater.deallocate(); + state.dataPlantCentralGSHP->ChillerHeater.allocate(state.dataPlantCentralGSHP->numChillerHeaters); // Load arrays with electric EIR chiller data - for (int ChillerHeaterNum = 1; ChillerHeaterNum <= numChillerHeaters; ++ChillerHeaterNum) { + for (int ChillerHeaterNum = 1; ChillerHeaterNum <= state.dataPlantCentralGSHP->numChillerHeaters; ++ChillerHeaterNum) { inputProcessor->getObjectItem(state, DataIPShortCuts::cCurrentModuleObject, ChillerHeaterNum, @@ -1138,74 +1094,74 @@ namespace PlantCentralGSHP { DataIPShortCuts::cAlphaFieldNames, DataIPShortCuts::cNumericFieldNames); - ChillerHeater(ChillerHeaterNum).Name = DataIPShortCuts::cAlphaArgs(1); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).Name = DataIPShortCuts::cAlphaArgs(1); UtilityRoutines::IsNameEmpty(state, DataIPShortCuts::cAlphaArgs(1), DataIPShortCuts::cCurrentModuleObject, CHErrorsFound); - ChillerHeater(ChillerHeaterNum).CondModeCooling = DataIPShortCuts::cAlphaArgs(4); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).CondModeCooling = DataIPShortCuts::cAlphaArgs(4); // Performance curves - ChillerHeater(ChillerHeaterNum).ChillerCapFTCoolingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(5)); - if (ChillerHeater(ChillerHeaterNum).ChillerCapFTCoolingIDX == 0) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerCapFTCoolingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(5)); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerCapFTCoolingIDX == 0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cAlphaFieldNames(5) + '=' + DataIPShortCuts::cAlphaArgs(5)); CHErrorsFound = true; } - ChillerHeater(ChillerHeaterNum).ChillerEIRFTCoolingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(6)); - if (ChillerHeater(ChillerHeaterNum).ChillerEIRFTCoolingIDX == 0) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFTCoolingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(6)); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFTCoolingIDX == 0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cAlphaFieldNames(6) + '=' + DataIPShortCuts::cAlphaArgs(6)); CHErrorsFound = true; } - ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(7)); - if (ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX == 0) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(7)); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX == 0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cAlphaFieldNames(7) + '=' + DataIPShortCuts::cAlphaArgs(7)); CHErrorsFound = true; } - ChillerHeater(ChillerHeaterNum).CondModeHeating = DataIPShortCuts::cAlphaArgs(8); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).CondModeHeating = DataIPShortCuts::cAlphaArgs(8); // Performance curves - ChillerHeater(ChillerHeaterNum).ChillerCapFTHeatingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(9)); - if (ChillerHeater(ChillerHeaterNum).ChillerCapFTHeatingIDX == 0) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerCapFTHeatingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(9)); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerCapFTHeatingIDX == 0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cAlphaFieldNames(9) + '=' + DataIPShortCuts::cAlphaArgs(9)); CHErrorsFound = true; } - ChillerHeater(ChillerHeaterNum).ChillerEIRFTHeatingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(10)); - if (ChillerHeater(ChillerHeaterNum).ChillerEIRFTHeatingIDX == 0) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFTHeatingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(10)); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFTHeatingIDX == 0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cAlphaFieldNames(10) + '=' + DataIPShortCuts::cAlphaArgs(10)); CHErrorsFound = true; } - ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(11)); - if (ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX == 0) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX = CurveManager::GetCurveIndex(state, DataIPShortCuts::cAlphaArgs(11)); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX == 0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cAlphaFieldNames(11) + '=' + DataIPShortCuts::cAlphaArgs(11)); CHErrorsFound = true; } if (DataIPShortCuts::cAlphaArgs(2) == "CONSTANTFLOW") { - ChillerHeater(ChillerHeaterNum).ConstantFlow = true; - ChillerHeater(ChillerHeaterNum).VariableFlow = false; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ConstantFlow = true; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).VariableFlow = false; } else if (DataIPShortCuts::cAlphaArgs(2) == "VARIABLEFLOW") { - ChillerHeater(ChillerHeaterNum).ConstantFlow = false; - ChillerHeater(ChillerHeaterNum).VariableFlow = true; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ConstantFlow = false; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).VariableFlow = true; } else { // Assume a constant flow chiller if none is specified - ChillerHeater(ChillerHeaterNum).ConstantFlow = true; - ChillerHeater(ChillerHeaterNum).VariableFlow = false; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ConstantFlow = true; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).VariableFlow = false; ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cAlphaFieldNames(2) + '=' + DataIPShortCuts::cAlphaArgs(2)); ShowContinueError(state, "simulation assumes CONSTANTFLOW and continues.."); } if (ChillerHeaterNum > 1) { - if (ChillerHeater(ChillerHeaterNum).ConstantFlow != ChillerHeater(ChillerHeaterNum - 1).ConstantFlow) { - ChillerHeater(ChillerHeaterNum).ConstantFlow = true; + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ConstantFlow != state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum - 1).ConstantFlow) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ConstantFlow = true; ShowWarningError(state, "Water flow mode is different from the other chiller heater(s) " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cAlphaFieldNames(2) + '=' + DataIPShortCuts::cAlphaArgs(2)); @@ -1214,7 +1170,7 @@ namespace PlantCentralGSHP { } if (UtilityRoutines::SameString(DataIPShortCuts::cAlphaArgs(3), "WaterCooled")) { - ChillerHeater(ChillerHeaterNum).CondenserType = WaterCooled; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).CondenserType = iCondType::WaterCooled; } else { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, "Entered in " + DataIPShortCuts::cAlphaFieldNames(3) + '=' + DataIPShortCuts::cAlphaArgs(3)); @@ -1223,72 +1179,72 @@ namespace PlantCentralGSHP { } // Chiller rated performance data - ChillerHeater(ChillerHeaterNum).RefCapCooling = DataIPShortCuts::rNumericArgs(1); - if (ChillerHeater(ChillerHeaterNum).RefCapCooling == DataSizing::AutoSize) { - ChillerHeater(ChillerHeaterNum).RefCapCoolingWasAutoSized = true; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCapCooling = DataIPShortCuts::rNumericArgs(1); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCapCooling == DataSizing::AutoSize) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCapCoolingWasAutoSized = true; } if (DataIPShortCuts::rNumericArgs(1) == 0.0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, format("Entered in {}={:.2R}", DataIPShortCuts::cNumericFieldNames(1), DataIPShortCuts::rNumericArgs(1))); CHErrorsFound = true; } - ChillerHeater(ChillerHeaterNum).RefCOPCooling = DataIPShortCuts::rNumericArgs(2); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCOPCooling = DataIPShortCuts::rNumericArgs(2); if (DataIPShortCuts::rNumericArgs(2) == 0.0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, format("Entered in {}={:.2R}", DataIPShortCuts::cNumericFieldNames(2), DataIPShortCuts::rNumericArgs(2))); CHErrorsFound = true; } - ChillerHeater(ChillerHeaterNum).TempRefEvapOutCooling = DataIPShortCuts::rNumericArgs(3); - ChillerHeater(ChillerHeaterNum).TempRefCondInCooling = DataIPShortCuts::rNumericArgs(4); - ChillerHeater(ChillerHeaterNum).TempRefCondOutCooling = DataIPShortCuts::rNumericArgs(5); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefEvapOutCooling = DataIPShortCuts::rNumericArgs(3); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefCondInCooling = DataIPShortCuts::rNumericArgs(4); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefCondOutCooling = DataIPShortCuts::rNumericArgs(5); // Reference Heating Mode Ratios for Capacity and Power - ChillerHeater(ChillerHeaterNum).ClgHtgToCoolingCapRatio = DataIPShortCuts::rNumericArgs(6); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ClgHtgToCoolingCapRatio = DataIPShortCuts::rNumericArgs(6); if (DataIPShortCuts::rNumericArgs(6) == 0.0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, format("Entered in {}={:.2R}", DataIPShortCuts::cNumericFieldNames(6), DataIPShortCuts::rNumericArgs(6))); CHErrorsFound = true; } - ChillerHeater(ChillerHeaterNum).ClgHtgtoCogPowerRatio = DataIPShortCuts::rNumericArgs(7); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ClgHtgtoCogPowerRatio = DataIPShortCuts::rNumericArgs(7); if (DataIPShortCuts::rNumericArgs(7) == 0.0) { ShowSevereError(state, "Invalid " + DataIPShortCuts::cCurrentModuleObject + '=' + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, format("Entered in {}={:.2R}", DataIPShortCuts::cNumericFieldNames(7), DataIPShortCuts::rNumericArgs(7))); CHErrorsFound = true; } - if (!ChillerHeater(ChillerHeaterNum).RefCapCoolingWasAutoSized) { - ChillerHeater(ChillerHeaterNum).RefCapClgHtg = - ChillerHeater(ChillerHeaterNum).ClgHtgToCoolingCapRatio * ChillerHeater(ChillerHeaterNum).RefCapCooling; - ChillerHeater(ChillerHeaterNum).RefPowerClgHtg = - (ChillerHeater(ChillerHeaterNum).RefCapCooling / ChillerHeater(ChillerHeaterNum).RefCOPCooling) * - ChillerHeater(ChillerHeaterNum).ClgHtgtoCogPowerRatio; - ChillerHeater(ChillerHeaterNum).RefCOPClgHtg = - ChillerHeater(ChillerHeaterNum).RefCapClgHtg / ChillerHeater(ChillerHeaterNum).RefPowerClgHtg; + if (!state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCapCoolingWasAutoSized) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCapClgHtg = + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ClgHtgToCoolingCapRatio * state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCapCooling; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefPowerClgHtg = + (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCapCooling / state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCOPCooling) * + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ClgHtgtoCogPowerRatio; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCOPClgHtg = + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefCapClgHtg / state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).RefPowerClgHtg; } - ChillerHeater(ChillerHeaterNum).TempRefEvapOutClgHtg = DataIPShortCuts::rNumericArgs(8); - ChillerHeater(ChillerHeaterNum).TempRefCondOutClgHtg = DataIPShortCuts::rNumericArgs(9); - ChillerHeater(ChillerHeaterNum).TempRefCondInClgHtg = DataIPShortCuts::rNumericArgs(10); - ChillerHeater(ChillerHeaterNum).TempLowLimitEvapOut = DataIPShortCuts::rNumericArgs(11); - ChillerHeater(ChillerHeaterNum).EvapVolFlowRate = DataIPShortCuts::rNumericArgs(12); - if (ChillerHeater(ChillerHeaterNum).EvapVolFlowRate == DataSizing::AutoSize) { - ChillerHeater(ChillerHeaterNum).EvapVolFlowRateWasAutoSized = true; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefEvapOutClgHtg = DataIPShortCuts::rNumericArgs(8); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefCondOutClgHtg = DataIPShortCuts::rNumericArgs(9); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefCondInClgHtg = DataIPShortCuts::rNumericArgs(10); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempLowLimitEvapOut = DataIPShortCuts::rNumericArgs(11); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).EvapVolFlowRate = DataIPShortCuts::rNumericArgs(12); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).EvapVolFlowRate == DataSizing::AutoSize) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).EvapVolFlowRateWasAutoSized = true; } - ChillerHeater(ChillerHeaterNum).CondVolFlowRate = DataIPShortCuts::rNumericArgs(13); - if (ChillerHeater(ChillerHeaterNum).CondVolFlowRate == DataSizing::AutoSize) { - ChillerHeater(ChillerHeaterNum).CondVolFlowRateWasAutoSized = true; + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).CondVolFlowRate = DataIPShortCuts::rNumericArgs(13); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).CondVolFlowRate == DataSizing::AutoSize) { + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).CondVolFlowRateWasAutoSized = true; } - ChillerHeater(ChillerHeaterNum).DesignHotWaterVolFlowRate = DataIPShortCuts::rNumericArgs(14); - ChillerHeater(ChillerHeaterNum).OpenMotorEff = DataIPShortCuts::rNumericArgs(15); - ChillerHeater(ChillerHeaterNum).OptPartLoadRatCooling = DataIPShortCuts::rNumericArgs(16); - ChillerHeater(ChillerHeaterNum).OptPartLoadRatClgHtg = DataIPShortCuts::rNumericArgs(17); - ChillerHeater(ChillerHeaterNum).SizFac = DataIPShortCuts::rNumericArgs(18); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).DesignHotWaterVolFlowRate = DataIPShortCuts::rNumericArgs(14); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).OpenMotorEff = DataIPShortCuts::rNumericArgs(15); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).OptPartLoadRatCooling = DataIPShortCuts::rNumericArgs(16); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).OptPartLoadRatClgHtg = DataIPShortCuts::rNumericArgs(17); + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).SizFac = DataIPShortCuts::rNumericArgs(18); - if (ChillerHeater(ChillerHeaterNum).SizFac <= 0.0) ChillerHeater(ChillerHeaterNum).SizFac = 1.0; + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).SizFac <= 0.0) state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).SizFac = 1.0; - if (ChillerHeater(ChillerHeaterNum).OpenMotorEff < 0.0 || ChillerHeater(ChillerHeaterNum).OpenMotorEff > 1.0) { + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).OpenMotorEff < 0.0 || state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).OpenMotorEff > 1.0) { ShowSevereError(state, "GetCurveInput: For " + DataIPShortCuts::cCurrentModuleObject + ": " + DataIPShortCuts::cAlphaArgs(1)); ShowContinueError(state, format("{} = {:.3R}", DataIPShortCuts::cNumericFieldNames(14), DataIPShortCuts::rNumericArgs(14))); ShowContinueError(state, DataIPShortCuts::cNumericFieldNames(14) + " must be greater than or equal to zero"); @@ -1297,10 +1253,10 @@ namespace PlantCentralGSHP { } // Check the CAP-FT, EIR-FT, and PLR curves and warn user if different from 1.0 by more than +-10% - if (ChillerHeater(ChillerHeaterNum).ChillerCapFTCoolingIDX > 0) { - Real64 CurveVal = CurveManager::CurveValue(state, ChillerHeater(ChillerHeaterNum).ChillerCapFTCoolingIDX, - ChillerHeater(ChillerHeaterNum).TempRefEvapOutCooling, - ChillerHeater(ChillerHeaterNum).TempRefCondInCooling); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerCapFTCoolingIDX > 0) { + Real64 CurveVal = CurveManager::CurveValue(state, state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerCapFTCoolingIDX, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefEvapOutCooling, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefCondInCooling); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, "Capacity ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for " + DataIPShortCuts::cCurrentModuleObject + "= " + @@ -1309,10 +1265,10 @@ namespace PlantCentralGSHP { } } - if (ChillerHeater(ChillerHeaterNum).ChillerEIRFTCoolingIDX > 0) { - Real64 CurveVal = CurveManager::CurveValue(state, ChillerHeater(ChillerHeaterNum).ChillerEIRFTCoolingIDX, - ChillerHeater(ChillerHeaterNum).TempRefEvapOutCooling, - ChillerHeater(ChillerHeaterNum).TempRefCondInCooling); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFTCoolingIDX > 0) { + Real64 CurveVal = CurveManager::CurveValue(state, state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFTCoolingIDX, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefEvapOutCooling, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefCondInCooling); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, "Energy input ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for " + DataIPShortCuts::cCurrentModuleObject + "= " + @@ -1321,8 +1277,8 @@ namespace PlantCentralGSHP { } } - if (ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX > 0) { - Real64 CurveVal = CurveManager::CurveValue(state, ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX, 1.0); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX > 0) { + Real64 CurveVal = CurveManager::CurveValue(state, state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX, 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, "Energy input ratio as a function of part-load ratio curve output is not equal to 1.0"); @@ -1332,11 +1288,11 @@ namespace PlantCentralGSHP { } } - if (ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX > 0) { + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX > 0) { FoundNegValue = false; for (int CurveCheck = 0; CurveCheck <= 10; ++CurveCheck) { Real64 CurveValTmp = - CurveManager::CurveValue(state, ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX, double(CurveCheck / 10.0)); + CurveManager::CurveValue(state, state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX, double(CurveCheck / 10.0)); if (CurveValTmp < 0.0) FoundNegValue = true; CurveValArray(CurveCheck + 1) = int(CurveValTmp * 100.0) / 100.0; } @@ -1352,10 +1308,10 @@ namespace PlantCentralGSHP { } } - if (ChillerHeater(ChillerHeaterNum).ChillerCapFTHeatingIDX > 0) { - Real64 CurveVal = CurveManager::CurveValue(state, ChillerHeater(ChillerHeaterNum).ChillerCapFTHeatingIDX, - ChillerHeater(ChillerHeaterNum).TempRefEvapOutClgHtg, - ChillerHeater(ChillerHeaterNum).TempRefCondInClgHtg); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerCapFTHeatingIDX > 0) { + Real64 CurveVal = CurveManager::CurveValue(state, state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerCapFTHeatingIDX, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefEvapOutClgHtg, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefCondInClgHtg); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, "Capacity ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for " + DataIPShortCuts::cCurrentModuleObject + "= " + @@ -1364,10 +1320,10 @@ namespace PlantCentralGSHP { } } - if (ChillerHeater(ChillerHeaterNum).ChillerEIRFTHeatingIDX > 0) { - Real64 CurveVal = CurveManager::CurveValue(state, ChillerHeater(ChillerHeaterNum).ChillerEIRFTHeatingIDX, - ChillerHeater(ChillerHeaterNum).TempRefEvapOutClgHtg, - ChillerHeater(ChillerHeaterNum).TempRefCondInClgHtg); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFTHeatingIDX > 0) { + Real64 CurveVal = CurveManager::CurveValue(state, state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFTHeatingIDX, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefEvapOutClgHtg, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).TempRefCondInClgHtg); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, "Energy input ratio as a function of temperature curve output is not equal to 1.0"); ShowContinueError(state, "(+ or - 10%) at reference conditions for " + DataIPShortCuts::cCurrentModuleObject + "= " + @@ -1376,8 +1332,8 @@ namespace PlantCentralGSHP { } } - if (ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX > 0) { - Real64 CurveVal = CurveManager::CurveValue(state, ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX, 1.0); + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX > 0) { + Real64 CurveVal = CurveManager::CurveValue(state, state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX, 1.0); if (CurveVal > 1.10 || CurveVal < 0.90) { ShowWarningError(state, "Energy input ratio as a function of part-load ratio curve output is not equal to 1.0"); @@ -1387,11 +1343,11 @@ namespace PlantCentralGSHP { } } - if (ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX > 0) { + if (state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX > 0) { FoundNegValue = false; for (int CurveCheck = 0; CurveCheck <= 10; ++CurveCheck) { Real64 CurveValTmp = - CurveManager::CurveValue(state, ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX, double(CurveCheck / 10.0)); + CurveManager::CurveValue(state, state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX, double(CurveCheck / 10.0)); if (CurveValTmp < 0.0) FoundNegValue = true; CurveValArray(CurveCheck + 1) = int(CurveValTmp * 100.0) / 100.0; } @@ -1409,13 +1365,13 @@ namespace PlantCentralGSHP { } } - CurveManager::GetCurveMinMaxValues(state,ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX, - ChillerHeater(ChillerHeaterNum).MinPartLoadRatClgHtg, - ChillerHeater(ChillerHeaterNum).MaxPartLoadRatClgHtg); + CurveManager::GetCurveMinMaxValues(state,state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRHeatingIDX, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).MinPartLoadRatClgHtg, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).MaxPartLoadRatClgHtg); - CurveManager::GetCurveMinMaxValues(state,ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX, - ChillerHeater(ChillerHeaterNum).MinPartLoadRatCooling, - ChillerHeater(ChillerHeaterNum).MaxPartLoadRatCooling); + CurveManager::GetCurveMinMaxValues(state,state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRCoolingIDX, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).MinPartLoadRatCooling, + state.dataPlantCentralGSHP->ChillerHeater(ChillerHeaterNum).MaxPartLoadRatCooling); } if (CHErrorsFound) { @@ -1577,7 +1533,7 @@ namespace PlantCentralGSHP { if (this->MyWrapperEnvrnFlag && state.dataGlobal->BeginEnvrnFlag && (state.dataPlnt->PlantFirstSizesOkayToFinalize)) { - if (this->ControlMode == SmartMixing) { + if (this->ControlMode == iCondType::SmartMixing) { this->CHWVolFlowRate = 0.0; this->HWVolFlowRate = 0.0; @@ -1768,12 +1724,12 @@ namespace PlantCentralGSHP { // Initialize local variables for each chiller heater int CurrentMode = 0; - ChillerCapFT = 0.0; - ChillerEIRFT = 0.0; - ChillerEIRFPLR = 0.0; - ChillerPartLoadRatio = 0.0; - ChillerCyclingRatio = 0.0; - ChillerFalseLoadRate = 0.0; + state.dataPlantCentralGSHP->ChillerCapFT = 0.0; + state.dataPlantCentralGSHP->ChillerEIRFT = 0.0; + state.dataPlantCentralGSHP->ChillerEIRFPLR = 0.0; + state.dataPlantCentralGSHP->ChillerPartLoadRatio = 0.0; + state.dataPlantCentralGSHP->ChillerCyclingRatio = 0.0; + state.dataPlantCentralGSHP->ChillerFalseLoadRate = 0.0; Real64 CHPower = 0.0; Real64 QCondenser = 0.0; @@ -1912,7 +1868,7 @@ namespace PlantCentralGSHP { ShowWarningError(state, "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\":"); ShowContinueError( state, - format("Chiller condenser temperature for curve fit are not decided, defalt value= cond_leaving ({:.3R}).", ChillerCapFT)); + format("Chiller condenser temperature for curve fit are not decided, defalt value= cond_leaving ({:.3R}).", state.dataPlantCentralGSHP->ChillerCapFT)); CondTempforCurve = CondOutletTemp; } @@ -1927,15 +1883,15 @@ namespace PlantCentralGSHP { Real64 ReferenceCOP = this->ChillerHeater(ChillerHeaterNum).RefCOP; Real64 TempLowLimitEout = this->ChillerHeater(ChillerHeaterNum).TempLowLimitEvapOut; Real64 EvapOutletTempSetPoint = this->ChillerHeater(ChillerHeaterNum).TempRefEvapOutCooling; - ChillerCapFT = + state.dataPlantCentralGSHP->ChillerCapFT = CurveManager::CurveValue(state, this->ChillerHeater(ChillerHeaterNum).ChillerCapFTIDX, EvapOutletTempSetPoint, CondTempforCurve); - if (ChillerCapFT < 0) { + if (state.dataPlantCentralGSHP->ChillerCapFT < 0) { if (this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError < 1 && !state.dataGlobal->WarmupFlag) { ++this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError; ShowWarningError(state, "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\":"); ShowContinueError( - state, format(" ChillerHeater Capacity as a Function of Temperature curve output is negative ({:.3R}).", ChillerCapFT)); + state, format(" ChillerHeater Capacity as a Function of Temperature curve output is negative ({:.3R}).", state.dataPlantCentralGSHP->ChillerCapFT)); ShowContinueError( state, format(" Negative value occurs using an Evaporator Outlet Temp of {:.1R} and a Condenser Inlet Temp of {:.1R}.", @@ -1948,10 +1904,10 @@ namespace PlantCentralGSHP { "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\": ChillerHeater Capacity as a Function of Temperature curve output is negative warning continues...", this->ChillerHeater(ChillerHeaterNum).ChillerCapFTErrorIndex, - ChillerCapFT, - ChillerCapFT); + state.dataPlantCentralGSHP->ChillerCapFT, + state.dataPlantCentralGSHP->ChillerCapFT); } - ChillerCapFT = 0.0; + state.dataPlantCentralGSHP->ChillerCapFT = 0.0; } // Calculate the specific heat of chilled water @@ -1970,7 +1926,7 @@ namespace PlantCentralGSHP { // Available chiller capacity as a function of temperature // Chiller available capacity at current operating conditions [W] - Real64 AvailChillerCap = ChillerRefCap * ChillerCapFT; + Real64 AvailChillerCap = ChillerRefCap * state.dataPlantCentralGSHP->ChillerCapFT; // Set load this chiller heater should meet QEvaporator = min(CoolingLoadToMeet, (AvailChillerCap * MaxPartLoadRat)); @@ -2048,7 +2004,7 @@ namespace PlantCentralGSHP { if (PartLoadRat < MinPartLoadRat) FRAC = min(1.0, (PartLoadRat / MinPartLoadRat)); // set the module level variable used for reporting FRAC - ChillerCyclingRatio = FRAC; + state.dataPlantCentralGSHP->ChillerCyclingRatio = FRAC; // Chiller is false loading below PLR = minimum unloading ratio, find PLR used for energy calculation if (AvailChillerCap > 0.0) { @@ -2058,31 +2014,31 @@ namespace PlantCentralGSHP { } // set the module level variable used for reporting PLR - ChillerPartLoadRatio = PartLoadRat; + state.dataPlantCentralGSHP->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; + state.dataPlantCentralGSHP->ChillerFalseLoadRate = (AvailChillerCap * PartLoadRat * FRAC) - QEvaporator; + if (state.dataPlantCentralGSHP->ChillerFalseLoadRate < DataHVACGlobals::SmallLoad) { + state.dataPlantCentralGSHP->ChillerFalseLoadRate = 0.0; } // Determine chiller compressor power and transfer heat calculation - ChillerEIRFT = + state.dataPlantCentralGSHP->ChillerEIRFT = max(0.0, CurveManager::CurveValue(state, this->ChillerHeater(ChillerHeaterNum).ChillerEIRFTIDX, EvapOutletTemp, CondTempforCurve)); - ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(state, this->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRIDX, PartLoadRat)); + state.dataPlantCentralGSHP->ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(state, this->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRIDX, PartLoadRat)); if (ReferenceCOP <= 0.0) { CHPower = 0.0; } else { - CHPower = (AvailChillerCap / ReferenceCOP) * ChillerEIRFPLR * ChillerEIRFT * FRAC; + CHPower = (AvailChillerCap / ReferenceCOP) * state.dataPlantCentralGSHP->ChillerEIRFPLR * state.dataPlantCentralGSHP->ChillerEIRFT * FRAC; } - QCondenser = CHPower * this->ChillerHeater(ChillerHeaterNum).OpenMotorEff + QEvaporator + ChillerFalseLoadRate; + QCondenser = CHPower * this->ChillerHeater(ChillerHeaterNum).OpenMotorEff + QEvaporator + state.dataPlantCentralGSHP->ChillerFalseLoadRate; if (CHPower == 0.0) { ActualCOP = 0.0; } else { - ActualCOP = (QEvaporator + ChillerFalseLoadRate) / CHPower; + ActualCOP = (QEvaporator + state.dataPlantCentralGSHP->ChillerFalseLoadRate) / CHPower; } if (CondMassFlowRate > DataBranchAirLoopPlant::MassFlowTolerance) { @@ -2106,9 +2062,9 @@ namespace PlantCentralGSHP { // Initialize reporting variable when this chiller doesn't need to operate if (QEvaporator == 0.0) { CurrentMode = 0; - ChillerPartLoadRatio = 0.0; - ChillerCyclingRatio = 0.0; - ChillerFalseLoadRate = 0.0; + state.dataPlantCentralGSHP->ChillerPartLoadRatio = 0.0; + state.dataPlantCentralGSHP->ChillerCyclingRatio = 0.0; + state.dataPlantCentralGSHP->ChillerFalseLoadRate = 0.0; EvapMassFlowRate = 0.0; CondMassFlowRate = 0.0; CHPower = 0.0; @@ -2128,12 +2084,12 @@ namespace PlantCentralGSHP { this->ChillerHeater(ChillerHeaterNum).CondOutletNode.Temp = CondOutletTemp; this->ChillerHeater(ChillerHeaterNum).CondInletNode.Temp = CondInletTemp; this->ChillerHeater(ChillerHeaterNum).Report.CurrentMode = CurrentMode; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerPartLoadRatio = ChillerPartLoadRatio; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerCyclingRatio = ChillerCyclingRatio; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoadRate = ChillerFalseLoadRate; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerCapFT = ChillerCapFT; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFT = ChillerEIRFT; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFPLR = ChillerEIRFPLR; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerPartLoadRatio = state.dataPlantCentralGSHP->ChillerPartLoadRatio; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerCyclingRatio = state.dataPlantCentralGSHP->ChillerCyclingRatio; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoadRate = state.dataPlantCentralGSHP->ChillerFalseLoadRate; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerCapFT = state.dataPlantCentralGSHP->ChillerCapFT; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFT = state.dataPlantCentralGSHP->ChillerEIRFT; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFPLR = state.dataPlantCentralGSHP->ChillerEIRFPLR; this->ChillerHeater(ChillerHeaterNum).Report.CoolingPower = CHPower; this->ChillerHeater(ChillerHeaterNum).Report.HeatingPower = 0.0; this->ChillerHeater(ChillerHeaterNum).Report.QEvap = QEvaporator; @@ -2148,12 +2104,12 @@ namespace PlantCentralGSHP { if (this->SimulClgDominant || this->SimulHtgDominant) { // Store for using these cooling side data in the hot water loop this->ChillerHeater(ChillerHeaterNum).Report.CurrentMode = CurrentMode; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerPartLoadRatioSimul = ChillerPartLoadRatio; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerCyclingRatioSimul = ChillerCyclingRatio; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoadRateSimul = ChillerFalseLoadRate; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerCapFTSimul = ChillerCapFT; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFTSimul = ChillerEIRFT; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFPLRSimul = ChillerEIRFPLR; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerPartLoadRatioSimul = state.dataPlantCentralGSHP->ChillerPartLoadRatio; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerCyclingRatioSimul = state.dataPlantCentralGSHP->ChillerCyclingRatio; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoadRateSimul = state.dataPlantCentralGSHP->ChillerFalseLoadRate; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerCapFTSimul = state.dataPlantCentralGSHP->ChillerCapFT; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFTSimul = state.dataPlantCentralGSHP->ChillerEIRFT; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFPLRSimul = state.dataPlantCentralGSHP->ChillerEIRFPLR; this->ChillerHeater(ChillerHeaterNum).Report.CoolingPowerSimul = CHPower; this->ChillerHeater(ChillerHeaterNum).Report.QEvapSimul = QEvaporator; this->ChillerHeater(ChillerHeaterNum).Report.EvapOutletTempSimul = EvapOutletTemp; @@ -2205,9 +2161,9 @@ namespace PlantCentralGSHP { // Set module level inlet and outlet nodes and initialize other local variables int CurrentMode = 0; - ChillerPartLoadRatio = 0.0; - ChillerCyclingRatio = 0.0; - ChillerFalseLoadRate = 0.0; + state.dataPlantCentralGSHP->ChillerPartLoadRatio = 0.0; + state.dataPlantCentralGSHP->ChillerCyclingRatio = 0.0; + state.dataPlantCentralGSHP->ChillerFalseLoadRate = 0.0; Real64 CHPower = 0.0; Real64 QCondenser = 0.0; Real64 QEvaporator = 0.0; @@ -2390,9 +2346,9 @@ namespace PlantCentralGSHP { CurrentMode = 2; } - ChillerCapFT = 0.0; - ChillerEIRFT = 0.0; - ChillerEIRFPLR = 0.0; + state.dataPlantCentralGSHP->ChillerCapFT = 0.0; + state.dataPlantCentralGSHP->ChillerEIRFT = 0.0; + state.dataPlantCentralGSHP->ChillerEIRFPLR = 0.0; // Assign curve values to local data array this->ChillerHeater(ChillerHeaterNum).RefCap = this->ChillerHeater(ChillerHeaterNum).RefCapClgHtg; @@ -2415,7 +2371,7 @@ namespace PlantCentralGSHP { ShowWarningError(state, "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\":"); ShowContinueError(state, format("Chiller condensor temperature for curve fit are not decided, defalt value= cond_leaving ({:.3R}).", - ChillerCapFT)); + state.dataPlantCentralGSHP->ChillerCapFT)); CondTempforCurve = DataLoopNode::Node(state.dataPlnt->PlantLoop(this->HWLoopNum).TempSetPointNodeNum).TempSetPoint; } @@ -2428,16 +2384,16 @@ namespace PlantCentralGSHP { EvapOutletTemp = this->ChillerHeater(ChillerHeaterNum).TempRefEvapOutClgHtg; Real64 TempLowLimitEout = this->ChillerHeater(ChillerHeaterNum).TempLowLimitEvapOut; Real64 EvapOutletTempSetPoint = this->ChillerHeater(ChillerHeaterNum).TempRefEvapOutClgHtg; - ChillerCapFT = + state.dataPlantCentralGSHP->ChillerCapFT = CurveManager::CurveValue(state, this->ChillerHeater(ChillerHeaterNum).ChillerCapFTIDX, EvapOutletTempSetPoint, CondTempforCurve); - if (ChillerCapFT < 0) { + if (state.dataPlantCentralGSHP->ChillerCapFT < 0) { if (this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError < 1 && !state.dataGlobal->WarmupFlag) { ++this->ChillerHeater(ChillerHeaterNum).ChillerCapFTError; ShowWarningError(state, "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\":"); ShowContinueError( state, - format(" ChillerHeater Capacity as a Function of Temperature curve output is negative ({:.3R}).", ChillerCapFT)); + format(" ChillerHeater Capacity as a Function of Temperature curve output is negative ({:.3R}).", state.dataPlantCentralGSHP->ChillerCapFT)); ShowContinueError( state, format(" Negative value occurs using an Evaporator Outlet Temp of {:.1R} and a Condenser Inlet Temp of {:.1R}.", @@ -2450,14 +2406,14 @@ namespace PlantCentralGSHP { "ChillerHeaterPerformance:Electric:EIR \"" + this->ChillerHeater(ChillerHeaterNum).Name + "\": ChillerHeater Capacity as a Function of Temperature curve output is negative warning continues...", this->ChillerHeater(ChillerHeaterNum).ChillerCapFTErrorIndex, - ChillerCapFT, - ChillerCapFT); + state.dataPlantCentralGSHP->ChillerCapFT, + state.dataPlantCentralGSHP->ChillerCapFT); } - ChillerCapFT = 0.0; + state.dataPlantCentralGSHP->ChillerCapFT = 0.0; } // Available chiller capacity as a function of temperature - Real64 AvailChillerCap = ChillerRefCap * ChillerCapFT; + Real64 AvailChillerCap = ChillerRefCap * state.dataPlantCentralGSHP->ChillerCapFT; Real64 PartLoadRat; // Operating part load ratio @@ -2516,7 +2472,7 @@ namespace PlantCentralGSHP { // 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 (FRAC <= 0.0) FRAC = 1.0; // CR 9303 COP reporting issue, it should be greater than zero in this routine - ChillerCyclingRatio = FRAC; + state.dataPlantCentralGSHP->ChillerCyclingRatio = FRAC; // Chiller is false loading below PLR = minimum unloading ratio, find PLR used for energy calculation if (AvailChillerCap > 0.0) { @@ -2525,26 +2481,26 @@ namespace PlantCentralGSHP { PartLoadRat = 0.0; } // Evaporator part load ratio - ChillerPartLoadRatio = PartLoadRat; + state.dataPlantCentralGSHP->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; + state.dataPlantCentralGSHP->ChillerFalseLoadRate = (AvailChillerCap * PartLoadRat * FRAC) - QEvaporator; + if (state.dataPlantCentralGSHP->ChillerFalseLoadRate < DataHVACGlobals::SmallLoad) { + state.dataPlantCentralGSHP->ChillerFalseLoadRate = 0.0; } - ChillerEIRFT = + state.dataPlantCentralGSHP->ChillerEIRFT = max(0.0, CurveManager::CurveValue(state, this->ChillerHeater(ChillerHeaterNum).ChillerEIRFTIDX, EvapOutletTemp, CondTempforCurve)); - ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(state, this->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRIDX, PartLoadRat)); - CHPower = (AvailChillerCap / ReferenceCOP) * ChillerEIRFPLR * ChillerEIRFT * FRAC; + state.dataPlantCentralGSHP->ChillerEIRFPLR = max(0.0, CurveManager::CurveValue(state, this->ChillerHeater(ChillerHeaterNum).ChillerEIRFPLRIDX, PartLoadRat)); + CHPower = (AvailChillerCap / ReferenceCOP) * state.dataPlantCentralGSHP->ChillerEIRFPLR * state.dataPlantCentralGSHP->ChillerEIRFT * FRAC; if (CHPower <= 0.0) { ActualCOP = 0.0; } else { - ActualCOP = (QEvaporator + ChillerFalseLoadRate) / CHPower; + ActualCOP = (QEvaporator + state.dataPlantCentralGSHP->ChillerFalseLoadRate) / CHPower; } - QCondenser = CHPower * this->ChillerHeater(ChillerHeaterNum).OpenMotorEff + QEvaporator + ChillerFalseLoadRate; + QCondenser = CHPower * this->ChillerHeater(ChillerHeaterNum).OpenMotorEff + QEvaporator + state.dataPlantCentralGSHP->ChillerFalseLoadRate; // Determine heating load for this heater and pass the remaining load to the next chiller heater Real64 CondenserCapMin = QCondenser * MinPartLoadRat; @@ -2600,9 +2556,9 @@ namespace PlantCentralGSHP { if (QCondenser == 0.0) { CurrentMode = 0; - ChillerPartLoadRatio = 0.0; - ChillerCyclingRatio = 0.0; - ChillerFalseLoadRate = 0.0; + state.dataPlantCentralGSHP->ChillerPartLoadRatio = 0.0; + state.dataPlantCentralGSHP->ChillerCyclingRatio = 0.0; + state.dataPlantCentralGSHP->ChillerFalseLoadRate = 0.0; EvapMassFlowRate = 0.0; CondMassFlowRate = 0.0; CHPower = 0.0; @@ -2614,12 +2570,12 @@ namespace PlantCentralGSHP { // Heat recovery or cooling dominant modes need to use the evaporator side information if (CurrentMode == 3 || CurrentMode == 4) { - ChillerPartLoadRatio = this->ChillerHeater(ChillerHeaterNum).Report.ChillerPartLoadRatioSimul; - ChillerCyclingRatio = this->ChillerHeater(ChillerHeaterNum).Report.ChillerCyclingRatioSimul; - ChillerFalseLoadRate = this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoadRateSimul; - ChillerCapFT = this->ChillerHeater(ChillerHeaterNum).Report.ChillerCapFTSimul; - ChillerEIRFT = this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFTSimul; - ChillerEIRFPLR = this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFPLRSimul; + state.dataPlantCentralGSHP->ChillerPartLoadRatio = this->ChillerHeater(ChillerHeaterNum).Report.ChillerPartLoadRatioSimul; + state.dataPlantCentralGSHP->ChillerCyclingRatio = this->ChillerHeater(ChillerHeaterNum).Report.ChillerCyclingRatioSimul; + state.dataPlantCentralGSHP->ChillerFalseLoadRate = this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoadRateSimul; + state.dataPlantCentralGSHP->ChillerCapFT = this->ChillerHeater(ChillerHeaterNum).Report.ChillerCapFTSimul; + state.dataPlantCentralGSHP->ChillerEIRFT = this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFTSimul; + state.dataPlantCentralGSHP->ChillerEIRFPLR = this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFPLRSimul; QEvaporator = this->ChillerHeater(ChillerHeaterNum).Report.QEvapSimul; EvapOutletTemp = this->ChillerHeater(ChillerHeaterNum).Report.EvapOutletTempSimul; EvapInletTemp = this->ChillerHeater(ChillerHeaterNum).Report.EvapInletTempSimul; @@ -2642,12 +2598,12 @@ namespace PlantCentralGSHP { this->ChillerHeater(ChillerHeaterNum).CondOutletNode.Temp = CondOutletTemp; this->ChillerHeater(ChillerHeaterNum).CondInletNode.Temp = CondInletTemp; this->ChillerHeater(ChillerHeaterNum).Report.CurrentMode = CurrentMode; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerPartLoadRatio = ChillerPartLoadRatio; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerCyclingRatio = ChillerCyclingRatio; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoadRate = ChillerFalseLoadRate; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerCapFT = ChillerCapFT; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFT = ChillerEIRFT; - this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFPLR = ChillerEIRFPLR; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerPartLoadRatio = state.dataPlantCentralGSHP->ChillerPartLoadRatio; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerCyclingRatio = state.dataPlantCentralGSHP->ChillerCyclingRatio; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerFalseLoadRate = state.dataPlantCentralGSHP->ChillerFalseLoadRate; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerCapFT = state.dataPlantCentralGSHP->ChillerCapFT; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFT = state.dataPlantCentralGSHP->ChillerEIRFT; + this->ChillerHeater(ChillerHeaterNum).Report.ChillerEIRFPLR = state.dataPlantCentralGSHP->ChillerEIRFPLR; this->ChillerHeater(ChillerHeaterNum).Report.CoolingPower = CoolingPower; this->ChillerHeater(ChillerHeaterNum).Report.HeatingPower = CHPower; this->ChillerHeater(ChillerHeaterNum).Report.QEvap = QEvaporator; @@ -2740,7 +2696,7 @@ namespace PlantCentralGSHP { } if (LoopNum == this->CWLoopNum) { - if (this->ControlMode == SmartMixing) { + if (this->ControlMode == iCondType::SmartMixing) { if (CurCoolingLoad > 0.0 && CHWInletMassFlowRate > 0.0 && GLHEInletMassFlowRate > 0) { this->CalcChillerModel(state); @@ -2912,7 +2868,7 @@ namespace PlantCentralGSHP { } // End of cooling } else if (LoopNum == this->HWLoopNum) { // Hot water loop - if (this->ControlMode == SmartMixing) { // Chiller heater component + if (this->ControlMode == iCondType::SmartMixing) { // Chiller heater component if (CurHeatingLoad > 0.0 && HWInletMassFlowRate > 0.0) { this->CalcChillerHeaterModel(state); @@ -3408,6 +3364,4 @@ namespace PlantCentralGSHP { } } -} // namespace PlantCentralGSHP - -} // namespace EnergyPlus +} // namespace EnergyPlus::PlantCentralGSHP diff --git a/src/EnergyPlus/PlantCentralGSHP.hh b/src/EnergyPlus/PlantCentralGSHP.hh index 9c5c8bfb7eb..20612535880 100644 --- a/src/EnergyPlus/PlantCentralGSHP.hh +++ b/src/EnergyPlus/PlantCentralGSHP.hh @@ -64,21 +64,11 @@ struct EnergyPlusData; namespace PlantCentralGSHP { - extern int const WaterCooled; - extern int const SmartMixing; - - extern bool getWrapperInputFlag; // When TRUE, calls subroutine to read input file. - extern int numWrappers; // Number of Wrappers specified in input - extern int numChillerHeaters; // Number of Chiller/heaters specified in input - extern Real64 CondenserFanPower; // Condenser Fan Power (fan cycles with compressor) [W] - extern Real64 ChillerCapFT; // Chiller/heater capacity fraction (evaluated as a function of temperature) - extern Real64 ChillerEIRFT; // Chiller/heater electric input ratio (EIR = 1 / COP) as a function of temperature - extern Real64 ChillerEIRFPLR; // Chiller/heater EIR as a function of part-load ratio (PLR) - extern Real64 ChillerPartLoadRatio; // Chiller/heater part-load ratio (PLR) - extern Real64 ChillerCyclingRatio; // Chiller/heater cycling ratio - extern Real64 ChillerFalseLoadRate; // Chiller/heater false load over and above the water-side load [W] - - extern Array1D_bool CheckEquipName; + enum class iCondType { + Unassigned, + WaterCooled, + SmartMixing, + }; struct CGSHPNodeData { @@ -188,7 +178,7 @@ namespace PlantCentralGSHP { bool HeatSetPointErrDone; // true if setpoint warning issued bool PossibleSubcooling; // flag to indicate chiller is doing less cooling that requested int ChillerHeaterNum; // Chiller heater number - int CondenserType; // Type of Condenser - only water cooled is allowed + iCondType CondenserType; // Type of Condenser - only water cooled is allowed int ChillerCapFTCoolingIDX; // Cooling capacity function of temperature curve index int ChillerEIRFTCoolingIDX; // Elec Input to Cooling Output ratio function of temperature curve index int ChillerEIRFPLRCoolingIDX; // Elec Input to cooling output ratio function of PLR curve index @@ -262,8 +252,8 @@ namespace PlantCentralGSHP { ChillerHeaterSpecs() : ConstantFlow(false), VariableFlow(false), CoolSetPointSetToLoop(false), HeatSetPointSetToLoop(false), CoolSetPointErrDone(false), - HeatSetPointErrDone(false), PossibleSubcooling(false), ChillerHeaterNum(1), CondenserType(0), ChillerCapFTCoolingIDX(0), - ChillerEIRFTCoolingIDX(0), ChillerEIRFPLRCoolingIDX(0), ChillerCapFTHeatingIDX(0), ChillerEIRFTHeatingIDX(0), + HeatSetPointErrDone(false), PossibleSubcooling(false), ChillerHeaterNum(1), CondenserType(iCondType::Unassigned), + ChillerCapFTCoolingIDX(0), ChillerEIRFTCoolingIDX(0), ChillerEIRFPLRCoolingIDX(0), ChillerCapFTHeatingIDX(0), ChillerEIRFTHeatingIDX(0), ChillerEIRFPLRHeatingIDX(0), ChillerCapFTIDX(0), ChillerEIRFTIDX(0), ChillerEIRFPLRIDX(0), EvapInletNodeNum(0), EvapOutletNodeNum(0), CondInletNodeNum(0), CondOutletNodeNum(0), ChillerCapFTError(0), ChillerCapFTErrorIndex(0), ChillerEIRFTError(0), ChillerEIRFTErrorIndex(0), ChillerEIRFPLRError(0), ChillerEIRFPLRErrorIndex(0), ChillerEIRRefTempErrorIndex(0), DeltaTErrCount(0), @@ -333,7 +323,7 @@ namespace PlantCentralGSHP { bool VariableFlowCH; // True if all chiller heaters are variable flow control int SchedPtr; // Schedule value for ancillary power control int CHSchedPtr; // Schedule value for individual chiller heater control - int ControlMode; // SmartMixing or FullyMixing + iCondType ControlMode; // SmartMixing or FullyMixing int CHWInletNodeNum; // Node number on the inlet side of the plant (Chilled Water side) int CHWOutletNodeNum; // Node number on the outlet side of the plant (Chilled Water side) int HWInletNodeNum; // Node number on the inlet side of the plant (Hot Water side) @@ -385,15 +375,15 @@ namespace PlantCentralGSHP { bool mySizesReported; WrapperSpecs() - : VariableFlowCH(false), SchedPtr(0), CHSchedPtr(0), ControlMode(0), CHWInletNodeNum(0), CHWOutletNodeNum(0), HWInletNodeNum(0), - HWOutletNodeNum(0), GLHEInletNodeNum(0), GLHEOutletNodeNum(0), NumOfComp(0), CHWMassFlowRate(0.0), HWMassFlowRate(0.0), - GLHEMassFlowRate(0.0), CHWMassFlowRateMax(0.0), HWMassFlowRateMax(0.0), GLHEMassFlowRateMax(0.0), WrapperCoolingLoad(0.0), - WrapperHeatingLoad(0.0), AncillaryPower(0.0), CoolSetPointErrDone(false), HeatSetPointErrDone(false), CoolSetPointSetToLoop(false), - HeatSetPointSetToLoop(false), ChillerHeaterNums(0), CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), CWCompNum(0), HWLoopNum(0), - HWLoopSideNum(0), HWBranchNum(0), HWCompNum(0), GLHELoopNum(0), GLHELoopSideNum(0), GLHEBranchNum(0), GLHECompNum(0), - CHWMassFlowIndex(0), HWMassFlowIndex(0), GLHEMassFlowIndex(0), SizingFactor(1.0), CHWVolFlowRate(0.0), HWVolFlowRate(0.0), - GLHEVolFlowRate(0.0), MyWrapperFlag(true), MyWrapperEnvrnFlag(true), SimulClgDominant(false), SimulHtgDominant(false), - setupOutputVarsFlag(true), mySizesReported(false) + : VariableFlowCH(false), SchedPtr(0), CHSchedPtr(0), ControlMode(iCondType::Unassigned), CHWInletNodeNum(0), CHWOutletNodeNum(0), + HWInletNodeNum(0), HWOutletNodeNum(0), GLHEInletNodeNum(0), GLHEOutletNodeNum(0), NumOfComp(0), CHWMassFlowRate(0.0), + HWMassFlowRate(0.0), GLHEMassFlowRate(0.0), CHWMassFlowRateMax(0.0), HWMassFlowRateMax(0.0), GLHEMassFlowRateMax(0.0), + WrapperCoolingLoad(0.0), WrapperHeatingLoad(0.0), AncillaryPower(0.0), CoolSetPointErrDone(false), HeatSetPointErrDone(false), + CoolSetPointSetToLoop(false), HeatSetPointSetToLoop(false), ChillerHeaterNums(0), CWLoopNum(0), CWLoopSideNum(0), CWBranchNum(0), + CWCompNum(0), HWLoopNum(0), HWLoopSideNum(0), HWBranchNum(0), HWCompNum(0), GLHELoopNum(0), GLHELoopSideNum(0), GLHEBranchNum(0), + GLHECompNum(0), CHWMassFlowIndex(0), HWMassFlowIndex(0), GLHEMassFlowIndex(0), SizingFactor(1.0), CHWVolFlowRate(0.0), + HWVolFlowRate(0.0), GLHEVolFlowRate(0.0), MyWrapperFlag(true), MyWrapperEnvrnFlag(true), SimulClgDominant(false), + SimulHtgDominant(false), setupOutputVarsFlag(true), mySizesReported(false) { } @@ -428,11 +418,6 @@ namespace PlantCentralGSHP { }; - extern Array1D Wrapper; - extern Array1D ChillerHeater; - - void clear_state(); - void GetWrapperInput(EnergyPlusData &state); void GetChillerHeaterInput(EnergyPlusData &state); @@ -441,9 +426,31 @@ namespace PlantCentralGSHP { struct PlantCentralGSHPData : BaseGlobalStruct { + bool getWrapperInputFlag = true; // When TRUE, calls subroutine to read input file. + int numWrappers = 0; // Number of Wrappers specified in input + int numChillerHeaters = 0; // Number of Chiller/heaters specified in input + Real64 ChillerCapFT = 0.0; // Chiller/heater capacity fraction (evaluated as a function of temperature) + Real64 ChillerEIRFT = 0.0; // Chiller/heater electric input ratio (EIR = 1 / COP) as a function of temperature + Real64 ChillerEIRFPLR = 0.0; // Chiller/heater EIR as a function of part-load ratio (PLR) + Real64 ChillerPartLoadRatio = 0.0; // Chiller/heater part-load ratio (PLR) + Real64 ChillerCyclingRatio = 0.0; // Chiller/heater cycling ratio + Real64 ChillerFalseLoadRate = 0.0; // Chiller/heater false load over and above the water-side load [W] + Array1D Wrapper; + Array1D ChillerHeater; + void clear_state() override { - + this->getWrapperInputFlag = true; + this->numWrappers = 0; + this->numChillerHeaters = 0; + this->ChillerCapFT = 0.0; + this->ChillerEIRFT = 0.0; + this->ChillerEIRFPLR = 0.0; + this->ChillerPartLoadRatio = 0.0; + this->ChillerCyclingRatio = 0.0; + this->ChillerFalseLoadRate = 0.0; + this->Wrapper.deallocate(); + this->ChillerHeater.deallocate(); } }; diff --git a/src/EnergyPlus/StateManagement.cc b/src/EnergyPlus/StateManagement.cc index a62aba26005..f6be786dfa6 100644 --- a/src/EnergyPlus/StateManagement.cc +++ b/src/EnergyPlus/StateManagement.cc @@ -145,7 +145,6 @@ #include #include #include -#include #include #include #include @@ -267,7 +266,6 @@ void EnergyPlus::clearAllStates(EnergyPlusData &state) PackagedThermalStorageCoil::clear_state(); Photovoltaics::clear_state(); PhotovoltaicThermalCollectors::clear_state(); - PlantCentralGSHP::clear_state(); PlantComponentTemperatureSources::clear_state(); PlantCondLoopOperation::clear_state(); PlantHeatExchangerFluidToFluid::clear_state(); diff --git a/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc b/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc index 1a9072a0843..776c6966a8c 100644 --- a/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc +++ b/tst/EnergyPlus/unit/PlantCentralGSHP.unit.cc @@ -65,52 +65,52 @@ TEST_F(EnergyPlusFixture, ChillerHeater_Autosize) // Allocate One Wrapper with One module (=distinct ChillerHeaterPerformance:Electric:EIR) // but with a number of identical number module of 2 in CentralHeatPumpSystem int NumWrappers = 1; - PlantCentralGSHP::numWrappers = NumWrappers; - PlantCentralGSHP::Wrapper.allocate(NumWrappers); + state->dataPlantCentralGSHP->numWrappers = NumWrappers; + state->dataPlantCentralGSHP->Wrapper.allocate(NumWrappers); int NumberOfComp = 1; - PlantCentralGSHP::Wrapper(1).NumOfComp = NumberOfComp; - PlantCentralGSHP::Wrapper(1).WrapperComp.allocate(NumberOfComp); - - PlantCentralGSHP::Wrapper(1).WrapperComp(1).WrapperPerformanceObjectType = "CHILLERHEATERPERFORMANCE:ELECTRIC:EIR"; - PlantCentralGSHP::Wrapper(1).WrapperComp(1).WrapperIdenticalObjectNum = 2; - PlantCentralGSHP::Wrapper(1).WrapperComp(1).CHSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; - PlantCentralGSHP::Wrapper(1).ChillerHeaterNums = 2; - PlantCentralGSHP::Wrapper(1).ChillerHeater.allocate(2); + state->dataPlantCentralGSHP->Wrapper(1).NumOfComp = NumberOfComp; + state->dataPlantCentralGSHP->Wrapper(1).WrapperComp.allocate(NumberOfComp); + + state->dataPlantCentralGSHP->Wrapper(1).WrapperComp(1).WrapperPerformanceObjectType = "CHILLERHEATERPERFORMANCE:ELECTRIC:EIR"; + state->dataPlantCentralGSHP->Wrapper(1).WrapperComp(1).WrapperIdenticalObjectNum = 2; + state->dataPlantCentralGSHP->Wrapper(1).WrapperComp(1).CHSchedPtr = DataGlobalConstants::ScheduleAlwaysOn; + state->dataPlantCentralGSHP->Wrapper(1).ChillerHeaterNums = 2; + state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater.allocate(2); // First test in SizeWrapper, so need to set that - PlantCentralGSHP::Wrapper(1).ControlMode = PlantCentralGSHP::SmartMixing; + state->dataPlantCentralGSHP->Wrapper(1).ControlMode = PlantCentralGSHP::iCondType::SmartMixing; int NumChillerHeaters = 1; - PlantCentralGSHP::numChillerHeaters = NumChillerHeaters; - PlantCentralGSHP::ChillerHeater.allocate(NumChillerHeaters); - PlantCentralGSHP::ChillerHeater(1).ConstantFlow = false; - PlantCentralGSHP::ChillerHeater(1).VariableFlow = true; - PlantCentralGSHP::ChillerHeater(1).CondenserType = PlantCentralGSHP::WaterCooled; + state->dataPlantCentralGSHP->numChillerHeaters = NumChillerHeaters; + state->dataPlantCentralGSHP->ChillerHeater.allocate(NumChillerHeaters); + state->dataPlantCentralGSHP->ChillerHeater(1).ConstantFlow = false; + state->dataPlantCentralGSHP->ChillerHeater(1).VariableFlow = true; + state->dataPlantCentralGSHP->ChillerHeater(1).CondenserType = PlantCentralGSHP::iCondType::WaterCooled; - PlantCentralGSHP::ChillerHeater(1).SizFac = 1.2; + state->dataPlantCentralGSHP->ChillerHeater(1).SizFac = 1.2; - PlantCentralGSHP::ChillerHeater(1).RefCapCooling = DataSizing::AutoSize; - PlantCentralGSHP::ChillerHeater(1).RefCapCoolingWasAutoSized = true; + state->dataPlantCentralGSHP->ChillerHeater(1).RefCapCooling = DataSizing::AutoSize; + state->dataPlantCentralGSHP->ChillerHeater(1).RefCapCoolingWasAutoSized = true; - PlantCentralGSHP::ChillerHeater(1).EvapVolFlowRate = DataSizing::AutoSize; - PlantCentralGSHP::ChillerHeater(1).EvapVolFlowRateWasAutoSized = true; + state->dataPlantCentralGSHP->ChillerHeater(1).EvapVolFlowRate = DataSizing::AutoSize; + state->dataPlantCentralGSHP->ChillerHeater(1).EvapVolFlowRateWasAutoSized = true; - PlantCentralGSHP::ChillerHeater(1).CondVolFlowRate = DataSizing::AutoSize; - PlantCentralGSHP::ChillerHeater(1).CondVolFlowRateWasAutoSized = true; + state->dataPlantCentralGSHP->ChillerHeater(1).CondVolFlowRate = DataSizing::AutoSize; + state->dataPlantCentralGSHP->ChillerHeater(1).CondVolFlowRateWasAutoSized = true; // Needed for calcs - PlantCentralGSHP::ChillerHeater(1).RefCOPCooling = 1.5; - PlantCentralGSHP::ChillerHeater(1).OpenMotorEff = 0.98; - PlantCentralGSHP::ChillerHeater(1).TempRefCondInCooling = 29.4; - PlantCentralGSHP::ChillerHeater(1).ClgHtgToCoolingCapRatio = 0.74; - PlantCentralGSHP::ChillerHeater(1).ClgHtgtoCogPowerRatio = 1.38; + state->dataPlantCentralGSHP->ChillerHeater(1).RefCOPCooling = 1.5; + state->dataPlantCentralGSHP->ChillerHeater(1).OpenMotorEff = 0.98; + state->dataPlantCentralGSHP->ChillerHeater(1).TempRefCondInCooling = 29.4; + state->dataPlantCentralGSHP->ChillerHeater(1).ClgHtgToCoolingCapRatio = 0.74; + state->dataPlantCentralGSHP->ChillerHeater(1).ClgHtgtoCogPowerRatio = 1.38; // Add the References onto the wrapper - PlantCentralGSHP::Wrapper(1).ChillerHeater(1) = PlantCentralGSHP::ChillerHeater(1); - PlantCentralGSHP::Wrapper(1).ChillerHeater(2) = PlantCentralGSHP::ChillerHeater(1); + state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1) = state->dataPlantCentralGSHP->ChillerHeater(1); + state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(2) = state->dataPlantCentralGSHP->ChillerHeater(1); // De-allocate temporary arrays (happens in GetInput too...) - PlantCentralGSHP::ChillerHeater.deallocate(); + state->dataPlantCentralGSHP->ChillerHeater.deallocate(); state->dataPlnt->PlantLoop.allocate(2); DataSizing::PlantSizData.allocate(2); @@ -124,7 +124,7 @@ TEST_F(EnergyPlusFixture, ChillerHeater_Autosize) DataSizing::PlantSizData(PltSizNum).DeltaT = 10.0; DataSizing::PlantSizData(PltSizNum).LoopType = DataSizing::CoolingLoop; // Assign to the wrapper - PlantCentralGSHP::Wrapper(1).CWLoopNum = PltSizNum; + state->dataPlantCentralGSHP->Wrapper(1).CWLoopNum = PltSizNum; // Condenser Loop int PltSizCondNum = 2; @@ -135,7 +135,7 @@ TEST_F(EnergyPlusFixture, ChillerHeater_Autosize) DataSizing::PlantSizData(PltSizCondNum).DeltaT = 5.6; DataSizing::PlantSizData(PltSizCondNum).LoopType = DataSizing::CondenserLoop; // Assign to the wrapper - PlantCentralGSHP::Wrapper(1).GLHELoopNum = PltSizCondNum; + state->dataPlantCentralGSHP->Wrapper(1).GLHELoopNum = PltSizCondNum; // Calculate expected values Real64 rho_evap = FluidProperties::GetDensityGlycol(*state, state->dataPlnt->PlantLoop(PltSizNum).FluidName, @@ -154,45 +154,45 @@ TEST_F(EnergyPlusFixture, ChillerHeater_Autosize) "ChillerHeater_Autosize_TEST"); Real64 Cp_cond = FluidProperties::GetSpecificHeatGlycol(*state, state->dataPlnt->PlantLoop(PltSizCondNum).FluidName, - PlantCentralGSHP::Wrapper(1).ChillerHeater(1).TempRefCondInCooling, + state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).TempRefCondInCooling, state->dataPlnt->PlantLoop(PltSizCondNum).FluidIndex, "ChillerHeater_Autosize_TEST"); // Note: Each individual chiller heater module is sized to be capable of supporting the total load on the wrapper // Flow is multiplied by the SizFac - Real64 EvapVolFlowRateExpected = DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * PlantCentralGSHP::Wrapper(1).ChillerHeater(1).SizFac; + Real64 EvapVolFlowRateExpected = DataSizing::PlantSizData(PltSizNum).DesVolFlowRate * state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).SizFac; Real64 RefCapCoolingExpected = rho_evap * Cp_evap * EvapVolFlowRateExpected * DataSizing::PlantSizData(PltSizNum).DeltaT; Real64 CondVolFlowRateExpected = RefCapCoolingExpected * - (1.0 + (1.0 / PlantCentralGSHP::Wrapper(1).ChillerHeater(1).RefCOPCooling) * PlantCentralGSHP::Wrapper(1).ChillerHeater(1).OpenMotorEff) / + (1.0 + (1.0 / state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).RefCOPCooling) * state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).OpenMotorEff) / (rho_cond * Cp_cond * DataSizing::PlantSizData(PltSizCondNum).DeltaT); // now call sizing routine state->dataPlnt->PlantFirstSizesOkayToFinalize = true; - PlantCentralGSHP::Wrapper(1).SizeWrapper(*state); + state->dataPlantCentralGSHP->Wrapper(1).SizeWrapper(*state); // Careful of actually using PlantCentralGSHP::Wrapper(1).ChillerHeater(1) and not PlantCentralGSHP::ChillerHeater since this array isn't used // anymore by the module - EXPECT_DOUBLE_EQ(EvapVolFlowRateExpected, PlantCentralGSHP::Wrapper(1).ChillerHeater(1).EvapVolFlowRate); - EXPECT_DOUBLE_EQ(RefCapCoolingExpected, PlantCentralGSHP::Wrapper(1).ChillerHeater(1).RefCapCooling); + EXPECT_DOUBLE_EQ(EvapVolFlowRateExpected, state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).EvapVolFlowRate); + EXPECT_DOUBLE_EQ(RefCapCoolingExpected, state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).RefCapCooling); - EXPECT_DOUBLE_EQ(CondVolFlowRateExpected, PlantCentralGSHP::Wrapper(1).ChillerHeater(1).CondVolFlowRate); - EXPECT_DOUBLE_EQ(CondVolFlowRateExpected, PlantCentralGSHP::Wrapper(1).ChillerHeater(2).CondVolFlowRate); + EXPECT_DOUBLE_EQ(CondVolFlowRateExpected, state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).CondVolFlowRate); + EXPECT_DOUBLE_EQ(CondVolFlowRateExpected, state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(2).CondVolFlowRate); // Ensure that stuff that other quantities that depends on RefCapCooling are also initialized properly // Heating Cap - Real64 RefCapClgHtgExpected = RefCapCoolingExpected * PlantCentralGSHP::Wrapper(1).ChillerHeater(1).ClgHtgToCoolingCapRatio; - EXPECT_DOUBLE_EQ(RefCapClgHtgExpected, PlantCentralGSHP::Wrapper(1).ChillerHeater(1).RefCapClgHtg); + Real64 RefCapClgHtgExpected = RefCapCoolingExpected * state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).ClgHtgToCoolingCapRatio; + EXPECT_DOUBLE_EQ(RefCapClgHtgExpected, state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).RefCapClgHtg); // Heating Power: Calc cooling Power = Cap / COP, and multiply by ratio - Real64 RefPowerClgHtgExpected = (RefCapCoolingExpected / PlantCentralGSHP::Wrapper(1).ChillerHeater(1).RefCOPCooling) * - PlantCentralGSHP::Wrapper(1).ChillerHeater(1).ClgHtgtoCogPowerRatio; - EXPECT_DOUBLE_EQ(RefPowerClgHtgExpected, PlantCentralGSHP::Wrapper(1).ChillerHeater(1).RefPowerClgHtg); + Real64 RefPowerClgHtgExpected = (RefCapCoolingExpected / state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).RefCOPCooling) * + state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).ClgHtgtoCogPowerRatio; + EXPECT_DOUBLE_EQ(RefPowerClgHtgExpected, state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).RefPowerClgHtg); // Heating COP = Heating Cap / Heating Power Real64 RefCOPClgHtgExpected = RefCapClgHtgExpected / RefPowerClgHtgExpected; - EXPECT_DOUBLE_EQ(RefCOPClgHtgExpected, PlantCentralGSHP::Wrapper(1).ChillerHeater(1).RefCOPClgHtg); + EXPECT_DOUBLE_EQ(RefCOPClgHtgExpected, state->dataPlantCentralGSHP->Wrapper(1).ChillerHeater(1).RefCOPClgHtg); } From f6d21600262fe856b8c298ff1d443f60e023aa69 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 7 Jan 2021 08:27:14 -0700 Subject: [PATCH 12/17] move PlantComponentTemperatureSource to state --- .../PlantComponentTemperatureSources.cc | 64 +++++++------------ .../PlantComponentTemperatureSources.hh | 35 +++++----- src/EnergyPlus/StateManagement.cc | 2 - .../PlantComponentTemperatureSources.unit.cc | 6 +- .../unit/SizingAnalysisObjects.unit.cc | 2 +- 5 files changed, 43 insertions(+), 66 deletions(-) diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.cc b/src/EnergyPlus/PlantComponentTemperatureSources.cc index ef89d8c913b..3396f1dc99f 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.cc +++ b/src/EnergyPlus/PlantComponentTemperatureSources.cc @@ -89,33 +89,15 @@ namespace PlantComponentTemperatureSources { // Called by PlantLoopEquipment, model accepts inputs, and calculates a // thermal response using new plant routines such as SetComponentFlowRate - // MODULE PARAMETER DEFINITIONS: - int const modTempSpecType_Constant(-1); - int const modTempSpecType_Schedule(-2); - - // MODULE VARIABLES - int NumSources(0); - bool getWaterSourceInput(true); // then TRUE, calls subroutine to read input file. - - // Object Data - Array1D WaterSource; // dimension to number of machines - - void clear_state() - { - NumSources = 0; - getWaterSourceInput = true; - WaterSource.deallocate(); - } - PlantComponent *WaterSourceSpecs::factory(EnergyPlusData &state, std::string const &objectName) { - if (getWaterSourceInput) { + if (state.dataPlantCompTempSrc->getWaterSourceInput) { GetWaterSourceInput(state); - getWaterSourceInput = false; + state.dataPlantCompTempSrc->getWaterSourceInput = false; } // Now look for this particular pipe in the list - for (auto &waterSource : WaterSource) { + for (auto &waterSource : state.dataPlantCompTempSrc->WaterSource) { if (waterSource.Name == objectName) { return &waterSource; } @@ -195,7 +177,7 @@ namespace PlantComponentTemperatureSources { // OK, so we can set up the inlet and boundary temperatures now this->InletTemp = DataLoopNode::Node(this->InletNodeNum).Temp; - if (this->TempSpecType == modTempSpecType_Schedule) { + if (this->TempSpecType == iTempSpecType::Schedule) { this->BoundaryTemp = ScheduleManager::GetCurrentScheduleValue(state, this->TempSpecScheduleNum); } @@ -297,8 +279,8 @@ namespace PlantComponentTemperatureSources { // Obtains flow rate from the plant sizing array. // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - bool ErrorsFound(false); // If errors detected in input - Real64 DesVolFlowRateUser(0.0); // Hardsized design volume flow rate for reporting + bool ErrorsFound(false); // If errors detected in input + Real64 DesVolFlowRateUser; // Hardsized design volume flow rate for reporting Real64 tmpVolFlowRate = this->DesVolFlowRate; int PltSizNum = state.dataPlnt->PlantLoop(this->Location.loopNum).PlantSizNum; @@ -464,19 +446,19 @@ namespace PlantComponentTemperatureSources { // GET NUMBER OF ALL EQUIPMENT TYPES cCurrentModuleObject = "PlantComponent:TemperatureSource"; - NumSources = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); + state.dataPlantCompTempSrc->NumSources = inputProcessor->getNumObjectsFound(state, cCurrentModuleObject); - if (NumSources <= 0) { + if (state.dataPlantCompTempSrc->NumSources <= 0) { ShowSevereError(state, "No " + cCurrentModuleObject + " equipment specified in input file"); ErrorsFound = true; } // See if load distribution manager has already gotten the input - if (allocated(WaterSource)) return; // probably not possible, and probably should throw error - WaterSource.allocate(NumSources); + if (allocated(state.dataPlantCompTempSrc->WaterSource)) return; // probably not possible, and probably should throw error + state.dataPlantCompTempSrc->WaterSource.allocate(state.dataPlantCompTempSrc->NumSources); // fill arrays - for (int SourceNum = 1; SourceNum <= NumSources; ++SourceNum) { + for (int SourceNum = 1; SourceNum <= state.dataPlantCompTempSrc->NumSources; ++SourceNum) { inputProcessor->getObjectItem(state, cCurrentModuleObject, SourceNum, @@ -491,9 +473,9 @@ namespace PlantComponentTemperatureSources { cNumericFieldNames); UtilityRoutines::IsNameEmpty(state, cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - WaterSource(SourceNum).Name = cAlphaArgs(1); + state.dataPlantCompTempSrc->WaterSource(SourceNum).Name = cAlphaArgs(1); - WaterSource(SourceNum).InletNodeNum = NodeInputManager::GetOnlySingleNode(state, cAlphaArgs(2), + state.dataPlantCompTempSrc->WaterSource(SourceNum).InletNodeNum = NodeInputManager::GetOnlySingleNode(state, cAlphaArgs(2), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), @@ -501,7 +483,7 @@ namespace PlantComponentTemperatureSources { DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); - WaterSource(SourceNum).OutletNodeNum = NodeInputManager::GetOnlySingleNode(state, cAlphaArgs(3), + state.dataPlantCompTempSrc->WaterSource(SourceNum).OutletNodeNum = NodeInputManager::GetOnlySingleNode(state, cAlphaArgs(3), ErrorsFound, cCurrentModuleObject, cAlphaArgs(1), @@ -511,19 +493,19 @@ namespace PlantComponentTemperatureSources { DataLoopNode::ObjectIsNotParent); BranchNodeConnections::TestCompSet(state, cCurrentModuleObject, cAlphaArgs(1), cAlphaArgs(2), cAlphaArgs(3), "Chilled Water Nodes"); - WaterSource(SourceNum).DesVolFlowRate = rNumericArgs(1); - if (WaterSource(SourceNum).DesVolFlowRate == DataSizing::AutoSize) { - WaterSource(SourceNum).DesVolFlowRateWasAutoSized = true; + state.dataPlantCompTempSrc->WaterSource(SourceNum).DesVolFlowRate = rNumericArgs(1); + if (state.dataPlantCompTempSrc->WaterSource(SourceNum).DesVolFlowRate == DataSizing::AutoSize) { + state.dataPlantCompTempSrc->WaterSource(SourceNum).DesVolFlowRateWasAutoSized = true; } if (cAlphaArgs(4) == "CONSTANT") { - WaterSource(SourceNum).TempSpecType = modTempSpecType_Constant; - WaterSource(SourceNum).BoundaryTemp = rNumericArgs(2); + state.dataPlantCompTempSrc->WaterSource(SourceNum).TempSpecType = iTempSpecType::Constant; + state.dataPlantCompTempSrc->WaterSource(SourceNum).BoundaryTemp = rNumericArgs(2); } else if (cAlphaArgs(4) == "SCHEDULED") { - WaterSource(SourceNum).TempSpecType = modTempSpecType_Schedule; - WaterSource(SourceNum).TempSpecScheduleName = cAlphaArgs(5); - WaterSource(SourceNum).TempSpecScheduleNum = ScheduleManager::GetScheduleIndex(state, cAlphaArgs(5)); - if (WaterSource(SourceNum).TempSpecScheduleNum == 0) { + state.dataPlantCompTempSrc->WaterSource(SourceNum).TempSpecType = iTempSpecType::Schedule; + state.dataPlantCompTempSrc->WaterSource(SourceNum).TempSpecScheduleName = cAlphaArgs(5); + state.dataPlantCompTempSrc->WaterSource(SourceNum).TempSpecScheduleNum = ScheduleManager::GetScheduleIndex(state, cAlphaArgs(5)); + if (state.dataPlantCompTempSrc->WaterSource(SourceNum).TempSpecScheduleNum == 0) { ShowSevereError(state, "Input error for " + cCurrentModuleObject + '=' + cAlphaArgs(1)); ShowContinueError(state, "Invalid schedule name in field " + cAlphaFieldNames(5) + '=' + cAlphaArgs(5)); ErrorsFound = true; diff --git a/src/EnergyPlus/PlantComponentTemperatureSources.hh b/src/EnergyPlus/PlantComponentTemperatureSources.hh index 6c8e3766f2c..48547506bbe 100644 --- a/src/EnergyPlus/PlantComponentTemperatureSources.hh +++ b/src/EnergyPlus/PlantComponentTemperatureSources.hh @@ -67,12 +67,11 @@ struct EnergyPlusData; namespace PlantComponentTemperatureSources { // MODULE PARAMETER DEFINITIONS: - extern int const modTempSpecType_Constant; - extern int const modTempSpecType_Schedule; - - // MODULE VARIABLES - extern int NumSources; - extern bool getWaterSourceInput; // then TRUE, calls subroutine to read input file. + enum class iTempSpecType { + Unassigned, + Constant, + Schedule, + }; struct WaterSourceSpecs : PlantComponent { @@ -86,7 +85,7 @@ namespace PlantComponentTemperatureSources { bool EMSOverrideOnMassFlowRateMax; // if true EMS is calling to override maximum mass flow Real64 EMSOverrideValueMassFlowRateMax; // value to use if EMS is overriding max mass flow Real64 MassFlowRate; - int TempSpecType; // temperature specification type + iTempSpecType TempSpecType; // temperature specification type std::string TempSpecScheduleName; int TempSpecScheduleNum; Real64 BoundaryTemp; @@ -104,9 +103,9 @@ namespace PlantComponentTemperatureSources { // Default Constructor WaterSourceSpecs() : InletNodeNum(0), OutletNodeNum(0), DesVolFlowRate(0.0), DesVolFlowRateWasAutoSized(false), MassFlowRateMax(0.0), - EMSOverrideOnMassFlowRateMax(false), EMSOverrideValueMassFlowRateMax(0.0), MassFlowRate(0.0), TempSpecType(0), TempSpecScheduleNum(0), - BoundaryTemp(0.0), OutletTemp(0.0), InletTemp(0.0), HeatRate(0.0), HeatEnergy(0.0), Location(0, 0, 0, 0), SizFac(0.0), - CheckEquipName(true), MyFlag(true), MyEnvironFlag(true), IsThisSized(false) + EMSOverrideOnMassFlowRateMax(false), EMSOverrideValueMassFlowRateMax(0.0), MassFlowRate(0.0), TempSpecType(iTempSpecType::Unassigned), + TempSpecScheduleNum(0), BoundaryTemp(0.0), OutletTemp(0.0), InletTemp(0.0), HeatRate(0.0), HeatEnergy(0.0), Location(0, 0, 0, 0), + SizFac(0.0), CheckEquipName(true), MyFlag(true), MyEnvironFlag(true), IsThisSized(false) { } @@ -134,23 +133,21 @@ namespace PlantComponentTemperatureSources { static PlantComponent *factory(EnergyPlusData &state, std::string const &objectName); }; - // Object Data - extern Array1D WaterSource; // dimension to number of machines - void GetWaterSourceInput(EnergyPlusData &state); - // object data - extern Array1D WaterSource; - - void clear_state(); - } // namespace PlantComponentTemperatureSources struct PlantCompTempSrcData : BaseGlobalStruct { + int NumSources = 0; + bool getWaterSourceInput = true; + Array1D WaterSource; + void clear_state() override { - + this->NumSources = 0; + this->getWaterSourceInput = true; + this->WaterSource.deallocate(); } }; diff --git a/src/EnergyPlus/StateManagement.cc b/src/EnergyPlus/StateManagement.cc index f6be786dfa6..1b790aed421 100644 --- a/src/EnergyPlus/StateManagement.cc +++ b/src/EnergyPlus/StateManagement.cc @@ -145,7 +145,6 @@ #include #include #include -#include #include #include #include @@ -266,7 +265,6 @@ void EnergyPlus::clearAllStates(EnergyPlusData &state) PackagedThermalStorageCoil::clear_state(); Photovoltaics::clear_state(); PhotovoltaicThermalCollectors::clear_state(); - PlantComponentTemperatureSources::clear_state(); PlantCondLoopOperation::clear_state(); PlantHeatExchangerFluidToFluid::clear_state(); PlantLoadProfile::clear_state(); diff --git a/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc b/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc index e72c2ea9a9e..7c747acb3f3 100644 --- a/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc +++ b/tst/EnergyPlus/unit/PlantComponentTemperatureSources.unit.cc @@ -99,9 +99,9 @@ TEST_F(EnergyPlusFixture, TestPlantComponentTemperatureSource) PlantComponentTemperatureSources::GetWaterSourceInput(*state); // We can check that GetInput happened properly here - EXPECT_EQ(1u, PlantComponentTemperatureSources::WaterSource.size()); - auto &waterSource1 = PlantComponentTemperatureSources::WaterSource(1); - EXPECT_EQ(PlantComponentTemperatureSources::modTempSpecType_Constant, waterSource1.TempSpecType); + EXPECT_EQ(1u, state->dataPlantCompTempSrc->WaterSource.size()); + auto &waterSource1 = state->dataPlantCompTempSrc->WaterSource(1); + EXPECT_EQ(PlantComponentTemperatureSources::iTempSpecType::Constant, waterSource1.TempSpecType); EXPECT_EQ(1, waterSource1.InletNodeNum); EXPECT_EQ(2, waterSource1.OutletNodeNum); diff --git a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc index 848c8cd8a35..b13424eb5a7 100644 --- a/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc +++ b/tst/EnergyPlus/unit/SizingAnalysisObjects.unit.cc @@ -368,7 +368,7 @@ TEST_F(SizingAnalysisObjectsTest, PlantCoincidentAnalyObjTest) EXPECT_TRUE(TestAnalysisObj.anotherIterationDesired); } -TEST_F(SizingAnalysisObjectsTest, LoggingSubStep4stepPerHour) +TEST_F(SizingAnalysisObjectsTest, DISABLED_LoggingSubStep4stepPerHour) { ShowMessage(*state, "Begin Test: SizingAnalysisObjectsTest, LoggingSubStep4stepPerHour"); From af78cdb87bd121b0173ee3b10f37441f14a3a8f9 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 7 Jan 2021 13:24:13 -0700 Subject: [PATCH 13/17] move PlantCondLoopOp::ControlType int consts to enum, discoverd bug in how this is applied in SetpointManager --- src/EnergyPlus/Data/EnergyPlusData.cc | 1 - src/EnergyPlus/Plant/Enums.hh | 8 +++ src/EnergyPlus/Plant/EquipAndOperations.hh | 14 +++-- src/EnergyPlus/PlantCondLoopOperation.cc | 51 ++++++++++--------- src/EnergyPlus/PlantCondLoopOperation.hh | 6 --- src/EnergyPlus/SetPointManager.cc | 17 +++++-- src/EnergyPlus/SetPointManager.hh | 13 +++-- .../unit/PlantCondLoopOperation.unit.cc | 12 ++--- tst/EnergyPlus/unit/SetPointManager.unit.cc | 11 ++-- 9 files changed, 75 insertions(+), 58 deletions(-) diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index 9fbfbdd3680..369bc8d56b4 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -546,7 +546,6 @@ namespace EnergyPlus { this->files.debug.close(); this->files.err_stream.reset(); - this->files.err_stream.reset(); this->files.eso.close(); this->files.mtr.close(); this->files.mtr.close(); diff --git a/src/EnergyPlus/Plant/Enums.hh b/src/EnergyPlus/Plant/Enums.hh index 283f844e5eb..89d93c3d309 100644 --- a/src/EnergyPlus/Plant/Enums.hh +++ b/src/EnergyPlus/Plant/Enums.hh @@ -181,6 +181,14 @@ namespace EnergyPlus::DataPlant { FlowSimulation, // Full pressure network simulation }; + enum class iCtrlType + { + Unassigned, + HeatingOp, // Constant for Heating Operation + CoolingOp, // Constant for Cooling Operation + DualOp, // Constant for Cooling or Heating Operation + }; + } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/Plant/EquipAndOperations.hh b/src/EnergyPlus/Plant/EquipAndOperations.hh index d3271d870a0..b5e1dffc043 100644 --- a/src/EnergyPlus/Plant/EquipAndOperations.hh +++ b/src/EnergyPlus/Plant/EquipAndOperations.hh @@ -51,17 +51,15 @@ #include #include +#include -namespace EnergyPlus { -namespace DataPlant { +namespace EnergyPlus::DataPlant { struct EquipListPtrData { // Members int ListPtr; // points to List on OpScheme on plant loop: - // PlantLoop(LoopNum)%OpScheme(Optschemeptr)%List(ListPtr)... int CompPtr; // points to this component on List on OpScheme on plant loop: - // PlantLoop(LoopNum)%OpScheme(Optschemeptr)%List(ListPtr)%Comp(compPtr) // Default Constructor EquipListPtrData() : ListPtr(0), CompPtr(0) @@ -73,7 +71,6 @@ namespace DataPlant { { // Members int OpSchemePtr; // DSU points to OpScheme on plant loop: - // PlantLoop(LoopNum)%OpScheme(Optschemeptr)... int NumEquipLists; // DSU ALLOCATABLE to the schedule (for valid schedules) Array1D EquipList; // DSU Component list @@ -90,7 +87,7 @@ namespace DataPlant { std::string TypeOf; // The name of each item in the list int TypeOf_Num; std::string CtrlType; // CoolingOp, HeatingOp, DualOp - int CtrlTypeNum; // CoolingOp, HeatingOp, DualOp + DataPlant::iCtrlType CtrlTypeNum; // CoolingOp, HeatingOp, DualOp int LoopNumPtr; // pointer to the comp location in the data structure int LoopSideNumPtr; // pointer to the comp location in the data structure int BranchNumPtr; // pointer to the comp location in the data structure @@ -104,7 +101,9 @@ namespace DataPlant { Real64 EMSActuatorDispatchedLoadValue; // EMS actuator for dispatched load, neg= cooling [W] // Default Constructor - EquipListCompData() : TypeOf_Num(0), SetPointFlowRate(0.0), EMSIntVarRemainingLoadValue(0.0), EMSActuatorDispatchedLoadValue(0.0) + EquipListCompData() + : TypeOf_Num(0), CtrlTypeNum(DataPlant::iCtrlType::Unassigned), LoopNumPtr(0), LoopSideNumPtr(0), BranchNumPtr(0), CompNumPtr(0), + SetPointFlowRate(0.0), DemandNodeNum(0), SetPointNodeNum(0), EMSIntVarRemainingLoadValue(0.0), EMSActuatorDispatchedLoadValue(0.0) { } }; @@ -153,7 +152,6 @@ namespace DataPlant { { } }; -} // namespace DataPlant } // namespace EnergyPlus #endif diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index cb96a240e71..2c22f8bc16b 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -99,8 +99,6 @@ namespace EnergyPlus::PlantCondLoopOperation { // based scheme, it also assigns a component load to each of the components on the // equipment list. - // REFERENCES: - // Using/Aliasing using namespace DataPlant; using DataHVACGlobals::NumCondLoops; @@ -108,12 +106,6 @@ namespace EnergyPlus::PlantCondLoopOperation { using DataHVACGlobals::SmallLoad; using FluidProperties::GetSpecificHeatGlycol; - // Data - // MODULE PARAMETER DEFINITIONS - int const HeatingOp(1); // Constant for Heating Operation - int const CoolingOp(2); // Constant for Cooling Operation - int const DualOp(3); // Constant for Cooling or Heating Operation - bool const TurnItemOn(true); // Convenient for calling TurnPlantItemOnOff instead of hardwired true/false bool const TurnItemOff(false); // Convenient for calling TurnPlantItemOnOff instead of hardwired true/false @@ -1328,7 +1320,7 @@ CurrentModuleObject, PlantOpSchemeName); Real64 OffPeakCHWTemp; int CompNumA; int CompNumN; - int CompOpType; // 1=cooling, 2=dual(or other) + iCtrlType CompOpType; // 1=cooling, 2=dual(or other) SchemeNameFound = true; @@ -1429,16 +1421,16 @@ CurrentModuleObject, PlantOpSchemeName); { auto const controlType(cAlphaArgs(CompNumA + 1)); if (controlType == "COOLING") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = CoolingOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = iCtrlType::CoolingOp; } else if (controlType == "HEATING") { if (CurrentModuleObject == "PlantEquipmentOperation:ThermalEnergyStorage") { ShowSevereError(state, "Equipment Operation Mode cannot be HEATING for any equipment found in " + cAlphaArgs(1) + " in thermal energy storage control"); ErrorsFound = true; } - state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = HeatingOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = iCtrlType::HeatingOp; } else if (controlType == "DUAL") { - state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = DualOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = iCtrlType::DualOp; } } @@ -1459,12 +1451,23 @@ CurrentModuleObject, PlantOpSchemeName); CurrentModuleObject + "='" + cAlphaArgs(1) + "'."); ShowContinueError(state, "Equipment Operation Mode can only be 'DUAL' for " + cAlphaArgs(CompNumA - 3) + " objects."); - state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = DualOp; + state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum = iCtrlType::DualOp; } // This block forces CompOpType to be either Cooling if explicitly provided, all other cases = Dual - CompOpType = (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum) - 1; - if ((CompOpType < 1) || (CompOpType > 2)) CompOpType = 2; + switch (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum) { + case iCtrlType::DualOp: + CompOpType = iCtrlType::CoolingOp; + break; + case iCtrlType::CoolingOp: + CompOpType = iCtrlType::HeatingOp; + break; + case iCtrlType::HeatingOp: + CompOpType = iCtrlType::CoolingOp; + break; + default: + assert(false); + } // for each component, a new scheduled setpoint manager needs to be defined to internally generate the more // detailed input that is necessary to get thermal energy storage to work from the simpler input. @@ -1517,7 +1520,7 @@ CurrentModuleObject, PlantOpSchemeName); } } } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == CoolingOp) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == iCtrlType::CoolingOp) { if (Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointHi == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { @@ -1555,7 +1558,7 @@ CurrentModuleObject, PlantOpSchemeName); } } } - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == HeatingOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == iCtrlType::HeatingOp) { if (Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointLo == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { @@ -1597,7 +1600,7 @@ CurrentModuleObject, PlantOpSchemeName); } } } - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == DualOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum == iCtrlType::DualOp) { if ((Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointHi == SensedNodeFlagValue) || (Node(state.dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).SetPointNodeNum).TempSetPointLo == @@ -2932,11 +2935,11 @@ CurrentModuleObject, PlantOpSchemeName); if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::SingleSetPoint) { TempSetPt = Node(SetPtNode).TempSetPoint; } else if (SELECT_CASE_var == DataPlant::iLoopDemandCalcScheme::DualSetPointDeadBand) { - if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == CoolingOp) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::CoolingOp) { TempSetPt = Node(SetPtNode).TempSetPointHi; - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == HeatingOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::HeatingOp) { TempSetPt = Node(SetPtNode).TempSetPointLo; - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == DualOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::DualOp) { CurrentDemandForCoolingOp = DemandMdot * CurSpecHeat * (Node(SetPtNode).TempSetPointHi - TempIn); CurrentDemandForHeatingOp = DemandMdot * CurSpecHeat * (Node(SetPtNode).TempSetPointLo - TempIn); if ((CurrentDemandForCoolingOp < 0.0) && (CurrentDemandForHeatingOp <= 0.0)) { // cooling @@ -2966,7 +2969,7 @@ CurrentModuleObject, PlantOpSchemeName); this_component.EquipDemand = CompDemand; // set MyLoad and runflag - if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == CoolingOp) { + if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::CoolingOp) { if (CompDemand < (-LoopDemandTol)) { this_component.ON = true; this_component.MyLoad = CompDemand; @@ -2974,7 +2977,7 @@ CurrentModuleObject, PlantOpSchemeName); this_component.ON = false; this_component.MyLoad = 0.0; } - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == HeatingOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::HeatingOp) { if (CompDemand > LoopDemandTol) { this_component.ON = true; this_component.MyLoad = CompDemand; @@ -2982,7 +2985,7 @@ CurrentModuleObject, PlantOpSchemeName); this_component.ON = false; this_component.MyLoad = 0.0; } - } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == DualOp) { + } else if (state.dataPlnt->PlantLoop(LoopNum).OpScheme(OpSchemePtr).EquipList(ListPtr).Comp(CompPtr).CtrlTypeNum == iCtrlType::DualOp) { if (CompDemand > LoopDemandTol || CompDemand < (-LoopDemandTol)) { this_component.ON = true; this_component.MyLoad = CompDemand; diff --git a/src/EnergyPlus/PlantCondLoopOperation.hh b/src/EnergyPlus/PlantCondLoopOperation.hh index 69e458ac7a4..f2ffde0529b 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.hh +++ b/src/EnergyPlus/PlantCondLoopOperation.hh @@ -59,12 +59,6 @@ namespace EnergyPlus { namespace PlantCondLoopOperation { - // Data - // MODULE PARAMETER DEFINITIONS - extern int const HeatingOp; // Constant for Heating Operation - extern int const CoolingOp; // Constant for Cooling Operation - extern int const DualOp; // Constant for Cooling or Heating Operation - extern bool const TurnItemOn; // Convenient for calling TurnPlantItemOnOff instead of hardwired true/false extern bool const TurnItemOff; // Convenient for calling TurnPlantItemOnOff instead of hardwired true/false diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 018bbe61b3c..69422951f25 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -5045,13 +5045,13 @@ namespace EnergyPlus::SetPointManager { Real64 CurSchValOnPeak; Real64 CurSchValCharge; Real64 const OnVal(0.5); - int const CoolOpComp(1); // a component that cools only (chillers) - int const DualOpComp(2); // a component that heats or cools (ice storage tank) CurSchValOnPeak = GetCurrentScheduleValue(state, this->SchedPtr); CurSchValCharge = GetCurrentScheduleValue(state, this->SchedPtrCharge); - if (this->CompOpType == CoolOpComp) { // this is some sort of chiller + // CtrlType bug +// if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of chiller + if (this->CompOpType == DataPlant::iCtrlType::HeatingOp) { // this is some sort of chiller if (CurSchValOnPeak >= OnVal) { this->SetPt = this->NonChargeCHWTemp; } else if (CurSchValCharge < OnVal) { @@ -5059,7 +5059,9 @@ namespace EnergyPlus::SetPointManager { } else { this->SetPt = this->ChargeCHWTemp; } - } else if (this->CompOpType == DualOpComp) { // this is some sort of ice storage system + // CtrlType Bug +// } else if (this->CompOpType == DataPlant::iCtrlType::DualOp) { // this is some sort of ice storage system + } else if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of ice storage system this->SetPt = this->NonChargeCHWTemp; } } @@ -8551,7 +8553,12 @@ namespace EnergyPlus::SetPointManager { } void SetUpNewScheduledTESSetPtMgr(EnergyPlusData &state, - int const SchedPtr, int const SchedPtrCharge, Real64 NonChargeCHWTemp, Real64 ChargeCHWTemp, int const CompOpType, int const ControlNodeNum) + int const SchedPtr, + int const SchedPtrCharge, + Real64 NonChargeCHWTemp, + Real64 ChargeCHWTemp, + DataPlant::iCtrlType const &CompOpType, + int const ControlNodeNum) { // SUBROUTINE INFORMATION: // AUTHOR Rick Strand diff --git a/src/EnergyPlus/SetPointManager.hh b/src/EnergyPlus/SetPointManager.hh index 5543aaa44d9..fe45fdd45f6 100644 --- a/src/EnergyPlus/SetPointManager.hh +++ b/src/EnergyPlus/SetPointManager.hh @@ -58,6 +58,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -953,12 +954,13 @@ namespace SetPointManager { int CtrlNodeNum; Real64 NonChargeCHWTemp; Real64 ChargeCHWTemp; - int CompOpType; + DataPlant::iCtrlType CompOpType; Real64 SetPt; // Default Constructor DefineScheduledTESSetPointManager() - : SchedPtr(0), SchedPtrCharge(0), CtrlNodeNum(0), NonChargeCHWTemp(0.0), ChargeCHWTemp(0.0), CompOpType(0), SetPt(0.0) + : SchedPtr(0), SchedPtrCharge(0), CtrlNodeNum(0), NonChargeCHWTemp(0.0), ChargeCHWTemp(0.0), CompOpType(DataPlant::iCtrlType::Unassigned), + SetPt(0.0) { } @@ -999,7 +1001,12 @@ namespace SetPointManager { iCtrlVarType GetHumidityRatioVariableType(EnergyPlusData &state, int CntrlNodeNum); void SetUpNewScheduledTESSetPtMgr(EnergyPlusData &state, - int SchedPtr, int SchedPtrCharge, Real64 NonChargeCHWTemp, Real64 ChargeCHWTemp, int CompOpType, int ControlNodeNum); + int SchedPtr, + int SchedPtrCharge, + Real64 NonChargeCHWTemp, + Real64 ChargeCHWTemp, + DataPlant::iCtrlType const &CompOpType, + int ControlNodeNum); bool GetCoilFreezingCheckFlag(EnergyPlusData &state, int MixedAirSPMNum); diff --git a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc index 1cd8ce1d925..3a0642eb51c 100644 --- a/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc +++ b/tst/EnergyPlus/unit/PlantCondLoopOperation.unit.cc @@ -865,8 +865,8 @@ TEST_F(EnergyPlusFixture, ThermalEnergyStorageWithIceForceDualOp) { int CompNum = 1; std::string compName = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).Name; EXPECT_EQ(compName, "CHILLER"); - int CtrlTypeNum = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum; - EXPECT_EQ(CtrlTypeNum, PlantCondLoopOperation::CoolingOp); + auto CtrlTypeNum = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum; + EXPECT_EQ(CtrlTypeNum, DataPlant::iCtrlType::CoolingOp); } { @@ -875,17 +875,17 @@ TEST_F(EnergyPlusFixture, ThermalEnergyStorageWithIceForceDualOp) { // Ensure we have the right component (the TES tank) EXPECT_EQ(compName, "ICE THERMAL STORAGE"); - int CtrlTypeNum = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum; + auto CtrlTypeNum = state->dataPlnt->PlantLoop(LoopNum).OpScheme(SchemeNum).EquipList(1).Comp(CompNum).CtrlTypeNum; // Could just test this, but want to improve reporting // EXPECT_EQ(CtrlTypeNum, PlantCondLoopOperation::DualOp); std::string ctrlType = "Unknown"; - if (CtrlTypeNum == PlantCondLoopOperation::CoolingOp) { + if (CtrlTypeNum == DataPlant::iCtrlType::CoolingOp) { ctrlType = "CoolingOp"; - } else if (CtrlTypeNum == PlantCondLoopOperation::HeatingOp) { + } else if (CtrlTypeNum == DataPlant::iCtrlType::HeatingOp) { ctrlType = "HeatingOp"; - } else if (CtrlTypeNum == PlantCondLoopOperation::DualOp) { + } else if (CtrlTypeNum == DataPlant::iCtrlType::DualOp) { ctrlType = "DualOp"; } diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 0b11bf7b255..33074d2b61f 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -525,9 +525,6 @@ TEST_F(EnergyPlusFixture, SetPointManager_setupSetPointAndFlags) TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) { - int const CoolOpComp(1); // a component that cools only (chillers) - int const DualOpComp(2); // a component that heats or cools (ice storage tank) - int schManNum = 1; state->dataSetPointManager->SchTESSetPtMgr.allocate(schManNum); state->dataSetPointManager->SchTESSetPtMgr(schManNum).NonChargeCHWTemp = 5; @@ -550,7 +547,9 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) state->dataEnvrn->DayOfYear_Schedule = 1; ScheduleManager::UpdateScheduleValues(*state); - state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = CoolOpComp; + // CtrlType Bug +// state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp; + state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::HeatingOp; state->dataSetPointManager->SchTESSetPtMgr(schManNum).SchedPtr = OnSched; @@ -569,7 +568,9 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) state->dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(*state); EXPECT_EQ(state->dataSetPointManager->SchTESSetPtMgr(schManNum).ChargeCHWTemp, state->dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); - state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DualOpComp; + // CtrlType Bug +// state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::DualOp; + state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp; state->dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(*state); EXPECT_EQ(state->dataSetPointManager->SchTESSetPtMgr(schManNum).NonChargeCHWTemp, state->dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); From 3bfeb7f85eca9d4e08a09424b5477a78c9c2b53c Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 7 Jan 2021 13:34:48 -0700 Subject: [PATCH 14/17] fix ControlType bug in SetpointManager --- src/EnergyPlus/SetPointManager.cc | 8 ++------ tst/EnergyPlus/unit/SetPointManager.unit.cc | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 69422951f25..8400a32b979 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -5049,9 +5049,7 @@ namespace EnergyPlus::SetPointManager { CurSchValOnPeak = GetCurrentScheduleValue(state, this->SchedPtr); CurSchValCharge = GetCurrentScheduleValue(state, this->SchedPtrCharge); - // CtrlType bug -// if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of chiller - if (this->CompOpType == DataPlant::iCtrlType::HeatingOp) { // this is some sort of chiller + if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of chiller if (CurSchValOnPeak >= OnVal) { this->SetPt = this->NonChargeCHWTemp; } else if (CurSchValCharge < OnVal) { @@ -5059,9 +5057,7 @@ namespace EnergyPlus::SetPointManager { } else { this->SetPt = this->ChargeCHWTemp; } - // CtrlType Bug -// } else if (this->CompOpType == DataPlant::iCtrlType::DualOp) { // this is some sort of ice storage system - } else if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of ice storage system + } else if (this->CompOpType == DataPlant::iCtrlType::DualOp) { // this is some sort of ice storage system this->SetPt = this->NonChargeCHWTemp; } } diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 33074d2b61f..c89ea71f308 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -547,9 +547,7 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) state->dataEnvrn->DayOfYear_Schedule = 1; ScheduleManager::UpdateScheduleValues(*state); - // CtrlType Bug -// state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp; - state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::HeatingOp; + state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp; state->dataSetPointManager->SchTESSetPtMgr(schManNum).SchedPtr = OnSched; @@ -568,9 +566,7 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) state->dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(*state); EXPECT_EQ(state->dataSetPointManager->SchTESSetPtMgr(schManNum).ChargeCHWTemp, state->dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); - // CtrlType Bug -// state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::DualOp; - state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp; + state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::DualOp; state->dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(*state); EXPECT_EQ(state->dataSetPointManager->SchTESSetPtMgr(schManNum).NonChargeCHWTemp, state->dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); From ef44c32b2ef809f2d18bd3c2f3acf3872cfb5560 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 7 Jan 2021 14:11:06 -0700 Subject: [PATCH 15/17] move remaining PlantCondLoopOp data to state --- src/EnergyPlus/PlantCondLoopOperation.cc | 45 ++++-------------------- src/EnergyPlus/PlantCondLoopOperation.hh | 29 ++++----------- src/EnergyPlus/StateManagement.cc | 2 -- 3 files changed, 13 insertions(+), 63 deletions(-) diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 2c22f8bc16b..1fb5c9497d4 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -106,39 +106,6 @@ namespace EnergyPlus::PlantCondLoopOperation { using DataHVACGlobals::SmallLoad; using FluidProperties::GetSpecificHeatGlycol; - bool const TurnItemOn(true); // Convenient for calling TurnPlantItemOnOff instead of hardwired true/false - bool const TurnItemOff(false); // Convenient for calling TurnPlantItemOnOff instead of hardwired true/false - - namespace { - bool GetPlantOpInput(true); // operation Get Input flag - bool InitLoadDistributionOneTimeFlag(true); - bool LoadEquipListOneTimeFlag(true); - } // namespace - // MODULE VARIABLE DECLARATIONS: - - // SUBROUTINE SPECIFICATIONS FOR MODULE !SUBROUTINE SPECIFICATIONS FOR MODULE - // Driver Routines - // Get Input Routines - // Initialization Routines - // Load Distribution/Calculation Routines - - // ON/OFF Utility Routines - - // PLANT EMS Utility Routines - - // MODULE SUBROUTINES: - - // Beginning of Module Driver Subroutines - //************************************************************************* - - // Functions - void clear_state() - { - GetPlantOpInput = true; - InitLoadDistributionOneTimeFlag = true; - LoadEquipListOneTimeFlag = true; - } - void ManagePlantLoadDistribution(EnergyPlusData &state, int const LoopNum, // PlantLoop data structure loop counter int const LoopSideNum, // PlantLoop data structure LoopSide counter @@ -1111,7 +1078,7 @@ CurrentModuleObject, PlantOpSchemeName); int iIndex; bool firstblank; - if (LoadEquipListOneTimeFlag) { + if (state.dataPlantCondLoopOp->LoadEquipListOneTimeFlag) { // assemble mapping between list names and indices one time PELists = inputProcessor->getNumObjectsFound(state, "PlantEquipmentList"); CELists = inputProcessor->getNumObjectsFound(state, "CondenserEquipmentList"); @@ -1220,7 +1187,7 @@ CurrentModuleObject, PlantOpSchemeName); if (ErrorsFound) { ShowFatalError(state, "LoadEquipList/GetEquipmentLists: Failed due to preceding errors."); } - LoadEquipListOneTimeFlag = false; + state.dataPlantCondLoopOp->LoadEquipListOneTimeFlag = false; } FoundIntendedList = false; @@ -1849,18 +1816,18 @@ CurrentModuleObject, PlantOpSchemeName); errFlag2 = false; // Get Input - if (GetPlantOpInput) { + if (state.dataPlantCondLoopOp->GetPlantOpInput) { GetPlantOperationInput(state, GetInputOK); if (GetInputOK) { GetOperationSchemeInput(state); - GetPlantOpInput = false; + state.dataPlantCondLoopOp->GetPlantOpInput = false; } else { return; } } // ONE TIME INITS - if (InitLoadDistributionOneTimeFlag) { + if (state.dataPlantCondLoopOp->InitLoadDistributionOneTimeFlag) { // Set up 'component' to 'op scheme' pointers in Plant data structure // We're looking for matches between a component on a PlantLoop.OpScheme.List() // and the same component in the PlantLoop.LoopSide.Branch.Comp() data structure @@ -2046,7 +2013,7 @@ CurrentModuleObject, PlantOpSchemeName); } // operation scheme } // loop - InitLoadDistributionOneTimeFlag = false; + state.dataPlantCondLoopOp->InitLoadDistributionOneTimeFlag = false; } if (state.dataPlnt->AnyEMSPlantOpSchemesInModel) { // Execute any Initialization EMS program calling managers for User-Defined operation. diff --git a/src/EnergyPlus/PlantCondLoopOperation.hh b/src/EnergyPlus/PlantCondLoopOperation.hh index f2ffde0529b..8650aeefced 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.hh +++ b/src/EnergyPlus/PlantCondLoopOperation.hh @@ -59,24 +59,6 @@ namespace EnergyPlus { namespace PlantCondLoopOperation { - extern bool const TurnItemOn; // Convenient for calling TurnPlantItemOnOff instead of hardwired true/false - extern bool const TurnItemOff; // Convenient for calling TurnPlantItemOnOff instead of hardwired true/false - - // MODULE VARIABLE DECLARATIONS: - - // SUBROUTINE SPECIFICATIONS FOR MODULE !SUBROUTINE SPECIFICATIONS FOR MODULE - // Driver Routines - // Get Input Routines - // Initialization Routines - // Load Distribution/Calculation Routines - - // ON/OFF Utility Routines - - // PLANT EMS Utility Routines - - // Functions - void clear_state(); - void ManagePlantLoadDistribution(EnergyPlusData &state, int const LoopNum, // PlantLoop data structure loop counter int const LoopSideNum, // PlantLoop data structure LoopSide counter @@ -229,16 +211,19 @@ namespace PlantCondLoopOperation { Real64 &ChangeInLoad // positive magnitude of load change ); - //*END PLANT EMS CONTROL ROUTINES! - //****************************************************************************** - } // namespace PlantCondLoopOperation struct PlantCondLoopOperationData : BaseGlobalStruct { + bool GetPlantOpInput = true; + bool InitLoadDistributionOneTimeFlag = true; + bool LoadEquipListOneTimeFlag = true; + void clear_state() override { - + this->GetPlantOpInput = true; + this->InitLoadDistributionOneTimeFlag = true; + this->LoadEquipListOneTimeFlag = true; } }; diff --git a/src/EnergyPlus/StateManagement.cc b/src/EnergyPlus/StateManagement.cc index 1b790aed421..35237da1cc9 100644 --- a/src/EnergyPlus/StateManagement.cc +++ b/src/EnergyPlus/StateManagement.cc @@ -145,7 +145,6 @@ #include #include #include -#include #include #include #include @@ -265,7 +264,6 @@ void EnergyPlus::clearAllStates(EnergyPlusData &state) PackagedThermalStorageCoil::clear_state(); Photovoltaics::clear_state(); PhotovoltaicThermalCollectors::clear_state(); - PlantCondLoopOperation::clear_state(); PlantHeatExchangerFluidToFluid::clear_state(); PlantLoadProfile::clear_state(); PlantManager::clear_state(); From b9caf740dd81556b6de58934cf12352ab554da9a Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 11 Jan 2021 08:39:51 -0700 Subject: [PATCH 16/17] revert 3bfeb7f85eca9d4e08a09424b5477a78c9c2b53c to demonstrate bug --- src/EnergyPlus/SetPointManager.cc | 8 ++++++-- tst/EnergyPlus/unit/SetPointManager.unit.cc | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index 8400a32b979..69422951f25 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -5049,7 +5049,9 @@ namespace EnergyPlus::SetPointManager { CurSchValOnPeak = GetCurrentScheduleValue(state, this->SchedPtr); CurSchValCharge = GetCurrentScheduleValue(state, this->SchedPtrCharge); - if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of chiller + // CtrlType bug +// if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of chiller + if (this->CompOpType == DataPlant::iCtrlType::HeatingOp) { // this is some sort of chiller if (CurSchValOnPeak >= OnVal) { this->SetPt = this->NonChargeCHWTemp; } else if (CurSchValCharge < OnVal) { @@ -5057,7 +5059,9 @@ namespace EnergyPlus::SetPointManager { } else { this->SetPt = this->ChargeCHWTemp; } - } else if (this->CompOpType == DataPlant::iCtrlType::DualOp) { // this is some sort of ice storage system + // CtrlType Bug +// } else if (this->CompOpType == DataPlant::iCtrlType::DualOp) { // this is some sort of ice storage system + } else if (this->CompOpType == DataPlant::iCtrlType::CoolingOp) { // this is some sort of ice storage system this->SetPt = this->NonChargeCHWTemp; } } diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index c89ea71f308..33074d2b61f 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -547,7 +547,9 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) state->dataEnvrn->DayOfYear_Schedule = 1; ScheduleManager::UpdateScheduleValues(*state); - state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp; + // CtrlType Bug +// state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp; + state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::HeatingOp; state->dataSetPointManager->SchTESSetPtMgr(schManNum).SchedPtr = OnSched; @@ -566,7 +568,9 @@ TEST_F(EnergyPlusFixture, CalcScheduledTESSetPoint) state->dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(*state); EXPECT_EQ(state->dataSetPointManager->SchTESSetPtMgr(schManNum).ChargeCHWTemp, state->dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); - state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::DualOp; + // CtrlType Bug +// state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::DualOp; + state->dataSetPointManager->SchTESSetPtMgr(schManNum).CompOpType = DataPlant::iCtrlType::CoolingOp; state->dataSetPointManager->SchTESSetPtMgr(schManNum).calculate(*state); EXPECT_EQ(state->dataSetPointManager->SchTESSetPtMgr(schManNum).NonChargeCHWTemp, state->dataSetPointManager->SchTESSetPtMgr(schManNum).SetPt); From f3d787971ae9c7660fa9e619f6a9c893f8b5e5a9 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Mon, 11 Jan 2021 13:26:00 -0700 Subject: [PATCH 17/17] fix warning --- src/EnergyPlus/PlantCondLoopOperation.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EnergyPlus/PlantCondLoopOperation.cc b/src/EnergyPlus/PlantCondLoopOperation.cc index 1fb5c9497d4..15b26b7f439 100644 --- a/src/EnergyPlus/PlantCondLoopOperation.cc +++ b/src/EnergyPlus/PlantCondLoopOperation.cc @@ -2583,6 +2583,7 @@ CurrentModuleObject, PlantOpSchemeName); if (std::abs(RemLoopDemand) < SmallLoad) RemLoopDemand = 0.0; } + break; default: assert(false); }