From ca5894ca54d2c5e28a593e08ab05847b08385de8 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Thu, 19 Oct 2023 09:56:58 -0400 Subject: [PATCH 1/4] A few initial ideas --- src/CNDTYPES.DEF | 1 + src/CNRECS.DEF | 8 ++++-- src/dhwcalc.cpp | 66 +++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 70 insertions(+), 5 deletions(-) diff --git a/src/CNDTYPES.DEF b/src/CNDTYPES.DEF index 5da8fe008..58cdd384b 100644 --- a/src/CNDTYPES.DEF +++ b/src/CNDTYPES.DEF @@ -400,6 +400,7 @@ PIPESEGP -- "class PIPESEG*" INSTSML "SmallInstantaneous" INSTLRG "LargeInstantaneous" INSTUEF "InstantaneousUEF" + TANKHX "TankHX" BUILTUP "BuiltUp" } *choicb WHASHPTYCH { // comments from Ecotope, see hphw.hh diff --git a/src/CNRECS.DEF b/src/CNRECS.DEF index f26fc0f59..2cce7ebd9 100644 --- a/src/CNRECS.DEF +++ b/src/CNRECS.DEF @@ -4566,8 +4566,9 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater *declare "bool wh_CanHaveLoopReturn() const { return wh_IsHPWHModel(); }" *declare "bool wh_CanHaveDHWLOOPHEATER() const { return wh_IsPrimary() && wh_IsHPWHModel(); }" *declare "bool wh_IsInstUEFModel() const { return wh_type==C_WHTYPECH_INSTUEF; }" - *declare "bool wh_IsSubhrModel() const { return wh_IsHPWHModel() || wh_IsInstUEFModel(); }" - *declare "bool wh_UsesTSetpoint() const { return wh_IsHPWHModel(); }" + *declare "bool wh_IsTankHXModel() const { return wh_type == C_WHTYPECH_TANKHX; }" + *declare "bool wh_IsSubhrModel() const { return wh_IsHPWHModel() || wh_IsInstUEFModel() || wh_IsTankHXModel(); }" + *declare "bool wh_UsesTSetpoint() const { return wh_IsHPWHModel() || wh_IsTankHXModel(); }" *declare "float wh_CalcLDEF( float arl, int options=0);" *declare "RC wh_SetupAsCHDHWSource();" *declare "RC wh_DoHour();" @@ -4575,6 +4576,8 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater *declare "RC wh_DoSubhrTick( struct DHWTICK& tk, float scaleWH, float tInlet, float& tOutlet);" *declare "RC wh_InstUEFInit();" *declare "RC wh_InstUEFDoSubhrTick( double draw, float tInletWH, float scaleWH, float tUse);" + *declare "RC wh_TankHXInit();" + *declare "RC wh_TankHXDoSubhrTick( double draw, float tInletWH, float scaleWH, float tUse);" *declare "RC wh_DoSubhrEnd( bool bIsLH);" *declare "RC wh_DoEndPreRun();" *declare "RC wh_EndIvl( IVLCH ivl, float HARL, float wsMult);" @@ -4712,6 +4715,7 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater *s *e *nest HPWHLINK wh_HPWH; // interface to Ecotope HPWH detailed heat pump model // also used for resistance electric heaters + *s *e FLOAT wh_tTank; // tank temperature for TankHX model, F *s *e FLOAT wh_qXBU; // current step HPWH add'l backup resistance heat, Btu // output water heated to ws_tUse iff HPWH output temp < ws_tUse *s *e DBL wh_qEnv; // current step heat removed by HPWH from environment, Btu diff --git a/src/dhwcalc.cpp b/src/dhwcalc.cpp index bccfafc54..07861c5a7 100644 --- a/src/dhwcalc.cpp +++ b/src/dhwcalc.cpp @@ -4366,8 +4366,15 @@ RC DHWHEATER::wh_Init() // init for run if (wh_IsHPWHModel()) rc |= wh_HPWHInit(); // set up from DHWHEATER inputs - else if (wh_type == C_WHTYPECH_INSTUEF) - rc |= wh_InstUEFInit(); // UEF-based instantaneous water heater model 5-2017 + else if (wh_IsInstUEFModel()) + rc |= wh_InstUEFInit(); // UEF-based instantaneous water heater model + + else if (wh_IsTankHXModel()) + rc |= wh_TankHXInit(); // lumped tank with heat exchanger model +#if defined( _DEBUG) + else + ASSERT( 1); // missing case +#endif return rc; } // DHWHEATER::wh_Init @@ -4892,7 +4899,8 @@ RC DHWHEATER::wh_DoSubhrTick( // DHWHEATER energy use for 1 tick if (wh_IsInstUEFModel()) rc |= wh_InstUEFDoSubhrTick(drawForTick, tInletMix, scaleWH, pWS->ws_tUse); - + else if (wh_IsTankHXModel()) + rc |= wh_TankHXDoSubhrTick(drawForTick, tInletMix, scaleWH, pWS->ws_tUse); else { float deltaT = max(1.f, pWS->ws_tUse - tInletMix); @@ -5222,6 +5230,58 @@ RC DHWHEATER::wh_InstUEFDoSubhrTick( } return rc; } // DHWHEATER::wh_InstUEFDoSubhrTick +//----------------------------------------------------------------------------- +RC DHWHEATER::wh_TankHXInit() +{ + RC rc = RCOK; + + + + return rc; + +} // DHWHEATER::wh_TankHXInit +//----------------------------------------------------------------------------- +RC DHWHEATER::wh_TankHXDoSubhrTick( + double draw, // draw for tick, gal (use + DHWLOOP) + float tInletWH, // current water heater inlet temp, F + // includes upstream heat recovery, solar, etc. + // also includes mixed-in DHWLOOP return, if any + [[maybe_unused]] float scaleWH, // draw scale factor + // re DHWSYSs with >1 DHWHEATER + // *not* including hw_fMixUse or hw_fMixRL; + float tUse) // assumed output temp, F + + // returns RCOK iff all OK + +{ + RC rc = RCOK; + +#if 0 + // draw heat equivalent + if (wh_tTank > tUse) + + + float qDraw = (tOut - tInletWH) * draw * heat per gal * subhourDur + + + + // tank losses + + + // tank input + + + // update tank temp + + + // accounting + // DHWSYSRES + // Meters +#endif + + + return rc; +} // DHWHEATER::wh_TankHXDoSubhrTick //============================================================================= From 71a86628c8c49f44428a0477d44b21abf45e70d5 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Mon, 13 Nov 2023 15:01:44 -0500 Subject: [PATCH 2/4] HPWHsim branch heat-exchange-models --- vendor/HPWHsim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/HPWHsim b/vendor/HPWHsim index d20541324..ad7efa0df 160000 --- a/vendor/HPWHsim +++ b/vendor/HPWHsim @@ -1 +1 @@ -Subproject commit d2054132479a920d651a77a733e53de2a24e634b +Subproject commit ad7efa0dfa524e3ec5d159e06374888ef1dd44e8 From 76f76a16fda0e8d324e5c3481776ba8929a84349 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Fri, 17 Nov 2023 15:46:32 -0500 Subject: [PATCH 3/4] Initial AquaThermAire integration --- src/CNDTYPES.DEF | 3 ++- src/CNRECS.DEF | 8 ++----- src/dhwcalc.cpp | 59 ++---------------------------------------------- vendor/HPWHsim | 2 +- 4 files changed, 7 insertions(+), 65 deletions(-) diff --git a/src/CNDTYPES.DEF b/src/CNDTYPES.DEF index 58cdd384b..fa7c2d1e2 100644 --- a/src/CNDTYPES.DEF +++ b/src/CNDTYPES.DEF @@ -400,7 +400,6 @@ PIPESEGP -- "class PIPESEG*" INSTSML "SmallInstantaneous" INSTLRG "LargeInstantaneous" INSTUEF "InstantaneousUEF" - TANKHX "TankHX" BUILTUP "BuiltUp" } *choicb WHASHPTYCH { // comments from Ecotope, see hphw.hh @@ -462,6 +461,8 @@ PIPESEGP -- "class PIPESEG*" AOSMITHSHPT66 "AOSmithSHPT66" AOSMITHSHPT80 "AOSmithSHPT80" + AQUATHERMAIRE "AquaThermAire" // Villara AquaThermAire system + GENERIC1 "GenericTier1" // Generic Tier 1 GENERIC2 "GenericTier2" // Generic Tier 2 GENERIC3 "GenericTier3" // Generic Tier 3 diff --git a/src/CNRECS.DEF b/src/CNRECS.DEF index 1b6435ea3..477442c97 100644 --- a/src/CNRECS.DEF +++ b/src/CNRECS.DEF @@ -4574,9 +4574,8 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater *declare "bool wh_CanHaveLoopReturn() const { return wh_IsHPWHModel(); }" *declare "bool wh_CanHaveDHWLOOPHEATER() const { return wh_IsPrimary() && wh_IsHPWHModel(); }" *declare "bool wh_IsInstUEFModel() const { return wh_type==C_WHTYPECH_INSTUEF; }" - *declare "bool wh_IsTankHXModel() const { return wh_type == C_WHTYPECH_TANKHX; }" - *declare "bool wh_IsSubhrModel() const { return wh_IsHPWHModel() || wh_IsInstUEFModel() || wh_IsTankHXModel(); }" - *declare "bool wh_UsesTSetpoint() const { return wh_IsHPWHModel() || wh_IsTankHXModel(); }" + *declare "bool wh_IsSubhrModel() const { return wh_IsHPWHModel() || wh_IsInstUEFModel(); }" + *declare "bool wh_UsesTSetpoint() const { return wh_IsHPWHModel(); }" *declare "float wh_CalcLDEF( float arl, int options=0);" *declare "RC wh_SetupAsCHDHWSource();" *declare "RC wh_DoHour();" @@ -4584,8 +4583,6 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater *declare "RC wh_DoSubhrTick( struct DHWTICK& tk, float scaleWH, float tInlet, float& tOutlet);" *declare "RC wh_InstUEFInit();" *declare "RC wh_InstUEFDoSubhrTick( double draw, float tInletWH, float scaleWH, float tUse);" - *declare "RC wh_TankHXInit();" - *declare "RC wh_TankHXDoSubhrTick( double draw, float tInletWH, float scaleWH, float tUse);" *declare "RC wh_DoSubhrEnd( bool bIsLH);" *declare "RC wh_DoEndPreRun();" *declare "RC wh_EndIvl( IVLCH ivl, float HARL, float wsMult);" @@ -4723,7 +4720,6 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater *s *e *nest HPWHLINK wh_HPWH; // interface to Ecotope HPWH detailed heat pump model // also used for resistance electric heaters - *s *e FLOAT wh_tTank; // tank temperature for TankHX model, F *s *e FLOAT wh_qXBU; // current step HPWH add'l backup resistance heat, Btu // output water heated to ws_tUse iff HPWH output temp < ws_tUse *s *e DBL wh_qEnv; // current step heat removed by HPWH from environment, Btu diff --git a/src/dhwcalc.cpp b/src/dhwcalc.cpp index 07861c5a7..088ba7ff4 100644 --- a/src/dhwcalc.cpp +++ b/src/dhwcalc.cpp @@ -3069,6 +3069,8 @@ RC HPWHLINK::hw_InitResistance( // set up HPWH has EF-rated resistance heater { C_WHASHPTYCH_AWHSTIER3GENERIC65, hwatSMALL | HPWH::MODELS_AWHSTier3Generic65 }, { C_WHASHPTYCH_AWHSTIER3GENERIC80, hwatSMALL | HPWH::MODELS_AWHSTier3Generic80 }, + { C_WHASHPTYCH_AQUATHERMAIRE, hwatSMALL | HPWH::MODELS_AQUATHERMAIRE }, + // large { C_WHASHPTYCH_SANCO2_GS3, hwatLARGE | HPWH::MODELS_SANCO2_GS3_45HPA_US_SP }, { C_WHASHPTYCH_COLMACCXV5_SP, hwatLARGE | HPWH::MODELS_ColmacCxV_5_SP }, @@ -4369,8 +4371,6 @@ RC DHWHEATER::wh_Init() // init for run else if (wh_IsInstUEFModel()) rc |= wh_InstUEFInit(); // UEF-based instantaneous water heater model - else if (wh_IsTankHXModel()) - rc |= wh_TankHXInit(); // lumped tank with heat exchanger model #if defined( _DEBUG) else ASSERT( 1); // missing case @@ -4899,8 +4899,6 @@ RC DHWHEATER::wh_DoSubhrTick( // DHWHEATER energy use for 1 tick if (wh_IsInstUEFModel()) rc |= wh_InstUEFDoSubhrTick(drawForTick, tInletMix, scaleWH, pWS->ws_tUse); - else if (wh_IsTankHXModel()) - rc |= wh_TankHXDoSubhrTick(drawForTick, tInletMix, scaleWH, pWS->ws_tUse); else { float deltaT = max(1.f, pWS->ws_tUse - tInletMix); @@ -5230,59 +5228,6 @@ RC DHWHEATER::wh_InstUEFDoSubhrTick( } return rc; } // DHWHEATER::wh_InstUEFDoSubhrTick -//----------------------------------------------------------------------------- -RC DHWHEATER::wh_TankHXInit() -{ - RC rc = RCOK; - - - - return rc; - -} // DHWHEATER::wh_TankHXInit -//----------------------------------------------------------------------------- -RC DHWHEATER::wh_TankHXDoSubhrTick( - double draw, // draw for tick, gal (use + DHWLOOP) - float tInletWH, // current water heater inlet temp, F - // includes upstream heat recovery, solar, etc. - // also includes mixed-in DHWLOOP return, if any - [[maybe_unused]] float scaleWH, // draw scale factor - // re DHWSYSs with >1 DHWHEATER - // *not* including hw_fMixUse or hw_fMixRL; - float tUse) // assumed output temp, F - - // returns RCOK iff all OK - -{ - RC rc = RCOK; - -#if 0 - // draw heat equivalent - if (wh_tTank > tUse) - - - float qDraw = (tOut - tInletWH) * draw * heat per gal * subhourDur - - - - // tank losses - - - // tank input - - - // update tank temp - - - // accounting - // DHWSYSRES - // Meters -#endif - - - return rc; -} // DHWHEATER::wh_TankHXDoSubhrTick - //============================================================================= /////////////////////////////////////////////////////////////////////////////// diff --git a/vendor/HPWHsim b/vendor/HPWHsim index ad7efa0df..2fa7021f5 160000 --- a/vendor/HPWHsim +++ b/vendor/HPWHsim @@ -1 +1 @@ -Subproject commit ad7efa0dfa524e3ec5d159e06374888ef1dd44e8 +Subproject commit 2fa7021f5e2ddf8f3a6d586b0ff152c8791dcc19 From 8f193131d0f8954a30d28a833d6c48b0dc443db0 Mon Sep 17 00:00:00 2001 From: Chip Barnaby Date: Mon, 27 Nov 2023 15:24:55 -0500 Subject: [PATCH 4/4] Update HPWHsim --- vendor/HPWHsim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/HPWHsim b/vendor/HPWHsim index 2fa7021f5..92d5edf23 160000 --- a/vendor/HPWHsim +++ b/vendor/HPWHsim @@ -1 +1 @@ -Subproject commit 2fa7021f5e2ddf8f3a6d586b0ff152c8791dcc19 +Subproject commit 92d5edf2393ff8f521121484f6a62082303a8d94