Skip to content

Commit 5c0d18c

Browse files
authored
Merge pull request #523 from cse-sim/dhw-message-tweak
Eliminate spurious 'ignore' message for non-central DHWSYS
2 parents 0f5ce40 + 3675c72 commit 5c0d18c

File tree

4 files changed

+64
-16
lines changed

4 files changed

+64
-16
lines changed

src/CNRECS.DEF

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4200,9 +4200,10 @@ RECORD DHWSYS "DHWSYS" *RAT // input / runtime DHW system
42004200
*i TI ws_centralDHWSYSi // index of central (parent) DHWSYS, 0 if none
42014201
// child DHWSYSs specify unit-specfic draws only
42024202
// but have no heaters etc
4203-
*declare "int ws_HasCentralDHWSYS() const { return ws_centralDHWSYSi > 0; }"
4203+
*declare "bool ws_HasCentralDHWSYS() const { return ws_centralDHWSYSi > 0; }"
42044204
*declare "DHWSYS* ws_GetCentralDHWSYS() const;"
4205-
*declare "int ws_IsCentralDHWSYS() const;"
4205+
*declare "bool ws_IsCentralDHWSYS() const;"
4206+
*declare "DHWSYS* ws_GetPrimaryDHWSYS() const { return ws_HasCentralDHWSYS() ? ws_GetCentralDHWSYS() : const_cast<DHWSYS*>(this); }"
42064207

42074208
*i FLOAT_GEZ ws_mult; // multiplier: model as ws_mult identical systems
42084209
// fractional values supported

src/dhwcalc.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ DHWSYS* DHWSYS::ws_GetCentralDHWSYS() const
828828
return pWS;
829829
} // DHWSYS::ws_GetCentralDHWSYS
830830
//-----------------------------------------------------------------------------
831-
int DHWSYS::ws_IsCentralDHWSYS() const
831+
bool DHWSYS::ws_IsCentralDHWSYS() const
832832
{ // note: dicey for input records
833833
// ws_childSYSCount is derived in ws_Init() pass 1
834834
#if defined( _DEBUG)
@@ -1169,8 +1169,9 @@ RC DHWSYS::ws_Init( // init for run (including children)
11691169
// total target warmup water waste, gal/day
11701170
ws_dayWaste = ws_dayWasteVol + ws_dayWasteBranchVolF * ws_branchTotals.st_vol;
11711171

1172-
if (!ws_HasDHWDAYUSEDraws())
1173-
{ // no DHWDAYUSE (on this or any child): info msgs re draw-related input
1172+
if (!ws_GetPrimaryDHWSYS()->ws_HasDHWDAYUSEDraws())
1173+
{ // info msgs re draw-related input if no wsDayUse draws
1174+
// check for DAYUSE draws in parent iff child, else self
11741175
const char* when = "-- there are no wsDayUse draws.";
11751176
ignoreN(when, DHWSYS_DAYWASTEVOL, DHWSYS_DAYWASTEBRANCHVOLF, 0);
11761177
for (int iEU=1; iEU<NDHWENDUSES; iEU++)

test/DHW02.cse

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ DHWSYS "DS0"
4444
wsSDLM = HWSDLM( 1900)
4545
wsParElec = fix($hour+12)%12
4646
wsCalcMode = PRERUN
47+
wsDayWasteVol = 100
4748

4849
DHWHEATER "WH0"
4950
whHeatSrc = Fuel
@@ -117,6 +118,12 @@ DHWSYS "DS1"
117118

118119
endDHWSYS
119120

121+
DHWSYS DS2
122+
wsCentralDHWSYS = "DS1"
123+
wsUse = 0
124+
wsDayWasteBranchVolF = 1
125+
126+
120127
// DHW report definitions
121128

122129
// DHWSYS

test/ref-win32-msvc/dhw02.rep

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11

22

3+
Error Messages for Run 001:
4+
5+
---------------
6+
DHW02.CSE(38): Info:
7+
DHWSYS 'DS0': 'wsDayWasteVol' is ignored -- there are no wsDayUse draws.
8+
---------------
9+
10+
11+
312
! Log for Run 001:
413

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

716

817

@@ -54,6 +63,7 @@ Input for Run 001:
5463
wsSDLM = HWSDLM( 1900)
5564
wsParElec = fix($hour+12)%12
5665
wsCalcMode = PRERUN
66+
wsDayWasteVol = 100
5767

5868
DHWHEATER "WH0"
5969
whHeatSrc = Fuel
@@ -68,6 +78,18 @@ Input for Run 001:
6878

6979

7080

81+
Error Messages for Run 002:
82+
83+
---------------
84+
DHW02.CSE(38): Info:
85+
DHWSYS 'DS0': 'wsDayWasteVol' is ignored -- there are no wsDayUse draws.
86+
---------------
87+
DHW02.CSE(121): Info: DHWSYS 'DS2':
88+
'wsDayWasteBranchVolF' is ignored -- there are no wsDayUse draws.
89+
---------------
90+
91+
92+
7193
Weather for Apr
7294

7395
Day DOY Tavg31 tMains
@@ -1080,14 +1102,18 @@ Br1 for Wed 01-Apr
10801102

10811103
! Log for Run 002:
10821104

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

10851107

10861108

10871109
Input for Run 001:
10881110

10891111

10901112
METER Elec1
1113+
-----------------------
1114+
??? DHW02.CSE(38): Info:
1115+
??? DHWSYS 'DS0': 'wsDayWasteVol' is ignored -- there are no wsDayUse draws.
1116+
-----------------------
10911117
METER Fuel1
10921118

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

11491175
endDHWSYS
11501176

1177+
DHWSYS DS2
1178+
wsCentralDHWSYS = "DS1"
1179+
wsUse = 0
1180+
wsDayWasteBranchVolF = 1
1181+
1182+
11511183
// DHW report definitions
11521184

11531185
// DHWSYS
@@ -1314,21 +1346,28 @@ Input for Run 001:
13141346

13151347

13161348

1349+
-----------------------
1350+
??? DHW02.CSE(38): Info:
1351+
??? DHWSYS 'DS0': 'wsDayWasteVol' is ignored -- there are no wsDayUse draws.
1352+
-----------------------
1353+
??? DHW02.CSE(121): Info: DHWSYS 'DS2':
1354+
??? 'wsDayWasteBranchVolF' is ignored -- there are no wsDayUse draws.
1355+
-----------------------
13171356

13181357

13191358

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

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

13281367
! Timing info --
13291368

1330-
! Input: Time = 0.11 Calls = 2 T/C = 0.0540
1369+
! Input: Time = 0.09 Calls = 2 T/C = 0.0465
13311370
! AutoSizing: Time = 0.00 Calls = 0 T/C = 0.0000
1332-
! Simulation: Time = 1.62 Calls = 2 T/C = 0.8090
1333-
! Reports: Time = 0.00 Calls = 2 T/C = 0.0020
1334-
! Total: Time = 1.73 Calls = 1 T/C = 1.7300
1371+
! Simulation: Time = 1.41 Calls = 2 T/C = 0.7055
1372+
! Reports: Time = 0.00 Calls = 2 T/C = 0.0015
1373+
! Total: Time = 1.51 Calls = 1 T/C = 1.5130

0 commit comments

Comments
 (0)