@@ -3507,14 +3507,15 @@ RECORD DHWSYSRES_IVL "DHWSYSRES interval sub" *SUBSTRUCT // interval substruct
35073507 *declare "void wsr_AccumTick( const struct DHWTICK& tk);"
35083508 *declare "static const size_t wsr_NFLOAT;"
35093509
3510- // water heating energy (not fuel)
3510+ // water heating energy (not fuel), Btu
3511+ // values are for associated DHWSYS (wh_mult include, ws_mult not included)
35113512 *e FLOAT total //
35123513 *e FLOAT qDWHR // drain water heat recovery
35133514 *e FLOAT qSSF // implied energy contribution from ws_SSF
35143515 *e FLOAT qSolar // DHWSOLARSYS
3515- *e FLOAT qWaterHeater // DHWHEATER
3516- *e FLOAT qLoopHeater
3517- *e FLOAT qXBU
3516+ *e FLOAT qWH // DHWHEATER primary (compressor, burner, )
3517+ *e FLOAT qLH // Loop heater primary
3518+ *e FLOAT qXBU // add'l backup heat
35183519
35193520*END // DHWSYSRES_IVL
35203521//=============================================================================
@@ -3610,7 +3611,7 @@ RECORD DHWSYS "DHWSys" *RAT // input / runtime DHW system
36103611
36113612 *h *e FLOAT ws_tInlet; // current hour cold water inlet temp, F for this DHWSYS
36123613 // user expression or default Wthr.d.wd_tMains
3613- // Not modified by DWHR or Solar
3614+ // Not modified by solar and/ or DHWHEATREC
36143615 *h *e FLOAT ws_tInletX; // hour average adjusted cold water temp, F
36153616 // reflects solar and/or DHWHEATREC
36163617 *h FLOAT ws_hwUse; // current hour hot water use (at fixtures), gal
@@ -3660,6 +3661,12 @@ RECORD DHWSYS "DHWSys" *RAT // input / runtime DHW system
36603661 // default = ws_tUse
36613662 *h FLOAT ws_tSetpointLH; // DHWLOOPHEATER set point (for all child DHWLOOPHEATERs using HPWH model), F
36623663 // default = ws_tUse
3664+ *r DHWDRMETH ws_drMethod // DHW demand response control method
3665+ // C_DHWDRMETH_NONE, C_DHWDRMETH_SCHED,
3666+ *h DHWDRSIG ws_drSignal; // DHW demand response control signal
3667+ *h *e INT ws_drModeHPWH; // DHW demand response HPWHsim base mode for hour
3668+ // may be modified at subhour or tick ivl
3669+
36633670 *s *hide DBL ws_tOutPrimSum; // working var re ws_tOutPrimLT
36643671 *s *e FLOAT ws_tOutPrimLT; // primary water heater outlet temp, F
36653672 // for HPWH only, re DHWLOOPHEATER entering temp
@@ -3789,11 +3796,6 @@ RECORD DHWSYS "DHWSys" *RAT // input / runtime DHW system
37893796 *h *e FLOAT ws_HARL; // hour total adjusted recovery load, Btu
37903797 *h *e FLOAT ws_HARLtk; // hour total adjusted recovery load, Btu
37913798 // check figure derived from ticks
3792-
3793- #if 0
3794- *s *e *nest DHWSYSRES ws_res // results
3795- #endif
3796-
37973799*END // DHWSYS
37983800
37993801//=============================================================================
@@ -3828,9 +3830,9 @@ RECORD HPWHLINK "HPWHLink" *SUBSTRUCT // Ecotope's HPWH tank and heater
38283830*declare "void hw_SetQTX( float qTX);"
38293831*declare "RC hw_DoHour( float& tSetpoint);"
38303832*declare "RC hw_DoSubhrStart( float tEx, float tASHPSrc=-999.f);"
3831- *declare "RC hw_DoSubhrTick( DHWTICK& tk, float tInlet, float scaleWH=1.f, float tMix=-1., float tMains=-1.f, float* pTOutNoMix=NULL);"
3833+ *declare "RC hw_DoSubhrTick( DHWTICK& tk, float tInlet, float scaleWH=1.f, float tMix=-1., float tMains=-1.f, float* pTOutNoMix=NULL, int drMode=0 );"
38323834*declare "RC hw_DoSubhrTick( int iTk, float draw, float tInlet, float* pTOut, float scaleWH=1.f);"
3833- *declare "RC hw_DoSubhrEnd( float mult, ZNR* pZn, ZNR* pZnASHPSrc, double& totOut );"
3835+ *declare "RC hw_DoSubhrEnd( float mult, ZNR* pZn, ZNR* pZnASHPSrc);"
38343836
38353837*declare "record* hw_pOwner;" // owner (DHWHEATER, DHWSOLARSYS, ...)
38363838*declare "class HPWH* hw_pHPWH;" // pointer HPWH object
@@ -3855,7 +3857,7 @@ RECORD HPWHLINK "HPWHLink" *SUBSTRUCT // Ecotope's HPWH tank and heater
38553857 // Loop return flow is reduced to balance load at ws_tUse.
38563858
38573859*s *e *array 2 DBL hw_inElec; // current subhr HPWH electricity use, kWh
3858- // [0]=resistance backup (iff HP) (not including wh_HPWHxBU )
3860+ // [0]=resistance backup (iff HP) (not including hw_HPWHxBU )
38593861 // [1]=primary(=compressor or non-HP resistance) + misc
38603862*r FLOAT hw_HPWHxBU; // current subhr HPWH add'l backup resistance heat, Btu
38613863 // output water heated to ws_tUse iff HPWH output temp < ws_tUse
@@ -3865,7 +3867,7 @@ RECORD HPWHLINK "HPWHLink" *SUBSTRUCT // Ecotope's HPWH tank and heater
38653867 // for 1 DHWHEATER (no wh_mult)
38663868*s *e DBL hw_qHW; // current subhr HPWHtotal hot water heating, kWh. always >= 0
38673869 // for 1 DHWHEATER (no wh_mult)
3868- // includes heat to DHWLOOP, does not include wh_HPWHxBU
3870+ // includes heat to DHWLOOP, does not include hw_HPWHxBU
38693871*s *e DBL hw_qTX; // current subhr extra heat tank heat, kWh (not Btu)
38703872
38713873*h *e INT hw_tankTempSet; // nz iff HPWH tank temp has been initialized
@@ -3912,13 +3914,15 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater
39123914 *declare "RC wh_DoSubhrTick( struct DHWTICK& tk, float scaleWH);"
39133915 *declare "RC wh_InstUEFInit();"
39143916 *declare "RC wh_InstUEFDoSubhrTick( double draw, float tInletWH, float scaleWH, float tUse);"
3915- *declare "RC wh_DoSubhrEnd();"
3917+ *declare "RC wh_DoSubhrEnd( bool bIsLH );"
39163918 *declare "RC wh_DoEndPreRun();"
39173919 *declare "RC wh_EndIvl( IVLCH ivl, float HARL, float wsMult);"
39183920 *declare "static WStr wh_GetHPWHVersion();"
39193921 *declare "int wh_ReportBalErrorsIf() const;"
39203922 *declare "virtual void ReceiveRuntimeMessage( const char* msg);"
39213923 *declare "RC wh_HPWHInit();"
3924+ *declare "static void wh_DRMapValidate();"
3925+ *declare "static int wh_DRMapSigToDRMode( DHWDRSIG drSig);"
39223926
39233927 *r FLOAT_GEZ wh_mult; // count of identical water heaters (default 1)
39243928 // models as if repeated identical input
@@ -3931,7 +3935,7 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater
39313935 // _ELRESX: electric resistance (Ecotope HPWH)
39323936 *i WHTYPECH wh_type; // heater type
39333937 // C_WHTYPECH_STRGSML, _STRGLRG, _INSTSML, _INSTLRG,
3934- // _INSTUEF
3938+ // _INSTUEF, _BUILTUP
39353939 *i ANAME wh_desc; // probe-able description text
39363940 *declare "virtual const char* GetDescription( int options=0) { options; return wh_desc; }"
39373941 *r INT wh_fcn; // function of this DHWHEATER per whfcnXXX enum
@@ -4003,7 +4007,7 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater
40034007 // load that is unmet on 1 min basis
40044008 // default = 1; only for C_WHTYPECH_INSTUEF
40054009 *i DBL wh_loadCFwdMax; // max load carry-forward energy (from wh_loadCFwdF), Btu
4006- // any excess load met via wh_HPWHxBU
4010+ // any excess load met via wh_qXBU
40074011 *s DBL wh_loadCFwd; // current load carry forward, Btu
40084012 // see wh_InstUEFDoSubhr()
40094013 *s *e FLOAT wh_nTickFullLoad; // INSTUEF: current subhour equiv full load ticks (fractional)
@@ -4028,15 +4032,15 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater
40284032 *s *e *nest HPWHLINK wh_HPWH; // interface to Ecotope HPWH detailed heat pump model
40294033 // also used for resistance electric heaters
40304034
4031- *s *e FLOAT wh_HPWHxBU; // current step HPWH add'l backup resistance heat, Btu
4035+ *s *e FLOAT wh_qXBU; // current step HPWH add'l backup resistance heat, Btu
40324036 // output water heated to ws_tUse iff HPWH output temp < ws_tUse
40334037 *s *e DBL wh_qEnv; // current step heat removed by HPWH from environment, kWh
40344038 // + = to water heater; for 1 DHWHEATER (no wh_mult)
40354039 *s *e DBL wh_qLoss; // current step HPWH standby losses, kWh. + = to surround
40364040 // for 1 DHWHEATER (no wh_mult)
4037- *s *e DBL wh_qHW; // current step HPWHtotal hot water heating, kWh. always >= 0
4041+ *s *e float wh_qHW; // current step hot water heating, kWh. always >= 0
40384042 // for 1 DHWHEATER (no wh_mult)
4039- // includes heat to DHWLOOP, does not include wh_HPWHxBU
4043+ // includes heat to DHWLOOP, does not include wh_qXBU
40404044 *s *e INT wh_nzDrawCount; // current substep # of draws > 0
40414045
40424046 *h *e INT wh_bWriteCSV; // write HPWH debugging CSV iff nz
@@ -4050,7 +4054,7 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater
40504054 *h *e INT wh_hrCount; // # of hourly values included in wh_totHARL
40514055 // re calc of avg
40524056 *h *e DBL wh_totOut; // cumulative (year to date) total heat delivered to hot water, Btu
4053- // includes wh_HPWHxBU
4057+ // includes wh_qXBU
40544058
40554059
40564060 // energy inputs for current subhour, Btu
@@ -4059,8 +4063,8 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater
40594063 *s *e FLOAT wh_inElecSh; // primary electricity (including wh_parElec) (note not kWh)
40604064 // for HPWH, includes compressor + misc (not resistance)
40614065 *s *e FLOAT wh_inElecBUSh; // backup electricity (>0 only for HPWH resistance heat)
4062- // (includes wh_HPWHxBU )
4063- *s *e FLOAT wh_inElecXBUSh; // "extra" backup (reheating to maintain ws_tUse)
4066+ // (does not include wh_inElecXBUSh )
4067+ *s *e FLOAT wh_inElecXBUSh; // XBU "extra" backup (reheating to maintain ws_tUse)
40644068 *s *e FLOAT wh_inFuelSh; // fuel (including wh_pilotPwr)
40654069
40664070
@@ -4070,8 +4074,8 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater
40704074 *h *e FLOAT wh_inElec; // primary electricity (including wh_parElec) (note not kWh)
40714075 // for HPWH, includes compressor + misc (not resistance)
40724076 *h *e FLOAT wh_inElecBU; // backup electricity (>0 only for HPWH resistance heat)
4073- // (includes wh_HPWHxBU )
4074- *h *e FLOAT wh_inElecXBU; // "extra" backup (reheating to maintain ws_tUse)
4077+ // (does not include wh_inElecXBU )
4078+ *h *e FLOAT wh_inElecXBU; // XBU "extra" backup (reheating to maintain ws_tUse)
40754079 *h *e FLOAT wh_inFuel; // fuel (including wh_pilotPwr)
40764080
40774081 // annual total energy inputs, Btu (check figures)
@@ -4084,6 +4088,8 @@ RECORD DHWHEATER "DHWHeater" *RAT // input / runtime DHW heater
40844088 // default = none (include wh_HPWHxBU in end use dhwBU)
40854089 *declare "MTR* wh_pMtrElec; MTR* wh_pMtrFuel;"
40864090 // runtime pointers to meters, NULL if not accum'ing
4091+ *declare "DHWSYSRES_IVL* wh_pResSh;" // pointer to DHWSYSRES subhour record
4092+ // re heat output accounting
40874093
40884094 *h *e INT wh_unMetSh; // count of subhrs in this hour
40894095 // when wh_tHWOut < wh_tUse
0 commit comments