Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/CNRECS.DEF
Original file line number Diff line number Diff line change
Expand Up @@ -4200,9 +4200,10 @@ RECORD DHWSYS "DHWSYS" *RAT // input / runtime DHW system
*i TI ws_centralDHWSYSi // index of central (parent) DHWSYS, 0 if none
// child DHWSYSs specify unit-specfic draws only
// but have no heaters etc
*declare "int ws_HasCentralDHWSYS() const { return ws_centralDHWSYSi > 0; }"
*declare "bool ws_HasCentralDHWSYS() const { return ws_centralDHWSYSi > 0; }"
*declare "DHWSYS* ws_GetCentralDHWSYS() const;"
*declare "int ws_IsCentralDHWSYS() const;"
*declare "bool ws_IsCentralDHWSYS() const;"
*declare "DHWSYS* ws_GetPrimaryDHWSYS() const { return ws_HasCentralDHWSYS() ? ws_GetCentralDHWSYS() : const_cast<DHWSYS*>(this); }"

*i FLOAT_GEZ ws_mult; // multiplier: model as ws_mult identical systems
// fractional values supported
Expand Down
7 changes: 4 additions & 3 deletions src/dhwcalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ DHWSYS* DHWSYS::ws_GetCentralDHWSYS() const
return pWS;
} // DHWSYS::ws_GetCentralDHWSYS
//-----------------------------------------------------------------------------
int DHWSYS::ws_IsCentralDHWSYS() const
bool DHWSYS::ws_IsCentralDHWSYS() const
{ // note: dicey for input records
// ws_childSYSCount is derived in ws_Init() pass 1
#if defined( _DEBUG)
Expand Down Expand Up @@ -1169,8 +1169,9 @@ RC DHWSYS::ws_Init( // init for run (including children)
// total target warmup water waste, gal/day
ws_dayWaste = ws_dayWasteVol + ws_dayWasteBranchVolF * ws_branchTotals.st_vol;

if (!ws_HasDHWDAYUSEDraws())
{ // no DHWDAYUSE (on this or any child): info msgs re draw-related input
if (!ws_GetPrimaryDHWSYS()->ws_HasDHWDAYUSEDraws())
{ // info msgs re draw-related input if no wsDayUse draws
// check for DAYUSE draws in parent iff child, else self
const char* when = "-- there are no wsDayUse draws.";
ignoreN(when, DHWSYS_DAYWASTEVOL, DHWSYS_DAYWASTEBRANCHVOLF, 0);
for (int iEU=1; iEU<NDHWENDUSES; iEU++)
Expand Down
7 changes: 7 additions & 0 deletions test/DHW02.cse
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ DHWSYS "DS0"
wsSDLM = HWSDLM( 1900)
wsParElec = fix($hour+12)%12
wsCalcMode = PRERUN
wsDayWasteVol = 100

DHWHEATER "WH0"
whHeatSrc = Fuel
Expand Down Expand Up @@ -117,6 +118,12 @@ DHWSYS "DS1"

endDHWSYS

DHWSYS DS2
wsCentralDHWSYS = "DS1"
wsUse = 0
wsDayWasteBranchVolF = 1


// DHW report definitions

// DHWSYS
Expand Down
61 changes: 50 additions & 11 deletions test/ref-win32-msvc/dhw02.rep
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@


Error Messages for Run 001:

---------------
DHW02.CSE(38): Info:
DHWSYS 'DS0': 'wsDayWasteVol' is ignored -- there are no wsDayUse draws.
---------------



! Log for Run 001:

! CSE 0.920.0+main.99c64c5b.17 for Win32 console
! CSE 0.923.0+dhw-message-tweak.937e80d9.1.dirty for Win32 console



Expand Down Expand Up @@ -54,6 +63,7 @@ Input for Run 001:
wsSDLM = HWSDLM( 1900)
wsParElec = fix($hour+12)%12
wsCalcMode = PRERUN
wsDayWasteVol = 100

DHWHEATER "WH0"
whHeatSrc = Fuel
Expand All @@ -68,6 +78,18 @@ Input for Run 001:



Error Messages for Run 002:

---------------
DHW02.CSE(38): Info:
DHWSYS 'DS0': 'wsDayWasteVol' is ignored -- there are no wsDayUse draws.
---------------
DHW02.CSE(121): Info: DHWSYS 'DS2':
'wsDayWasteBranchVolF' is ignored -- there are no wsDayUse draws.
---------------



Weather for Apr

Day DOY Tavg31 tMains
Expand Down Expand Up @@ -1080,14 +1102,18 @@ Br1 for Wed 01-Apr

! Log for Run 002:

! CSE 0.920.0+main.99c64c5b.17 for Win32 console
! CSE 0.923.0+dhw-message-tweak.937e80d9.1.dirty for Win32 console



Input for Run 001:


METER Elec1
-----------------------
??? DHW02.CSE(38): Info:
??? DHWSYS 'DS0': 'wsDayWasteVol' is ignored -- there are no wsDayUse draws.
-----------------------
METER Fuel1

# #define NUnitB 1 // units per branch
Expand Down Expand Up @@ -1148,6 +1174,12 @@ Input for Run 001:

endDHWSYS

DHWSYS DS2
wsCentralDHWSYS = "DS1"
wsUse = 0
wsDayWasteBranchVolF = 1


// DHW report definitions

// DHWSYS
Expand Down Expand Up @@ -1314,21 +1346,28 @@ Input for Run 001:



-----------------------
??? DHW02.CSE(38): Info:
??? DHWSYS 'DS0': 'wsDayWasteVol' is ignored -- there are no wsDayUse draws.
-----------------------
??? DHW02.CSE(121): Info: DHWSYS 'DS2':
??? 'wsDayWasteBranchVolF' is ignored -- there are no wsDayUse draws.
-----------------------



! CSE 0.920.0+main.99c64c5b.17 for Win32 console run(s) done: Mon 18-Dec-23 4:17:50 pm
! CSE 0.923.0+dhw-message-tweak.937e80d9.1.dirty for Win32 console run(s) done: Thu 09-Jan-25 4:3 pm

! Executable: d:\cse\msvc\cse.exe
! 18-Dec-23 4:07 pm (VS 14.29 2796544 bytes) (HPWH 1.22.0+HEAD.f9b8f77.122)
! Command line: -x! -b -t1 dhw02
! Input file: D:\cse\test\dhw02.cse
! Executable: d:\cse\builds\cse.exe
! 09-Jan-25 4:3 pm (VS 14.29 2941952 bytes) (HPWH 1.24.0)
! Command line: -x! -t1 DHW02
! Input file: D:\cse\test\DHW02.cse
! Report file: D:\CSE\TEST\DHW02.REP

! Timing info --

! Input: Time = 0.11 Calls = 2 T/C = 0.0540
! Input: Time = 0.09 Calls = 2 T/C = 0.0465
! AutoSizing: Time = 0.00 Calls = 0 T/C = 0.0000
! Simulation: Time = 1.62 Calls = 2 T/C = 0.8090
! Reports: Time = 0.00 Calls = 2 T/C = 0.0020
! Total: Time = 1.73 Calls = 1 T/C = 1.7300
! Simulation: Time = 1.41 Calls = 2 T/C = 0.7055
! Reports: Time = 0.00 Calls = 2 T/C = 0.0015
! Total: Time = 1.51 Calls = 1 T/C = 1.5130
Loading