diff --git a/src/ConvertInputFormat/main.cpp b/src/ConvertInputFormat/main.cpp index c6a8a3677c0..3efc0f46fa9 100644 --- a/src/ConvertInputFormat/main.cpp +++ b/src/ConvertInputFormat/main.cpp @@ -88,7 +88,7 @@ static constexpr std::array(OutputTypes::Num) static constexpr auto outputTypeExperimentalStart = OutputTypes::CBOR; -template void displayMessage(std::string_view str_format, Args &&...args) +template void displayMessage(std::string_view str_format, Args &&... args) { fmt::print(std::cout, str_format, args...); std::cout.write("\n", 1); diff --git a/src/EnergyPlus/EPVector.hh b/src/EnergyPlus/EPVector.hh index 1cb6505b668..9b5c02f294a 100644 --- a/src/EnergyPlus/EPVector.hh +++ b/src/EnergyPlus/EPVector.hh @@ -263,12 +263,12 @@ private: bool m_allocated{false}; }; -template [[nodiscard]] bool allocated(EPVector const &v) noexcept +template [[nodiscard]] bool allocated(EPVector const &v) noexcept { return v.allocated(); } -template [[nodiscard]] auto isize(const EPVector &v) noexcept +template [[nodiscard]] auto isize(const EPVector &v) noexcept { return v.isize(); } @@ -294,7 +294,7 @@ template [[nodiscard]] auto isize(const EPVector &v) noexcept return std::count_if(values.cbegin(), values.cend(), [](bool v) { return v; }); } -template [[nodiscard]] EPVector pack(EPVector const &v, EPVector const &mask) +template [[nodiscard]] EPVector pack(EPVector const &v, EPVector const &mask) { EPVector r; r.reserve(mask.size()); @@ -306,7 +306,7 @@ template [[nodiscard]] EPVector pack(EPVector const &v, EPVec return r; } -template [[nodiscard]] Array1D pack(Array1 const &a, EPVector const &mask) +template [[nodiscard]] Array1D pack(Array1 const &a, EPVector const &mask) { Array1D r; r.reserve(mask.size()); @@ -318,17 +318,17 @@ template [[nodiscard]] Array1D pack(Array1 const &a, EPVector return r; } -template [[nodiscard]] T magnitude_squared(const EPVector &v) +template [[nodiscard]] T magnitude_squared(const EPVector &v) { return std::inner_product(v.begin(), v.end(), v.begin(), T{}); } -template [[nodiscard]] T dot(const EPVector &u, const V &v) +template [[nodiscard]] T dot(const EPVector &u, const V &v) { return std::inner_product(u.begin(), u.end(), v.begin(), T{}); } -template [[nodiscard]] Member maxval(EPVector const &a, Member Element::*pmem) +template [[nodiscard]] Member maxval(EPVector const &a, Member Element::*pmem) { Member v(a.empty() ? std::numeric_limits::lowest() : a(1).*pmem); for (int i = 2, e = a.isize(); i <= e; ++i) { @@ -343,7 +343,7 @@ template inline Member sum(EPVector return std::accumulate(c.cbegin(), c.cend(), 0.0, [&pmem](const Member &sum, const Element &e) { return sum + e.*pmem; }); } -template [[nodiscard]] T maxval(EPVector const &a) +template [[nodiscard]] T maxval(EPVector const &a) { auto max = std::max_element(a.begin(), a.end()); if (max == a.end()) { diff --git a/src/EnergyPlus/FileSystem.hh b/src/EnergyPlus/FileSystem.hh index b23b40f8364..a8c31c20300 100644 --- a/src/EnergyPlus/FileSystem.hh +++ b/src/EnergyPlus/FileSystem.hh @@ -229,8 +229,8 @@ namespace FileSystem { is_any, std::unique_ptr, std::unique_ptr, std::unique_ptr>::value; template - inline constexpr bool enable_json_v = - is_all_json_type(fileType) && is_any::value && !is_any::value; + inline constexpr bool enable_json_v = is_all_json_type(fileType) && is_any::value && + !is_any::value; template void writeFile(fs::path const &filePath, const std::string_view data) { diff --git a/src/EnergyPlus/HeatBalanceKivaManager.cc b/src/EnergyPlus/HeatBalanceKivaManager.cc index ec82cb61fba..435b29f05c0 100644 --- a/src/EnergyPlus/HeatBalanceKivaManager.cc +++ b/src/EnergyPlus/HeatBalanceKivaManager.cc @@ -839,7 +839,7 @@ bool KivaManager::setupKivaInstances(EnergyPlusData &state) Real64 surfHeight = Surfaces(wl).get_average_height(state); // round to avoid numerical precision differences - surfHeight = std::round((surfHeight) * 1000.0) / 1000.0; + surfHeight = std::round((surfHeight)*1000.0) / 1000.0; if (combinationMap.count({Surfaces(wl).Construction, surfHeight}) == 0) { // create new combination diff --git a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh index 589efb9ee43..d8f995a4f53 100644 --- a/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh +++ b/src/EnergyPlus/HeatPumpWaterToWaterCOOLING.hh @@ -128,10 +128,11 @@ namespace HeatPumpWaterToWaterCOOLING { MaxPartLoadRat(0.0), OptPartLoadRat(0.0), LoadSideVolFlowRate(0.0), LoadSideDesignMassFlow(0.0), SourceSideVolFlowRate(0.0), SourceSideDesignMassFlow(0.0), SourceSideInletNodeNum(0), SourceSideOutletNodeNum(0), LoadSideInletNodeNum(0), LoadSideOutletNodeNum(0), SourceSideUACoeff(0.0), LoadSideUACoeff(0.0), CompPistonDisp(0.0), CompClearanceFactor(0.0), CompSucPressDrop(0.0), SuperheatTemp(0.0), - PowerLosses(0.0), LossFactor(0.0), HighPressCutoff(0.0), LowPressCutoff(0.0), IsOn(false), MustRun(false), SourcePlantLoc{}, - LoadPlantLoc{}, CondMassFlowIndex(0), Power(0.0), Energy(0.0), QLoad(0.0), QLoadEnergy(0.0), QSource(0.0), QSourceEnergy(0.0), - LoadSideWaterInletTemp(0.0), SourceSideWaterInletTemp(0.0), LoadSideWaterOutletTemp(0.0), SourceSideWaterOutletTemp(0.0), Running(0), - LoadSideWaterMassFlowRate(0.0), SourceSideWaterMassFlowRate(0.0), plantScanFlag(true), beginEnvironFlag(true) + PowerLosses(0.0), LossFactor(0.0), HighPressCutoff(0.0), LowPressCutoff(0.0), IsOn(false), + MustRun(false), SourcePlantLoc{}, LoadPlantLoc{}, CondMassFlowIndex(0), Power(0.0), Energy(0.0), QLoad(0.0), QLoadEnergy(0.0), + QSource(0.0), QSourceEnergy(0.0), LoadSideWaterInletTemp(0.0), SourceSideWaterInletTemp(0.0), LoadSideWaterOutletTemp(0.0), + SourceSideWaterOutletTemp(0.0), Running(0), LoadSideWaterMassFlowRate(0.0), SourceSideWaterMassFlowRate(0.0), plantScanFlag(true), + beginEnvironFlag(true) { } diff --git a/src/EnergyPlus/IOFiles.hh b/src/EnergyPlus/IOFiles.hh index 5991b069993..b7dcea12eb9 100644 --- a/src/EnergyPlus/IOFiles.hh +++ b/src/EnergyPlus/IOFiles.hh @@ -495,7 +495,7 @@ inline constexpr bool is_fortran_syntax(const std::string_view format_str) class InputOutputFile; template -void print(InputOutputFile &outputFile, std::string_view format_str, Args &&...args); +void print(InputOutputFile &outputFile, std::string_view format_str, Args &&... args); inline constexpr FormatSyntax check_syntax(const std::string_view format_str) { @@ -613,7 +613,7 @@ public: private: std::unique_ptr os; bool print_to_dev_null = false; - template friend void print(InputOutputFile &outputFile, std::string_view format_str, Args &&...args); + template friend void print(InputOutputFile &outputFile, std::string_view format_str, Args &&... args); friend class IOFiles; }; @@ -805,7 +805,7 @@ public: } }; -template void vprint(std::ostream &os, std::string_view format_str, const Args &...args) +template void vprint(std::ostream &os, std::string_view format_str, const Args &... args) { // assert(os.good()); auto buffer = fmt::memory_buffer(); @@ -817,7 +817,7 @@ template void vprint(std::ostream &os, std::string_view forma os.write(buffer.data(), buffer.size()); } -template std::string vprint(std::string_view format_str, const Args &...args) +template std::string vprint(std::string_view format_str, const Args &... args) { auto buffer = fmt::memory_buffer(); try { @@ -851,19 +851,19 @@ template std::string vprint(std::string_view format_str, cons // namespace { - template void print_fortran_syntax(std::ostream &os, std::string_view format_str, const Args &...args) + template void print_fortran_syntax(std::ostream &os, std::string_view format_str, const Args &... args) { EnergyPlus::vprint, DoubleWrapper, Args>...>(os, format_str, args...); } - template std::string format_fortran_syntax(std::string_view format_str, const Args &...args) + template std::string format_fortran_syntax(std::string_view format_str, const Args &... args) { return EnergyPlus::vprint, DoubleWrapper, Args>...>(format_str, args...); } } // namespace template -void print(std::ostream &os, std::string_view format_str, Args &&...args) +void print(std::ostream &os, std::string_view format_str, Args &&... args) { if constexpr (formatSyntax == FormatSyntax::Fortran) { print_fortran_syntax(os, format_str, args...); @@ -874,7 +874,7 @@ void print(std::ostream &os, std::string_view format_str, Args &&...args) } } -template void print(InputOutputFile &outputFile, std::string_view format_str, Args &&...args) +template void print(InputOutputFile &outputFile, std::string_view format_str, Args &&... args) { auto *outputStream = [&]() -> std::ostream * { if (outputFile.os) { @@ -897,7 +897,7 @@ template void print(InputOutputFil } } -template std::string format(std::string_view format_str, Args &&...args) +template std::string format(std::string_view format_str, Args &&... args) { if constexpr (formatSyntax == FormatSyntax::Fortran) { return format_fortran_syntax(format_str, args...); diff --git a/src/EnergyPlus/PoweredInductionUnits.hh b/src/EnergyPlus/PoweredInductionUnits.hh index babe185b7c3..0e8beca99f2 100644 --- a/src/EnergyPlus/PoweredInductionUnits.hh +++ b/src/EnergyPlus/PoweredInductionUnits.hh @@ -156,9 +156,9 @@ namespace PoweredInductionUnits { OutAirNode(0), HCoilInAirNode(0), ControlCompTypeNum(0), CompErrIndex(0), Mixer_Num(0), Fan_Num(0), Fan_Index(0), FanAvailSchedPtr(0), HCoilType(HtgCoilType::Invalid), HCoil_PlantType(DataPlant::PlantEquipmentType::Invalid), HCoil_Index(0), HCoil_FluidIndex(0), MaxVolHotWaterFlow(0.0), MaxVolHotSteamFlow(0.0), MaxHotWaterFlow(0.0), MaxHotSteamFlow(0.0), MinVolHotWaterFlow(0.0), - MinHotSteamFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), HotControlOffset(0.0), - HWplantLoc{}, ADUNum(0), InducesPlenumAir(false), HeatingRate(0.0), HeatingEnergy(0.0), SensCoolRate(0.0), SensCoolEnergy(0.0), - CtrlZoneNum(0), ctrlZoneInNodeIndex(0), AirLoopNum(0), OutdoorAirFlowRate(0.0) + MinHotSteamFlow(0.0), MinVolHotSteamFlow(0.0), MinHotWaterFlow(0.0), HotControlNode(0), HotCoilOutNodeNum(0), + HotControlOffset(0.0), HWplantLoc{}, ADUNum(0), InducesPlenumAir(false), HeatingRate(0.0), HeatingEnergy(0.0), SensCoolRate(0.0), + SensCoolEnergy(0.0), CtrlZoneNum(0), ctrlZoneInNodeIndex(0), AirLoopNum(0), OutdoorAirFlowRate(0.0) { } diff --git a/src/EnergyPlus/StringUtilities.hh b/src/EnergyPlus/StringUtilities.hh index 3f12c78a384..2748eb14369 100644 --- a/src/EnergyPlus/StringUtilities.hh +++ b/src/EnergyPlus/StringUtilities.hh @@ -157,7 +157,7 @@ inline auto nth_occurrence(std::string_view input_str, char const search_char, s return pos; } -template bool readList(std::string_view input, Param &&...param) +template bool readList(std::string_view input, Param &&... param) { if constexpr (std::conjunction_v...> || std::conjunction_v...>) { size_t index = 0; diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 17f2a681acf..68f17f37af8 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -2487,109 +2487,109 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Compressor) } // Run and Check: VRFOU_CompSpd - { // Test the method VRFOU_CompSpd, which calculates the compressor speed at given - // operational conditions to meet the evaporator or condenser capacity provided. + {// Test the method VRFOU_CompSpd, which calculates the compressor speed at given + // operational conditions to meet the evaporator or condenser capacity provided. - { // a. Evaporator + {// a. Evaporator - // Inputs_condition - Real64 constexpr Q_req = 6971; // Required capacity [W] - Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] - Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] - Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] - Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] - Real64 CompSpdActual; // Actual compressor running speed [rps] + // Inputs_condition + Real64 constexpr Q_req = 6971; // Required capacity [W] + Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] + Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] + Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] + Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] + Real64 CompSpdActual; // Actual compressor running speed [rps] - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( - *state, Q_req, HXOpMode::EvapMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( + *state, Q_req, HXOpMode::EvapMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); - // Test - EXPECT_NEAR(1295, CompSpdActual, 5); - } - - { - // b. Condenser - - // Inputs_condition - Real64 constexpr Q_req = 6953; // Required capacity [W] - Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] - Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] - Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] - Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] - Real64 CompSpdActual; // Actual compressor running speed [rps] - - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( - *state, Q_req, HXOpMode::CondMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); - - // Test - EXPECT_NEAR(950, CompSpdActual, 5); - } - } // namespace EnergyPlus - - // Run and Check: VRFOU_CompCap - { - // Test the method VRFOU_CompCap, which calculates the compressor performance (power and capacity) - // at given compressor speed and operational conditions. - - // Inputs_condition - Real64 constexpr CompSpdActual = 1298; // Actual compressor running speed [rps] - Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] - Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] - Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] - Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] - Real64 Q_c_tot; // Compressor evaporative capacity [W] - Real64 Ncomp; // Compressor power [W] - - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompCap(*state, CompSpdActual, T_suction, T_discharge, h_IU_evap_in, h_comp_in, Q_c_tot, Ncomp); - - // Test - EXPECT_NEAR(6990, Q_c_tot, 10); - EXPECT_NEAR(1601, Ncomp, 10); - } - - // Run and Check: VRFOU_CalcComp - { - // Test the method VRFOU_CalcCompH, which simulates the compressor performance at given oprtaional conditions. More specifically, it - // sepcifies the compressor speed to provide sufficient evaporative capacity, and calculate the power of the compressor running at the - // specified speed. Note that it may be needed to manipulate the operational conditions to further adjust system capacity at low load - // conditions. The low load modification logics are different for cooling mode and heating mode. + // Test + EXPECT_NEAR(1295, CompSpdActual, 5); +} - // Inputs_condition - Real64 TU_load = 6006; // Indoor unit cooling load [W] - Real64 T_suction = 8.86; // Compressor suction temperature Te' [C] - Real64 T_discharge = 40.26; // Compressor discharge temperature Tc' [C] - Real64 Pipe_h_out_ave = 233428; // Average Enthalpy of the refrigerant leaving IUs [kJ/kg] - Real64 IUMaxCondTemp = 36; // VRV IU condensing temperature, max among all indoor units [C] - Real64 MinOutdoorUnitTe = -72; // The minimum temperature that OU Te can be at cooling mode (only used for calculating Min capacity) - Real64 Tfs = 10.90; // Temperature of the air at the OU evaporator coil surface [C]] - Real64 Pipe_Q = 162.67; // Piping Loss Algorithm Parameter: Heat loss [W] - Real64 OUEvapHeatExtract = 5110.40; // Evaporator heat extract [W] - Real64 Ncomp = 1058; // Compressor power [W] - Real64 CompSpdActual; // Actual compressor running speed [rps] +{ + // b. Condenser + + // Inputs_condition + Real64 constexpr Q_req = 6953; // Required capacity [W] + Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] + Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] + Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] + Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] + Real64 CompSpdActual; // Actual compressor running speed [rps] + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( + *state, Q_req, HXOpMode::CondMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); + + // Test + EXPECT_NEAR(950, CompSpdActual, 5); +} +} // namespace EnergyPlus - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CalcCompH(*state, - TU_load, - T_suction, - T_discharge, - Pipe_h_out_ave, - IUMaxCondTemp, - MinOutdoorUnitTe, - Tfs, - Pipe_Q, - OUEvapHeatExtract, - CompSpdActual, - Ncomp); +// Run and Check: VRFOU_CompCap +{ + // Test the method VRFOU_CompCap, which calculates the compressor performance (power and capacity) + // at given compressor speed and operational conditions. + + // Inputs_condition + Real64 constexpr CompSpdActual = 1298; // Actual compressor running speed [rps] + Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] + Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] + Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] + Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] + Real64 Q_c_tot; // Compressor evaporative capacity [W] + Real64 Ncomp; // Compressor power [W] + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompCap(*state, CompSpdActual, T_suction, T_discharge, h_IU_evap_in, h_comp_in, Q_c_tot, Ncomp); + + // Test + EXPECT_NEAR(6990, Q_c_tot, 10); + EXPECT_NEAR(1601, Ncomp, 10); +} - // Test - EXPECT_NEAR(5110, OUEvapHeatExtract, 1); - EXPECT_NEAR(1500, CompSpdActual, 1); - EXPECT_NEAR(2080, Ncomp, 1); - EXPECT_EQ(state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRFTU(1).VRFTUInletNodeNum).MassFlowRate, 0.0); - } +// Run and Check: VRFOU_CalcComp +{ + // Test the method VRFOU_CalcCompH, which simulates the compressor performance at given oprtaional conditions. More specifically, it + // sepcifies the compressor speed to provide sufficient evaporative capacity, and calculate the power of the compressor running at the + // specified speed. Note that it may be needed to manipulate the operational conditions to further adjust system capacity at low load + // conditions. The low load modification logics are different for cooling mode and heating mode. + + // Inputs_condition + Real64 TU_load = 6006; // Indoor unit cooling load [W] + Real64 T_suction = 8.86; // Compressor suction temperature Te' [C] + Real64 T_discharge = 40.26; // Compressor discharge temperature Tc' [C] + Real64 Pipe_h_out_ave = 233428; // Average Enthalpy of the refrigerant leaving IUs [kJ/kg] + Real64 IUMaxCondTemp = 36; // VRV IU condensing temperature, max among all indoor units [C] + Real64 MinOutdoorUnitTe = -72; // The minimum temperature that OU Te can be at cooling mode (only used for calculating Min capacity) + Real64 Tfs = 10.90; // Temperature of the air at the OU evaporator coil surface [C]] + Real64 Pipe_Q = 162.67; // Piping Loss Algorithm Parameter: Heat loss [W] + Real64 OUEvapHeatExtract = 5110.40; // Evaporator heat extract [W] + Real64 Ncomp = 1058; // Compressor power [W] + Real64 CompSpdActual; // Actual compressor running speed [rps] + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CalcCompH(*state, + TU_load, + T_suction, + T_discharge, + Pipe_h_out_ave, + IUMaxCondTemp, + MinOutdoorUnitTe, + Tfs, + Pipe_Q, + OUEvapHeatExtract, + CompSpdActual, + Ncomp); + + // Test + EXPECT_NEAR(5110, OUEvapHeatExtract, 1); + EXPECT_NEAR(1500, CompSpdActual, 1); + EXPECT_NEAR(2080, Ncomp, 1); + EXPECT_EQ(state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRFTU(1).VRFTUInletNodeNum).MassFlowRate, 0.0); +} } TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Coil) @@ -2632,165 +2632,163 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Coil) InitializePsychRoutines(*state); // Run and Check: VRFOU_Cap - { // Test the method VRFOU_Cap, which determines the VRF OU heat transfer rate, given refrigerant side temperature, - // i.e., condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. - { // a. Condenser - - // Inputs_condition - m_air = 3.6; - OutDryBulbTemp = 28; - OutHumRat = 0.0146; - SC = 1; - Tdischarge = 36; - - // Run - Q_h_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::CondMode, Tdischarge, SC, m_air, OutDryBulbTemp, OutHumRat); - - // Test - EXPECT_NEAR(27551, Q_h_OU, 10); - } + { // Test the method VRFOU_Cap, which determines the VRF OU heat transfer rate, given refrigerant side temperature, + // i.e., condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. + {// a. Condenser + + // Inputs_condition + m_air = 3.6; + OutDryBulbTemp = 28; + OutHumRat = 0.0146; + SC = 1; + Tdischarge = 36; + + // Run + Q_h_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::CondMode, Tdischarge, SC, m_air, OutDryBulbTemp, OutHumRat); + + // Test + EXPECT_NEAR(27551, Q_h_OU, 10); +} - { - // b. Evaporator +{ + // b. Evaporator - // Inputs_condition - m_air = 3.6; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - SH = 1; - Tsuction = -3; + // Inputs_condition + m_air = 3.6; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + SH = 1; + Tsuction = -3; - // Run - Q_c_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::EvapMode, Tsuction, SH, m_air, OutDryBulbTemp, OutHumRat); + // Run + Q_c_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::EvapMode, Tsuction, SH, m_air, OutDryBulbTemp, OutHumRat); - // Test - EXPECT_NEAR(24456, Q_c_OU, 10); - } - } // namespace EnergyPlus - - // Run and Check: VRFOU_FlowRate - { // Test the method VRFOU_Cap, which calculates the outdoor unit fan flow rate, given VRF OU load and refrigerant side temperature, i.e., - // condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. - { // a. Condenser - - // Inputs_condition - Q_h_OU = 27551; - OutDryBulbTemp = 28; - OutHumRat = 0.0146; - SC = 1; - Tdischarge = 36; - - // Run - m_air = - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::CondMode, Tdischarge, SC, Q_h_OU, OutDryBulbTemp, OutHumRat); - - // Test - EXPECT_NEAR(3.6, m_air, 0.01); - } + // Test + EXPECT_NEAR(24456, Q_c_OU, 10); +} +} // namespace EnergyPlus - { - // b. Evaporator +// Run and Check: VRFOU_FlowRate +{ // Test the method VRFOU_Cap, which calculates the outdoor unit fan flow rate, given VRF OU load and refrigerant side temperature, i.e., + // condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. + {// a. Condenser - // Inputs_condition - Q_c_OU = 24456; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - SH = 1; - Tsuction = -3; + // Inputs_condition + Q_h_OU = 27551; +OutDryBulbTemp = 28; +OutHumRat = 0.0146; +SC = 1; +Tdischarge = 36; - // Run - m_air = - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::EvapMode, Tsuction, SH, Q_c_OU, OutDryBulbTemp, OutHumRat); +// Run +m_air = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::CondMode, Tdischarge, SC, Q_h_OU, OutDryBulbTemp, OutHumRat); - // Test - EXPECT_NEAR(3.6, m_air, 0.01); - } - } +// Test +EXPECT_NEAR(3.6, m_air, 0.01); +} - // Run and Check: VRFOU_TeTc - { // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature - // at cooling mode, or evaporating temperature at heating mode, given the coil heat - // release/extract amount and air side parameters. - { // a. Condenser - - // Inputs_condition - m_air = 3.6; - Q_h_OU = 27551; - OutDryBulbTemp = 28; - OutHumRat = 0.0146; - SC = 1; - - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( - *state, HXOpMode::CondMode, Q_h_OU, SC, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tdischarge); - - // Test - EXPECT_NEAR(36, Tdischarge, 0.05); - } +{ + // b. Evaporator - { - // b. Evaporator + // Inputs_condition + Q_c_OU = 24456; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + SH = 1; + Tsuction = -3; - // Inputs_condition - m_air = 3.6; - Q_c_OU = 24456; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - SH = 1; - Tsuction = -3; + // Run + m_air = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::EvapMode, Tsuction, SH, Q_c_OU, OutDryBulbTemp, OutHumRat); + + // Test + EXPECT_NEAR(3.6, m_air, 0.01); +} +} - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( - *state, HXOpMode::EvapMode, Q_c_OU, SH, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tsuction); +// Run and Check: VRFOU_TeTc +{ // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature + // at cooling mode, or evaporating temperature at heating mode, given the coil heat + // release/extract amount and air side parameters. + {// a. Condenser + + // Inputs_condition + m_air = 3.6; +Q_h_OU = 27551; +OutDryBulbTemp = 28; +OutHumRat = 0.0146; +SC = 1; + +// Run +state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( + *state, HXOpMode::CondMode, Q_h_OU, SC, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tdischarge); + +// Test +EXPECT_NEAR(36, Tdischarge, 0.05); +} - // Test - EXPECT_NEAR(-3, Tsuction, 0.05); - } - } +{ + // b. Evaporator + + // Inputs_condition + m_air = 3.6; + Q_c_OU = 24456; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + SH = 1; + Tsuction = -3; + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( + *state, HXOpMode::EvapMode, Q_c_OU, SH, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tsuction); + + // Test + EXPECT_NEAR(-3, Tsuction, 0.05); +} +} - // Run and Check: VRFOU_SCSH +// Run and Check: VRFOU_SCSH +{ + // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature + // at cooling mode, or evaporating temperature at heating mode, given the coil heat + // release/extract amount and air side parameters. { - // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature - // at cooling mode, or evaporating temperature at heating mode, given the coil heat - // release/extract amount and air side parameters. - { - // a. Condenser - - // Inputs_condition - m_air = 3.6; - Q_h_OU = 27551; - OutDryBulbTemp = 28; - OutHumRat = 0.0146; - Tdischarge = 36; - - // Run - SC = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( - *state, HXOpMode::CondMode, Q_h_OU, Tdischarge, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); - - // Test - EXPECT_NEAR(1, SC, 0.01); - } + // a. Condenser + + // Inputs_condition + m_air = 3.6; + Q_h_OU = 27551; + OutDryBulbTemp = 28; + OutHumRat = 0.0146; + Tdischarge = 36; - { - // b. Evaporator + // Run + SC = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( + *state, HXOpMode::CondMode, Q_h_OU, Tdischarge, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); - // Inputs_condition - m_air = 3.6; - Q_c_OU = 24456; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - Tsuction = -3; + // Test + EXPECT_NEAR(1, SC, 0.01); + } - // Run - SH = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( - *state, HXOpMode::EvapMode, Q_c_OU, Tsuction, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); + { + // b. Evaporator - // Test - EXPECT_NEAR(1, SH, 0.01); - } + // Inputs_condition + m_air = 3.6; + Q_c_OU = 24456; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + Tsuction = -3; + + // Run + SH = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( + *state, HXOpMode::EvapMode, Q_c_OU, Tsuction, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); + + // Test + EXPECT_NEAR(1, SH, 0.01); } - // Clean up - state->dataHVACVarRefFlow->VRF.deallocate(); +} +// Clean up +state->dataHVACVarRefFlow->VRF.deallocate(); } TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_GetCoilInput) diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 02bf71ec73b..02079680f88 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -7208,7 +7208,10 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo state->dataSize->SysSizInput.allocate(state->dataSize->NumSysSizInput); state->dataSize->SysSizInput(1).AirLoopNum = 1; state->dataSize->SysSizInput(1).SizingOption = DataSizing::NonCoincident; - auto degC_to_F = [](Real64 celsius) constexpr { return celsius * (9.0 / 5.0) + 32.0; }; + auto degC_to_F = [](Real64 celsius) constexpr + { + return celsius * (9.0 / 5.0) + 32.0; + }; constexpr Real64 coolMixTempSys = 26.2; constexpr Real64 coolMixTempSysIP = degC_to_F(coolMixTempSys); constexpr Real64 heatMixTempSys = -1.7;