From 869f3af4b3ce11543319ede844e710cd64890c3a Mon Sep 17 00:00:00 2001 From: mjwitte Date: Thu, 21 Mar 2019 12:36:11 -0500 Subject: [PATCH 001/136] Fix WAHP simultaneous heat-cool with dehumid load plus heating load --- src/EnergyPlus/Furnaces.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 6f3b72763ff..ed272522f66 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -10639,7 +10639,7 @@ namespace Furnaces { } if (Furnace(FurnaceNum).FurnaceType_Num != UnitarySys_HeatCool) { - if (QZnReq > SmallLoad) { + if ((QZnReq > SmallLoad) && Furnace(FurnaceNum).HeatCoolMode == Heating) { if (Furnace(FurnaceNum).bIsIHP) { SimIHP(BlankString, Furnace(FurnaceNum).HeatingCoilIndex, @@ -10797,7 +10797,7 @@ namespace Furnaces { } if (Furnace(FurnaceNum).FurnaceType_Num != UnitarySys_HeatCool) { - if (QZnReq > SmallLoad) { + if ((QZnReq > SmallLoad) && (Furnace(FurnaceNum).HeatCoolMode == Heating)) { if (Furnace(FurnaceNum).bIsIHP) { SimIHP(BlankString, Furnace(FurnaceNum).HeatingCoilIndex, From 272b4f052b19d426a0edbb4ff570d654cb6eba5b Mon Sep 17 00:00:00 2001 From: mjwitte Date: Thu, 21 Mar 2019 12:55:45 -0500 Subject: [PATCH 002/136] Fix again WAHP simultaneous heat-cool with dehumid load plus heating load --- src/EnergyPlus/Furnaces.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index ed272522f66..da89f65ea54 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -10639,7 +10639,7 @@ namespace Furnaces { } if (Furnace(FurnaceNum).FurnaceType_Num != UnitarySys_HeatCool) { - if ((QZnReq > SmallLoad) && Furnace(FurnaceNum).HeatCoolMode == Heating) { + if ((QZnReq > SmallLoad) && HeatingLoad) { if (Furnace(FurnaceNum).bIsIHP) { SimIHP(BlankString, Furnace(FurnaceNum).HeatingCoilIndex, @@ -10797,7 +10797,7 @@ namespace Furnaces { } if (Furnace(FurnaceNum).FurnaceType_Num != UnitarySys_HeatCool) { - if ((QZnReq > SmallLoad) && (Furnace(FurnaceNum).HeatCoolMode == Heating)) { + if ((QZnReq > SmallLoad) && HeatingLoad) { if (Furnace(FurnaceNum).bIsIHP) { SimIHP(BlankString, Furnace(FurnaceNum).HeatingCoilIndex, From 0dd3258f37425e621271d635537f767fae49e2ec Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Thu, 4 Apr 2019 08:42:41 -0700 Subject: [PATCH 003/136] first commit --- src/EnergyPlus/Psychrometrics.cc | 10 ++++++++ src/EnergyPlus/Psychrometrics.hh | 42 +++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 236a80349e6..fa0797dec54 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -67,9 +67,11 @@ namespace EnergyPlus { #ifdef EP_nocache_Psychrometrics #undef EP_cache_PsyTwbFnTdbWPb #undef EP_cache_PsyPsatFnTemp +#undef EP_cache_PsyTsatFnPb #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp +//#define EP_cache_PsyTsatFnPb #endif #define EP_psych_errors @@ -1351,9 +1353,17 @@ namespace Psychrometrics { } #endif +#ifdef EP_cache_PsyPsatFnPb + + Real64 PsyTsatFnPb_raw(Real64 const Press, // barometric pressure {Pascals} + std::string const &CalledFrom // routine this function was called from (error messages) + ) + +#else Real64 PsyTsatFnPb(Real64 const Press, // barometric pressure {Pascals} std::string const &CalledFrom // routine this function was called from (error messages) ) +#endif { // FUNCTION INFORMATION: diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index abad58c3851..964bac64621 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -67,9 +67,11 @@ namespace EnergyPlus { #ifdef EP_nocache_Psychrometrics #undef EP_cache_PsyTwbFnTdbWPb #undef EP_cache_PsyPsatFnTemp +#undef EP_cache_PsyTsatFnPb #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp +//#define EP_cache_PsyTsatFnPb #endif #define EP_psych_errors @@ -174,7 +176,19 @@ namespace Psychrometrics { } }; #endif +#ifdef EP_cache_PsyTsatFnPb + struct cached_tsat_pb + { + // Members + Int64 iPb; + Real64 Tsat; + // Default Constructor + cached_tsat_pb() : iPb(-1000), Tsat(0.0) + { + } + }; +#endif // Object Data #ifdef EP_cache_PsyTwbFnTdbWPb extern Array1D cached_Twb; // DIMENSION(0:twbcache_size) @@ -182,7 +196,9 @@ namespace Psychrometrics { #ifdef EP_cache_PsyPsatFnTemp extern Array1D cached_Psat; // DIMENSION(0:psatcache_size) #endif - +#ifdef EP_cache_PsyTsatFnPb + extern Array1D cached_Tsat; // DIMENSION(0:tsatcache_size) +#endif // Subroutine Specifications for the Module // Functions @@ -1043,9 +1059,33 @@ namespace Psychrometrics { return PsyHFnTdbW(TDB, max(PsyWFnTdbRhPb(TDB, RH, PB, CalledFrom), 1.0e-5)); // enthalpy {J/kg} } +#ifdef EP_cache_PsyPsatFnPb + + Real64 PsyTsatFnPb_raw(Real64 const Press, // barometric pressure {Pascals} + std::string const &CalledFrom = blank_string // routine this function was called from (error messages) + ); + + inline Real64 PsyTsatFnPb(Real64 const Press, // barometric pressure {Pascals} + std::string const &CalledFrom = blank_string // routine this function was called from (error messages) + ) + { + Int64 const Pb_tag(Press); + Int64 const hash(Pb_tag & tsatcache_mask); + auto &cTsat(cached_Tsat[hash]); + + if (cTsat.iPb != Pb_tag) { + cTsat.iPb = Pb_tag; + cTsat.Tsat = PsyTsatFnPb_raw(Press, CalledFrom); + } + + return cTsat.Tsat; // saturation pressure {Pascals} + } + +#else Real64 PsyTsatFnPb(Real64 const Press, // barometric pressure {Pascals} std::string const &CalledFrom = blank_string // routine this function was called from (error messages) ); +#endif inline Real64 PsyTdpFnWPb(Real64 const W, // humidity ratio Real64 const PB, // barometric pressure (N/M**2) {Pascals} From c046569a4d7f2be9d2df3ad6ca051a60eebaff4f Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Thu, 4 Apr 2019 13:58:20 -0700 Subject: [PATCH 004/136] TsatFnPb --- src/EnergyPlus/DataGlobals.cc | 7 +++++++ src/EnergyPlus/DataGlobals.hh | 3 +++ src/EnergyPlus/EnergyPlusPgm.cc | 1 + src/EnergyPlus/Psychrometrics.cc | 16 +++++++++++++--- src/EnergyPlus/Psychrometrics.hh | 14 +++++++++----- 5 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index 7d6c3d013ad..b05d9a1d8f7 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -264,6 +264,10 @@ namespace DataGlobals { void (*fProgressPtr)(int const); void (*fMessagePtr)(std::string const &); +// int timer_1(0); +// int timer_2(0); +// int timer_3(0); + // Clears the global data in DataGlobals. // Needed for unit tests, should not be normally called. void clear_state() @@ -362,6 +366,9 @@ namespace DataGlobals { err_stream = nullptr; eio_stream = nullptr; delightin_stream = nullptr; +// timer_1 = 0; +// timer_2 = 0; +// timer_3 = 0; } } // namespace DataGlobals diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index 216dff85520..c380f5e87e5 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -302,6 +302,9 @@ namespace DataGlobals { extern void (*fProgressPtr)(int const); extern void (*fMessagePtr)(std::string const &); +// extern int timer_1; +// extern int timer_2; +// extern int timer_3; // Clears the global data in DataGlobals. // Needed for unit tests, should not be normally called. void clear_state(); diff --git a/src/EnergyPlus/EnergyPlusPgm.cc b/src/EnergyPlus/EnergyPlusPgm.cc index a30ff909eec..9809b3e7b28 100644 --- a/src/EnergyPlus/EnergyPlusPgm.cc +++ b/src/EnergyPlus/EnergyPlusPgm.cc @@ -469,6 +469,7 @@ int RunEnergyPlus(std::string const & filepath) EnergyPlus::inputProcessor->reportOrphanRecordObjects(); ReportOrphanFluids(); ReportOrphanSchedules(); +// std::cout << "Timer 1: " << DataGlobals::timer_1 << " Timer 2: " << DataGlobals::timer_2; if (runReadVars) { std::string readVarsPath = exeDirectory + "ReadVarsESO" + exeExtension; diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index fa0797dec54..394280635fd 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -71,7 +71,7 @@ namespace EnergyPlus { #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp -//#define EP_cache_PsyTsatFnPb +#define EP_cache_PsyTsatFnPb #endif #define EP_psych_errors @@ -200,7 +200,11 @@ namespace Psychrometrics { int const psatprecision_bits(24); // 28 // 24 // 32 Int64 const psatcache_mask(psatcache_size - 1); #endif - +#ifdef EP_cache_PsyTsatFnPb + int const tsatcache_size(1024 * 1024); + int const tsatprecision_bits(24); // 28 //24 //32 + Int64 const tsatcache_mask(psatcache_size - 1); +#endif // MODULE VARIABLE DECLARATIONS: // na @@ -220,6 +224,9 @@ namespace Psychrometrics { #ifdef EP_cache_PsyPsatFnTemp Array1D cached_Psat; // DIMENSION(0:psatcache_size) #endif +#ifdef EP_cache_PsyTsatFnPb + Array1D cached_Tsat; // DIMENSION(0:tsatcache_size) +#endif // Subroutine Specifications for the Module @@ -283,6 +290,9 @@ namespace Psychrometrics { #endif #ifdef EP_cache_PsyPsatFnTemp cached_Psat.allocate({0, psatcache_size}); +#endif +#ifdef EP_cache_PsyTsatFnPb + cached_Tsat.allocate({0, tsatcache_size}); #endif } @@ -1353,7 +1363,7 @@ namespace Psychrometrics { } #endif -#ifdef EP_cache_PsyPsatFnPb +#ifdef EP_cache_PsyTsatFnPb Real64 PsyTsatFnPb_raw(Real64 const Press, // barometric pressure {Pascals} std::string const &CalledFrom // routine this function was called from (error messages) diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 964bac64621..1dea07e53d5 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -71,7 +71,7 @@ namespace EnergyPlus { #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp -//#define EP_cache_PsyTsatFnPb +#define EP_cache_PsyTsatFnPb #endif #define EP_psych_errors @@ -130,6 +130,11 @@ namespace Psychrometrics { extern int const psatprecision_bits; // 28 //24 //32 extern Int64 const psatcache_mask; #endif +#ifdef EP_cache_PsyTsatFnPb + extern int const tsatcache_size; + extern int const tsatprecision_bits; // 28 //24 //32 + extern Int64 const tsatcache_mask; +#endif // MODULE VARIABLE DECLARATIONS: // na @@ -1059,7 +1064,7 @@ namespace Psychrometrics { return PsyHFnTdbW(TDB, max(PsyWFnTdbRhPb(TDB, RH, PB, CalledFrom), 1.0e-5)); // enthalpy {J/kg} } -#ifdef EP_cache_PsyPsatFnPb +#ifdef EP_cache_PsyTsatFnPb Real64 PsyTsatFnPb_raw(Real64 const Press, // barometric pressure {Pascals} std::string const &CalledFrom = blank_string // routine this function was called from (error messages) @@ -1071,9 +1076,8 @@ namespace Psychrometrics { { Int64 const Pb_tag(Press); Int64 const hash(Pb_tag & tsatcache_mask); - auto &cTsat(cached_Tsat[hash]); - - if (cTsat.iPb != Pb_tag) { + auto &cTsat(cached_Tsat(hash)); + if (cTsat.iPb != Pb_tag) { cTsat.iPb = Pb_tag; cTsat.Tsat = PsyTsatFnPb_raw(Press, CalledFrom); } From 0d6921e70ae63556bc4f810f4f48650e65d8de2b Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Fri, 5 Apr 2019 14:29:21 -0700 Subject: [PATCH 005/136] test cache --- src/EnergyPlus/Psychrometrics.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 394280635fd..2f3d39b4de6 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -203,7 +203,7 @@ namespace Psychrometrics { #ifdef EP_cache_PsyTsatFnPb int const tsatcache_size(1024 * 1024); int const tsatprecision_bits(24); // 28 //24 //32 - Int64 const tsatcache_mask(psatcache_size - 1); + Int64 const tsatcache_mask(tsatcache_size - 1); #endif // MODULE VARIABLE DECLARATIONS: // na From 2132100f1acac87c8a6d7a8bc6c9223aa85afd30 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Sun, 7 Apr 2019 18:03:10 -0400 Subject: [PATCH 006/136] test-tsat --- src/EnergyPlus/Psychrometrics.cc | 81 ++++++++++++++++++++++++++++++-- src/EnergyPlus/Psychrometrics.hh | 32 ++++++++++++- 2 files changed, 108 insertions(+), 5 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 394280635fd..2205ca55656 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -72,6 +72,7 @@ namespace EnergyPlus { #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp #define EP_cache_PsyTsatFnPb +#define EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors @@ -204,6 +205,10 @@ namespace Psychrometrics { int const tsatcache_size(1024 * 1024); int const tsatprecision_bits(24); // 28 //24 //32 Int64 const tsatcache_mask(psatcache_size - 1); +#endif +#ifdef EP_cache_PsyTsatFnHPb + int const tsat_hbp_cache_size(1024 * 1024); + int const tsat_hbp_precision_bits(24); // 28 //24 //32 #endif // MODULE VARIABLE DECLARATIONS: // na @@ -227,7 +232,9 @@ namespace Psychrometrics { #ifdef EP_cache_PsyTsatFnPb Array1D cached_Tsat; // DIMENSION(0:tsatcache_size) #endif - +#ifdef EP_cache_PsyTsatFnHPb + Array1D cached_Tsat_HPb; // DIMENSION(0:tsat_hbp_cache_size) +#endif // Subroutine Specifications for the Module // Functions @@ -246,6 +253,12 @@ namespace Psychrometrics { #endif #ifdef EP_cache_PsyPsatFnTemp cached_Psat.deallocate(); +#endif +#ifdef EP_cache_PsyTsatFnPb + cached_Tsat.deallocate(); +#endif +#ifdef EP_cache_PsyTsatFnHPb + cached_Tsat_HPb.deallocate(); #endif } @@ -293,6 +306,9 @@ namespace Psychrometrics { #endif #ifdef EP_cache_PsyTsatFnPb cached_Tsat.allocate({0, tsatcache_size}); +#endif +#ifdef EP_cache_PsyTsatFnHPb + cached_Tsat_HPb.allocate({0, tsat_hbp_cache_size}); #endif } @@ -1008,12 +1024,65 @@ namespace Psychrometrics { } #endif - Real64 PsyTsatFnHPb(Real64 const H, // enthalpy {J/kg} - Real64 const PB, // barometric pressure {Pascals} + Real64 PsyTsatFnHPb(Real64 const H, + Real64 const Pb, // barometric pressure {Pascals} std::string const &CalledFrom // routine this function was called from (error messages) ) { + + Real64 Tsat_result; // result=> Sat-Temp {C} + + Int64 const Grid_Shift((64 - 12 - tsat_hbp_precision_bits)); + + // INTERFACE BLOCK SPECIFICATIONS: + // na + + // DERIVED TYPE DEFINITIONS: + // na + + // FUNCTION LOCAL VARIABLE DECLARATIONS: + Int64 H_tag; + Int64 Pb_tag; + Int64 hash; + Real64 H_tag_r; + Real64 Pb_tag_r; +// timer_2 += 1; + +#ifdef EP_psych_stats + ++NumTimesCalled(iPsyTwbFnTdbWPb_cache); +#endif + + H_tag = bit_transfer(H, H_tag); + Pb_tag = bit_transfer(Pb, Pb_tag); + + H_tag = bit_shift(H_tag, -Grid_Shift); + Pb_tag = bit_shift(Pb_tag, -Grid_Shift); + hash = bit_and(bit_xor(H_tag, Pb_tag), Int64(tsat_hbp_cache_size - 1)); + + if (cached_Tsat_HPb(hash).iH != H_tag || cached_Tsat_HPb(hash).iPb != Pb_tag) { + cached_Tsat_HPb(hash).iH = H_tag; + cached_Tsat_HPb(hash).iPb = Pb_tag; + + H_tag_r = bit_transfer(bit_shift(H_tag, Grid_Shift), H_tag_r); + Pb_tag_r = bit_transfer(bit_shift(Pb_tag, Grid_Shift), Pb_tag_r); + + cached_Tsat_HPb(hash).Tsat = PsyTsatFnHPb_raw(H_tag_r, Pb_tag_r, CalledFrom); + } + + // Twbresult_last = cached_Twb(hash)%Twb + // Twb_result = Twbresult_last + Tsat_result = cached_Tsat_HPb(hash).Tsat; + + return Tsat_result; + } + + Real64 PsyTsatFnHPb_raw(Real64 const H, // enthalpy {J/kg} + Real64 const PB, // barometric pressure {Pascals} + std::string const &CalledFrom // routine this function was called from (error messages) + ) + { + // FUNCTION INFORMATION: // AUTHOR George Shih // DATE WRITTEN May 1976 @@ -1059,9 +1128,10 @@ namespace Psychrometrics { Real64 HH; // temporary enthalpy (calculation) value bool FlagError; // Set when errors should be flagged Real64 Hloc; // local value of H +// timer_1 += 1; // CHECK H IN RANGE. - HH = H + 1.78637e4; + HH = H + 1.78637e4; //TODO: what is that??? if (H >= 0.0) { Hloc = max(0.00001, H); @@ -1092,6 +1162,9 @@ namespace Psychrometrics { } } #endif + // Array1D CaseRange = [-4.24e4, -2.2138e4, -6.7012e2, 2.7297e4, 7.5222e4, 1.8379e5, 4.7577e5, 1.5445e6, 3.8353e6, 4.5866e7]; + // Real64 CaseIndex = 0; + if (HH > 7.5222e4) goto Label20; if (HH > 2.7297e4) goto Label60; if (HH > -6.7012e2) goto Label50; diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 1dea07e53d5..ef92a0c27fc 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -72,6 +72,7 @@ namespace EnergyPlus { #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp #define EP_cache_PsyTsatFnPb +#define EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors @@ -135,6 +136,10 @@ namespace Psychrometrics { extern int const tsatprecision_bits; // 28 //24 //32 extern Int64 const tsatcache_mask; #endif +#ifdef EP_cache_PsyTsatFnHPb + extern int const tsat_hbp_cache_size; + extern int const tsat_hbp_precision_bits; +#endif // MODULE VARIABLE DECLARATIONS: // na @@ -167,7 +172,20 @@ namespace Psychrometrics { } }; #endif +#ifdef EP_cache_PsyTsatFnHPb + struct cached_tsat_h_pb + { + // Members + Int64 iH; + Int64 iPb; + Real64 Tsat; + // Default Constructor + cached_tsat_h_pb() : iH(0), iPb(0), Tsat(0.0) + { + } + }; +#endif #ifdef EP_cache_PsyPsatFnTemp struct cached_psat_t { @@ -203,6 +221,9 @@ namespace Psychrometrics { #endif #ifdef EP_cache_PsyTsatFnPb extern Array1D cached_Tsat; // DIMENSION(0:tsatcache_size) +#endif +#ifdef EP_cache_PsyTsatFnHPb + extern Array1D cached_Tsat_HPb; // DIMENSION(0:tsat_hbp_cache_size) #endif // Subroutine Specifications for the Module @@ -729,6 +750,10 @@ namespace Psychrometrics { Real64 const PB, // barometric pressure {Pascals} std::string const &CalledFrom = blank_string // routine this function was called from (error messages) ); + Real64 PsyTsatFnHPb_raw(Real64 const H, // enthalpy {J/kg} + Real64 const PB, // barometric pressure {Pascals} + std::string const &CalledFrom = blank_string // routine this function was called from (error messages) + ); inline Real64 PsyRhovFnTdbRh(Real64 const Tdb, // dry-bulb temperature {C} Real64 const RH, // relative humidity value (0.0-1.0) @@ -1074,7 +1099,12 @@ namespace Psychrometrics { std::string const &CalledFrom = blank_string // routine this function was called from (error messages) ) { - Int64 const Pb_tag(Press); + + Int64 const Grid_Shift(28); // Tuned This is a hot spot + assert(Grid_Shift == 64 - 12 - tsatprecision_bits); // Force Grid_Shift updates when precision bits changes + Int64 const Pb_tag( + bit_shift(bit_transfer(Press, Grid_Shift), -Grid_Shift)); // Note that 2nd arg to TRANSFER is not used: Only type matters +// Int64 const Pb_tag(Press); Int64 const hash(Pb_tag & tsatcache_mask); auto &cTsat(cached_Tsat(hash)); if (cTsat.iPb != Pb_tag) { From 4f6cc4466856df9497125fff2020e3c0b6251ebc Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Sun, 7 Apr 2019 18:14:38 -0400 Subject: [PATCH 007/136] undef tsat --- src/EnergyPlus/Psychrometrics.cc | 2 +- src/EnergyPlus/Psychrometrics.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 8122a84743d..a9eff5d8106 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -71,7 +71,7 @@ namespace EnergyPlus { #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp -#define EP_cache_PsyTsatFnPb +#undef EP_cache_PsyTsatFnPb #define EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index ef92a0c27fc..73ba73cd1b6 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -71,7 +71,7 @@ namespace EnergyPlus { #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp -#define EP_cache_PsyTsatFnPb +#undef EP_cache_PsyTsatFnPb #define EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors From 0ef3a9328fc4f51ddafb52c6431b39cae03d40e4 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Fri, 31 May 2019 15:49:38 +0800 Subject: [PATCH 008/136] psy clean up --- src/EnergyPlus/Psychrometrics.cc | 82 ++++---------------------------- src/EnergyPlus/Psychrometrics.hh | 68 ++++++++++++++++++++++++-- 2 files changed, 73 insertions(+), 77 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index a9eff5d8106..c0cf0eb8ab6 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -68,11 +68,12 @@ namespace EnergyPlus { #undef EP_cache_PsyTwbFnTdbWPb #undef EP_cache_PsyPsatFnTemp #undef EP_cache_PsyTsatFnPb +#undef EP_cache_PsyTsatFnHPb #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp #undef EP_cache_PsyTsatFnPb -#define EP_cache_PsyTsatFnHPb +#undef EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors @@ -1024,63 +1025,18 @@ namespace Psychrometrics { } #endif - Real64 PsyTsatFnHPb(Real64 const H, - Real64 const Pb, // barometric pressure {Pascals} - std::string const &CalledFrom // routine this function was called from (error messages) - ) - { - - - Real64 Tsat_result; // result=> Sat-Temp {C} - - Int64 const Grid_Shift((64 - 12 - tsat_hbp_precision_bits)); - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - - // FUNCTION LOCAL VARIABLE DECLARATIONS: - Int64 H_tag; - Int64 Pb_tag; - Int64 hash; - Real64 H_tag_r; - Real64 Pb_tag_r; -// timer_2 += 1; - -#ifdef EP_psych_stats - ++NumTimesCalled(iPsyTwbFnTdbWPb_cache); -#endif - - H_tag = bit_transfer(H, H_tag); - Pb_tag = bit_transfer(Pb, Pb_tag); - - H_tag = bit_shift(H_tag, -Grid_Shift); - Pb_tag = bit_shift(Pb_tag, -Grid_Shift); - hash = bit_and(bit_xor(H_tag, Pb_tag), Int64(tsat_hbp_cache_size - 1)); - - if (cached_Tsat_HPb(hash).iH != H_tag || cached_Tsat_HPb(hash).iPb != Pb_tag) { - cached_Tsat_HPb(hash).iH = H_tag; - cached_Tsat_HPb(hash).iPb = Pb_tag; - - H_tag_r = bit_transfer(bit_shift(H_tag, Grid_Shift), H_tag_r); - Pb_tag_r = bit_transfer(bit_shift(Pb_tag, Grid_Shift), Pb_tag_r); - - cached_Tsat_HPb(hash).Tsat = PsyTsatFnHPb_raw(H_tag_r, Pb_tag_r, CalledFrom); - } - - // Twbresult_last = cached_Twb(hash)%Twb - // Twb_result = Twbresult_last - Tsat_result = cached_Tsat_HPb(hash).Tsat; - - return Tsat_result; - } +#ifdef EP_cache_PsyTsatFnHPb Real64 PsyTsatFnHPb_raw(Real64 const H, // enthalpy {J/kg} Real64 const PB, // barometric pressure {Pascals} std::string const &CalledFrom // routine this function was called from (error messages) ) +#else + Real64 PsyTsatFnHPb(Real64 const H, // enthalpy {J/kg} + Real64 const PB, // barometric pressure {Pascals} + std::string const &CalledFrom // routine this function was called from (error messages) + ) +#endif { // FUNCTION INFORMATION: @@ -1093,29 +1049,12 @@ namespace Psychrometrics { // This function provides the saturation temperature from the enthalpy // and barometric pressure. - // METHODOLOGY EMPLOYED: - // na - // REFERENCES: // ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P99, EQN 22 - // USE STATEMENTS: - // Return value Real64 T; // result=> saturation temperature {C} - // Locals - // FUNCTION ARGUMENT DEFINITIONS: - - // FUNCTION PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // FUNCTION LOCAL VARIABLE DECLARATIONS: Real64 T1; // APPROXIMATE SATURATION TEMPERATURE (C) Real64 T2; // APPROXIMATE SATURATION TEMPERATURE (C) @@ -1128,9 +1067,7 @@ namespace Psychrometrics { Real64 HH; // temporary enthalpy (calculation) value bool FlagError; // Set when errors should be flagged Real64 Hloc; // local value of H -// timer_1 += 1; - // CHECK H IN RANGE. HH = H + 1.78637e4; //TODO: what is that??? if (H >= 0.0) { @@ -1143,6 +1080,7 @@ namespace Psychrometrics { ++NumTimesCalled(iPsyTsatFnHPb); #endif + FlagError = false; #ifdef EP_psych_errors if (HH <= -4.24E4 || HH >= 4.5866E7) { diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 73ba73cd1b6..800f207a714 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -72,7 +72,7 @@ namespace EnergyPlus { #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp #undef EP_cache_PsyTsatFnPb -#define EP_cache_PsyTsatFnHPb +#undef EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors @@ -746,14 +746,72 @@ namespace Psychrometrics { #endif - Real64 PsyTsatFnHPb(Real64 const H, // enthalpy {J/kg} - Real64 const PB, // barometric pressure {Pascals} - std::string const &CalledFrom = blank_string // routine this function was called from (error messages) - ); + +#ifdef EP_cache_PsyTsatFnHPb Real64 PsyTsatFnHPb_raw(Real64 const H, // enthalpy {J/kg} Real64 const PB, // barometric pressure {Pascals} std::string const &CalledFrom = blank_string // routine this function was called from (error messages) ); + inline Real64 PsyTsatFnHPb(Real64 const H, + Real64 const Pb, // barometric pressure {Pascals} + std::string const &CalledFrom = blank_string // routine this function was called from (error messages) + ) + { + + + Real64 Tsat_result; // result=> Sat-Temp {C} + + Int64 const Grid_Shift((64 - 12 - tsat_hbp_precision_bits)); + + // INTERFACE BLOCK SPECIFICATIONS: + // na + + // DERIVED TYPE DEFINITIONS: + // na + + // FUNCTION LOCAL VARIABLE DECLARATIONS: + Int64 H_tag; + Int64 Pb_tag; + Int64 hash; + Real64 H_tag_r; + Real64 Pb_tag_r; + +#ifdef EP_psych_stats + ++NumTimesCalled(iPsyTwbFnTdbWPb_cache); +#endif + + H_tag = bit_transfer(H, H_tag); + Pb_tag = bit_transfer(Pb, Pb_tag); + + H_tag = bit_shift(H_tag, -Grid_Shift); + Pb_tag = bit_shift(Pb_tag, -Grid_Shift); + hash = bit_and(bit_xor(H_tag, Pb_tag), Int64(tsat_hbp_cache_size - 1)); + + if (cached_Tsat_HPb(hash).iH != H_tag || cached_Tsat_HPb(hash).iPb != Pb_tag) { + cached_Tsat_HPb(hash).iH = H_tag; + cached_Tsat_HPb(hash).iPb = Pb_tag; + + H_tag_r = bit_transfer(bit_shift(H_tag, Grid_Shift), H_tag_r); + Pb_tag_r = bit_transfer(bit_shift(Pb_tag, Grid_Shift), Pb_tag_r); + + cached_Tsat_HPb(hash).Tsat = PsyTsatFnHPb(H_tag_r, Pb_tag_r, CalledFrom); + } + + // Twbresult_last = cached_Twb(hash)%Twb + // Twb_result = Twbresult_last + Tsat_result = cached_Tsat_HPb(hash).Tsat; + + return Tsat_result; + } + +#else + + Real64 PsyTsatFnHPb(Real64 const H, // enthalpy {J/kg} + Real64 const PB, // barometric pressure {Pascals} + std::string const &CalledFrom = blank_string // routine this function was called from (error messages) + ); + +#endif inline Real64 PsyRhovFnTdbRh(Real64 const Tdb, // dry-bulb temperature {C} Real64 const RH, // relative humidity value (0.0-1.0) From 077bd18a045ea5db0d8c8c647131af3f76357f34 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Fri, 31 May 2019 19:17:36 +0800 Subject: [PATCH 009/136] convert fortran --- src/EnergyPlus/Psychrometrics.cc | 179 ++++++++++++++----------------- 1 file changed, 82 insertions(+), 97 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index c0cf0eb8ab6..5e6f15abb30 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -209,7 +209,7 @@ namespace Psychrometrics { #endif #ifdef EP_cache_PsyTsatFnHPb int const tsat_hbp_cache_size(1024 * 1024); - int const tsat_hbp_precision_bits(24); // 28 //24 //32 + int const tsat_hbp_precision_bits(20); // 28 //24 //32 #endif // MODULE VARIABLE DECLARATIONS: // na @@ -1068,7 +1068,7 @@ namespace Psychrometrics { bool FlagError; // Set when errors should be flagged Real64 Hloc; // local value of H - HH = H + 1.78637e4; //TODO: what is that??? + HH = H + 1.78637e4; if (H >= 0.0) { Hloc = max(0.00001, H); @@ -1100,109 +1100,94 @@ namespace Psychrometrics { } } #endif - // Array1D CaseRange = [-4.24e4, -2.2138e4, -6.7012e2, 2.7297e4, 7.5222e4, 1.8379e5, 4.7577e5, 1.5445e6, 3.8353e6, 4.5866e7]; - // Real64 CaseIndex = 0; - - if (HH > 7.5222e4) goto Label20; - if (HH > 2.7297e4) goto Label60; - if (HH > -6.7012e2) goto Label50; - if (HH > -2.2138e4) goto Label40; - if (HH < -4.24e4) HH = -4.24e4; // Peg to minimum - goto Label30; - Label20:; - if (HH < 1.8379e5) goto Label70; - if (HH < 4.7577e5) goto Label80; - if (HH < 1.5445e6) goto Label90; - if (HH < 3.8353e6) goto Label100; - if (HH > 4.5866e7) HH = 4.5866e7; // Peg to maximum - goto Label110; - // TEMP. IS FROM -60 C TO -40 C - Label30:; - T = F6(HH, -19.44, 8.53675e-4, -5.12637e-9, -9.85546e-14, -1.00102e-18, -4.2705e-24); - goto Label120; - // TEMP. IS FROM -40 C TO -20 C - Label40:; - T = F6(HH, -1.94224e1, 8.5892e-4, -4.50709e-9, -6.19492e-14, 8.71734e-20, 8.73051e-24); - goto Label120; - // TEMP. IS FROM -20 C TO 0 C - Label50:; - T = F6(HH, -1.94224e1, 8.59061e-4, -4.4875e-9, -5.76696e-14, 7.72217e-19, 3.97894e-24); - goto Label120; - // TEMP. IS FROM 0 C TO 20 C - Label60:; - T = F6(HH, -2.01147e1, 9.04936e-4, -6.83305e-9, 2.3261e-14, 7.27237e-20, -6.31939e-25); - goto Label120; - // TEMP. IS FROM 20 C TO 40 C - Label70:; - T = F6(HH, -1.82124e1, 8.31683e-4, -6.16461e-9, 3.06411e-14, -8.60964e-20, 1.03003e-25); - goto Label120; - // TEMP. IS FROM 40 C TO 60 C - Label80:; - T = F6(HH, -1.29419, 3.88538e-4, -1.30237e-9, 2.78254e-15, -3.27225e-21, 1.60969e-27); - goto Label120; - // TEMP. IS FROM 60 C TO 80 C - Label90:; - T = F6(HH, 2.39214e1, 1.27519e-4, -1.52089e-10, 1.1043e-16, -4.33919e-23, 7.05296e-30); - goto Label120; - // TEMP. IS FROM 80 C TO 90 C - Label100:; - T = F6(HH, 4.88446e1, 3.85534e-5, -1.78805e-11, 4.87224e-18, -7.15283e-25, 4.36246e-32); - goto Label120; - // TEMP. IS FROM 90 C TO 100C - Label110:; - T = F7(HH, 7.60565e11, 5.80534e4, -7.36433e-3, 5.11531e-10, -1.93619e-17, 3.70511e-25, -2.77313e-33); - // IF THE BAROMETRIC PRESSURE IS - // EQUAL TO 1.0133E5 , SATURATION - // TEMP. IS CALCULATED BY ABOVE EQUA - // OTHERWISE TEMP. IS COMPUTED BY - // FOLLOWING ITERATION METHOD - Label120:; + std::array CaseRange = {-4.24e4, -2.2138e4, -6.7012e2, 2.7297e4, 7.5222e4, 1.8379e5, 4.7577e5, 1.5445e6, 3.8353e6, 4.5866e7}; + int CaseIndex = 0; + int beg(0), mid, end(9); // 1-based indexing + + while (beg + 1 < end) { + mid = ((beg + end) >> 1); + (HH > CaseRange[mid] ? beg : end) = mid; + } + + CaseIndex = beg + 1; + + switch(CaseIndex) { + case 0 : + HH = -4.24e4; //HH < -4.24e4, Peg to minimum + case 1 : // -2.2138e4 > HH > -4.24e4 + T = F6(HH, -19.44, 8.53675e-4, -5.12637e-9, -9.85546e-14, -1.00102e-18, -4.2705e-24); + break; + case 2 : // -6.7012e2 > HH > -2.2138e4 + T = F6(HH, -1.94224e1, 8.5892e-4, -4.50709e-9, -6.19492e-14, 8.71734e-20, 8.73051e-24); + break; + case 3 : // 2.7297e4 > HH > -6.7012e2 + T = F6(HH, -1.94224e1, 8.59061e-4, -4.4875e-9, -5.76696e-14, 7.72217e-19, 3.97894e-24); + break; + case 4 :// 7.5222e4 > HH > 2.7297e4 + T = F6(HH, -2.01147e1, 9.04936e-4, -6.83305e-9, 2.3261e-14, 7.27237e-20, -6.31939e-25); + break; + case 5 :// 7.5222e4 > HH > 2.7297e4 + T = F6(HH, -1.82124e1, 8.31683e-4, -6.16461e-9, 3.06411e-14, -8.60964e-20, 1.03003e-25); + break; + case 6 : + T = F6(HH, -1.29419, 3.88538e-4, -1.30237e-9, 2.78254e-15, -3.27225e-21, 1.60969e-27); + break; + case 7 : + T = F6(HH, 2.39214e1, 1.27519e-4, -1.52089e-10, 1.1043e-16, -4.33919e-23, 7.05296e-30); + break; + case 8 : + T = F6(HH, 4.88446e1, 3.85534e-5, -1.78805e-11, 4.87224e-18, -7.15283e-25, 4.36246e-32); + break; + case 10 : + HH = 4.5866e7; + case 9 : + T = F7(HH, 7.60565e11, 5.80534e4, -7.36433e-3, 5.11531e-10, -1.93619e-17, 3.70511e-25, -2.77313e-33); + break; + } + #ifdef EP_psych_errors if (FlagError) { ShowContinueError(" Initial Resultant Temperature= " + TrimSigDigits(T, 2)); } #endif - if (std::abs(PB - 1.0133e5) / 1.0133e5 <= 0.01) goto Label170; - IterCount = 0; - T1 = T; - H1 = PsyHFnTdbW(T1, PsyWFnTdbTwbPb(T1, T1, PB)); - Y1 = H1 - Hloc; - if (std::abs(Y1 / Hloc) <= 0.1e-4) goto Label140; - T2 = T1 * 0.9; - Label130:; - ++IterCount; - H2 = PsyHFnTdbW(T2, PsyWFnTdbTwbPb(T2, T2, PB)); - Y2 = H2 - Hloc; - if (std::abs(Y2 / Hloc) <= 0.1e-4) goto Label150; - if (Y2 == Y1) goto Label150; - TN = T2 - Y2 / (Y2 - Y1) * (T2 - T1); - if (IterCount > 30) goto Label160; - T1 = T2; - T2 = TN; - Y1 = Y2; - goto Label130; - Label140:; - T = T1; - goto Label170; - Label150:; - T = T2; - goto Label170; - Label160:; -#ifdef EP_psych_errors - if (FlagError) { - ShowSevereError("Temperature did not converge (PsyTsatFnHPb)"); - if (!CalledFrom.empty()) { - ShowContinueErrorTimeStamp(" Routine=" + CalledFrom + ','); + if (std::abs(PB - 1.0133e5) / 1.0133e5 > 0.01) { + IterCount = 0; + T1 = T; + H1 = PsyHFnTdbW(T1, PsyWFnTdbTwbPb(T1, T1, PB)); + Y1 = H1 - Hloc; + if (std::abs(Y1 / Hloc) <= 0.1e-4) { + T = T1; } else { - ShowContinueErrorTimeStamp(" Routine=Unknown,"); - } - String = " Enthalpy=" + TrimSigDigits(HH, 5) + " Pressure= " + TrimSigDigits(PB, 2); - ShowContinueError(String + " Last T=" + TrimSigDigits(T, 2)); - } + T2 = T1 * 0.9; + while (IterCount <= 30) { + ++IterCount; + H2 = PsyHFnTdbW(T2, PsyWFnTdbTwbPb(T2, T2, PB)); + Y2 = H2 - Hloc; + if (std::abs(Y2 / Hloc) <= 0.1e-4 || Y2 == Y1) { + T = T2; + break; + } + + TN = T2 - Y2 / (Y2 - Y1) * (T2 - T1); + T1 = T2; + T2 = TN; + Y1 = Y2; + } +#ifdef EP_psych_errors + if (FlagError && IterCount > 30){ + ShowSevereError("Temperature did not converge (PsyTsatFnHPb)"); + if (!CalledFrom.empty()) { + ShowContinueErrorTimeStamp(" Routine=" + CalledFrom + ','); + } else { + ShowContinueErrorTimeStamp(" Routine=Unknown,"); + } + String = " Enthalpy=" + TrimSigDigits(HH, 5) + " Pressure= " + TrimSigDigits(PB, 2); + ShowContinueError(String + " Last T=" + TrimSigDigits(T, 2)); + } #endif - Label170:; + } - // result is T + } return T; } From 49a926b1ed6145370bf025c892677da731eb284d Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Sun, 2 Jun 2019 09:48:32 +0800 Subject: [PATCH 010/136] cache-psy --- src/EnergyPlus/Psychrometrics.cc | 2 +- src/EnergyPlus/Psychrometrics.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 5e6f15abb30..a79108cfe82 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -72,7 +72,7 @@ namespace EnergyPlus { #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp -#undef EP_cache_PsyTsatFnPb +#define EP_cache_PsyTsatFnPb #undef EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 800f207a714..df60373ecbe 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -71,7 +71,7 @@ namespace EnergyPlus { #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp -#undef EP_cache_PsyTsatFnPb +#define EP_cache_PsyTsatFnPb #undef EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors From 0d8e3eef82ac191745af73824d8fe737454548e1 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Sun, 2 Jun 2019 18:52:37 +0800 Subject: [PATCH 011/136] cache-glyc --- src/EnergyPlus/FluidProperties.cc | 19 +++++++++--- src/EnergyPlus/FluidProperties.hh | 49 ++++++++++++++++++++++++++++--- 2 files changed, 60 insertions(+), 8 deletions(-) diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index 789ae08a816..5eb33bfb668 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -151,6 +151,10 @@ namespace FluidProperties { int FluidIndex_EthyleneGlycol(0); int FluidIndex_PropoleneGlycol(0); + int const t_sh_cache_size(1024 * 1024); + int const t_sh_precision_bits(24); + Int64 const t_sh_cache_mask(t_sh_cache_size - 1); + // ACCESSIBLE SPECIFICATIONS OF MODULE SUBROUTINES OR FUNCTONS: // Object Data @@ -160,6 +164,8 @@ namespace FluidProperties { Array1D GlycolData; Array1D GlycolErrorTracking; + Array1D cached_t_sh; // DIMENSION(t_sh_cache_size) + // Data Initializer Forward Declarations // See GetFluidPropertiesData "SUBROUTINE LOCAL DATA" for actual data. @@ -182,6 +188,7 @@ namespace FluidProperties { GlyRawData.deallocate(); GlycolData.deallocate(); GlycolErrorTracking.deallocate(); + cached_t_sh.deallocate(); } void DefaultEthGlyCpData_initializer(Array2D &, Array1D const &); @@ -574,6 +581,8 @@ namespace FluidProperties { cNumericFieldNames = ""; lNumericFieldBlanks = false; + cached_t_sh.allocate({0, t_sh_cache_size}); + // Check to see if there is any FluidName input. If not, this is okay as // long as the user only desires to simulate loops with water. More than // one FluidName input is not allowed. @@ -2033,6 +2042,8 @@ namespace FluidProperties { NumOfGlyConcs = NumOfOptionalInput + 1; GlycolData.allocate(NumOfGlyConcs); GlycolUsed.dimension(NumOfGlyConcs, false); + + GlycolUsed(1) = true; // mark Water as always used // First "glycol" is always pure water. Load data from default arrays @@ -8032,10 +8043,10 @@ namespace FluidProperties { //***************************************************************************** - Real64 GetSpecificHeatGlycol(std::string const &Glycol, // carries in substance name - Real64 const Temperature, // actual temperature given as input - int &GlycolIndex, // Index to Glycol Properties - std::string const &CalledFrom // routine this function was called from (error messages) + Real64 GetSpecificHeatGlycol_raw(std::string const &Glycol, // carries in substance name + Real64 const Temperature, // actual temperature given as input + int &GlycolIndex, // Index to Glycol Properties + std::string const &CalledFrom // routine this function was called from (error messages) ) { diff --git a/src/EnergyPlus/FluidProperties.hh b/src/EnergyPlus/FluidProperties.hh index b404fa48ebe..c261cc22032 100644 --- a/src/EnergyPlus/FluidProperties.hh +++ b/src/EnergyPlus/FluidProperties.hh @@ -107,6 +107,10 @@ namespace FluidProperties { extern int FluidIndex_EthyleneGlycol; extern int FluidIndex_PropoleneGlycol; + extern int const t_sh_cache_size; + extern int const t_sh_precision_bits; + extern Int64 const t_sh_cache_mask; + // ACCESSIBLE SPECIFICATIONS OF MODULE SUBROUTINES OR FUNCTONS: // Types @@ -344,12 +348,25 @@ namespace FluidProperties { } }; + struct cached_tsh + { + // Members + Int64 iT; + Real64 sh; + + // Default Constructor + cached_tsh() : iT(-1000), sh(0.0) + { + } + }; + // Object Data extern Array1D RefrigData; extern Array1D RefrigErrorTracking; extern Array1D GlyRawData; extern Array1D GlycolData; extern Array1D GlycolErrorTracking; + extern Array1D cached_t_sh; // Functions @@ -479,12 +496,36 @@ namespace FluidProperties { //***************************************************************************** - Real64 GetSpecificHeatGlycol(std::string const &Glycol, // carries in substance name - Real64 const Temperature, // actual temperature given as input - int &GlycolIndex, // Index to Glycol Properties - std::string const &CalledFrom // routine this function was called from (error messages) + Real64 GetSpecificHeatGlycol_raw(std::string const &Glycol, // carries in substance name + Real64 const Temperature, // actual temperature given as input + int &GlycolIndex, // Index to Glycol Properties + std::string const &CalledFrom // routine this function was called from (error messages) ); + + inline Real64 GetSpecificHeatGlycol(std::string const &Glycol, // carries in substance name + Real64 const Temperature, // actual temperature given as input + int &GlycolIndex, // Index to Glycol Properties + std::string const &CalledFrom // routine this function was called from (error messages) + ) + { + + Int64 const Grid_Shift(28); // Tuned This is a hot spot + assert(Grid_Shift == 64 - 12 - t_sh_precision_bits); // Force Grid_Shift updates when precision bits changes + + Int64 const T_tag(bit_shift(bit_transfer(Temperature + 1000 * GlycolIndex, Grid_Shift), -Grid_Shift)); + + Int64 const hash(T_tag & t_sh_cache_mask); + auto &cTsh(cached_t_sh(hash)); + + if (cTsh.iT != T_tag) { + cTsh.iT = T_tag; + cTsh.sh = GetSpecificHeatGlycol_raw(Glycol, Temperature, GlycolIndex, CalledFrom); + } + + return cTsh.sh; // saturation pressure {Pascals} + } + //***************************************************************************** Real64 GetDensityGlycol(std::string const &Glycol, // carries in substance name From f92f6c25a0de8736ea30c9c584df68d661e13e88 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Fri, 21 Jun 2019 09:46:51 -0700 Subject: [PATCH 012/136] clean --- src/EnergyPlus/Psychrometrics.cc | 2 +- src/EnergyPlus/Psychrometrics.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index a79108cfe82..5e6f15abb30 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -72,7 +72,7 @@ namespace EnergyPlus { #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp -#define EP_cache_PsyTsatFnPb +#undef EP_cache_PsyTsatFnPb #undef EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index df60373ecbe..800f207a714 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -71,7 +71,7 @@ namespace EnergyPlus { #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp -#define EP_cache_PsyTsatFnPb +#undef EP_cache_PsyTsatFnPb #undef EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors From 1f73f86f4c86819de519c8997511766a595ad09a Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Fri, 21 Jun 2019 15:52:56 -0700 Subject: [PATCH 013/136] another clean up --- src/EnergyPlus/DataGlobals.cc | 7 ------ src/EnergyPlus/DataGlobals.hh | 3 --- src/EnergyPlus/EnergyPlusPgm.cc | 1 - src/EnergyPlus/Psychrometrics.cc | 4 +-- src/EnergyPlus/Psychrometrics.hh | 42 ++++++++++---------------------- 5 files changed, 15 insertions(+), 42 deletions(-) diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index b05d9a1d8f7..7d6c3d013ad 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -264,10 +264,6 @@ namespace DataGlobals { void (*fProgressPtr)(int const); void (*fMessagePtr)(std::string const &); -// int timer_1(0); -// int timer_2(0); -// int timer_3(0); - // Clears the global data in DataGlobals. // Needed for unit tests, should not be normally called. void clear_state() @@ -366,9 +362,6 @@ namespace DataGlobals { err_stream = nullptr; eio_stream = nullptr; delightin_stream = nullptr; -// timer_1 = 0; -// timer_2 = 0; -// timer_3 = 0; } } // namespace DataGlobals diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index c380f5e87e5..216dff85520 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -302,9 +302,6 @@ namespace DataGlobals { extern void (*fProgressPtr)(int const); extern void (*fMessagePtr)(std::string const &); -// extern int timer_1; -// extern int timer_2; -// extern int timer_3; // Clears the global data in DataGlobals. // Needed for unit tests, should not be normally called. void clear_state(); diff --git a/src/EnergyPlus/EnergyPlusPgm.cc b/src/EnergyPlus/EnergyPlusPgm.cc index f95bf98b236..4a261691c97 100644 --- a/src/EnergyPlus/EnergyPlusPgm.cc +++ b/src/EnergyPlus/EnergyPlusPgm.cc @@ -469,7 +469,6 @@ int RunEnergyPlus(std::string const & filepath) EnergyPlus::inputProcessor->reportOrphanRecordObjects(); ReportOrphanFluids(); ReportOrphanSchedules(); -// std::cout << "Timer 1: " << DataGlobals::timer_1 << " Timer 2: " << DataGlobals::timer_2; if (runReadVars) { std::string readVarsPath = exeDirectory + "ReadVarsESO" + exeExtension; diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 5e6f15abb30..f97452a21af 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -204,12 +204,12 @@ namespace Psychrometrics { #endif #ifdef EP_cache_PsyTsatFnPb int const tsatcache_size(1024 * 1024); - int const tsatprecision_bits(24); // 28 //24 //32 + int const tsatprecision_bits(24); Int64 const tsatcache_mask(tsatcache_size - 1); #endif #ifdef EP_cache_PsyTsatFnHPb int const tsat_hbp_cache_size(1024 * 1024); - int const tsat_hbp_precision_bits(20); // 28 //24 //32 + int const tsat_hbp_precision_bits(28); #endif // MODULE VARIABLE DECLARATIONS: // na diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 800f207a714..63ca22e4922 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -133,7 +133,7 @@ namespace Psychrometrics { #endif #ifdef EP_cache_PsyTsatFnPb extern int const tsatcache_size; - extern int const tsatprecision_bits; // 28 //24 //32 + extern int const tsatprecision_bits; extern Int64 const tsatcache_mask; #endif #ifdef EP_cache_PsyTsatFnHPb @@ -176,12 +176,11 @@ namespace Psychrometrics { struct cached_tsat_h_pb { // Members - Int64 iH; - Int64 iPb; + Int64 iH_Pb; Real64 Tsat; // Default Constructor - cached_tsat_h_pb() : iH(0), iPb(0), Tsat(0.0) + cached_tsat_h_pb() : iH_Pb(0), Tsat(0.0) { } }; @@ -770,35 +769,21 @@ namespace Psychrometrics { // na // FUNCTION LOCAL VARIABLE DECLARATIONS: - Int64 H_tag; - Int64 Pb_tag; + Int64 H_Pb_tag; Int64 hash; - Real64 H_tag_r; - Real64 Pb_tag_r; #ifdef EP_psych_stats ++NumTimesCalled(iPsyTwbFnTdbWPb_cache); #endif - H_tag = bit_transfer(H, H_tag); - Pb_tag = bit_transfer(Pb, Pb_tag); - - H_tag = bit_shift(H_tag, -Grid_Shift); - Pb_tag = bit_shift(Pb_tag, -Grid_Shift); - hash = bit_and(bit_xor(H_tag, Pb_tag), Int64(tsat_hbp_cache_size - 1)); - - if (cached_Tsat_HPb(hash).iH != H_tag || cached_Tsat_HPb(hash).iPb != Pb_tag) { - cached_Tsat_HPb(hash).iH = H_tag; - cached_Tsat_HPb(hash).iPb = Pb_tag; - - H_tag_r = bit_transfer(bit_shift(H_tag, Grid_Shift), H_tag_r); - Pb_tag_r = bit_transfer(bit_shift(Pb_tag, Grid_Shift), Pb_tag_r); - - cached_Tsat_HPb(hash).Tsat = PsyTsatFnHPb(H_tag_r, Pb_tag_r, CalledFrom); + H_Pb_tag = bit_transfer(Pb * 10000 + H, H_Pb_tag); + H_Pb_tag = bit_shift(H_Pb_tag, -Grid_Shift); + hash = bit_and(H_Pb_tag, Int64(tsat_hbp_cache_size - 1)); + if (cached_Tsat_HPb(hash).iH_Pb != H_Pb_tag ) { + cached_Tsat_HPb(hash).iH_Pb = H_Pb_tag; + cached_Tsat_HPb(hash).Tsat = PsyTsatFnHPb_raw(H, Pb, CalledFrom); } - // Twbresult_last = cached_Twb(hash)%Twb - // Twb_result = Twbresult_last Tsat_result = cached_Tsat_HPb(hash).Tsat; return Tsat_result; @@ -1160,9 +1145,8 @@ namespace Psychrometrics { Int64 const Grid_Shift(28); // Tuned This is a hot spot assert(Grid_Shift == 64 - 12 - tsatprecision_bits); // Force Grid_Shift updates when precision bits changes - Int64 const Pb_tag( - bit_shift(bit_transfer(Press, Grid_Shift), -Grid_Shift)); // Note that 2nd arg to TRANSFER is not used: Only type matters -// Int64 const Pb_tag(Press); + Int64 const Pb_tag(bit_shift(bit_transfer(Press, Grid_Shift), -Grid_Shift)); + Int64 const hash(Pb_tag & tsatcache_mask); auto &cTsat(cached_Tsat(hash)); if (cTsat.iPb != Pb_tag) { @@ -1170,7 +1154,7 @@ namespace Psychrometrics { cTsat.Tsat = PsyTsatFnPb_raw(Press, CalledFrom); } - return cTsat.Tsat; // saturation pressure {Pascals} + return cTsat.Tsat; // saturation temperature } #else From da70b3ef3939f57c57f81847622b479a0bd43db9 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Sat, 22 Jun 2019 13:28:59 -0700 Subject: [PATCH 014/136] the other way --- src/EnergyPlus/Psychrometrics.cc | 2 +- src/EnergyPlus/Psychrometrics.hh | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index f97452a21af..3c38c736085 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -73,7 +73,7 @@ namespace EnergyPlus { #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp #undef EP_cache_PsyTsatFnPb -#undef EP_cache_PsyTsatFnHPb +#define EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 63ca22e4922..8f8def63f80 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -72,7 +72,7 @@ namespace EnergyPlus { #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp #undef EP_cache_PsyTsatFnPb -#undef EP_cache_PsyTsatFnHPb +#define EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors @@ -176,11 +176,12 @@ namespace Psychrometrics { struct cached_tsat_h_pb { // Members - Int64 iH_Pb; + Int64 iH; + Int64 iPb; Real64 Tsat; // Default Constructor - cached_tsat_h_pb() : iH_Pb(0), Tsat(0.0) + cached_tsat_h_pb() : iH(0), iPb(0), Tsat(0.0) { } }; @@ -769,18 +770,22 @@ namespace Psychrometrics { // na // FUNCTION LOCAL VARIABLE DECLARATIONS: - Int64 H_Pb_tag; + Int64 H_tag; + Int64 Pb_tag; Int64 hash; #ifdef EP_psych_stats ++NumTimesCalled(iPsyTwbFnTdbWPb_cache); #endif - H_Pb_tag = bit_transfer(Pb * 10000 + H, H_Pb_tag); - H_Pb_tag = bit_shift(H_Pb_tag, -Grid_Shift); - hash = bit_and(H_Pb_tag, Int64(tsat_hbp_cache_size - 1)); - if (cached_Tsat_HPb(hash).iH_Pb != H_Pb_tag ) { - cached_Tsat_HPb(hash).iH_Pb = H_Pb_tag; + H_tag = bit_transfer(H, H_tag); + H_tag = bit_shift(H_tag, -Grid_Shift); + Pb_tag = bit_transfer(Pb, Pb_tag); + Pb_tag = bit_shift(Pb_tag, -Grid_Shift); + hash = bit_and(bit_xor(H_tag, Pb_tag), Int64(tsat_hbp_cache_size - 1)); + if (cached_Tsat_HPb(hash).iH != H_tag || cached_Tsat_HPb(hash).iPb != Pb_tag) { + cached_Tsat_HPb(hash).iH = H_tag; + cached_Tsat_HPb(hash).iPb = Pb_tag; cached_Tsat_HPb(hash).Tsat = PsyTsatFnHPb_raw(H, Pb, CalledFrom); } From 52e718eebdeef64762f6963bd659424f0aaf469d Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Mon, 24 Jun 2019 15:08:33 -0700 Subject: [PATCH 015/136] test CI --- src/EnergyPlus/Psychrometrics.cc | 2 +- src/EnergyPlus/Psychrometrics.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index 3c38c736085..f97452a21af 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -73,7 +73,7 @@ namespace EnergyPlus { #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp #undef EP_cache_PsyTsatFnPb -#define EP_cache_PsyTsatFnHPb +#undef EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 8f8def63f80..6e6d39aa28b 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -72,7 +72,7 @@ namespace EnergyPlus { #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp #undef EP_cache_PsyTsatFnPb -#define EP_cache_PsyTsatFnHPb +#undef EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors From 0bbb181e28cfb59da07ed54124819bdaaa0e8cdf Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Thu, 11 Jul 2019 12:58:57 -0700 Subject: [PATCH 016/136] test global var --- src/EnergyPlus/DataGlobals.cc | 3 +++ src/EnergyPlus/DataGlobals.hh | 1 + src/EnergyPlus/FluidProperties.cc | 4 ++-- src/EnergyPlus/FluidProperties.hh | 23 +++++++++++++---------- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index 7d6c3d013ad..72d06b56398 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -260,6 +260,8 @@ namespace DataGlobals { bool AnySlabsInModel(false); // true if there are any zone-coupled ground domains in the input file bool AnyBasementsInModel(false); // true if there are any basements in the input file + bool UseGlycCache(true); + int Progress(0); // current progress (0-100) void (*fProgressPtr)(int const); void (*fMessagePtr)(std::string const &); @@ -356,6 +358,7 @@ namespace DataGlobals { ShowDecayCurvesInEIO = false; AnySlabsInModel = false; AnyBasementsInModel = false; + UseGlycCache = true; Progress = 0; eso_stream = nullptr; mtr_stream = nullptr; diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index 216dff85520..802c4c43616 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -297,6 +297,7 @@ namespace DataGlobals { extern bool ShowDecayCurvesInEIO; // true if the Radiant to Convective Decay Curves should appear in the EIO file extern bool AnySlabsInModel; // true if there are any zone-coupled ground domains in the input file extern bool AnyBasementsInModel; // true if there are any basements in the input file + extern bool UseGlycCache; extern int Progress; extern void (*fProgressPtr)(int const); diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index 180b2a7ff69..45017e6ea9a 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -188,7 +188,7 @@ namespace FluidProperties { GlyRawData.deallocate(); GlycolData.deallocate(); GlycolErrorTracking.deallocate(); - cached_t_sh.deallocate(); + if (DataGlobals::UseGlycCache) cached_t_sh.deallocate(); } void DefaultEthGlyCpData_initializer(Array2D &, Array1D const &); @@ -581,7 +581,7 @@ namespace FluidProperties { cNumericFieldNames = ""; lNumericFieldBlanks = false; - cached_t_sh.allocate({0, t_sh_cache_size}); + if (DataGlobals::UseGlycCache) cached_t_sh.allocate({0, t_sh_cache_size}); // Check to see if there is any FluidName input. If not, this is okay as // long as the user only desires to simulate loops with water. More than diff --git a/src/EnergyPlus/FluidProperties.hh b/src/EnergyPlus/FluidProperties.hh index 9bcfde9dc87..91b982fbc00 100644 --- a/src/EnergyPlus/FluidProperties.hh +++ b/src/EnergyPlus/FluidProperties.hh @@ -509,21 +509,24 @@ namespace FluidProperties { std::string const &CalledFrom // routine this function was called from (error messages) ) { + if (DataGlobals::UseGlycCache) { + Int64 const Grid_Shift(28); // Tuned This is a hot spot + assert(Grid_Shift == 64 - 12 - t_sh_precision_bits); // Force Grid_Shift updates when precision bits changes - Int64 const Grid_Shift(28); // Tuned This is a hot spot - assert(Grid_Shift == 64 - 12 - t_sh_precision_bits); // Force Grid_Shift updates when precision bits changes + Int64 const T_tag(bit_shift(bit_transfer(Temperature + 1000 * GlycolIndex, Grid_Shift), -Grid_Shift)); - Int64 const T_tag(bit_shift(bit_transfer(Temperature + 1000 * GlycolIndex, Grid_Shift), -Grid_Shift)); + Int64 const hash(T_tag & t_sh_cache_mask); + auto &cTsh(cached_t_sh(hash)); - Int64 const hash(T_tag & t_sh_cache_mask); - auto &cTsh(cached_t_sh(hash)); + if (cTsh.iT != T_tag) { + cTsh.iT = T_tag; + cTsh.sh = GetSpecificHeatGlycol_raw(Glycol, Temperature, GlycolIndex, CalledFrom); + } - if (cTsh.iT != T_tag) { - cTsh.iT = T_tag; - cTsh.sh = GetSpecificHeatGlycol_raw(Glycol, Temperature, GlycolIndex, CalledFrom); + return cTsh.sh; // saturation pressure {Pascals} + } else { + return GetSpecificHeatGlycol_raw(Glycol, Temperature, GlycolIndex, CalledFrom); } - - return cTsh.sh; // saturation pressure {Pascals} } //***************************************************************************** From 0ba3c0d4ece0606fd2ee62fb80fb083fd7f313b8 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Mon, 22 Jul 2019 16:16:09 -0700 Subject: [PATCH 017/136] cache on --- src/EnergyPlus/Psychrometrics.cc | 10 +++++++--- src/EnergyPlus/Psychrometrics.hh | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.cc b/src/EnergyPlus/Psychrometrics.cc index f97452a21af..4c9bf4f39d6 100644 --- a/src/EnergyPlus/Psychrometrics.cc +++ b/src/EnergyPlus/Psychrometrics.cc @@ -72,8 +72,8 @@ namespace EnergyPlus { #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp -#undef EP_cache_PsyTsatFnPb -#undef EP_cache_PsyTsatFnHPb +#define EP_cache_PsyTsatFnPb +#define EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors @@ -1114,6 +1114,8 @@ namespace Psychrometrics { switch(CaseIndex) { case 0 : HH = -4.24e4; //HH < -4.24e4, Peg to minimum + T = F6(HH, -19.44, 8.53675e-4, -5.12637e-9, -9.85546e-14, -1.00102e-18, -4.2705e-24); + break; case 1 : // -2.2138e4 > HH > -4.24e4 T = F6(HH, -19.44, 8.53675e-4, -5.12637e-9, -9.85546e-14, -1.00102e-18, -4.2705e-24); break; @@ -1138,9 +1140,11 @@ namespace Psychrometrics { case 8 : T = F6(HH, 4.88446e1, 3.85534e-5, -1.78805e-11, 4.87224e-18, -7.15283e-25, 4.36246e-32); break; + case 9 : + T = F7(HH, 7.60565e11, 5.80534e4, -7.36433e-3, 5.11531e-10, -1.93619e-17, 3.70511e-25, -2.77313e-33); + break; case 10 : HH = 4.5866e7; - case 9 : T = F7(HH, 7.60565e11, 5.80534e4, -7.36433e-3, 5.11531e-10, -1.93619e-17, 3.70511e-25, -2.77313e-33); break; } diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 6e6d39aa28b..2a1559c78cf 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -71,8 +71,8 @@ namespace EnergyPlus { #else #define EP_cache_PsyTwbFnTdbWPb #define EP_cache_PsyPsatFnTemp -#undef EP_cache_PsyTsatFnPb -#undef EP_cache_PsyTsatFnHPb +#define EP_cache_PsyTsatFnPb +#define EP_cache_PsyTsatFnHPb #endif #define EP_psych_errors From 23760aa1115db41256088a44fc3a49c0a6529138 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Thu, 25 Jul 2019 16:37:59 -0700 Subject: [PATCH 018/136] design documentation --- ...r and cache two psychrometric functions.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 design/FY2019/Refactor and cache two psychrometric functions.md diff --git a/design/FY2019/Refactor and cache two psychrometric functions.md b/design/FY2019/Refactor and cache two psychrometric functions.md new file mode 100644 index 00000000000..5fb02239499 --- /dev/null +++ b/design/FY2019/Refactor and cache two psychrometric functions.md @@ -0,0 +1,52 @@ +# Refactor and cache two psychrometric functions + +Xuan Luo, Tianzhen Hong + +Lawrence Berkeley National Laboratory + +July 25, 2019 + +## Justification for Feature Update + +The feature is to convert the funtion `PsyTsatFnHPb` from Fortran code to C++ code, and use caching for two psychrometric funtions - `PsyTsatFnHPb` & `PsyTsatFnPb`. + +The caching helps achieve run time performance gain but may trigger some small differences in the reported results. Table 1 summarizes the regression diffs of the two psychrometric functions. The summary is based on the regression test results with 623 EnergyPlus test files. The max diff in annual energy/facility report indicates the maximum relative difference in the summary tables, out of the total 623 tests. The math diffs indicate the differences in the reported variables and meters by hour or by time step. The tables diffs indicate the differences in the final report tables. + +**Table 1. Regression diffs of two psychrometric functions - annual** + +| Trade off flags | Number of tests have large math diffs | Number of tests have large table diffs | Annual Site EUI | | Annual Energy Meters Entire Facility - Electricity | | Annual Energy Meters Entire Facility - Gas | | Annual Energy Meters Entire Facility - Cooling | | Annual Energy Meters Entire Facility - Water | | Annual Energy Meters Entire Facility - Other | | +|-----------------------|---------------------------------------|----------------------------------------|-------------------|--------------------------------|----------------------------------------------------|--------------------------------|--------------------------------------------|--------------------------------|------------------------------------------------|--------------------------------|----------------------------------------------|--------------------------------|----------------------------------------------|--------------------------------| +| | | | Max relative diff | # test cases have diff > 0.01% | Max relative diff | # test cases have diff > 0.01% | Max relative diff | # test cases have diff > 0.01% | Max relative diff | # test cases have diff > 0.01% | Max relative diff | # test cases have diff > 0.01% | Max relative diff | # test cases have diff > 0.01% | +| EP_cache_PsyTsatFnPb | 43 | 23 | 0.10% | 7 | 0.11% | 7 | 0.02% | 2 | 0.02% | 3 | 0.23% | 12 | 0.09% | 6 | +| EP_cache_PsyTsatFnHPb | 57 | 34 | 0.06% | 10 | 0.06% | 9 | 0.02% | 3 | 0.02% | 5 | 0.18% | 12 | 0.09% | 8 | + +The regression diffs of the peak results are summarized in Table 2. + +**Table 2. Regression diffs of two psychrometric functions - peak** + +| Trade off flags | Annual Energy Meters Entire Facility - Electricity | | Annual Energy Meters Entire Facility - Gas | | Annual Energy Meters Entire Facility - Cooling | | Annual Energy Meters Entire Facility - Water | | Annual Energy Meters Entire Facility - Other | | +|-----------------------|----------------------------------------------------|--------------------------------|--------------------------------------------|--------------------------------|------------------------------------------------|--------------------------------|----------------------------------------------|--------------------------------|----------------------------------------------|--------------------------------| +| | Max relative diff | # test cases have diff > 0.01% | Max relative diff | # test cases have diff > 0.01% | Max relative diff | # test cases have diff > 0.01% | Max relative diff | # test cases have diff > 0.01% | Max relative diff | # test cases have diff > 0.01% | +| EP_cache_PsyTsatFnPb | 4.30% | 2 | 0.47% | 1 | 0.12% | 1 | N/A | 0 | 0.72 | 2 | +| EP_cache_PsyTsatFnHPb | 4.20% | 3 | 0.31% | 1 | 0.04% | 2 | N/A | 0 | 0.60% | 2 | + +We further took some example files and analyzed where the big diffs show in each test case. The big deviations mainly appear in fields including heating and cooling capacity, convergence information, annual peak (minimum and maximum) values and setpoint not met (Table 3). This indicates that at some extreme conditions, minor (10^-16) precision difference in the calculation of psychrometric function can cause cumulative effect in simulation results. + +For example, in Ice Thermal Storage Calculation, the `Ice Thermal Storage Requested Load` is calculated by `Design mass flow rate * Cp of glycol * (Inlet temperature – Setpoint temperature)`. In the `5ZoneIceStorge.idf` test case, the design mass flow rate multiplied by the specific heat is at the magnitude of 10^4 and the precision diff of temperature is also magnified by this amount. In general, when calculating water flow rate in small building with the unit of m^3/s, the absolute flow rate value can be relatively small, and the deviation of the diff of two temperatures (e.g. inlet and outlet temperature) accounts for greater relative difference in loads. When calculating air flow rate in large buildings, the absolute value of flow rate can be large and the precision deviation of two temperatures diffs can account for greater absolute difference in loads. + + +**Table 3. Regression diffs of two psychrometric functions - examples** + +|  | Table big diffs | ESO big diffs | MTR big diffs | +|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| 5ZoneCoolBeam | Warmup Convergence Information | N/A | N/A | +| 5ZoneCoolingPanelBaseboard | Annual and Peak Values - Electricity; Annual and Peak Values - Gas; Annual and Peak Values - Cooling; Annual and Peak Values - Other | Max absolute diff: 2250.1488349, field: CENTRAL CHILLER:Chiller Evaporator Cooling Rate [W](Hourly), time: 07/21 01:00:00, relative: 0.290877294867;Max relative diff: 1.0, field: MAIN HEATING COIL 1:Heating Coil Heating Rate [W](Hourly), time: 07/21 06:00:00, absolute: 694.942999853 | Max absolute diff: 5825448.88749, field: Gas:Facility [J](Monthly), time: July, relative: 0.0108159291299;Max relative diff: 0.0108159291299, field: Gas:Facility [J](Monthly), time: July, absolute: 5825448.88749 | +| 5ZoneElectricBaseboard | Annual and Peak Values - Electricity;Annual and Peak Values - Other | N/A | N/A | +| 5ZoneIceStorage | Plant Loop Coincident Design Fluid Flow Rate Adjustments | N/A | N/A | +| 5ZoneWaterCooled_Baseboard | Annual and Peak Values - Water;Annual and Peak Values - Other | Max absolute diff: 3910.55749028, field: CENTRAL CHILLER:Chiller Evaporator Cooling Rate [W](Hourly), time: 07/21 24:00:00, relative: 0.489140289909;Max relative diff: 0.489140289909, field: CENTRAL CHILLER:Chiller Evaporator Cooling Rate [W](Hourly), time: 07/21 24:00:00, absolute: 3910.55749028 | Max absolute diff: 3781493.32856, field: Electricity:Facility [J](Monthly), time: July, relative: 0.003822818262;Max relative diff: 0.0065249669738, field: Electricity:Plant [J](Monthly), time: July, absolute: 3781493.14183 | +| 5ZoneWaterCooled_HighRHControl | Warmup Convergence Information;Annual and Peak Values - Electricity;Annual and Peak Values - other | Max absolute diff: 754.535946383, field: MAIN COOLING COIL 1:Cooling Coil Total Cooling Rate [W](Hourly), time: 07/21 06:00:00, relative: 0.114245738677; Max relative diff: 0.239215392434, field: MAIN HEATING COIL 1:Heating Coil Heating Rate [W](Hourly), time: 07/21 06:00:00, absolute: 724.02837944 | Max absolute diff: 3163512.97647, field: Gas:Facility [J](Monthly), time: July, relative: 0.00478605484346; Max relative diff: 0.00478605484346, field: Gas:Facility [J](Monthly), time: July, absolute: 3163512.97647 | +| ASHRAE9012016_Hospital_Denver | Comfort and Setpoint Not Met Summary | Max absolute diff: 1101315204.01, field: Electricity:Facility [J](Monthly), time: July, relative: 0.0110115007204;Max relative diff: 0.0110115007204, field: Electricity:Facility [J](Monthly), time: July, absolute: 1101315204.01 | Max absolute diff: 1101315204.01, field: Electricity:Facility [J](Monthly), time: 07/21 24:00:00, relative: 0.0110115007204;Max relative diff: 0.0110115007204, field: Electricity:Facility [J](Monthly), time: 07/21 24:00:00, absolute: 1101315204.01 | +| ASHRAE9012016_OfficeLarge_Denver | Time Setpoint Not Met | N/A | N/A | +| CentralChillerHeaterSystem_Cooling_Heating | Comfort and Setpoint Not Met Summary;Environment:WarmupDays;Warmup Convergence Information;Annual and Peak Values - Electricity;Annual and Peak Values - Other;EAp2-2. Advisory Messages | Max absolute diff: 943291.539437, field: CHILLERBANK:Chiller Heater System Cooling Electric Energy [J](TimeStep), time: 07/21 07:40:00, relative: 0.160657554291;Max relative diff: 999, field: VERTICAL GROUND HEAT EXCHANGER:Ground Heat Exchanger Heat Transfer Rate [W](TimeStep), time: 07/21 07:40:00, absolute: 49963.5234817 | Max absolute diff: 3865279.15555, field: Electricity:Plant [J](Monthly), time: July, relative: 0.00856142803732;Max relative diff: 0.00856142803732, field: Electricity:Plant [J](Monthly), time: July, absolute: 3865279.15555 | +| HeatPumpWaterHeater | Warmup Convergence Information;Annual and Peak Values - Electricity; Annual and Peak Values - Water; Annual and Peak Values - Cooling; Annual and Peak Values - Other | Max absolute diff: 965.026314929, field: MAIN COOLING COIL 1:Cooling Coil Total Cooling Rate [W](Hourly), time: 07/21 05:00:00, relative: 0.143084278282;Max relative diff: 0.296270953432, field: HPWHPLANTDXCOIL:Cooling Coil Total Cooling Rate [W](Hourly), time: 07/21 03:00:00, absolute: 409.557737679 | Max absolute diff: 6079154.87704, field: Electricity:Facility [J](Monthly), time: July, relative: 0.00520247500374;Max relative diff: 0.00791127718368, field: Electricity:Plant [J](Monthly), time: July, absolute: 6033670.18734 | + From 22543527f423c0985f1a82f69409109e65f6c90c Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Fri, 26 Jul 2019 11:01:59 -0700 Subject: [PATCH 019/136] cache-glyc --- src/EnergyPlus/DataGlobals.cc | 3 --- src/EnergyPlus/DataGlobals.hh | 1 - src/EnergyPlus/FluidProperties.cc | 24 ++++++++++++++--- src/EnergyPlus/FluidProperties.hh | 44 ++++++++++++++++++++----------- 4 files changed, 48 insertions(+), 24 deletions(-) diff --git a/src/EnergyPlus/DataGlobals.cc b/src/EnergyPlus/DataGlobals.cc index 72d06b56398..7d6c3d013ad 100644 --- a/src/EnergyPlus/DataGlobals.cc +++ b/src/EnergyPlus/DataGlobals.cc @@ -260,8 +260,6 @@ namespace DataGlobals { bool AnySlabsInModel(false); // true if there are any zone-coupled ground domains in the input file bool AnyBasementsInModel(false); // true if there are any basements in the input file - bool UseGlycCache(true); - int Progress(0); // current progress (0-100) void (*fProgressPtr)(int const); void (*fMessagePtr)(std::string const &); @@ -358,7 +356,6 @@ namespace DataGlobals { ShowDecayCurvesInEIO = false; AnySlabsInModel = false; AnyBasementsInModel = false; - UseGlycCache = true; Progress = 0; eso_stream = nullptr; mtr_stream = nullptr; diff --git a/src/EnergyPlus/DataGlobals.hh b/src/EnergyPlus/DataGlobals.hh index 802c4c43616..216dff85520 100644 --- a/src/EnergyPlus/DataGlobals.hh +++ b/src/EnergyPlus/DataGlobals.hh @@ -297,7 +297,6 @@ namespace DataGlobals { extern bool ShowDecayCurvesInEIO; // true if the Radiant to Convective Decay Curves should appear in the EIO file extern bool AnySlabsInModel; // true if there are any zone-coupled ground domains in the input file extern bool AnyBasementsInModel; // true if there are any basements in the input file - extern bool UseGlycCache; extern int Progress; extern void (*fProgressPtr)(int const); diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index 45017e6ea9a..bf633d8591e 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -62,6 +62,8 @@ #include #include +#undef EP_cache_GlycolSpecificHeat + namespace EnergyPlus { namespace FluidProperties { @@ -151,9 +153,11 @@ namespace FluidProperties { int FluidIndex_EthyleneGlycol(0); int FluidIndex_PropoleneGlycol(0); +#ifdef EP_cache_GlycolSpecificHeat int const t_sh_cache_size(1024 * 1024); int const t_sh_precision_bits(24); Int64 const t_sh_cache_mask(t_sh_cache_size - 1); +#endif // ACCESSIBLE SPECIFICATIONS OF MODULE SUBROUTINES OR FUNCTONS: @@ -164,7 +168,9 @@ namespace FluidProperties { Array1D GlycolData; Array1D GlycolErrorTracking; +#ifdef EP_cache_GlycolSpecificHeat Array1D cached_t_sh; // DIMENSION(t_sh_cache_size) +#endif // Data Initializer Forward Declarations // See GetFluidPropertiesData "SUBROUTINE LOCAL DATA" for actual data. @@ -188,7 +194,9 @@ namespace FluidProperties { GlyRawData.deallocate(); GlycolData.deallocate(); GlycolErrorTracking.deallocate(); - if (DataGlobals::UseGlycCache) cached_t_sh.deallocate(); +#ifdef EP_cache_GlycolSpecificHeat + cached_t_sh.deallocate(); +#endif } void DefaultEthGlyCpData_initializer(Array2D &, Array1D const &); @@ -581,8 +589,9 @@ namespace FluidProperties { cNumericFieldNames = ""; lNumericFieldBlanks = false; - if (DataGlobals::UseGlycCache) cached_t_sh.allocate({0, t_sh_cache_size}); - +#ifdef EP_cache_GlycolSpecificHeat + cached_t_sh.allocate({0, t_sh_cache_size}); +#endif // Check to see if there is any FluidName input. If not, this is okay as // long as the user only desires to simulate loops with water. More than // one FluidName input is not allowed. @@ -8042,12 +8051,19 @@ namespace FluidProperties { } //***************************************************************************** - +#ifdef EP_cache_GlycolSpecificHeat Real64 GetSpecificHeatGlycol_raw(std::string const &Glycol, // carries in substance name Real64 const Temperature, // actual temperature given as input int &GlycolIndex, // Index to Glycol Properties std::string const &CalledFrom // routine this function was called from (error messages) ) +#else + Real64 GetSpecificHeatGlycol(std::string const &Glycol, // carries in substance name + Real64 const Temperature, // actual temperature given as input + int &GlycolIndex, // Index to Glycol Properties + std::string const &CalledFrom // routine this function was called from (error messages) + ) +#endif { // FUNCTION INFORMATION: diff --git a/src/EnergyPlus/FluidProperties.hh b/src/EnergyPlus/FluidProperties.hh index 91b982fbc00..03c3c5fadc4 100644 --- a/src/EnergyPlus/FluidProperties.hh +++ b/src/EnergyPlus/FluidProperties.hh @@ -61,6 +61,10 @@ #include #include + +#undef EP_cache_GlycolSpecificHeat + + namespace EnergyPlus { namespace FluidProperties { @@ -107,10 +111,12 @@ namespace FluidProperties { extern int FluidIndex_EthyleneGlycol; extern int FluidIndex_PropoleneGlycol; + +#ifdef EP_cache_GlycolSpecificHeat extern int const t_sh_cache_size; extern int const t_sh_precision_bits; extern Int64 const t_sh_cache_mask; - +#endif // ACCESSIBLE SPECIFICATIONS OF MODULE SUBROUTINES OR FUNCTONS: // Types @@ -366,7 +372,10 @@ namespace FluidProperties { extern Array1D GlyRawData; extern Array1D GlycolData; extern Array1D GlycolErrorTracking; + +#ifdef EP_cache_GlycolSpecificHeat extern Array1D cached_t_sh; +#endif // Functions @@ -495,7 +504,7 @@ namespace FluidProperties { ); //***************************************************************************** - +#ifdef EP_cache_GlycolSpecificHeat Real64 GetSpecificHeatGlycol_raw(std::string const &Glycol, // carries in substance name Real64 const Temperature, // actual temperature given as input int &GlycolIndex, // Index to Glycol Properties @@ -509,25 +518,28 @@ namespace FluidProperties { std::string const &CalledFrom // routine this function was called from (error messages) ) { - if (DataGlobals::UseGlycCache) { - Int64 const Grid_Shift(28); // Tuned This is a hot spot - assert(Grid_Shift == 64 - 12 - t_sh_precision_bits); // Force Grid_Shift updates when precision bits changes - - Int64 const T_tag(bit_shift(bit_transfer(Temperature + 1000 * GlycolIndex, Grid_Shift), -Grid_Shift)); + Int64 const Grid_Shift(28); + assert(Grid_Shift == 64 - 12 - t_sh_precision_bits); - Int64 const hash(T_tag & t_sh_cache_mask); - auto &cTsh(cached_t_sh(hash)); + Int64 const T_tag(bit_shift(bit_transfer(Temperature + 1000 * GlycolIndex, Grid_Shift), -Grid_Shift)); - if (cTsh.iT != T_tag) { - cTsh.iT = T_tag; - cTsh.sh = GetSpecificHeatGlycol_raw(Glycol, Temperature, GlycolIndex, CalledFrom); - } + Int64 const hash(T_tag & t_sh_cache_mask); + auto &cTsh(cached_t_sh(hash)); - return cTsh.sh; // saturation pressure {Pascals} - } else { - return GetSpecificHeatGlycol_raw(Glycol, Temperature, GlycolIndex, CalledFrom); + if (cTsh.iT != T_tag) { + cTsh.iT = T_tag; + cTsh.sh = GetSpecificHeatGlycol_raw(Glycol, Temperature, GlycolIndex, CalledFrom); } + + return cTsh.sh; // saturation pressure {Pascals} } +#else + Real64 GetSpecificHeatGlycol(std::string const &Glycol, // carries in substance name + Real64 const Temperature, // actual temperature given as input + int &GlycolIndex, // Index to Glycol Properties + std::string const &CalledFrom // routine this function was called from (error messages) + ); +#endif //***************************************************************************** From 1e2fe583d7712c6819e1cd811424f43516ae51be Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Fri, 26 Jul 2019 11:03:37 -0700 Subject: [PATCH 020/136] cache-on --- src/EnergyPlus/FluidProperties.cc | 2 +- src/EnergyPlus/FluidProperties.hh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index bf633d8591e..9349fcdc62c 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -62,7 +62,7 @@ #include #include -#undef EP_cache_GlycolSpecificHeat +#define EP_cache_GlycolSpecificHeat namespace EnergyPlus { diff --git a/src/EnergyPlus/FluidProperties.hh b/src/EnergyPlus/FluidProperties.hh index 03c3c5fadc4..48bb1bb0ae6 100644 --- a/src/EnergyPlus/FluidProperties.hh +++ b/src/EnergyPlus/FluidProperties.hh @@ -62,7 +62,7 @@ #include -#undef EP_cache_GlycolSpecificHeat +#define EP_cache_GlycolSpecificHeat namespace EnergyPlus { From 030f9f63ad42fc37e0410859ac26ecd5d0b08cb7 Mon Sep 17 00:00:00 2001 From: mjwitte Date: Tue, 20 Aug 2019 16:48:20 -0500 Subject: [PATCH 021/136] Air boundary - daylighting part 1 --- src/EnergyPlus/DataDaylighting.hh | 2 +- src/EnergyPlus/DataViewFactorInformation.hh | 3 +- src/EnergyPlus/DaylightingManager.cc | 373 +++++++++----------- 3 files changed, 167 insertions(+), 211 deletions(-) diff --git a/src/EnergyPlus/DataDaylighting.hh b/src/EnergyPlus/DataDaylighting.hh index b6ae70a4b23..f6f2ee8eee4 100644 --- a/src/EnergyPlus/DataDaylighting.hh +++ b/src/EnergyPlus/DataDaylighting.hh @@ -148,7 +148,7 @@ namespace DataDaylighting { Real64 MinLightFraction; // Minimum fraction of light output that continuous dimming system can dim down to int LightControlSteps; // Number of levels (excluding zero) of stepped control system Real64 LightControlProbability; // For manual control of stepped systems, probability that lighting will - int TotalExtWindows; // Total number of exterior windows in the zone + int TotalExtWindows; // Total number of exterior windows in the zone or same solar enclosure Real64 AveVisDiffReflect; // Area-weighted average inside surface visible reflectance of zone Real64 DElightGriddingResolution; // Field: Delight Gridding Resolution Array1D RefPtPowerReductionFactor; // =1.0 ! Electric power reduction factor at reference points diff --git a/src/EnergyPlus/DataViewFactorInformation.hh b/src/EnergyPlus/DataViewFactorInformation.hh index b69e3610b40..52c8b7c7451 100644 --- a/src/EnergyPlus/DataViewFactorInformation.hh +++ b/src/EnergyPlus/DataViewFactorInformation.hh @@ -81,9 +81,10 @@ namespace DataViewFactorInformation { Real64 ExtWindowArea; // Exterior window area Real64 TotalSurfArea; // Total surface area Array1D SolAbsorptance; // Surface solar absorptance + int TotalEnclosureDaylRefPoints; // Total number of daylighting reference points in enclosure // Default Constructor - ZoneViewFactorInformation() : NumOfSurfaces(0), FloorArea(0.0), ExtWindowArea(0.0), TotalSurfArea(0.0) + ZoneViewFactorInformation() : NumOfSurfaces(0), FloorArea(0.0), ExtWindowArea(0.0), TotalSurfArea(0.0), TotalEnclosureDaylRefPoints(0) { } }; diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 41916b60889..61b3076b0e2 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -307,33 +308,13 @@ namespace DaylightingManager { // Finds total number of exterior windows in the space. - // METHODOLOGY EMPLOYED: - // na - // REFERENCES: // Based on DOE-2.1E subroutine DAVREF - // USE STATEMENTS: - // na - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int IType; // Surface type/class Real64 AREA; // Inside surface area (m2) Real64 AInsTot; // Total inside surface area of a zone (m2) Real64 ARHTOT; // Sum over surfaces of AREA*(inside visible reflectance) (m2) - int ISurf; // Surface number int IWin; // Window number int ITILT; // Surface tilt category (1 = floor, 2 = wall, 3 = ceiling) int IT; // Tilt index @@ -348,8 +329,6 @@ namespace DaylightingManager { int IWinDr; // Window/door surface number Real64 ETA; // Ratio of floor-to-window-center height and average floor-to-ceiling height - // FLOW: - // Total inside surface area, including windows AInsTot = 0.0; // Sum of products of inside surface area * vis reflectance @@ -357,15 +336,16 @@ namespace DaylightingManager { // Area sum and area * reflectance sum for different orientations AR = 0.0; ARH = 0.0; - // Loop over surfaces - for (ISurf = Zone(ZoneNum).SurfaceFirst; ISurf <= Zone(ZoneNum).SurfaceLast; ++ISurf) { + // Loop over surfaces in the zone's enclosure + auto & thisEnclosure(DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum)); + for (int ISurf : thisEnclosure.SurfacePtr) { IType = Surface(ISurf).Class; // Error if window has multiplier > 1 since this causes incorrect illuminance calc if (IType == SurfaceClass_Window && Surface(ISurf).Multiplier > 1.0) { - if (ZoneDaylight(ZoneNum).TotalDaylRefPoints > 0) { + if (thisEnclosure.TotalEnclosureDaylRefPoints > 0) { ShowSevereError("DayltgAveInteriorReflectance: Multiplier > 1.0 for window " + Surface(ISurf).Name + " in Zone=" + Surface(ISurf).ZoneName); - ShowContinueError("...not allowed since it is in a zone with daylighting."); + ShowContinueError("...not allowed since it is in a zone or enclosure with daylighting."); ShowFatalError("Program terminates due to preceding conditions."); } else { ShowSevereError("DayltgAveInteriorReflectance: Multiplier > 1.0 for window " + Surface(ISurf).Name + @@ -403,7 +383,7 @@ namespace DaylightingManager { // Average floor visible reflectance ZoneDaylight(ZoneNum).FloorVisRefl = ARH(3) / (AR(3) + 1.e-6); - for (ISurf = Zone(ZoneNum).SurfaceFirst; ISurf <= Zone(ZoneNum).SurfaceLast; ++ISurf) { + for (int ISurf : thisEnclosure.SurfacePtr) { IType = Surface(ISurf).Class; if (IType == SurfaceClass_Wall || IType == SurfaceClass_Floor || IType == SurfaceClass_Roof) { // Remove this surface from the zone inside surface area and area*reflectivity @@ -421,7 +401,7 @@ namespace DaylightingManager { ITILT = 3; // Ceiling } // Loop over windows and doors on this wall - for (IWinDr = Zone(ZoneNum).SurfaceFirst; IWinDr <= Zone(ZoneNum).SurfaceLast; ++IWinDr) { + for (int IWinDr : thisEnclosure.SurfacePtr) { if ((Surface(IWinDr).Class == SurfaceClass_Window || Surface(IWinDr).Class == SurfaceClass_Door) && Surface(IWinDr).BaseSurf == ISurf) { ATWL += Surface(IWinDr).Area + SurfaceWindow(IWinDr).FrameArea * (1.0 + 0.5 * SurfaceWindow(IWinDr).ProjCorrFrIn) + @@ -448,9 +428,9 @@ namespace DaylightingManager { } } // End of loop over opaque surfaces in zone - for (IWin = Zone(ZoneNum).SurfaceFirst; IWin <= Zone(ZoneNum).SurfaceLast; ++IWin) { + for (int IWin : thisEnclosure.SurfacePtr) { if (Surface(IWin).Class == SurfaceClass_Window) { - ISurf = Surface(IWin).BaseSurf; + int ISurf = Surface(IWin).BaseSurf; // Ratio of floor-to-window-center height and average floor-to-ceiling height ETA = max(0.0, min(1.0, (SurfaceWindow(IWin).WinCenter(3) - Zone(ZoneNum).OriginZ) * Zone(ZoneNum).FloorArea / Zone(ZoneNum).Volume)); AP = SurfaceWindow(ISurf).ZoneAreaMinusThisSurf; @@ -4470,14 +4450,7 @@ namespace DaylightingManager { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int TotDaylightingControls; // Total Daylighting:Controls inputs (splitflux or delight type) - int IntWin; // Interior window surface index bool ErrorsFound; // Error flag - int SurfNum; // Surface counter (loop) - int WindowShadingControlPtr; // Pointer for WindowShadingControl - int ZoneNum; // Zone Number (loop counter) - int SurfNumAdj; // Surface Number for adjacent surface - int ZoneNumAdj; // Zone Number for adjacent zone - // RJH DElight Modification Begin - local variable declarations Real64 dLatitude; // double for argument passing int iErrorFlag; // Error Flag for warning/errors returned from DElight int iDElightErrorFile; // Unit number for reading DElight Error File @@ -4486,7 +4459,6 @@ namespace DaylightingManager { std::string cErrorMsg; // Each DElight Error Message can be up to 200 characters long bool bEndofErrFile; // End of Error File flag bool bRecordsOnErrFile; // true if there are records on the error file - // RJH DElight Modification End - local variable declarations int NumReports; int NumNames; @@ -4507,50 +4479,62 @@ namespace DaylightingManager { } maxNumRefPtInAnyZone = 0; - for (SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { + for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { if (Surface(SurfNum).Class != SurfaceClass_Window) continue; - ZoneNum = Surface(SurfNum).Zone; - int numRefPoints = ZoneDaylight(ZoneNum).TotalDaylRefPoints; - if (numRefPoints > maxNumRefPtInAnyZone) { - maxNumRefPtInAnyZone = numRefPoints; - } - if (ZoneDaylight(ZoneNum).TotalDaylRefPoints > 0) { + // Loop through all zones in the same enclosure to find total reference points + int numEnclRefPoints = 0; + int surfEnclNum = Surface(SurfNum).SolarEnclIndex; + for (int zoneNum : DataViewFactorInformation::ZoneSolarInfo(surfEnclNum).ZoneNums) { + int numRefPoints = ZoneDaylight(zoneNum).TotalDaylRefPoints; + numEnclRefPoints += numRefPoints; + if (numRefPoints > maxNumRefPtInAnyZone) { + maxNumRefPtInAnyZone = numRefPoints; + } + } + DataViewFactorInformation::ZoneSolarInfo(surfEnclNum).TotalEnclosureDaylRefPoints = numEnclRefPoints; + if (numEnclRefPoints > 0) { if (!SurfaceWindow(SurfNum).SurfDayLightInit) { - SurfaceWindow(SurfNum).SolidAngAtRefPt.allocate(numRefPoints); + SurfaceWindow(SurfNum).SolidAngAtRefPt.allocate(numEnclRefPoints); SurfaceWindow(SurfNum).SolidAngAtRefPt = 0.0; - SurfaceWindow(SurfNum).SolidAngAtRefPtWtd.allocate(numRefPoints); + SurfaceWindow(SurfNum).SolidAngAtRefPtWtd.allocate(numEnclRefPoints); SurfaceWindow(SurfNum).SolidAngAtRefPtWtd = 0.0; - SurfaceWindow(SurfNum).IllumFromWinAtRefPt.allocate(2, numRefPoints); + SurfaceWindow(SurfNum).IllumFromWinAtRefPt.allocate(2, numEnclRefPoints); SurfaceWindow(SurfNum).IllumFromWinAtRefPt = 0.0; - SurfaceWindow(SurfNum).BackLumFromWinAtRefPt.allocate(2, numRefPoints); + SurfaceWindow(SurfNum).BackLumFromWinAtRefPt.allocate(2, numEnclRefPoints); SurfaceWindow(SurfNum).BackLumFromWinAtRefPt = 0.0; - SurfaceWindow(SurfNum).SourceLumFromWinAtRefPt.allocate(2, numRefPoints); + SurfaceWindow(SurfNum).SourceLumFromWinAtRefPt.allocate(2, numEnclRefPoints); SurfaceWindow(SurfNum).SourceLumFromWinAtRefPt = 0.0; - SurfaceWindow(SurfNum).IllumFromWinAtRefPtRep.allocate(numRefPoints); + SurfaceWindow(SurfNum).IllumFromWinAtRefPtRep.allocate(numEnclRefPoints); SurfaceWindow(SurfNum).IllumFromWinAtRefPtRep = 0.0; - SurfaceWindow(SurfNum).LumWinFromRefPtRep.allocate(numRefPoints); + SurfaceWindow(SurfNum).LumWinFromRefPtRep.allocate(numEnclRefPoints); SurfaceWindow(SurfNum).LumWinFromRefPtRep = 0.0; SurfaceWindow(SurfNum).SurfDayLightInit = true; } } else { - SurfNumAdj = Surface(SurfNum).ExtBoundCond; + int SurfNumAdj = Surface(SurfNum).ExtBoundCond; if (SurfNumAdj > 0) { - ZoneNumAdj = Surface(SurfNumAdj).Zone; - if (ZoneDaylight(ZoneNumAdj).TotalDaylRefPoints > 0) { + // Loop through all zones in the adjacent enclosure to find total reference points + int numAdjEnclRefPoints = 0; + int adjSurfEnclNum = Surface(SurfNumAdj).SolarEnclIndex; + for (int adjZoneNum : DataViewFactorInformation::ZoneSolarInfo(adjSurfEnclNum).ZoneNums) { + numAdjEnclRefPoints += ZoneDaylight(adjZoneNum).TotalDaylRefPoints; + } + DataViewFactorInformation::ZoneSolarInfo(adjSurfEnclNum).TotalEnclosureDaylRefPoints = numAdjEnclRefPoints; + if (numAdjEnclRefPoints > 0) { if (!SurfaceWindow(SurfNum).SurfDayLightInit) { - SurfaceWindow(SurfNum).SolidAngAtRefPt.allocate(numRefPoints); + SurfaceWindow(SurfNum).SolidAngAtRefPt.allocate(numAdjEnclRefPoints); SurfaceWindow(SurfNum).SolidAngAtRefPt = 0.0; - SurfaceWindow(SurfNum).SolidAngAtRefPtWtd.allocate(numRefPoints); + SurfaceWindow(SurfNum).SolidAngAtRefPtWtd.allocate(numAdjEnclRefPoints); SurfaceWindow(SurfNum).SolidAngAtRefPtWtd = 0.0; - SurfaceWindow(SurfNum).IllumFromWinAtRefPt.allocate(2, numRefPoints); + SurfaceWindow(SurfNum).IllumFromWinAtRefPt.allocate(2, numAdjEnclRefPoints); SurfaceWindow(SurfNum).IllumFromWinAtRefPt = 0.0; - SurfaceWindow(SurfNum).BackLumFromWinAtRefPt.allocate(2, numRefPoints); + SurfaceWindow(SurfNum).BackLumFromWinAtRefPt.allocate(2, numAdjEnclRefPoints); SurfaceWindow(SurfNum).BackLumFromWinAtRefPt = 0.0; - SurfaceWindow(SurfNum).SourceLumFromWinAtRefPt.allocate(2, numRefPoints); + SurfaceWindow(SurfNum).SourceLumFromWinAtRefPt.allocate(2, numAdjEnclRefPoints); SurfaceWindow(SurfNum).SourceLumFromWinAtRefPt = 0.0; - SurfaceWindow(SurfNum).IllumFromWinAtRefPtRep.allocate(numRefPoints); + SurfaceWindow(SurfNum).IllumFromWinAtRefPtRep.allocate(numAdjEnclRefPoints); SurfaceWindow(SurfNum).IllumFromWinAtRefPtRep = 0.0; - SurfaceWindow(SurfNum).LumWinFromRefPtRep.allocate(numRefPoints); + SurfaceWindow(SurfNum).LumWinFromRefPtRep.allocate(numAdjEnclRefPoints); SurfaceWindow(SurfNum).LumWinFromRefPtRep = 0.0; SurfaceWindow(SurfNum).SurfDayLightInit = true; } @@ -4560,28 +4544,29 @@ namespace DaylightingManager { if (Surface(SurfNum).ExtBoundCond == ExternalEnvironment) { - WindowShadingControlPtr = Surface(SurfNum).WindowShadingControlPtr; + int WindowShadingControlPtr = Surface(SurfNum).WindowShadingControlPtr; if (Surface(SurfNum).HasShadeControl) { + auto & thisSurfEnclosure(DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNum).SolarEnclIndex)); if (WindowShadingControl(WindowShadingControlPtr).GlareControlIsActive) { // Error if GlareControlIsActive but window is not in a Daylighting:Detailed zone - if (ZoneDaylight(Surface(SurfNum).Zone).TotalDaylRefPoints == 0) { + if (thisSurfEnclosure.TotalEnclosureDaylRefPoints == 0) { ShowSevereError("Window=" + Surface(SurfNum).Name + " has Window Shading Control with"); - ShowContinueError("GlareControlIsActive = Yes but it is not in a Daylighting zone."); - ShowContinueError("Zone indicated=" + Zone(ZoneNum).Name); + ShowContinueError("GlareControlIsActive = Yes but it is not in a Daylighting zone or enclosure."); + ShowContinueError("Zone or enclosure indicated=" + DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNum).SolarEnclIndex).Name); ErrorsFound = true; } - // Error if GlareControlIsActive and window is in a Daylighting:Detailed zone with - // an interior window adjacent to another Daylighting:Detailed zone - if (ZoneDaylight(ZoneNum).TotalDaylRefPoints > 0) { - for (IntWin = Zone(ZoneNum).SurfaceFirst; IntWin <= Zone(ZoneNum).SurfaceLast; ++IntWin) { - SurfNumAdj = Surface(IntWin).ExtBoundCond; - if (Surface(IntWin).Class == SurfaceClass_Window && SurfNumAdj > 0) { - ZoneNumAdj = Surface(SurfNumAdj).Zone; - if (ZoneDaylight(ZoneNumAdj).TotalDaylRefPoints > 0) { + // Error if GlareControlIsActive and window is in a Daylighting:Detailed zone/enclosure with + // an interior window adjacent to another Daylighting:Detailed zone/enclosure + if (thisSurfEnclosure.TotalEnclosureDaylRefPoints > 0) { + for (int intWin : thisSurfEnclosure.SurfacePtr) { + int SurfNumAdj = Surface(intWin).ExtBoundCond; + if (Surface(intWin).Class == SurfaceClass_Window && SurfNumAdj > 0) { + auto & adjSurfEnclosure(DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNumAdj).SolarEnclIndex)); + if (adjSurfEnclosure.TotalEnclosureDaylRefPoints > 0) { ShowSevereError("Window=" + Surface(SurfNum).Name + " has Window Shading Control with"); - ShowContinueError("GlareControlIsActive = Yes and is in a Daylighting zone"); - ShowContinueError("that shares an interior window with another Daylighting zone"); - ShowContinueError("Adjacent Zone indicated=" + Zone(ZoneNumAdj).Name); + ShowContinueError("GlareControlIsActive = Yes and is in a Daylighting zone or enclosure"); + ShowContinueError("that shares an interior window with another Daylighting zone or enclosure"); + ShowContinueError("Adjacent Zone or Enclosure indicated=" + adjSurfEnclosure.Name); ErrorsFound = true; } } @@ -4592,24 +4577,24 @@ namespace DaylightingManager { if (WindowShadingControl(WindowShadingControlPtr).ShadingControlType == WSCT_MeetDaylIlumSetp) { // Error if window has ShadingControlType = MeetDaylightingIlluminanceSetpoint & // but is not in a Daylighting:Detailed zone - if (ZoneDaylight(Surface(SurfNum).Zone).TotalDaylRefPoints == 0) { + if (thisSurfEnclosure.TotalEnclosureDaylRefPoints == 0) { ShowSevereError("Window=" + Surface(SurfNum).Name + " has Window Shading Control with"); - ShowContinueError("MeetDaylightingIlluminanceSetpoint but it is not in a Daylighting zone."); - ShowContinueError("Zone indicated=" + Zone(ZoneNum).Name); + ShowContinueError("MeetDaylightingIlluminanceSetpoint but it is not in a Daylighting zone or enclosure."); + ShowContinueError("Zone or enclosure indicated=" + thisSurfEnclosure.Name); ErrorsFound = true; } // Error if window has ShadingControlType = MeetDaylightIlluminanceSetpoint and is in a & // Daylighting:Detailed zone with an interior window adjacent to another Daylighting:Detailed zone - if (ZoneDaylight(ZoneNum).TotalDaylRefPoints > 0) { - for (IntWin = Zone(ZoneNum).SurfaceFirst; IntWin <= Zone(ZoneNum).SurfaceLast; ++IntWin) { - SurfNumAdj = Surface(IntWin).ExtBoundCond; - if (Surface(IntWin).Class == SurfaceClass_Window && SurfNumAdj > 0) { - ZoneNumAdj = Surface(SurfNumAdj).Zone; - if (ZoneDaylight(ZoneNumAdj).TotalDaylRefPoints > 0) { + if (thisSurfEnclosure.TotalEnclosureDaylRefPoints > 0) { + for (int intWin : thisSurfEnclosure.SurfacePtr) { + int SurfNumAdj = Surface(intWin).ExtBoundCond; + if (Surface(intWin).Class == SurfaceClass_Window && SurfNumAdj > 0) { + auto & adjSurfEnclosure(DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNumAdj).SolarEnclIndex)); + if (adjSurfEnclosure.TotalEnclosureDaylRefPoints > 0) { ShowSevereError("Window=" + Surface(SurfNum).Name + " has Window Shading Control with"); - ShowContinueError("MeetDaylightIlluminanceSetpoint and is in a Daylighting zone"); - ShowContinueError("that shares an interior window with another Daylighting zone"); - ShowContinueError("Adjacent Zone indicated=" + Zone(ZoneNumAdj).Name); + ShowContinueError("MeetDaylightIlluminanceSetpoint and is in a Daylighting zone or enclosure"); + ShowContinueError("that shares an interior window with another Daylighting zone or enclosure"); + ShowContinueError("Adjacent Zone or enclosure indicated=" + adjSurfEnclosure.Name); ErrorsFound = true; } } @@ -7836,9 +7821,11 @@ namespace DaylightingManager { Real64 COSBintWin; ZoneNumThisWin = Surface(Surface(IWin).BaseSurf).Zone; + int thisWinEnclNum = Surface(Surface(IWin).BaseSurf).SolarEnclIndex; + int thisZoneEnclNum = Zone(ZoneNum).SolarEnclosureNum; // The inside surface area, ZoneDaylight(ZoneNum)%TotInsSurfArea was calculated in subr DayltgAveInteriorReflectance - if (ZoneNumThisWin == ZoneNum) { + if (thisWinEnclNum == thisZoneEnclNum) { ExtWinType = InZoneExtWin; ZoneInsideSurfArea = ZoneDaylight(ZoneNum).TotInsSurfArea; IntWinAdjZoneExtWinNum = 0; @@ -10435,7 +10422,6 @@ namespace DaylightingManager { // AUTHOR Fred Winkelmann // DATE WRITTEN Feb. 2004 // MODIFIED: June 2010;LKL - Merged two routines. - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // For each Daylighting:Detailed zone, Z, creates a list of other zones, Zadj, @@ -10446,42 +10432,8 @@ namespace DaylightingManager { // may be associated with an exterior window in a daylit target zone or an exterior window in // an adjacent zone, daylit or not, that shares interior windows with the target zone. - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // Using/Aliasing using General::RoundSigDigits; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // na - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int ZoneNum; // Zone number - int NumList; // Counter of adjacent zone numbers - int ZoneNumAdj; // Zone number - bool AdjZoneHasExtWins; // True if adjacent zone has one or more exterior windows - int SurfNumAdj; // Surface number - int SurfNumAdj2; // Surface number - int ExtWinIndex; - int IntWinIndex; - int ZoneAdjLoop; - int NumOfIntWindowsCount; - int ZoneExtWinCtr; // Exterior window counter - int SurfNum; // Surface number - int loop; // DO loop index Array1D_int ZoneExtWin; int WinSize; int RefSize; @@ -10496,96 +10448,99 @@ namespace DaylightingManager { static ObjexxFCL::gio::Fmt Format_703("('Zone/Window Adjacency Daylighting Matrix, ',A,',',A,$)"); static ObjexxFCL::gio::Fmt fmtCommaA("(',',A,$)"); - // FLOW: // Count number of exterior Windows (use to allocate arrays) - - // FLOW: - - for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { - // Count exterior windows in this zone - for (SurfNum = Zone(ZoneNum).SurfaceFirst; SurfNum <= Zone(ZoneNum).SurfaceLast; ++SurfNum) { - if ((Surface(SurfNum).Class == SurfaceClass_Window && Surface(SurfNum).ExtBoundCond == ExternalEnvironment) || - SurfaceWindow(SurfNum).OriginalClass == SurfaceClass_TDD_Diffuser) { + for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { + // Count exterior windows in this zone or shared solar enclosure + for (int surfNum : DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).SurfacePtr) { + if ((Surface(surfNum).Class == SurfaceClass_Window && Surface(surfNum).ExtBoundCond == ExternalEnvironment) || + SurfaceWindow(surfNum).OriginalClass == SurfaceClass_TDD_Diffuser) { ++ZoneDaylight(ZoneNum).TotalExtWindows; } } } - for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { - NumList = 0; + for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { + int NumList = 0; if (ZoneDaylight(ZoneNum).TotalDaylRefPoints == 0) continue; // This is a Daylighting:Detailed zone // Find adjacent zones - for (ZoneNumAdj = 1; ZoneNumAdj <= NumOfZones; ++ZoneNumAdj) { - if (ZoneNumAdj == ZoneNum) continue; - // Require that ZoneNumAdj have a least one exterior window - AdjZoneHasExtWins = false; - for (SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { - if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond == ExternalEnvironment) { - AdjZoneHasExtWins = true; - break; - } - } - if (!AdjZoneHasExtWins) continue; - // Loop again through surfaces in ZoneNumAdj and see if any are interior windows adjacent to ZoneNum - for (SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { - if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond >= 1) { - // This is an interior window in ZoneNumAdj - if (Surface(Surface(SurfNumAdj).ExtBoundCond).Zone == ZoneNum) { - // This interior window is adjacent to ZoneNum - ++NumList; + int thisZoneEnclNum = Zone(ZoneNum).SolarEnclosureNum; + for (int adjEnclNum = 1; adjEnclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++adjEnclNum) { + if (adjEnclNum == thisZoneEnclNum) continue; + for (int ZoneNumAdj : DataViewFactorInformation::ZoneSolarInfo(adjEnclNum).ZoneNums) { + // Require that ZoneNumAdj have a least one exterior window + bool AdjZoneHasExtWins = false; + for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { + if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond == ExternalEnvironment) { + AdjZoneHasExtWins = true; break; } } + if (!AdjZoneHasExtWins) continue; + // Loop again through surfaces in ZoneNumAdj and see if any are interior windows adjacent to ZoneNum + for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { + if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond >= 1) { + // This is an interior window in ZoneNumAdj + if (Surface(Surface(SurfNumAdj).ExtBoundCond).Zone == ZoneNum) { + // This interior window is adjacent to ZoneNum + ++NumList; + break; + } + } + } } } ZoneDaylight(ZoneNum).AdjIntWinZoneNums.allocate(NumList); ZoneDaylight(ZoneNum).AdjIntWinZoneNums = 0; } - for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { - NumList = 0; + for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { + int NumList = 0; if (ZoneDaylight(ZoneNum).TotalDaylRefPoints == 0) continue; // This is a Daylighting:Detailed zone // Find adjacent zones - for (ZoneNumAdj = 1; ZoneNumAdj <= NumOfZones; ++ZoneNumAdj) { - if (ZoneNumAdj == ZoneNum) continue; - // Require that ZoneNumAdj have a least one exterior window - AdjZoneHasExtWins = false; - for (SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { - if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond == ExternalEnvironment) { - AdjZoneHasExtWins = true; - break; - } - } - if (!AdjZoneHasExtWins) continue; - // Loop again through surfaces in ZoneNumAdj and see if any are interior windows adjacent to ZoneNum - for (SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { - if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond >= 1) { - // This is an interior window in ZoneNumAdj - if (Surface(Surface(SurfNumAdj).ExtBoundCond).Zone == ZoneNum) { - // This interior window is adjacent to ZoneNum - ++NumList; - ZoneDaylight(ZoneNum).AdjIntWinZoneNums(NumList) = ZoneNumAdj; - ZoneDaylight(ZoneNumAdj).AdjZoneHasDayltgCtrl = true; + int thisZoneEnclNum = Zone(ZoneNum).SolarEnclosureNum; + for (int adjEnclNum = 1; adjEnclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++adjEnclNum) { + if (adjEnclNum == thisZoneEnclNum) continue; + for (int ZoneNumAdj : DataViewFactorInformation::ZoneSolarInfo(adjEnclNum).ZoneNums) { + if (ZoneNumAdj == ZoneNum) continue; + // Require that ZoneNumAdj have a least one exterior window + bool AdjZoneHasExtWins = false; + for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { + if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond == ExternalEnvironment) { + AdjZoneHasExtWins = true; break; } } + if (!AdjZoneHasExtWins) continue; + // Loop again through surfaces in ZoneNumAdj and see if any are interior windows adjacent to ZoneNum + for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { + if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond >= 1) { + // This is an interior window in ZoneNumAdj + if (Surface(Surface(SurfNumAdj).ExtBoundCond).Zone == ZoneNum) { + // This interior window is adjacent to ZoneNum + ++NumList; + ZoneDaylight(ZoneNum).AdjIntWinZoneNums(NumList) = ZoneNumAdj; + ZoneDaylight(ZoneNumAdj).AdjZoneHasDayltgCtrl = true; + break; + } + } + } } } ZoneDaylight(ZoneNum).NumOfIntWinAdjZones = NumList; } // now fill out information on relationship between adjacent exterior windows and associated interior windows - for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { + for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { // first find count of exterior windows if (ZoneDaylight(ZoneNum).NumOfIntWinAdjZones <= 0) { ZoneDaylight(ZoneNum).NumOfIntWinAdjZoneExtWins = 0; continue; } - for (ZoneAdjLoop = 1; ZoneAdjLoop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++ZoneAdjLoop) { - ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(ZoneAdjLoop); - for (SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { + for (int ZoneAdjLoop = 1; ZoneAdjLoop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++ZoneAdjLoop) { + int ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(ZoneAdjLoop); + for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond == ExternalEnvironment) { ++ZoneDaylight(ZoneNum).NumOfIntWinAdjZoneExtWins; } @@ -10595,17 +10550,17 @@ namespace DaylightingManager { ZoneDaylight(ZoneNum).IntWinAdjZoneExtWin.allocate(ZoneDaylight(ZoneNum).NumOfIntWinAdjZoneExtWins); // now fill nested structure - ExtWinIndex = 0; - for (ZoneAdjLoop = 1; ZoneAdjLoop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++ZoneAdjLoop) { - ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(ZoneAdjLoop); - for (SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { + int ExtWinIndex = 0; + for (int ZoneAdjLoop = 1; ZoneAdjLoop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++ZoneAdjLoop) { + int ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(ZoneAdjLoop); + for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond == ExternalEnvironment) { ++ExtWinIndex; ZoneDaylight(ZoneNum).IntWinAdjZoneExtWin(ExtWinIndex).SurfNum = SurfNumAdj; // now count interior windows shared by both zones - NumOfIntWindowsCount = 0; - for (SurfNumAdj2 = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj2 <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj2) { + int NumOfIntWindowsCount = 0; + for (int SurfNumAdj2 = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj2 <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj2) { if (Surface(SurfNumAdj2).Class == SurfaceClass_Window && Surface(SurfNumAdj2).ExtBoundCond >= 1) { // This is an interior window in ZoneNumAdj if (Surface(Surface(SurfNumAdj2).ExtBoundCond).Zone == ZoneNum) { @@ -10617,8 +10572,8 @@ namespace DaylightingManager { // allocate nested array ZoneDaylight(ZoneNum).IntWinAdjZoneExtWin(ExtWinIndex).IntWinNum.allocate(NumOfIntWindowsCount); ZoneDaylight(ZoneNum).IntWinAdjZoneExtWin(ExtWinIndex).IntWinNum = 0; - IntWinIndex = 0; - for (SurfNumAdj2 = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj2 <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj2) { + int IntWinIndex = 0; + for (int SurfNumAdj2 = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj2 <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj2) { if (Surface(SurfNumAdj2).Class == SurfaceClass_Window && Surface(SurfNumAdj2).ExtBoundCond >= 1) { // This is an interior window in ZoneNumAdj if (Surface(Surface(SurfNumAdj2).ExtBoundCond).Zone == ZoneNum) { @@ -10635,25 +10590,25 @@ namespace DaylightingManager { ZoneExtWin.dimension(NumOfZones, 0); - for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { + for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { if (ZoneDaylight(ZoneNum).TotalDaylRefPoints > 0) { // This is a Daylighting:Detailed zone - // Get exterior windows in this zone - for (SurfNum = Zone(ZoneNum).SurfaceFirst; SurfNum <= Zone(ZoneNum).SurfaceLast; ++SurfNum) { - if ((Surface(SurfNum).Class == SurfaceClass_Window && Surface(SurfNum).ExtBoundCond == ExternalEnvironment) || - SurfaceWindow(SurfNum).OriginalClass == SurfaceClass_TDD_Diffuser) { + // Get exterior windows in this zone ro shared solar enclosure + for (int surfNum : DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).SurfacePtr) { + if ((Surface(surfNum).Class == SurfaceClass_Window && Surface(surfNum).ExtBoundCond == ExternalEnvironment) || + SurfaceWindow(surfNum).OriginalClass == SurfaceClass_TDD_Diffuser) { ++ZoneExtWin(ZoneNum); } } // Get exterior windows in adjacent zones that share interior windows with ZoneNum if (ZoneDaylight(ZoneNum).NumOfIntWinAdjZones > 0) { - for (loop = 1; loop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++loop) { - ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(loop); + for (int loop = 1; loop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++loop) { + int ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(loop); // Get exterior windows in ZoneNumAdj -- there must be at least one, otherwise // it would not be an "AdjIntWinZone" - for (SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { + for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { if ((Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond == ExternalEnvironment) || SurfaceWindow(SurfNumAdj).OriginalClass == SurfaceClass_TDD_Diffuser) { ++ZoneExtWin(ZoneNum); @@ -10665,7 +10620,7 @@ namespace DaylightingManager { } // End of check if a Daylighting:Detailed zone } // End of primary zone loop - for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { + for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { ZoneDaylight(ZoneNum).NumOfDayltgExtWins = 0; if (ZoneDaylight(ZoneNum).TotalDaylRefPoints > 0) { // This is a Daylighting:Detailed zone @@ -10688,7 +10643,7 @@ namespace DaylightingManager { ZoneDaylight(ZoneNum).SourceLumFromWinAtRefPt.allocate(ZoneExtWin(ZoneNum), 2, ZoneDaylight(ZoneNum).TotalDaylRefPoints); ZoneDaylight(ZoneNum).SourceLumFromWinAtRefPt = 0.0; - for (loop = 1; loop <= ZoneDaylight(ZoneNum).MapCount; ++loop) { + for (int loop = 1; loop <= ZoneDaylight(ZoneNum).MapCount; ++loop) { MapNum = ZoneDaylight(ZoneNum).ZoneToMap(loop); if (IllumMapCalc(MapNum).TotalMapRefPoints > 0) { @@ -10706,23 +10661,23 @@ namespace DaylightingManager { } } - ZoneExtWinCtr = 0; + int ZoneExtWinCtr = 0; - for (SurfNum = Zone(ZoneNum).SurfaceFirst; SurfNum <= Zone(ZoneNum).SurfaceLast; ++SurfNum) { - if ((Surface(SurfNum).Class == SurfaceClass_Window && Surface(SurfNum).ExtBoundCond == ExternalEnvironment) || - SurfaceWindow(SurfNum).OriginalClass == SurfaceClass_TDD_Diffuser) { + for (int surfNum : DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).SurfacePtr) { + if ((Surface(surfNum).Class == SurfaceClass_Window && Surface(surfNum).ExtBoundCond == ExternalEnvironment) || + SurfaceWindow(surfNum).OriginalClass == SurfaceClass_TDD_Diffuser) { ++ZoneExtWinCtr; - ZoneDaylight(ZoneNum).DayltgExtWinSurfNums(ZoneExtWinCtr) = SurfNum; + ZoneDaylight(ZoneNum).DayltgExtWinSurfNums(ZoneExtWinCtr) = surfNum; } } // Get exterior windows in adjacent zones that share interior windows with ZoneNum if (ZoneDaylight(ZoneNum).NumOfIntWinAdjZones > 0) { - for (loop = 1; loop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++loop) { - ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(loop); + for (int loop = 1; loop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++loop) { + int ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(loop); // Get exterior windows in ZoneNumAdj -- there must be at least one, otherwise // it would not be an "AdjIntWinZone" - for (SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { + for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { if ((Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond == ExternalEnvironment) || SurfaceWindow(SurfNumAdj).OriginalClass == SurfaceClass_TDD_Diffuser) { ++ZoneExtWinCtr; @@ -10762,7 +10717,7 @@ namespace DaylightingManager { ZoneDaylight(ZoneNum).DaylBackFacSun.allocate(24, MaxSlatAngs + 1, RefSize, WinSize); ZoneDaylight(ZoneNum).DaylBackFacSunDisk.allocate(24, MaxSlatAngs + 1, RefSize, WinSize); - for (loop = 1; loop <= ZoneDaylight(ZoneNum).MapCount; ++loop) { + for (int loop = 1; loop <= ZoneDaylight(ZoneNum).MapCount; ++loop) { MapNum = ZoneDaylight(ZoneNum).ZoneToMap(loop); RefSize = IllumMapCalc(MapNum).TotalMapRefPoints; IllumMapCalc(MapNum).DaylIllFacSky.allocate(24, MaxSlatAngs + 1, 4, RefSize, WinSize); @@ -10786,7 +10741,7 @@ namespace DaylightingManager { } // End of primary zone loop ObjexxFCL::gio::write(OutputFileInits, Format_700); - for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { + for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { if (ZoneDaylight(ZoneNum).TotalDaylRefPoints == 0 || ZoneDaylight(ZoneNum).DaylightMethod != SplitFluxDaylighting) continue; ObjexxFCL::gio::write(OutputFileInits, Format_701) << Zone(ZoneNum).Name << RoundSigDigits(ZoneDaylight(ZoneNum).TotalExtWindows) @@ -10794,7 +10749,7 @@ namespace DaylightingManager { } ObjexxFCL::gio::write(OutputFileInits, Format_702); - for (ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { + for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { if (ZoneDaylight(ZoneNum).TotalDaylRefPoints == 0 || ZoneDaylight(ZoneNum).DaylightMethod != SplitFluxDaylighting) continue; ObjexxFCL::gio::write(OutputFileInits, Format_703) << Zone(ZoneNum).Name << RoundSigDigits(ZoneDaylight(ZoneNum).NumOfIntWinAdjZones); for (int loop = 1, loop_end = min(ZoneDaylight(ZoneNum).NumOfIntWinAdjZones, 100); loop <= loop_end; ++loop) { From 2db8eb728a8d99b27743ea83993113bbf3b33c6c Mon Sep 17 00:00:00 2001 From: mjwitte Date: Thu, 22 Aug 2019 10:16:07 -0500 Subject: [PATCH 022/136] Air boundary - address comments and other cleanup --- .../group-surface-construction-elements.tex | 33 ++++------- src/EnergyPlus/DataSurfaces.cc | 3 +- src/EnergyPlus/DataSurfaces.hh | 1 - src/EnergyPlus/HeatBalanceIntRadExchange.cc | 35 ++++------- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 19 +++--- src/EnergyPlus/InternalHeatGains.cc | 8 +-- src/EnergyPlus/OutputReports.cc | 9 +-- src/EnergyPlus/SolarShading.cc | 58 +++++++++---------- src/EnergyPlus/SurfaceGeometry.cc | 16 +---- 9 files changed, 67 insertions(+), 115 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-surface-construction-elements.tex b/doc/input-output-reference/src/overview/group-surface-construction-elements.tex index 149254926d8..51b84b34ad9 100644 --- a/doc/input-output-reference/src/overview/group-surface-construction-elements.tex +++ b/doc/input-output-reference/src/overview/group-surface-construction-elements.tex @@ -4082,37 +4082,28 @@ \subsubsection{Inputs}\label{inputs-38-01} This field controls how the surface is modeled for solar distribution and daylighting calculations. There are two choices: -\begin{itemize} - \item - \textbf{GroupedZones} - The two zones separated by this air boundary will be grouped together into a combined zone for solar distribution and daylighting. If a given zone has an air boundary with more than one zone, then all of the connected zones will be grouped together. For example, if there is an air boundary between zones A and B, and another air boundary between zones B and C, all three zones (A, B, and C) will be grouped into a single zone. - - \item - \textbf{InteriorWindow} - The air boundary will be modeled as a perfectly transmitting interior window. As with other interior windows, all direct solar passing through the interior window will be diffuse in the adjacent zone. -\end{itemize} +\begin{description} + \item[GroupedZones] The two zones separated by this air boundary will be grouped together into a combined zone for solar distribution and daylighting. If a given zone has an air boundary with more than one zone, then all of the connected zones will be grouped together. For example, if there is an air boundary between zones A and B, and another air boundary between zones B and C, all three zones (A, B, and C) will be grouped into a single zone. + \item[InteriorWindow] The air boundary will be modeled as a perfectly transmitting interior window. As with other interior windows, all direct solar passing through the interior window will be diffuse in the adjacent zone. +\end{description} \paragraph{Field: Radiant Exchange Method}\label{field-radiant-exchange-method} This field controls how the surface is modeled for radiant exchange calculations. There are two choices: -\begin{itemize} - \item - \textbf{GroupedZones} - The two zones separated by this air boundary will be grouped together into a combined zone for radiant exchange between surfaces and distribution of radiant internal gains. If a given zone has an air boundary with more than one zone, then all of the connected zones will be grouped together. For example, if there is an air boundary between zones A and B, and another air boundary between zones B and C, all three zones (A, B, and C) will be grouped into a single zone. Normal default simplified view factors will apply unless detailed view factors are specified using \hyperref[zonepropertyuserviewfactorsbysurfacename]{ZoneProperty:UserViewFactors:bySurfaceName}. - - \item - \textbf{IRTSurface} - The air boundary will be modeled as blackbody surface between the adjacent zones (similar to, but not exactly the same as, \hyperref[materialinfraredtransparent]{Material:InfraredTransparent}. The surface participates in the radiant exchange within each zone and receives long-wave radiant energy from internal sources. The surface does not absorb any visible or solar radiation, has no thermal resistance, and has zero convective heat transfer coefficients on both sides. -\end{itemize} +\begin{description} + \item[GroupedZones] The two zones separated by this air boundary will be grouped together into a combined zone for radiant exchange between surfaces and distribution of radiant internal gains. If a given zone has an air boundary with more than one zone, then all of the connected zones will be grouped together. For example, if there is an air boundary between zones A and B, and another air boundary between zones B and C, all three zones (A, B, and C) will be grouped into a single zone. Normal default simplified view factors will apply unless detailed view factors are specified using \hyperref[zonepropertyuserviewfactorsbysurfacename]{ZoneProperty:UserViewFactors:bySurfaceName}. + \item[IRTSurface] The air boundary will be modeled as blackbody surface between the adjacent zones (similar to, but not exactly the same as, \hyperref[materialinfraredtransparent]{Material:InfraredTransparent}. The surface participates in the radiant exchange within each zone and receives long-wave radiant energy from internal sources. The surface does not absorb any visible or solar radiation, has no thermal resistance, and has zero convective heat transfer coefficients on both sides. +\end{description} \paragraph{Field: Air Exchange Method}\label{field-air-exchange-method} This field controls how the surface is modeled for radiant exchange calculations. There are two choices: -\begin{itemize} - \item - \textbf{None} - There will be no air exchange modeled across this surface. Other objects, such as \hyperref[zonemixing]{ZoneMixing} and \hyperref[zonecrossmixing]{ZoneCrossMixing} or AirflowNetwork openings may be specified if desired. - \item - \textbf{SimpleMixing} - For each pair of zones connected by Construction:AirBoundary, a pair of ZoneMixing objects will created automatically. These mixing objects may be automatically adjusted to balance HVAC system flows using the \hyperref[zoneairmassflowconservation]{ZoneAirMassFlowConservation} object. - -\end{itemize} +\begin{description} + \item[None] There will be no air exchange modeled across this surface. Other objects, such as \hyperref[zonemixing]{ZoneMixing} and \hyperref[zonecrossmixing]{ZoneCrossMixing} or AirflowNetwork openings may be specified if desired. + \item[SimpleMixing] For each pair of zones connected by Construction:AirBoundary, a pair of ZoneMixing objects will created automatically. These mixing objects may be automatically adjusted to balance HVAC system flows using the \hyperref[zoneairmassflowconservation]{ZoneAirMassFlowConservation} object. +\end{description} \paragraph{Field: Simple Mixing Air Changes per Hour}\label{field-simple-mixing-air-changes-per-hour} diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 5fd555c16a4..b928262e282 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -180,7 +180,7 @@ namespace DataSurfaces { // Parameters to indicate heat transfer model to use for surface int const HeatTransferModel_NotSet(-1); - int const HeatTransferModel_None(0); // shading surfaces for example and non-heat transfer air boundaries + int const HeatTransferModel_None(0); // shading surfaces int const HeatTransferModel_CTF(1); int const HeatTransferModel_EMPD(2); int const HeatTransferModel_CondFD(5); @@ -190,7 +190,6 @@ namespace DataSurfaces { int const HeatTransferModel_TDD(9); // tubular daylighting device int const HeatTransferModel_Kiva(10); // Kiva ground calculations int const HeatTransferModel_AirBoundaryNoHT(11); // Construction:AirBoundary - not IRT or interior window - int const HeatTransferModel_AirBoundaryIntWin(12); // Construction:AirBoundary - interior window for solar/daylighting // Parameters for classification of outside face of surfaces int const OutConvClass_WindwardVertWall(101); diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index d3a5c22c33c..f65f7599519 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -168,7 +168,6 @@ namespace DataSurfaces { extern int const HeatTransferModel_TDD; // tubular daylighting device extern int const HeatTransferModel_Kiva; // Kiva ground calculations extern int const HeatTransferModel_AirBoundaryNoHT; // Construction:AirBoundary - not IRT or interior window - extern int const HeatTransferModel_AirBoundaryIntWin; // Construction:AirBoundary - interior window for solar/daylighting // Parameters for classification of outside face of surfaces extern int const OutConvClass_WindwardVertWall; diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index 8d70db4a104..9c940fdcbbc 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -177,24 +177,12 @@ namespace HeatBalanceIntRadExchange { using HeatBalanceMovableInsulation::EvalInsideMovableInsulation; using WindowEquivalentLayer::EQLWindowInsideEffectiveEmiss; - // Argument array dimensioning - - // SUBROUTINE PARAMETER DEFINITIONS: Real64 const StefanBoltzmannConst(5.6697e-8); // Stefan-Boltzmann constant in W/(m2*K4) static ObjexxFCL::gio::Fmt fmtLD("*"); - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - - int RecSurfNum; // Counter within DO loop (refers to main surface derived type index) RECEIVING SURFACE - int SendSurfNum; // Counter within DO loop (refers to main surface derived type index) SENDING SURFACE - - int ConstrNumRec; // Receiving surface construction number - int ConstrNumSend; // Sending surface construction number Real64 RecSurfTemp; // Receiving surface temperature (C) Real64 SendSurfTemp; // Sending surface temperature (C) Real64 RecSurfEmiss; // Inside surface emissivity - int SurfNum; // Surface number - int ConstrNum; // Construction number bool IntShadeOrBlindStatusChanged; // True if status of interior shade or blind on at least // one window in a zone has changed from previous time step int ShadeFlag; // Window shading status current time step @@ -244,7 +232,6 @@ namespace HeatBalanceIntRadExchange { } #endif - ConstrNumRec = 0; int startEnclosure = 1; int endEnclosure = DataViewFactorInformation::NumOfRadiantEnclosures; if (PartialResimulate) { @@ -294,12 +281,10 @@ namespace HeatBalanceIntRadExchange { IntMovInsulChanged = false; if (!BeginEnvrnFlag) { // Check for change in shade/blind status - for (int surfCounter = 1; surfCounter <= zone_info.NumOfSurfaces; ++surfCounter) { - SurfNum = zone_info.SurfacePtr(surfCounter); + for (int const SurfNum : zone_SurfacePtr) { if (IntShadeOrBlindStatusChanged || IntMovInsulChanged) break; // Need only check if one window's status or one movable insulation status has changed - ConstrNum = Surface(SurfNum).Construction; - if (Construct(ConstrNum).TypeIsWindow) { + if (Construct(Surface(SurfNum).Construction).TypeIsWindow) { ShadeFlag = SurfaceWindow(SurfNum).ShadingFlag; ShadeFlagPrev = SurfaceWindow(SurfNum).ExtIntShadePrevTS; if ((ShadeFlagPrev != IntShadeOn && ShadeFlag == IntShadeOn) || @@ -314,8 +299,8 @@ namespace HeatBalanceIntRadExchange { if (IntShadeOrBlindStatusChanged || IntMovInsulChanged || BeginEnvrnFlag) { // Calc inside surface emissivities for this time step for (int ZoneSurfNum = 1; ZoneSurfNum <= n_zone_Surfaces; ++ZoneSurfNum) { - SurfNum = zone_SurfacePtr(ZoneSurfNum); - ConstrNum = Surface(SurfNum).Construction; + int const SurfNum = zone_SurfacePtr(ZoneSurfNum); + int const ConstrNum = Surface(SurfNum).Construction; zone_info.Emissivity(ZoneSurfNum) = Construct(ConstrNum).InsideAbsorpThermal; auto const &surface_window(SurfaceWindow(SurfNum)); if (Construct(ConstrNum).TypeIsWindow && @@ -339,9 +324,9 @@ namespace HeatBalanceIntRadExchange { // precalculate the fourth power of surface temperature as part of strategy to reduce calculation time - Glazer 2011-04-22 for (size_type SendZoneSurfNum = 0; SendZoneSurfNum < s_zone_Surfaces; ++SendZoneSurfNum) { - SendSurfNum = zone_SurfacePtr[SendZoneSurfNum]; + int const SendSurfNum = zone_SurfacePtr[SendZoneSurfNum]; auto const &surface_window(SurfaceWindow(SendSurfNum)); - ConstrNumSend = Surface(SendSurfNum).Construction; + int const ConstrNumSend = Surface(SendSurfNum).Construction; auto const &construct(Construct(ConstrNumSend)); if (construct.WindowTypeEQL || construct.WindowTypeBSDF) { SendSurfTemp = surface_window.EffInsSurfTemp; @@ -366,8 +351,8 @@ namespace HeatBalanceIntRadExchange { // These are the money loops size_type lSR(0u); for (size_type RecZoneSurfNum = 0; RecZoneSurfNum < s_zone_Surfaces; ++RecZoneSurfNum) { - RecSurfNum = zone_SurfacePtr[RecZoneSurfNum]; - ConstrNumRec = Surface(RecSurfNum).Construction; + int const RecSurfNum = zone_SurfacePtr[RecZoneSurfNum]; + int const ConstrNumRec = Surface(RecSurfNum).Construction; auto const &construct(Construct(ConstrNumRec)); auto &surface_window(SurfaceWindow(RecSurfNum)); auto &netLWRadToRecSurf(NetLWRadToSurf(RecSurfNum)); @@ -572,7 +557,7 @@ namespace HeatBalanceIntRadExchange { // Initialize the surface pointer array int enclosureSurfNum = 0; - for (int zoneNum : thisEnclosure.ZoneNums) { + for (int const zoneNum : thisEnclosure.ZoneNums) { for (int surfNum = Zone(zoneNum).SurfaceFirst, surfNum_end = Zone(zoneNum).SurfaceLast; surfNum <= surfNum_end; ++surfNum) { if (!Surface(surfNum).HeatTransSurf) continue; ++enclosureSurfNum; @@ -841,7 +826,7 @@ namespace HeatBalanceIntRadExchange { // Initialize the surface pointer array int enclosureSurfNum = 0; - for (int zoneNum : thisEnclosure.ZoneNums) { + for (int const zoneNum : thisEnclosure.ZoneNums) { for (int surfNum = Zone(zoneNum).SurfaceFirst, surfNum_end = Zone(zoneNum).SurfaceLast; surfNum <= surfNum_end; ++surfNum) { // Do not include non-heat transfer surfaces, unless it is an air boundary interior window if (!Surface(surfNum).HeatTransSurf && !Construct(Surface(surfNum).Construction).TypeIsAirBoundaryInteriorWindow) continue; diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 59980669aa5..bc36333c433 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -3287,7 +3287,7 @@ namespace HeatBalanceSurfaceManager { if (!Surface(SurfNum).HeatTransSurf) continue; //!!! Following may need to be removed or changed when shelves are considered in adjacent reflection calculations if (Surface(SurfNum).Class == SurfaceClass_Shading) continue; - int enclosureNum = Surface(SurfNum).SolarEnclIndex; + int const enclosureNum = Surface(SurfNum).SolarEnclIndex; IntBmIncInsSurfIntensRep(SurfNum) = ZoneBmSolFrIntWinsRep(enclosureNum) / DataViewFactorInformation::ZoneSolarInfo(enclosureNum).TotalSurfArea; IntBmIncInsSurfAmountRep(SurfNum) = IntBmIncInsSurfIntensRep(SurfNum) * (Surface(SurfNum).Area + SurfaceWindow(SurfNum).DividerArea); IntBmIncInsSurfAmountRepEnergy(SurfNum) = IntBmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; @@ -3307,11 +3307,11 @@ namespace HeatBalanceSurfaceManager { // COMPUTE RADIANT GAINS ON SURFACES for (SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - int zoneNum = Surface(SurfNum).Zone; + int const zoneNum = Surface(SurfNum).Zone; if (!Surface(SurfNum).HeatTransSurf || zoneNum == 0) continue; // Skip non-heat transfer surfaces if (Surface(SurfNum).Class == SurfaceClass_TDD_Dome) continue; // Skip tubular daylighting device domes - int radEnclosureNum = Zone(zoneNum).RadiantEnclosureNum; - int solEnclosureNum = Zone(zoneNum).SolarEnclosureNum; + int const radEnclosureNum = Zone(zoneNum).RadiantEnclosureNum; + int const solEnclosureNum = Zone(zoneNum).SolarEnclosureNum; ConstrNum = Surface(SurfNum).Construction; @@ -3512,7 +3512,7 @@ namespace HeatBalanceSurfaceManager { // RJH 08/30/07 - Add InitialDifSolInAbs, InitialDifSolwinAbs, and InitialDifSolAbsByShade // calced in CalcWinTransDifSolInitialDistribution to QRadSWInAbs, QRadSWwinAbs, and IntSWAbsByShade here for (SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - int zoneNum = Surface(SurfNum).Zone; + int const zoneNum = Surface(SurfNum).Zone; if (!Surface(SurfNum).HeatTransSurf || zoneNum == 0) continue; // Skip non-heat transfer surfaces if (Surface(SurfNum).Class == SurfaceClass_TDD_Dome) continue; // Skip tubular daylighting device domes ConstrNum = Surface(SurfNum).Construction; @@ -3569,7 +3569,7 @@ namespace HeatBalanceSurfaceManager { SWInAbsTotalReport(SurfNum) = 0.0; InitialDifSolInAbsReport(SurfNum) = 0.0; InitialDifSolInTransReport(SurfNum) = 0.0; - int zoneNum = Surface(SurfNum).Zone; + int const zoneNum = Surface(SurfNum).Zone; if (!Surface(SurfNum).HeatTransSurf || zoneNum == 0) continue; // Skip non-heat transfer surfaces if (Surface(SurfNum).Class == SurfaceClass_TDD_Dome) continue; // Skip tubular daylighting device domes ConstrNum = Surface(SurfNum).Construction; @@ -3707,7 +3707,7 @@ namespace HeatBalanceSurfaceManager { Real64 SUM1 = 0.0; auto & thisEnclosure(DataViewFactorInformation::ZoneRadiantInfo(radEnclosureNum)); - for (int SurfNum : thisEnclosure.SurfacePtr ) { + for (int const SurfNum : thisEnclosure.SurfacePtr ) { if (!Surface(SurfNum).HeatTransSurf) continue; @@ -3841,7 +3841,7 @@ namespace HeatBalanceSurfaceManager { SUM1 = 0.0; - for (int SurfNum : DataViewFactorInformation::ZoneSolarInfo(enclosureNum).SurfacePtr) { + for (int const SurfNum : DataViewFactorInformation::ZoneSolarInfo(enclosureNum).SurfacePtr) { ConstrNum = Surface(SurfNum).Construction; @@ -7294,8 +7294,7 @@ namespace HeatBalanceSurfaceManager { TMULTseq(CurOverallSimDay, TimeStepInDay, enclosureNum) = TMULT(enclosureNum); } for (jSurf = 1; jSurf <= TotSurfaces; ++jSurf) { - int iZone = Surface(jSurf).Zone; - if (!Surface(jSurf).HeatTransSurf || iZone == 0) continue; // Skip non-heat transfer surfaces + if (!Surface(jSurf).HeatTransSurf || Surface(jSurf).Zone == 0) continue; // Skip non-heat transfer surfaces if (Surface(jSurf).Class == SurfaceClass_TDD_Dome) continue; // Skip tubular daylighting device domes ITABSFseq(CurOverallSimDay, TimeStepInDay, jSurf) = ITABSF(jSurf); } diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 2b678aef11e..02efe8b43b8 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -6037,7 +6037,7 @@ namespace InternalHeatGains { for (int enclosureNum = 1; enclosureNum <= DataViewFactorInformation::NumOfRadiantEnclosures; ++enclosureNum) { auto & thisEnclosure(DataViewFactorInformation::ZoneRadiantInfo(enclosureNum)); QL(enclosureNum) = 0.0; - for (int zoneNum : thisEnclosure.ZoneNums) { + for (int const zoneNum : thisEnclosure.ZoneNums) { Real64 zoneQL; SumAllInternalRadiationGains(zoneNum, zoneQL); QL(enclosureNum) += zoneQL; @@ -6051,15 +6051,15 @@ namespace InternalHeatGains { AllocateLoadComponentArrays(); } for (SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { - int NZ = Surface(SurfNum).Zone; + int const NZ = Surface(SurfNum).Zone; if (!Surface(SurfNum).HeatTransSurf || NZ == 0) continue; // Skip non-heat transfer surfaces - int radEnclosureNum = Zone(Surface(SurfNum).Zone).RadiantEnclosureNum; + int const radEnclosureNum = Zone(Surface(SurfNum).Zone).RadiantEnclosureNum; if (!doLoadComponentPulseNow) { QRadThermInAbs(SurfNum) = QL(radEnclosureNum) * TMULT(radEnclosureNum) * ITABSF(SurfNum); } else { curQL = QL(radEnclosureNum); // for the loads component report during the special sizing run increase the radiant portion - // a small amount to create a "pulse" of heat that is used for the + // a small amount to create a "pulse" of heat that is used for the delayed loads adjQL = curQL + DataViewFactorInformation::ZoneRadiantInfo(radEnclosureNum).FloorArea * pulseMultipler; // ITABSF is the Inside Thermal Absorptance // TMULT is a mulipliter for each zone diff --git a/src/EnergyPlus/OutputReports.cc b/src/EnergyPlus/OutputReports.cc index ce2a2338cda..86df04b1689 100644 --- a/src/EnergyPlus/OutputReports.cc +++ b/src/EnergyPlus/OutputReports.cc @@ -1977,8 +1977,6 @@ void DetailsForSurfaces(int const RptType) // (1=Vertices only, 10=Details only, AlgoName = "Tubular Daylighting Device"; } else if (SELECT_CASE_var == HeatTransferModel_AirBoundaryNoHT) { AlgoName = "Air Boundary - No Heat Transfer"; - } else if (SELECT_CASE_var == HeatTransferModel_AirBoundaryIntWin) { - AlgoName = "Air Boundary - Interior Window"; } } // Default Convection Coefficient Calculation Algorithms @@ -2226,8 +2224,6 @@ void DetailsForSurfaces(int const RptType) // (1=Vertices only, 10=Details only, AlgoName = "Tubular Daylighting Device"; } else if (SELECT_CASE_var == HeatTransferModel_AirBoundaryNoHT) { AlgoName = "Air Boundary - No Heat Transfer"; - } else if (SELECT_CASE_var == HeatTransferModel_AirBoundaryIntWin) { - AlgoName = "Air Boundary - Interior Window"; } } *eiostream << "HeatTransfer Surface," << Surface(surf).Name << "," << cSurfaceClass(Surface(surf).Class) << "," << BaseSurfName << "," @@ -2508,9 +2504,8 @@ void VRMLOut(std::string &PolygonAction, std::string &ColorScheme) // Do all detached shading surfaces first for (surf = 1; surf <= TotSurfaces; ++surf) { if (Surface(surf).HeatTransSurf) continue; - int constrNum = Surface(surf).Construction; - if (constrNum > 0) { - if (DataHeatBalance::Construct(constrNum).TypeIsAirBoundary) continue; + if (Surface(surf).Construction > 0) { + if (DataHeatBalance::Construct(Surface(surf).Construction).TypeIsAirBoundary) continue; } if (Surface(surf).Class == SurfaceClass_Shading) continue; if (Surface(surf).Sides == 0) continue; diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 36b9001f72b..29e5682a8fa 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -3088,9 +3088,10 @@ namespace SolarShading { AreaSum = 0.0; TestFractSum = 0.0; - for (int SurfNum : thisEnclosure.SurfacePtr) { - int surfZoneNum = Surface(SurfNum).Zone; - if (Zone(surfZoneNum).OfType == StandardZone && Surface(SurfNum).CosTilt < -0.5) AreaSum += Surface(SurfNum).Area; + for (int const SurfNum : thisEnclosure.SurfacePtr) { + if (Zone(Surface(SurfNum).Zone).OfType == StandardZone && Surface(SurfNum).CosTilt < -0.5) { + AreaSum += Surface(SurfNum).Area; + } } HorizAreaSum = AreaSum; @@ -3105,13 +3106,12 @@ namespace SolarShading { // Compute ISABSF - for (int SurfNum : thisEnclosure.SurfacePtr) { + for (int const SurfNum : thisEnclosure.SurfacePtr) { // only horizontal surfaces. ! !CR 8229, relaxed from -0.99 to -0.5 (Tilt > 154) // only horizontal surfaces. ! !CR8769 use ASHRAE std of >120, -0.9 to -0.5 (Tilt > 120) - int surfZoneNum = Surface(SurfNum).Zone; - if ((Zone(surfZoneNum).OfType != StandardZone || Surface(SurfNum).CosTilt < -0.5) && - (Zone(surfZoneNum).OfType == StandardZone || Surface(SurfNum).ExtBoundCond > 0)) { + if ((Zone(Surface(SurfNum).Zone).OfType != StandardZone || Surface(SurfNum).CosTilt < -0.5) && + (Zone(Surface(SurfNum).Zone).OfType == StandardZone || Surface(SurfNum).ExtBoundCond > 0)) { int ConstrNum = Surface(SurfNum).Construction; // last minute V3.1 @@ -3157,7 +3157,7 @@ namespace SolarShading { AreaSum += Surface(SurfNum).Area; } - for (int SurfNum : thisEnclosure.SurfacePtr) { + for (int const SurfNum : thisEnclosure.SurfacePtr) { int ConstrNum = Surface(SurfNum).Construction; if (Construct(ConstrNum).TransDiff <= 0.0) { // Opaque surface if (AreaSum > 0.0) ISABSF(SurfNum) = Surface(SurfNum).Area * Construct(ConstrNum).InsideAbsorpSolar / AreaSum; @@ -5864,7 +5864,6 @@ namespace SolarShading { int ConstrNumSh; // Shaded construction number int ConstrNumBack; // Construction number of back surface int ConstrNumBackSh; // Shaded construction number of back surface - int FlConstrNum; // Construction number of floor surface int ShadeFlag; // Shading flag for a window int ShadeFlagBack; // Shading flag for a window that is a back surface int Lay; // Glass layer number @@ -6209,7 +6208,7 @@ namespace SolarShading { // Loop over exterior surfaces in this zone auto &thisEnclosure(DataViewFactorInformation::ZoneSolarInfo(enclosureNum)); - for (int SurfNum : thisEnclosure.SurfacePtr) { + for (int const SurfNum : thisEnclosure.SurfacePtr) { if (((Surface(SurfNum).ExtBoundCond != ExternalEnvironment) && (Surface(SurfNum).ExtBoundCond != OtherSideCondModeledExt)) && SurfaceWindow(SurfNum).OriginalClass != SurfaceClass_TDD_Diffuser) continue; @@ -7953,10 +7952,10 @@ namespace SolarShading { } else { // Simple interior solar distribution. All beam from exterior windows falls on floor; // some of this is absorbed/transmitted, rest is reflected to other surfaces. - for (int FloorNum : thisEnclosure.SurfacePtr) { + for (int const FloorNum : thisEnclosure.SurfacePtr) { // In following, ISABSF is zero except for nominal floor surfaces if (ISABSF(FloorNum) <= 0.0 || FloorNum == SurfNum) continue; // Keep only floor surfaces - FlConstrNum = Surface(FloorNum).Construction; + int FlConstrNum = Surface(FloorNum).Construction; BTOTWinZone = TBm * SunLitFract * Surface(SurfNum).Area * CosInc * InOutProjSLFracMult; //[m2] @@ -8036,7 +8035,7 @@ namespace SolarShading { } // Variables for reporting - for (int SurfNum : thisEnclosure.SurfacePtr) { + for (int const SurfNum : thisEnclosure.SurfacePtr) { if (SolarDistribution == FullInteriorExterior) { BmIncInsSurfAmountRep(SurfNum) *= BeamSolarRad; BmIncInsSurfAmountRepEnergy(SurfNum) = BmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; @@ -8298,7 +8297,7 @@ namespace SolarShading { ZoneDifSolFrExtWinsRepEnergy(enclosureNum) = 0; auto &thisEnclosure(DataViewFactorInformation::ZoneSolarInfo(enclosureNum)); - for (int SurfNum : thisEnclosure.SurfacePtr) { + for (int const SurfNum : thisEnclosure.SurfacePtr) { if (Surface(SurfNum).Class != SurfaceClass_Window) continue; int SurfNum2 = 0; if (SurfaceWindow(SurfNum).OriginalClass == SurfaceClass_TDD_Diffuser) { @@ -8419,7 +8418,7 @@ namespace SolarShading { if (SolarDistribution == FullInteriorExterior) { for (int IBack = 1; IBack <= NumOfBackSurf; ++IBack) { - int BackSurfNum = BackSurfaces(TimeStep, HourOfDay, IBack, SurfNum); + int const BackSurfNum = BackSurfaces(TimeStep, HourOfDay, IBack, SurfNum); if (BackSurfNum == 0) break; // No more irradiated back surfaces for this exterior window int ConstrNumBack = Surface(BackSurfNum).Construction; @@ -8455,15 +8454,14 @@ namespace SolarShading { } } } else { - for (int FloorNum : thisEnclosure.SurfacePtr) { + for (int const FloorNum : thisEnclosure.SurfacePtr) { // In following, ISABSF is zero except for nominal floor surfaces if (!Surface(FloorNum).HeatTransSurf) continue; if (ISABSF(FloorNum) <= 0.0 || FloorNum == SurfNum) continue; // Keep only floor surfaces - int FlConstrNum = Surface(FloorNum).Construction; Real64 BTOTWinZone = TBm * SunLitFract * Surface(SurfNum).Area * CosInc * window.InOutProjSLFracMult(HourOfDay); //[m2] - if (Construct(FlConstrNum).TransDiff <= 0.0) { + if (Construct(Surface(FloorNum).Construction).TransDiff <= 0.0) { // Opaque surface AISurf(FloorNum) += BTOTWinZone * ISABSF(FloorNum) / Surface(FloorNum).Area; //[-] @@ -11256,7 +11254,7 @@ namespace SolarShading { ZoneDifSolarDistTransmittedTotl = 0.0; // Loop over all diffuse solar transmitting surfaces (i.e., exterior windows and TDDs) in the current zone - for (int DifTransSurfNum : thisEnclosure.SurfacePtr) { + for (int const DifTransSurfNum : thisEnclosure.SurfacePtr) { // Skip surfaces that are not exterior, except for TDD_Diffusers if (((Surface(DifTransSurfNum).ExtBoundCond != ExternalEnvironment) && (Surface(DifTransSurfNum).ExtBoundCond != OtherSideCondModeledExt)) && @@ -11287,15 +11285,15 @@ namespace SolarShading { WinDifSolarDistTransmittedTotl = 0.0; // Loop over all heat transfer surfaces in the current zone that might receive diffuse solar - for (int HeatTransSurfNum : thisEnclosure.SurfacePtr) { + for (int const HeatTransSurfNum : thisEnclosure.SurfacePtr) { // Skip surfaces that are not heat transfer surfaces // Skip tubular daylighting device domes if (Surface(HeatTransSurfNum).Class == SurfaceClass_TDD_Dome) continue; // View factor from current (sending) window DifTransSurfNum to current (receiving) surface HeatTransSurfNum - int HTenclosureSurfNum = Surface(HeatTransSurfNum).SolarEnclSurfIndex; // HT surface index for ZoneSolarInfo.SurfacePtr and F arrays - int enclosureNum = Surface(HeatTransSurfNum).SolarEnclIndex; // index for ZoneSolarInfo - int DTenclSurfNum = Surface(DifTransSurfNum).SolarEnclSurfIndex; // Window surface index for ZoneSolarInfo.SurfacePtr and F arrays + int const HTenclosureSurfNum = Surface(HeatTransSurfNum).SolarEnclSurfIndex; // HT surface index for ZoneSolarInfo.SurfacePtr and F arrays + int const enclosureNum = Surface(HeatTransSurfNum).SolarEnclIndex; // index for ZoneSolarInfo + int const DTenclSurfNum = Surface(DifTransSurfNum).SolarEnclSurfIndex; // Window surface index for ZoneSolarInfo.SurfacePtr and F arrays ViewFactor = DataViewFactorInformation::ZoneSolarInfo(enclosureNum).F(HTenclosureSurfNum, DTenclSurfNum); // debug ViewFactorTotal @@ -11442,7 +11440,7 @@ namespace SolarShading { // * Construct(AdjConstrNum)%TransDiff // Get the adjacent zone index - int adjEnclosureNum = Surface(AdjSurfNum).SolarEnclIndex; + int const adjEnclosureNum = Surface(AdjSurfNum).SolarEnclIndex; // Call routine to distribute diffuse solar transmitted through this interior window into adjacent zone CalcInteriorWinTransDifSolInitialDistribution(adjEnclosureNum, AdjSurfNum, DifSolarTransW); @@ -11648,7 +11646,7 @@ namespace SolarShading { // NOTE: This calc is here because interior windows are currently assumed to have no shading // Get the adjacent surface number for this receiving window surface - int AdjSurfNum = Surface(HeatTransSurfNum).ExtBoundCond; + int const AdjSurfNum = Surface(HeatTransSurfNum).ExtBoundCond; // If the adjacent surface number is > 0, this is an interior window if (AdjSurfNum > 0) { // this is an interior window surface @@ -11832,7 +11830,7 @@ namespace SolarShading { auto &thisEnclosure(DataViewFactorInformation::ZoneSolarInfo(IntWinEnclosureNum)); // Loop over all heat transfer surfaces in the current zone that might receive diffuse solar Real64 InitialZoneDifSolReflW_zone(0.0); - for (int HeatTransSurfNum : thisEnclosure.SurfacePtr) { + for (int const HeatTransSurfNum : thisEnclosure.SurfacePtr) { // Skip surfaces that are not heat transfer surfaces if (!Surface(HeatTransSurfNum).HeatTransSurf) continue; // Skip tubular daylighting device domes @@ -11973,16 +11971,14 @@ namespace SolarShading { // NOTE: This calc is here because interior windows are currently assumed to have no shading // Get the adjacent surface number for this receiving window surface - int AdjSurfNum = Surface(HeatTransSurfNum).ExtBoundCond; + int const AdjSurfNum = Surface(HeatTransSurfNum).ExtBoundCond; // If the adjacent surface number is > 0, this is an interior window if (AdjSurfNum > 0) { // this is an interior window surface - // Get the adjacent zone index - int adjEnclosureNum = Surface(AdjSurfNum).SolarEnclIndex; - + // Get the adjacent zone/enclosure index // Add transmitted diffuse solar to total reflected distributed diffuse solar for each zone // for subsequent interreflection calcs - InitialZoneDifSolReflW(adjEnclosureNum) += DifSolarTransW; // [W] + InitialZoneDifSolReflW(Surface(AdjSurfNum).SolarEnclIndex) += DifSolarTransW; // [W] } } else if (ShadeFlag == IntShadeOn || ShadeFlag >= 3) { diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 2bec99e07f5..dd4aa7aff59 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -1994,8 +1994,9 @@ namespace SurfaceGeometry { for (SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { if (!Surface(SurfNum).HeatTransSurf) continue; // ignore shading surfaces if (Surface(SurfNum).ExtBoundCond > 0 && Surface(SurfNum).ExtBoundCond != SurfNum) continue; // interzone, not adiabatic surface - if (!Construct(Surface(SurfNum).Construction).TypeIsIRT) + if (!Construct(Surface(SurfNum).Construction).TypeIsIRT) { continue; + } if (!DisplayExtraWarnings) { ++iTmp1; } else { @@ -7036,19 +7037,6 @@ namespace SurfaceGeometry { surf.HeatTransferAlgorithm = HeatTransferModel_Kiva; DataHeatBalance::AnyKiva = true; } - //if (surf.HeatTransSurf) { - // if (DataHeatBalance::Construct(surf.Construction).TypeIsAirBoundaryIRTSurface) { - // // IRT air boundaries use CTF algorithm - // surf.HeatTransferAlgorithm = HeatTransferModel_CTF; - // DataHeatBalance::AnyAirBoundary = true; - // } else if (DataHeatBalance::Construct(surf.Construction).TypeIsAirBoundaryInteriorWindow) { - // surf.HeatTransferAlgorithm = HeatTransferModel_AirBoundaryIntWin; - // DataHeatBalance::AnyAirBoundary = true; - // } else if (DataHeatBalance::Construct(surf.Construction).TypeIsAirBoundary) { - // surf.HeatTransferAlgorithm = HeatTransferModel_AirBoundaryNoHT; - // DataHeatBalance::AnyAirBoundary = true; - // } - //} } // Setup Kiva instances From a6d3052f0d54612fdf10ae99bbae745097ce738d Mon Sep 17 00:00:00 2001 From: mjwitte Date: Thu, 22 Aug 2019 12:06:38 -0500 Subject: [PATCH 023/136] Air boundary - more cleanup --- src/EnergyPlus/DataViewFactorInformation.hh | 4 ++-- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/DataViewFactorInformation.hh b/src/EnergyPlus/DataViewFactorInformation.hh index b69e3610b40..7b4d8abe123 100644 --- a/src/EnergyPlus/DataViewFactorInformation.hh +++ b/src/EnergyPlus/DataViewFactorInformation.hh @@ -76,8 +76,8 @@ namespace DataViewFactorInformation { Array1D Emissivity; // Surface emissivity Array1D Azimuth; // Azimuth angle of the surface (in degrees) Array1D Tilt; // Tilt angle of the surface (in degrees) - Array1D_int SurfacePtr; // Surface ALLOCATABLE (to Surface derived type) - Real64 FloorArea; // Floor area of zone(s) in radiant enclosure + Array1D_int SurfacePtr; // Surface number for surfaces in this enclosure + Real64 FloorArea; // Floor area of zone(s) in enclosure Real64 ExtWindowArea; // Exterior window area Real64 TotalSurfArea; // Total surface area Array1D SolAbsorptance; // Surface solar absorptance diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index 9c940fdcbbc..8feee909f66 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -810,7 +810,14 @@ namespace HeatBalanceIntRadExchange { int numEnclosureSurfaces = 0; for (int zoneNum : thisEnclosure.ZoneNums) { for (int surfNum = Zone(zoneNum).SurfaceFirst, surfNum_end = Zone(zoneNum).SurfaceLast; surfNum <= surfNum_end; ++surfNum) { - if (Surface(surfNum).HeatTransSurf) ++numEnclosureSurfaces; + // Do not include non-heat transfer surfaces, unless it is an air boundary interior window + if (Surface(surfNum).Construction > 0) { + if (!Surface(surfNum).HeatTransSurf && !Construct(Surface(surfNum).Construction).TypeIsAirBoundaryInteriorWindow) continue; + } + else if (!Surface(surfNum).HeatTransSurf) { + continue; + } + ++numEnclosureSurfaces; } } thisEnclosure.NumOfSurfaces = numEnclosureSurfaces; @@ -829,7 +836,11 @@ namespace HeatBalanceIntRadExchange { for (int const zoneNum : thisEnclosure.ZoneNums) { for (int surfNum = Zone(zoneNum).SurfaceFirst, surfNum_end = Zone(zoneNum).SurfaceLast; surfNum <= surfNum_end; ++surfNum) { // Do not include non-heat transfer surfaces, unless it is an air boundary interior window - if (!Surface(surfNum).HeatTransSurf && !Construct(Surface(surfNum).Construction).TypeIsAirBoundaryInteriorWindow) continue; + if (Surface(surfNum).Construction > 0) { + if (!Surface(surfNum).HeatTransSurf && !Construct(Surface(surfNum).Construction).TypeIsAirBoundaryInteriorWindow) continue; + } else if (!Surface(surfNum).HeatTransSurf) { + continue; + } ++enclosureSurfNum; thisEnclosure.SurfacePtr(enclosureSurfNum) = surfNum; // Store pointers back to here From 84b124cd9c3f6ee5d3a2d38d098b2a43c2478002 Mon Sep 17 00:00:00 2001 From: mjwitte Date: Sat, 24 Aug 2019 13:28:29 -0500 Subject: [PATCH 024/136] Air boundary - daylighting part 2 --- src/EnergyPlus/DataHeatBalance.cc | 27 +-- src/EnergyPlus/DataHeatBalance.hh | 13 +- src/EnergyPlus/DataSurfaces.hh | 7 +- src/EnergyPlus/DaylightingManager.cc | 200 +++++++++----------- src/EnergyPlus/DaylightingManager.hh | 1 + src/EnergyPlus/HeatBalanceSurfaceManager.cc | 24 +-- src/EnergyPlus/SurfaceGeometry.cc | 9 +- 7 files changed, 137 insertions(+), 144 deletions(-) diff --git a/src/EnergyPlus/DataHeatBalance.cc b/src/EnergyPlus/DataHeatBalance.cc index 6c2886f5caa..aa96ba8b3db 100644 --- a/src/EnergyPlus/DataHeatBalance.cc +++ b/src/EnergyPlus/DataHeatBalance.cc @@ -489,18 +489,20 @@ namespace DataHeatBalance { int SolarDistribution(0); // Solar Distribution Algorithm int InsideSurfIterations(0); // Counts inside surface iterations int OverallHeatTransferSolutionAlgo(DataSurfaces::HeatTransferModel_CTF); // Global HeatBalanceAlgorithm setting - // Flags for HeatTransfer Algorithms Used - bool AnyCTF(false); // CTF used - bool AnyEMPD(false); // EMPD used - bool AnyCondFD(false); // CondFD used - bool AnyHAMT(false); // HAMT used - bool AnyKiva(false); // Kiva used - bool AnyAirBoundary(false); // Construction:AirBoundary used - int MaxNumberOfWarmupDays(25); // Maximum number of warmup days allowed - int MinNumberOfWarmupDays(6); // Minimum number of warmup days allowed - Real64 CondFDRelaxFactor(1.0); // Relaxation factor, for looping across all the surfaces. + + // Flags for HeatTransfer Algorithms Used + bool AnyCTF(false); // CTF used + bool AnyEMPD(false); // EMPD used + bool AnyCondFD(false); // CondFD used + bool AnyHAMT(false); // HAMT used + bool AnyKiva(false); // Kiva used + bool AnyAirBoundary(false); // Construction:AirBoundary used + bool AnyAirBoundaryGroupedSolar(false); // Construction:AirBoundary with GroupedZones for solar used somewhere + + int MaxNumberOfWarmupDays(25); // Maximum number of warmup days allowed + int MinNumberOfWarmupDays(6); // Minimum number of warmup days allowed + Real64 CondFDRelaxFactor(1.0); // Relaxation factor, for looping across all the surfaces. Real64 CondFDRelaxFactorInput(1.0); // Relaxation factor, for looping across all the surfaces, user input value - // LOGICAL :: CondFDVariableProperties = .FALSE. ! if true, then variable conductivity or enthalpy in Cond FD. int ZoneAirSolutionAlgo(Use3rdOrder); // ThirdOrderBackwardDifference, AnalyticalSolution, and EulerMethod Real64 BuildingRotationAppendixG(0.0); // Building Rotation for Appendix G @@ -725,7 +727,7 @@ namespace DataHeatBalance { Array1D MultHorizonZenith; // Contribution to eff sky view factor from horizon or zenith brightening Array1D QS; // Zone short-wave flux density; used to calculate short-wave - // radiation absorbed on inside surfaces of zone + // radiation absorbed on inside surfaces of zone or enclosure Array1D QSLights; // Like QS, but Lights short-wave only. Array1D QSDifSol; // Like QS, but diffuse solar short-wave only. @@ -867,6 +869,7 @@ namespace DataHeatBalance { AnyHAMT = false; AnyKiva = false; AnyAirBoundary = false; + AnyAirBoundaryGroupedSolar = false; MaxNumberOfWarmupDays = 25; MinNumberOfWarmupDays = 6; CondFDRelaxFactor = 1.0; diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index d49e2838e99..a5f486aa6c7 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -344,12 +344,13 @@ namespace DataHeatBalance { extern int OverallHeatTransferSolutionAlgo; // UseCTF Solution, UseEMPD moisture solution, UseCondFD solution // Flags for HeatTransfer Algorithms Used - extern bool AnyCTF; // CTF used - extern bool AnyEMPD; // EMPD used - extern bool AnyCondFD; // CondFD used - extern bool AnyHAMT; // HAMT used - extern bool AnyKiva; // Kiva used - extern bool AnyAirBoundary; // Construction:AirBoundary used + extern bool AnyCTF; // CTF used + extern bool AnyEMPD; // EMPD used + extern bool AnyCondFD; // CondFD used + extern bool AnyHAMT; // HAMT used + extern bool AnyKiva; // Kiva used + extern bool AnyAirBoundary; // Construction:AirBoundary used + extern bool AnyAirBoundaryGroupedSolar; // Construction:AirBoundary with GroupedZones for solar used somewhere extern int MaxNumberOfWarmupDays; // Maximum number of warmup days allowed extern int MinNumberOfWarmupDays; // Minimum number of warmup days allowed diff --git a/src/EnergyPlus/DataSurfaces.hh b/src/EnergyPlus/DataSurfaces.hh index f65f7599519..2e1aa6ae15f 100644 --- a/src/EnergyPlus/DataSurfaces.hh +++ b/src/EnergyPlus/DataSurfaces.hh @@ -1084,9 +1084,8 @@ namespace DataSurfaces { Real64 VentingOpenFactorMultRep; // Window/door opening modulation multiplier on venting open factor, for reporting Real64 InsideTempForVentingRep; // Inside air temp used to control window/door venting, for reporting (C) Real64 VentingAvailabilityRep; // Venting availability schedule value (0.0/1.0 = no venting allowed/not allowed) - Array1D IllumFromWinAtRefPtRep; // Illuminance from window at reference point #1 [lux] - Array1D LumWinFromRefPtRep; // Window luminance as viewed from reference point #1 [cd/m2] - Real64 LumWinFromRefPt2Rep; // Window luminance as viewed from reference point #2 [cd/m2] + Array1D IllumFromWinAtRefPtRep; // Illuminance from window at reference point N [lux] + Array1D LumWinFromRefPtRep; // Window luminance as viewed from reference point N [cd/m2] // for shadowing of ground by building and obstructions [W/m2] Real64 SkyGndSolarInc; // Incident diffuse solar from ground-reflected sky radiation; used for // Complex Fen; if CalcSolRefl is true, accounts for shadowing of ground by building and obstructions [W/m2] @@ -1152,7 +1151,7 @@ namespace DataSurfaces { AirflowDestination(0), AirflowReturnNodePtr(0), MaxAirflow(0.0), AirflowControlType(0), AirflowHasSchedule(false), AirflowSchedulePtr(0), AirflowThisTS(0.0), TAirflowGapOutlet(0.0), WindowCalcIterationsRep(0), VentingOpenFactorRep(0.0), VentingOpenFactorMultRep(0.0), InsideTempForVentingRep(0.0), VentingAvailabilityRep(0.0), - LumWinFromRefPt2Rep(0.0), SkyGndSolarInc(0.0), BmGndSolarInc(0.0), ZoneAreaMinusThisSurf(3, 0.0), ZoneAreaReflProdMinusThisSurf(3, 0.0), + SkyGndSolarInc(0.0), BmGndSolarInc(0.0), ZoneAreaMinusThisSurf(3, 0.0), ZoneAreaReflProdMinusThisSurf(3, 0.0), LightWellEff(1.0), SolarDiffusing(false), FrameHeatGain(0.0), FrameHeatLoss(0.0), DividerHeatLoss(0.0), TCLayerTemp(0.0), SpecTemp(0.0), WindowModelType(Window5DetailedModel), TDDPipeNum(0) { diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 61b3076b0e2..8c97188dc35 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -192,6 +192,7 @@ namespace DaylightingManager { int OutputFileDFS(0); // Unit number for daylight factors Array1D DaylIllum; // Daylight illuminance at reference points (lux) int maxNumRefPtInAnyZone(0); // The most number of reference points that any single zone has + int maxNumRefPtInAnyEncl(0); // The most number of reference points that any single enclosure has Real64 PHSUN(0.0); // Solar altitude (radians) Real64 SPHSUN(0.0); // Sine of solar altitude Real64 CPHSUN(0.0); // Cosine of solar altitude @@ -270,6 +271,7 @@ namespace DaylightingManager { OutputFileDFS = 0; DaylIllum.deallocate(); maxNumRefPtInAnyZone = 0; + maxNumRefPtInAnyEncl = 0; PHSUN = 0.0; SPHSUN = 0.0; CPHSUN = 0.0; @@ -4414,41 +4416,17 @@ namespace DaylightingManager { // SUBROUTINE INFORMATION: // AUTHOR Linda Lawrie // DATE WRITTEN Oct 2004 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This subroutine provides a simple structure to get all daylighting // parameters. - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // Using/Aliasing using namespace DataIPShortCuts; - - // RJH DElight Modification Begin using namespace DElightManagerF; // Module for managing DElight subroutines - // RJH DElight Modification End using DataSystemVariables::GoodIOStatValue; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: static ObjexxFCL::gio::Fmt fmtA("(A)"); - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int TotDaylightingControls; // Total Daylighting:Controls inputs (splitflux or delight type) bool ErrorsFound; // Error flag Real64 dLatitude; // double for argument passing @@ -4479,18 +4457,18 @@ namespace DaylightingManager { } maxNumRefPtInAnyZone = 0; + maxNumRefPtInAnyEncl = 0; for (int SurfNum = 1; SurfNum <= TotSurfaces; ++SurfNum) { if (Surface(SurfNum).Class != SurfaceClass_Window) continue; // Loop through all zones in the same enclosure to find total reference points int numEnclRefPoints = 0; int surfEnclNum = Surface(SurfNum).SolarEnclIndex; - for (int zoneNum : DataViewFactorInformation::ZoneSolarInfo(surfEnclNum).ZoneNums) { + for (int const zoneNum : DataViewFactorInformation::ZoneSolarInfo(surfEnclNum).ZoneNums) { int numRefPoints = ZoneDaylight(zoneNum).TotalDaylRefPoints; numEnclRefPoints += numRefPoints; - if (numRefPoints > maxNumRefPtInAnyZone) { - maxNumRefPtInAnyZone = numRefPoints; - } + maxNumRefPtInAnyZone = max(numRefPoints, maxNumRefPtInAnyZone); } + maxNumRefPtInAnyEncl = max(numEnclRefPoints, maxNumRefPtInAnyEncl); DataViewFactorInformation::ZoneSolarInfo(surfEnclNum).TotalEnclosureDaylRefPoints = numEnclRefPoints; if (numEnclRefPoints > 0) { if (!SurfaceWindow(SurfNum).SurfDayLightInit) { @@ -4516,7 +4494,7 @@ namespace DaylightingManager { // Loop through all zones in the adjacent enclosure to find total reference points int numAdjEnclRefPoints = 0; int adjSurfEnclNum = Surface(SurfNumAdj).SolarEnclIndex; - for (int adjZoneNum : DataViewFactorInformation::ZoneSolarInfo(adjSurfEnclNum).ZoneNums) { + for (int const adjZoneNum : DataViewFactorInformation::ZoneSolarInfo(adjSurfEnclNum).ZoneNums) { numAdjEnclRefPoints += ZoneDaylight(adjZoneNum).TotalDaylRefPoints; } DataViewFactorInformation::ZoneSolarInfo(adjSurfEnclNum).TotalEnclosureDaylRefPoints = numAdjEnclRefPoints; @@ -4558,8 +4536,8 @@ namespace DaylightingManager { // Error if GlareControlIsActive and window is in a Daylighting:Detailed zone/enclosure with // an interior window adjacent to another Daylighting:Detailed zone/enclosure if (thisSurfEnclosure.TotalEnclosureDaylRefPoints > 0) { - for (int intWin : thisSurfEnclosure.SurfacePtr) { - int SurfNumAdj = Surface(intWin).ExtBoundCond; + for (int const intWin : thisSurfEnclosure.SurfacePtr) { + int const SurfNumAdj = Surface(intWin).ExtBoundCond; if (Surface(intWin).Class == SurfaceClass_Window && SurfNumAdj > 0) { auto & adjSurfEnclosure(DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNumAdj).SolarEnclIndex)); if (adjSurfEnclosure.TotalEnclosureDaylRefPoints > 0) { @@ -4586,8 +4564,8 @@ namespace DaylightingManager { // Error if window has ShadingControlType = MeetDaylightIlluminanceSetpoint and is in a & // Daylighting:Detailed zone with an interior window adjacent to another Daylighting:Detailed zone if (thisSurfEnclosure.TotalEnclosureDaylRefPoints > 0) { - for (int intWin : thisSurfEnclosure.SurfacePtr) { - int SurfNumAdj = Surface(intWin).ExtBoundCond; + for (int const intWin : thisSurfEnclosure.SurfacePtr) { + int const SurfNumAdj = Surface(intWin).ExtBoundCond; if (Surface(intWin).Class == SurfaceClass_Window && SurfNumAdj > 0) { auto & adjSurfEnclosure(DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNumAdj).SolarEnclIndex)); if (adjSurfEnclosure.TotalEnclosureDaylRefPoints > 0) { @@ -4605,6 +4583,61 @@ namespace DaylightingManager { } } + if (!DataHeatBalance::AnyAirBoundaryGroupedSolar) { + for (int SurfLoop = 1; SurfLoop <= TotSurfaces; ++SurfLoop) { + if (Surface(SurfLoop).Class == SurfaceClass_Window && Surface(SurfLoop).ExtSolar) { + int const zoneOfSurf = Surface(SurfLoop).Zone; + if (ZoneDaylight(zoneOfSurf).TotalDaylRefPoints > 0 && !Zone(zoneOfSurf).HasInterZoneWindow && + ZoneDaylight(zoneOfSurf).DaylightMethod == SplitFluxDaylighting) { + for (int refPtNum = 1; refPtNum <= ZoneDaylight(zoneOfSurf).TotalDaylRefPoints; ++refPtNum) { + SetupOutputVariable("Daylighting Window Reference Point " + std::to_string(refPtNum) + " Illuminance", + OutputProcessor::Unit::lux, + SurfaceWindow(SurfLoop).IllumFromWinAtRefPtRep(refPtNum), + "Zone", + "Average", + Surface(SurfLoop).Name); + SetupOutputVariable("Daylighting Window Reference Point " + std::to_string(refPtNum) + " View Luminance", + OutputProcessor::Unit::cd_m2, + SurfaceWindow(SurfLoop).LumWinFromRefPtRep(refPtNum), + "Zone", + "Average", + Surface(SurfLoop).Name); + } + } + } + } + } else { + for (int enclNum = 1; enclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclNum) { + for (int const enclSurfNum : DataViewFactorInformation::ZoneSolarInfo(enclNum).SurfacePtr) { + if (Surface(enclSurfNum).Class == SurfaceClass_Window && Surface(enclSurfNum).ExtSolar) { + int refPtCount = 0; + for (int const enclZoneNum : DataViewFactorInformation::ZoneSolarInfo(enclNum).ZoneNums) { + if (DataViewFactorInformation::ZoneSolarInfo(enclNum).TotalEnclosureDaylRefPoints > 0 && + !Zone(enclZoneNum).HasInterZoneWindow && ZoneDaylight(enclZoneNum).DaylightMethod == SplitFluxDaylighting) { + for (int refPtNum = 1; refPtNum <= ZoneDaylight(enclZoneNum).TotalDaylRefPoints; ++refPtNum) { + ++refPtCount; // Count reference points across each zone in the same enclosure + std::string const varKey = + Surface(enclSurfNum).Name + " to " + DaylRefPt(ZoneDaylight(enclZoneNum).DaylRefPtNum(refPtNum)).Name; + SetupOutputVariable("Daylighting Window Reference Point Illuminance", + OutputProcessor::Unit::lux, + SurfaceWindow(enclSurfNum).IllumFromWinAtRefPtRep(refPtCount), + "Zone", + "Average", + varKey); + SetupOutputVariable("Daylighting Window Reference Point View Luminance", + OutputProcessor::Unit::cd_m2, + SurfaceWindow(enclSurfNum).LumWinFromRefPtRep(refPtCount), + "Zone", + "Average", + varKey); + } + } + } + } + } + } + } + // RJH DElight Modification Begin - Calls to DElight preprocessing subroutines if (doesDayLightingUseDElight()) { dLatitude = Latitude; @@ -5103,13 +5136,9 @@ namespace DaylightingManager { int IOStat; int NumAlpha; int NumNumber; - int iDaylCntrl; - int refPtNum; - int SurfLoop; - int ZoneFound; cCurrentModuleObject = "Daylighting:Controls"; - for (iDaylCntrl = 1; iDaylCntrl <= TotDaylightingControls; ++iDaylCntrl) { + for (int iDaylCntrl = 1; iDaylCntrl <= TotDaylightingControls; ++iDaylCntrl) { cAlphaArgs = ""; rNumericArgs = 0.0; inputProcessor->getObjectItem(cCurrentModuleObject, @@ -5123,7 +5152,7 @@ namespace DaylightingManager { lAlphaFieldBlanks, cAlphaFieldNames, cNumericFieldNames); - ZoneFound = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); + int const ZoneFound = UtilityRoutines::FindItemInList(cAlphaArgs(2), Zone); if (ZoneFound == 0) { ShowSevereError(cCurrentModuleObject + ": invalid " + cAlphaFieldNames(2) + "=\"" + cAlphaArgs(2) + "\"."); ErrorsFound = true; @@ -5238,7 +5267,7 @@ namespace DaylightingManager { zone_daylight.TimeExceedingDaylightIlluminanceSPAtRefPt = 0.0; int countRefPts = 0; - for (refPtNum = 1; refPtNum <= curTotalDaylRefPts; ++refPtNum) { + for (int refPtNum = 1; refPtNum <= curTotalDaylRefPts; ++refPtNum) { zone_daylight.DaylRefPtNum(refPtNum) = UtilityRoutines::FindItemInList( cAlphaArgs(6 + refPtNum), DaylRefPt, &RefPointData::Name); // Field: Daylighting Reference Point Name if (zone_daylight.DaylRefPtNum(refPtNum) == 0) { @@ -5308,31 +5337,6 @@ namespace DaylightingManager { "Average", zone_daylight.Name); } - - for (SurfLoop = 1; SurfLoop <= TotSurfaces; ++SurfLoop) { - if (Surface(SurfLoop).Class == SurfaceClass_Window && Surface(SurfLoop).ExtSolar) { - int zoneOfSurf = Surface(SurfLoop).Zone; - if (ZoneDaylight(zoneOfSurf).TotalDaylRefPoints > 0 && !Zone(zoneOfSurf).HasInterZoneWindow && - ZoneDaylight(zoneOfSurf).DaylightMethod == SplitFluxDaylighting) { - SurfaceWindow(SurfLoop).IllumFromWinAtRefPtRep.allocate(ZoneDaylight(zoneOfSurf).TotalDaylRefPoints); - SurfaceWindow(SurfLoop).LumWinFromRefPtRep.allocate(ZoneDaylight(zoneOfSurf).TotalDaylRefPoints); - for (refPtNum = 1; refPtNum <= ZoneDaylight(zoneOfSurf).TotalDaylRefPoints; ++refPtNum) { - SetupOutputVariable("Daylighting Window Reference Point " + std::to_string(refPtNum) + " Illuminance", - OutputProcessor::Unit::lux, - SurfaceWindow(SurfLoop).IllumFromWinAtRefPtRep(refPtNum), - "Zone", - "Average", - Surface(SurfLoop).Name); - SetupOutputVariable("Daylighting Window Reference Point " + std::to_string(refPtNum) + " View Luminance", - OutputProcessor::Unit::cd_m2, - SurfaceWindow(SurfLoop).LumWinFromRefPtRep(refPtNum), - "Zone", - "Average", - Surface(SurfLoop).Name); - } - } - } - } } void GeometryTransformForDaylighting() @@ -7285,9 +7289,13 @@ namespace DaylightingManager { IS = 1; if (SurfaceWindow(IWin).ShadingFlag > 0 || SurfaceWindow(IWin).SolarDiffusing) IS = 2; if (ZoneDaylight(ZoneNum).DaylightMethod == SplitFluxDaylighting) { - for (int refPtNum = 1; refPtNum <= ZoneDaylight(ZoneNum).TotalDaylRefPoints; ++refPtNum) { - SurfaceWindow(IWin).IllumFromWinAtRefPtRep(refPtNum) = ZoneDaylight(ZoneNum).IllumFromWinAtRefPt(loop, IS, refPtNum); - SurfaceWindow(IWin).LumWinFromRefPtRep(refPtNum) = ZoneDaylight(ZoneNum).SourceLumFromWinAtRefPt(loop, IS, refPtNum); + int refPtCount = 0; + for (int const enclZoneNum : DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).ZoneNums) { + for (int refPtNum = 1; refPtNum <= ZoneDaylight(enclZoneNum).TotalDaylRefPoints; ++refPtNum) { + ++refPtCount; // Count reference points across each zone in the same enclosure + SurfaceWindow(IWin).IllumFromWinAtRefPtRep(refPtCount) = ZoneDaylight(enclZoneNum).IllumFromWinAtRefPt(loop, IS, refPtNum); + SurfaceWindow(IWin).LumWinFromRefPtRep(refPtCount) = ZoneDaylight(enclZoneNum).SourceLumFromWinAtRefPt(loop, IS, refPtNum); + } } } } @@ -10429,8 +10437,8 @@ namespace DaylightingManager { // windows with Z. Used in calculation of daylighting through interior windows. // Sets the daylighting factor pointers for each Daylighting:Detailed zone. The pointer - // may be associated with an exterior window in a daylit target zone or an exterior window in - // an adjacent zone, daylit or not, that shares interior windows with the target zone. + // may be associated with an exterior window in a daylit target zone's enclosure or an exterior window in + // an adjacent enclosure, daylit or not, that shares interior windows with the target zone's enclosure. using General::RoundSigDigits; @@ -10451,7 +10459,7 @@ namespace DaylightingManager { // Count number of exterior Windows (use to allocate arrays) for (int ZoneNum = 1; ZoneNum <= NumOfZones; ++ZoneNum) { // Count exterior windows in this zone or shared solar enclosure - for (int surfNum : DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).SurfacePtr) { + for (int const surfNum : DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).SurfacePtr) { if ((Surface(surfNum).Class == SurfaceClass_Window && Surface(surfNum).ExtBoundCond == ExternalEnvironment) || SurfaceWindow(surfNum).OriginalClass == SurfaceClass_TDD_Diffuser) { ++ZoneDaylight(ZoneNum).TotalExtWindows; @@ -10464,7 +10472,7 @@ namespace DaylightingManager { if (ZoneDaylight(ZoneNum).TotalDaylRefPoints == 0) continue; // This is a Daylighting:Detailed zone // Find adjacent zones - int thisZoneEnclNum = Zone(ZoneNum).SolarEnclosureNum; + int const thisZoneEnclNum = Zone(ZoneNum).SolarEnclosureNum; for (int adjEnclNum = 1; adjEnclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++adjEnclNum) { if (adjEnclNum == thisZoneEnclNum) continue; for (int ZoneNumAdj : DataViewFactorInformation::ZoneSolarInfo(adjEnclNum).ZoneNums) { @@ -10499,7 +10507,7 @@ namespace DaylightingManager { if (ZoneDaylight(ZoneNum).TotalDaylRefPoints == 0) continue; // This is a Daylighting:Detailed zone // Find adjacent zones - int thisZoneEnclNum = Zone(ZoneNum).SolarEnclosureNum; + int const thisZoneEnclNum = Zone(ZoneNum).SolarEnclosureNum; for (int adjEnclNum = 1; adjEnclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++adjEnclNum) { if (adjEnclNum == thisZoneEnclNum) continue; for (int ZoneNumAdj : DataViewFactorInformation::ZoneSolarInfo(adjEnclNum).ZoneNums) { @@ -10552,7 +10560,7 @@ namespace DaylightingManager { // now fill nested structure int ExtWinIndex = 0; for (int ZoneAdjLoop = 1; ZoneAdjLoop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++ZoneAdjLoop) { - int ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(ZoneAdjLoop); + int const ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(ZoneAdjLoop); for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond == ExternalEnvironment) { ++ExtWinIndex; @@ -10594,8 +10602,8 @@ namespace DaylightingManager { if (ZoneDaylight(ZoneNum).TotalDaylRefPoints > 0) { // This is a Daylighting:Detailed zone - // Get exterior windows in this zone ro shared solar enclosure - for (int surfNum : DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).SurfacePtr) { + // Get exterior windows in this zone or shared solar enclosure + for (int const surfNum : DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).SurfacePtr) { if ((Surface(surfNum).Class == SurfaceClass_Window && Surface(surfNum).ExtBoundCond == ExternalEnvironment) || SurfaceWindow(surfNum).OriginalClass == SurfaceClass_TDD_Diffuser) { ++ZoneExtWin(ZoneNum); @@ -10663,7 +10671,7 @@ namespace DaylightingManager { int ZoneExtWinCtr = 0; - for (int surfNum : DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).SurfacePtr) { + for (int const surfNum : DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).SurfacePtr) { if ((Surface(surfNum).Class == SurfaceClass_Window && Surface(surfNum).ExtBoundCond == ExternalEnvironment) || SurfaceWindow(surfNum).OriginalClass == SurfaceClass_TDD_Diffuser) { ++ZoneExtWinCtr; @@ -10674,7 +10682,7 @@ namespace DaylightingManager { // Get exterior windows in adjacent zones that share interior windows with ZoneNum if (ZoneDaylight(ZoneNum).NumOfIntWinAdjZones > 0) { for (int loop = 1; loop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++loop) { - int ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(loop); + int const ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(loop); // Get exterior windows in ZoneNumAdj -- there must be at least one, otherwise // it would not be an "AdjIntWinZone" for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { @@ -10838,8 +10846,6 @@ namespace DaylightingManager { // SUBROUTINE INFORMATION: // AUTHOR Fred Winkelmann // DATE WRITTEN Mar. 2004 - // MODIFIED:na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // Calculates the inter-reflected illuminance in a daylit zone from beam @@ -10847,42 +10853,22 @@ namespace DaylightingManager { // is determined by the split-flux method and is assumed to be uniform, i.e., the same // at all reference points. - // METHODOLOGY EMPLOYED:na - // REFERENCES:na - // USE STATEMENTS: - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int IWin; // Window number - int ConstrNum; // Window construction number - int AdjZoneNum; // Adjacent zone number - Real64 QDifTrans; // Luminous flux transmitted through an int win from adjacent zone (lumens) + Real64 QDifTrans; // Luminous flux transmitted through an int win from adjacent zone's enclosure (lumens) Real64 QDifTransUp; // Upgoing part of QDifTrans (lumens) Real64 QDifTransDn; // Downgoing part of QDifTrans (lumens) Real64 DifInterReflIllThisWin; // Inter-reflected illuminance due to QDifTrans (lux) - Real64 BmInterReflIll; // Inter-reflected illuminance due to beam solar entering ZoneNum + Real64 BmInterReflIll; // Inter-reflected illuminance due to beam solar entering ZoneNum's enclosure // through its interior windows (lux) - // FLOW: ZoneDaylight(ZoneNum).InterReflIllFrIntWins = 0.0; - for (IWin = Zone(ZoneNum).SurfaceFirst; IWin <= Zone(ZoneNum).SurfaceLast; ++IWin) { + auto &thisEnclSurfaces(DataViewFactorInformation::ZoneSolarInfo(Zone(ZoneNum).SolarEnclosureNum).SurfacePtr); + for (int const IWin : thisEnclSurfaces) { if (Surface(IWin).Class == SurfaceClass_Window && Surface(IWin).ExtBoundCond >= 1) { // This is an interior window in ZoneNum - ConstrNum = Surface(IWin).Construction; - AdjZoneNum = Surface(Surface(IWin).ExtBoundCond).Zone; - QDifTrans = QSDifSol(AdjZoneNum) * Construct(ConstrNum).TransDiffVis * Surface(IWin).Area * PDIFLW; + int const ConstrNum = Surface(IWin).Construction; + int const adjEnclNum = Surface(Surface(IWin).ExtBoundCond).SolarEnclIndex; + QDifTrans = QSDifSol(adjEnclNum) * Construct(ConstrNum).TransDiffVis * Surface(IWin).Area * PDIFLW; QDifTransUp = QDifTrans * SurfaceWindow(IWin).FractionUpgoing; QDifTransDn = QDifTrans * (1.0 - SurfaceWindow(IWin).FractionUpgoing); if (ZoneDaylight(ZoneNum).TotInsSurfArea * (1.0 - ZoneDaylight(ZoneNum).AveVisDiffReflect) != 0.0) { diff --git a/src/EnergyPlus/DaylightingManager.hh b/src/EnergyPlus/DaylightingManager.hh index fcab0d96a2a..97cb918a09e 100644 --- a/src/EnergyPlus/DaylightingManager.hh +++ b/src/EnergyPlus/DaylightingManager.hh @@ -77,6 +77,7 @@ namespace DaylightingManager { extern int OutputFileDFS; // Unit number for daylight factors extern Array1D DaylIllum; // Daylight illuminance at reference points (lux) extern int maxNumRefPtInAnyZone; // The most number of reference points that any single zone has + extern int maxNumRefPtInAnyEncl; // The most number of reference points that any single enclosure has extern Real64 PHSUN; // Solar altitude (radians) extern Real64 SPHSUN; // Sine of solar altitude extern Real64 CPHSUN; // Cosine of solar altitude diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index bc36333c433..0b6986301a6 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -2582,27 +2582,27 @@ namespace HeatBalanceSurfaceManager { // Flux of diffuse solar in each zone QSDifSol = 0.0; - for (int ZoneNum = 1; ZoneNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++ZoneNum) { - QSDifSol(ZoneNum) = QDforDaylight(ZoneNum); + for (int enclNum = 1; enclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclNum) { + QSDifSol(enclNum) = QDforDaylight(enclNum); } if (InterZoneWindow) { - for (int ZoneNum = 1; ZoneNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++ZoneNum) { - if (RecDifShortFromZ(ZoneNum)) { + for (int enclNum = 1; enclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclNum) { + if (RecDifShortFromZ(enclNum)) { Real64 QSDifSol_sum(0.0); // Accumulator - auto lZone(FractDifShortZtoZ.index(ZoneNum, 1)); // Tuned Linear indexing - for (int OtherZoneNum = 1; OtherZoneNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++OtherZoneNum, ++lZone) { - if ((OtherZoneNum != ZoneNum) && (RecDifShortFromZ(OtherZoneNum))) { - QSDifSol_sum += FractDifShortZtoZ[lZone] * QDforDaylight(OtherZoneNum); // [ lZone ] == ( ZoneNum, OtherZoneNum ) + auto lZone(FractDifShortZtoZ.index(enclNum, 1)); // Tuned Linear indexing + for (int otherEnclNum = 1; otherEnclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++otherEnclNum, ++lZone) { + if ((otherEnclNum != enclNum) && (RecDifShortFromZ(otherEnclNum))) { + QSDifSol_sum += FractDifShortZtoZ[lZone] * QDforDaylight(otherEnclNum); // [ lZone ] == ( enclNum, otherEnclNum ) } } - QSDifSol(ZoneNum) += QSDifSol_sum; + QSDifSol(enclNum) += QSDifSol_sum; } } } - for (int ZoneNum = 1; ZoneNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++ZoneNum) { - QSDifSol(ZoneNum) *= FractDifShortZtoZ(ZoneNum, ZoneNum) * VMULT(ZoneNum); + for (int enclNum = 1; enclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++enclNum) { + QSDifSol(enclNum) *= FractDifShortZtoZ(enclNum, enclNum) * VMULT(enclNum); } // RJH - 09-12-07 commented out report varariable calcs here since they refer to old distribution method @@ -6365,7 +6365,7 @@ namespace HeatBalanceSurfaceManager { Construct(surface.Construction).InsideAbsorpThermal * surface.Area * (Sigma_Temp_4 - (SurfaceWindow(SurfNum).IRfromParentZone + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum))); - WinLossSWZoneToOutWinRep(SurfNum) = QS(surface.Zone) * surface.Area * Construct(surface.Construction).TransDiff; + WinLossSWZoneToOutWinRep(SurfNum) = QS(surface.SolarEnclIndex) * surface.Area * Construct(surface.Construction).TransDiff; } else { // Regular window if (InsideSurfIterations == 0) { // Do windows only once if (SurfaceWindow(SurfNum).StormWinFlag == 1) ConstrNum = surface.StormWinConstruction; diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 0d39caee4a0..6fc1a4bbc42 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -1085,6 +1085,10 @@ namespace SurfaceGeometry { TotSurfaces = SurfNum + AddedSubSurfaces + NeedToAddSurfaces + NeedToAddSubSurfaces; + if (ErrorsFound) { + ShowFatalError(RoutineName + "Errors discovered, program terminates."); + } + // Have to make room for added surfaces, if needed FirstTotalSurfaces = SurfNum + AddedSubSurfaces; if (NeedToAddSurfaces + NeedToAddSubSurfaces > 0) { @@ -12721,7 +12725,6 @@ namespace SurfaceGeometry { void SetupSolarEnclosuresAndAirBoundaries(bool &ErrorsFound) { - bool anySolarGroupedZones = false; int enclosureNum = 0; if (std::any_of(Construct.begin(), Construct.end(), [](DataHeatBalance::ConstructionData const &e) { return e.TypeIsAirBoundary; })) { std::string RoutineName = "SetupSolarEnclosuresAndAirBoundaries"; @@ -12741,7 +12744,7 @@ namespace SurfaceGeometry { // Solar distribution if (constr.TypeIsAirBoundarySolar) { // Boundary is grouped - assign solar enclosure - anySolarGroupedZones = true; + DataHeatBalance::AnyAirBoundaryGroupedSolar = true; auto &thisSideEnclosureNum(Zone(surf.Zone).SolarEnclosureNum); auto &otherSideEnclosureNum(Zone(Surface(surf.ExtBoundCond).Zone).SolarEnclosureNum); if ((thisSideEnclosureNum == 0) && (otherSideEnclosureNum == 0)) { @@ -12817,7 +12820,7 @@ namespace SurfaceGeometry { ShowContinueError("For explicit details on each use, use Output:Diagnostics,DisplayExtraWarnings;"); } } - if (anySolarGroupedZones) { + if (DataHeatBalance::AnyAirBoundaryGroupedSolar) { // All grouped solar zones have been assigned to an enclosure, now assign remaining zones for (int zoneNum = 1; zoneNum <= DataGlobals::NumOfZones; ++zoneNum) { if (Zone(zoneNum).SolarEnclosureNum == 0) { From 5205242be43bae8eac0e8b3f7ca2219f420edf46 Mon Sep 17 00:00:00 2001 From: mjwitte Date: Sat, 24 Aug 2019 13:43:28 -0500 Subject: [PATCH 025/136] Air boundary - fix merge add daylighting example --- src/EnergyPlus/HeatBalanceIntRadExchange.cc | 2 +- testfiles/5ZoneAirCooled_AirBoundaries.idf | 4 - ...oneAirCooled_AirBoundaries_Daylighting.idf | 3697 +++++++++++++++++ testfiles/CMakeLists.txt | 1 + 4 files changed, 3699 insertions(+), 5 deletions(-) create mode 100644 testfiles/5ZoneAirCooled_AirBoundaries_Daylighting.idf diff --git a/src/EnergyPlus/HeatBalanceIntRadExchange.cc b/src/EnergyPlus/HeatBalanceIntRadExchange.cc index 33b486367c9..a3540efa19e 100644 --- a/src/EnergyPlus/HeatBalanceIntRadExchange.cc +++ b/src/EnergyPlus/HeatBalanceIntRadExchange.cc @@ -292,7 +292,7 @@ namespace HeatBalanceIntRadExchange { (ShadeFlagPrev == IntShadeOn && ShadeFlag != IntShadeOn) || (ShadeFlagPrev == IntBlindOn && ShadeFlag != IntBlindOn)) IntShadeOrBlindStatusChanged = true; if (SurfaceWindow(SurfNum).WindowModelType == WindowEQLModel && - DataWindowEquivalentLayer::CFS(Construct(ConstrNum).EQLConsPtr).ISControlled) { + DataWindowEquivalentLayer::CFS(Construct(Surface(SurfNum).Construction).EQLConsPtr).ISControlled) { IntShadeOrBlindStatusChanged = true; } } else { diff --git a/testfiles/5ZoneAirCooled_AirBoundaries.idf b/testfiles/5ZoneAirCooled_AirBoundaries.idf index 463cf143b52..08b46774bd2 100644 --- a/testfiles/5ZoneAirCooled_AirBoundaries.idf +++ b/testfiles/5ZoneAirCooled_AirBoundaries.idf @@ -3494,8 +3494,6 @@ Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 22 BACK-1, !- Extended Field Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field - SB35, !- Extended Field - Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field F3-1, !- Extended Field Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field C3-1, !- Extended Field @@ -3578,8 +3576,6 @@ Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field DB-1, !- Extended Field Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field - SB35, !- Extended Field - Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field F3-1, !- Extended Field Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field C3-1, !- Extended Field diff --git a/testfiles/5ZoneAirCooled_AirBoundaries_Daylighting.idf b/testfiles/5ZoneAirCooled_AirBoundaries_Daylighting.idf new file mode 100644 index 00000000000..e1bca2aefa5 --- /dev/null +++ b/testfiles/5ZoneAirCooled_AirBoundaries_Daylighting.idf @@ -0,0 +1,3697 @@ +!-Generator IDFEditor 1.34 +!-Option OriginalOrderTop UseSpecialFormat +!-NOTE: All comments with '!-' are ignored by the IDFEditor and are generated automatically. +!- Use '!' comments if they need to be retained when using the IDFEditor. +! 5ZoneAirCooled_AirBoundaries.idf +! Basic file description: 1 story building divided into 4 exterior and one interior conditioned zones with air boundaries and return plenum. +! +! Highlights: Construction:AirBoundary used to combine zones Space1-1, Space4-1, and Space5-1. +! Space2-1 and Space3-1 remain separate. This is based on 5ZoneAirCooled.idf +! +! Simulation Location/Run: CHICAGO_IL_USA TMY2-94846, 2 design days, 2 run periods, +! Run Control executes the run periods using the weather file +! +! Location: Chicago, IL +! +! Design Days: CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, MaxDB= -17.3°C +! CHICAGO_IL_USA Annual Cooling 1% Design Conditions, MaxDB= 31.5°C MCWB= 23.0°C +! +! Run Period (Weather File): 1/1 through 12/31, CHICAGO_IL_USA TMY2-94846 +! +! Run Control: Zone and System sizing with weather file run control (no design days run) +! +! Building: Single floor rectangular building 100 ft x 50 ft. 5 zones - 4 exterior, 1 interior, zone height 8 feet. +! Exterior zone depth is 12 feet. There is a 2 foot high return plenum: the overall building height is +! 10 feet. There are windows on all 4 facades; the south and north facades have glass doors. +! The south facing glass is shaded by overhangs. The walls are woodshingle over plywood, R11 insulation, +! and gypboard. The roof is a gravel built up roof with R-3 mineral board insulation and plywood sheathing. +! The windows are of various single and double pane construction with 3mm and 6mm glass and either 6mm or +! 13mm argon or air gap. The window to wall ratio is approximately 0.29. +! The south wall and door have overhangs. +! +! The building is oriented 30 degrees east of north. +! +! Floor Area: 463.6 m2 (5000 ft2) +! Number of Stories: 1 +! +! Zone Description Details: +! +! (0,15.2,0) (30.5,15.2,0) +! _____ ________ ____ +! |\ *** **************** /| +! | \ / | +! | \ (26.8,11.6,0) / | +! * \_____________________________/ * +! * |(3.7,11.6,0) | * +! * | | * +! * | | * +! * | (26.8,3.7,0)| * +! * |___________________________| * +! * / (3.7,3.7,0) \ * +! | / \ | +! | / \ | +! |/___******************___***________\| +! | Overhang | | +! |_______________________| | window/door = * +! |___| +! +! (0,0,0) (30.5,0,0) +! +! Internal gains description: lighting is 1.5 watts/ft2, office equip is 1.0 watts/ft2. There is 1 occupant +! per 100 ft2 of floor area. The infiltration is 0.25 air changes per hour. +! +! Interzone Surfaces: 8 interzone surfaces, 4 are air boundaries (see diagram) +! Internal Mass: None +! People: 50 +! Lights: 7500 W +! Windows: 4 ea.: 1) Double pane clear, 3mm glass, 13mm air gap +! 2) Double pane clear, 3mm glass, 13mm argon gap +! 3) Double pane clear, 6mm glass, 6mm air gap +! 4) Double pane lowE, 6mm lowE glass outside, 6mm air gap, 6mm clear glass +! +! Doors: 2 ea.: Single pane grey, 3mm glass +! +! Detached Shading: None +! Daylight: None +! Natural Ventilation: None +! Compact Schedules: Yes +! +! HVAC: Standard VAV system with outside air, hot water reheat coils, +! central chilled water cooling coil. Central Plant is single hot water +! boiler, electric compression chiller with air cooled condenser. +! All equipment is autosized. HW and ChW coils are used in the outside air +! stream to precondition the outside air. +! +! Zonal Equipment: AirTerminal:SingleDuct:VAV:Reheat +! Central Air Handling Equipment: Yes +! System Equipment Autosize: Yes +! Purchased Cooling: None +! Purchased Heating: None +! Coils: Coil:Cooling:Water, Coil:Heating:Water +! Pumps: Pump:VariableSpeed +! Boilers: Boiler:HotWater +! Chillers: Chiller:Electric +! +! Results: +! Standard Reports: None +! Timestep or Hourly Variables: Hourly +! Time bins Report: None +! HTML Report: None +! Environmental Emissions: None +! Utility Tariffs: None + + Version,9.2; + + Building, + Building, !- Name + 30., !- North Axis {deg} + City, !- Terrain + 0.04, !- Loads Convergence Tolerance Value + 0.4, !- Temperature Convergence Tolerance Value {deltaC} + FullExterior, !- Solar Distribution + 25, !- Maximum Number of Warmup Days + 6; !- Minimum Number of Warmup Days + + Timestep,4; + + SurfaceConvectionAlgorithm:Inside,Simple; + + SurfaceConvectionAlgorithm:Outside,SimpleCombined; + + HeatBalanceAlgorithm,ConductionTransferFunction; + + GlobalGeometryRules, + UpperLeftCorner, !- Starting Vertex Position + CounterClockWise, !- Vertex Entry Direction + Relative, !- Coordinate System + Relative; !- Daylighting Reference Point Coordinate System + + ScheduleTypeLimits, + Any Number; !- Name + + ScheduleTypeLimits, + Fraction, !- Name + 0.0, !- Lower Limit Value + 1.0, !- Upper Limit Value + CONTINUOUS; !- Numeric Type + + ScheduleTypeLimits, + Temperature, !- Name + -60, !- Lower Limit Value + 200, !- Upper Limit Value + CONTINUOUS, !- Numeric Type + Temperature; !- Unit Type + + ScheduleTypeLimits, + Control Type, !- Name + 0, !- Lower Limit Value + 4, !- Upper Limit Value + DISCRETE; !- Numeric Type + + ScheduleTypeLimits, + On/Off, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + DISCRETE; !- Numeric Type + + ScheduleTypeLimits, + FlowRate, !- Name + 0.0, !- Lower Limit Value + 10, !- Upper Limit Value + CONTINUOUS; !- Numeric Type + + RunPeriod, + Run Period 1, !- Name + 1, !- Begin Month + 1, !- Begin Day of Month + , !- Begin Year + 1, !- End Month + 31, !- End Day of Month + , !- End Year + Tuesday, !- Day of Week for Start Day + Yes, !- Use Weather File Holidays and Special Days + Yes, !- Use Weather File Daylight Saving Period + No, !- Apply Weekend Holiday Rule + Yes, !- Use Weather File Rain Indicators + Yes; !- Use Weather File Snow Indicators + + RunPeriod, + Run Period 2, !- Name + 7, !- Begin Month + 1, !- Begin Day of Month + , !- Begin Year + 7, !- End Month + 31, !- End Day of Month + , !- End Year + Tuesday, !- Day of Week for Start Day + Yes, !- Use Weather File Holidays and Special Days + Yes, !- Use Weather File Daylight Saving Period + No, !- Apply Weekend Holiday Rule + Yes, !- Use Weather File Rain Indicators + Yes; !- Use Weather File Snow Indicators + + Site:Location, + CHICAGO_IL_USA TMY2-94846, !- Name + 41.78, !- Latitude {deg} + -87.75, !- Longitude {deg} + -6.00, !- Time Zone {hr} + 190.00; !- Elevation {m} + + SimulationControl, + Yes, !- Do Zone Sizing Calculation + Yes, !- Do System Sizing Calculation + Yes, !- Do Plant Sizing Calculation + No, !- Run Simulation for Sizing Periods + Yes; !- Run Simulation for Weather File Run Periods + +! CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, MaxDB= -17.3°C + + SizingPeriod:DesignDay, + CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, !- Name + 1, !- Month + 21, !- Day of Month + WinterDesignDay, !- Day Type + -17.3, !- Maximum Dry-Bulb Temperature {C} + 0.0, !- Daily Dry-Bulb Temperature Range {deltaC} + , !- Dry-Bulb Temperature Range Modifier Type + , !- Dry-Bulb Temperature Range Modifier Day Schedule Name + Wetbulb, !- Humidity Condition Type + -17.3, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C} + , !- Humidity Condition Day Schedule Name + , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir} + , !- Enthalpy at Maximum Dry-Bulb {J/kg} + , !- Daily Wet-Bulb Temperature Range {deltaC} + 99063., !- Barometric Pressure {Pa} + 4.9, !- Wind Speed {m/s} + 270, !- Wind Direction {deg} + No, !- Rain Indicator + No, !- Snow Indicator + No, !- Daylight Saving Time Indicator + ASHRAEClearSky, !- Solar Model Indicator + , !- Beam Solar Day Schedule Name + , !- Diffuse Solar Day Schedule Name + , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless} + , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless} + 0.0; !- Sky Clearness + +! CHICAGO_IL_USA Annual Cooling 1% Design Conditions, MaxDB= 31.5°C MCWB= 23.0°C + + SizingPeriod:DesignDay, + CHICAGO_IL_USA Annual Cooling 1% Design Conditions DB/MCWB, !- Name + 7, !- Month + 21, !- Day of Month + SummerDesignDay, !- Day Type + 31.5, !- Maximum Dry-Bulb Temperature {C} + 10.7, !- Daily Dry-Bulb Temperature Range {deltaC} + , !- Dry-Bulb Temperature Range Modifier Type + , !- Dry-Bulb Temperature Range Modifier Day Schedule Name + Wetbulb, !- Humidity Condition Type + 23.0, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C} + , !- Humidity Condition Day Schedule Name + , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir} + , !- Enthalpy at Maximum Dry-Bulb {J/kg} + , !- Daily Wet-Bulb Temperature Range {deltaC} + 99063., !- Barometric Pressure {Pa} + 5.3, !- Wind Speed {m/s} + 230, !- Wind Direction {deg} + No, !- Rain Indicator + No, !- Snow Indicator + No, !- Daylight Saving Time Indicator + ASHRAEClearSky, !- Solar Model Indicator + , !- Beam Solar Day Schedule Name + , !- Diffuse Solar Day Schedule Name + , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless} + , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless} + 1.0; !- Sky Clearness + + Site:GroundTemperature:BuildingSurface,20.03,20.03,20.13,20.30,20.43,20.52,20.62,20.77,20.78,20.55,20.44,20.20; + + Material, + WD10, !- Name + MediumSmooth, !- Roughness + 0.667, !- Thickness {m} + 0.115, !- Conductivity {W/m-K} + 513, !- Density {kg/m3} + 1381, !- Specific Heat {J/kg-K} + 0.9, !- Thermal Absorptance + 0.78, !- Solar Absorptance + 0.78; !- Visible Absorptance + + Material, + RG01, !- Name + Rough, !- Roughness + 1.2700000E-02, !- Thickness {m} + 1.442000, !- Conductivity {W/m-K} + 881.0000, !- Density {kg/m3} + 1674.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.6500000, !- Solar Absorptance + 0.6500000; !- Visible Absorptance + + Material, + BR01, !- Name + VeryRough, !- Roughness + 9.4999997E-03, !- Thickness {m} + 0.1620000, !- Conductivity {W/m-K} + 1121.000, !- Density {kg/m3} + 1464.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7000000, !- Solar Absorptance + 0.7000000; !- Visible Absorptance + + Material, + IN46, !- Name + VeryRough, !- Roughness + 7.6200001E-02, !- Thickness {m} + 2.3000000E-02, !- Conductivity {W/m-K} + 24.00000, !- Density {kg/m3} + 1590.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.5000000, !- Solar Absorptance + 0.5000000; !- Visible Absorptance + + Material, + WD01, !- Name + MediumSmooth, !- Roughness + 1.9099999E-02, !- Thickness {m} + 0.1150000, !- Conductivity {W/m-K} + 513.0000, !- Density {kg/m3} + 1381.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7800000, !- Solar Absorptance + 0.7800000; !- Visible Absorptance + + Material, + PW03, !- Name + MediumSmooth, !- Roughness + 1.2700000E-02, !- Thickness {m} + 0.1150000, !- Conductivity {W/m-K} + 545.0000, !- Density {kg/m3} + 1213.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7800000, !- Solar Absorptance + 0.7800000; !- Visible Absorptance + + Material, + IN02, !- Name + Rough, !- Roughness + 9.0099998E-02, !- Thickness {m} + 4.3000001E-02, !- Conductivity {W/m-K} + 10.00000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + GP01, !- Name + MediumSmooth, !- Roughness + 1.2700000E-02, !- Thickness {m} + 0.1600000, !- Conductivity {W/m-K} + 801.0000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + GP02, !- Name + MediumSmooth, !- Roughness + 1.5900001E-02, !- Thickness {m} + 0.1600000, !- Conductivity {W/m-K} + 801.0000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + CC03, !- Name + MediumRough, !- Roughness + 0.1016000, !- Thickness {m} + 1.310000, !- Conductivity {W/m-K} + 2243.000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.6500000, !- Solar Absorptance + 0.6500000; !- Visible Absorptance + + Material:NoMass, + CP01, !- Name + Rough, !- Roughness + 0.3670000, !- Thermal Resistance {m2-K/W} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material:NoMass, + MAT-CLNG-1, !- Name + Rough, !- Roughness + 0.652259290, !- Thermal Resistance {m2-K/W} + 0.65, !- Thermal Absorptance + 0.65, !- Solar Absorptance + 0.65; !- Visible Absorptance + + Material:AirGap, + AL21, !- Name + 0.1570000; !- Thermal Resistance {m2-K/W} + + Material:AirGap, + AL23, !- Name + 0.1530000; !- Thermal Resistance {m2-K/W} + + Construction, + ROOF-1, !- Name + RG01, !- Outside Layer + BR01, !- Layer 2 + IN46, !- Layer 3 + WD01; !- Layer 4 + + Construction, + WALL-1, !- Name + WD01, !- Outside Layer + PW03, !- Layer 2 + IN02, !- Layer 3 + GP01; !- Layer 4 + + Construction, + CLNG-1, !- Name + MAT-CLNG-1; !- Outside Layer + + Construction, + FLOOR-SLAB-1, !- Name + CC03; !- Outside Layer + + Construction, + INT-WALL-1, !- Name + GP02, !- Outside Layer + AL21, !- Layer 2 + GP02; !- Layer 3 + + Construction:AirBoundary, + Air Wall, !- Name + GroupedZones, !- Solar and Daylighting Method + GroupedZones, !- Radiant Exchange Method + SimpleMixing, !- Air Exchange Method + 0.5, !- Simple Mixing Air Changes per Hour {1/hr} + ; !- Simple Mixing Schedule Name + + WindowMaterial:Gas, + AIR 13MM, !- Name + Air, !- Gas Type + 0.0127; !- Thickness {m} + + WindowMaterial:Glazing, + CLEAR 3MM, !- Name + SpectralAverage, !- Optical Data Type + , !- Window Glass Spectral Data Set Name + 0.003, !- Thickness {m} + 0.837, !- Solar Transmittance at Normal Incidence + 0.075, !- Front Side Solar Reflectance at Normal Incidence + 0.075, !- Back Side Solar Reflectance at Normal Incidence + 0.898, !- Visible Transmittance at Normal Incidence + 0.081, !- Front Side Visible Reflectance at Normal Incidence + 0.081, !- Back Side Visible Reflectance at Normal Incidence + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Front Side Infrared Hemispherical Emissivity + 0.84, !- Back Side Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + WindowMaterial:Glazing, + GREY 3MM, !- Name + SpectralAverage, !- Optical Data Type + , !- Window Glass Spectral Data Set Name + 0.003, !- Thickness {m} + 0.626, !- Solar Transmittance at Normal Incidence + 0.061, !- Front Side Solar Reflectance at Normal Incidence + 0.061, !- Back Side Solar Reflectance at Normal Incidence + 0.611, !- Visible Transmittance at Normal Incidence + 0.061, !- Front Side Visible Reflectance at Normal Incidence + 0.061, !- Back Side Visible Reflectance at Normal Incidence + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Front Side Infrared Hemispherical Emissivity + 0.84, !- Back Side Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + Construction, + Dbl Clr 3mm/13mm Air, !- Name + CLEAR 3MM, !- Outside Layer + AIR 13MM, !- Layer 2 + CLEAR 3MM; !- Layer 3 + + Construction, + Sgl Grey 3mm, !- Name + GREY 3MM; !- Outside Layer + + Schedule:Compact, + OCCUPY-1, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays SummerDesignDay CustomDay1 CustomDay2, !- Field 2 + Until: 8:00,0.0, !- Field 3 + Until: 11:00,1.00, !- Field 5 + Until: 12:00,0.80, !- Field 7 + Until: 13:00,0.40, !- Field 9 + Until: 14:00,0.80, !- Field 11 + Until: 18:00,1.00, !- Field 13 + Until: 19:00,0.50, !- Field 15 + Until: 24:00,0.0, !- Field 17 + For: Weekends WinterDesignDay Holiday, !- Field 19 + Until: 24:00,0.0; !- Field 20 + + Schedule:Compact, + LIGHTS-1, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays SummerDesignDay CustomDay1 CustomDay2, !- Field 2 + Until: 8:00,0.05, !- Field 3 + Until: 9:00,0.9, !- Field 5 + Until: 10:00,0.95, !- Field 7 + Until: 11:00,1.00, !- Field 9 + Until: 12:00,0.95, !- Field 11 + Until: 13:00,0.8, !- Field 13 + Until: 14:00,0.9, !- Field 15 + Until: 18:00,1.00, !- Field 17 + Until: 19:00,0.60, !- Field 19 + Until: 21:00,0.20, !- Field 21 + Until: 24:00,0.05, !- Field 23 + For: Weekends WinterDesignDay Holiday, !- Field 25 + Until: 24:00,0.05; !- Field 26 + + Schedule:Compact, + EQUIP-1, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays SummerDesignDay CustomDay1 CustomDay2, !- Field 2 + Until: 8:00,0.02, !- Field 3 + Until: 9:00,0.4, !- Field 5 + Until: 14:00,0.9, !- Field 7 + Until: 15:00,0.8, !- Field 9 + Until: 16:00,0.7, !- Field 11 + Until: 18:00,0.5, !- Field 13 + Until: 20:00,0.3, !- Field 15 + Until: 24:00,0.02, !- Field 17 + For: Weekends WinterDesignDay Holiday, !- Field 19 + Until: 24:00,0.2; !- Field 20 + + Schedule:Compact, + INFIL-SCH, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0, !- Field 3 + Through: 10/31, !- Field 5 + For: AllDays, !- Field 6 + Until: 24:00,0.0, !- Field 7 + Through: 12/31, !- Field 9 + For: AllDays, !- Field 10 + Until: 24:00,1.0; !- Field 11 + + Schedule:Compact, + ActSchd, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,117.239997864; !- Field 3 + + !- Field 4 + + Schedule:Compact, + ShadeTransSch, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,0.0; !- Field 3 + + Zone, + PLENUM-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 0.609600067, !- Ceiling Height {m} + 283.2; !- Volume {m3} + + BuildingSurface:Detailed, + WALL-1PF, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,0.0,3.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 30.5,0.0,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + WALL-1PR, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,0.0,3.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + WALL-1PB, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,3.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 0.0,15.2,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + WALL-1PL, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,3.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 0.0,0.0,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + TOP-1, !- Name + ROOF, !- Surface Type + ROOF-1, !- Construction Name + PLENUM-1, !- Zone Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.00000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,3.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,3.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,3.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C1-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + Surface, !- Outside Boundary Condition + C1-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C2-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + Surface, !- Outside Boundary Condition + C2-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C3-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + Surface, !- Outside Boundary Condition + C3-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C4-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + Surface, !- Outside Boundary Condition + C4-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C5-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + Surface, !- Outside Boundary Condition + C5-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + SPACE1-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 239.247360229; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + SPACE1-1 Infil 1, !- Name + SPACE1-1, !- Zone or ZoneList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.032, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + SPACE1-1 People 1, !- Name + SPACE1-1, !- Zone or ZoneList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 11, !- Number of People + , !- People per Zone Floor Area {person/m2} + , !- Zone Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + SPACE1-1 Lights 1, !- Name + SPACE1-1, !- Zone or ZoneList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 1584, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 1.0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + Daylighting:Controls, + SPACE1-1 Daylighting Control, !- Name + SPACE1-1, !- Zone Name + SplitFlux, !- Daylighting Method + , !- Availability Schedule Name + Stepped, !- Lighting Control Type + 0.3000, !- Minimum Input Power Fraction for Continuous or ContinuousOff Dimming Control + 0.2000, !- Minimum Light Output Fraction for Continuous or ContinuousOff Dimming Control + 3, !- Number of Stepped Control Steps + 1.0000, !- Probability Lighting will be Reset When Needed in Manual Stepped Control + SPACE1-1 Reference Point1, !- Glare Calculation Daylighting Reference Point Name + 180, !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone y-Axis {deg} + 20, !- Maximum Allowable Discomfort Glare Index + , !- DElight Gridding Resolution {m2} + SPACE1-1 Reference Point1, !- Daylighting Reference Point 1 Name + 1.0000, !- Fraction of Zone Controlled by Reference Point 1 + 400.0000; !- Illuminance Setpoint at Reference Point 1 {lux} + + Daylighting:ReferencePoint, + SPACE1-1 Reference Point1, !- Name + SPACE1-1, !- Zone Name + 15.0, !- X-Coordinate of Reference Point {m} + 3.0, !- Y-Coordinate of Reference Point {m} + 0.7; !- Z-Coordinate of Reference Point {m} + + ElectricEquipment, + SPACE1-1 ElecEq 1, !- Name + SPACE1-1, !- Zone or ZoneList Name + EQUIP-1, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 1056, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + FRONT-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + SPACE1-1, !- Zone Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WF-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + FRONT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 3.0,0.0,2.1, !- X,Y,Z ==> Vertex 1 {m} + 3.0,0.0,0.9, !- X,Y,Z ==> Vertex 2 {m} + 16.8,0.0,0.9, !- X,Y,Z ==> Vertex 3 {m} + 16.8,0.0,2.1; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + DF-1, !- Name + GLASSDOOR, !- Surface Type + Sgl Grey 3mm, !- Construction Name + FRONT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 21.3,0.0,2.1, !- X,Y,Z ==> Vertex 1 {m} + 21.3,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 23.8,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 23.8,0.0,2.1; !- X,Y,Z ==> Vertex 4 {m} + + Shading:Zone:Detailed, + Main South Overhang, !- Name + FRONT-1, !- Base Surface Name + ShadeTransSch, !- Transmittance Schedule Name + 4, !- Number of Vertices + 0.0,-1.3,2.2, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.2, !- X,Y,Z ==> Vertex 2 {m} + 19.8,0.0,2.2, !- X,Y,Z ==> Vertex 3 {m} + 19.8,-1.3,2.2; !- X,Y,Z ==> Vertex 4 {m} + + Shading:Zone:Detailed, + South Door Overhang, !- Name + FRONT-1, !- Base Surface Name + ShadeTransSch, !- Transmittance Schedule Name + 4, !- Number of Vertices + 21.0,-2.0,2.6, !- X,Y,Z ==> Vertex 1 {m} + 21.0,0.0,2.6, !- X,Y,Z ==> Vertex 2 {m} + 24.1,0.0,2.6, !- X,Y,Z ==> Vertex 3 {m} + 24.1,-2.0,2.6; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C1-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + SPACE1-1, !- Zone Name + Surface, !- Outside Boundary Condition + C1-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F1-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + SPACE1-1, !- Zone Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB12, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE1-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB21, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB14, !- Name + WALL, !- Surface Type + Air Wall, !- Construction Name + SPACE1-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB41, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB15, !- Name + WALL, !- Surface Type + Air Wall, !- Construction Name + SPACE1-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB51, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + SPACE2-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 103.311355591; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + SPACE2-1 Infil 1, !- Name + SPACE2-1, !- Zone or ZoneList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.014, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + SPACE2-1 People 1, !- Name + SPACE2-1, !- Zone or ZoneList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 5, !- Number of People + , !- People per Zone Floor Area {person/m2} + , !- Zone Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + SPACE2-1 Lights 1, !- Name + SPACE2-1, !- Zone or ZoneList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 684, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + ElectricEquipment, + SPACE2-1 ElecEq 1, !- Name + SPACE2-1, !- Zone or ZoneList Name + EQUIP-1, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 456, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + RIGHT-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + SPACE2-1, !- Zone Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WR-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + RIGHT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 30.5,3.8,2.1, !- X,Y,Z ==> Vertex 1 {m} + 30.5,3.8,0.9, !- X,Y,Z ==> Vertex 2 {m} + 30.5,11.4,0.9, !- X,Y,Z ==> Vertex 3 {m} + 30.5,11.4,2.1; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C2-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + SPACE2-1, !- Zone Name + Surface, !- Outside Boundary Condition + C2-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F2-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + SPACE2-1, !- Zone Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB21, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE2-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB12, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB23, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE2-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB32, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB25, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE2-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB52, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + SPACE3-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 239.247360229; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + SPACE3-1 Infil 1, !- Name + SPACE3-1, !- Zone or ZoneList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.032, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + SPACE3-1 People 1, !- Name + SPACE3-1, !- Zone or ZoneList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 11, !- Number of People + , !- People per Zone Floor Area {person/m2} + , !- Zone Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + SPACE3-1 Lights 1, !- Name + SPACE3-1, !- Zone or ZoneList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 1584, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + ElectricEquipment, + SPACE3-1 ElecEq 1, !- Name + SPACE3-1, !- Zone or ZoneList Name + EQUIP-1, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 1056, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + BACK-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + SPACE3-1, !- Zone Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WB-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + BACK-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 27.4,15.2,2.1, !- X,Y,Z ==> Vertex 1 {m} + 27.4,15.2,0.9, !- X,Y,Z ==> Vertex 2 {m} + 13.7,15.2,0.9, !- X,Y,Z ==> Vertex 3 {m} + 13.7,15.2,2.1; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + DB-1, !- Name + GLASSDOOR, !- Surface Type + Sgl Grey 3mm, !- Construction Name + BACK-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 9.1,15.2,2.1, !- X,Y,Z ==> Vertex 1 {m} + 9.1,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 7.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 7.0,15.2,2.1; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C3-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + SPACE3-1, !- Zone Name + Surface, !- Outside Boundary Condition + C3-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F3-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + SPACE3-1, !- Zone Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB32, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE3-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB23, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB34, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE3-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB43, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB35, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE3-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB53, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + SPACE4-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 103.311355591; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + SPACE4-1 Infil 1, !- Name + SPACE4-1, !- Zone or ZoneList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.014, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + SPACE4-1 People 1, !- Name + SPACE4-1, !- Zone or ZoneList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 5, !- Number of People + , !- People per Zone Floor Area {person/m2} + , !- Zone Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + SPACE4-1 Lights 1, !- Name + SPACE4-1, !- Zone or ZoneList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 684, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + ElectricEquipment, + SPACE4-1 ElecEq 1, !- Name + SPACE4-1, !- Zone or ZoneList Name + EQUIP-1, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 456, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + LEFT-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + SPACE4-1, !- Zone Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WL-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + LEFT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 0.0,11.4,2.1, !- X,Y,Z ==> Vertex 1 {m} + 0.0,11.4,0.9, !- X,Y,Z ==> Vertex 2 {m} + 0.0,3.8,0.9, !- X,Y,Z ==> Vertex 3 {m} + 0.0,3.8,2.1; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C4-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + SPACE4-1, !- Zone Name + Surface, !- Outside Boundary Condition + C4-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F4-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + SPACE4-1, !- Zone Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB41, !- Name + WALL, !- Surface Type + Air Wall, !- Construction Name + SPACE4-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB14, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB43, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE4-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB34, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB45, !- Name + WALL, !- Surface Type + Air Wall, !- Construction Name + SPACE4-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB54, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + SPACE5-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 447.682556152; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + SPACE5-1 Infil 1, !- Name + SPACE5-1, !- Zone or ZoneList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.062, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + SPACE5-1 People 1, !- Name + SPACE5-1, !- Zone or ZoneList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 20, !- Number of People + , !- People per Zone Floor Area {person/m2} + , !- Zone Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + SPACE5-1 Lights 1, !- Name + SPACE5-1, !- Zone or ZoneList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 2964, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 1.0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + Daylighting:Controls, + SPACE5-1 Daylighting Control, !- Name + SPACE5-1, !- Zone Name + SplitFlux, !- Daylighting Method + , !- Availability Schedule Name + Stepped, !- Lighting Control Type + 0.3000, !- Minimum Input Power Fraction for Continuous or ContinuousOff Dimming Control + 0.2000, !- Minimum Light Output Fraction for Continuous or ContinuousOff Dimming Control + 3, !- Number of Stepped Control Steps + 1.0000, !- Probability Lighting will be Reset When Needed in Manual Stepped Control + SPACE5-1 Reference Point1, !- Glare Calculation Daylighting Reference Point Name + 180, !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone y-Axis {deg} + 20, !- Maximum Allowable Discomfort Glare Index + , !- DElight Gridding Resolution {m2} + SPACE5-1 Reference Point1, !- Daylighting Reference Point 1 Name + 1.0000, !- Fraction of Zone Controlled by Reference Point 1 + 400.0000; !- Illuminance Setpoint at Reference Point 1 {lux} + + Daylighting:ReferencePoint, + SPACE5-1 Reference Point1, !- Name + SPACE5-1, !- Zone Name + 8.0, !- X-Coordinate of Reference Point {m} + 8.0, !- Y-Coordinate of Reference Point {m} + 0.7; !- Z-Coordinate of Reference Point {m} + + ElectricEquipment, + SPACE5-1 ElecEq 1, !- Name + SPACE5-1, !- Zone or ZoneList Name + EQUIP-1, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 1976, !- Design Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + C5-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + SPACE5-1, !- Zone Name + Surface, !- Outside Boundary Condition + C5-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F5-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + SPACE5-1, !- Zone Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB51, !- Name + WALL, !- Surface Type + Air Wall, !- Construction Name + SPACE5-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB15, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB52, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE5-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB25, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB53, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + SPACE5-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB35, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB54, !- Name + WALL, !- Surface Type + Air Wall , !- Construction Name + SPACE5-1, !- Zone Name + Surface, !- Outside Boundary Condition + SB45, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Sizing:Parameters, + 1.0, !- Heating Sizing Factor + 1.0, !- Cooling Sizing Factor + ; !- Timesteps in Averaging Window + + Sizing:Zone, + SPACE1-1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA SPACE1-1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDayWithLimit, !- Cooling Design Air Flow Method + , !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + , !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + ; !- Heating Maximum Air Flow Fraction + + DesignSpecification:OutdoorAir, + SZ DSOA SPACE1-1, !- Name + sum, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + SPACE2-1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA SPACE2-1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDayWithLimit, !- Cooling Design Air Flow Method + , !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + , !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + ; !- Heating Maximum Air Flow Fraction + + DesignSpecification:OutdoorAir, + SZ DSOA SPACE2-1, !- Name + sum, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + SPACE3-1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA SPACE3-1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDayWithLimit, !- Cooling Design Air Flow Method + , !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + , !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + ; !- Heating Maximum Air Flow Fraction + + DesignSpecification:OutdoorAir, + SZ DSOA SPACE3-1, !- Name + sum, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + SPACE4-1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA SPACE4-1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDayWithLimit, !- Cooling Design Air Flow Method + , !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + , !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + ; !- Heating Maximum Air Flow Fraction + + DesignSpecification:OutdoorAir, + SZ DSOA SPACE4-1, !- Name + sum, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + SPACE5-1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA SPACE5-1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDayWithLimit, !- Cooling Design Air Flow Method + , !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + , !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + ; !- Heating Maximum Air Flow Fraction + + DesignSpecification:OutdoorAir, + SZ DSOA SPACE5-1, !- Name + sum, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:System, + VAV Sys 1, !- AirLoop Name + sensible, !- Type of Load to Size On + autosize, !- Design Outdoor Air Flow Rate {m3/s} + 0.3, !- Central Heating Maximum System Air Flow Ratio + 4.5, !- Preheat Design Temperature {C} + 0.008, !- Preheat Design Humidity Ratio {kgWater/kgDryAir} + 11.0, !- Precool Design Temperature {C} + 0.008, !- Precool Design Humidity Ratio {kgWater/kgDryAir} + 12.8, !- Central Cooling Design Supply Air Temperature {C} + 16.7, !- Central Heating Design Supply Air Temperature {C} + noncoincident, !- Type of Zone Sum to Use + no, !- 100% Outdoor Air in Cooling + no, !- 100% Outdoor Air in Heating + 0.008, !- Central Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.008, !- Central Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + DesignDay, !- Cooling Supply Air Flow Rate Method + 0, !- Cooling Supply Air Flow Rate {m3/s} + , !- Cooling Supply Air Flow Rate Per Floor Area {m3/s-m2} + , !- Cooling Fraction of Autosized Cooling Supply Air Flow Rate + , !- Cooling Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W} + DesignDay, !- Heating Supply Air Flow Rate Method + 0, !- Heating Supply Air Flow Rate {m3/s} + , !- Heating Supply Air Flow Rate Per Floor Area {m3/s-m2} + , !- Heating Fraction of Autosized Heating Supply Air Flow Rate + , !- Heating Fraction of Autosized Cooling Supply Air Flow Rate + , !- Heating Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W} + , !- System Outdoor Air Method + 1.0, !- Zone Maximum Outdoor Air Fraction {dimensionless} + CoolingDesignCapacity, !- Cooling Design Capacity Method + autosize, !- Cooling Design Capacity {W} + , !- Cooling Design Capacity Per Floor Area {W/m2} + , !- Fraction of Autosized Cooling Design Capacity + HeatingDesignCapacity, !- Heating Design Capacity Method + autosize, !- Heating Design Capacity {W} + , !- Heating Design Capacity Per Floor Area {W/m2} + , !- Fraction of Autosized Heating Design Capacity + VAV; !- Central Cooling Capacity Control Method + + Sizing:Plant, + Hot Water Loop, !- Plant or Condenser Loop Name + heating, !- Loop Type + 82., !- Design Loop Exit Temperature {C} + 11; !- Loop Design Temperature Difference {deltaC} + + Sizing:Plant, + Chilled Water Loop, !- Plant or Condenser Loop Name + cooling, !- Loop Type + 7.00, !- Design Loop Exit Temperature {C} + 4.00; !- Loop Design Temperature Difference {deltaC} + + Schedule:Compact, + Htg-SetP-Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: SummerDesignDay, !- Field 2 + Until: 24:00,16.7, !- Field 3 + For: WinterDesignDay, !- Field 5 + Until: 24:00,22.2, !- Field 6 + For: WeekDays, !- Field 8 + Until: 6:00,16.7, !- Field 9 + Until: 20:00,22.2, !- Field 11 + Until: 24:00,16.7, !- Field 13 + For: WeekEnds Holiday, !- Field 15 + Until: 24:00,16.7, !- Field 16 + For: AllOtherDays, !- Field 18 + Until: 24:00,16.7; !- Field 19 + + Schedule:Compact, + PlenumHtg-SetP-Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,12.8; !- Field 3 + + Schedule:Compact, + Clg-SetP-Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: SummerDesignDay, !- Field 2 + Until: 24:00,23.9, !- Field 3 + For: WinterDesignDay, !- Field 5 + Until: 24:00,29.4, !- Field 6 + For: WeekDays, !- Field 8 + Until: 6:00,29.4, !- Field 9 + Until: 20:00,23.9, !- Field 11 + Until: 24:00,29.4, !- Field 13 + For: WeekEnds Holiday, !- Field 15 + Until: 24:00,29.4, !- Field 16 + For: AllOtherDays, !- Field 18 + Until: 24:00,29.4; !- Field 19 + + Schedule:Compact, + PlenumClg-SetP-Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,40.0; !- Field 3 + + Schedule:Compact, + Zone Control Type Sched, !- Name + Control Type, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: SummerDesignDay, !- Field 2 + Until: 24:00,2, !- Field 3 + For: WinterDesignDay, !- Field 5 + Until: 24:00,1, !- Field 6 + For: AllOtherDays, !- Field 8 + Until: 24:00,4; !- Field 9 + + Schedule:Compact, + Min OA Sched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Weekdays, !- Field 2 + Until: 6:00,0.02, !- Field 3 + Until: 20:00,1.0, !- Field 5 + Until: 24:00,0.02, !- Field 7 + For: AllOtherDays, !- Field 9 + Until: 24:00,0.02; !- Field 10 + + Schedule:Compact, + FanAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0, !- Field 3 + Through: 9/30, !- Field 5 + For: WeekDays, !- Field 6 + Until: 6:00,0.0, !- Field 7 + Until: 20:00,1.0, !- Field 9 + Until: 24:00,0.0, !- Field 11 + For: SummerDesignDay WinterDesignDay, !- Field 13 + Until: 24:00,1.0, !- Field 14 + For: AllOtherDays, !- Field 16 + Until: 24:00,0.0, !- Field 17 + Through: 12/31, !- Field 19 + For: AllDays, !- Field 20 + Until: 24:00,1.0; !- Field 21 + + Schedule:Compact, + CoolingCoilAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays, !- Field 2 + Until: 6:00,0.0, !- Field 3 + Until: 20:00,1.0, !- Field 5 + Until: 24:00,0.0, !- Field 7 + For: SummerDesignDay WinterDesignDay, !- Field 9 + Until: 24:00,1.0, !- Field 10 + For: AllOtherDays, !- Field 12 + Until: 24:00,0.0; !- Field 13 + + Schedule:Compact, + CoolingPumpAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0; !- Field 3 + + Schedule:Compact, + ReheatCoilAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0, !- Field 3 + Through: 9/30, !- Field 5 + For: WeekDays, !- Field 6 + Until: 6:00,0.0, !- Field 7 + Until: 20:00,1.0, !- Field 9 + Until: 24:00,0.0, !- Field 11 + For: SummerDesignDay WinterDesignDay, !- Field 13 + Until: 24:00,1.0, !- Field 14 + For: AllOtherDays, !- Field 16 + Until: 24:00,0.0, !- Field 17 + Through: 12/31, !- Field 19 + For: AllDays, !- Field 20 + Until: 24:00,1.0; !- Field 21 + + Schedule:Compact, + CW Loop Temp Schedule, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,7.22; !- Field 3 + + Schedule:Compact, + HW Loop Temp Schedule, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,82; !- Field 3 + + Schedule:Compact, + PlantOnSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0; !- Field 3 + + Schedule:Compact, + Seasonal Reset Supply Air Temp Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,16.0, !- Field 3 + Through: 9/30, !- Field 5 + For: AllDays, !- Field 6 + Until: 24:00,13.0, !- Field 7 + Through: 12/31, !- Field 9 + For: AllDays, !- Field 10 + Until: 24:00,16.0; !- Field 11 + + Schedule:Compact, + OA Cooling Supply Air Temp Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,11.5; !- Field 3 + + Schedule:Compact, + OA Heating Supply Air Temp Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,4.5; !- Field 3 + + OutdoorAir:NodeList, + OutsideAirInletNodes; !- Node or NodeList Name 1 + + NodeList, + OutsideAirInletNodes, !- Name + Outside Air Inlet Node 1;!- Node 1 Name + + ZoneHVAC:EquipmentConnections, + SPACE1-1, !- Zone Name + SPACE1-1 Eq, !- Zone Conditioning Equipment List Name + SPACE1-1 In Node, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + SPACE1-1 Node, !- Zone Air Node Name + SPACE1-1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + SPACE2-1, !- Zone Name + SPACE2-1 Eq, !- Zone Conditioning Equipment List Name + SPACE2-1 In Node, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + SPACE2-1 Node, !- Zone Air Node Name + SPACE2-1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + SPACE3-1, !- Zone Name + SPACE3-1 Eq, !- Zone Conditioning Equipment List Name + SPACE3-1 In Node, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + SPACE3-1 Node, !- Zone Air Node Name + SPACE3-1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + SPACE4-1, !- Zone Name + SPACE4-1 Eq, !- Zone Conditioning Equipment List Name + SPACE4-1 In Node, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + SPACE4-1 Node, !- Zone Air Node Name + SPACE4-1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + SPACE5-1, !- Zone Name + SPACE5-1 Eq, !- Zone Conditioning Equipment List Name + SPACE5-1 In Node, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + SPACE5-1 Node, !- Zone Air Node Name + SPACE5-1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneControl:Thermostat, + SPACE1-1 Control, !- Name + SPACE1-1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + SPACE2-1 Control, !- Name + SPACE2-1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + SPACE3-1 Control, !- Name + SPACE3-1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + SPACE4-1 Control, !- Name + SPACE4-1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + SPACE5-1 Control, !- Name + SPACE5-1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ThermostatSetpoint:SingleHeating, + HeatingSetpoint, !- Name + Htg-SetP-Sch; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:SingleCooling, + CoolingSetpoint, !- Name + Clg-SetP-Sch; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:SingleHeating, + PlenumHeatingSetpoint, !- Name + PlenumHtg-SetP-Sch; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:SingleCooling, + PlenumCoolingSetpoint, !- Name + PlenumClg-SetP-Sch; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:DualSetpoint, + DualSetPoint, !- Name + Htg-SetP-Sch, !- Heating Setpoint Temperature Schedule Name + Clg-SetP-Sch; !- Cooling Setpoint Temperature Schedule Name + + ZoneHVAC:EquipmentList, + SPACE1-1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + SPACE1-1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Load Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Load Fraction Schedule Name + + ZoneHVAC:EquipmentList, + SPACE2-1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + SPACE2-1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Load Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Load Fraction Schedule Name + + ZoneHVAC:EquipmentList, + SPACE3-1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + SPACE3-1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Load Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Load Fraction Schedule Name + + ZoneHVAC:EquipmentList, + SPACE4-1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + SPACE4-1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Load Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Load Fraction Schedule Name + + ZoneHVAC:EquipmentList, + SPACE5-1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + SPACE5-1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Load Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Load Fraction Schedule Name + + ZoneHVAC:AirDistributionUnit, + SPACE1-1 ATU, !- Name + SPACE1-1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + SPACE1-1 VAV Reheat; !- Air Terminal Name + + ZoneHVAC:AirDistributionUnit, + SPACE2-1 ATU, !- Name + SPACE2-1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + SPACE2-1 VAV Reheat; !- Air Terminal Name + + ZoneHVAC:AirDistributionUnit, + SPACE3-1 ATU, !- Name + SPACE3-1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + SPACE3-1 VAV Reheat; !- Air Terminal Name + + ZoneHVAC:AirDistributionUnit, + SPACE4-1 ATU, !- Name + SPACE4-1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + SPACE4-1 VAV Reheat; !- Air Terminal Name + + ZoneHVAC:AirDistributionUnit, + SPACE5-1 ATU, !- Name + SPACE5-1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + SPACE5-1 VAV Reheat; !- Air Terminal Name + + AirTerminal:SingleDuct:VAV:Reheat, + SPACE1-1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + SPACE1-1 Zone Coil Air In Node, !- Damper Air Outlet Node Name + SPACE1-1 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + Constant, !- Zone Minimum Air Flow Input Method + 0.3, !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + SPACE1-1 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + SPACE1-1 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + NORMAL, !- Damper Heating Action + AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + AUTOCALCULATE; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + SPACE2-1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + SPACE2-1 Zone Coil Air In Node, !- Damper Air Outlet Node Name + SPACE2-1 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + Constant, !- Zone Minimum Air Flow Input Method + 0.3, !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + SPACE2-1 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + SPACE2-1 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + NORMAL, !- Damper Heating Action + AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + AUTOCALCULATE; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + SPACE3-1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + SPACE3-1 Zone Coil Air In Node, !- Damper Air Outlet Node Name + SPACE3-1 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + Constant, !- Zone Minimum Air Flow Input Method + 0.3, !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + SPACE3-1 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + SPACE3-1 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + NORMAL, !- Damper Heating Action + AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + AUTOCALCULATE; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + SPACE4-1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + SPACE4-1 Zone Coil Air In Node, !- Damper Air Outlet Node Name + SPACE4-1 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + Constant, !- Zone Minimum Air Flow Input Method + 0.3, !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + SPACE4-1 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + SPACE4-1 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + NORMAL, !- Damper Heating Action + AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + AUTOCALCULATE; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + SPACE5-1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + SPACE5-1 Zone Coil Air In Node, !- Damper Air Outlet Node Name + SPACE5-1 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + Constant, !- Zone Minimum Air Flow Input Method + 0.3, !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + SPACE5-1 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + SPACE5-1 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + NORMAL, !- Damper Heating Action + AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + AUTOCALCULATE; !- Maximum Flow Fraction During Reheat + + Coil:Heating:Water, + SPACE1-1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + SPACE1-1 Zone Coil Water In Node, !- Water Inlet Node Name + SPACE1-1 Zone Coil Water Out Node, !- Water Outlet Node Name + SPACE1-1 Zone Coil Air In Node, !- Air Inlet Node Name + SPACE1-1 In Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Coil:Heating:Water, + SPACE2-1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + SPACE2-1 Zone Coil Water In Node, !- Water Inlet Node Name + SPACE2-1 Zone Coil Water Out Node, !- Water Outlet Node Name + SPACE2-1 Zone Coil Air In Node, !- Air Inlet Node Name + SPACE2-1 In Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Coil:Heating:Water, + SPACE3-1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + SPACE3-1 Zone Coil Water In Node, !- Water Inlet Node Name + SPACE3-1 Zone Coil Water Out Node, !- Water Outlet Node Name + SPACE3-1 Zone Coil Air In Node, !- Air Inlet Node Name + SPACE3-1 In Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Coil:Heating:Water, + SPACE4-1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + SPACE4-1 Zone Coil Water In Node, !- Water Inlet Node Name + SPACE4-1 Zone Coil Water Out Node, !- Water Outlet Node Name + SPACE4-1 Zone Coil Air In Node, !- Air Inlet Node Name + SPACE4-1 In Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Coil:Heating:Water, + SPACE5-1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + SPACE5-1 Zone Coil Water In Node, !- Water Inlet Node Name + SPACE5-1 Zone Coil Water Out Node, !- Water Outlet Node Name + SPACE5-1 Zone Coil Air In Node, !- Air Inlet Node Name + SPACE5-1 In Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + AirLoopHVAC:ReturnPath, + ReturnAirPath1, !- Name + PLENUM-1 Out Node, !- Return Air Path Outlet Node Name + AirLoopHVAC:ReturnPlenum,!- Component 1 Object Type + Return-Plenum-1; !- Component 1 Name + + AirLoopHVAC:ReturnPlenum, + Return-Plenum-1, !- Name + PLENUM-1, !- Zone Name + PLENUM-1 Node, !- Zone Node Name + PLENUM-1 Out Node, !- Outlet Node Name + , !- Induced Air Outlet Node or NodeList Name + SPACE1-1 Out Node, !- Inlet 1 Node Name + SPACE2-1 Out Node, !- Inlet 2 Node Name + SPACE3-1 Out Node, !- Inlet 3 Node Name + SPACE4-1 Out Node, !- Inlet 4 Node Name + SPACE5-1 Out Node; !- Inlet 5 Node Name + + AirLoopHVAC:SupplyPath, + Zone Supply Air Path 1, !- Name + Zone Eq In Node, !- Supply Air Path Inlet Node Name + AirLoopHVAC:ZoneSplitter,!- Component 1 Object Type + Zone Supply Air Splitter 1; !- Component 1 Name + + AirLoopHVAC:ZoneSplitter, + Zone Supply Air Splitter 1, !- Name + Zone Eq In Node, !- Inlet Node Name + SPACE1-1 ATU In Node, !- Outlet 1 Node Name + SPACE2-1 ATU In Node, !- Outlet 2 Node Name + SPACE3-1 ATU In Node, !- Outlet 3 Node Name + SPACE4-1 ATU In Node, !- Outlet 4 Node Name + SPACE5-1 ATU In Node; !- Outlet 5 Node Name + + AirLoopHVAC, + VAV Sys 1, !- Name + VAV Sys 1 Controllers, !- Controller List Name + VAV Sys 1 Avail List, !- Availability Manager List Name + autosize, !- Design Supply Air Flow Rate {m3/s} + VAV Sys 1 Branches, !- Branch List Name + , !- Connector List Name + VAV Sys 1 Inlet Node, !- Supply Side Inlet Node Name + PLENUM-1 Out Node, !- Demand Side Outlet Node Name + Zone Eq In Node, !- Demand Side Inlet Node Names + VAV Sys 1 Outlet Node; !- Supply Side Outlet Node Names + + AirLoopHVAC:ControllerList, + VAV Sys 1 Controllers, !- Name + Controller:WaterCoil, !- Controller 1 Object Type + Central Cooling Coil Controller 1, !- Controller 1 Name + Controller:WaterCoil, !- Controller 2 Object Type + Central Heating Coil Controller 1; !- Controller 2 Name + + AvailabilityManagerAssignmentList, + VAV Sys 1 Avail List, !- Name + AvailabilityManager:Scheduled, !- Availability Manager 1 Object Type + VAV Sys 1 Avail; !- Availability Manager 1 Name + + AvailabilityManager:Scheduled, + VAV Sys 1 Avail, !- Name + FanAvailSched; !- Schedule Name + + BranchList, + VAV Sys 1 Branches, !- Name + VAV Sys 1 Main Branch; !- Branch 1 Name + + Branch, + VAV Sys 1 Main Branch, !- Name + , !- Pressure Drop Curve Name + AirLoopHVAC:OutdoorAirSystem, !- Component 1 Object Type + OA Sys 1, !- Component 1 Name + VAV Sys 1 Inlet Node, !- Component 1 Inlet Node Name + Mixed Air Node 1, !- Component 1 Outlet Node Name + Coil:Cooling:Water, !- Component 2 Object Type + Main Cooling Coil 1, !- Component 2 Name + Mixed Air Node 1, !- Component 2 Inlet Node Name + Main Cooling Coil 1 Outlet Node, !- Component 2 Outlet Node Name + Coil:Heating:Water, !- Component 3 Object Type + Main Heating Coil 1, !- Component 3 Name + Main Cooling Coil 1 Outlet Node, !- Component 3 Inlet Node Name + Main Heating Coil 1 Outlet Node, !- Component 3 Outlet Node Name + Fan:VariableVolume, !- Component 4 Object Type + Supply Fan 1, !- Component 4 Name + Main Heating Coil 1 Outlet Node, !- Component 4 Inlet Node Name + VAV Sys 1 Outlet Node; !- Component 4 Outlet Node Name + + AirLoopHVAC:OutdoorAirSystem, + OA Sys 1, !- Name + OA Sys 1 Controllers, !- Controller List Name + OA Sys 1 Equipment, !- Outdoor Air Equipment List Name + VAV Sys 1 Avail List; !- Availability Manager List Name + + AirLoopHVAC:ControllerList, + OA Sys 1 Controllers, !- Name + Controller:OutdoorAir, !- Controller 1 Object Type + OA Controller 1, !- Controller 1 Name + Controller:WaterCoil, !- Controller 2 Object Type + OA CC Controller 1, !- Controller 2 Name + Controller:WaterCoil, !- Controller 3 Object Type + OA HC Controller 1; !- Controller 3 Name + + AirLoopHVAC:OutdoorAirSystem:EquipmentList, + OA Sys 1 Equipment, !- Name + Coil:Heating:Water, !- Component 1 Object Type + OA Heating Coil 1, !- Component 1 Name + Coil:Cooling:Water, !- Component 2 Object Type + OA Cooling Coil 1, !- Component 2 Name + OutdoorAir:Mixer, !- Component 3 Object Type + OA Mixing Box 1; !- Component 3 Name + + Coil:Heating:Water, + OA Heating Coil 1, !- Name + CoolingCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + OA Heating Coil 1 Water Inlet Node, !- Water Inlet Node Name + OA Heating Coil 1 Water Outlet Node, !- Water Outlet Node Name + Outside Air Inlet Node 1,!- Air Inlet Node Name + OA Heating Coil 1 Air Outlet Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Coil:Cooling:Water, + OA Cooling Coil 1, !- Name + CoolingCoilAvailSched, !- Availability Schedule Name + autosize, !- Design Water Flow Rate {m3/s} + autosize, !- Design Air Flow Rate {m3/s} + autosize, !- Design Inlet Water Temperature {C} + autosize, !- Design Inlet Air Temperature {C} + autosize, !- Design Outlet Air Temperature {C} + autosize, !- Design Inlet Air Humidity Ratio {kgWater/kgDryAir} + autosize, !- Design Outlet Air Humidity Ratio {kgWater/kgDryAir} + OA Cooling Coil 1 Water Inlet Node, !- Water Inlet Node Name + OA Cooling Coil 1 Water Outlet Node, !- Water Outlet Node Name + OA Heating Coil 1 Air Outlet Node, !- Air Inlet Node Name + OA Mixing Box 1 Inlet Node, !- Air Outlet Node Name + SimpleAnalysis, !- Type of Analysis + CrossFlow, !- Heat Exchanger Configuration + , !- Condensate Collection Water Storage Tank Name + 4.0; !- Design Water Temperature Difference {deltaC} + + OutdoorAir:Mixer, + OA Mixing Box 1, !- Name + Mixed Air Node 1, !- Mixed Air Node Name + OA Mixing Box 1 Inlet Node, !- Outdoor Air Stream Node Name + Relief Air Outlet Node 1,!- Relief Air Stream Node Name + VAV Sys 1 Inlet Node; !- Return Air Stream Node Name + + Coil:Cooling:Water, + Main Cooling Coil 1, !- Name + CoolingCoilAvailSched, !- Availability Schedule Name + autosize, !- Design Water Flow Rate {m3/s} + autosize, !- Design Air Flow Rate {m3/s} + autosize, !- Design Inlet Water Temperature {C} + autosize, !- Design Inlet Air Temperature {C} + autosize, !- Design Outlet Air Temperature {C} + autosize, !- Design Inlet Air Humidity Ratio {kgWater/kgDryAir} + autosize, !- Design Outlet Air Humidity Ratio {kgWater/kgDryAir} + Main Cooling Coil 1 Water Inlet Node, !- Water Inlet Node Name + Main Cooling Coil 1 Water Outlet Node, !- Water Outlet Node Name + Mixed Air Node 1, !- Air Inlet Node Name + Main Cooling Coil 1 Outlet Node, !- Air Outlet Node Name + SimpleAnalysis, !- Type of Analysis + CrossFlow, !- Heat Exchanger Configuration + , !- Condensate Collection Water Storage Tank Name + 4.0; !- Design Water Temperature Difference {deltaC} + + Coil:Heating:Water, + Main Heating Coil 1, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + Main Heating Coil 1 Water Inlet Node, !- Water Inlet Node Name + Main Heating Coil 1 Water Outlet Node, !- Water Outlet Node Name + Main Cooling Coil 1 Outlet Node, !- Air Inlet Node Name + Main Heating Coil 1 Outlet Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Fan:VariableVolume, + Supply Fan 1, !- Name + FanAvailSched, !- Availability Schedule Name + 0.7, !- Fan Total Efficiency + 600.0, !- Pressure Rise {Pa} + autosize, !- Maximum Flow Rate {m3/s} + Fraction, !- Fan Power Minimum Flow Rate Input Method + 0.25, !- Fan Power Minimum Flow Fraction + , !- Fan Power Minimum Air Flow Rate {m3/s} + 0.9, !- Motor Efficiency + 1.0, !- Motor In Airstream Fraction + 0.35071223, !- Fan Power Coefficient 1 + 0.30850535, !- Fan Power Coefficient 2 + -0.54137364, !- Fan Power Coefficient 3 + 0.87198823, !- Fan Power Coefficient 4 + 0.000, !- Fan Power Coefficient 5 + Main Heating Coil 1 Outlet Node, !- Air Inlet Node Name + VAV Sys 1 Outlet Node; !- Air Outlet Node Name + + Controller:WaterCoil, + OA HC Controller 1, !- Name + Temperature, !- Control Variable + Normal, !- Action + FLOW, !- Actuator Variable + OA Heating Coil 1 Air Outlet Node, !- Sensor Node Name + OA Heating Coil 1 Water Inlet Node, !- Actuator Node Name + 0.002, !- Controller Convergence Tolerance {deltaC} + autosize, !- Maximum Actuated Flow {m3/s} + 0.0; !- Minimum Actuated Flow {m3/s} + + Controller:WaterCoil, + OA CC Controller 1, !- Name + Temperature, !- Control Variable + Reverse, !- Action + FLOW, !- Actuator Variable + OA Mixing Box 1 Inlet Node, !- Sensor Node Name + OA Cooling Coil 1 Water Inlet Node, !- Actuator Node Name + 0.002, !- Controller Convergence Tolerance {deltaC} + autosize, !- Maximum Actuated Flow {m3/s} + 0.0; !- Minimum Actuated Flow {m3/s} + + Controller:WaterCoil, + Central Cooling Coil Controller 1, !- Name + Temperature, !- Control Variable + Reverse, !- Action + FLOW, !- Actuator Variable + Main Cooling Coil 1 Outlet Node, !- Sensor Node Name + Main Cooling Coil 1 Water Inlet Node, !- Actuator Node Name + 0.002, !- Controller Convergence Tolerance {deltaC} + autosize, !- Maximum Actuated Flow {m3/s} + 0.0; !- Minimum Actuated Flow {m3/s} + + Controller:OutdoorAir, + OA Controller 1, !- Name + Relief Air Outlet Node 1,!- Relief Air Outlet Node Name + VAV Sys 1 Inlet Node, !- Return Air Node Name + Mixed Air Node 1, !- Mixed Air Node Name + Outside Air Inlet Node 1,!- Actuator Node Name + autosize, !- Minimum Outdoor Air Flow Rate {m3/s} + autosize, !- Maximum Outdoor Air Flow Rate {m3/s} + NoEconomizer, !- Economizer Control Type + ModulateFlow, !- Economizer Control Action Type + 19., !- Economizer Maximum Limit Dry-Bulb Temperature {C} + , !- Economizer Maximum Limit Enthalpy {J/kg} + , !- Economizer Maximum Limit Dewpoint Temperature {C} + , !- Electronic Enthalpy Limit Curve Name + 4.6, !- Economizer Minimum Limit Dry-Bulb Temperature {C} + NoLockout, !- Lockout Type + FixedMinimum, !- Minimum Limit Type + Min OA Sched; !- Minimum Outdoor Air Schedule Name + + Controller:WaterCoil, + Central Heating Coil Controller 1, !- Name + Temperature, !- Control Variable + Normal, !- Action + FLOW, !- Actuator Variable + Main Heating Coil 1 Outlet Node, !- Sensor Node Name + Main Heating Coil 1 Water Inlet Node, !- Actuator Node Name + 0.002, !- Controller Convergence Tolerance {deltaC} + autosize, !- Maximum Actuated Flow {m3/s} + 0.0; !- Minimum Actuated Flow {m3/s} + + SetpointManager:Scheduled, + Supply Air Temp Manager 1, !- Name + Temperature, !- Control Variable + Seasonal Reset Supply Air Temp Sch, !- Schedule Name + VAV Sys 1 Outlet Node; !- Setpoint Node or NodeList Name + + SetpointManager:Scheduled, + OA Air Temp Manager 1, !- Name + Temperature, !- Control Variable + OA Cooling Supply Air Temp Sch, !- Schedule Name + OA Mixing Box 1 Inlet Node; !- Setpoint Node or NodeList Name + + SetpointManager:Scheduled, + OA Air Temp Manager 2, !- Name + Temperature, !- Control Variable + OA Heating Supply Air Temp Sch, !- Schedule Name + OA Heating Coil 1 Air Outlet Node; !- Setpoint Node or NodeList Name + + SetpointManager:MixedAir, + Mixed Air Temp Manager 1,!- Name + Temperature, !- Control Variable + VAV Sys 1 Outlet Node, !- Reference Setpoint Node Name + Main Heating Coil 1 Outlet Node, !- Fan Inlet Node Name + VAV Sys 1 Outlet Node, !- Fan Outlet Node Name + Main Branch SetPoint Node List; !- Setpoint Node or NodeList Name + + NodeList, + Main Branch SetPoint Node List, !- Name + Mixed Air Node 1, !- Node 1 Name + Main Cooling Coil 1 Outlet Node, !- Node 2 Name + Main Heating Coil 1 Outlet Node; !- Node 3 Name + + PlantLoop, + Hot Water Loop, !- Name + Water, !- Fluid Type + , !- User Defined Fluid Type + Hot Loop Operation, !- Plant Equipment Operation Scheme Name + HW Supply Outlet Node, !- Loop Temperature Setpoint Node Name + 100, !- Maximum Loop Temperature {C} + 10, !- Minimum Loop Temperature {C} + autosize, !- Maximum Loop Flow Rate {m3/s} + 0.0, !- Minimum Loop Flow Rate {m3/s} + , !- Plant Loop Volume {m3} + HW Supply Inlet Node, !- Plant Side Inlet Node Name + HW Supply Outlet Node, !- Plant Side Outlet Node Name + Heating Supply Side Branches, !- Plant Side Branch List Name + Heating Supply Side Connectors, !- Plant Side Connector List Name + HW Demand Inlet Node, !- Demand Side Inlet Node Name + HW Demand Outlet Node, !- Demand Side Outlet Node Name + Heating Demand Side Branches, !- Demand Side Branch List Name + Heating Demand Side Connectors, !- Demand Side Connector List Name + SequentialLoad; !- Load Distribution Scheme + + SetpointManager:Scheduled, + Hot Water Loop Setpoint Manager, !- Name + Temperature, !- Control Variable + HW Loop Temp Schedule, !- Schedule Name + HW Supply Outlet Node; !- Setpoint Node or NodeList Name + + BranchList, + Heating Supply Side Branches, !- Name + Heating Supply Inlet Branch, !- Branch 1 Name + Central Boiler Branch, !- Branch 2 Name + Heating Supply Bypass Branch, !- Branch 3 Name + Heating Supply Outlet Branch; !- Branch 4 Name + + ConnectorList, + Heating Supply Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + Heating Supply Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + Heating Supply Mixer; !- Connector 2 Name + + Branch, + Heating Supply Inlet Branch, !- Name + , !- Pressure Drop Curve Name + Pump:VariableSpeed, !- Component 1 Object Type + HW Circ Pump, !- Component 1 Name + HW Supply Inlet Node, !- Component 1 Inlet Node Name + HW Pump Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Central Boiler Branch, !- Name + , !- Pressure Drop Curve Name + Boiler:HotWater, !- Component 1 Object Type + Central Boiler, !- Component 1 Name + Central Boiler Inlet Node, !- Component 1 Inlet Node Name + Central Boiler Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Heating Supply Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Supply Side Bypass, !- Component 1 Name + Heating Supply Bypass Inlet Node, !- Component 1 Inlet Node Name + Heating Supply Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Supply Side Bypass, !- Name + Heating Supply Bypass Inlet Node, !- Inlet Node Name + Heating Supply Bypass Outlet Node; !- Outlet Node Name + + Branch, + Heating Supply Outlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Supply Outlet, !- Component 1 Name + Heating Supply Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + HW Supply Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Supply Outlet, !- Name + Heating Supply Exit Pipe Inlet Node, !- Inlet Node Name + HW Supply Outlet Node; !- Outlet Node Name + + BranchList, + Heating Demand Side Branches, !- Name + Heating Demand Inlet Branch, !- Branch 1 Name + SPACE1-1 Reheat Branch, !- Branch 2 Name + SPACE2-1 Reheat Branch, !- Branch 3 Name + SPACE3-1 Reheat Branch, !- Branch 4 Name + SPACE4-1 Reheat Branch, !- Branch 5 Name + SPACE5-1 Reheat Branch, !- Branch 6 Name + OA Heating Coil Branch, !- Branch 7 Name + Main Heating Coil 1 Branch, !- Branch 8 Name + Heating Demand Bypass Branch, !- Branch 9 Name + Heating Demand Outlet Branch; !- Branch 10 Name + + ConnectorList, + Heating Demand Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + Heating Demand Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + Heating Demand Mixer; !- Connector 2 Name + + Branch, + Heating Demand Inlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Demand Inlet Pipe, !- Component 1 Name + HW Demand Inlet Node, !- Component 1 Inlet Node Name + HW Demand Entrance Pipe Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Demand Inlet Pipe, !- Name + HW Demand Inlet Node, !- Inlet Node Name + HW Demand Entrance Pipe Outlet Node; !- Outlet Node Name + + Branch, + Heating Demand Outlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Demand Outlet Pipe, !- Component 1 Name + HW Demand Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + HW Demand Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Demand Outlet Pipe, !- Name + HW Demand Exit Pipe Inlet Node, !- Inlet Node Name + HW Demand Outlet Node; !- Outlet Node Name + + Branch, + SPACE1-1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + SPACE1-1 Zone Coil, !- Component 1 Name + SPACE1-1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + SPACE1-1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + SPACE2-1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + SPACE2-1 Zone Coil, !- Component 1 Name + SPACE2-1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + SPACE2-1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + SPACE3-1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + SPACE3-1 Zone Coil, !- Component 1 Name + SPACE3-1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + SPACE3-1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + SPACE4-1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + SPACE4-1 Zone Coil, !- Component 1 Name + SPACE4-1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + SPACE4-1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + SPACE5-1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + SPACE5-1 Zone Coil, !- Component 1 Name + SPACE5-1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + SPACE5-1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + OA Heating Coil Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + OA Heating Coil 1, !- Component 1 Name + OA Heating Coil 1 Water Inlet Node, !- Component 1 Inlet Node Name + OA Heating Coil 1 Water Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Main Heating Coil 1 Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + Main Heating Coil 1, !- Component 1 Name + Main Heating Coil 1 Water Inlet Node, !- Component 1 Inlet Node Name + Main Heating Coil 1 Water Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Heating Demand Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Demand Bypass, !- Component 1 Name + Heating Demand Bypass Inlet Node, !- Component 1 Inlet Node Name + Heating Demand Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Demand Bypass, !- Name + Heating Demand Bypass Inlet Node, !- Inlet Node Name + Heating Demand Bypass Outlet Node; !- Outlet Node Name + + Connector:Splitter, + Heating Demand Splitter, !- Name + Heating Demand Inlet Branch, !- Inlet Branch Name + SPACE1-1 Reheat Branch, !- Outlet Branch 1 Name + SPACE2-1 Reheat Branch, !- Outlet Branch 2 Name + SPACE3-1 Reheat Branch, !- Outlet Branch 3 Name + SPACE4-1 Reheat Branch, !- Outlet Branch 4 Name + SPACE5-1 Reheat Branch, !- Outlet Branch 5 Name + OA Heating Coil Branch, !- Outlet Branch 6 Name + Main Heating Coil 1 Branch, !- Outlet Branch 7 Name + Heating Demand Bypass Branch; !- Outlet Branch 8 Name + + Connector:Mixer, + Heating Demand Mixer, !- Name + Heating Demand Outlet Branch, !- Outlet Branch Name + SPACE1-1 Reheat Branch, !- Inlet Branch 1 Name + SPACE2-1 Reheat Branch, !- Inlet Branch 2 Name + SPACE3-1 Reheat Branch, !- Inlet Branch 3 Name + SPACE4-1 Reheat Branch, !- Inlet Branch 4 Name + SPACE5-1 Reheat Branch, !- Inlet Branch 5 Name + OA Heating Coil Branch, !- Inlet Branch 6 Name + Main Heating Coil 1 Branch, !- Inlet Branch 7 Name + Heating Demand Bypass Branch; !- Inlet Branch 8 Name + + Connector:Splitter, + Heating Supply Splitter, !- Name + Heating Supply Inlet Branch, !- Inlet Branch Name + Central Boiler Branch, !- Outlet Branch 1 Name + Heating Supply Bypass Branch; !- Outlet Branch 2 Name + + Connector:Mixer, + Heating Supply Mixer, !- Name + Heating Supply Outlet Branch, !- Outlet Branch Name + Central Boiler Branch, !- Inlet Branch 1 Name + Heating Supply Bypass Branch; !- Inlet Branch 2 Name + + PlantEquipmentOperationSchemes, + Hot Loop Operation, !- Name + PlantEquipmentOperation:HeatingLoad, !- Control Scheme 1 Object Type + Central Boiler Only, !- Control Scheme 1 Name + PlantOnSched; !- Control Scheme 1 Schedule Name + + PlantEquipmentOperation:HeatingLoad, + Central Boiler Only, !- Name + 0, !- Load Range 1 Lower Limit {W} + 1000000, !- Load Range 1 Upper Limit {W} + heating plant; !- Range 1 Equipment List Name + + PlantEquipmentList, + heating plant, !- Name + Boiler:HotWater, !- Equipment 1 Object Type + Central Boiler; !- Equipment 1 Name + + Boiler:HotWater, + Central Boiler, !- Name + NaturalGas, !- Fuel Type + autosize, !- Nominal Capacity {W} + 0.8, !- Nominal Thermal Efficiency + LeavingBoiler, !- Efficiency Curve Temperature Evaluation Variable + BoilerEfficiency, !- Normalized Boiler Efficiency Curve Name + autosize, !- Design Water Flow Rate {m3/s} + 0.0, !- Minimum Part Load Ratio + 1.2, !- Maximum Part Load Ratio + 1.0, !- Optimum Part Load Ratio + Central Boiler Inlet Node, !- Boiler Water Inlet Node Name + Central Boiler Outlet Node, !- Boiler Water Outlet Node Name + 100., !- Water Outlet Upper Temperature Limit {C} + LeavingSetpointModulated;!- Boiler Flow Mode + + SetpointManager:Scheduled, + Central Boiler Setpoint Manager, !- Name + Temperature, !- Control Variable + HW Loop Temp Schedule, !- Schedule Name + Central Boiler Outlet Node; !- Setpoint Node or NodeList Name + + Curve:Quadratic, + BoilerEfficiency, !- Name + 1.0, !- Coefficient1 Constant + 0.0, !- Coefficient2 x + 0.0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + + Pump:VariableSpeed, + HW Circ Pump, !- Name + HW Supply Inlet Node, !- Inlet Node Name + HW Pump Outlet Node, !- Outlet Node Name + autosize, !- Design Maximum Flow Rate {m3/s} + 179352, !- Design Pump Head {Pa} + autosize, !- Design Power Consumption {W} + 0.9, !- Motor Efficiency + 0.0, !- Fraction of Motor Inefficiencies to Fluid Stream + 0, !- Coefficient 1 of the Part Load Performance Curve + 1, !- Coefficient 2 of the Part Load Performance Curve + 0, !- Coefficient 3 of the Part Load Performance Curve + 0, !- Coefficient 4 of the Part Load Performance Curve + 0, !- Design Minimum Flow Rate {m3/s} + INTERMITTENT; !- Pump Control Type + + PlantLoop, + Chilled Water Loop, !- Name + Water, !- Fluid Type + , !- User Defined Fluid Type + CW Loop Operation, !- Plant Equipment Operation Scheme Name + CW Supply Outlet Node, !- Loop Temperature Setpoint Node Name + 98, !- Maximum Loop Temperature {C} + 1, !- Minimum Loop Temperature {C} + autosize, !- Maximum Loop Flow Rate {m3/s} + 0.0, !- Minimum Loop Flow Rate {m3/s} + , !- Plant Loop Volume {m3} + CW Supply Inlet Node, !- Plant Side Inlet Node Name + CW Supply Outlet Node, !- Plant Side Outlet Node Name + Cooling Supply Side Branches, !- Plant Side Branch List Name + Cooling Supply Side Connectors, !- Plant Side Connector List Name + CW Demand Inlet Node, !- Demand Side Inlet Node Name + CW Demand Outlet Node, !- Demand Side Outlet Node Name + Cooling Demand Side Branches, !- Demand Side Branch List Name + Cooling Demand Side Connectors, !- Demand Side Connector List Name + SequentialLoad, !- Load Distribution Scheme + CW Avail List; !- Availability Manager List Name + + AvailabilityManagerAssignmentList, + CW Avail List, !- Name + AvailabilityManager:LowTemperatureTurnOff, !- Availability Manager 1 Object Type + CW Low Temp Limit; !- Availability Manager 1 Name + + AvailabilityManager:LowTemperatureTurnOff, + CW Low Temp Limit, !- Name + Outside Air Inlet Node 1,!- Sensor Node Name + 2.0, !- Temperature {C} + CoolingPumpAvailSched; !- Applicability Schedule Name + + SetpointManager:Scheduled, + Chilled Water Loop Setpoint Manager, !- Name + Temperature, !- Control Variable + CW Loop Temp Schedule, !- Schedule Name + CW Supply Outlet Node; !- Setpoint Node or NodeList Name + + BranchList, + Cooling Supply Side Branches, !- Name + CW Pump Branch, !- Branch 1 Name + Central Chiller Branch, !- Branch 2 Name + Cooling Supply Bypass Branch, !- Branch 3 Name + Cooling Supply Outlet; !- Branch 4 Name + + BranchList, + Cooling Demand Side Branches, !- Name + Cooling Demand Inlet, !- Branch 1 Name + Cooling Coil Branch, !- Branch 2 Name + OA Cooling Coil Branch, !- Branch 3 Name + Cooling Demand Bypass Branch, !- Branch 4 Name + Cooling Demand Outlet; !- Branch 5 Name + + ConnectorList, + Cooling Supply Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + CW Loop Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + CW Loop Mixer; !- Connector 2 Name + + ConnectorList, + Cooling Demand Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + CW Demand Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + CW Demand Mixer; !- Connector 2 Name + + Branch, + Cooling Demand Inlet, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Cooling Demand Side Inlet Pipe, !- Component 1 Name + CW Demand Inlet Node, !- Component 1 Inlet Node Name + CW Demand Entrance Pipe Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Cooling Demand Side Inlet Pipe, !- Name + CW Demand Inlet Node, !- Inlet Node Name + CW Demand Entrance Pipe Outlet Node; !- Outlet Node Name + + Branch, + Cooling Coil Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Cooling:Water, !- Component 1 Object Type + Main Cooling Coil 1, !- Component 1 Name + Main Cooling Coil 1 Water Inlet Node, !- Component 1 Inlet Node Name + Main Cooling Coil 1 Water Outlet Node; !- Component 1 Outlet Node Name + + Branch, + OA Cooling Coil Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Cooling:Water, !- Component 1 Object Type + OA Cooling Coil 1, !- Component 1 Name + OA Cooling Coil 1 Water Inlet Node, !- Component 1 Inlet Node Name + OA Cooling Coil 1 Water Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Cooling Demand Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Cooling Demand Side Bypass, !- Component 1 Name + CW Demand Bypass Inlet Node, !- Component 1 Inlet Node Name + CW Demand Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Cooling Demand Side Bypass, !- Name + CW Demand Bypass Inlet Node, !- Inlet Node Name + CW Demand Bypass Outlet Node; !- Outlet Node Name + + Branch, + Cooling Demand Outlet, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + CW Demand Side Outlet Pipe, !- Component 1 Name + CW Demand Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + CW Demand Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + CW Demand Side Outlet Pipe, !- Name + CW Demand Exit Pipe Inlet Node, !- Inlet Node Name + CW Demand Outlet Node; !- Outlet Node Name + + Branch, + Cooling Supply Outlet, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Supply Side Outlet Pipe, !- Component 1 Name + Supply Side Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + CW Supply Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Supply Side Outlet Pipe, !- Name + Supply Side Exit Pipe Inlet Node, !- Inlet Node Name + CW Supply Outlet Node; !- Outlet Node Name + + Branch, + CW Pump Branch, !- Name + , !- Pressure Drop Curve Name + Pump:VariableSpeed, !- Component 1 Object Type + CW Circ Pump, !- Component 1 Name + CW Supply Inlet Node, !- Component 1 Inlet Node Name + CW Pump Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Central Chiller Branch, !- Name + , !- Pressure Drop Curve Name + Chiller:Electric, !- Component 1 Object Type + Central Chiller, !- Component 1 Name + Central Chiller Inlet Node, !- Component 1 Inlet Node Name + Central Chiller Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Cooling Supply Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Supply Side Bypass, !- Component 1 Name + CW Supply Bypass Inlet Node, !- Component 1 Inlet Node Name + CW Supply Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Supply Side Bypass, !- Name + CW Supply Bypass Inlet Node, !- Inlet Node Name + CW Supply Bypass Outlet Node; !- Outlet Node Name + + Connector:Splitter, + CW Loop Splitter, !- Name + CW Pump Branch, !- Inlet Branch Name + Central Chiller Branch, !- Outlet Branch 1 Name + Cooling Supply Bypass Branch; !- Outlet Branch 2 Name + + Connector:Mixer, + CW Loop Mixer, !- Name + Cooling Supply Outlet, !- Outlet Branch Name + Central Chiller Branch, !- Inlet Branch 1 Name + Cooling Supply Bypass Branch; !- Inlet Branch 2 Name + + Connector:Splitter, + CW Demand Splitter, !- Name + Cooling Demand Inlet, !- Inlet Branch Name + Cooling Coil Branch, !- Outlet Branch 1 Name + OA Cooling Coil Branch, !- Outlet Branch 2 Name + Cooling Demand Bypass Branch; !- Outlet Branch 3 Name + + Connector:Mixer, + CW Demand Mixer, !- Name + Cooling Demand Outlet, !- Outlet Branch Name + Cooling Coil Branch, !- Inlet Branch 1 Name + OA Cooling Coil Branch, !- Inlet Branch 2 Name + Cooling Demand Bypass Branch; !- Inlet Branch 3 Name + + PlantEquipmentOperationSchemes, + CW Loop Operation, !- Name + PlantEquipmentOperation:CoolingLoad, !- Control Scheme 1 Object Type + Central Chiller Only, !- Control Scheme 1 Name + PlantOnSched; !- Control Scheme 1 Schedule Name + + PlantEquipmentOperation:CoolingLoad, + Central Chiller Only, !- Name + 0, !- Load Range 1 Lower Limit {W} + 900000, !- Load Range 1 Upper Limit {W} + Cooling Plant; !- Range 1 Equipment List Name + + PlantEquipmentList, + Cooling Plant, !- Name + Chiller:Electric, !- Equipment 1 Object Type + Central Chiller; !- Equipment 1 Name + + Chiller:Electric, + Central Chiller, !- Name + AirCooled, !- Condenser Type + autosize, !- Nominal Capacity {W} + 3.2, !- Nominal COP {W/W} + Central Chiller Inlet Node, !- Chilled Water Inlet Node Name + Central Chiller Outlet Node, !- Chilled Water Outlet Node Name + Central Chiller Condenser Inlet Node, !- Condenser Inlet Node Name + Central Chiller Condenser Outlet Node, !- Condenser Outlet Node Name + 0.0, !- Minimum Part Load Ratio + 1.0, !- Maximum Part Load Ratio + 0.65, !- Optimum Part Load Ratio + 35.0, !- Design Condenser Inlet Temperature {C} + 2.778, !- Temperature Rise Coefficient + 6.67, !- Design Chilled Water Outlet Temperature {C} + autosize, !- Design Chilled Water Flow Rate {m3/s} + autosize, !- Design Condenser Fluid Flow Rate {m3/s} + 0.9949, !- Coefficient 1 of Capacity Ratio Curve + -0.045954, !- Coefficient 2 of Capacity Ratio Curve + -0.0013543, !- Coefficient 3 of Capacity Ratio Curve + 2.333, !- Coefficient 1 of Power Ratio Curve + -1.975, !- Coefficient 2 of Power Ratio Curve + 0.6121, !- Coefficient 3 of Power Ratio Curve + 0.03303, !- Coefficient 1 of Full Load Ratio Curve + 0.6852, !- Coefficient 2 of Full Load Ratio Curve + 0.2818, !- Coefficient 3 of Full Load Ratio Curve + 5, !- Chilled Water Outlet Temperature Lower Limit {C} + LeavingSetpointModulated;!- Chiller Flow Mode + + SetpointManager:Scheduled, + Central Chiller Setpoint Manager, !- Name + Temperature, !- Control Variable + CW Loop Temp Schedule, !- Schedule Name + Central Chiller Outlet Node; !- Setpoint Node or NodeList Name + + OutdoorAir:Node, + Central Chiller Condenser Inlet Node, !- Name + -1.0; !- Height Above Ground {m} + + Pump:VariableSpeed, + CW Circ Pump, !- Name + CW Supply Inlet Node, !- Inlet Node Name + CW Pump Outlet Node, !- Outlet Node Name + autosize, !- Design Maximum Flow Rate {m3/s} + 179352, !- Design Pump Head {Pa} + autosize, !- Design Power Consumption {W} + 0.9, !- Motor Efficiency + 0.0, !- Fraction of Motor Inefficiencies to Fluid Stream + 0, !- Coefficient 1 of the Part Load Performance Curve + 1, !- Coefficient 2 of the Part Load Performance Curve + 0, !- Coefficient 3 of the Part Load Performance Curve + 0, !- Coefficient 4 of the Part Load Performance Curve + 0, !- Design Minimum Flow Rate {m3/s} + INTERMITTENT, !- Pump Control Type + CoolingPumpAvailSched; !- Pump Flow Rate Schedule Name + + Output:Variable,*,Site Outdoor Air Drybulb Temperature,hourly; + + Output:Variable,*,Zone Air Temperature,hourly; + + Output:Variable,*,Zone Mean Air Dewpoint Temperature,hourly; + + Output:Variable,*,Zone Air System Sensible Cooling Rate,hourly; + + Output:Variable,*,Zone Air System Sensible Heating Rate,hourly; + + Output:Variable,OA Mixing Box 1 Inlet Node,System Node Temperature,hourly; + + Output:Variable,OA Mixing Box 1 Inlet Node,System Node Mass Flow Rate,hourly; + + Output:Variable,OA Mixing Box 1 Inlet Node,System Node Setpoint Temperature,hourly; + + Output:Variable,OA Mixing Box 1 Inlet Node,System Node Humidity Ratio,hourly; + + Output:Variable,OA Heating Coil 1 Air Outlet Node,System Node Temperature,hourly; + + Output:Variable,OA Heating Coil 1 Air Outlet Node,System Node Mass Flow Rate,hourly; + + Output:Variable,OA Heating Coil 1 Air Outlet Node,System Node Setpoint Temperature,hourly; + + Output:Variable,OA Heating Coil 1 Air Outlet Node,System Node Humidity Ratio,hourly; + + Output:Variable,Mixed Air Node 1,System Node Temperature,hourly; + + Output:Variable,Mixed Air Node 1,System Node Humidity Ratio,hourly; + + Output:Variable,Mixed Air Node 1,System Node Dewpoint Temperature,hourly; + + Output:Variable,VAV Sys 1 Outlet Node,System Node Temperature,hourly; + + Output:Variable,VAV Sys 1 Outlet Node,System Node Mass Flow Rate,hourly; + + Output:Variable,VAV Sys 1 Outlet Node,System Node Humidity Ratio,hourly; + + Output:Variable,VAV Sys 1 Outlet Node,System Node Setpoint Temperature,hourly; + + Output:Variable,OA Cooling Coil 1 Water Inlet Node,System Node Temperature,hourly; + + Output:Variable,OA Cooling Coil 1 Water Inlet Node,System Node Mass Flow Rate,hourly; + + Output:Variable,Main Cooling Coil 1 Water Inlet Node,System Node Mass Flow Rate,hourly; + + Output:Variable,OA Heating Coil 1 Water Inlet Node,System Node Temperature,hourly; + + Output:Variable,OA Heating Coil 1 Water Inlet Node,System Node Mass Flow Rate,hourly; + + Output:Variable,Main Heating Coil 1 Water Inlet Node,System Node Mass Flow Rate,hourly; + + Output:Variable,*,Heating Coil Heating Rate,hourly; + + Output:Variable,*,Cooling Coil Total Cooling Rate,hourly; + + Output:Variable,*,Cooling Coil Sensible Cooling Rate,hourly; + + Output:Variable,*,Plant Supply Side Cooling Demand Rate,hourly; + + Output:Variable,*,Plant Supply Side Heating Demand Rate,hourly; + + Output:Variable,*,Boiler Gas Rate,hourly; + + Output:Variable,*,Boiler Heating Rate,hourly; + + Output:Variable,*,Chiller Electric Power,hourly; + + Output:Variable,*,Chiller Evaporator Cooling Rate,hourly; + + Output:Variable,*,Chiller Evaporator Inlet Temperature,hourly; + + Output:Variable,*,Chiller Evaporator Outlet Temperature,hourly; + + Output:Variable,*,Chiller Evaporator Mass Flow Rate,hourly; + + Output:Variable,*,Chiller Condenser Heat Transfer Rate,hourly; + + Output:Variable,*,Pump Mass Flow Rate,hourly; + + Output:Variable,*,Pump Outlet Temperature,hourly; + + Output:VariableDictionary,IDF; + + Output:Meter:MeterFileOnly,Electricity:Facility,monthly; + + Output:Meter:MeterFileOnly,Electricity:Building,monthly; + + Output:Meter:MeterFileOnly,InteriorLights:Electricity,monthly; + + Output:Meter:MeterFileOnly,Electricity:HVAC,monthly; + + Output:Meter:MeterFileOnly,Electricity:Plant,monthly; + + Output:Meter:MeterFileOnly,Gas:Facility,monthly; + + Output:Meter:MeterFileOnly,Gas:Plant,monthly; + + Output:Meter:MeterFileOnly,Electricity:Facility,runperiod; + + Output:Meter:MeterFileOnly,Electricity:Building,runperiod; + + Output:Meter:MeterFileOnly,InteriorLights:Electricity,runperiod; + + Output:Meter:MeterFileOnly,Electricity:HVAC,runperiod; + + Output:Meter:MeterFileOnly,Electricity:Plant,runperiod; + + Output:Meter:MeterFileOnly,Gas:Facility,runperiod; + + Output:Meter:MeterFileOnly,Gas:Plant,runperiod; + + Output:Meter:MeterFileOnly,MyGeneralLights,monthly; + + Output:Meter:MeterFileOnly,MyGeneralLights,runperiod; + + Output:Meter:MeterFileOnly,MyBuildingElectric,monthly; + + Output:Meter:MeterFileOnly,MyBuildingElectric,runperiod; + + Output:Meter:MeterFileOnly,MyBuildingOther,monthly; + + Output:Meter:MeterFileOnly,MyBuildingOther,runperiod; + +! The following custom meters are set up to illustrate the capabilities +! of custom meters. +! Custom Meter "MyGeneralLights" duplicates the InteriorLights:Electricity meter. +! Custom Meter "MyBuildingElectric" duplicates the Electricity:Building meter (by specifying that meter). +! Custom Meter (Decrement) "MyBuildingOther" uses Electricity:Building as its source meter +! and subtracts out the values for MyGeneralLights (aka InteriorLights:Electricity). The +! resultant value for MyBuildingOther should be equal to the value for the meters +! Electricity:Building - InteriorLights:Electricity (aka MyGeneralLights) + + Meter:Custom, + MyGeneralLights, !- Name + Electricity, !- Fuel Type + SPACE1-1 Lights 1, !- Key Name 1 + Lights Electric Energy, !- Output Variable or Meter Name 1 + SPACE2-1 Lights 1, !- Key Name 2 + Lights Electric Energy, !- Output Variable or Meter Name 2 + SPACE3-1 Lights 1, !- Key Name 3 + Lights Electric Energy, !- Output Variable or Meter Name 3 + SPACE4-1 Lights 1, !- Key Name 4 + Lights Electric Energy, !- Output Variable or Meter Name 4 + SPACE5-1 Lights 1, !- Key Name 5 + Lights Electric Energy; !- Output Variable or Meter Name 5 + + Meter:Custom, + MyBuildingElectric, !- Name + Electricity, !- Fuel Type + , !- Key Name 1 + Electricity:Building; !- Output Variable or Meter Name 1 + + Meter:CustomDecrement, + MyBuildingOther, !- Name + Electricity, !- Fuel Type + Electricity:Building, !- Source Meter Name + , !- Key Name 1 + MyGeneralLights; !- Output Variable or Meter Name 1 + + Output:Surfaces:Drawing,VRML; + + OutputControl:Table:Style, + HTML; !- Column Separator + + Output:Table:SummaryReports, + AllSummary, !- Report 1 Name + ZoneComponentLoadSummary;!- Report 2 Name + + Output:Surfaces:List,Details; + Output:Surfaces:List,ViewFactorInfo; + Output:Surfaces:List,ViewFactorInfo,idf; + Output:Surfaces:Drawing,dxf; + + Output:Variable,*,Surface Outside Face Temperature,Hourly; + + Output:Variable,*,Surface Inside Face Temperature,Hourly; + + Output:Variable,*,Surface Inside Face Solar Radiation Heat Gain Energy,hourly; + + Output:Variable,*,Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy,hourly; + + Output:Variable,*,Daylighting Reference Point 1 Illuminance,hourly; !- Zone Average [lux] + Output:Variable,*,Daylighting Reference Point 1 Daylight Illuminance Setpoint Exceeded Time,hourly; !- Zone Sum [hr] + Output:Variable,*,Daylighting Reference Point 1 Glare Index,hourly; !- Zone Average [] + Output:Variable,*,Daylighting Reference Point 1 Glare Index Setpoint Exceeded Time,hourly; !- Zone Sum [hr] + Output:Variable,*,Daylighting Lighting Power Multiplier,hourly; !- Zone Average [] + Output:Variable,*,Daylighting Window Reference Point Illuminance,hourly; !- Zone Average [lux] + Output:Variable,*,Daylighting Window Reference Point View Luminance,hourly; !- Zone Average [cd/m2] + + Meter:Custom, + Total Building Inside Face Solar Radiation Heat Gain Energy, !- Name + Generic, !- Fuel Type + WALL-1PF, !- Key Name 1 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 1 + WALL-1PR, !- Key Name 2 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 2 + WALL-1PB, !- Key Name 3 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 3 + WALL-1PL, !- Key Name 4 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 4 + C1-1P, !- Key Name 5 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 5 + C2-1P, !- Key Name 6 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 6 + C3-1P, !- Key Name 7 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 7 + C4-1P, !- Key Name 8 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 8 + C5-1P, !- Key Name 9 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 9 + TOP-1, !- Key Name 10 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 10 + FRONT-1, !- Key Name 11 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 11 + SB12, !- Key Name 14 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 14 + F1-1, !- Key Name 15 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 15 + C1-1, !- Key Name 16 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 16 + RIGHT-1, !- Key Name 17 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 17 + SB21, !- Key Name 20 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 20 + SB23, !- Key Name 20 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 20 + SB25, !- Key Name 20 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 20 + F2-1, !- Key Name 21 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 21 + C2-1, !- Key Name 22 + Surface Inside Face Solar Radiation Heat Gain Energy, !- Output Variable or Meter Name 22 + BACK-1, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + F3-1, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + C3-1, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + LEFT-1, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + SB32, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + SB34, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + SB35, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + F4-1, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + C4-1, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + SB43, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + SB52, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + SB53, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + F5-1, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy, !- Extended Field + C5-1, !- Extended Field + Surface Inside Face Solar Radiation Heat Gain Energy; !- Extended Field + + Meter:Custom, + Total Building Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Name + Generic, !- Fuel Type + WALL-1PF, !- Key Name 1 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 1 + WALL-1PR, !- Key Name 2 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 2 + WALL-1PB, !- Key Name 3 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 3 + WALL-1PL, !- Key Name 4 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 4 + C1-1P, !- Key Name 5 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 5 + C2-1P, !- Key Name 6 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 6 + C3-1P, !- Key Name 7 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 7 + C4-1P, !- Key Name 8 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 8 + C5-1P, !- Key Name 9 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 9 + TOP-1, !- Key Name 10 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 10 + FRONT-1, !- Key Name 11 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 11 + WF-1, !- Key Name 12 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 12 + DF-1, !- Key Name 13 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 13 + SB12, !- Key Name 16 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 16 + F1-1, !- Key Name 17 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 17 + C1-1, !- Key Name 18 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 18 + RIGHT-1, !- Key Name 19 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 19 + WR-1, !- Key Name 20 + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Output Variable or Meter Name 20 + SB21, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + SB23, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + SB25, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + F2-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + C2-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + BACK-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + WB-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + DB-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + F3-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + C3-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + LEFT-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + WL-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + SB32, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + SB34, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + SB35, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + F4-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + C4-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + SB43, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + SB52, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + SB53, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + F5-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy, !- Extended Field + C5-1, !- Extended Field + Surface Inside Face Net Surface Thermal Radiation Heat Gain Energy; !- Extended Field + + Output:Meter,Total Building Inside Face Solar Radiation Heat Gain Energy,hourly; + + OUtput:Meter,Total Building Inside Face Net Surface Thermal Radiation Heat Gain Energy,hourly; + + Output:Table:Monthly, + Building Gain Totals, !- Name + 2, !- Digits After Decimal + TOTAL BUILDING INSIDE FACE SOLAR RADIATION HEAT GAIN ENERGY, !- Variable or Meter 1 Name + SumOrAverage, !- Aggregation Type for Variable or Meter 1 + TOTAL BUILDING INSIDE FACE NET SURFACE THERMAL RADIATION HEAT GAIN ENERGY, !- Variable or Meter 2 Name + SumOrAverage; !- Aggregation Type for Variable or Meter 2 + + Output:Diagnostics, + DisplayExtraWarnings; !- Key 1 + diff --git a/testfiles/CMakeLists.txt b/testfiles/CMakeLists.txt index 1f4191df0a5..94947f1ee9e 100644 --- a/testfiles/CMakeLists.txt +++ b/testfiles/CMakeLists.txt @@ -41,6 +41,7 @@ ADD_SIMULATION_TEST(IDF_FILE 5ZoneAirCooledDemandLimiting_ReductionRatioVentilat ADD_SIMULATION_TEST(IDF_FILE 5ZoneAirCooledWithCoupledInGradeSlab.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) ADD_SIMULATION_TEST(IDF_FILE 5ZoneAirCooledWithDOASAirLoop.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) ADD_SIMULATION_TEST(IDF_FILE 5ZoneAirCooled_AirBoundaries.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) +ADD_SIMULATION_TEST(IDF_FILE 5ZoneAirCooled_AirBoundaries_Daylighting.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) ADD_SIMULATION_TEST(IDF_FILE 5ZoneAirCooled_UniformLoading.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) ADD_SIMULATION_TEST(IDF_FILE 5ZoneAirCooled_VRPSizing.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) ADD_SIMULATION_TEST(IDF_FILE 5ZoneAirCooled_VRPSizing_MaxZd.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) From 71d9da1476749c5d3d5b8befef6e1b6fff86d252 Mon Sep 17 00:00:00 2001 From: mjwitte Date: Sat, 24 Aug 2019 15:18:41 -0500 Subject: [PATCH 026/136] Air boundary - unit test cleanup --- tst/EnergyPlus/unit/DaylightingManager.unit.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tst/EnergyPlus/unit/DaylightingManager.unit.cc b/tst/EnergyPlus/unit/DaylightingManager.unit.cc index b2c6224e337..9c3c080869d 100644 --- a/tst/EnergyPlus/unit/DaylightingManager.unit.cc +++ b/tst/EnergyPlus/unit/DaylightingManager.unit.cc @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -825,6 +826,7 @@ TEST_F(EnergyPlusFixture, DaylightingManager_GetDaylParamInGeoTrans_Test) SurfaceGeometry::SetupZoneGeometry(foundErrors); // this calls GetSurfaceData() EXPECT_FALSE(foundErrors); // expect no errors + HeatBalanceIntRadExchange::InitSolarViewFactors(); DataGlobals::NumOfTimeStepInHour = 1; // must initialize this to get schedules initialized DataGlobals::MinutesPerTimeStep = 60; // must initialize this to get schedules initialized @@ -1324,6 +1326,8 @@ TEST_F(EnergyPlusFixture, DaylightingManager_DayltgInteriorIllum_Test) SurfaceGeometry::SetupZoneGeometry(foundErrors); // this calls GetSurfaceData() EXPECT_FALSE(foundErrors); // expect no errors + HeatBalanceIntRadExchange::InitSolarViewFactors(); + int ZoneNum = UtilityRoutines::FindItemInList("EAST ZONE", DataHeatBalance::Zone); InternalHeatGains::GetInternalHeatGainsInput(); InternalHeatGains::GetInternalHeatGainsInputFlag = false; From df76cdd8e2ff3250b5e0618d3d288937b2fdcc7f Mon Sep 17 00:00:00 2001 From: mjwitte Date: Sat, 24 Aug 2019 16:56:18 -0500 Subject: [PATCH 027/136] Air boundary - fix build warnings --- src/EnergyPlus/DaylightingManager.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 8c97188dc35..3a88406b82e 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -317,7 +317,6 @@ namespace DaylightingManager { Real64 AREA; // Inside surface area (m2) Real64 AInsTot; // Total inside surface area of a zone (m2) Real64 ARHTOT; // Sum over surfaces of AREA*(inside visible reflectance) (m2) - int IWin; // Window number int ITILT; // Surface tilt category (1 = floor, 2 = wall, 3 = ceiling) int IT; // Tilt index static Vector3 AR; // Inside surface area sum for floor/wall/ceiling (m2) @@ -328,7 +327,6 @@ namespace DaylightingManager { // a selected floor/wall/ceiling (m2) Real64 ATWL; // Opaque surface area (m2) Real64 ARHTWL; // ATWL times inside visible reflectance of surface (m2) - int IWinDr; // Window/door surface number Real64 ETA; // Ratio of floor-to-window-center height and average floor-to-ceiling height // Total inside surface area, including windows From ac2ab83a5e4f4ae624af35b0cddeb018ff71f20c Mon Sep 17 00:00:00 2001 From: mjwitte Date: Mon, 26 Aug 2019 18:31:07 -0500 Subject: [PATCH 028/136] Air boundary - more daylighting work --- src/EnergyPlus/DaylightingManager.cc | 101 ++++++++++----------------- 1 file changed, 35 insertions(+), 66 deletions(-) diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 3a88406b82e..8dd52a3d8a6 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -733,7 +733,7 @@ namespace DaylightingManager { IWin = ZoneDaylight(ZoneNum).DayltgExtWinSurfNums(loop); // For this report, do not include ext wins in zone adjacent to ZoneNum since the inter-reflected // component will not be calculated for these windows until the time-step loop. - if (Surface(IWin).Zone == ZoneNum) { + if (Surface(IWin).SolarEnclIndex == Zone(ZoneNum).SolarEnclosureNum) { // clear sky DaylFac1 = ZoneDaylight(ZoneNum).DaylIllFacSky(12, 1, 1, 1, loop); DaylFac2 = 0.0; @@ -827,9 +827,9 @@ namespace DaylightingManager { for (loop = 1; loop <= ZoneDaylight(ZoneNum).NumOfDayltgExtWins; ++loop) { IWin = ZoneDaylight(ZoneNum).DayltgExtWinSurfNums(loop); - // For this report, do not include ext wins in zone adjacent to ZoneNum since the inter-reflected + // For this report, do not include ext wins in zone/enclosure adjacent to ZoneNum since the inter-reflected // component will not be calculated for these windows until the time-step loop. - if (Surface(IWin).Zone == ZoneNum) { + if (Surface(IWin).SolarEnclIndex == Zone(ZoneNum).SolarEnclosureNum) { if (SurfaceWindow(IWin).MovableSlats) { // variable slat angle - MaxSlatangle sets @@ -1842,7 +1842,6 @@ namespace DaylightingManager { // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int ZoneNumThisWin; // A window's zone number int ShelfNum; // Daylighting shelf object number static Vector3 W1; // First vertex of window (where vertices are numbered @@ -1897,8 +1896,7 @@ namespace DaylightingManager { IllumMapCalc(MapNum).SolidAngAtMapPt(loopwin, iRefPoint) = 0.0; IllumMapCalc(MapNum).SolidAngAtMapPtWtd(loopwin, iRefPoint) = 0.0; } - ZoneNumThisWin = Surface(Surface(IWin).BaseSurf).Zone; - if (ZoneNumThisWin == ZoneNum) { + if (Surface(Surface(IWin).BaseSurf).SolarEnclIndex == Zone(ZoneNum).SolarEnclosureNum) { ExtWinType = InZoneExtWin; } else { ExtWinType = AdjZoneExtWin; @@ -4093,7 +4091,7 @@ namespace DaylightingManager { // Interior window visible transmittance multiplier for exterior window in adjacent zone TVisIntWinMult = 1.0; TVisIntWinDiskMult = 1.0; - if (Surface(IWin).Zone != ZoneNum) { + if (Surface(IWin).SolarEnclIndex != Zone(ZoneNum).SolarEnclosureNum) { TVisIntWinMult = TVISIntWin; TVisIntWinDiskMult = TVISIntWinDisk; } @@ -5602,48 +5600,20 @@ namespace DaylightingManager { for (PipeNum = 1; PipeNum <= NumOfTDDPipes; ++PipeNum) { SurfNum = TDDPipe(PipeNum).Diffuser; if (SurfNum > 0) { - if (ZoneDaylight(Surface(SurfNum).Zone).DaylightMethod == NoDaylighting) { + bool daylightControlFound = false; + for (int const zoneNum : DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNum).SolarEnclSurfIndex).ZoneNums) { + if (ZoneDaylight(Surface(SurfNum).Zone).DaylightMethod != NoDaylighting) { + daylightControlFound = true; + } + } + if (!daylightControlFound) { ShowSevereError("DaylightingDevice:Tubular = " + TDDPipe(PipeNum).Name + ": is not connected to a Zone that has Daylighting. "); - ShowContinueError("Add Daylighting:Controls to Zone named: " + Zone(Surface(SurfNum).Zone).Name); - ShowContinueError("A sufficient control is provided on the .dbg file."); - ErrorsFound = true; - if (CheckTDDZone(Surface(SurfNum).Zone)) { - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " ! Following control is to allow tubular reporting in this Zone"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << "Daylighting:Controls, !- this control controls 0% of zone."; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " " + Zone(Surface(SurfNum).Zone).Name + ", !- Zone Name"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 1, !- Total Daylighting Reference Points"; - if (DaylRefWorldCoordSystem) { - // world coordinates, use zone origin for ref pt - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " " + RoundSigDigits(Zone(Surface(SurfNum).Zone).OriginX, 2) + - ", !- X-Coordinate of First Reference Point {m}"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " " + RoundSigDigits(Zone(Surface(SurfNum).Zone).OriginY, 2) + - ", !- Y-Coordinate of First Reference Point {m}"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " " + RoundSigDigits(Zone(Surface(SurfNum).Zone).OriginZ, 2) + - ", !- Z-Coordinate of First Reference Point {m}"; - } else { - // relative coordinates, use 0,0,0 for ref pt - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0.0, !- X-Coordinate of First Reference Point {m}"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0.0, !- Y-Coordinate of First Reference Point {m}"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0.0, !- Z-Coordinate of First Reference Point {m}"; - } - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " , !- X-Coordinate of Second Reference Point"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " , !- Y-Coordinate of Second Reference Point"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " , !- Z-Coordinate of Second Reference Point"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0.0, !- Fraction of Zone Controlled by First Reference Point"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0.0, !- Fraction of Zone Controlled by Second Reference Point"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0.0, !- Illuminance Setpoint at First Reference Point"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0.0, !- Illuminance Setpoint at Second Reference Point"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 3, !- Lighting Control Type"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) - << " 0.0, !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone y-Axis"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " , !- Maximum Allowable Discomfort Glare Index"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0.0, !- Minimum Input Power Fraction for Continuous Dimming Control"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0.0, !- Minimum Light Output Fraction for Continuous Dimming Control"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0, !- Number of Stepped Control Steps"; - ObjexxFCL::gio::write(OutputFileDebug, fmtA) << " 0.0; !- Probability Lighting will be Reset When Needed in Manual Stepped Control"; - - CheckTDDZone(Surface(SurfNum).Zone) = false; + ShowContinueError("Add Daylighting:Controls one of the following zones in the same enclosure: "); + for (int const zoneNum : DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNum).SolarEnclSurfIndex).ZoneNums) { + ShowContinueError(Zone(zoneNum).Name); } + ErrorsFound = true; + CheckTDDZone(Surface(SurfNum).Zone) = false; } } else { // SurfNum == 0 @@ -6172,7 +6142,7 @@ namespace DaylightingManager { Real64 const d12(distance(R1, R2)); // Distance between R1 and R2 auto const &window(Surface(IWin)); - auto const window_Zone(window.Zone); + auto const window_Enclosure(window.SolarEnclIndex); auto const window_iBaseSurf(window.BaseSurf); auto const &window_base(window_iBaseSurf > 0 ? Surface(window_iBaseSurf) : window); auto const window_base_iExtBoundCond(window_base.ExtBoundCond); @@ -6184,7 +6154,7 @@ namespace DaylightingManager { auto const &surface(Surface(ISurf)); IType = surface.Class; if ((surface.ShadowingSurf) || // Shadowing surface - ((surface.Zone == window_Zone) && // Wall/ceiling/floor is in same zone as window + ((surface.SolarEnclIndex == window_Enclosure) && // Wall/ceiling/floor is in same zone as window (IType == SurfaceClass_Wall || IType == SurfaceClass_Roof || IType == SurfaceClass_Floor) && (ISurf != window_iBaseSurf) && (ISurf != window_base_iExtBoundCond))) // Exclude window's base or base-adjacent surfaces { @@ -6203,7 +6173,7 @@ namespace DaylightingManager { auto surfaceHit = [=, &R1, &hit](SurfaceData const &surface) -> bool { auto const sClass(surface.Class); if ((surface.ShadowingSurf) || // Shadowing surface - ((surface.Zone == window_Zone) && // Surface is in same zone as window + ((surface.SolarEnclIndex == window_Enclosure) && // Surface is in same zone as window (sClass == SurfaceClass_Wall || sClass == SurfaceClass_Roof || sClass == SurfaceClass_Floor) && // Wall, ceiling/roof, or floor (&surface != window_base_p) && (&surface != window_base_adjacent_p))) // Exclude window's base or base-adjacent surfaces { @@ -6255,7 +6225,7 @@ namespace DaylightingManager { auto const window1_base_iExtBoundCond(window1_base.ExtBoundCond); auto const &window2(Surface(IWin2)); - auto const window2_Zone(window2.Zone); + auto const window2_Enclosure(window2.SolarEnclIndex); auto const window2_iBaseSurf(window2.BaseSurf); auto const &window2_base(window2_iBaseSurf > 0 ? Surface(window2_iBaseSurf) : window2); auto const window2_base_iExtBoundCond(window2_base.ExtBoundCond); @@ -6271,7 +6241,7 @@ namespace DaylightingManager { auto const &surface(Surface(ISurf)); IType = surface.Class; if ((surface.ShadowingSurf) || // Shadowing surface - ((surface.Zone == window2_Zone) && // Wall/ceiling/floor is in same zone as windows + ((surface.SolarEnclIndex == window2_Enclosure) && // Wall/ceiling/floor is in same zone as windows (IType == SurfaceClass_Wall || IType == SurfaceClass_Roof || IType == SurfaceClass_Floor) && // Wall, ceiling/roof, or floor (ISurf != window1_iBaseSurf) && (ISurf != window2_iBaseSurf) && // Exclude windows' base surfaces (ISurf != window1_base_iExtBoundCond) && (ISurf != window2_base_iExtBoundCond))) // Exclude windows' base-adjacent surfaces @@ -6295,7 +6265,7 @@ namespace DaylightingManager { auto surfaceHit = [=, &R1, &hit](SurfaceData const &surface) -> bool { auto const sClass(surface.Class); if ((surface.ShadowingSurf) || // Shadowing surface - ((surface.Zone == window2_Zone) && // Surface is in same zone as window + ((surface.SolarEnclIndex == window2_Enclosure) && // Surface is in same zone as window (sClass == SurfaceClass_Wall || sClass == SurfaceClass_Roof || sClass == SurfaceClass_Floor) && // Wall, ceiling/roof, or floor (&surface != window1_base_p) && (&surface != window2_base_p) && // Exclude windows' base surfaces (&surface != window1_base_adjacent_p) && (&surface != window2_base_adjacent_p))) // Exclude windows' base-adjacent surfaces @@ -7254,10 +7224,10 @@ namespace DaylightingManager { // Loop again over windows and reset remaining shading flags that // are 10 or higher (i.e., conditionally off) to off - for (IWin = Zone(ZoneNum).SurfaceFirst; IWin <= Zone(ZoneNum).SurfaceLast; ++IWin) { - if (Surface(IWin).Class != SurfaceClass_Window) continue; - if (Surface(IWin).ExtBoundCond != ExternalEnvironment) continue; - if (SurfaceWindow(IWin).ShadingFlag >= 10) SurfaceWindow(IWin).ShadingFlag = ShadeOff; + for (loop = 1; loop <= ZoneDaylight(ZoneNum).NumOfDayltgExtWins; ++loop) { + if (Surface(loop).Class != SurfaceClass_Window) continue; + if (Surface(loop).ExtBoundCond != ExternalEnvironment) continue; + if (SurfaceWindow(loop).ShadingFlag >= 10) SurfaceWindow(loop).ShadingFlag = ShadeOff; } // Variables for reporting @@ -7827,11 +7797,9 @@ namespace DaylightingManager { Real64 COSBintWin; ZoneNumThisWin = Surface(Surface(IWin).BaseSurf).Zone; - int thisWinEnclNum = Surface(Surface(IWin).BaseSurf).SolarEnclIndex; - int thisZoneEnclNum = Zone(ZoneNum).SolarEnclosureNum; // The inside surface area, ZoneDaylight(ZoneNum)%TotInsSurfArea was calculated in subr DayltgAveInteriorReflectance - if (thisWinEnclNum == thisZoneEnclNum) { + if (Surface(Surface(IWin).BaseSurf).SolarEnclIndex == Zone(ZoneNum).SolarEnclosureNum) { ExtWinType = InZoneExtWin; ZoneInsideSurfArea = ZoneDaylight(ZoneNum).TotInsSurfArea; IntWinAdjZoneExtWinNum = 0; @@ -10469,7 +10437,7 @@ namespace DaylightingManager { int NumList = 0; if (ZoneDaylight(ZoneNum).TotalDaylRefPoints == 0) continue; // This is a Daylighting:Detailed zone - // Find adjacent zones + // Find adjacent zones/enclosures int const thisZoneEnclNum = Zone(ZoneNum).SolarEnclosureNum; for (int adjEnclNum = 1; adjEnclNum <= DataViewFactorInformation::NumOfSolarEnclosures; ++adjEnclNum) { if (adjEnclNum == thisZoneEnclNum) continue; @@ -10487,7 +10455,7 @@ namespace DaylightingManager { for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond >= 1) { // This is an interior window in ZoneNumAdj - if (Surface(Surface(SurfNumAdj).ExtBoundCond).Zone == ZoneNum) { + if (Surface(Surface(SurfNumAdj).ExtBoundCond).SolarEnclIndex == thisZoneEnclNum) { // This interior window is adjacent to ZoneNum ++NumList; break; @@ -10523,7 +10491,7 @@ namespace DaylightingManager { for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { if (Surface(SurfNumAdj).Class == SurfaceClass_Window && Surface(SurfNumAdj).ExtBoundCond >= 1) { // This is an interior window in ZoneNumAdj - if (Surface(Surface(SurfNumAdj).ExtBoundCond).Zone == ZoneNum) { + if (Surface(Surface(SurfNumAdj).ExtBoundCond).SolarEnclIndex == thisZoneEnclNum) { // This interior window is adjacent to ZoneNum ++NumList; ZoneDaylight(ZoneNum).AdjIntWinZoneNums(NumList) = ZoneNumAdj; @@ -10544,6 +10512,7 @@ namespace DaylightingManager { ZoneDaylight(ZoneNum).NumOfIntWinAdjZoneExtWins = 0; continue; } + int const thisZoneEnclNum = Zone(ZoneNum).SolarEnclosureNum; for (int ZoneAdjLoop = 1; ZoneAdjLoop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++ZoneAdjLoop) { int ZoneNumAdj = ZoneDaylight(ZoneNum).AdjIntWinZoneNums(ZoneAdjLoop); for (int SurfNumAdj = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj) { @@ -10569,7 +10538,7 @@ namespace DaylightingManager { for (int SurfNumAdj2 = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj2 <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj2) { if (Surface(SurfNumAdj2).Class == SurfaceClass_Window && Surface(SurfNumAdj2).ExtBoundCond >= 1) { // This is an interior window in ZoneNumAdj - if (Surface(Surface(SurfNumAdj2).ExtBoundCond).Zone == ZoneNum) { + if (Surface(Surface(SurfNumAdj2).ExtBoundCond).SolarEnclIndex == thisZoneEnclNum) { // This interior window is adjacent to ZoneNum and associated with this ++NumOfIntWindowsCount; } @@ -10582,7 +10551,7 @@ namespace DaylightingManager { for (int SurfNumAdj2 = Zone(ZoneNumAdj).SurfaceFirst; SurfNumAdj2 <= Zone(ZoneNumAdj).SurfaceLast; ++SurfNumAdj2) { if (Surface(SurfNumAdj2).Class == SurfaceClass_Window && Surface(SurfNumAdj2).ExtBoundCond >= 1) { // This is an interior window in ZoneNumAdj - if (Surface(Surface(SurfNumAdj2).ExtBoundCond).Zone == ZoneNum) { + if (Surface(Surface(SurfNumAdj2).ExtBoundCond).SolarEnclIndex == thisZoneEnclNum) { // This interior window is adjacent to ZoneNum and associated with this ++IntWinIndex; ZoneDaylight(ZoneNum).IntWinAdjZoneExtWin(ExtWinIndex).IntWinNum(IntWinIndex) = SurfNumAdj2; @@ -10955,7 +10924,7 @@ namespace DaylightingManager { ZoneNumAdj = Surface(Surface(IWin).ExtBoundCond).Zone; IntWinNextToIntWinAdjZone = false; for (loop = 1; loop <= ZoneDaylight(ZoneNum).NumOfIntWinAdjZones; ++loop) { - if (ZoneNumAdj == ZoneDaylight(ZoneNum).AdjIntWinZoneNums(loop)) { + if (Zone(ZoneNumAdj).SolarEnclosureNum == Zone(ZoneDaylight(ZoneNum).AdjIntWinZoneNums(loop)).SolarEnclosureNum) { IntWinNextToIntWinAdjZone = true; break; } From dba42d3c102f10632cfdcb5468f030727f95e56d Mon Sep 17 00:00:00 2001 From: mjwitte Date: Mon, 26 Aug 2019 20:04:25 -0500 Subject: [PATCH 029/136] Air boundary - fix daylighting build warning --- src/EnergyPlus/DaylightingManager.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 8dd52a3d8a6..9c205daefcd 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -5602,15 +5602,15 @@ namespace DaylightingManager { if (SurfNum > 0) { bool daylightControlFound = false; for (int const zoneNum : DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNum).SolarEnclSurfIndex).ZoneNums) { - if (ZoneDaylight(Surface(SurfNum).Zone).DaylightMethod != NoDaylighting) { + if (ZoneDaylight(zoneNum).DaylightMethod != NoDaylighting) { daylightControlFound = true; } } if (!daylightControlFound) { ShowSevereError("DaylightingDevice:Tubular = " + TDDPipe(PipeNum).Name + ": is not connected to a Zone that has Daylighting. "); ShowContinueError("Add Daylighting:Controls one of the following zones in the same enclosure: "); - for (int const zoneNum : DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNum).SolarEnclSurfIndex).ZoneNums) { - ShowContinueError(Zone(zoneNum).Name); + for (int const zoneNum2 : DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNum).SolarEnclSurfIndex).ZoneNums) { + ShowContinueError(Zone(zoneNum2).Name); } ErrorsFound = true; CheckTDDZone(Surface(SurfNum).Zone) = false; From cf7f66c5b207b564b0fe1ec10e0ebe3a048ff3de Mon Sep 17 00:00:00 2001 From: mjwitte Date: Mon, 26 Aug 2019 20:22:18 -0500 Subject: [PATCH 030/136] Air boundary - revert potentially diff-causing change to window shading --- src/EnergyPlus/DaylightingManager.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 9c205daefcd..5cd1ced72a8 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -7224,10 +7224,10 @@ namespace DaylightingManager { // Loop again over windows and reset remaining shading flags that // are 10 or higher (i.e., conditionally off) to off - for (loop = 1; loop <= ZoneDaylight(ZoneNum).NumOfDayltgExtWins; ++loop) { - if (Surface(loop).Class != SurfaceClass_Window) continue; - if (Surface(loop).ExtBoundCond != ExternalEnvironment) continue; - if (SurfaceWindow(loop).ShadingFlag >= 10) SurfaceWindow(loop).ShadingFlag = ShadeOff; + for (IWin = Zone(ZoneNum).SurfaceFirst; IWin <= Zone(ZoneNum).SurfaceLast; ++IWin) { + if (Surface(IWin).Class != SurfaceClass_Window) continue; + if (Surface(IWin).ExtBoundCond != ExternalEnvironment) continue; + if (SurfaceWindow(IWin).ShadingFlag >= 10) SurfaceWindow(IWin).ShadingFlag = ShadeOff; } // Variables for reporting From 72d8764c65f71144a9e8b3968959a109168bee52 Mon Sep 17 00:00:00 2001 From: mjwitte Date: Tue, 27 Aug 2019 07:25:11 -0500 Subject: [PATCH 031/136] Air boundary - fix TDD pipe error --- src/EnergyPlus/DaylightingManager.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index 5cd1ced72a8..42fc92d1ed0 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -5601,7 +5601,8 @@ namespace DaylightingManager { SurfNum = TDDPipe(PipeNum).Diffuser; if (SurfNum > 0) { bool daylightControlFound = false; - for (int const zoneNum : DataViewFactorInformation::ZoneSolarInfo(Surface(SurfNum).SolarEnclSurfIndex).ZoneNums) { + int const pipeEnclNum = Zone(Surface(SurfNum).Zone).SolarEnclosureNum; + for (int const zoneNum : DataViewFactorInformation::ZoneSolarInfo(pipeEnclNum).ZoneNums) { if (ZoneDaylight(zoneNum).DaylightMethod != NoDaylighting) { daylightControlFound = true; } From 65b01895c064376850b163c829ca232189e9b67e Mon Sep 17 00:00:00 2001 From: mjwitte Date: Tue, 27 Aug 2019 18:09:30 -0500 Subject: [PATCH 032/136] Air boundary - more unit tests --- src/EnergyPlus/SurfaceGeometry.cc | 6 - .../unit/HeatBalanceIntRadExchange.unit.cc | 163 ++++++- .../unit/HeatBalanceManager.unit.cc | 89 +++- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 420 ++++++++++++++++++ 4 files changed, 666 insertions(+), 12 deletions(-) diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 6fc1a4bbc42..4496e49f03f 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -12728,7 +12728,6 @@ namespace SurfaceGeometry { int enclosureNum = 0; if (std::any_of(Construct.begin(), Construct.end(), [](DataHeatBalance::ConstructionData const &e) { return e.TypeIsAirBoundary; })) { std::string RoutineName = "SetupSolarEnclosuresAndAirBoundaries"; - int errorCount = 0; for (int surfNum = 1; surfNum <= DataSurfaces::TotSurfaces; ++surfNum) { auto &surf(Surface(surfNum)); if (surf.Construction == 0) continue; @@ -12814,11 +12813,6 @@ namespace SurfaceGeometry { } } } - if (errorCount > 0) { - ShowSevereError(RoutineName + ": " + General::TrimSigDigits(errorCount) + - " surfaces use Construction:AirBoundary in non-interzone surfaces."); - ShowContinueError("For explicit details on each use, use Output:Diagnostics,DisplayExtraWarnings;"); - } } if (DataHeatBalance::AnyAirBoundaryGroupedSolar) { // All grouped solar zones have been assigned to an enclosure, now assign remaining zones diff --git a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc index 5603768dd69..141dede5875 100644 --- a/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceIntRadExchange.unit.cc @@ -308,8 +308,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest) }); ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound = false; - //auto numZones = inputProcessor->getNumObjectsFound("Zone"); - //DataHeatBalFanSys::ZoneReOrder.allocate(numZones); HeatBalanceManager::GetZoneData(ErrorsFound); EXPECT_FALSE(ErrorsFound); @@ -390,8 +388,6 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest2) }); ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound = false; - //auto numZones = inputProcessor->getNumObjectsFound("Zone"); - //DataHeatBalFanSys::ZoneReOrder.allocate(numZones); HeatBalanceManager::GetZoneData(ErrorsFound); EXPECT_FALSE(ErrorsFound); @@ -424,4 +420,163 @@ TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest2) EXPECT_EQ(DataViewFactorInformation::ZoneSolarInfo(3).Name, "Zone 3"); } +TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest3) +{ + + std::string const idf_objects = delimited_string({ + "Zone,", + "Zone 1; !- Name", + + "Zone,", + "Zone 2; !- Name", + + "Zone,", + "Zone 3; !- Name", + + "Zone,", + "Zone 4; !- Name", + + "Zone,", + "Zone 5; !- Name", + + "ZoneProperty:UserViewFactors:bySurfaceName,", + "Zone 3,", + "SB51,SB51,0.000000,", + "SB51,SB52,2.672021E-002,", + "SB51,SB53,8.311358E-002,", + "SB51,SB54,2.672021E-002;", + + "ZoneProperty:UserViewFactors:bySurfaceName,", + "Perimeter Zones,", + "SB51,SB51,0.000000,", + "SB51,SB52,2.672021E-002,", + "SB51,SB53,8.311358E-002,", + "SB51,SB54,2.672021E-002;", + + "ZoneList,", + "Perimeter Zones, !- Name", + "Zone 5, !- Zone 1 Name", + "Zone 2; !- Zone 2 Name", + + "ZoneProperty:UserViewFactors:bySurfaceName,", + "Zone 6,", + "SB51,SB51,0.000000,", + "SB51,SB52,2.672021E-002,", + "SB51,SB53,8.311358E-002,", + "SB51,SB54,2.672021E-002;", + }); + ASSERT_TRUE(process_idf(idf_objects)); + bool ErrorsFound = false; + HeatBalanceManager::GetZoneData(ErrorsFound); + EXPECT_FALSE(ErrorsFound); + + DataViewFactorInformation::NumOfSolarEnclosures = 3; + DataViewFactorInformation::ZoneSolarInfo.allocate(3); + DataViewFactorInformation::ZoneSolarInfo(1).Name = "Enclosure 1"; + DataViewFactorInformation::ZoneSolarInfo(1).ZoneNums.push_back(UtilityRoutines::FindItemInList( + UtilityRoutines::MakeUPPERCase("Zone 2"), DataHeatBalance::Zone, DataGlobals::NumOfZones)); + DataViewFactorInformation::ZoneSolarInfo(1).ZoneNums.push_back(UtilityRoutines::FindItemInList( + UtilityRoutines::MakeUPPERCase("Zone 1"), DataHeatBalance::Zone, DataGlobals::NumOfZones)); + DataViewFactorInformation::ZoneSolarInfo(2).Name = "Enclosure 2"; + DataViewFactorInformation::ZoneSolarInfo(2).ZoneNums.push_back(UtilityRoutines::FindItemInList( + UtilityRoutines::MakeUPPERCase("Zone 4"), DataHeatBalance::Zone, DataGlobals::NumOfZones)); + DataViewFactorInformation::ZoneSolarInfo(2).ZoneNums.push_back(UtilityRoutines::FindItemInList( + UtilityRoutines::MakeUPPERCase("Zone 5"), DataHeatBalance::Zone, DataGlobals::NumOfZones)); + DataViewFactorInformation::ZoneSolarInfo(3).Name = "Zone 3"; + DataViewFactorInformation::ZoneSolarInfo(3).ZoneNums.push_back(UtilityRoutines::FindItemInList( + UtilityRoutines::MakeUPPERCase("Zone 3"), DataHeatBalance::Zone, DataGlobals::NumOfZones)); + + ErrorsFound = false; + HeatBalanceIntRadExchange::AlignInputViewFactors("ZoneProperty:UserViewFactors:bySurfaceName", ErrorsFound); + EXPECT_TRUE(ErrorsFound); + std::string const error_string = delimited_string({ + " ** Severe ** AlignInputViewFactors: ZoneProperty:UserViewFactors:bySurfaceName=\"Perimeter Zones\" found a matching ZoneList, but did not find a matching radiant or solar enclosure with the same zones.", + " ** Severe ** AlignInputViewFactors: ZoneProperty:UserViewFactors:bySurfaceName=\"Zone 6\" did not find a matching radiant or solar enclosure name." + }); + EXPECT_TRUE(compare_err_stream(error_string, true)); + + EXPECT_EQ(DataViewFactorInformation::ZoneSolarInfo(1).Name, "Enclosure 1"); + EXPECT_EQ(DataViewFactorInformation::ZoneSolarInfo(2).Name, "Enclosure 2"); + EXPECT_EQ(DataViewFactorInformation::ZoneSolarInfo(3).Name, "Zone 3"); +} + +TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_AlignInputViewFactorsTest4) +{ + + std::string const idf_objects = delimited_string({ + "Zone,", + "Zone 1; !- Name", + + "Zone,", + "Zone 2; !- Name", + + "Zone,", + "Zone 3; !- Name", + + "Zone,", + "Zone 4; !- Name", + + "Zone,", + "Zone 5; !- Name", + + "ZoneProperty:UserViewFactors:bySurfaceName,", + "Zone 3,", + "SB51,SB51,0.000000,", + "SB51,SB52,2.672021E-002,", + "SB51,SB53,8.311358E-002,", + "SB51,SB54,2.672021E-002;", + + "ZoneProperty:UserViewFactors:bySurfaceName,", + "Perimeter Zones,", + "SB51,SB51,0.000000,", + "SB51,SB52,2.672021E-002,", + "SB51,SB53,8.311358E-002,", + "SB51,SB54,2.672021E-002;", + + "ZoneList,", + "Perimeter Zones, !- Name", + "Zone 5, !- Zone 1 Name", + "Zone 2; !- Zone 2 Name", + + "ZoneProperty:UserViewFactors:bySurfaceName,", + "Zone 6,", + "SB51,SB51,0.000000,", + "SB51,SB52,2.672021E-002,", + "SB51,SB53,8.311358E-002,", + "SB51,SB54,2.672021E-002;", + }); + ASSERT_TRUE(process_idf(idf_objects)); + bool ErrorsFound = false; + HeatBalanceManager::GetZoneData(ErrorsFound); + EXPECT_FALSE(ErrorsFound); + + DataViewFactorInformation::NumOfRadiantEnclosures = 3; + DataViewFactorInformation::ZoneRadiantInfo.allocate(3); + DataViewFactorInformation::ZoneRadiantInfo(1).Name = "Enclosure 1"; + DataViewFactorInformation::ZoneRadiantInfo(1).ZoneNums.push_back(UtilityRoutines::FindItemInList( + UtilityRoutines::MakeUPPERCase("Zone 2"), DataHeatBalance::Zone, DataGlobals::NumOfZones)); + DataViewFactorInformation::ZoneRadiantInfo(1).ZoneNums.push_back(UtilityRoutines::FindItemInList( + UtilityRoutines::MakeUPPERCase("Zone 5"), DataHeatBalance::Zone, DataGlobals::NumOfZones)); + DataViewFactorInformation::ZoneRadiantInfo(2).Name = "Enclosure 2"; + DataViewFactorInformation::ZoneRadiantInfo(2).ZoneNums.push_back(UtilityRoutines::FindItemInList( + UtilityRoutines::MakeUPPERCase("Zone 4"), DataHeatBalance::Zone, DataGlobals::NumOfZones)); + DataViewFactorInformation::ZoneRadiantInfo(2).ZoneNums.push_back(UtilityRoutines::FindItemInList( + UtilityRoutines::MakeUPPERCase("Zone 5"), DataHeatBalance::Zone, DataGlobals::NumOfZones)); + DataViewFactorInformation::ZoneRadiantInfo(3).Name = "Zone 3"; + DataViewFactorInformation::ZoneRadiantInfo(3).ZoneNums.push_back(UtilityRoutines::FindItemInList( + UtilityRoutines::MakeUPPERCase("Zone 3"), DataHeatBalance::Zone, DataGlobals::NumOfZones)); + + ErrorsFound = false; + HeatBalanceIntRadExchange::AlignInputViewFactors("ZoneProperty:UserViewFactors:bySurfaceName", ErrorsFound); + EXPECT_TRUE(ErrorsFound); + std::string const error_string = delimited_string({ + " ** Severe ** AlignInputViewFactors: ZoneProperty:UserViewFactors:bySurfaceName=\"Zone 6\" did not find a matching radiant or solar enclosure name." + }); + EXPECT_TRUE(compare_err_stream(error_string, true)); + + EXPECT_EQ(DataViewFactorInformation::ZoneRadiantInfo(1).Name, "Perimeter Zones"); + EXPECT_EQ(DataViewFactorInformation::ZoneRadiantInfo(2).Name, "Enclosure 2"); + EXPECT_EQ(DataViewFactorInformation::ZoneRadiantInfo(3).Name, "Zone 3"); +} + } // namespace EnergyPlus diff --git a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc index 127282d65db..622c56b4b70 100644 --- a/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc +++ b/tst/EnergyPlus/unit/HeatBalanceManager.unit.cc @@ -1788,13 +1788,24 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData) "IRTSurface, !- Radiant Exchange Method", "SimpleMixing, !- Air Exchange Method", ", !- Simple Mixing Air Changes per Hour {1 / hr}", - "; !- Simple Mixing Schedule Name" + "; !- Simple Mixing Schedule Name", + + "Construction:AirBoundary,", + "Air Boundary with Good Mixing Schedule, !- Name", + "InteriorWindow, !- Solar and Daylighting Method", + "IRTSurface, !- Radiant Exchange Method", + "SimpleMixing, !- Air Exchange Method", + "0.4, !- Simple Mixing Air Changes per Hour {1 / hr}", + "Always2; !- Simple Mixing Schedule Name", + + "Schedule:Constant,Always2,,2.0;", }); ASSERT_TRUE(process_idf(idf_objects)); bool ErrorsFound(false); + ProcessScheduleInput(); // call get material data to auto-generate IRTSurface material ErrorsFound = false; @@ -1818,7 +1829,8 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData) ErrorsFound = false; GetConstructData(ErrorsFound); EXPECT_FALSE(ErrorsFound); - EXPECT_EQ(DataHeatBalance::TotConstructs, 2); + + EXPECT_EQ(DataHeatBalance::TotConstructs, 3); int constrNum = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Non-Grouped Air Boundary"), DataHeatBalance::Construct); EXPECT_TRUE(UtilityRoutines::SameString(DataHeatBalance::Construct(constrNum).Name, "Non-Grouped Air Boundary")); @@ -1848,6 +1860,79 @@ TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData) EXPECT_EQ(DataHeatBalance::Construct(constrNum).AirBoundaryACH, 0.0); // Not processed for GroupedZone mixing option EXPECT_EQ(DataHeatBalance::Construct(constrNum).AirBoundaryMixingSched, 0); EXPECT_EQ(DataHeatBalance::NominalRforNominalUCalculation(constrNum), 0.0); + + constrNum = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Air Boundary with Good Mixing Schedule"), DataHeatBalance::Construct); + EXPECT_TRUE(UtilityRoutines::SameString(DataHeatBalance::Construct(constrNum).Name, "Air Boundary with Good Mixing Schedule")); + EXPECT_TRUE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundary); + EXPECT_FALSE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundaryGroupedRadiant); + EXPECT_FALSE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundarySolar); + EXPECT_TRUE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundaryInteriorWindow); + EXPECT_TRUE(DataHeatBalance::Construct(constrNum).IsUsedCTF); + EXPECT_TRUE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundaryIRTSurface); + EXPECT_TRUE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundaryMixing); + EXPECT_EQ(DataHeatBalance::Construct(constrNum).TotLayers, 1); + EXPECT_TRUE(UtilityRoutines::SameString(DataHeatBalance::Material(DataHeatBalance::Construct(constrNum).LayerPoint(1)).Name, "~AirBoundary-IRTMaterial")); + EXPECT_EQ(DataHeatBalance::Construct(constrNum).AirBoundaryACH, 0.4); + EXPECT_EQ(DataHeatBalance::Construct(constrNum).AirBoundaryMixingSched, 1); + EXPECT_EQ(DataHeatBalance::NominalRforNominalUCalculation(constrNum), 0.01); + +} + +TEST_F(EnergyPlusFixture, HeatBalanceManager_GetAirBoundaryConstructData2) +{ + + std::string const idf_objects = delimited_string({ + + "Construction:AirBoundary,", + "Air Boundary with Bad Mixing Schedule, !- Name", + "GroupedZones, !- Solar and Daylighting Method", + "GroupedZones, !- Radiant Exchange Method", + "SimpleMixing, !- Air Exchange Method", + "0.1, !- Simple Mixing Air Changes per Hour {1 / hr}", + "xyz; !- Simple Mixing Schedule Name", + + "Schedule:Constant,Always2,,2.0;", + + }); + + ASSERT_TRUE(process_idf(idf_objects)); + + bool ErrorsFound(false); + ProcessScheduleInput(); + + // skip call to get material data since this doesn't use IRT + ErrorsFound = false; + EXPECT_EQ(DataHeatBalance::TotMaterials, 0); + + // get constructions + ErrorsFound = false; + GetConstructData(ErrorsFound); + EXPECT_TRUE(ErrorsFound); + + std::string const error_string = delimited_string({ + " ** Severe ** CreateAirBoundaryConstructionsConstruction:AirBoundary=\"AIR BOUNDARY WITH BAD MIXING SCHEDULE\", invalid (not found) Simple Mixing Schedule Name=\"xyz\".", + " ** Severe ** Errors found in creating the constructions defined with Construction:AirBoundary.", + " ** Warning ** This building has no thermal mass which can cause an unstable solution.", + " ** ~~~ ** Use Material object for all opaque material definitions except very light insulation layers." + }); + EXPECT_TRUE(compare_err_stream(error_string, true)); + + EXPECT_EQ(DataHeatBalance::TotConstructs, 1); + + int constrNum = UtilityRoutines::FindItemInList(UtilityRoutines::MakeUPPERCase("Air Boundary with Bad Mixing Schedule"), DataHeatBalance::Construct); + EXPECT_TRUE(UtilityRoutines::SameString(DataHeatBalance::Construct(constrNum).Name, "Air Boundary with Bad Mixing Schedule")); + EXPECT_TRUE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundary); + EXPECT_TRUE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundaryGroupedRadiant); + EXPECT_TRUE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundarySolar); + EXPECT_FALSE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundaryInteriorWindow); + EXPECT_FALSE(DataHeatBalance::Construct(constrNum).IsUsedCTF); + EXPECT_FALSE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundaryIRTSurface); + EXPECT_TRUE(DataHeatBalance::Construct(constrNum).TypeIsAirBoundaryMixing); + EXPECT_EQ(DataHeatBalance::Construct(constrNum).TotLayers, 0); + EXPECT_EQ(DataHeatBalance::Construct(constrNum).AirBoundaryACH, 0.1); + EXPECT_EQ(DataHeatBalance::Construct(constrNum).AirBoundaryMixingSched, 0); + EXPECT_EQ(DataHeatBalance::NominalRforNominalUCalculation(constrNum), 0.0); + } TEST_F(EnergyPlusFixture, HeatBalanceManager_GetMaterialData_IRTSurfaces) diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index fadd4a14c30..5095c3aca05 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -53,6 +53,7 @@ // EnergyPlus Headers #include #include +#include #include #include #include @@ -4432,3 +4433,422 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_CreateInternalMassSurfaces) EXPECT_EQ("TFLOORZONESINTMASS", DataSurfaces::IntMassObjects(3).Name); EXPECT_EQ("T SW APARTMENT TFLOORZONESINTMASS", SurfaceTmp(17).Name); } + +TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresNoAirBoundaries) +{ + + std::string const idf_objects = delimited_string({ + "Zone,", + "Zone 1; !- Name", + + "Zone,", + "Zone 2; !- Name", + + "Zone,", + "Zone 3; !- Name", + + "Material,", + " Some Material, !- Name", + " VeryRough, !- Roughness", + " 0.006, !- Thickness {m}", + " 0.815, !- Conductivity {W/m-K}", + " 929, !- Density {kg/m3}", + " 3140, !- Specific Heat {J/kg-K}", + " 0.9, !- Thermal Absorptance", + " 0.7, !- Solar Absorptance", + " 0.7; !- Visible Absorptance", + "Construction,", + " Some Construction, !- Name", + " Some Material; !- Outside Layer", + + "BuildingSurface:Detailed,", + " Zone1-Surface1, !- Name", + " Wall, !- Surface Type", + " Some Construction, !- Construction Name", + " Zone 1, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone2-Surface1, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + + "BuildingSurface:Detailed,", + " Zone2-Surface1, !- Name", + " Wall, !- Surface Type", + " Some Construction, !- Construction Name", + " Zone 2, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone1-Surface1, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + + "BuildingSurface:Detailed,", + " Zone1-Surface2, !- Name", + " Wall, !- Surface Type", + " Some Construction, !- Construction Name", + " Zone 1, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone3-Surface1, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + + "BuildingSurface:Detailed,", + " Zone3-Surface1, !- Name", + " Wall, !- Surface Type", + " Some Construction, !- Construction Name", + " Zone 3, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone1-Surface2, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + }); + ASSERT_TRUE(process_idf(idf_objects)); + bool ErrorsFound = false; + + GetMaterialData(ErrorsFound); // read material data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetConstructData(ErrorsFound); // read construction data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetZoneData(ErrorsFound); // read zone data + EXPECT_FALSE(ErrorsFound); // expect no errors + + SetupZoneGeometry(ErrorsFound); + // SetupZoneGeometry calls SurfaceGeometry::GetSurfaceData + // SetupZoneGeometry calls SurfaceGeometry::SetupSolarEnclosuresAndAirBoundaries + // SetupZoneGeometry calls SurfaceGeometry::SetupRadiantEnclosuresAndAirBoundaries + EXPECT_FALSE(ErrorsFound); // expect no errors + + EXPECT_EQ(DataViewFactorInformation::NumOfRadiantEnclosures, 3); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(1).Name, "Zone 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(2).Name, "Zone 2")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(3).Name, "Zone 3")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(1).ZoneNames[0], "Zone 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(2).ZoneNames[0], "Zone 2")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(3).ZoneNames[0], "Zone 3")); + EXPECT_EQ(DataHeatBalance::Zone(1).RadiantEnclosureNum, 1); + EXPECT_EQ(DataHeatBalance::Zone(2).RadiantEnclosureNum, 2); + EXPECT_EQ(DataHeatBalance::Zone(3).RadiantEnclosureNum, 3); + + EXPECT_EQ(DataViewFactorInformation::NumOfSolarEnclosures, 3); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(1).Name, "Zone 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(2).Name, "Zone 2")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(3).Name, "Zone 3")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(1).ZoneNames[0], "Zone 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(2).ZoneNames[0], "Zone 2")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(3).ZoneNames[0], "Zone 3")); + EXPECT_EQ(DataHeatBalance::Zone(1).SolarEnclosureNum, 1); + EXPECT_EQ(DataHeatBalance::Zone(2).SolarEnclosureNum, 2); + EXPECT_EQ(DataHeatBalance::Zone(3).SolarEnclosureNum, 3); + +} + +TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresWithAirBoundaries1) +{ + + std::string const idf_objects = delimited_string({ + "Zone,", + "Zone 1; !- Name", + + "Zone,", + "Zone 2; !- Name", + + "Zone,", + "Zone 3; !- Name", + + "Material,", + " Some Material, !- Name", + " VeryRough, !- Roughness", + " 0.006, !- Thickness {m}", + " 0.815, !- Conductivity {W/m-K}", + " 929, !- Density {kg/m3}", + " 3140, !- Specific Heat {J/kg-K}", + " 0.9, !- Thermal Absorptance", + " 0.7, !- Solar Absorptance", + " 0.7; !- Visible Absorptance", + "Construction,", + " Some Construction, !- Name", + " Some Material; !- Outside Layer", + "Construction:AirBoundary,", + "Grouped Air Boundary, !- Name", + "GroupedZones, !- Solar and Daylighting Method", + "GroupedZones, !- Radiant Exchange Method", + "None; !- Air Exchange Method", + + "BuildingSurface:Detailed,", + " Zone1-Surface1, !- Name", + " Wall, !- Surface Type", + " Grouped Air Boundary, !- Construction Name", + " Zone 1, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone2-Surface1, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + + "BuildingSurface:Detailed,", + " Zone2-Surface1, !- Name", + " Wall, !- Surface Type", + " Grouped Air Boundary, !- Construction Name", + " Zone 2, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone1-Surface1, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + + "BuildingSurface:Detailed,", + " Zone1-Surface2, !- Name", + " Wall, !- Surface Type", + " Grouped Air Boundary, !- Construction Name", + " Zone 1, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone3-Surface1, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + + "BuildingSurface:Detailed,", + " Zone3-Surface1, !- Name", + " Wall, !- Surface Type", + " Grouped Air Boundary, !- Construction Name", + " Zone 3, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone1-Surface2, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + }); + ASSERT_TRUE(process_idf(idf_objects)); + bool ErrorsFound = false; + + GetMaterialData(ErrorsFound); // read material data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetConstructData(ErrorsFound); // read construction data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetZoneData(ErrorsFound); // read zone data + EXPECT_FALSE(ErrorsFound); // expect no errors + + SetupZoneGeometry(ErrorsFound); + // SetupZoneGeometry calls SurfaceGeometry::GetSurfaceData + // SetupZoneGeometry calls SurfaceGeometry::SetupSolarEnclosuresAndAirBoundaries + // SetupZoneGeometry calls SurfaceGeometry::SetupRadiantEnclosuresAndAirBoundaries + EXPECT_FALSE(ErrorsFound); // expect no errors + + EXPECT_EQ(DataViewFactorInformation::NumOfRadiantEnclosures, 1); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(1).Name, "Radiant Enclosure 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(1).ZoneNames[0], "Zone 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(1).ZoneNames[1], "Zone 2")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(1).ZoneNames[2], "Zone 3")); + EXPECT_EQ(DataHeatBalance::Zone(1).RadiantEnclosureNum, 1); + EXPECT_EQ(DataHeatBalance::Zone(2).RadiantEnclosureNum, 1); + EXPECT_EQ(DataHeatBalance::Zone(3).RadiantEnclosureNum, 1); + + EXPECT_EQ(DataViewFactorInformation::NumOfSolarEnclosures, 1); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(1).Name, "Solar Enclosure 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(1).ZoneNames[0], "Zone 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(1).ZoneNames[1], "Zone 2")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(1).ZoneNames[2], "Zone 3")); + EXPECT_EQ(DataHeatBalance::Zone(1).SolarEnclosureNum, 1); + EXPECT_EQ(DataHeatBalance::Zone(2).SolarEnclosureNum, 1); + EXPECT_EQ(DataHeatBalance::Zone(3).SolarEnclosureNum, 1); + +} + +TEST_F(EnergyPlusFixture, HeatBalanceIntRadExchange_SetupEnclosuresWithAirBoundaries2) +{ + + std::string const idf_objects = delimited_string({ + "Zone,", + "Zone 1; !- Name", + + "Zone,", + "Zone 2; !- Name", + + "Zone,", + "Zone 3; !- Name", + + "Material,", + " Some Material, !- Name", + " VeryRough, !- Roughness", + " 0.006, !- Thickness {m}", + " 0.815, !- Conductivity {W/m-K}", + " 929, !- Density {kg/m3}", + " 3140, !- Specific Heat {J/kg-K}", + " 0.9, !- Thermal Absorptance", + " 0.7, !- Solar Absorptance", + " 0.7; !- Visible Absorptance", + "Construction,", + " Some Construction, !- Name", + " Some Material; !- Outside Layer", + + "Construction:AirBoundary,", + "Grouped Radiant Air Boundary, !- Name", + "InteriorWindow, !- Solar and Daylighting Method", + "GroupedZones, !- Radiant Exchange Method", + "None; !- Air Exchange Method", + + "Construction:AirBoundary,", + "Grouped Solar Air Boundary, !- Name", + "GroupedZones, !- Solar and Daylighting Method", + "IRTSurface, !- Radiant Exchange Method", + "None; !- Air Exchange Method", + + "BuildingSurface:Detailed,", + " Zone1-Surface1, !- Name", + " Wall, !- Surface Type", + " Grouped Radiant Air Boundary, !- Construction Name", + " Zone 1, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone2-Surface1, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + + "BuildingSurface:Detailed,", + " Zone2-Surface1, !- Name", + " Wall, !- Surface Type", + " Grouped Radiant Air Boundary, !- Construction Name", + " Zone 2, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone1-Surface1, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + + "BuildingSurface:Detailed,", + " Zone1-Surface2, !- Name", + " Wall, !- Surface Type", + " Grouped Solar Air Boundary, !- Construction Name", + " Zone 1, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone3-Surface1, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + + "BuildingSurface:Detailed,", + " Zone3-Surface1, !- Name", + " Wall, !- Surface Type", + " Grouped Solar Air Boundary, !- Construction Name", + " Zone 3, !- Zone Name", + " Surface, !- Outside Boundary Condition", + " Zone1-Surface2, !- Outside Boundary Condition Object", + " NoSun, !- Sun Exposure", + " NoWind, !- Wind Exposure", + " , !- View Factor to Ground", + " 4, !- Number of Vertices", + " 0,0,0, !- Vertex 1", + " 0,1,0, !- Vertex 1", + " 0,1,1, !- Vertex 1", + " 0,0,1; !- Vertex 1", + }); + ASSERT_TRUE(process_idf(idf_objects)); + bool ErrorsFound = false; + + GetMaterialData(ErrorsFound); // read material data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetConstructData(ErrorsFound); // read construction data + EXPECT_FALSE(ErrorsFound); // expect no errors + + GetZoneData(ErrorsFound); // read zone data + EXPECT_FALSE(ErrorsFound); // expect no errors + + SetupZoneGeometry(ErrorsFound); + // SetupZoneGeometry calls SurfaceGeometry::GetSurfaceData + // SetupZoneGeometry calls SurfaceGeometry::SetupSolarEnclosuresAndAirBoundaries + // SetupZoneGeometry calls SurfaceGeometry::SetupRadiantEnclosuresAndAirBoundaries + EXPECT_FALSE(ErrorsFound); // expect no errors + + ErrorsFound = false; + + //std::string const error_string = delimited_string({ + //" ** Severe ** AlignInputViewFactors: ZoneProperty:UserViewFactors:bySurfaceName=\"Zone 6\" did not find a matching radiant or solar enclosure name." + // }); + //EXPECT_TRUE(compare_err_stream(error_string, true)); + + // For this test case, Zones 1 and 2 share a radiant enclosure and Zone 1 and 3 share a solar enclosure + + EXPECT_EQ(DataViewFactorInformation::NumOfRadiantEnclosures, 2); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(1).Name, "Radiant Enclosure 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(1).ZoneNames[0], "Zone 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(1).ZoneNames[1], "Zone 2")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(2).Name, "Zone 3")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneRadiantInfo(2).ZoneNames[0], "Zone 3")); + EXPECT_EQ(DataHeatBalance::Zone(1).RadiantEnclosureNum, 1); + EXPECT_EQ(DataHeatBalance::Zone(2).RadiantEnclosureNum, 1); + EXPECT_EQ(DataHeatBalance::Zone(3).RadiantEnclosureNum, 2); + + EXPECT_EQ(DataViewFactorInformation::NumOfSolarEnclosures, 2); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(1).Name, "Solar Enclosure 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(1).ZoneNames[0], "Zone 1")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(1).ZoneNames[1], "Zone 3")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(2).Name, "Zone 2")); + EXPECT_TRUE(UtilityRoutines::SameString(DataViewFactorInformation::ZoneSolarInfo(2).ZoneNames[0], "Zone 2")); + EXPECT_EQ(DataHeatBalance::Zone(1).SolarEnclosureNum, 1); + EXPECT_EQ(DataHeatBalance::Zone(2).SolarEnclosureNum, 2); + EXPECT_EQ(DataHeatBalance::Zone(3).SolarEnclosureNum, 1); + +} From 0429a89df03c233e0e8e52545ebfaf1c24d21c0f Mon Sep 17 00:00:00 2001 From: mjwitte Date: Tue, 27 Aug 2019 19:27:17 -0500 Subject: [PATCH 033/136] Air boundary - move NoRegularMaterialsUsed up so it can be cleared properly --- src/EnergyPlus/DataHeatBalance.cc | 2 ++ src/EnergyPlus/DataHeatBalance.hh | 1 + src/EnergyPlus/HeatBalanceManager.cc | 1 - 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/DataHeatBalance.cc b/src/EnergyPlus/DataHeatBalance.cc index aa96ba8b3db..4843ac46490 100644 --- a/src/EnergyPlus/DataHeatBalance.cc +++ b/src/EnergyPlus/DataHeatBalance.cc @@ -584,6 +584,7 @@ namespace DataHeatBalance { bool NoFfactorConstructionsUsed(true); bool NoCfactorConstructionsUsed(true); + bool NoRegularMaterialsUsed(true); int NumRefrigeratedRacks(0); // Total number of refrigerated case compressor racks in input int NumRefrigSystems(0); // Total number of detailed refrigeration systems in input @@ -945,6 +946,7 @@ namespace DataHeatBalance { AdaptiveComfortRequested_ASH55 = false; NoFfactorConstructionsUsed = true; NoCfactorConstructionsUsed = true; + NoRegularMaterialsUsed = true; NumRefrigeratedRacks = 0; NumRefrigSystems = 0; NumRefrigCondensers = 0; diff --git a/src/EnergyPlus/DataHeatBalance.hh b/src/EnergyPlus/DataHeatBalance.hh index a5f486aa6c7..bb41e952270 100644 --- a/src/EnergyPlus/DataHeatBalance.hh +++ b/src/EnergyPlus/DataHeatBalance.hh @@ -437,6 +437,7 @@ namespace DataHeatBalance { extern bool NoFfactorConstructionsUsed; extern bool NoCfactorConstructionsUsed; + extern bool NoRegularMaterialsUsed; extern int NumRefrigeratedRacks; // Total number of refrigerated case compressor racks in input extern int NumRefrigSystems; // Total number of detailed refrigeration systems in input diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 4090c0f00a2..485d416d63f 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -4176,7 +4176,6 @@ namespace HeatBalanceManager { bool ConstructionFound; // True if input window construction name is found in the // Window5 data file bool EOFonW5File; // True if EOF encountered reading Window5 data file - static bool NoRegularMaterialsUsed(true); int MaterialLayerGroup; // window construction layer material group index int iMatGlass; // number of glass layers From c60df95af41fdb60db4b0f61718ecced78c3c341 Mon Sep 17 00:00:00 2001 From: mjwitte Date: Wed, 28 Aug 2019 15:29:51 -0500 Subject: [PATCH 034/136] Air boundary - engineering ref for daylighting --- .../daylighting-calculations.tex | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/engineering-reference/src/daylighting-and-window-calculations/daylighting-calculations.tex b/doc/engineering-reference/src/daylighting-and-window-calculations/daylighting-calculations.tex index 491420c5e51..97a3edc7b27 100644 --- a/doc/engineering-reference/src/daylighting-and-window-calculations/daylighting-calculations.tex +++ b/doc/engineering-reference/src/daylighting-and-window-calculations/daylighting-calculations.tex @@ -10,8 +10,14 @@ \section{Daylighting Calculations}\label{daylighting-calculations} \item \emph{Daylight factors}, which are ratios of interior illuminance or luminance to exterior horizontal illuminance, are calculated and stored. The user specifies the coordinates of one or more reference points in each daylit zone. - EnergyPlus then integrates over the area of each exterior window in the zone to obtain the contribution of direct light from the window to the illuminance at the reference points, - and the contribution of light that reflects from the walls, floor and ceiling before reaching the reference points. + EnergyPlus then integrates over the area of each exterior window in the zone (or enclosure) to obtain the contribution of direct light from the window to the illuminance at the reference points, + and the contribution of light that reflects from the walls, floor and ceiling before reaching the reference points. + + If a zone has surfaces with air boundaries (Construction:AirBoundary) + using the \textit{GroupedZones} method for solar and daylighting then all of the surfaces within the grouped enclosure are included in the "zone". Each daylighting control and reference point + remains associated with a specific zone, but all windows (and other surfaces) within the grouped enclosure are seen by each reference point within the enclosure. For example if there is an air + boundary between Zone A and Zone B, a daylighting reference point in Zone A will see all surfaces in both Zone A and Zone B directly. + Window luminance and window background luminance, which are used to determine glare, are also calculated. Taken into account are such factors as sky luminance distribution, window size and orientation, glazing transmittance, inside surface reflectances, sun control devices such as movable window shades, and external obstructions. Dividing daylight illuminance or luminance by exterior illuminance yields daylight factors. From ae07326e0a68f8267070fd2e6aae98cae4cb515d Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Tue, 3 Sep 2019 13:59:19 -0500 Subject: [PATCH 035/136] Solution to Reversed Layers for IZ Constructions When interzone surfaces are used, the constructions must be reversed. For most materials, the layers simply need to be matched in reverse order. However, for window glass and equivalent glass layers, some of the properties are different on the front and back side. So, when this check happens and the layers are different, it needs to see if the user has correctly reversed these material types. In V9.1, no check is made and an error is thrown if the materials are different even if they are correctly reversed. --- src/EnergyPlus/SurfaceGeometry.cc | 89 ++++++++++++++++++++++++++++--- src/EnergyPlus/SurfaceGeometry.hh | 6 +++ 2 files changed, 89 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index c5c2a28f49b..5aec7a1685b 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -1435,12 +1435,7 @@ namespace SurfaceGeometry { // check layers as number of layers is the same izConstDiff = false; // ok if same nominal U - for (Lay = 1; Lay <= TotLay; ++Lay) { - if (Construct(ConstrNum).LayerPoint(Lay) != Construct(ConstrNumFound).LayerPoint(TotLay - Lay + 1)) { - izConstDiff = true; - break; // exit when diff - } - } + CheckForReversedLayers(izConstDiff, ConstrNum, ConstrNumFound, TotLay); if (izConstDiff && std::abs(NominalU(ConstrNum) - NominalU(ConstrNumFound)) > 0.001) { ShowSevereError(RoutineName + "Construction " + Construct(ConstrNum).Name + " of interzone surface " + Surface(SurfNum).Name + @@ -13264,6 +13259,88 @@ namespace SurfaceGeometry { Surface(SurfNum).Width = WidthEff; Surface(SurfNum).Height = HeightEff; } + + + void CheckForReversedLayers(bool &RevLayerDiffs, // true when differences are discovered in interzone constructions + int const ConstrNum, // construction index + int const ConstrNumRev, // construction index for reversed construction + int const TotalLayers // total layers for construction definition + ) + { + + int LayerNo; + RevLayerDiffs = false; + + for (LayerNo = 1; LayerNo <= TotalLayers; ++LayerNo) { + auto &thisConstLayer(Construct(ConstrNum).LayerPoint(LayerNo)); + auto &revConstLayer(Construct(ConstrNumRev).LayerPoint(TotalLayers - LayerNo + 1)); + if (thisConstLayer != revConstLayer) { // Not pointing to the same layer + // If not point to the same layer, check to see if this is window glass which might need to have + // front and back material properties reversed. + auto &thisMatLay(Material(thisConstLayer)); + auto &revMatLay(Material(revConstLayer)); + Real64 const SmallDiff = 0.0001; + if ((thisMatLay.Group = WindowGlass) && (thisMatLay.Group = WindowGlass)) { + // Both layers are window glass, so need to check to see if the properties are reversed + if ((abs(thisMatLay.Thickness - revMatLay.Thickness) > SmallDiff) || + (abs(thisMatLay.ReflectSolBeamBack - revMatLay.ReflectSolBeamFront) > SmallDiff) || + (abs(thisMatLay.ReflectSolBeamFront - revMatLay.ReflectSolBeamBack) > SmallDiff) || + (abs(thisMatLay.TransVis - revMatLay.TransVis) > SmallDiff) || + (abs(thisMatLay.ReflectVisBeamBack - revMatLay.ReflectVisBeamFront) > SmallDiff) || + (abs(thisMatLay.ReflectVisBeamFront - revMatLay.ReflectVisBeamBack) > SmallDiff) || + (abs(thisMatLay.TransThermal - revMatLay.TransThermal) > SmallDiff) || + (abs(thisMatLay.AbsorpThermalBack - revMatLay.AbsorpThermalFront) > SmallDiff) || + (abs(thisMatLay.AbsorpThermalFront - revMatLay.AbsorpThermalBack) > SmallDiff) || + (abs(thisMatLay.Conductivity - revMatLay.Conductivity) > SmallDiff) || + (abs(thisMatLay.GlassTransDirtFactor - revMatLay.GlassTransDirtFactor) > SmallDiff) || + (thisMatLay.SolarDiffusing != revMatLay.SolarDiffusing) || + (abs(thisMatLay.YoungModulus - revMatLay.YoungModulus) > SmallDiff) || + (abs(thisMatLay.PoissonsRatio - revMatLay.PoissonsRatio) > SmallDiff)) { + RevLayerDiffs = true; + break; // exit when diff + } // If none of the above conditions is met, then these should be the same layers in reverse (RevLayersDiffs = false) + } else if ((thisMatLay.Group = GlassEquivalentLayer) && (thisMatLay.Group = GlassEquivalentLayer)) { + auto &thisMatLay(Material(thisConstLayer)); + auto &revMatLay(Material(revConstLayer)); + Real64 const SmallDiff = 0.0001; + if ((abs(thisMatLay.TausBackBeamBeam - revMatLay.TausFrontBeamBeam) > SmallDiff) || + (abs(thisMatLay.TausFrontBeamBeam - revMatLay.TausBackBeamBeam) > SmallDiff) || + (abs(thisMatLay.ReflBackBeamBeam - revMatLay.ReflFrontBeamBeam) > SmallDiff) || + (abs(thisMatLay.ReflFrontBeamBeam - revMatLay.ReflBackBeamBeam) > SmallDiff) || + (abs(thisMatLay.TausBackBeamBeamVis - revMatLay.TausFrontBeamBeamVis) > SmallDiff) || + (abs(thisMatLay.TausFrontBeamBeamVis - revMatLay.TausBackBeamBeamVis) > SmallDiff) || + (abs(thisMatLay.ReflBackBeamBeamVis - revMatLay.ReflFrontBeamBeamVis) > SmallDiff) || + (abs(thisMatLay.ReflFrontBeamBeamVis - revMatLay.ReflBackBeamBeamVis) > SmallDiff) || + (abs(thisMatLay.TausBackBeamDiff - revMatLay.TausFrontBeamDiff) > SmallDiff) || + (abs(thisMatLay.TausFrontBeamDiff - revMatLay.TausBackBeamDiff) > SmallDiff) || + (abs(thisMatLay.ReflBackBeamDiff - revMatLay.ReflFrontBeamDiff) > SmallDiff) || + (abs(thisMatLay.ReflFrontBeamDiff - revMatLay.ReflBackBeamDiff) > SmallDiff) || + (abs(thisMatLay.TausBackBeamDiffVis - revMatLay.TausFrontBeamDiffVis) > SmallDiff) || + (abs(thisMatLay.TausFrontBeamDiffVis - revMatLay.TausBackBeamDiffVis) > SmallDiff) || + (abs(thisMatLay.ReflBackBeamDiffVis - revMatLay.ReflFrontBeamDiffVis) > SmallDiff) || + (abs(thisMatLay.ReflFrontBeamDiffVis - revMatLay.ReflBackBeamDiffVis) > SmallDiff) || // 16 + (abs(thisMatLay.TausDiffDiff - revMatLay.TausDiffDiff) > SmallDiff) || + (abs(thisMatLay.ReflBackDiffDiff - revMatLay.ReflFrontDiffDiff) > SmallDiff) || + (abs(thisMatLay.ReflFrontDiffDiff - revMatLay.ReflBackDiffDiff) > SmallDiff) || + (abs(thisMatLay.TausDiffDiffVis - revMatLay.TausDiffDiffVis) > SmallDiff) || + (abs(thisMatLay.ReflBackDiffDiffVis - revMatLay.ReflFrontDiffDiffVis) > SmallDiff) || + (abs(thisMatLay.ReflFrontDiffDiffVis - revMatLay.ReflBackDiffDiffVis) > SmallDiff) || + (abs(thisMatLay.TausThermal - revMatLay.TausThermal) > SmallDiff) || + (abs(thisMatLay.EmissThermalBack - revMatLay.EmissThermalFront) > SmallDiff) || + (abs(thisMatLay.EmissThermalFront - revMatLay.EmissThermalBack) > SmallDiff) || + (abs(thisMatLay.Resistance - revMatLay.Resistance) > SmallDiff)) { + RevLayerDiffs = true; + break; // exit when diff + } // If none of the above conditions is met, then these should be the same layers in reverse (RevLayersDiffs = false) + } else { + // Other material types do not have reversed constructions so if they are not the same layer there is a problem (RevLayersDiffs = true) + RevLayerDiffs = true; + break; // exit when diff + } // End check of whether or not these are WindowGlass + } // else: thisConstLayer is the same as revConstLayer--so there is no problem (RevLayersDiffs = false) + } + } + } // namespace SurfaceGeometry } // namespace EnergyPlus diff --git a/src/EnergyPlus/SurfaceGeometry.hh b/src/EnergyPlus/SurfaceGeometry.hh index e626e19db83..b9106153640 100644 --- a/src/EnergyPlus/SurfaceGeometry.hh +++ b/src/EnergyPlus/SurfaceGeometry.hh @@ -389,6 +389,12 @@ namespace SurfaceGeometry { bool isRectangle(int const ThisSurf // Current surface number ); + void CheckForReversedLayers(bool &RevLayerDiffs, // true when differences are discovered in interzone constructions + int const ConstrNum, // construction index + int const ConstrNumRev, // construction index for reversed construction + int const TotalLayers // total layers for construction definition + ); + } // namespace SurfaceGeometry } // namespace EnergyPlus From c0f48bc9bdd66c4f3f7121dfc9e3f91279a7ef75 Mon Sep 17 00:00:00 2001 From: JasonGlazer Date: Tue, 3 Sep 2019 15:18:37 -0500 Subject: [PATCH 036/136] Fix to ExpandObjects/epfilter.f90 --- src/ExpandObjects/epfilter.f90 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ExpandObjects/epfilter.f90 b/src/ExpandObjects/epfilter.f90 index 994cd04e1cd..f71e1eeb0bf 100644 --- a/src/ExpandObjects/epfilter.f90 +++ b/src/ExpandObjects/epfilter.f90 @@ -8855,6 +8855,8 @@ SUBROUTINE CreateNewVAV CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','2',.FALSE.) CASE (baseboardElectric) CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','1') + CALL AddToObjStr('Zone Equipment Sequential Cooling Fraction Schedule Name','',.FALSE.) + CALL AddToObjStr('Zone Equipment Sequential Heating Fraction Schedule Name','',.FALSE.) CALL AddToObjStr('Zone Equipment Object Type','ZoneHVAC:Baseboard:Convective:Electric') CALL AddToObjFld('Zone Equipment Name', base + vzNameOff,' Baseboard Heat') CALL AddToObjStr('Zone Equipment Cooling Sequence','2') @@ -9303,7 +9305,7 @@ SUBROUTINE CreateNewVAV END IF CALL AddToObjFld('Inlet Node Name', base + fpvzNameOff,' Zone Return Plenum Inlet',.TRUE.) END IF - !ZONE EQUIPMENT LIST ~ line 61 of FPVAV tab + !ZONE EQUIPMENT LIST ~ line 61 of FPVAV tab CALL CreateNewObj('ZoneHVAC:EquipmentList') CALL AddToObjFld('Name', base + fpvzNameOff,' Equipment') CALL AddToObjStr('Load Distribution Scheme','SequentialLoad') @@ -9315,6 +9317,7 @@ SUBROUTINE CreateNewVAV CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','1',.FALSE.) CASE (baseboardHotWater) CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','1') + ! fix for 7377 CALL AddToObjStr('Zone Equipment Sequential Cooling Fraction Schedule Name','',.FALSE.) CALL AddToObjStr('Zone Equipment Sequential Heating Fraction Schedule Name','',.FALSE.) CALL AddToObjStr('Zone Equipment Object Type','ZoneHVAC:Baseboard:RadiantConvective:Water') @@ -9323,6 +9326,8 @@ SUBROUTINE CreateNewVAV CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','2',.FALSE.) CASE (baseboardElectric) CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','1') + CALL AddToObjStr('Zone Equipment Sequential Cooling Fraction Schedule Name','',.FALSE.) + CALL AddToObjStr('Zone Equipment Sequential Heating Fraction Schedule Name','',.FALSE.) CALL AddToObjStr('Zone Equipment Object Type','ZoneHVAC:Baseboard:Convective:Electric') CALL AddToObjFld('Zone Equipment Name', base + fpvzNameOff,' Baseboard Heat') CALL AddToObjStr('Zone Equipment Cooling Sequence','2') @@ -9800,6 +9805,8 @@ SUBROUTINE CreateNewVAV CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','2',.FALSE.) CASE (baseboardElectric) CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','1') + CALL AddToObjStr('Zone Equipment Sequential Cooling Fraction Schedule Name','',.FALSE.) + CALL AddToObjStr('Zone Equipment Sequential Heating Fraction Schedule Name','',.FALSE.) CALL AddToObjStr('Zone Equipment Object Type','ZoneHVAC:Baseboard:Convective:Electric') CALL AddToObjFld('Zone Equipment Name', base + hcvzNameOff,' Baseboard Heat') CALL AddToObjStr('Zone Equipment Cooling Sequence','2') @@ -13374,6 +13381,8 @@ SUBROUTINE CreateNewUnitary CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','2',.FALSE.) CASE (baseboardElectric) CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','1') + CALL AddToObjStr('Zone Equipment Sequential Cooling Fraction Schedule Name','',.FALSE.) + CALL AddToObjStr('Zone Equipment Sequential Heating Fraction Schedule Name','',.FALSE.) CALL AddToObjStr('Zone Equipment Object Type','ZoneHVAC:Baseboard:Convective:Electric') CALL AddToObjFld('Zone Equipment Name', base + uzNameOff,' Baseboard Heat') CALL AddToObjStr('Zone Equipment Cooling Sequence','2') @@ -18619,6 +18628,8 @@ SUBROUTINE CreateNewConstVol CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','2',.FALSE.) CASE (baseboardElectric) CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','1') + CALL AddToObjStr('Zone Equipment Sequential Cooling Fraction Schedule Name','',.FALSE.) + CALL AddToObjStr('Zone Equipment Sequential Heating Fraction Schedule Name','',.FALSE.) CALL AddToObjStr('Zone Equipment Object Type','ZoneHVAC:Baseboard:Convective:Electric') CALL AddToObjFld('Zone Equipment Name', base + cvzNameOff,' Baseboard Heat') CALL AddToObjStr('Zone Equipment Cooling Sequence','2') @@ -20565,6 +20576,8 @@ SUBROUTINE CreateNewDualDuct CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','2',.FALSE.) CASE (baseboardElectric) CALL AddToObjStr('Zone Equipment Heating or No-Load Sequence','1') + CALL AddToObjStr('Zone Equipment Sequential Cooling Fraction Schedule Name','',.FALSE.) + CALL AddToObjStr('Zone Equipment Sequential Heating Fraction Schedule Name','',.FALSE.) CALL AddToObjStr('Zone Equipment Object Type','ZoneHVAC:Baseboard:Convective:Electric') CALL AddToObjFld('Zone Equipment Name', base + ddzNameOff,' Baseboard Heat') CALL AddToObjStr('Zone Equipment Cooling Sequence','2') From 7b46aa28b147c010e47dbf208041f8f7b702227b Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Wed, 4 Sep 2019 10:13:50 -0500 Subject: [PATCH 037/136] Final fixes, unit test, and documentation addition Completed some corrections to the issue solution as well as added a unit test and some documentation to clarify the requirements for interzone constructions. This is now ready for review. --- ...roup-thermal-zone-description-geometry.tex | 4 + src/EnergyPlus/SurfaceGeometry.cc | 18 +- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 155 ++++++++++++++++++ 3 files changed, 171 insertions(+), 6 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex b/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex index eea114825d2..ff96e1326da 100644 --- a/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex +++ b/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex @@ -520,6 +520,10 @@ \subsection{Surface(s)}\label{surfaces} Note that heat transfer surfaces are fully represented with each description. As stated earlier in the Construction description, materials in the construction (outside to inside) are included but film coefficients neither inside nor outside are used in the description -- these are automatically calculated during the EnergyPlus run. Interzone surfaces which do not have a symmetrical construction (such as a ceiling/floor) require two Construction objects with the layers in reverse order. For example, CEILING with carpet, concrete, ceiling tile and FLOOR with ceiling tile, concrete, carpet. If interzone surfaces have a symmetrical construction, the specification for the two surfaces can reference the same Construction. When a surface is connected as the outside boundary condition for another surface, the two surfaces may be in the same plane, or they may be separated to imply thickness. \end{callout} +\begin{callout} +Note also that if interzone constructions include either \hyperref[windowmaterialglazing]{WindowMaterial:Glazing} or \hyperref[windowmaterialglazingequivalentlayer]{WindowMaterial:Glazing:EquivalentLayer} then the materials properties of layers consisting of those material types will have front and back side values that may differ from one another. So, if using such materials in the definition of an interzone construction, reversed materials must also have their front and back properties inverted so as to match in reverse order. For example, if there is a single layer of glass of type \hyperref[windowmaterialglazing]{WindowMaterial:Glazing} defined for an interzone construction and the front and back properties differ, the user must define two materials with equivalent properties except that the front and back values must be reversed. This means that one material used for the definition on one side might have a front side solar reflectance at normal incidence of 0.35 and a back side solar reflectance at normal incidence of 0.25. The material used for the other side of the interzone construction must then have a front side solar reflectance at normal incidence of 0.25 and a back side solar reflectance at normal incidence of 0.35 to match properly in reverse. EnergyPlus checks for all of the user input properties for single and multiple layer interzone constructions that use these two material types to confirm that this has been done correctly so that the simulation accurately reflects the properties of the materials on each side. +\end{callout} + \textbf{Shading} surfaces are used to describe aspects of the site which do not directly impact the physical interactions of the environmental parameters but may significantly shade the building during specific hours of the day or time so the year (e.g.~trees, bushes, mountains, nearby buildings which aren't being simulated as part of this facility, etc.) \begin{callout} diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 5aec7a1685b..a1c20cfce89 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -1441,6 +1441,7 @@ namespace SurfaceGeometry { Surface(SurfNum).Name + " does not have the same materials in the reverse order as the construction " + Construct(ConstrNumFound).Name + " of adjacent surface " + Surface(Found).Name); + ShowContinueError("or the properties of the reversed layers are not correct due to differing layer front and back side values"); if (!Construct(ConstrNum).ReverseConstructionLayersOrderWarning || !Construct(ConstrNumFound).ReverseConstructionLayersOrderWarning) { ShowContinueError("...this problem for this pair will not be reported again."); @@ -1453,6 +1454,7 @@ namespace SurfaceGeometry { Surface(SurfNum).Name + " does not have the same materials in the reverse order as the construction " + Construct(ConstrNumFound).Name + " of adjacent surface " + Surface(Found).Name); + ShowContinueError("or the properties of the reversed layers are not correct due to differing layer front and back side values"); ShowContinueError("...but Nominal U values are similar, diff=[" + RoundSigDigits(std::abs(NominalU(ConstrNum) - NominalU(ConstrNumFound)), 4) + "] ... simulation proceeds."); @@ -13274,13 +13276,17 @@ namespace SurfaceGeometry { for (LayerNo = 1; LayerNo <= TotalLayers; ++LayerNo) { auto &thisConstLayer(Construct(ConstrNum).LayerPoint(LayerNo)); auto &revConstLayer(Construct(ConstrNumRev).LayerPoint(TotalLayers - LayerNo + 1)); - if (thisConstLayer != revConstLayer) { // Not pointing to the same layer + auto &thisMatLay(Material(thisConstLayer)); + auto &revMatLay(Material(revConstLayer)); + if ((thisConstLayer != revConstLayer) || // Not pointing to the same layer + (thisMatLay.Group == WindowGlass) || // Not window glass or glass equivalent layer which have + (revMatLay.Group == WindowGlass) || // to have certain properties flipped from front to back + (thisMatLay.Group == GlassEquivalentLayer) || + (revMatLay.Group == GlassEquivalentLayer)) { // If not point to the same layer, check to see if this is window glass which might need to have // front and back material properties reversed. - auto &thisMatLay(Material(thisConstLayer)); - auto &revMatLay(Material(revConstLayer)); Real64 const SmallDiff = 0.0001; - if ((thisMatLay.Group = WindowGlass) && (thisMatLay.Group = WindowGlass)) { + if ((thisMatLay.Group == WindowGlass) && (revMatLay.Group == WindowGlass)) { // Both layers are window glass, so need to check to see if the properties are reversed if ((abs(thisMatLay.Thickness - revMatLay.Thickness) > SmallDiff) || (abs(thisMatLay.ReflectSolBeamBack - revMatLay.ReflectSolBeamFront) > SmallDiff) || @@ -13299,7 +13305,7 @@ namespace SurfaceGeometry { RevLayerDiffs = true; break; // exit when diff } // If none of the above conditions is met, then these should be the same layers in reverse (RevLayersDiffs = false) - } else if ((thisMatLay.Group = GlassEquivalentLayer) && (thisMatLay.Group = GlassEquivalentLayer)) { + } else if ((thisMatLay.Group == GlassEquivalentLayer) && (revMatLay.Group == GlassEquivalentLayer)) { auto &thisMatLay(Material(thisConstLayer)); auto &revMatLay(Material(revConstLayer)); Real64 const SmallDiff = 0.0001; @@ -13318,7 +13324,7 @@ namespace SurfaceGeometry { (abs(thisMatLay.TausBackBeamDiffVis - revMatLay.TausFrontBeamDiffVis) > SmallDiff) || (abs(thisMatLay.TausFrontBeamDiffVis - revMatLay.TausBackBeamDiffVis) > SmallDiff) || (abs(thisMatLay.ReflBackBeamDiffVis - revMatLay.ReflFrontBeamDiffVis) > SmallDiff) || - (abs(thisMatLay.ReflFrontBeamDiffVis - revMatLay.ReflBackBeamDiffVis) > SmallDiff) || // 16 + (abs(thisMatLay.ReflFrontBeamDiffVis - revMatLay.ReflBackBeamDiffVis) > SmallDiff) || (abs(thisMatLay.TausDiffDiff - revMatLay.TausDiffDiff) > SmallDiff) || (abs(thisMatLay.ReflBackDiffDiff - revMatLay.ReflFrontDiffDiff) > SmallDiff) || (abs(thisMatLay.ReflFrontDiffDiff - revMatLay.ReflBackDiffDiff) > SmallDiff) || diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index fadd4a14c30..28d061a62b4 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -4432,3 +4432,158 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_CreateInternalMassSurfaces) EXPECT_EQ("TFLOORZONESINTMASS", DataSurfaces::IntMassObjects(3).Name); EXPECT_EQ("T SW APARTMENT TFLOORZONESINTMASS", SurfaceTmp(17).Name); } + +TEST_F(EnergyPlusFixture, SurfaceGeometry_CheckForReversedLayers) +{ + bool RevLayerDiffs; + bool ExpectResult; + Construct.allocate(6); + Material.allocate(7); + + // Case 1a: Constructs with regular materials are a reverse of each other--material layers match in reverse (should get a "false" answer) + Construct(1).TotLayers = 3; + Construct(1).LayerPoint(1) = 1; + Construct(1).LayerPoint(2) = 2; + Construct(1).LayerPoint(3) = 3; + Construct(2).TotLayers = 3; + Construct(2).LayerPoint(1) = 3; + Construct(2).LayerPoint(2) = 2; + Construct(2).LayerPoint(3) = 1; + RevLayerDiffs = true; + ExpectResult = false; + CheckForReversedLayers(RevLayerDiffs, 1, 2, 3); + EXPECT_EQ(RevLayerDiffs, ExpectResult); + + // Case 1a: Constructs with regular materials are not reverse of each other--material layers do not match in reverse (should get a "true" answer) + Construct(2).LayerPoint(1) = 1; + Construct(2).LayerPoint(3) = 3; + Material(1).Group = RegularMaterial; + Material(2).Group = RegularMaterial; + Material(3).Group = RegularMaterial; + RevLayerDiffs = false; + ExpectResult = true; + CheckForReversedLayers(RevLayerDiffs, 1, 2, 3); + EXPECT_EQ(RevLayerDiffs, ExpectResult); + + // Case 2a: Constructs are reverse of each other using WindowGlass, front/back properties properly switched (should get a "false" answer) + Construct(3).TotLayers = 3; + Construct(3).LayerPoint(1) = 4; + Construct(3).LayerPoint(2) = 2; + Construct(3).LayerPoint(3) = 5; + Construct(4).TotLayers = 3; + Construct(4).LayerPoint(1) = 4; + Construct(4).LayerPoint(2) = 2; + Construct(4).LayerPoint(3) = 5; + Material(4).Group = WindowGlass; + Material(4).Thickness = 0.15; + Material(4).ReflectSolBeamFront = 0.35; + Material(4).ReflectSolBeamBack = 0.25; + Material(4).TransVis = 0.45; + Material(4).ReflectVisBeamFront = 0.34; + Material(4).ReflectVisBeamBack = 0.24; + Material(4).TransThermal = 0.44; + Material(4).AbsorpThermalFront = 0.33; + Material(4).AbsorpThermalBack = 0.23; + Material(4).Conductivity = 0.43; + Material(4).GlassTransDirtFactor = 0.67; + Material(4).SolarDiffusing = 0.12; + Material(4).YoungModulus = 0.89; + Material(4).PoissonsRatio = 1.11; + Material(5).Group = WindowGlass; + Material(5).Thickness = 0.15; + Material(5).ReflectSolBeamFront = 0.25; + Material(5).ReflectSolBeamBack = 0.35; + Material(5).TransVis = 0.45; + Material(5).ReflectVisBeamFront = 0.24; + Material(5).ReflectVisBeamBack = 0.34; + Material(5).TransThermal = 0.44; + Material(5).AbsorpThermalFront = 0.23; + Material(5).AbsorpThermalBack = 0.33; + Material(5).Conductivity = 0.43; + Material(5).GlassTransDirtFactor = 0.67; + Material(5).SolarDiffusing = 0.12; + Material(5).YoungModulus = 0.89; + Material(5).PoissonsRatio = 1.11; + RevLayerDiffs = true; + ExpectResult = false; + CheckForReversedLayers(RevLayerDiffs, 3, 4, 3); + EXPECT_EQ(RevLayerDiffs, ExpectResult); + + // Case 2b: Constructs are reverse of each other using WindowGlass, front/back properties NOT properly switched (should get a "true" answer) + Material(5).ReflectVisBeamFront = 0.34; // correct would be 0.24 + Material(5).ReflectVisBeamBack = 0.24; // correct would be 0.34 + RevLayerDiffs = false; + ExpectResult = true; + CheckForReversedLayers(RevLayerDiffs, 3, 4, 3); + EXPECT_EQ(RevLayerDiffs, ExpectResult); + + // Case 3a: Single layer constructs using Equivalent Glass, front/back properties properly switched (should get a "false" answer) + Construct(5).TotLayers = 1; + Construct(5).LayerPoint(1) = 6; + Construct(6).TotLayers = 1; + Construct(6).LayerPoint(1) = 7; + Material(6).Group = GlassEquivalentLayer; + Material(6).TausFrontBeamBeam = 0.39; + Material(6).TausBackBeamBeam = 0.29; + Material(6).ReflFrontBeamBeam = 0.38; + Material(6).ReflBackBeamBeam = 0.28; + Material(6).TausFrontBeamBeamVis = 0.37; + Material(6).TausBackBeamBeamVis = 0.27; + Material(6).ReflFrontBeamBeamVis = 0.36; + Material(6).ReflBackBeamBeamVis = 0.26; + Material(6).TausFrontBeamDiff = 0.35; + Material(6).TausBackBeamDiff = 0.25; + Material(6).ReflFrontBeamDiff = 0.34; + Material(6).ReflBackBeamDiff = 0.24; + Material(6).TausFrontBeamDiffVis = 0.33; + Material(6).TausBackBeamDiffVis = 0.23; + Material(6).ReflFrontBeamDiffVis = 0.32; + Material(6).ReflBackBeamDiffVis = 0.22; + Material(6).TausDiffDiff = 0.456; + Material(6).ReflFrontDiffDiff = 0.31; + Material(6).ReflBackDiffDiff = 0.21; + Material(6).TausDiffDiffVis = 0.345; + Material(6).ReflFrontDiffDiffVis = 0.30; + Material(6).ReflBackDiffDiffVis = 0.20; + Material(6).TausThermal = 0.234; + Material(6).EmissThermalFront = 0.888; + Material(6).EmissThermalBack = 0.777; + Material(6).Resistance = 1.234; + Material(7).Group = GlassEquivalentLayer; + Material(7).TausFrontBeamBeam = 0.29; + Material(7).TausBackBeamBeam = 0.39; + Material(7).ReflFrontBeamBeam = 0.28; + Material(7).ReflBackBeamBeam = 0.38; + Material(7).TausFrontBeamBeamVis = 0.27; + Material(7).TausBackBeamBeamVis = 0.37; + Material(7).ReflFrontBeamBeamVis = 0.26; + Material(7).ReflBackBeamBeamVis = 0.36; + Material(7).TausFrontBeamDiff = 0.25; + Material(7).TausBackBeamDiff = 0.35; + Material(7).ReflFrontBeamDiff = 0.24; + Material(7).ReflBackBeamDiff = 0.34; + Material(7).TausFrontBeamDiffVis = 0.23; + Material(7).TausBackBeamDiffVis = 0.33; + Material(7).ReflFrontBeamDiffVis = 0.22; + Material(7).ReflBackBeamDiffVis = 0.32; + Material(7).TausDiffDiff = 0.456; + Material(7).ReflFrontDiffDiff = 0.21; + Material(7).ReflBackDiffDiff = 0.31; + Material(7).TausDiffDiffVis = 0.345; + Material(7).ReflFrontDiffDiffVis = 0.20; + Material(7).ReflBackDiffDiffVis = 0.30; + Material(7).TausThermal = 0.234; + Material(7).EmissThermalFront = 0.777; + Material(7).EmissThermalBack = 0.888; + Material(7).Resistance = 1.234; + RevLayerDiffs = true; + ExpectResult = false; + CheckForReversedLayers(RevLayerDiffs, 5, 6, 1); + EXPECT_EQ(RevLayerDiffs, ExpectResult); + // Case 3a: Single layer constructs using Equivalent Glass, front/back properties NOT properly switched (should get a "true" answer) + Material(7).EmissThermalFront = 0.888; + RevLayerDiffs = false; + ExpectResult = true; + CheckForReversedLayers(RevLayerDiffs, 5, 6, 1); + EXPECT_EQ(RevLayerDiffs, ExpectResult); +} From 96e7b53ce59a2239f0a5e3a4e84da29f93a4631b Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Wed, 4 Sep 2019 11:05:12 -0500 Subject: [PATCH 038/136] Correction for build fail and removal of unused variable The new subroutine/function was not logged on a whitelist and was causing a build issue for the custom check compiler. In addition, an unused variable was removed from SurfaceGeometry.cc. --- scripts/dev/find_byref_bool_override.py | 5 +++++ src/EnergyPlus/SurfaceGeometry.cc | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/dev/find_byref_bool_override.py b/scripts/dev/find_byref_bool_override.py index e5f28e5cd2d..40816b9b9ee 100755 --- a/scripts/dev/find_byref_bool_override.py +++ b/scripts/dev/find_byref_bool_override.py @@ -322,6 +322,11 @@ "CannotShade" ] }, + "SurfaceGeometry.cc": { + "CheckForReversedLayers": [ + "RevLayerDiffs" + ] + }, "SwimmingPool.cc": { # This is an inverse one-way toggle (can only set it to false if true # when passed) diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index a1c20cfce89..25900e33a0e 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -871,7 +871,6 @@ namespace SurfaceGeometry { int Found; // For matching interzone surfaces int ConstrNumFound; // Construction number of matching interzone surface static bool NonMatch(false); // Error for non-matching interzone surfaces - int Lay; // Layer number int MovedSurfs; // Number of Moved Surfaces (when sorting into hierarchical structure) static bool SurfError(false); // General Surface Error, causes fatal error at end of routine int Loop; From 3bcb24964de485b573fb4a380901afe585e03eb5 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Wed, 4 Sep 2019 13:09:44 -0500 Subject: [PATCH 039/136] Correction of a few issues that caused warnings Misassigned a boolean variable as a real. Corrected to eliminate build warnings. --- tst/EnergyPlus/unit/SurfaceGeometry.unit.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc index 28d061a62b4..e80663b8183 100644 --- a/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc +++ b/tst/EnergyPlus/unit/SurfaceGeometry.unit.cc @@ -4486,7 +4486,7 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_CheckForReversedLayers) Material(4).AbsorpThermalBack = 0.23; Material(4).Conductivity = 0.43; Material(4).GlassTransDirtFactor = 0.67; - Material(4).SolarDiffusing = 0.12; + Material(4).SolarDiffusing = true; Material(4).YoungModulus = 0.89; Material(4).PoissonsRatio = 1.11; Material(5).Group = WindowGlass; @@ -4501,7 +4501,7 @@ TEST_F(EnergyPlusFixture, SurfaceGeometry_CheckForReversedLayers) Material(5).AbsorpThermalBack = 0.33; Material(5).Conductivity = 0.43; Material(5).GlassTransDirtFactor = 0.67; - Material(5).SolarDiffusing = 0.12; + Material(5).SolarDiffusing = true; Material(5).YoungModulus = 0.89; Material(5).PoissonsRatio = 1.11; RevLayerDiffs = true; From 81d198f852acc33f6fb85fde06638207a0a2d9d4 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Wed, 4 Sep 2019 15:45:14 -0700 Subject: [PATCH 040/136] half way --- src/EnergyPlus/FluidProperties.cc | 10 +++++++--- src/EnergyPlus/FluidProperties.hh | 2 ++ src/EnergyPlus/OutputProcessor.cc | 1 + tst/EnergyPlus/unit/BaseboardRadiator.unit.cc | 2 ++ tst/EnergyPlus/unit/BoilerHotWater.unit.cc | 3 +++ tst/EnergyPlus/unit/ChillerAbsorption.unit.cc | 2 ++ .../unit/ChillerConstantCOP.unit.cc | 2 ++ tst/EnergyPlus/unit/ChillerElectric.unit.cc | 2 ++ .../unit/ChillerElectricEIR.unit.cc | 6 +++++- .../unit/CondenserLoopTowers.unit.cc | 16 ++++++++++++++++ .../unit/DesiccantDehumidifiers.unit.cc | 3 +++ tst/EnergyPlus/unit/FanCoilUnits.unit.cc | 10 ++++++++++ .../unit/GroundHeatExchangers.unit.cc | 19 +++++++++++++++++++ tst/EnergyPlus/unit/HVACControllers.unit.cc | 2 ++ tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc | 5 +++++ .../unit/HVACInterfaceManager.unit.cc | 2 ++ .../unit/HVACMultiSpeedHeatPump.unit.cc | 3 +++ .../unit/HVACVariableRefrigerantFlow.unit.cc | 12 +++++++++++- .../unit/HWBaseboardRadiator.unit.cc | 2 ++ .../unit/HeatPumpWaterToWaterSimple.unit.cc | 4 ++++ tst/EnergyPlus/unit/HeatRecovery.unit.cc | 2 ++ tst/EnergyPlus/unit/Humidifiers.unit.cc | 6 ++++++ .../unit/LowTempRadiantSystem.unit.cc | 4 ++++ tst/EnergyPlus/unit/MixedAir.unit.cc | 3 +++ .../unit/OASystemHWPreheatCoil.unit.cc | 5 +++++ tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc | 2 ++ .../unit/PackagedTerminalHeatPump.unit.cc | 3 +++ tst/EnergyPlus/unit/SetPointManager.unit.cc | 3 +++ tst/EnergyPlus/unit/UnitarySystem.unit.cc | 2 ++ tst/EnergyPlus/unit/WaterCoils.unit.cc | 3 +++ 30 files changed, 136 insertions(+), 5 deletions(-) diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index 64e9b7b9122..03cc9d16529 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -223,6 +223,13 @@ namespace FluidProperties { // Functions + void InitializeGlycRoutines() + { +#ifdef EP_cache_GlycolSpecificHeat + cached_t_sh.allocate({0, t_sh_cache_size}); +#endif + } + void GetFluidPropertiesData() { @@ -589,9 +596,6 @@ namespace FluidProperties { cNumericFieldNames = ""; lNumericFieldBlanks = false; -#ifdef EP_cache_GlycolSpecificHeat - cached_t_sh.allocate({0, t_sh_cache_size}); -#endif // Check to see if there is any FluidName input. If not, this is okay as // long as the user only desires to simulate loops with water. More than // one FluidName input is not allowed. diff --git a/src/EnergyPlus/FluidProperties.hh b/src/EnergyPlus/FluidProperties.hh index 48bb1bb0ae6..0c6a92837c1 100644 --- a/src/EnergyPlus/FluidProperties.hh +++ b/src/EnergyPlus/FluidProperties.hh @@ -381,6 +381,8 @@ namespace FluidProperties { void clear_state(); + void InitializeGlycRoutines(); + void GetFluidPropertiesData(); //***************************************************************************** diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 9c230d4b0cc..c10555c4953 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include diff --git a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc index 9f8ff1cc2b5..90b22bf8f95 100644 --- a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -77,6 +78,7 @@ TEST_F(EnergyPlusFixture, BaseboardConvWater_SizingTest) int BaseboardNum(0); int CntrlZoneNum(0); bool FirstHVACIteration(false); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", diff --git a/tst/EnergyPlus/unit/BoilerHotWater.unit.cc b/tst/EnergyPlus/unit/BoilerHotWater.unit.cc index 50e646eb3c6..512d8b5fc60 100644 --- a/tst/EnergyPlus/unit/BoilerHotWater.unit.cc +++ b/tst/EnergyPlus/unit/BoilerHotWater.unit.cc @@ -64,6 +64,8 @@ using namespace EnergyPlus::DataSizing; TEST_F(EnergyPlusFixture, Boiler_HotWaterSizingTest) { + + FluidProperties::InitializeGlycRoutines(); // unit test for autosizing boiler nominal capacity in Boiler:HotWater Boilers::Boiler.allocate(1); // Hardsized Hot Water Boiler @@ -110,6 +112,7 @@ TEST_F(EnergyPlusFixture, Boiler_HotWaterAutoSizeTempTest) { // unit test for checking hot water temperature for autosizing // boiler nominal capacity in Boiler:HotWater + FluidProperties::InitializeGlycRoutines(); Boilers::Boiler.allocate(1); // Autosized Hot Water Boiler diff --git a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc index 0a170a309f5..3edc714032c 100644 --- a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ using namespace ObjexxFCL; TEST_F(EnergyPlusFixture, ChillerAbsorption_Calc) { + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Version,9.2;", diff --git a/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc b/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc index 49e94c948a4..97ffed8b2fb 100644 --- a/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc +++ b/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -74,6 +75,7 @@ TEST_F(EnergyPlusFixture, ChillerConstantCOP_WaterCooled_Autosize) DataGlobals::NumOfTimeStepInHour = 1; DataGlobals::TimeStep = 1; DataGlobals::MinutesPerTimeStep = 60; + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Chiller:ConstantCOP,", diff --git a/tst/EnergyPlus/unit/ChillerElectric.unit.cc b/tst/EnergyPlus/unit/ChillerElectric.unit.cc index 39b78d0f223..8e21f69fd59 100644 --- a/tst/EnergyPlus/unit/ChillerElectric.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectric.unit.cc @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -74,6 +75,7 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Autosize) DataGlobals::NumOfTimeStepInHour = 1; DataGlobals::TimeStep = 1; DataGlobals::MinutesPerTimeStep = 60; + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Chiller:Electric,", diff --git a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc index ba68c6f3ce7..b840d78e37f 100644 --- a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc @@ -56,8 +56,8 @@ #include #include #include +#include #include - #include "Fixtures/EnergyPlusFixture.hh" using namespace EnergyPlus; @@ -99,6 +99,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_TestOutletNodeConditions) TEST_F(EnergyPlusFixture, ElectricEIRChiller_HeatRecoveryAutosizeTest) { // unit test for autosizing heat recovery in Chiller:Electric:EIR + FluidProperties::InitializeGlycRoutines(); ChillerElectricEIR::ElectricEIRChiller.allocate(1); ChillerElectricEIR::ElectricEIRChiller(1).SizFac = 1.0; @@ -130,6 +131,8 @@ TEST_F(EnergyPlusFixture, ElectricEIRChiller_HeatRecoveryAutosizeTest) DataPlant::PlantFirstSizesOkayToFinalize = true; + FluidProperties::InitializeGlycRoutines(); + // now call sizing routine ChillerElectricEIR::SizeElectricEIRChiller(1); // see if heat recovery flow rate is as expected @@ -154,6 +157,7 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_AirCooledChiller) DataGlobals::MinutesPerTimeStep = 60; Psychrometrics::InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ "Chiller:Electric:EIR,", diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index 9c632be8564..c5d3ca1e1fa 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -490,6 +491,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_MerkelNoCooling) DataGlobals::BeginSimFlag = true; SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); + FluidProperties::InitializeGlycRoutines(); // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation @@ -883,6 +885,8 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); + FluidProperties::InitializeGlycRoutines(); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -1315,6 +1319,8 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUserInputTowerSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); + FluidProperties::InitializeGlycRoutines(); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -1730,6 +1736,8 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_TwoSpeedUserInputTowerSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); + FluidProperties::InitializeGlycRoutines(); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -2214,6 +2222,8 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_MerkelUserInputTowerSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); + FluidProperties::InitializeGlycRoutines(); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -2641,6 +2651,8 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_TwoSpeedTowerLowSpeedNomCapSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); + FluidProperties::InitializeGlycRoutines(); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -3037,6 +3049,8 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUser_SizingError_Sizing SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); + FluidProperties::InitializeGlycRoutines(); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -3437,6 +3451,8 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUser_SizingError_UserSp SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); + FluidProperties::InitializeGlycRoutines(); + // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); diff --git a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc index 6f60a748896..782686dbdb9 100644 --- a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc +++ b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -5425,6 +5426,8 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_RegenAirHeaterHWCoilSizingTest) DataSizing::CurSysNum = 1; DataSizing::CurOASysNum = 0; + FluidProperties::InitializeGlycRoutines(); + GetDesiccantDehumidifierInput(); EXPECT_EQ(1, NumDesicDehums); EXPECT_EQ(1, NumGenericDesicDehums); diff --git a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc index 5448fcdcb9c..de28fb5285e 100644 --- a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc +++ b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc @@ -65,6 +65,7 @@ #include #include #include +#include #include #include #include @@ -133,6 +134,7 @@ TEST_F(EnergyPlusFixture, MultiStage4PipeFanCoilHeatingTest) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -444,6 +446,7 @@ TEST_F(EnergyPlusFixture, MultiStage4PipeFanCoilCoolingTest) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -757,6 +760,7 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilHeatingTest) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -1144,6 +1148,7 @@ TEST_F(EnergyPlusFixture, ElectricCoilFanCoilHeatingTest) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -1452,6 +1457,7 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilCoolingTest) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -1805,6 +1811,7 @@ TEST_F(EnergyPlusFixture, FanCoil_ASHRAE90VariableFan) DataSizing::CurZoneEqNum = 1; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -2219,6 +2226,7 @@ TEST_F(EnergyPlusFixture, Test_TightenWaterFlowLimits) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone, EAST ZONE, 0, 0, 0, 0, 1, 1, autocalculate, autocalculate;", @@ -2505,6 +2513,7 @@ TEST_F(EnergyPlusFixture, FanCoil_CyclingFanMode) DataSizing::CurZoneEqNum = 1; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -2908,6 +2917,7 @@ TEST_F(EnergyPlusFixture, FanCoil_FanSystemModelCyclingFanMode) DataSizing::CurZoneEqNum = 1; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", diff --git a/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc b/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc index 7f5f2dfe27e..112af19ab4c 100644 --- a/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc +++ b/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -181,6 +182,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_GetGFunc) TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_Slinky_CalcHXResistance) { // Initializations + FluidProperties::InitializeGlycRoutines(); GLHESlinky thisGLHE; PlantLoop.allocate(1); @@ -1187,6 +1189,8 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcGFunction_Check) SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); + FluidProperties::InitializeGlycRoutines(); + auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20; @@ -1669,6 +1673,8 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calc_pipe_convection_re SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); + FluidProperties::InitializeGlycRoutines(); + auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 13.0; @@ -1973,6 +1979,8 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calc_pipe_resistance) SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); + FluidProperties::InitializeGlycRoutines(); + auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 13.0; @@ -2269,6 +2277,8 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHGroutResistance_1 SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); + FluidProperties::InitializeGlycRoutines(); + auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20.0; @@ -2571,6 +2581,7 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHGroutResistance_2 thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20.0; thisGLHE.massFlowRate = 1; + FluidProperties::InitializeGlycRoutines(); Real64 const tolerance = 0.00001; @@ -2865,6 +2876,8 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHGroutResistance_3 SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); + FluidProperties::InitializeGlycRoutines(); + auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20.0; @@ -3170,6 +3183,8 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHTotalInternalResi Real64 const tolerance = 0.00001; + FluidProperties::InitializeGlycRoutines(); + // Flow rate and pipe thickness picked to fix pipe resistance at 0.05 EXPECT_NEAR(thisGLHE.theta_1, 0.33333, tolerance); EXPECT_NEAR(thisGLHE.theta_2, 3.0, tolerance); @@ -3461,6 +3476,8 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHTotalInternalResi SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); + FluidProperties::InitializeGlycRoutines(); + auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20.0; @@ -3759,6 +3776,8 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHTotalInternalResi SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); + FluidProperties::InitializeGlycRoutines(); + auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20.0; diff --git a/tst/EnergyPlus/unit/HVACControllers.unit.cc b/tst/EnergyPlus/unit/HVACControllers.unit.cc index 4e348e4eef1..462ec5a6e68 100644 --- a/tst/EnergyPlus/unit/HVACControllers.unit.cc +++ b/tst/EnergyPlus/unit/HVACControllers.unit.cc @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -196,6 +197,7 @@ TEST_F(EnergyPlusFixture, HVACControllers_TestTempAndHumidityRatioCtrlVarType) }); ASSERT_TRUE(process_idf(idf_objects)); + FluidProperties::InitializeGlycRoutines(); GetSetPointManagerInputs(); // check specified control variable type is "HumidityRatio" diff --git a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc index 051642652a0..bf909a4d7b2 100644 --- a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc +++ b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -1733,6 +1734,8 @@ TEST_F(EnergyPlusFixture, Beam_sizeandSimulateOneZone) DataGlobals::DoingSizing = false; DataGlobals::KickOffSimulation = true; + FluidProperties::InitializeGlycRoutines(); + WeatherManager::ResetEnvironmentCounter(); TestAirPathIntegrity(ErrorsFound); // Needed to initialize return node connections to airloops and inlet nodes SimulationManager::SetupSimulation(ErrorsFound); @@ -3293,6 +3296,8 @@ TEST_F(EnergyPlusFixture, Beam_fatalWhenSysSizingOff) DataGlobals::BeginSimFlag = true; SimulationManager::GetProjectData(); + FluidProperties::InitializeGlycRoutines(); + OutputReportPredefined::SetPredefinedTables(); HeatBalanceManager::SetPreConstructionInputParameters(); // establish array bounds for constructions early // OutputProcessor::TimeValue.allocate(2); diff --git a/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc b/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc index c1a83dffc02..823fa44c352 100644 --- a/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc @@ -59,6 +59,7 @@ #include #include #include +#include namespace EnergyPlus { TEST_F(EnergyPlusFixture, ExcessiveHeatStorage_Test) @@ -85,6 +86,7 @@ TEST_F(EnergyPlusFixture, ExcessiveHeatStorage_Test) DataLoopNode::Node.allocate(TotNumLoops); DataLoopNode::Node(1).Temp = 100; DataLoopNode::Node(1).MassFlowRate = 10; + FluidProperties::InitializeGlycRoutines(); // LoopSideInlet_MdotCpDeltaT should be < LoopSideInlet_McpDTdt // Therefore CapExcessStorageTime AND TotalTime will increase by 1 timestep diff --git a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc index a7772426185..24f4b11bb54 100644 --- a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include @@ -1329,6 +1330,8 @@ TEST_F(EnergyPlusFixture, HVACMultiSpeedHeatPump_HeatRecoveryTest) DataPlant::PlantLoop(1).FluidName = "WATER"; DataPlant::PlantLoop(1).FluidIndex = 1; + FluidProperties::InitializeGlycRoutines(); + DataLoopNode::Node(HeatRecInNode).MassFlowRate = 0.0; // test heat recovery result with 0 water flow rate HVACMultiSpeedHeatPump::MSHPHeatRecovery(1); diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index b54bc250549..48770f3527b 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -4943,6 +4943,8 @@ TEST_F(EnergyPlusFixture, VRFTest_SysCurve_WaterCooled) DataZoneEnergyDemands::ZoneSysEnergyDemand.allocate(1); + InitializeGlycRoutines(); + Array2D DummyArray; // Sky temperature DataGlobals::NumOfTimeStepInHour = 4; DataGlobals::MinutesPerTimeStep = 60 / DataGlobals::NumOfTimeStepInHour; @@ -5768,6 +5770,8 @@ TEST_F(EnergyPlusFixture, VRFTest_TU_NoLoad_OAMassFlowRateTest) HeatBalanceManager::GetZoneData(ErrorsFound); // read zone data EXPECT_FALSE(ErrorsFound); + InitializeGlycRoutines(); + DataZoneEquipment::GetZoneEquipmentData(); // read equipment list and connections HVACVariableRefrigerantFlow::MyEnvrnFlag = true; ZoneInletAirNode = GetVRFTUZoneInletAirNode(VRFTUNum); // trigger GetVRFInput by calling a mining function @@ -5830,6 +5834,7 @@ TEST_F(EnergyPlusFixture, VRFTest_CondenserCalcTest) ASSERT_TRUE(process_idf(idf_objects)); CurveManager::GetCurveInput(); + InitializeGlycRoutines(); int VRFCond = 1; VRF.allocate(1); @@ -7179,7 +7184,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SupplementalHeatingCoilGetInput) }); ASSERT_TRUE(process_idf(idf_objects)); - + InitializeGlycRoutines(); // get zone data bool ErrorsFound(false); GetZoneData(ErrorsFound); @@ -7268,6 +7273,7 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilElectric) DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).HumRat = 0.0070; DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW( DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).Temp, DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).HumRat); + InitializeGlycRoutines(); bool FirstHVACIteration(false); Real64 SuppHeatCoilLoad = 10000.0; @@ -7333,6 +7339,8 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilFuel) DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW( DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).Temp, DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).HumRat); + InitializeGlycRoutines(); + bool FirstHVACIteration(false); Real64 SuppHeatCoilLoad = 10000.0; // run supplemental heating coil @@ -7407,6 +7415,8 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilWater) PlantSizData(NumPltSizInput).ExitTemp = 60.0; // hot water coil inlet water temp PlantSizData(NumPltSizInput).DeltaT = 10.0; // loop temperature difference + InitializeGlycRoutines(); + // set up plant loop TotNumLoops = 1; PlantLoop.allocate(TotNumLoops); diff --git a/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc index 2193d65e189..c4147ac4e85 100644 --- a/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc @@ -104,6 +104,8 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_CalcHWBaseboard) PlantLoop(1).FluidType = 2; QBBRadSource(1) = 0.0; + FluidProperties::InitializeGlycRoutines(); + CalcHWBaseboard(BBNum, LoadMet); EXPECT_NEAR(14746.226690452937, HWBaseboard(1).TotPower, 0.000001); diff --git a/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc b/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc index d8366225ed8..0cf9b31b370 100644 --- a/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc +++ b/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -721,6 +722,8 @@ TEST_F(EnergyPlusFixture, PlantLoopSourceSideTest) BranchInputManager::ManageBranchInput(); // just gets input and + FluidProperties::InitializeGlycRoutines(); + DataGlobals::DoingSizing = false; DataGlobals::KickOffSimulation = true; @@ -812,6 +815,7 @@ TEST_F(EnergyPlusFixture, PlantLoopSourceSideTest) TEST_F(EnergyPlusFixture, WWHP_AutosizeTest1) { // this test is for checking autosizing of heating WWHP. derived from unit test PlantLoopSourceSideTest + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({"Schedule:Constant,Radiator massflow temporary,Any value sch,1;", "Schedule:Constant,Radiator supply temperature temporary,Any value sch,40;", diff --git a/tst/EnergyPlus/unit/HeatRecovery.unit.cc b/tst/EnergyPlus/unit/HeatRecovery.unit.cc index 158bc55040c..9a9d0e28c10 100644 --- a/tst/EnergyPlus/unit/HeatRecovery.unit.cc +++ b/tst/EnergyPlus/unit/HeatRecovery.unit.cc @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -490,6 +491,7 @@ TEST_F(EnergyPlusFixture, HeatRecoveryHXOnMainBranch_SimHeatRecoveryTest) Real64 Qhr_HeatingRateTot(0.0); int InletNode(0); // Heat Recovery primary air inlet node number int OutletNode(0); // Heat Recovery primary air outlet node number + FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ diff --git a/tst/EnergyPlus/unit/Humidifiers.unit.cc b/tst/EnergyPlus/unit/Humidifiers.unit.cc index 7f1fd7149d1..654a6c50d18 100644 --- a/tst/EnergyPlus/unit/Humidifiers.unit.cc +++ b/tst/EnergyPlus/unit/Humidifiers.unit.cc @@ -59,6 +59,7 @@ #include #include #include +#include #include #include @@ -79,6 +80,7 @@ TEST_F(EnergyPlusFixture, Humidifiers_Sizing) NumElecSteamHums = 0; NumGasSteamHums = 1; NumHumidifiers = 1; + FluidProperties::InitializeGlycRoutines(); HumidifierData thisHum; @@ -114,6 +116,7 @@ TEST_F(EnergyPlusFixture, Humidifiers_AutoSizing) NumElecSteamHums = 0; NumGasSteamHums = 1; NumHumidifiers = 1; + FluidProperties::InitializeGlycRoutines(); HumidifierData thisHum; @@ -154,6 +157,7 @@ TEST_F(EnergyPlusFixture, Humidifiers_EnergyUse) TimeStepSys = 0.25; SysSizingRunDone = true; CurSysNum = 1; + FluidProperties::InitializeGlycRoutines(); NumElecSteamHums = 0; NumGasSteamHums = 1; @@ -229,6 +233,7 @@ TEST_F(EnergyPlusFixture, Humidifiers_GetHumidifierInput) }); ASSERT_TRUE(process_idf(idf_objects)); + FluidProperties::InitializeGlycRoutines(); GetHumidifierInput(); ASSERT_EQ(1, NumHumidifiers); @@ -244,6 +249,7 @@ TEST_F(EnergyPlusFixture, Humidifiers_ThermalEfficiency) TimeStepSys = 0.25; SysSizingRunDone = true; CurSysNum = 1; + FluidProperties::InitializeGlycRoutines(); NumElecSteamHums = 0; NumGasSteamHums = 1; diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index 2820e42e64d..c0ec8d932ee 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -1102,6 +1102,8 @@ TEST_F(EnergyPlusFixture, AutosizeLowTempRadiantVariableFlowTest) }); ASSERT_TRUE(process_idf(idf_objects)); + InitializeGlycRoutines(); + GetProjectControlData(ErrorsFound); EXPECT_FALSE(ErrorsFound); @@ -1810,6 +1812,8 @@ TEST_F(LowTempRadiantSystemTest, LowTempRadCalcRadSysHXEffectTermTest) Real64 HXEffectFuncResult; int GlycolIndex = 0; + InitializeGlycRoutines(); + // Set values of items that will stay constant for all calls to HX Effectiveness function RadSysNum = 1; WaterMassFlow = 0.1; diff --git a/tst/EnergyPlus/unit/MixedAir.unit.cc b/tst/EnergyPlus/unit/MixedAir.unit.cc index 0d9be869f09..acb6b20b23e 100644 --- a/tst/EnergyPlus/unit/MixedAir.unit.cc +++ b/tst/EnergyPlus/unit/MixedAir.unit.cc @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -1213,6 +1214,8 @@ TEST_F(EnergyPlusFixture, MixedAir_HumidifierOnOASystemTest) DataEnvironment::DayOfYear_Schedule = 1; ScheduleManager::UpdateScheduleValues(); + FluidProperties::InitializeGlycRoutines(); + GetOASysInputFlag = true; DataGlobals::BeginEnvrnFlag = true; int AirloopNum = 1; diff --git a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc index 1729e7a3aa9..49ddc3b12a3 100644 --- a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc +++ b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc @@ -55,6 +55,7 @@ #include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include #include @@ -1039,6 +1040,8 @@ TEST_F(EnergyPlusFixture, OASystem_HotWaterPreheatCoilScheduledOffSim) }); ASSERT_TRUE(process_idf(idf_objects)); + FluidProperties::InitializeGlycRoutines(); + // OutputProcessor::TimeValue.allocate(2); SimulationManager::ManageSimulation(); @@ -2017,6 +2020,8 @@ TEST_F(EnergyPlusFixture, OASystem_HotWaterPreheatCoilScheduledOnSim) }); ASSERT_TRUE(process_idf(idf_objects)); + FluidProperties::InitializeGlycRoutines(); + // OutputProcessor::TimeValue.allocate(2); SimulationManager::ManageSimulation(); diff --git a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc index 7642bcb5d5b..673c1e7edc4 100644 --- a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc +++ b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc @@ -554,6 +554,7 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_WaterCoolingCoilAutoSizeTest) DataGlobals::DoingSizing = true; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); bool ErrorsFound(false); GetZoneData(ErrorsFound); @@ -860,6 +861,7 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_SteamHeatingCoilAutoSizeTest) DataGlobals::DoingSizing = true; InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); bool ErrorsFound(false); GetZoneData(ErrorsFound); diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index d193ebec39e..8c53568f30f 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -438,6 +439,8 @@ TEST_F(EnergyPlusFixture, PackagedTerminalHP_VSCoils_Sizing) ASSERT_TRUE(process_idf(idf_objects)); + FluidProperties::InitializeGlycRoutines(); + // Test for #7053: // Fake that there is at least one UnitarySystemPerformance:Multispeed object UnitarySystems::DesignSpecMSHP fakeDesignSpecMSHP; diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 860d942637b..82aff48904a 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -119,6 +120,8 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterChWSetPointManager) mySPM.maximumChilledWaterSetpoint = 10; mySPM.returnTemperatureConstantTarget = 12; + FluidProperties::InitializeGlycRoutines(); + // test 1: normal, in range DataLoopNode::Node(1).Temp = 11; DataLoopNode::Node(2).Temp = 7; diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index adbc1df696e..4fcf9ae34d3 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -3561,6 +3562,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryCoolingSystem) DataEnvironment::OutBaroPress = 101325.0; DataEnvironment::StdRhoAir = 1.20; Psychrometrics::InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); thisSys.m_MultiOrVarSpeedHeatCoil = true; thisSys.m_MultiOrVarSpeedCoolCoil = true; diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 0f96ff67954..854ed42fafc 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -162,6 +162,7 @@ class WaterCoilsTest : public EnergyPlusFixture TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) { + InitializeGlycRoutines(); OutBaroPress = 101325.0; StdRhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, 20.0, 0.0); @@ -820,6 +821,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) { InitializePsychRoutines(); + InitializeGlycRoutines(); OutBaroPress = 101325.0; StdRhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, 20.0, 0.0); ShowMessage("Begin Test: WaterCoilsTest, CoilCoolingWaterSimpleSizing"); @@ -921,6 +923,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) { InitializePsychRoutines(); + InitializeGlycRoutines(); OutBaroPress = 101325.0; StdRhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, 20.0, 0.0); ShowMessage("Begin Test: WaterCoilsTest, CoilCoolingWaterDetailedSizing"); From 7a35c52c9be5dc9078388e6a8568fb0ab0c859ce Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Thu, 5 Sep 2019 13:33:51 -0500 Subject: [PATCH 041/136] Step 01 - Clean up comments - No diffs --- src/EnergyPlus/CondenserLoopTowers.cc | 577 +------------------------- src/EnergyPlus/CondenserLoopTowers.hh | 60 --- 2 files changed, 6 insertions(+), 631 deletions(-) diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index f266d355708..a2d9b4f1808 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -130,9 +130,6 @@ namespace CondenserLoopTowers { // Empirical Model Type int const CoolToolsXFModel(1); - // CoolTools counterflow model does not work properly. The empirical model seems flawed since the tower - // operates in the free convection regime on the design day. - // INTEGER, PARAMETER :: CoolToolsCFModel = 2 int const CoolToolsUserDefined(3); int const YorkCalcModel(4); int const YorkCalcUserDefined(5); @@ -164,22 +161,15 @@ namespace CondenserLoopTowers { static std::string const BlankString; - // DERIVED TYPE DEFINITIONS - - // MODULE VARIABLE DECLARATIONS: int NumSimpleTowers(0); // Number of similar towers bool GetInput(true); bool InitTowerOneTimeFlag(true); - //? The following block of variables are used to carry model results for a tower instance - // across sim, update, and report routines. Simulation manager must be careful - // in models with multiple towers. Real64 InletWaterTemp(0.0); // CW temperature at tower inlet Real64 OutletWaterTemp(0.0); // CW temperature at tower outlet int WaterInletNode(0); // Node number at tower inlet int WaterOutletNode(0); // Node number at tower outlet Real64 WaterMassFlowRate(0.0); // WaterMassFlowRate through tower - Real64 Qactual(0.0); // Tower heat transfer Real64 CTFanPower(0.0); // Tower fan power used Real64 AirFlowRateRatio(0.0); // Ratio of air flow rate through VS cooling tower to design air flow rate @@ -189,16 +179,6 @@ namespace CondenserLoopTowers { Array1D_bool CheckEquipName; - // SUBROUTINE SPECIFICATIONS FOR MODULE CondenserLoopTowers - - // Driver/Manager Routines - - // Get Input routines for module - - // Initialization routines for module - - // Update routines to check convergence and update nodes - // Object Data Array1D SimpleTower; // dimension to number of machines Array1D SimpleTowerInlet; // inlet conditions @@ -206,11 +186,6 @@ namespace CondenserLoopTowers { Array1D VSTower; // model coefficients and specific variables for VS tower std::unordered_map UniqueSimpleTowerNames; - // MODULE SUBROUTINES: - - // Beginning of CondenserLoopTowers Module Driver Subroutines - //************************************************************************* - // Functions void clear_state() { @@ -266,8 +241,6 @@ namespace CondenserLoopTowers { // then calls the appropriate subroutine to calculate tower performance, // update records (node info) and writes output report info. - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - int TowerNum; // GET INPUT @@ -387,12 +360,6 @@ namespace CondenserLoopTowers { } // TypeOfEquip } - // End CondenserLoopTowers Module Driver Subroutines - //****************************************************************************** - - // Beginning of CondenserLoopTowers Module Get Input subroutines - //****************************************************************************** - void GetTowerInput() { @@ -1284,43 +1251,6 @@ namespace CondenserLoopTowers { if (UtilityRoutines::SameString(AlphArray(4), "CoolToolsCrossFlow")) { SimpleTower(TowerNum).TowerModelType = CoolToolsXFModel; // set cross-flow model coefficients - // Outputs approach in F - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(1) = -2.1985908408527 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(2) = -24.3108065555106 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(3) = 21.9333667825398 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(4) = -4.94979078884808 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(5) = 14.6788552214526 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(6) = -15.4612468065777 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(7) = 2.83753688605444 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(8) = 10.0023162199558 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(9) = 2.70780345372045 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(10) = -5.91993527180418 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(11) = 0.194222288920726 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(12) = 0.142543400927955 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(13) = -0.0818947291400898 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(14) = -0.169584760441541 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(15) = 0.0186741309635284 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(16) = 0.0536824177590012 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(17) = -0.00375848174056975 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(18) = 0.000623763881051551 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(19) = -0.000709769430542879 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(20) = 0.0000234697776728891 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(21) = 2.45541543720225 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(22) = -0.607566456611435 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(23) = 0.117339576910507 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(24) = 1.64648551160799 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(25) = -0.135898905926974 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(26) = -0.152577581866506 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(27) = -0.034055419164321 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(28) = 0.00274052705314173 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(29) = -0.00442366885652332 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(30) = 0.0000687098236486247 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(31) = -0.0416435261408276 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(32) = 0.00263481599534274 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(33) = -0.010325259545311 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(34) = 0.000356999078067433 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(35) = 0.000249188476685273 - // Outputs approach in C VSTower(SimpleTower(TowerNum).VSTower).Coeff(1) = 0.52049709836241; VSTower(SimpleTower(TowerNum).VSTower).Coeff(2) = -10.617046395344; @@ -1368,126 +1298,9 @@ namespace CondenserLoopTowers { VSTower(SimpleTower(TowerNum).VSTower).MinWaterFlowRatio = 0.75; VSTower(SimpleTower(TowerNum).VSTower).MaxWaterFlowRatio = 1.25; - // CoolTools counterflow model does not work properly. The empirical model seems flawed since the tower - // operates in the free convection regime on the design day. - // ELSEIF(UtilityRoutines::SameString(AlphArray(5),'COOLTOOLS COUNTERFLOW'))THEN - // SimpleTower(TowerNum)%TowerModelType = CoolToolsCFModel - //! set counter-flow model coefficients - //! Outputs approach in F - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(1) = -4.48760943345722 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(2) = 0.741749875850003 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(3) = 1.74679844252553 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(4) = -0.397320959632943 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(5) = 19.5106208955792 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(6) = -9.79489761472574 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(7) = 1.96690857354709 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(8) = -1.40803729637148 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(9) = 0.633867141219563 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(10) = -0.517255742412696 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(11) = 0.0546335532842876 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(12) = 0.0468060318806566 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(13) = -0.0244033403339062 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(14) = -0.267365212754448 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(15) = 0.0385664546399435 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(16) = 0.037765628073743 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(17) = -0.000928698541521428 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(18) = -0.000122211107650076 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(19) = 0.000682937021895334 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(20) = 0.00000679217734960548 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(21) = 1.47274732178792 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(22) = -0.869303590626237 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(23) = 0.149995781695274 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(24) = 2.4548219494635 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(25) = -0.161092120908292 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(26) = -0.0830303891087807 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(27) = -0.0251101427687245 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(28) = 0.00430042875730149 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(29) = -0.013969370453107 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(30) = 0.000096171182587938 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(31) = -0.0251558254472348 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(32) = 0.0077094706621763 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(33) = -0.0173842428341529 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(34) = 0.000244578460749651 - //! VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(35) = 0.000123026859143619 - //! Outputs approach in C - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(1) = -1.92653164860338 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(2) = 1.17466595655408 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(3) = 0.536606417689184 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(4) = -0.220733866462746 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(5) = 6.4745897765876 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(6) = -4.75598392569308 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(7) = 1.09272698530394 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(8) = -0.110853998895391 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(9) = 0.352148411788646 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(10) = -0.287364301340387 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(11) = 0.0160624154449042 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(12) = 0.0389845209910517 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(13) = -0.0244033403339062 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(14) = -0.223657243353147 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(15) = 0.0385664546399435 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(16) = 0.037765628073743 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(17) = -0.000497969128726743 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(18) = -0.000219979993770137 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(19) = 0.0012292866394116 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(20) = 0.0000220066546127218 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(21) = 0.767702044158785 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(22) = -0.731689870392589 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(23) = 0.149995781695274 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(24) = 2.00780209496408 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(25) = -0.161092120908292 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(26) = -0.0830303891087807 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(27) = -0.0341193367495736 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(28) = 0.00774077176314268 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(29) = -0.0251448668155926 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(30) = 0.000311594631584919 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(31) = -0.0311927664658427 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(32) = 0.0138770471919173 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(33) = -0.0312916371014752 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(34) = 0.000792434212828869 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(35) = 0.000398607023625325 - - //! set minimum and maximum boundaries for CoolTools counterflow model input variables - // VSTower(SimpleTower(TowerNum)%VSTower)%MinInletAirWBTemp = -1.0 - // VSTower(SimpleTower(TowerNum)%VSTower)%MaxInletAirWBTemp = 26.6667 - // VSTower(SimpleTower(TowerNum)%VSTower)%MinRangeTemp = 1.1111 - // VSTower(SimpleTower(TowerNum)%VSTower)%MaxRangeTemp = 11.1111 - // VSTower(SimpleTower(TowerNum)%VSTower)%MinApproachTemp = 1.1111 - // VSTower(SimpleTower(TowerNum)%VSTower)%MaxApproachTemp = 11.1111 - // VSTower(SimpleTower(TowerNum)%VSTower)%MinWaterFlowRatio = 0.75 - // VSTower(SimpleTower(TowerNum)%VSTower)%MaxWaterFlowRatio = 1.25 - } else if (UtilityRoutines::SameString(AlphArray(4), "YorkCalc")) { SimpleTower(TowerNum).TowerModelType = YorkCalcModel; // set counter-flow model coefficients - // Outputs approach in F - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(1) = 2.471005863 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(2) = -0.139855144 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(3) = 0.001325024 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(4) = 0.768721437 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(5) = -0.023370562 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(6) = 0.000149476 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(7) = -0.01116139 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(8) = 0.000325406 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(9) = -0.00000230183 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(10) = 9.852803844 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(11) = -0.173673565 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(12) = 0.000811069 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(13) = 1.749920395 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(14) = 0.004930143 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(15) = -0.00022193 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(16) = -0.009865402 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(17) = -0.000283361 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(18) = 0.00000466261 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(19) = 0.09746009 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(20) = -0.011167959 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(21) = 0.000138903 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(22) = -0.135414837 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(23) = 0.001004747 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(24) = 0.0000119203 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(25) = -0.002255673 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(26) = 0.0000192893 - // VSTower(SimpleTower(TowerNum)%VSTower)%Coeff(27) = -0.000000260086 - // Outputs approach in C VSTower(SimpleTower(TowerNum).VSTower).Coeff(1) = -0.359741205; VSTower(SimpleTower(TowerNum).VSTower).Coeff(2) = -0.055053608; @@ -1606,8 +1419,7 @@ namespace CondenserLoopTowers { } } else { ShowSevereError(cCurrentModuleObject + " \"" + SimpleTower(TowerNum).Name + "\". Illegal Tower Model Type = " + AlphArray(5)); - ShowContinueError( - " Tower Model Type must be \"CoolToolsCrossFlow\", \"YorkCalc\", \"CoolToolsUserDefined\", or \"YorkCalcUserDefined."); + ShowContinueError(R"( Tower Model Type must be "CoolToolsCrossFlow", "YorkCalc", "CoolToolsUserDefined", or "YorkCalcUserDefined.)"); ErrorsFound = true; } @@ -1746,14 +1558,6 @@ namespace CondenserLoopTowers { // for autosizing calculations (see SizeTower) SimpleTower(TowerNum).PerformanceInputMethod_Num = PIM_UFactor; - // Makeup water drift percentage must be greater than or equal to 0 - // SimpleTower(TowerNum)%MakeupWaterDrift = NumArray(10)/100.0 - // IF(NumArray(10) .LT. 0.0) THEN - // CALL ShowSevereError('COOLING TOWER:VARIABLE SPEED, "'//TRIM(SimpleTower(TowerNum)%Name)//& - // '" Makeup Water Drift as a percentage of design water flow rate must be >= 0') - // ErrorsFound = .TRUE. - // END IF - if (!AlphArray(7).empty()) { SimpleTower(TowerNum).BasinHeaterSchedulePtr = GetScheduleIndex(AlphArray(7)); if (SimpleTower(TowerNum).BasinHeaterSchedulePtr == 0) { @@ -1762,15 +1566,6 @@ namespace CondenserLoopTowers { } } - // IF(AlphArray(9) .NE. ' ')THEN - // SimpleTower(TowerNum)%BlowDownSchedulePtr = GetScheduleIndex(AlphArray(9)) - // IF(SimpleTower(TowerNum)%BlowDownSchedulePtr .EQ. 0)THEN - // CALL ShowWarningError('COOLING TOWER:VARIABLE SPEED, "'//TRIM(SimpleTower(TowerNum)%Name)//& - // '" blowdown schedule name "'//TRIM(AlphArray(9)) & - // //'" was not found. Basin blowdown will not be modeled and the simulation continues') - // END IF - // END IF - // begin water use and systems get input if (UtilityRoutines::SameString(AlphArray(8), "LossFactor")) { SimpleTower(TowerNum).EvapLossMode = EvapLossByUserFactor; @@ -1951,11 +1746,7 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).HighSpeedAirFlowRate == AutoSize) { SimpleTower(TowerNum).HighSpeedAirFlowRateWasAutoSized = true; } - if (lNumericFieldBlanks(8)) { - SimpleTower(TowerNum).DefaultedDesignAirFlowScalingFactor = true; - } else { - SimpleTower(TowerNum).DefaultedDesignAirFlowScalingFactor = false; - } + SimpleTower(TowerNum).DefaultedDesignAirFlowScalingFactor = lNumericFieldBlanks(8); SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap = NumArray(8); SimpleTower(TowerNum).MinimumVSAirFlowFrac = NumArray(9); SimpleTower(TowerNum).HighSpeedFanPower = NumArray(10); @@ -2431,9 +2222,6 @@ namespace CondenserLoopTowers { "Plant"); } - // CALL SetupOutputVariable('Tower Makeup Water Consumption [m3]', & - // SimpleTowerReport(TowerNum)%WaterAmountUsed,'System','Sum',SimpleTower(TowerNum)%Name, & - // ResourceTypeKey='Water',EndUseKey='HeatRejection',GroupKey='Plant') } // CurrentModuleObject='CoolingTower:VariableSpeed:Merkel' @@ -2639,12 +2427,6 @@ namespace CondenserLoopTowers { } // loop all towers } - // End of Get Input subroutines for the CondenserLoopTowers Module - //****************************************************************************** - - // Beginning Initialization Section for the CondenserLoopTowers Module - //****************************************************************************** - void InitSimVars() { @@ -2657,41 +2439,11 @@ namespace CondenserLoopTowers { // PURPOSE OF THIS SUBROUTINE: // Initialize the simulation variables. - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // USE STATEMENTS: - // na - - // SUBROUTINE ARGUMENT DEFINITIONS: - // na - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - // na - - // INITIALIZE MODULE LEVEL VARIABLES - InletWaterTemp = 0.0; // CW temperature at tower inlet OutletWaterTemp = 0.0; // CW temperature at tower outlet WaterInletNode = 0; // Node number at tower inlet WaterOutletNode = 0; // Node number at tower outlet WaterMassFlowRate = 0.0; // WaterMassFlowRate through tower - // TowerMassFlowRateMax = 0.0 ! Max Hardware Mass Flow Rate - // TowerMassFlowRateMin = 0.0 ! Min Hardware Mass Flow Rate - // LoopMassFlowRateMaxAvail = 0.0 ! Max Loop Mass Flow Rate available - // LoopMassFlowRateMinAvail = 0.0 ! Min Loop Mass Flow Rate available Qactual = 0.0; // Tower heat transfer CTFanPower = 0.0; // Tower fan power used AirFlowRateRatio = 0.0; // Ratio of air flow rate through VS cooling tower to design air flow rate @@ -2745,10 +2497,6 @@ namespace CondenserLoopTowers { static Array1D_bool OneTimeFlagForEachTower; // LOGICAL :: FatalError int TypeOf_Num(0); - int LoopNum; - int LoopSideNum; - int BranchIndex; - int CompIndex; Real64 rho; // local density of fluid // Do the one time initializations @@ -2793,12 +2541,8 @@ namespace CondenserLoopTowers { } // check if setpoint on outlet node - if ((Node(SimpleTower(TowerNum).WaterOutletNodeNum).TempSetPoint == SensedNodeFlagValue) && - (Node(SimpleTower(TowerNum).WaterOutletNodeNum).TempSetPointHi == SensedNodeFlagValue)) { - SimpleTower(TowerNum).SetpointIsOnOutlet = false; - } else { - SimpleTower(TowerNum).SetpointIsOnOutlet = true; - } + SimpleTower(TowerNum).SetpointIsOnOutlet = !((Node(SimpleTower(TowerNum).WaterOutletNodeNum).TempSetPoint == SensedNodeFlagValue) && + (Node(SimpleTower(TowerNum).WaterOutletNodeNum).TempSetPointHi == SensedNodeFlagValue)); OneTimeFlagForEachTower(TowerNum) = false; } @@ -2847,11 +2591,6 @@ namespace CondenserLoopTowers { SimpleTowerInlet(TowerNum).AirWetBulb = OutWetBulbTemp; } - LoopNum = SimpleTower(TowerNum).LoopNum; - LoopSideNum = SimpleTower(TowerNum).LoopSideNum; - BranchIndex = SimpleTower(TowerNum).BranchNum; - CompIndex = SimpleTower(TowerNum).CompNum; - WaterMassFlowRate = RegulateCondenserCompFlowReqOp(SimpleTower(TowerNum).LoopNum, SimpleTower(TowerNum).LoopSideNum, @@ -2904,9 +2643,6 @@ namespace CondenserLoopTowers { using ReportSizingManager::ReportSizingOutput; using namespace OutputReportPredefined; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: static ObjexxFCL::gio::Fmt OutputFormat("(F6.2)"); static ObjexxFCL::gio::Fmt OutputFormat2("(F9.6)"); @@ -2914,12 +2650,6 @@ namespace CondenserLoopTowers { Real64 const Acc(0.0001); // Accuracy of result static std::string const RoutineName("SizeTower"); - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int PltSizCondNum(0); // Plant Sizing index for condenser loop int SolFla; // Flag of solver @@ -2954,8 +2684,6 @@ namespace CondenserLoopTowers { bool ErrorsFound; Real64 OutWaterTemp; // outlet water temperature during sizing [C] Real64 CoolingOutput; // tower capacity during sizing [W] - Real64 DesTowerInletAirDBTemp; // design tower inlet air dry-bulb temperature - Real64 DesTowerInletAirWBTemp; // design tower inlet air wet-bulb temperature Real64 DesTowerInletWaterTemp; // design tower inlet water temperature Real64 DesTowerExitWaterTemp; // design tower exit water temperature Real64 DesTowerWaterDeltaT; // design tower temperature range @@ -2967,8 +2695,6 @@ namespace CondenserLoopTowers { tmpHighSpeedFanPower = SimpleTower(TowerNum).HighSpeedFanPower; tmpHighSpeedAirFlowRate = SimpleTower(TowerNum).HighSpeedAirFlowRate; tmpLowSpeedAirFlowRate = SimpleTower(TowerNum).LowSpeedAirFlowRate; - DesTowerInletAirWBTemp = SimpleTower(TowerNum).DesInletAirWBTemp; - DesTowerInletAirDBTemp = SimpleTower(TowerNum).DesInletAirDBTemp; // Find the appropriate Plant Sizing object PltSizCondNum = PlantLoop(SimpleTower(TowerNum).LoopNum).PlantSizNum; @@ -3949,15 +3675,6 @@ namespace CondenserLoopTowers { // MODIFIED na // RE-ENGINEERED na - // PURPOSE OF THIS SUBROUTINE: - // - - // METHODOLOGY EMPLOYED: - // - - // REFERENCES: - // na - // Using/Aliasing using namespace DataSizing; using DataPlant::PlantFinalSizesOkayToReport; @@ -3968,20 +3685,11 @@ namespace CondenserLoopTowers { using PlantUtilities::RegisterPlantCompDesignFlow; using ReportSizingManager::ReportSizingOutput; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: int const MaxIte(500); // Maximum number of iterations Real64 const Acc(0.0001); // Accuracy of result static std::string const RoutineName("SizeTower"); - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int PltSizCondNum; // Plant Sizing index for condenser loop int SolFla; // Flag of solver @@ -4942,12 +4650,6 @@ namespace CondenserLoopTowers { } } // namespace CondenserLoopTowers - // End Initialization Section for the CondenserLoopTowers Module - //****************************************************************************** - - // Beginning of the CondenserLoopTowers Module Simulation Subroutines - // ***************************************************************************** - void CalcSingleSpeedTower(int &TowerNum) { @@ -5024,9 +4726,6 @@ namespace CondenserLoopTowers { using FaultsManager::FaultsCondenserSWTSensor; using FaultsManager::FaultsTowerFouling; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalcSingleSpeedTower"); int const MaxIteration(100); // Maximum fluid bypass iteration calculations @@ -5037,12 +4736,6 @@ namespace CondenserLoopTowers { // for glycols, it can be much lower. The fluid type is stored at the loop. // Current choices are Water and Steam, needs to expand for glycols - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 AirFlowRate; Real64 UAdesign; // UA value at design conditions (entered by user or calculated) @@ -5165,7 +4858,7 @@ namespace CondenserLoopTowers { // MassFlowTolerance is a parameter to indicate a no flow condition if (WaterMassFlowRate <= MassFlowTolerance) { - // for multiple cells, we assume that it's a commun bassin + // for multiple cells, we assume that it's a common basin CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, @@ -5394,18 +5087,9 @@ namespace CondenserLoopTowers { using FaultsManager::FaultsCondenserSWTSensor; using FaultsManager::FaultsTowerFouling; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalcTwoSpeedTower"); - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 AirFlowRate; Real64 UAdesign; // UA value at design conditions (entered by user) [W/C] @@ -5622,9 +5306,6 @@ namespace CondenserLoopTowers { // METHODOLOGY EMPLOYED: // Find a fan speed that operates the tower to meet MyLoad - // REFERENCES: - // na - // Using/Aliasing using CurveManager::CurveValue; using DataBranchAirLoopPlant::MassFlowTolerance; @@ -5638,21 +5319,12 @@ namespace CondenserLoopTowers { using General::RoundSigDigits; using General::SolveRoot; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: Real64 const DesignWetBulb(25.56); // tower outdoor air entering wetbulb for design [C] int const MaxIte(500); // Maximum number of iterations for solver Real64 const Acc(1.e-3); // Accuracy of solver result static std::string const RoutineName("CalcMerkelVariableSpeedTower"); - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Array1D Par(8); // Parameter array passed to solver int SolFla; // Flag of solver @@ -5956,23 +5628,12 @@ namespace CondenserLoopTowers { // MODIFIED na // RE-ENGINEERED na - // PURPOSE OF THIS FUNCTION: - // - - // METHODOLOGY EMPLOYED: - // - - // REFERENCES: - // na - // Using/Aliasing using CurveManager::CurveValue; // Return value Real64 Residuum; // residual to be minimized to zero - // Argument array dimensioning - // Locals // FUNCTION ARGUMENT DEFINITIONS: // par(2) =MyLoad [W] , negative is cooling @@ -5983,15 +5644,6 @@ namespace CondenserLoopTowers { // par(7) = specific heat of water at inlet temp // par(8) = water mass flow rate, total [kg/s] - // FUNCTION PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - // FUNCTION LOCAL VARIABLE DECLARATIONS: int TowerNum; Real64 WaterMassFlowRatePerCell; @@ -6093,9 +5745,6 @@ namespace CondenserLoopTowers { using General::CreateSysTimeIntervalString; using General::SolveRoot; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: static ObjexxFCL::gio::Fmt OutputFormat("(F5.2)"); static ObjexxFCL::gio::Fmt OutputFormat2("(F8.5)"); @@ -6103,12 +5752,6 @@ namespace CondenserLoopTowers { Real64 const Acc(0.0001); // Accuracy of result static std::string const RoutineName("CalcVariableSpeedTower"); - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 OutletWaterTempOFF; // Outlet water temperature with fan OFF (C) Real64 OutletWaterTempON; // Outlet water temperature with fan ON at maximum fan speed (C) @@ -6451,14 +6094,9 @@ namespace CondenserLoopTowers { // Merkel, F. 1925. Verduftungskuhlung. VDI Forschungsarbeiten, Nr 275, Berlin. // ASHRAE 1999. HVAC1KIT: A Toolkit for Primary HVAC System Energy Calculations. - // USE STATEMENTS: - // na - // Locals Real64 Qactual; // Actual heat transfer rate between tower water and air [W] - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: int const IterMax(50); // Maximum number of iterations allowed Real64 const WetBulbTolerance(0.00001); // Maximum error for exiting wet-bulb temperature between iterations @@ -6466,12 +6104,6 @@ namespace CondenserLoopTowers { Real64 const DeltaTwbTolerance(0.001); // Maximum error (tolerance) in DeltaTwb for iteration convergence [C] static std::string const RoutineName("SimSimpleTower"); - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int Iter; // Number of iterations completed Real64 MdotCpWater; // Water mass flow rate times the heat capacity [W/K] @@ -6615,19 +6247,10 @@ namespace CondenserLoopTowers { using DataPlant::SingleSetPoint; using General::SolveRoot; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: int const MaxIte(500); // Maximum number of iterations Real64 const Acc(0.0001); // Accuracy of result - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: int SolFla; // Flag of solver Array1D Par(4); // Parameter array for regula falsi solver @@ -6695,32 +6318,10 @@ namespace CondenserLoopTowers { // York International Corporation, "YORKcalcTM Software, Chiller-Plant Energy-Estimating Program", // Form 160.00-SG2 (0502). 2002. - // USE STATEMENTS: - // na - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - // REAL(r64) :: Twb ! Inlet air wet-bulb temperature [C] (or [F] for CoolTools Model) - // REAL(r64) :: Tr ! Cooling tower range (outlet water temp minus inlet air wet-bulb temp) [C] - // (or [F] for CoolTools Model) static Real64 PctAirFlow(0.0); // air flow rate ratio (fan power ratio in the case of CoolTools model) static Real64 FlowFactor(0.0); // water flow rate to air flow rate ratio (L/G) for YorkCalc model - // IF(SimpleTower(TowerNum)%TowerModelType .EQ. CoolToolsXFModel .OR. & - // SimpleTower(TowerNum)%TowerModelType .EQ. CoolToolsCFModel .OR. & - // SimpleTower(TowerNum)%TowerModelType .EQ. YorkCalcModel)THEN - // Twb = (TwbIN * 1.8) + 32.0 ! Convert Celsius to Fahrenheit for CoolTools Model - // Tr = (TrIN * 1.8) - // Convert air flow rate ratio to fan power ratio for CoolTools Model - // IF(SimpleTower(TowerNum)%TowerModelType .NE. YorkCalcModel)PctAirFlow = (AirFlowRatio)**3.0 - // ELSE - // Twb = TwbIN - // Tr = TrIN - // IF(SimpleTower(TowerNum)%TowerModelType .NE. YorkCalcUserDefined)PctAirFlow = (AirFlowRatio)**3.0 - // END IF - if (SimpleTower(TowerNum).TowerModelType == YorkCalcModel || SimpleTower(TowerNum).TowerModelType == YorkCalcUserDefined) { PctAirFlow = AirFlowRatio; FlowFactor = PctWaterFlow / PctAirFlow; @@ -6784,14 +6385,6 @@ namespace CondenserLoopTowers { VSTower(SimpleTower(TowerNum).VSTower).Coeff(33) * PctWaterFlow * Tr * Tr + VSTower(SimpleTower(TowerNum).VSTower).Coeff(34) * Twb * Tr * Tr + VSTower(SimpleTower(TowerNum).VSTower).Coeff(35) * Tr * Tr * Tr; } - // capping approach to 0 results in failure of RegulaFalsi routine - // Approach = MAX(0.0, Approach) - - // IF(SimpleTower(TowerNum)%TowerModelType .EQ. CoolToolsXFModel .OR. & - // SimpleTower(TowerNum)%TowerModelType .EQ. CoolToolsCFModel .OR. & - // SimpleTower(TowerNum)%TowerModelType .EQ. YorkCalcModel)THEN - // Approach = (Approach / 1.8) ! Convert from Fahrenheit to Celsius - // END IF } void CheckModelBounds(int const TowerNum, // index to tower @@ -6834,19 +6427,6 @@ namespace CondenserLoopTowers { using General::CreateSysTimeIntervalString; using General::RoundSigDigits; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // CHARACTER(len=*), PARAMETER :: OutputFormat ='(F5.2)' - // CHARACTER(len=*), PARAMETER :: OutputFormat2 ='(F8.5)' - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static std::string OutputChar; // character string for warning messages static std::string OutputCharLo; // character string for warning messages @@ -7077,32 +6657,15 @@ namespace CondenserLoopTowers { // Puts UA into the cooling tower data structure, calls SimSimpleTower, and calculates // the residual as defined above. - // REFERENCES: - - // USE STATEMENTS: - // na - // Return value Real64 Residuum; // residual to be minimized to zero - // Argument array dimensioning - - // Locals // SUBROUTINE ARGUMENT DEFINITIONS: // par(2) = tower number // par(3) = design water mass flow rate [kg/s] // par(4) = design air volume flow rate [m3/s] // par(5) = water specific heat [J/(kg*C)] - // FUNCTION PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // FUNCTION LOCAL VARIABLE DECLARATIONS: int TowerIndex; // index of this tower Real64 OutWaterTemp; // outlet water temperature [C] @@ -7133,16 +6696,9 @@ namespace CondenserLoopTowers { // Varies tower range temperature until a balance point exists where the model output corresponds // to the desired independent variables - // REFERENCES: - - // USE STATEMENTS: - // na - // Return value Real64 Residuum; // residual to be minimized to zero - // Argument array dimensioning - // Locals Real64 AirFlowRateRatio; // ratio of water flow rate to design water flow rate @@ -7151,15 +6707,6 @@ namespace CondenserLoopTowers { // par(3) = air flow ratio // par(4) = inlet air wet-bulb temperature [C] - // FUNCTION PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // FUNCTION LOCAL VARIABLE DECLARATIONS: int TowerIndex; // index of this tower Real64 WaterFlowRateRatio; // ratio of water flow rate to design water flow rate @@ -7198,16 +6745,9 @@ namespace CondenserLoopTowers { // In SizeTower, calibrates tower water flow rate ratio at an air flow rate ratio of 1. // In VariableSpeedTower, calculates air flow rate ratio at the inlet water flow rate ratio. - // REFERENCES: - - // USE STATEMENTS: - // na - // Return value Real64 Residuum; // residual to be minimized to zero - // Argument array dimensioning - // Locals Real64 AirFlowRateRatio; // ratio of water flow rate to design water flow rate @@ -7218,15 +6758,6 @@ namespace CondenserLoopTowers { // par(5) = desired approach [C] // par(6) = 0.0 to calculate water flow rate ratio, 1.0 for air - // FUNCTION PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // FUNCTION LOCAL VARIABLE DECLARATIONS: int TowerIndex; // index of this tower Real64 WaterFlowRateRatio; // ratio of water flow rate to design water flow rate @@ -7255,10 +6786,6 @@ namespace CondenserLoopTowers { return Residuum; } - // End of the CondenserLoopTowers Module Simulation Subroutines - - // ***************************************************************************** - void CalculateWaterUseage(int const TowerNum) { @@ -7273,9 +6800,6 @@ namespace CondenserLoopTowers { // Collect tower water useage calculations for // reuse by all the tower models. - // METHODOLOGY EMPLOYED: - // - // REFERENCES: // Code for this routine started from VariableSpeedTower @@ -7285,18 +6809,9 @@ namespace CondenserLoopTowers { using DataWater::WaterStorage; using ScheduleManager::GetCurrentScheduleValue; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalculateWaterUseage"); - // INTERFACE BLOCK SPECIFICATIONS: - // na - - // DERIVED TYPE DEFINITIONS: - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 AirDensity; Real64 AirMassFlowRate; @@ -7435,9 +6950,6 @@ namespace CondenserLoopTowers { SimpleTowerReport(TowerNum).StarvedMakeUpVol = StarvedVdot * (TimeStepSys * SecInHour); } - // Beginning of Record Keeping subroutines for the Tower Module - // ***************************************************************************** - void UpdateTowers(int const TowerNum) { @@ -7450,12 +6962,6 @@ namespace CondenserLoopTowers { // PURPOSE OF THIS SUBROUTINE: // This subroutine is for passing results to the outlet water node. - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - // Using/Aliasing using DataBranchAirLoopPlant::MassFlowTolerance; using DataEnvironment::CurMnDy; @@ -7463,18 +6969,9 @@ namespace CondenserLoopTowers { using DataPlant::PlantLoop; using General::TrimSigDigits; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: static ObjexxFCL::gio::Fmt LowTempFmt("(' ',F6.2)"); - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: std::string CharErrOut; std::string CharLowOutletTemp; @@ -7546,46 +7043,8 @@ namespace CondenserLoopTowers { WaterMassFlowRate); } } - - // Check if water mass flow rate is lower than loop minimum and warn user - // IF(WaterMassFlowRate .LT. LoopMassFlowRateMinAvail)THEN - // SimpleTower(TowerNum)%WMFRLessThanMinAvailErrCount = SimpleTower(TowerNum)%WMFRLessThanMinAvailErrCount + 1 - // IF (SimpleTower(TowerNum)%WMFRLessThanMinAvailErrCount < 2) THEN - // CALL ShowWarningError (TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//'"') - // CALL ShowContinueError ('Cooling tower water mass flow below loop minimum.') - // CALL ShowContinueErrorTimeStamp(' ') - // CALL ShowContinueError('Actual Mass flow = '//TRIM(TrimSigDigits(WaterMassFlowRate,2))) - // CALL ShowContinueError('Loop Minimum flow = '//TRIM(TrimSigDigits(LoopMassFlowRateMinAvail,2))) - // ELSE - // CALL ShowRecurringWarningErrorAtEnd(TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//& - // '" Cooling tower water mass flow rate below loop minimum error continues...' & - // , SimpleTower(TowerNum)%WMFRLessThanMinAvailErrIndex, WaterMassFlowRate, WaterMassFlowRate) - // ENDIF - // END IF - - // Check if water mass flow rate is greater than loop maximum and warn user - // IF(WaterMassFlowRate .GT. LoopMassFlowRateMaxAvail)THEN - // SimpleTower(TowerNum)%WMFRGreaterThanMaxAvailErrCount = SimpleTower(TowerNum)%WMFRGreaterThanMaxAvailErrCount + 1 - // IF (SimpleTower(TowerNum)%WMFRGreaterThanMaxAvailErrCount < 2) THEN - // CALL ShowWarningError (TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//'"') - // CALL ShowContinueError ('Cooling Tower water mass flow above loop maximum.') - // CALL ShowContinueErrorTimeStamp(' ') - // CALL ShowContinueError('Actual Mass flow='//TRIM(TrimSigDigits(WaterMassFlowRate,2))) - // CALL ShowContinueError('Loop Maximum flow = '//TRIM(TrimSigDigits(LoopMassFlowRateMaxAvail,2))) - // ELSE - // CALL ShowRecurringWarningErrorAtEnd(TRIM(SimpleTower(TowerNum)%TowerType)//' "'//TRIM(SimpleTower(TowerNum)%Name)//& - // '" Cooling tower water mass flow rate above loop maximum error continues...' & - // , SimpleTower(TowerNum)%WMFRGreaterThanMaxAvailErrIndex, WaterMassFlowRate, WaterMassFlowRate) - // ENDIF - // END IF } - // End of Record Keeping subroutines for the Tower Module - // ***************************************************************************** - - // Beginning of Reporting subroutines for the Tower Module - // ***************************************************************************** - void ReportTowers(bool const RunFlag, int const TowerNum) { @@ -7598,31 +7057,7 @@ namespace CondenserLoopTowers { // PURPOSE OF THIS SUBROUTINE: // This subroutine updates the report variables for the tower. - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: - // na - - // USE STATEMENTS: - // na - - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - - // SUBROUTINE PARAMETER DEFINITIONS: - // na - - // INTERFACE BLOCK SPECIFICATIONS - // na - - // DERIVED TYPE DEFINITIONS - // na - - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 ReportingConstant; - - ReportingConstant = TimeStepSys * SecInHour; + Real64 const ReportingConstant = TimeStepSys * SecInHour; if (!RunFlag) { SimpleTowerReport(TowerNum).InletWaterTemp = Node(WaterInletNode).Temp; diff --git a/src/EnergyPlus/CondenserLoopTowers.hh b/src/EnergyPlus/CondenserLoopTowers.hh index f067856b5ff..d4eec49e18a 100644 --- a/src/EnergyPlus/CondenserLoopTowers.hh +++ b/src/EnergyPlus/CondenserLoopTowers.hh @@ -59,15 +59,9 @@ namespace EnergyPlus { namespace CondenserLoopTowers { - // Using/Aliasing - - // Data // MODULE PARAMETER DEFINITIONS // Empirical Model Type extern int const CoolToolsXFModel; - // CoolTools counterflow model does not work properly. The empirical model seems flawed since the tower - // operates in the free convection regime on the design day. - // INTEGER, PARAMETER :: CoolToolsCFModel = 2 extern int const CoolToolsUserDefined; extern int const YorkCalcModel; extern int const YorkCalcUserDefined; @@ -97,24 +91,13 @@ namespace CondenserLoopTowers { extern int const CellCtrl_MinCell; extern int const CellCtrl_MaxCell; - // DERIVED TYPE DEFINITIONS - - // MODULE VARIABLE DECLARATIONS: extern int NumSimpleTowers; // Number of similar towers - //? The following block of variables are used to carry model results for a tower instance - // across sim, update, and report routines. Simulation manager must be careful - // in models with multiple towers. - extern Real64 InletWaterTemp; // CW temperature at tower inlet extern Real64 OutletWaterTemp; // CW temperature at tower outlet extern int WaterInletNode; // Node number at tower inlet extern int WaterOutletNode; // Node number at tower outlet extern Real64 WaterMassFlowRate; // WaterMassFlowRate through tower - // DSU this is plant level stuff now REAL(r64) :: TowerMassFlowRateMax = 0.0d0 ! Max Hardware Mass Flow Rate - // DSU this is plant level stuff now REAL(r64) :: TowerMassFlowRateMin = 0.0d0 ! Min Hardware Mass Flow Rate - // DSU this is plant level stuff now REAL(r64) :: LoopMassFlowRateMaxAvail = 0.0d0 ! Max Loop Mass Flow Rate available - // DSU this is plant level stuff now REAL(r64) :: LoopMassFlowRateMinAvail = 0.0d0 ! Min Loop Mass Flow Rate available extern Real64 Qactual; // Tower heat transfer extern Real64 CTFanPower; // Tower fan power used extern Real64 AirFlowRateRatio; // Ratio of air flow rate through VS cooling tower to design air flow rate @@ -125,18 +108,6 @@ namespace CondenserLoopTowers { extern bool GetInput; // When TRUE, calls subroutine to read input file extern Array1D_bool CheckEquipName; - // SUBROUTINE SPECIFICATIONS FOR MODULE CondenserLoopTowers - - // Driver/Manager Routines - - // Get Input routines for module - - // Initialization routines for module - - // Update routines to check convergence and update nodes - - // Types - struct Towerspecs { // Members @@ -461,20 +432,8 @@ namespace CondenserLoopTowers { Real64 &SizingFactor // sizing factor ); - // End CondenserLoopTowers Module Driver Subroutines - //****************************************************************************** - - // Beginning of CondenserLoopTowers Module Get Input subroutines - //****************************************************************************** - void GetTowerInput(); - // End of Get Input subroutines for the CondenserLoopTowers Module - //****************************************************************************** - - // Beginning Initialization Section for the CondenserLoopTowers Module - //****************************************************************************** - void InitSimVars(); void InitTower(int const TowerNum, // Number of the current cooling tower being simulated @@ -485,12 +444,6 @@ namespace CondenserLoopTowers { void SizeVSMerkelTower(int const TowerNum); - // End Initialization Section for the CondenserLoopTowers Module - //****************************************************************************** - - // Beginning of the CondenserLoopTowers Module Simulation Subroutines - // ***************************************************************************** - void CalcSingleSpeedTower(int &TowerNum); void CalcTwoSpeedTower(int &TowerNum); @@ -543,23 +496,10 @@ namespace CondenserLoopTowers { Array1 const &Par // par(1) = tower number ); - // End of the CondenserLoopTowers Module Simulation Subroutines - - // ***************************************************************************** - void CalculateWaterUseage(int const TowerNum); - // Beginning of Record Keeping subroutines for the Tower Module - // ***************************************************************************** - void UpdateTowers(int const TowerNum); - // End of Record Keeping subroutines for the Tower Module - // ***************************************************************************** - - // Beginning of Reporting subroutines for the Tower Module - // ***************************************************************************** - void ReportTowers(bool const RunFlag, int const TowerNum); } // namespace CondenserLoopTowers From 7c8a86807b3ea848ddfa8052ac5ac793fedbdac5 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Thu, 5 Sep 2019 14:47:39 -0700 Subject: [PATCH 042/136] unit test and docs --- ...r and cache two psychrometric functions.md | 61 ++++-- design/FY2019/diff-sum-PsyTsatFnPb.xlsx | Bin 0 -> 51836 bytes src/EnergyPlus/Psychrometrics.cc | 10 +- src/EnergyPlus/Psychrometrics.hh | 2 +- tst/EnergyPlus/unit/CMakeLists.txt | 1 + tst/EnergyPlus/unit/Psychrometrics.unit.cc | 192 ++++++++++++++++++ 6 files changed, 239 insertions(+), 27 deletions(-) create mode 100644 design/FY2019/diff-sum-PsyTsatFnPb.xlsx create mode 100644 tst/EnergyPlus/unit/Psychrometrics.unit.cc diff --git a/design/FY2019/Refactor and cache two psychrometric functions.md b/design/FY2019/Refactor and cache two psychrometric functions.md index 5fb02239499..67b3b4a4239 100644 --- a/design/FY2019/Refactor and cache two psychrometric functions.md +++ b/design/FY2019/Refactor and cache two psychrometric functions.md @@ -32,21 +32,46 @@ The regression diffs of the peak results are summarized in Table 2. We further took some example files and analyzed where the big diffs show in each test case. The big deviations mainly appear in fields including heating and cooling capacity, convergence information, annual peak (minimum and maximum) values and setpoint not met (Table 3). This indicates that at some extreme conditions, minor (10^-16) precision difference in the calculation of psychrometric function can cause cumulative effect in simulation results. -For example, in Ice Thermal Storage Calculation, the `Ice Thermal Storage Requested Load` is calculated by `Design mass flow rate * Cp of glycol * (Inlet temperature – Setpoint temperature)`. In the `5ZoneIceStorge.idf` test case, the design mass flow rate multiplied by the specific heat is at the magnitude of 10^4 and the precision diff of temperature is also magnified by this amount. In general, when calculating water flow rate in small building with the unit of m^3/s, the absolute flow rate value can be relatively small, and the deviation of the diff of two temperatures (e.g. inlet and outlet temperature) accounts for greater relative difference in loads. When calculating air flow rate in large buildings, the absolute value of flow rate can be large and the precision deviation of two temperatures diffs can account for greater absolute difference in loads. - - -**Table 3. Regression diffs of two psychrometric functions - examples** - -|  | Table big diffs | ESO big diffs | MTR big diffs | -|--------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| 5ZoneCoolBeam | Warmup Convergence Information | N/A | N/A | -| 5ZoneCoolingPanelBaseboard | Annual and Peak Values - Electricity; Annual and Peak Values - Gas; Annual and Peak Values - Cooling; Annual and Peak Values - Other | Max absolute diff: 2250.1488349, field: CENTRAL CHILLER:Chiller Evaporator Cooling Rate [W](Hourly), time: 07/21 01:00:00, relative: 0.290877294867;Max relative diff: 1.0, field: MAIN HEATING COIL 1:Heating Coil Heating Rate [W](Hourly), time: 07/21 06:00:00, absolute: 694.942999853 | Max absolute diff: 5825448.88749, field: Gas:Facility [J](Monthly), time: July, relative: 0.0108159291299;Max relative diff: 0.0108159291299, field: Gas:Facility [J](Monthly), time: July, absolute: 5825448.88749 | -| 5ZoneElectricBaseboard | Annual and Peak Values - Electricity;Annual and Peak Values - Other | N/A | N/A | -| 5ZoneIceStorage | Plant Loop Coincident Design Fluid Flow Rate Adjustments | N/A | N/A | -| 5ZoneWaterCooled_Baseboard | Annual and Peak Values - Water;Annual and Peak Values - Other | Max absolute diff: 3910.55749028, field: CENTRAL CHILLER:Chiller Evaporator Cooling Rate [W](Hourly), time: 07/21 24:00:00, relative: 0.489140289909;Max relative diff: 0.489140289909, field: CENTRAL CHILLER:Chiller Evaporator Cooling Rate [W](Hourly), time: 07/21 24:00:00, absolute: 3910.55749028 | Max absolute diff: 3781493.32856, field: Electricity:Facility [J](Monthly), time: July, relative: 0.003822818262;Max relative diff: 0.0065249669738, field: Electricity:Plant [J](Monthly), time: July, absolute: 3781493.14183 | -| 5ZoneWaterCooled_HighRHControl | Warmup Convergence Information;Annual and Peak Values - Electricity;Annual and Peak Values - other | Max absolute diff: 754.535946383, field: MAIN COOLING COIL 1:Cooling Coil Total Cooling Rate [W](Hourly), time: 07/21 06:00:00, relative: 0.114245738677; Max relative diff: 0.239215392434, field: MAIN HEATING COIL 1:Heating Coil Heating Rate [W](Hourly), time: 07/21 06:00:00, absolute: 724.02837944 | Max absolute diff: 3163512.97647, field: Gas:Facility [J](Monthly), time: July, relative: 0.00478605484346; Max relative diff: 0.00478605484346, field: Gas:Facility [J](Monthly), time: July, absolute: 3163512.97647 | -| ASHRAE9012016_Hospital_Denver | Comfort and Setpoint Not Met Summary | Max absolute diff: 1101315204.01, field: Electricity:Facility [J](Monthly), time: July, relative: 0.0110115007204;Max relative diff: 0.0110115007204, field: Electricity:Facility [J](Monthly), time: July, absolute: 1101315204.01 | Max absolute diff: 1101315204.01, field: Electricity:Facility [J](Monthly), time: 07/21 24:00:00, relative: 0.0110115007204;Max relative diff: 0.0110115007204, field: Electricity:Facility [J](Monthly), time: 07/21 24:00:00, absolute: 1101315204.01 | -| ASHRAE9012016_OfficeLarge_Denver | Time Setpoint Not Met | N/A | N/A | -| CentralChillerHeaterSystem_Cooling_Heating | Comfort and Setpoint Not Met Summary;Environment:WarmupDays;Warmup Convergence Information;Annual and Peak Values - Electricity;Annual and Peak Values - Other;EAp2-2. Advisory Messages | Max absolute diff: 943291.539437, field: CHILLERBANK:Chiller Heater System Cooling Electric Energy [J](TimeStep), time: 07/21 07:40:00, relative: 0.160657554291;Max relative diff: 999, field: VERTICAL GROUND HEAT EXCHANGER:Ground Heat Exchanger Heat Transfer Rate [W](TimeStep), time: 07/21 07:40:00, absolute: 49963.5234817 | Max absolute diff: 3865279.15555, field: Electricity:Plant [J](Monthly), time: July, relative: 0.00856142803732;Max relative diff: 0.00856142803732, field: Electricity:Plant [J](Monthly), time: July, absolute: 3865279.15555 | -| HeatPumpWaterHeater | Warmup Convergence Information;Annual and Peak Values - Electricity; Annual and Peak Values - Water; Annual and Peak Values - Cooling; Annual and Peak Values - Other | Max absolute diff: 965.026314929, field: MAIN COOLING COIL 1:Cooling Coil Total Cooling Rate [W](Hourly), time: 07/21 05:00:00, relative: 0.143084278282;Max relative diff: 0.296270953432, field: HPWHPLANTDXCOIL:Cooling Coil Total Cooling Rate [W](Hourly), time: 07/21 03:00:00, absolute: 409.557737679 | Max absolute diff: 6079154.87704, field: Electricity:Facility [J](Monthly), time: July, relative: 0.00520247500374;Max relative diff: 0.00791127718368, field: Electricity:Plant [J](Monthly), time: July, absolute: 6033670.18734 | - +We summarized the diff analysis of the ESO file with each malfunctioning test case for the PsyTsatFnPb function, including (1) if the file has large abs value at large rel diff hours for some attributes, (2) maximum #hours with big ref diff at abs values out of 8760, and (3) most significant deviated attribute. A more detailed diff analysis by attributes is attached in a spreadsheet. For most of the files with large math diffs, the diff happens only in a few hours for some sensitive fields, and by the diff-of-warning-messages many of them are triggered by the inconsistent number of iterations for convergence. For example, the reference supermarket has large math diff in total heating energy during one peak hour only. For 5ZoneVAV-ChilledWaterStorage-Mixed, the cached version somehow converges in less number of iterations for some HVAC loops, and that's accounting for the diffs in Solver Iteration Count. Other files with diffs originally have some existing severe error and warnings which I assume can be vulnerable now, and their behaviors can deviate in subroutines such as cooling tower and heat pumps. None of those behaviors leads to large diffs in annual energy use though. + + +**Table 3. Regression diffs analysis of the PsyTsatFnPb function** +|File name |Max #hours in a year ESO has large abs value at large rel diffs|Notes |Malfunctioning attribute | +|-------------------------------------------------------|---------------------------------------------------------------|----------------------------------|------------------------------------------------------------| +|2ZoneDataCenterHVAC_wEconomizer |952 |Diffs in pre-existing severe error|Chiller Evaporator Inlet Temperature | +|UserDefinedRoomAirPatterns |502 |Diffs in pre-existing warnings |RETURN OUTLET:System Node Enthalpy | +|GasTurbChillerHeatRecoveryAuto |321 | |Chiller Evaporator Inlet Temperature | +|ShopWithPVandStorage |10 |OK |Inverter Thermal Loss Rate | +|MultiSpeedHP_StagedThermostat |113 | |Zone Air System Sensible Heating Energy | +|ElectricEIRChillerHeatRecoveryAuto |1 |OK |REHEAT COIL ZONE 1:Heating Coil Heating Rate | +|HeatPumpWaterHeaterStratified |2 |OK |Water Heater Source Side Heat Transfer Rate | +|HospitalLowEnergy |132 |Diffs in pre-existing warnings |LAB 1:Zone Air Relative Humidity | +|5ZoneCoolBeam |15 |OK |Chiller Evaporator Cooling Rate | +|VSHeatPumpWaterHeater |165 |Diffs in pre-existing severe error|Water Heater Source Side Inlet Temperature | +|CoolingTower_VariableSpeed_IdealCondEntTempSetpoint |72 |OK |CONDENSER TOWER OUTLET NODE:System Node Setpoint Temperature| +|CentralChillerHeaterSystem_Simultaneous_Cooling_Heating|4469 | |Ground Heat Exchanger Inlet Temperature | +|5ZoneVAV-ChilledWaterStorage-Mixed_DCV_MaxZd |3 |OK |HVAC System Solver Iteration Count | +|5ZoneCoolingPanelBaseboardAuto |35 |OK |Chiller Evaporator Cooling Rate | +|DualDuctVarVolDamper |1 |OK |Air System Simulation Maximum Iteration Count | +|ChangeoverBypassVAV_AirToAirHeatPump |107 | |Unitary System Bypass Air Mass Flow Rate | +|5ZoneVAV-ChilledWaterStorage-Mixed_DCV_MultiPath |3 |OK |HVAC System Solver Iteration Count | +|HeatRecoveryPlantLoopAuto |35 |OK |BIG CHILLER:Chiller Condenser Heat Transfer Rate | +|5ZoneIceStorage |8 |OK |Ice Thermal Storage Requested Load | +|TermRhSingleHeatCoolNoDB |1 |OK |Zone Air System Sensible Heating Rate | +|5ZoneVAV-ChilledWaterStorage-Stratified |2 |OK |Air System Simulation Iteration Count | +|RefBldgSuperMarketNew2004_Chicago |1 |OK |Air System Total Heating Energy | +|ChangeoverBypassVAV_AirToAir |98 |OK |Unitary System Bypass Air Mass Flow Rate | +|DualDuctConstVolDamperMultizoneAverageSetPointManager |1 |OK |Air System Simulation Iteration Count | +|ChangeoverBypassVAV |100 |OK |Unitary System Bypass Air Mass Flow Rate | +|ChangeoverBypassVAV_MaxTemp |117 |OK |Unitary System Bypass Air Mass Flow Rate | +|HeatRecoveryElectricChiller |453 | |BIG WATER HEATER:Water Heater Net Heat Transfer Energy | +|5ZoneWaterLoopHeatPump |6 |OK |Chiller Evaporator Outlet Temperature | +|TermRhDualSetpointWithDB |1 |OK |Zone Air System Sensible Heating Rate | +|HeatPumpWaterHeater |82 |OK |HPWHPLANTTANK:Water Heater Use Side Mass Flow Rate | +|RefrigeratedWarehouse |32 |OK |Zone Mixing Latent Heat Loss Energy | +|5ZoneVAV-ChilledWaterStorage-Mixed |7 |OK |HVAC System Solver Iteration Count | +|CompSetPtControl |2360 | |Chiller Evaporator Mass Flow Rate | +|HVACTemplate-5ZoneFanCoil-DOAS |11 |OK |Heating Coil Heating Rate | +|CentralChillerHeaterSystem_Cooling_Heating |3512 | |Ground Heat Exchanger Outlet Temperature | +|FourPipeBeamLargeOffice |1 |OK |Chiller Evaporator Mass Flow Rate | +|5ZoneAirCooledDemandLimiting_FixedRateVentilation |2 |OK |Pump Electric Power | \ No newline at end of file diff --git a/design/FY2019/diff-sum-PsyTsatFnPb.xlsx b/design/FY2019/diff-sum-PsyTsatFnPb.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..67feea19d50211bee77a47c2d14ed3ce426a6133 GIT binary patch literal 51836 zcmeFX^LHmf&@UX@+1R%2jcpqn+qP|NY}FTa3C0THYA0SX5Fd!fxBp@c&xt0c?ARvhlARy=_{)}Bx^kd;9 zJL_oQ6#T&Z$%12O7-yah^4qC>ScP3|Pgte~*AfF$Fz_IEeM|#&XS5TcN~eNnd}DA| zL1P=0d$Mv7$Kc_BK^h{4)MpdZ-Jn#7L`#*%M5WXDEkm}?g}Q@n+2|M8 zHgkAlFVfcR4pes^7oj{mZc}CSW0lTmq77ZYub!`WKXrV}qtaU!Cx)dVgKpl>Ad=vP zRS+ecm=?@hR{J@>5h09XxvASB;;nazJ#_q$9X!*nyo5wk1#D6~`rXp8JTXNcF4|!K z^6`ld?g7QCU--WEW%JO75aO@EAJ3>~T@M2yC=&xD@`vHnVkMV*HQx|H1M9VhsLozh09puQ<$% z5Pl=|5i$OC2#yGp<6)j`qqrCpkt@ z@D!la!hScE>ovj!J6t_}I}sd1RI&Z-q5e;h1PP{QJbY`U>l-AvATXewwoLzp6AuSx z8xscyoB!}${~u;Rzg^h(SN`w5YE~P}f|UNH5hdkYOfTXf`NG z*!&-N@MydAwf@O6fjfkI-OP-+zi=S!gQGtU(p5yGL3pFv-ta*>%skA1!BNcn>TnJ~ko@I7pwRZVSF!^mWQ!R&q zZ=tG}wZSdz?ZjC$=10Iz(T!)Q{9rGl`3D?WX?{d6konUk61vwx@n@L(o)2?*uUVVH z;x~jN{AyXkDh>hPa984paY>>8nq-%wqRejfn>|;N_eq-mjeGj3#~bs*iLvFK@0tET zO-82#eQx91Tz-GAy2#%Y-zM|F8%v40zQa2655N2tV4`+U@IfLJE@~NOWO$4G^4n9S zoJpkm*erf|N!8nq2LVjj{X#41YNLa*Z~RT??5R&K{7KSTG93=df=kk{X^{%!3Tjtx zRJZ71YWQR-9EEmho>o*}Lcc$bU8=tp?b9wuAU#JextNB`$CHetlSOl$_J3_5u|(2V78 zg|uB!lkkCB&Vw_m;L$n!uqQT^?D}wt`YCMX|8C)T74C+y>s#R*`kPGh8 zAEW&DO+@0`3Iw-8UPu61&64&m9Tue_$W3t1T7z`hPC{`K13GbfMY&g-baEJ_UvhYNOM0OAwS(Pv(pRRT4J)@M3kwDthMp}cH@hX;E{Vd36~0Sfe*UWUCN3ZT7oaJ@ z=O~o_6^gI7C^-&uD6oZbxoPheK!Q$?{D&=yDM~1NL?39&d1`?4+2MnVY`*p7dW`%w z?8%$y#Y8LtZCqq&)}-IW;2Qe&FV8`=-*QVL5>JEQuk`Nnx~}eOhu!Y-4_w>WI)O#@ z{W7Ne>C%f{nKe4e4&GbAc_o2Q9`vw0dhbc)M4+gU%LZfYbymdVjlkV8fo{NJ z8wPpDF2JNqs zUG2I3(0-((INaIGv3cnO`sB=WjK$QZPC9^ zu#0F1-;jW1ZsjV|o~O;p@6p^-68QQ$2YeiS@D1;8?Y$_*+A;j6sMvcJ)A+X+-NI`1 zbz;*At1E$N>qOPz4EJr?hXod5tab?Q~1~DYDk~p3h7zq5&}aJr%e{i(^SwJf*~{T8*7 z|IS~!bGNB{uU#(~#u|;Jw5C`XFy&+)YxyB5V0cMO?@e(mNiAi>?pT_T=$Vmgid)au zx%|$4TKt_QC&mshXjd|r3%^CX6@)i>=?pH4>U1%O5+(bh^{{Gp+L-W5zhKCePRdMd z{!JR0z^q_{ckAYqUS+A%o@=j(_fMCpOgsjyHst`W-UCX^h#P`S8cLxe8Xl|_-%@vD z__X65r@QNF=1x72c#N-QkcOiUF?O?|gFQ*!DAzy}ui2o#c3ILP&w*Ymp+rvur*v=g zOesV+ewgT%@qq!u&gEY}5tX~0>8nck7h&}>=W&_cba;Go;1K?)pxFBJzTjbofg7uL zj@m^6`qjg0o2U87+zVCk_!tWl6Z=zOaPvc{W_BzHmkQ*I|H3&k2l2M+`=@bd zow%0VyYEIvgfj__(P>T353z^Q@by>!Rd`K%XlWTFh+FoJfcaVq{w6~Opr=Awg<=<% zL8oG&L=giYdl?dvl0#hD&B#js8eoJFk2|bEH%@RFd|5I;f>WX$h@ua$C6^+{OJbfl zOSJuqIxCJc1J)5_Zyg~TVTyPTE*n8b;GK!j+O%qik9(zE*VlcO(0pfkYN`r(7mmvS z`=SbVQmT`H($S6PmsB3HvEDI%W^HGdhs+?O*V(S`EHAQa-CnB83-nIjb6S z;j7Lw#uu#5-10-r>HVvy9t8xQeM1^WPgSyw48eptBxOUX7|Q}+`Nk9iO}(F#kn*<~ zwcRu%;w@vlgtzky>CUO7^|rCp?X*S{7}`vupm;kO0Y&P03ou7Zs`Wc;4k0n577h1# zD?pqm@vzkju%9(V5aVa~=eApToF{7NIBhzUW~E%wibRDX=|2(@>~aE<{v!TTa(t(Z z$r3PEBK(ZvsJiy&N6$V1f+#c04+jXANBH}LzRZUXLByD$ty=mWdwm$YBZ$oVv|A9hh$j|vGBV6X5EcqyPZ!5HQ-eWu$rW(sp)ntxMk5vIM^MRA}Yq@5r2sKrxmc-!;lLOv@6K?a4*Ze~+-Ef5L_&8#n7H zBu0J|BN452fdGko&{7Xw{UPD2W)qG|j>QQM~#@y1EkYS$2sSiVU*TjO8wK0-An2dpT(T;P&lYeF7m!`{Ij$!8Yh*LboUtSeG2;z8Ww*Bk| z)oA0|CQjJBIR2h&@ z;2^J`b&z9m)q&F)nFv+K!dC9eZ_xd)8790eaTrzKYsrJ*v2yyD`r3$Z$rl9=N}Dt~ z6PBW|tFrFCdU_ou1uw=;Bmv7PtcS@db7$Pbhc3Qs!ds*l&5tap07%ej*Lf!lvaPLd z9UWG%+1Wu^2`(IotsJ$!FX%3d#}|0fr^?MN)cr9fHWaq6pEPg-nbW0n^JVXYEQ3KI z_O&4)SxQh6*5)W5#%lTGV^_;1!fCk~Fe0fAkfM!oVW|{O=YO>ITCihf#flUP`I{6s$Ni_7m%+AHarn!xp5WBz%H^VM{ymg?g$gUpOF8g`Z%FmI*>#~y30+8b6VI7mJg!lrhn4&TZ&ZkJtE4+Ua$t`F6+17kALw!&e z(BW>W(p(i=PyqedQ};V7O;dTII5N~)rn8j%xty^*!&B8)<9k%??Z)r})hG`|Jo<$j z26@i&nVKF-u#c@DuUWeLiMeyJKVXe6eJxHiVf54ZAZ3&~NNi0sFa38TF~Ogyk3?#u zq_r-`BC)_8tq^Be4GhsuI~Jk7_(Mb|f~B+JF4x6ICHrY!YHp-!XqUcF1RvSG=6Q!= z>mkG(YIpK1(Sc5&0JXc6G`%eDE3v^&a~b zirc9WuDW>Lh*&LeNC1_EJRjgp%$LF{IEK@ zJ94<}-s{IIoJ7fowYJ6sS}M}?V_9p;r*jU2;+}im{b0QW=WHpAWdyboknTL{xY6_~ z{K^?V6B0%ru+3E^V|QNaV7OW+G@>NTkf2p+vy#~A_k>6p5KB3ncx1I}4hS1ht&^}^ z)+J5iF_>tDZJ7G71}&>H1MbyP;zyKb3uqELXe@#nLDtV{_N|(#L}ttt$~G5bimLnD zlGl^jt|WdN&v&?q1KNQv;lYVvq3?h9-3VO=I{|GY%RZ~Cu(xAKf?~_6kP>874!<(Q zSm93LFlU`6gK6vSLLJ!tU86=YYV< zkZzF!^eIxh5%rP>j~^+>#_ zsM*@DfWX=kcqQ8I>{xC0+B3?YNrUTyw5!6f{?zh_DI^QW`?m)YFZ-&^zq3j6S zm|#@G%I#aNl^LLI@cA6dm+kEZyKQ@-;URyuXmv+Z?PK}9LAR*Jo|lhTBqv29vPSt= zNaeRA&Pxv7suV=WG2PPrc%(&@+TD!2c#6Hg`FD2CABm-D?g<_FAb%pyF<0nXCIMHi zRE|*sd-0m~G@76ig2zhYFU?9emjp{zF7n`jHA(Z=mw$ryo&Be=!Na&g(HqzFuGy`t z9q>M@nEK%5jP&-_48mfHRSNhQwdtfK`)=_hYrFm9vuAq54QfzSBS($DmzVum-sTy> zM0B`!QQvYr?+z~b{Q>rVTlLc`0gd%>_+q3!nI$P?KI2!3KT{icXH(%_&8nTRupoy7 zC=qGGVFk>|1lh3-8LHfwk^zYlhhJRS-F-`?lwv7a2x&nWH?CM<3>3b2gKQ`s)fKZ< z2t@Kp{UYaw!AL$ak|i+_STesD3-qJNK(75kb#INr&{vE@w*(#WjZrIW7_t@hf-VW7 z)JJSuII)xM4^8}{BvdakjtyPkbusS_3Drd&9!v(fPV^)PY402Il+Y4#$g3Ew5&;c< z4BQrwWkOgJ*TdL!njUioN!Xb=TM>w4z1Zes+c$?(`lKPQ?Zo3 z&Ef+yoK#_{Db|DmnZ;!hg;U}7c{~?ThB@}Fj$TP~OHoFx-#W}i%7boNaiFa~QYI-^ zvcTzTAO9r5qX)xtkr4j)5uVz>KlJ-hM=F=DG?4;!B62iGRr?rr^xyr&{2vS}VSALp zyp2+8ddYX{V6E|54AAXRMx;T967nMD*R3RGka-9SQZ3^w&-IA&BmkLSaOX?pkQJ7Q zf)QBQ&U&1}gfK)S-2G#*H3aG4c7nPXlw}MTtNjwqRlxT2@jiO1KVFUPsAMNQ>Qmg@ znxJK4X!m&H5q3orYD|+I$%Kp6- z8yuYP`?=lQ)X=c1DbroN?Q!hXdd6HBhsj5P7Hv6Euw$wRrdhE%JiC9mQGNufEXb%o ztat5gj>nz3LK@UolqGMQO?mz-NR)EKN#Z2@lZ_@I6Tw%Cd5N+KUnGw@n!_1^71Sfr zaIoOy=}kgZ{x{Nt0?J}kj`QdvTiK^oy&$!06=i70$lRr-H~+z7#(AM?J{m^D(2eg` zkA16R40R5c6gbSzXo{x`1CjKk{&+-6^E<#(1xW)=PZ>yyrSNAH!%vp7-NiYAbkl|` z12uYy`?wo{g{DYe$o>VdSWM;L!%%2q_l;!Z=1B>h-qz0(cW$j1mhk$_F?E4b8W3tb zOUt0(`x}xv@L<$CENM9f9UZotaP}3~xhYX0NLj2{LH% zB?f3kBZa&1S$`6y?Qz?^Sq6bt$^IxQ{nzRmMK8FRZ3BHMGc*2{Rp(g1W=@ux@YmCw zt1{ngM^64MLzXC2)__ZEA0j@#J8ZiSWYC77HJqp^$#IR}qvgE%-_FvPT*)SkCoO@i zb^m_kpFQbok)+2}C6MEuiR$yg_^JL3#_LF81L>Q|-f(R-;wmF#zn4R4Ne4eUf83V9 zo~ubymV}PeQE_6<12OD zg67@zI7@a<`1D}~`RMAUtvXkj&Ve9KZ>@HNE@({z^&8{1;wpr)Yb9Au`n}?)a|w+Z zqp9+$*rM~YsYLh8Z>Qt(h-KNO>gq*zz%1jaWYSg)wO(fd?6C6^4ik{LX$`wbdEWHB zF9|Ly==nF0%@lq`K^fD@r)}_W$)(0@VtsIgXW~cBl(IEkR`5avY*_)nc{mM7$B)Lc z92)9`KE*n1LbjbB1&B1>Ga_X_t;nQ(pb^JaY%y6N;V`u)f23|B4~b>V=%8_9P_ORs zd^4#z$_7ib`+<5gAJbeCTs#EOt{ ztbx6B>ix=ljp3?D`qhSHO+n8wjE?s&HXsw?w11bynqRnIvMKuHM(Z3I2x%r?H)cSh zcsb!~@Dl1>R^JT>X}-^7v(UU@q!Sv&wb;SZ*cz@T9(_XXjj-$3i7ie*0Dk$s8#eZn zqV#x0*`^KxeSWPs7aqJ8Q0nSfTOQ~xXZee4P&6^ltI4(y%Bp(!o?f40B{RZZc~hYyam|t0%wfVfvYVNymkr zQc;M3f40EFsi1i)eVmPZJ0`JvK7LTkQ8zU_vU$thS;}vpExM#!rmb8EFEDIsytL=F z4<-xZq(4OKn=(6C$pMCU5Rg}#75HH^JOvvaF9LyP)L=GAd^}Oe_rHXVt2AckSRBre zDs?(Ls?5OPAF;Wd>*f@<4|cj`N3Z4Z40H9>=XTWLr9Po9`SGexURReZ5)e4Ib5hNd z*RS@#whf#jBkk8tGb^Gxpm=op8R6L^>Iv)BVOPj&yvb<~6A$g;iq>}IRzTh2uMB|; zr|NS7q%%E#rln+#x^(zz4VossK0ks9nkU73RcKZTpT$a4*L=;O)y7sq$`Fm8>@-eh9!-@h90IzNTg#J)%xdv!*)Mzd8k*RKyLeQi9?6AHi z97j`9_au*4Mql0Eg}_~5T=%%dZc;QTFb9Kt8jk7HGjVFD?2v9Gc=xPQG}g21Rx0Gu z8`2zZ3e{(TSx={kJ>79yq+TU47kj&IB(la5Vm)|YVm41iybrCIjzIsD@^s(fjkEo- z`V-In%}(PpO1-K)aeNXZ6^{gGw3JPiB>X`3QblNPdk z%11bZ{|mbj+779IB}g*bOEedaQ^=i;@`9&s4ziu}l4S|YNrq9=zt`@3t}P@i%Uh^b z9@#9+Vcmm27GI(Ag^dGd<&ER?Z2H!15e@-KBkmDJckb5P{srMn2h#vN|4$5j%q^To zbd3>*R;Ll9jnl)evPkgk;YNL~2BX%I-{)oYdVrzO&I7dj29Y@AxE${+MMH?796xPH-~3aV`@0-qZ$YBSHTJKBh*(bf$3b zy-~Jh!eU*pzvo~tGUFutXa6nuYOGSrgv!)w*M_dQ-$O{oB$u0PyRdJ_=y1rI>MOyz z`Uu;AVien^xLvs0^@K&HohDgl6sLl^a8DprEG{4t>X^R-N| zVV+v@UvNpa%2As~@0U16*RAeF>oj#HaQ%ompDsq%&GxZpuG7{E^)wxSn`w^NPR#hu zbmn8uVC+r3TDKkieZuv&AAaej(e2?*7T$zcd14tbWsbN|PXg<9)MX-Y`QsrJrEL*920!N1y z^!!)#eDsnW5RlEp*^+owsqjaJCpdb-TcTnHXj!AIQnbVtqBaqE|B_yZXL+iLQnNB& z3t5ZSt)ccG)<@pnd<4WH^zca;6?mt|b!#Anafm$MJ3Y+qAi~JZXY8g_OIq*Qyg>q* zclKKDI*xLJ!I_R9;EO>@+k?9S4s%~~mpwy3ijC3Q-BPWb`YeLvcP-|>n!VHUFZctv zqaVPjMV&Bpxd{oijXW@16zx09Y7Gzm@wL11p&kR3=~+uw(0 zHP&`C_)}8|xSxEi;DjQgN^5B;)eouIn+iRUytl&bj+>5d?`s2@J>FmuAYVYQqY@P! z<4@wMsa__Z>s_p8%If=g{75!l`n?CQkA~FUpUf>;EbQKbAxQTMyBhcN`iqgXj5ZcD zbt^kU!($dyX&yeR_%NTwWgRkujDpL6FN;E&W6>)8yck?@I8g`an}(V=2<;;SpQaMV z$M)R^26(M43f~t61w<2z&tinHYitGL8YPG z(|@)s|B)HG)SijKXh-WZaEPRCfJ_|3@ zXlVYH0E*8Otac{Mc@0XjBPeZA`vM?qr<{?m*1XI8*`W0TF-(Y#PpKhzh2GfH#ivex z+d?_0C3|pMS=%b_MVfu0F{0Aja$&dTjrtVk_FqH&=1zjDgs_zYwSb0jB80A8ark;+ z8bQ6`h+Ok>i;Ilmg(r}6092qD6~$ux7y ziHOygDyni?q+CZjvDd7EAc0^iQ$9q&`a{w4-fpWprcSqj#U z-_wa=0>SzQKEdx>lBmYpy1idFlrhFZNbh%`Lb)T%A|uH^QBU0~uBXPq40MUlhuj*j zhBolEMj?Cn`)$^`i0(Sc<1_0e8X-4-#kymA@a|S+P2Ju)=E-fPJak5NNBvE*xn`89 z0eLxLE706mS&M5hJ4TE~iz?$DTu|+A6pbaQ?iP(aS`lE~murZ6yhf=HiCm-*bvB|< zVQdjKiJTfTBMx1^pV_vnAFi-j7VtGCGyax?**~)KXmrYwQTbAZM~sDopfASskkvV0 zP?EBaiCoM(n&#o{7k#MgF>k~Zu5dpb!U57dq5cSGvaIvzLT3y%TatkLYMc_k%eq|h z_=rCx5{Y<{M~F0*Z^9a%n1Cq0QWMK&J8av~r#Wc{Bb+Fmz@wcd2#_77k9qo|x28s5>P9T(K<~eeR7zqup^?wm_?cu z$W!Lz?tbZuI2dh<3~$V9Uwub9e~0EVBg1Wht3C)EUuzuV=l16r6lI%We&cW$I0US% z;7E)wJ+a(s9oy^F?A2^eWbhvn8olT#hjD-AqME2aJSGV}KwY396Ljz1Q+czg%}&IE znqgmv=xw|$^EL+@lWSc5d8xY?EWZNZtIQV-1nbRaZ89HpMxUOagsn4se1j$_Z|+a? z6nh$v*ho^Zry&1yi+K1!^vuUXGgoXVcTsg(gU*t^W^w$c-%KTAIB=pAqGDZ7_=}(; zYPL0y6D{|o=E+7`@T(-kjSeIKZ|%FngJ(kAqJl+dO;=VW{C7CplSVI2G()EBR7c=u zyLRcq|5VLGI|GV(Z4uj8&KytK4O`g|N#uutMX14Arq;Zx*1XbrMxl;`(-9oA9R`Ny z(eti&?@@&Cx^TETe(K3DjPjPup4d9L*-Q!V6t>DtP$d&4HsSJZHA^IAl~CaZ;*|AWBNrzaxD1fL3dm zc3Lua8vyz#_V9`)R43VzE>@9hhdYjRp8czbaXJoGQ-oM5uU?A6Bos^1Z=ci=21AB` zG(`4!{31I#%|H}EorA2ObVS)sD6V|to~(mpR^eON%6SSzL3^roj$c)Ob_i<7*YJmW ziQ*D^!Ff-(P)oG5nCPJ6qXJ_>oX=;zGe->=Nk;&WeWOXsm7eGYp450U-WVnKqTi-@ zLmW|c)ANdSMA(XJS%ZZajQqc=z@K{+x44LwCtaYdjxEam(4H^3rkq9a9U@lWi!L?M zmfC+RFgVxQFm@uLEqlrI>@E4lfDbY=jVsZ?v${!yqUwalYEQNpK6? z)lmtJ=T7Um{iMH;$$fpB-0WF4hxQ2K_jU~6E>}5K5^=~Nqkdb!8&BmlirGxjj)U3h z;h|yx`qS7#Z^^7Oq~aR)qo{?b6r#3Ohq+^GOno-!ox9N@?;0g3>me;(yn*T&{}p$) zsvlcnygoQ$m4FQc)wx|4#+t&+zgW8hI!%VJq8;zE;FFl{m(dZ8 zpJ^Y+i*T!Ve>+py7Nn* zA{wMu+eG>w@W0DVN33u|q8)X|*8V?fK#wk{apKFeb1u6-WMtaXBZNrV^LcR?np;+> zh1=xenakj%l%W%Dte*3ihIe-DpH@v<0Q!KvF~>2r)(PtIeR@r}27-#&0lv!o&?9s< zq4;C3P_7Jrv_C{gb_?;pyS*8sega-o!+*+fqrD;^A2#Y7DfdZKx9|6;ef8^>WQF{W zgCY=)*R)PN5I5bcS!UG7>WL)UjMvPDKCT96J@H2(hS%+^Bhr~)%R&2l{5nRsrp!Fj z-Y!s`;5IZRl`NI{&V1@u-6M$JSl#+^xw+3>{&rO-?$bmbKw7EAB;yn$e47{;o)h>u zoE2T~r4J{mri)41^9Da~`!Oc}X2kQGW*~P02CbHKS{0cw_5A%}4EH|thx3qg57k_* zmv`DbQMmM|Os(&uT!=iTB)nK-R?=ljG)wbW43`gyFOKPNx5xr+k);Ro5IhvW%&z9^ zq*=Xoo1!x4{P-wAp4T%yUuJa+-rAy&EsXK-JQcCup%=*DD{c`I0o?dqZDy;S%J)6@ zr_}nP-Ht38@41y{C_&&bdN!xe@*qVUqC@9(F!UhIjyZ+DI?51%QU+c=5c(HO%4WK0 z!o(9*2w>706lXR6gb(YzWemI2aUhawCW#YGmxaerJ&Cve^Sv30R1+=DAJ*pdb==d}IVMzUtq0^kw95ekr)c~8h!z5jY>Pp-u$(v^2& z8vjuGRQ-txb{AlM2XDrg!K=>mqr_Agdu)eA`fa6YVyb|Z7w0Nnrc1u3L(j~S9T2gL+guYYv0 zdRAyjTXnjr|5P(60$fu_I6V-5_!q(8FSSsy+wTG{zfhr5X)U7sJ>=G54WB@Rl6z>O zlzn6+x9TTQN~7GjA9;)dXtZJ+V9db?5K1!@sDVC{KS9`Ta6!4L#X%euJpWj{1qB7w z!pZG|r&8SZW5`Cb)Y3apA2r^>lkSvuaKX!v4POW`86{ag4fSFUO50;S#42r2nh$ zAI>4Pl&VIcY0iHW{bz@)KbX}-Lc+hegW^$4xv6^^RUVGoYTEKi`!xd*il?aNu$3~e zjh-m_ZGD|-@ji~SWXs%rf@JhTPpO3ZhJS7==z7dd{KZjoE>`s}x|@L>A`Km>1>)o?(v@+Ks?2mgn5z9Fnj(9MbI#hLUQ_p{ z9zWyi!}o{Es&@AY|AkDdA8p;g2E$k5Y~vPC_E{WURJ;~hMU{!RcM*rfaG!y;+Q^MB zb-YMU*`zvGf;zn{1T7;3jk^R08+^KU0n(-J?+M**2oTHrn~t1&$mr8;QAhslMH|{3#xg+Ap8CYNuGHF zzIcBc)Ug&NUcwP4ZUfi<@q@`o#v9Pruuw-M_Q5T8AF(Z9x z7_238l-OE+9?DuN^X>b_Hj*)Sred~|rSoCy?Am86SYKKmyeeAp1b5xEucMat#`Zz@ zrIm_bjlWk>oL19+58u{QHbwPoY^fjsa2vyq!lr+ZCZe(({61_HxgWaSz?}OF72Oj$ zzF5t~8x;N~i%SX^#j8um^{4$`ixZ5sj8=jvg z?sC}f7`$LxyyLOm>2CdlTjT7dKV`*#AhW96KgQn_l7vO$%)_|}^U>tDm1qZ`E6Brj zx4vnnxbbZ#<7~js|89C)DIdwF4TD!;B~$PP--pxB|5e5p;g{v|cHbd--sRvZKj8@nY_^v( z#h);*=F%y;EpiM~&qavd&i+EBFvc%!t+j@4^ca+K^b&!oZ3~r{yUzajA0sP-`sZ|D zF(4o*?_eO<|FyOIkK%I|OEWW97pDKb{bzV3CwC)xQzE(SX2o_VXw-)SeH?;S_1}3T zO;Z)Sxld!;m<^}6+oA+oEBU*r&HME`Budbu>JL&0w#6(7PwvEkKYPd?$S*=4Q$qfq zN6R~c{(!f$2M3`ZLZq>kdcm*fy$8j7|Mv&vdf*Ar^X>ZWZF$AvCgA<-lPN#o{dM>v z!2jdz&G73rAGk>L^#z#f5BQuKOV}|e+-t8F>iL>#cjylQ9?z^G2LN6#-s>ag`U5`V z(({D^08gJ>Ul$od{eZXkjD(v29p2Bksq8z?oSl!iuSJJ?O~jo5tNA;?NxqQZ>+AJ* zY~kzeuHB(JnTaUC3mA6;e9KVm4`5jL|NL8Yz4BuC^;zE^@Ur(%-(S4{Ei&NoDnDjn zrQZMZ_Ot&J&^~9l4Lrm0e-R3Qct@`Px(fpm0QyzEX6`q8&sG$P`h36M04EO6?ETvP zYrv0j^;IDjkx$L^Ty30o*HBN^~G(E#U;6-`9 zzvpK_0wDk9^(FD^z!R9T@C-Bn-XRP5?K9>0FIRud{I&PgkF*2iHjJ;|`M5)#f_XE{ z7ySCHegzu(`2fp-Uw0V^M16jT48s?iJA%M3L&2|)tE(|X|H2nn6Vq~*_wu=Xpuo4% zO5%HtFBYhJk3S+E2~K{0<}tfwNZf2$}gz(L2L-}=&bHW%P=?MsO4>-NioJj3JRX48+q^xClh zlTBVmutyoyktzDsLzx}_7~q?O9v&yds0|C8m8siDR_=?^?78JK=Ft}n4ZtE8dyMhT z;JV<}8r|%E+1dV9v!NjH6C(zq|Lx-DW-*!1HzCUro5er*w4ZW~$YAF;;32HzTl%W}0%Onlt%Oqp_qmwL;3!+!X5RZWN}jk9u_w zFpgRE>F>r;NwloVY8pqC=`qb^y#Lh5w&cZWLz*V9p6_A8pNa=4k)vh#D|*po>+Y(Z zZw7a^r9(cr@--UG9-xMz$@nMB+KmkZxO21&61WO@h{iVjS{Q_mywcJ=?+*oe>pk8I zZbOaP4>C;yJQ4X;m$o$%Fy=@b;}ssL0_b%6*<^S5*0|T6ob33;H(osP1zg|wj5b%! zT=5c4Hn``wptool3RO3syn(oo`lP8>Ioz-|x6_8V#`76sCXZ^(A&RZD5>LPE^+EAR z_n7nM4$j#1%8gl@6rb7RZRyIV?)YO5GMgI?MlO(b=NDgHb8$2%8MvsL(*zL2OIUT) zeWqNO;kL?hvR7c?h0RLj#}3@EXBT}5?T;VwQrj+qdLbI`+(T{SPY%{t{+(=+h}4}_ zFxR;1*X4x>(Al!46{@S1mneAtSl^RYV4v^ zPk;x#e^}QrgFyzhGYOYI?9{DP-x@_8uk%DURkA~SiY|4md# z$p=wUJ3~+*?bkh4_hD1CN0|WDJpgDPFhT~O@a~j5Tz9Xc4hV@-q``MM_DksOyo4QN z>pn;#Loc73LeVZs?OWV)<&V!`BPiSOjF!`y>l6hcG+%w!HbU+Z*UE>4^1)s;H5o0- zBKW0R+iYgr*}ChxuLjYYU$*gtO&~gxp||Mt<=M4$d~oD^5P)DfwT~)s&)*P}B!s*Q z{xsa-LacPfpsGsO0{+Ir))P1LFcEa1^>(YY1NLk=)^4v?8OqTy)OmwZ(`jYSc`blcb+yn)bFAGj80TPm};TpAY za{VH2z510p9NaVWwj_FtW$dTGug%&&G14s0(O#ok6_Rh)$&+Vytb2-RC$w|R9*2cb zVy@^nyFYJx(Ri8PV+K4Fi7PqEiInV>>)BExNBNXW&V|)viSfAZ5pm|Zm5sndhrzn? z6(jA(zRO#Gu$r76>oTLEHHzpVi(YuP(X+uz7RxqG>&LR%q?iLz%udVY zsm1HdjW*lA=J|l9^FrSD33(4>dO_l!2}h_PI|saBN1_b8CwaSx;;RU7vejIfo=O$w zT-0jSE_)~c+>~}P{p{YTyek%BqlQ)ZMXcZbx!{`Dip94S8i z@+J>XxyDO^YNQH2>`7+iu%y4(Hl-!T#2`Ud%B8YVpR1*dWP3Ik3Ud2ZA2jn-sBHSiVG3>VkZ+qO>?rn#8=;@2U%2l^gRJ1MWj&5ZM^V4 z8u}9ZcSD_!?bA+O@>FdtAYzqBjBec~EKr`lxSkxbYZNw`D3gZXecLb0h{ni70^dip zwi>^b%AeFY<@wXJRU>i3t!`l`A;{qnoP!(OsPU$e(q9Nd?YaNfA;MMQ$`Q? zqr6&(j6JW7D`Og9Dcel_Qz}v5m$yaeTZSf_n>O|0qs@)|ReGK5r@?IrzXHM{P+`pC zw6ygQMKHDu;JNr;{;rCz?w&Hj*DN{d#7YIl`7b6p+7Bty=G4Souw3Xmk#AcezGN|S zfvrSYB2u=$4NST5?(z)(4YLCB0`$$(GzMgZu;<&-=&%Wo<^hs1eK9L)9nm@SiMI-(+H{u9}@OL$x}P*0*oA3|8rZ zYcjXf3}YW%ypqy29Mb$EjO5B)nq;kZ6Rk?q=N_8A2%Cv!Y5FEpu~?|~mYJqH*xVYA zxiy|?y6XW?2jCFQi?3t=(#P-YNXi|8ku>-4@BrdW zj0ag&1X2(6o;~%pzQBh~rZU@lskhSSF_Qj&OOaI9^X+iD5GsEr8jxGt-qM$)BaC`% zq_Zd5*5dK7$d;?U-AVP|d8VCwPf&psA+c4<&_ zEUt}0+Ej#WQnk8e`Xz3ydJabnaafZkj=TfzN#~!)(h(j#M(ug!x6;NtJ6cp^V&b@| zi1Cn}Pxi{jWA0pRyjOx8@G~$H;Df_4xFW3HhK(0%Tk^;fi<~a_Sn`;qBb0g~9cFI{ zx7W2EHkk@aFIvJ?=Kv*b3FpcL9#qcl94pcWZ=W%uDV8^F6)~Z2k2jrsc!s<{a^#qLaKXx7#No1&S!u&vS&Y&|~ri|2|qSH;67QyFc&Tv6$B zqfJr8meD3(zdzclk)oF#`nU+|NoozA51UK{wqEwA^w}&gkGVA_Myf06Ld;T~o1?MR zLl-YTFw~{~++-@C^s+^z&x0aOv*Tgp{C>q@c^tW7!@lmfIIZr){lN8~Ic4gys8x-% zmmc!C2%Di~O_7^Sg=DMtrj<*wQ4gDBlufWnb!R*!$KzsFzY$f-H6{yO)rNcNVVR4t z0nW1SO{Oy3q=~l)H`&4CrtG@L2bVu(y|zUXu7Qhg>G*bR9B9V+$ie zit00yFiQt({D&l zYl2xi!mWp{UNhN~abFip^Y232vBp1o=N~=#M^FCIbABX`HRVy$vF6%CG#6nV(PYCE z9yXcELZsT8M#{?ea+Kp>xn|avb1j(lT7OIm5<6W;7qA5HSSpZZqe0QbDzDxsDN=Xl ztfk5j=PpEmW@E_VVPIYGF<|l zO(r&*sAlJtRIS!4nH$UM!u>{u1uOD&nyx{dzxfbS;a`azxsa}zdxAcnW)_bi>Yf-`LNOqoqFUJLJDniSpYPCtMa^nip=`gU@b2BZ)9Np&d287ba4T$CT zPW}%(1a6sHzdQn|hf`jCT)@?amuxb%;nmA2l|q~1HaEtHU)A$`z>_Qf38F2YbB6$? zTMwmNgf%s~+JoID6H_DA+%gGO2j}$8tt(9Fw!%p6(AzDU#ksI#?c7gF8QF!f_i?F# zY|7V*J=Z^H*$A^9I(hT=xU384VUwv~CfQ*VX0pR<7ySIT4Ks3ZGbxGTy$vos7QDlZmx{0`LR8GjCBHg?t%rf%yutWtPkft9WvKN=5-5ExQFm_Lh8i9^&b`E* z@P9d=Ps~j zbv1^n-p18T&Vu)UoNF&jM=13W`CCBb?cr{dsqB!dy=fg&24zd+v$`rw>J*TSo(GP? z*e=Kp(Qepxpl>DI$+l%2MXCxh&CWyzP&c7 zbge1V(&9zcJ35#}_&Ezlp!HDuo2T|RO!;Axse#sOFIEaKZca*jG5I_82Ae*3><+dn z+rRa&{Y6;QSbMeNVUwxh*30&lLObgob89&#T}d&QRx0iR5g_dMN%`_r%7Gz?jazMb}kqE&Eif zzciI;;NsAdiP|vPA|7JZa|FPn>9MkIp1V+GmTG~vu_l?ji)btgTMwN214z}yEz}FK zSR6X>zxqI|A|K+{!)k|PrkK(ke{;#;?^2sRUi2)_-UZJXH`^PE9L09rv*+?m8s)cV zO;&jV+`3jNPgULJ&sAmG18TFZHJLP^y=~q}jUGN3_ORTAA+(R=P1t*| z%?HL-^94kyC(G=3z0R10qOwob&<9Fuc8xyIWZf;%Rpm>gub0YdjUGN3{=n@IY}DB5 zDbJHCAV-O4jJ|ZrJdz5D07)_hSo1{@4#!>(p&gE%(Yni`ccI$U?WMF@qX$oN+UdYO z2kHRM5VRDG9mHU>3aT#{4iv{DLixnSwv?LN`mKw22wxAcB{0QJU7JmnscXoi-ofAM z_O_|3f+I}OVA0pJ@+oe;zw+gHiJ+ubUroEMRGdhN<|v1%Cl}FMCD4SQR%!85#qP*6 z!*xNdi4ax}@!aut{!%KpDF%+M@|^Nc-N)Lwr6degW1?o4snq-M@m-^aTBU6T&lfoe?|h-En_9!i3aScNWJ0l?rNcfDp@L6yG}B2Ube#O_BQ;aMz`>*s%%R>F(w@JA;koQ`QP;y(1Qag2Xef^oJOt1u?UCY zbrIgEGMgocpeGq^K-pA#8+s~m!>wCuYZ-mqKp~|&nO{k*7*+#R@8_x$emw4MU}+;r z3~#YLXueRMZK*-lKJjv+S1tDLr-eMMR!VxKsaB}kx((m z*j^~pwv<(CM=uD>IQo@Ohd$UiLm~o1p^!H8WDh@cCEuk20T=ASgMr6YUI>cN! zbs*lk2^C@8v!~$Mb9tuh9Ho4i;vBUkyExZ-ILB6!OAH=gT5_+d*!t2G#@K96)GBS- zbpTrpiuX#xDIo*#s>D6d)_Mz+tMvN*nR9w_ucW+0R~E0Jey$8LSQB?HD(*RqPnE=o zRDAA&*Bc<&L*2mI2}4+4T8{cnOIxl4w$d=SwB^=yTfH3MXvE!Nk>w&{PYL3dVAV;gsKi(B&$ZVqeX>M=lMfC$BS7Zc;TXuM%j(SQ2M4 z*Vz>?YpnT}2ld7?wz-*%zSyJi6_Ck=Lz&xgbB}e;D46mUV%*+IhrzUq4VE%j8dOJU z?qXs^%!KZ~`mrLqXH0PSjA`tiu_CU|))mqGrY@W0R{lyZb&h4IB3S{$?JlB)V@(z? zbAv=0C5fblW>BvH>X6JsX`6I5U8V1IAoh$X$TPt$6gu*WAfx6<$>Qb%uJ?p)Iz*5cFveH0LRJE^z%l)=>xNO54iEyQ#Qo zX(q+02P>6>bA4kSPWeRx{uVM3km7^uaRf7apMk12mFYx!CWhzzmZHJ4%d(m4HEBE@ zo7ki(rcKq}Hau5`mM=P42QJfjZLj00`eOn}0bGkUgtU7Bo-+AB!Bf(+vk0v+cy{^a zb5SaVr@is_z>=#bmmi<9y$w%&am+E^{Kh(-vj0eAE>#`5C&U?ou(;^XLHP}ey`;B@ zAzCSvLPGMc&10pR3euyW@KWru`@{cnt<*r7~ zvBAZBqmh#wS+DRcVkO0|?a7L&byY^F{LLt+9LknrQq705TzX2w>9^vQ{FW8e!ztSX zIAwDL=i1%_r_#6&r*!xiI2E@Rp;>0acX8{WL>7N$w;}CVNLAsgwh1padLxZ0oi#35 zAqWT{&=+4tY~xd(Kvp~AR=CVg2n(_KwsaOeU|GQQGE1?q z_7!0DsOuHLCZ!}0N$pX71(5B*3Lu+F1>gwN+P>lkK68p~9Z#op@twbLV8d4*G#)s$ zz?^2nE+~&1SQ1MCv?Xq!tN^@Jz*)1%bd^KH|B``{R(`XkKis7%`_rZ+wR<>KbFiT1 z_KpQrYusH>gR*GLZxV3Uj1@~Uu;$U3ONZ&v=?>eQRE3eM_NEE1dJuwP2W)PyPI%q_ zaK#bD9cxVE*v5T6=Rs9S(;LuI`KukTasNFKTBv3^-M6SyxkV=<*-3z(eglfP^1Ap6W zRDl+Ls7apyIk5=%qxMvoL*R|t?DyhDyy}x;XXo^xLkW$$kp1amjhIL z+o*XlL^kVNXB#1&L_ASMa3(hhiHeZN`1H(Zw7-HYY3+zISv%ESwq-S^UqgZq_ z*-%y9cCFdD?3r56PL7;yQWdVN+CA4*&8}Vqo;0<1kz*{?(!vhI4Y?HlW9Ok#cOt@8 z{^JcXs76*%bF>BDR0&|SbrqTw{j2H?72%tuy&=|kAFXgn7?|5k(e*lj_jIQ zZz(C&{-x4Zh^r&|xv%A>cd*z?K<8GK;WFLcP zPrOgj6eiNsZSY+iOr!2g9aaP)$u8XUt5={B}6$4dWXLotb)o0Y%)zyL@HmS<;sM`JVsG86GHp_>zKnc)F z*H|!?khbbb7Hq;;>;kD2rUWpl?j>%%`E*XfyjuLZe11e!x@zoj3EH10PR{qVN!8Gj zj>-Tn*^KSeQM#DV!GibKk&rG zgp?5`C8FbwUtsmDSL7j4g;@Fbhg-QjAr28IcZk@j%Co++D?CzZoSYRdH`hm-yz+5k zF=JLP>AxsP8_mx8L4T=z(>~a|lhR+S&E<5e#v|3x+QNd~`bo79FCi7+Ap?$d0=vFoO4HoXMbW|u-Y?JHYgQ#rdM ze=eR=wW+A~HteKLB^YWuM*#Ig_5d#ZOy|=`Cfk%2%UMwB#earNPl3%%gw;WN2wY|(O%kJgNeJw;wWKbLLWtpa>wM%HG|`T71K{h z`85=pNP!Yaa{9Cu0DzL=j+$sJwTzk<|6KV<88kev-J~i`f8fsI_H!=7EtL)+x}F=zE}kn( zhpSZ=+t0<4)Fhl-fYByZn}jR(UjNPkRxFRW?k*RXoJ2i|yx1L>e#W z1>B@+c&!AwikEEW8jUR)gj-64zwAyzscqPsgmr4KN-gcLRspr29JSvnGF7RTWa@2H zOZIRkGF5LWI7O-t!e*!P<4>O3XZdJgsgg^(cm*|=+|8PYL03r%xP5osC9Tp2`>M)I z0buHd*HR)bSBeXQ*PqJ^L&)SU_I=0-sTSmPa%^5zG>XV+cgZDEu?zC%cF5dX<)*54 z8)9`k|1}Za=AChoHU~(%#WTnxc@FH>s=aAWsvak|oaN?htFR6aC>KV zEk&+^qoOKlwLcpJqyFT4NVzyv)s~~$+u)K`d3#;&amWhmaLMkM>57MvlQkjr+;w$^ zhhe|` z5>xVMoVX`0a?C#FtX|=Y99Ugg1$2IP_WYeHSL-{ARV=_txdYrOQB}H1o;3{i) zRrRZgcB%doA)wr(WZKR|jpFuo1FTN#mjX}i3?iWQv!nHU1+NAr&<2Q%2WW%SI+pzf8s75}j6e96tBs!uhIG1bE_VygO8Feg=a zh&`NuOK0UMbc!IW6Z@sGQ}eXUWuTNaUWz`-4RbGLyr{8G-T zeMALx-WKU%L`n7>u3A!{Z4xR%?uOXfT3@teZ-@kUa8k($+>2?QkElew$`#qsx`tN3 z>8<+&#EMjndv%w((kgA{8`k;tjdjT67d4o?>h-ROH0uH^AodqW?DuM3tuO7015+w} z)TSzX6|M8~tk7h@sh7Hfh;%^~@O$e?VT|qZdnM2|D;2+Y^h;H|iXfBS+aOzeL}r|& zj#T?X7BGDKHwUsEhOgS&5R)2%Ensb~*u2#1lG~aiB<@&TZFsW%`7w)!V9A*LeXbhN zd+XK%EXlI2RjtbC-(UjJiF*O2yb%r)=q6u$o9RGQ+1xRLMnpXLx_o zZ-aWJOwOc>CHFHm1Dq|jh=*A9P*rdS!9TP(OA1^uiwapE7D7n zwptoB^B^o!WlM&aD0YTKg>j0v_!*&LX=ivA`mj{cY( zD^3v(f$HJ&L@@?HS#$kess>cilG+2HWHXmjY(ChczY!>@Z5ODjk)C|&J>)bf;Dzhh z80lA?FW8*5K+`1DHNPAQQzg9o!CJrYguRPGaioW0YrK$ig>3Tn@1{H{&K%Tep-z8)P#4#;;phVRhY7FHF8%%eAsVh)@@cFXhE#1j*I0_)V&cQ17)` zQmf`IC8@N&rpMA;M@V)j6HU2iuq3yLhSVw_0@g+4(O?tv;5v4*P!i|B=sa#}($8-j zQc|V$X9C#TTn9{jQL14>h$d;zPbr$hS9B=)LcqG%d{F!hXSD-N8pQ)Pud1W9;UzWR zY(Uqj%AZB6mj0kKH}puEg@KEzNhyDpn~|%0h*uY%kLsP-O3e@BPQ5eT-iDXt<8FV< z@2d|l*_-R4sfsPte^ZWN@-Nsx`to@pT3u9rt4t=W5cZD^T9PMcwY%mg-Jf zAx{}r{UzxHl|r!L-ELe`xn0wRV-sJg-^ZVK+rQ z99dmFeh7HH$k|;+mZHwVp?Xu(zA-A5qa8hLjjO0KvVBVrH#H)+j=gMj-KGnYNVceu@%vA}r0VcVqFtOF*yH`%@N zCx(!9k^QY!n%pcM+1C}-f+?y5+8|SRUEOw|s=fugrF!9hm=~4Em#Gv2)hyo$yUvo5|r2G)B^mzkH^dhdK_s@?CJsu}WR z!behEj_i=TBd%YE*(SE-Y{WRXu4W<$Zt#p>@8q6>XV2xC%-Og-gB0EK ziq>*Al8H{R_Whsk<3sQqxnC}$Il?tt3bbuh%xw}+hNXBNw?&6lx)@WbnM zXsmfzmuCXMN(xnyG4X>w4UQy>-zHVzp{l(JKGnmfA6b9H53g7FrUQ3?C?>Kb zFy}&)ua;5dbD3Fg4lS2pxDi8IFDemP>rE+vC#q#EDg?UsJ}RRG=CdwzeS`@H$7^a^Qx_ZmH7B14U3I(kN}*nYSE=cCC9yNX#135< zL!QU3Dvvh_i-$p165QRnpXuj#?KWmBjc)4a))n2Ex~L@WAX7X>4^HOE z0b-LF5NOwU^Ot+mxkB?*q*W%dSje;}d~*`0ao< z+?A!eOU^q-x+vdfPOUl}1;hY0S-c@Q64jYZi_^tmQVXZjoNuJ)xtinA(++$%*k$QO&aJ zdMUM0l~UUWudvSh5=$6>-D7eUvRZnK^_@L;opcXdUg5DcSEi}@9GEgpZ=R{pMDbf9hRYT2;v@X+du5_l38iR|*+N5eDO)}NCktTcC;tGJJ$g-Q3vhzqK_3n`VjbU1s8DwGyk`;V}%{8>t>&Rrv8c&cdh9fK{ z{sd5p(fQ0;1XT8f%4`+e1X`ZqtGaF>THO?1sSMDPR(C%QZCY7CXo;zM+jK}N+h**%^GLZuF1}m(ki|o+x>$TF?PtoY5<1{!qNL3M z*V?o+AGTEwKiDLRKOIu7S*F=MkkgG6&1MsN;;FDqVfUfrb{b`{RVW3;%p7{Fe289G zsK-+A(9TOo>o=*&8A!FaEo15+;FdAT>Qf~GZUU#j? z4+dYI=&Ndt`xCWrX1QrPqQB_8-!?bv@>>#&iobpve5!|oZ*478cOO1|5aFl-Ib)Ku zD&j)*=cN3-;pmfLA^Y$J)Zf~zSmzYg4#Gl|KpTF_Md9$1%->92Di*kvPX&ok6!4Hr z@TDnCD#if4`e|U2r-5CE!Xjv}Zbex4ll~rY%C)okJ043r0cdAU~ zrmj*)<%9#?FD%@tlnbdY-L_lz5U9eTyHhup?9@JH@36Xy-GjUQvv;F^_82^S3Z6Ze zXDYZW>DydLXK~d_9|2VP&;8#VkXl#ToK0uPN7r5c)2OsFF6%4Df&qSki7@|1RNMST zec)M-Tvqif_wmZ4M%kxbsd9E28*}hBc*YoUa*Pr8j4|S#@tZPVl5q&>S<4vdioM9y z9Q99jWPX#X&{5Uiv?!|{gY%r_=5>suIv^9dmQ#@<&X7?UC@5-5HO&(#VCgVZ$H$+Z zK)7yAU1}~i?`vB@Nx?{6y=zXd>b&6?X?IyltL#0Ado##tc9a$4RHk^O{k4OX^r{610IVyp+K`4pP+3jtrG-YC? zWUVHOiVW#E%hEz+bE)f3AZl%*rUX@Y&$vIpocd%g%rCzq1X0>v_ZP3g_UbBQW2oC( z?7MBRTBQq<%*}+9L$8E8t?Q z{wOZ`c!Swa(Mn=+dQXf>ootex=sv(ObW&phvzpYL`)+1*2rz8-n#um)JZ|oA7$!1}ybp-zW-oU_Z-h?; z+edywwE8Ut9h>*yt@5PUgI#rPf)rn7F{-_33sya5w*{Mumnn>yAbV~hpHmSDf4npw zkj$7%y+`&DZXLTYpnB2EQ5C)1U;c_cRKn+%KNTGj*wu0k%8okmBl^1lp#rRB0;{JeD_ZF??eB#`vi(l*5nI z4FP_2!|qagvVHXnP9UxVH#aBt@aqoq&??>jvFcml3+{O5-sd%v;=pEmBp5lJ+;GCA z4ca*Ya}P4pVBgZVrKR{}J7O#CW`1lY34*Y!6Hpb*jNI``pl!sJ7cbUzS96r}!tzHd zsXs_pF;FMq#2JiWP_o$B6NjnknNDhC{~$>m?o=w;I)iSO59e&xd1EU{DG_w1UQ@Wz z-T7AS-sP+dak}xPB0UZhhU_EZR3y|P@FgaAI^LYjJ6y<0;>lK9@Iy5X#Vp z-F>!HeN;Tf)u859r?(LMXYT?z&~Sa9f@l1u9FQO_#N`>=#{E8uaPR5`U)6!!|LFn4 zwL9{|sOmgM3x0PYNTbp&VX6)!S0--f(>xKdK%@~iBW!f;nuYoT?g>mo%B_hs{-<#8 z$k2s+5jW`&2;Wz2gK!rI-U=~_`DyP3gYXUqR_#qYs_NnFcdDEu5x0QKtxzHyIMcJ8 zMgS`oJ{`EPb~&CoL=f`kI5PuT8sZDSl2`Bt+WzVW-!7886>pUII#-7(@feO^70Gbm z*0=n}_h6bUR_jKvG}LQ=XA0Q)@vAvV1zZgA6Rap*G71hFxkotsx>#~9gQ#O|CU>LsE_RQ#@z36I6T`CU$Kcsh z@a(xfQ?WKlUqc*)s;js^1CR*>#~y`x&rr^I?NJn! zLs=@3o^E}RtJ#?`nWS|yt}3Ir50wjvQ&Nje!#!fqq3(&*unM%+|~^Gc=VC9^Qm zm}XOE5mPqi+cY!G@Vsz^?`8`^0$iP}s$z=!zy)M=a;70wy)fMMy4k8y>7iToZSI2| z=;YfuadP+nNaWac#*FJcfA!LeEPY+8nUBjQ+{|$;Z8vp+58b5|*RS08f=kt}N-N^T z8&hmNNtshlw;-Zky?-E89Jh~1oI+(v5-@tETCcQ79A^i5tF(!zpDokBOI0H3wLr_p zse9O4mye}+3w?MQKCKPo2q_g9bA;SbC&lj$MLb|y*x$S03*ts*OSD#<^|%q;-iDqu zz*@3e^cC=kizkGO3`ZDeW4D6-g7J31PDGDn(4~vJO;p4~{CeU>a4F^ki=ZO5OvuAs zsyh5++(sLK>MEcy36&Q{0CM9!VEg71ndN{8G2wJT1|&mHif{;D57Fn(8o*~QYImtP zcv!c$p(n#oti`hEEAizsr}N>Aje|Q0^AgEwO=|iJ2KEe`hX0?kb4`|I#j*5M%5nhF z@qUkJ=rF0d<}Z4VHzdyGRT(D?j>Ini_Oa}hmjYoII-SZ8U0oRivQ(S8tL z7a%8XsQttYL$Wn7>ToZ`rjFMX8#d;R z&LH%FA{mVj)Vm>nV31%#UGEaZ0=uFG#p7{1h=|fPc^Y$fY$_{ z@AJXwMh}du#NtEb#~B*%$(UqiCxpo4zAunQ0ExWhsB z1rr=B^Ft1<^bkR33OFd{MFYIp+O`Lk*_uexV4S`u z0-#7zs2krvrupsAbFhz7m#kZ%49v#If_dSwEC=RAnH-9rH7|xb3KXQ#NZXN=4g5VP z-H*?4&zTo3xL75)t9P_&BP*RM<`230ZNYQFZDA{6=9#}>v_LRO11w0TE5ZwEj4`uACVTl ztz}kzO~||@!y*8bY=e&Q?t3bZAD`o$r6|pJE5SIP<6n0<6Jfo-k`YVp4SDFIsg$n| zd9`Fp1aOilM{>%IObLfKImazWQv3i8PqGc@p!*ur=1T8Hx(`rFo@$#2gQ+U@TUUe( zTQVOC*rH1!e2LY%&x%`fkyK@VfW&nCu&BLdagD`;t$@Fr3QJl?eNf8UJP=QfYGNwK z2-~OjcZhp!38PO^GfX0eO8ZG)@%rPWrvklJ_JuGC8q|y`cR;ZW{#Sysn}4f@DZ%l3zT*1@&>h{>W2Q);ViI zSmlhD`{_*K0>K*EF5X&K1iP#a@mMhp_^|28F>(y)@dC@VN@C2Z^bjvFvQ_6 zbcV9&k6U`=U;lO@L1gY@kphuINE)n;R>lhP=-}F55~pP>fRB91UUcA)fkv?m9!aZZ zbJ8j6Y-$Yeqsp28q&y*11UdE{tqIm;;vws7q+zIy1u&A7sEb#ln7CA~jDki52v^&b+)2ENH<1W8X)nU!By_o&>F z?tQNlsSXJ{hYNN4r`eUi^?f17mUR7suV`<{yExbONgaQr8=q3Z+zPRi%4p_SDuyI5 zz;Q+hh89RsaSTCf`zQUNz|xeF@)&ZQi7B+r3+nWceM{PY!GpBylcJ8>KB>pPH2MM zZY9`tFaSnMEU~#rk$A9p-J6^R3 zlYU$cMz>rPg)%yATsI#xG_D=+rmKjelw-xX-XSqfF`J}sINVHadYxZcZOVXEUzK+U zq6zWuwzc~d0+<8ax=as6YDswyATl4~;PUvB+T4S5#MMjBlN1M+!^o7A$}OI9aFrDy zzm^pE02K2f{w)V!8C-+QkeHPB8wTrfRfap)pj%8GJb4793xSD5w;8R~sqYGTwWPY= z)J-q>-L%aZ99MQc*n@Uhk1Lz*LwNB_Z5N)H)F<#Bl(5Uku;2##1BpI2fPU1)RX#ps z)smWCfjw>Qt(egJq>d}ljR&lZ{W37Ss8a(tr~YkJp`Q6oqiBUl$6N&EXjfma6S7VkvUv)pk`y z?Raot*mzg$YBPHJP>uqGPVVM**9{Ol^E+1x=KPArpZHTp^Z7&{d_c3V z=VwA_rUhwas6Jt07)K2hP;}(68PFhhe@h?d8e~SX|P%%S!TUOv5NoAn* zzIz4&wH>Kmjvm!euMaqIjqkqbJ!^;575+|r>RT5Z%;U6;T0tpY&e%tc)MMJ-egwTWA8^;y9(7B$`6qbx6FmDHJo~NB zZ2OV@89VW4A!l?C@6dNJmP0AoAtB8<-(ng50n~5c_i2zN$1Tnpl3pxfmsNCu#Yq2< z1;S>;g~EKp25Iv`reR7=OaL7CW7}Qkpe=I?x$T{XzlUzz@OMcMj-W5wO%H!ZnJLTI zmkmkbuT_L;&2qP-aC#n4`&$24;>6urq^4DyVVPM&cw$TKd6;*d4nTeoN9zEm_tSo+PX zc+oyVezMhS0?TO`bTNPBZp_Mo<@K%?);EsW)aWLel0j2ZPwx#h2EBgoLt}%>~HYww?1?FM4^{5`X}^>CDcUl zq{UGy73_bGS-ldr}WwlZ3@PI|4RLQ=`cbTq`aE~8mIiq7Cr7>WJvV(WE= z=aSB_%@*+y@9i^0q*3#NoQn>dKAP z1E$OsPqICB%4n6F)SZXSEx;D9{I5uYT-=xbLNzcpHOhnSXDrjR+%dw#iPHRa4 zC?n>1duV$I#Xw71MrEWh+gb*~J|F!~5EGzw;`HbG<{FO}=<3-plRxBDpj^G+qT)f- z*M~>;(oJ8X0R53I4#Q)b*>k~7uk+Y*!A-Bv*mJ>6pPtR^xuu(a$Kg9j(-A|2W^mIx zG{3nmXDLdKl7s(CeaP@KQ%8aGQO;7(Zu6jD)5s`eWZr#WKqd;v%Qws6_ zL{l2z|K)csd8iyk<(~`SPVvurY$o{Ece^Yh0Nw%wKso@m@;5*LJg7{o3XY=iuR#F3 zQnLp-4u}wUI$sATmZye;o<43VxOSlnlEjDl_}C#!F{MduG1x9 z3xc@DX+b76RrklYX-_M2(I+`;DoR z0qu-DGTdKhbhW5GPapE{w!zs=E4d-$pWYWvBMp??26Au0SM65ZbR+wyu45wGGh(8P z64SnobCWvoJ5_F!0MgrDFOGhm=Z3*I&%_|Gd((?!l<2t({C9IJ1kBO9!gp3j&Wd++guL!sElC`jd@R{3J;1cN8Vr--6MzP~_H;P@+Mm5;YdAJ^k zM9u&n2Y7>PnP9g+Z8#1sF{}2Gye@sFVO}vy0$X(n2#}WEfvK-&p)(SqZEPpZanG&@ zxMy9AsVw|E_bf5`f4p97V_MKsQmI{L`VfG46P9jb4eAmgm3w3m)O8qtbF8xz1J+ra zqhX!&yKry!a`$<(QCH-yZ*D9>0+JA}a(5APZ3GE;keRkO97$zf84h=?FwfEQVi(}W z){l)&yd@|=$~6M!iGOYc1$dB|XPz}-T4VmF60FP{fp_{3KvDT?PVd zNVfK?0|LCCUMLN;Ln;5AfB@yj^jL+S9&GK$Y&S@?X%(%azd2uI3!VkTivDx>`u`I= zLsVoQq9V`!2G96SMPss2$MkH%7rBHLN8@KbU#=3Tc2I1AM&-t*E;bMDCL&@LstYZ@ zlBNzw-1CWdC)Dg6J+kF!RtHKX@kWkfjZ(tkzE-t_9(UVu*Q`TG8936amf_=$7jOGk zIB1nB1*ER4bGKaT;~tNMjz)GIMbQj*R(B}78ph#WCmTUmyq|(NXtN+Xm zi=(lO=BtbHkW>vx?OKXzKg(nn$CnI__ig)B}zzu zNaHVd0l&QiYHtjNM6vF)H(LAihr>(o*T>IO+x69{Qg+L4>`l}$G3STQk`P^aHwR^Y zzKSaDnuI8E;x;ntur8&Tr>_cSFLa*%*eH|9DJiAGKb;(Q8J+bVe2eIaGqhR5?Bp*V zmY{+=ebcP$TUIu8Wy&kml~&Ck<{>x?Pw5?KNbg!>%pM^qGQSGu_ToM~$~w3n#3DCP zOvOsH?V#P}!ZrVPvOF;(_=FgL_}v;(KKja*?U{pU}LW5P_tAVv<=6*dKH z$-^2_V$knMGQHkykzi^fyatG8^i>y5Xove_9rCHVEiL3m>CT8~lp^&OTmcTHWtbiK zZ>z_s&jbmHAe{qt*nwC0CWobG)>LwyhWr`!g3vBLVHCBKL{5L*4{?&d1Fsg$B~I5ZRQM-nTbG5v>H%lEfXks@ z;-4%~yLZO}w{tJ4E1736Pd8jzd;1|{b&0oIG_&Ue4N3cc?)9};Kd$G;%il=55vHtJ=$sR$c8XdCk;xzbiJK*ntHwK15!#0pGRj6)B_7zmZ8p-Zd*wRO;% zEk%1Oub6G%YcjVPsXxlHXMqsHI3{rQt>=8{dIl3WF2FEpRu?4|p8(fXLTSYCuk!}jC%n$}D9o0c?)oWud&lX@Y@M7CIXFL_*flMTo>{n;)cF<7 zU}*R3(;C!#KC_4C<}BHBsunpll%H4B-THn4`TPpoE%a1RHzMCF4hIhaXI0On26Vq@ z6mO<#LDMY#9Dh8+INzG4-UsNj|03b;)v1EQXm)9pBm$FM5^GWTW*}qwGbkO+A^6cO*c6v6T=e-PaIQ z{DoRamxKReIIRtX@(GLY1j_FHeHO!b_$QG}kK_K*&8OzpGVT;s)&Ly3j4;{Lq1n;# zXk&5mrcevhg*62`K=M}V%E**1Y?_e8c4`eN?*r&R!sLA*VXQ)H~7_%iLc z0~L1~Jw&iB!NP#jcaoI($G|{tD2f>v29&bVpCsRmcDP8}tl^$(s+l3MBUI zE5k;k8lkaT;eH=rlN*iVDr1|^U%%?xkCH8LLGsneNs8B?wOu#Gplh5rN5A$~|NENr zqMK!E=8sH-di=w)tYF9LV5Of;n?kzF0>Bbss_uL)kR^+D_8|6D685g9E{pW4+L>Ub zaX##>J?d@rEX|7IB&2=ZOlksk6s9LyU zlwPYaK9|6OZdh;7`i?X;crkv%!9nID5pBx1@9q;2LW?oHQ!3{wZM!u0`kD~9Sock) zpre^hA!-xEEZj=1jBsghQlzF?Lj=24lb;p9H3xDQgOoU!sFbJr#dha5jjjm)Qb$#VPE|HcJ(s&Fmbbl`R+YSXh*>sp9)@9^PiEugGxwxAcV-udbZU-t`&09ch#8$OBB1 zu|^#du{Uad9jHu9skH`-9mtg6WZN)a*q*JYv{ZBbT~>VCdtFuH;JTBdn>De>j`k~I4n+30AH7o>fxmD5?C%Z+ z-WT>*gHl+3{;r?m8knMZ2Y+_2#3V=1oU=Up2h(B~1%D%7II#OzYed zPVMCBu~nZ@O^L&hMKC= zYoie{oX)5)oAIx3kMJaKIQmeTEA4z9)X>#1{i2JKqIvJm@ZaA;RZ&s1Ls9))Jw|a5 zKO8kGS*KWgLaFdV*6`qTN#yoypDXQi(uAKtuF#gC+3^H5khBz0Z5E9_Uc)TD+ecW= zJ=p=immhRDF@O2p)AbK~MlnP}aDQvRI4p=s!poTN3g`qnPER2D^B-A@sZBmIMEjgI zT42TT)Zq^;yKYE|2M$NWy7)0b+Oko)g^MG6SAk!Tgt~p z0nIm$d;xK3M1RsMW7+tey-mW%g zf_H+G?zjckyJgx*F$TsD#3gswQY&9x8C?hZ8vTRJ*Gn7HwrHl7)&5G^okp~pqqU>p z?k~UBsZel_7D>h~sDL5m1aqk%<=|q{wZ^E2b75rN!;vv6ym9JS36+xMPOn4A!>9)F z6u`hq%B5h-Jj!MgN)4md;K-r=-SJin|Jlz3M>}V#+Pv4bR+kF4*iNe&>XwciQ@23WSyBDz4qhNqc71$ zIrCD|dbg2p?D>2svB}k=Y|)s_Ozb48*^>Ct$v|9lu)=Str-g@?>=af94vF89d8xud z`_>dgf36}CpX}eH@Md9kFQc8r`jE0WYp=i-u7-JnYWF9Fen+aR!c(lJmP@Ro=8!td zkB~0*_#D-L9=A@(49XT0-*{}&LE@Jj_xngsVOouVl!HuO0~9$bqPEvGRHBLmvck~G z4M`w9hz%+$dP3}L&^5siX~34!SWN$M=`GuB1Vex6#s;ht*llcHvq z#Fs;IVBx^Xm)BO2qVF5qvm@7natbCOptEE=Ji%`f3&=pKua$O}-bnblwo~X;fKiw)s*ziT@ytYhj`AL5 zx9UTE+;zcYFI`XG@y#t@;8ZGD$Zmd7SDjqqw-@cflucuo^kYK8Eq|p7D{w|4I#Juk z4t0p+Yb%=)uZ>O%fd78(ltgiINw5wQN0iY@G0s5pl%Z)EYT}=ALj0A6w}}Ba=|Q`S zxb1)WRzmQVRxQZ)cTrnO{EkT?9$_{f8g$ywG8)t%w#7H~Yf)i5@Q}wlyO$^~pTpfw znl*;GbWFQQva!DycToB}FSn~^%=Pg#EpD`zJglx|xpd*g1d>~gccG0E6vvU)$p(i` z^GSf9kYS_zua-7Qlrd@d$4H2$GTbHaIRrFmtjN**>MyvpoMgOIkj_LuRjWK6uaWL` zlJR{Aqaqm?i%dMb!BX%{(6+<%a1N>4W%CC&;}#fZnxp;UI-&vc^|8H7Z>)|4mEeTw zl0K&5&YWlVb*N2;&}m|LQTSz9b7F*CV5Q$`#27cjHRB)8(FC+Ww9dTsH$u2R7qH5E zpu>Bv8R8Z0rjk0RJFmd_hp|(^x3WBA7pTiw+nYUZuJDtfnr=q zw%AZhmIOaL(;p=&z<%8${g@mAeew#70N<9 z&ULFV*U;QNg0>&6kcq$ZR}a3Kw#|HMN;p&l7?amy6DPm)0Z|l@(^3 zTHz)Hj9YEG;D$ICc0zo*%sZ7oJ?XS{F~y58bd?AIZ6@xVw5bn(16K{2~A^$zuLQsP8&YYq?gZ{N!DS?7r@6BnVGlQ z1kaP~SJWy@7<79{L^)KRr3JrK-WCt5XTrCj`drh^?@qOh(N-(=T+??gt84R1?HAv# z*5T4*X7i^&qBf8-piZRKNJ_$jhr!|aV5CxsEUHFMX$_A3Ssq*9~EpPIpi zJA|#`XUDGl0j%EvA|GnXzLf&X7p<~L@!e#`g(Q|ZN4R!}i$9jlU0t|2_$mC@X|FL; z>yXdQB0I5?2xMfIIHaCoGT`r28>*?7gadq_wjTI}XTQw@wg|{WY{>XO^f8gTZ2>M-AzFY)WGxa`Ms)HnKzqkTKFXVz?fXdYMfo@?O32U3CpldbSO(%pKaPOKW4a-SwiA%Erx7YP^npShz=hllFd&TIWWF<3M^ z;_htJ>B`BHM((PNt>Hc2B?@+udL za!FS{;w`G^_>i`9xpUYfxtuIO!8?`)9}L~uIB_D;X7i{xoOf_fB5_M6w9mY59`Cz@ z=JQ=T14JAGEclW|=yk^a1A%xfDUS!gEGmI}P1fZ{n(L7@hr2g+32^URMT zuC#{-|L`%cZYFD^_z42kkA*-B$V}L=`W#Y~Ov%bqW7D=NrcU04l)y9Dh$yWWEPO|@ zy`S;DQWqylA!^NQ4KhF+!V%j}y1HvB_j&8V7pf1N>YE!EqeKd;PK4wP29}*K>0T95 zM`XEsq`q3R!1Dr0Py;cPrKp`xoOW7~nIvYAW=9z_=>|m%3+Y>L_VaN1bNOpe*d1Pj zDYA$A-f6H)|11-~|8-!1Xz#PPo&Fo!7TV$~W3~=9O%AL9JDbIk0WFw(yW>F$)Cqd= z8nKn0WIm2V)koG<4s~O(wiApB8ea!qmzhG;DqGMz5DcdIh$|uANZVmNNke@kV&3kV zq1YHKy)+dY7O8%5_VKZ2d|Zske`Ss6!g!rVeR$nWxYfE+gh+}7pTL1M7MfEn!n6+1JynS;iJOUq z%4rxo*;w_$9=p|)=dv=EKRB7mtp_K8b4sn~e0S91C>F7em30H6exi4R^>lZm7MqEz z5Z**OtOXS6!Yei|WGN7L8p051YSTv3x-ph)Db4ut3!Hpf`F;7acQR|QraGDmN(hip zv|}%#Qm%%AvGAYQc6w<<13` z7O)zPKkbFLd=rOh=#B?as3OoDRH7j73RbTD9U79j(a$tLe3`W76VA&f=ei1(i#uSI zn|My|J;66$HEdU=@zY?HD^bV4Uy-cVxN(eBW^BeA@Du@)Zom}DThdvw@c6o1Z4y|^ z$>ENyGA6($2IY5edcN?U>YdKJlP{N5XbFH2rpicA#2e{|I_=)TS{Eqic%-Gr+C?5P z1pPd~3gO;P!u1W;Y<^FsTmr&&`R+V^Y69~L!;-Eb(ty&- zt%aS@acOX9e9R*3*Ty_O2c||;SiTM1@K)j)%;9g7w1FyvS-B2p|IYoG1L)hX9U?VZSHE$P~{ zo+hhQO2eTaznQD)H21;Lv$;l7c3XG7-n7*1HB%t~#A>Y0hEL@a>}G+y_+awyM_bo$ zo26X>H_!g2bOQp}JIK>2-iNXJx$D#3F5`9oXyrSMYim+|Xu*udp|G+asl{ZdLJyDf z;}&H)Iz{3RSX*%iDb-cG(#EtQLm1><>*_)h)07^lS%n0->8oB`Zx(bDdp z9b{b(A?q{RIawA?P$%)kZD)NdpE^YExC;h9I9-rPZws@ESXymaDA0h^epw z9%|;4O+5nI$MK8m2tj#R(~4lod?TBgQ)!5PLUXkliSx39FNX!sQtxLh9BfzN&m^ED zYVjC_1=FXSM+JL|4fkP)1hv&&E=yQT;x+Du=nL?>hilD=BJo;F8a(gt^o9#w+DSJq z*^qw$*Ky-aww(B*vx-Jpqnk_MWdAp&0H(GhY3=pLyg_w|HS1zL)X@eAZW!|G|IpHubT*?0hffQ_BvEPa&)0SK0`7;Xgm4-Y z;58Ub^*%<3cWX~(6PV522C;g5##BAjvrr#eUh&>&7(I{1SQs`}axT@zd7N-s+1I4H zB1wCvsT}PDX%|V5d#x(dTC9H7b*X_y^q!!F47fir&e7L^%R0{m&|-dagKt= z%RkZ|-57#Mv)X$8ynm6grggM4CYwb^X4@e57S;!e%(K=@poG|Bc}6T?_8?0WZp7m* z@ncLd^N0?N`t8@1y=e2cn3e9~OCQyd2vOx5N};4;xI=ZYD3x6?e-u42QE>wN&q&z8 zQ{nfd#jMDV=?@^l@&!Kif4X^u8~drj0;smwG(YEph8Eh-WXs1p;rHj1Va^P-nU^sO zH5zuZ9l2O`P_*xfuMFGF1qe*qcOpNcE`?2dKBxBWi)a}oQGV5jSORs3`&CuiOw#c8<8S)A#^e2nw?`Uy z|9F<}ovWl(jKJ6yY#+wu1G@aIu8C)$(2>=<4NZ~%*3fh3SuM^P?2iGmrTV?F-_Mg zLTbsK3tuJUn&LB(s4*pYVl&mh2m>TX5DGyU(tM;Pk{X$&kgzQ_nv5ZpvkY)T#@2$PileEZ9f_u38_E1PZ`?SD4Jx)AEy<9RUS~4@f zm*HkX@_L?cu=#)JAE(xyLpov9tq)P;sDZlDXz{Xl(U_g^ZYNYxm}m9$`hdEm)IgA7 zp)c~Spn;ecn5gn6kF66u33=r93hi*QUp{!NrZb|mEX9#{tI}5X-W&}a7u-uubdamVv3E)11y~28dLRHm#N&UP%`xsbC>S39_cXIS&WI#NKlw3 zKS&Tb%BA}(d0tMc{X+CB^#kfKmFES>)c`DZKn{T_s(tw+pM(wo8U)8jV1OxR;@*E_86vk3GmoIH!&f&^MI|U31SjJrNDDRg}T!_wZP-p4C z#O;|d(xJOs>;yafSK`B2mp$`%N!Ici+8e>X8FNFZTu-!p8anjO=25>=Kr#A5xTZb4mp0m4= zu8ChhgsNFVe{LiOzHZIRuK91Pr9|H{n*$en8+75Ew6y28QB1izuc0oc%CW0l1+F(oi?3gj1>jmrF;v=%{RW%P;f3x4}I`_?In$)eU;d@9SleNVRi{e|HJ`3 z1;B7%@rSl-%5uy+4_y*FrXS+ka&VV&rk~C%X_6X;>f>kWnK6So~%sP=&4W&)KU4^d7e@pegU8r%6gu-JBmI_?)j2Lj%z62 zCjAjI<3!;q61Y|Na(QtZ zLq=;-$YiJ#q0}-}Gv|m3w!h{k7J(n;!a9 zv2_)7dz{~+LqQE)=R1FTQZP!YhNXzU?UJO(@1*(+(1c%ds^Y+o7apaWSY0)8{{|9Q zXgJo@FF%ltw&)W#rWkiqzjGX_5suvKB;XDGhDEj4uKkCma|O2tZZHn$b-x15Q<&H8zW@lj^@=vfWKt(ZR)>D&FmyVI%YRuhBk8t2t= zoAW&o`isXWp&TbR?L_x={z2N??FUNo;WNjY<}DaaG79&H#a9ZKj?z0Wa26qb0Qbla z*>*k_%Dltbt*YW+=QNJTew1vLlOPzLlO|Gi;>kgGRwx&p&`WyOwM}i~O)_XZhF(g$ zAVxZU0yw=USY=KsD5u<^ha%0O_K8GO=8PjjB4{Ud{Isp$v!GN!_zJ%yqr`=^119to zwUlH+_6DVVG=;?n-@viXnd%6=#w`Dcuu-ed;Fs^6n>LTSB-IcOQ|j(4h9qZAU_U}v zH%S-gQuNIb^5`P<2ClXrs=1eD0ebSe^f?qih3}G9G@7TTI}%PdD$V|loK;uWGU(d| zS{ebs%f!Q3Y&(!56cb&4rSs!QPd`2$wF$^2QS7?bi8G~tATY{^NP@XlGF6P2m&bap z@XI@e-s$vD5J?@UqN8?mDKHNSn+)3|lon`C0zN zpGYE3Y&_a=fV1-z`Tn3?X8X;5j$J%Jl@cFfd#iU4NEPZ_Qda%cL}I@Uugt7+ug9)% zg@se+O(UU0olg42T5+CemfrJl6f)adLaIT^>;D{?=_tz+qvHFB;#9++N-UZ$w?!nbPao8KB))=e1!e6I3lg z-El4HU(Vqn)8w$s-8|%a2hqtFEM;0om2%4 z2D64}+!q~bd%A6#wBjt#CWX`7Jk9n|`24+c-9Q1k=ggt%-rd)NHHKg1`{rIUdd+YA z$`Sb#K?UZpQUMjpi@;4_Mz!)LY(B`s9YGB5{!nMF1A{%<*}RNH+MPk)6+Ntzv4YxS z-ioj~370HD%fTX{TO+?AVp!YBR93w=31kt7zfrIjb(G*>{a~l4>Ui>H4qi6pNj$-G zYYiF`T|Sw^Mdqr*d+%?T*Pctn=cDeRVlO>;50{l#f9&hhZ@MNjwguD57T{@YI2lk< z
7(vtFUTLsdsEHnbx>EOrry#1gjrfy*CCr(Iv@#*>IJ}8VJC^X+2m604!TQOmhJ(~^$8E^TO)NggOQEFD4up7^9{G{r>1EKlWKQr8=dRC>;h zG{qAKi&W<^W*MJLU}Vc>Q7(gfgLj1e<*MB8M=Cot>y}5Zayj{Q&=h4D;G1zy z@Qc9G_U%RREFZs&-kxpC&?lF+NHouf)D2 z&1AO%gf|Ul(3KCpjUYx6*c6H)sEHMV0W+IT?2t=OPm5a+=u>yntgZjbTr>G6bIsl) zuE|QgFyGU)&=3;}^&<2{I7AP3z&`70=bc1>VAudv1IEKTu_O5N&g(Kvi-SQ+&A(M5 za~S~w=4bZq`5>5^=J%Z_BZl(^^*^D*e1fr+5BML*VpX)YaGcVWuR-8jEck=qLL!!%98Nh8C`p*TK-r+uso>hcCNPbHkX(u^w9u>o$9!4wg zu>b`9BDpxN}0v2<{unM%aU8qoBq4ww6^em2De|K8X&cK9Bs@2Of zMiJ)^d~RkMIL?hAxRF|ewGj}rh4&B?g>2B>hXJEuFc`EwyuY~3S(Os_eIYy}lOFpA zanA=~8z!WR6xS)V6=}1< zfe>3~bnjEJHhkwcq%!{*`Q_zgGM4x(xMp~*~4&9%P}#V2^E*;~En#%=cC@vuN}JyzK^ zmwO@tU#SVKxS%7tpCke>Af!6!l$)^RRJ=xSfl|AueiT05pcHbmsA>(6_`MD<525k% zd+zPTX6{-xaP~*{TCP0akT$A&%>D!^9feF+7(|r6;NPDbf@23sTXkU+r@Y{Q7L^c9 zGYHz%1e$1VTVnPL0v%#(8w%I(2G;_$*O zpvfeP=VvrkcrfB>r>Y3M{(g;1h-UX=+#In|T-Qb-!ik#OEzbRi?LJf6)(n#IIy(9n z3g-2`y+<)vq+5GjOy)+)jQhQe(ShcBiGs+$-?}cL1am1&Fz;eH!oX-S?|y}hy&|$m z8p)Q1W)8gyTk~-*#lT?>3S+iw@MrtB(oay<9tk>G%J7tQQJwQOTp0_Wl38#bt@Bu4 z^&?ofy{fu4L%gk`%~Tk)!Hb)|wVm6IAyoCO#{tgJ!5ke_RkLH) z!cBsZ%pwT-=h@c_qz}3hbg+%Q=QgQOJGDt!tx78>*l)h3(dS8G!OmgrZF2C|-wW!W zuTK;viz#83i200zEkivML!$%ZtT@X)YnN!$=fmn>W3C*@eQ(QTx>CanCd;%3rNM`0Qd}CyyZ4^HO{}hf$xOxE# z4_9Px%Jtby%)LML_PVBnEWl6UpGE@NeLW@qJ%T`mD0wxu4;{}n2`~6v(~C;rq$x1N z$0BQaG2Q9iRRrZ(NyB9`Nam=0$&A1>iw#1{5$?mIAdItLBzVI0qsiIw>-3_VkTd;t z+FNjx;fA^%sm_*{WbS>CrurP}x6>g6LX>EoPaH~TV#}+7Jjd#-alz?d0~oy#qh1(? zPJMm*^#LtPT>*jBbi@h=i)73KVFpbjD4C5mwsiu2XxH!sNRMdhtkiMp_6=BXNC)CUJ{;6%jV^u(97m~h$?<$ z5{{!kRn%|#@jdac%JG_?T1BDqACpPJ3!~afVI^6JASMO^9jKe>qhdXJOy{ zl`|RlC>@)`VB$(*_@hD z&yX8N%4s^bV3-VhTVL`>4mxnCGv7T0={l+n9_(za_mtKN+2bTmH=f51sk0Z8Nkq^d z$dyonU10z82nB<(f05e>(_zMT6O=@o>4_ZKHux@rX;y5|{R4!s6;IiQuf*P%M!`Rk65C(Wp)WIlQuRr6B(TWAAugMfBuJiSnNE$FCF1UWjPzxII|G)}r zbp#E+60YLoLun#-YyAh>H~9`8kmFu?bu`7fosXZtm#4=!fvRrx@OwT~{g33wi zsjtCJU|q4fW8YC@F`cSjHwnsmg8nP}8yL_cLZ^dA%Lg_f6D?HeGI>p^3Q0y8bBh;ygEnSYX)w2!X=&duMtsczPL@Qla%&V zi|ASl*Y|mtSoKU7LJ7FST>rCE%4A@ocI7jKF)&qM_5EKCPaxs-D5Cx(UDX?s=ffa_ zC>cTQ4@qW!3h>sJMS!@b6$5wMw%qr+zdl;?GH`X=eE%da>u;0tRg-GfPn~WikL`d; zBvHdBvR1#$aXvhdpB;3wsV^;_UjJkgJ-(AHh&Nb>Jx?IgQ9BHW*I@?0ZWkLD%u@?I zX?CfMbDtf_GqvuP@+^eG6{&31K^cB8TvRp@-D7U@lS4h<)7que<9-O9C!vy?WbNUa zg;n17LG7lH;xB>L`K%8Gr+Y$BiEHBTCUfc-_)Fw6t;JYjRXk6^VJLr2D^;1fJKZ=F z@)Y@}IfNxqdP$NQ7T@v`*CHH*AIo!Jm8GQ4F>pikP=aS^M+XrM7UFv5N{0yrh^`b* z0f||K+Qg=+0{h3W(ZS0UcC1xR*N#o5ZLUsqK}7{A?NVE%n&h^(WO>u!?LOQYV@z*B zA;p~oXt0bXKgDT!8tq)VOg3(ZpJ(uD6N4*|EM8m!(u~<59$?+2IH|uS__D8@ z1_#KweT$YrY!&v8l1p1mkn?nE!%mM0^iFUi729Y_ioHO8;am@CpRka!a%nG$pTiRo!v~|g0An}ganKVD?Lql)nC_y)V zN~|FqkGX&H1|#diDv%GAAOEHMWOu7B2&6wGsoS5*DTIvI-fcGZ1>GKODh2nrreE*Piv<~^IC-|0>R-_b;;NweSrJb%dw%_1c zjn^-Lm7l7aVq(0d(%t^iD!;c=4RMb3lymju>?v4O3jBp8%`PXSfD#5$2pRm^x!Wmt zjg3L-_^PM9h=|yd3H<$rV&zA{&s827Up8wBGEZ?7rxyi)}#<|f1s7aXi z-~*E*8;NY&RYDl8T3V`Q$dF4O+}IdQR2&F3$jWM z8mp}PZ^M0=$RD5rq=lub>xChF4t^;;@@g8#wC!wT8-xIHzE)IY* zy~4GtFb7u{s|L)64kZ(F<2;DeMngHaaSPy;jyY5htw_xwU5(09=fXXfW+BvBkxB^oj)ml1?x@s}#|F z(Y}4G9+Q^gxFM(sVJorKU@pvwebxj}#KB1q6!C-OKctS`K8ao5>hgC#9a}s0KVfo9 z|3p85zJJ+mG?M^wxwT1MNqftdoiuEsPJ-l^Rwl!kfh$CRJrz%^7weeJJ!2LK(dBBD zr}W;|^AFCZh=FpEs&WyUOMt!*H};o-SEs51gbQ2S3aEt4vCk}f2i*D^jfuba4cKOsbm?pAhIO}vAE_imd@W*E0?`ZtL! znFNi1gFsU*094!8Kv}y&#MBjK_BMg8n4hlndBAPOl%NGNwe&@FH~9jTdtQNpzYi04 z6*<2K;bsJQnm!z$;Eh82*LjrkHm*)HqlmN_dLdctjB{8K1&x-MwWl+h&9sR~OkNK^~NUN&(N=zBjV&5oUog)S!T zj+=!lX8Dj`ghvJs$FwVw=7Z8V^5a3C;F3Ss~!GoJ^V?93{v^>=kY#F$ZrOILd+@7fl zErwAKuOe?xAF2v@pqIl6uQjEbU|NuNaumWgumr&sB=%D#$3ycD8&g*!vO2kkx=uaL zD;uw%L0g#le=VrZIU?NSjYaIZmsAM~iu-wZQ;)rVs^(wXZB;pcDEL;5{cZPoZh8ls z5x@(S(`_kXSU77vdTsZz9eENzG&XePl|)cDe}Kpay=trK((Mz+;J1)57bk!@h`atJYP_;&0(sbO!>Q!tq_M ziamG)ijJa-m@wPgJb#2(8x^UwYg!9(DH;y}_OPrLHZ2y%S@(ix@+K6$%UJOR%Lhan zPK3Cu{RaZ|D~!JxMV_DlS}csD^z1(+@Za2S@Io|kF2rZgH?A{)iBV0$GmJpu4jav7 zc&ZWWh|GN2%zk$87eWtZ6UAW3pFcap;U%{1h+_(~ZrAY7&{8aU*g0JtTL@Qn7C}ja zJm1W63T!pjo^jBPgjo1+u-*^I0c015<<_IboLn>ih}?EhM)id3IH0!#NJrZ$=<=4 z!Pwr(l-|SEhNuV}gt7nt{K@~fUm;0CGX0F-!mfh83imh5EM42C-3l7!AcHW%TN8ZN zqU3Or#_hf~n>MUWgNF8f@AgL|8vZIR_F;X~W}}uMjZy+caTFp?LVd{G=JE5T%cznvWrp8~d`nImKiP;WyOD5z z_<5JRT~9m(`i07O-z^I*cf^`07l9?1xKpj5o$J~pZta8il_4T^1sdz0q9?AG^1fk=XBzF`t1lMmQc_kS;7 z=OQ282f(#J|Af84{W*3k{wI-WUQxfa zu`mNqgYV;~CH_TkxI(9jkwI;D*?unDfXXS9x%0rX;*CKK9QrT1ZhSfqvLoidIokE% z=f@>7WJi^&T6=~Q3de&U;AHx6rv&5m-La0?&8L&Wde;x9{?=<-niFo2HnO+3{^!5{M?G34 zXj5xI9T`9=r2o)!1so=Tdj4I*e=me70w~o9HUPl;3jn++|NeRcRt6~SY+>kRYNF!e zWNBya{6E#d4-2_l9tr>$B>L|+5S9F28eA+)ZA}^eb!7UV6nKNjch|!J03eD00K&hQ z0FX%czl-4FX=D07{x^Z{DGg{e0Fe9!3i$RPqBg)0^S`R@Y+-8Z;tZ?^@bo_x;6I1a xe^*oT2LSkg4XXeB7XD{P`0wJxfB#MVzq&<583>@A003CvI{;|4!=Zn!{uh HH > -4.24e4 + if (HH < -4.24e4) HH = -4.24e4; T = F6(HH, -19.44, 8.53675e-4, -5.12637e-9, -9.85546e-14, -1.00102e-18, -4.2705e-24); break; case 2 : // -6.7012e2 > HH > -2.2138e4 @@ -1141,10 +1138,7 @@ namespace Psychrometrics { T = F6(HH, 4.88446e1, 3.85534e-5, -1.78805e-11, 4.87224e-18, -7.15283e-25, 4.36246e-32); break; case 9 : - T = F7(HH, 7.60565e11, 5.80534e4, -7.36433e-3, 5.11531e-10, -1.93619e-17, 3.70511e-25, -2.77313e-33); - break; - case 10 : - HH = 4.5866e7; + if (HH > 4.5866e7) HH = 4.5866e7; T = F7(HH, 7.60565e11, 5.80534e4, -7.36433e-3, 5.11531e-10, -1.93619e-17, 3.70511e-25, -2.77313e-33); break; } diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 2a1559c78cf..5c94cbea0a2 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -761,7 +761,7 @@ namespace Psychrometrics { Real64 Tsat_result; // result=> Sat-Temp {C} - Int64 const Grid_Shift((64 - 12 - tsat_hbp_precision_bits)); + Int64 const Grid_Shift(64 - 12 - tsat_hbp_precision_bits); // INTERFACE BLOCK SPECIFICATIONS: // na diff --git a/tst/EnergyPlus/unit/CMakeLists.txt b/tst/EnergyPlus/unit/CMakeLists.txt index 4a732cecbf1..f640074a2a8 100644 --- a/tst/EnergyPlus/unit/CMakeLists.txt +++ b/tst/EnergyPlus/unit/CMakeLists.txt @@ -132,6 +132,7 @@ set( test_src PlantCondLoopOperation.unit.cc PlantUtilities.unit.cc PoweredInductionUnits.unit.cc + Psychrometrics.unit.cc Pumps.unit.cc PurchasedAirManager.unit.cc PVWatts.unit.cc diff --git a/tst/EnergyPlus/unit/Psychrometrics.unit.cc b/tst/EnergyPlus/unit/Psychrometrics.unit.cc new file mode 100644 index 00000000000..9c01f5344e9 --- /dev/null +++ b/tst/EnergyPlus/unit/Psychrometrics.unit.cc @@ -0,0 +1,192 @@ +// EnergyPlus, Copyright (c) 1996-2019, The Board of Trustees of the University of Illinois, +// The Regents of the University of California, through Lawrence Berkeley National Laboratory +// (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge +// National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other +// contributors. All rights reserved. +// +// NOTICE: This Software was developed under funding from the U.S. Department of Energy and the +// U.S. Government consequently retains certain rights. As such, the U.S. Government has been +// granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable, +// worldwide license in the Software to reproduce, distribute copies to the public, prepare +// derivative works, and perform publicly and display publicly, and to permit others to do so. +// +// Redistribution and use in source and binary forms, with or without modification, are permitted +// provided that the following conditions are met: +// +// (1) Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// (2) Redistributions in binary form must reproduce the above copyright notice, this list of +// conditions and the following disclaimer in the documentation and/or other materials +// provided with the distribution. +// +// (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory, +// the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific prior +// written permission. +// +// (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form +// without changes from the version obtained under this License, or (ii) Licensee makes a +// reference solely to the software portion of its product, Licensee must refer to the +// software as "EnergyPlus version X" software, where "X" is the version number Licensee +// obtained under this License and may not use a different name for the software. Except as +// specifically required in this Section (4), Licensee shall not use in a company name, a +// product name, in advertising, publicity, or other promotional activities any name, trade +// name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly +// similar designation, without the U.S. Department of Energy's prior written consent. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// Google Test Headers +#include + +// EnergyPlus Headers +#include + +#include "Fixtures/EnergyPlusFixture.hh" +using namespace EnergyPlus; +using namespace EnergyPlus::Psychrometrics; + +TEST_F(EnergyPlusFixture, PsyTsatFnHPbTest) +{ + + InitializePsychRoutines(); + + // Test 1: Label70 - TEMP. IS FROM 20 C TO 40 C + Real64 H = 7.5223e4; + Real64 PB = 1.0133e5; + Real64 result = PsyTsatFnHPb_raw(H, PB); + Real64 actual_result = F6((H + 1.78637e4), -1.82124e1, 8.31683e-4, -6.16461e-9, 3.06411e-14, -8.60964e-20, 1.03003e-25); + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 2: Cache version of the function - first call + Real64 cache_miss_result = PsyTsatFnHPb(H, PB); + EXPECT_DOUBLE_EQ(actual_result, cache_miss_result); + + // Test 3: Label60 - TEMP. IS FROM 0 C TO 20 C + H = 2.7298e4 - 1.78637e4; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = F6((H + 1.78637e4), -2.01147e1, 9.04936e-4, -6.83305e-9, 2.3261e-14, 7.27237e-20, -6.31939e-25); + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 4: Label50 - TEMP. IS FROM -20 C TO 0 C + H = -6.7011e2 - 1.78637e4; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = F6((H + 1.78637e4), -1.94224e1, 8.59061e-4, -4.4875e-9, -5.76696e-14, 7.72217e-19, 3.97894e-24); + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 5: Label40 - TEMP. IS FROM -40 C TO -20 C + H = -2.2137e4 - 1.78637e4; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = F6((H + 1.78637e4), -1.94224e1, 8.5892e-4, -4.50709e-9, -6.19492e-14, 8.71734e-20, 8.73051e-24); + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 6: Label30 - TEMP. IS FROM -60 C TO -40 C + H = -4.23e4 - 1.78637e4; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = F6((H + 1.78637e4), -19.44, 8.53675e-4, -5.12637e-9, -9.85546e-14, -1.00102e-18, -4.2705e-24); + EXPECT_DOUBLE_EQ(actual_result, result); +// + // Test 7: TEMP. IS < -60 C + H = -5.25e4 - 1.78637e4; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = F6(-4.24e4, -19.44, 8.53675e-4, -5.12637e-9, -9.85546e-14, -1.00102e-18, -4.2705e-24); + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 8: Label80 - TEMP. IS FROM 40 C TO 60 C + H = 1.8380e5 - 1.78637e4; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = F6((H + 1.78637e4), -1.29419, 3.88538e-4, -1.30237e-9, 2.78254e-15, -3.27225e-21, 1.60969e-27); + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 9: Label90 - TEMP. IS FROM 60 C TO 80 C + H = 4.7578e5 - 1.78637e4; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = F6((H + 1.78637e4), 2.39214e1, 1.27519e-4, -1.52089e-10, 1.1043e-16, -4.33919e-23, 7.05296e-30); + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 10: Label100 - TEMP. IS FROM 80 C TO 90 C + H = 1.5446e6 - 1.78637e4; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = F6((H + 1.78637e4), 4.88446e1, 3.85534e-5, -1.78805e-11, 4.87224e-18, -7.15283e-25, 4.36246e-32); + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 11: Label110 - TEMP. IS FROM 90 C TO 100 C + H = 3.8354e6 - 1.78637e4; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = F7((H + 1.78637e4), 7.60565e11, 5.80534e4, -7.36433e-3, 5.11531e-10, -1.93619e-17, 3.70511e-25, -2.77313e-33); + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 12: TEMP > 100 C + H = 5.5867e7 - 1.78637e4; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = F7(4.5866e7, 7.60565e11, 5.80534e4, -7.36433e-3, 5.11531e-10, -1.93619e-17, 3.70511e-25, -2.77313e-33); + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 13: PB != 1.0133e5 + H = 7.5223e4; + PB = 0.9133e5; + result = PsyTsatFnHPb_raw(H, PB); + actual_result = 23.445553; + EXPECT_NEAR(actual_result, result, 0.00001); + + // Test 14: Cache version of the function - hit call + H = 7.5223e4 - 1.78637e4; + PB = 1.0133e5; + result = PsyTsatFnHPb_raw(H, PB); + Real64 cache_hit_result = PsyTsatFnHPb(H, PB); + EXPECT_DOUBLE_EQ(result, cache_hit_result); + +} + +TEST_F(EnergyPlusFixture, PsyTsatFnPbTest) +{ + + InitializePsychRoutines(); + + // Test 1: general + Real64 PB = 101325.0; + Real64 result = PsyTsatFnPb_raw(PB); + Real64 actual_result = 99.974; + EXPECT_NEAR(actual_result, result, 0.001); + + // Test 2: Cache version of the function - first call + PB = 101325.0; + result = PsyTsatFnPb_raw(PB); + Real64 cache_result = PsyTsatFnPb(PB); + EXPECT_DOUBLE_EQ(result, cache_result); + + // Test 3: upper bound + PB = 1555000.0; + result = PsyTsatFnPb_raw(PB); + actual_result = 200.0; + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 4: lower bound + PB = 0.0017; + result = PsyTsatFnPb_raw(PB); + actual_result = -100.0; + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 5: zero + PB = 611.1; + result = PsyTsatFnPb_raw(PB); + actual_result = 0.0; + EXPECT_DOUBLE_EQ(actual_result, result); + + // Test 6: Cache version of the function - hit call + PB = 101325.0; + result = PsyTsatFnPb_raw(PB); + Real64 cache_hit_result = PsyTsatFnPb(PB); + EXPECT_DOUBLE_EQ(result, cache_hit_result); + +} + From ad637ca6e2441a2988480cae4934953a23bd87cd Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Thu, 5 Sep 2019 16:43:50 -0700 Subject: [PATCH 043/136] init error at unit tests --- src/EnergyPlus/OutputProcessor.cc | 1 - tst/EnergyPlus/unit/BaseboardRadiator.unit.cc | 2 -- tst/EnergyPlus/unit/BoilerHotWater.unit.cc | 3 --- tst/EnergyPlus/unit/ChillerAbsorption.unit.cc | 2 -- .../unit/ChillerConstantCOP.unit.cc | 2 -- tst/EnergyPlus/unit/ChillerElectric.unit.cc | 2 -- .../unit/ChillerElectricEIR.unit.cc | 6 +----- .../unit/CondenserLoopTowers.unit.cc | 16 ---------------- .../unit/DesiccantDehumidifiers.unit.cc | 3 --- tst/EnergyPlus/unit/FanCoilUnits.unit.cc | 10 ---------- .../unit/Fixtures/EnergyPlusFixture.cc | 1 + .../unit/GroundHeatExchangers.unit.cc | 19 ------------------- tst/EnergyPlus/unit/HVACControllers.unit.cc | 2 -- tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc | 5 ----- .../unit/HVACInterfaceManager.unit.cc | 2 -- .../unit/HVACMultiSpeedHeatPump.unit.cc | 3 --- .../unit/HVACVariableRefrigerantFlow.unit.cc | 12 +----------- .../unit/HWBaseboardRadiator.unit.cc | 2 -- .../unit/HeatPumpWaterToWaterSimple.unit.cc | 4 ---- tst/EnergyPlus/unit/HeatRecovery.unit.cc | 2 -- tst/EnergyPlus/unit/Humidifiers.unit.cc | 6 ------ .../unit/LowTempRadiantSystem.unit.cc | 4 ---- tst/EnergyPlus/unit/MixedAir.unit.cc | 3 --- .../unit/OASystemHWPreheatCoil.unit.cc | 5 ----- tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc | 2 -- .../unit/PackagedTerminalHeatPump.unit.cc | 3 --- tst/EnergyPlus/unit/SetPointManager.unit.cc | 3 --- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 2 -- tst/EnergyPlus/unit/WaterCoils.unit.cc | 3 --- 29 files changed, 3 insertions(+), 127 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index c10555c4953..9c230d4b0cc 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -73,7 +73,6 @@ #include #include #include -#include #include #include #include diff --git a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc index 90b22bf8f95..9f8ff1cc2b5 100644 --- a/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/BaseboardRadiator.unit.cc @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include @@ -78,7 +77,6 @@ TEST_F(EnergyPlusFixture, BaseboardConvWater_SizingTest) int BaseboardNum(0); int CntrlZoneNum(0); bool FirstHVACIteration(false); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", diff --git a/tst/EnergyPlus/unit/BoilerHotWater.unit.cc b/tst/EnergyPlus/unit/BoilerHotWater.unit.cc index 512d8b5fc60..50e646eb3c6 100644 --- a/tst/EnergyPlus/unit/BoilerHotWater.unit.cc +++ b/tst/EnergyPlus/unit/BoilerHotWater.unit.cc @@ -64,8 +64,6 @@ using namespace EnergyPlus::DataSizing; TEST_F(EnergyPlusFixture, Boiler_HotWaterSizingTest) { - - FluidProperties::InitializeGlycRoutines(); // unit test for autosizing boiler nominal capacity in Boiler:HotWater Boilers::Boiler.allocate(1); // Hardsized Hot Water Boiler @@ -112,7 +110,6 @@ TEST_F(EnergyPlusFixture, Boiler_HotWaterAutoSizeTempTest) { // unit test for checking hot water temperature for autosizing // boiler nominal capacity in Boiler:HotWater - FluidProperties::InitializeGlycRoutines(); Boilers::Boiler.allocate(1); // Autosized Hot Water Boiler diff --git a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc index 3edc714032c..0a170a309f5 100644 --- a/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc +++ b/tst/EnergyPlus/unit/ChillerAbsorption.unit.cc @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include @@ -71,7 +70,6 @@ using namespace ObjexxFCL; TEST_F(EnergyPlusFixture, ChillerAbsorption_Calc) { - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Version,9.2;", diff --git a/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc b/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc index 97ffed8b2fb..49e94c948a4 100644 --- a/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc +++ b/tst/EnergyPlus/unit/ChillerConstantCOP.unit.cc @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -75,7 +74,6 @@ TEST_F(EnergyPlusFixture, ChillerConstantCOP_WaterCooled_Autosize) DataGlobals::NumOfTimeStepInHour = 1; DataGlobals::TimeStep = 1; DataGlobals::MinutesPerTimeStep = 60; - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Chiller:ConstantCOP,", diff --git a/tst/EnergyPlus/unit/ChillerElectric.unit.cc b/tst/EnergyPlus/unit/ChillerElectric.unit.cc index 8e21f69fd59..39b78d0f223 100644 --- a/tst/EnergyPlus/unit/ChillerElectric.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectric.unit.cc @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -75,7 +74,6 @@ TEST_F(EnergyPlusFixture, ChillerElectric_WaterCooled_Autosize) DataGlobals::NumOfTimeStepInHour = 1; DataGlobals::TimeStep = 1; DataGlobals::MinutesPerTimeStep = 60; - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Chiller:Electric,", diff --git a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc index b840d78e37f..ba68c6f3ce7 100644 --- a/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc +++ b/tst/EnergyPlus/unit/ChillerElectricEIR.unit.cc @@ -56,8 +56,8 @@ #include #include #include -#include #include + #include "Fixtures/EnergyPlusFixture.hh" using namespace EnergyPlus; @@ -99,7 +99,6 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_TestOutletNodeConditions) TEST_F(EnergyPlusFixture, ElectricEIRChiller_HeatRecoveryAutosizeTest) { // unit test for autosizing heat recovery in Chiller:Electric:EIR - FluidProperties::InitializeGlycRoutines(); ChillerElectricEIR::ElectricEIRChiller.allocate(1); ChillerElectricEIR::ElectricEIRChiller(1).SizFac = 1.0; @@ -131,8 +130,6 @@ TEST_F(EnergyPlusFixture, ElectricEIRChiller_HeatRecoveryAutosizeTest) DataPlant::PlantFirstSizesOkayToFinalize = true; - FluidProperties::InitializeGlycRoutines(); - // now call sizing routine ChillerElectricEIR::SizeElectricEIRChiller(1); // see if heat recovery flow rate is as expected @@ -157,7 +154,6 @@ TEST_F(EnergyPlusFixture, ChillerElectricEIR_AirCooledChiller) DataGlobals::MinutesPerTimeStep = 60; Psychrometrics::InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ "Chiller:Electric:EIR,", diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index c5d3ca1e1fa..9c632be8564 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include @@ -491,7 +490,6 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_MerkelNoCooling) DataGlobals::BeginSimFlag = true; SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - FluidProperties::InitializeGlycRoutines(); // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation @@ -885,8 +883,6 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - FluidProperties::InitializeGlycRoutines(); - // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -1319,8 +1315,6 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUserInputTowerSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - FluidProperties::InitializeGlycRoutines(); - // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -1736,8 +1730,6 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_TwoSpeedUserInputTowerSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - FluidProperties::InitializeGlycRoutines(); - // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -2222,8 +2214,6 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_MerkelUserInputTowerSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - FluidProperties::InitializeGlycRoutines(); - // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -2651,8 +2641,6 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_TwoSpeedTowerLowSpeedNomCapSizing) SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - FluidProperties::InitializeGlycRoutines(); - // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -3049,8 +3037,6 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUser_SizingError_Sizing SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - FluidProperties::InitializeGlycRoutines(); - // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); @@ -3451,8 +3437,6 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedUser_SizingError_UserSp SimulationManager::GetProjectData(); OutputReportPredefined::SetPredefinedTables(); - FluidProperties::InitializeGlycRoutines(); - // OutputProcessor::TimeValue.allocate(2); OutputProcessor::SetupTimePointers("Zone", DataGlobals::TimeStepZone); // Set up Time pointer for HB/Zone Simulation OutputProcessor::SetupTimePointers("HVAC", DataHVACGlobals::TimeStepSys); diff --git a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc index 782686dbdb9..6f60a748896 100644 --- a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc +++ b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include @@ -5426,8 +5425,6 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_RegenAirHeaterHWCoilSizingTest) DataSizing::CurSysNum = 1; DataSizing::CurOASysNum = 0; - FluidProperties::InitializeGlycRoutines(); - GetDesiccantDehumidifierInput(); EXPECT_EQ(1, NumDesicDehums); EXPECT_EQ(1, NumGenericDesicDehums); diff --git a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc index de28fb5285e..5448fcdcb9c 100644 --- a/tst/EnergyPlus/unit/FanCoilUnits.unit.cc +++ b/tst/EnergyPlus/unit/FanCoilUnits.unit.cc @@ -65,7 +65,6 @@ #include #include #include -#include #include #include #include @@ -134,7 +133,6 @@ TEST_F(EnergyPlusFixture, MultiStage4PipeFanCoilHeatingTest) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -446,7 +444,6 @@ TEST_F(EnergyPlusFixture, MultiStage4PipeFanCoilCoolingTest) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -760,7 +757,6 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilHeatingTest) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -1148,7 +1144,6 @@ TEST_F(EnergyPlusFixture, ElectricCoilFanCoilHeatingTest) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -1457,7 +1452,6 @@ TEST_F(EnergyPlusFixture, ConstantFanVariableFlowFanCoilCoolingTest) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -1811,7 +1805,6 @@ TEST_F(EnergyPlusFixture, FanCoil_ASHRAE90VariableFan) DataSizing::CurZoneEqNum = 1; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -2226,7 +2219,6 @@ TEST_F(EnergyPlusFixture, Test_TightenWaterFlowLimits) DataGlobals::MinutesPerTimeStep = 60; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone, EAST ZONE, 0, 0, 0, 0, 1, 1, autocalculate, autocalculate;", @@ -2513,7 +2505,6 @@ TEST_F(EnergyPlusFixture, FanCoil_CyclingFanMode) DataSizing::CurZoneEqNum = 1; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", @@ -2917,7 +2908,6 @@ TEST_F(EnergyPlusFixture, FanCoil_FanSystemModelCyclingFanMode) DataSizing::CurZoneEqNum = 1; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ " Zone,", diff --git a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc index 175a07b583d..e3dfe39a8a9 100644 --- a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc +++ b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc @@ -274,6 +274,7 @@ void EnergyPlusFixture::SetUp() UtilityRoutines::outputErrorHeader = false; Psychrometrics::InitializePsychRoutines(); + FluidProperties::InitializeGlycRoutines(); createCoilSelectionReportObj(); } diff --git a/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc b/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc index 112af19ab4c..7f5f2dfe27e 100644 --- a/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc +++ b/tst/EnergyPlus/unit/GroundHeatExchangers.unit.cc @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include @@ -182,7 +181,6 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_GetGFunc) TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_Slinky_CalcHXResistance) { // Initializations - FluidProperties::InitializeGlycRoutines(); GLHESlinky thisGLHE; PlantLoop.allocate(1); @@ -1189,8 +1187,6 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcGFunction_Check) SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); - FluidProperties::InitializeGlycRoutines(); - auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20; @@ -1673,8 +1669,6 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calc_pipe_convection_re SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); - FluidProperties::InitializeGlycRoutines(); - auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 13.0; @@ -1979,8 +1973,6 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calc_pipe_resistance) SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); - FluidProperties::InitializeGlycRoutines(); - auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 13.0; @@ -2277,8 +2269,6 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHGroutResistance_1 SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); - FluidProperties::InitializeGlycRoutines(); - auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20.0; @@ -2581,7 +2571,6 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHGroutResistance_2 thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20.0; thisGLHE.massFlowRate = 1; - FluidProperties::InitializeGlycRoutines(); Real64 const tolerance = 0.00001; @@ -2876,8 +2865,6 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHGroutResistance_3 SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); - FluidProperties::InitializeGlycRoutines(); - auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20.0; @@ -3183,8 +3170,6 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHTotalInternalResi Real64 const tolerance = 0.00001; - FluidProperties::InitializeGlycRoutines(); - // Flow rate and pipe thickness picked to fix pipe resistance at 0.05 EXPECT_NEAR(thisGLHE.theta_1, 0.33333, tolerance); EXPECT_NEAR(thisGLHE.theta_2, 3.0, tolerance); @@ -3476,8 +3461,6 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHTotalInternalResi SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); - FluidProperties::InitializeGlycRoutines(); - auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20.0; @@ -3776,8 +3759,6 @@ TEST_F(EnergyPlusFixture, GroundHeatExchangerTest_System_calcBHTotalInternalResi SetupInitialPlantCallingOrder(); SetupBranchControlTypes(); - FluidProperties::InitializeGlycRoutines(); - auto &thisGLHE(verticalGLHE[0]); thisGLHE.loopNum = 1; Node(thisGLHE.inletNodeNum).Temp = 20.0; diff --git a/tst/EnergyPlus/unit/HVACControllers.unit.cc b/tst/EnergyPlus/unit/HVACControllers.unit.cc index 462ec5a6e68..4e348e4eef1 100644 --- a/tst/EnergyPlus/unit/HVACControllers.unit.cc +++ b/tst/EnergyPlus/unit/HVACControllers.unit.cc @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -197,7 +196,6 @@ TEST_F(EnergyPlusFixture, HVACControllers_TestTempAndHumidityRatioCtrlVarType) }); ASSERT_TRUE(process_idf(idf_objects)); - FluidProperties::InitializeGlycRoutines(); GetSetPointManagerInputs(); // check specified control variable type is "HumidityRatio" diff --git a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc index bf909a4d7b2..051642652a0 100644 --- a/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc +++ b/tst/EnergyPlus/unit/HVACFourPipeBeam.unit.cc @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include @@ -1734,8 +1733,6 @@ TEST_F(EnergyPlusFixture, Beam_sizeandSimulateOneZone) DataGlobals::DoingSizing = false; DataGlobals::KickOffSimulation = true; - FluidProperties::InitializeGlycRoutines(); - WeatherManager::ResetEnvironmentCounter(); TestAirPathIntegrity(ErrorsFound); // Needed to initialize return node connections to airloops and inlet nodes SimulationManager::SetupSimulation(ErrorsFound); @@ -3296,8 +3293,6 @@ TEST_F(EnergyPlusFixture, Beam_fatalWhenSysSizingOff) DataGlobals::BeginSimFlag = true; SimulationManager::GetProjectData(); - FluidProperties::InitializeGlycRoutines(); - OutputReportPredefined::SetPredefinedTables(); HeatBalanceManager::SetPreConstructionInputParameters(); // establish array bounds for constructions early // OutputProcessor::TimeValue.allocate(2); diff --git a/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc b/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc index 823fa44c352..c1a83dffc02 100644 --- a/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc +++ b/tst/EnergyPlus/unit/HVACInterfaceManager.unit.cc @@ -59,7 +59,6 @@ #include #include #include -#include namespace EnergyPlus { TEST_F(EnergyPlusFixture, ExcessiveHeatStorage_Test) @@ -86,7 +85,6 @@ TEST_F(EnergyPlusFixture, ExcessiveHeatStorage_Test) DataLoopNode::Node.allocate(TotNumLoops); DataLoopNode::Node(1).Temp = 100; DataLoopNode::Node(1).MassFlowRate = 10; - FluidProperties::InitializeGlycRoutines(); // LoopSideInlet_MdotCpDeltaT should be < LoopSideInlet_McpDTdt // Therefore CapExcessStorageTime AND TotalTime will increase by 1 timestep diff --git a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc index 72666551e5b..4c85740bcda 100644 --- a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -1418,8 +1417,6 @@ TEST_F(EnergyPlusFixture, HVACMultiSpeedHeatPump_HeatRecoveryTest) DataPlant::PlantLoop(1).FluidName = "WATER"; DataPlant::PlantLoop(1).FluidIndex = 1; - FluidProperties::InitializeGlycRoutines(); - DataLoopNode::Node(HeatRecInNode).MassFlowRate = 0.0; // test heat recovery result with 0 water flow rate HVACMultiSpeedHeatPump::MSHPHeatRecovery(1); diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 48770f3527b..b54bc250549 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -4943,8 +4943,6 @@ TEST_F(EnergyPlusFixture, VRFTest_SysCurve_WaterCooled) DataZoneEnergyDemands::ZoneSysEnergyDemand.allocate(1); - InitializeGlycRoutines(); - Array2D DummyArray; // Sky temperature DataGlobals::NumOfTimeStepInHour = 4; DataGlobals::MinutesPerTimeStep = 60 / DataGlobals::NumOfTimeStepInHour; @@ -5770,8 +5768,6 @@ TEST_F(EnergyPlusFixture, VRFTest_TU_NoLoad_OAMassFlowRateTest) HeatBalanceManager::GetZoneData(ErrorsFound); // read zone data EXPECT_FALSE(ErrorsFound); - InitializeGlycRoutines(); - DataZoneEquipment::GetZoneEquipmentData(); // read equipment list and connections HVACVariableRefrigerantFlow::MyEnvrnFlag = true; ZoneInletAirNode = GetVRFTUZoneInletAirNode(VRFTUNum); // trigger GetVRFInput by calling a mining function @@ -5834,7 +5830,6 @@ TEST_F(EnergyPlusFixture, VRFTest_CondenserCalcTest) ASSERT_TRUE(process_idf(idf_objects)); CurveManager::GetCurveInput(); - InitializeGlycRoutines(); int VRFCond = 1; VRF.allocate(1); @@ -7184,7 +7179,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SupplementalHeatingCoilGetInput) }); ASSERT_TRUE(process_idf(idf_objects)); - InitializeGlycRoutines(); + // get zone data bool ErrorsFound(false); GetZoneData(ErrorsFound); @@ -7273,7 +7268,6 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilElectric) DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).HumRat = 0.0070; DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW( DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).Temp, DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).HumRat); - InitializeGlycRoutines(); bool FirstHVACIteration(false); Real64 SuppHeatCoilLoad = 10000.0; @@ -7339,8 +7333,6 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilFuel) DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW( DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).Temp, DataLoopNode::Node(HeatingCoil(CoilNum).AirInletNodeNum).HumRat); - InitializeGlycRoutines(); - bool FirstHVACIteration(false); Real64 SuppHeatCoilLoad = 10000.0; // run supplemental heating coil @@ -7415,8 +7407,6 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilWater) PlantSizData(NumPltSizInput).ExitTemp = 60.0; // hot water coil inlet water temp PlantSizData(NumPltSizInput).DeltaT = 10.0; // loop temperature difference - InitializeGlycRoutines(); - // set up plant loop TotNumLoops = 1; PlantLoop.allocate(TotNumLoops); diff --git a/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc b/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc index c4147ac4e85..2193d65e189 100644 --- a/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc +++ b/tst/EnergyPlus/unit/HWBaseboardRadiator.unit.cc @@ -104,8 +104,6 @@ TEST_F(EnergyPlusFixture, HWBaseboardRadiator_CalcHWBaseboard) PlantLoop(1).FluidType = 2; QBBRadSource(1) = 0.0; - FluidProperties::InitializeGlycRoutines(); - CalcHWBaseboard(BBNum, LoadMet); EXPECT_NEAR(14746.226690452937, HWBaseboard(1).TotPower, 0.000001); diff --git a/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc b/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc index 0cf9b31b370..d8366225ed8 100644 --- a/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc +++ b/tst/EnergyPlus/unit/HeatPumpWaterToWaterSimple.unit.cc @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -722,8 +721,6 @@ TEST_F(EnergyPlusFixture, PlantLoopSourceSideTest) BranchInputManager::ManageBranchInput(); // just gets input and - FluidProperties::InitializeGlycRoutines(); - DataGlobals::DoingSizing = false; DataGlobals::KickOffSimulation = true; @@ -815,7 +812,6 @@ TEST_F(EnergyPlusFixture, PlantLoopSourceSideTest) TEST_F(EnergyPlusFixture, WWHP_AutosizeTest1) { // this test is for checking autosizing of heating WWHP. derived from unit test PlantLoopSourceSideTest - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({"Schedule:Constant,Radiator massflow temporary,Any value sch,1;", "Schedule:Constant,Radiator supply temperature temporary,Any value sch,40;", diff --git a/tst/EnergyPlus/unit/HeatRecovery.unit.cc b/tst/EnergyPlus/unit/HeatRecovery.unit.cc index 9a9d0e28c10..158bc55040c 100644 --- a/tst/EnergyPlus/unit/HeatRecovery.unit.cc +++ b/tst/EnergyPlus/unit/HeatRecovery.unit.cc @@ -59,7 +59,6 @@ #include #include #include -#include #include #include #include @@ -491,7 +490,6 @@ TEST_F(EnergyPlusFixture, HeatRecoveryHXOnMainBranch_SimHeatRecoveryTest) Real64 Qhr_HeatingRateTot(0.0); int InletNode(0); // Heat Recovery primary air inlet node number int OutletNode(0); // Heat Recovery primary air outlet node number - FluidProperties::InitializeGlycRoutines(); std::string const idf_objects = delimited_string({ diff --git a/tst/EnergyPlus/unit/Humidifiers.unit.cc b/tst/EnergyPlus/unit/Humidifiers.unit.cc index 654a6c50d18..7f1fd7149d1 100644 --- a/tst/EnergyPlus/unit/Humidifiers.unit.cc +++ b/tst/EnergyPlus/unit/Humidifiers.unit.cc @@ -59,7 +59,6 @@ #include #include #include -#include #include #include @@ -80,7 +79,6 @@ TEST_F(EnergyPlusFixture, Humidifiers_Sizing) NumElecSteamHums = 0; NumGasSteamHums = 1; NumHumidifiers = 1; - FluidProperties::InitializeGlycRoutines(); HumidifierData thisHum; @@ -116,7 +114,6 @@ TEST_F(EnergyPlusFixture, Humidifiers_AutoSizing) NumElecSteamHums = 0; NumGasSteamHums = 1; NumHumidifiers = 1; - FluidProperties::InitializeGlycRoutines(); HumidifierData thisHum; @@ -157,7 +154,6 @@ TEST_F(EnergyPlusFixture, Humidifiers_EnergyUse) TimeStepSys = 0.25; SysSizingRunDone = true; CurSysNum = 1; - FluidProperties::InitializeGlycRoutines(); NumElecSteamHums = 0; NumGasSteamHums = 1; @@ -233,7 +229,6 @@ TEST_F(EnergyPlusFixture, Humidifiers_GetHumidifierInput) }); ASSERT_TRUE(process_idf(idf_objects)); - FluidProperties::InitializeGlycRoutines(); GetHumidifierInput(); ASSERT_EQ(1, NumHumidifiers); @@ -249,7 +244,6 @@ TEST_F(EnergyPlusFixture, Humidifiers_ThermalEfficiency) TimeStepSys = 0.25; SysSizingRunDone = true; CurSysNum = 1; - FluidProperties::InitializeGlycRoutines(); NumElecSteamHums = 0; NumGasSteamHums = 1; diff --git a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc index c0ec8d932ee..2820e42e64d 100644 --- a/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc +++ b/tst/EnergyPlus/unit/LowTempRadiantSystem.unit.cc @@ -1102,8 +1102,6 @@ TEST_F(EnergyPlusFixture, AutosizeLowTempRadiantVariableFlowTest) }); ASSERT_TRUE(process_idf(idf_objects)); - InitializeGlycRoutines(); - GetProjectControlData(ErrorsFound); EXPECT_FALSE(ErrorsFound); @@ -1812,8 +1810,6 @@ TEST_F(LowTempRadiantSystemTest, LowTempRadCalcRadSysHXEffectTermTest) Real64 HXEffectFuncResult; int GlycolIndex = 0; - InitializeGlycRoutines(); - // Set values of items that will stay constant for all calls to HX Effectiveness function RadSysNum = 1; WaterMassFlow = 0.1; diff --git a/tst/EnergyPlus/unit/MixedAir.unit.cc b/tst/EnergyPlus/unit/MixedAir.unit.cc index 9208c177314..39708a84c6d 100644 --- a/tst/EnergyPlus/unit/MixedAir.unit.cc +++ b/tst/EnergyPlus/unit/MixedAir.unit.cc @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include @@ -1214,8 +1213,6 @@ TEST_F(EnergyPlusFixture, MixedAir_HumidifierOnOASystemTest) DataEnvironment::DayOfYear_Schedule = 1; ScheduleManager::UpdateScheduleValues(); - FluidProperties::InitializeGlycRoutines(); - GetOASysInputFlag = true; DataGlobals::BeginEnvrnFlag = true; int AirloopNum = 1; diff --git a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc index 49ddc3b12a3..1729e7a3aa9 100644 --- a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc +++ b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc @@ -55,7 +55,6 @@ #include "Fixtures/EnergyPlusFixture.hh" #include #include -#include #include #include #include @@ -1040,8 +1039,6 @@ TEST_F(EnergyPlusFixture, OASystem_HotWaterPreheatCoilScheduledOffSim) }); ASSERT_TRUE(process_idf(idf_objects)); - FluidProperties::InitializeGlycRoutines(); - // OutputProcessor::TimeValue.allocate(2); SimulationManager::ManageSimulation(); @@ -2020,8 +2017,6 @@ TEST_F(EnergyPlusFixture, OASystem_HotWaterPreheatCoilScheduledOnSim) }); ASSERT_TRUE(process_idf(idf_objects)); - FluidProperties::InitializeGlycRoutines(); - // OutputProcessor::TimeValue.allocate(2); SimulationManager::ManageSimulation(); diff --git a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc index 673c1e7edc4..7642bcb5d5b 100644 --- a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc +++ b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc @@ -554,7 +554,6 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_WaterCoolingCoilAutoSizeTest) DataGlobals::DoingSizing = true; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); bool ErrorsFound(false); GetZoneData(ErrorsFound); @@ -861,7 +860,6 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_SteamHeatingCoilAutoSizeTest) DataGlobals::DoingSizing = true; InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); bool ErrorsFound(false); GetZoneData(ErrorsFound); diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index 3b8fa36a4f7..abb9388e85f 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -62,7 +62,6 @@ #include #include #include -#include #include #include #include @@ -439,8 +438,6 @@ TEST_F(EnergyPlusFixture, PackagedTerminalHP_VSCoils_Sizing) ASSERT_TRUE(process_idf(idf_objects)); - FluidProperties::InitializeGlycRoutines(); - // Test for #7053: // Fake that there is at least one UnitarySystemPerformance:Multispeed object UnitarySystems::DesignSpecMSHP fakeDesignSpecMSHP; diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 82aff48904a..860d942637b 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -70,7 +70,6 @@ #include #include #include -#include #include #include #include @@ -120,8 +119,6 @@ TEST_F(EnergyPlusFixture, SetPointManager_DefineReturnWaterChWSetPointManager) mySPM.maximumChilledWaterSetpoint = 10; mySPM.returnTemperatureConstantTarget = 12; - FluidProperties::InitializeGlycRoutines(); - // test 1: normal, in range DataLoopNode::Node(1).Temp = 11; DataLoopNode::Node(2).Temp = 7; diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 66e6a7d87ac..92718fb59cb 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -71,7 +71,6 @@ #include #include #include -#include #include #include #include @@ -3606,7 +3605,6 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_CalcUnitaryCoolingSystem) DataEnvironment::OutBaroPress = 101325.0; DataEnvironment::StdRhoAir = 1.20; Psychrometrics::InitializePsychRoutines(); - FluidProperties::InitializeGlycRoutines(); thisSys.m_MultiOrVarSpeedHeatCoil = true; thisSys.m_MultiOrVarSpeedCoolCoil = true; diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 854ed42fafc..0f96ff67954 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -162,7 +162,6 @@ class WaterCoilsTest : public EnergyPlusFixture TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) { - InitializeGlycRoutines(); OutBaroPress = 101325.0; StdRhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, 20.0, 0.0); @@ -821,7 +820,6 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) { InitializePsychRoutines(); - InitializeGlycRoutines(); OutBaroPress = 101325.0; StdRhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, 20.0, 0.0); ShowMessage("Begin Test: WaterCoilsTest, CoilCoolingWaterSimpleSizing"); @@ -923,7 +921,6 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) { InitializePsychRoutines(); - InitializeGlycRoutines(); OutBaroPress = 101325.0; StdRhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, 20.0, 0.0); ShowMessage("Begin Test: WaterCoilsTest, CoilCoolingWaterDetailedSizing"); From 44dc4f77dc4e5735d88689e469775c09bcc98357 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 6 Sep 2019 11:12:30 -0500 Subject: [PATCH 044/136] Step 02 - Clean up usings - No diffs --- src/EnergyPlus/CondenserLoopTowers.cc | 1685 +++++++++++-------------- 1 file changed, 766 insertions(+), 919 deletions(-) diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index a2d9b4f1808..ae1515412af 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -105,29 +105,6 @@ namespace CondenserLoopTowers { // PURPOSE OF THIS MODULE: // Model the performance of cooling towers - // Using/Aliasing - using namespace DataPrecisionGlobals; - using DataGlobals::KelvinConv; - using DataGlobals::SecInHour; - using DataGlobals::WarmupFlag; - using namespace DataHVACGlobals; - using namespace DataLoopNode; - using DataEnvironment::OutBaroPress; - using DataEnvironment::OutDryBulbTemp; - using DataEnvironment::OutHumRat; - using DataEnvironment::OutWetBulbTemp; - using DataEnvironment::StdBaroPress; - using DataPlant::PlantLoop; - using FluidProperties::GetDensityGlycol; - using FluidProperties::GetSpecificHeatGlycol; - using General::TrimSigDigits; - using Psychrometrics::PsyCpAirFnWTdb; - using Psychrometrics::PsyHFnTdbRhPb; - using Psychrometrics::PsyRhoAirFnPbTdbW; - using Psychrometrics::PsyTsatFnHPb; - using Psychrometrics::PsyWFnTdbH; - using Psychrometrics::PsyWFnTdbTwbPb; - // Empirical Model Type int const CoolToolsXFModel(1); int const CoolToolsUserDefined(3); @@ -259,12 +236,12 @@ namespace CondenserLoopTowers { } else { TowerNum = CompIndex; if (TowerNum > NumSimpleTowers || TowerNum < 1) { - ShowFatalError("SimTowers: Invalid CompIndex passed=" + TrimSigDigits(TowerNum) + - ", Number of Units=" + TrimSigDigits(NumSimpleTowers) + ", Entered Unit name=" + TowerName); + ShowFatalError("SimTowers: Invalid CompIndex passed=" + General::TrimSigDigits(TowerNum) + + ", Number of Units=" + General::TrimSigDigits(NumSimpleTowers) + ", Entered Unit name=" + TowerName); } if (CheckEquipName(TowerNum)) { if (TowerName != SimpleTower(TowerNum).Name) { - ShowFatalError("SimTowers: Invalid CompIndex passed=" + TrimSigDigits(TowerNum) + ", Unit name=" + TowerName + + ShowFatalError("SimTowers: Invalid CompIndex passed=" + General::TrimSigDigits(TowerNum) + ", Unit name=" + TowerName + ", stored Unit Name for that index=" + SimpleTower(TowerNum).Name); } CheckEquipName(TowerNum) = false; @@ -381,14 +358,6 @@ namespace CondenserLoopTowers { // Using/Aliasing using namespace DataIPShortCuts; // Data for field names, blank numerics - using BranchNodeConnections::TestCompSet; - using CurveManager::GetCurveIndex; - using DataSizing::AutoSize; - using General::TrimSigDigits; - using NodeInputManager::GetOnlySingleNode; - using OutAirNodeManager::CheckOutAirNodeNumber; - using ScheduleManager::GetScheduleIndex; - using WaterManager::SetupTankDemandComponent; // SUBROUTINE PARAMETER DEFINITIONS: static ObjexxFCL::gio::Fmt OutputFormat("(F5.2)"); @@ -470,44 +439,44 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).TowerType = cCurrentModuleObject; SimpleTower(TowerNum).TowerType_Num = CoolingTower_SingleSpeed; SimpleTower(TowerNum).TowerMassFlowRateMultiplier = 2.5; - SimpleTower(TowerNum).WaterInletNodeNum = GetOnlySingleNode( - AlphArray(2), ErrorsFound, cCurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - SimpleTower(TowerNum).WaterOutletNodeNum = GetOnlySingleNode( - AlphArray(3), ErrorsFound, cCurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); - TestCompSet(cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); + SimpleTower(TowerNum).WaterInletNodeNum = NodeInputManager::GetOnlySingleNode( + AlphArray(2), ErrorsFound, cCurrentModuleObject, AlphArray(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); + SimpleTower(TowerNum).WaterOutletNodeNum = NodeInputManager::GetOnlySingleNode( + AlphArray(3), ErrorsFound, cCurrentModuleObject, AlphArray(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 1, DataLoopNode::ObjectIsNotParent); + BranchNodeConnections::TestCompSet(cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); SimpleTower(TowerNum).DesignWaterFlowRate = NumArray(1); - if (SimpleTower(TowerNum).DesignWaterFlowRate == AutoSize) { + if (SimpleTower(TowerNum).DesignWaterFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).DesignWaterFlowRateWasAutoSized = true; } SimpleTower(TowerNum).HighSpeedAirFlowRate = NumArray(2); - if (SimpleTower(TowerNum).HighSpeedAirFlowRate == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedAirFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedAirFlowRateWasAutoSized = true; } SimpleTower(TowerNum).HighSpeedFanPower = NumArray(3); - if (SimpleTower(TowerNum).HighSpeedFanPower == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedFanPower == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedFanPowerWasAutoSized = true; } SimpleTower(TowerNum).HighSpeedTowerUA = NumArray(4); - if (SimpleTower(TowerNum).HighSpeedTowerUA == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedTowerUA == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedTowerUAWasAutoSized = true; } SimpleTower(TowerNum).FreeConvAirFlowRate = NumArray(5); - if (SimpleTower(TowerNum).FreeConvAirFlowRate == AutoSize) { + if (SimpleTower(TowerNum).FreeConvAirFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).FreeConvAirFlowRateWasAutoSized = true; } SimpleTower(TowerNum).FreeConvAirFlowRateSizingFactor = NumArray(6); SimpleTower(TowerNum).FreeConvTowerUA = NumArray(7); - if (SimpleTower(TowerNum).FreeConvTowerUA == AutoSize) { + if (SimpleTower(TowerNum).FreeConvTowerUA == DataSizing::AutoSize) { SimpleTower(TowerNum).FreeConvTowerUAWasAutoSized = true; } SimpleTower(TowerNum).FreeConvTowerUASizingFactor = NumArray(8); SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio = NumArray(9); SimpleTower(TowerNum).TowerNominalCapacity = NumArray(10); - if (SimpleTower(TowerNum).TowerNominalCapacity == AutoSize) { + if (SimpleTower(TowerNum).TowerNominalCapacity == DataSizing::AutoSize) { SimpleTower(TowerNum).TowerNominalCapacityWasAutoSized = true; } SimpleTower(TowerNum).TowerFreeConvNomCap = NumArray(11); - if (SimpleTower(TowerNum).TowerFreeConvNomCap == AutoSize) { + if (SimpleTower(TowerNum).TowerFreeConvNomCap == DataSizing::AutoSize) { SimpleTower(TowerNum).TowerFreeConvNomCapWasAutoSized = true; } SimpleTower(TowerNum).TowerFreeConvNomCapSizingFactor = NumArray(12); @@ -537,12 +506,12 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).TowerInletCondsAutoSize = true; } SimpleTower(TowerNum).DesApproach = NumArray(15); - if (SimpleTower(TowerNum).DesApproach == AutoSize || SimpleTower(TowerNum).DesApproach == 0) { + if (SimpleTower(TowerNum).DesApproach == DataSizing::AutoSize || SimpleTower(TowerNum).DesApproach == 0) { SimpleTower(TowerNum).DesApproach = 3.9; SimpleTower(TowerNum).TowerInletCondsAutoSize = true; } SimpleTower(TowerNum).DesRange = NumArray(16); - if (SimpleTower(TowerNum).DesRange == AutoSize || SimpleTower(TowerNum).DesRange == 0) { + if (SimpleTower(TowerNum).DesRange == DataSizing::AutoSize || SimpleTower(TowerNum).DesRange == 0) { SimpleTower(TowerNum).DesRange = 5.5; SimpleTower(TowerNum).TowerInletCondsAutoSize = true; } @@ -570,7 +539,7 @@ namespace CondenserLoopTowers { } if (!AlphArray(5).empty()) { - SimpleTower(TowerNum).BasinHeaterSchedulePtr = GetScheduleIndex(AlphArray(5)); + SimpleTower(TowerNum).BasinHeaterSchedulePtr = ScheduleManager::GetScheduleIndex(AlphArray(5)); if (SimpleTower(TowerNum).BasinHeaterSchedulePtr == 0) { ShowWarningError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" basin heater schedule name \"" + AlphArray(5) + "\" was not found. Basin heater operation will not be modeled and the simulation continues"); @@ -617,7 +586,7 @@ namespace CondenserLoopTowers { ShowContinueError("Invalid, " + cAlphaFieldNames(7) + " = " + AlphArray(7)); ErrorsFound = true; } - SimpleTower(TowerNum).SchedIDBlowdown = GetScheduleIndex(AlphArray(8)); + SimpleTower(TowerNum).SchedIDBlowdown = ScheduleManager::GetScheduleIndex(AlphArray(8)); if ((SimpleTower(TowerNum).SchedIDBlowdown == 0) && (SimpleTower(TowerNum).BlowdownMode == BlowdownBySchedule)) { ShowSevereError(cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError("Invalid, " + cAlphaFieldNames(8) + " = " + AlphArray(8)); @@ -627,7 +596,7 @@ namespace CondenserLoopTowers { if (AlphArray(9).empty()) { SimpleTower(TowerNum).SuppliedByWaterSystem = false; } else { // water from storage tank - SetupTankDemandComponent(AlphArray(1), + WaterManager::SetupTankDemandComponent(AlphArray(1), cCurrentModuleObject, AlphArray(9), ErrorsFound, @@ -641,15 +610,15 @@ namespace CondenserLoopTowers { if (lAlphaFieldBlanks(10)) { SimpleTower(TowerNum).OutdoorAirInletNodeNum = 0; } else { - SimpleTower(TowerNum).OutdoorAirInletNodeNum = GetOnlySingleNode(AlphArray(10), + SimpleTower(TowerNum).OutdoorAirInletNodeNum = NodeInputManager::GetOnlySingleNode(AlphArray(10), ErrorsFound, cCurrentModuleObject, SimpleTower(TowerNum).Name, - NodeType_Air, - NodeConnectionType_OutsideAirReference, + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_OutsideAirReference, 1, - ObjectIsNotParent); - if (!CheckOutAirNodeNumber(SimpleTower(TowerNum).OutdoorAirInletNodeNum)) { + DataLoopNode::ObjectIsNotParent); + if (!OutAirNodeManager::CheckOutAirNodeNumber(SimpleTower(TowerNum).OutdoorAirInletNodeNum)) { ShowSevereError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" Outdoor Air Inlet Node Name not valid Outdoor Air Node= " + AlphArray(10)); ShowContinueError("...does not appear in an OutdoorAir:NodeList or as an OutdoorAir:Node."); @@ -721,7 +690,7 @@ namespace CondenserLoopTowers { // High speed air flow rate must be greater than free convection air flow rate. // Can't tell yet if autosized, check later in InitTower. if (SimpleTower(TowerNum).HighSpeedAirFlowRate <= SimpleTower(TowerNum).FreeConvAirFlowRate && - SimpleTower(TowerNum).HighSpeedAirFlowRate != AutoSize) { + SimpleTower(TowerNum).HighSpeedAirFlowRate != DataSizing::AutoSize) { ShowSevereError(cCurrentModuleObject + " \"" + SimpleTower(TowerNum).Name + "\". Free convection air flow rate must be less than the design air flow rate."); ErrorsFound = true; @@ -735,7 +704,7 @@ namespace CondenserLoopTowers { ErrorsFound = true; } if (SimpleTower(TowerNum).HighSpeedTowerUA <= SimpleTower(TowerNum).FreeConvTowerUA && - SimpleTower(TowerNum).HighSpeedTowerUA != AutoSize) { + SimpleTower(TowerNum).HighSpeedTowerUA != DataSizing::AutoSize) { ShowSevereError(cCurrentModuleObject + " \"" + SimpleTower(TowerNum).Name + "\". Free convection UA must be less than the design tower UA."); ErrorsFound = true; @@ -824,11 +793,11 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).TowerType = cCurrentModuleObject; SimpleTower(TowerNum).TowerType_Num = CoolingTower_TwoSpeed; SimpleTower(TowerNum).TowerMassFlowRateMultiplier = 2.5; - SimpleTower(TowerNum).WaterInletNodeNum = GetOnlySingleNode( - AlphArray(2), ErrorsFound, cCurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - SimpleTower(TowerNum).WaterOutletNodeNum = GetOnlySingleNode( - AlphArray(3), ErrorsFound, cCurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); - TestCompSet(cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); + SimpleTower(TowerNum).WaterInletNodeNum = NodeInputManager::GetOnlySingleNode( + AlphArray(2), ErrorsFound, cCurrentModuleObject, AlphArray(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); + SimpleTower(TowerNum).WaterOutletNodeNum = NodeInputManager::GetOnlySingleNode( + AlphArray(3), ErrorsFound, cCurrentModuleObject, AlphArray(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 1, DataLoopNode::ObjectIsNotParent); + BranchNodeConnections::TestCompSet(cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); if (NumAlphas >= 4) { if (UtilityRoutines::SameString(AlphArray(4), "UFactorTimesAreaAndDesignWaterFlowRate")) { @@ -845,44 +814,44 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).PerformanceInputMethod_Num = PIM_UFactor; } SimpleTower(TowerNum).DesignWaterFlowRate = NumArray(1); - if (SimpleTower(TowerNum).DesignWaterFlowRate == AutoSize) { + if (SimpleTower(TowerNum).DesignWaterFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).DesignWaterFlowRateWasAutoSized = true; } SimpleTower(TowerNum).HighSpeedAirFlowRate = NumArray(2); - if (SimpleTower(TowerNum).HighSpeedAirFlowRate == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedAirFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedAirFlowRateWasAutoSized = true; } SimpleTower(TowerNum).HighSpeedFanPower = NumArray(3); - if (SimpleTower(TowerNum).HighSpeedFanPower == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedFanPower == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedFanPowerWasAutoSized = true; } SimpleTower(TowerNum).HighSpeedTowerUA = NumArray(4); - if (SimpleTower(TowerNum).HighSpeedTowerUA == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedTowerUA == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedTowerUAWasAutoSized = true; } SimpleTower(TowerNum).LowSpeedAirFlowRate = NumArray(5); - if (SimpleTower(TowerNum).LowSpeedAirFlowRate == AutoSize) { + if (SimpleTower(TowerNum).LowSpeedAirFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).LowSpeedAirFlowRateWasAutoSized = true; } SimpleTower(TowerNum).LowSpeedAirFlowRateSizingFactor = NumArray(6); SimpleTower(TowerNum).LowSpeedFanPower = NumArray(7); - if (SimpleTower(TowerNum).LowSpeedFanPower == AutoSize) { + if (SimpleTower(TowerNum).LowSpeedFanPower == DataSizing::AutoSize) { SimpleTower(TowerNum).LowSpeedFanPowerWasAutoSized = true; } SimpleTower(TowerNum).LowSpeedFanPowerSizingFactor = NumArray(8); SimpleTower(TowerNum).LowSpeedTowerUA = NumArray(9); - if (SimpleTower(TowerNum).LowSpeedTowerUA == AutoSize) { + if (SimpleTower(TowerNum).LowSpeedTowerUA == DataSizing::AutoSize) { SimpleTower(TowerNum).LowSpeedTowerUAWasAutoSized = true; } SimpleTower(TowerNum).LowSpeedTowerUASizingFactor = NumArray(10); SimpleTower(TowerNum).FreeConvAirFlowRate = NumArray(11); - if (SimpleTower(TowerNum).FreeConvAirFlowRate == AutoSize) { + if (SimpleTower(TowerNum).FreeConvAirFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).FreeConvAirFlowRateWasAutoSized = true; } SimpleTower(TowerNum).FreeConvAirFlowRateSizingFactor = NumArray(12); SimpleTower(TowerNum).FreeConvTowerUA = NumArray(13); - if (SimpleTower(TowerNum).FreeConvTowerUA == AutoSize) { + if (SimpleTower(TowerNum).FreeConvTowerUA == DataSizing::AutoSize) { SimpleTower(TowerNum).FreeConvTowerUAWasAutoSized = true; } SimpleTower(TowerNum).FreeConvTowerUASizingFactor = NumArray(14); @@ -890,12 +859,12 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).TowerNominalCapacity = NumArray(16); SimpleTower(TowerNum).TowerLowSpeedNomCap = NumArray(17); - if (SimpleTower(TowerNum).TowerLowSpeedNomCap == AutoSize) { + if (SimpleTower(TowerNum).TowerLowSpeedNomCap == DataSizing::AutoSize) { SimpleTower(TowerNum).TowerLowSpeedNomCapWasAutoSized = true; } SimpleTower(TowerNum).TowerLowSpeedNomCapSizingFactor = NumArray(18); SimpleTower(TowerNum).TowerFreeConvNomCap = NumArray(19); - if (SimpleTower(TowerNum).TowerFreeConvNomCap == AutoSize) { + if (SimpleTower(TowerNum).TowerFreeConvNomCap == DataSizing::AutoSize) { SimpleTower(TowerNum).TowerFreeConvNomCapWasAutoSized = true; } SimpleTower(TowerNum).TowerFreeConvNomCapSizingFactor = NumArray(20); @@ -911,12 +880,12 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).TowerInletCondsAutoSize = true; } SimpleTower(TowerNum).DesApproach = NumArray(23); - if (SimpleTower(TowerNum).DesApproach == AutoSize || SimpleTower(TowerNum).DesApproach == 0) { + if (SimpleTower(TowerNum).DesApproach == DataSizing::AutoSize || SimpleTower(TowerNum).DesApproach == 0) { SimpleTower(TowerNum).DesApproach = 3.9; SimpleTower(TowerNum).TowerInletCondsAutoSize = true; } SimpleTower(TowerNum).DesRange = NumArray(24); - if (SimpleTower(TowerNum).DesRange == AutoSize || SimpleTower(TowerNum).DesRange == 0) { + if (SimpleTower(TowerNum).DesRange == DataSizing::AutoSize || SimpleTower(TowerNum).DesRange == 0) { SimpleTower(TowerNum).DesRange = 5.5; SimpleTower(TowerNum).TowerInletCondsAutoSize = true; } @@ -943,7 +912,7 @@ namespace CondenserLoopTowers { } if (!AlphArray(5).empty()) { - SimpleTower(TowerNum).BasinHeaterSchedulePtr = GetScheduleIndex(AlphArray(5)); + SimpleTower(TowerNum).BasinHeaterSchedulePtr = ScheduleManager::GetScheduleIndex(AlphArray(5)); if (SimpleTower(TowerNum).BasinHeaterSchedulePtr == 0) { ShowWarningError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" basin heater schedule name \"" + AlphArray(5) + "\" was not found. Basin heater operation will not be modeled and the simulation continues"); @@ -989,7 +958,7 @@ namespace CondenserLoopTowers { ShowContinueError("Invalid " + cAlphaFieldNames(7) + '=' + AlphArray(7)); ErrorsFound = true; } - SimpleTower(TowerNum).SchedIDBlowdown = GetScheduleIndex(AlphArray(8)); + SimpleTower(TowerNum).SchedIDBlowdown = ScheduleManager::GetScheduleIndex(AlphArray(8)); if ((SimpleTower(TowerNum).SchedIDBlowdown == 0) && (SimpleTower(TowerNum).BlowdownMode == BlowdownBySchedule)) { ShowSevereError(cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError("Invalid " + cAlphaFieldNames(8) + '=' + AlphArray(8)); @@ -1042,7 +1011,7 @@ namespace CondenserLoopTowers { if (lAlphaFieldBlanks(9)) { SimpleTower(TowerNum).SuppliedByWaterSystem = false; } else { // water from storage tank - SetupTankDemandComponent(AlphArray(1), + WaterManager::SetupTankDemandComponent(AlphArray(1), cCurrentModuleObject, AlphArray(9), ErrorsFound, @@ -1055,15 +1024,15 @@ namespace CondenserLoopTowers { if (lAlphaFieldBlanks(10)) { SimpleTower(TowerNum).OutdoorAirInletNodeNum = 0; } else { - SimpleTower(TowerNum).OutdoorAirInletNodeNum = GetOnlySingleNode(AlphArray(10), + SimpleTower(TowerNum).OutdoorAirInletNodeNum = NodeInputManager::GetOnlySingleNode(AlphArray(10), ErrorsFound, cCurrentModuleObject, SimpleTower(TowerNum).Name, - NodeType_Air, - NodeConnectionType_OutsideAirReference, + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_OutsideAirReference, 1, - ObjectIsNotParent); - if (!CheckOutAirNodeNumber(SimpleTower(TowerNum).OutdoorAirInletNodeNum)) { + DataLoopNode::ObjectIsNotParent); + if (!OutAirNodeManager::CheckOutAirNodeNumber(SimpleTower(TowerNum).OutdoorAirInletNodeNum)) { ShowSevereError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" Outdoor Air Inlet Node Name not valid Outdoor Air Node= " + AlphArray(10)); ShowContinueError("...does not appear in an OutdoorAir:NodeList or as an OutdoorAir:Node."); @@ -1074,7 +1043,7 @@ namespace CondenserLoopTowers { // High speed air flow rate must be greater than low speed air flow rate. // Can't tell yet if autosized, check later in InitTower. if (SimpleTower(TowerNum).HighSpeedAirFlowRate <= SimpleTower(TowerNum).LowSpeedAirFlowRate && - SimpleTower(TowerNum).HighSpeedAirFlowRate != AutoSize) { + SimpleTower(TowerNum).HighSpeedAirFlowRate != DataSizing::AutoSize) { ShowSevereError(cCurrentModuleObject + " \"" + SimpleTower(TowerNum).Name + "\". Low speed air flow rate must be less than the high speed air flow rate."); ErrorsFound = true; @@ -1082,7 +1051,7 @@ namespace CondenserLoopTowers { // Low speed air flow rate must be greater than free convection air flow rate. // Can't tell yet if autosized, check later in InitTower. if (SimpleTower(TowerNum).LowSpeedAirFlowRate <= SimpleTower(TowerNum).FreeConvAirFlowRate && - SimpleTower(TowerNum).LowSpeedAirFlowRate != AutoSize) { + SimpleTower(TowerNum).LowSpeedAirFlowRate != DataSizing::AutoSize) { ShowSevereError(cCurrentModuleObject + " \"" + SimpleTower(TowerNum).Name + "\". Free convection air flow rate must be less than the low speed air flow rate."); ErrorsFound = true; @@ -1096,13 +1065,13 @@ namespace CondenserLoopTowers { ErrorsFound = true; } if (SimpleTower(TowerNum).HighSpeedTowerUA <= SimpleTower(TowerNum).LowSpeedTowerUA && - SimpleTower(TowerNum).HighSpeedTowerUA != AutoSize) { + SimpleTower(TowerNum).HighSpeedTowerUA != DataSizing::AutoSize) { ShowSevereError(cCurrentModuleObject + " \"" + SimpleTower(TowerNum).Name + "\". Tower UA at low fan speed must be less than the tower UA at high fan speed."); ErrorsFound = true; } if (SimpleTower(TowerNum).LowSpeedTowerUA <= SimpleTower(TowerNum).FreeConvTowerUA && - SimpleTower(TowerNum).LowSpeedTowerUA != AutoSize) { + SimpleTower(TowerNum).LowSpeedTowerUA != DataSizing::AutoSize) { ShowSevereError(cCurrentModuleObject + " \"" + SimpleTower(TowerNum).Name + "\". Tower UA at free convection air flow rate must be less than the tower UA at low fan speed."); ErrorsFound = true; @@ -1213,11 +1182,11 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).Name = AlphArray(1); SimpleTower(TowerNum).TowerType = cCurrentModuleObject; SimpleTower(TowerNum).TowerType_Num = CoolingTower_VariableSpeed; - SimpleTower(TowerNum).WaterInletNodeNum = GetOnlySingleNode( - AlphArray(2), ErrorsFound, cCurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - SimpleTower(TowerNum).WaterOutletNodeNum = GetOnlySingleNode( - AlphArray(3), ErrorsFound, cCurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); - TestCompSet(cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); + SimpleTower(TowerNum).WaterInletNodeNum = NodeInputManager::GetOnlySingleNode( + AlphArray(2), ErrorsFound, cCurrentModuleObject, AlphArray(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); + SimpleTower(TowerNum).WaterOutletNodeNum = NodeInputManager::GetOnlySingleNode( + AlphArray(3), ErrorsFound, cCurrentModuleObject, AlphArray(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 1, DataLoopNode::ObjectIsNotParent); + BranchNodeConnections::TestCompSet(cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); if ((UtilityRoutines::SameString(AlphArray(4), "CoolToolsUserDefined") || UtilityRoutines::SameString(AlphArray(4), "YorkCalcUserDefined")) && @@ -1236,7 +1205,7 @@ namespace CondenserLoopTowers { } if (!lAlphaFieldBlanks(6)) { - SimpleTower(TowerNum).FanPowerfAirFlowCurve = GetCurveIndex(AlphArray(6)); + SimpleTower(TowerNum).FanPowerfAirFlowCurve = CurveManager::GetCurveIndex(AlphArray(6)); if (SimpleTower(TowerNum).FanPowerfAirFlowCurve == 0) { ShowWarningError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" the Fan Power Ratio as a function of Air Flow Rate Ratio Curve Name specified as " + AlphArray(6) + @@ -1492,28 +1461,28 @@ namespace CondenserLoopTowers { } SimpleTower(TowerNum).DesignWaterFlowRate = NumArray(4); - if (SimpleTower(TowerNum).DesignWaterFlowRate == AutoSize) { + if (SimpleTower(TowerNum).DesignWaterFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).DesignWaterFlowRateWasAutoSized = true; } - if (NumArray(4) <= 0.0 && NumArray(4) != AutoSize) { + if (NumArray(4) <= 0.0 && NumArray(4) != DataSizing::AutoSize) { ShowSevereError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" design water flow rate must be > 0"); ErrorsFound = true; } SimpleTower(TowerNum).HighSpeedAirFlowRate = NumArray(5); - if (SimpleTower(TowerNum).HighSpeedAirFlowRate == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedAirFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedAirFlowRateWasAutoSized = true; } - if (NumArray(5) <= 0.0 && NumArray(5) != AutoSize) { + if (NumArray(5) <= 0.0 && NumArray(5) != DataSizing::AutoSize) { ShowSevereError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" design air flow rate must be > 0"); ErrorsFound = true; } SimpleTower(TowerNum).HighSpeedFanPower = NumArray(6); - if (SimpleTower(TowerNum).HighSpeedFanPower == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedFanPower == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedFanPowerWasAutoSized = true; } - if (NumArray(6) <= 0.0 && NumArray(6) != AutoSize) { + if (NumArray(6) <= 0.0 && NumArray(6) != DataSizing::AutoSize) { ShowSevereError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" design fan power must be > 0"); ErrorsFound = true; } @@ -1559,7 +1528,7 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).PerformanceInputMethod_Num = PIM_UFactor; if (!AlphArray(7).empty()) { - SimpleTower(TowerNum).BasinHeaterSchedulePtr = GetScheduleIndex(AlphArray(7)); + SimpleTower(TowerNum).BasinHeaterSchedulePtr = ScheduleManager::GetScheduleIndex(AlphArray(7)); if (SimpleTower(TowerNum).BasinHeaterSchedulePtr == 0) { ShowWarningError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" basin heater schedule name \"" + AlphArray(7) + "\" was not found. Basin heater operation will not be modeled and the simulation continues"); @@ -1596,7 +1565,7 @@ namespace CondenserLoopTowers { ShowContinueError("Entered in " + cCurrentModuleObject + '=' + AlphArray(1)); ErrorsFound = true; } - SimpleTower(TowerNum).SchedIDBlowdown = GetScheduleIndex(AlphArray(10)); + SimpleTower(TowerNum).SchedIDBlowdown = ScheduleManager::GetScheduleIndex(AlphArray(10)); if ((SimpleTower(TowerNum).SchedIDBlowdown == 0) && (SimpleTower(TowerNum).BlowdownMode == BlowdownBySchedule)) { ShowSevereError("Invalid " + cAlphaFieldNames(10) + '=' + AlphArray(10)); ShowContinueError("Entered in " + cCurrentModuleObject + '=' + AlphArray(1)); @@ -1649,7 +1618,7 @@ namespace CondenserLoopTowers { if (lAlphaFieldBlanks(11)) { SimpleTower(TowerNum).SuppliedByWaterSystem = false; } else { // water from storage tank - SetupTankDemandComponent(AlphArray(1), + WaterManager::SetupTankDemandComponent(AlphArray(1), cCurrentModuleObject, AlphArray(11), ErrorsFound, @@ -1662,15 +1631,15 @@ namespace CondenserLoopTowers { if (lAlphaFieldBlanks(12)) { SimpleTower(TowerNum).OutdoorAirInletNodeNum = 0; } else { - SimpleTower(TowerNum).OutdoorAirInletNodeNum = GetOnlySingleNode(AlphArray(12), + SimpleTower(TowerNum).OutdoorAirInletNodeNum = NodeInputManager::GetOnlySingleNode(AlphArray(12), ErrorsFound, cCurrentModuleObject, SimpleTower(TowerNum).Name, - NodeType_Air, - NodeConnectionType_OutsideAirReference, + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_OutsideAirReference, 1, - ObjectIsNotParent); - if (!CheckOutAirNodeNumber(SimpleTower(TowerNum).OutdoorAirInletNodeNum)) { + DataLoopNode::ObjectIsNotParent); + if (!OutAirNodeManager::CheckOutAirNodeNumber(SimpleTower(TowerNum).OutdoorAirInletNodeNum)) { ShowSevereError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" Outdoor Air Inlet Node Name not valid Outdoor Air Node= " + AlphArray(12)); ShowContinueError("...does not appear in an OutdoorAir:NodeList or as an OutdoorAir:Node."); @@ -1703,11 +1672,11 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).Name = AlphArray(1); SimpleTower(TowerNum).TowerType = cCurrentModuleObject; SimpleTower(TowerNum).TowerType_Num = CoolingTower_VariableSpeedMerkel; - SimpleTower(TowerNum).WaterInletNodeNum = GetOnlySingleNode( - AlphArray(2), ErrorsFound, cCurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Inlet, 1, ObjectIsNotParent); - SimpleTower(TowerNum).WaterOutletNodeNum = GetOnlySingleNode( - AlphArray(3), ErrorsFound, cCurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Outlet, 1, ObjectIsNotParent); - TestCompSet(cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); + SimpleTower(TowerNum).WaterInletNodeNum = NodeInputManager::GetOnlySingleNode( + AlphArray(2), ErrorsFound, cCurrentModuleObject, AlphArray(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent); + SimpleTower(TowerNum).WaterOutletNodeNum = NodeInputManager::GetOnlySingleNode( + AlphArray(3), ErrorsFound, cCurrentModuleObject, AlphArray(1), DataLoopNode::NodeType_Water, DataLoopNode::NodeConnectionType_Outlet, 1, DataLoopNode::ObjectIsNotParent); + BranchNodeConnections::TestCompSet(cCurrentModuleObject, AlphArray(1), AlphArray(2), AlphArray(3), "Chilled Water Nodes"); if (UtilityRoutines::SameString(AlphArray(4), "UFactorTimesAreaAndDesignWaterFlowRate")) { SimpleTower(TowerNum).PerformanceInputMethod_Num = PIM_UFactor; @@ -1719,7 +1688,7 @@ namespace CondenserLoopTowers { ErrorsFound = true; } - SimpleTower(TowerNum).FanPowerfAirFlowCurve = GetCurveIndex(AlphArray(5)); + SimpleTower(TowerNum).FanPowerfAirFlowCurve = CurveManager::GetCurveIndex(AlphArray(5)); if (SimpleTower(TowerNum).FanPowerfAirFlowCurve == 0) { ShowSevereError(cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError("Invalid " + cAlphaFieldNames(5) + '=' + AlphArray(5)); @@ -1729,47 +1698,47 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio = NumArray(1); SimpleTower(TowerNum).TowerNominalCapacity = NumArray(2); - if (SimpleTower(TowerNum).TowerNominalCapacity == AutoSize) { + if (SimpleTower(TowerNum).TowerNominalCapacity == DataSizing::AutoSize) { SimpleTower(TowerNum).TowerNominalCapacityWasAutoSized = true; } SimpleTower(TowerNum).TowerFreeConvNomCap = NumArray(3); - if (SimpleTower(TowerNum).TowerFreeConvNomCap == AutoSize) { + if (SimpleTower(TowerNum).TowerFreeConvNomCap == DataSizing::AutoSize) { SimpleTower(TowerNum).TowerFreeConvNomCapWasAutoSized = true; } SimpleTower(TowerNum).TowerFreeConvNomCapSizingFactor = NumArray(4); SimpleTower(TowerNum).DesignWaterFlowRate = NumArray(5); - if (SimpleTower(TowerNum).DesignWaterFlowRate == AutoSize) { + if (SimpleTower(TowerNum).DesignWaterFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).DesignWaterFlowRateWasAutoSized = true; } SimpleTower(TowerNum).DesignWaterFlowPerUnitNomCap = NumArray(6); SimpleTower(TowerNum).HighSpeedAirFlowRate = NumArray(7); - if (SimpleTower(TowerNum).HighSpeedAirFlowRate == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedAirFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedAirFlowRateWasAutoSized = true; } SimpleTower(TowerNum).DefaultedDesignAirFlowScalingFactor = lNumericFieldBlanks(8); SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap = NumArray(8); SimpleTower(TowerNum).MinimumVSAirFlowFrac = NumArray(9); SimpleTower(TowerNum).HighSpeedFanPower = NumArray(10); - if (SimpleTower(TowerNum).HighSpeedFanPower == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedFanPower == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedFanPowerWasAutoSized = true; } SimpleTower(TowerNum).DesignFanPowerPerUnitNomCap = NumArray(11); SimpleTower(TowerNum).FreeConvAirFlowRate = NumArray(12); - if (SimpleTower(TowerNum).FreeConvAirFlowRate == AutoSize) { + if (SimpleTower(TowerNum).FreeConvAirFlowRate == DataSizing::AutoSize) { SimpleTower(TowerNum).FreeConvAirFlowRateWasAutoSized = true; } SimpleTower(TowerNum).FreeConvAirFlowRateSizingFactor = NumArray(13); SimpleTower(TowerNum).HighSpeedTowerUA = NumArray(14); - if (SimpleTower(TowerNum).HighSpeedTowerUA == AutoSize) { + if (SimpleTower(TowerNum).HighSpeedTowerUA == DataSizing::AutoSize) { SimpleTower(TowerNum).HighSpeedTowerUAWasAutoSized = true; } SimpleTower(TowerNum).FreeConvTowerUA = NumArray(15); - if (SimpleTower(TowerNum).FreeConvTowerUA == AutoSize) { + if (SimpleTower(TowerNum).FreeConvTowerUA == DataSizing::AutoSize) { SimpleTower(TowerNum).FreeConvTowerUAWasAutoSized = true; } SimpleTower(TowerNum).FreeConvTowerUASizingFactor = NumArray(16); - SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr = GetCurveIndex(AlphArray(6)); + SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr = CurveManager::GetCurveIndex(AlphArray(6)); if (SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr == 0) { ShowSevereError(cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError("Invalid " + cAlphaFieldNames(6) + '=' + AlphArray(6)); @@ -1777,7 +1746,7 @@ namespace CondenserLoopTowers { ErrorsFound = true; } - SimpleTower(TowerNum).UAModFuncWetBulbDiffCurvePtr = GetCurveIndex(AlphArray(7)); + SimpleTower(TowerNum).UAModFuncWetBulbDiffCurvePtr = CurveManager::GetCurveIndex(AlphArray(7)); if (SimpleTower(TowerNum).UAModFuncWetBulbDiffCurvePtr == 0) { ShowSevereError(cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError("Invalid " + cAlphaFieldNames(7) + '=' + AlphArray(7)); @@ -1785,7 +1754,7 @@ namespace CondenserLoopTowers { ErrorsFound = true; } - SimpleTower(TowerNum).UAModFuncWaterFlowRatioCurvePtr = GetCurveIndex(AlphArray(8)); + SimpleTower(TowerNum).UAModFuncWaterFlowRatioCurvePtr = CurveManager::GetCurveIndex(AlphArray(8)); if (SimpleTower(TowerNum).UAModFuncWaterFlowRatioCurvePtr == 0) { ShowSevereError(cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError("Invalid " + cAlphaFieldNames(8) + '=' + AlphArray(8)); @@ -1804,12 +1773,12 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).TowerInletCondsAutoSize = true; } SimpleTower(TowerNum).DesApproach = NumArray(19); - if (SimpleTower(TowerNum).DesApproach == AutoSize || SimpleTower(TowerNum).DesApproach == 0) { + if (SimpleTower(TowerNum).DesApproach == DataSizing::AutoSize || SimpleTower(TowerNum).DesApproach == 0) { SimpleTower(TowerNum).DesApproach = 3.9; SimpleTower(TowerNum).TowerInletCondsAutoSize = true; } SimpleTower(TowerNum).DesRange = NumArray(20); - if (SimpleTower(TowerNum).DesRange == AutoSize || SimpleTower(TowerNum).DesRange == 0) { + if (SimpleTower(TowerNum).DesRange == DataSizing::AutoSize || SimpleTower(TowerNum).DesRange == 0) { SimpleTower(TowerNum).DesRange = 5.5; SimpleTower(TowerNum).TowerInletCondsAutoSize = true; } @@ -1836,7 +1805,7 @@ namespace CondenserLoopTowers { } if (!AlphArray(9).empty()) { - SimpleTower(TowerNum).BasinHeaterSchedulePtr = GetScheduleIndex(AlphArray(9)); + SimpleTower(TowerNum).BasinHeaterSchedulePtr = ScheduleManager::GetScheduleIndex(AlphArray(9)); if (SimpleTower(TowerNum).BasinHeaterSchedulePtr == 0) { ShowWarningError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" basin heater schedule name \"" + AlphArray(9) + "\" was not found. Basin heater operation will not be modeled and the simulation continues"); @@ -1882,7 +1851,7 @@ namespace CondenserLoopTowers { ShowContinueError("Invalid " + cAlphaFieldNames(11) + '=' + AlphArray(11)); ErrorsFound = true; } - SimpleTower(TowerNum).SchedIDBlowdown = GetScheduleIndex(AlphArray(12)); + SimpleTower(TowerNum).SchedIDBlowdown = ScheduleManager::GetScheduleIndex(AlphArray(12)); if ((SimpleTower(TowerNum).SchedIDBlowdown == 0) && (SimpleTower(TowerNum).BlowdownMode == BlowdownBySchedule)) { ShowSevereError(cCurrentModuleObject + '=' + AlphArray(1)); ShowContinueError("Invalid " + cAlphaFieldNames(12) + '=' + AlphArray(12)); @@ -1935,7 +1904,7 @@ namespace CondenserLoopTowers { if (lAlphaFieldBlanks(13)) { SimpleTower(TowerNum).SuppliedByWaterSystem = false; } else { // water from storage tank - SetupTankDemandComponent(AlphArray(1), + WaterManager::SetupTankDemandComponent(AlphArray(1), cCurrentModuleObject, AlphArray(13), ErrorsFound, @@ -1948,15 +1917,15 @@ namespace CondenserLoopTowers { if (lAlphaFieldBlanks(14)) { SimpleTower(TowerNum).OutdoorAirInletNodeNum = 0; } else { - SimpleTower(TowerNum).OutdoorAirInletNodeNum = GetOnlySingleNode(AlphArray(14), + SimpleTower(TowerNum).OutdoorAirInletNodeNum = NodeInputManager::GetOnlySingleNode(AlphArray(14), ErrorsFound, cCurrentModuleObject, SimpleTower(TowerNum).Name, - NodeType_Air, - NodeConnectionType_OutsideAirReference, + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_OutsideAirReference, 1, - ObjectIsNotParent); - if (!CheckOutAirNodeNumber(SimpleTower(TowerNum).OutdoorAirInletNodeNum)) { + DataLoopNode::ObjectIsNotParent); + if (!OutAirNodeManager::CheckOutAirNodeNumber(SimpleTower(TowerNum).OutdoorAirInletNodeNum)) { ShowSevereError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" Outdoor Air Inlet Node Name not valid Outdoor Air Node= " + AlphArray(14)); ShowContinueError("...does not appear in an OutdoorAir:NodeList or as an OutdoorAir:Node."); @@ -2473,20 +2442,6 @@ namespace CondenserLoopTowers { // METHODOLOGY EMPLOYED: // Uses the status flags to trigger initializations. - // Using/Aliasing - using DataGlobals::BeginEnvrnFlag; - using DataPlant::PlantFirstSizesOkayToFinalize; - using DataPlant::PlantLoop; - using DataPlant::TypeOf_CoolingTower_SingleSpd; - using DataPlant::TypeOf_CoolingTower_TwoSpd; - using DataPlant::TypeOf_CoolingTower_VarSpd; - using DataPlant::TypeOf_CoolingTower_VarSpdMerkel; - using PlantUtilities::InitComponentNodes; - using PlantUtilities::RegulateCondenserCompFlowReqOp; - using PlantUtilities::ScanPlantLoopsForObject; - using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyTwbFnTdbWPb; - // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("InitTower"); @@ -2495,7 +2450,6 @@ namespace CondenserLoopTowers { static Array1D_bool MyEnvrnFlag; static Array1D_bool OneTimeFlagForEachTower; - // LOGICAL :: FatalError int TypeOf_Num(0); Real64 rho; // local density of fluid @@ -2512,19 +2466,19 @@ namespace CondenserLoopTowers { if (OneTimeFlagForEachTower(TowerNum)) { if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_SingleSpeed) { - TypeOf_Num = TypeOf_CoolingTower_SingleSpd; + TypeOf_Num = DataPlant::TypeOf_CoolingTower_SingleSpd; } else if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_TwoSpeed) { - TypeOf_Num = TypeOf_CoolingTower_TwoSpd; + TypeOf_Num = DataPlant::TypeOf_CoolingTower_TwoSpd; } else if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_VariableSpeed) { - TypeOf_Num = TypeOf_CoolingTower_VarSpd; + TypeOf_Num = DataPlant::TypeOf_CoolingTower_VarSpd; } else if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_VariableSpeedMerkel) { - TypeOf_Num = TypeOf_CoolingTower_VarSpdMerkel; + TypeOf_Num = DataPlant::TypeOf_CoolingTower_VarSpdMerkel; } else { assert(false); } // Locate the tower on the plant loops for later usage - ScanPlantLoopsForObject(SimpleTower(TowerNum).Name, + PlantUtilities::ScanPlantLoopsForObject(SimpleTower(TowerNum).Name, TypeOf_Num, SimpleTower(TowerNum).LoopNum, SimpleTower(TowerNum).LoopSideNum, @@ -2541,23 +2495,23 @@ namespace CondenserLoopTowers { } // check if setpoint on outlet node - SimpleTower(TowerNum).SetpointIsOnOutlet = !((Node(SimpleTower(TowerNum).WaterOutletNodeNum).TempSetPoint == SensedNodeFlagValue) && - (Node(SimpleTower(TowerNum).WaterOutletNodeNum).TempSetPointHi == SensedNodeFlagValue)); + SimpleTower(TowerNum).SetpointIsOnOutlet = !((DataLoopNode::Node(SimpleTower(TowerNum).WaterOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && + (DataLoopNode::Node(SimpleTower(TowerNum).WaterOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)); OneTimeFlagForEachTower(TowerNum) = false; } // Begin environment initializations - if (MyEnvrnFlag(TowerNum) && BeginEnvrnFlag && (PlantFirstSizesOkayToFinalize)) { + if (MyEnvrnFlag(TowerNum) && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DataGlobals::InitConvTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); SimpleTower(TowerNum).DesWaterMassFlowRate = SimpleTower(TowerNum).DesignWaterFlowRate * rho; SimpleTower(TowerNum).DesWaterMassFlowRatePerCell = SimpleTower(TowerNum).DesWaterMassFlowRate / SimpleTower(TowerNum).NumCell; - InitComponentNodes(0.0, + PlantUtilities::InitComponentNodes(0.0, SimpleTower(TowerNum).DesWaterMassFlowRate, SimpleTower(TowerNum).WaterInletNodeNum, SimpleTower(TowerNum).WaterOutletNodeNum, @@ -2569,36 +2523,36 @@ namespace CondenserLoopTowers { MyEnvrnFlag(TowerNum) = false; } - if (!BeginEnvrnFlag) { + if (!DataGlobals::BeginEnvrnFlag) { MyEnvrnFlag(TowerNum) = true; } // Each time initializations WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; - SimpleTowerInlet(TowerNum).WaterTemp = Node(WaterInletNode).Temp; + SimpleTowerInlet(TowerNum).WaterTemp = DataLoopNode::Node(WaterInletNode).Temp; if (SimpleTower(TowerNum).OutdoorAirInletNodeNum != 0) { - SimpleTowerInlet(TowerNum).AirTemp = Node(SimpleTower(TowerNum).OutdoorAirInletNodeNum).Temp; - SimpleTowerInlet(TowerNum).AirHumRat = Node(SimpleTower(TowerNum).OutdoorAirInletNodeNum).HumRat; - SimpleTowerInlet(TowerNum).AirPress = Node(SimpleTower(TowerNum).OutdoorAirInletNodeNum).Press; + SimpleTowerInlet(TowerNum).AirTemp = DataLoopNode::Node(SimpleTower(TowerNum).OutdoorAirInletNodeNum).Temp; + SimpleTowerInlet(TowerNum).AirHumRat = DataLoopNode::Node(SimpleTower(TowerNum).OutdoorAirInletNodeNum).HumRat; + SimpleTowerInlet(TowerNum).AirPress = DataLoopNode::Node(SimpleTower(TowerNum).OutdoorAirInletNodeNum).Press; // SimpleTowerInlet(TowerNum)%AirWetBulb = PsyTwbFnTdbWPb(SimpleTowerInlet(TowerNum)%AirTemp, & // SimpleTowerInlet(TowerNum)%AirHumRat,SimpleTowerInlet(TowerNum)%AirPress) - SimpleTowerInlet(TowerNum).AirWetBulb = Node(SimpleTower(TowerNum).OutdoorAirInletNodeNum).OutAirWetBulb; + SimpleTowerInlet(TowerNum).AirWetBulb = DataLoopNode::Node(SimpleTower(TowerNum).OutdoorAirInletNodeNum).OutAirWetBulb; } else { - SimpleTowerInlet(TowerNum).AirTemp = OutDryBulbTemp; - SimpleTowerInlet(TowerNum).AirHumRat = OutHumRat; - SimpleTowerInlet(TowerNum).AirPress = OutBaroPress; - SimpleTowerInlet(TowerNum).AirWetBulb = OutWetBulbTemp; + SimpleTowerInlet(TowerNum).AirTemp = DataEnvironment::OutDryBulbTemp; + SimpleTowerInlet(TowerNum).AirHumRat = DataEnvironment::OutHumRat; + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::OutBaroPress; + SimpleTowerInlet(TowerNum).AirWetBulb = DataEnvironment::OutWetBulbTemp; } WaterMassFlowRate = - RegulateCondenserCompFlowReqOp(SimpleTower(TowerNum).LoopNum, + PlantUtilities::RegulateCondenserCompFlowReqOp(SimpleTower(TowerNum).LoopNum, SimpleTower(TowerNum).LoopSideNum, SimpleTower(TowerNum).BranchNum, SimpleTower(TowerNum).CompNum, SimpleTower(TowerNum).DesWaterMassFlowRate * SimpleTower(TowerNum).TowerMassFlowRateMultiplier); - SetComponentFlowRate(WaterMassFlowRate, + PlantUtilities::SetComponentFlowRate(WaterMassFlowRate, SimpleTower(TowerNum).WaterInletNodeNum, SimpleTower(TowerNum).WaterOutletNodeNum, SimpleTower(TowerNum).LoopNum, @@ -2629,20 +2583,6 @@ namespace CondenserLoopTowers { // Obtains condenser flow rate from the plant sizing array. If tower performance is specified // via the "Nominal Capacity" method, the water flow rate is directly proportional to capacity. - // REFERENCES: - // na - - // Using/Aliasing - using namespace DataSizing; - using DataPlant::PlantFinalSizesOkayToReport; - using DataPlant::PlantFirstSizesOkayToFinalize; - using DataPlant::PlantFirstSizesOkayToReport; - using DataPlant::PlantLoop; - using General::SolveRoot; - using PlantUtilities::RegisterPlantCompDesignFlow; - using ReportSizingManager::ReportSizingOutput; - using namespace OutputReportPredefined; - // SUBROUTINE PARAMETER DEFINITIONS: static ObjexxFCL::gio::Fmt OutputFormat("(F6.2)"); static ObjexxFCL::gio::Fmt OutputFormat2("(F9.6)"); @@ -2697,15 +2637,15 @@ namespace CondenserLoopTowers { tmpLowSpeedAirFlowRate = SimpleTower(TowerNum).LowSpeedAirFlowRate; // Find the appropriate Plant Sizing object - PltSizCondNum = PlantLoop(SimpleTower(TowerNum).LoopNum).PlantSizNum; + PltSizCondNum = DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).PlantSizNum; if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_SingleSpeed || SimpleTower(TowerNum).TowerType_Num == CoolingTower_TwoSpeed) { if (SimpleTower(TowerNum).TowerInletCondsAutoSize) { if (PltSizCondNum > 0) { // use plant sizing data - DesTowerExitWaterTemp = PlantSizData(PltSizCondNum).ExitTemp; - DesTowerInletWaterTemp = DesTowerExitWaterTemp + PlantSizData(PltSizCondNum).DeltaT; - DesTowerWaterDeltaT = PlantSizData(PltSizCondNum).DeltaT; + DesTowerExitWaterTemp = DataSizing::PlantSizData(PltSizCondNum).ExitTemp; + DesTowerInletWaterTemp = DesTowerExitWaterTemp + DataSizing::PlantSizData(PltSizCondNum).DeltaT; + DesTowerWaterDeltaT = DataSizing::PlantSizData(PltSizCondNum).DeltaT; } else { // set hard wired input assumptions // AssumedDeltaT = 11.0; @@ -2721,39 +2661,39 @@ namespace CondenserLoopTowers { DesTowerWaterDeltaT = SimpleTower(TowerNum).DesRange; if (PltSizCondNum > 0) { // check the tower range against the plant sizing data - if (std::abs(DesTowerWaterDeltaT - PlantSizData(PltSizCondNum).DeltaT) > TolTemp) { + if (std::abs(DesTowerWaterDeltaT - DataSizing::PlantSizData(PltSizCondNum).DeltaT) > TolTemp) { ShowWarningError("Error when autosizing the load for cooling tower = " + SimpleTower(TowerNum).Name + ". Tower Design Range Temperature is different from the Design Loop Delta Temperature."); ShowContinueError("Tower Design Range Temperature specified in tower = " + SimpleTower(TowerNum).Name); ShowContinueError("is inconsistent with Design Loop Delta Temperature specified in Sizing:Plant object = " + - PlantSizData(PltSizCondNum).PlantLoopName + "."); + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName + "."); ShowContinueError("..The Design Range Temperature specified in tower is = " + - TrimSigDigits(SimpleTower(TowerNum).DesRange, 2)); + General::TrimSigDigits(SimpleTower(TowerNum).DesRange, 2)); ShowContinueError("..The Design Loop Delta Temperature specified in plant sizing data is = " + - TrimSigDigits(PlantSizData(PltSizCondNum).DeltaT, 2)); + General::TrimSigDigits(DataSizing::PlantSizData(PltSizCondNum).DeltaT, 2)); } // check if the tower approach is different from plant sizing data - DesTowerApproachFromPlant = PlantSizData(PltSizCondNum).ExitTemp - SimpleTower(TowerNum).DesInletAirWBTemp; + DesTowerApproachFromPlant = DataSizing::PlantSizData(PltSizCondNum).ExitTemp - SimpleTower(TowerNum).DesInletAirWBTemp; if (std::abs(DesTowerApproachFromPlant - SimpleTower(TowerNum).DesApproach) > TolTemp) { ShowWarningError("Error when autosizing the UA for cooling tower = " + SimpleTower(TowerNum).Name + ". Tower Design Approach Temperature is inconsistent with Approach from Plant Sizing Data."); ShowContinueError("The Design Approach Temperature from inputs specified in Sizing:Plant object = " + - PlantSizData(PltSizCondNum).PlantLoopName); + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName); ShowContinueError("is inconsistent with Design Approach Temperature specified in tower = " + SimpleTower(TowerNum).Name + "."); ShowContinueError("..The Design Approach Temperature from inputs specified is = " + - TrimSigDigits(DesTowerApproachFromPlant, 2)); + General::TrimSigDigits(DesTowerApproachFromPlant, 2)); ShowContinueError("..The Design Approach Temperature specified in tower is = " + - TrimSigDigits(SimpleTower(TowerNum).DesApproach, 2)); + General::TrimSigDigits(SimpleTower(TowerNum).DesApproach, 2)); } } } } else { // CoolingTower_VariableSpeed if (PltSizCondNum > 0) { // use plant sizing data - DesTowerExitWaterTemp = PlantSizData(PltSizCondNum).ExitTemp; - DesTowerInletWaterTemp = DesTowerExitWaterTemp + PlantSizData(PltSizCondNum).DeltaT; - DesTowerWaterDeltaT = PlantSizData(PltSizCondNum).DeltaT; + DesTowerExitWaterTemp = DataSizing::PlantSizData(PltSizCondNum).ExitTemp; + DesTowerInletWaterTemp = DesTowerExitWaterTemp + DataSizing::PlantSizData(PltSizCondNum).DeltaT; + DesTowerWaterDeltaT = DataSizing::PlantSizData(PltSizCondNum).DeltaT; } else { // set hard wired input assumptions // AssumedDeltaT = 11.0; @@ -2766,13 +2706,13 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).PerformanceInputMethod_Num == PIM_UFactor && (!SimpleTower(TowerNum).HighSpeedTowerUAWasAutoSized)) { if (PltSizCondNum > 0) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * SimpleTower(TowerNum).DesignWaterFlowRate * DesTowerWaterDeltaT; SimpleTower(TowerNum).TowerNominalCapacity = DesTowerLoad / SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; @@ -2781,13 +2721,13 @@ namespace CondenserLoopTowers { AssumedDeltaT = DesTowerWaterDeltaT; AssumedExitTemp = DesTowerExitWaterTemp; - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, AssumedExitTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, AssumedExitTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * SimpleTower(TowerNum).DesignWaterFlowRate * AssumedDeltaT; @@ -2797,27 +2737,27 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).DesignWaterFlowRateWasAutoSized) { if (PltSizCondNum > 0) { - if (PlantSizData(PltSizCondNum).DesVolFlowRate >= SmallWaterVolFlow) { - tmpDesignWaterFlowRate = PlantSizData(PltSizCondNum).DesVolFlowRate * SimpleTower(TowerNum).SizFac; - if (PlantFirstSizesOkayToFinalize) SimpleTower(TowerNum).DesignWaterFlowRate = tmpDesignWaterFlowRate; + if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + tmpDesignWaterFlowRate = DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * SimpleTower(TowerNum).SizFac; + if (DataPlant::PlantFirstSizesOkayToFinalize) SimpleTower(TowerNum).DesignWaterFlowRate = tmpDesignWaterFlowRate; } else { tmpDesignWaterFlowRate = 0.0; - if (PlantFirstSizesOkayToFinalize) SimpleTower(TowerNum).DesignWaterFlowRate = tmpDesignWaterFlowRate; + if (DataPlant::PlantFirstSizesOkayToFinalize) SimpleTower(TowerNum).DesignWaterFlowRate = tmpDesignWaterFlowRate; } - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Water Flow Rate [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Water Flow Rate [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); } } else { - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { ShowSevereError("Autosizing error for cooling tower object = " + SimpleTower(TowerNum).Name); ShowFatalError("Autosizing of cooling tower condenser flow rate requires a loop Sizing:Plant object."); } @@ -2829,27 +2769,27 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).DesignWaterFlowRate = 5.382e-8 * SimpleTower(TowerNum).TowerNominalCapacity; tmpDesignWaterFlowRate = SimpleTower(TowerNum).DesignWaterFlowRate; if (UtilityRoutines::SameString(SimpleTower(TowerNum).TowerType, "CoolingTower:SingleSpeed")) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Water Flow Rate based on tower nominal capacity [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Water Flow Rate based on tower nominal capacity [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); } } else if (UtilityRoutines::SameString(SimpleTower(TowerNum).TowerType, "CoolingTower:TwoSpeed")) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Water Flow Rate based on tower high-speed nominal capacity [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Water Flow Rate based on tower high-speed nominal capacity [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); @@ -2857,7 +2797,7 @@ namespace CondenserLoopTowers { } } - RegisterPlantCompDesignFlow(SimpleTower(TowerNum).WaterInletNodeNum, tmpDesignWaterFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(SimpleTower(TowerNum).WaterInletNodeNum, tmpDesignWaterFlowRate); if (SimpleTower(TowerNum).HighSpeedFanPowerWasAutoSized) { // We assume the nominal fan power is 0.0105 times the design load @@ -2866,24 +2806,24 @@ namespace CondenserLoopTowers { tmpHighSpeedFanPower = SimpleTower(TowerNum).HighSpeedFanPower; } else { if (PltSizCondNum > 0) { - if (PlantSizData(PltSizCondNum).DesVolFlowRate >= SmallWaterVolFlow) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DataGlobals::InitConvTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * tmpDesignWaterFlowRate * DesTowerWaterDeltaT; tmpHighSpeedFanPower = 0.0105 * DesTowerLoad; - if (PlantFirstSizesOkayToFinalize) SimpleTower(TowerNum).HighSpeedFanPower = tmpHighSpeedFanPower; + if (DataPlant::PlantFirstSizesOkayToFinalize) SimpleTower(TowerNum).HighSpeedFanPower = tmpHighSpeedFanPower; } else { tmpHighSpeedFanPower = 0.0; - if (PlantFirstSizesOkayToFinalize) SimpleTower(TowerNum).HighSpeedFanPower = tmpHighSpeedFanPower; + if (DataPlant::PlantFirstSizesOkayToFinalize) SimpleTower(TowerNum).HighSpeedFanPower = tmpHighSpeedFanPower; } } else { - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { ShowSevereError("Autosizing of cooling tower fan power requires a loop Sizing:Plant object."); ShowFatalError(" Occurs in cooling tower object= " + SimpleTower(TowerNum).Name); } @@ -2891,27 +2831,27 @@ namespace CondenserLoopTowers { } if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_SingleSpeed || SimpleTower(TowerNum).TowerType_Num == CoolingTower_VariableSpeed) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Fan Power at Design Air Flow Rate [W]", SimpleTower(TowerNum).HighSpeedFanPower); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Fan Power at Design Air Flow Rate [W]", SimpleTower(TowerNum).HighSpeedFanPower); } } else if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_TwoSpeed) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Fan Power at High Fan Speed [W]", SimpleTower(TowerNum).HighSpeedFanPower); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Fan Power at High Fan Speed [W]", SimpleTower(TowerNum).HighSpeedFanPower); @@ -2921,32 +2861,32 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).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 / StdBaroPress) / 190.0; - if (PlantFirstSizesOkayToFinalize) SimpleTower(TowerNum).HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; + tmpHighSpeedAirFlowRate = tmpHighSpeedFanPower * 0.5 * (101325.0 / DataEnvironment::StdBaroPress) / 190.0; + if (DataPlant::PlantFirstSizesOkayToFinalize) SimpleTower(TowerNum).HighSpeedAirFlowRate = tmpHighSpeedAirFlowRate; if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_SingleSpeed || SimpleTower(TowerNum).TowerType_Num == CoolingTower_VariableSpeed) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Air Flow Rate [m3/s]", SimpleTower(TowerNum).HighSpeedAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Air Flow Rate [m3/s]", SimpleTower(TowerNum).HighSpeedAirFlowRate); } } else if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_TwoSpeed) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Air Flow Rate at High Fan Speed [m3/s]", SimpleTower(TowerNum).HighSpeedAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Air Flow Rate at High Fan Speed [m3/s]", SimpleTower(TowerNum).HighSpeedAirFlowRate); @@ -2956,30 +2896,30 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).HighSpeedTowerUAWasAutoSized) { if (PltSizCondNum > 0) { - if (PlantSizData(PltSizCondNum).DesVolFlowRate >= SmallWaterVolFlow) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DataGlobals::InitConvTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * tmpDesignWaterFlowRate * DesTowerWaterDeltaT; // This conditional statement is to trap when the user specified condenser/tower water design setpoint // temperature is less than design inlet air wet bulb temperature - if (PlantSizData(PltSizCondNum).ExitTemp <= SimpleTower(TowerNum).DesInletAirWBTemp) { + if (DataSizing::PlantSizData(PltSizCondNum).ExitTemp <= SimpleTower(TowerNum).DesInletAirWBTemp) { ShowSevereError("Error when autosizing the UA value for cooling tower = " + SimpleTower(TowerNum).Name + ". Design Loop Exit Temperature must be greater than " + - TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C when autosizing the tower UA."); + General::TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C when autosizing the tower UA."); ShowContinueError( - "The Design Loop Exit Temperature specified in Sizing:Plant object = " + PlantSizData(PltSizCondNum).PlantLoopName + - " (" + TrimSigDigits(PlantSizData(PltSizCondNum).ExitTemp, 2) + " C)"); + "The Design Loop Exit Temperature specified in Sizing:Plant object = " + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName + + " (" + General::TrimSigDigits(DataSizing::PlantSizData(PltSizCondNum).ExitTemp, 2) + " C)"); ShowContinueError("is less than or equal to the design inlet air wet-bulb temperature of " + - TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C."); + General::TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C."); ShowContinueError( "If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design Setpoint must be > " + - TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C if autosizing the cooling tower."); + General::TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C if autosizing the cooling tower."); ShowFatalError("Autosizing of cooling tower fails for tower = " + SimpleTower(TowerNum).Name + '.'); } @@ -2994,11 +2934,10 @@ namespace CondenserLoopTowers { DesTowerInletWaterTemp; // PlantSizData( PltSizCondNum ).ExitTemp + PlantSizData( PltSizCondNum ).DeltaT; SimpleTowerInlet(TowerNum).AirTemp = SimpleTower(TowerNum).DesInletAirDBTemp; // 35.0; SimpleTowerInlet(TowerNum).AirWetBulb = SimpleTower(TowerNum).DesInletAirWBTemp; // 25.6; - SimpleTowerInlet(TowerNum).AirPress = StdBaroPress; - SimpleTowerInlet(TowerNum).AirHumRat = PsyWFnTdbTwbPb( + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::StdBaroPress; + SimpleTowerInlet(TowerNum).AirHumRat = Psychrometrics::PsyWFnTdbTwbPb( SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); - // SimpleTowerInlet(TowerNum)%AirHumRat = PsyWFnTdbTwbPb(35.,25.6,StdBaroPress) - SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); + General::SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower UA"); ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); @@ -3007,52 +2946,52 @@ namespace CondenserLoopTowers { ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).HighSpeedTowerUA = UA; } SimpleTower(TowerNum).TowerNominalCapacity = DesTowerLoad / SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; } else { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).HighSpeedTowerUA = 0.0; } } if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_SingleSpeed) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } } else if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_TwoSpeed) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at High Fan Speed [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } } } else { - if (SimpleTower(TowerNum).DesignWaterFlowRate >= SmallWaterVolFlow) { + if (SimpleTower(TowerNum).DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DataGlobals::InitConvTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * tmpDesignWaterFlowRate * DesTowerWaterDeltaT; // This conditional statement is to trap when the user specified condenser/tower water design setpoint @@ -3067,26 +3006,26 @@ namespace CondenserLoopTowers { if (DesTowerExitWaterTemp <= SimpleTower(TowerNum).DesInletAirWBTemp) { ShowSevereError("Error when autosizing the UA value for cooling tower = " + SimpleTower(TowerNum).Name + ". Design Tower Exit Temperature must be greater than " + - TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C when autosizing the tower UA."); - ShowContinueError("The User-specified Design Loop Exit Temperature=" + TrimSigDigits(DesTowerExitWaterTemp, 2)); + General::TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C when autosizing the tower UA."); + ShowContinueError("The User-specified Design Loop Exit Temperature=" + General::TrimSigDigits(DesTowerExitWaterTemp, 2)); ShowContinueError("is less than or equal to the design inlet air wet-bulb temperature of " + - TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C."); + General::TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C."); if (SimpleTower(TowerNum).TowerInletCondsAutoSize) { ShowContinueError( "Because you did not specify the Design Approach Temperature, and you do not have a Sizing:Plant object, " "it was defaulted to " + - TrimSigDigits(DesTowerExitWaterTemp, 2) + " C."); + General::TrimSigDigits(DesTowerExitWaterTemp, 2) + " C."); } else { // Should never get there... ShowContinueError("The Design Loop Exit Temperature is the sum of the design air inlet wet-bulb temperature= " + - TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + + General::TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C plus the cooling tower design approach temperature = " + - TrimSigDigits(SimpleTower(TowerNum).DesApproach, 2) + "C."); + General::TrimSigDigits(SimpleTower(TowerNum).DesApproach, 2) + "C."); } ShowContinueError( "If using HVACTemplate:Plant:ChilledWaterLoop, then check that input field Condenser Water Design Setpoint must be > " + - TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C if autosizing the cooling tower."); + General::TrimSigDigits(SimpleTower(TowerNum).DesInletAirWBTemp, 2) + " C if autosizing the cooling tower."); ShowFatalError("Autosizing of cooling tower fails for tower = " + SimpleTower(TowerNum).Name + '.'); } @@ -3101,11 +3040,11 @@ namespace CondenserLoopTowers { DesTowerInletWaterTemp; // PlantSizData( PltSizCondNum ).ExitTemp + PlantSizData( PltSizCondNum ).DeltaT; SimpleTowerInlet(TowerNum).AirTemp = SimpleTower(TowerNum).DesInletAirDBTemp; // 35.0; SimpleTowerInlet(TowerNum).AirWetBulb = SimpleTower(TowerNum).DesInletAirWBTemp; // 25.6; - SimpleTowerInlet(TowerNum).AirPress = StdBaroPress; - SimpleTowerInlet(TowerNum).AirHumRat = PsyWFnTdbTwbPb( + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::StdBaroPress; + SimpleTowerInlet(TowerNum).AirHumRat = Psychrometrics::PsyWFnTdbTwbPb( SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); // SimpleTowerInlet(TowerNum)%AirHumRat = PsyWFnTdbTwbPb(35.,25.6,StdBaroPress) - SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); + General::SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower UA"); ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); @@ -3114,37 +3053,37 @@ namespace CondenserLoopTowers { ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).HighSpeedTowerUA = UA; } SimpleTower(TowerNum).TowerNominalCapacity = DesTowerLoad / SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; } else { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).HighSpeedTowerUA = 0.0; } } if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_SingleSpeed) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } } else if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_TwoSpeed) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at High Fan Speed [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); @@ -3154,16 +3093,16 @@ namespace CondenserLoopTowers { } if (SimpleTower(TowerNum).PerformanceInputMethod_Num == PIM_NominalCapacity) { - if (SimpleTower(TowerNum).DesignWaterFlowRate >= SmallWaterVolFlow) { + if (SimpleTower(TowerNum).DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { // 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 - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, 29.44, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, 29.44, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp DesTowerLoad = SimpleTower(TowerNum).TowerNominalCapacity * SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; @@ -3177,11 +3116,10 @@ namespace CondenserLoopTowers { SimpleTowerInlet(TowerNum).WaterTemp = SimpleTower(TowerNum).DesInletWaterTemp; // 35.0; // 95F design inlet water temperature SimpleTowerInlet(TowerNum).AirTemp = SimpleTower(TowerNum).DesInletAirDBTemp; // 95F design inlet air dry-bulb temp SimpleTowerInlet(TowerNum).AirWetBulb = SimpleTower(TowerNum).DesInletAirWBTemp; // 78F design inlet air wet-bulb temp - SimpleTowerInlet(TowerNum).AirPress = StdBaroPress; + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::StdBaroPress; SimpleTowerInlet(TowerNum).AirHumRat = - PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); - // SimpleTowerInlet(TowerNum)%AirHumRat = PsyWFnTdbTwbPb(35.,25.6,StdBaroPress) - SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); + Psychrometrics::PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); + General::SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower UA"); ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); @@ -3189,36 +3127,36 @@ namespace CondenserLoopTowers { ShowSevereError("Bad starting values for UA"); ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).HighSpeedTowerUA = UA; } } else { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).HighSpeedTowerUA = 0.0; } } if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_SingleSpeed) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at Design Air Flow Rate [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at Design Air Flow Rate [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } } else if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_TwoSpeed) { - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at High Fan Speed [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at High Fan Speed [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); @@ -3228,18 +3166,18 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).LowSpeedAirFlowRateWasAutoSized) { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).LowSpeedAirFlowRate = SimpleTower(TowerNum).LowSpeedAirFlowRateSizingFactor * SimpleTower(TowerNum).HighSpeedAirFlowRate; tmpLowSpeedAirFlowRate = SimpleTower(TowerNum).LowSpeedAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Low Fan Speed Air Flow Rate [m3/s]", SimpleTower(TowerNum).LowSpeedAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Low Fan Speed Air Flow Rate [m3/s]", SimpleTower(TowerNum).LowSpeedAirFlowRate); @@ -3250,16 +3188,16 @@ namespace CondenserLoopTowers { } if (SimpleTower(TowerNum).LowSpeedFanPowerWasAutoSized) { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).LowSpeedFanPower = SimpleTower(TowerNum).LowSpeedFanPowerSizingFactor * SimpleTower(TowerNum).HighSpeedFanPower; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Fan Power at Low Fan Speed [W]", SimpleTower(TowerNum).LowSpeedFanPower); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Fan Power at Low Fan Speed [W]", SimpleTower(TowerNum).LowSpeedFanPower); @@ -3267,16 +3205,16 @@ namespace CondenserLoopTowers { } } - if (SimpleTower(TowerNum).LowSpeedTowerUAWasAutoSized && PlantFirstSizesOkayToFinalize) { + if (SimpleTower(TowerNum).LowSpeedTowerUAWasAutoSized && DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).LowSpeedTowerUA = SimpleTower(TowerNum).LowSpeedTowerUASizingFactor * SimpleTower(TowerNum).HighSpeedTowerUA; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at Low Fan Speed [W/K]", SimpleTower(TowerNum).LowSpeedTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager:: ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at Low Fan Speed [W/K]", SimpleTower(TowerNum).LowSpeedTowerUA); @@ -3285,17 +3223,17 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).PerformanceInputMethod_Num == PIM_NominalCapacity) { if (SimpleTower(TowerNum).TowerLowSpeedNomCapWasAutoSized) { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerLowSpeedNomCap = SimpleTower(TowerNum).TowerLowSpeedNomCapSizingFactor * SimpleTower(TowerNum).TowerNominalCapacity; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Low Speed Nominal Capacity [W]", SimpleTower(TowerNum).TowerLowSpeedNomCap); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Low Speed Nominal Capacity [W]", SimpleTower(TowerNum).TowerLowSpeedNomCap); @@ -3303,17 +3241,17 @@ namespace CondenserLoopTowers { } } if (SimpleTower(TowerNum).TowerFreeConvNomCapWasAutoSized) { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerFreeConvNomCap = SimpleTower(TowerNum).TowerFreeConvNomCapSizingFactor * SimpleTower(TowerNum).TowerNominalCapacity; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Free Convection Nominal Capacity [W]", SimpleTower(TowerNum).TowerFreeConvNomCap); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Free Convection Nominal Capacity [W]", SimpleTower(TowerNum).TowerFreeConvNomCap); @@ -3324,17 +3262,17 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).PerformanceInputMethod_Num == PIM_NominalCapacity && UtilityRoutines::SameString(SimpleTower(TowerNum).TowerType, "CoolingTower:TwoSpeed")) { - if (SimpleTower(TowerNum).DesignWaterFlowRate >= SmallWaterVolFlow && SimpleTower(TowerNum).TowerLowSpeedNomCap > 0.0) { + if (SimpleTower(TowerNum).DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow && SimpleTower(TowerNum).TowerLowSpeedNomCap > 0.0) { // 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 - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, 29.44, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, 29.44, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp DesTowerLoad = SimpleTower(TowerNum).TowerLowSpeedNomCap * SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; Par(1) = DesTowerLoad; @@ -3347,10 +3285,10 @@ namespace CondenserLoopTowers { SimpleTowerInlet(TowerNum).WaterTemp = SimpleTower(TowerNum).DesInletWaterTemp; // 35.0; // 95F design inlet water temperature SimpleTowerInlet(TowerNum).AirTemp = SimpleTower(TowerNum).DesInletAirDBTemp; // 35.0; // 95F design inlet air dry-bulb temp SimpleTowerInlet(TowerNum).AirWetBulb = SimpleTower(TowerNum).DesInletAirWBTemp; // 25.6; // 78F design inlet air wet-bulb temp - SimpleTowerInlet(TowerNum).AirPress = StdBaroPress; + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::StdBaroPress; SimpleTowerInlet(TowerNum).AirHumRat = - PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); - SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); + Psychrometrics::PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); + General::SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower UA"); ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); @@ -3358,20 +3296,20 @@ namespace CondenserLoopTowers { ShowSevereError("Bad starting values for UA"); ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).LowSpeedTowerUA = UA; } } else { SimpleTower(TowerNum).LowSpeedTowerUA = 0.0; } - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Low Fan Speed U-Factor Times Area Value [W/K]", SimpleTower(TowerNum).LowSpeedTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Low Fan Speed U-Factor Times Area Value [W/K]", SimpleTower(TowerNum).LowSpeedTowerUA); @@ -3380,17 +3318,17 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).FreeConvAirFlowRateWasAutoSized) { SimpleTower(TowerNum).FreeConvAirFlowRate = SimpleTower(TowerNum).FreeConvAirFlowRateSizingFactor * tmpHighSpeedAirFlowRate; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).FreeConvAirFlowRate = SimpleTower(TowerNum).FreeConvAirFlowRateSizingFactor * SimpleTower(TowerNum).HighSpeedAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Free Convection Regime Air Flow Rate [m3/s]", SimpleTower(TowerNum).FreeConvAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Free Convection Regime Air Flow Rate [m3/s]", SimpleTower(TowerNum).FreeConvAirFlowRate); @@ -3399,16 +3337,16 @@ namespace CondenserLoopTowers { } if (SimpleTower(TowerNum).FreeConvTowerUAWasAutoSized) { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).FreeConvTowerUA = SimpleTower(TowerNum).FreeConvTowerUASizingFactor * SimpleTower(TowerNum).HighSpeedTowerUA; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Free Convection U-Factor Times Area Value [W/K]", SimpleTower(TowerNum).FreeConvTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Free Convection U-Factor Times Area Value [W/K]", SimpleTower(TowerNum).FreeConvTowerUA); @@ -3417,16 +3355,16 @@ namespace CondenserLoopTowers { } if (SimpleTower(TowerNum).PerformanceInputMethod_Num == PIM_NominalCapacity) { - if (SimpleTower(TowerNum).DesignWaterFlowRate >= SmallWaterVolFlow && SimpleTower(TowerNum).TowerFreeConvNomCap > 0.0) { + if (SimpleTower(TowerNum).DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow && SimpleTower(TowerNum).TowerFreeConvNomCap > 0.0) { // nominal capacity doesn't include compressor heat; predefined factor was 1.25 W heat rejection per W of evap cooling but now user // input - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, 29.44, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, 29.44, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); // 85F design exiting water temp DesTowerLoad = SimpleTower(TowerNum).TowerFreeConvNomCap * SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; Par(1) = DesTowerLoad; @@ -3439,10 +3377,10 @@ namespace CondenserLoopTowers { SimpleTowerInlet(TowerNum).WaterTemp = SimpleTower(TowerNum).DesInletWaterTemp; // 35.0; // 95F design inlet water temperature SimpleTowerInlet(TowerNum).AirTemp = SimpleTower(TowerNum).DesInletAirDBTemp; // 35.0; // 95F design inlet air dry-bulb temp SimpleTowerInlet(TowerNum).AirWetBulb = SimpleTower(TowerNum).DesInletAirWBTemp; // 25.6; // 78F design inlet air wet-bulb temp - SimpleTowerInlet(TowerNum).AirPress = StdBaroPress; + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::StdBaroPress; SimpleTowerInlet(TowerNum).AirHumRat = - PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); - SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); + Psychrometrics::PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); + General::SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower UA"); ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); @@ -3451,17 +3389,17 @@ namespace CondenserLoopTowers { ShowContinueError("Tower inlet design water temperature assumed to be 35.0 C."); ShowContinueError("Tower inlet design air dry-bulb temperature assumed to be 35.0 C."); ShowContinueError("Tower inlet design air wet-bulb temperature assumed to be 25.6 C."); - ShowContinueError("Tower load assumed to be " + TrimSigDigits(SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio, 3) + - " times free convection capacity of " + TrimSigDigits(SimpleTower(TowerNum).TowerFreeConvNomCap, 0) + " W."); + ShowContinueError("Tower load assumed to be " + General::TrimSigDigits(SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio, 3) + + " times free convection capacity of " + General::TrimSigDigits(SimpleTower(TowerNum).TowerFreeConvNomCap, 0) + " W."); SimSimpleTower(TowerNum, Par(3), Par(4), UA0, OutWaterTemp); CoolingOutput = Par(5) * Par(3) * (SimpleTowerInlet(TowerNum).WaterTemp - OutWaterTemp); - ShowContinueError("Tower capacity at lower UA guess (" + TrimSigDigits(UA0, 4) + ") = " + TrimSigDigits(CoolingOutput, 0) + + ShowContinueError("Tower capacity at lower UA guess (" + General::TrimSigDigits(UA0, 4) + ") = " + General::TrimSigDigits(CoolingOutput, 0) + " W."); SimSimpleTower(TowerNum, Par(3), Par(4), UA1, OutWaterTemp); CoolingOutput = Par(5) * Par(3) * (SimpleTowerInlet(TowerNum).WaterTemp - OutWaterTemp); - ShowContinueError("Tower capacity at upper UA guess (" + TrimSigDigits(UA1, 4) + ") = " + TrimSigDigits(CoolingOutput, 0) + + ShowContinueError("Tower capacity at upper UA guess (" + General::TrimSigDigits(UA1, 4) + ") = " + General::TrimSigDigits(CoolingOutput, 0) + " W."); if (CoolingOutput < DesTowerLoad) { @@ -3469,20 +3407,20 @@ namespace CondenserLoopTowers { } ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).FreeConvTowerUA = UA; } } else { SimpleTower(TowerNum).FreeConvTowerUA = 0.0; } - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", SimpleTower(TowerNum).FreeConvTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", SimpleTower(TowerNum).FreeConvTowerUA); @@ -3527,7 +3465,7 @@ namespace CondenserLoopTowers { } if (ModelCalibrated) { - SolveRoot(Acc, MaxIte, SolFla, WaterFlowRatio, SimpleTowerApproachResidual, constant_pointfive, MaxWaterFlowRateRatio, Par); + General::SolveRoot(Acc, MaxIte, SolFla, WaterFlowRatio, SimpleTowerApproachResidual, DataPrecisionGlobals::constant_pointfive, MaxWaterFlowRateRatio, Par); if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower water flow ratio during calibration"); ShowContinueError("Inlet air wet-bulb, range, and/or approach temperature does not allow calibration of water flow rate ratio " @@ -3561,36 +3499,36 @@ namespace CondenserLoopTowers { ". This is outside the valid range of " + OutputCharLo + " to " + OutputCharHi + '.'); } - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, (Twb + Ta + Tr), - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, (Twb + Ta + Tr), - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); SimpleTower(TowerNum).TowerNominalCapacity = ((rho * tmpDesignWaterFlowRate) * Cp * Tr); - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput( + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput( SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); } SimpleTower(TowerNum).FreeConvAirFlowRate = SimpleTower(TowerNum).MinimumVSAirFlowFrac * SimpleTower(TowerNum).HighSpeedAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Air Flow Rate in free convection regime [m3/s]", SimpleTower(TowerNum).FreeConvAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Air Flow Rate in free convection regime [m3/s]", SimpleTower(TowerNum).FreeConvAirFlowRate); @@ -3598,29 +3536,29 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).TowerFreeConvNomCap = SimpleTower(TowerNum).TowerNominalCapacity * SimpleTower(TowerNum).FreeConvectionCapacityFraction; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Tower capacity in free convection regime at design conditions [W]", SimpleTower(TowerNum).TowerFreeConvNomCap); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Tower capacity in free convection regime at design conditions [W]", SimpleTower(TowerNum).TowerFreeConvNomCap); } } - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { // create predefined report equipName = SimpleTower(TowerNum).Name; - PreDefTableEntry(pdchMechType, equipName, SimpleTower(TowerNum).TowerType); - PreDefTableEntry(pdchMechNomCap, equipName, SimpleTower(TowerNum).TowerNominalCapacity); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechType, equipName, SimpleTower(TowerNum).TowerType); + OutputReportPredefined::PreDefTableEntry(OutputReportPredefined::pdchMechNomCap, equipName, SimpleTower(TowerNum).TowerNominalCapacity); } // input error checking ErrorsFound = false; - if (PlantFinalSizesOkayToReport) { + if (DataPlant::PlantFinalSizesOkayToReport) { if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_SingleSpeed) { if (SimpleTower(TowerNum).DesignWaterFlowRate > 0.0) { if (SimpleTower(TowerNum).FreeConvAirFlowRate >= SimpleTower(TowerNum).HighSpeedAirFlowRate) { @@ -3675,16 +3613,6 @@ namespace CondenserLoopTowers { // MODIFIED na // RE-ENGINEERED na - // Using/Aliasing - using namespace DataSizing; - using DataPlant::PlantFinalSizesOkayToReport; - using DataPlant::PlantFirstSizesOkayToFinalize; - using DataPlant::PlantFirstSizesOkayToReport; - using DataPlant::PlantLoop; - using General::SolveRoot; - using PlantUtilities::RegisterPlantCompDesignFlow; - using ReportSizingManager::ReportSizingOutput; - // SUBROUTINE PARAMETER DEFINITIONS: int const MaxIte(500); // Maximum number of iterations Real64 const Acc(0.0001); // Accuracy of result @@ -3718,7 +3646,7 @@ namespace CondenserLoopTowers { // for warning message reporting purpose only // Find the appropriate Plant Sizing object - PltSizCondNum = PlantLoop(SimpleTower(TowerNum).LoopNum).PlantSizNum; + PltSizCondNum = DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).PlantSizNum; tmpNomTowerCap = SimpleTower(TowerNum).TowerNominalCapacity; tmpDesignWaterFlowRate = SimpleTower(TowerNum).DesignWaterFlowRate; @@ -3733,9 +3661,9 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).TowerInletCondsAutoSize) { if (PltSizCondNum > 0) { // use plant sizing data - DesTowerExitWaterTemp = PlantSizData(PltSizCondNum).ExitTemp; - DesTowerInletWaterTemp = DesTowerExitWaterTemp + PlantSizData(PltSizCondNum).DeltaT; - DesTowerWaterDeltaT = PlantSizData(PltSizCondNum).DeltaT; + DesTowerExitWaterTemp = DataSizing::PlantSizData(PltSizCondNum).ExitTemp; + DesTowerInletWaterTemp = DesTowerExitWaterTemp + DataSizing::PlantSizData(PltSizCondNum).DeltaT; + DesTowerWaterDeltaT = DataSizing::PlantSizData(PltSizCondNum).DeltaT; } else { // set default values to replace hard wired input assumptions DesTowerExitWaterTemp = SimpleTower(TowerNum).DesOutletWaterTemp; @@ -3749,27 +3677,27 @@ namespace CondenserLoopTowers { DesTowerWaterDeltaT = SimpleTower(TowerNum).DesRange; if (PltSizCondNum > 0) { // check the tower range against the plant sizing data - if (std::abs(DesTowerWaterDeltaT - PlantSizData(PltSizCondNum).DeltaT) > TolTemp) { + if (std::abs(DesTowerWaterDeltaT - DataSizing::PlantSizData(PltSizCondNum).DeltaT) > TolTemp) { ShowWarningError("Error when autosizing the load for cooling tower = " + SimpleTower(TowerNum).Name + ". Tower Design Range Temperature is different from the Design Loop Delta Temperature."); ShowContinueError("Tower Design Range Temperature specified in tower = " + SimpleTower(TowerNum).Name); ShowContinueError("is inconsistent with Design Loop Delta Temperature specified in Sizing:Plant object = " + - PlantSizData(PltSizCondNum).PlantLoopName + "."); - ShowContinueError("..The Design Range Temperature specified in tower is = " + TrimSigDigits(SimpleTower(TowerNum).DesRange, 2)); + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName + "."); + ShowContinueError("..The Design Range Temperature specified in tower is = " + General::TrimSigDigits(SimpleTower(TowerNum).DesRange, 2)); ShowContinueError("..The Design Loop Delta Temperature specified iin plant sizing data is = " + - TrimSigDigits(PlantSizData(PltSizCondNum).DeltaT, 2)); + General::TrimSigDigits(DataSizing::PlantSizData(PltSizCondNum).DeltaT, 2)); } // check if the tower approach is different from plant sizing data - DesTowerApproachFromPlant = PlantSizData(PltSizCondNum).ExitTemp - SimpleTower(TowerNum).DesInletAirWBTemp; + DesTowerApproachFromPlant = DataSizing::PlantSizData(PltSizCondNum).ExitTemp - SimpleTower(TowerNum).DesInletAirWBTemp; if (std::abs(DesTowerApproachFromPlant - SimpleTower(TowerNum).DesApproach) > TolTemp) { ShowWarningError("Error when autosizing the UA for cooling tower = " + SimpleTower(TowerNum).Name + ". Tower Design Approach Temperature is inconsistent with Approach from Plant Sizing Data."); ShowContinueError("The Design Approach Temperature from inputs specified in Sizing:Plant object = " + - PlantSizData(PltSizCondNum).PlantLoopName); + DataSizing::PlantSizData(PltSizCondNum).PlantLoopName); ShowContinueError("is inconsistent with Design Approach Temperature specified in tower = " + SimpleTower(TowerNum).Name + "."); - ShowContinueError("..The Design Approach Temperature from inputs specified is = " + TrimSigDigits(DesTowerApproachFromPlant, 2)); + ShowContinueError("..The Design Approach Temperature from inputs specified is = " + General::TrimSigDigits(DesTowerApproachFromPlant, 2)); ShowContinueError("..The Design Approach Temperature specified in tower is = " + - TrimSigDigits(SimpleTower(TowerNum).DesApproach, 2)); + General::TrimSigDigits(SimpleTower(TowerNum).DesApproach, 2)); } } } @@ -3777,30 +3705,30 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).PerformanceInputMethod_Num == PIM_NominalCapacity) { if (PltSizCondNum > 0) { // get nominal capacity from PlantSizData(PltSizCondNum)%DeltaT and PlantSizData(PltSizCondNum)%DesVolFlowRate - if (PlantSizData(PltSizCondNum).DesVolFlowRate >= SmallWaterVolFlow) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - DesTowerLoad = rho * Cp * PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT * SimpleTower(TowerNum).SizFac; + DesTowerLoad = rho * Cp * DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT * SimpleTower(TowerNum).SizFac; tmpNomTowerCap = DesTowerLoad / SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; } else { if (SimpleTower(TowerNum).TowerNominalCapacityWasAutoSized) tmpNomTowerCap = 0.0; } } else { // PltSizCondNum = 0 if (!SimpleTower(TowerNum).TowerInletCondsAutoSize) { // can use design data entered into tower object - if (SimpleTower(TowerNum).DesignWaterFlowRate >= SmallWaterVolFlow) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + if (SimpleTower(TowerNum).DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * SimpleTower(TowerNum).DesignWaterFlowRate * DesTowerWaterDeltaT * SimpleTower(TowerNum).SizFac; tmpNomTowerCap = DesTowerLoad / SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; @@ -3808,21 +3736,21 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).TowerNominalCapacityWasAutoSized) tmpNomTowerCap = 0.0; } } else { // do not have enough data to size. - if (PlantFirstSizesOkayToFinalize && SimpleTower(TowerNum).TowerNominalCapacityWasAutoSized) { + if (DataPlant::PlantFirstSizesOkayToFinalize && SimpleTower(TowerNum).TowerNominalCapacityWasAutoSized) { ShowSevereError("Autosizing error for cooling tower object = " + SimpleTower(TowerNum).Name); ShowFatalError("Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object."); } } } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (SimpleTower(TowerNum).TowerNominalCapacityWasAutoSized) { SimpleTower(TowerNum).TowerNominalCapacity = tmpNomTowerCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput( + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput( SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Nominal Capacity [W]", tmpNomTowerCap); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); @@ -3831,15 +3759,15 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).TowerNominalCapacity > 0.0 && tmpNomTowerCap > 0.0) { Real64 NomCapUser(0.0); NomCapUser = SimpleTower(TowerNum).TowerNominalCapacity; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Nominal Capacity [W]", tmpNomTowerCap, "User-Specified Nominal Capacity [W]", NomCapUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpNomTowerCap - NomCapUser) / NomCapUser) > AutoVsHardSizingThreshold) { + if ((std::abs(tmpNomTowerCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeVSMerkelTower: Potential issue with equipment sizing for " + SimpleTower(TowerNum).Name); ShowContinueError("User-Specified Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); ShowContinueError("differs from Design Size Nominal Capacity of " + General::RoundSigDigits(tmpNomTowerCap, 2) + @@ -3855,17 +3783,17 @@ namespace CondenserLoopTowers { } tmpTowerFreeConvNomCap = tmpNomTowerCap * SimpleTower(TowerNum).TowerFreeConvNomCapSizingFactor; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (SimpleTower(TowerNum).TowerFreeConvNomCapWasAutoSized) { SimpleTower(TowerNum).TowerFreeConvNomCap = tmpTowerFreeConvNomCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Free Convection Nominal Capacity [W]", SimpleTower(TowerNum).TowerFreeConvNomCap); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Free Convection Nominal Capacity [W]", SimpleTower(TowerNum).TowerFreeConvNomCap); @@ -3874,15 +3802,15 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).TowerFreeConvNomCap > 0.0 && tmpTowerFreeConvNomCap > 0.0) { Real64 NomCapUser(0.0); NomCapUser = SimpleTower(TowerNum).TowerFreeConvNomCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Free Convection Nominal Capacity [W]", tmpTowerFreeConvNomCap, "User-Specified Free Convection Nominal Capacity [W]", NomCapUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpTowerFreeConvNomCap - NomCapUser) / NomCapUser) > AutoVsHardSizingThreshold) { + if ((std::abs(tmpTowerFreeConvNomCap - NomCapUser) / NomCapUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeVSMerkelTower: Potential issue with equipment sizing for " + SimpleTower(TowerNum).Name); ShowContinueError("User-Specified Free Convection Nominal Capacity of " + General::RoundSigDigits(NomCapUser, 2) + " [W]"); @@ -3899,19 +3827,19 @@ namespace CondenserLoopTowers { } tmpDesignWaterFlowRate = tmpNomTowerCap * SimpleTower(TowerNum).DesignWaterFlowPerUnitNomCap; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (SimpleTower(TowerNum).DesignWaterFlowRateWasAutoSized) { // for nominal cap input method, get design water flow rate from nominal cap and scalable sizing factor SimpleTower(TowerNum).DesignWaterFlowRate = tmpDesignWaterFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Water Flow Rate [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Water Flow Rate [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); @@ -3921,15 +3849,15 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).DesignWaterFlowRate > 0.0 && tmpDesignWaterFlowRate > 0.0) { Real64 NomDesWaterFlowUser(0.0); NomDesWaterFlowUser = SimpleTower(TowerNum).DesignWaterFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Water Flow Rate [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate, "User-Specified Design Water Flow Rate [m3/s]", NomDesWaterFlowUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpDesignWaterFlowRate - NomDesWaterFlowUser) / NomDesWaterFlowUser) > AutoVsHardSizingThreshold) { + if ((std::abs(tmpDesignWaterFlowRate - NomDesWaterFlowUser) / NomDesWaterFlowUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeVSMerkelTower: Potential issue with equipment sizing for " + SimpleTower(TowerNum).Name); ShowContinueError("User-Specified Design Water Flow Rate of " + General::RoundSigDigits(NomDesWaterFlowUser, 2) + " [m3/s]"); @@ -3945,24 +3873,24 @@ namespace CondenserLoopTowers { } } - RegisterPlantCompDesignFlow(SimpleTower(TowerNum).WaterInletNodeNum, tmpDesignWaterFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(SimpleTower(TowerNum).WaterInletNodeNum, tmpDesignWaterFlowRate); if (SimpleTower(TowerNum).DefaultedDesignAirFlowScalingFactor) { - tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap * (101325.0 / StdBaroPress); + tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap * (101325.0 / DataEnvironment::StdBaroPress); } else { tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap; } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (SimpleTower(TowerNum).HighSpeedAirFlowRateWasAutoSized) { SimpleTower(TowerNum).HighSpeedAirFlowRate = tmpDesignAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Air Flow Rate [m3/s]", SimpleTower(TowerNum).HighSpeedAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Air Flow Rate [m3/s]", SimpleTower(TowerNum).HighSpeedAirFlowRate); @@ -3970,15 +3898,15 @@ namespace CondenserLoopTowers { } else { // Hard-sized with sizing data Real64 DesignAirFlowRateUser(0.0); DesignAirFlowRateUser = SimpleTower(TowerNum).HighSpeedAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Air Flow Rate [m3/s]", tmpDesignAirFlowRate, "User-Specified Design Air Flow Rate [m3/s]", DesignAirFlowRateUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpDesignAirFlowRate - DesignAirFlowRateUser) / DesignAirFlowRateUser) > AutoVsHardSizingThreshold) { + if ((std::abs(tmpDesignAirFlowRate - DesignAirFlowRateUser) / DesignAirFlowRateUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeVSMerkelTower: Potential issue with equipment sizing for " + SimpleTower(TowerNum).Name); ShowContinueError("User-Specified Design Air Flow Rate of " + General::RoundSigDigits(DesignAirFlowRateUser, 2) + " [m3/s]"); @@ -3994,17 +3922,17 @@ namespace CondenserLoopTowers { } tmpFreeConvAirFlowRate = tmpDesignAirFlowRate * SimpleTower(TowerNum).FreeConvAirFlowRateSizingFactor; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (SimpleTower(TowerNum).FreeConvAirFlowRateWasAutoSized) { SimpleTower(TowerNum).FreeConvAirFlowRate = tmpFreeConvAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Free Convection Regime Air Flow Rate [m3/s]", SimpleTower(TowerNum).FreeConvAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Free Convection Regime Air Flow Rate [m3/s]", SimpleTower(TowerNum).FreeConvAirFlowRate); @@ -4012,15 +3940,15 @@ namespace CondenserLoopTowers { } else { // Hard-sized with sizing data Real64 FreeConvAirFlowUser(0.0); FreeConvAirFlowUser = SimpleTower(TowerNum).FreeConvAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Free Convection Regime Air Flow Rate [m3/s]", tmpFreeConvAirFlowRate, "User-Specified Design Free Convection Regime Air Flow Rate [m3/s]", FreeConvAirFlowUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpFreeConvAirFlowRate - FreeConvAirFlowUser) / FreeConvAirFlowUser) > AutoVsHardSizingThreshold) { + if ((std::abs(tmpFreeConvAirFlowRate - FreeConvAirFlowUser) / FreeConvAirFlowUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeVSMerkelTower: Potential issue with equipment sizing for " + SimpleTower(TowerNum).Name); ShowContinueError("User-Specified Design Free Convection Regime Air Flow Rate of " + General::RoundSigDigits(FreeConvAirFlowUser, 2) + " [m3/s]"); @@ -4036,24 +3964,24 @@ namespace CondenserLoopTowers { } // now calcuate UA values from nominal capacities and flow rates - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (PltSizCondNum > 0) { // user has a plant sizing object - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); SimpleTowerInlet(TowerNum).WaterTemp = DesTowerInletWaterTemp; // PlantSizData( PltSizCondNum ).ExitTemp + PlantSizData( PltSizCondNum ).DeltaT; } else { // probably no plant sizing object - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DataGlobals::InitConvTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); SimpleTowerInlet(TowerNum).WaterTemp = DesTowerInletWaterTemp; // 35.0; // design condition } - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DataGlobals::InitConvTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); // full speed fan tower UA @@ -4067,10 +3995,10 @@ namespace CondenserLoopTowers { SimpleTowerInlet(TowerNum).AirTemp = SimpleTower(TowerNum).DesInletAirDBTemp; // 35.0; SimpleTowerInlet(TowerNum).AirWetBulb = SimpleTower(TowerNum).DesInletAirWBTemp; // 25.6; - SimpleTowerInlet(TowerNum).AirPress = StdBaroPress; + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::StdBaroPress; SimpleTowerInlet(TowerNum).AirHumRat = - PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); - SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); + Psychrometrics::PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); + General::SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower UA"); ShowFatalError("calculating cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); @@ -4079,14 +4007,14 @@ namespace CondenserLoopTowers { ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); } SimpleTower(TowerNum).HighSpeedTowerUA = UA; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); @@ -4103,10 +4031,10 @@ namespace CondenserLoopTowers { SimpleTowerInlet(TowerNum).AirTemp = SimpleTower(TowerNum).DesInletAirDBTemp; // 35.0; SimpleTowerInlet(TowerNum).AirWetBulb = SimpleTower(TowerNum).DesInletAirWBTemp; // 25.6; - SimpleTowerInlet(TowerNum).AirPress = StdBaroPress; + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::StdBaroPress; SimpleTowerInlet(TowerNum).AirHumRat = - PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); - SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); + Psychrometrics::PsyWFnTdbTwbPb(SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); + General::SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower free convection UA"); ShowFatalError("calculating cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); @@ -4115,14 +4043,14 @@ namespace CondenserLoopTowers { ShowFatalError("Autosizing of cooling tower UA failed for free convection tower " + SimpleTower(TowerNum).Name); } SimpleTower(TowerNum).FreeConvTowerUA = UA; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", SimpleTower(TowerNum).FreeConvTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", SimpleTower(TowerNum).FreeConvTowerUA); @@ -4134,18 +4062,18 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).DesignWaterFlowRateWasAutoSized) { // get from plant sizing // UA input method using plant sizing for flow rate, whereas Nominal capacity method uses scalable sizing factor per cap if (PltSizCondNum > 0) { - if (PlantSizData(PltSizCondNum).DesVolFlowRate >= SmallWaterVolFlow) { - tmpDesignWaterFlowRate = PlantSizData(PltSizCondNum).DesVolFlowRate * SimpleTower(TowerNum).SizFac; - if (PlantFirstSizesOkayToFinalize) { + if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + tmpDesignWaterFlowRate = DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * SimpleTower(TowerNum).SizFac; + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).DesignWaterFlowRate = tmpDesignWaterFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Water Flow Rate [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Water Flow Rate [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); @@ -4157,17 +4085,17 @@ namespace CondenserLoopTowers { } else { if (!SimpleTower(TowerNum).TowerInletCondsAutoSize) { - if (SimpleTower(TowerNum).DesignWaterFlowRate >= SmallWaterVolFlow) { - if (PlantFirstSizesOkayToFinalize) { + if (SimpleTower(TowerNum).DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).DesignWaterFlowRate = tmpDesignWaterFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Water Flow Rate [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Water Flow Rate [m3/s]", SimpleTower(TowerNum).DesignWaterFlowRate); @@ -4177,39 +4105,39 @@ namespace CondenserLoopTowers { tmpDesignWaterFlowRate = 0.0; } } else { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("Autosizing error for cooling tower object = " + SimpleTower(TowerNum).Name); ShowFatalError("Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object."); } } } } - RegisterPlantCompDesignFlow(SimpleTower(TowerNum).WaterInletNodeNum, tmpDesignWaterFlowRate); + PlantUtilities::RegisterPlantCompDesignFlow(SimpleTower(TowerNum).WaterInletNodeNum, tmpDesignWaterFlowRate); if (SimpleTower(TowerNum).HighSpeedTowerUAWasAutoSized) { // get nominal capacity from PlantSizData(PltSizCondNum)%DeltaT and PlantSizData(PltSizCondNum)%DesVolFlowRate if (PltSizCondNum > 0) { - if (PlantSizData(PltSizCondNum).DesVolFlowRate >= SmallWaterVolFlow) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - DesTowerLoad = rho * Cp * PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT * SimpleTower(TowerNum).SizFac; + DesTowerLoad = rho * Cp * DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT * SimpleTower(TowerNum).SizFac; tmpNomTowerCap = DesTowerLoad / SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerNominalCapacity = tmpNomTowerCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); @@ -4217,16 +4145,16 @@ namespace CondenserLoopTowers { } } else { tmpNomTowerCap = 0.0; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerNominalCapacity = tmpNomTowerCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); @@ -4235,27 +4163,27 @@ namespace CondenserLoopTowers { } } else { if (!SimpleTower(TowerNum).TowerInletCondsAutoSize) { - if (SimpleTower(TowerNum).DesignWaterFlowRate >= SmallWaterVolFlow) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + if (SimpleTower(TowerNum).DesignWaterFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); DesTowerLoad = rho * Cp * SimpleTower(TowerNum).DesignWaterFlowRate * DesTowerWaterDeltaT * SimpleTower(TowerNum).SizFac; tmpNomTowerCap = DesTowerLoad / SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerNominalCapacity = tmpNomTowerCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); @@ -4263,16 +4191,16 @@ namespace CondenserLoopTowers { } } else { tmpNomTowerCap = 0.0; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerNominalCapacity = tmpNomTowerCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); @@ -4280,7 +4208,7 @@ namespace CondenserLoopTowers { } } } else { - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("Autosizing error for cooling tower object = " + SimpleTower(TowerNum).Name); ShowFatalError("Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object."); } @@ -4288,16 +4216,16 @@ namespace CondenserLoopTowers { } if (SimpleTower(TowerNum).TowerFreeConvNomCapWasAutoSized) { tmpTowerFreeConvNomCap = tmpNomTowerCap * SimpleTower(TowerNum).TowerFreeConvNomCapSizingFactor; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerFreeConvNomCap = tmpTowerFreeConvNomCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Free Convection Nominal Capacity [W]", SimpleTower(TowerNum).TowerFreeConvNomCap); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Free Convection Nominal Capacity [W]", SimpleTower(TowerNum).TowerFreeConvNomCap); @@ -4306,20 +4234,20 @@ namespace CondenserLoopTowers { } if (SimpleTower(TowerNum).HighSpeedAirFlowRateWasAutoSized) { if (SimpleTower(TowerNum).DefaultedDesignAirFlowScalingFactor) { - tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap * (101325.0 / StdBaroPress); + tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap * (101325.0 / DataEnvironment::StdBaroPress); } else { tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap; } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).HighSpeedAirFlowRate = tmpDesignAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Air Flow Rate [m3/s]", SimpleTower(TowerNum).HighSpeedAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Air Flow Rate [m3/s]", SimpleTower(TowerNum).HighSpeedAirFlowRate); @@ -4328,16 +4256,16 @@ namespace CondenserLoopTowers { } if (SimpleTower(TowerNum).FreeConvAirFlowRateWasAutoSized) { tmpFreeConvAirFlowRate = tmpDesignAirFlowRate * SimpleTower(TowerNum).FreeConvAirFlowRateSizingFactor; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).FreeConvAirFlowRate = tmpFreeConvAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Free Convection Regime Air Flow Rate [m3/s]", SimpleTower(TowerNum).FreeConvAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Free Convection Regime Air Flow Rate [m3/s]", SimpleTower(TowerNum).FreeConvAirFlowRate); @@ -4345,14 +4273,14 @@ namespace CondenserLoopTowers { } } // now calcuate UA values from nominal capacities and flow rates - if (PlantFirstSizesOkayToFinalize) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + if (DataPlant::PlantFirstSizesOkayToFinalize) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DataGlobals::InitConvTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); // full speed fan tower UA Par(1) = tmpNomTowerCap * SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; @@ -4366,10 +4294,10 @@ namespace CondenserLoopTowers { DesTowerInletWaterTemp; // PlantSizData( PltSizCondNum ).ExitTemp + PlantSizData( PltSizCondNum ).DeltaT; SimpleTowerInlet(TowerNum).AirTemp = SimpleTower(TowerNum).DesInletAirDBTemp; // 35.0; SimpleTowerInlet(TowerNum).AirWetBulb = SimpleTower(TowerNum).DesInletAirWBTemp; // 25.6; - SimpleTowerInlet(TowerNum).AirPress = StdBaroPress; - SimpleTowerInlet(TowerNum).AirHumRat = PsyWFnTdbTwbPb( + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::StdBaroPress; + SimpleTowerInlet(TowerNum).AirHumRat = Psychrometrics::PsyWFnTdbTwbPb( SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); - SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); + General::SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower UA"); ShowFatalError("calculating cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); @@ -4378,14 +4306,14 @@ namespace CondenserLoopTowers { ShowFatalError("Autosizing of cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); } SimpleTower(TowerNum).HighSpeedTowerUA = UA; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at Full Speed Air Flow Rate [W/C]", SimpleTower(TowerNum).HighSpeedTowerUA); @@ -4402,10 +4330,10 @@ namespace CondenserLoopTowers { DesTowerInletWaterTemp; // PlantSizData( PltSizCondNum ).ExitTemp + PlantSizData( PltSizCondNum ).DeltaT; SimpleTowerInlet(TowerNum).AirTemp = DesTowerInletAirDBTemp; // 35.0; SimpleTowerInlet(TowerNum).AirWetBulb = DesTowerInletAirWBTemp; // 25.6; - SimpleTowerInlet(TowerNum).AirPress = StdBaroPress; - SimpleTowerInlet(TowerNum).AirHumRat = PsyWFnTdbTwbPb( + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::StdBaroPress; + SimpleTowerInlet(TowerNum).AirHumRat = Psychrometrics::PsyWFnTdbTwbPb( SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); - SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); + General::SolveRoot(Acc, MaxIte, SolFla, UA, SimpleTowerUAResidual, UA0, UA1, Par); if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower free convection UA"); ShowFatalError("calculating cooling tower UA failed for tower " + SimpleTower(TowerNum).Name); @@ -4414,14 +4342,14 @@ namespace CondenserLoopTowers { ShowFatalError("Autosizing of cooling tower UA failed for free convection tower " + SimpleTower(TowerNum).Name); } SimpleTower(TowerNum).LowSpeedTowerUA = UA; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", SimpleTower(TowerNum).FreeConvTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", SimpleTower(TowerNum).FreeConvTowerUA); @@ -4431,17 +4359,17 @@ namespace CondenserLoopTowers { } else { // full speed UA given if (SimpleTower(TowerNum).FreeConvTowerUAWasAutoSized) { // determine from scalable sizing factor - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).FreeConvTowerUA = SimpleTower(TowerNum).HighSpeedTowerUA * SimpleTower(TowerNum).FreeConvTowerUASizingFactor; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", SimpleTower(TowerNum).FreeConvTowerUA); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial U-Factor Times Area Value at Free Convection Air Flow Rate [W/C]", SimpleTower(TowerNum).FreeConvTowerUA); @@ -4453,27 +4381,27 @@ namespace CondenserLoopTowers { // need an air flow rate to find capacity from UA but flow rate is scaled off capacity // get nominal capacity from PlantSizData(PltSizCondNum)%DeltaT and PlantSizData(PltSizCondNum)%DesVolFlowRate if (PltSizCondNum > 0) { - if (PlantSizData(PltSizCondNum).DesVolFlowRate >= SmallWaterVolFlow) { - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + if (DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate >= DataHVACGlobals::SmallWaterVolFlow) { + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - DesTowerLoad = rho * Cp * PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT; + DesTowerLoad = rho * Cp * DataSizing::PlantSizData(PltSizCondNum).DesVolFlowRate * DesTowerWaterDeltaT; tmpNomTowerCap = DesTowerLoad / SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerNominalCapacity = tmpNomTowerCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); @@ -4481,16 +4409,16 @@ namespace CondenserLoopTowers { } } else { tmpNomTowerCap = rho = Cp = 0.0; // rho and Cp added: Used below - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerNominalCapacity = tmpNomTowerCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); @@ -4500,27 +4428,27 @@ namespace CondenserLoopTowers { } else { tmpNomTowerCap = 0.0; // Suppress uninitialized warnings - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { ShowSevereError("Autosizing error for cooling tower object = " + SimpleTower(TowerNum).Name); ShowFatalError("Autosizing of cooling tower nominal capacity requires a loop Sizing:Plant object."); } } if (SimpleTower(TowerNum).DefaultedDesignAirFlowScalingFactor) { - tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap * (101325.0 / StdBaroPress); + tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap * (101325.0 / DataEnvironment::StdBaroPress); } else { tmpDesignAirFlowRate = tmpNomTowerCap * SimpleTower(TowerNum).DesignAirFlowPerUnitNomCap; } - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).HighSpeedAirFlowRate = tmpDesignAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Air Flow Rate [m3/s]", SimpleTower(TowerNum).HighSpeedAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Air Flow Rate [m3/s]", SimpleTower(TowerNum).HighSpeedAirFlowRate); @@ -4529,21 +4457,21 @@ namespace CondenserLoopTowers { } else { // UA and Air flow rate given, so find Nominal Cap from running model - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Cp = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + Cp = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DesTowerExitWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); SimpleTowerInlet(TowerNum).WaterTemp = DesTowerInletWaterTemp; // PlantSizData( PltSizCondNum ).ExitTemp + PlantSizData( PltSizCondNum ).DeltaT; SimpleTowerInlet(TowerNum).AirTemp = DesTowerInletAirDBTemp; // 35.0; SimpleTowerInlet(TowerNum).AirWetBulb = DesTowerInletAirWBTemp; // 25.6; - SimpleTowerInlet(TowerNum).AirPress = StdBaroPress; - SimpleTowerInlet(TowerNum).AirHumRat = PsyWFnTdbTwbPb( + SimpleTowerInlet(TowerNum).AirPress = DataEnvironment::StdBaroPress; + SimpleTowerInlet(TowerNum).AirHumRat = Psychrometrics::PsyWFnTdbTwbPb( SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirWetBulb, SimpleTowerInlet(TowerNum).AirPress); SimSimpleTower(TowerNum, rho * tmpDesignWaterFlowRate, @@ -4552,16 +4480,16 @@ namespace CondenserLoopTowers { OutWaterTemp); tmpNomTowerCap = Cp * rho * tmpDesignWaterFlowRate * (SimpleTowerInlet(TowerNum).WaterTemp - OutWaterTemp); tmpNomTowerCap /= SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerNominalCapacity = tmpNomTowerCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Nominal Capacity [W]", SimpleTower(TowerNum).TowerNominalCapacity); @@ -4572,16 +4500,16 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).FreeConvAirFlowRateWasAutoSized) { tmpFreeConvAirFlowRate = tmpDesignAirFlowRate * SimpleTower(TowerNum).FreeConvAirFlowRateSizingFactor; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).FreeConvAirFlowRate = tmpFreeConvAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Free Convection Regime Air Flow Rate [m3/s]", SimpleTower(TowerNum).FreeConvAirFlowRate); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Free Convection Regime Air Flow Rate [m3/s]", SimpleTower(TowerNum).FreeConvAirFlowRate); @@ -4592,16 +4520,16 @@ namespace CondenserLoopTowers { SimSimpleTower(TowerNum, rho * tmpDesignWaterFlowRate, tmpFreeConvAirFlowRate, SimpleTower(TowerNum).FreeConvTowerUA, OutWaterTemp); tmpTowerFreeConvNomCap = Cp * rho * tmpDesignWaterFlowRate * (SimpleTowerInlet(TowerNum).WaterTemp - OutWaterTemp); tmpTowerFreeConvNomCap /= SimpleTower(TowerNum).HeatRejectCapNomCapSizingRatio; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { SimpleTower(TowerNum).TowerFreeConvNomCap = tmpTowerFreeConvNomCap; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Free Convection Nominal Capacity [W]", SimpleTower(TowerNum).TowerFreeConvNomCap); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Free Convection Nominal Capacity [W]", SimpleTower(TowerNum).TowerFreeConvNomCap); @@ -4611,16 +4539,16 @@ namespace CondenserLoopTowers { } tmpHighSpeedFanPower = tmpNomTowerCap * SimpleTower(TowerNum).DesignFanPowerPerUnitNomCap; - if (PlantFirstSizesOkayToFinalize) { + if (DataPlant::PlantFirstSizesOkayToFinalize) { if (SimpleTower(TowerNum).HighSpeedFanPowerWasAutoSized) { SimpleTower(TowerNum).HighSpeedFanPower = tmpHighSpeedFanPower; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput( + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput( SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Fan Power [W]", SimpleTower(TowerNum).HighSpeedFanPower); } - if (PlantFirstSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFirstSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Initial Design Fan Power [W]", SimpleTower(TowerNum).HighSpeedFanPower); @@ -4628,15 +4556,15 @@ namespace CondenserLoopTowers { } else { // Hard-sized with sizing data Real64 HighSpeedFanPowerUser(0.0); HighSpeedFanPowerUser = SimpleTower(TowerNum).HighSpeedAirFlowRate; - if (PlantFinalSizesOkayToReport) { - ReportSizingOutput(SimpleTower(TowerNum).TowerType, + if (DataPlant::PlantFinalSizesOkayToReport) { + ReportSizingManager::ReportSizingOutput(SimpleTower(TowerNum).TowerType, SimpleTower(TowerNum).Name, "Design Fan Power [W]", tmpHighSpeedFanPower, "User-Specified Design Fan Power [W]", HighSpeedFanPowerUser); if (DataGlobals::DisplayExtraWarnings) { - if ((std::abs(tmpHighSpeedFanPower - HighSpeedFanPowerUser) / HighSpeedFanPowerUser) > AutoVsHardSizingThreshold) { + if ((std::abs(tmpHighSpeedFanPower - HighSpeedFanPowerUser) / HighSpeedFanPowerUser) > DataSizing::AutoVsHardSizingThreshold) { ShowMessage("SizeVSMerkelTower: Potential issue with equipment sizing for " + SimpleTower(TowerNum).Name); ShowContinueError("User-Specified Design Fan Power of " + General::RoundSigDigits(HighSpeedFanPowerUser, 2) + " [W]"); ShowContinueError("differs from Design Fan Power of " + General::RoundSigDigits(tmpHighSpeedFanPower, 2) + " [W]"); @@ -4715,17 +4643,6 @@ namespace CondenserLoopTowers { // REFERENCES: // ASHRAE HVAC1KIT: A Toolkit for Primary HVAC System Energy Calculation. 1999. - // Using/Aliasing - using DataBranchAirLoopPlant::MassFlowTolerance; - using DataGlobals::DoingSizing; - using DataGlobals::KickOffSimulation; - using DataGlobals::WarmupFlag; - using DataPlant::DualSetPointDeadBand; - using DataPlant::PlantLoop; - using DataPlant::SingleSetPoint; - using FaultsManager::FaultsCondenserSWTSensor; - using FaultsManager::FaultsTowerFouling; - // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalcSingleSpeedTower"); int const MaxIteration(100); // Maximum fluid bypass iteration calculations @@ -4772,7 +4689,7 @@ namespace CondenserLoopTowers { WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; Qactual = 0.0; CTFanPower = 0.0; - OutletWaterTemp = Node(WaterInletNode).Temp; + OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; LoopNum = SimpleTower(TowerNum).LoopNum; LoopSideNum = SimpleTower(TowerNum).LoopSideNum; @@ -4781,41 +4698,41 @@ namespace CondenserLoopTowers { // water temperature setpoint { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = Node(WaterOutletNode).TempSetPoint; + TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPoint; } else { - TempSetPoint = PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; + TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; } - } else if (SELECT_CASE_var == DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = Node(WaterOutletNode).TempSetPointHi; + TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPointHi; } else { - TempSetPoint = PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; + TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; } } } // If there is a fault of condenser SWT Sensor (zrp_Jul2016) - if (SimpleTower(TowerNum).FaultyCondenserSWTFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { + if (SimpleTower(TowerNum).FaultyCondenserSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = SimpleTower(TowerNum).FaultyCondenserSWTIndex; Real64 TowerOutletTemp_ff = TempSetPoint; // calculate the sensor offset using fault information - SimpleTower(TowerNum).FaultyCondenserSWTOffset = FaultsCondenserSWTSensor(FaultIndex).CalFaultOffsetAct(); + SimpleTower(TowerNum).FaultyCondenserSWTOffset = FaultsManager::FaultsCondenserSWTSensor(FaultIndex).CalFaultOffsetAct(); // update the TempSetPoint TempSetPoint = TowerOutletTemp_ff - SimpleTower(TowerNum).FaultyCondenserSWTOffset; } // If there is a fault of cooling tower fouling (zrp_Jul2016) - if (SimpleTower(TowerNum).FaultyTowerFoulingFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { + if (SimpleTower(TowerNum).FaultyTowerFoulingFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = SimpleTower(TowerNum).FaultyTowerFoulingIndex; Real64 FreeConvTowerUA_ff = SimpleTower(TowerNum).FreeConvTowerUA; Real64 HighSpeedTowerUA_ff = SimpleTower(TowerNum).HighSpeedTowerUA; // calculate the Faulty Tower Fouling Factor using fault information - SimpleTower(TowerNum).FaultyTowerFoulingFactor = FaultsTowerFouling(FaultIndex).CalFaultyTowerFoulingFactor(); + SimpleTower(TowerNum).FaultyTowerFoulingFactor = FaultsManager::FaultsTowerFouling(FaultIndex).CalFaultyTowerFoulingFactor(); // update the tower UA values at faulty cases FreeConvTowerUA = FreeConvTowerUA_ff * SimpleTower(TowerNum).FaultyTowerFoulingFactor; @@ -4857,7 +4774,7 @@ namespace CondenserLoopTowers { // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. // MassFlowTolerance is a parameter to indicate a no flow condition - if (WaterMassFlowRate <= MassFlowTolerance) { + if (WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { // for multiple cells, we assume that it's a common basin CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, @@ -4875,7 +4792,7 @@ namespace CondenserLoopTowers { UAdesign = FreeConvTowerUA / SimpleTower(TowerNum).NumCell; AirFlowRate = SimpleTower(TowerNum).FreeConvAirFlowRate / SimpleTower(TowerNum).NumCell; DesignWaterFlowRate = SimpleTower(TowerNum).DesignWaterFlowRate; - OutletWaterTempOFF = Node(WaterInletNode).Temp; + OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp; OutletWaterTemp = OutletWaterTempOFF; FanModeFrac = 0.0; @@ -5001,12 +4918,12 @@ namespace CondenserLoopTowers { // output the number of cells operating SimpleTower(TowerNum).NumCellOn = NumCellOn; // Should this be water inlet node num????? - CpWater = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, - Node(WaterInletNode).Temp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + DataLoopNode::Node(WaterInletNode).Temp, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Qactual = WaterMassFlowRate * CpWater * (Node(WaterInletNode).Temp - OutletWaterTemp); + Qactual = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); AirFlowRateRatio = (AirFlowRate * SimpleTower(TowerNum).NumCell) / SimpleTower(TowerNum).HighSpeedAirFlowRate; } @@ -5076,17 +4993,6 @@ namespace CondenserLoopTowers { // REFERENCES: // ASHRAE HVAC1KIT: A Toolkit for Primary HVAC System Energy Calculation. 1999. - // Using/Aliasing - using DataBranchAirLoopPlant::MassFlowTolerance; - using DataGlobals::DoingSizing; - using DataGlobals::KickOffSimulation; - using DataGlobals::WarmupFlag; - using DataPlant::DualSetPointDeadBand; - using DataPlant::PlantLoop; - using DataPlant::SingleSetPoint; - using FaultsManager::FaultsCondenserSWTSensor; - using FaultsManager::FaultsTowerFouling; - // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalcTwoSpeedTower"); @@ -5123,7 +5029,7 @@ namespace CondenserLoopTowers { WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; Qactual = 0.0; CTFanPower = 0.0; - OutletWaterTemp = Node(WaterInletNode).Temp; + OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; LoopNum = SimpleTower(TowerNum).LoopNum; LoopSideNum = SimpleTower(TowerNum).LoopSideNum; @@ -5132,41 +5038,41 @@ namespace CondenserLoopTowers { // water temperature setpoint { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = Node(WaterOutletNode).TempSetPoint; + TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPoint; } else { - TempSetPoint = PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; + TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; } - } else if (SELECT_CASE_var == DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = Node(WaterOutletNode).TempSetPointHi; + TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPointHi; } else { - TempSetPoint = PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; + TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; } } } // If there is a fault of condenser SWT Sensor (zrp_Jul2016) - if (SimpleTower(TowerNum).FaultyCondenserSWTFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { + if (SimpleTower(TowerNum).FaultyCondenserSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = SimpleTower(TowerNum).FaultyCondenserSWTIndex; Real64 TowerOutletTemp_ff = TempSetPoint; // calculate the sensor offset using fault information - SimpleTower(TowerNum).FaultyCondenserSWTOffset = FaultsCondenserSWTSensor(FaultIndex).CalFaultOffsetAct(); + SimpleTower(TowerNum).FaultyCondenserSWTOffset = FaultsManager::FaultsCondenserSWTSensor(FaultIndex).CalFaultOffsetAct(); // update the TempSetPoint TempSetPoint = TowerOutletTemp_ff - SimpleTower(TowerNum).FaultyCondenserSWTOffset; } // If there is a fault of cooling tower fouling (zrp_Jul2016) - if (SimpleTower(TowerNum).FaultyTowerFoulingFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { + if (SimpleTower(TowerNum).FaultyTowerFoulingFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = SimpleTower(TowerNum).FaultyTowerFoulingIndex; Real64 FreeConvTowerUA_ff = SimpleTower(TowerNum).FreeConvTowerUA; Real64 HighSpeedTowerUA_ff = SimpleTower(TowerNum).HighSpeedTowerUA; // calculate the Faulty Tower Fouling Factor using fault information - SimpleTower(TowerNum).FaultyTowerFoulingFactor = FaultsTowerFouling(FaultIndex).CalFaultyTowerFoulingFactor(); + SimpleTower(TowerNum).FaultyTowerFoulingFactor = FaultsManager::FaultsTowerFouling(FaultIndex).CalFaultyTowerFoulingFactor(); // update the tower UA values at faulty cases FreeConvTowerUA = FreeConvTowerUA_ff * SimpleTower(TowerNum).FaultyTowerFoulingFactor; @@ -5174,9 +5080,9 @@ namespace CondenserLoopTowers { } // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. - if (PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; + if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; // MassFlowTolerance is a parameter to indicate a no flow condition - if (WaterMassFlowRate <= MassFlowTolerance) { + if (WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, @@ -5218,8 +5124,8 @@ namespace CondenserLoopTowers { UAdesign = FreeConvTowerUA / SimpleTower(TowerNum).NumCell; // where is NumCellOn? AirFlowRate = SimpleTower(TowerNum).FreeConvAirFlowRate / SimpleTower(TowerNum).NumCell; DesignWaterFlowRate = SimpleTower(TowerNum).DesignWaterFlowRate; // ??useless subroutine variable?? - OutletWaterTempOFF = Node(WaterInletNode).Temp; - WaterMassFlowRate = Node(WaterInletNode).MassFlowRate; + OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp; + WaterMassFlowRate = DataLoopNode::Node(WaterInletNode).MassFlowRate; OutletWaterTemp1stStage = OutletWaterTemp; OutletWaterTemp2ndStage = OutletWaterTemp; FanModeFrac = 0.0; @@ -5282,11 +5188,11 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).SpeedSelected = SpeedSel; SimpleTower(TowerNum).NumCellOn = NumCellOn; - CpWater = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, - Node(WaterInletNode).Temp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + DataLoopNode::Node(WaterInletNode).Temp, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Qactual = WaterMassFlowRate * CpWater * (Node(WaterInletNode).Temp - OutletWaterTemp); + Qactual = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); AirFlowRateRatio = (AirFlowRate * SimpleTower(TowerNum).NumCell) / SimpleTower(TowerNum).HighSpeedAirFlowRate; } @@ -5306,19 +5212,6 @@ namespace CondenserLoopTowers { // METHODOLOGY EMPLOYED: // Find a fan speed that operates the tower to meet MyLoad - // Using/Aliasing - using CurveManager::CurveValue; - using DataBranchAirLoopPlant::MassFlowTolerance; - using DataGlobals::DoingSizing; - using DataGlobals::KickOffSimulation; - using DataGlobals::WarmupFlag; - using DataPlant::DualSetPointDeadBand; - using DataPlant::SingleSetPoint; - using FaultsManager::FaultsCondenserSWTSensor; - using FaultsManager::FaultsTowerFouling; - using General::RoundSigDigits; - using General::SolveRoot; - // SUBROUTINE PARAMETER DEFINITIONS: Real64 const DesignWetBulb(25.56); // tower outdoor air entering wetbulb for design [C] int const MaxIte(500); // Maximum number of iterations for solver @@ -5353,14 +5246,14 @@ namespace CondenserLoopTowers { Real64 FanPowerAdjustFac; WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; - CpWater = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, - Node(WaterInletNode).Temp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + DataLoopNode::Node(WaterInletNode).Temp, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; Qactual = 0.0; CTFanPower = 0.0; - OutletWaterTemp = Node(WaterInletNode).Temp; + OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; LoopNum = SimpleTower(TowerNum).LoopNum; LoopSideNum = SimpleTower(TowerNum).LoopSideNum; @@ -5369,41 +5262,41 @@ namespace CondenserLoopTowers { // water temperature setpoint { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { + auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = Node(WaterOutletNode).TempSetPoint; + TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPoint; } else { - TempSetPoint = PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; + TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; } - } else if (SELECT_CASE_var == DualSetPointDeadBand) { + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = Node(WaterOutletNode).TempSetPointHi; + TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPointHi; } else { - TempSetPoint = PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; + TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; } } } // If there is a fault of condenser SWT Sensor (zrp_Jul2016) - if (SimpleTower(TowerNum).FaultyCondenserSWTFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { + if (SimpleTower(TowerNum).FaultyCondenserSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = SimpleTower(TowerNum).FaultyCondenserSWTIndex; Real64 TowerOutletTemp_ff = TempSetPoint; // calculate the sensor offset using fault information - SimpleTower(TowerNum).FaultyCondenserSWTOffset = FaultsCondenserSWTSensor(FaultIndex).CalFaultOffsetAct(); + SimpleTower(TowerNum).FaultyCondenserSWTOffset = FaultsManager::FaultsCondenserSWTSensor(FaultIndex).CalFaultOffsetAct(); // update the TempSetPoint TempSetPoint = TowerOutletTemp_ff - SimpleTower(TowerNum).FaultyCondenserSWTOffset; } // If there is a fault of cooling tower fouling (zrp_Jul2016) - if (SimpleTower(TowerNum).FaultyTowerFoulingFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { + if (SimpleTower(TowerNum).FaultyTowerFoulingFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = SimpleTower(TowerNum).FaultyTowerFoulingIndex; Real64 FreeConvTowerUA_ff = SimpleTower(TowerNum).FreeConvTowerUA; Real64 HighSpeedTowerUA_ff = SimpleTower(TowerNum).HighSpeedTowerUA; // calculate the Faulty Tower Fouling Factor using fault information - SimpleTower(TowerNum).FaultyTowerFoulingFactor = FaultsTowerFouling(FaultIndex).CalFaultyTowerFoulingFactor(); + SimpleTower(TowerNum).FaultyTowerFoulingFactor = FaultsManager::FaultsTowerFouling(FaultIndex).CalFaultyTowerFoulingFactor(); // update the tower UA values at faulty cases FreeConvTowerUA = FreeConvTowerUA_ff * SimpleTower(TowerNum).FaultyTowerFoulingFactor; @@ -5435,7 +5328,7 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).NumCellOn = NumCellOn; WaterMassFlowRatePerCell = WaterMassFlowRate / NumCellOn; // MassFlowTolerance is a parameter to indicate a no flow condition - if (WaterMassFlowRate <= MassFlowTolerance || (MyLoad > SmallLoad)) { + if (WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || (MyLoad > DataHVACGlobals::SmallLoad)) { // for multiple cells, we assume that it's a common bassin CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, @@ -5444,9 +5337,9 @@ namespace CondenserLoopTowers { return; } - if (std::abs(MyLoad) <= SmallLoad) { + if (std::abs(MyLoad) <= DataHVACGlobals::SmallLoad) { // tower doesn't need to do anything - OutletWaterTemp = Node(WaterInletNode).Temp; + OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; CTFanPower = 0.0; AirFlowRateRatio = 0.0; Qactual = 0.0; @@ -5460,11 +5353,11 @@ namespace CondenserLoopTowers { // first find free convection cooling rate UAdesignPerCell = FreeConvTowerUA / SimpleTower(TowerNum).NumCell; AirFlowRatePerCell = SimpleTower(TowerNum).FreeConvAirFlowRate / SimpleTower(TowerNum).NumCell; - OutletWaterTempOFF = Node(WaterInletNode).Temp; - WaterMassFlowRate = Node(WaterInletNode).MassFlowRate; + OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp; + WaterMassFlowRate = DataLoopNode::Node(WaterInletNode).MassFlowRate; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAdesignPerCell, OutletWaterTempOFF); - FreeConvQdot = WaterMassFlowRate * CpWater * (Node(WaterInletNode).Temp - OutletWaterTempOFF); + FreeConvQdot = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTempOFF); CTFanPower = 0.0; if (std::abs(MyLoad) <= FreeConvQdot) { // can meet load with free convection and fan off @@ -5485,16 +5378,16 @@ namespace CondenserLoopTowers { AirFlowRatePerCell = SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; AirFlowRateRatio = 1.0; WaterFlowRateRatio = WaterMassFlowRatePerCell / SimpleTower(TowerNum).DesWaterMassFlowRatePerCell; - UAwetbulbAdjFac = CurveValue(SimpleTower(TowerNum).UAModFuncWetBulbDiffCurvePtr, (DesignWetBulb - SimpleTowerInlet(TowerNum).AirWetBulb)); - UAairflowAdjFac = CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); - UAwaterflowAdjFac = CurveValue(SimpleTower(TowerNum).UAModFuncWaterFlowRatioCurvePtr, WaterFlowRateRatio); + UAwetbulbAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncWetBulbDiffCurvePtr, (DesignWetBulb - SimpleTowerInlet(TowerNum).AirWetBulb)); + UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); + UAwaterflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncWaterFlowRatioCurvePtr, WaterFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTemp); - FullSpeedFanQdot = WaterMassFlowRate * CpWater * (Node(WaterInletNode).Temp - OutletWaterTemp); + FullSpeedFanQdot = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); if (FullSpeedFanQdot <= std::abs(MyLoad)) { // full speed is what we want. - if ((FullSpeedFanQdot + SmallLoad) < std::abs(MyLoad) && (NumCellOn < SimpleTower(TowerNum).NumCell) && + if ((FullSpeedFanQdot + DataHVACGlobals::SmallLoad) < std::abs(MyLoad) && (NumCellOn < SimpleTower(TowerNum).NumCell) && ((WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin)) { // If full fan and not meeting setpoint, then increase number of cells until all are used or load is satisfied IncrNumCellFlag = true; // set value to true to enter in the loop @@ -5503,17 +5396,17 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).NumCellOn = NumCellOn; WaterMassFlowRatePerCell = WaterMassFlowRate / NumCellOn; WaterFlowRateRatio = WaterMassFlowRatePerCell / SimpleTower(TowerNum).DesWaterMassFlowRatePerCell; - UAwaterflowAdjFac = CurveValue(SimpleTower(TowerNum).UAModFuncWaterFlowRatioCurvePtr, WaterFlowRateRatio); + UAwaterflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncWaterFlowRatioCurvePtr, WaterFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTemp); - if ((FullSpeedFanQdot + SmallLoad) < std::abs(MyLoad) && (NumCellOn < SimpleTower(TowerNum).NumCell) && + if ((FullSpeedFanQdot + DataHVACGlobals::SmallLoad) < std::abs(MyLoad) && (NumCellOn < SimpleTower(TowerNum).NumCell) && ((WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin)) { IncrNumCellFlag = true; } else { IncrNumCellFlag = false; } } - FullSpeedFanQdot = WaterMassFlowRate * CpWater * (Node(WaterInletNode).Temp - OutletWaterTemp); + FullSpeedFanQdot = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); } Qactual = FullSpeedFanQdot; CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, @@ -5521,7 +5414,7 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).BasinHeaterSetPointTemp, BasinHeaterPower); // now calculate fan power - FanPowerAdjustFac = CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); + FanPowerAdjustFac = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * FanPowerAdjustFac * NumCellOn / SimpleTower(TowerNum).NumCell; return; @@ -5530,10 +5423,10 @@ namespace CondenserLoopTowers { // next find minimum air flow ratio cooling rate AirFlowRateRatio = SimpleTower(TowerNum).MinimumVSAirFlowFrac; AirFlowRatePerCell = AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; - UAairflowAdjFac = CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); + UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTemp); - MinSpeedFanQdot = WaterMassFlowRate * CpWater * (Node(WaterInletNode).Temp - OutletWaterTemp); + MinSpeedFanQdot = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); if (std::abs(MyLoad) <= MinSpeedFanQdot) { // min fan speed already exceeds load) Qactual = MinSpeedFanQdot; @@ -5542,7 +5435,7 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).BasinHeaterSetPointTemp, BasinHeaterPower); // now calculate fan power - FanPowerAdjustFac = CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); + FanPowerAdjustFac = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * FanPowerAdjustFac * NumCellOn / SimpleTower(TowerNum).NumCell; return; } @@ -5559,17 +5452,17 @@ namespace CondenserLoopTowers { Par(7) = CpWater; Par(8) = WaterMassFlowRate; - SolveRoot(Acc, MaxIte, SolFla, AirFlowRateRatio, VSMerkelResidual, SimpleTower(TowerNum).MinimumVSAirFlowFrac, 1.0, Par); + General::SolveRoot(Acc, MaxIte, SolFla, AirFlowRateRatio, VSMerkelResidual, SimpleTower(TowerNum).MinimumVSAirFlowFrac, 1.0, Par); if (SolFla == -1) { - if (!WarmupFlag) { + if (!DataGlobals::WarmupFlag) { if (SimpleTower(TowerNum).VSMerkelAFRErrorIter < 1) { ++SimpleTower(TowerNum).VSMerkelAFRErrorIter; ShowWarningError(cCoolingTower_VariableSpeedMerkel + " - Iteration limit exceeded calculating variable speed fan ratio for unit = " + SimpleTower(TowerNum).Name); ShowContinueError("Estimated air flow ratio = " + - RoundSigDigits((std::abs(MyLoad) - MinSpeedFanQdot) / (FullSpeedFanQdot - MinSpeedFanQdot), 4)); - ShowContinueError("Calculated air flow ratio = " + RoundSigDigits(AirFlowRateRatio, 4)); + General::RoundSigDigits((std::abs(MyLoad) - MinSpeedFanQdot) / (FullSpeedFanQdot - MinSpeedFanQdot), 4)); + ShowContinueError("Calculated air flow ratio = " + General::RoundSigDigits(AirFlowRateRatio, 4)); ShowContinueErrorTimeStamp("The calculated air flow ratio will be used and the simulation continues. Occurrence info:"); } ShowRecurringWarningErrorAtEnd( @@ -5581,12 +5474,12 @@ namespace CondenserLoopTowers { } } else if (SolFla == -2) { AirFlowRateRatio = (std::abs(MyLoad) - MinSpeedFanQdot) / (FullSpeedFanQdot - MinSpeedFanQdot); - if (!WarmupFlag) { + if (!DataGlobals::WarmupFlag) { if (SimpleTower(TowerNum).VSMerkelAFRErrorFail < 1) { ++SimpleTower(TowerNum).VSMerkelAFRErrorFail; ShowWarningError(cCoolingTower_VariableSpeedMerkel + " - solver failed calculating variable speed fan ratio for unit = " + SimpleTower(TowerNum).Name); - ShowContinueError("Estimated air flow ratio = " + RoundSigDigits(AirFlowRateRatio, 4)); + ShowContinueError("Estimated air flow ratio = " + General::RoundSigDigits(AirFlowRateRatio, 4)); ShowContinueErrorTimeStamp("The estimated air flow ratio will be used and the simulation continues. Occurrence info:"); } ShowRecurringWarningErrorAtEnd( @@ -5601,18 +5494,18 @@ namespace CondenserLoopTowers { // now rerun to get peformance with AirFlowRateRatio AirFlowRatePerCell = AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; - UAairflowAdjFac = CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); + UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTemp); - Qactual = WaterMassFlowRate * CpWater * (Node(WaterInletNode).Temp - OutletWaterTemp); + Qactual = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, BasinHeaterPower); // now calculate fan power - FanPowerAdjustFac = CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); + FanPowerAdjustFac = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * FanPowerAdjustFac * NumCellOn / SimpleTower(TowerNum).NumCell; } } @@ -5628,9 +5521,6 @@ namespace CondenserLoopTowers { // MODIFIED na // RE-ENGINEERED na - // Using/Aliasing - using CurveManager::CurveValue; - // Return value Real64 Residuum; // residual to be minimized to zero @@ -5670,12 +5560,12 @@ namespace CondenserLoopTowers { AirFlowRatePerCell = AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; - UAairflowAdjFac = CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); + UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTempTrial); - Qdot = TotalWaterMassFlowRate * CpWater * (Node(SimpleTower(TowerNum).WaterInletNodeNum).Temp - OutletWaterTempTrial); + Qdot = TotalWaterMassFlowRate * CpWater * (DataLoopNode::Node(SimpleTower(TowerNum).WaterInletNodeNum).Temp - OutletWaterTempTrial); Residuum = std::abs(TargetLoad) - Qdot; @@ -5729,22 +5619,6 @@ namespace CondenserLoopTowers { // York International Corporation, "YORKcalcTM Software, Chiller-Plant Energy-Estimating Program", // Form 160.00-SG2 (0502). 2002. - // Using/Aliasing - using CurveManager::CurveValue; - using DataBranchAirLoopPlant::MassFlowTolerance; - using DataEnvironment::CurMnDy; - using DataEnvironment::EnvironmentName; - using DataGlobals::CurrentTime; - using DataGlobals::DoingSizing; - using DataGlobals::KickOffSimulation; - using DataGlobals::WarmupFlag; - using DataPlant::DualSetPointDeadBand; - using DataPlant::PlantLoop; - using DataPlant::SingleSetPoint; - using FaultsManager::FaultsCondenserSWTSensor; - using General::CreateSysTimeIntervalString; - using General::SolveRoot; - // SUBROUTINE PARAMETER DEFINITIONS: static ObjexxFCL::gio::Fmt OutputFormat("(F5.2)"); static ObjexxFCL::gio::Fmt OutputFormat2("(F8.5)"); @@ -5826,7 +5700,7 @@ namespace CondenserLoopTowers { WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; Qactual = 0.0; CTFanPower = 0.0; - OutletWaterTemp = Node(WaterInletNode).Temp; + OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; WaterUsage = 0.0; Twb = SimpleTowerInlet(TowerNum).AirWetBulb; @@ -5836,34 +5710,34 @@ namespace CondenserLoopTowers { // water temperature setpoint { - auto const SELECT_CASE_var(PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { - TempSetPoint = PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DualSetPointDeadBand) { - TempSetPoint = PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; + auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; } else { assert(false); } } // If there is a fault of condenser SWT Sensor (zrp_Jul2016) - if (SimpleTower(TowerNum).FaultyCondenserSWTFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { + if (SimpleTower(TowerNum).FaultyCondenserSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = SimpleTower(TowerNum).FaultyCondenserSWTIndex; Real64 TowerOutletTemp_ff = TempSetPoint; // calculate the sensor offset using fault information - SimpleTower(TowerNum).FaultyCondenserSWTOffset = FaultsCondenserSWTSensor(FaultIndex).CalFaultOffsetAct(); + SimpleTower(TowerNum).FaultyCondenserSWTOffset = FaultsManager::FaultsCondenserSWTSensor(FaultIndex).CalFaultOffsetAct(); // update the TempSetPoint TempSetPoint = TowerOutletTemp_ff - SimpleTower(TowerNum).FaultyCondenserSWTOffset; } - Tr = Node(WaterInletNode).Temp - TempSetPoint; + Tr = DataLoopNode::Node(WaterInletNode).Temp - TempSetPoint; Ta = TempSetPoint - SimpleTowerInlet(TowerNum).AirWetBulb; // Do not RETURN here if flow rate is less than MassFlowTolerance. Check basin heater and then RETURN. - if (PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; + if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; // MassFlowTolerance is a parameter to indicate a no flow condition - if (WaterMassFlowRate <= MassFlowTolerance) { + if (WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, @@ -5876,9 +5750,9 @@ namespace CondenserLoopTowers { while (IncrNumCellFlag) { IncrNumCellFlag = false; // Initialize inlet node water properties - WaterDensity = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, - Node(WaterInletNode).Temp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + WaterDensity = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + DataLoopNode::Node(WaterInletNode).Temp, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); WaterFlowRateRatio = WaterMassFlowRatePerCell / (WaterDensity * SimpleTower(TowerNum).CalibratedWaterFlowRate / SimpleTower(TowerNum).NumCell); @@ -5891,8 +5765,8 @@ namespace CondenserLoopTowers { // regime specified by the user AirFlowRateRatio = 1.0; - OutletWaterTempOFF = Node(WaterInletNode).Temp; - OutletWaterTempON = Node(WaterInletNode).Temp; + OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp; + OutletWaterTempON = DataLoopNode::Node(WaterInletNode).Temp; OutletWaterTemp = OutletWaterTempOFF; FreeConvectionCapFrac = SimpleTower(TowerNum).FreeConvectionCapacityFraction; @@ -5915,7 +5789,7 @@ namespace CondenserLoopTowers { // find the correct air ratio only if full flow is too much if (OutletWaterTempON < TempSetPoint) { // outlet water temperature is calculated in the free convection regime - OutletWaterTempOFF = Node(WaterInletNode).Temp - FreeConvectionCapFrac * (Node(WaterInletNode).Temp - OutletWaterTempON); + OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp - FreeConvectionCapFrac * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTempON); // fan is OFF FanCyclingRatio = 0.0; // air flow ratio is assumed to be the fraction of tower capacity in the free convection regime (fan is OFF but air is flowing) @@ -5936,7 +5810,7 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).FanPowerfAirFlowCurve == 0) { CTFanPower = pow_3(AirFlowRateRatio) * SimpleTower(TowerNum).HighSpeedFanPower * NumCellOn / SimpleTower(TowerNum).NumCell; } else { - FanCurveValue = CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); + FanCurveValue = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); CTFanPower = max(0.0, (SimpleTower(TowerNum).HighSpeedFanPower * FanCurveValue)) * NumCellOn / SimpleTower(TowerNum).NumCell; } // fan is cycling ON and OFF at the minimum fan speed. Adjust fan power and air flow rate ratio according to cycling rate @@ -5965,15 +5839,15 @@ namespace CondenserLoopTowers { Par(5) = Ta; // desired approach temperature [C] Par(6) = 1.0; // calculate the air flow rate ratio required for a balance - SolveRoot( + General::SolveRoot( Acc, MaxIte, SolFla, AirFlowRateRatio, SimpleTowerApproachResidual, SimpleTower(TowerNum).MinimumVSAirFlowFrac, 1.0, Par); if (SolFla == -1) { - if (!WarmupFlag) + if (!DataGlobals::WarmupFlag) ShowWarningError("Cooling tower iteration limit exceeded when calculating air flow rate ratio for tower " + SimpleTower(TowerNum).Name); // IF RegulaFalsi cannot find a solution then provide detailed output for debugging } else if (SolFla == -2) { - if (!WarmupFlag) { + if (!DataGlobals::WarmupFlag) { ObjexxFCL::gio::write(OutputChar, OutputFormat) << TwbCapped; ObjexxFCL::gio::write(OutputChar2, OutputFormat) << Tr; ObjexxFCL::gio::write(OutputChar3, OutputFormat) << Ta; @@ -6000,7 +5874,7 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).FanPowerfAirFlowCurve == 0) { CTFanPower = pow_3(AirFlowRateRatio) * SimpleTower(TowerNum).HighSpeedFanPower * NumCellOn / SimpleTower(TowerNum).NumCell; } else { - FanCurveValue = CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); + FanCurveValue = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); CTFanPower = max(0.0, (SimpleTower(TowerNum).HighSpeedFanPower * FanCurveValue)) * NumCellOn / SimpleTower(TowerNum).NumCell; } // outlet water temperature is calculated as the inlet air wet-bulb temperature plus tower approach temperature @@ -6010,26 +5884,26 @@ namespace CondenserLoopTowers { } // IF(OutletWaterTempOFF .GT. TempSetPoint)THEN } // IF(OutletWaterTempON .LT. TempSetPoint) ie if tower should not run at full capacity - CpWater = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, - Node(SimpleTower(TowerNum).WaterInletNodeNum).Temp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + DataLoopNode::Node(SimpleTower(TowerNum).WaterInletNodeNum).Temp, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Qactual = WaterMassFlowRate * CpWater * (Node(WaterInletNode).Temp - OutletWaterTemp); + Qactual = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); SimpleTower(TowerNum).NumCellOn = NumCellOn; // Set water and air properties - AirDensity = PsyRhoAirFnPbTdbW(SimpleTowerInlet(TowerNum).AirPress, SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirHumRat); + AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(SimpleTowerInlet(TowerNum).AirPress, SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirHumRat); AirMassFlowRate = AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate * AirDensity * SimpleTower(TowerNum).NumCellOn / SimpleTower(TowerNum).NumCell; - InletAirEnthalpy = PsyHFnTdbRhPb(SimpleTowerInlet(TowerNum).AirWetBulb, 1.0, SimpleTowerInlet(TowerNum).AirPress); + InletAirEnthalpy = Psychrometrics::PsyHFnTdbRhPb(SimpleTowerInlet(TowerNum).AirWetBulb, 1.0, SimpleTowerInlet(TowerNum).AirPress); // calculate end time of current time step - CurrentEndTime = CurrentTime + SysTimeElapsed; + CurrentEndTime = DataGlobals::CurrentTime + DataHVACGlobals::SysTimeElapsed; // Print warning messages only when valid and only for the first ocurrance. Let summary provide statistics. // Wait for next time step to print warnings. If simulation iterates, print out // the warning for the last iteration only. Must wait for next time step to accomplish this. // If a warning occurs and the simulation down shifts, the warning is not valid. - if (CurrentEndTime > CurrentEndTimeLast && TimeStepSys >= TimeStepSysLast) { + if (CurrentEndTime > CurrentEndTimeLast && DataHVACGlobals::TimeStepSys >= TimeStepSysLast) { if (VSTower(SimpleTower(TowerNum).VSTower).PrintLGMessage) { ++VSTower(SimpleTower(TowerNum).VSTower).VSErrorCountFlowFrac; // Show single warning and pass additional info to ShowRecurringWarningErrorAtEnd @@ -6047,7 +5921,7 @@ namespace CondenserLoopTowers { } // save last system time step and last end time of current time step (used to determine if warning is valid) - TimeStepSysLast = TimeStepSys; + TimeStepSysLast = DataHVACGlobals::TimeStepSys; CurrentEndTimeLast = CurrentEndTime; // warn user on first occurrence if flow fraction is greater than maximum for the YorkCalc model, use recurring warning stats @@ -6059,15 +5933,15 @@ namespace CondenserLoopTowers { // Flow fractions greater than a MaxLiquidToGasRatio of 8 are not reliable using the YorkCalc model if (FlowFraction > VSTower(SimpleTower(TowerNum).VSTower).MaxLiquidToGasRatio) { // Report warnings only during actual simulation - if (!WarmupFlag) { + if (!DataGlobals::WarmupFlag) { VSTower(SimpleTower(TowerNum).VSTower).PrintLGMessage = true; ObjexxFCL::gio::write(OutputChar, OutputFormat) << FlowFraction; ObjexxFCL::gio::write(OutputChar2, OutputFormat) << VSTower(SimpleTower(TowerNum).VSTower).MaxLiquidToGasRatio; VSTower(SimpleTower(TowerNum).VSTower).LGBuffer1 = SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\" - Liquid to gas ratio (L/G) is out of range at " + OutputChar + '.'; VSTower(SimpleTower(TowerNum).VSTower).LGBuffer2 = " ...Valid maximum ratio = " + OutputChar2 + - ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + - CreateSysTimeIntervalString(); + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + + General::CreateSysTimeIntervalString(); VSTower(SimpleTower(TowerNum).VSTower).LGLast = FlowFraction; } } @@ -6148,14 +6022,14 @@ namespace CondenserLoopTowers { if (UAdesign == 0.0) return; // set water and air properties - AirDensity = PsyRhoAirFnPbTdbW(SimpleTowerInlet(TowerNum).AirPress, InletAirTemp, SimpleTowerInlet(TowerNum).AirHumRat); + AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(SimpleTowerInlet(TowerNum).AirPress, InletAirTemp, SimpleTowerInlet(TowerNum).AirHumRat); AirMassFlowRate = AirFlowRate * AirDensity; - CpAir = PsyCpAirFnWTdb(SimpleTowerInlet(TowerNum).AirHumRat, InletAirTemp); - CpWater = GetSpecificHeatGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + CpAir = Psychrometrics::PsyCpAirFnWTdb(SimpleTowerInlet(TowerNum).AirHumRat, InletAirTemp); + CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, SimpleTowerInlet(TowerNum).WaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - InletAirEnthalpy = PsyHFnTdbRhPb(SimpleTowerInlet(TowerNum).AirWetBulb, 1.0, SimpleTowerInlet(TowerNum).AirPress); + InletAirEnthalpy = Psychrometrics::PsyHFnTdbRhPb(SimpleTowerInlet(TowerNum).AirWetBulb, 1.0, SimpleTowerInlet(TowerNum).AirPress); // initialize exiting wet bulb temperature before iterating on final solution OutletAirWetBulb = InletAirWetBulb + 6.0; @@ -6171,7 +6045,7 @@ namespace CondenserLoopTowers { while ((WetBulbError > WetBulbTolerance) && (Iter <= IterMax) && (DeltaTwb > DeltaTwbTolerance)) { ++Iter; // OutletAirEnthalpy = PsyHFnTdbRhPb(OutletAirWetBulb,1.0,OutBaroPress) - OutletAirEnthalpy = PsyHFnTdbRhPb(OutletAirWetBulb, 1.0, SimpleTowerInlet(TowerNum).AirPress); + OutletAirEnthalpy = Psychrometrics::PsyHFnTdbRhPb(OutletAirWetBulb, 1.0, SimpleTowerInlet(TowerNum).AirPress); // calculate the airside specific heat and capacity CpAirside = (OutletAirEnthalpy - InletAirEnthalpy) / (OutletAirWetBulb - InletAirWetBulb); AirCapacity = AirMassFlowRate * CpAirside; @@ -6203,7 +6077,7 @@ namespace CondenserLoopTowers { DeltaTwb = std::abs(OutletAirWetBulb - InletAirWetBulb); // Add KelvinConv to denominator below convert OutletAirWetBulbLast to Kelvin to avoid divide by zero. // Wet bulb error units are delta K/K - WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + KelvinConv)); + WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + DataGlobals::KelvinConv)); } if (Qactual >= 0.0) { @@ -6242,11 +6116,6 @@ namespace CondenserLoopTowers { // York International Corporation, "YORKcalcTM Software, Chiller-Plant Energy-Estimating Program", // Form 160.00-SG2 (0502). 2002. - // Using/Aliasing - using DataPlant::DualSetPointDeadBand; - using DataPlant::SingleSetPoint; - using General::SolveRoot; - // SUBROUTINE PARAMETER DEFINITIONS: int const MaxIte(500); // Maximum number of iterations Real64 const Acc(0.0001); // Accuracy of result @@ -6262,7 +6131,7 @@ namespace CondenserLoopTowers { Par(2) = WaterFlowRateRatio; // water flow rate ratio Par(3) = AirFlowRateRatio; // air flow rate ratio Par(4) = Twb; // inlet air wet-bulb temperature [C] - SolveRoot(Acc, MaxIte, SolFla, Tr, SimpleTowerTrResidual, 0.001, VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp, Par); + General::SolveRoot(Acc, MaxIte, SolFla, Tr, SimpleTowerTrResidual, 0.001, VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp, Par); OutletWaterTemp = SimpleTowerInlet(TowerNum).WaterTemp - Tr; @@ -6274,11 +6143,11 @@ namespace CondenserLoopTowers { // if SolFla = -2, Tr is returned as minimum value (0.001) and outlet temp = inlet temp - 0.001 } else if (SolFla == -2) { // decide if should run at max flow { - auto const SELECT_CASE_var(PlantLoop(SimpleTower(TowerNum).LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == SingleSetPoint) { - TempSetPoint = PlantLoop(SimpleTower(TowerNum).LoopNum).LoopSide(SimpleTower(TowerNum).LoopSideNum).TempSetPoint; - } else if (SELECT_CASE_var == DualSetPointDeadBand) { - TempSetPoint = PlantLoop(SimpleTower(TowerNum).LoopNum).LoopSide(SimpleTower(TowerNum).LoopSideNum).TempSetPointHi; + auto const SELECT_CASE_var(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).LoopDemandCalcScheme); + if (SELECT_CASE_var == DataPlant::SingleSetPoint) { + TempSetPoint = DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).LoopSide(SimpleTower(TowerNum).LoopSideNum).TempSetPoint; + } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { + TempSetPoint = DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).LoopSide(SimpleTower(TowerNum).LoopSideNum).TempSetPointHi; } else { assert(false); } @@ -6420,13 +6289,6 @@ namespace CondenserLoopTowers { // REFERENCES: // na - // Using/Aliasing - using DataEnvironment::CurMnDy; - using DataEnvironment::EnvironmentName; - using DataGlobals::CurrentTime; - using General::CreateSysTimeIntervalString; - using General::RoundSigDigits; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: static std::string OutputChar; // character string for warning messages static std::string OutputCharLo; // character string for warning messages @@ -6444,13 +6306,13 @@ namespace CondenserLoopTowers { WaterFlowRateRatioCapped = WaterFlowRateRatio; // calculate end time of current time step - CurrentEndTime = CurrentTime + SysTimeElapsed; + CurrentEndTime = DataGlobals::CurrentTime + DataHVACGlobals::SysTimeElapsed; // Print warning messages only when valid and only for the first ocurrance. Let summary provide statistics. // Wait for next time step to print warnings. If simulation iterates, print out // the warning for the last iteration only. Must wait for next time step to accomplish this. // If a warning occurs and the simulation down shifts, the warning is not valid. - if (CurrentEndTime > CurrentEndTimeLast && TimeStepSys >= TimeStepSysLast) { + if (CurrentEndTime > CurrentEndTimeLast && DataHVACGlobals::TimeStepSys >= TimeStepSysLast) { if (VSTower(SimpleTower(TowerNum).VSTower).PrintTrMessage) { ++VSTower(SimpleTower(TowerNum).VSTower).VSErrorCountTR; if (VSTower(SimpleTower(TowerNum).VSTower).VSErrorCountTR < 2) { @@ -6516,29 +6378,29 @@ namespace CondenserLoopTowers { } // save last system time step and last end time of current time step (used to determine if warning is valid) - TimeStepSysLast = TimeStepSys; + TimeStepSysLast = DataHVACGlobals::TimeStepSys; CurrentEndTimeLast = CurrentEndTime; // check boundaries of independent variables and post warnings to individual buffers to print at end of time step if (Twb < VSTower(SimpleTower(TowerNum).VSTower).MinInletAirWBTemp || Twb > VSTower(SimpleTower(TowerNum).VSTower).MaxInletAirWBTemp) { - OutputChar = RoundSigDigits(Twb, 2); - OutputCharLo = RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MinInletAirWBTemp, 2); - OutputCharHi = RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MaxInletAirWBTemp, 2); + OutputChar = General::RoundSigDigits(Twb, 2); + OutputCharLo = General::RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MinInletAirWBTemp, 2); + OutputCharHi = General::RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MaxInletAirWBTemp, 2); if (Twb < VSTower(SimpleTower(TowerNum).VSTower).MinInletAirWBTemp) { TwbCapped = VSTower(SimpleTower(TowerNum).VSTower).MinInletAirWBTemp; } if (Twb > VSTower(SimpleTower(TowerNum).VSTower).MaxInletAirWBTemp) { TwbCapped = VSTower(SimpleTower(TowerNum).VSTower).MaxInletAirWBTemp; } - if (!WarmupFlag) { + if (!DataGlobals::WarmupFlag) { VSTower(SimpleTower(TowerNum).VSTower).PrintTwbMessage = true; VSTower(SimpleTower(TowerNum).VSTower).TwbBuffer1 = SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\" - Inlet air wet-bulb temperature is outside model boundaries at " + OutputChar + '.'; VSTower(SimpleTower(TowerNum).VSTower).TwbBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + - ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + - CreateSysTimeIntervalString(); - TrimValue = RoundSigDigits(TwbCapped, 6); + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + + General::CreateSysTimeIntervalString(); + TrimValue = General::RoundSigDigits(TwbCapped, 6); VSTower(SimpleTower(TowerNum).VSTower).TwbBuffer3 = " ...Inlet air wet-bulb temperature passed to the model = " + TrimValue; VSTower(SimpleTower(TowerNum).VSTower).TwbLast = Twb; } else { @@ -6549,23 +6411,23 @@ namespace CondenserLoopTowers { } if (Tr < VSTower(SimpleTower(TowerNum).VSTower).MinRangeTemp || Tr > VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp) { - OutputChar = RoundSigDigits(Tr, 2); - OutputCharLo = RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MinRangeTemp, 2); - OutputCharHi = RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp, 2); + OutputChar = General::RoundSigDigits(Tr, 2); + OutputCharLo = General::RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MinRangeTemp, 2); + OutputCharHi = General::RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp, 2); if (Tr < VSTower(SimpleTower(TowerNum).VSTower).MinRangeTemp) { TrCapped = VSTower(SimpleTower(TowerNum).VSTower).MinRangeTemp; } if (Tr > VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp) { TrCapped = VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp; } - if (!WarmupFlag) { + if (!DataGlobals::WarmupFlag) { VSTower(SimpleTower(TowerNum).VSTower).PrintTrMessage = true; VSTower(SimpleTower(TowerNum).VSTower).TrBuffer1 = SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\" - Tower range temperature is outside model boundaries at " + OutputChar + '.'; VSTower(SimpleTower(TowerNum).VSTower).TrBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + - ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + - CreateSysTimeIntervalString(); - TrimValue = RoundSigDigits(Tr, 5); + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + + General::CreateSysTimeIntervalString(); + TrimValue = General::RoundSigDigits(Tr, 5); VSTower(SimpleTower(TowerNum).VSTower).TrBuffer3 = " ...Tower range temperature passed to the model = " + TrimValue; VSTower(SimpleTower(TowerNum).VSTower).TrLast = Tr; } else { @@ -6576,24 +6438,24 @@ namespace CondenserLoopTowers { } if (Ta < VSTower(SimpleTower(TowerNum).VSTower).MinApproachTemp || Ta > VSTower(SimpleTower(TowerNum).VSTower).MaxApproachTemp) { - OutputChar = RoundSigDigits(Ta, 2); - OutputCharLo = RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MinApproachTemp, 2); - OutputCharHi = RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MaxApproachTemp, 2); + OutputChar = General::RoundSigDigits(Ta, 2); + OutputCharLo = General::RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MinApproachTemp, 2); + OutputCharHi = General::RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MaxApproachTemp, 2); if (Ta < VSTower(SimpleTower(TowerNum).VSTower).MinApproachTemp) { TaCapped = VSTower(SimpleTower(TowerNum).VSTower).MinApproachTemp; } if (Ta > VSTower(SimpleTower(TowerNum).VSTower).MaxApproachTemp) { TaCapped = VSTower(SimpleTower(TowerNum).VSTower).MaxApproachTemp; } - if (!WarmupFlag) { + if (!DataGlobals::WarmupFlag) { VSTower(SimpleTower(TowerNum).VSTower).PrintTaMessage = true; VSTower(SimpleTower(TowerNum).VSTower).TaBuffer1 = SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\" - Tower approach temperature is outside model boundaries at " + OutputChar + '.'; VSTower(SimpleTower(TowerNum).VSTower).TaBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + - ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + - CreateSysTimeIntervalString(); - TrimValue = RoundSigDigits(Ta, 5); + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + + General::CreateSysTimeIntervalString(); + TrimValue = General::RoundSigDigits(Ta, 5); VSTower(SimpleTower(TowerNum).VSTower).TaBuffer3 = " ...Tower approach temperature passed to the model = " + TrimValue; VSTower(SimpleTower(TowerNum).VSTower).TaLast = Ta; } else { @@ -6610,24 +6472,24 @@ namespace CondenserLoopTowers { } else { if (WaterFlowRateRatio < VSTower(SimpleTower(TowerNum).VSTower).MinWaterFlowRatio || WaterFlowRateRatio > VSTower(SimpleTower(TowerNum).VSTower).MaxWaterFlowRatio) { - OutputChar = RoundSigDigits(WaterFlowRateRatio, 2); - OutputCharLo = RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MinWaterFlowRatio, 2); - OutputCharHi = RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MaxWaterFlowRatio, 2); + OutputChar = General::RoundSigDigits(WaterFlowRateRatio, 2); + OutputCharLo = General::RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MinWaterFlowRatio, 2); + OutputCharHi = General::RoundSigDigits(VSTower(SimpleTower(TowerNum).VSTower).MaxWaterFlowRatio, 2); if (WaterFlowRateRatio < VSTower(SimpleTower(TowerNum).VSTower).MinWaterFlowRatio) { WaterFlowRateRatioCapped = VSTower(SimpleTower(TowerNum).VSTower).MinWaterFlowRatio; } if (WaterFlowRateRatio > VSTower(SimpleTower(TowerNum).VSTower).MaxWaterFlowRatio) { WaterFlowRateRatioCapped = VSTower(SimpleTower(TowerNum).VSTower).MaxWaterFlowRatio; } - if (!WarmupFlag) { + if (!DataGlobals::WarmupFlag) { VSTower(SimpleTower(TowerNum).VSTower).PrintWFRRMessage = true; VSTower(SimpleTower(TowerNum).VSTower).WFRRBuffer1 = SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\" - Water flow rate ratio is outside model boundaries at " + OutputChar + '.'; VSTower(SimpleTower(TowerNum).VSTower).WFRRBuffer2 = " ...Valid range = " + OutputCharLo + " to " + OutputCharHi + - ". Occurrence info = " + EnvironmentName + ", " + CurMnDy + ' ' + - CreateSysTimeIntervalString(); - TrimValue = RoundSigDigits(WaterFlowRateRatioCapped, 5); + ". Occurrence info = " + DataEnvironment::EnvironmentName + ", " + DataEnvironment::CurMnDy + ' ' + + General::CreateSysTimeIntervalString(); + TrimValue = General::RoundSigDigits(WaterFlowRateRatioCapped, 5); VSTower(SimpleTower(TowerNum).VSTower).WFRRBuffer3 = " ...Water flow rate ratio passed to the model = " + TrimValue; VSTower(SimpleTower(TowerNum).VSTower).WaterFlowRateRatioLast = WaterFlowRateRatio; } else { @@ -6722,7 +6584,7 @@ namespace CondenserLoopTowers { // call model to determine approach temperature given other independent variables (range temp is being varied to find balance) CalcVSTowerApproach(TowerIndex, WaterFlowRateRatio, AirFlowRateRatio, InletAirWB, Trange, Tapproach); // calculate residual based on a balance where Twb + Ta + Tr = Node(WaterInletNode)%Temp - Residuum = (InletAirWB + Tapproach + Trange) - Node(SimpleTower(TowerIndex).WaterInletNodeNum).Temp; + Residuum = (InletAirWB + Tapproach + Trange) - DataLoopNode::Node(SimpleTower(TowerIndex).WaterInletNodeNum).Temp; return Residuum; } @@ -6803,12 +6665,6 @@ namespace CondenserLoopTowers { // REFERENCES: // Code for this routine started from VariableSpeedTower - // Using/Aliasing - using DataGlobals::SecInHour; - using DataHVACGlobals::TimeStepSys; - using DataWater::WaterStorage; - using ScheduleManager::GetCurrentScheduleValue; - // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("CalculateWaterUseage"); @@ -6839,17 +6695,17 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).EvapLossMode == EvapLossByMoistTheory) { AirDensity = - PsyRhoAirFnPbTdbW(SimpleTowerInlet(TowerNum).AirPress, SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirHumRat); + Psychrometrics::PsyRhoAirFnPbTdbW(SimpleTowerInlet(TowerNum).AirPress, SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirHumRat); AirMassFlowRate = AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate * AirDensity * SimpleTower(TowerNum).NumCellOn / SimpleTower(TowerNum).NumCell; - InletAirEnthalpy = PsyHFnTdbRhPb(SimpleTowerInlet(TowerNum).AirWetBulb, 1.0, SimpleTowerInlet(TowerNum).AirPress); + InletAirEnthalpy = Psychrometrics::PsyHFnTdbRhPb(SimpleTowerInlet(TowerNum).AirWetBulb, 1.0, SimpleTowerInlet(TowerNum).AirPress); if (AirMassFlowRate > 0.0) { // Calculate outlet air conditions for determining water usage OutletAirEnthalpy = InletAirEnthalpy + Qactual / AirMassFlowRate; - OutletAirTSat = PsyTsatFnHPb(OutletAirEnthalpy, SimpleTowerInlet(TowerNum).AirPress); - OutletAirHumRatSat = PsyWFnTdbH(OutletAirTSat, OutletAirEnthalpy); + OutletAirTSat = Psychrometrics::PsyTsatFnHPb(OutletAirEnthalpy, SimpleTowerInlet(TowerNum).AirPress); + OutletAirHumRatSat = Psychrometrics::PsyWFnTdbH(OutletAirTSat, OutletAirEnthalpy); // calculate specific humidity ratios (HUMRAT to mass of moist air not dry air) InSpecificHumRat = SimpleTowerInlet(TowerNum).AirHumRat / (1 + SimpleTowerInlet(TowerNum).AirHumRat); @@ -6859,9 +6715,9 @@ namespace CondenserLoopTowers { TairAvg = (SimpleTowerInlet(TowerNum).AirTemp + OutletAirTSat) / 2.0; // Amount of water evaporated, get density water at air temp or 4 C if too cold - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, max(TairAvg, 4.0), - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); EvapVdot = (AirMassFlowRate * (OutSpecificHumRat - InSpecificHumRat)) / rho; // [m3/s] @@ -6871,11 +6727,9 @@ namespace CondenserLoopTowers { } } else if (SimpleTower(TowerNum).EvapLossMode == EvapLossByUserFactor) { - // EvapVdot = SimpleTower(TowerNum)%UserEvapLossFactor * (InletWaterTemp - OutletWaterTemp) & - // * SimpleTower(TowerNum)%DesignWaterFlowRate - rho = GetDensityGlycol(PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, + rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, AverageWaterTemp, - PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, + DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); EvapVdot = SimpleTower(TowerNum).UserEvapLossFactor * (InletWaterTemp - OutletWaterTemp) * (WaterMassFlowRate / rho); @@ -6891,7 +6745,7 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).BlowdownMode == BlowdownBySchedule) { // Amount of water lost due to blow down (purging contaminants from tower basin) if (SimpleTower(TowerNum).SchedIDBlowdown > 0) { - BlowDownVdot = GetCurrentScheduleValue(SimpleTower(TowerNum).SchedIDBlowdown); + BlowDownVdot = ScheduleManager::GetCurrentScheduleValue(SimpleTower(TowerNum).SchedIDBlowdown); } else { BlowDownVdot = 0.0; } @@ -6921,9 +6775,9 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).SuppliedByWaterSystem) { // set demand request - WaterStorage(SimpleTower(TowerNum).WaterTankID).VdotRequestDemand(SimpleTower(TowerNum).WaterTankDemandARRID) = MakeUpVdot; + DataWater::WaterStorage(SimpleTower(TowerNum).WaterTankID).VdotRequestDemand(SimpleTower(TowerNum).WaterTankDemandARRID) = MakeUpVdot; - AvailTankVdot = WaterStorage(SimpleTower(TowerNum).WaterTankID) + AvailTankVdot = DataWater::WaterStorage(SimpleTower(TowerNum).WaterTankID) .VdotAvailDemand(SimpleTower(TowerNum).WaterTankDemandARRID); // check what tank can currently provide TankSupplyVdot = MakeUpVdot; // init @@ -6937,17 +6791,17 @@ namespace CondenserLoopTowers { // total water usage // update report variables SimpleTowerReport(TowerNum).EvaporationVdot = EvapVdot; - SimpleTowerReport(TowerNum).EvaporationVol = EvapVdot * (TimeStepSys * SecInHour); + SimpleTowerReport(TowerNum).EvaporationVol = EvapVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); SimpleTowerReport(TowerNum).DriftVdot = DriftVdot; - SimpleTowerReport(TowerNum).DriftVol = DriftVdot * (TimeStepSys * SecInHour); + SimpleTowerReport(TowerNum).DriftVol = DriftVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); SimpleTowerReport(TowerNum).BlowdownVdot = BlowDownVdot; - SimpleTowerReport(TowerNum).BlowdownVol = BlowDownVdot * (TimeStepSys * SecInHour); + SimpleTowerReport(TowerNum).BlowdownVol = BlowDownVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); SimpleTowerReport(TowerNum).MakeUpVdot = MakeUpVdot; - SimpleTowerReport(TowerNum).MakeUpVol = MakeUpVdot * (TimeStepSys * SecInHour); + SimpleTowerReport(TowerNum).MakeUpVol = MakeUpVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); SimpleTowerReport(TowerNum).TankSupplyVdot = TankSupplyVdot; - SimpleTowerReport(TowerNum).TankSupplyVol = TankSupplyVdot * (TimeStepSys * SecInHour); + SimpleTowerReport(TowerNum).TankSupplyVol = TankSupplyVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); SimpleTowerReport(TowerNum).StarvedMakeUpVdot = StarvedVdot; - SimpleTowerReport(TowerNum).StarvedMakeUpVol = StarvedVdot * (TimeStepSys * SecInHour); + SimpleTowerReport(TowerNum).StarvedMakeUpVol = StarvedVdot * (DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour); } void UpdateTowers(int const TowerNum) @@ -6962,13 +6816,6 @@ namespace CondenserLoopTowers { // PURPOSE OF THIS SUBROUTINE: // This subroutine is for passing results to the outlet water node. - // Using/Aliasing - using DataBranchAirLoopPlant::MassFlowTolerance; - using DataEnvironment::CurMnDy; - using DataEnvironment::EnvironmentName; - using DataPlant::PlantLoop; - using General::TrimSigDigits; - // SUBROUTINE PARAMETER DEFINITIONS: static ObjexxFCL::gio::Fmt LowTempFmt("(' ',F6.2)"); @@ -6980,33 +6827,33 @@ namespace CondenserLoopTowers { Real64 LoopMinTemp; // set node information - Node(WaterOutletNode).Temp = OutletWaterTemp; + DataLoopNode::Node(WaterOutletNode).Temp = OutletWaterTemp; LoopNum = SimpleTower(TowerNum).LoopNum; LoopSideNum = SimpleTower(TowerNum).LoopSideNum; - if (PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 0 || WarmupFlag) return; + if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 0 || DataGlobals::WarmupFlag) return; // Check flow rate through tower and compare to design flow rate, show warning if greater than Design * Mulitplier - if (Node(WaterOutletNode).MassFlowRate > SimpleTower(TowerNum).DesWaterMassFlowRate * SimpleTower(TowerNum).TowerMassFlowRateMultiplier) { + if (DataLoopNode::Node(WaterOutletNode).MassFlowRate > SimpleTower(TowerNum).DesWaterMassFlowRate * SimpleTower(TowerNum).TowerMassFlowRateMultiplier) { ++SimpleTower(TowerNum).HighMassFlowErrorCount; if (SimpleTower(TowerNum).HighMassFlowErrorCount < 2) { ShowWarningError(SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\""); ShowContinueError(" Condenser Loop Mass Flow Rate is much greater than the towers design mass flow rate."); - ShowContinueError(" Condenser Loop Mass Flow Rate = " + TrimSigDigits(Node(WaterOutletNode).MassFlowRate, 6)); - ShowContinueError(" Tower Design Mass Flow Rate = " + TrimSigDigits(SimpleTower(TowerNum).DesWaterMassFlowRate, 6)); + ShowContinueError(" Condenser Loop Mass Flow Rate = " + General::TrimSigDigits(DataLoopNode::Node(WaterOutletNode).MassFlowRate, 6)); + ShowContinueError(" Tower Design Mass Flow Rate = " + General::TrimSigDigits(SimpleTower(TowerNum).DesWaterMassFlowRate, 6)); ShowContinueErrorTimeStamp(""); } else { ShowRecurringWarningErrorAtEnd( SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\" Condenser Loop Mass Flow Rate is much greater than the towers design mass flow rate error continues...", SimpleTower(TowerNum).HighMassFlowErrorIndex, - Node(WaterOutletNode).MassFlowRate, - Node(WaterOutletNode).MassFlowRate); + DataLoopNode::Node(WaterOutletNode).MassFlowRate, + DataLoopNode::Node(WaterOutletNode).MassFlowRate); } } // Check if OutletWaterTemp is below the minimum condenser loop temp and warn user - LoopMinTemp = PlantLoop(LoopNum).MinTemp; + LoopMinTemp = DataPlant::PlantLoop(LoopNum).MinTemp; if (OutletWaterTemp < LoopMinTemp && WaterMassFlowRate > 0.0) { ++SimpleTower(TowerNum).OutletWaterTempErrorCount; ObjexxFCL::gio::write(CharLowOutletTemp, LowTempFmt) << LoopMinTemp; @@ -7028,13 +6875,13 @@ namespace CondenserLoopTowers { } // Check if water mass flow rate is small (e.g. no flow) and warn user - if (WaterMassFlowRate > 0.0 && WaterMassFlowRate <= MassFlowTolerance) { + if (WaterMassFlowRate > 0.0 && WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { ++SimpleTower(TowerNum).SmallWaterMassFlowErrorCount; if (SimpleTower(TowerNum).SmallWaterMassFlowErrorCount < 2) { ShowWarningError(SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\""); ShowContinueError("Cooling tower water mass flow rate near zero."); ShowContinueErrorTimeStamp(""); - ShowContinueError("Actual Mass flow = " + TrimSigDigits(WaterMassFlowRate, 2)); + ShowContinueError("Actual Mass flow = " + General::TrimSigDigits(WaterMassFlowRate, 2)); } else { ShowRecurringWarningErrorAtEnd(SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\" Cooling tower water mass flow rate near zero error continues...", @@ -7057,11 +6904,11 @@ namespace CondenserLoopTowers { // PURPOSE OF THIS SUBROUTINE: // This subroutine updates the report variables for the tower. - Real64 const ReportingConstant = TimeStepSys * SecInHour; + Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; if (!RunFlag) { - SimpleTowerReport(TowerNum).InletWaterTemp = Node(WaterInletNode).Temp; - SimpleTowerReport(TowerNum).OutletWaterTemp = Node(WaterInletNode).Temp; + SimpleTowerReport(TowerNum).InletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; + SimpleTowerReport(TowerNum).OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; SimpleTowerReport(TowerNum).WaterMassFlowRate = WaterMassFlowRate; SimpleTowerReport(TowerNum).Qactual = 0.0; SimpleTowerReport(TowerNum).FanPower = 0.0; @@ -7075,7 +6922,7 @@ namespace CondenserLoopTowers { SimpleTowerReport(TowerNum).NumCellOn = 0; SimpleTowerReport(TowerNum).SpeedSelected = 0; } else { - SimpleTowerReport(TowerNum).InletWaterTemp = Node(WaterInletNode).Temp; + SimpleTowerReport(TowerNum).InletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; SimpleTowerReport(TowerNum).OutletWaterTemp = OutletWaterTemp; SimpleTowerReport(TowerNum).WaterMassFlowRate = WaterMassFlowRate; SimpleTowerReport(TowerNum).Qactual = Qactual; From 53342a7c2dc05fb460e8d552df9bbcd13bf5dde3 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 6 Sep 2019 12:00:10 -0500 Subject: [PATCH 045/136] Step 03 - Clean up compiler/IDE warnings - No diffs --- src/EnergyPlus/CondenserLoopTowers.cc | 168 ++++++++------------------ src/EnergyPlus/CondenserLoopTowers.hh | 64 +++++----- 2 files changed, 83 insertions(+), 149 deletions(-) diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index ae1515412af..db25752fa2c 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -370,8 +370,8 @@ namespace CondenserLoopTowers { int TwoSpeedTowerNumber; // Specific two-speed tower of interest int NumVariableSpeedTowers; // Number of variable-speed cooling towers int VariableSpeedTowerNumber; // Specific variable-speed tower of interest - int NumVSCoolToolsModelCoeffs; // Number of CoolTools VS cooling tower coefficient objects - int NumVSYorkCalcModelCoeffs; // Number of YorkCalc VS cooling tower coefficient objects + int NumVSCoolToolsModelCoeffs = 0; // Number of CoolTools VS cooling tower coefficient objects + int NumVSYorkCalcModelCoeffs = 0; // Number of YorkCalc VS cooling tower coefficient objects int NumVSMerkelTowers; // Number of Merkel variable speed cooling towers int MerkelVSTowerNum; // specific merkel variable speed tower of interest int VSModelCoeffNum; // Specific variable-speed tower coefficient object of interest @@ -663,17 +663,14 @@ namespace CondenserLoopTowers { if (NumAlphas >= 12) { if (lAlphaFieldBlanks(12) || AlphArray(12).empty()) { - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; } else { if (UtilityRoutines::SameString(AlphArray(12), "MinimalCell") || UtilityRoutines::SameString(AlphArray(12), "MaximalCell")) { if (UtilityRoutines::SameString(AlphArray(12), "MinimalCell")) { SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MinCell; - SimpleTower(TowerNum).CellCtrl = "MinimalCell"; } if (UtilityRoutines::SameString(AlphArray(12), "MaximalCell")) { SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; } } else { ShowSevereError("Illegal " + cAlphaFieldNames(12) + " = " + AlphArray(12)); @@ -683,7 +680,6 @@ namespace CondenserLoopTowers { } } else { // assume Cell Control not entered and should be defaulted - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; } @@ -762,7 +758,7 @@ namespace CondenserLoopTowers { } } else { // Tower performance input method is not specified as a valid "choice" ShowSevereError(cCurrentModuleObject + " \"" + SimpleTower(TowerNum).Name + - "\". Tower Performance Input Method must be \"UFactorTimesAreaAndDesignWaterFlowRate\" or \"NominalCapacity\"."); + R"(". Tower Performance Input Method must be "UFactorTimesAreaAndDesignWaterFlowRate" or "NominalCapacity".)"); ShowContinueError("Tower Performanace Input Method currently specified as: " + AlphArray(4)); ErrorsFound = true; } @@ -984,17 +980,14 @@ namespace CondenserLoopTowers { if (NumAlphas >= 11) { if (lAlphaFieldBlanks(11) || AlphArray(11).empty()) { - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; } else { if (UtilityRoutines::SameString(AlphArray(11), "MinimalCell") || UtilityRoutines::SameString(AlphArray(11), "MaximalCell")) { if (UtilityRoutines::SameString(AlphArray(11), "MinimalCell")) { SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MinCell; - SimpleTower(TowerNum).CellCtrl = "MinimalCell"; } if (UtilityRoutines::SameString(AlphArray(11), "MaximalCell")) { SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; } } else { ShowSevereError("Illegal " + cAlphaFieldNames(12) + " = " + AlphArray(12)); @@ -1004,7 +997,6 @@ namespace CondenserLoopTowers { } } else { // assume Cell Control not entered and should be defaulted - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; } @@ -1151,7 +1143,7 @@ namespace CondenserLoopTowers { } } else { // Tower performance input method is not specified as a valid "choice" ShowSevereError(cCurrentModuleObject + " \"" + SimpleTower(TowerNum).Name + - "\". Tower Performance Input Method must be \"UFactorTimesAreaAndDesignWaterFlowRate\" or \"NominalCapacity\"."); + R"(". Tower Performance Input Method must be "UFactorTimesAreaAndDesignWaterFlowRate" or "NominalCapacity".)"); ShowContinueError("Tower Performanace Input Method currently specified as: " + AlphArray(4)); ErrorsFound = true; } @@ -1433,8 +1425,7 @@ namespace CondenserLoopTowers { ObjexxFCL::gio::write(OutputChar, OutputFormat) << SimpleTower(TowerNum).DesignInletWB; ObjexxFCL::gio::write(OutputCharLo, OutputFormat) << VSTower(SimpleTower(TowerNum).VSTower).MinInletAirWBTemp; ObjexxFCL::gio::write(OutputCharHi, OutputFormat) << VSTower(SimpleTower(TowerNum).VSTower).MaxInletAirWBTemp; - ShowSevereError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" the design inlet air wet-bulb temperature of " + - OutputChar + " must be within the model limits of " + OutputCharLo + " and " + OutputCharHi + " degrees C"); + ShowSevereError(cCurrentModuleObject.append(", \"").append(SimpleTower(TowerNum).Name).append("\" the design inlet air wet-bulb temperature of ").append(OutputChar).append(" must be within the model limits of ").append(OutputCharLo).append(" and ").append(OutputCharHi).append(" degrees C")); ErrorsFound = true; } @@ -1444,8 +1435,7 @@ namespace CondenserLoopTowers { ObjexxFCL::gio::write(OutputChar, OutputFormat) << SimpleTower(TowerNum).DesignApproach; ObjexxFCL::gio::write(OutputCharLo, OutputFormat) << VSTower(SimpleTower(TowerNum).VSTower).MinApproachTemp; ObjexxFCL::gio::write(OutputCharHi, OutputFormat) << VSTower(SimpleTower(TowerNum).VSTower).MaxApproachTemp; - ShowSevereError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" the design approach temperature of " + OutputChar + - " must be within the model limits of " + OutputCharLo + " and " + OutputCharHi + " degrees C"); + ShowSevereError(cCurrentModuleObject.append(", \"").append(SimpleTower(TowerNum).Name).append("\" the design approach temperature of ").append(OutputChar).append(" must be within the model limits of ").append(OutputCharLo).append(" and ").append(OutputCharHi).append(" degrees C")); ErrorsFound = true; } @@ -1455,8 +1445,7 @@ namespace CondenserLoopTowers { ObjexxFCL::gio::write(OutputChar, OutputFormat) << SimpleTower(TowerNum).DesignRange; ObjexxFCL::gio::write(OutputCharLo, OutputFormat) << VSTower(SimpleTower(TowerNum).VSTower).MinRangeTemp; ObjexxFCL::gio::write(OutputCharHi, OutputFormat) << VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp; - ShowSevereError(cCurrentModuleObject + ", \"" + SimpleTower(TowerNum).Name + "\" the design range temperature of " + OutputChar + - " must be within the model limits of " + OutputCharLo + " and " + OutputCharHi + " degrees C"); + ShowSevereError(cCurrentModuleObject.append(", \"").append(SimpleTower(TowerNum).Name).append("\" the design range temperature of ").append(OutputChar).append(" must be within the model limits of ").append(OutputCharLo).append(" and ").append(OutputCharHi).append(" degrees C")); ErrorsFound = true; } @@ -1591,17 +1580,14 @@ namespace CondenserLoopTowers { if (NumAlphas >= 13) { if (lAlphaFieldBlanks(13) || AlphArray(13).empty()) { - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; } else { if (UtilityRoutines::SameString(AlphArray(13), "MinimalCell") || UtilityRoutines::SameString(AlphArray(13), "MaximalCell")) { if (UtilityRoutines::SameString(AlphArray(13), "MinimalCell")) { SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MinCell; - SimpleTower(TowerNum).CellCtrl = "MinimalCell"; } if (UtilityRoutines::SameString(AlphArray(13), "MaximalCell")) { SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; } } else { ShowSevereError("Illegal " + cAlphaFieldNames(13) + " = " + AlphArray(13)); @@ -1611,7 +1597,6 @@ namespace CondenserLoopTowers { } } else { // assume Cell Control not entered and should be defaulted - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; } @@ -1877,17 +1862,14 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).TowerMassFlowRateMultiplier = SimpleTower(TowerNum).MaxFracFlowRate; if (NumAlphas >= 15) { if (lAlphaFieldBlanks(15) || AlphArray(15).empty()) { - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; } else { if (UtilityRoutines::SameString(AlphArray(15), "MinimalCell") || UtilityRoutines::SameString(AlphArray(15), "MaximalCell")) { if (UtilityRoutines::SameString(AlphArray(15), "MinimalCell")) { SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MinCell; - SimpleTower(TowerNum).CellCtrl = "MinimalCell"; } if (UtilityRoutines::SameString(AlphArray(15), "MaximalCell")) { SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; } } else { ShowSevereError("Illegal " + cAlphaFieldNames(15) + " = " + AlphArray(15)); @@ -1897,7 +1879,6 @@ namespace CondenserLoopTowers { } } else { // assume Cell Control not entered and should be defaulted - SimpleTower(TowerNum).CellCtrl = "MaximalCell"; SimpleTower(TowerNum).CellCtrl_Num = CellCtrl_MaxCell; } @@ -3653,7 +3634,6 @@ namespace CondenserLoopTowers { tmpTowerFreeConvNomCap = SimpleTower(TowerNum).TowerFreeConvNomCap; tmpDesignAirFlowRate = SimpleTower(TowerNum).HighSpeedAirFlowRate; - tmpHighSpeedFanPower = SimpleTower(TowerNum).HighSpeedFanPower; tmpFreeConvAirFlowRate = SimpleTower(TowerNum).FreeConvAirFlowRate; DesTowerInletAirWBTemp = SimpleTower(TowerNum).DesInletAirWBTemp; DesTowerInletAirDBTemp = SimpleTower(TowerNum).DesInletAirDBTemp; @@ -4572,7 +4552,6 @@ namespace CondenserLoopTowers { ShowContinueError("Verify that the value entered is intended and is consistent with other components."); } } - tmpHighSpeedFanPower = HighSpeedFanPowerUser; } } } @@ -4654,14 +4633,13 @@ namespace CondenserLoopTowers { // Current choices are Water and Steam, needs to expand for glycols // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 AirFlowRate; - Real64 UAdesign; // UA value at design conditions (entered by user or calculated) + Real64 AirFlowRate = 0.0; + Real64 UAdesign = 0.0; // UA value at design conditions (entered by user or calculated) Real64 OutletWaterTempOFF; - Real64 FanModeFrac; - Real64 DesignWaterFlowRate; + Real64 FanModeFrac = 0.0; Real64 FanPowerOn; Real64 CpWater; - Real64 TempSetPoint; + Real64 TempSetPoint = 0.0; // Added variables for fluid bypass int NumIteration; @@ -4673,7 +4651,7 @@ namespace CondenserLoopTowers { Real64 OutletWaterTempPrev; // Added variables for multicell - Real64 WaterMassFlowRatePerCellMin; + Real64 WaterMassFlowRatePerCellMin = 0.0; Real64 WaterMassFlowRatePerCellMax; static int NumCellMin(0); static int NumCellMax(0); @@ -4741,7 +4719,6 @@ namespace CondenserLoopTowers { // Added for fluid bypass. First assume no fluid bypass BypassFlag = 0; - BypassFraction = 0.0; BypassFraction2 = 0.0; SimpleTower(TowerNum).BypassFraction = 0.0; CapacityControl = SimpleTower(TowerNum).CapacityControl; @@ -4791,7 +4768,6 @@ namespace CondenserLoopTowers { // Initialize local variables to the free convection design values UAdesign = FreeConvTowerUA / SimpleTower(TowerNum).NumCell; AirFlowRate = SimpleTower(TowerNum).FreeConvAirFlowRate / SimpleTower(TowerNum).NumCell; - DesignWaterFlowRate = SimpleTower(TowerNum).DesignWaterFlowRate; OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp; OutletWaterTemp = OutletWaterTempOFF; FanModeFrac = 0.0; @@ -4852,21 +4828,17 @@ namespace CondenserLoopTowers { // Inlet water temperature lower than setpoint, assume 100% bypass, tower fan off if (InletWaterTemp <= TempSetPoint) { CTFanPower = 0.0; - BypassFraction = 1.0; SimpleTower(TowerNum).BypassFraction = 1.0; OutletWaterTemp = InletWaterTemp; } else { if (std::abs(InletWaterTemp - OutletWaterTemp) <= 0.01) { // Outlet temp is close enough to inlet temp, assume 100% bypass, tower fan off - BypassFraction = 1.0; SimpleTower(TowerNum).BypassFraction = 1.0; CTFanPower = 0.0; } else { BypassFraction = (TempSetPoint - OutletWaterTemp) / (InletWaterTemp - OutletWaterTemp); if (BypassFraction > 1.0 || BypassFraction < 0.0) { // Bypass cannot meet setpoint, assume no bypass - BypassFlag = 0; - BypassFraction = 0.0; SimpleTower(TowerNum).BypassFraction = 0.0; } else { NumIteration = 0; @@ -4997,17 +4969,16 @@ namespace CondenserLoopTowers { static std::string const RoutineName("CalcTwoSpeedTower"); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Real64 AirFlowRate; + Real64 AirFlowRate = 0.0; Real64 UAdesign; // UA value at design conditions (entered by user) [W/C] Real64 OutletWaterTempOFF; Real64 OutletWaterTemp1stStage; Real64 OutletWaterTemp2ndStage; - Real64 FanModeFrac; - Real64 DesignWaterFlowRate; + Real64 FanModeFrac = 0.0; Real64 FanPowerLow; Real64 FanPowerHigh; Real64 CpWater; - Real64 TempSetPoint; + Real64 TempSetPoint = 0.0; int LoopNum; int LoopSideNum; @@ -5015,7 +4986,7 @@ namespace CondenserLoopTowers { static int SpeedSel(0); // Added variables for multicell - Real64 WaterMassFlowRatePerCellMin; + Real64 WaterMassFlowRatePerCellMin = 0.0; Real64 WaterMassFlowRatePerCellMax; static int NumCellMin(0); static int NumCellMax(0); @@ -5123,7 +5094,6 @@ namespace CondenserLoopTowers { // set local variable for tower UAdesign = FreeConvTowerUA / SimpleTower(TowerNum).NumCell; // where is NumCellOn? AirFlowRate = SimpleTower(TowerNum).FreeConvAirFlowRate / SimpleTower(TowerNum).NumCell; - DesignWaterFlowRate = SimpleTower(TowerNum).DesignWaterFlowRate; // ??useless subroutine variable?? OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp; WaterMassFlowRate = DataLoopNode::Node(WaterInletNode).MassFlowRate; OutletWaterTemp1stStage = OutletWaterTemp; @@ -5224,8 +5194,7 @@ namespace CondenserLoopTowers { Real64 CpWater; int LoopNum; int LoopSideNum; - Real64 TempSetPoint; - Real64 WaterMassFlowRatePerCellMin; + Real64 WaterMassFlowRatePerCellMin = 0.0; Real64 WaterMassFlowRatePerCellMax; int NumCellMin = 0; int NumCellMax = 0; @@ -5260,33 +5229,11 @@ namespace CondenserLoopTowers { Real64 FreeConvTowerUA = SimpleTower(TowerNum).FreeConvTowerUA; Real64 HighSpeedTowerUA = SimpleTower(TowerNum).HighSpeedTowerUA; - // water temperature setpoint - { - auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); - if (SELECT_CASE_var == DataPlant::SingleSetPoint) { - if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPoint; - } else { - TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; - } - } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { - if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPointHi; - } else { - TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; - } - } - } - // If there is a fault of condenser SWT Sensor (zrp_Jul2016) if (SimpleTower(TowerNum).FaultyCondenserSWTFlag && (!DataGlobals::WarmupFlag) && (!DataGlobals::DoingSizing) && (!DataGlobals::KickOffSimulation)) { int FaultIndex = SimpleTower(TowerNum).FaultyCondenserSWTIndex; - Real64 TowerOutletTemp_ff = TempSetPoint; - // calculate the sensor offset using fault information SimpleTower(TowerNum).FaultyCondenserSWTOffset = FaultsManager::FaultsCondenserSWTSensor(FaultIndex).CalFaultOffsetAct(); - // update the TempSetPoint - TempSetPoint = TowerOutletTemp_ff - SimpleTower(TowerNum).FaultyCondenserSWTOffset; } // If there is a fault of cooling tower fouling (zrp_Jul2016) @@ -5399,12 +5346,9 @@ namespace CondenserLoopTowers { UAwaterflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncWaterFlowRatioCurvePtr, WaterFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTemp); - if ((FullSpeedFanQdot + DataHVACGlobals::SmallLoad) < std::abs(MyLoad) && (NumCellOn < SimpleTower(TowerNum).NumCell) && - ((WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin)) { - IncrNumCellFlag = true; - } else { - IncrNumCellFlag = false; - } + IncrNumCellFlag = (FullSpeedFanQdot + DataHVACGlobals::SmallLoad) < std::abs(MyLoad) && + (NumCellOn < SimpleTower(TowerNum).NumCell) && + ((WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin); } FullSpeedFanQdot = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); } @@ -5510,7 +5454,7 @@ namespace CondenserLoopTowers { } } - Real64 VSMerkelResidual(Real64 const AirFlowRateRatio, // fan speed ratio (1.0 is continuous, 0.0 is off) + Real64 VSMerkelResidual(Real64 const _AirFlowRateRatio, // fan speed ratio (1.0 is continuous, 0.0 is off) Array1 const &Par // par(1) = Tower number ) { @@ -5558,9 +5502,9 @@ namespace CondenserLoopTowers { CpWater = Par(7); TotalWaterMassFlowRate = Par(8); - AirFlowRatePerCell = AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; + AirFlowRatePerCell = _AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; - UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); + UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, _AirFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTempTrial); @@ -5628,14 +5572,11 @@ namespace CondenserLoopTowers { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 OutletWaterTempOFF; // Outlet water temperature with fan OFF (C) - Real64 OutletWaterTempON; // Outlet water temperature with fan ON at maximum fan speed (C) + Real64 OutletWaterTempON = 0.0; // Outlet water temperature with fan ON at maximum fan speed (C) Real64 OutletWaterTempMIN; // Outlet water temperature with fan at minimum speed (C) Real64 CpWater; // Specific heat of water Real64 TempSetPoint(0.0); // Outlet water temperature setpoint (C) Real64 FanCurveValue; // Output of fan power as a func of air flow rate ratio curve - Real64 AirDensity; // Density of air [kg/m3] - Real64 AirMassFlowRate; // Mass flow rate of air [kg/s] - Real64 InletAirEnthalpy; // Enthalpy of entering moist air [J/kg] int SolFla; // Flag of solver Array1D Par(6); // Parameter array for regula falsi solver Real64 Twb; // inlet air wet-bulb temperature @@ -5644,10 +5585,10 @@ namespace CondenserLoopTowers { Real64 TrCapped; // range temp passed to VS tower model Real64 Ta; // approach temperature Real64 TaCapped; // approach temp passed to VS tower model - Real64 WaterFlowRateRatio; // Water flow rate ratio - Real64 WaterFlowRateRatioCapped; // Water flow rate ratio passed to VS tower model + Real64 WaterFlowRateRatio = 0.0; // Water flow rate ratio + Real64 WaterFlowRateRatioCapped = 0.0; // Water flow rate ratio passed to VS tower model Real64 WaterDensity; // density of inlet water - Real64 FreeConvectionCapFrac; // fraction of tower capacity in free convection + Real64 FreeConvectionCapFrac = 0.0; // fraction of tower capacity in free convection Real64 FlowFraction; // liquid to gas (L/G) ratio for cooling tower std::string OutputChar; // character string used for warning messages std::string OutputChar2; // character string used for warning messages @@ -5661,7 +5602,7 @@ namespace CondenserLoopTowers { int LoopSideNum; // Added variables for multicell - Real64 WaterMassFlowRatePerCellMin; + Real64 WaterMassFlowRatePerCellMin = 0.0; Real64 WaterMassFlowRatePerCellMax; static int NumCellMin(0); static int NumCellMax(0); @@ -5890,11 +5831,6 @@ namespace CondenserLoopTowers { RoutineName); Qactual = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); SimpleTower(TowerNum).NumCellOn = NumCellOn; - // Set water and air properties - AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(SimpleTowerInlet(TowerNum).AirPress, SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirHumRat); - AirMassFlowRate = AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate * AirDensity * SimpleTower(TowerNum).NumCellOn / - SimpleTower(TowerNum).NumCell; - InletAirEnthalpy = Psychrometrics::PsyHFnTdbRhPb(SimpleTowerInlet(TowerNum).AirWetBulb, 1.0, SimpleTowerInlet(TowerNum).AirPress); // calculate end time of current time step CurrentEndTime = DataGlobals::CurrentTime + DataHVACGlobals::SysTimeElapsed; @@ -5949,7 +5885,7 @@ namespace CondenserLoopTowers { } } - void SimSimpleTower(int const TowerNum, Real64 const WaterMassFlowRate, Real64 const AirFlowRate, Real64 const UAdesign, Real64 &OutletWaterTemp) + void SimSimpleTower(int const TowerNum, Real64 const _WaterMassFlowRate, Real64 const AirFlowRate, Real64 const UAdesign, Real64 &_OutletWaterTemp) { // SUBROUTINE INFORMATION: @@ -5969,7 +5905,7 @@ namespace CondenserLoopTowers { // ASHRAE 1999. HVAC1KIT: A Toolkit for Primary HVAC System Energy Calculations. // Locals - Real64 Qactual; // Actual heat transfer rate between tower water and air [W] + Real64 _Qactual; // Actual heat transfer rate between tower water and air [W] // SUBROUTINE PARAMETER DEFINITIONS: int const IterMax(50); // Maximum number of iterations allowed @@ -6006,7 +5942,7 @@ namespace CondenserLoopTowers { WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; - Qactual = 0.0; + _Qactual = 0.0; // WetBulbTolerance = 0.00001 WetBulbError = 1.0; // IterMax = 50 @@ -6015,7 +5951,7 @@ namespace CondenserLoopTowers { // set local tower inlet and outlet temperature variables InletWaterTemp = SimpleTowerInlet(TowerNum).WaterTemp; - OutletWaterTemp = InletWaterTemp; + _OutletWaterTemp = InletWaterTemp; InletAirTemp = SimpleTowerInlet(TowerNum).AirTemp; InletAirWetBulb = SimpleTowerInlet(TowerNum).AirWetBulb; @@ -6035,10 +5971,10 @@ namespace CondenserLoopTowers { OutletAirWetBulb = InletAirWetBulb + 6.0; // Calcluate mass flow rates - if (WaterMassFlowRate > 0.0) { - MdotCpWater = WaterMassFlowRate * CpWater; + if (_WaterMassFlowRate > 0.0) { + MdotCpWater = _WaterMassFlowRate * CpWater; } else { - OutletWaterTemp = InletWaterTemp; + _OutletWaterTemp = InletWaterTemp; return; } Iter = 0; @@ -6069,10 +6005,10 @@ namespace CondenserLoopTowers { effectiveness = NumTransferUnits / (1.0 + NumTransferUnits); } // calculate water to air heat transfer and store last exiting WB temp of air - Qactual = effectiveness * CapacityRatioMin * (InletWaterTemp - InletAirWetBulb); + _Qactual = effectiveness * CapacityRatioMin * (InletWaterTemp - InletAirWetBulb); OutletAirWetBulbLast = OutletAirWetBulb; // calculate new exiting wet bulb temperature of airstream - OutletAirWetBulb = InletAirWetBulb + Qactual / AirCapacity; + OutletAirWetBulb = InletAirWetBulb + _Qactual / AirCapacity; // Check error tolerance and exit if satisfied DeltaTwb = std::abs(OutletAirWetBulb - InletAirWetBulb); // Add KelvinConv to denominator below convert OutletAirWetBulbLast to Kelvin to avoid divide by zero. @@ -6080,18 +6016,18 @@ namespace CondenserLoopTowers { WetBulbError = std::abs((OutletAirWetBulb - OutletAirWetBulbLast) / (OutletAirWetBulbLast + DataGlobals::KelvinConv)); } - if (Qactual >= 0.0) { - OutletWaterTemp = InletWaterTemp - Qactual / MdotCpWater; + if (_Qactual >= 0.0) { + _OutletWaterTemp = InletWaterTemp - _Qactual / MdotCpWater; } else { - OutletWaterTemp = InletWaterTemp; + _OutletWaterTemp = InletWaterTemp; } } void SimVariableTower(int const TowerNum, // variable speed tower index Real64 const WaterFlowRateRatio, // current water flow rate ratio (capped if applicable) - Real64 const AirFlowRateRatio, // current air flow rate ratio + Real64 const _AirFlowRateRatio, // current air flow rate ratio Real64 const Twb, // current inlet air wet-bulb temperature (C, capped if applicable) - Real64 &OutletWaterTemp // calculated tower outlet water temperature (C) + Real64 &_OutletWaterTemp // calculated tower outlet water temperature (C) ) { @@ -6129,11 +6065,11 @@ namespace CondenserLoopTowers { // determine tower outlet water temperature Par(1) = TowerNum; // Index to cooling tower Par(2) = WaterFlowRateRatio; // water flow rate ratio - Par(3) = AirFlowRateRatio; // air flow rate ratio + Par(3) = _AirFlowRateRatio; // air flow rate ratio Par(4) = Twb; // inlet air wet-bulb temperature [C] General::SolveRoot(Acc, MaxIte, SolFla, Tr, SimpleTowerTrResidual, 0.001, VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp, Par); - OutletWaterTemp = SimpleTowerInlet(TowerNum).WaterTemp - Tr; + _OutletWaterTemp = SimpleTowerInlet(TowerNum).WaterTemp - Tr; if (SolFla == -1) { ShowSevereError("Iteration limit exceeded in calculating tower nominal capacity at minimum air flow ratio"); @@ -6153,7 +6089,7 @@ namespace CondenserLoopTowers { } } if (SimpleTowerInlet(TowerNum).WaterTemp > (TempSetPoint + VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp)) { // run flat out - OutletWaterTemp = SimpleTowerInlet(TowerNum).WaterTemp - VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp; + _OutletWaterTemp = SimpleTowerInlet(TowerNum).WaterTemp - VSTower(SimpleTower(TowerNum).VSTower).MaxRangeTemp; } } } @@ -6562,7 +6498,7 @@ namespace CondenserLoopTowers { Real64 Residuum; // residual to be minimized to zero // Locals - Real64 AirFlowRateRatio; // ratio of water flow rate to design water flow rate + Real64 _AirFlowRateRatio; // ratio of water flow rate to design water flow rate // SUBROUTINE ARGUMENT DEFINITIONS: // par(2) = water flow ratio @@ -6577,12 +6513,12 @@ namespace CondenserLoopTowers { TowerIndex = int(Par(1)); WaterFlowRateRatio = Par(2); - AirFlowRateRatio = Par(3); + _AirFlowRateRatio = Par(3); InletAirWB = Par(4); Tapproach = 0.0; // call model to determine approach temperature given other independent variables (range temp is being varied to find balance) - CalcVSTowerApproach(TowerIndex, WaterFlowRateRatio, AirFlowRateRatio, InletAirWB, Trange, Tapproach); + CalcVSTowerApproach(TowerIndex, WaterFlowRateRatio, _AirFlowRateRatio, InletAirWB, Trange, Tapproach); // calculate residual based on a balance where Twb + Ta + Tr = Node(WaterInletNode)%Temp Residuum = (InletAirWB + Tapproach + Trange) - DataLoopNode::Node(SimpleTower(TowerIndex).WaterInletNodeNum).Temp; @@ -6611,7 +6547,7 @@ namespace CondenserLoopTowers { Real64 Residuum; // residual to be minimized to zero // Locals - Real64 AirFlowRateRatio; // ratio of water flow rate to design water flow rate + Real64 _AirFlowRateRatio; // ratio of water flow rate to design water flow rate // SUBROUTINE ARGUMENT DEFINITIONS: // par(2) = water or air flow ratio (opposite of input variable) @@ -6630,10 +6566,10 @@ namespace CondenserLoopTowers { TowerIndex = int(Par(1)); if (Par(6) == 0.0) { - AirFlowRateRatio = Par(2); + _AirFlowRateRatio = Par(2); WaterFlowRateRatio = FlowRatio; } else { - AirFlowRateRatio = FlowRatio; + _AirFlowRateRatio = FlowRatio; WaterFlowRateRatio = Par(2); } InletAirWB = Par(3); @@ -6642,7 +6578,7 @@ namespace CondenserLoopTowers { TapproachActual = 0.0; // call model to determine tower approach temperature given other independent variables - CalcVSTowerApproach(TowerIndex, WaterFlowRateRatio, AirFlowRateRatio, InletAirWB, Trange, TapproachActual); + CalcVSTowerApproach(TowerIndex, WaterFlowRateRatio, _AirFlowRateRatio, InletAirWB, Trange, TapproachActual); Residuum = TapproachDesired - TapproachActual; return Residuum; diff --git a/src/EnergyPlus/CondenserLoopTowers.hh b/src/EnergyPlus/CondenserLoopTowers.hh index d4eec49e18a..c01f2f1857d 100644 --- a/src/EnergyPlus/CondenserLoopTowers.hh +++ b/src/EnergyPlus/CondenserLoopTowers.hh @@ -206,7 +206,6 @@ namespace CondenserLoopTowers { // through the tower sump // multi cell tower int NumCell; // Number of cells in the cooling tower - std::string CellCtrl; // Cell control type : either MaxCell or MinCell int CellCtrl_Num; int NumCellOn; // number of cells working Real64 MinFracFlowRate; // Minimal fraction of design flow/cell allowable @@ -387,7 +386,6 @@ namespace CondenserLoopTowers { //- LG = Liquid to gas ratio std::string LGBuffer1; // - buffer to print LG warning messages on following time step std::string LGBuffer2; // - buffer to print LG warning messages on following time step - std::string LGBuffer3; // - buffer to print LG warning messages on following time step bool PrintTrMessage; // - flag to print Tr error message bool PrintTwbMessage; // - flag to print Twb error message bool PrintTaMessage; // - flag to print Ta error message @@ -423,12 +421,12 @@ namespace CondenserLoopTowers { std::string const &TowerName, int &CompIndex, bool &RunFlag, - bool const InitLoopEquip, + bool InitLoopEquip, Real64 &MyLoad, Real64 &MaxCap, Real64 &MinCap, Real64 &OptCap, - bool const GetSizingFactor, // TRUE when just the sizing factor is requested + bool GetSizingFactor, // TRUE when just the sizing factor is requested Real64 &SizingFactor // sizing factor ); @@ -436,71 +434,71 @@ namespace CondenserLoopTowers { void InitSimVars(); - void InitTower(int const TowerNum, // Number of the current cooling tower being simulated - bool const RunFlag // Indication of + void InitTower(int TowerNum, // Number of the current cooling tower being simulated + bool RunFlag // Indication of ); - void SizeTower(int const TowerNum); + void SizeTower(int TowerNum); - void SizeVSMerkelTower(int const TowerNum); + void SizeVSMerkelTower(int TowerNum); void CalcSingleSpeedTower(int &TowerNum); void CalcTwoSpeedTower(int &TowerNum); - void CalcMerkelVariableSpeedTower(int const TowerNum, Real64 &MyLoad); + void CalcMerkelVariableSpeedTower(int TowerNum, Real64 &MyLoad); - Real64 VSMerkelResidual(Real64 const AirFlowRateRatio, // fan speed ratio (1.0 is continuous, 0.0 is off) + Real64 VSMerkelResidual(Real64 _AirFlowRateRatio, // fan speed ratio (1.0 is continuous, 0.0 is off) Array1 const &Par // par(1) = Tower number ); - void CalcVariableSpeedTower(int const TowerNum); + void CalcVariableSpeedTower(int TowerNum); - void SimSimpleTower(int const TowerNum, Real64 const WaterMassFlowRate, Real64 const AirFlowRate, Real64 const UAdesign, Real64 &OutletWaterTemp); + void SimSimpleTower(int TowerNum, Real64 _WaterMassFlowRate, Real64 AirFlowRate, Real64 UAdesign, Real64 &_OutletWaterTemp); - void SimVariableTower(int const TowerNum, // variable speed tower index - Real64 const WaterFlowRateRatio, // current water flow rate ratio (capped if applicable) - Real64 const AirFlowRateRatio, // current air flow rate ratio - Real64 const Twb, // current inlet air wet-bulb temperature (C, capped if applicable) - Real64 &OutletWaterTemp // calculated tower outlet water temperature (C) + void SimVariableTower(int TowerNum, // variable speed tower index + Real64 WaterFlowRateRatio, // current water flow rate ratio (capped if applicable) + Real64 _AirFlowRateRatio, // current air flow rate ratio + Real64 Twb, // current inlet air wet-bulb temperature (C, capped if applicable) + Real64 &_OutletWaterTemp // calculated tower outlet water temperature (C) ); - void CalcVSTowerApproach(int const TowerNum, // Index to cooling tower - Real64 const PctWaterFlow, // Water flow ratio of cooling tower - Real64 const AirFlowRatio, // Air flow ratio of cooling tower - Real64 const Twb, // Inlet air wet-bulb temperature [C] - Real64 const Tr, // Cooling tower range (outlet water temp minus inlet air wet-bulb temp) [C] + void CalcVSTowerApproach(int TowerNum, // Index to cooling tower + Real64 PctWaterFlow, // Water flow ratio of cooling tower + Real64 AirFlowRatio, // Air flow ratio of cooling tower + Real64 Twb, // Inlet air wet-bulb temperature [C] + Real64 Tr, // Cooling tower range (outlet water temp minus inlet air wet-bulb temp) [C] Real64 &Approach // Calculated approach temperature [C] ); - void CheckModelBounds(int const TowerNum, // index to tower - Real64 const Twb, // current inlet air wet-bulb temperature (C) - Real64 const Tr, // requested range temperature for current time step (C) - Real64 const Ta, // requested approach temperature for current time step (C) - Real64 const WaterFlowRateRatio, // current water flow rate ratio at water inlet node + void CheckModelBounds(int TowerNum, // index to tower + Real64 Twb, // current inlet air wet-bulb temperature (C) + Real64 Tr, // requested range temperature for current time step (C) + Real64 Ta, // requested approach temperature for current time step (C) + Real64 WaterFlowRateRatio, // current water flow rate ratio at water inlet node Real64 &TwbCapped, // bounded value of inlet air wet-bulb temperature (C) Real64 &TrCapped, // bounded value of range temperature (C) Real64 &TaCapped, // bounded value of approach temperature (C) Real64 &WaterFlowRateRatioCapped // bounded value of water flow rate ratio ); - Real64 SimpleTowerUAResidual(Real64 const UA, // UA of cooling tower + Real64 SimpleTowerUAResidual(Real64 UA, // UA of cooling tower Array1 const &Par // par(1) = design tower load [W] ); - Real64 SimpleTowerTrResidual(Real64 const Trange, // cooling tower range temperature [C] + Real64 SimpleTowerTrResidual(Real64 Trange, // cooling tower range temperature [C] Array1 const &Par // par(1) = tower number ); - Real64 SimpleTowerApproachResidual(Real64 const FlowRatio, // water or air flow ratio of cooling tower + Real64 SimpleTowerApproachResidual(Real64 FlowRatio, // water or air flow ratio of cooling tower Array1 const &Par // par(1) = tower number ); - void CalculateWaterUseage(int const TowerNum); + void CalculateWaterUseage(int TowerNum); - void UpdateTowers(int const TowerNum); + void UpdateTowers(int TowerNum); - void ReportTowers(bool const RunFlag, int const TowerNum); + void ReportTowers(bool RunFlag, int TowerNum); } // namespace CondenserLoopTowers From 79e6f646bc83a69dff506dc43675e21ba72dde34 Mon Sep 17 00:00:00 2001 From: xuanluolbl Date: Fri, 6 Sep 2019 10:02:35 -0700 Subject: [PATCH 046/136] try again --- src/EnergyPlus/FluidProperties.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index 03cc9d16529..953c4ed95d5 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -596,6 +596,8 @@ namespace FluidProperties { cNumericFieldNames = ""; lNumericFieldBlanks = false; + InitializeGlycRoutines(); + // Check to see if there is any FluidName input. If not, this is okay as // long as the user only desires to simulate loops with water. More than // one FluidName input is not allowed. From ebc99bf912785de47a8feaf9e303da522ad1336f Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 6 Sep 2019 12:41:18 -0500 Subject: [PATCH 047/136] Step 04 - Removal of statics - Good ERR diffs in 4 files --- src/EnergyPlus/CondenserLoopTowers.cc | 96 +++++++++++---------------- src/EnergyPlus/CondenserLoopTowers.hh | 6 +- 2 files changed, 42 insertions(+), 60 deletions(-) diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index db25752fa2c..96c6cf3c109 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -381,7 +381,7 @@ namespace CondenserLoopTowers { int NumNums2; // Number of elements in the numeric2 array int IOStat; // IO Status when calling get input subroutine int CoeffNum; // Index for reading user defined VS tower coefficients - static bool ErrorsFound(false); // Logical flag set .TRUE. if errors found while getting input data + bool ErrorsFound(false); // Logical flag set .TRUE. if errors found while getting input data std::string OutputChar; // report variable for warning messages std::string OutputCharLo; // report variable for warning messages std::string OutputCharHi; // report variable for warning messages @@ -2427,24 +2427,10 @@ namespace CondenserLoopTowers { static std::string const RoutineName("InitTower"); // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static bool ErrorsFound(false); // Flag if input data errors are found - - static Array1D_bool MyEnvrnFlag; - static Array1D_bool OneTimeFlagForEachTower; int TypeOf_Num(0); Real64 rho; // local density of fluid - // Do the one time initializations - if (InitTowerOneTimeFlag) { - MyEnvrnFlag.allocate(NumSimpleTowers); - OneTimeFlagForEachTower.allocate(NumSimpleTowers); - - OneTimeFlagForEachTower = true; - MyEnvrnFlag = true; - InitTowerOneTimeFlag = false; - } - - if (OneTimeFlagForEachTower(TowerNum)) { + if (SimpleTower(TowerNum).oneTimeFlag) { if (SimpleTower(TowerNum).TowerType_Num == CoolingTower_SingleSpeed) { TypeOf_Num = DataPlant::TypeOf_CoolingTower_SingleSpd; @@ -2459,6 +2445,7 @@ namespace CondenserLoopTowers { } // Locate the tower on the plant loops for later usage + bool ErrorsFound = false; PlantUtilities::ScanPlantLoopsForObject(SimpleTower(TowerNum).Name, TypeOf_Num, SimpleTower(TowerNum).LoopNum, @@ -2479,11 +2466,11 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).SetpointIsOnOutlet = !((DataLoopNode::Node(SimpleTower(TowerNum).WaterOutletNodeNum).TempSetPoint == DataLoopNode::SensedNodeFlagValue) && (DataLoopNode::Node(SimpleTower(TowerNum).WaterOutletNodeNum).TempSetPointHi == DataLoopNode::SensedNodeFlagValue)); - OneTimeFlagForEachTower(TowerNum) = false; + SimpleTower(TowerNum).oneTimeFlag = false; } // Begin environment initializations - if (MyEnvrnFlag(TowerNum) && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { + if (SimpleTower(TowerNum).envrnFlag && DataGlobals::BeginEnvrnFlag && (DataPlant::PlantFirstSizesOkayToFinalize)) { rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, DataGlobals::InitConvTemp, @@ -2501,11 +2488,11 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).BranchNum, SimpleTower(TowerNum).CompNum); - MyEnvrnFlag(TowerNum) = false; + SimpleTower(TowerNum).envrnFlag = false; } if (!DataGlobals::BeginEnvrnFlag) { - MyEnvrnFlag(TowerNum) = true; + SimpleTower(TowerNum).envrnFlag = true; } // Each time initializations @@ -4584,7 +4571,7 @@ namespace CondenserLoopTowers { // Cyclic losses are neglected. The period of time required to meet the // leaving water temperature setpoint is used to determine the required // fan power and energy. Free convection regime is also modeled. This - // occures when the pump is operating and the fan is off. If free convection + // occurs when the pump is operating and the fan is off. If free convection // regime cooling is all that is required for a given time step, the leaving // water temperature is allowed to fall below the leaving water temperature // setpoint (free cooling). At times when the cooling tower fan is required, @@ -4653,9 +4640,9 @@ namespace CondenserLoopTowers { // Added variables for multicell Real64 WaterMassFlowRatePerCellMin = 0.0; Real64 WaterMassFlowRatePerCellMax; - static int NumCellMin(0); - static int NumCellMax(0); - static int NumCellOn(0); + int NumCellMin(0); + int NumCellMax(0); + int NumCellOn(0); Real64 WaterMassFlowRatePerCell; bool IncrNumCellFlag; // determine if yes or no we increase the number of cells @@ -4983,14 +4970,14 @@ namespace CondenserLoopTowers { int LoopNum; int LoopSideNum; - static int SpeedSel(0); + int SpeedSel(0); // Added variables for multicell Real64 WaterMassFlowRatePerCellMin = 0.0; Real64 WaterMassFlowRatePerCellMax; - static int NumCellMin(0); - static int NumCellMax(0); - static int NumCellOn(0); + int NumCellMin(0); + int NumCellMax(0); + int NumCellOn(0); Real64 WaterMassFlowRatePerCell; bool IncrNumCellFlag; // determine if yes or no we increase the number of cells @@ -5595,18 +5582,16 @@ namespace CondenserLoopTowers { std::string OutputChar3; // character string used for warning messages std::string OutputChar4; // character string used for warning messages std::string OutputChar5; // character string used for warning messages - static Real64 TimeStepSysLast(0.0); // last system time step (used to check for downshifting) Real64 CurrentEndTime; // end time of time step for current simulation time step - static Real64 CurrentEndTimeLast(0.0); // end time of time step for last simulation time step int LoopNum; int LoopSideNum; // Added variables for multicell Real64 WaterMassFlowRatePerCellMin = 0.0; Real64 WaterMassFlowRatePerCellMax; - static int NumCellMin(0); - static int NumCellMax(0); - static int NumCellOn(0); + int NumCellMin(0); + int NumCellMax(0); + int NumCellOn(0); Real64 WaterMassFlowRatePerCell; bool IncrNumCellFlag; @@ -5835,11 +5820,11 @@ namespace CondenserLoopTowers { // calculate end time of current time step CurrentEndTime = DataGlobals::CurrentTime + DataHVACGlobals::SysTimeElapsed; - // Print warning messages only when valid and only for the first ocurrance. Let summary provide statistics. + // Print warning messages only when valid and only for the first occurrence. Let summary provide statistics. // Wait for next time step to print warnings. If simulation iterates, print out // the warning for the last iteration only. Must wait for next time step to accomplish this. // If a warning occurs and the simulation down shifts, the warning is not valid. - if (CurrentEndTime > CurrentEndTimeLast && DataHVACGlobals::TimeStepSys >= TimeStepSysLast) { + if (CurrentEndTime > SimpleTower(TowerNum).CurrentEndTimeLast && DataHVACGlobals::TimeStepSys >= SimpleTower(TowerNum).TimeStepSysLast) { if (VSTower(SimpleTower(TowerNum).VSTower).PrintLGMessage) { ++VSTower(SimpleTower(TowerNum).VSTower).VSErrorCountFlowFrac; // Show single warning and pass additional info to ShowRecurringWarningErrorAtEnd @@ -5857,8 +5842,8 @@ namespace CondenserLoopTowers { } // save last system time step and last end time of current time step (used to determine if warning is valid) - TimeStepSysLast = DataHVACGlobals::TimeStepSys; - CurrentEndTimeLast = CurrentEndTime; + SimpleTower(TowerNum).TimeStepSysLast = DataHVACGlobals::TimeStepSys; + SimpleTower(TowerNum).CurrentEndTimeLast = CurrentEndTime; // warn user on first occurrence if flow fraction is greater than maximum for the YorkCalc model, use recurring warning stats if (SimpleTower(TowerNum).TowerModelType == YorkCalcModel || SimpleTower(TowerNum).TowerModelType == YorkCalcUserDefined) { @@ -6123,13 +6108,9 @@ namespace CondenserLoopTowers { // York International Corporation, "YORKcalcTM Software, Chiller-Plant Energy-Estimating Program", // Form 160.00-SG2 (0502). 2002. - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static Real64 PctAirFlow(0.0); // air flow rate ratio (fan power ratio in the case of CoolTools model) - static Real64 FlowFactor(0.0); // water flow rate to air flow rate ratio (L/G) for YorkCalc model - - if (SimpleTower(TowerNum).TowerModelType == YorkCalcModel || SimpleTower(TowerNum).TowerModelType == YorkCalcUserDefined) { - PctAirFlow = AirFlowRatio; - FlowFactor = PctWaterFlow / PctAirFlow; + if (SimpleTower(TowerNum).TowerModelType == YorkCalcModel || SimpleTower(TowerNum).TowerModelType == YorkCalcUserDefined) { + Real64 PctAirFlow = AirFlowRatio; + Real64 FlowFactor = PctWaterFlow / PctAirFlow; Approach = VSTower(SimpleTower(TowerNum).VSTower).Coeff(1) + VSTower(SimpleTower(TowerNum).VSTower).Coeff(2) * Twb + VSTower(SimpleTower(TowerNum).VSTower).Coeff(3) * Twb * Twb + VSTower(SimpleTower(TowerNum).VSTower).Coeff(4) * Tr + VSTower(SimpleTower(TowerNum).VSTower).Coeff(5) * Twb * Tr + VSTower(SimpleTower(TowerNum).VSTower).Coeff(6) * Twb * Twb * Tr + @@ -6155,9 +6136,8 @@ namespace CondenserLoopTowers { VSTower(SimpleTower(TowerNum).VSTower).Coeff(27) * Twb * Twb * Tr * Tr * FlowFactor * FlowFactor; } else { // empirical model is CoolTools format - // the CoolTools model actually uses PctFanPower = AirFlowRatio^3 as an input to the model - PctAirFlow = pow_3(AirFlowRatio); + Real64 PctAirFlow = pow_3(AirFlowRatio); Approach = VSTower(SimpleTower(TowerNum).VSTower).Coeff(1) + VSTower(SimpleTower(TowerNum).VSTower).Coeff(2) * PctAirFlow + VSTower(SimpleTower(TowerNum).VSTower).Coeff(3) * PctAirFlow * PctAirFlow + @@ -6226,13 +6206,11 @@ namespace CondenserLoopTowers { // na // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - static std::string OutputChar; // character string for warning messages - static std::string OutputCharLo; // character string for warning messages - static std::string OutputCharHi; // character string for warning messages - static std::string TrimValue; // character string for warning messages - static Real64 TimeStepSysLast(0.0); // last system time step (used to check for downshifting) - static Real64 CurrentEndTime(0.0); // end time of time step for current simulation time step - static Real64 CurrentEndTimeLast(0.0); // end time of time step for last simulation time step + std::string OutputChar; // character string for warning messages + std::string OutputCharLo; // character string for warning messages + std::string OutputCharHi; // character string for warning messages + std::string TrimValue; // character string for warning messages + Real64 CurrentEndTime(0.0); // end time of time step for current simulation time step // current end time is compared with last to see if time step changed // initialize capped variables in case independent variables are in bounds @@ -6248,7 +6226,7 @@ namespace CondenserLoopTowers { // Wait for next time step to print warnings. If simulation iterates, print out // the warning for the last iteration only. Must wait for next time step to accomplish this. // If a warning occurs and the simulation down shifts, the warning is not valid. - if (CurrentEndTime > CurrentEndTimeLast && DataHVACGlobals::TimeStepSys >= TimeStepSysLast) { + if (CurrentEndTime > SimpleTower(TowerNum).CurrentEndTimeLast && DataHVACGlobals::TimeStepSys >= SimpleTower(TowerNum).TimeStepSysLast) { if (VSTower(SimpleTower(TowerNum).VSTower).PrintTrMessage) { ++VSTower(SimpleTower(TowerNum).VSTower).VSErrorCountTR; if (VSTower(SimpleTower(TowerNum).VSTower).VSErrorCountTR < 2) { @@ -6314,8 +6292,8 @@ namespace CondenserLoopTowers { } // save last system time step and last end time of current time step (used to determine if warning is valid) - TimeStepSysLast = DataHVACGlobals::TimeStepSys; - CurrentEndTimeLast = CurrentEndTime; + SimpleTower(TowerNum).TimeStepSysLast = DataHVACGlobals::TimeStepSys; + SimpleTower(TowerNum).CurrentEndTimeLast = CurrentEndTime; // check boundaries of independent variables and post warnings to individual buffers to print at end of time step if (Twb < VSTower(SimpleTower(TowerNum).VSTower).MinInletAirWBTemp || Twb > VSTower(SimpleTower(TowerNum).VSTower).MaxInletAirWBTemp) { @@ -6608,9 +6586,9 @@ namespace CondenserLoopTowers { Real64 AirDensity; Real64 AirMassFlowRate; Real64 AvailTankVdot; - static Real64 BlowDownVdot(0.0); - static Real64 DriftVdot(0.0); - static Real64 EvapVdot(0.0); + Real64 BlowDownVdot(0.0); + Real64 DriftVdot(0.0); + Real64 EvapVdot(0.0); Real64 InletAirEnthalpy; Real64 InSpecificHumRat; Real64 OutSpecificHumRat; diff --git a/src/EnergyPlus/CondenserLoopTowers.hh b/src/EnergyPlus/CondenserLoopTowers.hh index c01f2f1857d..67ccc3b92b7 100644 --- a/src/EnergyPlus/CondenserLoopTowers.hh +++ b/src/EnergyPlus/CondenserLoopTowers.hh @@ -250,6 +250,10 @@ namespace CondenserLoopTowers { int FaultyTowerFoulingIndex; // Index of the fouling fault object corresponding to the condenser Real64 FaultyTowerFoulingFactor; // Tower fouling factor std::string EndUseSubcategory; // identifier use for the end use subcategory + bool envrnFlag; + bool oneTimeFlag; + Real64 TimeStepSysLast; // last system time step (used to check for downshifting) + Real64 CurrentEndTimeLast; // end time of time step for last simulation time step // Default Constructor Towerspecs() @@ -280,7 +284,7 @@ namespace CondenserLoopTowers { VSMerkelAFRErrorFail(0), VSMerkelAFRErrorFailIndex(0), DesInletWaterTemp(0), DesOutletWaterTemp(0), DesInletAirDBTemp(0), DesInletAirWBTemp(0), DesApproach(0), DesRange(0), TowerInletCondsAutoSize(false), FaultyCondenserSWTFlag(false), FaultyCondenserSWTIndex(0), FaultyCondenserSWTOffset(0.0), FaultyTowerFoulingFlag(false), FaultyTowerFoulingIndex(0), - FaultyTowerFoulingFactor(1.0) + FaultyTowerFoulingFactor(1.0), envrnFlag(true), oneTimeFlag(true), TimeStepSysLast(0.0), CurrentEndTimeLast(0.0) { } }; From 9d1b75008229c1f5d5d316228662e17c540dae79 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 6 Sep 2019 13:17:18 -0500 Subject: [PATCH 048/136] Step 05 - Renamed module level vars - Still 4 ERR diffs --- src/EnergyPlus/CondenserLoopTowers.cc | 544 +++++++++++++------------- src/EnergyPlus/CondenserLoopTowers.hh | 22 +- 2 files changed, 282 insertions(+), 284 deletions(-) diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 96c6cf3c109..f8a896376ff 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -140,19 +140,18 @@ namespace CondenserLoopTowers { int NumSimpleTowers(0); // Number of similar towers bool GetInput(true); - bool InitTowerOneTimeFlag(true); - - Real64 InletWaterTemp(0.0); // CW temperature at tower inlet - Real64 OutletWaterTemp(0.0); // CW temperature at tower outlet - int WaterInletNode(0); // Node number at tower inlet - int WaterOutletNode(0); // Node number at tower outlet - Real64 WaterMassFlowRate(0.0); // WaterMassFlowRate through tower - Real64 Qactual(0.0); // Tower heat transfer - Real64 CTFanPower(0.0); // Tower fan power used - Real64 AirFlowRateRatio(0.0); // Ratio of air flow rate through VS cooling tower to design air flow rate - Real64 BasinHeaterPower(0.0); // Basin heater power use (W) - Real64 WaterUsage(0.0); // Tower water usage (m3/s) - Real64 FanCyclingRatio(0.0); // cycling ratio of tower fan when min fan speed provide to much capacity + + Real64 __InletWaterTemp(0.0); // CW temperature at tower inlet + Real64 __OutletWaterTemp(0.0); // CW temperature at tower outlet + int __WaterInletNode(0); // Node number at tower inlet + int __WaterOutletNode(0); // Node number at tower outlet + Real64 __WaterMassFlowRate(0.0); // WaterMassFlowRate through tower + Real64 __Qactual(0.0); // Tower heat transfer + Real64 __CTFanPower(0.0); // Tower fan power used + Real64 __AirFlowRateRatio(0.0); // Ratio of air flow rate through VS cooling tower to design air flow rate + Real64 __BasinHeaterPower(0.0); // Basin heater power use (W) + Real64 __WaterUsage(0.0); // Tower water usage (m3/s) + Real64 __FanCyclingRatio(0.0); // cycling ratio of tower fan when min fan speed provide to much capacity Array1D_bool CheckEquipName; @@ -168,18 +167,17 @@ namespace CondenserLoopTowers { { NumSimpleTowers = 0; GetInput = true; - InitTowerOneTimeFlag = true; - InletWaterTemp = 0.0; - OutletWaterTemp = 0.0; - WaterInletNode = 0; - WaterOutletNode = 0; - WaterMassFlowRate = 0.0; - Qactual = 0.0; - CTFanPower = 0.0; - AirFlowRateRatio = 0.0; - BasinHeaterPower = 0.0; - WaterUsage = 0.0; - FanCyclingRatio = 0.0; + __InletWaterTemp = 0.0; + __OutletWaterTemp = 0.0; + __WaterInletNode = 0; + __WaterOutletNode = 0; + __WaterMassFlowRate = 0.0; + __Qactual = 0.0; + __CTFanPower = 0.0; + __AirFlowRateRatio = 0.0; + __BasinHeaterPower = 0.0; + __WaterUsage = 0.0; + __FanCyclingRatio = 0.0; CheckEquipName.deallocate(); SimpleTower.deallocate(); UniqueSimpleTowerNames.clear(); @@ -2389,17 +2387,17 @@ namespace CondenserLoopTowers { // PURPOSE OF THIS SUBROUTINE: // Initialize the simulation variables. - InletWaterTemp = 0.0; // CW temperature at tower inlet - OutletWaterTemp = 0.0; // CW temperature at tower outlet - WaterInletNode = 0; // Node number at tower inlet - WaterOutletNode = 0; // Node number at tower outlet - WaterMassFlowRate = 0.0; // WaterMassFlowRate through tower - Qactual = 0.0; // Tower heat transfer - CTFanPower = 0.0; // Tower fan power used - AirFlowRateRatio = 0.0; // Ratio of air flow rate through VS cooling tower to design air flow rate - BasinHeaterPower = 0.0; // Basin heater power use (W) - WaterUsage = 0.0; // Tower water usage (m3/s) - FanCyclingRatio = 0.0; // cycling ratio of tower fan when min fan speed provide to much capacity + __InletWaterTemp = 0.0; // CW temperature at tower inlet + __OutletWaterTemp = 0.0; // CW temperature at tower outlet + __WaterInletNode = 0; // Node number at tower inlet + __WaterOutletNode = 0; // Node number at tower outlet + __WaterMassFlowRate = 0.0; // WaterMassFlowRate through tower + __Qactual = 0.0; // Tower heat transfer + __CTFanPower = 0.0; // Tower fan power used + __AirFlowRateRatio = 0.0; // Ratio of air flow rate through VS cooling tower to design air flow rate + __BasinHeaterPower = 0.0; // Basin heater power use (W) + __WaterUsage = 0.0; // Tower water usage (m3/s) + __FanCyclingRatio = 0.0; // cycling ratio of tower fan when min fan speed provide to much capacity } void InitTower(int const TowerNum, // Number of the current cooling tower being simulated @@ -2496,8 +2494,8 @@ namespace CondenserLoopTowers { } // Each time initializations - WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; - SimpleTowerInlet(TowerNum).WaterTemp = DataLoopNode::Node(WaterInletNode).Temp; + __WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; + SimpleTowerInlet(TowerNum).WaterTemp = DataLoopNode::Node(__WaterInletNode).Temp; if (SimpleTower(TowerNum).OutdoorAirInletNodeNum != 0) { SimpleTowerInlet(TowerNum).AirTemp = DataLoopNode::Node(SimpleTower(TowerNum).OutdoorAirInletNodeNum).Temp; @@ -2513,14 +2511,14 @@ namespace CondenserLoopTowers { SimpleTowerInlet(TowerNum).AirWetBulb = DataEnvironment::OutWetBulbTemp; } - WaterMassFlowRate = + __WaterMassFlowRate = PlantUtilities::RegulateCondenserCompFlowReqOp(SimpleTower(TowerNum).LoopNum, SimpleTower(TowerNum).LoopSideNum, SimpleTower(TowerNum).BranchNum, SimpleTower(TowerNum).CompNum, SimpleTower(TowerNum).DesWaterMassFlowRate * SimpleTower(TowerNum).TowerMassFlowRateMultiplier); - PlantUtilities::SetComponentFlowRate(WaterMassFlowRate, + PlantUtilities::SetComponentFlowRate(__WaterMassFlowRate, SimpleTower(TowerNum).WaterInletNodeNum, SimpleTower(TowerNum).WaterOutletNodeNum, SimpleTower(TowerNum).LoopNum, @@ -2530,7 +2528,7 @@ namespace CondenserLoopTowers { // Added for fluid bypass. 8/2008 SimpleTower(TowerNum).BypassFraction = 0.0; - BasinHeaterPower = 0.0; + __BasinHeaterPower = 0.0; } void SizeTower(int const TowerNum) @@ -4650,11 +4648,11 @@ namespace CondenserLoopTowers { int LoopSideNum; // set inlet and outlet nodes - WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; - WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; - Qactual = 0.0; - CTFanPower = 0.0; - OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; + __WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; + __WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; + __Qactual = 0.0; + __CTFanPower = 0.0; + __OutletWaterTemp = DataLoopNode::Node(__WaterInletNode).Temp; LoopNum = SimpleTower(TowerNum).LoopNum; LoopSideNum = SimpleTower(TowerNum).LoopSideNum; @@ -4666,13 +4664,13 @@ namespace CondenserLoopTowers { auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPoint; + TempSetPoint = DataLoopNode::Node(__WaterOutletNode).TempSetPoint; } else { TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPointHi; + TempSetPoint = DataLoopNode::Node(__WaterOutletNode).TempSetPointHi; } else { TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; } @@ -4718,8 +4716,8 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).DesWaterMassFlowRate * SimpleTower(TowerNum).MaxFracFlowRate / SimpleTower(TowerNum).NumCell; // round it up to the nearest integer - NumCellMin = min(int((WaterMassFlowRate / WaterMassFlowRatePerCellMax) + 0.9999), SimpleTower(TowerNum).NumCell); - NumCellMax = min(int((WaterMassFlowRate / WaterMassFlowRatePerCellMin) + 0.9999), SimpleTower(TowerNum).NumCell); + NumCellMin = min(int((__WaterMassFlowRate / WaterMassFlowRatePerCellMax) + 0.9999), SimpleTower(TowerNum).NumCell); + NumCellMax = min(int((__WaterMassFlowRate / WaterMassFlowRatePerCellMin) + 0.9999), SimpleTower(TowerNum).NumCell); } // cap min at 1 @@ -4733,17 +4731,17 @@ namespace CondenserLoopTowers { } SimpleTower(TowerNum).NumCellOn = NumCellOn; - WaterMassFlowRatePerCell = WaterMassFlowRate / NumCellOn; + WaterMassFlowRatePerCell = __WaterMassFlowRate / NumCellOn; // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. // MassFlowTolerance is a parameter to indicate a no flow condition - if (WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { + if (__WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { // for multiple cells, we assume that it's a common basin CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, - BasinHeaterPower); + __BasinHeaterPower); return; } @@ -4755,15 +4753,15 @@ namespace CondenserLoopTowers { // Initialize local variables to the free convection design values UAdesign = FreeConvTowerUA / SimpleTower(TowerNum).NumCell; AirFlowRate = SimpleTower(TowerNum).FreeConvAirFlowRate / SimpleTower(TowerNum).NumCell; - OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp; - OutletWaterTemp = OutletWaterTempOFF; + OutletWaterTempOFF = DataLoopNode::Node(__WaterInletNode).Temp; + __OutletWaterTemp = OutletWaterTempOFF; FanModeFrac = 0.0; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRate, UAdesign, OutletWaterTempOFF); // Assume Setpoint was met using free convection regime (pump ON and fan OFF) - CTFanPower = 0.0; - OutletWaterTemp = OutletWaterTempOFF; + __CTFanPower = 0.0; + __OutletWaterTemp = OutletWaterTempOFF; if (OutletWaterTempOFF > TempSetPoint) { // Setpoint was not met (or free conv. not used), turn on cooling tower fan @@ -4773,28 +4771,28 @@ namespace CondenserLoopTowers { // The fan power is for all cells operating FanPowerOn = SimpleTower(TowerNum).HighSpeedFanPower * NumCellOn / SimpleTower(TowerNum).NumCell; - SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRate, UAdesign, OutletWaterTemp); + SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRate, UAdesign, __OutletWaterTemp); - if (OutletWaterTemp <= TempSetPoint) { - if (CapacityControl == CapacityControl_FanCycling || OutletWaterTemp <= OWTLowerLimit) { + if (__OutletWaterTemp <= TempSetPoint) { + if (CapacityControl == CapacityControl_FanCycling || __OutletWaterTemp <= OWTLowerLimit) { // Setpoint was met with pump ON and fan ON, calculate run-time fraction - FanModeFrac = (TempSetPoint - OutletWaterTempOFF) / (OutletWaterTemp - OutletWaterTempOFF); - CTFanPower = FanModeFrac * FanPowerOn; - OutletWaterTemp = TempSetPoint; + FanModeFrac = (TempSetPoint - OutletWaterTempOFF) / (__OutletWaterTemp - OutletWaterTempOFF); + __CTFanPower = FanModeFrac * FanPowerOn; + __OutletWaterTemp = TempSetPoint; } else { // FluidBypass, fan runs at full speed for the entire time step FanModeFrac = 1.0; - CTFanPower = FanPowerOn; + __CTFanPower = FanPowerOn; BypassFlag = 1; } } else { // Setpoint was not met, cooling tower ran at full capacity FanModeFrac = 1.0; - CTFanPower = FanPowerOn; + __CTFanPower = FanPowerOn; // if possible increase the number of cells and do the calculations again with the new water mass flow rate per cell - if (NumCellOn < SimpleTower(TowerNum).NumCell && (WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin) { + if (NumCellOn < SimpleTower(TowerNum).NumCell && (__WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin) { ++NumCellOn; - WaterMassFlowRatePerCell = WaterMassFlowRate / NumCellOn; + WaterMassFlowRatePerCell = __WaterMassFlowRate / NumCellOn; IncrNumCellFlag = true; } } @@ -4813,51 +4811,51 @@ namespace CondenserLoopTowers { // between the new and old bypass fractions is less than the threshold. if (BypassFlag == 1) { // Inlet water temperature lower than setpoint, assume 100% bypass, tower fan off - if (InletWaterTemp <= TempSetPoint) { - CTFanPower = 0.0; + if (__InletWaterTemp <= TempSetPoint) { + __CTFanPower = 0.0; SimpleTower(TowerNum).BypassFraction = 1.0; - OutletWaterTemp = InletWaterTemp; + __OutletWaterTemp = __InletWaterTemp; } else { - if (std::abs(InletWaterTemp - OutletWaterTemp) <= 0.01) { + if (std::abs(__InletWaterTemp - __OutletWaterTemp) <= 0.01) { // Outlet temp is close enough to inlet temp, assume 100% bypass, tower fan off SimpleTower(TowerNum).BypassFraction = 1.0; - CTFanPower = 0.0; + __CTFanPower = 0.0; } else { - BypassFraction = (TempSetPoint - OutletWaterTemp) / (InletWaterTemp - OutletWaterTemp); + BypassFraction = (TempSetPoint - __OutletWaterTemp) / (__InletWaterTemp - __OutletWaterTemp); if (BypassFraction > 1.0 || BypassFraction < 0.0) { // Bypass cannot meet setpoint, assume no bypass SimpleTower(TowerNum).BypassFraction = 0.0; } else { NumIteration = 0; BypassFractionPrev = BypassFraction; - OutletWaterTempPrev = OutletWaterTemp; + OutletWaterTempPrev = __OutletWaterTemp; while (NumIteration < MaxIteration) { ++NumIteration; // need to iterate for the new OutletWaterTemp while bypassing tower water - SimSimpleTower(TowerNum, WaterMassFlowRatePerCell * (1.0 - BypassFraction), AirFlowRate, UAdesign, OutletWaterTemp); + SimSimpleTower(TowerNum, WaterMassFlowRatePerCell * (1.0 - BypassFraction), AirFlowRate, UAdesign, __OutletWaterTemp); // Calc new BypassFraction based on the new OutletWaterTemp - if (std::abs(OutletWaterTemp - OWTLowerLimit) <= 0.01) { + if (std::abs(__OutletWaterTemp - OWTLowerLimit) <= 0.01) { BypassFraction2 = BypassFraction; break; - } else if (OutletWaterTemp < OWTLowerLimit) { + } else if (__OutletWaterTemp < OWTLowerLimit) { // Set OutletWaterTemp = OWTLowerLimit, and use linear interpolation to calculate the bypassFraction BypassFraction2 = BypassFractionPrev - (BypassFractionPrev - BypassFraction) * (OutletWaterTempPrev - OWTLowerLimit) / - (OutletWaterTempPrev - OutletWaterTemp); - SimSimpleTower(TowerNum, WaterMassFlowRatePerCell * (1.0 - BypassFraction2), AirFlowRate, UAdesign, OutletWaterTemp); - if (OutletWaterTemp < OWTLowerLimit) { + (OutletWaterTempPrev - __OutletWaterTemp); + SimSimpleTower(TowerNum, WaterMassFlowRatePerCell * (1.0 - BypassFraction2), AirFlowRate, UAdesign, __OutletWaterTemp); + if (__OutletWaterTemp < OWTLowerLimit) { // Use previous iteraction values BypassFraction2 = BypassFractionPrev; - OutletWaterTemp = OutletWaterTempPrev; + __OutletWaterTemp = OutletWaterTempPrev; } break; } else { - BypassFraction2 = (TempSetPoint - OutletWaterTemp) / (InletWaterTemp - OutletWaterTemp); + BypassFraction2 = (TempSetPoint - __OutletWaterTemp) / (__InletWaterTemp - __OutletWaterTemp); } // Compare two BypassFraction to determine when to stop if (std::abs(BypassFraction2 - BypassFraction) <= BypassFractionThreshold) break; BypassFractionPrev = BypassFraction; - OutletWaterTempPrev = OutletWaterTemp; + OutletWaterTempPrev = __OutletWaterTemp; BypassFraction = BypassFraction2; } if (NumIteration > MaxIteration) { @@ -4866,24 +4864,24 @@ namespace CondenserLoopTowers { } SimpleTower(TowerNum).BypassFraction = BypassFraction2; // may not meet TempSetPoint due to limit of tower outlet temp to OWTLowerLimit - OutletWaterTemp = (1.0 - BypassFraction2) * OutletWaterTemp + BypassFraction2 * InletWaterTemp; + __OutletWaterTemp = (1.0 - BypassFraction2) * __OutletWaterTemp + BypassFraction2 * __InletWaterTemp; } } } } // output the fraction of the time step the fan is ON - FanCyclingRatio = FanModeFrac; + __FanCyclingRatio = FanModeFrac; // output the number of cells operating SimpleTower(TowerNum).NumCellOn = NumCellOn; // Should this be water inlet node num????? CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, - DataLoopNode::Node(WaterInletNode).Temp, + DataLoopNode::Node(__WaterInletNode).Temp, DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Qactual = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); - AirFlowRateRatio = (AirFlowRate * SimpleTower(TowerNum).NumCell) / SimpleTower(TowerNum).HighSpeedAirFlowRate; + __Qactual = __WaterMassFlowRate * CpWater * (DataLoopNode::Node(__WaterInletNode).Temp - __OutletWaterTemp); + __AirFlowRateRatio = (AirFlowRate * SimpleTower(TowerNum).NumCell) / SimpleTower(TowerNum).HighSpeedAirFlowRate; } void CalcTwoSpeedTower(int &TowerNum) @@ -4983,11 +4981,11 @@ namespace CondenserLoopTowers { // set inlet and outlet nodes - WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; - WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; - Qactual = 0.0; - CTFanPower = 0.0; - OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; + __WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; + __WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; + __Qactual = 0.0; + __CTFanPower = 0.0; + __OutletWaterTemp = DataLoopNode::Node(__WaterInletNode).Temp; LoopNum = SimpleTower(TowerNum).LoopNum; LoopSideNum = SimpleTower(TowerNum).LoopSideNum; @@ -4999,13 +4997,13 @@ namespace CondenserLoopTowers { auto const SELECT_CASE_var(DataPlant::PlantLoop(LoopNum).LoopDemandCalcScheme); if (SELECT_CASE_var == DataPlant::SingleSetPoint) { if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPoint; + TempSetPoint = DataLoopNode::Node(__WaterOutletNode).TempSetPoint; } else { TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPoint; } } else if (SELECT_CASE_var == DataPlant::DualSetPointDeadBand) { if (SimpleTower(TowerNum).SetpointIsOnOutlet) { - TempSetPoint = DataLoopNode::Node(WaterOutletNode).TempSetPointHi; + TempSetPoint = DataLoopNode::Node(__WaterOutletNode).TempSetPointHi; } else { TempSetPoint = DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).TempSetPointHi; } @@ -5040,11 +5038,11 @@ namespace CondenserLoopTowers { // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; // MassFlowTolerance is a parameter to indicate a no flow condition - if (WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { + if (__WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, - BasinHeaterPower); + __BasinHeaterPower); return; } @@ -5056,8 +5054,8 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).DesWaterMassFlowRate * SimpleTower(TowerNum).MaxFracFlowRate / SimpleTower(TowerNum).NumCell; // round it up to the nearest integer - NumCellMin = min(int((WaterMassFlowRate / WaterMassFlowRatePerCellMax) + 0.9999), SimpleTower(TowerNum).NumCell); - NumCellMax = min(int((WaterMassFlowRate / WaterMassFlowRatePerCellMin) + 0.9999), SimpleTower(TowerNum).NumCell); + NumCellMin = min(int((__WaterMassFlowRate / WaterMassFlowRatePerCellMax) + 0.9999), SimpleTower(TowerNum).NumCell); + NumCellMax = min(int((__WaterMassFlowRate / WaterMassFlowRatePerCellMin) + 0.9999), SimpleTower(TowerNum).NumCell); } // cap min at 1 @@ -5071,7 +5069,7 @@ namespace CondenserLoopTowers { } SimpleTower(TowerNum).NumCellOn = NumCellOn; - WaterMassFlowRatePerCell = WaterMassFlowRate / NumCellOn; + WaterMassFlowRatePerCell = __WaterMassFlowRate / NumCellOn; IncrNumCellFlag = true; @@ -5081,17 +5079,17 @@ namespace CondenserLoopTowers { // set local variable for tower UAdesign = FreeConvTowerUA / SimpleTower(TowerNum).NumCell; // where is NumCellOn? AirFlowRate = SimpleTower(TowerNum).FreeConvAirFlowRate / SimpleTower(TowerNum).NumCell; - OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp; - WaterMassFlowRate = DataLoopNode::Node(WaterInletNode).MassFlowRate; - OutletWaterTemp1stStage = OutletWaterTemp; - OutletWaterTemp2ndStage = OutletWaterTemp; + OutletWaterTempOFF = DataLoopNode::Node(__WaterInletNode).Temp; + __WaterMassFlowRate = DataLoopNode::Node(__WaterInletNode).MassFlowRate; + OutletWaterTemp1stStage = __OutletWaterTemp; + OutletWaterTemp2ndStage = __OutletWaterTemp; FanModeFrac = 0.0; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRate, UAdesign, OutletWaterTempOFF); // Setpoint was met using free convection regime (pump ON and fan OFF) - CTFanPower = 0.0; - OutletWaterTemp = OutletWaterTempOFF; + __CTFanPower = 0.0; + __OutletWaterTemp = OutletWaterTempOFF; SpeedSel = 0; if (OutletWaterTempOFF > TempSetPoint) { @@ -5105,9 +5103,9 @@ namespace CondenserLoopTowers { if (OutletWaterTemp1stStage <= TempSetPoint) { // Setpoint was met with pump ON and fan ON 1st stage, calculate fan mode fraction FanModeFrac = (TempSetPoint - OutletWaterTempOFF) / (OutletWaterTemp1stStage - OutletWaterTempOFF); - CTFanPower = FanModeFrac * FanPowerLow; - OutletWaterTemp = TempSetPoint; - Qactual *= FanModeFrac; + __CTFanPower = FanModeFrac * FanPowerLow; + __OutletWaterTemp = TempSetPoint; + __Qactual *= FanModeFrac; SpeedSel = 1; } else { // Setpoint was not met, turn on cooling tower 2nd stage fan @@ -5120,19 +5118,19 @@ namespace CondenserLoopTowers { if ((OutletWaterTemp2ndStage <= TempSetPoint) && UAdesign > 0.0) { // Setpoint was met with pump ON and fan ON 2nd stage, calculate fan mode fraction FanModeFrac = (TempSetPoint - OutletWaterTemp1stStage) / (OutletWaterTemp2ndStage - OutletWaterTemp1stStage); - CTFanPower = (FanModeFrac * FanPowerHigh) + (1.0 - FanModeFrac) * FanPowerLow; - OutletWaterTemp = TempSetPoint; + __CTFanPower = (FanModeFrac * FanPowerHigh) + (1.0 - FanModeFrac) * FanPowerLow; + __OutletWaterTemp = TempSetPoint; SpeedSel = 2; } else { // Setpoint was not met, cooling tower ran at full capacity - OutletWaterTemp = OutletWaterTemp2ndStage; - CTFanPower = FanPowerHigh; + __OutletWaterTemp = OutletWaterTemp2ndStage; + __CTFanPower = FanPowerHigh; SpeedSel = 2; FanModeFrac = 1.0; // if possible increase the number of cells and do the calculations again with the new water mass flow rate per cell - if (NumCellOn < SimpleTower(TowerNum).NumCell && (WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin) { + if (NumCellOn < SimpleTower(TowerNum).NumCell && (__WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin) { ++NumCellOn; - WaterMassFlowRatePerCell = WaterMassFlowRate / NumCellOn; + WaterMassFlowRatePerCell = __WaterMassFlowRate / NumCellOn; IncrNumCellFlag = true; } } @@ -5141,16 +5139,16 @@ namespace CondenserLoopTowers { } // output the fraction of the time step the fan is ON - FanCyclingRatio = FanModeFrac; + __FanCyclingRatio = FanModeFrac; SimpleTower(TowerNum).SpeedSelected = SpeedSel; SimpleTower(TowerNum).NumCellOn = NumCellOn; CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, - DataLoopNode::Node(WaterInletNode).Temp, + DataLoopNode::Node(__WaterInletNode).Temp, DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Qactual = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); - AirFlowRateRatio = (AirFlowRate * SimpleTower(TowerNum).NumCell) / SimpleTower(TowerNum).HighSpeedAirFlowRate; + __Qactual = __WaterMassFlowRate * CpWater * (DataLoopNode::Node(__WaterInletNode).Temp - __OutletWaterTemp); + __AirFlowRateRatio = (AirFlowRate * SimpleTower(TowerNum).NumCell) / SimpleTower(TowerNum).HighSpeedAirFlowRate; } void CalcMerkelVariableSpeedTower(int const TowerNum, Real64 &MyLoad) @@ -5201,15 +5199,15 @@ namespace CondenserLoopTowers { Real64 MinSpeedFanQdot; Real64 FanPowerAdjustFac; - WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; + __WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, - DataLoopNode::Node(WaterInletNode).Temp, + DataLoopNode::Node(__WaterInletNode).Temp, DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; - Qactual = 0.0; - CTFanPower = 0.0; - OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; + __WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; + __Qactual = 0.0; + __CTFanPower = 0.0; + __OutletWaterTemp = DataLoopNode::Node(__WaterInletNode).Temp; LoopNum = SimpleTower(TowerNum).LoopNum; LoopSideNum = SimpleTower(TowerNum).LoopSideNum; @@ -5245,8 +5243,8 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).DesWaterMassFlowRate * SimpleTower(TowerNum).MaxFracFlowRate / SimpleTower(TowerNum).NumCell; // round it up to the nearest integer - NumCellMin = min(int((WaterMassFlowRate / WaterMassFlowRatePerCellMax) + 0.9999), SimpleTower(TowerNum).NumCell); - NumCellMax = min(int((WaterMassFlowRate / WaterMassFlowRatePerCellMin) + 0.9999), SimpleTower(TowerNum).NumCell); + NumCellMin = min(int((__WaterMassFlowRate / WaterMassFlowRatePerCellMax) + 0.9999), SimpleTower(TowerNum).NumCell); + NumCellMax = min(int((__WaterMassFlowRate / WaterMassFlowRatePerCellMin) + 0.9999), SimpleTower(TowerNum).NumCell); } // cap min at 1 @@ -5260,49 +5258,49 @@ namespace CondenserLoopTowers { } SimpleTower(TowerNum).NumCellOn = NumCellOn; - WaterMassFlowRatePerCell = WaterMassFlowRate / NumCellOn; + WaterMassFlowRatePerCell = __WaterMassFlowRate / NumCellOn; // MassFlowTolerance is a parameter to indicate a no flow condition - if (WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || (MyLoad > DataHVACGlobals::SmallLoad)) { + if (__WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || (MyLoad > DataHVACGlobals::SmallLoad)) { // for multiple cells, we assume that it's a common bassin CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, - BasinHeaterPower); + __BasinHeaterPower); return; } if (std::abs(MyLoad) <= DataHVACGlobals::SmallLoad) { // tower doesn't need to do anything - OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; - CTFanPower = 0.0; - AirFlowRateRatio = 0.0; - Qactual = 0.0; + __OutletWaterTemp = DataLoopNode::Node(__WaterInletNode).Temp; + __CTFanPower = 0.0; + __AirFlowRateRatio = 0.0; + __Qactual = 0.0; CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, - BasinHeaterPower); + __BasinHeaterPower); return; } // first find free convection cooling rate UAdesignPerCell = FreeConvTowerUA / SimpleTower(TowerNum).NumCell; AirFlowRatePerCell = SimpleTower(TowerNum).FreeConvAirFlowRate / SimpleTower(TowerNum).NumCell; - OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp; - WaterMassFlowRate = DataLoopNode::Node(WaterInletNode).MassFlowRate; + OutletWaterTempOFF = DataLoopNode::Node(__WaterInletNode).Temp; + __WaterMassFlowRate = DataLoopNode::Node(__WaterInletNode).MassFlowRate; SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAdesignPerCell, OutletWaterTempOFF); - FreeConvQdot = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTempOFF); - CTFanPower = 0.0; + FreeConvQdot = __WaterMassFlowRate * CpWater * (DataLoopNode::Node(__WaterInletNode).Temp - OutletWaterTempOFF); + __CTFanPower = 0.0; if (std::abs(MyLoad) <= FreeConvQdot) { // can meet load with free convection and fan off - OutletWaterTemp = OutletWaterTempOFF; - AirFlowRateRatio = 0.0; - Qactual = FreeConvQdot; + __OutletWaterTemp = OutletWaterTempOFF; + __AirFlowRateRatio = 0.0; + __Qactual = FreeConvQdot; CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, - BasinHeaterPower); + __BasinHeaterPower); return; } @@ -5310,64 +5308,64 @@ namespace CondenserLoopTowers { // next find full fan speed cooling rate UAdesignPerCell = HighSpeedTowerUA / SimpleTower(TowerNum).NumCell; AirFlowRatePerCell = SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; - AirFlowRateRatio = 1.0; + __AirFlowRateRatio = 1.0; WaterFlowRateRatio = WaterMassFlowRatePerCell / SimpleTower(TowerNum).DesWaterMassFlowRatePerCell; UAwetbulbAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncWetBulbDiffCurvePtr, (DesignWetBulb - SimpleTowerInlet(TowerNum).AirWetBulb)); - UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); + UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, __AirFlowRateRatio); UAwaterflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncWaterFlowRatioCurvePtr, WaterFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; - SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTemp); - FullSpeedFanQdot = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); + SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, __OutletWaterTemp); + FullSpeedFanQdot = __WaterMassFlowRate * CpWater * (DataLoopNode::Node(__WaterInletNode).Temp - __OutletWaterTemp); if (FullSpeedFanQdot <= std::abs(MyLoad)) { // full speed is what we want. if ((FullSpeedFanQdot + DataHVACGlobals::SmallLoad) < std::abs(MyLoad) && (NumCellOn < SimpleTower(TowerNum).NumCell) && - ((WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin)) { + ((__WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin)) { // If full fan and not meeting setpoint, then increase number of cells until all are used or load is satisfied IncrNumCellFlag = true; // set value to true to enter in the loop while (IncrNumCellFlag) { ++NumCellOn; SimpleTower(TowerNum).NumCellOn = NumCellOn; - WaterMassFlowRatePerCell = WaterMassFlowRate / NumCellOn; + WaterMassFlowRatePerCell = __WaterMassFlowRate / NumCellOn; WaterFlowRateRatio = WaterMassFlowRatePerCell / SimpleTower(TowerNum).DesWaterMassFlowRatePerCell; UAwaterflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncWaterFlowRatioCurvePtr, WaterFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; - SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTemp); + SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, __OutletWaterTemp); IncrNumCellFlag = (FullSpeedFanQdot + DataHVACGlobals::SmallLoad) < std::abs(MyLoad) && (NumCellOn < SimpleTower(TowerNum).NumCell) && - ((WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin); + ((__WaterMassFlowRate / (NumCellOn + 1)) >= WaterMassFlowRatePerCellMin); } - FullSpeedFanQdot = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); + FullSpeedFanQdot = __WaterMassFlowRate * CpWater * (DataLoopNode::Node(__WaterInletNode).Temp - __OutletWaterTemp); } - Qactual = FullSpeedFanQdot; + __Qactual = FullSpeedFanQdot; CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, - BasinHeaterPower); + __BasinHeaterPower); // now calculate fan power - FanPowerAdjustFac = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); - CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * FanPowerAdjustFac * NumCellOn / SimpleTower(TowerNum).NumCell; + FanPowerAdjustFac = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, __AirFlowRateRatio); + __CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * FanPowerAdjustFac * NumCellOn / SimpleTower(TowerNum).NumCell; return; } // next find minimum air flow ratio cooling rate - AirFlowRateRatio = SimpleTower(TowerNum).MinimumVSAirFlowFrac; - AirFlowRatePerCell = AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; - UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); + __AirFlowRateRatio = SimpleTower(TowerNum).MinimumVSAirFlowFrac; + AirFlowRatePerCell = __AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; + UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, __AirFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; - SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTemp); - MinSpeedFanQdot = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); + SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, __OutletWaterTemp); + MinSpeedFanQdot = __WaterMassFlowRate * CpWater * (DataLoopNode::Node(__WaterInletNode).Temp - __OutletWaterTemp); if (std::abs(MyLoad) <= MinSpeedFanQdot) { // min fan speed already exceeds load) - Qactual = MinSpeedFanQdot; + __Qactual = MinSpeedFanQdot; CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, - BasinHeaterPower); + __BasinHeaterPower); // now calculate fan power - FanPowerAdjustFac = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); - CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * FanPowerAdjustFac * NumCellOn / SimpleTower(TowerNum).NumCell; + FanPowerAdjustFac = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, __AirFlowRateRatio); + __CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * FanPowerAdjustFac * NumCellOn / SimpleTower(TowerNum).NumCell; return; } @@ -5381,9 +5379,9 @@ namespace CondenserLoopTowers { Par(5) = UAwetbulbAdjFac; Par(6) = UAwaterflowAdjFac; Par(7) = CpWater; - Par(8) = WaterMassFlowRate; + Par(8) = __WaterMassFlowRate; - General::SolveRoot(Acc, MaxIte, SolFla, AirFlowRateRatio, VSMerkelResidual, SimpleTower(TowerNum).MinimumVSAirFlowFrac, 1.0, Par); + General::SolveRoot(Acc, MaxIte, SolFla, __AirFlowRateRatio, VSMerkelResidual, SimpleTower(TowerNum).MinimumVSAirFlowFrac, 1.0, Par); if (SolFla == -1) { if (!DataGlobals::WarmupFlag) { @@ -5393,51 +5391,51 @@ namespace CondenserLoopTowers { " - Iteration limit exceeded calculating variable speed fan ratio for unit = " + SimpleTower(TowerNum).Name); ShowContinueError("Estimated air flow ratio = " + General::RoundSigDigits((std::abs(MyLoad) - MinSpeedFanQdot) / (FullSpeedFanQdot - MinSpeedFanQdot), 4)); - ShowContinueError("Calculated air flow ratio = " + General::RoundSigDigits(AirFlowRateRatio, 4)); + ShowContinueError("Calculated air flow ratio = " + General::RoundSigDigits(__AirFlowRateRatio, 4)); ShowContinueErrorTimeStamp("The calculated air flow ratio will be used and the simulation continues. Occurrence info:"); } ShowRecurringWarningErrorAtEnd( cCoolingTower_VariableSpeedMerkel + " \"" + SimpleTower(TowerNum).Name + "\" - Iteration limit exceeded calculating air flow ratio error continues. air flow ratio statistics follow.", SimpleTower(TowerNum).VSMerkelAFRErrorIterIndex, - AirFlowRateRatio, - AirFlowRateRatio); + __AirFlowRateRatio, + __AirFlowRateRatio); } } else if (SolFla == -2) { - AirFlowRateRatio = (std::abs(MyLoad) - MinSpeedFanQdot) / (FullSpeedFanQdot - MinSpeedFanQdot); + __AirFlowRateRatio = (std::abs(MyLoad) - MinSpeedFanQdot) / (FullSpeedFanQdot - MinSpeedFanQdot); if (!DataGlobals::WarmupFlag) { if (SimpleTower(TowerNum).VSMerkelAFRErrorFail < 1) { ++SimpleTower(TowerNum).VSMerkelAFRErrorFail; ShowWarningError(cCoolingTower_VariableSpeedMerkel + " - solver failed calculating variable speed fan ratio for unit = " + SimpleTower(TowerNum).Name); - ShowContinueError("Estimated air flow ratio = " + General::RoundSigDigits(AirFlowRateRatio, 4)); + ShowContinueError("Estimated air flow ratio = " + General::RoundSigDigits(__AirFlowRateRatio, 4)); ShowContinueErrorTimeStamp("The estimated air flow ratio will be used and the simulation continues. Occurrence info:"); } ShowRecurringWarningErrorAtEnd( cCoolingTower_VariableSpeedMerkel + " \"" + SimpleTower(TowerNum).Name + "\" - solver failed calculating air flow ratio error continues. air flow ratio statistics follow.", SimpleTower(TowerNum).VSMerkelAFRErrorFailIndex, - AirFlowRateRatio, - AirFlowRateRatio); + __AirFlowRateRatio, + __AirFlowRateRatio); } } // now rerun to get peformance with AirFlowRateRatio - AirFlowRatePerCell = AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; + AirFlowRatePerCell = __AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate / SimpleTower(TowerNum).NumCell; - UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, AirFlowRateRatio); + UAairflowAdjFac = CurveManager::CurveValue(SimpleTower(TowerNum).UAModFuncAirFlowRatioCurvePtr, __AirFlowRateRatio); UAadjustedPerCell = UAdesignPerCell * UAwetbulbAdjFac * UAairflowAdjFac * UAwaterflowAdjFac; - SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, OutletWaterTemp); - Qactual = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); + SimSimpleTower(TowerNum, WaterMassFlowRatePerCell, AirFlowRatePerCell, UAadjustedPerCell, __OutletWaterTemp); + __Qactual = __WaterMassFlowRate * CpWater * (DataLoopNode::Node(__WaterInletNode).Temp - __OutletWaterTemp); CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, - BasinHeaterPower); + __BasinHeaterPower); // now calculate fan power - FanPowerAdjustFac = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); - CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * FanPowerAdjustFac * NumCellOn / SimpleTower(TowerNum).NumCell; + FanPowerAdjustFac = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, __AirFlowRateRatio); + __CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * FanPowerAdjustFac * NumCellOn / SimpleTower(TowerNum).NumCell; } } @@ -5603,8 +5601,8 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).DesWaterMassFlowRate * SimpleTower(TowerNum).MaxFracFlowRate / SimpleTower(TowerNum).NumCell; // round it up to the nearest integer - NumCellMin = min(int((WaterMassFlowRate / WaterMassFlowRatePerCellMax) + 0.9999), SimpleTower(TowerNum).NumCell); - NumCellMax = min(int((WaterMassFlowRate / WaterMassFlowRatePerCellMin) + 0.9999), SimpleTower(TowerNum).NumCell); + NumCellMin = min(int((__WaterMassFlowRate / WaterMassFlowRatePerCellMax) + 0.9999), SimpleTower(TowerNum).NumCell); + NumCellMax = min(int((__WaterMassFlowRate / WaterMassFlowRatePerCellMin) + 0.9999), SimpleTower(TowerNum).NumCell); } // cap min at 1 @@ -5618,17 +5616,17 @@ namespace CondenserLoopTowers { } SimpleTower(TowerNum).NumCellOn = NumCellOn; - WaterMassFlowRatePerCell = WaterMassFlowRate / NumCellOn; + WaterMassFlowRatePerCell = __WaterMassFlowRate / NumCellOn; // Set inlet and outlet nodes and initialize subroutine variables - WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; - WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; - Qactual = 0.0; - CTFanPower = 0.0; - OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; + __WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; + __WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; + __Qactual = 0.0; + __CTFanPower = 0.0; + __OutletWaterTemp = DataLoopNode::Node(__WaterInletNode).Temp; - WaterUsage = 0.0; + __WaterUsage = 0.0; Twb = SimpleTowerInlet(TowerNum).AirWetBulb; TwbCapped = SimpleTowerInlet(TowerNum).AirWetBulb; LoopNum = SimpleTower(TowerNum).LoopNum; @@ -5657,17 +5655,17 @@ namespace CondenserLoopTowers { TempSetPoint = TowerOutletTemp_ff - SimpleTower(TowerNum).FaultyCondenserSWTOffset; } - Tr = DataLoopNode::Node(WaterInletNode).Temp - TempSetPoint; + Tr = DataLoopNode::Node(__WaterInletNode).Temp - TempSetPoint; Ta = TempSetPoint - SimpleTowerInlet(TowerNum).AirWetBulb; // Do not RETURN here if flow rate is less than MassFlowTolerance. Check basin heater and then RETURN. if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 0) return; // MassFlowTolerance is a parameter to indicate a no flow condition - if (WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { + if (__WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { CalcBasinHeaterPower(SimpleTower(TowerNum).BasinHeaterPowerFTempDiff, SimpleTower(TowerNum).BasinHeaterSchedulePtr, SimpleTower(TowerNum).BasinHeaterSetPointTemp, - BasinHeaterPower); + __BasinHeaterPower); return; } @@ -5677,7 +5675,7 @@ namespace CondenserLoopTowers { IncrNumCellFlag = false; // Initialize inlet node water properties WaterDensity = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidName, - DataLoopNode::Node(WaterInletNode).Temp, + DataLoopNode::Node(__WaterInletNode).Temp, DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); WaterFlowRateRatio = @@ -5690,23 +5688,23 @@ namespace CondenserLoopTowers { // the tower's full capacity temperature difference by the percentage of tower capacity in free convection // regime specified by the user - AirFlowRateRatio = 1.0; - OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp; - OutletWaterTempON = DataLoopNode::Node(WaterInletNode).Temp; - OutletWaterTemp = OutletWaterTempOFF; + __AirFlowRateRatio = 1.0; + OutletWaterTempOFF = DataLoopNode::Node(__WaterInletNode).Temp; + OutletWaterTempON = DataLoopNode::Node(__WaterInletNode).Temp; + __OutletWaterTemp = OutletWaterTempOFF; FreeConvectionCapFrac = SimpleTower(TowerNum).FreeConvectionCapacityFraction; - SimVariableTower(TowerNum, WaterFlowRateRatioCapped, AirFlowRateRatio, TwbCapped, OutletWaterTempON); + SimVariableTower(TowerNum, WaterFlowRateRatioCapped, __AirFlowRateRatio, TwbCapped, OutletWaterTempON); if (OutletWaterTempON > TempSetPoint) { - FanCyclingRatio = 1.0; - AirFlowRateRatio = 1.0; - CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * NumCellOn / SimpleTower(TowerNum).NumCell; - OutletWaterTemp = OutletWaterTempON; + __FanCyclingRatio = 1.0; + __AirFlowRateRatio = 1.0; + __CTFanPower = SimpleTower(TowerNum).HighSpeedFanPower * NumCellOn / SimpleTower(TowerNum).NumCell; + __OutletWaterTemp = OutletWaterTempON; // if possible increase the number of cells and do the calculations again with the new water mass flow rate per cell - if (NumCellOn < SimpleTower(TowerNum).NumCell && (WaterMassFlowRate / (NumCellOn + 1)) > WaterMassFlowRatePerCellMin) { + if (NumCellOn < SimpleTower(TowerNum).NumCell && (__WaterMassFlowRate / (NumCellOn + 1)) > WaterMassFlowRatePerCellMin) { ++NumCellOn; - WaterMassFlowRatePerCell = WaterMassFlowRate / NumCellOn; + WaterMassFlowRatePerCell = __WaterMassFlowRate / NumCellOn; IncrNumCellFlag = true; } } @@ -5715,43 +5713,43 @@ namespace CondenserLoopTowers { // find the correct air ratio only if full flow is too much if (OutletWaterTempON < TempSetPoint) { // outlet water temperature is calculated in the free convection regime - OutletWaterTempOFF = DataLoopNode::Node(WaterInletNode).Temp - FreeConvectionCapFrac * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTempON); + OutletWaterTempOFF = DataLoopNode::Node(__WaterInletNode).Temp - FreeConvectionCapFrac * (DataLoopNode::Node(__WaterInletNode).Temp - OutletWaterTempON); // fan is OFF - FanCyclingRatio = 0.0; + __FanCyclingRatio = 0.0; // air flow ratio is assumed to be the fraction of tower capacity in the free convection regime (fan is OFF but air is flowing) - AirFlowRateRatio = FreeConvectionCapFrac; + __AirFlowRateRatio = FreeConvectionCapFrac; // Assume setpoint was met using free convection regime (pump ON and fan OFF) - CTFanPower = 0.0; - OutletWaterTemp = OutletWaterTempOFF; + __CTFanPower = 0.0; + __OutletWaterTemp = OutletWaterTempOFF; if (OutletWaterTempOFF > TempSetPoint) { // Setpoint was not met, turn on cooling tower fan at minimum fan speed - AirFlowRateRatio = SimpleTower(TowerNum).MinimumVSAirFlowFrac; - SimVariableTower(TowerNum, WaterFlowRateRatioCapped, AirFlowRateRatio, TwbCapped, OutletWaterTempMIN); + __AirFlowRateRatio = SimpleTower(TowerNum).MinimumVSAirFlowFrac; + SimVariableTower(TowerNum, WaterFlowRateRatioCapped, __AirFlowRateRatio, TwbCapped, OutletWaterTempMIN); if (OutletWaterTempMIN < TempSetPoint) { // if setpoint was exceeded, cycle the fan at minimum air flow to meet the setpoint temperature if (SimpleTower(TowerNum).FanPowerfAirFlowCurve == 0) { - CTFanPower = pow_3(AirFlowRateRatio) * SimpleTower(TowerNum).HighSpeedFanPower * NumCellOn / SimpleTower(TowerNum).NumCell; + __CTFanPower = pow_3(__AirFlowRateRatio) * SimpleTower(TowerNum).HighSpeedFanPower * NumCellOn / SimpleTower(TowerNum).NumCell; } else { - FanCurveValue = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); - CTFanPower = max(0.0, (SimpleTower(TowerNum).HighSpeedFanPower * FanCurveValue)) * NumCellOn / SimpleTower(TowerNum).NumCell; + FanCurveValue = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, __AirFlowRateRatio); + __CTFanPower = max(0.0, (SimpleTower(TowerNum).HighSpeedFanPower * FanCurveValue)) * NumCellOn / SimpleTower(TowerNum).NumCell; } // fan is cycling ON and OFF at the minimum fan speed. Adjust fan power and air flow rate ratio according to cycling rate - FanCyclingRatio = ((OutletWaterTempOFF - TempSetPoint) / (OutletWaterTempOFF - OutletWaterTempMIN)); - CTFanPower *= FanCyclingRatio; - OutletWaterTemp = TempSetPoint; - AirFlowRateRatio = - (FanCyclingRatio * SimpleTower(TowerNum).MinimumVSAirFlowFrac) + ((1 - FanCyclingRatio) * FreeConvectionCapFrac); + __FanCyclingRatio = ((OutletWaterTempOFF - TempSetPoint) / (OutletWaterTempOFF - OutletWaterTempMIN)); + __CTFanPower *= __FanCyclingRatio; + __OutletWaterTemp = TempSetPoint; + __AirFlowRateRatio = + (__FanCyclingRatio * SimpleTower(TowerNum).MinimumVSAirFlowFrac) + ((1 - __FanCyclingRatio) * FreeConvectionCapFrac); } else { // if setpoint was not met at minimum fan speed, set fan speed to maximum - AirFlowRateRatio = 1.0; + __AirFlowRateRatio = 1.0; // fan will not cycle and runs the entire time step - FanCyclingRatio = 1.0; + __FanCyclingRatio = 1.0; - SimVariableTower(TowerNum, WaterFlowRateRatioCapped, AirFlowRateRatio, TwbCapped, OutletWaterTemp); + SimVariableTower(TowerNum, WaterFlowRateRatioCapped, __AirFlowRateRatio, TwbCapped, __OutletWaterTemp); // Setpoint was met with pump ON and fan ON at full flow // Calculate the fraction of full air flow to exactly meet the setpoint temperature @@ -5766,7 +5764,7 @@ namespace CondenserLoopTowers { Par(6) = 1.0; // calculate the air flow rate ratio required for a balance General::SolveRoot( - Acc, MaxIte, SolFla, AirFlowRateRatio, SimpleTowerApproachResidual, SimpleTower(TowerNum).MinimumVSAirFlowFrac, 1.0, Par); + Acc, MaxIte, SolFla, __AirFlowRateRatio, SimpleTowerApproachResidual, SimpleTower(TowerNum).MinimumVSAirFlowFrac, 1.0, Par); if (SolFla == -1) { if (!DataGlobals::WarmupFlag) ShowWarningError("Cooling tower iteration limit exceeded when calculating air flow rate ratio for tower " + @@ -5798,13 +5796,13 @@ namespace CondenserLoopTowers { // Use theoretical cubic for deterination of fan power if user has not specified a fan power ratio curve if (SimpleTower(TowerNum).FanPowerfAirFlowCurve == 0) { - CTFanPower = pow_3(AirFlowRateRatio) * SimpleTower(TowerNum).HighSpeedFanPower * NumCellOn / SimpleTower(TowerNum).NumCell; + __CTFanPower = pow_3(__AirFlowRateRatio) * SimpleTower(TowerNum).HighSpeedFanPower * NumCellOn / SimpleTower(TowerNum).NumCell; } else { - FanCurveValue = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, AirFlowRateRatio); - CTFanPower = max(0.0, (SimpleTower(TowerNum).HighSpeedFanPower * FanCurveValue)) * NumCellOn / SimpleTower(TowerNum).NumCell; + FanCurveValue = CurveManager::CurveValue(SimpleTower(TowerNum).FanPowerfAirFlowCurve, __AirFlowRateRatio); + __CTFanPower = max(0.0, (SimpleTower(TowerNum).HighSpeedFanPower * FanCurveValue)) * NumCellOn / SimpleTower(TowerNum).NumCell; } // outlet water temperature is calculated as the inlet air wet-bulb temperature plus tower approach temperature - OutletWaterTemp = Twb + Ta; + __OutletWaterTemp = Twb + Ta; } // IF(OutletWaterTempMIN .LT. TempSetPoint)THEN } // IF(OutletWaterTempOFF .GT. TempSetPoint)THEN @@ -5814,7 +5812,7 @@ namespace CondenserLoopTowers { DataLoopNode::Node(SimpleTower(TowerNum).WaterInletNodeNum).Temp, DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - Qactual = WaterMassFlowRate * CpWater * (DataLoopNode::Node(WaterInletNode).Temp - OutletWaterTemp); + __Qactual = __WaterMassFlowRate * CpWater * (DataLoopNode::Node(__WaterInletNode).Temp - __OutletWaterTemp); SimpleTower(TowerNum).NumCellOn = NumCellOn; // calculate end time of current time step @@ -5849,8 +5847,8 @@ namespace CondenserLoopTowers { if (SimpleTower(TowerNum).TowerModelType == YorkCalcModel || SimpleTower(TowerNum).TowerModelType == YorkCalcUserDefined) { VSTower(SimpleTower(TowerNum).VSTower).PrintLGMessage = false; // Do not report error message in free convection regime - if (AirFlowRateRatio > SimpleTower(TowerNum).MinimumVSAirFlowFrac) { - FlowFraction = WaterFlowRateRatioCapped / AirFlowRateRatio; + if (__AirFlowRateRatio > SimpleTower(TowerNum).MinimumVSAirFlowFrac) { + FlowFraction = WaterFlowRateRatioCapped / __AirFlowRateRatio; // Flow fractions greater than a MaxLiquidToGasRatio of 8 are not reliable using the YorkCalc model if (FlowFraction > VSTower(SimpleTower(TowerNum).VSTower).MaxLiquidToGasRatio) { // Report warnings only during actual simulation @@ -5925,8 +5923,8 @@ namespace CondenserLoopTowers { // set inlet and outlet node numbers, and initialize some local variables - WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; - WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; + __WaterInletNode = SimpleTower(TowerNum).WaterInletNodeNum; + __WaterOutletNode = SimpleTower(TowerNum).WaterOutletNodeNum; _Qactual = 0.0; // WetBulbTolerance = 0.00001 WetBulbError = 1.0; @@ -5935,8 +5933,8 @@ namespace CondenserLoopTowers { // DeltaTwbTolerance = 0.001 // set local tower inlet and outlet temperature variables - InletWaterTemp = SimpleTowerInlet(TowerNum).WaterTemp; - _OutletWaterTemp = InletWaterTemp; + __InletWaterTemp = SimpleTowerInlet(TowerNum).WaterTemp; + _OutletWaterTemp = __InletWaterTemp; InletAirTemp = SimpleTowerInlet(TowerNum).AirTemp; InletAirWetBulb = SimpleTowerInlet(TowerNum).AirWetBulb; @@ -5959,7 +5957,7 @@ namespace CondenserLoopTowers { if (_WaterMassFlowRate > 0.0) { MdotCpWater = _WaterMassFlowRate * CpWater; } else { - _OutletWaterTemp = InletWaterTemp; + _OutletWaterTemp = __InletWaterTemp; return; } Iter = 0; @@ -5990,7 +5988,7 @@ namespace CondenserLoopTowers { effectiveness = NumTransferUnits / (1.0 + NumTransferUnits); } // calculate water to air heat transfer and store last exiting WB temp of air - _Qactual = effectiveness * CapacityRatioMin * (InletWaterTemp - InletAirWetBulb); + _Qactual = effectiveness * CapacityRatioMin * (__InletWaterTemp - InletAirWetBulb); OutletAirWetBulbLast = OutletAirWetBulb; // calculate new exiting wet bulb temperature of airstream OutletAirWetBulb = InletAirWetBulb + _Qactual / AirCapacity; @@ -6002,9 +6000,9 @@ namespace CondenserLoopTowers { } if (_Qactual >= 0.0) { - _OutletWaterTemp = InletWaterTemp - _Qactual / MdotCpWater; + _OutletWaterTemp = __InletWaterTemp - _Qactual / MdotCpWater; } else { - _OutletWaterTemp = InletWaterTemp; + _OutletWaterTemp = __InletWaterTemp; } } @@ -6603,21 +6601,21 @@ namespace CondenserLoopTowers { Real64 AverageWaterTemp; - AverageWaterTemp = (InletWaterTemp + OutletWaterTemp) / 2.0; + AverageWaterTemp = (__InletWaterTemp + __OutletWaterTemp) / 2.0; // Set water and air properties if (SimpleTower(TowerNum).EvapLossMode == EvapLossByMoistTheory) { AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(SimpleTowerInlet(TowerNum).AirPress, SimpleTowerInlet(TowerNum).AirTemp, SimpleTowerInlet(TowerNum).AirHumRat); - AirMassFlowRate = AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate * AirDensity * SimpleTower(TowerNum).NumCellOn / + AirMassFlowRate = __AirFlowRateRatio * SimpleTower(TowerNum).HighSpeedAirFlowRate * AirDensity * SimpleTower(TowerNum).NumCellOn / SimpleTower(TowerNum).NumCell; InletAirEnthalpy = Psychrometrics::PsyHFnTdbRhPb(SimpleTowerInlet(TowerNum).AirWetBulb, 1.0, SimpleTowerInlet(TowerNum).AirPress); if (AirMassFlowRate > 0.0) { // Calculate outlet air conditions for determining water usage - OutletAirEnthalpy = InletAirEnthalpy + Qactual / AirMassFlowRate; + OutletAirEnthalpy = InletAirEnthalpy + __Qactual / AirMassFlowRate; OutletAirTSat = Psychrometrics::PsyTsatFnHPb(OutletAirEnthalpy, SimpleTowerInlet(TowerNum).AirPress); OutletAirHumRatSat = Psychrometrics::PsyWFnTdbH(OutletAirTSat, OutletAirEnthalpy); @@ -6646,7 +6644,7 @@ namespace CondenserLoopTowers { DataPlant::PlantLoop(SimpleTower(TowerNum).LoopNum).FluidIndex, RoutineName); - EvapVdot = SimpleTower(TowerNum).UserEvapLossFactor * (InletWaterTemp - OutletWaterTemp) * (WaterMassFlowRate / rho); + EvapVdot = SimpleTower(TowerNum).UserEvapLossFactor * (__InletWaterTemp - __OutletWaterTemp) * (__WaterMassFlowRate / rho); if (EvapVdot < 0.0) EvapVdot = 0.0; } else { // should never come here @@ -6654,7 +6652,7 @@ namespace CondenserLoopTowers { // amount of water lost due to drift DriftVdot = SimpleTower(TowerNum).DesignWaterFlowRate * SimpleTower(TowerNum).NumCellOn / SimpleTower(TowerNum).NumCell * - SimpleTower(TowerNum).DriftLossFraction * AirFlowRateRatio; + SimpleTower(TowerNum).DriftLossFraction * __AirFlowRateRatio; if (SimpleTower(TowerNum).BlowdownMode == BlowdownBySchedule) { // Amount of water lost due to blow down (purging contaminants from tower basin) @@ -6741,19 +6739,19 @@ namespace CondenserLoopTowers { Real64 LoopMinTemp; // set node information - DataLoopNode::Node(WaterOutletNode).Temp = OutletWaterTemp; + DataLoopNode::Node(__WaterOutletNode).Temp = __OutletWaterTemp; LoopNum = SimpleTower(TowerNum).LoopNum; LoopSideNum = SimpleTower(TowerNum).LoopSideNum; if (DataPlant::PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock == 0 || DataGlobals::WarmupFlag) return; // Check flow rate through tower and compare to design flow rate, show warning if greater than Design * Mulitplier - if (DataLoopNode::Node(WaterOutletNode).MassFlowRate > SimpleTower(TowerNum).DesWaterMassFlowRate * SimpleTower(TowerNum).TowerMassFlowRateMultiplier) { + if (DataLoopNode::Node(__WaterOutletNode).MassFlowRate > SimpleTower(TowerNum).DesWaterMassFlowRate * SimpleTower(TowerNum).TowerMassFlowRateMultiplier) { ++SimpleTower(TowerNum).HighMassFlowErrorCount; if (SimpleTower(TowerNum).HighMassFlowErrorCount < 2) { ShowWarningError(SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\""); ShowContinueError(" Condenser Loop Mass Flow Rate is much greater than the towers design mass flow rate."); - ShowContinueError(" Condenser Loop Mass Flow Rate = " + General::TrimSigDigits(DataLoopNode::Node(WaterOutletNode).MassFlowRate, 6)); + ShowContinueError(" Condenser Loop Mass Flow Rate = " + General::TrimSigDigits(DataLoopNode::Node(__WaterOutletNode).MassFlowRate, 6)); ShowContinueError(" Tower Design Mass Flow Rate = " + General::TrimSigDigits(SimpleTower(TowerNum).DesWaterMassFlowRate, 6)); ShowContinueErrorTimeStamp(""); } else { @@ -6761,17 +6759,17 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\" Condenser Loop Mass Flow Rate is much greater than the towers design mass flow rate error continues...", SimpleTower(TowerNum).HighMassFlowErrorIndex, - DataLoopNode::Node(WaterOutletNode).MassFlowRate, - DataLoopNode::Node(WaterOutletNode).MassFlowRate); + DataLoopNode::Node(__WaterOutletNode).MassFlowRate, + DataLoopNode::Node(__WaterOutletNode).MassFlowRate); } } // Check if OutletWaterTemp is below the minimum condenser loop temp and warn user LoopMinTemp = DataPlant::PlantLoop(LoopNum).MinTemp; - if (OutletWaterTemp < LoopMinTemp && WaterMassFlowRate > 0.0) { + if (__OutletWaterTemp < LoopMinTemp && __WaterMassFlowRate > 0.0) { ++SimpleTower(TowerNum).OutletWaterTempErrorCount; ObjexxFCL::gio::write(CharLowOutletTemp, LowTempFmt) << LoopMinTemp; - ObjexxFCL::gio::write(CharErrOut, LowTempFmt) << OutletWaterTemp; + ObjexxFCL::gio::write(CharErrOut, LowTempFmt) << __OutletWaterTemp; strip(CharErrOut); if (SimpleTower(TowerNum).OutletWaterTempErrorCount < 2) { ShowWarningError(SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\""); @@ -6783,25 +6781,25 @@ namespace CondenserLoopTowers { SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\" Cooling tower water outlet temperature is below the specified minimum condenser loop temp error continues...", SimpleTower(TowerNum).OutletWaterTempErrorIndex, - OutletWaterTemp, - OutletWaterTemp); + __OutletWaterTemp, + __OutletWaterTemp); } } // Check if water mass flow rate is small (e.g. no flow) and warn user - if (WaterMassFlowRate > 0.0 && WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { + if (__WaterMassFlowRate > 0.0 && __WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { ++SimpleTower(TowerNum).SmallWaterMassFlowErrorCount; if (SimpleTower(TowerNum).SmallWaterMassFlowErrorCount < 2) { ShowWarningError(SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\""); ShowContinueError("Cooling tower water mass flow rate near zero."); ShowContinueErrorTimeStamp(""); - ShowContinueError("Actual Mass flow = " + General::TrimSigDigits(WaterMassFlowRate, 2)); + ShowContinueError("Actual Mass flow = " + General::TrimSigDigits(__WaterMassFlowRate, 2)); } else { ShowRecurringWarningErrorAtEnd(SimpleTower(TowerNum).TowerType + " \"" + SimpleTower(TowerNum).Name + "\" Cooling tower water mass flow rate near zero error continues...", SimpleTower(TowerNum).SmallWaterMassFlowErrorIndex, - WaterMassFlowRate, - WaterMassFlowRate); + __WaterMassFlowRate, + __WaterMassFlowRate); } } } @@ -6821,32 +6819,32 @@ namespace CondenserLoopTowers { Real64 const ReportingConstant = DataHVACGlobals::TimeStepSys * DataGlobals::SecInHour; if (!RunFlag) { - SimpleTowerReport(TowerNum).InletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; - SimpleTowerReport(TowerNum).OutletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; - SimpleTowerReport(TowerNum).WaterMassFlowRate = WaterMassFlowRate; + SimpleTowerReport(TowerNum).InletWaterTemp = DataLoopNode::Node(__WaterInletNode).Temp; + SimpleTowerReport(TowerNum).OutletWaterTemp = DataLoopNode::Node(__WaterInletNode).Temp; + SimpleTowerReport(TowerNum).WaterMassFlowRate = __WaterMassFlowRate; SimpleTowerReport(TowerNum).Qactual = 0.0; SimpleTowerReport(TowerNum).FanPower = 0.0; SimpleTowerReport(TowerNum).FanEnergy = 0.0; SimpleTowerReport(TowerNum).AirFlowRatio = 0.0; SimpleTowerReport(TowerNum).WaterAmountUsed = 0.0; - SimpleTowerReport(TowerNum).BasinHeaterPower = BasinHeaterPower; - SimpleTowerReport(TowerNum).BasinHeaterConsumption = BasinHeaterPower * ReportingConstant; + SimpleTowerReport(TowerNum).BasinHeaterPower = __BasinHeaterPower; + SimpleTowerReport(TowerNum).BasinHeaterConsumption = __BasinHeaterPower * ReportingConstant; SimpleTowerReport(TowerNum).FanCyclingRatio = 0.0; SimpleTowerReport(TowerNum).BypassFraction = 0.0; // added for fluid bypass SimpleTowerReport(TowerNum).NumCellOn = 0; SimpleTowerReport(TowerNum).SpeedSelected = 0; } else { - SimpleTowerReport(TowerNum).InletWaterTemp = DataLoopNode::Node(WaterInletNode).Temp; - SimpleTowerReport(TowerNum).OutletWaterTemp = OutletWaterTemp; - SimpleTowerReport(TowerNum).WaterMassFlowRate = WaterMassFlowRate; - SimpleTowerReport(TowerNum).Qactual = Qactual; - SimpleTowerReport(TowerNum).FanPower = CTFanPower; - SimpleTowerReport(TowerNum).FanEnergy = CTFanPower * ReportingConstant; - SimpleTowerReport(TowerNum).AirFlowRatio = AirFlowRateRatio; - SimpleTowerReport(TowerNum).WaterAmountUsed = WaterUsage * ReportingConstant; - SimpleTowerReport(TowerNum).BasinHeaterPower = BasinHeaterPower; - SimpleTowerReport(TowerNum).BasinHeaterConsumption = BasinHeaterPower * ReportingConstant; - SimpleTowerReport(TowerNum).FanCyclingRatio = FanCyclingRatio; + SimpleTowerReport(TowerNum).InletWaterTemp = DataLoopNode::Node(__WaterInletNode).Temp; + SimpleTowerReport(TowerNum).OutletWaterTemp = __OutletWaterTemp; + SimpleTowerReport(TowerNum).WaterMassFlowRate = __WaterMassFlowRate; + SimpleTowerReport(TowerNum).Qactual = __Qactual; + SimpleTowerReport(TowerNum).FanPower = __CTFanPower; + SimpleTowerReport(TowerNum).FanEnergy = __CTFanPower * ReportingConstant; + SimpleTowerReport(TowerNum).AirFlowRatio = __AirFlowRateRatio; + SimpleTowerReport(TowerNum).WaterAmountUsed = __WaterUsage * ReportingConstant; + SimpleTowerReport(TowerNum).BasinHeaterPower = __BasinHeaterPower; + SimpleTowerReport(TowerNum).BasinHeaterConsumption = __BasinHeaterPower * ReportingConstant; + SimpleTowerReport(TowerNum).FanCyclingRatio = __FanCyclingRatio; SimpleTowerReport(TowerNum).BypassFraction = SimpleTower(TowerNum).BypassFraction; // added for fluid bypass SimpleTowerReport(TowerNum).NumCellOn = SimpleTower(TowerNum).NumCellOn; SimpleTowerReport(TowerNum).SpeedSelected = SimpleTower(TowerNum).SpeedSelected; diff --git a/src/EnergyPlus/CondenserLoopTowers.hh b/src/EnergyPlus/CondenserLoopTowers.hh index 67ccc3b92b7..219fe29c229 100644 --- a/src/EnergyPlus/CondenserLoopTowers.hh +++ b/src/EnergyPlus/CondenserLoopTowers.hh @@ -93,17 +93,17 @@ namespace CondenserLoopTowers { extern int NumSimpleTowers; // Number of similar towers - extern Real64 InletWaterTemp; // CW temperature at tower inlet - extern Real64 OutletWaterTemp; // CW temperature at tower outlet - extern int WaterInletNode; // Node number at tower inlet - extern int WaterOutletNode; // Node number at tower outlet - extern Real64 WaterMassFlowRate; // WaterMassFlowRate through tower - extern Real64 Qactual; // Tower heat transfer - extern Real64 CTFanPower; // Tower fan power used - extern Real64 AirFlowRateRatio; // Ratio of air flow rate through VS cooling tower to design air flow rate - extern Real64 BasinHeaterPower; // Basin heater power use (W) - extern Real64 WaterUsage; // Tower water usage (m3/s) - extern Real64 FanCyclingRatio; // cycling ratio of tower fan when min fan speed provide to much capacity +// extern Real64 InletWaterTemp; // CW temperature at tower inlet +// extern Real64 OutletWaterTemp; // CW temperature at tower outlet +// extern int WaterInletNode; // Node number at tower inlet +// extern int WaterOutletNode; // Node number at tower outlet +// extern Real64 WaterMassFlowRate; // WaterMassFlowRate through tower +// extern Real64 Qactual; // Tower heat transfer +// extern Real64 CTFanPower; // Tower fan power used +// extern Real64 AirFlowRateRatio; // Ratio of air flow rate through VS cooling tower to design air flow rate +// extern Real64 BasinHeaterPower; // Basin heater power use (W) +// extern Real64 WaterUsage; // Tower water usage (m3/s) +// extern Real64 FanCyclingRatio; // cycling ratio of tower fan when min fan speed provide to much capacity extern bool GetInput; // When TRUE, calls subroutine to read input file extern Array1D_bool CheckEquipName; From 14d336c89b1f8254d8ff1c5329f0c131cd7d9fcd Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 10 Sep 2019 10:10:46 -0400 Subject: [PATCH 049/136] Refine VSWSHP model --- src/EnergyPlus/Furnaces.cc | 380 ++++++++++++++++++++----------------- 1 file changed, 207 insertions(+), 173 deletions(-) diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index b44f0bb75a3..866498e4ca3 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -9922,7 +9922,7 @@ namespace Furnaces { TotalZoneSensibleLoad = QZnReq; TotalZoneLatentLoad = QLatReq; // Calculate the reheat coil output - if ((GetCurrentScheduleValue(Furnace(FurnaceNum).SchedPtr) > 0.0 && CoolingLoad) && + if ((GetCurrentScheduleValue(Furnace(FurnaceNum).SchedPtr) > 0.0) && (Furnace(FurnaceNum).Humidistat && Furnace(FurnaceNum).DehumidControlType_Num == DehumidControl_CoolReheat && (QLatReq < 0.0))) { // if a Humidistat is installed and dehumdification control type is CoolReheat CalcVarSpeedHeatPump(FurnaceNum, @@ -10085,8 +10085,6 @@ namespace Furnaces { // SUBROUTINE INFORMATION: // AUTHOR Bo Shen, based on HVACMultiSpeedHeatPump:ControlMSHPOutput // DATE WRITTEN March, 2012 - // MODIFIED na - // RE-ENGINEERED // PURPOSE OF THIS SUBROUTINE: // Determine the part load fraction at low speed, and speed ratio at high speed for this time step. @@ -10106,9 +10104,6 @@ namespace Furnaces { using IntegratedHeatPump::IntegratedHeatPumps; using Psychrometrics::PsyCpAirFnWTdb; - // Locals - // SUBROUTINE ARGUMENT DEFINITIONS: - // SUBROUTINE PARAMETER DEFINITIONS: int const MaxIte(500); // maximum number of iterations @@ -10134,16 +10129,9 @@ namespace Furnaces { SpeedRatio = 0.0; SpeedNum = 1; LatOutput = 0.0; + Real64 noLatOutput = 0.0; ErrorToler = 0.001; // Error tolerance for convergence from input deck - // dehumidification load has the priority - if ((GetCurrentScheduleValue(Furnace(FurnaceNum).SchedPtr) > 0.0 && CoolingLoad) && - (Furnace(FurnaceNum).Humidistat && Furnace(FurnaceNum).DehumidControlType_Num == DehumidControl_CoolReheat && (QLatReq < 0.0))) { - QZnReq = 0.0; - } else { - QLatReq = 0.0; - } - if (GetCurrentScheduleValue(Furnace(FurnaceNum).SchedPtr) == 0.0) return; // Get result when DX coil is off @@ -10155,7 +10143,7 @@ namespace Furnaces { SpeedRatio, PartLoadFrac, NoCompOutput, - LatOutput, + noLatOutput, 0.0, 0.0, OnOffAirFlowRatio, @@ -10170,22 +10158,25 @@ namespace Furnaces { // If cooling and NoCompOutput < QZnReq, the coil needs to be off // If heating and NoCompOutput > QZnReq, the coil needs to be off - if ((QZnReq < (-1.0 * SmallLoad) && NoCompOutput < QZnReq) || (QZnReq > SmallLoad && NoCompOutput > QZnReq) || - ((std::abs(QZnReq) <= SmallLoad) && (std::abs(QLatReq) <= SmallLoad)) || (QLatReq < (-1.0 * SmallLoad) && LatOutput < QLatReq)) { - return; + // If no cooling or heating and no latent load, the coil needs to be off + if (QZnReq < -SmallLoad) { + if (NoCompOutput < QZnReq && QLatReq >= -SmallLoad) return; + } else if (QZnReq > SmallLoad) { + if (NoCompOutput > QZnReq && QLatReq >= -SmallLoad) return; + if (QLatReq <= -SmallLoad) QZnReq = 0.0; // Zero heating load to allow dehumidification + } else { + if (QLatReq >= -SmallLoad) return; } // Get full load result PartLoadFrac = 1.0; SpeedRatio = 1.0; if (Furnace(FurnaceNum).HeatCoolMode == HeatingMode) { - if (Furnace(FurnaceNum).FurnaceType_Num == UnitarySys_HeatCool) { - SpeedNum = Furnace(FurnaceNum).NumOfSpeedCooling; - } else { - SpeedNum = Furnace(FurnaceNum).NumOfSpeedHeating; - } + SpeedNum = Furnace(FurnaceNum).NumOfSpeedHeating; } else if (Furnace(FurnaceNum).HeatCoolMode == CoolingMode) { SpeedNum = Furnace(FurnaceNum).NumOfSpeedCooling; + } else if (QLatReq < -SmallLoad) { + SpeedNum = Furnace(FurnaceNum).NumOfSpeedCooling; } else { SpeedNum = 1; PartLoadFrac = 0.0; @@ -10207,8 +10198,7 @@ namespace Furnaces { SupHeaterLoad); if (QLatReq < (-1.0 * SmallLoad)) { // dehumidification mode - // ! If the QLatReq <= LatOutput the unit needs to run full out - if (QLatReq <= LatOutput) { + if (QLatReq <= LatOutput || (QZnReq < -SmallLoad && QZnReq <= FullOutput || QZnReq > SmallLoad && QZnReq >= FullOutput)) { PartLoadFrac = 1.0; SpeedRatio = 1.0; Furnace(FurnaceNum).CompPartLoadRatio = PartLoadFrac; @@ -10218,15 +10208,6 @@ namespace Furnaces { } ErrorToler = 0.001; // Error tolerance for convergence from input deck } else if (QZnReq < (-1.0 * SmallLoad)) { - // Since we are cooling, we expect FullOutput to be < 0 and FullOutput < NoCompOutput - // Check that this is the case; if not set PartLoadFrac = 0.0 (off) and return - if (FullOutput >= 0.0 || FullOutput >= NoCompOutput) { - PartLoadFrac = 0.0; - SpeedRatio = 0.0; - SpeedNum = 1; - return; - } - // ! If the QZnReq <= FullOutput the unit needs to run full out if (QZnReq <= FullOutput) { PartLoadFrac = 1.0; SpeedRatio = 1.0; @@ -10237,14 +10218,6 @@ namespace Furnaces { } ErrorToler = 0.001; // Error tolerance for convergence from input deck } else { - // Since we are heating, we expect FullOutput to be > 0 and FullOutput > NoCompOutput - // Check that this is the case; if not set PartLoadFrac = 0.0 (off) - if (FullOutput <= 0.0 || FullOutput <= NoCompOutput) { - PartLoadFrac = 0.0; - SpeedRatio = 0.0; - SpeedNum = 1; - // may need supplemental heating so don't return in heating mode - } if (QZnReq >= FullOutput) { PartLoadFrac = 1.0; SpeedRatio = 1.0; @@ -10253,132 +10226,192 @@ namespace Furnaces { ErrorToler = 0.001; // Error tolerance for convergence from input deck } - if ((QZnReq > SmallLoad && QZnReq < FullOutput) || (QZnReq < (-1.0 * SmallLoad) && QZnReq > FullOutput) || (QLatReq < (-1.0 * SmallLoad))) { + if (QZnReq < -SmallLoad && NoCompOutput - QZnReq > SmallLoad || QZnReq > SmallLoad && QZnReq - NoCompOutput > SmallLoad) { + if ((QZnReq > SmallLoad && QZnReq < FullOutput) || (QZnReq < (-1.0 * SmallLoad) && QZnReq > FullOutput)) { - Par(1) = FurnaceNum; - Par(2) = ZoneNum; - if (FirstHVACIteration) { - Par(3) = 1.0; - } else { - Par(3) = 0.0; - } - Par(4) = OpMode; - Par(5) = QZnReq; - Par(6) = OnOffAirFlowRatio; - Par(7) = SupHeaterLoad; - Par(9) = CompOp; - Par(10) = 1.0; - // Check whether the low speed coil can meet the load or not - CalcVarSpeedHeatPump( - FurnaceNum, FirstHVACIteration, CompOp, 1, 0.0, 1.0, LowOutput, LatOutput, QZnReq, QLatReq, OnOffAirFlowRatio, SupHeaterLoad); - if ((QZnReq > SmallLoad && QZnReq <= LowOutput) || (QZnReq < (-1.0 * SmallLoad) && QZnReq >= LowOutput) || - (QLatReq < (-1.0 * SmallLoad) && QLatReq > LatOutput)) { - // Calculate the part load fraction - SpeedRatio = 0.0; - SpeedNum = 1; - - if (QLatReq < 0.0) { // calculate latent heat residual - Par(10) = 0.0; - Par(5) = QLatReq; - } - - SolveRoot(ErrorToler, MaxIte, SolFla, PartLoadFrac, VSHPCyclingResidual, 0.0, 1.0, Par); - if (SolFla == -1) { - if (!WarmupFlag) { - if (ErrCountCyc == 0) { - ++ErrCountCyc; - ShowWarningError("Iteration limit exceeded calculating VS WSHP unit cycling ratio, for unit=" + Furnace(FurnaceNum).Name); - ShowContinueErrorTimeStamp("Cycling ratio returned=" + RoundSigDigits(PartLoadFrac, 2)); - } else { - ++ErrCountCyc; - ShowRecurringWarningErrorAtEnd( - Furnace(FurnaceNum).Name + "\": Iteration limit warning exceeding calculating DX unit cycling ratio continues...", - Furnace(FurnaceNum).ErrIndexCyc, - PartLoadFrac, - PartLoadFrac); + Par(1) = FurnaceNum; + Par(2) = ZoneNum; + if (FirstHVACIteration) { + Par(3) = 1.0; + } else { + Par(3) = 0.0; + } + Par(4) = OpMode; + Par(5) = QZnReq; + Par(6) = OnOffAirFlowRatio; + Par(7) = SupHeaterLoad; + Par(9) = CompOp; + Par(10) = 1.0; + // Check whether the low speed coil can meet the load or not + CalcVarSpeedHeatPump( + FurnaceNum, FirstHVACIteration, CompOp, 1, 0.0, 1.0, LowOutput, LatOutput, QZnReq, QLatReq, OnOffAirFlowRatio, SupHeaterLoad); + if ((QZnReq > SmallLoad && QZnReq <= LowOutput) || (QZnReq < (-1.0 * SmallLoad) && QZnReq >= LowOutput)) { + // Calculate the part load fraction + SpeedRatio = 0.0; + SpeedNum = 1; + SolveRoot(ErrorToler, MaxIte, SolFla, PartLoadFrac, VSHPCyclingResidual, 0.0, 1.0, Par); + if (SolFla == -1) { + if (!WarmupFlag) { + if (ErrCountCyc == 0) { + ++ErrCountCyc; + ShowWarningError("Iteration limit exceeded calculating VS WSHP unit cycling ratio, for unit=" + + Furnace(FurnaceNum).Name); + ShowContinueErrorTimeStamp("Cycling ratio returned=" + RoundSigDigits(PartLoadFrac, 2)); + } else { + ++ErrCountCyc; + ShowRecurringWarningErrorAtEnd( + Furnace(FurnaceNum).Name + + "\": Iteration limit warning exceeding calculating DX unit cycling ratio continues...", + Furnace(FurnaceNum).ErrIndexCyc, + PartLoadFrac, + PartLoadFrac); + } } + } else if (SolFla == -2) { + ShowFatalError("VS WSHP unit cycling ratio calculation failed: cycling limits exceeded, for unit=" + + Furnace(FurnaceNum).Name); } - } else if (SolFla == -2) { - ShowFatalError("VS WSHP unit cycling ratio calculation failed: cycling limits exceeded, for unit=" + Furnace(FurnaceNum).Name); - } - } else { - // Check to see which speed to meet the load - PartLoadFrac = 1.0; - SpeedRatio = 1.0; - if ((QZnReq < (-1.0 * SmallLoad)) || (QLatReq < (-1.0 * SmallLoad))) { // Cooling - for (i = 2; i <= Furnace(FurnaceNum).NumOfSpeedCooling; ++i) { - CalcVarSpeedHeatPump(FurnaceNum, - FirstHVACIteration, - CompOp, - i, - SpeedRatio, - PartLoadFrac, - TempOutput, - LatOutput, - QZnReq, - QLatReq, - OnOffAirFlowRatio, - SupHeaterLoad); + } else { + // Check to see which speed to meet the load + PartLoadFrac = 1.0; + SpeedRatio = 1.0; + if (QZnReq < (-1.0 * SmallLoad)) { // Cooling + for (i = 2; i <= Furnace(FurnaceNum).NumOfSpeedCooling; ++i) { + CalcVarSpeedHeatPump(FurnaceNum, + FirstHVACIteration, + CompOp, + i, + SpeedRatio, + PartLoadFrac, + TempOutput, + LatOutput, + QZnReq, + QLatReq, + OnOffAirFlowRatio, + SupHeaterLoad); - if (QLatReq < (-1.0 * SmallLoad)) { - if (QLatReq > LatOutput) { + if (QZnReq >= TempOutput) { + SpeedNum = i; + break; + } + } + } else { + for (i = 2; i <= Furnace(FurnaceNum).NumOfSpeedHeating; ++i) { + CalcVarSpeedHeatPump(FurnaceNum, + FirstHVACIteration, + CompOp, + i, + SpeedRatio, + PartLoadFrac, + TempOutput, + LatOutput, + QZnReq, + QLatReq, + OnOffAirFlowRatio, + SupHeaterLoad); + if (QZnReq <= TempOutput) { SpeedNum = i; break; } - } else if (QZnReq >= TempOutput) { - SpeedNum = i; - break; } } - } else { - for (i = 2; i <= Furnace(FurnaceNum).NumOfSpeedHeating; ++i) { - CalcVarSpeedHeatPump(FurnaceNum, - FirstHVACIteration, - CompOp, - i, - SpeedRatio, - PartLoadFrac, - TempOutput, - LatOutput, - QZnReq, - QLatReq, - OnOffAirFlowRatio, - SupHeaterLoad); - if (QZnReq <= TempOutput) { - SpeedNum = i; - break; + Par(8) = SpeedNum; + SolveRoot(ErrorToler, MaxIte, SolFla, SpeedRatio, VSHPSpeedResidual, 1.0e-10, 1.0, Par); + if (SolFla == -1) { + if (!WarmupFlag) { + if (ErrCountVar == 0) { + ++ErrCountVar; + ShowWarningError("Iteration limit exceeded calculating VS WSHP unit speed ratio, for unit=" + + Furnace(FurnaceNum).Name); + ShowContinueErrorTimeStamp("Speed ratio returned=[" + RoundSigDigits(SpeedRatio, 2) + + "], Speed number =" + RoundSigDigits(SpeedNum)); + } else { + ++ErrCountVar; + ShowRecurringWarningErrorAtEnd( + Furnace(FurnaceNum).Name + "\": Iteration limit warning exceeding calculating DX unit speed ratio continues...", + Furnace(FurnaceNum).ErrIndexVar, + SpeedRatio, + SpeedRatio); + } } + } else if (SolFla == -2) { + ShowFatalError("VS WSHP unit compressor speed calculation failed: speed limits exceeded, for unit=" + + Furnace(FurnaceNum).Name); } } + } else { + LatOutput = noLatOutput; // reset full output if not needed for sensible load + SpeedNum = 1; // reset speed from full output test + } + } else { + LatOutput = noLatOutput; // reset full output if not needed for sensible load + SpeedNum = 1; // reset speed from full output test + } + // meet the latent load + if (QLatReq < -SmallLoad && QLatReq < LatOutput) { + PartLoadFrac = 1.0; + SpeedRatio = 1.0; + for (i = SpeedNum; i <= Furnace(FurnaceNum).NumOfSpeedCooling; ++i) { + CalcVarSpeedHeatPump(FurnaceNum, + FirstHVACIteration, + CompOp, + i, + SpeedRatio, + PartLoadFrac, + TempOutput, + LatOutput, + QZnReq, + QLatReq, + OnOffAirFlowRatio, + SupHeaterLoad); + + if (QLatReq > LatOutput) { + SpeedNum = i; + break; + } + } + if (QLatReq - LatOutput > SmallLoad) { + Par(1) = FurnaceNum; + Par(2) = ZoneNum; + if ( FirstHVACIteration ) { + Par(3) = 1.0; + } else { + Par(3) = 0.0; + } + Par(4) = OpMode; + Par(5) = QLatReq; + Par(6) = OnOffAirFlowRatio; + Par(7) = SupHeaterLoad; Par(8) = SpeedNum; - - if (QLatReq < (-1.0 * SmallLoad)) { // calculate latent heat residual - Par(10) = 0.0; - Par(5) = QLatReq; + Par(9) = CompOp; + Par(10) = 0.0; + if (SpeedNum < 2) { + SolveRoot(ErrorToler, MaxIte, SolFla, PartLoadFrac, VSHPCyclingResidual, 0.0, 1.0, Par); + } else { + SolveRoot(ErrorToler, MaxIte, SolFla, SpeedRatio, VSHPSpeedResidual, 1.0e-10, 1.0, Par); } - - SolveRoot(ErrorToler, MaxIte, SolFla, SpeedRatio, VSHPSpeedResidual, 1.0e-10, 1.0, Par); - if (SolFla == -1) { - if (!WarmupFlag) { - if (ErrCountVar == 0) { + if ( SolFla == -1 ) { + if ( !WarmupFlag ) { + if ( ErrCountVar == 0 ) { ++ErrCountVar; ShowWarningError("Iteration limit exceeded calculating VS WSHP unit speed ratio, for unit=" + Furnace(FurnaceNum).Name); ShowContinueErrorTimeStamp("Speed ratio returned=[" + RoundSigDigits(SpeedRatio, 2) + - "], Speed number =" + RoundSigDigits(SpeedNum)); + "], Speed number =" + RoundSigDigits(SpeedNum)); } else { ++ErrCountVar; ShowRecurringWarningErrorAtEnd(Furnace(FurnaceNum).Name + - "\": Iteration limit warning exceeding calculating DX unit speed ratio continues...", - Furnace(FurnaceNum).ErrIndexVar, - SpeedRatio, - SpeedRatio); + "\": Iteration limit warning exceeding calculating DX unit speed ratio continues...", + Furnace(FurnaceNum).ErrIndexVar, + SpeedRatio, + SpeedRatio); } } - } else if (SolFla == -2) { + } else if ( SolFla == -2 ) { ShowFatalError("VS WSHP unit compressor speed calculation failed: speed limits exceeded, for unit=" + Furnace(FurnaceNum).Name); } } } + // end meet the latent load // if the heating coil cannot meet the load, trim with supplemental heater // occurs with constant fan mode when compressor is on or off @@ -10459,17 +10492,10 @@ namespace Furnaces { // SUBROUTINE INFORMATION: // AUTHOR: Bo Shen, based on HVACMultiSpeedHeatPump:CalcMSHeatPump // DATE WRITTEN: March 2012 - // MODIFIED na - // RE-ENGINEERED na // PURPOSE OF THIS SUBROUTINE: // This routine will calcultes MSHP performance based on given system load - // METHODOLOGY EMPLOYED: - // na - - // REFERENCES: na - // Using/Aliasing using Fans::SimulateFanComponents; using IntegratedHeatPump::SimIHP; @@ -11018,30 +11044,38 @@ namespace Furnaces { // If the fan runs continually do not allow coils to set OnOffFanPartLoadRatio. if (Furnace(FurnaceNum).OpMode == ContFanCycCoil) OnOffFanPartLoadFraction = 1.0; - // Check delta T (outlet to space), if positive - // use space HumRat (next line), else outlet humrat (IF) so psyc routine gives good result - MinHumRat = Node(Furnace(FurnaceNum).NodeNumOfControlledZone).HumRat; - if (Node(OutletNode).Temp < Node(Furnace(FurnaceNum).NodeNumOfControlledZone).Temp) MinHumRat = Node(OutletNode).HumRat; - - // Calculate sensible load met (at constant humidity ratio) - SensibleLoadMet = AirMassFlow * (PsyHFnTdbW(Node(OutletNode).Temp, MinHumRat) - - PsyHFnTdbW(Node(Furnace(FurnaceNum).NodeNumOfControlledZone).Temp, MinHumRat)) - - Furnace(FurnaceNum).SenLoadLoss; - Furnace(FurnaceNum).SensibleLoadMet = SensibleLoadMet; - - if (Furnace(FurnaceNum).Humidistat) { - MaxTemp = Node(Furnace(FurnaceNum).NodeNumOfControlledZone).Temp; - // modified, why does switching between furnace outlet and control zone temp - // cause latent load to change when latent capacity is 0 ? - // IF(Node(FurnaceOutletNode)%Temp .GT. Node(Furnace(FurnaceNum)%NodeNumOfControlledZone)%Temp ) & - // MaxTemp = Node(FurnaceOutletNode)%Temp - // Calculate latent load met (at constant temperature) - LatentLoadMet = AirMassFlow * (PsyHFnTdbW(MaxTemp, Node(OutletNode).HumRat) - - PsyHFnTdbW(MaxTemp, Node(Furnace(FurnaceNum).NodeNumOfControlledZone).HumRat)) - - Furnace(FurnaceNum).LatLoadLoss; - } else { - LatentLoadMet = 0.0; - } + auto &outNode = Node(OutletNode); + auto &zoneNode = Node(Furnace(FurnaceNum).NodeNumOfControlledZone); + Real64 zoneEnthalpy = PsyHFnTdbW(zoneNode.Temp, zoneNode.HumRat); + Real64 outletEnthalpy = PsyHFnTdbW(outNode.Temp, outNode.HumRat); + Real64 totalLoadMet = AirMassFlow * (outletEnthalpy - zoneEnthalpy); + SensibleLoadMet = + AirMassFlow * Psychrometrics::PsyDeltaHSenFnTdb2W2Tdb1W1(outNode.Temp, outNode.HumRat, zoneNode.Temp, zoneNode.HumRat); // sensible {W}; + LatentLoadMet = totalLoadMet - SensibleLoadMet; + //// Check delta T (outlet to space), if positive + // // use space HumRat (next line), else outlet humrat (IF) so psyc routine gives good result + // MinHumRat = Node(Furnace(FurnaceNum).NodeNumOfControlledZone).HumRat; + // if (Node(OutletNode).Temp < Node(Furnace(FurnaceNum).NodeNumOfControlledZone).Temp) MinHumRat = Node(OutletNode).HumRat; + + // // Calculate sensible load met (at constant humidity ratio) + // SensibleLoadMet = AirMassFlow * (PsyHFnTdbW(Node(OutletNode).Temp, MinHumRat) - + // PsyHFnTdbW(Node(Furnace(FurnaceNum).NodeNumOfControlledZone).Temp, MinHumRat)) - + // Furnace(FurnaceNum).SenLoadLoss; + // Furnace(FurnaceNum).SensibleLoadMet = SensibleLoadMet; + + // if (Furnace(FurnaceNum).Humidistat) { + // MaxTemp = Node(Furnace(FurnaceNum).NodeNumOfControlledZone).Temp; + // // modified, why does switching between furnace outlet and control zone temp + // // cause latent load to change when latent capacity is 0 ? + // // IF(Node(FurnaceOutletNode)%Temp .GT. Node(Furnace(FurnaceNum)%NodeNumOfControlledZone)%Temp ) & + // // MaxTemp = Node(FurnaceOutletNode)%Temp + // // Calculate latent load met (at constant temperature) + // LatentLoadMet = AirMassFlow * (PsyHFnTdbW(MaxTemp, Node(OutletNode).HumRat) - + // PsyHFnTdbW(MaxTemp, Node(Furnace(FurnaceNum).NodeNumOfControlledZone).HumRat)) - + // Furnace(FurnaceNum).LatLoadLoss; + // } else { + // LatentLoadMet = 0.0; + // } Furnace(FurnaceNum).LatentLoadMet = LatentLoadMet; } From b1264edbd696bd1953a45f3550c6af34841782ed Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Tue, 10 Sep 2019 10:47:15 -0400 Subject: [PATCH 050/136] Update JSON library: 3.5.0 -> 3.7.0 --- third_party/nlohmann/json.hpp | 22739 +++++++++++++++++--------------- 1 file changed, 12432 insertions(+), 10307 deletions(-) diff --git a/third_party/nlohmann/json.hpp b/third_party/nlohmann/json.hpp index 84b1664e44c..8538ac4980c 100644 --- a/third_party/nlohmann/json.hpp +++ b/third_party/nlohmann/json.hpp @@ -1,12 +1,12 @@ /* __ _____ _____ _____ __| | __| | | | JSON for Modern C++ -| | |__ | | | | | | version 3.5.0 +| | |__ | | | | | | version 3.7.0 |_____|_____|_____|_|___| https://github.com/nlohmann/json Licensed under the MIT License . SPDX-License-Identifier: MIT -Copyright (c) 2013-2018 Niels Lohmann . +Copyright (c) 2013-2019 Niels Lohmann . Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -27,11 +27,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifndef NLOHMANN_JSON_HPP -#define NLOHMANN_JSON_HPP +#ifndef INCLUDE_NLOHMANN_JSON_HPP_ +#define INCLUDE_NLOHMANN_JSON_HPP_ #define NLOHMANN_JSON_VERSION_MAJOR 3 -#define NLOHMANN_JSON_VERSION_MINOR 5 +#define NLOHMANN_JSON_VERSION_MINOR 7 #define NLOHMANN_JSON_VERSION_PATCH 0 #include // all_of, find, for_each @@ -42,817 +42,1710 @@ SOFTWARE. #include // initializer_list #include // istream, ostream #include // random_access_iterator_tag +#include // unique_ptr #include // accumulate #include // string, stoi, to_string #include // declval, forward, move, pair, swap +#include // vector +#include -// #include -#ifndef NLOHMANN_JSON_FWD_HPP -#define NLOHMANN_JSON_FWD_HPP +// #include -#include // int64_t, uint64_t + +#include + +// #include + + +#include // transform +#include // array +#include // and, not +#include // forward_list +#include // inserter, front_inserter, end #include // map -#include // allocator #include // string -#include // vector -#include +#include // tuple, make_tuple +#include // is_arithmetic, is_same, is_enum, underlying_type, is_convertible +#include // unordered_map +#include // pair, declval +#include // valarray -/*! -@brief namespace for Niels Lohmann -@see https://github.com/nlohmann -@since version 1.0.0 -*/ -namespace nlohmann -{ -/*! -@brief default JSONSerializer template argument +// #include -This serializer ignores the template arguments and uses ADL -([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl)) -for serialization. -*/ -template -struct adl_serializer; -template class ObjectType = - std::map, - template class ArrayType = std::vector, - class StringType = std::string, class BooleanType = bool, - class NumberIntegerType = std::int64_t, - class NumberUnsignedType = std::uint64_t, - class NumberFloatType = double, - template class AllocatorType = std::allocator, - template class JSONSerializer = - adl_serializer> -class basic_json; +#include // exception +#include // runtime_error +#include // to_string -/*! -@brief JSON Pointer +// #include -A JSON pointer defines a string syntax for identifying a specific value -within a JSON document. It can be used with functions `at` and -`operator[]`. Furthermore, JSON pointers are the base for JSON patches. -@sa [RFC 6901](https://tools.ietf.org/html/rfc6901) +#include // size_t -@since version 2.0.0 -*/ -template -class json_pointer; +namespace nlohmann +{ +namespace detail +{ +/// struct to capture the start position of the current token +struct position_t +{ + /// the total number of characters read + std::size_t chars_read_total = 0; + /// the number of characters read in the current line + std::size_t chars_read_current_line = 0; + /// the number of lines read + std::size_t lines_read = 0; -/*! -@brief default JSON class + /// conversion to size_t to preserve SAX interface + constexpr operator size_t() const + { + return chars_read_total; + } +}; -This type is the default specialization of the @ref basic_json class which -uses the standard template types. +} // namespace detail +} // namespace nlohmann -@since version 1.0.0 -*/ -using json = basic_json<>; -} // namespace nlohmann +// #include + +#include // pair +// #include +/* Hedley - https://nemequ.github.io/hedley + * Created by Evan Nemerson + * + * To the extent possible under law, the author(s) have dedicated all + * copyright and related and neighboring rights to this software to + * the public domain worldwide. This software is distributed without + * any warranty. + * + * For details, see . + * SPDX-License-Identifier: CC0-1.0 + */ + +#if !defined(JSON_HEDLEY_VERSION) || (JSON_HEDLEY_VERSION < 9) +#if defined(JSON_HEDLEY_VERSION) + #undef JSON_HEDLEY_VERSION #endif +#define JSON_HEDLEY_VERSION 9 -// #include +#if defined(JSON_HEDLEY_STRINGIFY_EX) + #undef JSON_HEDLEY_STRINGIFY_EX +#endif +#define JSON_HEDLEY_STRINGIFY_EX(x) #x +#if defined(JSON_HEDLEY_STRINGIFY) + #undef JSON_HEDLEY_STRINGIFY +#endif +#define JSON_HEDLEY_STRINGIFY(x) JSON_HEDLEY_STRINGIFY_EX(x) -// This file contains all internal macro definitions -// You MUST include macro_unscope.hpp at the end of json.hpp to undef all of them +#if defined(JSON_HEDLEY_CONCAT_EX) + #undef JSON_HEDLEY_CONCAT_EX +#endif +#define JSON_HEDLEY_CONCAT_EX(a,b) a##b -// exclude unsupported compilers -#if !defined(JSON_SKIP_UNSUPPORTED_COMPILER_CHECK) - #if defined(__clang__) - #if (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) < 30400 - #error "unsupported Clang version - see https://github.com/nlohmann/json#supported-compilers" - #endif - #elif defined(__GNUC__) && !(defined(__ICC) || defined(__INTEL_COMPILER)) - #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 - #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers" - #endif - #endif +#if defined(JSON_HEDLEY_CONCAT) + #undef JSON_HEDLEY_CONCAT #endif +#define JSON_HEDLEY_CONCAT(a,b) JSON_HEDLEY_CONCAT_EX(a,b) -// C++ language standard detection -#if (defined(__cplusplus) && __cplusplus >= 201703L) || (defined(_HAS_CXX17) && _HAS_CXX17 == 1) // fix for issue #464 - #define JSON_HAS_CPP_17 - #define JSON_HAS_CPP_14 -#elif (defined(__cplusplus) && __cplusplus >= 201402L) || (defined(_HAS_CXX14) && _HAS_CXX14 == 1) - #define JSON_HAS_CPP_14 +#if defined(JSON_HEDLEY_VERSION_ENCODE) + #undef JSON_HEDLEY_VERSION_ENCODE #endif +#define JSON_HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) -// disable float-equal warnings on GCC/clang -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wfloat-equal" +#if defined(JSON_HEDLEY_VERSION_DECODE_MAJOR) + #undef JSON_HEDLEY_VERSION_DECODE_MAJOR #endif +#define JSON_HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) -// disable documentation warnings on clang -#if defined(__clang__) - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wdocumentation" +#if defined(JSON_HEDLEY_VERSION_DECODE_MINOR) + #undef JSON_HEDLEY_VERSION_DECODE_MINOR #endif +#define JSON_HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) -// allow for portable deprecation warnings -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #define JSON_DEPRECATED __attribute__((deprecated)) -#elif defined(_MSC_VER) - #define JSON_DEPRECATED __declspec(deprecated) -#else - #define JSON_DEPRECATED +#if defined(JSON_HEDLEY_VERSION_DECODE_REVISION) + #undef JSON_HEDLEY_VERSION_DECODE_REVISION #endif +#define JSON_HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) -// allow for portable nodiscard warnings -#if defined(__has_cpp_attribute) - #if __has_cpp_attribute(nodiscard) && defined(JSON_HAS_CPP_17) - #define JSON_NODISCARD [[nodiscard]] - #elif __has_cpp_attribute(gnu::warn_unused_result) - #define JSON_NODISCARD [[gnu::warn_unused_result]] - #else - #define JSON_NODISCARD - #endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #undef JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) +#elif defined(__GNUC__) + #define JSON_HEDLEY_GNUC_VERSION JSON_HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) +#endif + +#if defined(JSON_HEDLEY_GNUC_VERSION_CHECK) + #undef JSON_HEDLEY_GNUC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GNUC_VERSION) + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GNUC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define JSON_NODISCARD + #define JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) #endif -// allow to disable exceptions -#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(JSON_NOEXCEPTION) - #define JSON_THROW(exception) throw exception - #define JSON_TRY try - #define JSON_CATCH(exception) catch(exception) - #define JSON_INTERNAL_CATCH(exception) catch(exception) +#if defined(JSON_HEDLEY_MSVC_VERSION) + #undef JSON_HEDLEY_MSVC_VERSION +#endif +#if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) +#elif defined(_MSC_FULL_VER) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) +#elif defined(_MSC_VER) + #define JSON_HEDLEY_MSVC_VERSION JSON_HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) +#endif + +#if defined(JSON_HEDLEY_MSVC_VERSION_CHECK) + #undef JSON_HEDLEY_MSVC_VERSION_CHECK +#endif +#if !defined(_MSC_VER) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) +#elif defined(_MSC_VER) && (_MSC_VER >= 1400) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) +#elif defined(_MSC_VER) && (_MSC_VER >= 1200) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) #else - #define JSON_THROW(exception) std::abort() - #define JSON_TRY if(true) - #define JSON_CATCH(exception) if(false) - #define JSON_INTERNAL_CATCH(exception) if(false) + #define JSON_HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) #endif -// override exception macros -#if defined(JSON_THROW_USER) - #undef JSON_THROW - #define JSON_THROW JSON_THROW_USER +#if defined(JSON_HEDLEY_INTEL_VERSION) + #undef JSON_HEDLEY_INTEL_VERSION #endif -#if defined(JSON_TRY_USER) - #undef JSON_TRY - #define JSON_TRY JSON_TRY_USER +#if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) +#elif defined(__INTEL_COMPILER) + #define JSON_HEDLEY_INTEL_VERSION JSON_HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) #endif -#if defined(JSON_CATCH_USER) - #undef JSON_CATCH - #define JSON_CATCH JSON_CATCH_USER - #undef JSON_INTERNAL_CATCH - #define JSON_INTERNAL_CATCH JSON_CATCH_USER + +#if defined(JSON_HEDLEY_INTEL_VERSION_CHECK) + #undef JSON_HEDLEY_INTEL_VERSION_CHECK #endif -#if defined(JSON_INTERNAL_CATCH_USER) - #undef JSON_INTERNAL_CATCH - #define JSON_INTERNAL_CATCH JSON_INTERNAL_CATCH_USER +#if defined(JSON_HEDLEY_INTEL_VERSION) + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_INTEL_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) #endif -// manual branch prediction -#if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) - #define JSON_LIKELY(x) __builtin_expect(!!(x), 1) - #define JSON_UNLIKELY(x) __builtin_expect(!!(x), 0) +#if defined(JSON_HEDLEY_PGI_VERSION) + #undef JSON_HEDLEY_PGI_VERSION +#endif +#if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) + #define JSON_HEDLEY_PGI_VERSION JSON_HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) +#endif + +#if defined(JSON_HEDLEY_PGI_VERSION_CHECK) + #undef JSON_HEDLEY_PGI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PGI_VERSION) + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PGI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) #else - #define JSON_LIKELY(x) x - #define JSON_UNLIKELY(x) x + #define JSON_HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) #endif -/*! -@brief macro to briefly define a mapping between an enum and JSON -@def NLOHMANN_JSON_SERIALIZE_ENUM -@since version 3.4.0 -*/ -#define NLOHMANN_JSON_SERIALIZE_ENUM(ENUM_TYPE, ...) \ - template \ - inline void to_json(BasicJsonType& j, const ENUM_TYPE& e) \ - { \ - static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ - static const std::pair m[] = __VA_ARGS__; \ - auto it = std::find_if(std::begin(m), std::end(m), \ - [e](const std::pair& ej_pair) -> bool \ - { \ - return ej_pair.first == e; \ - }); \ - j = ((it != std::end(m)) ? it : std::begin(m))->second; \ - } \ - template \ - inline void from_json(const BasicJsonType& j, ENUM_TYPE& e) \ - { \ - static_assert(std::is_enum::value, #ENUM_TYPE " must be an enum!"); \ - static const std::pair m[] = __VA_ARGS__; \ - auto it = std::find_if(std::begin(m), std::end(m), \ - [j](const std::pair& ej_pair) -> bool \ - { \ - return ej_pair.second == j; \ - }); \ - e = ((it != std::end(m)) ? it : std::begin(m))->first; \ - } +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #undef JSON_HEDLEY_SUNPRO_VERSION +#endif +#if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) +#elif defined(__SUNPRO_C) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) +#elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) +#elif defined(__SUNPRO_CC) + #define JSON_HEDLEY_SUNPRO_VERSION JSON_HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) +#endif -// Ugly macros to avoid uglier copy-paste when specializing basic_json. They -// may be removed in the future once the class is split. +#if defined(JSON_HEDLEY_SUNPRO_VERSION_CHECK) + #undef JSON_HEDLEY_SUNPRO_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_SUNPRO_VERSION) + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_SUNPRO_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) +#endif -#define NLOHMANN_BASIC_JSON_TPL_DECLARATION \ - template class ObjectType, \ - template class ArrayType, \ - class StringType, class BooleanType, class NumberIntegerType, \ - class NumberUnsignedType, class NumberFloatType, \ - template class AllocatorType, \ - template class JSONSerializer> +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION +#endif +#if defined(__EMSCRIPTEN__) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION JSON_HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) +#endif -#define NLOHMANN_BASIC_JSON_TPL \ - basic_json +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK) + #undef JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_EMSCRIPTEN_VERSION) + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_EMSCRIPTEN_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) +#endif -// #include +#if defined(JSON_HEDLEY_ARM_VERSION) + #undef JSON_HEDLEY_ARM_VERSION +#endif +#if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) +#elif defined(__CC_ARM) && defined(__ARMCC_VERSION) + #define JSON_HEDLEY_ARM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) +#endif +#if defined(JSON_HEDLEY_ARM_VERSION_CHECK) + #undef JSON_HEDLEY_ARM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_ARM_VERSION) + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_ARM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) +#endif -#include // not -#include // size_t -#include // conditional, enable_if, false_type, integral_constant, is_constructible, is_integral, is_same, remove_cv, remove_reference, true_type +#if defined(JSON_HEDLEY_IBM_VERSION) + #undef JSON_HEDLEY_IBM_VERSION +#endif +#if defined(__ibmxl__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) +#elif defined(__xlC__) && defined(__xlC_ver__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) +#elif defined(__xlC__) + #define JSON_HEDLEY_IBM_VERSION JSON_HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) +#endif -namespace nlohmann -{ -namespace detail -{ -// alias templates to reduce boilerplate -template -using enable_if_t = typename std::enable_if::type; +#if defined(JSON_HEDLEY_IBM_VERSION_CHECK) + #undef JSON_HEDLEY_IBM_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IBM_VERSION) + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IBM_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) +#endif -template -using uncvref_t = typename std::remove_cv::type>::type; +#if defined(JSON_HEDLEY_TI_VERSION) + #undef JSON_HEDLEY_TI_VERSION +#endif +#if defined(__TI_COMPILER_VERSION__) + #define JSON_HEDLEY_TI_VERSION JSON_HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) +#endif -// implementation of C++14 index_sequence and affiliates -// source: https://stackoverflow.com/a/32223343 -template -struct index_sequence -{ - using type = index_sequence; - using value_type = std::size_t; - static constexpr std::size_t size() noexcept - { - return sizeof...(Ints); - } -}; +#if defined(JSON_HEDLEY_TI_VERSION_CHECK) + #undef JSON_HEDLEY_TI_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TI_VERSION) + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TI_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) +#endif -template -struct merge_and_renumber; +#if defined(JSON_HEDLEY_CRAY_VERSION) + #undef JSON_HEDLEY_CRAY_VERSION +#endif +#if defined(_CRAYC) + #if defined(_RELEASE_PATCHLEVEL) + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) + #else + #define JSON_HEDLEY_CRAY_VERSION JSON_HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) + #endif +#endif -template -struct merge_and_renumber, index_sequence> - : index_sequence < I1..., (sizeof...(I1) + I2)... > {}; +#if defined(JSON_HEDLEY_CRAY_VERSION_CHECK) + #undef JSON_HEDLEY_CRAY_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_CRAY_VERSION) + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_CRAY_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) +#endif -template -struct make_index_sequence - : merge_and_renumber < typename make_index_sequence < N / 2 >::type, - typename make_index_sequence < N - N / 2 >::type > {}; +#if defined(JSON_HEDLEY_IAR_VERSION) + #undef JSON_HEDLEY_IAR_VERSION +#endif +#if defined(__IAR_SYSTEMS_ICC__) + #if __VER__ > 1000 + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) + #else + #define JSON_HEDLEY_IAR_VERSION JSON_HEDLEY_VERSION_ENCODE(VER / 100, __VER__ % 100, 0) + #endif +#endif -template<> struct make_index_sequence<0> : index_sequence<> {}; -template<> struct make_index_sequence<1> : index_sequence<0> {}; +#if defined(JSON_HEDLEY_IAR_VERSION_CHECK) + #undef JSON_HEDLEY_IAR_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_IAR_VERSION) + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_IAR_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) +#endif -template -using index_sequence_for = make_index_sequence; +#if defined(JSON_HEDLEY_TINYC_VERSION) + #undef JSON_HEDLEY_TINYC_VERSION +#endif +#if defined(__TINYC__) + #define JSON_HEDLEY_TINYC_VERSION JSON_HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) +#endif -// dispatch utility (taken from ranges-v3) -template struct priority_tag : priority_tag < N - 1 > {}; -template<> struct priority_tag<0> {}; +#if defined(JSON_HEDLEY_TINYC_VERSION_CHECK) + #undef JSON_HEDLEY_TINYC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_TINYC_VERSION) + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_TINYC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) +#endif -// taken from ranges-v3 -template -struct static_const -{ - static constexpr T value{}; -}; +#if defined(JSON_HEDLEY_DMC_VERSION) + #undef JSON_HEDLEY_DMC_VERSION +#endif +#if defined(__DMC__) + #define JSON_HEDLEY_DMC_VERSION JSON_HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) +#endif -template -constexpr T static_const::value; -} // namespace detail -} // namespace nlohmann +#if defined(JSON_HEDLEY_DMC_VERSION_CHECK) + #undef JSON_HEDLEY_DMC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_DMC_VERSION) + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_DMC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) +#endif -// #include +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #undef JSON_HEDLEY_COMPCERT_VERSION +#endif +#if defined(__COMPCERT_VERSION__) + #define JSON_HEDLEY_COMPCERT_VERSION JSON_HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION_CHECK) + #undef JSON_HEDLEY_COMPCERT_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_COMPCERT_VERSION) + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_COMPCERT_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) +#endif -#include // not -#include // numeric_limits -#include // false_type, is_constructible, is_integral, is_same, true_type -#include // declval +#if defined(JSON_HEDLEY_PELLES_VERSION) + #undef JSON_HEDLEY_PELLES_VERSION +#endif +#if defined(__POCC__) + #define JSON_HEDLEY_PELLES_VERSION JSON_HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) +#endif -// #include +#if defined(JSON_HEDLEY_PELLES_VERSION_CHECK) + #undef JSON_HEDLEY_PELLES_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_PELLES_VERSION) + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_PELLES_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) +#endif -// #include +#if defined(JSON_HEDLEY_GCC_VERSION) + #undef JSON_HEDLEY_GCC_VERSION +#endif +#if \ + defined(JSON_HEDLEY_GNUC_VERSION) && \ + !defined(__clang__) && \ + !defined(JSON_HEDLEY_INTEL_VERSION) && \ + !defined(JSON_HEDLEY_PGI_VERSION) && \ + !defined(JSON_HEDLEY_ARM_VERSION) && \ + !defined(JSON_HEDLEY_TI_VERSION) && \ + !defined(__COMPCERT__) + #define JSON_HEDLEY_GCC_VERSION JSON_HEDLEY_GNUC_VERSION +#endif +#if defined(JSON_HEDLEY_GCC_VERSION_CHECK) + #undef JSON_HEDLEY_GCC_VERSION_CHECK +#endif +#if defined(JSON_HEDLEY_GCC_VERSION) + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (JSON_HEDLEY_GCC_VERSION >= JSON_HEDLEY_VERSION_ENCODE(major, minor, patch)) +#else + #define JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) +#endif -#include // random_access_iterator_tag +#if defined(JSON_HEDLEY_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_ATTRIBUTE(attribute) (0) +#endif -// #include +#if defined(JSON_HEDLEY_GNUC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif +#if defined(JSON_HEDLEY_GCC_HAS_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_ATTRIBUTE +#endif +#if defined(__has_attribute) + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) __has_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif -namespace nlohmann -{ -namespace detail -{ -template struct make_void -{ - using type = void; -}; -template using void_t = typename make_void::type; -} // namespace detail -} // namespace nlohmann +#if defined(JSON_HEDLEY_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) +#endif -// #include +#if defined(JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif +#if defined(JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE +#endif +#if defined(__has_cpp_attribute) && defined(__cplusplus) + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif -namespace nlohmann -{ -namespace detail -{ -template -struct iterator_types {}; +#if defined(JSON_HEDLEY_HAS_BUILTIN) + #undef JSON_HEDLEY_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) +#else + #define JSON_HEDLEY_HAS_BUILTIN(builtin) (0) +#endif -template -struct iterator_types < - It, - void_t> -{ - using difference_type = typename It::difference_type; - using value_type = typename It::value_type; - using pointer = typename It::pointer; - using reference = typename It::reference; - using iterator_category = typename It::iterator_category; -}; +#if defined(JSON_HEDLEY_GNUC_HAS_BUILTIN) + #undef JSON_HEDLEY_GNUC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif -// This is required as some compilers implement std::iterator_traits in a way that -// doesn't work with SFINAE. See https://github.com/nlohmann/json/issues/1341. -template -struct iterator_traits -{ -}; +#if defined(JSON_HEDLEY_GCC_HAS_BUILTIN) + #undef JSON_HEDLEY_GCC_HAS_BUILTIN +#endif +#if defined(__has_builtin) + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) +#else + #define JSON_HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif -template -struct iterator_traits < T, enable_if_t < !std::is_pointer::value >> - : iterator_types -{ -}; +#if defined(JSON_HEDLEY_HAS_FEATURE) + #undef JSON_HEDLEY_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_HAS_FEATURE(feature) __has_feature(feature) +#else + #define JSON_HEDLEY_HAS_FEATURE(feature) (0) +#endif -template -struct iterator_traits::value>> -{ - using iterator_category = std::random_access_iterator_tag; - using value_type = T; - using difference_type = ptrdiff_t; - using pointer = T*; - using reference = T&; -}; -} -} +#if defined(JSON_HEDLEY_GNUC_HAS_FEATURE) + #undef JSON_HEDLEY_GNUC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif -// #include +#if defined(JSON_HEDLEY_GCC_HAS_FEATURE) + #undef JSON_HEDLEY_GCC_HAS_FEATURE +#endif +#if defined(__has_feature) + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) +#else + #define JSON_HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif -// #include +#if defined(JSON_HEDLEY_HAS_EXTENSION) + #undef JSON_HEDLEY_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) +#else + #define JSON_HEDLEY_HAS_EXTENSION(extension) (0) +#endif +#if defined(JSON_HEDLEY_GNUC_HAS_EXTENSION) + #undef JSON_HEDLEY_GNUC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif -#include +#if defined(JSON_HEDLEY_GCC_HAS_EXTENSION) + #undef JSON_HEDLEY_GCC_HAS_EXTENSION +#endif +#if defined(__has_extension) + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) +#else + #define JSON_HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif -// #include +#if defined(JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) +#endif +#if defined(JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif -// http://en.cppreference.com/w/cpp/experimental/is_detected -namespace nlohmann -{ -namespace detail -{ -struct nonesuch -{ - nonesuch() = delete; - ~nonesuch() = delete; - nonesuch(nonesuch const&) = delete; - void operator=(nonesuch const&) = delete; -}; +#if defined(JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) + #undef JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE +#endif +#if defined(__has_declspec_attribute) + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) +#else + #define JSON_HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) JSON_HEDLEY_GCC_VERSION_CHECK(major,minor,patch) +#endif -template class Op, - class... Args> -struct detector -{ - using value_t = std::false_type; - using type = Default; -}; +#if defined(JSON_HEDLEY_HAS_WARNING) + #undef JSON_HEDLEY_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_HAS_WARNING(warning) __has_warning(warning) +#else + #define JSON_HEDLEY_HAS_WARNING(warning) (0) +#endif -template class Op, class... Args> -struct detector>, Op, Args...> -{ - using value_t = std::true_type; - using type = Op; -}; +#if defined(JSON_HEDLEY_GNUC_HAS_WARNING) + #undef JSON_HEDLEY_GNUC_HAS_WARNING +#endif +#if defined(__has_warning) + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) +#else + #define JSON_HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) JSON_HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) +#endif -template